@preventive/triage 1.0.0-alpha.70 → 1.0.0-alpha.72

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.
Files changed (47) hide show
  1. package/common/managed/directory-packages.ts +28 -0
  2. package/out/activity.js +4 -4
  3. package/out/{chunk-GTMTGYPT.js → chunk-27Y75UQR.js} +1 -1
  4. package/out/chunk-4LZK6C6N.js +11 -0
  5. package/out/chunk-4XSH6ZLT.js +1 -0
  6. package/out/{chunk-QPGM3DTI.js → chunk-7CHIFYQW.js} +1 -1
  7. package/out/chunk-7YFJUT2P.js +1 -0
  8. package/out/chunk-CZ3U2LI4.js +2 -0
  9. package/out/chunk-ETL5ZPPR.js +259 -0
  10. package/out/{chunk-45J7357T.js → chunk-L6VIWL2Y.js} +1 -1
  11. package/out/{chunk-MPXVKVPF.js → chunk-OSHR3N4S.js} +1 -1
  12. package/out/chunk-PQPKHAI5.js +15 -0
  13. package/out/chunk-UD33S2MG.js +52 -0
  14. package/out/{chunk-GZ46SSTF.js → chunk-WKFBZYJX.js} +1 -1
  15. package/out/client-managed.js +28 -27
  16. package/out/compare.js +13 -15
  17. package/out/dialogs.js +28 -28
  18. package/out/graph.js +1 -1
  19. package/out/index.html +6 -6
  20. package/out/scan.js +2 -2
  21. package/out/terminal.js +1 -1
  22. package/out/view.css +1 -1
  23. package/out/view.js +11 -11
  24. package/package.json +3 -1
  25. package/risk/actions/resolve.js +9 -3
  26. package/risk/files/characters.js +11 -0
  27. package/risk/files/source-map-link.js +43 -0
  28. package/risk/npm/compare.js +4 -26
  29. package/server-managed/bundle-advisory-inventory.ts +9 -1
  30. package/server-managed/bundle-build-worker.js +5 -2
  31. package/server-managed/bundle-cache.ts +1 -1
  32. package/server-managed/bundle-dependency-reviews.ts +11 -4
  33. package/server-managed/http.ts +111 -57
  34. package/server-managed/locked-packages.ts +9 -4
  35. package/server-managed/npm-delta.ts +16 -1
  36. package/server-managed/npm-kept.ts +6 -0
  37. package/server-managed/pull-dependencies.ts +5 -2
  38. package/server-managed/pull-dependency-reviews.ts +22 -8
  39. package/server-managed/repository-issues.ts +15 -9
  40. package/server-managed/stasis-dependencies.ts +7 -4
  41. package/out/chunk-2HGKTQ5Q.js +0 -52
  42. package/out/chunk-7GJNLCXF.js +0 -15
  43. package/out/chunk-CGRIZ5M5.js +0 -1
  44. package/out/chunk-D6NVKGGG.js +0 -10
  45. package/out/chunk-MQ4HT75S.js +0 -247
  46. package/out/chunk-NB4JBTKK.js +0 -2
  47. package/out/chunk-VFWMQ3LG.js +0 -2
@@ -1,4 +1,4 @@
1
- import{Db as e,Eb as t,Fb as n,Hb as r,Ib as i,Jb as a,Ob as o,dc as s,jc as c,w as l}from"./chunk-MQ4HT75S.js";import{k as u,l as d}from"./chunk-QPGM3DTI.js";import{e as f,f as p,g as m,j as h}from"./chunk-QRKFPLA4.js";import{c as g}from"./chunk-2XUEZHIP.js";var _=`.md-quote,.md-alert{margin:0;&:not(:first-child),+*{margin-top:.5lh}>:first-child{margin-top:0}>:last-child{margin-bottom:0}}.md-quote{padding-inline-start:.85em;border-inline-start:.25em solid rgb(from currentcolor r g b / .3);color:rgb(from currentcolor r g b / calc(alpha*.78));.md-quote{color:inherit}}.md-alert{--md-alert: var(--info);padding:.35lh .85em;border-inline-start:.25em solid var(--md-alert);background:rgb(from var(--md-alert) r g b / .06);border-radius:0 var(--ui-radius, 4px) var(--ui-radius, 4px) 0}.md-alert-tip{--md-alert: var(--green)}.md-alert-important{--md-alert: var(--purple)}.md-alert-warning{--md-alert: var(--warning)}.md-alert-caution{--md-alert: var(--critical)}.md-alert-title{display:flex;align-items:center;gap:.45em;margin-bottom:.2lh;color:var(--md-alert);font-weight:600}.md-alert-icon{flex:none;width:1.05em;height:1.05em}
1
+ import{Cb as e,Db as t,Eb as n,Gb as r,Hb as i,Ib as a,Nb as o,cc as s,ic as c,w as l}from"./chunk-ETL5ZPPR.js";import{k as u,l as d}from"./chunk-7CHIFYQW.js";import{e as f,f as p,g as m,j as h}from"./chunk-QRKFPLA4.js";import{c as g}from"./chunk-2XUEZHIP.js";var _=`.md-quote,.md-alert{margin:0;&:not(:first-child),+*{margin-top:.5lh}>:first-child{margin-top:0}>:last-child{margin-bottom:0}}.md-quote{padding-inline-start:.85em;border-inline-start:.25em solid rgb(from currentcolor r g b / .3);color:rgb(from currentcolor r g b / calc(alpha*.78));.md-quote{color:inherit}}.md-alert{--md-alert: var(--info);padding:.35lh .85em;border-inline-start:.25em solid var(--md-alert);background:rgb(from var(--md-alert) r g b / .06);border-radius:0 var(--ui-radius, 4px) var(--ui-radius, 4px) 0}.md-alert-tip{--md-alert: var(--green)}.md-alert-important{--md-alert: var(--purple)}.md-alert-warning{--md-alert: var(--warning)}.md-alert-caution{--md-alert: var(--critical)}.md-alert-title{display:flex;align-items:center;gap:.45em;margin-bottom:.2lh;color:var(--md-alert);font-weight:600}.md-alert-icon{flex:none;width:1.05em;height:1.05em}
2
2
  `,v=`.token.comment,.token.prolog,.token.cdata{color:var(--code-comment);font-style:italic}.token.punctuation{color:var(--muted)}.token.string,.token.attr-value,.token.char,.token.regex{color:var(--code-string)}.token.number,.token.boolean,.token.constant,.token.symbol{color:var(--code-number)}.token.keyword,.token.builtin,.token.important,.token.atrule{color:var(--code-keyword)}.token.function,.token.class-name,.token.tag{color:var(--code-function)}.token.operator,.token.entity,.token.url,.token.attr-name,.token.selector{color:var(--code-operator)}.token.variable,.token.property,.token.parameter{color:var(--code-variable)}.token.annotation{color:var(--code-function)}.token.deleted{color:var(--code-deleted)}.token.inserted{color:var(--code-inserted)}.token.italic{font-style:italic}.token.bold{font-weight:700}.code-control{padding:0 .3em;margin:0 .1em;border-radius:3px;font-size:.8em;line-height:0;font-style:normal;font-weight:400;color:var(--warning);background:rgb(from var(--warning) r g b / .14);box-shadow:inset 0 0 0 1px rgb(from var(--warning) r g b / .45);white-space:nowrap;user-select:none}
3
3
  `,y=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`,b=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.8" y="5" width="20.4" height="14" rx="2"/><path d="M5.6 15.6V8.4l3.1 3.6 3.1-3.6v7.2"/><path d="M16.9 8.4v7.2m-2.6-2.9 2.6 2.9 2.6-2.9"/></svg>`,x=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M6 9V2h12v7"/><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><rect x="6" y="14" width="12" height="8"/></svg>`;function S(e,t){let n=u.find(t=>t.value===e)?.label??e;return d(e)?.includes(`partial`)?t===`exclude`?`${n} (full only)`:t===`only`?`${n} (partial only)`:n:n}function C(e){return h.filter(t=>e.has(t)).map(e=>f[e]??e).join(`, `)}function w(r=l){let i=[];if(r.filterSeverities.size>0&&i.push({key:`severity`,label:`Severity`,value:C(r.filterSeverities),clear:{filterSeverities:new Set}}),r.filterColors.size>0&&i.push({key:`marks`,label:`Marks`,value:[...r.filterColors].map(e=>m[e]??e).join(`, `),clear:{filterColors:new Set}}),r.filterSources.size===1&&i.push({key:`source`,label:`Source`,value:r.filterSources.has(`own`)?`Sources only`:`Dependencies only`,clear:{filterSources:new Set}}),r.filterAnalyzer&&i.push({key:`analyzer`,label:`Analyzer`,value:r.filterAnalyzer===e?`(none)`:r.filterAnalyzer,clear:{filterAnalyzer:``}}),r.filterModel&&i.push({key:`model`,label:`Model`,value:r.filterModel===n?`(none)`:r.filterModel,clear:{filterModel:``}}),r.filterValidationModel&&i.push({key:`validationModel`,label:`Validation model`,value:r.filterValidationModel===n?`(none)`:r.filterValidationModel,clear:{filterValidationModel:``}}),r.filterRepo&&i.push({key:`repo`,label:`Repository`,value:r.filterRepo===t?`(no repo)`:r.filterRepo,clear:{filterRepo:``}}),d(r.filterRevalidate)&&i.push({key:`revalidate`,label:`Revalidation`,value:S(r.filterRevalidate,r.filterPartial),clear:{filterRevalidate:``,filterPartial:``}}),!r.filterRevalidate&&(r.filterConfMin>0||r.filterConfMax<10)){let e;e=r.filterConfMin>0&&r.filterConfMax<10?`${r.filterConfMin}\u2013${r.filterConfMax}`:r.filterConfMin>0?`\u2265 ${r.filterConfMin}`:`\u2264 ${r.filterConfMax}`,i.push({key:`confidence`,label:`Confidence`,value:e,clear:{filterConfMin:0,filterConfMax:10}})}r.filterInclude&&i.push({key:`search`,label:r.filterIncludeNegate?`Excluding`:`Search`,value:`"${r.filterInclude}"`,clear:{filterInclude:``,filterIncludeNegate:!1}});for(let[e,t]of[[`filterComment`,`comment`],[`filterIssue`,`issue`],[`filterFix`,`fix`],[`filterFlagged`,`flag`]]){let n=r[e];n&&i.push({key:`annotation:${t}`,label:`Annotation`,value:`${n===`with`?`With`:`Without`} ${t}`,clear:{[e]:``}})}return!l.currentWorkspace&&r.filterDuplicates&&i.push({key:`duplicates`,label:`Duplicates`,value:r.filterDuplicates===`with`?`Only rows linked to other reports`:`Exclude rows linked to other reports`,clear:{filterDuplicates:``}}),r.filterCrossContext&&i.push({key:`cross-context`,label:`Context`,value:r.filterCrossContext===`with`?`Only rows across multiple repos or packages`:`Exclude rows across multiple repos or packages`,clear:{filterCrossContext:``}}),r.filterAppStacked&&i.push({key:`app-stacked`,label:`App stack`,value:r.filterAppStacked===`with`?`Only rows with multiple App findings`:`Exclude rows with multiple App findings`,clear:{filterAppStacked:``}}),r.filterSecurity&&i.push({key:`security`,label:`Security`,value:r.filterSecurity===`with`?`Only security-related rows`:`Exclude security-related rows`,clear:{filterSecurity:``}}),i}function T(){return c().filter(e=>s(e).commonTriage===l.shownTriage)}function E(){return l.shownTriage?p[l.shownTriage]??l.shownTriage:null}function D(e,t=r()){let n=T(),s=n.length;i(t);let c;try{c=o(n).length}finally{a()}return{included:c,total:s,excluded:s-c,fields:t,filters:w(t),bucketLabel:E(),focusedOnly:e===`print`&&l.viewMode===`focus`}}var O=`.managed-comment{container:managed-comment / inline-size;white-space:normal}.managed-comment-row{display:grid;grid-template-columns:minmax(0,max-content) minmax(0,1fr) auto;align-items:start;gap:.35rem .65rem;line-height:1.5}.managed-comment-author{grid-column:1;grid-row:1;display:flex;align-items:center;gap:.45rem;min-width:0;max-width:14rem;& strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}}.managed-comment-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:1.3rem;height:1.3rem;overflow:hidden;border-radius:50%;background:rgb(from var(--muted) r g b / .15);color:var(--muted);font-size:.65rem;font-weight:600;& img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}& img[hidden]{display:none}}.managed-comment-body{grid-column:2;grid-row:1;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;& a{color:var(--accent);text-decoration:none}& a:hover{text-decoration:underline}& a.comment-self-ref{text-decoration:underline dotted;text-underline-offset:2px}& a.comment-self-ref:hover{text-decoration:underline solid}}.managed-comment-time{color:var(--muted);font-size:.7rem;font-weight:400;white-space:nowrap;text-align:right}.managed-comment-meta{grid-column:3;grid-row:1;justify-self:end;display:flex;align-items:center;gap:.5rem;min-height:1.3rem}.managed-comment-actions{display:flex;align-items:center;gap:.15rem}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr) auto;.managed-comment-body{grid-column:1}.managed-comment-meta{grid-column:2}}@container managed-comment (max-width: 28rem){.managed-comment-row:has(.managed-comment-meta){grid-template-columns:minmax(0,max-content) minmax(0,1fr);.managed-comment-meta{grid-column:1 / -1;grid-row:1}.managed-comment-author,.managed-comment-body{grid-row:2}}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr)}.managed-comment-author{max-width:9rem}}
4
4
  `;export{_ as a,v as b,y as c,b as d,x as e,w as f,T as g,E as h,D as i,O as j};
@@ -0,0 +1,11 @@
1
+ import{c as e}from"./chunk-PWFUOLZK.js";import{b as t,c as n}from"./chunk-C4Z6ZBXV.js";import{a as r,c as i,g as a,j as o}from"./chunk-2XUEZHIP.js";var s=`:host{display:inline-flex;flex-shrink:0;vertical-align:middle;--switch-track-width: 26px;--switch-track-height: 14px}button,.checkbox-mode{align-items:center;gap:8px;box-sizing:border-box;height:30px;margin:0;padding:0 .6rem;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);background:transparent;color:var(--muted);font:inherit;font-size:.78rem;font-weight:500;line-height:1;white-space:nowrap;cursor:default}button{display:var(--switch-button-display, inline-flex);&:hover:not(:disabled){color:var(--text);background:rgb(from var(--text) r g b / .04)}&[aria-pressed=true]{color:var(--text)}&:disabled{opacity:.4}&:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}}.checkbox-mode{display:var(--switch-checkbox-display, none);border:0;color:var(--text);&:has(:disabled){opacity:.4}& input{width:.85rem;height:.85rem;margin:0;accent-color:var(--accent)}}.track{position:relative;flex-shrink:0;width:var(--switch-track-width);height:var(--switch-track-height);background:var(--border);border-radius:var(--ui-radius, 8px);transition:background .15s;&:after{content:"";position:absolute;top:2px;left:2px;width:calc(var(--switch-track-height) - 4px);height:calc(var(--switch-track-height) - 4px);border-radius:50%;background:var(--muted);transition:transform .15s,background .15s}}button[aria-pressed=true] .track{background:color-mix(in oklch,var(--accent) 22%,transparent);&:after{transform:translate(calc(var(--switch-track-width) - var(--switch-track-height)));background:var(--accent)}}:host([borderless]) :is(button,.checkbox-mode){height:100%;border:0;border-radius:0}:host([compact]){--switch-track-width: 22px;--switch-track-height: 12px}:host([compact]) :is(button,.checkbox-mode){height:auto;gap:7px;padding:2px 8px;border-radius:var(--ui-radius, 6px);font-size:.68rem;line-height:1.2}:host-context(body.theme-w95){.checkbox-mode{padding:0 4px;color:#000;font-size:11px;font-weight:400}.checkbox-mode input{appearance:none;width:13px;height:13px;background:#fff;box-shadow:var(--w95-sunken);&:checked{background:var(--w95-check),#fff}}}
2
+ `,c=class extends o{static properties={checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},label:{type:String},accessibleLabel:{type:String,attribute:`accessible-label`}};static styles=r(s);constructor(){super(),this.checked=!1,this.disabled=!1,this.label=``,this.accessibleLabel=``}_checkboxClick(e){(this.disabled||e.target.tagName!==`INPUT`)&&e.stopPropagation()}render(){return i`<button type="button" part="button" aria-pressed="${String(this.checked)}" aria-label="${this.accessibleLabel||this.label}" ?disabled="${this.disabled}"><span>${this.label}</span><span class="track" part="track" aria-hidden="true"></span></button> <label class="checkbox-mode" @click="${this._checkboxClick}"><input type="checkbox" part="checkbox" .checked="${this.checked}" ?disabled="${this.disabled}" aria-label="${this.accessibleLabel||this.label}"> <span>${this.label}</span></label>`}};customElements.get(`mode-switch`)||customElements.define(`mode-switch`,c);function l(e){return!Number.isFinite(e)||e<0?`—`:e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KiB`:e<1073741824?`${(e/1048576).toFixed(1)} MiB`:`${(e/1073741824).toFixed(1)} GiB`}function u(e){return Array.isArray(e)?e.reduce((e,t)=>({bytes:e.bytes!=null&&Number.isFinite(t.bytes)?e.bytes+t.bytes:null,lines:e.lines!=null&&Number.isFinite(t.lines)?e.lines+t.lines:null}),{bytes:0,lines:0}):{bytes:null,lines:null}}function d(e,t,n){if(Array.isArray(e?.files))return{files:t.length,lines:u(t).lines,packages:new Set(t.map(e=>e.module)).size};let r=e=>Number.isSafeInteger(e)&&e>=0?e:null,i=e?.summary;return{files:r(i?.[n===`code`?`codeFiles`:`files`]),lines:r(i?.lines),packages:null}}function f(e){return(e??[]).filter(e=>![`resource:base64`,`directory`].includes(e.format))}var p=t(class extends n{constructor(){super(...arguments),this.key=a}render(e,t){return this.key=e,t}update(t,[n,r]){return n!==this.key&&(e(t),this.key=n),r}});export{l as a,u as b,d as c,f as d,p as e};
3
+ /*! Bundled license information:
4
+
5
+ lit-html/directives/keyed.js:
6
+ (**
7
+ * @license
8
+ * Copyright 2021 Google LLC
9
+ * SPDX-License-Identifier: BSD-3-Clause
10
+ *)
11
+ */
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-GO7FT4OD.js";import{c as t,d as n,e as r,h as i,i as a,j as o,m as s,n as c,o as l,p as u}from"./chunk-CZ3U2LI4.js";import{a as d}from"./chunk-7YFJUT2P.js";import"./chunk-PXK7EU4V.js";import{a as f,c as p}from"./chunk-JCIIBLKR.js";import"./chunk-PQPKHAI5.js";import{m,q as h,s as g,w as _}from"./chunk-WFDXHPT2.js";import{b as v}from"./chunk-IYPY47MC.js";import"./chunk-QRKFPLA4.js";import"./chunk-TUII34K2.js";import"./chunk-OOJM4CTU.js";function y(e){if(e instanceof Uint8Array)return{proven:!1,reason:`unsupported`,at:null};if(typeof e!=`string`)throw TypeError(`a text must be a string or its UTF-8 bytes, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a text must be a well-formed string`);return{proven:!1,reason:`unsupported`,at:null}}var b=e=>e.subarray(0,8e3).includes(0),x=(e,t)=>(e+Math.imul(t,97)>>>0)%107927,S=e=>Uint8Array.from({length:256},(t,n)=>Number(n===10||e.includes(String.fromCodePoint(n)))),C=S(``),w=S(`,;={}`);function T(e,t=C){let n=!b(e),r=new Map,i=(e,t)=>r.set(e,(r.get(e)??0)+t),a=0,o=0,s=0;for(let r=0;r<e.length;r++){let c=e[r];if(n&&c===13&&e[r+1]===10)continue;let l=a;a=(a<<7^o>>>25)+c>>>0,o=(o<<7^l>>>25)>>>0,!(++s<64&&t[c]===0)&&(i(x(a,o),s),s=0,a=0,o=0)}s>0&&i(x(a,o),s);let c=Uint32Array.from(r.keys()).sort();return{hashes:c,bytes:Float64Array.from(c,e=>r.get(e)),total:r.values().reduce((e,t)=>e+t,0)}}function E(e,t){let n=0;for(let r=0,i=0;r<e.hashes.length&&i<t.hashes.length;)e.hashes[r]<t.hashes[i]?r++:e.hashes[r]>t.hashes[i]?i++:n+=Math.min(e.bytes[r++],t.bytes[i++]);return n}function D(e,t,n){let r=0,i=e.total,a=t.total;for(let o=0,s=0;o<e.hashes.length&&s<t.hashes.length;)if(e.hashes[o]<t.hashes[s]?i-=e.bytes[o++]:(e.hashes[o]>t.hashes[s]||(r+=Math.min(e.bytes[o],t.bytes[s]),i-=e.bytes[o++]),a-=t.bytes[s++]),(r+Math.min(i,a))*6e4<n)return 0;return r}function O(e,t,n,r,i=!1){if(e===null||t===null||t.length===0)return 0;let a=Math.abs(e.length-t.length),o=Math.max(e.length,t.length);if(o*(6e4-n)<a*6e4)return 0;let s=r(e),c=r(t),l=i?D(s,c,n*o):E(s,c);return Math.trunc(l*6e4/o)}var k=/^[\w-]{6,}$/u,A=/[\dA-Z]/u,ee=/^(?:\.[\w-]+)+$/u,te=/^[\w-]{8,32}$/u;function j(e){let t=[];for(let n=e.length-1;n>0;n--){if(e[n]!==`-`&&e[n]!==`.`)continue;let r=e.indexOf(`.`,n+1),i=e.slice(r),a=e.slice(n+1,r);r!==-1&&te.test(a)&&ee.test(i)&&/[A-Za-z]/u.test(a)&&A.test(a)&&t.push([e.slice(0,n),a,i])}return t}var M=e=>e.replaceAll(/\d/gu,`0`).replaceAll(/[a-z]/gu,`a`).replaceAll(/[A-Z]/gu,`A`);function ne(e,t){let n=j(t);for(let[t,r,i]of j(e)){let e=n.find(e=>e[2]===i);if(e&&e[1]!==r)return e[0]===t&&M(e[1])!==M(r)}return!1}function re(e){let t=e.lastIndexOf(`/`),n=e.slice(t+1),r=n.lastIndexOf(`.`),i=r>0?n.slice(r):``;return{name:n,key:`${e.slice(0,t+1)}\0${i}\0${n.length}`}}function ie(e,t){let n=e.length,r=0;for(;r<e.length&&e[r]===t[r];)r++;for(;n>r&&e[n-1]===t[n-1];)n--;for(;r>0&&!`-._`.includes(e[r-1]);)r--;for(;n<e.length&&e[n]!==`.`;)n++;let i=e.slice(r,n),a=t.slice(r,n);return r>0&&k.test(i)&&k.test(a)&&(A.test(i)||A.test(a))}function ae({sources:e,dests:t,pairs:n,used:r,record:i,punctuatedScoreOf:a},{remaining:o,open:s},c,l){let u=(e,t)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>[t,re(e[t].path)])),d=u(t,s),f=u(e,o),p=Map.groupBy(f.keys(),e=>f.get(e).key),m=Map.groupBy(d.keys(),e=>d.get(e).key),h=[];for(let[e,t]of m){let n=p.get(e)??[];for(let e of t)for(let t of n)ie(f.get(t).name,d.get(e).name)&&h.push({s:t,d:e})}let g=Map.groupBy(h,({d:e})=>e),_=Map.groupBy(h,({s:e})=>e),v=[];for(let{s:e,d:t}of h){let n=_.get(e).length===1&&g.get(t).length===1&&ne(f.get(e).name,d.get(t).name),r=a(e,t,n?0:c);(n||r>=c)&&v.push({s:e,d:t,score:r})}let y=[],b=new Set,x=new Set;for(let e of v.sort((e,t)=>t.score-e.score))n.has(e.d)||r.has(e.s)||(x.has(e.s)||b.has(e.d)||l(e)?(y.push(e),x.add(e.s),b.add(e.d)):i(e.d,e.s,e.score));return y}function oe(e,t){let n=e.length;if(n!==t.length)return!1;let r=0;if(n>=32&&(e.byteOffset&3)==(t.byteOffset&3)){for(let n=4-(e.byteOffset&3)&3;r<n;r++)if(e[r]!==t[r])return!1;let i=n-r>>>2,a=new Int32Array(e.buffer,e.byteOffset+r,i),o=new Int32Array(t.buffer,t.byteOffset+r,i);for(let e=0;e<i;e++)if(a[e]!==o[e])return!1;r+=i*4}for(;r<n;r++)if(e[r]!==t[r])return!1;return!0}var N=class extends Error{constructor(e,t,n){let r=n===void 0?``:` in the ${n} tree`;super(t===void 0?e:`${e}: ${JSON.stringify(t)}${r}`),this.name=`CompareError`,this.path=t,this.tree=n}},se=new Set([`file`,`contiguous-file`]),ce=new Set([`fifo`,`character-device`,`block-device`]),le=/(?:^|\/)\.{0,2}(?:\/|$)/u;function ue(e){if(!Number.isInteger(e)||e<0||e>4095)throw RangeError(`a mode must be an integer from 0 to 0o7777, not ${e}`)}function de(e,t,n,r){if(typeof e!=`string`)throw TypeError(`an entry's name must be a string, not ${typeof e}`);if(e!==`.`||t!==`directory`){if(r?e===``:le.test(e))throw new N(r?`a name must not be empty`:"a name must be a relative path with no empty, `.` or `..` segment",e,n);if(!e.isWellFormed())throw new N(`a name must be well-formed Unicode`,e,n)}}function fe(e,t,n){if(typeof e!=`string`||e===``)throw new N(`a link must name its target`,t,n);if(!e.isWellFormed())throw new N(`a link target must be well-formed Unicode`,t,n);return e}function pe(e){if(e===void 0)return new Uint8Array;if(e instanceof Uint8Array)return e;if(typeof e!=`string`)throw TypeError(`a file's data must be a string or a Uint8Array, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a file's text must be well-formed Unicode`);return e}var P=e=>typeof e==`string`?d(e):e;function me(e,t,n){if(typeof e!=`object`||!e)throw TypeError(`an entry must be an object, not ${e===null?`null`:typeof e}`);let{name:r,type:i=`file`,mode:a,linkname:o,data:s}=e;if(de(r,i,t,n),a!==void 0&&ue(a),se.has(i))return{path:r,type:`file`,mode:a??420,data:pe(s)};if(i===`symlink`||i===`hardlink`)return{path:r,type:i,target:fe(o,r,t)};if(i===`directory`)return{path:r,type:i};throw ce.has(i)?new N(`a ${i} is neither a file nor a link`,r,t):TypeError(`${JSON.stringify(i)} is not an entry type`)}function F(e,t){return e.type===t.type?e.type===`symlink`?e.target===t.target:e.data===t.data?!0:typeof e.data==`string`&&typeof t.data==`string`?!1:oe(P(e.data),P(t.data)):!1}function he(e,t,n){let r=new Set([e.path]),i=t.get(e.target);for(;i?.type===`hardlink`;){if(r.has(i.path))throw new N(`a hard link leads back to itself`,e.path,n);r.add(i.path),i=t.get(i.target)}if(i===void 0||i.type===`directory`)throw new N(`a hard link must name a file or a link in the tree`,e.path,n);return{...i,path:e.path}}function I(e,t,n){let r=new Map;for(let i of e){let e=me(i,t,n);if(e.type!==`directory`||e.path!==`.`){if(r.has(e.path))throw new N(`a name is given twice`,e.path,t);r.set(e.path,e)}}let i=new Map;for(let[e,a]of r){for(let i=n?-1:e.lastIndexOf(`/`);i>0;i=e.lastIndexOf(`/`,i-1)){let n=r.get(e.slice(0,i));if(n!==void 0&&n.type!==`directory`)throw new N(`a path lies under a ${n.type===`symlink`?`link`:`file`}`,e,t)}a.type===`hardlink`?i.set(e,he(a,r,t)):a.type!==`directory`&&i.set(e,a)}return i}var ge=100,_e=4,L=e=>e.slice(e.lastIndexOf(`/`)+1);function R(t,n){if(t.type===`symlink`)return`l${t.target}`;let r=n(t);return`f${r.length}:${e(r)}`}function ve({sources:e,dests:t,sourceNames:n,destNames:r,used:i,record:a,bytes:o}){let s=Map.groupBy(e.keys(),t=>R(e[t],o));for(let c=0;c<t.length;c++){let l=-1,u=ge;for(let a of s.get(R(t[c],o))??[])if(!i.has(a)&&F(e[a],t[c])&&((l===-1||n[a]===r[c])&&(l=a),n[a]===r[c]||--u===0))break;l!==-1&&a(c,l,6e4)}}var ye=new Map([[`.ts`,`.js`],[`.mts`,`.mjs`],[`.cts`,`.cjs`],[`.tsx`,`.jsx`]]),be=new Map([...[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.mts`,`.cts`,`.tsx`].map(e=>[e,`script`]),...[`.css`,`.scss`,`.sass`,`.less`].map(e=>[e,`style`])]);function z(e){let t=e.split(`/`),n=t.pop(),r=n.lastIndexOf(`.`);return r>0?{dirs:t,stem:n.slice(0,r),extension:n.slice(r)}:{dirs:t,stem:n,extension:``}}function B(e){let{dirs:t,stem:n,extension:r}=z(e);return JSON.stringify([t.map(e=>e===`lib`||e===`src`?null:e),n,ye.get(r)??r])}function xe(e){let{dirs:t,stem:n,extension:r}=z(e),i=[n,be.get(r)??r],a=t.lastIndexOf(`node_modules`),o=a===-1?0:a+(t[a+1]?.startsWith(`@`)?3:2),s=[JSON.stringify([...i,t])];for(let e=o;e<t.length;e++)s.push(JSON.stringify([...i,t.toSpliced(e,1,null)]));return s}var V=(e,t)=>Math.max(t,e+Math.trunc((6e4-e)/2));function H({pairs:e,used:t,scoreOf:n},{remaining:r,open:i},{s:a,d:o,score:s},c){let l=V(s,c);return i.some(t=>t!==o&&!e.has(t)&&n(a,t,l)>=l)||r.some(e=>e!==a&&!t.has(e)&&n(e,o,l)>=l)}function Se(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=Map.groupBy(t.remaining.filter(e=>i[e].type===`file`),e=>B(i[e].path)),d=t.open.filter(e=>a[e].type===`file`).flatMap(e=>(u.get(B(a[e].path))??[]).map(t=>({s:t,d:e,score:l(t,e,0)})));for(let i of d.sort((e,t)=>t.score-e.score))o.has(i.d)||s.has(i.s)||n&&H(e,t,i,r)||c(i.d,i.s,i.score)}function Ce(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=new Map,d=(e,t,n)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>{let r=xe(e[t].path);for(let e of r)(u.get(e)??u.set(e,{sources:[],dests:[]}).get(e))[n].push(t);return[t,r]})),f=d(a,t.open.filter(e=>!o.has(e)),`dests`),p=d(i,t.remaining.filter(e=>!s.has(e)),`sources`),m=(e,t)=>{let n=new Set(e.flatMap(e=>u.get(e)[t]));return n.size===1?[...n][0]:-1};for(let[i,a]of p){let o=m(a,`dests`);if(o===-1||m(f.get(o),`sources`)!==i)continue;let s={s:i,d:o,score:l(i,o,0)};n&&H(e,t,s,r)||c(o,i,s.score)}}function we(e,t,n){let r=G(e),i=t<6e4&&r.remaining.length*r.open.length<=n*n;Se(e,r,i,t),Ce(e,r,i,t)}function U(e,t){let n=new Map;for(let r of t)n.set(e[r],n.has(e[r])?-1:r);return n}function Te({sourceNames:e,destNames:t,record:n,scoreOf:r},{remaining:i,open:a},o){let s=U(t,a),c=U(e,i);for(let t of i){let i=s.get(e[t]);if(i===void 0||i===-1||c.get(e[t])===-1)continue;let a=r(t,i,o);a>=o&&n(i,t,a)}}var W=(e,t)=>t.score-e.score||t.nameScore-e.nameScore;function Ee(e,t){if(e.length<_e){e.push(t);return}let n=0;for(let t=1;t<e.length;t++)W(e[t],e[n])>0&&(n=t);W(e[n],t)>0&&(e[n]=t)}function De({sourceNames:e,destNames:t,pairs:n,used:r,record:i,scoreOf:a},{remaining:o,open:s},c,l){let u=[];for(let n of s){let r=[];for(let i of o)Ee(r,{score:a(i,n,c),nameScore:+(e[i]===t[n]),dst:n,src:i});u.push(...r)}let d=0,f=e=>{for(;d<l.length&&V(l[d].score,c)>e;d++){let{s:e,d:t,score:a}=l[d];!n.has(t)&&!r.has(e)&&i(t,e,a)}};for(let{dst:e,src:t,score:a}of u.sort(W)){if(a<c)break;f(a),!n.has(e)&&!r.has(t)&&i(e,t,a)}f(-1/0)}var G=({sources:e,dests:t,pairs:n,used:r})=>({remaining:e.keys().filter(e=>!r.has(e)).toArray(),open:t.keys().filter(e=>!n.has(e)).toArray()}),K=e=>V(e,e);function q(e,t,{minimum:n,limit:r,byPath:i}){let a=new Map,o=new Set;if(e.length===0||t.length===0)return a;let s=new Map,c=new Map,l=new Map,u=e=>e.type===`file`?c.get(e)??c.set(e,P(e.data)).get(e):null,d=e=>s.get(e)??s.set(e,T(e)).get(e),f=e=>l.get(e)??l.set(e,T(e,w)).get(e),p={sources:e,dests:t,pairs:a,used:o,sourceNames:e.map(e=>L(e.path)),destNames:t.map(e=>L(e.path)),record(e,t,n){a.set(e,{source:t,score:n}),o.add(t)},bytes:u,scoreOf:(n,r,i)=>O(u(e[n]),u(t[r]),i,d),punctuatedScoreOf:(n,r,i)=>O(u(e[n]),u(t[r]),i,f,!0)};if(ve(p),i&&we(p,n,r),n>=6e4)return a;Te(p,G(p),K(n));let m=G(p);if(m.remaining.length*m.open.length>r*r)return a;let h=i?ae(p,m,K(n),e=>H(p,m,e,n)):[];return De(p,G(p),n,h),a}var Oe=50,ke=1e3;function J(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return e.codePointAt(r)-t.codePointAt(r);return e.length-t.length}function Ae(e){if(e===!1)return null;let t=e===!0?Oe:e;if(typeof t!=`number`)throw TypeError(`renames must be a boolean or a percentage, not ${typeof e}`);if(!(t>0&&t<=100))throw RangeError(`renames must be a percentage above 0 and at most 100, not ${e}`);return Math.max(1,Math.trunc(6e4*t/100))}function je({renamesByPath:e,renameLimit:t,renameGroup:n,paths:r,lines:i}){if(typeof e!=`boolean`)throw TypeError(`renamesByPath must be a boolean, not ${typeof e}`);if(t!==1/0&&!(Number.isSafeInteger(t)&&t>=0))throw RangeError(`renameLimit must be a whole number or Infinity, not ${t}`);if(n!==null&&typeof n!=`function`)throw TypeError(`renameGroup must be a function, not ${typeof n}`);if(r!==`tree`&&r!==`keys`)throw RangeError(`paths must be 'tree' or 'keys', not ${r}`);if(typeof i!=`boolean`)throw TypeError(`lines must be a boolean, not ${typeof i}`)}var Me=(e,t)=>F(e,t)&&(e.type!==`file`||e.mode===t.mode),Y=(e,t,n,r=null)=>({status:e,old:t,new:n,similarity:r}),Ne=/\.d\.(?:[^./]+\.)?[cm]?ts$/u,Pe=e=>e.endsWith(`.mts`)?`module`:e.endsWith(`.cts`)?`commonjs`:null,Fe=/^export\s*\{\s*\}\s*;?$/u;function Ie(e){if(e===null)return{proven:!0,runtime:``,loads:!1};try{return t(e)===void 0?{proven:!1}:y(e.data)}catch{return{proven:!1}}}function Le(e){if(![e.old,e.new].filter(e=>e!==null).every(e=>e.type===`file`&&Ne.test(e.path))||e.old&&e.new&&e.old.mode!==e.new.mode)return e;let t=Ie(e.new),n=Ie(e.old);return!n.proven||!t.proven||n.runtime!==t.runtime&&!(e.old===null&&Fe.test(t.runtime))||n.loads&&e.old&&e.new&&e.old.path!==e.new.path&&Pe(e.old.path)!==Pe(e.new.path)?e:{...e,typeOnly:!0}}function Re(e,t){let n=[],r=[],i=[];for(let[n,a]of e){let e=t.get(n);e===void 0?i.push(a):e.type===a.type?Me(a,e)||r.push(Y(`modified`,a,e)):r.push(Y(`type-changed`,a,e))}for(let[r,i]of t)e.has(r)||n.push(i);return i.sort((e,t)=>J(e.path,t.path)),n.sort((e,t)=>J(e.path,t.path)),{changes:r,deleted:i,added:n}}function ze(e,t,{group:n,...r}){if(n===null)return q(e,t,r);let i=new Map,a=e=>Map.groupBy(e.keys(),t=>n(e[t].path)),o=a(e);for(let[n,s]of a(t)){let a=o.get(n);if(a!==void 0)for(let[n,{source:o,score:c}]of q(a.map(t=>e[t]),s.map(e=>t[e]),r))i.set(s[n],{source:a[o],score:c})}return i}function Be(e,t,{renames:i=!0,renamesByPath:a=!0,renameLimit:o=ke,renameGroup:s=null,paths:c=`tree`,lines:l=!0,horizon:u,whitespace:d,ignoreCase:f}={}){let p=Ae(i);je({renamesByPath:a,renameLimit:o,renameGroup:s,paths:c,lines:l});let m=n({horizon:u,whitespace:d,ignoreCase:f}),h=c===`keys`,{changes:g,deleted:_,added:v}=Re(I(e,`old`,h),I(t,`new`,h)),y=p===null?new Map:ze(_,v,{minimum:p,limit:o,byPath:a,group:s});for(let[e,t]of v.entries()){let n=y.get(e);g.push(n===void 0?Y(`added`,null,t):Y(`renamed`,_[n.source],t,Math.trunc(n.score*100/6e4)))}let b=new Set(y.values().map(({source:e})=>e));for(let[e,t]of _.entries())b.has(e)||g.push(Y(`deleted`,t,null));return g.sort((e,t)=>J((e.new??e.old).path,(t.new??t.old).path)),(l?g.map(e=>({...e,...r(e.old,e.new,m)})):g).map(Le)}function X(e,t,n){let r=new Map,o=new Set,s=0;for(let a of e){let e=i(n,a);e===null||!t.has(e)||(r.set(a,e),o.add(e),e!==a&&s++)}for(let n of e)r.has(n)||!t.has(n)||o.has(n)||(r.set(n,n),o.add(n));let c=r.size;for(let s of e){if(r.has(s))continue;let e=i(n,s)??a(n,s);for(;t.has(e)||o.has(e);)e=`../${e}`;r.set(s,e),o.add(e)}return{paths:r,paired:c,moved:s}}function Ve(e,t){let n=new Set(e),r=new Set(t),i=(e,t)=>{let n=new Map;for(let r of e)for(let e=r.indexOf(`/`);e!==-1;e=r.indexOf(`/`,e+1)){let i=r.slice(0,e+1);t.has(r.slice(e+1))&&n.set(i,(n.get(i)??0)+1)}let r=null,i=!1;for(let[e,t]of n)t>(n.get(r)??0)?[r,i]=[e,!1]:t===n.get(r)&&(i=!0);return i?null:r},a=X(n,r,null).paired,o=[[{base:``,other:i(r,n)},n],[{base:i(n,r),other:``},r]].filter(([e])=>e.base!==null&&e.other!==null).map(([e,t])=>({root:e,side:t,...X(n,r,e)})).filter(({side:e,paired:t,moved:n})=>t>a&&n*2>=e.size);return o.length===2&&o[0].paired===o[1].paired?null:o.toSorted((e,t)=>t.paired-e.paired)[0]?.root??null}function He(e,t){let n=[...e],r=new Set(t),i=Ve(n,r);return{root:i,paths:X(n,r,i).paths}}function Ue(e,t,n){if(!e&&!t)return null;let r=[...e??[]],i=Map.groupBy(r,([,e])=>e),a=new Map(i.entries().map(([e,t])=>[e,o(n,e,t.map(([t])=>t.slice(e.length+1)))]));return new Map([...r.map(([e,t])=>[n.paths.get(e)??e,a.get(t)]),...t??[]])}function We(e,t,n=new Map,r=new Map,i=null,a=()=>!1){let o=e=>{let t=n.get(e)??r.get(e);return t===void 0?[...new Set([e,Ze(i,e)??e])]:[t]},s=[],c=[],u=[],d=new Set;for(let n of e.values()){let e=o(n.parent).map(e=>t.get(l(e,n.specifier,n.conditions,n.platform))).find(Boolean),i=r.get(n.target)??n.target;if(e){if(d.add(e.key),!o(n.target).includes(e.target)){let{target:t,...n}=e;s.push({...n,baseTarget:i,otherTarget:t})}continue}let u=o(n.parent).find(a);if(u===void 0)continue;let{specifier:f,conditions:p,platform:m}=n;c.push({key:l(u,f,p,m),parent:u,specifier:f,conditions:p,platform:m,baseTarget:i,otherTarget:null})}for(let e of t.values()){if(d.has(e.key)||!a(e.parent))continue;let{target:t,...n}=e;u.push({...n,baseTarget:null,otherTarget:t})}for(let e of[s,c,u])e.sort((e,t)=>e.key.localeCompare(t.key));return{changed:s,onlyBase:c,onlyOther:u,totalChanges:s.length+c.length+u.length}}function Z(e){return m(e)??0}function Ge(e,t){return e===t||e?.format===`base64`&&t?.format===`base64`&&e.data===t.data||e?.format===`digest`&&t?.format===`digest`&&e.digest===t.digest}function Q(e){if(e?.kind!==`stasis`||!e.bundle)return null;let{formats:t,executable:n,entries:r}=e.bundle;return e=>({format:t?.get(e),executable:n?.has(e)??!1,entry:r?.has(e)??!1})}function Ke(e,t){return!e||!t?[]:[`format`,`executable`,`entry`].filter(n=>e[n]!==t[n]).map(n=>({field:n,from:e[n],to:t[n]}))}function qe(e){return(t,n)=>Math.abs(n.delta)-Math.abs(t.delta)||t[e].localeCompare(n[e])}function $(e){return(t,n)=>n.bytes-t.bytes||t[e].localeCompare(n[e])}function Je(e,t){return typeof e==`string`?`\0text\0${e.toWellFormed()}`:e?.format===`base64`?`\0base64\0${e.data}`:e?.format===`digest`?`\0digest\0${e.digest}`:`\0none\0${t}`}var Ye=250;function Xe(e,t,n,r,i){let a=(e,t,n)=>e.filter(({path:e})=>e!==``&&e.isWellFormed()).map(({path:e},r)=>({name:e,data:Je(t.get(e),`${n}${r}`)})),o={paths:`keys`,renameGroup:i,renameLimit:Ye,lines:!1},s=Be(a(e,n,`a`),a(t,r,`b`),o);return new Map(s.filter(({status:e})=>e===`renamed`).map(e=>[e.old.path,e.new.path]))}function Ze(e,t){return e?e.base===``?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}function Qe(){return{baseBytes:0,otherBytes:0,onlyBaseFiles:0,onlyOtherFiles:0,changedFiles:0}}function $e(e,t,n,r=He(e.keys(),t.keys()),i=[]){let{root:a,paths:o}=r,s=new Map([...o].map(([e,t])=>[t,e]));e=new Map([...e].map(([e,t])=>[o.get(e),t]));let c=e=>s.get(e)===e?{}:{basePath:s.get(e)},l=(e,t)=>{let n=Ke(i[0]?.(e),i[1]?.(t));return n.length>0?{meta:n}:{}},u=[],d=[],f=[],p=0,m=0,h=0,g=0,_=0,v=0,y=new Map,b=e=>{let t=n(e),r=y.get(t);return r||(r=Qe(),y.set(t,r)),r},x=new Set([...e.keys(),...t.keys()]);for(let n of x){let r=e.has(n),i=t.has(n),a=b(n);if(r&&i){let r=e.get(n),i=t.get(n),o=Ge(r,i),u=l(s.get(n),n),d=Z(r),h=o?d:Z(i);if(p+=d,m+=h,a.baseBytes+=d,a.otherBytes+=h,o&&!u.meta)v++;else{let e=h-d;f.push({path:n,...c(n),baseBytes:d,otherBytes:h,delta:e,...u,...o?{modified:!1}:{}}),_+=e,a.changedFiles++}}else if(r){let t=Z(e.get(n));p+=t,h+=t,a.baseBytes+=t,a.onlyBaseFiles++,u.push({path:n,...c(n),bytes:t})}else{let e=Z(t.get(n));m+=e,g+=e,a.otherBytes+=e,a.onlyOtherFiles++,d.push({path:n,bytes:e})}}let S=Xe(u,d,e,t,n);if(S.size>0){let n=new Set(S.values());for(let[n,r]of S){let i=e.get(n),a=t.get(r),o=Ge(i,a),c=Z(i),u=o?c:Z(a);h-=c,g-=u,f.push({path:r,renamedFrom:n,basePath:s.get(n),baseBytes:c,otherBytes:u,delta:u-c,modified:!o,...l(s.get(n),r)}),_+=u-c;let d=b(n);d.onlyBaseFiles--,d.onlyOtherFiles--,d.changedFiles++}u.splice(0,u.length,...u.filter(e=>!S.has(e.path))),d.splice(0,d.length,...d.filter(e=>!n.has(e.path)))}let C=[],w=[],T=[],E=[];for(let[e,t]of y){let n=t.baseBytes>0||t.onlyBaseFiles>0||t.changedFiles>0,r=t.otherBytes>0||t.onlyOtherFiles>0||t.changedFiles>0,i=t.onlyBaseFiles+t.onlyOtherFiles+t.changedFiles;n&&!r?C.push({pkg:e,bytes:t.baseBytes}):r&&!n?w.push({pkg:e,bytes:t.otherBytes}):i>0||t.baseBytes!==t.otherBytes?T.push({pkg:e,baseBytes:t.baseBytes,otherBytes:t.otherBytes,delta:t.otherBytes-t.baseBytes}):E.push({pkg:e,bytes:t.baseBytes})}return u.sort($(`path`)),d.sort($(`path`)),f.sort(qe(`path`)),C.sort($(`pkg`)),w.sort($(`pkg`)),T.sort(qe(`pkg`)),{totals:{baseFiles:e.size,baseBytes:p,otherFiles:t.size,otherBytes:m,onlyBaseFiles:u.length,onlyBaseBytes:h,onlyOtherFiles:d.length,onlyOtherBytes:g,changedFiles:f.length,renamedFiles:S.size,changedDelta:_,unchangedFiles:v,fileDelta:t.size-e.size,byteDelta:m-p,identical:u.length===0&&d.length===0&&f.length===0},files:{onlyBase:u,onlyOther:d,changed:f,root:a,basePaths:o},packages:{onlyBase:C,onlyOther:w,changed:T,unchanged:E}}}function et(e,t,n=null){let[r,i]=[e,t],[a,o]=s(r,i,n),l=c(r,a),d=c(i,o),m=He(l.keys(),d.keys()),y=Ue(h(r),h(i),m),b=$e(l,d,e=>v(e,{packageDir:y?.get(e)}),m,[Q(r),Q(i)]),x=_(r),S=_(i),C=(e,t)=>{let n=0;for(let r of t)n+=e.get(r)??0;return n};Object.assign(b.totals,{baseLines:C(x,l.keys()),otherLines:C(S,d.keys())});for(let e of b.files.onlyBase)e.lines=x.get(e.basePath??e.path)??0;for(let e of b.files.onlyOther)e.lines=S.get(e.path)??0;for(let e of b.files.changed)Object.assign(e,{baseLines:x.get(e.basePath??e.path)??0,otherLines:S.get(e.path)??0});let w=new Set([...b.files.onlyOther,...b.files.changed.filter(e=>e.modified!==!1)].map(e=>e.path));b.resolutions=We(u(r,a),u(i,o),new Map(b.files.changed.filter(e=>e.renamedFrom!=null).map(e=>[e.basePath,e.path])),b.files.basePaths,b.files.root,e=>d.has(e)&&!w.has(e));let T=e=>v(``,{packageDir:e}),E=g(r,a?l.keys():null,T),D=g(i,o?d.keys():null,T);return b.versionUpdates=p(E,D),b.packageRows=f(b.packages,E,D),b.scope=n??``,b}export{et as prepareComparison};
@@ -1,4 +1,4 @@
1
- import{b as e,h as t}from"./chunk-HETCVNO4.js";import{a as n}from"./chunk-D6NVKGGG.js";import{a as r,b as i,e as a}from"./chunk-IYPY47MC.js";import{A as o,B as s,D as c,E as l,b as u,c as d,d as f,j as p,m,p as h,s as g,t as _,w as v,z as y}from"./chunk-QRKFPLA4.js";import{B as b,b as x,c as S,i as C,x as ee,z as w}from"./chunk-74AEKRES.js";import{a as T,b as E,c as D}from"./chunk-C4Z6ZBXV.js";import{c as O,f as k,g as A,i as te}from"./chunk-2XUEZHIP.js";var ne=E(class extends D{constructor(e){if(super(e),e.type!==T.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return k}});function re(e){let t=typeof e==`string`?e.trim():``;return/^[0-9a-f]{7,64}$/iu.test(t)?t:``}function ie(e){return re(e?.commit)}function j(e,t){return typeof e==`string`&&typeof t==`string`&&e!==``&&e.toLowerCase()===t.toLowerCase()}function ae(e,t){return j(t,c(e))?ie(e?.repo):``}function oe(e,t){let n=e?.advisory?.package,r=e?.repo?.github;if(typeof n!=`string`||n===``||typeof r!=`string`||r===``)return!1;let i=c({repo:{github:r}}),a=i?.split(`/`)[1].toLowerCase();return a!==n.toLowerCase()&&a!==n.replace(/^@[^/]+\//u,``).toLowerCase()?!1:!j(i,typeof t==`string`&&t!==``?c({repo:{github:t}})??t:``)}function se(e,t){if(!oe(e,t))return e;let{repo:n,...r}=e;return{...r,_repoIgnored:!0}}var ce=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`),le=e=>x(e)?e:ce(S(String(e))),M=globalThis.trustedTypes?.createPolicy(`deepview`,{createHTML:le,createScriptURL:e=>{let t=new URL(e,globalThis.location.href);if(t.origin!==globalThis.location.origin)throw TypeError(`Not a same-origin script: ${t.href}`);return t.href}}),N=e=>M?M.createHTML(e):le(e),ue=e=>M?M.createScriptURL(String(e)):e,P={showAll:!1,packagesView:!1,dependencyPackagesView:!1,flowPackagesView:!1,bundleIssues:!1,bundleLayout:`graph`,lockfileLayout:`dependencies`,bundleReason:null,bundleReasonFor:null,selected:null,focusedPkg:null,topPkgsTab:`issues`,edgeOpacity:.22,nodeSize:1,showLabels:!1,selectedSeverities:new Set,selectedColors:new Set,pathFilter:``,hidden:new Set,solo:null,graphState:null,layoutCache:null,keptViewport:null};function de({keepViewport:e=!1}={}){P.graphState?._cleanup?P.graphState._cleanup({keepViewport:e}):e||(P.keptViewport=null),P.graphState=null}function F(e){return e.id??String(e._id)}function fe(e){let t=h(e);return t!==``&&t!==`revalidation`}var pe=[{value:`confirmed`,label:`Confirmed`,kinds:[`confirmed`,`partial`,`revalidation`]},{value:`unreachable`,label:`Unreachable`,kinds:[`unreachable`]},{value:`refuted`,label:`Refuted`,kinds:[`refuted`]}];function me(e){return pe.find(t=>t.value===e)?.kinds??null}var he=[``,`exclude`,`only`];function ge(e,t){let n=me(e);return n?.includes(`partial`)?t===`only`?[`partial`]:t===`exclude`?[`confirmed`]:n:n}function I(e){if(e.confidence!==void 0)return e.confidence;if(e.critical===!0||e._source)return 10}var _e=e=>e.confidence!==void 0||e.critical===!0;function ve(e){return e.every(e=>e.every(e=>I(e)!==void 0))&&e.some(e=>e.some(_e))}function ye(e,t,n){return e.some(e=>{let r=[`refuted`,`unreachable`].includes(n(e))?0:I(e);return r===void 0?t===0:r>=t})}function be(e,t){let n=e.map(t).filter(e=>e.length>0);if(!n.some(e=>e.some(e=>I(e)!==void 0)))return 0;let r=e=>n.reduce((t,n)=>t+ +!!n.some(t=>(I(t)??-1)>=e),0),i;for(i=r(6)<=25?6:r(7)<=25?7:8;i>0&&r(i-1)===r(i);)i--;return i}function xe(e,t){return ve(e)?t:0}function Se(e,t,n){let r=new Set(e.ruledOutIds??[]);for(let t of e)for(let e of t)[`refuted`,`unreachable`].includes(n(e))&&r.add(F(e));for(let i of e){let e=t(i);if(e.length!==0&&e.some(e=>ge(`confirmed`,``).includes(n(e)||(e._source&&!e._sourcePass?`revalidation`:``)))){for(let e of i)if(r.add(F(e)),e.isApp&&Array.isArray(e.revalidateInputs))for(let t of e.revalidateInputs)t&&r.add(t)}}return r}function Ce(e,t,n,r){let i=xe(e,t),a=e.filter(e=>ye(e,i,r));if(a.length===0)return!1;let o=new Set(ge(`confirmed`,``));return e.some(e=>e.some(e=>o.has(r(e))))?a.every(e=>e.every(e=>n.has(F(e)))):!1}function we(e,{tabs:t,kindOf:n,severityMode:r}){let i=e.map(t).filter(e=>e.length>0),a=Se(e,t,n);if(!Ce(i,be(e,t),a,n))return!1;let o=xe(i,6);return i.every(e=>!ye(e,o,n)||!e.some(e=>m(e,r)!==`low`)||e.every(e=>a.has(F(e))))}function Te(e){if(!e)return e;let t="`".repeat(Math.max(0,...[...e.matchAll(/`+/gu)].map(e=>e[0].length))+1),n=/^`|`$/u.test(e)||e.startsWith(` `)&&e.endsWith(` `)&&e.trim()!==``?` `:``;return`${t}${n}${e}${n}${t}`}var L=!0;function Ee(e,t=!1){L=e!==!1&&!t}function De(){return L}function R(e){return L?h(e):``}function Oe(e){return h(e)!==``}function ke(e){return e.some(e=>(e.groups??[]).some(e=>e.some(fe)))}function Ae(e){let t=R(e);return t&&t!==`revalidation`?t:null}function je(e){return R(e)===`revalidation`}var Me=new Set([`refuted`,`unreachable`]);function Ne(e){return Me.has(R(e))}function Pe(e){return Me.has(R(e))}function Fe(e){let t=new Set(e);return pe.filter(e=>e.kinds.some(e=>t.has(e)))}function z(e){return RegExp(`(^|/)${e}/`,`u`)}function Ie(e){return RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,`u`)}var Le=z(`node_modules`),Re=z(`vendor`),B=`node_modules`,ze=z(B),Be=Ie(B);function Ve(e){e!==B&&(B=e,ze=z(e),Be=Ie(e))}var He=null;function Ue(t){He?.length===t.length&&He.every((e,n)=>e===t[n])||(He=[...t],Ve(e(t)))}function We(){return B}function V(e){return ze.test(e)}var Ge=new WeakSet;function Ke(e){let t=!1;for(let n of e??[])for(let e of n.groups??[])for(let n of e){if(n.isApp!==!1)continue;let e=Ge.has(n);`isUpstream`in n&&!e||(V(n.file)?(n.isUpstream!==!0&&(t=!0),n.isUpstream=!0,Ge.add(n)):e&&(t=!0,delete n.isUpstream,Ge.delete(n)))}return t}function qe(e){let t=typeof e==`string`?e:``;return Le.test(t)||Re.test(t)||ze.test(t)}var Je=/^(.*(?:^|\/)node_modules\/(?:@[^/]+\/[^/]+|[^/]+))(?:\/|$)/u;function Ye(e){return Je.exec(typeof e==`string`?e:``)?.[1]??null}function Xe(e){if(typeof e!=`object`||!e)return null;for(let[t,n]of Object.entries(e))if(typeof n?.name==`string`&&n.name!==``)return`${t}:${n.name}@${typeof n.version==`string`?n.version:``}`;return null}var Ze=null,Qe={byRoot:new Map,byPackage:new Map},$e=e=>`${e?._managedReportId??``}\0${e?._reportName??``}`,et=(e,t)=>`${$e(e)}\0${t}`,tt=e=>c({repo:{github:e.id}})??e.id;function nt(e,t){if(e===null)return null;let n=U(t),r=U(e),[i,a]=[r.commit.toLowerCase(),n.commit.toLowerCase()];return!j(tt(r),tt(n))||r.prefix!==n.prefix||!(i.startsWith(a)||a.startsWith(i))?null:a.length>i.length?t:e}function rt(e){let t=Array.isArray(e)?e:[];if(Ze?.length===t.length&&Ze.every(([e,n],r)=>e===t[r]&&n===e?.groups))return;Ze=t.map(e=>[e,e?.groups]);let n=new Map,r=new Map,i=(e,t,n)=>e.set(t,e.has(t)?nt(e.get(t),n):n);for(let e of t)for(let t of e?.groups??[])for(let e of t){if(!e||e._repoIgnored||oe(e,e._repoFallback))continue;let t=U(e.repo);if(!t.id||!t.commit)continue;let a=Ye(e.file),o=Xe(e.package);if(a!==null){let t=et(e,a),n=r.get(t),i=n===void 0?e.repo:n&&n.pkg===o?nt(n.repo,e.repo):null;r.set(t,i&&{repo:i,pkg:o})}o!==null&&!o.endsWith(`@`)&&i(n,o,e.repo)}Qe={byRoot:r,byPackage:n}}function it(e){return typeof e!=`number`||!Number.isFinite(e)?null:n(e)}function at(e){if(e.length<=1)return{prefix:``,stripped:[...e]};let t=e.map(e=>e.split(`/`)),n=Math.min(...t.map(e=>e.length)),r=0;for(let e=0;e<n-1&&t.every(n=>n[e]===t[0][e]);e++)r=e+1;return r>0&&t[0][r-1].startsWith(`@`)&&r--,r>0&&t[0][r-1]===`node_modules`&&r--,r===0?{prefix:``,stripped:[...e]}:{prefix:`${t[0].slice(0,r).join(`/`)}/`,stripped:t.map(e=>e.slice(r).join(`/`))}}function ot(e){return e.match(Be)?.[1]??e}var H={on:new WeakMap,off:new WeakMap};function st(e){let t=L?H.on:H.off,n=t.get(e);if(n===void 0){let r=L?[Ae(e),e.revalidateVerdict,e.revalidateRecommendation]:[];n=[e.file,e.title,e.description,e.impact,e.reproduction,tn(e),e.recommendation,e.confidenceReason,...r,e.discoveredIn,e.repo?.github].filter(Boolean).join(`
1
+ import{b as e,h as t}from"./chunk-HETCVNO4.js";import{a as n}from"./chunk-4LZK6C6N.js";import{a as r,b as i,e as a}from"./chunk-IYPY47MC.js";import{A as o,B as s,D as c,E as l,b as u,c as d,d as f,j as p,m,p as h,s as g,t as _,w as v,z as y}from"./chunk-QRKFPLA4.js";import{B as b,b as x,c as S,i as C,x as ee,z as w}from"./chunk-74AEKRES.js";import{a as T,b as E,c as D}from"./chunk-C4Z6ZBXV.js";import{c as O,f as k,g as A,i as te}from"./chunk-2XUEZHIP.js";var ne=E(class extends D{constructor(e){if(super(e),e.type!==T.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return k}});function re(e){let t=typeof e==`string`?e.trim():``;return/^[0-9a-f]{7,64}$/iu.test(t)?t:``}function ie(e){return re(e?.commit)}function j(e,t){return typeof e==`string`&&typeof t==`string`&&e!==``&&e.toLowerCase()===t.toLowerCase()}function ae(e,t){return j(t,c(e))?ie(e?.repo):``}function oe(e,t){let n=e?.advisory?.package,r=e?.repo?.github;if(typeof n!=`string`||n===``||typeof r!=`string`||r===``)return!1;let i=c({repo:{github:r}}),a=i?.split(`/`)[1].toLowerCase();return a!==n.toLowerCase()&&a!==n.replace(/^@[^/]+\//u,``).toLowerCase()?!1:!j(i,typeof t==`string`&&t!==``?c({repo:{github:t}})??t:``)}function se(e,t){if(!oe(e,t))return e;let{repo:n,...r}=e;return{...r,_repoIgnored:!0}}var ce=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`),le=e=>x(e)?e:ce(S(String(e))),M=globalThis.trustedTypes?.createPolicy(`deepview`,{createHTML:le,createScriptURL:e=>{let t=new URL(e,globalThis.location.href);if(t.origin!==globalThis.location.origin)throw TypeError(`Not a same-origin script: ${t.href}`);return t.href}}),N=e=>M?M.createHTML(e):le(e),ue=e=>M?M.createScriptURL(String(e)):e,P={showAll:!1,packagesView:!1,dependencyPackagesView:!1,flowPackagesView:!1,bundleIssues:!1,bundleLayout:`graph`,lockfileLayout:`dependencies`,bundleReason:null,bundleReasonFor:null,selected:null,focusedPkg:null,topPkgsTab:`issues`,edgeOpacity:.22,nodeSize:1,showLabels:!1,selectedSeverities:new Set,selectedColors:new Set,pathFilter:``,hidden:new Set,solo:null,graphState:null,layoutCache:null,keptViewport:null};function de({keepViewport:e=!1}={}){P.graphState?._cleanup?P.graphState._cleanup({keepViewport:e}):e||(P.keptViewport=null),P.graphState=null}function F(e){return e.id??String(e._id)}function fe(e){let t=h(e);return t!==``&&t!==`revalidation`}var pe=[{value:`confirmed`,label:`Confirmed`,kinds:[`confirmed`,`partial`,`revalidation`]},{value:`unreachable`,label:`Unreachable`,kinds:[`unreachable`]},{value:`refuted`,label:`Refuted`,kinds:[`refuted`]}];function me(e){return pe.find(t=>t.value===e)?.kinds??null}var he=[``,`exclude`,`only`];function ge(e,t){let n=me(e);return n?.includes(`partial`)?t===`only`?[`partial`]:t===`exclude`?[`confirmed`]:n:n}function I(e){if(e.confidence!==void 0)return e.confidence;if(e.critical===!0||e._source)return 10}var _e=e=>e.confidence!==void 0||e.critical===!0;function ve(e){return e.every(e=>e.every(e=>I(e)!==void 0))&&e.some(e=>e.some(_e))}function ye(e,t,n){return e.some(e=>{let r=[`refuted`,`unreachable`].includes(n(e))?0:I(e);return r===void 0?t===0:r>=t})}function be(e,t){let n=e.map(t).filter(e=>e.length>0);if(!n.some(e=>e.some(e=>I(e)!==void 0)))return 0;let r=e=>n.reduce((t,n)=>t+ +!!n.some(t=>(I(t)??-1)>=e),0),i;for(i=r(6)<=25?6:r(7)<=25?7:8;i>0&&r(i-1)===r(i);)i--;return i}function xe(e,t){return ve(e)?t:0}function Se(e,t,n){let r=new Set(e.ruledOutIds??[]);for(let t of e)for(let e of t)[`refuted`,`unreachable`].includes(n(e))&&r.add(F(e));for(let i of e){let e=t(i);if(e.length!==0&&e.some(e=>ge(`confirmed`,``).includes(n(e)||(e._source&&!e._sourcePass?`revalidation`:``)))){for(let e of i)if(r.add(F(e)),e.isApp&&Array.isArray(e.revalidateInputs))for(let t of e.revalidateInputs)t&&r.add(t)}}return r}function Ce(e,t,n,r){let i=xe(e,t),a=e.filter(e=>ye(e,i,r));if(a.length===0)return!1;let o=new Set(ge(`confirmed`,``));return e.some(e=>e.some(e=>o.has(r(e))))?a.every(e=>e.every(e=>n.has(F(e)))):!1}function we(e,{tabs:t,kindOf:n,severityMode:r}){let i=e.map(t).filter(e=>e.length>0),a=Se(e,t,n);if(!Ce(i,be(e,t),a,n))return!1;let o=xe(i,6);return i.every(e=>!ye(e,o,n)||!e.some(e=>m(e,r)!==`low`)||e.every(e=>a.has(F(e))))}function Te(e){if(!e)return e;let t="`".repeat(Math.max(0,...[...e.matchAll(/`+/gu)].map(e=>e[0].length))+1),n=/^`|`$/u.test(e)||e.startsWith(` `)&&e.endsWith(` `)&&e.trim()!==``?` `:``;return`${t}${n}${e}${n}${t}`}var L=!0;function Ee(e,t=!1){L=e!==!1&&!t}function De(){return L}function R(e){return L?h(e):``}function Oe(e){return h(e)!==``}function ke(e){return e.some(e=>(e.groups??[]).some(e=>e.some(fe)))}function Ae(e){let t=R(e);return t&&t!==`revalidation`?t:null}function je(e){return R(e)===`revalidation`}var Me=new Set([`refuted`,`unreachable`]);function Ne(e){return Me.has(R(e))}function Pe(e){return Me.has(R(e))}function Fe(e){let t=new Set(e);return pe.filter(e=>e.kinds.some(e=>t.has(e)))}function z(e){return RegExp(`(^|/)${e}/`,`u`)}function Ie(e){return RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,`u`)}var Le=z(`node_modules`),Re=z(`vendor`),B=`node_modules`,ze=z(B),Be=Ie(B);function Ve(e){e!==B&&(B=e,ze=z(e),Be=Ie(e))}var He=null;function Ue(t){He?.length===t.length&&He.every((e,n)=>e===t[n])||(He=[...t],Ve(e(t)))}function We(){return B}function V(e){return ze.test(e)}var Ge=new WeakSet;function Ke(e){let t=!1;for(let n of e??[])for(let e of n.groups??[])for(let n of e){if(n.isApp!==!1)continue;let e=Ge.has(n);`isUpstream`in n&&!e||(V(n.file)?(n.isUpstream!==!0&&(t=!0),n.isUpstream=!0,Ge.add(n)):e&&(t=!0,delete n.isUpstream,Ge.delete(n)))}return t}function qe(e){let t=typeof e==`string`?e:``;return Le.test(t)||Re.test(t)||ze.test(t)}var Je=/^(.*(?:^|\/)node_modules\/(?:@[^/]+\/[^/]+|[^/]+))(?:\/|$)/u;function Ye(e){return Je.exec(typeof e==`string`?e:``)?.[1]??null}function Xe(e){if(typeof e!=`object`||!e)return null;for(let[t,n]of Object.entries(e))if(typeof n?.name==`string`&&n.name!==``)return`${t}:${n.name}@${typeof n.version==`string`?n.version:``}`;return null}var Ze=null,Qe={byRoot:new Map,byPackage:new Map},$e=e=>`${e?._managedReportId??``}\0${e?._reportName??``}`,et=(e,t)=>`${$e(e)}\0${t}`,tt=e=>c({repo:{github:e.id}})??e.id;function nt(e,t){if(e===null)return null;let n=U(t),r=U(e),[i,a]=[r.commit.toLowerCase(),n.commit.toLowerCase()];return!j(tt(r),tt(n))||r.prefix!==n.prefix||!(i.startsWith(a)||a.startsWith(i))?null:a.length>i.length?t:e}function rt(e){let t=Array.isArray(e)?e:[];if(Ze?.length===t.length&&Ze.every(([e,n],r)=>e===t[r]&&n===e?.groups))return;Ze=t.map(e=>[e,e?.groups]);let n=new Map,r=new Map,i=(e,t,n)=>e.set(t,e.has(t)?nt(e.get(t),n):n);for(let e of t)for(let t of e?.groups??[])for(let e of t){if(!e||e._repoIgnored||oe(e,e._repoFallback))continue;let t=U(e.repo);if(!t.id||!t.commit)continue;let a=Ye(e.file),o=Xe(e.package);if(a!==null){let t=et(e,a),n=r.get(t),i=n===void 0?e.repo:n&&n.pkg===o?nt(n.repo,e.repo):null;r.set(t,i&&{repo:i,pkg:o})}o!==null&&!o.endsWith(`@`)&&i(n,o,e.repo)}Qe={byRoot:r,byPackage:n}}function it(e){return typeof e!=`number`||!Number.isFinite(e)?null:n(e)}function at(e){if(e.length<=1)return{prefix:``,stripped:[...e]};let t=e.map(e=>e.split(`/`)),n=Math.min(...t.map(e=>e.length)),r=0;for(let e=0;e<n-1&&t.every(n=>n[e]===t[0][e]);e++)r=e+1;return r>0&&t[0][r-1].startsWith(`@`)&&r--,r>0&&t[0][r-1]===`node_modules`&&r--,r===0?{prefix:``,stripped:[...e]}:{prefix:`${t[0].slice(0,r).join(`/`)}/`,stripped:t.map(e=>e.slice(r).join(`/`))}}function ot(e){return e.match(Be)?.[1]??e}var H={on:new WeakMap,off:new WeakMap};function st(e){let t=L?H.on:H.off,n=t.get(e);if(n===void 0){let r=L?[Ae(e),e.revalidateVerdict,e.revalidateRecommendation]:[];n=[e.file,e.title,e.description,e.impact,e.reproduction,tn(e),e.recommendation,e.confidenceReason,...r,e.discoveredIn,e.repo?.github].filter(Boolean).join(`
2
2
  `).toLowerCase(),t.set(e,n)}return n}function ct(e){H.on.delete(e),H.off.delete(e)}function lt(e){return[typeof e?.category==`string`?e.category.trim():``,g(e,L)].filter(Boolean).join(` · `)}function ut(e){if(e.length===0)return``;let t=e[0];for(let n=1;n<e.length;n++){for(;t&&!e[n].startsWith(t);)t=t.slice(0,-1);if(!t)return``}return t}function dt(e){if(!e)return``;let t=e.match(/github\.com\/([^/?#]+\/[^/?#]+?)(?:\.git)?(?:[/?#]|$)/iu);return t?t[1]:e}function ft(e){if(!e)return null;let t=e.trim().replace(/\/$/u,``);return t?/^https?:\/\//iu.test(t)?t:/^github\.com\//iu.test(t)?`https://${t}`:`https://github.com/${t}`:null}var pt=/^(?:@[\w.-]+\/)?[\w.-]+@[^/\s@]+$/u;function mt(e){return pt.test(e||``)}function U(e){if(e==null||typeof e==`string`)return{id:e??``,prefix:``,commit:``};let t=l(e);return{id:typeof e.github==`string`?e.github:``,prefix:t?`${t}/`:``,commit:ie(e)}}function ht(e,t,n,r=``){if(mt(e))return null;let i=U(t),a=U(n),o=re(r);if(i.id){let t=c({repo:{github:i.id}}),n=ft(t??i.id),r=j(t,c({repo:{github:a.id}}));return`${n}/blob/${i.commit||(r?a.commit:``)||(r||!qe(e)?o:``)||`HEAD`}/${i.prefix}${ot(e)}`}if(V(e))return null;let s=ft(a.id);return s?`${s}/blob/${a.commit||o||`HEAD`}/${a.prefix}${e}`:null}function gt(e,t){let n=e?.file??``,r=W(e,t);return r?O`<a href="${_t(r)}" target="_blank" rel="noopener">${n}</a>`:n}function _t(e){return e.replace(/#L\d+(?:-L?\d+)?$/u,``)}function vt({start:e,end:t}){return t>e?`#L${e}-L${t}`:`#L${e}`}function W(e,t){if(!e)return null;if(s(e.location))return e.location;let n=ht(e.file,e.repo,t,e.auditedCommit);if(!n)return null;let r=q(e.line);if(r)return`${n}${vt(r)}`;let i=parseInt(e.line,10);return Number.isFinite(i)?`${n}#L${i}`:n}var yt=/^https?:\/\/(?:www\.)?github\.com\/([^/\s]+\/[^/\s]+)\/(?:blob|tree|blame)\/[^/\s]+\/(\S+)$/u,bt=/#L(\d+)(?:-L?(\d+))?$/u;function xt(e){let t=typeof e==`string`?yt.exec(e):null;if(!t)return``;let n=t[2],r=bt.exec(n);if(!r)return`${t[1]}/${n}`;n=n.slice(0,r.index);let i=r[2]?`${r[1]}-${r[2]}`:r[1];return`${t[1]}/${n}:${i}`}var St=/^(?:\s+\S|[-*+] |\d+[.)] |>|#{1,6}(?:[ \t]|$)|\||`{3}|~{3})/u;function Ct(e){return e.split(/(\n{2,})/u).map(e=>{if(/^\n+$/u.test(e))return e;let t=e.split(`
3
3
  `);return t.some(e=>St.test(e)||K.test(e))?e:t.map(e=>e.trim()).filter(Boolean).join(` `)}).join(``)}function wt(e,t,n){let r=t?/^\n*/u.exec(e)[0]:``,i=e.slice(r.length),a=n?/\n*$/u.exec(i)[0]:``;return r+Ct(i.slice(0,i.length-a.length))+a}function Tt(e){if(!e)return e;let t=e.replaceAll(`\r
4
4
  `,`
@@ -0,0 +1 @@
1
+ import{f as e,g as t,j as n,k as r,l as i,m as a}from"./chunk-PXK7EU4V.js";var o=t,s=t?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):null,{isWellFormed:c}=String.prototype;function l(e,t,n){if(t||e.length===n.length)return n;if(c){if(c.call(e))return n;throw TypeError(i)}let r=0,a=n.length-3;for(;r<=a;){let t=n.indexOf(239,r);if(t===-1||t>a)break;if(r=t+1,n[t+1]===191&&n[t+2]===189){if(e===d(n))return n;throw TypeError(i)}}return n}function u(t,n=!1){if(typeof t!=`string`)throw TypeError(r);return t.length===0?new Uint8Array:l(t,n,e.encode(t))}function d(e,t=!1){return n(e),e.byteLength===0?``:t?o.decode(e):s.decode(e)}var f=(e,t=`uint8`)=>a(u(e,!1),t),p=(e,t=`uint8`)=>a(u(e,!0),t),m=e=>d(e,!1),h=e=>d(e,!0);export{f as a,p as b,m as c,h as d};
@@ -0,0 +1,2 @@
1
+ import{c as e}from"./chunk-7YFJUT2P.js";import{a as t,g as n,h as r}from"./chunk-PQPKHAI5.js";import{l as i}from"./chunk-WFDXHPT2.js";function a(e,t){return e?e.base===``?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}var o=(e,t)=>`${`../`.repeat(e.base.split(`/`).length-1)}${t}`;function s({root:e,paths:t},n,r){if(!e||n===`.`)return n;for(let e of r){let r=t.get(`${n}/${e}`);if(r?.endsWith(`/${e}`))return r.slice(0,-e.length-1)}let i=a(e,`${n}/`);return i===null?o(e,n):i.slice(0,-1)||`.`}function c(e,t){if(!e)return{prefix:t,from:null,to:null};let n=t.startsWith(e.other)?t:``;return{prefix:n,from:`./${e.base}${n.slice(e.other.length)}`,to:`./${n||e.other}`}}function l(e){let t=i(e),n=new Map;for(let[r,i]of Object.entries(e?.bundle?.reason??{})){let e=new Set(Array.isArray(i)?i.filter(e=>t.has(e)):[]);e.size>0&&n.set(r,e)}return{stasis:e?.kind===`stasis`,files:t,trees:n}}var u=[[`extra`,`add`],[`metro`,`bundle:metro`]];function d(e){if(e.length!==2)return e;let t=(t,n)=>e.find((r,i)=>r.trees.has(n)&&!r.trees.has(t)&&e[1-i].trees.has(t)&&!e[1-i].trees.has(n)),n=e.map(()=>new Map);for(let[r,i]of u){let a=t(r,i);a&&n[e.indexOf(a)].set(i,r)}let r=t(`metro`,`bundle:metro`);return r&&t(`run`,`bundle`)===r&&n[e.indexOf(r)].set(`bundle`,`run`),e.map((e,t)=>n[t].size===0?e:{...e,trees:new Map([...e.trees].map(([e,r])=>[n[t].get(e)??e,r])),actual:new Map([...n[t]].map(([e,t])=>[t,e]))})}function f(e,t){if(!e.stasis||e.trees.size!==1)return null;let[[n,r]]=e.trees;return r.size===e.files.size&&!t.some(t=>t!==e&&t.trees.has(n))?n:null}var p=e=>e.trees.size===0||e.trees.size===1&&[...e.trees.values()][0].size===e.files.size,m=`reasons:`,h=(e,t)=>`${m}${JSON.stringify([e,t].toSorted())}`;function g(e){if(!e.startsWith(m))return null;try{let t=JSON.parse(e.slice(m.length));return Array.isArray(t)&&t.length===2&&t.every(e=>typeof e==`string`)?t:null}catch{return null}}function _(...e){let t=d(e.map(l));if(t.length===2&&!t.some(p)){let[e,n]=t.map(e=>[...e.trees.keys()].toSorted()),r=e.filter(e=>n.includes(e)),[i,a]=[e,n].map(e=>e.filter(e=>!r.includes(e)));if(i.length>0&&a.length>0)return[...r.map(e=>({id:`reason:${e}`,label:e})),...i.flatMap(e=>a.map(t=>({id:h(e,t),label:`${e} \u2192 ${t}`})))]}let n=t.filter(e=>f(e,t)===null),r=new Set(n.flatMap(e=>[...e.trees.keys()])),i=e=>n.some(t=>t.stasis&&(t.trees.get(e)?.size??0)<t.files.size);return[...r].some(i)?[...r].toSorted().map(e=>({id:`reason:${e}`,label:e})):[]}function v(e,t,n=``){if(!n)return[``,``];let r=g(n),i=d([e,t].map(l)),a=n.startsWith(`reason:`)?n.slice(7):null;return i.map(e=>{let t=r?r.find(t=>e.trees.has(t)):f(e,i)??a;return t==null?n:`reason:${e.actual?.get(t)??t}`})}function y(e,t=``){let n=i(e);if(!t||e?.kind!==`stasis`)return n;let r=e?.bundle?.reason?.[t.replace(/^reason:/u,``)],a=new Set(Array.isArray(r)?r:[]);return new Map([...n].filter(([e])=>a.has(e)))}function b(e,t,n,r){return JSON.stringify([e,t,n,r])}function x(e,t=``){let n=new Map;if(e?.kind!==`stasis`||!e.bundle)return n;let r=t?i(e):null,a=t?y(e,t):null;for(let[t,i]of e.bundle.imports)for(let[e,o]of i)for(let[i,s]of o){let o=typeof s==`string`?[[null,s]]:s;for(let[s,c]of o){if(a&&!a.has(e)&&(r.has(e)||!a.has(c)))continue;let o=b(e,i,t,s);n.set(o,{key:o,parent:e,specifier:i,conditions:t,platform:s,target:c})}}return n}var S=(e,{lo:t,start:n},r)=>e[n+(r-t)/2];function C(e,t,{low:n,high:r},i,a){return e===-t||e-1<n||e!==t&&e+1<=r&&S(i,a,e-1)<S(i,a,e+1)?e+1:e-1}function w(e,t,n,{first:r,n:i,m:a,d:o,...s}){e.a.fill(1,0,r).fill(1,i),e.b.fill(1,0,r).fill(1,a);let c=i,l=a;for(let r=o;r>0;r--){let i=c-l,a=C(i,r,s,t,n[r]),o=S(t,n[r],a);for(let t=a>i?o:o+1;t<c;t++)e.a[t]=e.b[t-i]=1;c=o,l=c-a}for(let t=r;t<c;t++)e.a[t]=e.b[t]=1}function T(e,t,n){let r=0,i=t.length,a=e.length,o=2*(a+i);for(;r<a&&r<i&&e[r]===t[r];)r++;for(;a>r&&i>r&&e[a-1]===t[i-1];)a--,i--;let s={high:a-r,low:r-i},c=[r],l=[{lo:1,start:0}];for(let u=0;u<=s.high-s.low;u++){let d=l[u],f=Math.min(u,s.high),p=Math.max(-u,s.low+(s.low+u&1));l.push({lo:p,start:c.length});for(let m=p;m<=f;m+=2){let f=C(m,u,s,c,d),p=S(c,d,f),h=f>m?p:p+1,g=h;for(;h<a&&h-m<i&&e[h]===t[h-m];)h++;if(o+=2+h-g,c.push(h),h>=a&&h-m>=i)return w(n,c,l,{first:r,n:a,m:i,d:u,...s}),o}}throw Error(`no edit script between two lines`)}var E=/[\p{L}\p{N}_$]+|\s+|[^\p{L}\p{N}_$\s]/gu,ee=2e3,D=800,O=.6;function k(e,t){if(e.length>ee)return null;let n=e.match(E)??[];return n.length>D?null:{line:e,tokens:n,words:n.map(e=>(t.has(e)||t.set(e,t.size),t.get(e)))}}function A({tokens:e,line:t},n){let r=[];for(let i=0,a=0;a<e.length;i+=e[a++].length){if(n[a])continue;let o=r.at(-1);o&&/^\s*$/u.test(t.slice(o[1],i))?o[1]=i+e[a].length:r.push([i,i+e[a].length])}return r}var j=(e,t)=>e.reduce((e,[t,n])=>e+n-t,0)/Math.max(1,t.length);function M(e,t){let n={a:e.words.map(()=>0),b:t.words.map(()=>0)},r=T(e.words,t.words,n),i={a:A(e,n.a),b:A(t,n.b)};return{ranges:i,share:n.a.includes(1)?Math.min(j(i.a,e.line),j(i.b,t.line)):1,steps:r}}function N(e,t){if(e===t)return{a:[],b:[]};let n=new Map,r=k(e,n),i=k(t,n);if(r===null||i===null)return null;let{ranges:a,share:o}=M(r,i);return o<=O?a:null}var P=200,te=5e6,F=6,I=60,L=3;function R(e){let t=new Map;for(let n of e?.tokens??[])t.set(n,(t.get(n)??0)+1);return t}function z(e,t){let n=new Map,r=[e,t].map(e=>e.map(e=>k(e,n))),i=r.map(e=>e.map(R)),a=0,o=(e,t,n)=>{let r=0;for(let[i,o]of e)if(a+=L,(r+=i.length*Math.max(0,o-(t.get(i)??0)))>O*n.length)return 1/0;return r/Math.max(1,n.length)},s=(n,a)=>r[0][n]===null||r[1][a]===null?1/0:Math.min(o(i[0][n],i[1][a],e[n]),o(i[1][a],i[0][n],t[a])),c=(e,t)=>{if(a+=I,s(e,t)===1/0)return 1/0;let{share:n,steps:i}=M(r[0][e],r[1][t]);return a+=i,n<=O?n:1/0},l=new Float64Array(e.length*t.length).fill(NaN);return{share:(n,r)=>{let i=n*t.length+r;return Number.isNaN(l[i])&&(l[i]=e[n]===t[r]?0:c(n,r)),l[i]},floor:s,spent:()=>a}}function B(e,t,{share:n,spent:r}){let i=Array.from({length:e+1},()=>new Float64Array(t+1)),a=(e,t)=>n(e,t)===1/0?-1/0:1e3-n(e,t)+i[e][t];for(let n=0;n<e;n++)for(let e=0;e<t;e++)if(i[n+1][e+1]=Math.max(i[n][e+1],i[n+1][e],a(n,e)),r()>te)return null;let o=[];for(let n=e,r=t;n>0&&r>0;)i[n][r]===i[n][r-1]?r--:i[n][r]===i[n-1][r]?n--:o.push([--n,--r]);return o.toReversed()}function V(e,t,{share:n,floor:r}){let i=[];for(let a=0,o=0;a<e&&o<t;a++){let e=null,s=1/0,c=Array.from({length:Math.min(t,o+F)-o},(e,t)=>[o+t,r(a,o+t)]);for(let[t,r]of c.toSorted((e,t)=>e[1]-t[1]||e[0]-t[0])){if(r>s)break;(n(a,t)<s||n(a,t)===s&&t<e)&&([e,s]=[t,n(a,t)])}e!==null&&(i.push([a,e]),o=e+1)}return i}function H(e,t){if(e.length>P||t.length>P)return[];let n=z(e,t);return B(e.length,t.length,n)??V(e.length,t.length,n)}var U=(e,t,r)=>n(e,t,{...r,discard:!1});function W(t){if(t===null)return``;let n=t.type===`symlink`?t.target:t.data;if(typeof n==`string`)return n.includes(`\0`)?void 0:n;if(!n.includes(0))try{return e(n)}catch{return}}var G=new Set([`none`,`all`,`change`,`trailing`]);function K({horizon:e=1/0,whitespace:t=`none`,ignoreCase:n=!1}={}){if(e!==1/0&&!(Number.isSafeInteger(e)&&e>=0))throw RangeError(`horizon must be a whole number or Infinity, not ${e}`);if(!G.has(t))throw RangeError(`whitespace must be 'none', 'all', 'change' or 'trailing', not ${t}`);if(typeof n!=`boolean`)throw TypeError(`ignoreCase must be a boolean, not ${typeof n}`);return{horizon:e,whitespace:t,ignoreCase:n}}var q=e=>e.reduce((e,{a0:t,a1:n,b0:r,b1:i})=>e+n-t+i-r,0),J=e=>e===``?[]:e.split(/(?<=\n)/u),Y=e=>({...e,ignoreCase:!1,whitespace:`none`}),X=e=>(e.whitespace??`none`)!==`none`||!!e.ignoreCase;function Z(e,n,i,{whitespace:a,ignoreCase:o}){try{return r(e,n,i,{format:`normal`,ignoreCase:o,whitespace:a}),!0}catch(e){if(e instanceof t)return!1;throw e}}function ne(e,t,n,r,i){let a=J(e),o=J(t),s=(e,t,n,r)=>({a0:e,a1:t,b0:n,b1:r,remove:a.slice(e,t),insert:o.slice(n,r)}),c=i.flatMap(({a0:e,a1:t,b0:r,b1:i})=>e===t||r===i?[s(e,t,r,i)]:U(a.slice(e,t).join(``),o.slice(r,i).join(``),n).map(t=>s(e+t.a0,e+t.a1,r+t.b0,r+t.b1))),l=q(c)<q(r)&&Z(e,t,c,n)?c:r;return q(l)<q(i)?l:i}function re(e,t,n){let r=U(e,t,n);return X(n)?ne(e,t,n,r,U(e,t,Y(n))):r}function ie(e,t,n){let r=W(e),i=W(t);if(r===void 0||i===void 0)return{binary:!0,blocks:[],insertions:null,deletions:null};let a=r===i?[]:re(r,i,n),o=0,s=0;for(let{a0:e,a1:t,b0:n,b1:r}of a)s+=r-n,o+=t-e;return{binary:!1,blocks:a,insertions:s,deletions:o}}function ae(e,t,n,r){return Z(e,t,n,K(r))}var Q=/[ \t\n\v\f\r]/u,$=e=>{let t=e.split(`
2
+ `);return t.at(-1)===``&&t.pop(),t};function oe(e,t){for(let n=0,r=0;;n++,r++){let i=``,a=``;for(;n<e.length&&Q.test(e[n]);)i+=e[n++];for(;r<t.length&&Q.test(t[r]);)a+=t[r++];if(i!==a&&new Set(i+a).size>1)return!0;if(n>=e.length||r>=t.length)return!1}}function se(e,t,n){try{if(!ae(e,t,n,{whitespace:`all`}))return!0}catch{return!0}let r=$(e),i=$(t),a=0,o=0;for(let e=0;e<=n.length;e++){let t=e<n.length?n[e].a0:r.length;for(;a<t;a++,o++)if(r[a]!==i[o]&&oe(r[a],i[o]))return!0;e<n.length&&({a1:a,b1:o}=n[e])}return!1}function ce(e,t,{extension:n=!0}={}){let r=e.split(`/`),i=t.split(`/`),a=0;for(;a<r.length-1&&a<i.length-1&&r[a]===i[a];)a++;let o=0;for(;o<r.length-a-1&&o<i.length-a-1&&r.at(-1-o)===i.at(-1-o);)o++;let s={head:a?`${r.slice(0,a).join(`/`)}/`:``,from:r.slice(a,r.length-o).join(`/`),to:i.slice(a,i.length-o).join(`/`),tail:o?`/${r.slice(-o).join(`/`)}`:``},c=s.from.lastIndexOf(`.`);return n&&!s.from.includes(`/`)&&!s.to.includes(`/`)&&c>0&&s.to.lastIndexOf(`.`)===c&&s.from.slice(0,c)===s.to.slice(0,c)?{...s,head:s.head+s.from.slice(0,c),from:s.from.slice(c),to:s.to.slice(c)}:s}export{N as a,H as b,W as c,K as d,ie as e,se as f,ce as g,a as h,o as i,s as j,c as k,_ as l,v as m,y as n,b as o,x as p};