@preventive/triage 1.0.0-alpha.52 → 1.0.0-alpha.54

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 (112) hide show
  1. package/common/bundle-compare-diff.js +28 -9
  2. package/common/bundle-compare-inputs.d.ts +1 -0
  3. package/common/bundle-compare-inputs.js +91 -15
  4. package/common/bundle-comparison.js +14 -7
  5. package/common/default-scan-models.ts +3 -0
  6. package/common/dependency-reviews.d.ts +1 -1
  7. package/common/dependency-reviews.js +1 -1
  8. package/common/managed/finding-detail.d.ts +4 -2
  9. package/common/managed/finding-detail.js +27 -15
  10. package/common/managed/team-app.d.ts +9 -0
  11. package/common/managed/team-app.js +59 -6
  12. package/common/workspace-app.js +38 -6
  13. package/out/activity.js +4 -4
  14. package/out/chunk-4EMM6UCD.js +1 -0
  15. package/out/chunk-4ISO5F7Y.js +7 -0
  16. package/out/chunk-4XIH7YTX.js +1 -0
  17. package/out/chunk-6W5BMATD.js +1 -0
  18. package/out/{chunk-WFYLMF6Z.js → chunk-74AEKRES.js} +1 -1
  19. package/out/chunk-DEVAORP2.js +1 -0
  20. package/out/{chunk-KOGNQDSJ.js → chunk-DTM47KGS.js} +1 -1
  21. package/out/chunk-E3LFSUDJ.js +9 -0
  22. package/out/chunk-FHIVVVUA.js +6 -0
  23. package/out/chunk-G3LY2FV4.js +1 -0
  24. package/out/chunk-HAZKDK4M.js +4 -0
  25. package/out/chunk-HOB3YPS5.js +1 -0
  26. package/out/chunk-I47TYPXO.js +52 -0
  27. package/out/chunk-J7A5OSZE.js +244 -0
  28. package/out/chunk-JFL7WLRV.js +1 -0
  29. package/out/chunk-JMG5DXII.js +2 -0
  30. package/out/chunk-JOXLZXMI.js +1 -0
  31. package/out/chunk-L4CTEMRG.js +2 -0
  32. package/out/chunk-M37X4LCF.js +14 -0
  33. package/out/chunk-M3Y6SLC4.js +1 -0
  34. package/out/chunk-NXATZJQ2.js +1 -0
  35. package/out/{chunk-MYGJBYYJ.js → chunk-ORIP5INC.js} +1 -1
  36. package/out/chunk-PAD2JHZT.js +1 -0
  37. package/out/chunk-QMVOEBWC.js +13 -0
  38. package/out/{chunk-SXV2T5C4.js → chunk-QRKFPLA4.js} +1 -1
  39. package/out/chunk-RRBIJL2B.js +1 -0
  40. package/out/{chunk-GDPCLSOS.js → chunk-SYXT3SFP.js} +1 -1
  41. package/out/chunk-TOXMUOIW.js +5 -0
  42. package/out/chunk-UBOCLLF2.js +1 -0
  43. package/out/chunk-UCP3JRE2.js +1 -0
  44. package/out/{chunk-NCN3M5EP.js → chunk-VC72ZO3P.js} +2 -2
  45. package/out/chunk-VRX2APNA.js +9 -0
  46. package/out/{chunk-IMM274IW.js → chunk-VZMELPVL.js} +4 -3
  47. package/out/{chunk-CHRBUGVN.js → chunk-WHVXTJHK.js} +1 -1
  48. package/out/chunk-WMFDQS2L.js +11 -0
  49. package/out/chunk-WNSVBOSO.js +41 -0
  50. package/out/chunk-WREU7JAG.js +1 -0
  51. package/out/chunk-Y5ZHFNBD.js +2 -0
  52. package/out/chunk-YF4M5OCI.js +1 -0
  53. package/out/chunk-Z667U2UJ.js +1 -0
  54. package/out/chunk-ZQHLECTI.js +1 -0
  55. package/out/client-managed-import.js +1 -1
  56. package/out/client-managed.js +27 -26
  57. package/out/compare.js +14 -14
  58. package/out/dialogs.js +36 -51
  59. package/out/graph.js +17 -15
  60. package/out/index.html +26 -10
  61. package/out/prism.js +1 -1
  62. package/out/scan.js +2 -2
  63. package/out/terminal.js +232 -232
  64. package/out/view.css +1 -1
  65. package/out/view.js +15 -15
  66. package/package.json +12 -7
  67. package/risk/actions/resolve.js +36 -5
  68. package/risk/index.d.ts +20 -2
  69. package/risk/npm/malware.js +6 -4
  70. package/risk/npm/registry.js +8 -6
  71. package/server-managed/bundle-advisories.ts +56 -74
  72. package/server-managed/bundle-build-worker.js +61 -4
  73. package/server-managed/bundle-build.ts +13 -4
  74. package/server-managed/bundle-dependency-reviews.ts +74 -0
  75. package/server-managed/bundle-validation.ts +32 -0
  76. package/server-managed/db-methods.ts +51 -16
  77. package/server-managed/db-neon.ts +18 -2
  78. package/server-managed/db.ts +11 -2
  79. package/server-managed/github-issue-links.ts +151 -47
  80. package/server-managed/github-pulls.ts +34 -15
  81. package/server-managed/history-windows.ts +172 -0
  82. package/server-managed/http.ts +227 -12
  83. package/server-managed/index.ts +13 -1
  84. package/server-managed/managed-issues.ts +29 -15
  85. package/server-managed/npm-insights.ts +4 -3
  86. package/server-managed/npm-kept.ts +4 -0
  87. package/server-managed/package-entry-points.ts +37 -9
  88. package/server-managed/pretty-print.ts +7 -5
  89. package/server-managed/public-workspace.ts +2 -2
  90. package/server-managed/repository-actions.ts +7 -4
  91. package/server-managed/repository-browser.ts +11 -4
  92. package/server-managed/repository-history.ts +2 -2
  93. package/server-managed/repository-pulse.ts +11 -2
  94. package/server-managed/repository-risk-audit.ts +4 -5
  95. package/server-managed/repository-risk.ts +4 -4
  96. package/server-managed/sql.ts +2 -1
  97. package/server-managed/stasis-config.ts +46 -0
  98. package/server-managed/team-app-summaries.ts +54 -0
  99. package/server-managed/team-app.ts +52 -31
  100. package/server-managed/team-reports.ts +34 -13
  101. package/server-managed/upstream-cache.ts +41 -32
  102. package/server-managed/workspace-shares.ts +3 -1
  103. package/out/chunk-2ZDZWLFY.js +0 -1
  104. package/out/chunk-7VAWINQF.js +0 -6
  105. package/out/chunk-FMXWXDR4.js +0 -36
  106. package/out/chunk-IZ7POWI3.js +0 -18
  107. package/out/chunk-LJ7XRXFU.js +0 -52
  108. package/out/chunk-OGAYMEER.js +0 -232
  109. package/out/chunk-QB4CBOX2.js +0 -1
  110. package/out/chunk-TQJDYHVE.js +0 -2
  111. package/out/chunk-VH4XMZIW.js +0 -2
  112. package/out/chunk-WYLQWYLA.js +0 -1
@@ -0,0 +1 @@
1
+ import{f as e,i as t,j as n}from"./chunk-JOXLZXMI.js";import{C as r,D as i,Q as a,s as o}from"./chunk-UCP3JRE2.js";import{d as s,f as c,h as l}from"./chunk-JMG5DXII.js";var u=`[0-9]+`,d=`[-_.]?(alpha|a|beta|b|preview|pre|c|rc)[-_.]?(${u})?`,f=`-(${u})|[-_.]?(post|rev|r)[-_.]?(${u})?`,p=`[-_.]?dev[-_.]?(${u})?`,ee=RegExp(`^v?(?:(${u})!)?(${u}(?:\\.${u})*)(?:${d})?(?:${f})?(?:(${p}))?(?:\\+([a-z0-9]+(?:[-_.][a-z0-9]+)*))?$`,`iu`),m={__proto__:null,alpha:`a`,a:`a`,beta:`b`,b:`b`,preview:`rc`,pre:`rc`,c:`rc`,rc:`rc`},h=e=>e.replace(/^0+(?=\d)/u,``);function g(e){let t=/^[\0-\u007F]*$/u.test(e)?ee.exec(e):null;if(t===null)return;let[,n,r,i,a,o,s,c,l,u,d]=t;return{epoch:h(n??`0`),release:r.split(`.`).map(h),pre:i===void 0?void 0:`${m[i.toLowerCase()]}${h(a??`0`)}`,post:o===void 0&&s===void 0?void 0:h(o??c??`0`),dev:l===void 0?void 0:h(u??`0`),local:d?.toLowerCase().split(/[-_.]/u).map(e=>/^\d+$/u.test(e)?h(e):e)}}function _({epoch:e,release:t,pre:n,post:r,dev:i,local:a}){let o=e===`0`?``:`${e}!`;return o+=t.join(`.`),n!==void 0&&(o+=n),r!==void 0&&(o+=`.post${r}`),i!==void 0&&(o+=`.dev${i}`),a!==void 0&&(o+=`+${a.join(`.`)}`),o}function v(e){let t=e.release.length;for(;t>1&&e.release[t-1]===`0`;)t--;return _({...e,release:e.release.slice(0,t)})}var y=e=>v(g(e)),b=n(e=>g(e)!==void 0,`a version`);function x(e,t){let n=_(g(b(e,t)));if(n!==e)throw new s(`${l(e)} is not a version in normal form, ${l(n)}`,t);return e}function S(e){let[t,n]=[0,e.length];for(;t<n&&(e[t]===` `||e[t]===` `);)t++;for(;n>t&&(e[n-1]===` `||e[n-1]===` `);)n--;return e.slice(t,n)}var C=/^v?(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*\.\*$/iu,w=/^(===|~=|==|!=|<=|>=|<|>)[ \t]*(.*)$/su;function te(e){let t=w.exec(e);if(t===null)return!1;let[,n,r]=t;if(n===`===`)return/^[^\s;)]+$/u.test(r);if((n===`==`||n===`!=`)&&C.test(r))return!0;let i=g(r);return i!==void 0&&(n!==`~=`||i.release.length>=2)&&(i.local===void 0||n===`==`||n===`!=`)}var T=e=>e.split(`,`).every(e=>te(S(e))),E=n(T,`a list of version specifiers`),D=/^(?:[\dA-Za-z]|[\dA-Za-z][\w.-]*[\dA-Za-z])$/u,O=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,k=e=>D.test(e),A=e=>e.toLowerCase().replace(/[-_.]+/gu,`-`),j=n(k,`a package name`);function M(t,n){if(!O.test(e(t,n)))throw new s(k(t)?`${l(t)} is not a name in normal form, ${l(A(t))}`:`${l(t)} is not a name`,n);return t}var N=new Set([`python_version`,`python_full_version`,`os_name`,`sys_platform`,`platform_release`,`platform_system`,`platform_version`,`platform_machine`,`platform_python_implementation`,`implementation_name`,`implementation_version`,`extra`,`extras`,`dependency_groups`]),P=new Set([`and`,`or`,`in`,`not`]),F=/[ \t]*(?:([()])|('[^']*'|"[^"]*")|(===|==|!=|<=|>=|~=|<|>)|([A-Za-z_][\w.]*)|(.|$))/gsuy,I=64;function L(e){let t=[];for(let[,n,r,i,a,o]of e.matchAll(F)){if(o===``)break;if(n!==void 0)t.push(n);else if(r!==void 0)t.push(`string`);else if(i!==void 0)t.push(`op`);else if(P.has(a))t.push(a);else if(N.has(a))t.push(`variable`);else return}return t}function R(e,t,n){let r=B(e,t,n);for(;r!==-1&&(e[r]===`and`||e[r]===`or`);)r=B(e,r+1,n);return r}var z=(e,t)=>e===`variable`&&t===`string`||e===`string`&&t===`variable`;function B(e,t,n){if(e[t]===`(`){if(n>=I)return-1;let r=R(e,t+1,n+1);return r!==-1&&e[r]===`)`?r+1:-1}let r=e[t+1],i=r===`op`||r===`in`?1:r===`not`&&e[t+2]===`in`?2:0;return i>0&&z(e[t],e[t+1+i])?t+1+i+1:-1}function V(e){let t=/[[\p{Cc}\p{Zl}\p{Zp}]--\t]/v.test(e)?void 0:L(e);return t!==void 0&&t.length>0&&R(t,0,0)===t.length}var H=n(V,`an environment marker`),U=/^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?[ \t]*(?:\[([^\]]*)\])?[ \t]*(.*)$/su;function W(e){let[,t,n]=U.exec(e)??[];if(n===void 0||t!==void 0&&S(t)!==``&&!t.split(`,`).every(e=>k(S(e))))return!1;if(n.startsWith(`@`)){let[,e,t]=/^@[ \t]*([^ \t]*)(.*)$/su.exec(n),r=/^(?:[ \t]+;[ \t]*(.*))?$/su.exec(t);return URL.canParse(e)&&r!==null&&(r[1]===void 0||V(r[1]))}let r=n.indexOf(`;`),i=S(r===-1?n:n.slice(0,r));if(i.startsWith(`(`)){if(!i.endsWith(`)`))return!1;i=i.slice(1,-1)}return(i===``||T(i))&&(r===-1||V(S(n.slice(r+1))))}var G=n(W,`a requirement`),K=/^([\w.]+)-([^-]*)(?:-\d[^-]*)?-[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?:-\w+(?:\.\w+)*){2}\.whl$/u;function q(e){let[,t,n]=K.exec(e)??[];if(t===void 0||t.includes(`__`))return;let r=g(n);return r===void 0?void 0:{name:A(t),version:r}}function J(e){let t=/^(.*)\.(?:tar\.gz|zip)$/su.exec(e)?.[1],n=t?.lastIndexOf(`-`)??-1;if(n===-1)return;let r=g(t.slice(n+1));return r===void 0?void 0:{name:A(t.slice(0,n)),version:r}}var Y={__proto__:null,md5:32,sha1:40,sha224:56,sha256:64,sha384:96,sha512:128,sha3_224:56,sha3_256:64,sha3_384:96,sha3_512:128,blake2b:128,blake2s:64};function X(e,t,n,r){if(t.length!==n||!/^[\da-f]*$/u.test(t))throw new s(`${l(t)} is not a ${e} digest in lowercase hex`,r);return t}function Z(t,n,r){let i=e(t,n).indexOf(`:`),a=t.slice(0,i);if(i===-1||!Object.hasOwn(r,a))throw new s(`${l(t)} is not a hash of ${Object.keys(r).join(`, `)}`,n);return X(a,t.slice(i+1),r[a],n),t}var ne=o(t)(a,`an http(s) URL`);function Q(t,n){if(/^(?:\/|\\|[A-Za-z]:)/u.test(e(t,n)))throw new s(`${l(t)} is absolute, and only reads on the machine that wrote it`,n);return r(t,n)}var re=(e,t)=>i(Q(e,t),t),$=e=>e.slice(e.lastIndexOf(`/`)+1);function ie({name:e,path:t,pathname:n}){return e===void 0?t===void 0?c(()=>decodeURIComponent($(n)),()=>{}):$(t):e}export{v as a,y as b,b as c,x as d,E as e,A as f,j as g,M as h,H as i,G as j,q as k,J as l,Y as m,X as n,Z as o,ne as p,Q as q,re as r,ie as s};
@@ -0,0 +1,2 @@
1
+ var e=/[\p{Cc}\p{Zl}\p{Zp}\p{Bidi_Control}]/gu,t=(e,t)=>e.length>t?e.slice(0,e.codePointAt(t-1)>65535?t-1:t):e,n=e=>`U+${e.codePointAt(0).toString(16).toUpperCase().padStart(4,`0`)}`,r=t=>JSON.stringify(t).replaceAll(e,e=>`\\u${e.codePointAt(0).toString(16).padStart(4,`0`)}`);function i(e){let n=t(e,64);return n===e?r(e):`${r(n)}...`}var a=class extends Error{constructor(e,t){super(t===void 0?e:`${e} at line ${t+1}`),this.name=new.target.name,this.line=t}},o=class extends Error{constructor(e,t){super(t===void 0?e:`${t}: ${e}`),this.name=`LockfileError`,this.where=t}},s=(e,t)=>{throw new o(e,t)};function c(e,t){try{return e()}catch(e){return t(e)}}var l=(e,t)=>c(e,e=>{throw e instanceof o&&e.where===void 0?new o(e.message,t):e});function u(e){let n=t(e,200);return r(n===e?e:`${n}\u2026`)}var d=/^[A-Za-z_$][\w$]*$/u;function f(e,t){return d.test(t)?e===``?t:`${e}.${t}`:`${e}[${u(t)}]`}var p=(e,t)=>new o(`${e} at line ${Math.max(t,0)+1}`),m=/[\p{Cc}\p{Cs}\uFEFF\uFFFE\uFFFF\u2028\u2029]/u,h=[`<<<<<<<`,`=======`,`>>>>>>>`];function g(e,t){if(h.every(t=>e.includes(t)))throw new o(`${t} reads a file with ${h.map(e=>u(e)).join(`, `)} in it as a merge conflict`)}function _(e,t){let n=/^\{(\r?\n)([\t ]+)"/u.exec(e);if(n===null)throw p(`expected "{" alone on the first line and an indented key on the next, as ${t} writes the file`,0);return n.slice(1)}function v(e,t){t.lastIndex=e.pos;let n=t.exec(e.text);return n!==null&&(e.pos=t.lastIndex),n}var y=(e,t)=>t<e.length?u(e.slice(t)):`the end of the line`,b=e=>/^ */u.exec(e)[0].length,x=2**20,S=(e,t)=>({text:e,forbidden:t,pos:0,number:-1,line:void 0,crlf:void 0});function C(e){let{text:t,pos:r}=e;if(e.line=void 0,r>=t.length)return;let i=t.indexOf(`
2
+ `,r);i===-1&&(i=t.length),e.pos=i+1,e.number++;let a=i<t.length&&t[i-1]===`\r`,o=t.slice(r,a?i-1:i);if(o.length>x)throw p(`a line longer than ${x} characters`,e.number);let s=e.forbidden.exec(o)?.[0];if(s!==void 0)throw p(`${n(s)} is not allowed`,e.number);if(i<t.length&&a!==(e.crlf??=a))throw p(`a ${a?`CRLF`:`LF`} line end, after ${e.crlf?`CRLF`:`LF`} ones`,e.number);e.line=o}function w(e,t,n){let r=t+1;for(;r<e.length&&e[r]!==`"`;)r+=e[r]===`\\`?2:1;if(r>=e.length)throw p(`a string with no closing quote`,n);let i=e.slice(t,++r);if(!i.includes(`\\`))return[i.slice(1,-1),r];let a=c(()=>JSON.parse(i),()=>{throw p(`${u(i)} is not a string as JSON writes it`,n)});if(JSON.stringify(a)!==i)throw p(`${u(i)} is not written as JSON writes ${u(a)}`,n);return[a,r]}export{n as a,i as b,a as c,o as d,s as e,c as f,l as g,u as h,f as i,p as j,m as k,g as l,_ as m,v as n,y as o,b as p,x as q,S as r,C as s,w as t};
@@ -0,0 +1 @@
1
+ import{b as e,s as t}from"./chunk-UCP3JRE2.js";import{b as n,d as r,e as i}from"./chunk-E3LFSUDJ.js";import{d as a,h as o}from"./chunk-JMG5DXII.js";function s(e){return e===void 0?`nothing`:Array.isArray(e)?`an array`:e instanceof r?`the float ${e.text}`:e instanceof n?`the date-time ${e.text}`:typeof e==`object`?`a table`:typeof e==`string`?`the string ${o(e)}`:`the ${typeof e==`boolean`?`boolean`:`integer`} ${String(e)}`}var{refuse:c,record:l,entries:u,sequence:d,string:f,boolean:p,count:m}=e(s,i,`a table`,`key`,`an array`);function h(e,t){if(f(e,t)===``||/[\p{Cc}\p{Zl}\p{Zp}\p{Bidi_Control}]/u.test(e))throw new a(`${o(e)} is empty, or has a control character in it`,t);return e}var g=t(f),_=e=>(t,n)=>d(t,n).map((t,r)=>e(t,`${n}[${r}]`)),v=(e=f)=>_((t,n)=>e(f(t,n),n)),y=(e,t,n)=>v(n)(e,t);function b(e,t,n,r){let i=Object.create(null);if(e!==void 0)for(let[a,o,s]of u(e,t))i[n(a,s)]=r(o,s,a);return i}function x(e,t,n){let r=t.filter(t=>e[t]!==void 0);if(r.length!==1)throw new a(`expected one of ${t.join(`, `)}, found ${r.length===0?`none`:r.join(` and `)}`,n);return r[0]}function S(e,t,n){let r=new Map;for(let[i,s]of e.entries()){let e=t(s);if(r.has(e))throw new a(`${o(n(s))} is listed twice, first as package[${r.get(e)}]`,`package[${i}]`);r.set(e,i)}return r}export{s as a,c as b,l as c,u as d,d as e,f,p as g,m as h,h as i,g as j,_ as k,v as l,y as m,b as n,x as o,S as p};
@@ -0,0 +1,2 @@
1
+ import{e,f as t,g as n,k as r}from"./chunk-4HI2MSAV.js";import{k as i}from"./chunk-FHIVVVUA.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,D=2e3,ee=800,O=.6;function k(e,t){if(e.length>D)return null;let n=e.match(E)??[];return n.length>ee?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 te(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 N=200,P=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()>P)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>N||t.length>N)return[];let n=z(e,t);return B(e.length,t.length,n)??V(e.length,t.length,n)}var U=(e,n,r)=>t(e,n,{...r,discard:!1});function W(e){if(e===null)return``;let t=e.type===`symlink`?e.target:e.data;if(typeof t==`string`)return t.includes(`\0`)?void 0:t;if(!t.includes(0))try{return r(t)}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(t,r,i,a,o){let s=J(t),c=J(r),l=(e,t,n,r)=>({a0:e,a1:t,b0:n,b1:r,remove:s.slice(e,t),insert:c.slice(n,r)}),u=o.flatMap(({a0:e,a1:t,b0:n,b1:r})=>e===t||n===r?[l(e,t,n,r)]:U(s.slice(e,t).join(``),c.slice(n,r).join(``),i).map(t=>l(e+t.a0,e+t.a1,n+t.b0,n+t.b1))),d=q(u)<q(a)&&(a=>{try{return n(t,r,a,{format:`normal`,ignoreCase:i.ignoreCase,whitespace:i.whitespace}),!0}catch(t){if(t instanceof e)return!1;throw t}})(u)?u:a;return q(d)<q(o)?d:o}function ne(e,t,n){let r=U(e,t,n);return X(n)?Z(e,t,n,r,U(e,t,Y(n))):r}function re(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?[]:ne(r,i,n),o=(e,t)=>a.reduce((n,r)=>n+r[t]-r[e],0);return{binary:!1,blocks:a,insertions:o(`b0`,`b1`),deletions:o(`a0`,`a1`)}}function ie(t,r,i,a){let{whitespace:o,ignoreCase:s}=K(a);try{return n(t,r,i,{format:`normal`,whitespace:o,ignoreCase:s}),!0}catch(t){if(t instanceof e)return!1;throw t}}var Q=/[ \t\n\v\f\r]/u,$=e=>{let t=e.split(`
2
+ `);return t.at(-1)===``&&t.pop(),t};function ae(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 oe(e,t,n){try{if(!ie(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]&&ae(r[a],i[o]))return!0;e<n.length&&({a1:a,b1:o}=n[e])}return!1}function se(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{te as a,H as b,W as c,K as d,re as e,oe as f,se 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};
@@ -0,0 +1,14 @@
1
+ import{c as e}from"./chunk-G3LY2FV4.js";import{a as t}from"./chunk-4EMM6UCD.js";import{H as n,I as r,J as i,K as a,M as o,Q as s,b as c,h as l,m as u,n as d,s as f,u as ee}from"./chunk-UCP3JRE2.js";import{a as p}from"./chunk-DEVAORP2.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{d as m,h,i as g,j as _,p as te,r as ne,s as re}from"./chunk-JMG5DXII.js";import"./chunk-OOJM4CTU.js";var v=[`PODS`,`DEPENDENCIES`,`SPEC REPOS`,`EXTERNAL SOURCES`,`CHECKOUT OPTIONS`,`SPEC CHECKSUMS`,`PODFILE CHECKSUM`,`COCOAPODS`],ie=e=>({yesNo:e>=10,dates:e>=13}),ae=new Set([`null`,`Null`,`NULL`,`~`,``,`true`,`True`,`TRUE`,`false`,`False`,`FALSE`]),oe=new Set([`yes`,`Yes`,`YES`,`no`,`No`,`NO`,`on`,`On`,`ON`,`off`,`Off`,`OFF`]),se=[/^[-+]?\d+$/u,/^00[0-7]+$/u,/^0x[\dA-Fa-f]+$/u,/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][-+]?\d+)?$/u,/^[-+]?\.(?:inf|Inf|INF)$/u,/^\.(?:nan|NaN|NAN)$/u],ce=/^(?:\d{4}-\d\d-\d\d|\d{4}-\d\d?-\d\d?(?:[Tt]|[ \t]+)\d\d?:\d\d:\d\d(?:.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d\d)?))?)$/u,y=/^\w[\w/ ()~<>=.:`,-]*$/u,le=/^:[a-z_][a-z0-9_]*$/u;function ue(e,t){return ae.has(e)||se.some(t=>t.test(e))?!0:t.yesNo&&oe.has(e)||t.dates&&ce.test(e)}var b=e=>JSON.stringify(e).replace(/#(?=[{$@])/gu,`\\#`);function de(e,t){return ue(e,t)?`'${e}'`:y.test(e)&&!e.endsWith(`:`)?e:b(e)}var fe=e=>e.replaceAll(`Σ`,`σ`).toLowerCase();function pe(e){if(e.kind===`seq`)return e.items.length===0?``:pe(e.items[0]);if(e.kind===`map`)return e.entries.map(({key:e})=>fe(String(e.value))).sort(t)[0]??``;if(e.type===`boolean`){if(e.value)throw _(`true, which YAMLHelper fails to sort`,e.line);return``}return fe(e.value)}function me(e,n=e=>e){return e.map(e=>[pe(n(e)),e]).sort((e,n)=>t(e[0],n[0])).map(([,e])=>e)}function x(e,t){return e.type===`symbol`?`:${e.value}`:e.type===`boolean`?String(e.value):de(e.value,t)}var S=e=>e.kind!==`scalar`,he=e=>e.kind===`seq`?e.items.length:e.entries.length,C=e=>e.replaceAll(`
2
+ `,`
3
+ `);function ge(e,t){return e.kind===`seq`?_e(e.items,t):e.kind===`map`?ve(e.entries,t):x(e,t)}function _e(e,t){return e.length===0?`[]`:`- ${me(e).map(e=>{let n=ge(e,t);return S(e)&&he(e)>1?C(n):n}).join(`
4
+ - `)}`}function ve(e,t,n,r=`
5
+ `){if(e.length===0)return`{}`;let i=me(e,e=>e.key);if(n!==void 0){let e=n.flatMap(e=>i.filter(({key:t})=>t.type===`string`&&t.value===e));i=[...e,...i.filter(t=>!e.includes(t))]}return i.map(({key:e,value:n})=>{let r=ge(n,t);return S(n)?`${x(e,t)}:
6
+ ${C(r)}`:`${x(e,t)}: ${r}`}).join(r)}var ye=(e,t)=>`${ve(e.entries,t,v,`
7
+
8
+ `)}
9
+ `;function be(e,t,n,r,i){let a=ye(t,n),o=r?a.replaceAll(`
10
+ `,`\r
11
+ `):a;if(e===o)return;let s=r?`\r
12
+ `:`
13
+ `,[c,l]=[e.split(s),o.split(s)],u=l.findIndex((e,t)=>e!==c[t]),d=`as CocoaPods ${i} writes it`;throw u===c.length?new m(`line ${u}: expected a line end, ${d}`):u===-1||u===l.length-1?new m(`line ${u===-1?l.length:u+1}: expected the end of the file, ${d}`):new m(`line ${u+1}: expected ${h(l[u])}, ${d}, found ${h(c[u])}`)}function xe(e){return e===void 0?`nothing`:e.kind===`seq`?`a sequence`:e.kind===`map`?`a mapping`:e.type===`string`?`the string ${h(e.value)}`:`the ${e.type} ${String(e.value)}`}var{refuse:w}=c(xe);function T(e,t,n){if(e?.kind!==`scalar`||e.type!==t)throw w(`a ${t}`,e,n);return e.value}var E=(e,t)=>d(T(e,`string`,t),t),D=f(E);function O(e,t){if(e===void 0)return[];if(e.kind!==`seq`)throw w(`a sequence`,e,t);return e.items}function k(e,t){if(e===void 0)return[];if(e.kind!==`map`)throw w(`a mapping`,e,t);return e.entries.map(({key:e,value:n})=>[e,n,g(t,e.type===`symbol`?`:${e.value}`:String(e.value))])}var A=[`type`,`flatten`,`sha1`,`sha256`,`headers`],j={__proto__:null,git:[`commit`,`tag`,`branch`,`submodules`],hg:[`revision`,`tag`,`branch`],http:A,scp:A,svn:[`revision`,`tag`,`folder`,`externals`,`checkout`]},M=e=>e===`type`?`fileType`:e,Se=new Set([`submodules`,`flatten`,`externals`,`checkout`]),Ce=new Set([`zip`,`tgz`,`tar`,`tbz`,`txz`,`dmg`]),N=D(i,`a sha1 in lowercase hex`),we={__proto__:null,sha1:N,sha256:D(r,`a sha256 in lowercase hex`),type:D(e=>Ce.has(e),`a type of file CocoaPods extracts`)},P={__proto__:null,git:{option:`commit`,given:D(e=>/^[\da-f]{4,64}$/iu.test(e),`a commit's hash, and locks no commit`),kept:n,as:`the full commit hash CocoaPods keeps, as git rev-parse writes it`},hg:{option:`revision`,given:D(e=>/^[\da-f]{4,40}$/iu.test(e),`a changeset's hash, and locks no revision`),kept:i,as:`the full changeset hash CocoaPods keeps, as hg id writes it`},svn:{option:`revision`,given:D(e=>/^\d+$/u.test(e),`a revision's number, and locks no revision`),kept:e=>/^\d+$/u.test(e),as:`the revision number CocoaPods keeps, as svn export writes it`}},F={__proto__:null,http:D(s,`an http(s) URL`),scp:D(e=>e.startsWith(`scp://`)&&URL.canParse(e),`an scp:// URL`)};function Te(e,t){if(/^(?:\/|[A-Za-z]:)/u.test(e))throw new m(`${h(e)} is absolute, and only reads on the machine that wrote it`,t);if(e.startsWith(`~`))throw new m(`${h(e)} is from a home directory, and only reads on the machine that wrote it`,t);if(e.includes(`\\`)||e.includes(`//`))throw new m(`${h(e)} is not a path from the Podfile's directory`,t);return e}var Ee=new Set([`revision`,`tag`,`branch`,`folder`]);function De(e,t,n,r){if(Se.has(t))return T(n,`boolean`,r);if(t===`headers`)return O(n,r).map((e,t)=>E(e,`${r}[${t}]`));if(t in we)return we[t](n,r);let i=E(n,r);if(e===`git`&&(t===`branch`||t===`tag`)&&a(i,r),e!==`git`&&Ee.has(t)&&(i.startsWith(`-`)||i.includes(` --`)))throw new m(`${h(i)} starts with "-", or has " --" in it, which ${e} would read as an option`,r);return t===P[e]?.option?P[e].given(n,r):i}var Oe=(e,t,n)=>o((F[e]??E)(t,n),n);function ke(e,t){let n=[],r=Object.create(null);for(let[i,a,o]of k(e,t)){if(i.type!==`symbol`&&i.type!==`string`)throw new m(`the ${i.type} ${String(i.value)} as a key, where a symbol or a string names an option`,o);let e={name:i.value,string:i.type===`string`,node:a,where:o};n.push(e),e.string||(r[e.name]=e)}return{list:n,symbols:r}}function Ae({list:e,symbols:t},n){let r=Object.keys(t),i=r.filter(e=>e in j);if(i.length===0)throw new m(`names no source CocoaPods knows: :podspec, :path, or one of :git, :hg, :http, :scp and :svn`,n);if(i.length>1)throw new m(`both :${i[0]} and :${i[1]}, which CocoaPods reads as no source at all`,n);let a=e.find(e=>e.string);if(a!==void 0)throw new m(`a key that is not a symbol, which cocoapods-downloader reads as one and the rest of CocoaPods passes over`,a.where);let[o]=i,s=r.find(e=>e!==o&&!j[o].includes(e));if(s!==void 0)throw new m(`an option cocoapods-downloader does not take of :${o}`,t[s].where);let c={type:o,url:Oe(o,t[o].node,t[o].where)};for(let e of j[o]){let n=t[e];c[M(e)]=n===void 0?void 0:De(o,e,n.node,n.where)}return c}function je(e,t){if(e?.kind===`scalar`&&(e.type===`string`||e.type===`boolean`))return e.value;throw w(`a string or a boolean`,e,t)}function Me(e,t){let n=ke(e,t),{symbols:r}=n,i=[`podspec`,`path`].find(e=>e in r);if(i===void 0)return Ae(n,t);let a=Object.create(null);for(let{name:e,string:t,node:r,where:o}of n.list)if(t||e!==i){if(!t&&(e===`podspec`||e===`path`||e in j))throw new m(`beside :${i}, which CocoaPods reads alone`,o);if(e in a)throw new m(`both :${e} and ${h(e)}, where options has each name once`,o);a[e]=je(r,o)}let{node:o,where:s}=r[i],c=E(o,s);return i===`podspec`&&/^https?:/iu.test(c)?F.http(o,s):Te(c,s),{type:i,[i]:c,options:a}}var Ne=(e,t)=>Ae(ke(e,t),t);function Pe(e){if(e.type===`git`){let t=[`commit`,`branch`,`tag`].filter(t=>e[t]!==void 0).map(t=>`, ${t} \`${e[t]}\``);return`from \`${e.url}\`${t.join(``)}`}if(e.type===`hg`||e.type===`svn`)return`from \`${e.url}\``;if(e.type===`podspec`||e.type===`path`)return`from \`${e[e.type]}\``}var Fe=e=>[[e.type,e.url],...j[e.type].map(t=>[t,e[M(t)]])].filter(([,e])=>e!==void 0),Ie=e=>typeof e==`boolean`?String(e):b(e),I=String.raw`"(?:[^"\\]|\\.)*"`,L=new RegExp(String.raw`(?::(\w+)=>|(\w+): )(${I}|true|false|\[(?:${I}(?:, ${I})*)?\])(?:, |$)`,`uy`),Le=new RegExp(I,`gu`);function Re(e){if(e.endsWith(`, `))return;let t=new Map,n=new Set;for(L.lastIndex=0;L.lastIndex<e.length;){let r=L.exec(e);if(r===null||t.has(r[1]??r[2]))return;n.add(r[1]===void 0),t.set(r[1]??r[2],r[3])}return n.size===1?t:void 0}var ze=(e,t)=>JSON.stringify((e.match(Le)??[]).sort())===JSON.stringify(t.map(b).sort());function Be(e,t){let n=/^from `\{(.+)\}`$/u.exec(e),r=n===null?void 0:Re(n[1]),i=Fe(t);return r===void 0||r.size!==i.length?!1:i.every(([e,t])=>{let n=r.get(e);return n===void 0?!1:Array.isArray(t)?n.startsWith(`[`)&&ze(n,t):n===Ie(t)})}function Ve(e,t,n){let r=Pe(t);if(r===void 0?Be(e,t):e===r)return;let i=r===void 0?`the options of EXTERNAL SOURCES, as Ruby's Hash#inspect writes them`:h(r);throw new m(`${h(e)} is not ${i}, as CocoaPods describes the external source`,n)}var R=Symbol(`any`);function He(e){let{type:t,url:n,tag:r,submodules:i}=e,a=P[t].option,o=e[a]!==void 0||r!==void 0?e:{type:t,url:n,[a]:R,submodules:i||void 0};return t===`git`&&e.branch!==void 0?[{...e,branch:void 0,commit:R},o]:[o]}function Ue(e,t){let n=P[e.type];for(let r of j[e.type]){let[i,a]=[e[M(r)],t[M(r)]];if(!(a===R?i!==void 0&&n.kept(i):i===a))return i===void 0?`no :${r}, which CocoaPods keeps of this download`:a===void 0?`a :${r}, which CocoaPods does not keep of this download`:a===R?`${h(i)} is not ${n.as}`:`another :${r} than EXTERNAL SOURCES has`}}function We(e,t,n,r){if(e.type===`path`){if(t!==void 0)throw new m(`checkout options of a pod by :path, which CocoaPods keeps none of`,n);return}if(e.type===`podspec`)return;if(t===void 0)throw new m(`no checkout options, which CocoaPods keeps of a pod by :${e.type}`,r);if(t.type!==e.type||t.url!==e.url)throw new m(`not by the :${e.type} and URL EXTERNAL SOURCES has`,n);if(P[e.type]===void 0){if(j[e.type].map(M).some(n=>JSON.stringify(t[n])!==JSON.stringify(e[n])))throw new m(`other than the options EXTERNAL SOURCES has, which CocoaPods keeps as they are of a file`,n);return}let i=He(e).map(e=>Ue(t,e));if(!i.includes(void 0))throw new m(i[0],n)}var z=f(l),B=String.raw`(?!\.)[!-'*-.0-[\]-~]+`,Ge=RegExp(`^${B}(?:/${B})*$`,`u`),V=z(e=>e.length<=1024&&Ge.test(e),`a pod's name`),Ke=e=>e.split(`/`,1)[0];function H(e,t){if(V(e,t).includes(`/`))throw new m(`${h(e)} is a subspec's name, where a root's is`,t);return e}var qe=/^\d+(?:\.[\dA-Za-z-]+)*(?:\+[\dA-Za-z.-]+)?$/u,U=e=>qe.test(e),Je=z(U,`a version`);function Ye(e,t){let n=/^(\S+) \((.+)\)$/u.exec(e);if(n===null)throw new m(`${h(e)} is not a pod and its version, as CocoaPods writes them`,t);let r=Je(n[2],t);return{name:V(n[1],t),version:r}}function Xe(t,n){let r=t.split(`, `);for(let[t,i]of r.entries()){if(e(i,U)===void 0)throw new m(`${h(i)} is not a requirement, as CocoaPods writes one`,n);if(t>0&&r[t-1]>i)throw new m(`${h(i)} after ${h(r[t-1])}, where CocoaPods sorts requirements`,n)}if(t===`>= 0`)throw new m(`">= 0", which CocoaPods writes as no requirement at all`,n);return r}function W(e,t){let n=/^(\S+)(?: \((.+)\))?$/u.exec(e);if(n===null)throw new m(`${h(e)} is not a dependency, as CocoaPods writes one`,t);let r=V(n[1],t);return n[2]?.startsWith("from `")?{name:r,requirements:[],description:n[2]}:{name:r,requirements:n[2]===void 0?[]:Xe(n[2],t),description:void 0}}function Ze(e,t){let{name:n,requirements:r,description:i}=W(e,t);if(i!==void 0)throw new m(`${h(e)} names an external source, which only the Podfile's dependencies do`,t);return{name:n,requirements:r}}var Qe=/^[^\d.:-]?[\p{Alpha}_ \t\n\v\f\r!@#$%^&*(){}<>|/\\~;=]/u,$e=/^-?\d{4}-\d{1,2}-\d{1,2}(?:[Tt]|[ \t\n\v\f\r]+)\d{1,2}:\d\d:\d\d(?:\.\d*)?(?:[ \t\n\v\f\r]*(?:Z|[-+]\d{1,2}:?(?:\d\d)?))?$/u,et=/^\d{4}-(?:1[012]|0\d|\d)-(?:[12]\d|3[01]|0\d|\d)$/u,tt=/^[-+]?\d[\d_]*(?::[0-5]?\d){1,2}(?:\.[\d_]*)?$/u,nt=/^[-+]?(?:\d[\d_,]*)?\.\d*(?:[eE][-+]\d+)?$/u,rt=[/^[-+]?0b[01_,]+$/u,/^[-+]?0[0-7_,]+$/u,/^[-+]?(?:0|[1-9][\d_,]*)$/u,/^[-+]?0x[\dA-Fa-f_,]+$/u];function it(e){return e===``?`null`:Qe.test(e)||e.includes(`
14
+ `)?e.length>5||/^[^ytonf~]/iu.test(e)?`string`:e===`~`||/^null$/iu.test(e)?`null`:/^(?:yes|true|on|no|false|off)$/iu.test(e)?`boolean`:`string`:$e.test(e)?`a time`:et.test(e)?`a date`:/^[-+]?\.inf$/iu.test(e)||/^\.nan$/iu.test(e)?`a float`:/^:./u.test(e)?`a symbol`:tt.test(e)?`a number`:nt.test(e)&&!/^[-+]?\.$/u.test(e)?`a float`:rt.some(t=>t.test(e))?`an integer`:`string`}function at(e){let t=it(e);return{type:t,value:t===`boolean`?/^(?:yes|true|on)$/iu.test(e):e}}var ot=/[^\p{L}\p{M}\p{N}\p{P}\p{S}\p{Zs}]/u,st=/^"(?:[^"\\]|\\["\\])*"/u,ct=/^"(?:[^"\\]|\\["\\])*(\\[^"\\])/u,lt=/^'((?:[^']|'')*)'/u,ut=8,G=1024,K=e=>e===`-`||e.startsWith(`- `);function q(e){for(re(e);e.line!==void 0;re(e)){let t=te(e.line),n=e.line.slice(t);if(n!==``){if(n.startsWith(`#`))throw _(`a comment, which CocoaPods does not write`,e.number);e.current={indent:t,text:n,number:e.number};return}}e.current=void 0}var J=(e,t,n)=>({kind:`scalar`,type:e,value:t,line:n});function dt(e,t){let n=st.exec(e);if(n!==null)return[J(`string`,JSON.parse(n[0]),t),e.slice(n[0].length)];let r=lt.exec(e);if(r!==null)return[J(`string`,r[1].replaceAll(`''`,`'`),t),e.slice(r[0].length)];let i=ct.exec(e)?.[1];throw _(i===void 0?`a quoted scalar with no closing quote in ${h(e)}`:`${h(i)}, an escape this reader does not take: CocoaPods writes \\# before {, $ and @, which Psych does not read back`,t)}function ft(e,t){if(le.test(e))return J(`symbol`,e.slice(1),t);if(!y.test(e)||e.endsWith(` `)||e.endsWith(`:`)||e.includes(`: `))throw _(`${h(e)} is not a scalar as CocoaPods writes one`,t);let{type:n,value:r}=at(e);if(n!==`string`&&n!==`boolean`)throw _(`${h(e)}, which Psych reads as ${n}, where a Podfile.lock holds a string, a symbol, true or false`,t);return J(n,r,t)}function Y(e,t){if(e===`[]`)return{kind:`seq`,items:[]};if(e===`{}`)return{kind:`map`,entries:[]};if(e.startsWith(`"`)||e.startsWith(`'`)){let[n,r]=dt(e,t);if(r!==``)throw _(`${h(r)} after a quoted scalar`,t);return n}return ft(e,t)}function pt(e,t){let n,r;if(e.startsWith(`"`)||e.startsWith(`'`)){if([n,r]=dt(e,t),r!==`:`&&!r.startsWith(`: `))return null}else{let i=/:(?: |$)/u.exec(e);if(i===null)return null;n=ft(e.slice(0,i.index),t),r=e.slice(i.index)}let i=e.length-r.length;if(i>G&&[...e.slice(0,i)].length>G)throw _(`a key longer than ${G} characters, which Psych does not read`,t);let a=r.slice(2);if(a.startsWith(` `))throw _(`more than one space after ":"`,t);return{key:n,value:a}}function mt(e,t){if(t>ut)throw _(`nested deeper than a Podfile.lock is`,e.current.number)}function ht(e,t,n){let{number:r,text:i}=e.current;return i!==`[]`&&i!==`{}`?(K(i)?gt:X)(e,t,n):(q(e),Y(i,r))}function X(e,t,n,r){mt(e,n);let i={kind:`map`,entries:[]},a=new Set;do{let{number:o,text:s}=e.current;if(r??=pt(s,o),r===null)throw _(`expected a mapping key, found ${h(s)}`,o);let{key:c}=r,l=`${c.type}:${c.value}`;if(a.has(l))throw _(`a second ${h(String(c.value))}`,o);a.add(l),q(e);let u;if(r.value!==``)u=Y(r.value,o);else if(e.current?.indent>t)u=ht(e,e.current.indent,n+1);else if(e.current?.indent===t&&K(e.current.text))u=gt(e,t,n+1);else throw _(`nothing under ${h(String(c.value))}`,o);i.entries.push({key:c,value:u}),r=void 0}while(e.current?.indent===t);return i}function gt(e,t,n){mt(e,n);let r={kind:`seq`,items:[]};for(;e.current?.indent===t&&K(e.current.text);){let{number:i,text:a}=e.current,o=a.slice(2);if(o===``||o.startsWith(` `))throw _(`expected one space and a value after "-"`,i);let s=pt(o,i);s===null?(r.items.push(Y(o,i)),q(e)):r.items.push(X(e,t+2,n+1,s))}return r}function _t(e){let t=ne(e,ot);if(q(t),t.current===void 0)throw _(`an empty file, where CocoaPods writes its version at least`,0);if(t.current.indent!==0||K(t.current.text))throw _(`expected a mapping at column 0`,t.current.number);let n=X(t,0,0);if(t.current!==void 0)throw _(`bad indentation`,t.current.number);return{root:n,crlf:t.crlf===!0}}var Z=e=>g(``,e),Q=e=>(e?.items??e?.entries)?.length===0;function vt(e){let t=Object.create(null);for(let{key:n,value:r}of e.entries){if(n.type!==`string`||!v.includes(n.value))throw _(`unsupported section ${h(String(n.value))}`,n.line);if(Q(r))throw _(`an empty ${n.value}, which CocoaPods leaves out`,n.line);t[n.value]=r}return t}function yt(e){if(e===void 0)throw new m(`expected COCOAPODS, the version of CocoaPods that wrote the file, which it always writes`);let t=E(e,`COCOAPODS`),n=/^(\d+)\.(\d+)\.\d+(?:\.(?:beta|rc)\.\d+)?$/u.exec(t);if(n===null||Number(n[1])!==1||Number(n[2])<5||Number(n[2])>17)throw new m(`${h(t)} is not a version of CocoaPods from 1.5 to 1.17, which this reader reads`,`COCOAPODS`);return{version:t,rules:ie(Number(n[2]))}}function bt(e,t){let n=new Set;return O(e,t).map((e,r)=>{let i=`${t}[${r}]`,a=E(e,i),o=Ze(a,i);if(n.has(a))throw new m(`a second ${h(a)}, where CocoaPods lists each dependency of a pod once`,i);return n.add(a),o})}function xt(e){let t=Object.create(null),n=new Map;for(let[r,i]of O(e,`PODS`).entries()){let e=`PODS[${r}]`;if(i.kind===`seq`||i.kind===`map`&&i.entries.length!==1)throw new m(`expected a pod, or one pod and what it depends on`,e);let{key:a,value:o}=i.kind===`map`?i.entries[0]:{key:i},s=g(e,String(a.value));if(Q(o))throw new m(`none it depends on, where CocoaPods writes the pod alone`,s);let c=bt(o,s),{name:l,version:u}=Ye(E(a,e),e);if(l in t)throw new m(`a second ${h(l)}`,e);t[l]={name:l,root:Ke(l),version:u,dependencies:c},n.set(l,e)}return{pods:t,placeOf:n}}function St(e,t){let n=Object.create(null);for(let r of Object.values(e)){let e=n[r.root]??={name:r.root,version:r.version,pods:[],checksum:void 0,repo:void 0,external:void 0,checkout:void 0};if(e.version!==r.version)throw new m(`at ${h(r.version)}, where its root's other pods are at ${h(e.version)}`,t.get(r.name));e.pods.push(r.name)}return n}function $(e,t,n){let r=new Map;for(let[i,a,o]of k(e,Z(t)))r.set(H(T(i,`string`,o),o),{value:n(a,o),where:o});return r}var Ct=D(e=>!/\s/u.test(e),`a spec repo's URL or name`);function wt(e){let t=new Map;for(let[n,r,i]of k(e,Z(`SPEC REPOS`))){let e=o(Ct(n,i),i);if(Q(r))throw new m(`no pod of the spec repo, where CocoaPods leaves it out`,i);for(let[n,a]of O(r,i).entries()){let r=`${i}[${n}]`,o=H(E(a,r),r);if(t.has(o))throw new m(`${h(o)} is in ${h(t.get(o).value)} too`,r);t.set(o,{value:e,where:r})}}return t}function Tt(e,t,{checksums:n,repos:r,externals:i,checkouts:a}){for(let[t,o]of[[n,`checksum`],[r,`repo`],[i,`external`],[a,`checkout`]])for(let[n,{value:r,where:i}]of t){if(!(n in e))throw new m(`${h(n)} is the root of no pod in PODS`,i);e[n][o]=r}for(let[e,{where:t}]of a)if(!i.has(e))throw new m(`${h(e)} has no external source, and CocoaPods keeps checkout options of none other`,t);for(let[t,{value:n,where:o}]of i){if(r.has(t))throw new m(`${h(t)} is from an external source and a spec repo both`,o);We(n,e[t].checkout,a.get(t)?.where,o)}for(let n of Object.values(e)){let e=t.get(n.pods[0]);if(n.checksum===void 0)throw new m(`no checksum of ${h(n.name)} in SPEC CHECKSUMS, which CocoaPods writes of every podspec`,e);if(n.repo===void 0&&n.external===void 0)throw new m(`${h(n.name)} is from no spec repo and no external source`,e)}}function Et(e,t,n,r){let i=new Set;for(let{name:r,description:a,where:o}of e){if(!(r in t))throw new m(`${h(r)} is no pod in PODS`,o);if(a===void 0)continue;let{root:e}=t[r];if(n[e].external===void 0)throw new m(`${h(e)} has no external source in EXTERNAL SOURCES`,o);Ve(a,n[e].external,o),i.add(e)}for(let[e,{where:t}]of r)if(!i.has(e))throw new m(`${h(e)} is from an external source no dependency of the Podfile names`,t)}function Dt(e,t,n){let r=new Set(e.map(e=>e.name));for(let e of r)for(let n of t[e]?.dependencies??[])r.add(n.name);let i=Object.values(t).find(e=>!r.has(e.name));if(i!==void 0)throw new m(`${h(i.name)} is not one the Podfile's dependencies lead to, which CocoaPods would not install`,n.get(i.name))}function Ot(e){if(e===void 0||e instanceof Uint8Array)return e;if(typeof e!=`string`)throw TypeError(`expected the Podfile as a string or a Uint8Array`);if(!e.isWellFormed())throw TypeError(`expected the Podfile as well-formed text, or its bytes`);return new TextEncoder().encode(e)}async function kt(e,t){if(t===void 0)throw new m(`no PODFILE CHECKSUM to hold the Podfile to, which CocoaPods writes of a Podfile it reads from a file`);let n=p(new Uint8Array(await crypto.subtle.digest(`SHA-1`,e)));if(n!==t)throw new m(`not the sha1 of the Podfile given, ${n}: the lockfile was written for another Podfile`,Z(`PODFILE CHECKSUM`))}async function At(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let n=Ot(ee(t,[`podfile`]).podfile),{root:r,crlf:i}=_t(e),a=vt(r),{version:o,rules:s}=yt(a.COCOAPODS),c=u(a,`PODFILE CHECKSUM`,``,N),{pods:l,placeOf:d}=xt(a.PODS),f=St(l,d),p={checksums:$(a[`SPEC CHECKSUMS`],`SPEC CHECKSUMS`,N),repos:wt(a[`SPEC REPOS`]),externals:$(a[`EXTERNAL SOURCES`],`EXTERNAL SOURCES`,Me),checkouts:$(a[`CHECKOUT OPTIONS`],`CHECKOUT OPTIONS`,Ne)},m=O(a.DEPENDENCIES,`DEPENDENCIES`).map((e,t)=>{let n=`DEPENDENCIES[${t}]`;return{...W(E(e,n),n),where:n}});be(e,r,s,i,o),Tt(f,d,p),Et(m,l,f,p.externals);let h=m.map(({name:e,requirements:t,description:n})=>({name:e,requirements:t,external:n!==void 0}));return Dt(h,l,d),n!==void 0&&await kt(n,c),{cocoapods:o,podfileChecksum:c,pods:l,roots:f,dependencies:h}}export{m as LockfileError,At as parsePodfileLock};
@@ -0,0 +1 @@
1
+ import{d as e,i as t}from"./chunk-JMG5DXII.js";var n=[`dependencies`,`devDependencies`,`optionalDependencies`];function r(n,r,i){let[a,o]=[`dependencies`,`optionalDependencies`].map(e=>i(n[e],t(r,e))),s=Object.keys(o).find(e=>e in a);if(s!==void 0)throw new e(`listed under dependencies too`,t(t(r,`optionalDependencies`),s));return{dependencies:a,optionalDependencies:o}}function i(e,t){let n=new Set,r=e=>{for(let t of Object.values(e))t.startsWith(`link:`)||n.add(t)};for(let t of e)r(t);for(let e of n)r(t[e].dependencies),r(t[e].optionalDependencies);return Object.keys(t).find(e=>!n.has(e))}function a(e,t,{required:n=[`dependencies`],dev:r=[`devDependencies`],optional:i=[`optionalDependencies`]}={}){let a=(n,r)=>{let i=new Set,a=t=>{for(let n of Object.values(t))n.startsWith(`link:`)||i.add(e[n])};for(let e of Object.values(t))for(let t of n)a(e[t]);for(let e of i)for(let t of r)a(e[t]);return i},o=a([...n,...i],[`dependencies`,`optionalDependencies`]),s=a([...n,...r],[`dependencies`]),c=a(n,[`dependencies`]);return e=>({dev:!o.has(e),optional:!s.has(e),devOptional:!c.has(e)})}export{n as a,r as b,i as c,a as d};
@@ -0,0 +1 @@
1
+ import{a as e,b as t,c as n,d as r}from"./chunk-HOB3YPS5.js";import{a as i,b as a,c as o,d as s,e as c,f as l,g as u,j as d,l as f,m as p,n as m,p as h}from"./chunk-JOXLZXMI.js";import{A as ee,B as te,H as ne,I as g,M as _,c as re,k as v,l as y,m as b,t as ie,u as ae}from"./chunk-UCP3JRE2.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{a as oe,e as x,g as S}from"./chunk-E3LFSUDJ.js";import{d as C,e as w,f as se,h as T,i as E}from"./chunk-JMG5DXII.js";import"./chunk-OOJM4CTU.js";var D=d(e=>/^[A-Z_a-z][\w-]*$/u.test(e),`a package name`),O=d(e=>t(e)!==void 0,`a version`),ce=d(e=>/^\w[\w+.-]*$/u.test(e),`a feature name`),le=[`branch`,`tag`,`rev`];function k(e){let t=e.hostname===`github.com`,n=new URL(t?`https:${e.href.slice(e.protocol.length)}`:e.href),r=n.pathname.replace(/\/$/u,``);return n.pathname=(t?r.toLowerCase():r).replace(/\.git$/u,``),n.href}var ue=e=>e.href.startsWith(`/`,e.protocol.length);function de(e){let t=URL.parse(e);return t!==null&&t.href===e&&ue(t)?t:void 0}var A=(e,t,n=[])=>JSON.stringify([e,k(t),...n]);function j(e,t,n){let r=n=>w(`${T(e)} is not a source: ${n}`,t),[,i,a]=/^(registry|sparse|git)\+(.*)$/su.exec(e)??r(`expected registry+, sparse+ or git+ and a URL`);if(i!==`git`){i===`registry`&&_(a,t);let n=de(i===`sparse`?e:a);return(n===void 0||n.search!==``||n.hash!==``)&&r(`expected a URL in normal form, without a query or a fragment`),{scheme:i,identity:A(i,n)}}let[,o,s,c]=/^([^#?]*)(?:\?([^#]*))?(?:#(.*))?$/su.exec(a);(n?c!==void 0:!ne(c??``))&&r(n?`a dependency names no commit`:`expected "#" and the commit it resolved to`),_(o,t);let l=de(o)??r(`expected a URL in normal form`),u=[...new URLSearchParams(s??``)];return(u.length>1||u.length===1&&!le.includes(u[0][0]))&&r(`expected at most one of branch=, tag= or rev=`),{scheme:i,identity:A(i,l,u[0])}}var M=new URL(`https://github.com/rust-lang/crates.io-index`),fe=e=>e.registry===void 0||e.registry===`crates-io`,N=`any registry`;function P(e,t){if(e.type===`path`)return t;if(e.type===`git`){let t=le.flatMap(t=>e[t]===void 0?[]:[t,e[t]]);return A(`git`,new URL(e.url),t)}return e.index===void 0?fe(e)?A(`registry`,M):N:A(e.index.startsWith(`sparse+`)?`sparse`:`registry`,new URL(e.index))}var pe=e=>e===`crates-io`?M:URL.parse(e);function F(e){let t=pe(e);return t===null?`registry ${e}`:k(t)}function me(e){return pe(e)?.href??`registry ${e}`}function I(e){if(e.type!==`path`)return e.type===`git`?k(new URL(e.url)):e.index===void 0?fe(e)?k(M):`registry ${e.registry}`:k(new URL(e.index))}var he=[`version`,`package`,`patch`],ge=[`name`,`version`,`source`,`checksum`,`dependencies`],_e=[`name`,`version`,`source`,`checksum`],ve={root:`a [root] table is lockfile version 1, which is not read here`,metadata:`a [metadata] table holds checksums in lockfile version 1 and nothing cargo writes after`},ye={replace:`[replace] is not supported`};function be(e,t){if(e===3||e===4)return e;throw e===void 0?new C("no `version`: this is lockfile version 1 or 2, which is not read here, where 3 and 4 are",t):e===5?new C(`lockfile version 5 is only read by a nightly cargo, with -Znext-lockfile-bump`,t):new C(`unsupported version: expected 3 or 4, found ${i(e)}`,t)}var L=(e,t,n)=>n===void 0?`${e} ${t}`:`${e} ${t} (${n})`;function xe(e,t,n=ge){o(e,t,n,ye);let r=D(e.name,E(t,`name`)),i=O(e.version,E(t,`version`)),a=b(e,`source`,t,l),s=a===void 0?void 0:j(a,E(t,`source`),!1),c=b(e,`checksum`,t,l);if(c!==void 0&&(s===void 0||s.scheme===`git`))throw new C(`a ${s===void 0?`path`:`git`} package has no checksum`,E(t,`checksum`));if(c!==void 0&&!g(c))throw new C(`${T(c)} is not a sha256 checksum`,E(t,`checksum`));if(c===void 0&&s!==void 0&&s.scheme!==`git`&&n===ge)throw new C(`expected a checksum, which cargo checks a registry's package with, and refuses the lockfile without`,t);let u=b(e,`dependencies`,t,p)??[];return{key:L(r,i,a),name:r,version:i,source:a,checksum:c,identity:s?.identity,edges:u}}function Se(e,t,n){let r=n=>w(`${T(e)} ${n}`,t),[,i,a,o]=/^([^ ]+)(?: ([^ ]+)(?: \((.+)\))?)?$/su.exec(e)??r("is not `name`, `name version` or `name version (source)`"),s=n.get(i)??r(`names no package in the lockfile`),c=a===void 0?[...new Set(s.map(e=>e.version))]:[a];c.length>1&&r(`could be any of ${c.length} versions`);let l=s.filter(e=>e.version===c[0]);if(l.length===0&&r(`names a version the lockfile does not hold`),o!==void 0){let e=j(o,t,!0).identity,n=l.filter(t=>t.identity===e);return n.length!==1&&r(`names a source the lockfile does not hold`),n[0]}let u=l.filter(e=>e.source===void 0);return u.length>0||l.length===1?u[0]??l[0]:r(`could be any of ${l.length} sources`)}function Ce(e,t){let n=new Set(e.filter(e=>e.source===void 0));for(let e of n)for(let t of e.resolved)n.add(t);let r=e.find(e=>!n.has(e));if(r!==void 0)throw new C(`nothing in the workspace depends on ${T(r.key)}, directly or not`,t)}function we(e){let t=o(S(e),void 0,he,ve),n=be(t.version,`version`),r=c(t.package??[],`package`).map((e,t)=>xe(e,`package[${t}]`));h(r,e=>`${e.name} ${e.version} ${e.identity}`,e=>e.key);let i=Map.groupBy(r,e=>e.name);for(let[e,t]of r.entries()){let n=E(`package[${e}]`,`dependencies`);t.resolved=t.edges.map((e,t)=>Se(e,`${n}[${t}]`,i));let r=ie(t.resolved);if(r!==void 0)throw new C(`${T(r.key)} is listed twice`,n)}Ce(r,`package`);let a=Object.create(null);for(let e of r)a[e.key]={...R(e),dependencies:e.resolved.map(e=>e.key)};return{version:n,packages:a,unusedPatches:Te(t.patch)}}function Te(e){return e===void 0?[]:(o(e,`patch`,[`unused`]),c(e.unused,`patch.unused`).map((e,t)=>R(xe(e,`patch.unused[${t}]`,_e))))}var R=({name:e,version:t,source:n,checksum:r})=>({name:e,version:t,source:n,checksum:r}),Ee=/[\\/]/u;function z(e,t){let n=t?e.indexOf(`\\`):e.search(Ee);return n===-1?[e,``]:[e.slice(0,n),e.slice(n+1)]}function De(e){let t=e.slice(0,8).replaceAll(`/`,`\\`);if(!t.startsWith(`\\\\`))return/^[A-Za-z]:/u.test(e)?{length:2,verbatim:!1}:void 0;if(t.startsWith(`?\\`,2)&&!e.slice(0,4).includes(`/`)){if(t.startsWith(`UNC\\`,4)){let[t,n]=z(e.slice(8),!0),[r]=z(n,!0);return{length:8+t.length+(r===``?0:1+r.length),verbatim:!0}}return/^[A-Za-z]:(?:[\\/]|$)/u.test(e.slice(4))?{length:6,verbatim:!0}:{length:4+z(e.slice(4),!0)[0].length,verbatim:!0}}if(t.startsWith(`.\\`,2))return{length:4+z(e.slice(4),!1)[0].length,verbatim:!1};let[n,r]=z(e.slice(2),!1),[i]=z(r,!1);return n!==``&&i!==``?{length:3+n.length+i.length,verbatim:!1}:void 0}function Oe(e,t){let n=t?De(e):void 0,r=n?.verbatim===!0,i=e.slice(n?.length??0).replace(t?/^[\\/]/u:/^\//u,``).split(r?`\\`:t?Ee:`/`).findLast(e=>e!==``&&(r||e!==`.`));return i===`..`||i===`.`?void 0:i}var ke=/ *(?:([(),=])|"([^"]*)"|(r#)?([A-Z_a-z]\w*)|(.|$))/gsuy,Ae=64,je=class extends Error{},B=()=>{throw new je};function Me(e){let t=[];for(let[,n,r,i,a,o]of e.matchAll(ke)){if(o===``)break;o!==void 0&&B(),t.push(a===void 0?{punct:n,string:r}:{ident:a,raw:i!==void 0})}return t}function Ne(e){let t=Me(e),n=0,r=()=>t[n],i=e=>{r()?.punct!==e&&B(),n++},a=()=>{let e=t[n++];if(e?.ident===void 0&&B(),r()?.punct!==`=`)return{name:e.ident,key:e.ident};n++;let i=t[n++]?.string;return i===void 0&&B(),{name:e.ident,value:i,key:`${e.ident}="${i}"`}},o=(e=0)=>{let t=r();if(t?.raw===!1&&[`all`,`any`,`not`].includes(t.ident)){e>=Ae&&B(),n++,i(`(`);let a=[];for(;r()?.punct!==`)`&&(a.push(o(e+1)),t.ident!==`not`&&r()?.punct===`,`);)n++;return t.ident===`not`&&a.length===0&&B(),i(`)`),{op:t.ident,list:a}}let{name:s,value:c,key:l}=a();return c===void 0&&(s===`true`||s===`false`)?{op:s,list:[]}:{op:`cfg`,name:s,key:l}};return{expr:o,cfg:a,done:()=>r()===void 0}}function Pe(e,t){try{let n=Ne(e),r=t(n);return n.done()?r:void 0}catch(e){if(e instanceof je)return;throw e}}function V(t){let n=/^cfg\((.*)\)$/su.exec(e(t))?.[1];return n===void 0?/^[\w.-]+$/u.test(t)?{name:t,expr:void 0}:void 0:Pe(n,e=>({name:void 0,expr:e.expr()}))}function Fe(t){return Pe(e(t),e=>e.cfg().key)}var Ie={__proto__:null,all:(e,t)=>Le(e.list,t,!1),any:(e,t)=>Le(e.list,t,!0),not:(e,t)=>{let n=H(e.list[0],t);return n===void 0?void 0:!n},true:()=>!0,false:()=>!1,cfg:(e,t)=>t(e)};function H(e,t){return Ie[e.op](e,t)}function Le(e,t,n){let r=!1;for(let i of e){let e=H(i,t);if(e===n)return n;e===void 0&&(r=!0)}return r?void 0:!n}function Re(e,t){if(e.expr===void 0)return t.name===void 0?void 0:e.name===t.name;let n=e=>t.decides===void 0||t.decides.has(e);return H(e.expr,e=>t.cfg.has(e.key)?!0:!n(e.name)&&void 0)}function ze(e){let t=/^[\\/]{2}([^\\/?.][^\\/]*)[\\/]+([^\\/]+)/u.exec(e);if(t!==null)return{prefix:`//${t[1]}/${t[2]}`.toLowerCase(),rest:`/${e.slice(t[0].length)}`};let n=/^([A-Za-z]):(?=[\\/])/u.exec(e);return n===null?/^(?:[\\/]{2}|[A-Za-z]:)/u.test(e)?void 0:{prefix:void 0,rest:e}:{prefix:n[1].toUpperCase(),rest:e.slice(2)}}function Be(e,t){let n=t?ze(e):{prefix:void 0,rest:e};if(n===void 0)return;let r=[],i=0;for(let e of n.rest.split(t?/[\\/]/u:`/`))e===`..`&&r.length>0?r.pop():e===`..`?i++:e!==``&&e!==`.`&&r.push(e);return{prefix:n.prefix,absolute:t?/^[\\/]/u.test(n.rest):n.rest.startsWith(`/`),up:i,parts:r}}function Ve(e,t){if(e.type!==`path`){let t=P(e,`path`);return{key:t===N?`${t} ${e.registry}`:t}}return{key:`path`,readings:[!1,!0].map(t=>Be(e.path,t)),inherited:t}}var U=(e,t)=>t.length<=e.length&&t.every((n,r)=>n===e[e.length-t.length+r]);function He(e,t,n){if(e.absolute&&t.absolute)return e.prefix!==void 0&&t.prefix!==void 0&&e.prefix!==t.prefix||e.parts.join(`/`)!==t.parts.join(`/`);if(e.absolute||t.absolute)return!U((e.absolute?e:t).parts,(e.absolute?t:e).parts);if(n)return!U(e.parts,t.parts)&&!U(t.parts,e.parts);let[r,i]=e.up>=t.up?[e,t]:[t,e],a=r.parts.length-i.parts.length;return a<0||a>r.up-i.up||!U(r.parts,i.parts)}function Ue(e,t){return e.key!==`path`||t.key!==`path`?e.key!==t.key:e.readings.every((n,r)=>{let i=t.readings[r];return n!==void 0&&i!==void 0&&He(n,i,e.inherited!==t.inherited)})}var W=`which only a nightly cargo reads, is not supported`;function G(e,t){let r=n(e);if(r===void 0)throw new C(`${T(e)} is not a version requirement`,t);return r}var We=[`version`,`registry`,`registry-index`,`path`,`git`,`branch`,`tag`,`rev`,`features`,`optional`,`default-features`,`default_features`,`package`,`public`],Ge={base:`a path base, ${W}`,artifact:`an artifact dependency, ${W}`,lib:`an artifact dependency, ${W}`,target:`an artifact dependency, ${W}`},Ke=[`workspace`,`features`,`default-features`,`default_features`,`optional`,`public`],qe=[[`dependencies`,`normal`],[`dev-dependencies`,`dev`],[`build-dependencies`,`build`]];function K(e,t,n,r){let i=n.replaceAll(`-`,`_`);if(i===n||e[i]===void 0)return e[n];let a=E(t??``,i);if(r===`2024`)throw new C(`not supported in the 2024 edition: use ${T(n)}`,a);if(e[n]!==void 0)throw new C(`given beside ${T(n)}`,a);return e[i]}function Je(e,t){let n=URL.parse(l(e,t));if(n===null)throw new C(`${T(e)} is not a URL`,t);if(!ue(n))throw new C(`${T(e)} is a URL with no path, which cargo refuses`,t);return n}function Ye(e,t,n){let r=b(e,`features`,t,p)??[];for(let[e,n]of r.entries()){let r=`${E(t,`features`)}[${e}]`;if(n.includes(`/`))throw new C(`${T(n)}: a dependency's feature cannot name another's`,r);if(n.startsWith(`dep:`))throw new C(`${T(n)}: a dependency's feature cannot be \`dep:\``,r)}return b(e,`public`,t,u),{features:r,defaultFeatures:y(u)(K(e,t,`default-features`,n),E(t,`default-features`))}}function q(e,t,n,r){if(typeof e==`string`)return G(e,t),{package:n,version:e,source:{type:`registry`,registry:void 0,index:void 0},optional:!1,defaultFeatures:!0,features:[]};o(e,t,We,Ge);let i=(n,r)=>b(e,n,t,r),a=i(`version`,l);a!==void 0&&G(a,E(t,`version`));let s=i(`registry`,D),c=i(`registry-index`,l);c!==void 0&&Je(c,E(t,`registry-index`));let d=i(`path`,l),f=i(`git`,l),p=[`branch`,`tag`,`rev`].filter(t=>e[t]!==void 0),m=[f!==void 0&&(s!==void 0||c!==void 0)&&"`git` or a registry",s!==void 0&&c!==void 0&&"`registry` or `registry-index`",f!==void 0&&d!==void 0&&"`git` or `path`",p.length>1&&"`branch`, `tag` or `rev`"].find(Boolean);if(m)throw new C(`ambiguous: only one of ${m} is taken`,t);if(f===void 0&&p.length>0)throw new C(`\`${p[0]}\` is only for a git dependency`,E(t,p[0]));if(a===void 0&&d===void 0&&f===void 0)throw new C(`names no version, path or git repository`,t);let h={type:`registry`,registry:s,index:c};if(d!==void 0&&(h={type:`path`,path:d}),f!==void 0){let e=Je(_(f,E(t,`git`)),E(t,`git`));if(e.search!==``||e.hash!==``)throw new C(`${T(f)} has a query or a fragment, which cargo drops or misreads`,E(t,`git`));h={type:`git`,url:f,branch:i(`branch`,l),tag:i(`tag`,l),rev:i(`rev`,l)}}let{features:ee,defaultFeatures:te=!0}=Ye(e,t,r);return{package:i(`package`,D)??n,version:a,source:h,optional:i(`optional`,u)??!1,defaultFeatures:te,features:ee}}function Xe(e,t,n,r){if(o(e,t,n),e.workspace!==!0)throw a(`true`,e.workspace,E(t,`workspace`));if(r===void 0)throw new C(`inherits from a workspace, and no workspace root is given`,t)}function Ze(e,t,n,r){Xe(e,t,Ke,r.workspace);let i=r.workspace.dependencies[n];if(i===void 0)throw new C(`${T(n)} is not in [workspace.dependencies]`,t);let{features:a,defaultFeatures:o}=Ye(e,t,r.edition);if(o===!1&&i.defaultFeatures&&r.edition===`2024`)throw new C("`default-features = false` cannot turn off the workspace's default features",t);return{...i,features:[...i.features,...a],defaultFeatures:o===!0||i.defaultFeatures,optional:b(e,`optional`,t,u)??!1,inherited:!0}}function Qe(e,t,n,r,i){for(let[a,o,c]of s(e,t)){D(a,c);let e=x(o)&&`workspace`in o?Ze(o,c,a,i):{...q(o,c,a,i.edition),inherited:!1};if(e.optional&&n===`dev`)throw new C(`a dev-dependency cannot be optional`,c);let t=Ve(e.source,e.inherited),s=i.sources.get(a)??[];if(s.some(e=>Ue(e,t)))throw new C(`${T(a)} is given another source elsewhere, which cargo refuses`,c);i.sources.set(a,[...s,t]),i.list.push({name:a,kind:n,target:r,...e})}}function $e(e,t,n){let r={workspace:t,edition:n,list:[],sources:new Map},i=(e,t,n)=>{for(let[i,a]of qe){let o=K(e,t,i,r.edition);o!==void 0&&Qe(o,E(t??``,i),a,n,r)}};i(e,void 0,void 0);for(let[t,n,r]of s(v(e.target),`target`)){if(V(t)===void 0)throw new C(`${T(t)} is neither a target's name nor a cfg(\u2026) cargo reads`,r);o(n,r,qe.flatMap(([e])=>[e,e.replaceAll(`-`,`_`)])),i(n,r,t)}return r.list}function J(e){let t=e.indexOf(`/`);if(t!==-1){let n=e[t-1]===`?`;return{dep:e.slice(0,n?t-1:t),feature:e.slice(t+1),weak:n}}return e.startsWith(`dep:`)?{dep:e.slice(4),feature:void 0,weak:!1}:{dep:void 0,feature:e,weak:!1}}function et(e,t,n){let r=m(e,t,ce,f()),i=new Set(Object.values(r).flat().map(J).filter(e=>e.feature===void 0).map(e=>e.dep)),a=Object.assign(Object.create(null),r),o=new Map;for(let e of n)o.set(e.name,o.get(e.name)||e.optional),e.optional&&!(e.name in r)&&!i.has(e.name)&&(a[e.name]=[`dep:${e.name}`]);let s=new Set;for(let[e,n]of Object.entries(a))for(let i of n){let n=n=>w(`${T(i)} ${n}`,E(t,e)),{dep:c,feature:l,weak:u}=J(i);if(c===void 0){if(l in r)continue;o.has(l)||n(`is neither a feature nor a dependency`),o.get(l)||n(`is a dependency, but not an optional one`),l in a||n(`is an optional dependency with no feature of its name: use "dep:${l}"`);continue}s.add(c),l?.includes(`/`)&&n(`has more than one "/"`),c.startsWith(`dep:`)&&n(`has both "dep:" and "/"`),o.has(c)||n(`names ${T(c)}, which is not a dependency`),(l===void 0||u)&&!o.get(c)&&n(`names ${T(c)}, which is not an optional dependency`)}let c=[...o].find(([e,t])=>t&&!s.has(e));if(c!==void 0)throw new C(`optional dependency ${T(c[0])} is in no feature: add "dep:${c[0]}" to one`,t);return a}var tt=[`badges`,`features`,`lib`,`bin`,`example`,`test`,`bench`,`dependencies`,`dev-dependencies`,`dev_dependencies`,`build-dependencies`,`build_dependencies`,`target`,`lints`,`hints`],nt=[...tt,`package`,`project`,`workspace`,`profile`,`patch`],rt={"cargo-features":`cargo-features, ${W}`,replace:`[replace] is not supported`},it={metabuild:`metabuild, ${W}`,"default-target":`a per-package target, ${W}`,"forced-target":`a per-package target, ${W}`,"im-a-teapot":`im-a-teapot, ${W}`,"cargo-features":`cargo-features belong at the top of the manifest, and are not supported`},at=[`members`,`exclude`,`default-members`,`resolver`,`metadata`,`package`,`dependencies`,`lints`],ot=[`2015`,`2018`,`2021`,`2024`],Y={__proto__:null,2018:`1.31.0`,2021:`1.56.0`,2024:`1.85.0`},st={__proto__:null,1:1,2:2,3:3},ct=d(e=>ot.includes(e),`an edition: expected one of ${ot.join(`, `)}`),lt=d(e=>e in st,`a resolver: expected "1", "2" or "3"`),ut=(e,t)=>st[lt(e,t)];function dt(e){let r=t(e);if(r!==void 0)return r.pre===``&&r.build===``?r:void 0;let i=n(e);if(i?.length!==1||i[0].op!==`^`||i[0].pre!==``||e.startsWith(`^`))return;let{major:a,minor:o,patch:s}=i[0];return t(`${a}.${o??0}.${s??0}`)}var ft=d(e=>dt(e)!==void 0,`a Rust version`);function pt(e,t){if(typeof e!=`boolean`&&typeof e!=`string`)throw a(`true, false or a path`,e,t);return e}var mt=e=>[!1,!0].every(t=>Oe(e,t)!==void 0);function ht(e,t){if(Array.isArray(e))throw new C(`several build scripts, ${W}`,t);let n=pt(e,t);if(typeof n==`string`&&!mt(n))throw new C(`${T(n)} names no file, which cargo crashes on`,t);return n}function gt(e,t){let n=l(e,t);if(/^\p{White_Space}*$/u.test(n))throw new C(`a library's name cannot be empty, which cargo refuses`,t);if(n.includes(`-`))throw new C(`${T(n)}: a library's name cannot have a "-", which cargo refuses`,t);return n}function _t(e,t){let n=v(e.lib);return{name:b(n,`name`,`lib`,gt)??t.replaceAll(`-`,`_`),path:b(n,`path`,`lib`,l)}}function vt(e,t){if(typeof e==`boolean`)return e;if(!Array.isArray(e))throw a(`true, false or registry names`,e,t);return p(e,t)}var X={authors:p,categories:p,description:l,documentation:l,edition:ct,exclude:p,homepage:l,include:p,keywords:p,license:l,"license-file":l,publish:vt,readme:pt,repository:l,"rust-version":ft,version:O},yt={...X,name:D,build:ht,links:l,workspace:l,autolib:u,autobins:u,autoexamples:u,autotests:u,autobenches:u,"default-run":l,resolver:ut,metadata:e=>e};function bt(e,t){for(let[,n,r]of s(e,t))for(let[,e,t]of s(n,r))l(e,t);return e}function xt(e,t,n,r){o(e,t);let i=y(u)(K(e,t,`proc-macro`,n),E(t,`proc-macro`)),a=y(p)(K(e,t,`crate-type`,n),E(t,`crate-type`));if(r&&a?.includes(`proc-macro`)&&a.length>1)throw new C(`a proc-macro crate type is taken alone`,E(t,`crate-type`));return i??a?.includes(`proc-macro`)??!1}function St(e,t){let n=e.lib!==void 0&&xt(e.lib,`lib`,t,!0),r=[`example`,`test`,`bench`].flatMap(n=>c(e[n]??[],n).map((e,r)=>xt(e,`${n}[${r}]`,t,!1)));return{procMacro:n,procMacroTarget:n||r.includes(!0)}}function Ct(e){o(e,`workspace`,at);let t=(t,n)=>b(e,t,`workspace`,n),n=t(`package`,(e,t)=>o(e,t,[...Object.keys(X),`badges`]))??Object.create(null);for(let[e,t,r]of s(n,`workspace.package`))(e===`badges`?bt:X[e])(t,r);let r=m(e.dependencies,`workspace.dependencies`,D,(e,t,n)=>{let r=q(e,t,n);if(r.optional)throw new C(`a workspace dependency cannot be optional`,t);if(x(e)&&e.public!==void 0)throw new C(`a workspace dependency cannot be public`,t);return r});return{members:t(`members`,p)??[],exclude:t(`exclude`,p)??[],defaultMembers:t(`default-members`,p),resolver:t(`resolver`,ut),package:n,dependencies:r}}var wt=e=>m(e,`patch`,e=>e,(e,t)=>m(e,t,D,q));function Tt(e,t,n){if(x(e)&&x(t)){let r=Object.assign(Object.create(null),t);for(let[i,a]of Object.entries(e))r[i]=Object.hasOwn(t,i)?Tt(a,t[i],E(n,i)):a;return r}if(Array.isArray(e)&&Array.isArray(t))return[...t,...e];if([e,t].some(e=>x(e)||Array.isArray(e)))throw new C(`${i(e)} in one config and ${i(t)} in one under it, which cargo does not merge`,n);return e}function Et(e){if(!Array.isArray(e)||!e.every(e=>typeof e==`string`))throw TypeError(`expected the texts of the config files`);let t;for(let[n,r]of e.entries()){let e=se(()=>S(r),e=>{throw e instanceof oe&&(e.message=`texts[${n}]: ${e.message}`),e});e.patch!==void 0&&(t=t===void 0?e.patch:Tt(t,e.patch,`patch`))}return{patch:wt(t)}}function Dt(e,t,n,r){if(!x(e))return e;if(Xe(e,t,[`workspace`],r),r.package[n]===void 0)throw new C(`workspace.package.${n} is not given`,t);return r.package[n]}function Ot(e,t){if(e.package!==void 0&&e.project!==void 0)throw new C(`[project] beside [package]`,`project`);let i=e.package===void 0?`project`:`package`,a=o(e[i],i,Object.keys(yt),it),s=Object.create(null);for(let[e,n]of Object.entries(yt)){let r=E(i,e);s[e]=y(n)(e in X?Dt(a[e],r,e,t):a[e],r)}if(a.workspace!==void 0&&e.workspace!==void 0)throw new C(`a workspace root names no other root`,E(i,`workspace`));let c=s.edition??`2015`;if(i===`project`&&c===`2024`)throw new C(`not supported in the 2024 edition: use [package]`,i);let l=s[`rust-version`];if(l!==void 0&&c in Y&&!r(n(`^${Y[c]}`),dt(l)))throw new C(`rust-version ${T(l)} is incompatible with ${Y[c]}, which the ${c} edition requires`,E(i,`rust-version`));let{version:u,publish:d,resolver:f,links:p}=s;if(u===void 0&&d!==void 0&&d!==!1&&!(Array.isArray(d)&&d.length===0))throw new C("`publish` needs a `version`",E(i,`publish`));if(f!==void 0&&e.workspace?.resolver!==void 0)throw new C("`resolver` is given in [workspace] too",E(i,`resolver`));if(p!==void 0&&s.build===!1)throw new C(`links to ${T(p)} with no build script, which cargo refuses`,E(i,`links`));let m=s.build===!0?`build.rs`:s.build;return{name:D(a.name,E(i,`name`)),version:u??`0.0.0`,edition:c,resolver:f,links:p,build:m}}function kt(e,t){let n=o(S(e),void 0,nt,rt),r=n.workspace===void 0?void 0:Ct(n.workspace);if(r!==void 0&&t!==void 0)throw new C(`a workspace root inherits from its own [workspace], not another`,`workspace`);if(t!==void 0&&t.workspace===void 0)throw TypeError(`expected the manifest of a workspace root`);let i=r??t?.workspace,a=wt(n.patch);if(n.package===void 0&&n.project===void 0){if(r===void 0)throw new C(`neither [package] nor [workspace]`);let e=tt.find(e=>n[e]!==void 0);if(e!==void 0)throw new C(`a virtual manifest has no package for it`,e);return{package:void 0,workspace:r,patch:a}}let s=Ot(n,i),c=$e(n,i,s.edition),l=St(n,s.edition);return{package:{...s,features:et(n.features,`features`,c),dependencies:c,lib:_t(n,s.name),...l},workspace:r,patch:a}}function At(e,t){let n=o(S(e),t),r=E(t,n.package===void 0?`project`:`package`),i=o(n.package??n.project,r),a=D(i.name,E(r,`name`));if(x(i.version))throw new C(`a vendored package inherits nothing from a workspace`,E(r,`version`));return{name:a,version:b(i,`version`,r,O)??`0.0.0`}}function jt(e){let t=0;for(let n of e.matchAll(/"(?:[^"\\]|\\.)*"(\s*:)?/gsu))n[1]!==void 0&&t++;return t}function Mt(e,t){let n=se(()=>JSON.parse(e),e=>w(`not JSON: ${e.message}`,t));if(!re(n))throw new C(`expected an object`,t);if(n.$comment!==void 0&&typeof n.$comment!=`string`)throw new C(`expected "$comment" to be a string`,t);if(Object.keys(n).filter(e=>e!==`$comment`).sort().join()!==`files,package`)throw new C(`expected "files" and "package", and nothing else`,t);if(n.package!==null&&!g(n.package))throw new C(`expected "package" to be a sha256 or null`,t);if(!re(n.files))throw new C(`expected "files" to be an object`,t);let r=Object.create(null);for(let[e,i]of Object.entries(n.files)){if(!te(e))throw new C(`${T(e)} is not a path within the package`,t);if(typeof i!=`string`||!g(i))throw new C(`expected a sha256 for ${T(e)}`,t);r[e]=i}if(jt(e)!==Object.keys(n).length+Object.keys(r).length)throw new C(`a key is given twice`,t);return{checksum:n.package??void 0,files:r}}function Nt(e){if(typeof e!=`string`)throw TypeError(`expected the text of a .cargo-checksum.json`);return Mt(e,void 0)}function Pt(e,t){if(typeof t!=`object`||!t)throw TypeError(`expected the vendor directory, by directory`);let n=new Map;for(let[e,r]of Object.entries(t)){if(!ee(e)||e.startsWith(`.`))throw new C(`${T(e)} is not a directory a directory source reads`,e);if(typeof r?.manifest!=`string`||typeof r.checksum!=`string`)throw TypeError(`expected the manifest and checksum texts of ${T(e)}`);let{name:t,version:i}=At(r.manifest,E(e,`Cargo.toml`)),a=`${t} ${i}`;if(n.has(a))throw new C(`${T(n.get(a).directory)} holds ${T(a)} too, and cargo would read either`,e);n.set(a,{directory:e,...Mt(r.checksum,E(e,`.cargo-checksum.json`))})}let r=Object.create(null);for(let[t,i]of Object.entries(e.packages)){if(i.source===void 0)continue;let e=n.get(`${i.name} ${i.version}`);if(e===void 0)throw new C(`no directory holds ${T(`${i.name} ${i.version}`)}`,t);if(e.checksum!==i.checksum)throw new C(`${T(e.directory)} holds it with checksum ${e.checksum??`none`}, where the lockfile has ${i.checksum??`none`}`,t);r[t]={directory:e.directory,files:e.files}}return r}var Z=(e,t)=>e.get(t)??e.set(t,new Set).get(t),Ft=(e,t,n)=>new C(`${T(e)} is asked of ${T(t)}, which has no such feature`,n),It=(e,t)=>new C(`feature ${T(e)} enables itself, which cargo refuses`,t);function Q(e,t){return t.defaultFeatures&&`default`in e[t.resolved].manifest.features?[...t.features,`default`]:t.features}var Lt=()=>({features:new Set,enabled:new Set,asked:new Map}),Rt=class{constructor(e,t){this.packages=e,this.why=t,this.requests=new Map,this.active=new Set,this.dirty=new Set}requestOf(e){return this.requests.has(e)||(this.requests.set(e,Lt()),this.dirty.add(e)),this.requests.get(e)}require(e,t,n,r){let i=this.packages[e].manifest.features;if(!(n in i))throw Ft(n,e,r);if(!t.features.has(n)){if(t.features.add(n),this.dirty.add(e),i[n].includes(n))throw It(n,e);for(let r of i[n])this.requireValue(e,t,J(r),e)}}requireValue(e,t,n,r){if(n.dep===void 0)return this.require(e,t,n.feature,r);let{features:i,dependencies:a}=this.packages[e].manifest,o=a.some(e=>e.name===n.dep&&e.optional);n.feature!==void 0&&!n.weak&&o&&n.dep in i&&this.require(e,t,n.dep,r),t.enabled.add(n.dep),n.feature!==void 0&&Z(t.asked,n.dep).add(n.feature),this.dirty.add(e)}ask(e,t,n){if(e.resolved===void 0)throw new C(this.why(e,n),n);this.active.add(e);let r=this.requestOf(e.resolved);for(let i of[...Q(this.packages,e),...t])this.require(e.resolved,r,i,n)}run(e){for(let[t,n]of e){let[e,r]=[Lt(),this.requestOf(t)];for(let i of n)this.requireValue(t,e,i,`features`),this.requireValue(t,r,i,`features`);for(let n of this.packages[t].dependencies)n.kind===`dev`&&this.ask(n,e.asked.get(n.name)??[],t)}for(;this.dirty.size>0;){let e=this.dirty.values().next().value;this.dirty.delete(e);let t=this.requestOf(e);for(let n of this.packages[e].dependencies)n.kind===`dev`||n.optional&&!t.enabled.has(n.name)||this.ask(n,t.asked.get(n.name)??[],e)}return this.active}};function zt(e,t,n){return new Rt(e,n).run(t)}var Bt=`path`,Vt={__proto__:null,registry:{registry:!1,index:!1},git:{url:!0,branch:!1,tag:!1,rev:!1},path:{path:!0}};function Ht(e){let t=Vt[e?.type];if(!(t!==void 0&&Object.entries(t).every(([t,n])=>typeof e[t]==`string`||!n&&e[t]===void 0)))throw TypeError(`expected a source, as parseCargoManifest gives one`)}function Ut(e,t){if(typeof e!=`string`)throw TypeError(`expected the key of a [patch] table`);return Ht(t),I(t)===F(e)}var Wt=(e,n)=>e===void 0||r(e,t(n)),Gt=(e,t)=>t.identity===e||e===N&&t.source!==void 0&&!t.source.startsWith(`git+`),Kt=(e,t)=>t.name===e.package&&Gt(e.identity,t)&&Wt(e.requirement,t.version),qt=(e,t)=>({...e,key:L(e.name,e.version,e.source),identity:e.source===void 0?Bt:j(e.source,t,!1).identity});function Jt(e,t,n){let r=new Map;for(let i of Object.keys(e).toSorted()){let a=E(t,i),o=Object.entries(e[i]).map(([e,t])=>({key:i,name:e,spec:t,where:E(a,e)}));r.set(me(i),{key:i,where:a,label:`${n}[patch.${i}]`,entries:o})}return r}function Yt(e,t){let n=Jt(v(t?.patch),E(`config`,`patch`),`the config's `);for(let[t,r]of Jt(e.patch,`patch`,``)){let e=n.get(t);e===void 0?n.set(t,r):e.entries.push(...r.entries.filter(t=>!e.entries.some(e=>e.name===t.name)))}let r=new Map;for(let{key:e,where:t,label:i}of n.values()){let n=F(e),a=r.get(n);if(a!==void 0)throw new C(`patches the source ${a} does by another URL, and cargo would take either table`,t);r.set(n,i)}return[...n.values()].flatMap(e=>e.entries)}function Xt(e,t){return Yt(e,t).map(({key:e,spec:t,where:n})=>{let r=F(e);if(I(t.source)===r)throw new C(`patches its source with itself, which cargo refuses`,n);let i=y(G)(t.version,n);return{table:r,target:`${r} ${t.package}`,package:t.package,identity:P(t.source,Bt),requirement:i,where:n}})}function Zt(e,t,n){let r=t.map(()=>{}),i=(e,a)=>t.some((t,o)=>a.has(o)||!n(e,t)||(a.add(o),r[o]!==void 0&&!i(r[o],a))?!1:(r[o]=e,!0));return e.find(e=>!i(e,new Set))}function Qt(e,t,n,r){let i=t.map(e=>qt(e,`patch.unused`)),a=i.find(t=>t.source!==void 0&&e.has(t.key));if(a!==void 0)throw new C(`the lockfile lists ${T(a.key)} unused, and among its packages: is it out of date?`,`patch.unused`);let o=new Map;for(let t of n)for(let n of e.values())Kt(t,n)&&o.set(`${t.table} ${n.key}`,{...n,table:t.table});let s=(e,t)=>(t.table===void 0||t.table===e.table)&&Kt(e,t),c=Zt(n,[...o.values(),...i],s);if(c!==void 0)throw new C(`the lockfile has no package of its own this patch offers, used or unused: is it out of date?`,c.where);let l=Zt([...[...r].map(e=>o.get(e)),...i],n,(e,t)=>s(t,e));if(l?.table!==void 0)throw new C(`a dependency resolves to it by a [patch], and no patch is left that offers it: is the lockfile out of date?`,l.key);if(l!==void 0)throw new C(`the lockfile lists ${T(`${l.name} ${l.version}`)} unused where no [patch] does: is it out of date?`,`patch.unused`)}function $t(e){let t=e.package?.edition;return e.workspace?.resolver??e.package?.resolver??(t===`2024`?3:t===`2021`?2:1)}function en(e,t){let n=new Map;for(let r of t){if(!(r in e.packages)||e.packages[r].source!==void 0)throw new C(`${T(r)} is not a path package in the lockfile`,`members`);let{name:t}=e.packages[r];if(n.has(t)&&n.get(t)!==r)throw new C(`${T(n.get(t))} and ${T(r)} are two members of one name, which cargo refuses`,`members`);n.set(t,r)}}function tn(e){let t=new Map;for(let[n,{manifest:r}]of Object.entries(e))if(r.links!==void 0){if(t.has(r.links))throw new C(`links the native library ${T(r.links)}, as ${T(t.get(r.links))} does, which cargo refuses`,n);t.set(r.links,n)}}function nn(e,t,n,r){let i=Object.create(null),a=new Map,o=new Map;for(let[s,c]of Object.entries(e.packages)){let e=t[s]?.package;if(e===void 0)throw new C(`no manifest of this package is given`,s);if(e.name!==c.name||e.version!==c.version)throw new C(`the manifest given is of ${T(`${e.name} ${e.version}`)}`,s);let l=n.includes(s),u=e.dependencies.map((e,t)=>{let n=l||e.kind!==`dev`?on(e,s,r,E(E(s,`dependencies`),String(t))):[],i={...e,resolved:n.length===1?n[0].key:void 0,active:!1};return n.length>1&&a.set(i,n.map(e=>e.key)),n.length===1&&n[0].slot!==void 0&&o.set(i,n[0].slot),i});i[s]={...R(c),manifest:e,dependencies:u}}return{packages:i,ambiguous:a,patched:o}}function rn(e,t,n){let r=new Set(n);for(let e of Object.values(t))for(let t of e.dependencies)t.active&&r.add(t.resolved);let i=Object.keys(t).find(e=>!r.has(e));if(i!==void 0)throw new C(`no member depends on it, directly or not: is the lockfile out of date?`,i);for(let[n,r]of Object.entries(t)){let t=new Set(r.dependencies.filter(e=>e.active).map(e=>e.resolved)),i=e.packages[n].dependencies.find(e=>!t.has(e));if(i!==void 0)throw new C(`the lockfile's edge to ${T(i)} is no dependency the members' features turn on: is it out of date?`,n)}}function an(e,t,n){let{workspace:r,members:i,config:a}=ae(n,[`workspace`,`members`,`config`]);if(r?.patch===void 0||r.workspace===void 0&&r.package===void 0)throw TypeError(`expected the manifest of the workspace root`);if(!Array.isArray(i))throw TypeError(`expected the members of the workspace`);if(a!==void 0&&a?.patch===void 0)throw TypeError(`expected the config, as parseCargoConfig gives it`);en(e,i);let o=r.package===void 0?void 0:L(r.package.name,r.package.version);if(o!==void 0&&!i.includes(o))throw new C(`the root package ${T(o)} is not among the members`,`members`);let s=new Map(Object.entries(e.packages).map(([e,t])=>[e,qt(t,e)])),c=Xt(r,a),{packages:l,ambiguous:u,patched:d}=nn(e,t,i,{locked:s,patches:Map.groupBy(c,e=>e.target)}),f=new Map(i.map(e=>[e,Object.keys(l[e].manifest.features).map(J)])),p=(t,n)=>{if(u.has(t))return`${T(t.name)} could be any of ${u.get(t).map(T).join(`, `)}`;let r=e.packages[n].dependencies.filter(n=>e.packages[n].name===t.package);return r.length===0?`the lockfile resolves no ${T(t.name)}, which the members' features turn on: is it out of date?`:`the lockfile resolves ${T(t.name)} to none but ${r.map(T).join(`, `)}, of another source or version: is it out of date, or [patch]ed by a config not given?`};for(let e of zt(l,f,p))e.active=!0;return rn(e,l,i),tn(l),Qt(s,e.unusedPatches,c,new Set(d.entries().filter(([e])=>e.active).map(([,e])=>e))),{resolver:$t(r),root:o,members:[...i],packages:l}}function on(e,t,{locked:n,patches:r},i){let a=y(G)(e.version,i),o=P(e.source,n.get(t).identity),s=I(e.source),c=r.get(`${s} ${e.package}`)??[];return n.get(t).dependencies.flatMap(t=>{let r=n.get(t);return r.name!==e.package||!Wt(a,r.version)?[]:Gt(o,r)?[{key:t,slot:void 0}]:c.some(e=>Kt(e,r))?[{key:t,slot:`${s} ${t}`}]:[]})}var sn=/^[A-Z_a-z]\w*$/u;function $(e,t){if(typeof e!=`object`||!e||!Array.isArray(e.cfg)||e.name!==void 0&&typeof e.name!=`string`)throw TypeError(`expected ${t} as { name, cfg }`);if(e.decides!==void 0&&!(Array.isArray(e.decides)&&e.decides.every(e=>typeof e==`string`)))throw TypeError(`expected ${t}.decides as the names of cfgs`);let n=e.cfg.map(e=>Fe(e)??w(`${T(e)} is not a line of \`rustc --print cfg\``,t)),r=e.decides?.map(e=>sn.test(e)?e:w(`${T(e)} is not the name of a cfg`,E(t,`decides`)));return{name:e.name,cfg:new Set(n),decides:r===void 0?void 0:new Set(r)}}var cn=e=>e.name===void 0||e.decides!==void 0;function ln(e){let t=$(e,`platform`),n=new Map;return e=>{if(typeof e!=`string`)throw TypeError(`expected a platform as a [target] table names it`);return n.has(e)||n.set(e,V(e)),Re(n.get(e)??w(`${T(e)} is neither a target's name nor a cfg(\u2026) cargo reads`),t)}}function un(e){if(!Array.isArray(e)||!e.every(e=>typeof e==`string`))throw TypeError(`expected the features as strings`);return[...new Set(e.flatMap(e=>e.split(/[\p{White_Space},]+/u)).filter(Boolean))].map(e=>{let t=J(e);if(t.feature===void 0)throw new C(`${T(e)}: \`dep:\` is not taken on the command line`,`features`);if(t.dep!==void 0&&t.feature.includes(`/`))throw new C(`${T(e)} has more than one "/"`,`features`);return{text:e,...t}})}function dn(e){let t=e=>(e.target===void 0?[`normal`,`dev`,`build`]:[`normal`,`build`,`dev`]).indexOf(e.kind),n=e.dependencies.toSorted((e,n)=>{let[r,i]=[e.target??``,n.target??``];return r===i?t(e)-t(n):r<i?-1:1});return new Map(n.map(e=>[e.name,e]))}function fn(e,t,n){let r=dn(e),i=t=>t in e.features||r.get(t)?.optional===!0,a=t=>t.dep===void 0?i(t.feature)?t:void 0:r.has(t.dep)?t:t.dep===e.name&&i(t.feature)?J(t.feature):void 0;return t.flatMap(e=>{let t=a(e);return t===void 0?[]:(n.add(e.text),[t])})}function pn(e,t,n,r){let i=new Map;if(e.root===void 0||e.resolver>=2){let a=new Set;for(let o of n)i.set(o,[fn(e.packages[o].manifest,t,a),!r.noDefaultFeatures]);let o=t.filter(e=>!a.has(e.text));if(o.length>0)throw new C(`no package selected has ${o.map(e=>T(e.text)).join(`, `)}`,`features`);return i}let a=r.current??e.root;if(!e.members.includes(a))throw new C(`${T(a)} is not a member of the workspace`,`current`);let o=t=>e.packages[t].name,s=t=>t.dep!==void 0&&e.members.some(e=>e!==a&&o(e)===t.dep)&&n.some(e=>o(e)===t.dep),c=Map.groupBy(t.filter(s),e=>e.dep);for(let l of e.members)l===a?i.set(l,[t.filter(e=>!s(e)),!r.noDefaultFeatures]):n.includes(l)&&i.set(l,[(c.get(o(l))??[]).map(e=>J(e.feature)),!0]);return i}function mn(e,t){let{packages:n}=t;if(!Array.isArray(n)||n.length===0)throw TypeError(`expected the packages built, as keys of members`);for(let t of n)if(!e.members.includes(t))throw new C(`${T(t)} is not a member of the workspace`,`packages`);let r=e.members.filter(e=>n.includes(e)),i=new Map;for(let[n,[a,o]]of pn(e,un(t.features??[]),r,t)){let{features:r,dependencies:s}=e.packages[n].manifest,c=a.find(e=>e.dep!==void 0&&!s.some(t=>t.name===e.dep));if(c!==void 0)throw new C(`${T(n)} has no dependency ${T(c.dep)}`,`features`);let l=[...o&&`default`in r?[`default`]:[],...t.allFeatures?Object.keys(r):[]];i.set(n,[...a,...l.map(J)])}return i}function hn(e,t){let{undecided:n}=e;if(n===void 0){if(t.some(cn))throw TypeError("expected `undecided`, 'on' or 'off', as a platform leaves cfgs undecided");return!1}if(n!==`on`&&n!==`off`)throw TypeError("expected `undecided` to be 'on' or 'off'");if(e.targets===`all`)throw TypeError("expected no `undecided` with targets 'all', which reads every platform");return n===`on`}var gn=class{constructor(e,t,n){this.graph=e,this.targeted=t;let r=n.targets===`all`;this.host=r?void 0:$(n.host,`host`),this.targets=r?[]:(n.targets?.length>0?n.targets:[n.host]).map((e,t)=>$(e,`targets[${t}]`)),this.undecided=hn(n,r?[]:[this.host,...this.targets]),this.dev=n.dev===!0,this.decoupleHost=e.resolver>=2,this.decoupleDev=e.resolver>=2&&!this.dev,this.ignoreInactive=e.resolver>=2&&!r,this.trackForHost=this.decoupleHost||this.ignoreInactive,this.platforms=new Map,this.depsOf=new Map,this.activated=new Map,this.activatedDeps=new Map,this.processed=new Set,this.deferred=new Map}saved(e){return this.decoupleHost?e:`normal`}enabled(e,t){return Z(this.activated,`${this.saved(t)} ${e}`)}features(e){return this.graph.packages[e].manifest.features}deps(e,t){let n=`${t} ${e}`;return this.depsOf.has(n)||this.depsOf.set(n,this.graph.packages[e].dependencies.filter(e=>this.targeted.has(e)&&!(e.kind===`dev`&&this.decoupleDev)&&(e.target===void 0||!this.ignoreInactive||this.activeFor(e,t))).map(e=>({dep:e,depFk:this.trackForHost&&this.forHost(e)?`host`:t}))),this.depsOf.get(n)}forHost(e){return e.kind===`build`||this.graph.packages[e.resolved].manifest.procMacro}activeFor(e,t){this.platforms.has(e.target)||this.platforms.set(e.target,V(e.target));let n=this.platforms.get(e.target),r=e=>Re(n,e)??this.undecided;return e.kind===`build`||t===`host`?r(this.host):this.targets.some(r)}request(e,t,n,r){if(!(n in this.features(e)))throw Ft(n,e,r);this.activateRec(e,t,n)}activatePkg(e,t,n,r){for(let i of n)this.request(e,t,i,r);if(!this.processed.has(`${t} ${e}`)){this.processed.add(`${t} ${e}`);for(let{dep:n,depFk:r}of this.deps(e,t))n.optional||this.activatePkg(n.resolved,r,Q(this.graph.packages,n),e)}}activateValue(e,t,n){n.dep===void 0?this.activateRec(e,t,n.feature):n.feature===void 0?this.activateDependency(e,t,n.dep):this.activateDepFeature(e,t,n.dep,n.feature,n.weak)}activateRec(e,t,n){let r=this.enabled(e,t);if(r.has(n))return;r.add(n);let i=this.features(e)[n]??[];if(i.includes(n))throw It(n,e);for(let n of i)this.activateValue(e,t,J(n))}activateDependency(e,t,n){Z(this.activatedDeps,`${this.saved(t)} ${e}`).add(n);let r=this.deferred.get(`${t} ${e} ${n}`)??[];this.deferred.delete(`${t} ${e} ${n}`);for(let{dep:i,depFk:a}of this.deps(e,t).filter(e=>e.dep.name===n)){for(let t of r)this.request(i.resolved,a,t,e);this.activatePkg(i.resolved,a,Q(this.graph.packages,i),e)}}activateDepFeature(e,t,n,r,i){for(let{dep:a,depFk:o}of this.deps(e,t).filter(e=>e.dep.name===n)){if(a.optional){if(i&&!this.activatedDeps.get(`${this.saved(t)} ${e}`)?.has(n)){Z(this.deferred,`${t} ${e} ${n}`).add(r);continue}this.activateDependency(e,t,n),!i&&n in this.features(e)&&this.activateRec(e,t,n)}this.request(a.resolved,o,r,e)}}builtKinds(e){let{procMacro:t,procMacroTarget:n}=this.graph.packages[e].manifest;return t||n&&this.dev?[`normal`,`host`]:[`normal`]}resolveRoot(e,t){for(let n of this.trackForHost&&this.graph.packages[e].manifest.procMacroTarget?[`normal`,`host`]:[`normal`]){for(let r of t)this.activateValue(e,n,r);this.activatePkg(e,n,[],`roots`)}}reach(e,t){let n=new Map,r=(e,t)=>{n.has(`${t} ${e}`)||n.set(`${t} ${e}`,[e,t])};for(let[t,n]of e)r(t,n);let i=new Set(n.keys());for(let[e,a]of n.values()){let n=this.activatedDeps.get(`${this.saved(a)} ${e}`);for(let o of this.graph.packages[e].dependencies)!this.targeted.has(o)||o.optional&&!n?.has(o.name)||o.kind===`dev`&&!(this.dev&&i.has(`${a} ${e}`))||o.target!==void 0&&this.host!==void 0&&!this.activeFor(o,a)||t(e,o)&&r(o.resolved,a===`host`||this.forHost(o)?`host`:`normal`)}return n}result(e){let t=e.map(e=>[e,this.graph.packages[e].manifest.procMacro?`host`:`normal`]);this.reach(t,(e,t)=>this.checkNamed(e,t));let n=this.reach(e.flatMap(e=>this.builtKinds(e).map(t=>[e,t])),()=>!0),r=Object.create(null);for(let e of Object.keys(this.graph.packages)){let[t,i]=[`normal`,`host`].map(t=>n.has(`${t} ${e}`)?[...this.enabled(e,t)].sort():void 0);(t!==void 0||i!==void 0)&&(r[e]={normal:t,host:i})}return r}checkNamed(e,t){let n=e=>e.name.replaceAll(`-`,`_`),r=this.graph.packages[e].dependencies.find(e=>this.targeted.has(e)&&e.resolved===t.resolved&&n(e)!==n(t));if(r!==void 0)throw new C(`depends on ${T(t.resolved)} as both ${T(t.name)} and ${T(r.name)}, which cargo refuses to build`,e);return!0}};function _n(e,t){ae(t,[`packages`,`features`,`allFeatures`,`noDefaultFeatures`,`current`,`dev`,`host`,`targets`,`undecided`]);let n=mn(e,t),r=new gn(e,zt(e.packages,n,e=>`the build turns on ${T(e.name)}, which the lockfile does not resolve to one package, and cargo would anew`),t);for(let[e,t]of n)r.resolveRoot(e,t);return r.result(t.packages)}export{C as LockfileError,oe as TomlError,an as linkCargo,ln as matchCargoPlatform,Nt as parseCargoChecksum,Et as parseCargoConfig,we as parseCargoLock,kt as parseCargoManifest,Ut as patchesCargoSource,Pt as readCargoVendor,_n as resolveCargoFeatures};
@@ -1 +1 @@
1
- import{Ka as e}from"./chunk-LJ7XRXFU.js";import{l as t,o as n,u as r}from"./chunk-7VAWINQF.js";import{a as i}from"./chunk-WCPJDAYA.js";import{b as a}from"./chunk-IYPY47MC.js";import{D as o,J as s,L as c,q as l}from"./chunk-SXV2T5C4.js";function u(e){let{data:t}=c(e);return t&&d(t)>0?t:null}function d(e){return(s(e)??[]).filter(t=>(Array.isArray(t)?t:[t]).some(t=>t&&typeof t==`object`&&l(t,t.source??e.source))).length}function f(e,t){let n=[],r=new Map;for(let{name:t,content:i,fallbackRepo:a}of e){if(typeof i!=`string`)continue;let e=u(i);if(!e)continue;let c=s(e),l=o(e)??o({repo:{github:a}}),f=new Set(l?[l]:[]);if(!l)for(let e of c.flat()){if(/(?:^|\/)(?:node_modules|dependencies)\//u.test(e?.file??``))continue;let t=o(e);t&&f.add(t)}for(let e of f)r.set(e,{id:e,label:e});n.push({id:t,filename:t,repoIds:[...f],analyzer:e.source,appFindings:d(e)})}let i=new Set(n.map(e=>e.id));return{merge:{bundles:[],results:[]},link:{reports:n,repositories:[...r.values()],workspaces:t.map(e=>({id:e.id,label:e.name,reports:e.reports.filter(e=>i.has(e))})).filter(e=>e.reports.length>0)}}}function p(e,t){let n=(e.reports??[]).filter(e=>e.visible&&e.repoId!=null).flatMap(e=>{let t=u(e.content??``);return t?[{id:e.id,filename:e.filename,repoIds:[e.repoId],repo:e.repoFullName,directory:e.repoDirectory,analyzer:e.analyzer,appFindings:d(t)}]:[]}),r=new Map((e.repos??[]).map(e=>[e.repoId,{id:e.repoId,label:e.fullName}]));for(let e of n)r.has(e.repoIds[0])||r.set(e.repoIds[0],{id:e.repoIds[0],label:e.repo??String(e.repoIds[0])});let a=t.results??[],o=new Set(a.map(e=>e.bundleId));return{merge:{bundles:(t.bundles??[]).filter(e=>o.has(e.id)).map(e=>({...e,size:i(e.byteSize)})),results:a},link:{repositories:[...r.values()].filter(e=>n.some(t=>t.repoIds.includes(e.id))),reports:n}}}var m=new Map([[`openai/gpt-6-astra`,`GPT-6 Astra`],[`openai/gpt-6-astra-pro`,`GPT-6 Astra Pro`],[`openai/gpt-5.6-sol`,`GPT-5.6 Sol`],[`openai/gpt-5.6-terra`,`GPT-5.6 Terra`],[`openai/gpt-5.6-luna`,`GPT-5.6 Luna`],[`anthropic/claude-fable-5.1`,`Claude Fable 5.1`],[`anthropic/claude-opus-5`,`Claude Opus 5`],[`anthropic/claude-sonnet-5`,`Claude Sonnet 5`],[`moonshotai/kimi-k3`,`Kimi K3`],[`z-ai/glm-5.3`,`GLM 5.3`],[`qwen/qwen3.8-max`,`Qwen3.8 Max`],[`deepseek/deepseek-v4.1-flash`,`DeepSeek V4.1 Flash`],[`deepseek/deepseek-v4-pro`,`DeepSeek V4 Pro`]]),h=new Map([[`openai`,`OpenAI`],[`anthropic`,`Anthropic`],[`moonshotai`,`Moonshot AI`],[`google`,`Google`],[`nvidia`,`NVIDIA`],[`qwen`,`Qwen`],[`deepseek`,`DeepSeek`],[`x-ai`,`xAI`],[`z-ai`,`Z.ai`],[`mistralai`,`Mistral AI`],[`meta`,`Meta`],[`unbiased`,`Unbiased`]]),g=new Map([[`meta-llama`,`meta`]]),_=new Map([[`gpt`,`GPT`],[`gptoss`,`GPT OSS`],[`oss`,`OSS`],[`o`,`O`],[`ai`,`AI`],[`api`,`API`],[`4o`,`4o`],[`k3`,`K3`],[`k4`,`K4`],[`qwen`,`Qwen`],[`kimi`,`Kimi`],[`mimo`,`MiMo`],[`gemini`,`Gemini`],[`claude`,`Claude`],[`fable`,`Fable`],[`opus`,`Opus`],[`sonnet`,`Sonnet`],[`astra`,`Astra`],[`terra`,`Terra`],[`luna`,`Luna`],[`codex`,`Codex`],[`deepseek`,`DeepSeek`],[`nemotron`,`Nemotron`],[`gemma`,`Gemma`]]);function v(e){let t=e.replace(/:free$/u,``).replaceAll(`_`,`-`).split(`-`).filter(Boolean),n=[];for(let e=0;e<t.length;e++){let r=t[e],i=t[e+1];if(/^\d+$/u.test(r)&&/^\d+$/u.test(i??``)){n.push(`${r}.${i}`),e++;continue}let a=_.get(r.toLowerCase());n.push(a??(/^(?:[a-z]+\d+|\d+[a-z]+)$/iu.test(r)?r.toUpperCase():r[0]?.toUpperCase()+r.slice(1)))}return n.join(` `).replace(/^GPT (\d)/u,`GPT-$1`)}function y(e){return m.get(e)??v(e.includes(`/`)?e.slice(e.indexOf(`/`)+1):e)}function b(e){let t=e.includes(`/`)?e.split(`/`)[0].replace(/^~/u,``):`other`,n=g.get(t)??t;return{key:n,name:h.get(n)??(n===`other`?`Other`:v(n))}}function x(e){return e===`xhigh`?`Extra high`:e?e[0].toUpperCase()+e.slice(1):`Unavailable`}function S(e){return e.efforts.includes(`max`)?`max`:e.efforts.at(-1)??null}async function C(e,t=fetch){let n=await t(`/api/admin/scan/models`,{credentials:`same-origin`,headers:{accept:`application/json`},signal:e});if(!n.ok)throw Error(`HTTP ${n.status}`);return w(await n.json())}function w(e){if(!Array.isArray(e?.models))throw Error(`No model catalogue returned`);let t=e.models.filter(e=>typeof e?.id==`string`&&e.id.length>0).map(e=>({id:e.id,efforts:Array.isArray(e.efforts)?[...new Set(e.efforts.filter(e=>typeof e==`string`&&e.length>0))]:[]}));if(t.length===0)throw Error(`No models available`);return{models:t,defaultModel:t.find(t=>t.id===e.defaultModel)?.id??t[0].id}}function T(e,t=[]){let n=new Map,r=e.flatMap(e=>{let r=t.filter(t=>t.bundles?.includes(e.integrity));return(r.length>0?r.map(e=>({id:e.id,label:e.name})):[{id:`unattached`,label:`Unattached`}]).map(t=>(n.set(t.id,t),{id:e.integrity,integrity:e.integrity,filename:e.name,repoId:t.id,repo:t.label,files:null,reasons:[],size:`—`}))});return{repositories:[...n.values()],bundles:r,reports:[],scans:[]}}function E(o,s){if(s.error)throw Error(s.error);let c=n(s),l=s.kind===`stasis`?s.bundle?.formats:null,u=r(s),d=[...t(s)].filter(([,e])=>e!=null).map(([e,t])=>({path:e,format:l?.get(e)??null,bytes:t,lines:u.get(e)??0,size:i(t),module:a(e,{packageDir:c?.get(e)})})),f=[{id:`all`,label:`All`,filePaths:null},...[...e(s,d.map(e=>e.path))].map(([e,t])=>({id:`reason:${e}`,label:e,filePaths:[...t]}))];return{...o,files:d,reasons:f,size:i(s.size)}}export{T as a,E as b,f as c,p as d,y as e,b as f,x as g,S as h,C as i,w as j};
1
+ import{Ka as e}from"./chunk-I47TYPXO.js";import{m as t,p as n,v as r}from"./chunk-FHIVVVUA.js";import{a as i}from"./chunk-WCPJDAYA.js";import{b as a}from"./chunk-IYPY47MC.js";import{D as o,J as s,L as c,q as l}from"./chunk-QRKFPLA4.js";function u(e){let{data:t}=c(e);return t&&d(t)>0?t:null}function d(e){return(s(e)??[]).filter(t=>(Array.isArray(t)?t:[t]).some(t=>t&&typeof t==`object`&&l(t,t.source??e.source))).length}function f(e,t){let n=[],r=new Map;for(let{name:t,content:i,fallbackRepo:a}of e){if(typeof i!=`string`)continue;let e=u(i);if(!e)continue;let c=s(e),l=o(e)??o({repo:{github:a}}),f=new Set(l?[l]:[]);if(!l)for(let e of c.flat()){if(/(?:^|\/)(?:node_modules|dependencies)\//u.test(e?.file??``))continue;let t=o(e);t&&f.add(t)}for(let e of f)r.set(e,{id:e,label:e});n.push({id:t,filename:t,repoIds:[...f],analyzer:e.source,appFindings:d(e)})}let i=new Set(n.map(e=>e.id));return{merge:{bundles:[],results:[]},link:{reports:n,repositories:[...r.values()],workspaces:t.map(e=>({id:e.id,label:e.name,reports:e.reports.filter(e=>i.has(e))})).filter(e=>e.reports.length>0)}}}function p(e,t){let n=(e.reports??[]).filter(e=>e.visible&&e.repoId!=null).flatMap(e=>{let t=u(e.content??``);return t?[{id:e.id,filename:e.filename,repoIds:[e.repoId],repo:e.repoFullName,directory:e.repoDirectory,analyzer:e.analyzer,appFindings:d(t)}]:[]}),r=new Map((e.repos??[]).map(e=>[e.repoId,{id:e.repoId,label:e.fullName}]));for(let e of n)r.has(e.repoIds[0])||r.set(e.repoIds[0],{id:e.repoIds[0],label:e.repo??String(e.repoIds[0])});let a=t.results??[],o=new Set(a.map(e=>e.bundleId));return{merge:{bundles:(t.bundles??[]).filter(e=>o.has(e.id)).map(e=>({...e,size:i(e.byteSize)})),results:a},link:{repositories:[...r.values()].filter(e=>n.some(t=>t.repoIds.includes(e.id))),reports:n}}}var m=new Map([[`openai/gpt-6-astra`,`GPT-6 Astra`],[`openai/gpt-6-astra-pro`,`GPT-6 Astra Pro`],[`openai/gpt-5.6-sol`,`GPT-5.6 Sol`],[`openai/gpt-5.6-terra`,`GPT-5.6 Terra`],[`openai/gpt-5.6-luna`,`GPT-5.6 Luna`],[`anthropic/claude-fable-5.1`,`Claude Fable 5.1`],[`anthropic/claude-opus-5`,`Claude Opus 5`],[`anthropic/claude-sonnet-5`,`Claude Sonnet 5`],[`moonshotai/kimi-k3`,`Kimi K3`],[`z-ai/glm-5.3`,`GLM 5.3`],[`qwen/qwen3.8-max`,`Qwen3.8 Max`],[`deepseek/deepseek-v4.1-flash`,`DeepSeek V4.1 Flash`],[`deepseek/deepseek-v4-pro`,`DeepSeek V4 Pro`]]),h=new Map([[`openai`,`OpenAI`],[`anthropic`,`Anthropic`],[`moonshotai`,`Moonshot AI`],[`google`,`Google`],[`nvidia`,`NVIDIA`],[`qwen`,`Qwen`],[`deepseek`,`DeepSeek`],[`x-ai`,`xAI`],[`z-ai`,`Z.ai`],[`mistralai`,`Mistral AI`],[`meta`,`Meta`],[`unbiased`,`Unbiased`]]),g=new Map([[`meta-llama`,`meta`]]),_=new Map([[`gpt`,`GPT`],[`gptoss`,`GPT OSS`],[`oss`,`OSS`],[`o`,`O`],[`ai`,`AI`],[`api`,`API`],[`4o`,`4o`],[`k3`,`K3`],[`k4`,`K4`],[`qwen`,`Qwen`],[`kimi`,`Kimi`],[`mimo`,`MiMo`],[`gemini`,`Gemini`],[`claude`,`Claude`],[`fable`,`Fable`],[`opus`,`Opus`],[`sonnet`,`Sonnet`],[`astra`,`Astra`],[`terra`,`Terra`],[`luna`,`Luna`],[`codex`,`Codex`],[`deepseek`,`DeepSeek`],[`nemotron`,`Nemotron`],[`gemma`,`Gemma`]]);function v(e){let t=e.replace(/:free$/u,``).replaceAll(`_`,`-`).split(`-`).filter(Boolean),n=[];for(let e=0;e<t.length;e++){let r=t[e],i=t[e+1];if(/^\d+$/u.test(r)&&/^\d+$/u.test(i??``)){n.push(`${r}.${i}`),e++;continue}let a=_.get(r.toLowerCase());n.push(a??(/^(?:[a-z]+\d+|\d+[a-z]+)$/iu.test(r)?r.toUpperCase():r[0]?.toUpperCase()+r.slice(1)))}return n.join(` `).replace(/^GPT (\d)/u,`GPT-$1`)}function y(e){return m.get(e)??v(e.includes(`/`)?e.slice(e.indexOf(`/`)+1):e)}function b(e){let t=e.includes(`/`)?e.split(`/`)[0].replace(/^~/u,``):`other`,n=g.get(t)??t;return{key:n,name:h.get(n)??(n===`other`?`Other`:v(n))}}function x(e){return e===`xhigh`?`Extra high`:e?e[0].toUpperCase()+e.slice(1):`Unavailable`}function S(e){return e.efforts.includes(`max`)?`max`:e.efforts.at(-1)??null}async function C(e,t=fetch){let n=await t(`/api/admin/scan/models`,{credentials:`same-origin`,headers:{accept:`application/json`},signal:e});if(!n.ok)throw Error(`HTTP ${n.status}`);return w(await n.json())}function w(e){if(!Array.isArray(e?.models))throw Error(`No model catalogue returned`);let t=e.models.filter(e=>typeof e?.id==`string`&&e.id.length>0).map(e=>({id:e.id,efforts:Array.isArray(e.efforts)?[...new Set(e.efforts.filter(e=>typeof e==`string`&&e.length>0))]:[]}));if(t.length===0)throw Error(`No models available`);return{models:t,defaultModel:t.find(t=>t.id===e.defaultModel)?.id??t[0].id}}function T(e,t=[]){let n=new Map,r=e.flatMap(e=>{let r=t.filter(t=>t.bundles?.includes(e.integrity));return(r.length>0?r.map(e=>({id:e.id,label:e.name})):[{id:`unattached`,label:`Unattached`}]).map(t=>(n.set(t.id,t),{id:e.integrity,integrity:e.integrity,filename:e.name,repoId:t.id,repo:t.label,files:null,reasons:[],size:`—`}))});return{repositories:[...n.values()],bundles:r,reports:[],scans:[]}}function E(o,s){if(s.error)throw Error(s.error);let c=n(s),l=s.kind===`stasis`?s.bundle?.formats:null,u=r(s),d=[...t(s)].filter(([,e])=>e!=null).map(([e,t])=>({path:e,format:l?.get(e)??null,bytes:t,lines:u.get(e)??0,size:i(t),module:a(e,{packageDir:c?.get(e)})})),f=[{id:`all`,label:`All`,filePaths:null},...[...e(s,d.map(e=>e.path))].map(([e,t])=>({id:`reason:${e}`,label:e,filePaths:[...t]}))];return{...o,files:d,reasons:f,size:i(s.size)}}export{T as a,E as b,f as c,p as d,y as e,b as f,x as g,S as h,C as i,w as j};
@@ -0,0 +1 @@
1
+ import{d as e,h as t}from"./chunk-JMG5DXII.js";function n(e,t){let[n,r,i,a]=[0,0,-1,0];for(;r<t.length;)if(e[n]===`*`)i=n++,a=r;else if(e[n]===`?`||e[n]===t[r])n++,r++;else{if(i===-1)return!1;n=i+1,r=++a}for(;e[n]===`*`;)n++;return n===e.length}function r(r,i){let a=r.split(`/`);if(a.length>30||a.some(e=>e===``||/[[\]{}()!+#\\]/u.test(e)))throw new e(`${t(r)} is a glob not read here`,i);return a.map(e=>{if(e===`**`)return null;let t=!e.startsWith(`.`)&&/[*?]/u.test(e),r=[...e];return e=>!(t&&e.startsWith(`.`))&&n(r,[...e])})}function i(e,t){let n=t;for(let t=0;t<e.length;t++)n&1<<t&&e[t]===null&&(n|=1<<t+1);return n}function a(e,t,n){let r=0;for(let i=0;i<e.length;i++)t&1<<i&&(e[i]===null?r|=n.startsWith(`.`)?0:1<<i:e[i](n)&&(r|=1<<i+1));return i(e,r)}var o=(e,t)=>!!(t&1<<e.length),s=(e,t)=>o(e,t.split(`/`).reduce((t,n)=>a(e,t,n),i(e,1)));export{r as a,i as b,a as c,o as d,s as e};
@@ -0,0 +1,13 @@
1
+ import{B as e,C as t,E as n,G as r,H as i,K as a,M as o,P as s,e as c,f as l,h as u,m as d,p as f,u as p}from"./chunk-UCP3JRE2.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{d as m,h,i as g,j as _,o as v,r as y,s as b,t as x}from"./chunk-JMG5DXII.js";import"./chunk-OOJM4CTU.js";var S=new Set([` `,` `,`
2
+ `,`\r`]),C=e=>/^[A-Za-z]$/u.test(e),w=e=>/^[\dA-Za-z-]$/u.test(e),T={__proto__:null,t:` `,b:`\b`,n:`
3
+ `,"\\":`\\`,'"':`"`};function E(e,t){let n=0,r=0,i={at:0,eof:!1};return i.next=()=>{if(i.at=r,n>=e.length)return i.eof=!0,`
4
+ `;let t=e[n++];return t===`\r`&&e[n]===`
5
+ `&&(t=e[n++]),t===`
6
+ `&&r++,t},i.fail=e=>new m(`${e} at line ${i.at+1}`,t),i}function D(e){let t=``;for(;;){let n=e.next();if(e.eof)throw e.fail(`a section with no closing "]"`);if(n===`]`)break;if(S.has(n))return[t,O(e,n)];if(!w(n)&&n!==`.`)throw e.fail(`${h(n)} in the name of a section`);t+=n.toLowerCase()}if(t===``)throw e.fail(`a section with no name`);return[t,void 0]}function O(e,t){let n=t;do{if(n===`
7
+ `)throw e.fail(`a section header that runs past its line`);n=e.next()}while(S.has(n));if(n!==`"`)throw e.fail(`expected a quoted subsection after the name of the section, found ${h(n)}`);let r=``;for(n=e.next();n!==`"`;n=e.next()){if(n===`\\`&&(n=e.next()),n===`
8
+ `)throw e.fail(`a subsection with no closing quote`);r+=n}if(e.next()!==`]`)throw e.fail(`expected "]" after the subsection`);return r}function k(e){let t=``,n=!1,r=!1,i=``;for(;;){let a=e.next();if(a===`
9
+ `){if(n)throw e.fail(`a value with no closing quote`);return t}if(r)continue;if(S.has(a)&&!n){t!==``&&(i+=a);continue}if(!n&&(a===`#`||a===`;`)){r=!0;continue}let o=/[^ ]/u.exec(i)?.[0];if(o!==void 0)throw e.fail(`${h(o)} within a value, which git reads as a space before 2.45 and as itself since`);if(t+=i,i=``,a===`\\`){if(a=e.next(),a===`
10
+ `)continue;if(!(a in T))throw e.fail(`${h(`\\${a}`)}, an escape git does not read`);t+=T[a]}else a===`"`?n=!n:t+=a}}function ee(e,t){let n=e.at,r=t.toLowerCase(),i=e.next();for(;!e.eof&&w(i);i=e.next())r+=i.toLowerCase();for(;i===` `||i===` `;)i=e.next();if(i===`
11
+ `)return{key:r,value:null,line:n};if(i!==`=`)throw e.fail(`expected "=" and a value after ${h(r)}, found ${h(i)}`);return{key:r,value:k(e),line:n}}function te(e,t){let n=e.indexOf(`\0`);if(n!==-1)throw new m(`a NUL, where git ends the name or value it is in, at line ${e.slice(0,n).split(`
12
+ `).length}`,t);let r=E(e.startsWith(``)?e.slice(1):e,t),i=[],a={section:void 0,subsection:void 0,header:void 0},o=!1;for(;;){let e=r.next();if(e===`
13
+ `){if(r.eof)return i;o=!1}else{if(o||S.has(e))continue;if(e===`#`||e===`;`)o=!0;else if(e===`[`){let e=r.at,[t,n]=D(r);a={section:t,subsection:n,header:e}}else if(C(e))i.push({...a,...ee(r,e)});else throw r.fail(`${h(e)}, where git reads a key, a section or a comment`)}}}var A=[`path`,`url`,`branch`,`update`,`shallow`,`ignore`,`fetchrecursesubmodules`],j=/^[\t\n\v\f\r ]*[+-]?(0[Xx][\dA-Fa-f]+|0[0-7]*|[1-9]\d*)([GKMgkm]?)$/u,M={__proto__:null,"":1,k:1024,m:1024**2,g:1024**3};function N(e){let t=j.exec(e);if(t===null)return!1;let[,n,r]=t,[i,a]=/^0[Xx]/u.test(n)?[16,n.slice(2)]:[n.startsWith(`0`)?8:10,n],o=a.replace(/^0+/u,``);return o.length<=11&&Number.parseInt(o||`0`,i)<=Math.trunc((2**31-1)/M[r.toLowerCase()])}var P=e=>e===null||/^(?:true|false|yes|no|on|off)?$/u.test(e.toLowerCase())||N(e),F={__proto__:null,shallow:P,fetchrecursesubmodules:e=>P(e)||e===`on-demand`,ignore:e=>[`all`,`dirty`,`untracked`,`none`].includes(e),update:e=>[`checkout`,`rebase`,`merge`].includes(e)};function I(e,t){if(e===``||e.split(/[/\\]/u).includes(`..`))throw new m(`a name git ignores the submodule for, empty or with a ".." in it`,t);return e}var L=/[\u200C-\u200F\u202A-\u202E\u206A-\u206F\uFEFF]/gu,R=e=>/^(?:\.git|git~1)[ .]*$/u.test(e.replaceAll(L,``).toLowerCase());function z(e,n){let r=t(e,n),i=r.split(`/`);if(r===`.`||i.at(-1)===`..`)throw new m(`${h(r)} is no submodule's path, but a directory it would be in`,n);if(i.some(R))throw new m(`${h(r)} is in a ".git", where git writes no submodule`,n);if(r.startsWith(`-`))throw new m(`${h(r)} starts with "-", which git ignores the path for`,n);return r}function B(e,t){if(typeof e==`string`&&e.startsWith(`-`))throw new m(`${h(e)} starts with "-", which git ignores the url for`,t);return o(e,t)}function V(e,t){let n=B(e,t);if(/^\.\.?\//u.test(n))throw new m(`${h(n)} is relative to the superproject's remote, which only a clone of it knows`,t);return s(n,t,`git`)}function H(e,t,n){let r=new Map;for(let{section:i,subsection:a,header:o,key:s,value:c,line:l}of e){if(i===void 0)throw new m(`a key outside any section, at line ${l+1}`,n);if(i!==`submodule`||a===void 0){let e=i.startsWith(`submodule.`)?`the form [submodule.name], whose name git lowercases,`:`[${i}${a===void 0?``:` "${a}"`}]`;throw new m(`a section of ${e} where .gitmodules has [submodule "name"] alone, at line ${o+1}`,n)}let e=g(t,a);I(a,e);let u=r.get(a)??r.set(a,{header:o,fields:Object.create(null)}).get(a);if(u.header!==o)throw new m(`a second section, at line ${o+1}, where git writes one`,e);if(s in u.fields)throw new m(`twice, of which git's submodule commands read the first and git config the last, at line ${l+1}`,g(e,s));u.fields[s]=c}return r}function U(e,t,n){c(e,t,A);for(let n of[`path`,`url`,`branch`,`update`,`ignore`])if(e[n]===null)throw new m(`a key alone, where git expects a value`,g(t,n));for(let n of Object.keys(F))if(n in e&&!F[n](e[n]))throw new m(`${h(e[n])} is not a value git reads here`,g(t,n));if(e.path===void 0)throw new m(`expected a path, without which git has no submodule`,g(t,`path`));if(e.url===void 0&&n)throw new m(`expected a url, without which git cannot clone the submodule`,g(t,`url`));let r=z(e.path,g(t,`path`));if(r.startsWith(`../`))throw new m(`${h(r)} is outside the repository, where git writes no submodule`,g(t,`path`));return{path:r,url:d(e,`url`,t,n?V:B),branch:e.branch===void 0||e.branch===`.`?e.branch:a(e.branch,g(t,`branch`))}}function W(e){let t=new Set(e);for(let n of e){let e=n.split(`/`);for(let r=1;r<e.length;r++){let i=e.slice(0,r).join(`/`);if(t.has(i)&&i!==`..`&&!i.endsWith(`/..`))return[n,i]}}}function G(e,t,n){let r=t===``?void 0:t,i=Object.create(null),a=new Map;for(let[o,{fields:s}]of H(te(e,r),t,r)){let e=g(t,o),r=U(s,e,n);if(a.has(r.path))throw new m(`the path of the submodule ${h(a.get(r.path))} too`,g(e,`path`));a.set(r.path,o),i[o]=r}let o=W([...a.keys()]);if(o!==void 0)throw new m(`inside the submodule ${h(a.get(o[1]))}, at ${h(o[1])}`,g(g(t,a.get(o[0])),`path`));return i}function K(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let{checkUrls:n=!0}=p(t,[`checkUrls`]);if(typeof n!=`boolean`)throw TypeError(`checkUrls: expected a boolean`);return G(e,``,n)}var q=/[\p{Cc}\p{Cs}\uFEFF]/u;function J(e,t,n){if(e[t]!==`"`)throw _(`expected a string, found ${v(e,t)}`,n);let[r,i]=x(e,t,n);if(!r.isWellFormed())throw _(`${h(e.slice(t,i))} escapes a lone surrogate, which forge does not read`,n);return[r,i]}function Y(e,t,n){if(t===e.length||e[t]===`,`&&t+1===e.length)return t<e.length;throw _(`expected "," or the end of the line, found ${v(e,t)}`,n)}function X(e,t,n){let{line:r,number:i}=e;if(r[t]===`"`||n>4){let[e,n]=J(r,t,i);return[e,Y(r,n,i)]}if(r.startsWith(`{}`,t))return[Object.create(null),Y(r,t+2,i)];if(r[t]===`{`&&t+1===r.length)return Z(e,n);throw _(`expected a string or an object, found ${v(r,t)}`,i)}function Z(e,t){let n=Object.create(null),r=new Map,i=` `.repeat(t+2);for(let a=!0;a;){b(e);let{line:o,number:s}=e;if(o===void 0)throw _(`expected a key, found the end of the file`,s+1);if(!o.startsWith(i)||o[i.length]===` `)throw _(`expected ${i.length} spaces of indentation and a key`,s);let[c,l]=J(o,i.length,s);if(r.has(c))throw _(`${h(c)} is a key at line ${r.get(c)+1} too`,s);if(r.set(c,s),!o.startsWith(`: `,l))throw _(`expected ": " after ${h(c)}, found ${v(o,l)}`,s);[n[c],a]=X(e,l+2,t+2)}b(e);let{line:a,number:o}=e,s=`${` `.repeat(t)}}`;if(a===void 0)throw _(`expected ${h(s)}, closing the object, found the end of the file`,o+1);if(a!==s&&a!==`${s},`)throw _(`expected ${h(s)}, closing the object, found ${h(a)}`,o);return[n,a!==s]}function ne(e){let t=y(e,q);if(b(t),t.line!==`{`&&t.line!==`{}`)throw _(`expected "{", or "{}" for no dependencies, found ${t.line===void 0?`nothing`:h(t.line)}`,t.number);let[n,r]=t.line===`{`?Z(t,0):[Object.create(null),!1];if(r)throw _(`a comma after the last "}"`,t.number);for(b(t);t.line!==void 0;b(t))if(t.line!==``)throw _(`expected the end of the file after the last "}", found ${h(t.line)}`,t.number);return n}var re=[`gitmodules`,`directory`,`checkUrls`],ie=[`rev`,`tag`,`branch`],ae=`gitmodules`,oe=t=>typeof t==`string`&&(t===`.`||e(t));function se(e){let{gitmodules:t,directory:n=`.`,checkUrls:r=!0}=p(e,re);if(t!==void 0&&typeof t!=`string`)throw TypeError(`gitmodules: expected the text of .gitmodules`);if(t===void 0&&e.directory!==void 0)throw TypeError(`directory needs gitmodules, whose paths it is for`);if(t===void 0&&e.checkUrls!==void 0)throw TypeError(`checkUrls needs gitmodules, whose urls it is for`);if(!oe(n))throw TypeError(`directory: expected a path in the repository, from its root, as "." or "packages/contracts"`);if(typeof r!=`boolean`)throw TypeError(`checkUrls: expected a boolean`);return{gitmodules:t,directory:n,checkUrls:r}}function Q(e,t){if(!i(u(e,t)))throw new m(`${h(e)} is not a full commit hash, which forge build --locked compares the submodule's with`,t);return e}function ce(e,t){let n=Object.keys(c(e,t,ie));if(n.length!==1)throw new m(`expected one of "rev", "tag" and "branch", found ${n.length===0?`none`:n.map(h).join(` and `)}`,t);let[r]=n;if(r===`rev`)return{type:r,name:void 0,rev:Q(e.rev,g(t,`rev`)),url:void 0};let i=g(t,r),o=c(e[r],i,[`name`,`rev`]);return{type:r,name:a(o.name,g(i,`name`)),rev:Q(o.rev,g(i,`rev`)),url:void 0}}function le(e,t,i,a){let o=G(t,ae,a),s=new Map(Object.entries(o).map(([e,{path:t}])=>[t,e]));for(let[t,a,c]of l(e,``)){let e=n(i,t);if(e===`..`||e.startsWith(`../`))throw new m(`outside the repository, from the lockfile's directory ${h(i)} in it`,c);let l=r(i,e);if(l!==t)throw new m(`not as forge writes the path, ${h(l)}`,c);let u=s.get(e);if(u===void 0)throw new m(`no submodule in .gitmodules is at ${h(e)}`,c);a.url=o[u].url}}function $(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let{gitmodules:n,directory:r,checkUrls:i}=se(t),a=f(ne(e),``,(e,t,n)=>(z(n,t),ce(e,t))),o=W(Object.keys(a));if(o!==void 0)throw new m(`inside the dependency ${h(o[1])}, whose submodules foundry.lock does not record`,g(``,o[0]));return n!==void 0&&le(a,n,r,i),{dependencies:a}}export{m as LockfileError,$ as parseFoundryLockfile,K as parseGitmodules};
@@ -50,7 +50,7 @@ ${m}`);for(let e of f)p.push(e.label===null?H(e.body):K(n,e.label,e.body));retur
50
50
  `).trim());return c&&(r.text=c),r}var dn=new Map(Et.map(([e,t])=>[e.toLowerCase(),t])),fn=[...dn.keys()];function pn(e){let t=e.length,n=1/0;for(let r=e.length-1;r>=0;r--){let i=fn.indexOf(e[r].label.toLowerCase());if(i===-1||i>=n)break;n=i,t=r}return{paragraphs:e.slice(0,t),fields:e.slice(t).map(e=>[dn.get(e.label.toLowerCase()),e.body])}}function mn(e,t,n){let r=[],i=P(t),a=e.endsWith(`…`)?e.slice(0,-1).trimEnd():``;!e||i===e||a&&i.startsWith(a)?r.push(t):r.push(e,t);for(let{label:e,body:t}of n)r.push(t?`**${e}:** ${t}`:`**${e}:**`);return r.filter(Boolean).join(`
51
51
 
52
52
  `)}var hn=/^<!--\s*DeepView findings export\b[^>]*-->/u,gn=/^Case \d+ of \d+(?:\s|$)/u,_n=/^- \*\*([^*\n]+?):\*\* ?(.*)$/gmu,vn=new Set([`evidence`,`severity correction`,`comment`]);function yn(e){let t=C(e).trim();if(!hn.test(t))return null;let{head:n,subs:r}=E(t,oe),i=[];for(let{heading:e,body:t}of r){if(e.trim().toLowerCase()===`summary`)continue;let n=bn(e);for(let e of D(t,se))i.push(Sn(e,n))}return Tn(xn(n),i)}function bn(e){let t=/^(.*?)\s*\(\d+\)\s*$/u.exec(e.trim());return Wt(t?t[1]:e)}function xn(e){let t=new Map;for(let n of e.matchAll(_n)){let e=n[1].trim().toLowerCase();t.has(e)||t.set(e,n[2].trim())}return{sources:(t.get(`source`)??``).split(`,`).map(e=>Qt(e).source).filter(Boolean),analyzers:(t.get(`analyzer`)??t.get(`analyzers`)??``).split(`;`).map(e=>e.trim()).filter(Boolean),repo:t.has(`repository`)?$t(t.get(`repository`)):``}}function Sn({heading:e,body:t},n){let r=e.trim().replace(/^\d+\.\s+/u,``),i=D(t,w).filter(e=>gn.test(e.heading.trim()));return i.length===0?[Cn(t,w,r,n)]:i.map(e=>Cn(e.body,ce,r,n))}function Cn(e,t,n,r){let{title:i,facts:a,rest:o}=sn(e),{head:s,subs:l}=E(o,t),u=l.map(e=>({label:e.heading.trim(),body:e.body.trim()})),d={file:`unknown`,line:`?`},f=null;for(let[e,t]of a)e.trim().toLowerCase()===`analyzer`?f=Qt(t):an(d,e,t);d.severity||=r||`medium`;let p=i||n,m=p!==`Untitled finding`&&p!==I(d),{paragraphs:h,fields:g}=pn(u.filter(e=>!vn.has(e.label.toLowerCase())).map(e=>({label:e.label,body:U(e.body)})));d.description=mn(m?p:``,U(s.trim()),h);let _=u.filter(e=>e.label.toLowerCase()===`evidence`).flatMap(e=>ln(e.body));_.length>0&&(d.evidence=_);for(let[e,t]of g)d[e]=t;let v=u.find(e=>e.label.toLowerCase()===`severity correction`);return v?.body&&(d.correctedSeverityReason=U(v.body)),{finding:c(d),analyzer:f}}function wn(e,t){let n={source:null,run:{}};if(t.some(e=>e.analyzer!==null)){let e=new Set(t.map(e=>e.analyzer?.source??null));e.size===1&&!e.has(null)&&([n.source]=e);for(let e of t)e.analyzer?.run?Object.assign(e.finding,e.analyzer.run):e.analyzer?.source&&!n.source&&(e.finding.source=e.analyzer.source);return n}let r=e.analyzers.length===1?Qt(e.analyzers[0]):null;return r?.source?n.source=r.source:r?.run?n.run=r.run:e.analyzers.length===0&&e.sources.length===1&&([n.source]=e.sources),n}function Tn(e,t){let n=t.flat(),{source:r,run:i}=wn(e,n),a={},o=new Set(n.map(e=>e.finding.type).filter(Boolean)),s=i.type??(o.size===1?[...o][0]:null)??(r?`security`:null);s&&(a.type=s),r&&(a.source=r);for(let e of[`model`,`effort`,`exportsMode`])i[e]&&(a[e]=i[e]);e.repo&&(a.repo={github:e.repo});let c=t.map(e=>e.map(e=>e.finding));return c.every(e=>e.length===1)?a.findings=c.flat():a.groups=c,a}var En=`markdown-generic`,Dn=[`#`,`id`,`product`,`priority`,`vulnerability`],On=[`title`,`description`,`root cause`,`code references`,`attack scenario`,`steps to reproduce`,`impact`,`patch`],kn=/^(?:#{3,6}[ \t]+)?(?:\*\*)?(Title|Description|Root Cause|Code references|Attack Scenario|Steps to Reproduce(?:[ \t]+.*?)?|Impact|Patch):?(?:\*\*)?(?:[ \t]+#+)?[ \t]*$/gimu,An={P0:`critical`,P1:`high`,P2:`medium`,P3:`low`,P4:`informational`},Y=e=>e.trim().slice(1,-1).split(`|`).map(e=>e.trim());function X(e,t){if(!e)throw Error(`Markdown (generic): unsupported ${t}`)}function jn(e){return[...new Set(e.split(`
53
- `).map(e=>e.trim()).filter(Boolean))].map(e=>{X(/^https?:\/\/[^\s()[\]{}"'<>`\\]+$/iu.test(e)&&!/[.,;!?]$/u.test(e),`link syntax; use bare URLs on separate lines`);let t;try{t=new URL(e)}catch{X(!1,`URL`)}let[n,r,i,a,...o]=t.pathname.slice(1).split(`/`);X([`github.com`,`www.github.com`].includes(t.hostname)&&!t.username&&!t.password&&!t.port&&[n,r].every(e=>e&&/^[\w-][\w.-]*$/u.test(e)),`repository URL`),X(o.every(Boolean),`repository path; empty components`);let s=`${n}/${r.replace(/\.git$/iu,``)}`.toLowerCase(),c=/^#L(\d+)(?:-L?(\d+))?$/u.exec(t.hash),l=i===`blob`?o.slice(0,-1):i===`tree`?o:[];try{l=l.map(decodeURIComponent)}catch{X(!1,`repository directory encoding`)}return X(l.every(e=>e===e.trim()&&!/[\\/:?#\p{Cc}]/u.test(e)),`repository directory`),{repo:s,ref:a,directory:l,...i===`blob`&&o.length&&{evidence:{file:o.join(`/`),line:c?c.slice(1).filter(Boolean).join(`-`):`?`,url:e}}}})}function Mn(e,t,n,r){let i=jn(n),a=i[0]?.repo;X(a&&i.every(e=>e.repo===a),`repository set for finding ${e.id}; expected exactly one repository`),X(!e.group.github||e.group.github===a,`repository set for product ${e.product}; expected exactly one repository`);let o=r.get(a);X(o===void 0||o===e.prefix,`repository ID prefixes for ${a}; expected ${o}, got ${e.prefix} (${e.id})`),r.set(a,e.prefix),e.group.github=a,e.group.directories.push(...i.map(e=>e.directory));let s=i.flatMap(e=>e.evidence??[]);if(s.length){Object.assign(t,{file:s[0].file,line:s[0].line,location:s[0].url,evidence:s});let e=i.find(e=>e.evidence).ref;T(e)&&(t.commitHash=e)}}function Nn(e){let t=e[0];for(let n of e.slice(1)){let e=0;for(;e<t.length&&t[e]===n[e];)e++;t=t.slice(0,e)}return t.join(`/`)}function Pn(e){let t=C(e).trim(),n=[...t.matchAll(/^## +(.*)$/gmu)];if(!n.some(e=>/^\d+\.\s+\S+/u.test(e[1]))&&(n.length||t.startsWith(`# `)))return null;let r=[...t.matchAll(/^\|[^\n]*\|$/gmu)].find(([e])=>Y(e).map(e=>e.toLowerCase()).join()===Dn.join());if(!r)return null;let i=t.slice(0,r.index).trim();X(!i||/^# [^\n]+$/u.test(i),`summary preamble`),X(r.index<(n[0]?.index??t.length),`summary position`);let a=t.slice(r.index,n[0]?.index).trim().split(`
53
+ `).map(e=>e.trim()).filter(Boolean))].map(e=>{X(/^https?:\/\/[^\s()[\]{}"'<>`\\]+$/iu.test(e)&&!/[.,;!?]$/u.test(e),`link syntax; use bare URLs on separate lines`);let t;try{t=new URL(e)}catch{X(!1,`URL`)}let[n,r,i,a,...o]=t.pathname.slice(1).split(`/`);X([`github.com`,`www.github.com`].includes(t.hostname)&&!t.username&&!t.password&&!t.port&&[n,r].every(e=>e&&/^[\w-][\w.-]*$/u.test(e)),`repository URL`),X(o.every(Boolean),`repository path; empty components`);let s=`${n}/${r.replace(/\.git$/iu,``)}`.toLowerCase(),c=/^#L(\d+)(?:-L?(\d+))?$/u.exec(t.hash),l=i===`blob`?o.slice(0,-1):i===`tree`?o:[];try{l=l.map(decodeURIComponent)}catch{X(!1,`repository directory encoding`)}return X(l.every(e=>e===e.trim()&&!/[\\/:?#\p{Cc}]/u.test(e)),`repository directory`),{repo:s,ref:a,directory:l,...i===`blob`&&o.length&&{evidence:{file:o.join(`/`),line:c?c.slice(1).filter(Boolean).join(`-`):`?`,url:e}}}})}function Mn(e,t,n,r){let i=jn(n),a=i[0]?.repo;X(a&&i.every(e=>e.repo===a),`repository set for finding ${e.id}; expected exactly one repository`),X(!e.group.github||e.group.github===a,`repository set for product ${e.product}; expected exactly one repository`);let o=r.get(a);X(o===void 0||o===e.prefix,`repository ID prefixes for ${a}; expected ${o}, got ${e.prefix} (${e.id})`),r.set(a,e.prefix),e.group.github=a,e.group.directories.push(...i.map(e=>e.directory));let s=i.flatMap(e=>e.evidence??[]);if(s.length){Object.assign(t,{file:s[0].file,line:s[0].line,location:s[0].url,evidence:s});let e=i.filter(e=>e.evidence).map(e=>e.ref.toLowerCase()),n=e.reduce((e,t)=>t.length>e.length?t:e);e.every(e=>T(e)&&n.startsWith(e))&&(t.auditedCommit=n)}}function Nn(e){let t=e[0];for(let n of e.slice(1)){let e=0;for(;e<t.length&&t[e]===n[e];)e++;t=t.slice(0,e)}return t.join(`/`)}function Pn(e){let t=C(e).trim(),n=[...t.matchAll(/^## +(.*)$/gmu)];if(!n.some(e=>/^\d+\.\s+\S+/u.test(e[1]))&&(n.length||t.startsWith(`# `)))return null;let r=[...t.matchAll(/^\|[^\n]*\|$/gmu)].find(([e])=>Y(e).map(e=>e.toLowerCase()).join()===Dn.join());if(!r)return null;let i=t.slice(0,r.index).trim();X(!i||/^# [^\n]+$/u.test(i),`summary preamble`),X(r.index<(n[0]?.index??t.length),`summary position`);let a=t.slice(r.index,n[0]?.index).trim().split(`
54
54
  `),o=new Set(Y(a[0]).map(e=>e.toLowerCase()));X(a[1]&&Y(a[1]).length===5&&Y(a[1]).every(e=>/^:?-{3,}:?$/u.test(e)),`summary separator`);let s=new Map,c=new Map,l=new Map;for(let e of a.slice(2).filter(e=>e.trim())){X(/^\|.*\|$/u.test(e)&&Y(e).length===5,`summary row`);let[t,n,r,i]=Y(e),a=/^(.+-)\d+$/u.exec(n)?.[1];X(/^\d+$/u.test(t)&&a&&r&&Object.hasOwn(An,i)&&!l.has(n),`summary values for ${n}`);let o=s.get(r)??{directories:[],rows:[]},c={raw:e,id:n,prefix:a,product:r,priority:i,group:o};l.set(n,c),o.rows.push(c),s.set(r,o)}X(l.size,`empty summary`);for(let[e,r]of n.entries()){let i=/^\d+\.\s+(\S+)\s*$/u.exec(r[1])?.[1],a=l.get(i);X(a&&!a.finding,`finding section ${r[1]}`);let s=t.slice(r.index,n[e+1]?.index),u=s.slice(r[0].length+1),d=new Map,f=[...u.matchAll(kn)];for(let[e,t]of f.entries()){let n=t[1],r=n.toLowerCase().replace(/^steps to reproduce\b.*$/u,`steps to reproduce`);X(!d.has(r),`duplicate section ${n}`),d.set(r,{heading:n,body:u.slice(t.index+t[0].length,f[e+1]?.index).trim()})}X(On.every(e=>d.has(e)),`missing required headers for ${i}`),X(!u.slice(0,f[0].index).trim(),`text before field headers for ${i}`);let p=d.get(`title`)?.body;X(p,`missing Title for ${i}`);let m={sourceId:i,_idBasis:{source:En,row:a.raw.trim(),section:s.trim()},product:a.product,priority:a.priority,severity:An[a.priority],file:`unknown`,line:`?`};o.has(`vulnerability`)&&(m.security=!0);let h=[p];for(let[e,t]of d)e===`title`||e===`code references`||(e===`steps to reproduce`?m.reproduction=t.body:e===`patch`?m.recommendation=t.body:h.push(e===`description`?t.body:`**${t.heading}:**
55
55
  ${t.body}`));m.description=h.join(`
56
56
 
@@ -0,0 +1 @@
1
+ import{a as e,b as t,d as n,e as r,h as i,i as a,j as o,k as s,m as c,o as l,q as u,r as d,s as ee}from"./chunk-JFL7WLRV.js";import{a as f,c as p,e as m,f as h,h as te,j as g,k as _,l as v,m as ne,n as re,o as ie,p as ae}from"./chunk-JOXLZXMI.js";import{D as oe,H as y,M as se,l as ce,m as b,p as le,t as x}from"./chunk-UCP3JRE2.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{a as ue,c as de,e as fe,g as pe}from"./chunk-E3LFSUDJ.js";import{d as S,e as me,h as C,i as w}from"./chunk-JMG5DXII.js";import"./chunk-OOJM4CTU.js";function T(e,t,n=[`https:`,`http:`,`file:`]){let r=URL.parse(h(e,t));if(r===null||r.href!==e||!n.includes(r.protocol))throw new S(`${C(e)} is not a URL in normal form, of ${n.map(e=>e.slice(0,-1)).join(`, `)}`,t);if(r.username!==``||r.password!==``)throw new S(`${C(e)} has credentials in it, which uv does not write`,t);return r}var E=g(e=>/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,9})?Z$/u.test(e)&&de(e),`a UTC timestamp`),D=v(i),O=(e,t,n)=>re(e,t,i,n),he={__proto__:null,md5:32,sha256:64,sha384:96,sha512:128,blake2b:64};function k(e){return e.type===`url`?new URL(e.url).pathname:e.type===`path`||e.type===`git`?e.path:void 0}var A=e=>e===void 0?void 0:e.endsWith(`.whl`)?`wheel`:`sdist`;function ge(e,t){return e.type===`registry`?e.url===void 0?[`url`,`path`]:[`url`]:t?e.type===`url`?[`url`]:[`filename`]:[]}function j(e,t,n,r){let i=ge(n,r),a=n.type===`registry`;p(e,t,[...i,`hash`,...a?[`size`,`upload-time`,`upload_time`]:[]]);let o=i.filter(t=>e[t]!==void 0);if(i.length>0&&o.length!==1)throw new S(o.length===0?`expected ${i.join(` or `)}`:`a url and a path, of which uv reads the url alone`,t);if(e[`upload-time`]!==void 0&&e.upload_time!==void 0)throw new S(`upload-time and upload_time, which are one field to uv`,t);let s=b(e,`url`,t,T),c={url:s?.href,path:b(e,`path`,t,u),filename:b(e,`filename`,t,h),hash:b(e,`hash`,t,(e,t)=>l(e,t,he)),size:b(e,`size`,t,te),uploadTime:b(e,e.upload_time===void 0?`upload-time`:`upload_time`,t,E)};if(!a&&c.hash===void 0)throw new S(`expected a hash, which uv writes for a file of a ${n.type} source`,t);return{file:c,pathname:s?.pathname}}function _e(e,t,n){if(e===void 0)return;let r=A(k(n));if(n.type!==`registry`&&r!==`sdist`)throw new S(`an sdist, which a ${n.type} source${r===`wheel`?` of a wheel`:``} has none of`,t);let{url:i,path:a,hash:o,size:s,uploadTime:c}=j(e,t,n,!1).file;return{url:i,path:a,hash:o,size:s,uploadTime:c}}function ve(t,n,r){if(t===void 0)return[];let{source:i}=r,a=A(k(i)),o=m(t,n);if(i.type!==`registry`&&(a!==`wheel`||o.length!==1))throw new S(a===`wheel`?`expected the one wheel the source is`:`wheels, which a ${i.type} source${a===`sdist`?` of an sdist`:``} has none of`,n);let c=new Set;return o.map((t,a)=>{let o=`${n}[${a}]`,{file:l,pathname:u}=j(t,o,i,!0),d=ee({name:l.filename,path:l.path,pathname:u}),f=d===void 0?void 0:s(d);if(f===void 0)throw new S(`${C(String(d))} is not the name of a wheel`,o);if(c.has(d))throw new S(`${C(d)} is listed twice`,o);if(c.add(d),f.name!==r.name)throw new S(`${C(d)} is a wheel of ${C(f.name)}, not of ${C(r.name)}`,o);if(r.versionKey!==void 0&&r.versionKey!==e(f.version)&&r.versionKey!==e({...f.version,local:void 0}))throw new S(`${C(d)} is a wheel of another version than ${C(r.version)}`,o);if(i.type===`url`&&l.url!==i.url)throw new S(`${C(l.url)} is not the URL the source names`,w(o,`url`));return{...l,filename:d}})}var M=[`registry`,`git`,`url`,`path`,`directory`,`editable`,`virtual`],ye=new Set([`directory`,`editable`,`virtual`]),N=new Set([`branch`,`tag`,`rev`]),be=new Set([...N,`subdirectory`,`path`,`lfs`]),P=(e,t,n)=>new S(`${C(e)} is not a git source: ${t}`,n),F=`expected "#" and the full commit it resolved to`;function I(e,t){let n=T(se(e,t),t,[`https:`,`http:`,`ssh:`,`file:`]),r=[...n.searchParams],i=r.find(([e])=>!be.has(e));if(i!==void 0)throw P(e,`uv does not read ${C(i[0])}`,t);if(new Set(r.map(([e])=>e)).size!==r.length)throw P(e,`a key twice in the query`,t);let a=r.filter(([e])=>N.has(e));if(a.length>1)throw P(e,`more than one of branch=, tag= and rev=`,t);let o=Object.fromEntries(r);if(o.lfs!==void 0&&o.lfs!==`true`)throw P(e,`lfs= other than true, which uv does not write`,t);for(let e of[`subdirectory`,`path`])o[e]!==void 0&&oe(o[e],t);let s=n.hash===``?void 0:n.hash.slice(1);if(s!==void 0&&!y(s))throw P(e,F,t);let c=o.rev?.toLowerCase();if(c!==void 0&&s!==void 0&&y(c)&&c!==s)throw P(e,`rev= names another commit than the one it resolved to`,t);return n.search=``,n.hash=``,{type:`git`,url:e,repository:n.href,reference:a.length===0?void 0:{kind:a[0][0],name:a[0][1]},commit:s,subdirectory:o.subdirectory,path:o.path,lfs:o.lfs===`true`}}function xe(e,t){return/^[A-Za-z][\dA-Za-z+.-]+:/u.test(h(e,t))?{type:`registry`,url:T(e,t).href,path:void 0}:{type:`registry`,url:void 0,path:u(e,t)}}function Se(e,t,n,r){let i=w(r,e);if(e===`registry`)return xe(t,i);if(e===`git`){let e=I(t,i);if(e.commit===void 0)throw P(t,F,i);return e}if(e===`url`){if(T(t,i,[`https:`,`http:`]).hash!==``)throw new S(`${C(t)} has a fragment, which uv drops`,i);return{type:e,url:t,subdirectory:ce(d)(n,w(r,`subdirectory`))}}return{type:e,path:u(t,i)}}function L(e,t){p(e,t,[...M,`subdirectory`]);let n=ie(e,M,t);if(e.subdirectory!==void 0&&n!==`url`)throw new S(`a subdirectory, which uv reads of a URL alone`,w(t,`subdirectory`));let r=Se(n,e[n],e.subdirectory,t);return{...r,id:Ce(r)}}function Ce(e){return e.type===`registry`?`registry+${e.url??e.path}`:e.type===`git`?`git+${e.url}`:e.type===`url`?`direct+${e.url}${e.subdirectory===void 0?``:`#subdirectory=${e.subdirectory}`}`:`${e.type}+${e.path}`}var R=e=>ye.has(e.type);function z(e,t){if(p(e,t,[`package`,`extra`,`group`]),e.extra!==void 0&&e.group!==void 0)throw new S(`an extra and a group, of which uv takes one`,t);return{package:i(e.package,w(t,`package`)),extra:b(e,`extra`,t,i),group:b(e,`group`,t,i)}}var B=[`git`,`url`,`path`,`directory`,`editable`,`virtual`],V=[`specifier`,`index`,`conflict`],H=[`name`,`extras`,`groups`,`marker`,`subdirectory`,...B,...V];function we(e,t){let n=B.filter(t=>e[t]!==void 0),i=V.filter(t=>e[t]!==void 0);if(n.length+ +(i.length>0)>1)throw new S(`more than one source: ${[...n,...i].join(`, `)}`,t);if(e.subdirectory!==void 0&&n[0]!==`url`)throw new S(`a subdirectory, which uv reads of a URL alone`,w(t,`subdirectory`));let[a=`registry`]=n,o=w(t,a);return a===`registry`?{type:a,specifier:b(e,`specifier`,t,r),index:b(e,`index`,t,T)?.href,conflict:b(e,`conflict`,t,z)}:a===`git`?I(e.git,o):a===`url`?{type:a,url:T(e.url,o,[`https:`,`http:`]).href,subdirectory:b(e,`subdirectory`,t,d)}:{type:a,path:u(e[a],o)}}function U(e,t,n=H){p(e,t,n);let r=b(e,`extras`,t,D)??[],o=b(e,`groups`,t,D)??[];if(r.length>0&&o.length>0)throw new S(`extras and groups, of which uv takes one`,t);return{name:i(e.name,w(t,`name`)),extras:r,groups:o,marker:b(e,`marker`,t,a),source:we(e,t)}}function Te(e,t){return{...U(e,t,[...H,`hashes`]),hashes:b(e,`hashes`,t,v((e,t)=>l(e,t,c)))??[]}}var W=_(U),G=(e,t)=>O(e,t,W);function Ee(e,t){return p(e,t,[`name`,`version`,`requires-dist`,`requires-python`,`provides-extras`]),{name:i(e.name,w(t,`name`)),version:b(e,`version`,t,n),requiresDist:b(e,`requires-dist`,t,v(o))??[],requiresPython:b(e,`requires-python`,t,r),providesExtras:b(e,`provides-extras`,t,D)??[]}}var De=_((e,t)=>{if(fe(e)&&Object.hasOwn(e,`package`))throw new S(`an override of one package's dependencies, which is not read here`,t);return U(e,t)}),Oe=[`members`,`requirements`,`constraints`,`overrides`,`excludes`,`build-constraints`,`dependency-groups`,`dependency-metadata`];function ke(e=Object.create(null)){let t=`manifest`;p(e,t,Oe);let n=(n,r)=>b(e,n,t,r)??[];return{members:n(`members`,D),requirements:n(`requirements`,W),constraints:n(`constraints`,W),overrides:n(`overrides`,De),excludes:n(`excludes`,D),buildConstraints:n(`build-constraints`,_(Te)),dependencyGroups:G(e[`dependency-groups`],w(t,`dependency-groups`)),dependencyMetadata:n(`dependency-metadata`,_(Ee))}}function Ae(e=Object.create(null),t){return p(e,t,[`requires-dist`,`provides-extras`,`requires-dev`]),{requiresDist:b(e,`requires-dist`,t,W)??[],providesExtras:b(e,`provides-extras`,t,D)??[],requiresDev:G(e[`requires-dev`],w(t,`requires-dev`))}}var K=(...e)=>(t,n)=>{if(!e.includes(h(t,n)))throw new S(`expected one of ${e.join(`, `)}`,n);return t},q=K(`disallow`,`allow`,`if-necessary`,`explicit`,`if-necessary-or-explicit`),J=g(e=>/^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+W)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d{1,9})?S)?)?$/u.test(e),`an ISO 8601 duration`);function je(e,t){return e===!1?!1:typeof e==`string`?{timestamp:E(e,t),span:void 0}:(p(e,t,[`timestamp`,`span`]),{timestamp:E(e.timestamp,w(t,`timestamp`)),span:J(e.span,w(t,`span`))})}function Me(e,t){p(e,t,[`glibc`,`musl`]);let n=g(e=>/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u.test(e),`a libc version`);return{glibc:b(e,`glibc`,t,n),musl:b(e,`musl`,t,n)}}var Ne=[`resolution-mode`,`prerelease-mode`,`fork-strategy`,`exclude-newer`,`exclude-newer-span`,`exclude-newer-package`,`prerelease-package`,`minimum-libc-version`];function Pe(e=Object.create(null)){let t=`options`;p(e,t,Ne);let n=b(e,`exclude-newer`,t,E);return{resolutionMode:b(e,`resolution-mode`,t,K(`highest`,`lowest`,`lowest-direct`))??`highest`,prereleaseMode:b(e,`prerelease-mode`,t,q)??`if-necessary-or-explicit`,forkStrategy:b(e,`fork-strategy`,t,K(`fewest`,`requires-python`))??`requires-python`,excludeNewer:e[`exclude-newer-span`]===void 0?n:void 0,excludeNewerSpan:b(e,`exclude-newer-span`,t,J),excludeNewerPackage:O(e[`exclude-newer-package`],w(t,`exclude-newer-package`),je),prereleasePackage:O(e[`prerelease-package`],w(t,`prerelease-package`),q),minimumLibcVersion:b(e,`minimum-libc-version`,t,Me)}}var Fe=_((e,t)=>{let n=_(z)(e,t);if(n.length<2)throw new S(`a set of conflicts of fewer than two, which uv refuses`,t);return n}),Ie=[`version`,`revision`,`requires-python`,`resolution-markers`,`supported-markers`,`required-markers`,`conflicts`,`options`,`manifest`,`package`],Le={distribution:"`distribution` is what uv 0.2 and older wrote for `package`, which is not read here"},Re=[`name`,`version`,`source`,`resolution-markers`,`dependencies`,`sdist`,`wheels`,`optional-dependencies`,`dev-dependencies`,`metadata`],ze={"dependency-groups":"`dependency-groups` is an older spelling of `dev-dependencies`, which uv no longer writes"},Be=[`name`,`version`,`source`,`extra`,`marker`];function Ve(e,t){if(e===void 0)return 0;if(e===1||e===2||e===3)return e;throw new S(`unsupported revision: expected 1, 2 or 3, found ${f(e)}`,t)}function He(e,t){if(e===1)return e;throw e===void 0?new S("no `version`: a lockfile of uv 0.2 or older, which is not read here",t):new S(`unsupported version: expected 1, found ${f(e)}`,t)}var Y=(e,t)=>e===void 0?[]:ne(e,t,a),X=(e,t,n)=>`${e}${t===void 0?``:`==${t}`} @ ${n}`;function Ue(e,t){p(e,t,Be);let r=b(e,`extra`,t,D)??[],o=x(r);if(o!==void 0)throw new S(`${C(o)} is listed twice`,w(t,`extra`));return{name:i(e.name,w(t,`name`)),version:b(e,`version`,t,n),source:b(e,`source`,t,L),extras:r,marker:b(e,`marker`,t,a),where:t}}var Z=(e,t)=>e===void 0?[]:m(e,t).map((e,n)=>Ue(e,`${t}[${n}]`));function We(e,r){p(e,r,Re,ze);let a=i(e.name,w(r,`name`)),o=L(e.source,w(r,`source`)),s=b(e,`version`,r,n);if(s===void 0&&!R(o))throw new S(`expected a version, which uv writes of any but a source tree's package`,r);let c={key:X(a,s,o.id),name:a,version:s,versionKey:s===void 0?void 0:t(s),source:o};return{...c,resolutionMarkers:Y(e[`resolution-markers`],w(r,`resolution-markers`)),sdist:_e(e.sdist,w(r,`sdist`),o),wheels:ve(e.wheels,w(r,`wheels`),c),edges:Z(e.dependencies,w(r,`dependencies`)),extraEdges:O(e[`optional-dependencies`],w(r,`optional-dependencies`),Z),groupEdges:O(e[`dev-dependencies`],w(r,`dev-dependencies`),Z),metadata:Ae(e.metadata,w(r,`metadata`))}}var Q=(e,t,n)=>`${e} ${t} ${n}`;function Ge(e,n){let r=t=>me(t,e.where),i=n.byName.get(e.name)??r(`${C(e.name)} names no package in the lockfile`),a=i.length===1?i[0]:void 0,o=e.source?.id??a?.source.id??r(`${C(e.name)} could be any of ${i.length} packages, and names no source`);e.version===void 0&&a===void 0&&!R(e.source)&&r(`${C(e.name)} could be any of ${i.length} versions, and names none`);let s=e.version===void 0?a?.versionKey:t(e.version),c=n.byId.get(Q(e.name,s,o))??r(`names a package the lockfile does not hold: ${C(X(e.name,e.version,o))}`);e.version!==void 0&&e.version!==c.version&&r(`${C(e.version)}, where the package is ${C(c.version)}`);for(let t of e.extras)t in c.extraEdges||r(`${C(t)}, an extra ${C(c.key)} has no dependencies for, which uv drops`);return{package:c.key,extras:e.extras,marker:e.marker}}function Ke(e,t,n){let r=e.map(e=>Ge(e,t)),i=x(r,e=>JSON.stringify([e.package,[...e.extras].sort(),e.marker]));if(i!==void 0)throw new S(`${C(i.package)} is listed twice alike`,n);return r}var $=(e,t,n)=>le(e,n,(e,n)=>Ke(e,t,n));function qe(e,t,n){return e.members.length===0?t.filter(e=>R(e.source)&&e.source.path===`.`).map(e=>e.key):e.members.map((e,t)=>{let r=(n.byName.get(e)??[]).filter(e=>R(e.source));if(r.length!==1)throw new S(`${C(e)} is ${r.length===0?`no package`:`more than one package`} of a directory in the lockfile`,`manifest.members[${t}]`);return r[0].key})}function Je(e){let t=p(pe(e),void 0,Ie,Le),n=He(t.version,`version`),i=Ve(t.revision,`revision`),a=r(t[`requires-python`],`requires-python`),o=m(t.package??[],`package`).map((e,t)=>We(e,`package[${t}]`)),s=ae(o,e=>Q(e.name,e.versionKey,e.source.id),e=>e.key),c={byName:Map.groupBy(o,e=>e.name),byId:new Map([...s].map(([e,t])=>[e,o[t]]))},l=Object.create(null);for(let[e,t]of o.entries()){let n=`package[${e}]`;l[t.key]={name:t.name,version:t.version,source:t.source,resolutionMarkers:t.resolutionMarkers,dependencies:Ke(t.edges,c,w(n,`dependencies`)),optionalDependencies:$(t.extraEdges,c,w(n,`optional-dependencies`)),devDependencies:$(t.groupEdges,c,w(n,`dev-dependencies`)),sdist:t.sdist,wheels:t.wheels,metadata:t.metadata}}let u=ke(t.manifest);return{version:n,revision:i,requiresPython:a,resolutionMarkers:Y(t[`resolution-markers`],`resolution-markers`),supportedMarkers:Y(t[`supported-markers`],`supported-markers`),requiredMarkers:Y(t[`required-markers`],`required-markers`),conflicts:b(t,`conflicts`,``,Fe)??[],options:Pe(t.options),manifest:u,members:qe(u,o,c),packages:l}}export{S as LockfileError,ue as TomlError,Je as parseUvLock};
@@ -1,2 +1,2 @@
1
- import{d as e,i as t,r as n,s as r,u as i}from"./chunk-WFYLMF6Z.js";import{c as a,g as o}from"./chunk-2XUEZHIP.js";var s=[[`manage`,`Overview`],[`manage-bundles`,`Bundles`],[`manage-scans`,`Scans`],[`manage-reports`,`Reports`],[`manage-deduplication`,`Deduplication`,`admin`],[`manage-repos`,`Repositories`,`admin`],[`admin-users`,`Users`,`admin`],[`manage-teams`,`Teams`,`admin`],[`manage-import`,`Import`,`admin`],[`manage-links`,`Links`],[`manage-history`,`History`]];function c(e,t,n=!1){return a`<header class="manage-header"><nav class="manage-nav" aria-label="Management pages">${s.filter(([e,,r])=>(r==null||r===t)&&(e!==`manage-links`||n)).map(([t,n])=>a`<button type="button" aria-current="${e===t?`page`:o}" @click="${()=>{document.dispatchEvent(new CustomEvent(`managed-admin-navigate`,{detail:{view:t},bubbles:!0,composed:!0}))}}">${n}</button>`)}</nav></header>`}function l(s){if(s===`bundle`)return e(t);if(s===`report`||s===`preview`)return e(r);if(s===`scan`)return e(n);if(s===`code`)return e(i);let c={users:`M10.75 4.75a2.75 2.75 0 1 1-5.5 0 2.75 2.75 0 0 1 5.5 0ZM3 14v-1.5A3.5 3.5 0 0 1 6.5 9h3a3.5 3.5 0 0 1 3.5 3.5V14`,team:`M8.5 5a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM1.5 14v-1.5A3.5 3.5 0 0 1 5 9h2a3.5 3.5 0 0 1 3.5 3.5V14M11 2.75a2.5 2.5 0 0 1 0 4.5m1 2a3 3 0 0 1 2.5 3V14`,repo:`M3 12.5V3a1.5 1.5 0 0 1 1.5-1.5H13v13H4.5a1.5 1.5 0 0 1 0-3H13M7 1.5v6l2-1.5 2 1.5v-6`,history:`M2 5a6.25 6.25 0 1 1-.25 5M1.5 1.5V5H5M8 4.5V8l3 1.5`,arrow:`M3 8h10M9 4l4 4-4 4`,show:`M1 8s2.5-4.5 7-4.5S15 8 15 8s-2.5 4.5-7 4.5S1 8 1 8Zm9 0a2 2 0 1 0-4 0 2 2 0 0 0 4 0`,hide:`m2 2 12 12M6 3.75A8 8 0 0 1 8 3.5c4.5 0 7 4.5 7 4.5a12 12 0 0 1-2 2.5M3.5 5A13 13 0 0 0 1 8s2.5 4.5 7 4.5a8 8 0 0 0 3-.6`,download:`M8 2v8M5 7l3 3 3-3M2 11v3h12v-3`,upload:`M8 11V2m-3 3 3-3 3 3M2 10v4h12v-4`};return a`<svg class="${s===`repo`?`repo-icon`:o}" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${c[s]??c.repo}"></path></svg>`}var u=`:host{display:flex;flex-direction:column;position:relative;padding:0 clamp(1rem,3vw,3rem) 3rem;color:var(--text);container-type:inline-size;font-family:var(--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);font-size:.875rem;line-height:1.5;--panel:color-mix(in srgb, var(--bg) 50%, var(--surface));--panel-hover:color-mix(in srgb, var(--text) 3%, var(--panel))}*,*:before,*:after{box-sizing:border-box}button,summary,select,label,legend,h1,h2,h3,.section-heading,.ui-hint,.page-intro>.intro,.count,.result-count,.repository-count,.breadcrumb-separator,.list-head,.report-list-head,.history-head,.bundle-group-head,.drop-copy,.local-import-copy,.location-field>span,.empty:not(.error,[role=alert]),.msg:not(.error,[role=alert]),.local-import-message:not(.error,[role=status]),.data-empty,.revision-empty{cursor:default;user-select:none;-webkit-user-select:none}input:not([type=checkbox],[type=radio]),textarea,[contenteditable],pre,code,.mono{cursor:text;user-select:text;-webkit-user-select:text}.wrap{width:100%;max-width:76rem;margin:0 auto;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:none;scrollbar-gutter:stable}.manage-header{position:sticky;top:0;z-index:2}.wrap:has(>.manage-list){display:flex;flex-direction:column;overflow:hidden;scrollbar-gutter:auto}.wrap:has(>.manage-list)>:not(.manage-list){flex:none}.manage-list{position:relative;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.manage-list.has-intro{margin-top:calc(-.45rem - 1px);padding-top:calc(.45rem + 1px)}.manage-nav button{flex:0 0 auto;position:relative;min-height:3.7rem;padding:.9rem 0;border:0;border-radius:0;color:var(--muted);background:none;font-size:.8rem;font-weight:500;white-space:nowrap}.manage-nav button:hover,.manage-nav button[aria-current=page]{color:var(--text)}.manage-nav button[aria-current=page]:after{content:"";position:absolute;bottom:.6rem;inset-inline:0;height:2px;background:var(--accent);border-radius:var(--ui-radius, 2px)}.manage-nav button:focus-visible{outline-offset:-3px}.head{display:flex;align-items:center;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem}h1,.head h1{margin:0;font-size:1.9rem;font-weight:600;letter-spacing:-.045em;line-height:1.2}.count{display:inline-flex;align-items:center;justify-content:center;min-width:1.6rem;padding:.12rem .5rem;border:1px solid var(--border);border-radius:6px;color:var(--muted);background:var(--surface);font-size:.73rem;font-weight:500;font-variant-numeric:tabular-nums}button,input,select{font:inherit}button,select,input[type=checkbox]{cursor:default}button,a,input,select{-webkit-app-region:no-drag}button,a{transition:background .15s,color .15s,border-color .15s}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button:disabled,select:disabled{opacity:.45}input:not([type=checkbox]),select{min-width:0;min-height:2.25rem;padding:.45rem .65rem;border:1px solid var(--border);border-radius:var(--ui-radius, 7px);background:var(--bg);color:var(--text);font-size:.8rem}input::placeholder{color:var(--muted)}input[type=checkbox]{accent-color:var(--accent)}.btn,.drop-browse{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:2.25rem;height:auto;padding:.45rem .8rem;border:1px solid var(--border);border-radius:var(--ui-radius, 7px);background:var(--surface);color:var(--text);font-size:.8rem;font-weight:500;text-decoration:none;white-space:nowrap}.btn:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--surface-active);border-color:var(--muted)}.btn.primary,.drop-browse{color:var(--bg);background:var(--accent);border-color:var(--accent)}.btn.primary:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--accent);filter:brightness(1.08)}.btn svg,.icon-btn svg{width:1rem;height:1rem}.icon-btn{width:2rem;height:2rem}.avatar{color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,var(--bg));border:1px solid color-mix(in srgb,var(--accent) 16%,var(--border))}.breadcrumb{display:flex;align-items:center;flex-basis:100%;gap:.4rem;margin-bottom:.8rem}.breadcrumb-manage{padding:.1rem 0;border:0;background:transparent;color:var(--muted);font-size:.78rem}.breadcrumb-manage:hover{color:var(--text)}.breadcrumb-separator{color:var(--muted)}.msg{margin:1rem 0;padding:1.1rem 1.25rem;border:1px solid var(--border);border-radius:var(--ui-radius, 9px);color:var(--muted);font-size:.85rem}.msg.error{color:var(--critical);border-color:color-mix(in srgb,var(--critical) 35%,var(--border))}.empty{padding:3.5rem 1.5rem;border:1px dashed var(--border);border-radius:var(--ui-radius, 10px);color:var(--muted);text-align:center}.empty strong{display:block;margin-bottom:.4rem;color:var(--text);font-size:.95rem;font-weight:500}.empty p{margin:0;font-size:.85rem}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@container (max-width: 35rem){.drop-copy>span{display:none}.manage-nav{gap:1.2rem;margin-bottom:1.75rem}.manage-nav button{min-height:3.25rem}h1,.head h1{font-size:1.65rem}.intro{margin-bottom:1.5rem}}@media(prefers-reduced-motion:reduce){button,a{transition:none}}.collection-toolbar input{flex:1;max-width:26rem;min-width:10rem}.collection-toolbar select{min-width:10rem}.result-count{text-align:right;white-space:nowrap;margin-left:auto;color:var(--muted);font-size:.75rem;font-variant-numeric:tabular-nums}@container (max-width: 35rem){.collection-toolbar input{flex-basis:100%;max-width:none}}.manage-nav{display:flex;gap:1.35rem;align-items:stretch;overflow-x:auto;scrollbar-width:thin;border-bottom:1px solid var(--border);margin-bottom:1.5rem;padding:0 .1rem}.wrap>:not(.manage-header),.manage-nav{-webkit-app-region:no-drag;app-region:no-drag}@media(display-mode:window-controls-overlay){.manage-header{display:flow-root}.manage-header:before{content:"";float:right;width:var(--wco-right-toolbar, 0px);height:var(--wco-titlebar-height)}.manage-nav{width:max-content;max-width:100%;border-bottom:0}.manage-nav button{min-height:var(--wco-titlebar-height);padding-block:.35rem}.manage-nav button[aria-current=page]:after{bottom:0}}.intro{margin:0 0 1.25rem;max-width:46rem;color:var(--muted);font-size:.875rem;line-height:1.65}.collection-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-bottom:.85rem}.page-intro{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.5rem 1rem;margin-bottom:1.25rem}.page-intro .intro{margin:0}.page-intro>.btn{margin-block:calc(-.45rem - 1px)}a{cursor:default}.loading-rows{border:1px solid var(--border);border-radius:var(--ui-radius, 10px);overflow:hidden}.loading-row{display:grid;align-content:center;gap:.6rem;min-height:4.25rem;padding:.85rem 1rem}.loading-row+.loading-row{border-top:1px solid var(--border)}.loading-row span{width:40%;height:.65rem;border-radius:3px;background:color-mix(in srgb,var(--muted) 15%,transparent)}.loading-row span+span{width:65%;height:.5rem}.drop-card{display:flex;align-items:center;gap:.75rem;margin-bottom:1rem;padding:.7rem .85rem;border:1px dashed color-mix(in srgb,var(--muted) 35%,var(--border));border-radius:var(--ui-radius, 8px);background:var(--panel)}.drop-icon{display:grid;place-items:center;flex-shrink:0;width:1.8rem;height:1.8rem;color:var(--muted)}.drop-icon svg{width:1.1rem;height:1.1rem}.drop-copy{min-width:0;display:flex;align-items:baseline;flex-wrap:wrap;gap:.2rem .6rem}.drop-copy strong{font-size:.8rem;font-weight:500}.drop-copy>span{color:var(--muted);font-size:.75rem}.drop-browse{min-width:7rem;margin-left:auto;flex-shrink:0}.content-hidden .filename,.content-hidden .report-name,.content-hidden .report-uploader{color:var(--muted)}.status{display:inline-flex;align-items:center;gap:.3rem;width:fit-content;padding:.1rem .4rem;border:1px solid var(--border);border-radius:5px;color:var(--muted);font-size:.65rem}.status:before{content:"";width:.25rem;height:.25rem;border-radius:50%;background:currentcolor}.status.visible{color:var(--green);border-color:rgb(from var(--green) r g b / .2);background:rgb(from var(--green) r g b / .06)}:host-context(body.theme-w95) *{overscroll-behavior:none}
1
+ import{d as e,i as t,s as n,t as r,v as i}from"./chunk-74AEKRES.js";import{c as a,g as o}from"./chunk-2XUEZHIP.js";var s=[[`manage`,`Overview`],[`manage-bundles`,`Bundles`],[`manage-scans`,`Scans`],[`manage-reports`,`Reports`],[`manage-deduplication`,`Deduplication`,`admin`],[`manage-repos`,`Repositories`,`admin`],[`admin-users`,`Users`,`admin`],[`manage-teams`,`Teams`,`admin`],[`manage-import`,`Import`,`admin`],[`manage-links`,`Links`],[`manage-history`,`History`]];function c(e,t,n=!1){return a`<header class="manage-header"><nav class="manage-nav" aria-label="Management pages">${s.filter(([e,,r])=>(r==null||r===t)&&(e!==`manage-links`||n)).map(([t,n])=>a`<button type="button" aria-current="${e===t?`page`:o}" @click="${()=>{document.dispatchEvent(new CustomEvent(`managed-admin-navigate`,{detail:{view:t},bubbles:!0,composed:!0}))}}">${n}</button>`)}</nav></header>`}function l(s){if(s===`bundle`)return e(t);if(s===`report`||s===`preview`)return e(r);if(s===`scan`)return e(n);if(s===`code`)return e(i);let c={users:`M10.75 4.75a2.75 2.75 0 1 1-5.5 0 2.75 2.75 0 0 1 5.5 0ZM3 14v-1.5A3.5 3.5 0 0 1 6.5 9h3a3.5 3.5 0 0 1 3.5 3.5V14`,team:`M8.5 5a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM1.5 14v-1.5A3.5 3.5 0 0 1 5 9h2a3.5 3.5 0 0 1 3.5 3.5V14M11 2.75a2.5 2.5 0 0 1 0 4.5m1 2a3 3 0 0 1 2.5 3V14`,repo:`M3 12.5V3a1.5 1.5 0 0 1 1.5-1.5H13v13H4.5a1.5 1.5 0 0 1 0-3H13M7 1.5v6l2-1.5 2 1.5v-6`,history:`M2 5a6.25 6.25 0 1 1-.25 5M1.5 1.5V5H5M8 4.5V8l3 1.5`,arrow:`M3 8h10M9 4l4 4-4 4`,show:`M1 8s2.5-4.5 7-4.5S15 8 15 8s-2.5 4.5-7 4.5S1 8 1 8Zm9 0a2 2 0 1 0-4 0 2 2 0 0 0 4 0`,hide:`m2 2 12 12M6 3.75A8 8 0 0 1 8 3.5c4.5 0 7 4.5 7 4.5a12 12 0 0 1-2 2.5M3.5 5A13 13 0 0 0 1 8s2.5 4.5 7 4.5a8 8 0 0 0 3-.6`,download:`M8 2v8M5 7l3 3 3-3M2 11v3h12v-3`,upload:`M8 11V2m-3 3 3-3 3 3M2 10v4h12v-4`};return a`<svg class="${s===`repo`?`repo-icon`:o}" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${c[s]??c.repo}"></path></svg>`}var u=`:host{display:flex;flex-direction:column;position:relative;padding:0 clamp(1rem,3vw,3rem) 3rem;color:var(--text);container-type:inline-size;font-family:var(--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);font-size:.875rem;line-height:1.5;--panel:color-mix(in srgb, var(--bg) 50%, var(--surface));--panel-hover:color-mix(in srgb, var(--text) 3%, var(--panel))}*,*:before,*:after{box-sizing:border-box}button,summary,select,label,legend,h1,h2,h3,.section-heading,.ui-hint,.page-intro>.intro,.count,.result-count,.repository-count,.breadcrumb-separator,.list-head,.report-list-head,.history-head,.bundle-group-head,.drop-copy,.local-import-copy,.location-field>span,.empty:not(.error,[role=alert]),.msg:not(.error,[role=alert]),.local-import-message:not(.error,[role=status]),.data-empty,.revision-empty{cursor:default;user-select:none;-webkit-user-select:none}input:not([type=checkbox],[type=radio]),textarea,[contenteditable],pre,code,.mono{cursor:text;user-select:text;-webkit-user-select:text}.wrap{width:100%;max-width:76rem;margin:0 auto;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:none;scrollbar-gutter:stable}.manage-header{position:sticky;top:0;z-index:2}.wrap:has(>.manage-list){display:flex;flex-direction:column;overflow:hidden;scrollbar-gutter:auto}.wrap:has(>.manage-list)>:not(.manage-list){flex:none}.manage-list{position:relative;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.manage-list.has-intro{margin-top:calc(-.45rem - 1px);padding-top:calc(.45rem + 1px)}.manage-nav button{flex:0 0 auto;position:relative;min-height:3.7rem;padding:.9rem 0;border:0;border-radius:0;color:var(--muted);background:none;font-size:.8rem;font-weight:500;white-space:nowrap}.manage-nav button:hover,.manage-nav button[aria-current=page]{color:var(--text)}.manage-nav button[aria-current=page]:after{content:"";position:absolute;bottom:.6rem;inset-inline:0;height:2px;background:var(--accent);border-radius:var(--ui-radius, 2px)}.manage-nav button:focus-visible{outline-offset:-3px}.head{display:flex;align-items:center;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem}h1,.head h1{margin:0;font-size:1.9rem;font-weight:600;letter-spacing:-.045em;line-height:1.2}.count{display:inline-flex;align-items:center;justify-content:center;min-width:1.6rem;padding:.12rem .5rem;border:1px solid var(--border);border-radius:6px;color:var(--muted);background:var(--surface);font-size:.73rem;font-weight:500;font-variant-numeric:tabular-nums}button,input,select{font:inherit}button,select,input[type=checkbox]{cursor:default}button,a,input,select{-webkit-app-region:no-drag}button,a{transition:background .15s,color .15s,border-color .15s}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button:disabled,select:disabled{opacity:.45}input:not([type=checkbox]),select{min-width:0;min-height:2.25rem;padding:.45rem .65rem;border:1px solid var(--border);border-radius:var(--ui-radius, 7px);background:var(--bg);color:var(--text);font-size:.8rem}input::placeholder{color:var(--muted)}input[type=checkbox]{accent-color:var(--accent)}.btn,.drop-browse{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:2.25rem;height:auto;padding:.45rem .8rem;border:1px solid var(--border);border-radius:var(--ui-radius, 7px);background:var(--surface);color:var(--text);font-size:.8rem;font-weight:500;text-decoration:none;white-space:nowrap}.btn:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--surface-active);border-color:var(--muted)}.btn.primary,.drop-browse{color:var(--bg);background:var(--accent);border-color:var(--accent)}.btn.primary:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--accent);filter:brightness(1.08)}.btn svg,.icon-btn svg{width:1rem;height:1rem}.icon-btn{width:2rem;height:2rem}.avatar{color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,var(--bg));border:1px solid color-mix(in srgb,var(--accent) 16%,var(--border))}.breadcrumb{display:flex;align-items:center;flex-basis:100%;gap:.4rem;margin-bottom:.8rem}.breadcrumb-manage{padding:.1rem 0;border:0;background:transparent;color:var(--muted);font-size:.78rem}.breadcrumb-manage:hover{color:var(--text)}.breadcrumb-separator{color:var(--muted)}.msg{margin:1rem 0;padding:1.1rem 1.25rem;border:1px solid var(--border);border-radius:var(--ui-radius, 9px);color:var(--muted);font-size:.85rem}.msg.error{color:var(--critical);border-color:color-mix(in srgb,var(--critical) 35%,var(--border))}.empty{padding:3.5rem 1.5rem;border:1px dashed var(--border);border-radius:var(--ui-radius, 10px);color:var(--muted);text-align:center}.empty strong{display:block;margin-bottom:.4rem;color:var(--text);font-size:.95rem;font-weight:500}.empty p{margin:0;font-size:.85rem}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@container (max-width: 35rem){.drop-copy>span{display:none}.manage-nav{gap:1.2rem;margin-bottom:1.75rem}.manage-nav button{min-height:3.25rem}h1,.head h1{font-size:1.65rem}.intro{margin-bottom:1.5rem}}@media(prefers-reduced-motion:reduce){button,a{transition:none}}.collection-toolbar input{flex:1;max-width:26rem;min-width:10rem}.collection-toolbar select{min-width:10rem}.result-count{text-align:right;white-space:nowrap;margin-left:auto;color:var(--muted);font-size:.75rem;font-variant-numeric:tabular-nums}@container (max-width: 35rem){.collection-toolbar input{flex-basis:100%;max-width:none}}.manage-nav{display:flex;gap:1.35rem;align-items:stretch;overflow-x:auto;scrollbar-width:thin;border-bottom:1px solid var(--border);margin-bottom:1.5rem;padding:0 .1rem}.wrap>:not(.manage-header),.manage-nav{-webkit-app-region:no-drag;app-region:no-drag}@media(display-mode:window-controls-overlay){.manage-header{display:flow-root}.manage-header:before{content:"";float:right;width:var(--wco-right-toolbar, 0px);height:var(--wco-titlebar-height)}.manage-nav{width:max-content;max-width:100%;border-bottom:0}.manage-nav button{min-height:var(--wco-titlebar-height);padding-block:.35rem}.manage-nav button[aria-current=page]:after{bottom:0}}.intro{margin:0 0 1.25rem;max-width:46rem;color:var(--muted);font-size:.875rem;line-height:1.65}.collection-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-bottom:.85rem}.page-intro{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.5rem 1rem;margin-bottom:1.25rem}.page-intro .intro{margin:0}.page-intro>.btn{margin-block:calc(-.45rem - 1px)}a{cursor:default}.loading-rows{border:1px solid var(--border);border-radius:var(--ui-radius, 10px);overflow:hidden}.loading-row{display:grid;align-content:center;gap:.6rem;min-height:4.25rem;padding:.85rem 1rem}.loading-row+.loading-row{border-top:1px solid var(--border)}.loading-row span{width:40%;height:.65rem;border-radius:3px;background:color-mix(in srgb,var(--muted) 15%,transparent)}.loading-row span+span{width:65%;height:.5rem}.drop-card{display:flex;align-items:center;gap:.75rem;margin-bottom:1rem;padding:.7rem .85rem;border:1px dashed color-mix(in srgb,var(--muted) 35%,var(--border));border-radius:var(--ui-radius, 8px);background:var(--panel)}.drop-icon{display:grid;place-items:center;flex-shrink:0;width:1.8rem;height:1.8rem;color:var(--muted)}.drop-icon svg{width:1.1rem;height:1.1rem}.drop-copy{min-width:0;display:flex;align-items:baseline;flex-wrap:wrap;gap:.2rem .6rem}.drop-copy strong{font-size:.8rem;font-weight:500}.drop-copy>span{color:var(--muted);font-size:.75rem}.drop-browse{min-width:7rem;margin-left:auto;flex-shrink:0}.content-hidden .filename,.content-hidden .report-name,.content-hidden .report-uploader{color:var(--muted)}.status{display:inline-flex;align-items:center;gap:.3rem;width:fit-content;padding:.1rem .4rem;border:1px solid var(--border);border-radius:5px;color:var(--muted);font-size:.65rem}.status:before{content:"";width:.25rem;height:.25rem;border-radius:50%;background:currentcolor}.status.visible{color:var(--green);border-color:rgb(from var(--green) r g b / .2);background:rgb(from var(--green) r g b / .06)}:host-context(body.theme-w95) *{overscroll-behavior:none}
2
2
  `;export{c as a,l as b,u as c};
@@ -0,0 +1,5 @@
1
+ import{a as e,e as t}from"./chunk-PAD2JHZT.js";import{A as n,B as r,C as i,E as a,F as o,G as s,H as c,M as l,O as u,Q as ee,S as d,a as f,d as p,e as m,f as te,i as ne,m as h,n as g,o as re,p as ie,q as _,r as v,u as ae,v as oe,x as y,z as se}from"./chunk-UCP3JRE2.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{d as b,e as ce,f as x,g as le,h as S,i as C,j as ue,l as de,m as fe}from"./chunk-JMG5DXII.js";import"./chunk-OOJM4CTU.js";function w(e,t=new Set){if(t.has(e))return;t.add(e);let{parent:n}=e;if(n===void 0)return;let r=w(n,t);return r===void 0?n.bundleDependencies?.includes(e.folder)||e.edgesIn.some(e=>w(e.from,t)===n)?n:void 0:r}var pe=({parent:e})=>e!==void 0&&(e.bundleDependencies!==void 0||pe(e)),me=e=>pe(e)?w(e):void 0;function he(e,t){let n=me(e);return n!==void 0&&n!==t}function ge(e,t){let n=me(e);if(e.inBundle!==(n!==void 0))throw new b(n===void 0?`set, where nothing bundles it`:`expected true, as ${S(n.location)} bundles it`,C(e.where,`inBundle`));let{resolution:r}=e;if(n===void 0||n===t){if(r===void 0)throw new b(`expected where it comes from, resolved or an integrity`,e.where)}else if(r!==void 0){let t=r.type===`git`||r.tarball!==void 0?`resolved`:`integrity`;throw new b(`npm takes it from the tarball of ${S(n.location)}, and from nothing else`,C(e.where,t))}}function _e(e){let t=e.get(``);for(let n of e.values())n.kind===`package`&&ge(n,t)}var T=e=>e?.endsWith(`.git`)?e.slice(0,-4):e;function E(e,t,n){let r=T(t);return e&&r?{user:e,project:r,committish:n}:void 0}var ve=e=>t=>{let[,n,r,i]=t.pathname.split(`/`,4);return i===e?void 0:E(n,r,t.hash.slice(1))},D={__proto__:null,github:{protocols:[`git:`,`http:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`github.com`,extract:e=>{let[,t,n,r,i]=e.pathname.split(`/`,5);if(!(r&&r!==`tree`))return E(t,n,r?i:e.hash.slice(1))}},bitbucket:{protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`bitbucket.org`,extract:ve(`get`)},gitlab:{protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gitlab.com`,extract:e=>{let t=e.pathname.slice(1);if(t.includes(`/-/`)||t.includes(`/archive.tar.gz`))return;let n=t.split(`/`),r=n.pop();return E(n.join(`/`),r,e.hash.slice(1))}},gist:{protocols:[`git:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gist.github.com`,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(r!==`raw`&&(t||n))return{user:n?t:null,project:T(n||t),committish:e.hash.slice(1)}}},sourcehut:{protocols:[`git+ssh:`,`https:`],domain:`git.sr.ht`,extract:ve(`archive`)}},ye=new Map(Object.entries(D).map(([e,t])=>[t.domain,e])),be=new Map(Object.keys(D).map(e=>[`${e}:`,e])),xe=new Set([`git+ssh:`,`ssh:`,`git+https:`,`git:`,`http:`,`https:`,`git+http:`,...be.keys()]);function Se(e){let t=e.indexOf(`#`),n=e=>e===-1||t>-1&&e>t,r=e.indexOf(`/`);return n(e.search(/\s/u))&&r>0&&(t>-1?e[t-1]!==`/`:!e.endsWith(`/`))&&!e.startsWith(`.`)&&n(e.indexOf(`@`))&&n(e.indexOf(`:`))&&n(e.indexOf(`/`,r+1))}var O=(e,t,n)=>{let r=e.indexOf(n);return e.lastIndexOf(t,r>-1?r:1/0)};function Ce(e){let t=e.indexOf(`:`);if(xe.has(e.slice(0,t+1))||e.slice(t,t+3)===`://`)return e;let n=e.indexOf(`@`);return n>-1?n>t?`git+ssh://${e}`:e:`${e.slice(0,t+1)}//${e.slice(t+1)}`}function we(e){let t=e,n=O(t,`:`,`#`);return n>O(t,`@`,`#`)&&(t=`${t.slice(0,n)}/${t.slice(n+1)}`),O(t,`:`,`#`)===-1&&!t.includes(`//`)&&(t=`git+ssh://${t}`),t}var k=e=>e&&decodeURIComponent(e);function Te(e){let t=e.pathname.startsWith(`/`)?e.pathname.slice(1):e.pathname,n=t.indexOf(`@`);n>-1&&(t=t.slice(n+1));let r=t.lastIndexOf(`/`),i=T(k(t.slice(r+1)));return{user:r>-1&&k(t.slice(0,r))||null,project:i,committish:k(e.hash.slice(1))||null}}function A(e){if(!e)return;let t=Ce(Se(e)?`github:${e}`:e),n=URL.parse(t)??URL.parse(we(t));if(n===null)return;let r=be.get(n.protocol),i=r??ye.get(n.hostname.replace(/^www\./u,``));if(i!==void 0)try{if(r!==void 0)return{type:i,...Te(n)};if(!D[i].protocols.includes(n.protocol))return;let e=D[i].extract(n);return e===void 0?void 0:{type:i,user:k(e.user),project:k(e.project),committish:k(e.committish)||null}}catch(e){if(e instanceof URIError)return;throw e}}function Ee({type:e,user:t,project:n,committish:r},i){let a=i&&r?`#${r}`:``;return e===`gist`?`git@${D[e].domain}:${n}.git${a}`:`git@${D[e].domain}:${t}/${n}.git${a}`}var De=/^(?:[Gg][Ii][Tt]\+)?[A-Za-z]+:/u,Oe=/^[^@]+@[^.:]+\.[^:]+:.+$/iu,j=/\.(?:tgz|tar\.gz|tar)$/iu,ke=e=>j.test(e),M=/^git(?:\+(?:https?|rsync|ftp|ssh))?:/u,N=(e,t)=>new b(`${S(e)} is ${t}`);function Ae(e,t){let n=j.test(e)?`file`:`directory`;if(/^file:/iu.test(e)&&!e.startsWith(`file:`))throw N(e,`a path whose "file:" npm reads in another case otherwise`);let r=e.startsWith(`file:`)?e.slice(5):e;if(/^(?:[/~]|[A-Za-z]:)/u.test(r))throw N(e,`a path from the root, a drive or the home directory, which a lockfile does not hold`);return{type:n,path:o(t,r)}}function P(e,t){let n={committish:null,range:null};for(let r of t?t.split(`::`):[]){let[t,i]=r.includes(`:`)?r.split(`:`):[void 0,r];if(t===`path`)throw N(e,`a subdirectory of a repository, which is not supported`);if(t!==void 0&&t!==`semver`)throw N(e,`a git spec with ${S(t)}, which npm passes over`);if(n.committish!==null||n.range!==null)throw N(e,`a git spec with two refs or ranges, which npm refuses`);t===void 0?n.committish=i:n.range=je(e,i)}return n}var je=(e,t)=>x(()=>decodeURIComponent(t),()=>{throw N(e,`a git spec npm cannot decode`)});function Me(e){let t=e.startsWith(`git+ssh:`)?/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/iu.exec(e):null;if(t!==null&&!/:\d+(?:\/|$)/u.test(t[1]))return{type:`git`,hosted:void 0,fetchSpec:t[1],...P(e,t[2])};let n=URL.parse(e);if(n===null)throw N(e,`not a URL npm reads`);if(n.protocol===`http:`||n.protocol===`https:`)return{type:`remote`,url:e};if(!M.test(n.protocol))throw N(e,`of a protocol npm does not read, ${S(n.protocol)}`);let r=P(e,n.hash.slice(1));return n.hash=``,{type:`git`,hosted:void 0,fetchSpec:n.href.replace(/^git\+/u,``),...r}}function Ne(e,t,n){let r=t.trim();if(n===void 0)return{type:`registry`,name:e,fetchSpec:r,kind:void 0};let i=`tag`;if(n.valid(r,!0)===null?n.validRange(r,!0)!==null&&(i=`range`):i=`version`,i===`tag`&&encodeURIComponent(r)!==r)throw N(t,`a tag npm refuses, of a character a URL escapes`);return{type:`registry`,name:e,fetchSpec:r,kind:i}}function F(e,t,n,r){if(/^(?:file:|[.]|~\/|\/|[A-Za-z]:)/iu.test(t))return Ae(t,n);if(/^npm:/iu.test(t))return Fe(t,n,r);let i=A(t);return i===void 0?De.test(t)?Me(t):t.includes(`/`)||j.test(t)?Ae(t,n):Ne(e,t,r):{type:`git`,hosted:i,fetchSpec:void 0,...P(t,i.committish)}}function Pe(e,t,n){let r=e.indexOf(`@`,1),i=r>0?e.slice(0,r):e;return De.test(e)?F(void 0,e,t,n):Oe.test(e)?F(void 0,`git+ssh://${e}`,t,n):!i.startsWith(`@`)&&(i.includes(`/`)||j.test(i))?F(void 0,e,t,n):F(y(i,void 0),r>0&&e.slice(r+1)||`*`,t,n)}function Fe(e,t,n){let r=Pe(e.slice(4),t,n);if(r.type===`alias`)throw N(e,`an alias of an alias, which npm refuses`);if(r.type!==`registry`||r.name===void 0)throw N(e,`an alias of no package of the registry, which npm refuses`);return{type:`alias`,sub:r}}var I=(e,t,n,r)=>F(e,t||`*`,n,r),Ie=e=>F(void 0,e,`.`,void 0),L=[`dev`,`optional`,`devOptional`,`peer`],Le=[`name`,`version`,`dependencies`,`optionalDependencies`,`peerDependencies`,`peerDependenciesMeta`,`bundleDependencies`,`acceptDependencies`,`funding`,`engines`,`os`,`cpu`,`libc`,`license`,`hasInstallScript`,`bin`,`deprecated`,`workspaces`,...L],Re={link:[`link`,`resolved`],importer:[...Le,`devDependencies`],package:[...Le,`resolved`,`integrity`,`inBundle`]},ze={hasShrinkwrap:`a shrinkwrap of its own, which is not supported`,extraneous:`nothing leads to it, and npm prunes it rather than install it`};function R(e,t){if(typeof e==`object`&&e&&Object.keys(e).length===0)throw new b(`expected what npm writes, which leaves an empty ${Array.isArray(e)?`sequence`:`mapping`} out`,t);return e}var Be=e=>(t,n)=>ie(R(t,n),n,e),z=(e,t)=>_(R(e,t),t,y),Ve=(e,t)=>y(g(e,t),t),He=(e,t)=>re(R(e,t),t,y),B=(e,t)=>re(R(e,t),t),V=e=>(t,n)=>Array.isArray(t)?B(t,n):e(t,n),Ue=Be((e,t,n)=>(y(n,t),{optional:h(m(e,t),`optional`,t,ne)??!1}));function We(e,t){return typeof e==`string`?g(e,t):(m(R(e,t),t),{type:h(e,`type`,t,g),url:h(e,`url`,t,g)})}var Ge=(e,t)=>Array.isArray(e)?R(e,t).map((e,n)=>We(e,`${t}[${n}]`)):We(e,t);function Ke(e,t,i){if(!n(i)||/[/:]/u.test(i))throw new b(`${S(i)} is not the name of a bin, as npm writes one`,t);if(!r(g(e,t).replace(/\/$/u,``)))throw new b(`${S(e)} is not a path within the package, as npm writes a bin's`,t);return e}var qe=V((e,t)=>(m(R(e,t),t,[`packages`,`nohoist`]),h(e,`nohoist`,t,B),B(e.packages,C(t,`packages`)))),Je={__proto__:null,dependencies:z,optionalDependencies:z,peerDependencies:z,devDependencies:(e,t)=>_(e,t,y),peerDependenciesMeta:Ue,acceptDependencies:z,bundleDependencies:He,funding:Ge,engines:V((e,t)=>_(R(e,t),t)),os:B,cpu:B,libc:B,license:V(g),bin:Be(Ke),deprecated:g,workspaces:qe};function Ye(e,t){let n=Object.fromEntries(L.map(n=>[n,v(e[n],C(t,n))]));if(n.devOptional&&(n.dev||n.optional))throw new b(`set beside dev or optional, where npm leaves it out`,C(t,`devOptional`));return n}var Xe=(e,t)=>u(e,t)&&e;function Ze(e,t,n,r){if(e.startsWith(`file:`)){if(!ke(e))throw new b(`${S(e)} is a directory, which npm packs again at every install: not supported`,r);i(e.slice(5),r);return}if(!ee(e))throw new b(`${S(e)} is not an http(s) URL, a file: tarball or a git URL`,r);if(A(e)!==void 0)throw new b(`${S(e)} is a repository to npm, which it reads as one on a git host`,r);d(e,t,n,r)}function Qe(e,t,n,r){let i=C(t,`resolved`),a=h(e,`resolved`,t,g),o=h(e,`integrity`,t,Xe);if(a===void 0)return o===void 0?void 0:{type:`tarball`,tarball:void 0,integrity:o};if(M.test(a)){if(o!==void 0)throw new b(`an integrity, which npm does not check for a git repository`,C(t,`integrity`));let e=a.lastIndexOf(`#`);if(e===-1||!c(a.slice(e+1)))throw new b(`expected a full commit hash after the "#" of ${S(a)}`,i);return{type:`git`,repo:l(a.slice(0,e),i),commit:a.slice(e+1)}}if(Ze(a,n,r,i),o===void 0)throw new b(`expected an integrity, which npm checks the tarball with`,t);return{type:`tarball`,tarball:a,integrity:o}}function $e(e){let t=e.split(`/`),n=t.at(-1);return t.at(-2)?.startsWith(`@`)?`${t.at(-2)}/${n}`:n}function et(e,t){if(m(e,t,Re.link,ze),e.link!==!0)throw p(`true`,e.link,C(t,`link`));return e.resolved===``?``:i(e.resolved,C(t,`resolved`))}function tt(e,t,n,r){m(e,t,Re[n],ze);let i=Object.create(null);for(let[n,r]of Object.entries(Je))i[n]=h(e,n,t,r);if(n===`importer`&&r!==void 0&&i.bundleDependencies!==void 0)throw new b(`a bundle of a directory, which is not supported`,C(t,`bundleDependencies`));let a=h(e,`name`,t,Ve);if(a!==void 0&&a===r)throw new b(`the name of its folder, which npm leaves out`,C(t,`name`));let o=h(e,`version`,t,n===`package`?se:g);if(n===`package`&&o===void 0&&!M.test(e.resolved??``))throw new b(`expected a version, which only a package from a git repository is read without`,C(t,`version`));let s={name:a??r,version:o,...i,hasInstallScript:v(e.hasInstallScript,C(t,`hasInstallScript`)),flags:Ye(e,t)};return n===`package`&&(s.resolution=Qe(e,t,s.name,o),s.inBundle=v(e.inBundle,C(t,`inBundle`))),s}var H=`packages`,nt=/^(?:(.+)\/)?node_modules\/((?:@[^/]+\/)?[^/]+)$/u;function rt(e,t){if(e===``)return{kind:`root`,parent:void 0,folder:void 0};i(e,t);let n=nt.exec(e);if(n!==null){if(n[2]===`node_modules`)throw new b(`a folder named "node_modules", which no package is`,t);return{kind:`package`,parent:n[1]??``,folder:y(n[2],t)}}let r=e.split(`/`);if(r.includes(`node_modules`))throw new b(`in a node_modules, but none of its packages`,t);if(r.every(e=>e===`..`))throw new b(`a directory the project is in, which is not supported`,t);return{kind:`importer`,parent:void 0,folder:$e(e)}}function it(e,t,n){let{kind:r,parent:i,folder:a}=rt(e,n),o={location:e,where:n,kind:r,parentLocation:i,folder:a,parent:void 0,fsParent:void 0,children:new Map,links:[],edges:new Map,edgesIn:[]};if(t?.link===void 0)return Object.assign(o,tt(t,n,r===`package`?`package`:`importer`,a));if(r!==`package`)throw new b(`a link outside a node_modules, where npm writes none`,n);return Object.assign(o,{kind:`link`,targetLocation:et(t,n),target:void 0})}function at(e,t){let n=t.get(e.parentLocation);if(n===void 0)throw new b(`in the node_modules of ${S(e.parentLocation)}, which the lockfile does not have`,e.where);if(n.kind===`link`)throw new b(`in the node_modules of ${S(e.parentLocation)}, a link, in which npm installs nothing`,e.where);let r=e.folder.toLowerCase(),i=n.children.get(r);if(i!==void 0)throw new b(`in the folder of ${S(i.location)} to npm, which takes names in one case`,e.where);n.children.set(r,e),e.parent=n}function ot(e,t){let n=t.get(e.targetLocation),r=C(e.where,`resolved`);if(n===void 0)throw new b(`${S(e.targetLocation)} is not in the lockfile, where npm looks for what a link leads to`,r);if(n.kind===`link`)throw new b(`${S(e.targetLocation)} is a link, where npm links the project, a directory or a package`,r);e.target=n,n.links.push(e)}function st(e,t){let n=e.location.split(`/`);for(;n.pop()!==void 0&&n.at(-1)!==`..`;){let e=t.get(n.join(`/`));if(e!==void 0)return e}}var U=e=>e.parent??e.fsParent,W=e=>e.kind===`link`?e.target:e,G=e=>e.location||`.`;function ct(e,t){let n=t.toLowerCase();for(let t=e;t!==void 0;t=U(t)){let e=t.children.get(n);if(e!==void 0)return e}}function lt(e){let t=new Map;for(let[n,r,i]of te(e,H))t.set(n,it(n,r,i));t.has(``)||t.set(``,it(``,Object.create(null),C(H,``)));for(let e of t.values())e.parentLocation!==void 0&&at(e,t),e.kind===`link`&&ot(e,t);for(let e of t.values())if(e.kind===`importer`){if(e.links.length===0)throw new b(`a directory no link leads to, of which npm installs nothing`,e.where);e.fsParent=st(e,t)}return t}function ut(n){let r=n.get(``),i=C(r.where,`workspaces`),a=new Map;for(let[o,s]of(r.workspaces??[]).entries()){let r=e(s.replace(/^\.?\/+/u,``),`${i}[${o}]`);for(let e of n.values()){if(e.kind!==`importer`||a.get(e.name)===e||!t(r,e.location))continue;let n=y(e.name,C(e.where,`name`));if(a.has(n))throw new b(`the name of the workspace ${S(a.get(n).location)} too, of which npm keeps one`,e.where);a.set(n,e)}}return a}var dt={__proto__:null,workspace:`workspaces`,peer:`peerDependencies`,peerOptional:`peerDependencies`,prod:`dependencies`,optional:`optionalDependencies`,dev:`devDependencies`},ft=e=>e.type===`workspace`?C(e.from.where,`workspaces`):C(C(e.from.where,dt[e.type]),e.name);function pt(e,t,n){let r=(t,n,r)=>{let i=t.toLowerCase(),a=e.edges.get(i);if(a?.type===`workspace`)return;let o={name:t,type:n,spec:r,accept:e.acceptDependencies?.[t],from:e,to:void 0};if(a!==void 0&&a.name!==t)throw new b(`${S(a.name)} too, to npm, which takes names in one case`,ft(o));e.edges.delete(i),e.edges.set(i,o)};if(e.kind===`root`)for(let[e,{location:n}]of t)r(e,`workspace`,`file:${n}`);let i=e.peerDependenciesMeta??Object.create(null),a=n?[]:Object.entries(e.peerDependencies??{});for(let[e,t]of a)i[e]?.optional||r(e,`peer`,t);for(let[e,t]of a)i[e]?.optional&&r(e,`peerOptional`,t);for(let t of e.parent===void 0?[`prod`,`optional`,`dev`]:[`prod`,`optional`])for(let[n,i]of Object.entries(e[dt[t]]??{}))r(n,t,i)}function mt(e,t,n){for(let r of e.values())r.kind!==`link`&&pt(r,t,n);for(let t of e.values())for(let e of t.edges.values())e.to=ct(t,e.name),e.to?.edgesIn.push(e)}var K=[...L,`extraneous`],ht=e=>new Map([...e.values()].map(e=>[e,Object.fromEntries(K.map(t=>[t,e.kind!==`root`]))]));function gt(e,t,n){if(!e.get(t)[n])for(let r=U(t);r!==void 0&&e.get(r)[n];r=U(r))e.get(r)[n]=!1}function _t(e,t){let[n,r,i]=[t===`dev`,t===`optional`||t===`peerOptional`,t.startsWith(`peer`)];return{extraneous:!e.extraneous&&!(i&&r),dev:!e.dev&&!n,optional:!e.optional&&!r,devOptional:!e.devOptional&&!e.dev&&!e.optional&&!n&&!r,peer:!e.peer&&!i}}function vt(e,t){let n=ht(e),r=new Set,i=[e.get(``)];for(;i.length>0;){let e=i.pop();r.add(e);let a=n.get(e);if(gt(n,e,`extraneous`),e.kind===`link`){let o=n.get(e.target),s=K.filter(e=>o[e]&&!a[e]);if(t)Object.assign(o,a);else for(let e of s)o[e]=!1;(t||s.length>0||!r.has(e.target))&&i.push(e.target);continue}for(let{type:t,to:r}of e.edges.values()){if(r===void 0)continue;let e=_t(a,t),o=n.get(r),s=K.filter(t=>o[t]&&e[t]);for(let e of s)o[e]=!1;s.length>0&&i.push(r)}}return n}function yt(e,t,n){let r=[e],i=new Set;for(;r.length>0;){let e=r.pop();i.has(e)||(i.add(e),r.push(...n(e,t(e))))}}function bt(e){let t=ht(e),n=(e,n)=>{if(!t.get(e)[n])return;let r=e=>Object.assign(t.get(e),{extraneous:!1,[n]:!1});yt(e,e=>{r(e),e.kind===`link`&&r(e.target)},e=>[...W(e).edges.values()].filter(({type:e,to:r})=>r!==void 0&&t.get(r)[n]&&(n!==`peer`&&e===`peer`||e===`prod`)).map(({to:e})=>e))},r=e=>{let i=t.get(e);i.extraneous=!1;for(let n of K)gt(t,e,n);if(e.kind===`link`){for(let n of L)t.get(e.target)[n]=i[n];return r(e.target)}for(let{type:r,to:a}of e.edges.values()){if(a===void 0)continue;t.get(a).extraneous=!1;let e=_t(i,r);for(let t of[`peer`,`devOptional`,`dev`,`optional`])e[t]&&n(a,t)}return e};return yt(e.get(``),r,(e,t)=>[...t.edges.values()].map(({to:e})=>e).filter(e=>e!==void 0)),t}function xt(e,t,n){for(let r of e.values()){let e=t.get(r);if(e.extraneous)return new b(`nothing installed leads to it, so ${n} takes it as extraneous, and prunes it`,r.where);if(r.kind===`link`)continue;let i={...e,devOptional:e.devOptional&&!e.dev&&!e.optional},a=L.find(e=>r.flags[e]!==i[e]);if(a!==void 0)return new b(`expected ${i[a]?`true`:`none`}, as ${n} sets it from what depends on it`,C(r.where,a))}}var q=[e=>vt(e,!1),e=>vt(e,!0),bt];function St(e){let[t,n,r]=e.split(`.`).map(Number);return t>11||t===11&&n>=18?q[0]:q[t===11&&(n>6||n===6&&r>=3)?1:2]}function Ct(e,t,n=t===void 0?`npm`:`npm ${t}`){let r=xt(e,(t===void 0?q[0]:St(t))(e),n);if(r!==void 0&&(t!==void 0||q.slice(1).every(t=>xt(e,t(e),`npm`)!==void 0)))throw r}var wt=64;function J(e,t){if(typeof e!=`object`||!e)return e;if(t>wt)throw new b(`nested more than ${wt} deep, as npm writes nothing`);if(Array.isArray(e))return e.map(e=>J(e,t+1));let n=Object.create(null);for(let[r,i]of Object.entries(e))n[r]=J(i,t+1);return n}function Tt(e,t){let n=e.split(`
2
+ `),r=t.split(`
3
+ `),i=0;for(;n[i]===r[i];)i++;if(i===r.length-1&&i===n.length)return ue(`expected a line end after the last "}"`,i-1);let a=i<n.length?S(n[i]):`the end of the file`;return ue(`expected ${i<r.length?S(r[i]):`the end of the file`}, as npm writes it, found ${a}`,i)}function Et(e){de(e,`npm`);let[t,n]=fe(e,`npm`),r=x(()=>JSON.parse(e),e=>ce(`not JSON: ${e.message}`)),i=J(r,0),a=`${JSON.stringify(r,null,n)}
4
+ `.replaceAll(`
5
+ `,t);if(a!==e)throw Tt(e,a);return i}var Dt=/^[\dA-Fa-f]{40,64}$/u;function Ot(e){let t=e.resolution?.tarball;return t?.startsWith(`file:`)?a(t.slice(5),`..`):G(e)}var Y=e=>S(e.location);function kt(e,{fetchSpec:t,kind:n},r){if(n===void 0||n===`range`&&t===`*`)return;if(n===`tag`)return e.kind===`link`||!/^https?:/u.test(e.resolution?.tarball??``)?`is a tag, which npm holds met by a tarball from a URL alone, and ${Y(e)} is none`:void 0;let{version:i}=W(e);return r.satisfies(i??``,t,!0)?void 0:`is not satisfied by ${Y(e)}, ${i??`of no version`}`}function At(e,t,n){let{resolution:r,version:i}=e;if(e.kind===`link`||r?.type!==`git`)return`asks for a git repository, and ${Y(e)} is from none`;let a=Ie(`${r.repo}#${r.commit}`),o=Dt.test(t.committish??``);if(!(t.hosted===void 0?a.hosted===void 0&&a.fetchSpec===t.fetchSpec:a.hosted!==void 0&&Ee(t.hosted,o)===Ee(a.hosted,o)))return`asks for another repository than ${Y(e)} is from${o?`, or another commit`:``}`;if(!(t.range===null||n===void 0||n.satisfies(i??``,t.range,!0)))return`asks for a version of the repository ${Y(e)} is not, ${i??`of no version`}`}function jt(e,t,n){switch(t.type){case`registry`:return kt(e,t,n);case`alias`:return kt(e,t.sub,n);case`directory`:return e.kind===`link`&&G(e.target)===t.path?void 0:`asks for a link to ${S(t.path)}, and ${Y(e)} is ${e.kind===`link`?`one to ${S(G(e.target))}`:`no link`}`;case`file`:case`remote`:{let n=t.type===`file`?`file:${t.path}`:t.url;return e.kind!==`link`&&e.resolution?.tarball===n?void 0:`asks for the tarball ${S(n)}, and ${Y(e)} is from another`}default:return At(e,t,n)}}function Mt(e,t){let{name:n}=W(e);if(t.type===`alias`&&n!==t.sub.name)return`asks for ${S(t.sub.name)}, and ${Y(e)} is ${S(n)}, which npm does not check`;let{committish:r}=t;if(t.type===`git`&&Dt.test(r??``)&&r.toLowerCase()!==e.resolution.commit)return`asks for another commit than ${Y(e)} is of, which npm does not check of a repository on no host it knows`}function Nt(e,t,n){let{from:r,to:i,spec:a}=e;if(e.type.startsWith(`peer`)&&i.parent===r&&r.parent!==void 0)return`${S(a)} is met in the node_modules of the package that asks for it, which npm holds a peer not to be`;if(i.folder!==e.name)return`is met by ${Y(i)}, which npm takes for it, though the names are in other cases`;let o=a=>{let o=I(e.name,a,Ot(r),t);return jt(i,o,t)??(n?Mt(i,o):void 0)},s=o(a);if(!(s===void 0||e.accept!==void 0&&o(e.accept)===void 0))return`${S(a)} ${s}, so npm would install another`}function Pt(e,t){return x(()=>Nt(e,t,!1)===void 0,e=>{if(e instanceof b)return!1;throw e})}function Ft(e,t){if(e.type===`peerOptional`)return;let n=ft(e);if(e.to===void 0)throw new b(`${S(e.spec)} is met by nothing where npm looks for ${S(e.name)}, so npm would install it`,n);let r=le(()=>Nt(e,t,!0),n);if(r!==void 0)throw new b(r,n)}function It(e,t){let n=new Set([e.get(``)]);for(let e of n){let r=new Set(e.kind===`package`?e.bundleDependencies:[]);for(let i of e.edges.values()){r.has(i.name)||Ft(i,t);let e=i.to===void 0?void 0:W(i.to);e!==void 0&&!e.location.startsWith(`../`)&&n.add(e)}}}var Lt=[`version`,`resolved`,`integrity`,`bundled`,...L,`requires`,`dependencies`,`from`],X=e=>e.location===``?`the project`:S(e.location);function Rt(e){let[t,n,r]=e.split(`.`).map(Number);return t===9||t===10&&(n<9||n===9&&r<=2)||t===11&&n<2}function zt(e,t){let n=[],r;for(let i of e.edgesIn){let e=i.from.location.split(`node_modules`),a=[e.length,e.at(-1)],o=r===void 0?-1:a[0]-r[0]||a[1].localeCompare(r[1],`en`);o>0||!Pt(i,t)||(o<0?[n,r]=[[i],a]:n.push(i))}return n}function Bt(e,t){let n=s(e,t);return`file:${n===`.`?``:n}`}function Vt(e,t){let n=G(t.from),r=I(e.folder,t.spec,n,void 0),i=`${e.folder}@${t.spec}`;return r.type===`file`?{type:`file`,save:Bt(n,r.path),raw:i}:r.type===`remote`?{type:`remote`,save:r.url,raw:i}:{type:r.type,raw:i}}function Ht(e,t,n){if(e.kind===`link`)return{version:`file:${n(e.target.location)}`};let{resolution:r}=e,i=r?.type===`git`?`${r.repo}#${r.commit}`:r?.tarball,a;r?.type===`git`?a=`git`:i!==void 0&&(a=i.startsWith(`file:`)?`file`:`remote`);let o=t===void 0?{type:a,save:i,raw:i}:Vt(e,t);return o.type===`file`||o.type===`remote`?{version:o.save}:o.type===`git`||a===`git`?{version:i,from:o.raw}:{version:e.name===e.folder?e.version:`npm:${e.name}@${e.version}`,resolved:a===`remote`?i:void 0}}var Ut=e=>[...new Map(e.map(e=>[JSON.stringify(e),e])).values()];function Z(e,t,n,r){if(e===t)return;let i=t===void 0?`none`:typeof t==`string`?S(t):String(t);throw new b(`expected ${i}, found ${f(e)}, as npm writes it of ${X(r)}`,n)}var Q=(e,t,n,r,i)=>Z(e[t],n,C(r,t),i);function Wt(e,t,n,r){let{path:i}=le(()=>I(e.name,e.spec,t,void 0),r);return n(Bt(t,i))}function Gt(e,t,n){if(e.edges.size===0)return;let r=Object.create(null);for(let i of e.edges.values())i.type.startsWith(`peer`)||(r[i.name]=i.spec.startsWith(`file:`)?Wt(i,G(e),t,C(n,i.name)):i.spec);return r}function Kt(e,t,n,r){let i=Gt(t,n,r);if(i===void 0)return Z(e,void 0,r,t);let a=m(e,r);for(let[e,n]of Object.entries(a)){if(!Object.hasOwn(i,e))throw new b(`${X(t)} asks for no such package, or for a peer, which npm leaves out`,C(r,e));if(n!==i[e])throw new b(`expected ${S(i[e])}, as ${X(t)} asks for it, found ${f(n)}, which npm writes there of an override alone, not read here`,C(r,e))}let o=Object.keys(i).find(e=>!Object.hasOwn(a,e));if(o!==void 0)throw new b(`expected ${S(o)}, which ${X(t)} asks for`,r)}function qt(e,t,n,r,i){let a=new Set([...t.children.values()].filter(e=>!r.includes(W(e).location)));if(a.size===0)return Z(e,void 0,n,t);let o=[...r,t.location],s=e===void 0?Object.create(null):m(e,n);for(let[e,r]of Object.entries(s)){let s=t.children.get(e.toLowerCase()),c=`${t.location===``?``:`${t.location}/`}node_modules/${e}`;if(s===void 0||s.folder!==e)throw new b(`${S(c)} is not in packages`,C(n,e));if(!a.has(s))throw new b(`${S(c)} links to ${S(G(W(s)))}, which this is under already, and npm leaves it out`,C(n,e));Xt(r,s,C(n,e),o,i)}let c=a.values().find(e=>!Object.hasOwn(s,e.folder));if(c!==void 0)throw new b(`expected ${S(c.folder)}, as npm writes ${S(c.location)} of packages`,n)}function Jt(e,t,n,r,i){if(t!==void 0&&e===void 0){if(i.resolved!==void 0)throw new b(`expected ${S(t)}: npm leaves it out of every entry or of none, and ${i.resolved} has it`,n);i.omitted??=n;return}if(Z(e,t,n,r),e!==void 0){if(i.omitted!==void 0)throw new b(`expected none: npm leaves it out of every entry or of none, and ${i.omitted} has none`,n);i.resolved??=n}}function Yt(e,t){let{semver:n,escape:r,own:i,root:a}=t;if(!i.has(e)){let t=e.kind===`link`?[]:zt(e,n),o=Ut(t.length===0?[Ht(e,void 0,r)]:t.map(t=>Ht(e,t,r)));i.set(e,{heads:o,bundled:he(e,a)||void 0})}return i.get(e)}function Xt(e,t,n,r,i){m(e,n,Lt);let{heads:a,bundled:o}=Yt(t,i),s=a.find(({version:t,from:n})=>t===e.version&&n===e.from)??a[0];Q(e,`version`,s.version,n,t),Q(e,`from`,s.from,n,t),Jt(e.resolved,s.resolved,C(n,`resolved`),t,i),Q(e,`bundled`,o,n,t),Q(e,`integrity`,t.resolution?.integrity,n,t);for(let r of L)Q(e,r,t.flags?.[r]||void 0,n,t);let c=W(t);Kt(e.requires,c,i.escape,C(n,`requires`)),qt(e.dependencies,c,C(n,`dependencies`),r,i)}function $(e,t,n,r,i={}){let a=e=>e.includes(`#`)?(i.hash=!0,r?e.replaceAll(`#`,`%23`):e):e,o=t.get(``);qt(e,o,`dependencies`,[],{semver:n,escape:a,own:new Map,root:o,omitted:void 0,resolved:void 0})}var Zt=`9.0.0`;function Qt(e,t,n,r){if(r!==void 0)return $(e,t,n,Rt(r));let i={hash:!1};try{$(e,t,n,!1,i)}catch(r){if(!(r instanceof b)||!i.hash)throw r;try{$(e,t,n,!0)}catch{throw r}Ct(t,Zt,`an npm that writes a "#" as "%23"`)}}var $t=[`checkVersions`,`semver`,`legacyPeerDeps`,`npm`],en=[`satisfies`,`valid`,`validRange`],tn=[`name`,`version`,`lockfileVersion`,`requires`,`packages`,...L];function nn(e){let{semver:t,legacyPeerDeps:n=!1,npm:r}=ae(e,$t),i=oe(e,en);if(typeof n!=`boolean`)throw TypeError(`legacyPeerDeps: expected a boolean`);if(r!==void 0&&!(/^\d+\.\d+\.\d+$/u.test(r)&&Number(r.split(`.`)[0])>=9))throw TypeError(`npm: expected a version of npm 9 or later, such as 11.12.1`);if(r===`11.6.1`||r===`11.6.2`)throw TypeError(`npm: ${r} works the flags out in a way not read here`);return{semver:i?t:void 0,legacyPeerDeps:n,npm:r}}function rn(e){let t=m(e,void 0).lockfileVersion;if(t!==2&&t!==3)throw new b(`unsupported version: expected 2 or 3, found ${f(t)}`,`lockfileVersion`);if(m(e,void 0,t===2?[...tn,`dependencies`]:tn),e.requires!==!0)throw p(`true`,e.requires,`requires`);return t}function an(e,t){let n=g(e.name,`name`);if(t.name!==void 0&&t.name!==n)throw new b(`expected the project's, ${S(t.name)}`,`name`);if(e.version!==t.version)throw new b(t.version===void 0?`a version, where the project has none`:`expected the project's, ${S(t.version)}`,`version`);let r=L.find(n=>v(e[n],n)!==t.flags[n]);if(r!==void 0)throw new b(`expected ${t.flags[r]?`true`:`none`}, as the project's in packages`,r);return{name:n,version:t.version}}var on=e=>e.kind===`link`?`link:${G(e.target)}`:e.location;function sn(e){let t=Object.create(null);for(let n of e.edges.values())t[n.name]={type:n.type,spec:n.spec,accept:n.accept,target:n.to===void 0?void 0:on(n.to)};return t}function cn(e){let{name:t,version:n,os:r,cpu:i,libc:a,license:o,funding:s,deprecated:c,hasInstallScript:l,flags:u}=e;return{name:t,version:n,edges:sn(e),bundleDependencies:e.bundleDependencies??[],engines:e.engines??Object.create(null),os:r,cpu:i,libc:a,bin:e.bin??Object.create(null),license:o,funding:s,deprecated:c,hasInstallScript:l,...u,devOptional:u.devOptional||u.dev||u.optional}}function ln(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let{semver:n,legacyPeerDeps:r,npm:i}=nn(t),a=Et(e),o=rn(a),s=lt(a.packages),c=s.get(``),l=ut(s);mt(s,l,r),It(s,n),Ct(s,i),_e(s),o===2&&Qt(a.dependencies,s,n,i);let u=an(a,c),ee=new Set(l.values()),d=Object.create(null),f=Object.create(null),p=Object.create(null);for(let e of new Set([c,...s.values()]))e.kind===`link`?p[e.location]=G(e.target):e.kind===`package`?f[e.location]={...cn(e),resolution:e.resolution,inBundle:e.inBundle}:d[G(e)]={...cn(e),workspace:ee.has(e),workspaces:e.workspaces??[]};return{lockfileVersion:o,...u,importers:d,packages:f,links:p}}export{b as LockfileError,ln as parseNpmLockfile};
@@ -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-L4CTEMRG.js";import{i as d}from"./chunk-4HI2MSAV.js";import"./chunk-PXK7EU4V.js";import{a as f,c as p}from"./chunk-JCIIBLKR.js";import{l as m,p as h,q as g,v as _}from"./chunk-FHIVVVUA.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(typeof e!=`string`)throw TypeError(`a text must be a string, 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 ne=e=>e.replaceAll(/\d/gu,`0`).replaceAll(/[a-z]/gu,`a`).replaceAll(/[A-Z]/gu,`A`);function re(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&&ne(e[1])!==ne(r)}return!1}function ie(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 ae(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 oe({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,ie(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)ae(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&&re(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 se(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 M=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}},ce=new Set([`file`,`contiguous-file`]),le=new Set([`fifo`,`character-device`,`block-device`]),ue=/(?:^|\/)\.{0,2}(?:\/|$)/u;function de(e){if(!Number.isInteger(e)||e<0||e>4095)throw RangeError(`a mode must be an integer from 0 to 0o7777, not ${e}`)}function fe(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===``:ue.test(e))throw new M(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 M(`a name must be well-formed Unicode`,e,n)}}function pe(e,t,n){if(typeof e!=`string`||e===``)throw new M(`a link must name its target`,t,n);if(!e.isWellFormed())throw new M(`a link target must be well-formed Unicode`,t,n);return e}function me(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 N=e=>typeof e==`string`?d(e):e;function he(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(fe(r,i,t,n),a!==void 0&&de(a),ce.has(i))return{path:r,type:`file`,mode:a??420,data:me(s)};if(i===`symlink`||i===`hardlink`)return{path:r,type:i,target:pe(o,r,t)};if(i===`directory`)return{path:r,type:i};throw le.has(i)?new M(`a ${i} is neither a file nor a link`,r,t):TypeError(`${JSON.stringify(i)} is not an entry type`)}function P(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:se(N(e.data),N(t.data)):!1}function ge(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 M(`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 M(`a hard link must name a file or a link in the tree`,e.path,n);return{...i,path:e.path}}function F(e,t,n){let r=new Map;for(let i of e){let e=he(i,t,n);if(e.type!==`directory`||e.path!==`.`){if(r.has(e.path))throw new M(`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 M(`a path lies under a ${n.type===`symlink`?`link`:`file`}`,e,t)}a.type===`hardlink`?i.set(e,ge(a,r,t)):a.type!==`directory`&&i.set(e,a)}return i}var _e=100,ve=4,I=e=>e.slice(e.lastIndexOf(`/`)+1);function L(t,n){if(t.type===`symlink`)return`l${t.target}`;let r=n(t);return`f${r.length}:${e(r)}`}function ye({sources:e,dests:t,sourceNames:n,destNames:r,used:i,record:a,bytes:o}){let s=Map.groupBy(e.keys(),t=>L(e[t],o));for(let c=0;c<t.length;c++){let l=-1,u=_e;for(let a of s.get(L(t[c],o))??[])if(!i.has(a)&&P(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 be=new Map([[`.ts`,`.js`],[`.mts`,`.mjs`],[`.cts`,`.cjs`],[`.tsx`,`.jsx`]]),xe=new Map([...[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.mts`,`.cts`,`.tsx`].map(e=>[e,`script`]),...[`.css`,`.scss`,`.sass`,`.less`].map(e=>[e,`style`])]);function R(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 z(e){let{dirs:t,stem:n,extension:r}=R(e);return JSON.stringify([t.map(e=>e===`lib`||e===`src`?null:e),n,be.get(r)??r])}function Se(e){let{dirs:t,stem:n,extension:r}=R(e),i=[n,xe.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 B=(e,t)=>Math.max(t,e+Math.trunc((6e4-e)/2));function V({pairs:e,used:t,scoreOf:n},{remaining:r,open:i},{s:a,d:o,score:s},c){let l=B(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 Ce(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=>z(i[e].path)),d=t.open.filter(e=>a[e].type===`file`).flatMap(e=>(u.get(z(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&&V(e,t,i,r))&&c(i.d,i.s,i.score)}function we(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=Se(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&&V(e,t,s,r)||c(o,i,s.score)}}function Te(e,t,n){let r=W(e),i=t<6e4&&r.remaining.length*r.open.length<=n*n;Ce(e,r,i,t),we(e,r,i,t)}function H(e,t){let n=new Map;for(let r of t)n.set(e[r],n.has(e[r])?-1:r);return n}function Ee({sourceNames:e,destNames:t,record:n,scoreOf:r},{remaining:i,open:a},o){let s=H(t,a),c=H(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 U=(e,t)=>t.score-e.score||t.nameScore-e.nameScore;function De(e,t){if(e.length<ve){e.push(t);return}let n=0;for(let t=1;t<e.length;t++)U(e[t],e[n])>0&&(n=t);U(e[n],t)>0&&(e[n]=t)}function Oe({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)De(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&&B(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(U)){if(a<c)break;f(a),!n.has(e)&&!r.has(t)&&i(e,t,a)}f(-1/0)}var W=({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()}),G=e=>e+Math.trunc(.5*(6e4-e));function K(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,N(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=>I(e.path)),destNames:t.map(e=>I(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(ye(p),i&&Te(p,n,r),n>=6e4)return a;Ee(p,W(p),G(n));let m=W(p);if(m.remaining.length*m.open.length>r*r)return a;let h=i?oe(p,m,G(n),e=>V(p,m,e,n)):[];return Oe(p,W(p),n,h),a}var ke=50,Ae=1e3;function q(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 je(e){if(e===!1)return null;let t=e===!0?ke: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 Me({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 Ne=(e,t)=>P(e,t)&&(e.type!==`file`||e.mode===t.mode),J=(e,t,n,r=null)=>({status:e,old:t,new:n,similarity:r}),Pe=/\.d\.(?:[^./]+\.)?[cm]?ts$/u,Fe=e=>e.endsWith(`.mts`)?`module`:e.endsWith(`.cts`)?`commonjs`:null,Ie=/^export\s*\{\s*\}\s*;?$/u;function Le(e){if(e===null)return{proven:!0,runtime:``,loads:!1};let n=t(e);try{return n===void 0?{proven:!1}:y(n)}catch{return{proven:!1}}}function Re(e){if(![e.old,e.new].filter(e=>e!==null).every(e=>e.type===`file`&&Pe.test(e.path))||e.old&&e.new&&e.old.mode!==e.new.mode)return e;let t=Le(e.new),n=Le(e.old);return!n.proven||!t.proven||n.runtime!==t.runtime&&!(e.old===null&&Ie.test(t.runtime))||n.loads&&e.old&&e.new&&e.old.path!==e.new.path&&Fe(e.old.path)!==Fe(e.new.path)?e:{...e,typeOnly:!0}}function ze(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?Ne(a,e)||r.push(J(`modified`,a,e)):r.push(J(`type-changed`,a,e))}for(let[r,i]of t)e.has(r)||n.push(i);return i.sort((e,t)=>q(e.path,t.path)),n.sort((e,t)=>q(e.path,t.path)),{changes:r,deleted:i,added:n}}function Be(e,t,{group:n,...r}){if(n===null)return K(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 K(a.map(t=>e[t]),s.map(e=>t[e]),r))i.set(s[n],{source:a[o],score:c})}return i}function Ve(e,t,{renames:i=!0,renamesByPath:a=!0,renameLimit:o=Ae,renameGroup:s=null,paths:c=`tree`,lines:l=!0,horizon:u,whitespace:d,ignoreCase:f}={}){let p=je(i);Me({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}=ze(F(e,`old`,h),F(t,`new`,h)),y=p===null?new Map:Be(_,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?J(`added`,null,t):J(`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(J(`deleted`,t,null));return g.sort((e,t)=>q((e.new??e.old).path,(t.new??t.old).path)),(l?g.map(e=>({...e,...r(e.old,e.new,m)})):g).map(Re)}function Y(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 He(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))t.has(r.slice(e+1))&&n.set(r.slice(0,e+1),(n.get(r.slice(0,e+1))??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=Y(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,...Y(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 Ue(e,t){let n=[...e],r=new Set(t),i=He(n,r);return{root:i,paths:Y(n,r,i).paths}}function We(e,t,n){if(!e&&!t)return null;let r=Map.groupBy([...e??[]],([,e])=>e),i=new Map([...r].map(([e,t])=>[e,o(n,e,t.map(([t])=>t.slice(e.length+1)))]));return new Map([...[...e??[]].map(([e,t])=>[n.paths.get(e)??e,i.get(t)]),...t??[]])}function Ge(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 X(e){return m(e)??0}function Ke(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 Z(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 qe(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 Q(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=Ve(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=Ue(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=qe(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=Ke(r,i),u=l(s.get(n),n),d=X(r),h=o?d:X(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=X(e.get(n));p+=t,h+=t,a.baseBytes+=t,a.onlyBaseFiles++,u.push({path:n,...c(n),bytes:t})}else{let e=X(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=Ke(i,a),c=X(i),u=o?c:X(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(Q(`path`)),C.sort($(`pkg`)),w.sort($(`pkg`)),T.sort(Q(`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=Ue(l.keys(),d.keys()),y=We(h(r),h(i),m),b=$e(l,d,e=>v(e,{packageDir:y?.get(e)}),m,[Z(r),Z(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=Ge(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};
@@ -0,0 +1 @@
1
+ import{e}from"./chunk-ZQHLECTI.js";import{d as t,f as n,h as r,i}from"./chunk-JMG5DXII.js";var a=Object.freeze(Object.create(null));function o(e){return e===void 0?`nothing`:e===null?`null`:Array.isArray(e)?`a sequence`:typeof e==`object`?`a mapping`:typeof e==`string`?`the string ${r(e)}`:`the ${typeof e} ${String(e)}`}function s(e,n,a,o,s){let c=(n,r,i)=>new t(`expected ${n}, found ${e(r)}`,i),l=(e,t)=>(n,r)=>{if(!e(n))throw c(t,n,r);return n},u=(e,s,l,u={})=>{if(!n(e))throw c(a,e,s);for(let n of l===void 0?[]:Object.keys(e)){if(Object.hasOwn(u,n))throw new t(u[n],i(s??``,n));if(!l.includes(n))throw new t(`unsupported ${o} ${r(n)}`,s)}return e};return{refuse:c,record:u,entries:(e,t)=>Object.entries(u(e,t)).map(([e,n])=>[e,n,i(t,e)]),sequence:l(Array.isArray,s),string:l(e=>typeof e==`string`,`a string`),boolean:l(e=>typeof e==`boolean`,`true or false`),count:l(e=>Number.isSafeInteger(e)&&e>=0,`a non-negative integer`)}}var c=e=>typeof e==`object`&&!!e&&!Array.isArray(e),{refuse:l,record:u,entries:d,sequence:f,string:p,boolean:m,count:h}=s(o,c,`a mapping`,`field`,`a sequence`),g=e=>e===void 0?a:e,ee=e=>(t,n)=>t===void 0?void 0:e(t,n),_=(e,t,n,r)=>e[t]===void 0?void 0:r(e[t],i(n,t));function v(e,n){if(p(e,n)===``)throw new t(`expected a non-empty string`,n);return e}function y(e,t,n=e=>e){return f(e,t).map((e,r)=>n(v(e,`${t}[${r}]`),`${t}[${r}]`))}function b(e,t,n,r=d){let i=Object.create(null);for(let[a,o,s]of r(e,t))i[a]=n(o,s,a);return i}var x=(e,t,n=()=>{})=>b(e,t,(e,t,r)=>(n(r,t),p(e,t)));function S(e,t){if(e!==void 0&&e!==!0)throw l(`true`,e,t);return e===!0}var C=e=>(n,i)=>(a,o)=>{let s=e(a,o);if(!n(s))throw new t(`${r(s)} is not ${i}`,o);return s};function w(e,t=e=>e){let n=new Set;return e.find(e=>n.size===n.add(t(e)).size)}function T(e,t){if(!c(e))throw TypeError(`expected an options object`);let n=Object.keys(e).find(e=>!t.includes(e));if(n!==void 0)throw TypeError(`unknown option ${r(n)}, of ${t.join(`, `)}`);return e}function te({checkVersions:e=!0,semver:t},n){if(typeof e!=`boolean`)throw TypeError(`checkVersions: expected a boolean`);if(t!==void 0&&!n.every(e=>typeof t?.[e]==`function`))throw TypeError(`semver: expected the semver package, with ${n.join(`, `)}`);if(e&&t===void 0)throw TypeError(`checkVersions needs semver: pass it as semver, or set checkVersions to false`);return e}var E=C(v),ne=/^(?:@[\dA-Za-z~-][\w.~-]*\/)?[\dA-Za-z~-][\w.~-]*$/u,D=e=>e.length<=214&&ne.test(e);function O(e,n){if(!D(e))throw new t(`${r(e)} is not a package name`,n);return e}var k=`(0|[1-9]\\d*)`,A=`(?:0|[1-9]\\d*|\\d*[A-Za-z-][\\dA-Za-z-]*)`,j=RegExp(`^${k}\\.${k}\\.${k}(?:-${A}(?:\\.${A})*)?(?:\\+[\\dA-Za-z-]+(?:\\.[\\dA-Za-z-]+)*)?$`,`u`);function M(e){if(e.length>256)return!1;let t=j.exec(e);return t!==null&&t.slice(1,4).every(e=>Number(e)<=2**53-1)}var N=E(M,`a version`),P=/[\p{Cc}\p{Zl}\p{Zp}\p{Bidi_Control}\\]/u,F=e=>e!==``&&e!==`.`&&e!==`..`&&!P.test(e),I=e=>!/^[A-Za-z]:/u.test(e)&&e.split(`/`).every(F);function L(e,n){let i=v(e,n);if(i===`.`)return i;let a=!0;for(let e of i.split(`/`))if(!(e===`..`&&a)&&(a=!1,!F(e)))throw new t(`${r(i)} is not a relative path in normal form`,n);if(/^[A-Za-z]:/u.test(i))throw new t(`${r(i)} starts with a drive letter`,n);return i}function R(e,n){let i=L(e,n);if(i===`..`||i.startsWith(`../`))throw new t(`${r(i)} climbs out of the directory it is in`,n);return i}function z(e,t){let n=e===`.`?[]:e.split(`/`);for(let e of t===`.`?[]:t.split(`/`))e===`..`&&n.length>0&&n.at(-1)!==`..`?n.pop():n.push(e);return n.length===0?`.`:n.join(`/`)}var B=(e,t)=>z(e,t.split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`)||`.`);function V(e,t){let n=e===`.`?[]:e.split(`/`),r=t===`.`?[]:t.split(`/`),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return[...n.slice(i).map(()=>`..`),...r.slice(i)].join(`/`)||`.`}var H=e=>/^(?:[\da-f]{40}|[\da-f]{64})$/u.test(e),re=e=>/^[\da-f]{64}$/u.test(e),U=e=>/^[\da-f]{40}$/u.test(e),W=/^$|^@$|^-|[\p{Cc}\p{Zl}\p{Zp}\p{Bidi_Control} ~^:?*[\\]|\.\.|@\{|^\/|\/$|\/\/|(?:^|\/)\.|\.lock(?:\/|$)|\.$/u,G=E(e=>!W.test(e),`a branch or tag name git takes`),K=/^(?:[^/:]*:\/\/)?(?:[^/@]*@)?-/u,q=/^[\dA-Za-z][\d+.A-Za-z-]*::/u,J=e=>e.replace(/%([\dA-Fa-f]{2})/gu,(e,t)=>String.fromCodePoint(Number.parseInt(t,16)));function Y(e,n){let i=v(e,n);if(K.test(i)||K.test(J(i)))throw new t(`${r(i)} has a "-" where git or ssh would read an option`,n);if(q.test(i))throw new t(`${r(i)} names a remote helper of git's, which is not supported`,n);return i}function X(e,n){if(/[\s\p{Cc}]/u.test(v(e,n)))throw new t(`${r(e)} is not a repository URL`,n);return Y(e,n)}var ie={__proto__:null,sha1:20,sha256:32,sha384:48,sha512:64},ae=t=>n(()=>e(t,{padding:!0}).length,()=>{});function Z(e,n){let i=v(e,n),a=i.indexOf(`-`),o=a===-1?void 0:ie[i.slice(0,a)];if(o===void 0||ae(i.slice(a+1))!==o)throw new t(`${r(e)} is not a sha1, sha256, sha384 or sha512 integrity`,n);return e}function oe(e,n){let r=new Map;for(let i of v(e,n).split(` `)){let e=Z(i,n).slice(0,i.indexOf(`-`));if(r.has(e))throw new t(`two ${e} integrities`,n);r.set(e,i)}return r}var se=/^(?:https?|ssh|git|git\+ssh|ssh\+git):\/\/[^/]/u,Q=/^(?:[^@/:\\]+@)?(?:\[[^\]/\\]+\]|[^@/:\\[\]]+):(?!:|\/\/)/u;function ce(e,n,i){if(/^[^[]:(?!:)/u.test(e))throw new t(`${r(e)} is a path on a drive to ${i} on Windows, and a host's to git elsewhere`,n);if(se.test(e)?!URL.canParse(e):!Q.test(e)||e.includes(`\\`))throw new t(`${r(e)} is not a URL of a host that git fetches from: http(s), ssh, git, or user@host:path`,n);return e}var $=e=>/^https?:\/\//u.test(e)&&!/[\s\p{Cc}]/u.test(e)&&URL.canParse(e),le=e=>$(e.replace(/^https?:/iu,e=>e.toLowerCase())),ue=new Set([`registry.npmjs.org`,`registry.npmjs.com`,`registry.yarnpkg.com`]);function de(e,n,i,a){let o=new URL(e),s=o.hostname.replace(/(?<!\.)\.+$/u,``);if(ue.has(s)&&o.pathname.replace(/^(\/@[^/]+)%2f/iu,`$1/`)!==`/${n}/-/${n.slice(n.indexOf(`/`)+1)}-${i}.tgz`)throw new t(`${r(e)} is not the registry's tarball of ${n}@${i}`,a)}export{o as a,s as b,c,l as d,u as e,d as f,f as g,p as h,m as i,h as j,g as k,ee as l,_ as m,v as n,y as o,b as p,x as q,S as r,C as s,w as t,T as u,te as v,D as w,O as x,M as y,N as z,F as A,I as B,L as C,R as D,z as E,B as F,V as G,H,re as I,U as J,G as K,Y as L,X as M,Z as N,oe as O,ce as P,$ as Q,le as R,de as S};