@preventive/triage 1.0.0-alpha.53 → 1.0.0-alpha.55

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 (114) 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 +1 -1
  9. package/common/managed/finding-detail.js +7 -7
  10. package/common/managed/routes.js +6 -2
  11. package/common/managed/team-app.d.ts +7 -0
  12. package/common/managed/team-app.js +31 -7
  13. package/common/managed/team-filters.js +26 -0
  14. package/common/workspace-app.js +19 -7
  15. package/out/activity.js +4 -4
  16. package/out/{chunk-NE2UGKRJ.js → chunk-3TFOB75M.js} +4 -3
  17. package/out/chunk-4EMM6UCD.js +1 -0
  18. package/out/chunk-4ISO5F7Y.js +7 -0
  19. package/out/chunk-4XIH7YTX.js +1 -0
  20. package/out/chunk-5PKS6FVK.js +2 -0
  21. package/out/chunk-6GAPL5ZA.js +42 -0
  22. package/out/chunk-6W5BMATD.js +1 -0
  23. package/out/{chunk-WFYLMF6Z.js → chunk-74AEKRES.js} +1 -1
  24. package/out/{chunk-YA4ETCFU.js → chunk-ATTKQVZH.js} +1 -1
  25. package/out/chunk-CGKPGHST.js +6 -0
  26. package/out/chunk-DEVAORP2.js +1 -0
  27. package/out/chunk-E3LFSUDJ.js +9 -0
  28. package/out/chunk-G3LY2FV4.js +1 -0
  29. package/out/chunk-HAZKDK4M.js +4 -0
  30. package/out/chunk-HOB3YPS5.js +1 -0
  31. package/out/{chunk-2K6UN3PC.js → chunk-IZ6MYRYB.js} +1 -1
  32. package/out/{chunk-KOGNQDSJ.js → chunk-J2FWBXFV.js} +1 -1
  33. package/out/{chunk-MYGJBYYJ.js → chunk-J4CLTPOR.js} +1 -1
  34. package/out/chunk-JFL7WLRV.js +1 -0
  35. package/out/chunk-JMG5DXII.js +2 -0
  36. package/out/chunk-JOXLZXMI.js +1 -0
  37. package/out/chunk-M37X4LCF.js +14 -0
  38. package/out/chunk-M3Y6SLC4.js +1 -0
  39. package/out/chunk-NXATZJQ2.js +1 -0
  40. package/out/chunk-PAD2JHZT.js +1 -0
  41. package/out/chunk-PKQBEPZU.js +244 -0
  42. package/out/chunk-PTFQKLKO.js +1 -0
  43. package/out/chunk-QMVOEBWC.js +13 -0
  44. package/out/{chunk-SXV2T5C4.js → chunk-QRKFPLA4.js} +1 -1
  45. package/out/chunk-RRBIJL2B.js +1 -0
  46. package/out/{chunk-GDPCLSOS.js → chunk-SYXT3SFP.js} +1 -1
  47. package/out/chunk-TOXMUOIW.js +5 -0
  48. package/out/chunk-UCP3JRE2.js +1 -0
  49. package/out/chunk-VRX2APNA.js +9 -0
  50. package/out/chunk-WMFDQS2L.js +11 -0
  51. package/out/chunk-WREU7JAG.js +1 -0
  52. package/out/chunk-WST3LUUL.js +1 -0
  53. package/out/{chunk-JEFZTVNX.js → chunk-X655SAHV.js} +1 -1
  54. package/out/chunk-Y5ZHFNBD.js +2 -0
  55. package/out/chunk-YF4M5OCI.js +1 -0
  56. package/out/chunk-Z667U2UJ.js +1 -0
  57. package/out/chunk-ZFXCWNXC.js +52 -0
  58. package/out/chunk-ZQHLECTI.js +1 -0
  59. package/out/client-managed-import.js +1 -1
  60. package/out/client-managed.js +27 -26
  61. package/out/compare.js +14 -14
  62. package/out/dialogs.js +36 -51
  63. package/out/graph.js +17 -15
  64. package/out/index.html +28 -12
  65. package/out/prism.js +1 -1
  66. package/out/scan.js +2 -2
  67. package/out/terminal.js +232 -232
  68. package/out/view.css +1 -1
  69. package/out/view.js +15 -15
  70. package/package.json +12 -7
  71. package/risk/actions/resolve.js +36 -5
  72. package/risk/index.d.ts +20 -2
  73. package/risk/npm/malware.js +6 -4
  74. package/risk/npm/registry.js +8 -6
  75. package/server-managed/bundle-advisories.ts +56 -74
  76. package/server-managed/bundle-build-worker.js +85 -21
  77. package/server-managed/bundle-build.ts +13 -4
  78. package/server-managed/bundle-dependency-reviews.ts +74 -0
  79. package/server-managed/bundle-validation.ts +32 -0
  80. package/server-managed/db-methods.ts +51 -16
  81. package/server-managed/db-neon.ts +18 -2
  82. package/server-managed/db.ts +11 -2
  83. package/server-managed/github-issue-links.ts +151 -47
  84. package/server-managed/github-pulls.ts +34 -15
  85. package/server-managed/http.ts +227 -12
  86. package/server-managed/index.ts +13 -1
  87. package/server-managed/managed-issues.ts +29 -15
  88. package/server-managed/npm-insights.ts +4 -3
  89. package/server-managed/npm-kept.ts +4 -0
  90. package/server-managed/package-entry-points.ts +37 -9
  91. package/server-managed/pretty-print.ts +7 -5
  92. package/server-managed/public-workspace.ts +2 -2
  93. package/server-managed/repository-actions.ts +7 -4
  94. package/server-managed/repository-browser.ts +11 -4
  95. package/server-managed/repository-risk-audit.ts +4 -5
  96. package/server-managed/repository-risk.ts +4 -4
  97. package/server-managed/sql.ts +2 -1
  98. package/server-managed/stasis-config.ts +55 -0
  99. package/server-managed/team-app-summaries.ts +54 -0
  100. package/server-managed/team-app.ts +52 -31
  101. package/server-managed/team-reports.ts +27 -7
  102. package/server-managed/upstream-cache.ts +41 -32
  103. package/server-managed/workspace-shares.ts +3 -1
  104. package/out/chunk-2ZDZWLFY.js +0 -1
  105. package/out/chunk-7VAWINQF.js +0 -6
  106. package/out/chunk-FMXWXDR4.js +0 -36
  107. package/out/chunk-HT2SSA3V.js +0 -1
  108. package/out/chunk-IZ7POWI3.js +0 -18
  109. package/out/chunk-LJ7XRXFU.js +0 -52
  110. package/out/chunk-QB4CBOX2.js +0 -1
  111. package/out/chunk-TQJDYHVE.js +0 -2
  112. package/out/chunk-TSIFIFBX.js +0 -232
  113. package/out/chunk-VH4XMZIW.js +0 -2
  114. package/out/chunk-WYLQWYLA.js +0 -1
@@ -0,0 +1,6 @@
1
+ import{a as e}from"./chunk-QRKFPLA4.js";import{b as t}from"./chunk-TUII34K2.js";var n=new Set([`module`,`commonjs`,`json`,`module-typescript`,`commonjs-typescript`]),r=new Set([`solidity`,`php`,`shell`,`rust`,`teal`]),i=new Set([`java`,`kotlin`,`gradle`,`objc`,`objcpp`,`swift`,`c`,`cpp`,`c-header`,`cpp-header`,`ruby`,`python`,`cmake`,`podspec`,`podfile`,`podfile-lock`,`template`,`xml`,`env`,`fastlane`,`pbxproj`]),a=new Set([`resource`,`resource:base64`]),o=new Set([`stat:file`,`stat:directory`]),s=new Set([...n,...r,...i,...a,`patch`,`directory`,...o]),c=e=>o.has(e),l=e=>e===`directory`||e===`stat:directory`?`directory`:`file`;function u(e,t,n){if(e===t)return e;let r=c(e);if(r!==c(t)&&l(e)===l(t))return r?t:e;throw Error(`format conflict for '${n}' ('${t}' vs '${e}')`)}var d=(e,t)=>t===``?e:e===`.`?t:`${e}/${t}`,f=/^(?=[A-Za-z0-9-]{1,39}\/)[A-Za-z0-9](?:-?[A-Za-z0-9])*\/(?!\.\.?$)[\w.-]{1,100}$/u,p=/^(?!\.\.?(?:\/|$))[\w.~@+-]+(?:\/(?!\.\.?(?:\/|$))[\w.~@+-]+)*$/u,m=/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u,h={github:e=>typeof e==`string`&&f.test(e),directory:e=>typeof e==`string`&&e.length<=1024&&(e===``||p.test(e)),commit:e=>typeof e==`string`&&m.test(e)},ee=(e,t)=>e?.toLowerCase()===t?.toLowerCase(),g=(e,t,n)=>{if(e===void 0)return;T(e)||S(!1,`${n} must be an object`);for(let r of Object.keys(e))Object.hasOwn(t,r)||S(!1,`unknown ${n} key '${r}'`);let r=Object.entries(t).map(([t,r])=>typeof r==`object`?[t,g(e[t],r,`${n}.${t}`)]:(e[t]!==void 0&&!r(e[t])&&S(!1,`invalid ${n}.${t}: ${JSON.stringify(e[t])}`),[t,e[t]])).filter(([,e])=>e!==void 0);return r.length===0?void 0:Object.freeze(E(r))},te=(e,t=`bundle repo`)=>g(e,h,t),_=(e,t)=>t??(j(e)?`npm`:void 0),ne=(e,t,n,r,i)=>(a,{ecosystem:o,[e]:s},c)=>{if(s===void 0)return;r(a,o)||S(!1,`${c}: '${a}' is no ${i} bucket, and carries no ${e}`);let l=g(s,t,`${c} module '${a}' ${e}`);return l?.[n]===void 0&&S(!1,`${c} module '${a}' ${e} has no ${n}`),l},re=ne(`repo`,h,`github`,(e,t)=>_(e,t)!==void 0,`dependency's`),ie={sha1:/^sha1-[A-Za-z\d+/]{27}=$/u,sha256:/^sha256-[A-Za-z\d+/]{43}=$/u,sha512:/^sha512-[A-Za-z\d+/]{86}==$/u},ae={integrity:e=>typeof e==`string`&&ie.sha256.test(e)},oe=(e,t)=>j(e)&&_(e,t)===`npm`,se={npm:`sha512`,cargo:`sha256`,composer:`sha1`,soldeer:`sha256`},ce=(e,{ecosystem:t,integrity:n},r)=>{if(n===void 0)return;let i=_(e,t);return(!Object.hasOwn(se,i)||i===`npm`&&!j(e))&&S(!1,`${r}: '${e}' is no npm, cargo, composer or soldeer dependency's bucket, and carries no integrity`),(typeof n!=`string`||!ie[se[i]].test(n))&&S(!1,`invalid ${r} module '${e}' integrity: ${JSON.stringify(n)}`),n},le=ne(`patch`,ae,`integrity`,oe,`npm dependency's`),ue=e=>typeof e==`string`&&/^[\w.+@/~'!()*-]+$/u.test(e),v={name:ue,version:ue},de=e=>typeof e==`string`&&e!==``&&!e.includes(`\\`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`),fe=(e,t,n)=>typeof e==`string`&&de(n)&&e===`${t}/${n}`,pe={vendored:()=>!0,subpackages:(e,t,n)=>fe(e.name,t,n)},me=(e,t)=>{for(let n=t.lastIndexOf(`/`);n>0;n=t.lastIndexOf(`/`,n-1))if(Object.hasOwn(e,t.slice(0,n)))return t.slice(0,n)};function he(e,t){if(e===void 0)return;let n=new Set(Object.keys(t).map(t=>me(e,t)).filter(e=>e!==void 0));return n.size===0?void 0:Object.freeze(E(C(n).map(t=>[t,e[t]])))}var ge=(e,t,{name:n,ecosystem:r,files:i,[e]:a},o)=>{if(a===void 0)return;_(t,r)===void 0&&S(!1,`${o}: '${t}' is no dependency's bucket, and carries no ${e}`),T(a)||S(!1,`${o} module '${t}' ${e} must be an object`);let s=E(Object.entries(a).map(([r,i])=>{de(r)||S(!1,`${o} module '${t}' ${e}: invalid directory ${JSON.stringify(r)}`);let a=g(i,v,`${o} module '${t}' ${e} '${r}'`);return a?.name===void 0&&S(!1,`${o} module '${t}' ${e} '${r}' has no name`),pe[e](a,n,r)||S(!1,`${o} module '${t}' ${e} '${r}' is named '${a.name}', not '${n}/${r}'`),[r,a]})),c=he(s,i),l=Object.keys(s).find(e=>!Object.hasOwn(c??{},e));return l!==void 0&&S(!1,`${o} module '${t}' ${e} '${l}' holds none of its files`),c},y={integrity:ce,repo:re,patch:le},_e=Object.keys(pe),b=[...Object.keys(y),..._e],ve=[`ecosystem`,...b],x=e=>{let t={name:e.name,version:e.version};for(let n of ve)e[n]!==void 0&&(t[n]=e[n]);return t.files=e.files,t},ye=[`integrity`,`patch`],be=(e,t)=>e[t]??(t===`patch`&&e.integrity!==void 0?null:void 0),xe=(e,t,n,r)=>{let[i,a]=[t[e],n[e]].map(e=>JSON.stringify(e)??`none`);i!==a&&S(!1,`${r} ${e} mismatch (${i} vs ${a})`)};function Se(e,t,n=`module`){let r;for(let i of Object.keys(y))ye.includes(i)&&be(e,i)!==void 0&&be(t,i)!==void 0?xe(i,e,t,n):e[i]===void 0&&t[i]!==void 0&&((r??={})[i]=t[i]);for(let n of _e)t[n]===void 0||Object.keys(t[n]).every(t=>Object.hasOwn(e[n]??{},t))||((r??={})[n]=Object.freeze(E([...Object.entries(t[n]),...Object.entries(e[n]??{})])));return r===void 0?e:x({...e,...r})}function Ce(e,t,n,r,i){let a={};for(let[i,o]of Object.entries(y))a[i]=r.includes(i)?o(e,t,n):void 0;for(let o of _e)a[o]=r.includes(o)?ge(o,e,{...t,[o]:i(o)},n):void 0;return a}function we(e,t,n,r=b){let{name:i,version:a,ecosystem:o}=e;S(o===void 0||typeof o==`string`),T(e.files)||S(!1,`${n}: module '${t}' files must be an object`);let s=E(Object.entries(e.files));return x({name:i,version:a??void 0,ecosystem:o,...Ce(t,{...e,files:s},n,r,t=>e[t]),files:s})}function Te(e,{scope:t=`full`}={}){let n=new Set;for(let[r,{files:i}]of e)if(t===`full`||j(r))for(let e of Object.keys(i))n.add(d(r,e));return n}function Ee(e,{what:t,files:n,formats:r,scope:i}){if(e.includes(`\\`))return`holds a '\\'`;if(O(e))return`escapes the root`;if(i!==`full`&&!j(e))return`is outside node_modules, which a '${i}'-scope ${t} does not record`;if(!n.has(e))return`names no file the ${t} records`;let a=r.get(e);return a===`directory`?`is a directory capture, not a file`:c(a)?`is a payload-free '${a}' record, not a file`:null}function De(e,{what:t,files:n,formats:r,scope:i}){for(let a of e){let e=Ee(a,{what:t,files:n,formats:r,scope:i});S(e===null,`${t}: executable entry '${a}' ${e}`)}}function Oe(e,t,n,r){S(Array.isArray(e),`${t} must be an array of file paths`);let i=new Set;for(let t of e)r(t),S(!i.has(t),`${n} '${t}' is listed twice`),i.add(t);return i}function ke(e,{what:t,files:n,formats:r,scope:i=`full`}){if(e===void 0)return new Set;let a=`${t}: executable entry`,o=Oe(e,`${t}: executable`,a,e=>S(typeof e==`string`&&e!==``,`${a} must be a non-empty string`));return De(o,{what:t,files:n,formats:r,scope:i}),o}function Ae(e,{what:t,modules:n,formats:r,scope:i}){if(e.size!==0)return De(e,{what:t,files:Te(n,{scope:i}),formats:r,scope:i}),D(e)}function S(e,t){if(!e)throw Error(t)}var je=`stasis.lock.json`,Me=new Set([`node_modules`,`full`]),Ne=(e,t)=>S(Me.has(e),`${t} scope must be node_modules or full, got ${JSON.stringify(e)}`),Pe=e=>e.slice(e.lastIndexOf(`/`)+1).toLowerCase()===je;function Fe(e,t){let n=0;for(;n<e.length&&e[n]===t[n];)n++;let r=e.length-n,i=t.length-n;if(r===0&&i===0)return 0;if(r<2)return i<2&&(e[n]??``)>(t[n]??``)?1:-1;if(i<2)return 1;if(e[n]===`*`)return-1;if(t[n]===`*`||e[n]===`node_modules`)return 1;if(t[n]===`node_modules`)return-1;let a=e.slice(n).join(`\0`),o=t.slice(n).join(`\0`);if(a<o)return-1;if(a>o)return 1;throw Error(`Unreachable`)}var C=(e,t=e=>e)=>Array.from(e,e=>({item:e,segments:t(e).split(`/`)})).toSorted((e,t)=>Fe(e.segments,t.segments)).map(({item:e})=>e),w=([e])=>e;function T(e){if(!e)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var E=e=>Object.setPrototypeOf(Object.fromEntries(e),null),D=e=>C(e),Ie=(e,{sorted:t=!0}={})=>E((t?C(e,w):[...e]).map(([e,n])=>[e,n instanceof Map?Ie(n,{sorted:t}):n]));function Le(e,t,n){let r=e.get(t);return r===void 0&&e.set(t,r=n()),r}var Re=(e,t)=>Le(e,t,()=>new Map),ze=e=>new Map(Object.entries(e).map(([e,t])=>[e,T(t)?ze(t):t]));function O(e){if(e.startsWith(`/`))return!0;if(!e.includes(`..`))return!1;let t=0;for(let n of e.split(`/`))if(n!==`.`&&n!==``){if(n!==`..`)t++;else if(--t<0)return!0}return!1}var Be=e=>e.includes(`\\`)||O(e),k=(e,t)=>S(!Be(e),`${t}: path '${e}' escapes the root or holds a '\\'`),Ve=e=>typeof e==`string`&&e!==``&&!Be(e),He=(e,t)=>S(Ve(e),`${t}: invalid entry ${JSON.stringify(e)}`),Ue=(e,t)=>Oe(e,`${t}: entries`,`${t}: entry`,e=>He(e,t));function We(e,t){for(let n of e)He(n,t);return D(e)}function Ge(e,t){k(e,`formats`),S(s.has(t),`unknown format '${t}' for ${e}`)}function Ke(e){S(T(e));let t=new Map;for(let[n,r]of Object.entries(e)){Ge(n,r);let e=n===``?`.`:n;S(!t.has(e),`duplicate format key '${e}'`),t.set(e,r)}return t}function qe(e,t,n){for(let[r,i]of e)c(i)&&t.has(r)&&S(!1,`${n}: '${r}' is a payload-free '${i}' record, yet carries content`)}function Je(e){for(let[t,n]of e)Ge(t,n);return Ie(e)}function Ye(e){for(let[,t]of e){S(t instanceof Map);for(let[e,n]of t){k(e,`imports`),S(n instanceof Map);for(let[,e]of n){if(typeof e==`string`){k(e,`imports`);continue}S(e instanceof Map&&e.size>0,`import target must be a file or a non-empty {platform: file} map`);for(let[t,n]of e)S(typeof t==`string`&&t.length>0&&!t.includes(`/`),`invalid platform key '${t}'`),S(typeof n==`string`),k(n,`imports`)}}}}function Xe(e){S(T(e));let t=ze(e);return Ye(t),t}function Ze(e){return Ye(e),Ie(e)}function Qe(e,{skipEmpty:t=!1,metadata:n=!0,what:r}={}){let i=n===!0?b:n===!1?[]:n,a={modules:[],sources:[]};for(let[n,o]of e){if(t&&Object.keys(o.files).length===0)continue;let e=j(n);e&&S(o.name&&o.version&&o.files);let s=E(C(Object.entries(o.files),w));a[e?`modules`:`sources`].push([n,x({...o,...Ce(n,{...o,files:s},r,i,e=>he(o[e],s)),files:s})])}return{modules:E(C(a.modules,w)),sources:E(C(a.sources,w))}}function $e(e,t,n){let r=new Map;for(let i of e.config.scope===`full`?[`modules`,`sources`]:[`modules`]){if(i===`modules`&&e.modules===void 0)continue;S(T(e[i]),`${t}: ${i} must be an object`);let a=i===`modules`;for(let[o,s]of Object.entries(e[i]))S(j(o)===a),k(o,t),S(s?.name&&(s.version||!a)&&s.files),r.set(o,we(s,o,t,n))}return r}function et({config:{scope:e},entries:t,modules:n,formats:r,imports:i,executable:a},o,s){let c=e===`full`,l=Qe(n,{...s,what:o});return{entries:c?We(t,o):void 0,sources:c?l.sources:void 0,modules:l.modules,formats:r===null?void 0:Je(r),imports:i===null?void 0:Ze(i),executable:Ae(a,{what:o,modules:n,formats:r??new Map,scope:e})}}function tt(e,t){return!(e instanceof Map)||!(t instanceof Map)?e===t:e.size===t.size&&e.entries().every(([e,n])=>t.get(e)===n)}var nt=e=>e instanceof Map?`{${[...e].map(([e,t])=>`${e}: ${t}`).join(`, `)}}`:e;function rt(e,t,n){let r=new Map;for(let i of[e,t])for(let[e,t]of i){let i=Re(r,e);for(let[e,r]of t){let t=Re(i,e);for(let[i,a]of r)t.has(i)?S(tt(t.get(i),a),`${n}: import '${i}' from '${e}' resolves differently ('${nt(t.get(i))}' vs '${nt(a)}')`):t.set(i,a instanceof Map?new Map(a):a)}}return r}function it(e,t,n){let r=e.get(t);e.set(t,r===void 0?n:u(n,r,t))}function at(e,t,n){let r=new Map;try{for(let n of[e,t])for(let[e,t]of n)it(r,e,t)}catch(e){throw Error(`${n}: ${e.message}`,{cause:e})}return r}var ot=(e,t,n,r)=>e.size===0?new Set(t):new Set(t).union(e.difference(Te(n,{scope:r}))),st=/(?:^|\/)\.{0,2}(?:\/|$)/u;function A(e,t,n){let r=d(e,t);return(r!==`.`||t!==``)&&st.test(r)&&S(!1,`${n}: non-canonical file key ${JSON.stringify(r)}`),r.includes(`\\`)&&S(!1,`${n}: file key '${r}' holds a '\\', which no path may`),r}function ct(e,t,n){let r=new Map;for(let[i,{files:a}]of e){typeof i!=`string`&&S(!1,`${t}: bucket dir ${String(i)} is not a string`),k(i,t);for(let e of Object.keys(a)){let a=A(i,e,t),o=r.get(a);o!==void 0&&n(a,o,i),r.set(a,i)}}return r}var lt=(e,t)=>n=>S(!1,`duplicate file key '${n}' across ${e} buckets -- module bucketing changed between writes (a workspace package without a version now owns its own bucket); regenerate the ${t}`);function ut(e,t,n,{held:r=!1}={}){let i=new Map;for(let a of[e,t])for(let[e,t]of a){let a=i.get(e);if(a===void 0){i.set(e,x({...t,files:Object.assign(Object.create(null),t.files)}));continue}S(a.name===t.name,`${n}: module '${e}' name mismatch ('${a.name}' vs '${t.name}')`),S(a.version===t.version,`${n}: module '${e}' version mismatch ('${a.version}' vs '${t.version}')`+(a.version==null==(t.version==null)?``:` -- an artifact from an older stasis may record a placeholder version for a workspace package without one; regenerate it (bundle=replace / lock=replace)`)),S(a.ecosystem===t.ecosystem,`${n}: module '${e}' ecosystem mismatch ('${a.ecosystem??`(none)`}' vs '${t.ecosystem??`(none)`}')`),i.set(e,Se(a,t,`${n}: module '${e}'`));for(let i of ye){if(a[i]===void 0==(t[i]===void 0)||r&&a[i]===void 0)continue;let[o,s]=a[i]===void 0?[t,a]:[a,t],c=Object.keys(s.files).find(e=>!Object.hasOwn(o.files,e));c!==void 0&&S(!1,`${n}: module '${e}' ${i} is recorded of one side's files, not of '${d(e,c)}' the other adds`)}for(let[r,i]of Object.entries(t.files))Object.hasOwn(a.files,r)?S(a.files[r]===i,`${n}: content mismatch for '${d(e,r)}'`):a.files[r]=i}return ct(i,n,(e,t,r)=>S(!1,`${n}: file '${e}' is bucketed under both '${t}' and '${r}' -- module bucketing changed between the artifacts (a workspace package without a version now owns its own bucket); regenerate the artifact (bundle=replace / lock=replace)`)),i}var j=e=>e===`node_modules`||e.startsWith(`node_modules/`)||e.endsWith(`/node_modules`)||e.includes(`/node_modules/`),dt=`node_modules/`;function ft(e){let t=e.length;for(;(t=e.lastIndexOf(dt,t-1))!==-1;)if(t===0||e[t-1]===`/`)return t;return-1}function pt(e){let t=ft(e);if(t===-1)return null;let n=t+dt.length,r=e.slice(n).split(`/`),i=r[0].startsWith(`@`)?2:1,a=r.slice(0,i);if(r.length<=i||a.includes(``))return null;let o=a.join(`/`);return{dir:e.slice(0,n)+o,rel:r.slice(i).join(`/`),name:o}}var M=1,mt=0,ht=lt(`bundle`,`artifact (bundle=replace)`),gt=(e,t)=>{let n=ct(e,`bundle`,ht);for(let e of n.keys())S(!Pe(e),`bundle: ${e} is a stasis lockfile, which no bundle may carry`);return qe(t,n,`bundle`),n},_t=e=>pt(e)??{dir:`.`,rel:e===`.`?``:e,name:null};function vt(e){S(T(e),`bundle: sources must be an object`);let t=new Map;for(let[n,r]of Object.entries(e)){k(n,`bundle`);let{dir:e,rel:i,name:a}=_t(n);S(!O(e)&&!O(i));let{files:o}=Le(t,e,()=>({name:a,version:null,files:Object.create(null)}));S(!Object.hasOwn(o,i),`bundle: duplicate file key '.' (v0 '' and '.')`),o[i]=r}return t}function yt(){throw Error(`bundle: file contents are not retained by this contents-free Bundle`)}var bt=(e,{files:t,...n})=>{let r=Object.create(null);for(let[n,i]of Object.entries(t))typeof i!=`symbol`&&S(!1,`bundle: file '${d(e,n)}' is not a placeholder`),Object.defineProperty(r,n,{get:yt,enumerable:!0});return{...n,files:Object.freeze(r)}},N=(e,t)=>{if(e===void 0&&t===void 0)return;let n=new Map;for(let r of[e,t])for(let[e,t]of Object.entries(r??{}))Array.isArray(t)&&n.set(e,new Set([...n.get(e)??[],...t]));return E([...n.keys()].toSorted().map(e=>[e,D(n.get(e))]))},xt=(e,t)=>Object.hasOwn(h,e)&&h[e](t),St=(e,t)=>e?.github===void 0||!ee(e.github,t?.github)?void 0:E(Object.keys(h).filter(n=>e[n]!==void 0&&(n===`github`||e[n]===t[n])).map(t=>[t,e[t]])),Ct=e=>{if(!T(e)||e.root!==!0||Object.hasOwn(e,`directory`))return e;let{root:t,...n}=e;return n},wt={npm:v,composer:v,cargo:v},Tt=(e,t)=>E(Object.keys(wt).map(n=>{let[r,i]=[e?.[n],t?.[n]];return[n,r?.name!==void 0&&r.name===i?.name?E(Object.entries(r).filter(([e,t])=>t===i[e])):void 0]})),P=class e{static VERSION=M;#e;get repo(){return this.#e}set repo(e){this.#e=te(e)}#t;get package(){return this.#t}set package(e){this.#t=g(e,wt,`bundle package`)}constructor({config:e={scope:`full`},entries:t,modules:n,formats:r,imports:i,executable:a,reason:o,repo:s,package:c,version:l=M}={}){S([mt,M].includes(l)),Ne(e.scope,`bundle`),this.version=l,this.config=e,this.entries=t??new Set,this.modules=n??new Map,this.formats=r??new Map,this.imports=i??new Map,this.executable=a??new Set,this.reason=o,this.repo=s,this.package=c}get sources(){let e=new Map;for(let[t,{files:n}]of this.modules)for(let[r,i]of Object.entries(n))e.set(d(t,r),i);return e}static isResourceFormat(e){return a.has(e)||e===`directory`}get hasCode(){return this.modules.entries().some(([t,{files:n}])=>Object.keys(n).some(n=>!e.isResourceFormat(this.formats.get(d(t,n)))))}static parse(t){return e.fromJSON(JSON.parse(t))}static fileKeyAt(e){let[t,n,r,i]=e;if(typeof n==`string`){if(e.length===2&&t===`sources`){let e=_t(n);return A(e.dir,e.rel,`bundle`)}if(e.length===4&&(t===`sources`||t===`modules`)&&r===`files`&&typeof i==`string`)return A(n,i,`bundle`)}}static fromJSON(t,{contents:n=!0}={}){S(t.version===M||t.version===mt),Ne(t.config?.scope,`bundle`);let r=Ke(t.formats),i=t.version===M;i&&t.config.scope!==`full`&&S(t.entries===void 0&&t.sources===void 0);let a=i?$e(t,`bundle`):vt(t.sources),o=gt(a,r),s=Xe(t.imports);if(!n)for(let[e,t]of a)a.set(e,bt(e,t));return new e({version:t.version,config:t.config,entries:i&&t.entries!==void 0?Ue(t.entries,`bundle`):new Set,modules:a,formats:r,imports:s,executable:i?ke(t.executable,{what:`bundle`,files:o,formats:r,scope:t.config.scope}):new Set,reason:T(t.reason)?t.reason:void 0,repo:Ct(t.repo),package:t.package})}serialize(){gt(this.modules,this.formats);let{entries:e,sources:t,modules:n,formats:r,imports:i,executable:a}=et(this,`bundle`,{skipEmpty:!0});return JSON.stringify({version:M,config:this.config,repo:this.repo,package:this.package,entries:e,formats:r,imports:i,executable:a,reason:N(this.reason,void 0),sources:t,modules:n},void 0,2)}withReason(t,n=[...this.sources.keys()]){let{version:r,config:i,entries:a,modules:o,formats:s,imports:c,executable:l,repo:u,package:d}=this,f=N(this.reason,{[t]:n});return new e({version:r,config:i,entries:a,modules:o,formats:s,imports:c,executable:l,reason:f,repo:u,package:d})}merge(t){return S(this.config.scope===t.config.scope,`bundle merge: scope mismatch ('${this.config.scope}' vs '${t.config.scope}')`),new e({config:{scope:this.config.scope},entries:new Set([...this.entries,...t.entries]),modules:ut(this.modules,t.modules,`bundle merge`),formats:at(this.formats,t.formats,`bundle merge`),imports:rt(this.imports,t.imports,`bundle merge`),executable:ot(this.executable,t.executable,t.modules,this.config.scope),reason:N(this.reason,t.reason),repo:St(this.repo,t.repo),package:Tt(this.package,t.package)})}},Et={__proto__:null,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`jsx`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsx:`tsx`,json:`json`,css:`css`,html:`markup`,htm:`markup`,xml:`markup`,svg:`markup`,yml:`yaml`,yaml:`yaml`,sh:`bash`,bash:`bash`,md:`markdown`,markdown:`markdown`,sol:`solidity`,php:`php`,phtml:`php`,rs:`rust`,rb:`ruby`,py:`python`,pyw:`python`,pyi:`python`,java:`java`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,"c++":`cpp`,hpp:`cpp`,hh:`cpp`,hxx:`cpp`,"h++":`cpp`,h:`cpp`,c:`c`,m:`objectivec`,mm:`objectivec`},Dt={__proto__:null,module:`javascript`,commonjs:`javascript`,"module-typescript":`typescript`,"commonjs-typescript":`typescript`,json:`json`,solidity:`solidity`,php:`php`,shell:`bash`,rust:`rust`,java:`java`,objc:`objectivec`,objcpp:`objectivec`,c:`c`,"c-header":`c`,cpp:`cpp`,"cpp-header":`cpp`,ruby:`ruby`,podspec:`ruby`,podfile:`ruby`,fastlane:`ruby`,"podfile-lock":`yaml`,xml:`markup`};function Ot(e){if(typeof e!=`string`)return!1;let t=e.length-1,n=0;for(;n<t&&/\s/u.test(e[n]);)n++;for(;t>n&&/\s/u.test(e[t]);)t--;return n<t&&e[n]===`{`&&e[t]===`}`}function kt(e,t,n){if(typeof t==`string`&&Dt[t])return Dt[t];if(typeof e!=`string`)return null;let r=e.slice(e.lastIndexOf(`/`)+1),i=r.lastIndexOf(`.`);if(i<=0)return null;let a=r.slice(i+1).toLowerCase();return a===`map`?Ot(n)?`json`:null:Et[a]??null}var At=/^webpack(?:-internal)?:\/\/[^/]*\//u,jt=/^[a-z][\d+.a-z-]*:/iu,Mt=/^file:/iu,Nt=/^(?:file|ftp|https?|wss?):/iu,Pt=/^(?:[a-z][\d+.a-z-]*:\/\/[^/]*\/?|\/\/[^/]+\/|[a-z]:\/|\/)?/iu,F=e=>Pt.exec(e)[0],I=e=>F(e).includes(`://`),L=e=>e.replace(I(e)?/[#?].*$/su:/\?.*$/su,``),Ft=e=>e.slice(e.lastIndexOf(`/`)+1),R=(e,t)=>URL.parse(e,t)?.href??null;function z(e){let t=F(e),n=t.includes(`://`)&&R(e);if(n)return n;let r=[];for(let n of e.slice(t.length).split(`/`))n===``||n===`.`||(n===`..`?r.length>0&&r.at(-1)!==`..`?r.pop():t||r.push(`..`):r.push(n));let i=/^[a-z]:\/$/iu.test(t)?t.toUpperCase():t.startsWith(`//`)?t.toLowerCase():t;return i?i.replace(/\/?$/u,`/`)+r.join(`/`):r.join(`/`)||`.`}function It(e,t){let n=F(t);return I(e)&&!n.includes(`:`)?R(t,e)??z(`${e}/../${t}`):z(n===`/`?F(e).replace(/\/?$/u,``)+t:n?t:`${e}/../${t}`)}function Lt(e){try{return decodeURIComponent(e)}catch{return e}}function B(e,t){let n=e.replaceAll(`\\`,`/`);if(At.test(n))return z(n.replace(At,``));let r=Nt.test(n)?R(n)??n:n,i=/^file:\/\/([^/#]*)([^#]*)/isu.exec(r);if(i){let[,e,t]=i;return z(Lt(e&&e.toLowerCase()!==`localhost`?`//${e}${t}`:t).replace(/^\/(?=[a-z]:\/)/iu,``))}if(jt.test(r)&&!F(r).includes(`:`))return r;if(t===void 0)return z(r);if(Mt.test(t)&&!F(r))return B(R(r,t)??r);let a=B(t);return F(r)&&!I(a)?z(r):It(a,r)}var Rt=/^(?:@[\dA-Za-z~-][\w.~-]*\/)?[\dA-Za-z~-][\w.~-]*$/u;function zt(e){let t=e.split(`/`).slice(0,e.startsWith(`@`)?2:1).join(`/`);return Rt.test(t)?t:null}var Bt=new Set([`.pnpm`,`.bun`,`.deno`]),Vt=/^\d+\.\d+\.\d+(?:-[\d.a-z-]+)?(?:\+[\d.a-z-]+)?$/iu;function Ht(e,t){let n=`${t.replace(`/`,`+`)}@`,r=e.startsWith(n)?e.slice(n.length).split(/[(_]/u)[0]:null;return Vt.test(r)?r:null}function Ut(e){let t=L(e).split(`/`),n=t.lastIndexOf(`node_modules`),r=n<0?null:zt(t.slice(n+1).join(`/`));if(r===null)return null;let i=n+1+r.split(`/`).length;if(i>=t.length||t.slice(i).includes(``))return null;let a=t.slice(0,i).join(`/`);return{name:r,version:Bt.has(t[n-2])?Ht(t[n-1],r):null,root:a,path:e.slice(a.length+1)}}var Wt=new Map([[`js`,`jsx`],[`mjs`,`jsx`],[`cjs`,`jsx`],[`jsx`,`jsx`],[`es`,`jsx`],[`es6`,`jsx`],[`ts`,`ts`],[`mts`,`ts`],[`cts`,`ts`],[`tsx`,`tsx`],[`json`,`json`]]);function Gt(e){let t=Ft(L(e));return/^[\w-]+$/u.test(t)?`jsx`:Wt.get(/\.([\da-z]+)$/iu.exec(t)?.[1].toLowerCase())??null}var Kt=[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.tsx`,`.mts`,`.cts`,`.json`],qt=[`.ios`,`.android`,`.web`];function Jt(e){let t=e.map(e=>/\.[a-z]+(?=\.\w+$)/u.exec(Ft(L(e.path??``)))?.[0]),[[n,r],[,i]]=qt.map(e=>[e,t.filter(t=>t===e).length]).toSorted((e,t)=>t[1]-e[1]);return[...r===i?[]:[n],`.native`,``,`.browser`,`.node`]}var Yt=new Map([[`.js`,[`.ts`,`.tsx`]],[`.jsx`,[`.tsx`]],[`.mjs`,[`.mts`]],[`.cjs`,[`.cts`]]]),Xt=[`index`,`main`,`browser`,`node`],Zt=[``,`src/`,`lib/`,`dist/`,`build/`],Qt=new Set([`lib`,`dist`,`build`,`out`,`esm`,`cjs`]);function*$t(e,t){yield e;let n=/\.[^./]+$/u.exec(e)?.[0];for(let t of Yt.get(n)??[])yield e.slice(0,-n.length)+t;for(let n of e.endsWith(`/`)?[`${e}index`]:[e,`${e}/index`])for(let e of Kt)for(let r of t)yield n+r+e;if(n)for(let r of t.filter(Boolean))yield e.slice(0,-n.length)+r+n}function*en(e){let t=e;for(;;){t.startsWith(`src/`)||(yield`src/${t}`),t!==e&&(yield t);let n=t.indexOf(`/`);if(n<0||!Qt.has(t.slice(0,n)))return;t=t.slice(n+1)}}function tn(e){let t=new Map,n=new Map,r=new Map;for(let i of e)i.path!==null&&t.set(i.path,i),i.package&&(n.set(i.package.name,(n.get(i.package.name)??new Set).add(i.package.root)),(r.get(i.package.root)??r.set(i.package.root,[]).get(i.package.root)).push(i));return{byPath:t,roots:n,byRoot:r,platforms:Jt(e),found:new Map}}function V(e,t){if(!e.found.has(t)){let n=L(t),r=$t(n,e.platforms).map(e=>e+t.slice(n.length));e.found.set(t,e.byPath.get(r.find(t=>e.byPath.has(t)))??null)}return e.found.get(t)}function nn(e,t,n){let r=e.roots.get(n);if(!r)return null;let i=t.path.split(`/`);for(let e=i.length-1;e>=0;e--){let t=[...i.slice(0,e),`node_modules`,n].join(`/`);if(r.has(t))return t}return r.size===1?[...r][0]:null}var rn=new Set(`assert.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.domain.events.fs.http.http2.https.inspector.module.net.os.path.perf_hooks.process.punycode.querystring.readline.repl.stream.string_decoder.sys.timers.tls.trace_events.tty.url.util.v8.vm.wasi.worker_threads.zlib._http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert/strict.dns/promises.fs/promises.inspector/promises.path/posix.path/win32.readline/promises.stream/consumers.stream/promises.stream/web.timers/promises.util/types`.split(`.`));function an(e){if(e.startsWith(`node:`)||rn.has(e))return{builtin:!0};let t=zt(L(e));return t===null?{}:{package:t}}function on(){let e=[],t=new Map,n=(n,r,i)=>{let a=t.get(n)??t.set(n,new Set).get(n);a.has(r)||(a.add(r),e.push(i))};return{edges:e,add:n,link:(e,t,r)=>{e&&t&&t!==e&&n(e,t,{from:e,to:t,kind:r})}}}function sn(e,t){for(let n of Xt)for(let r of Zt){let i=V(e,`${t}/${r}${n}`);if(i)return i}let n=e.byRoot.get(t);return n?.length===1?n[0]:null}function cn(e,t,n,r){return/^\/[^?]/u.test(n)?V(e,t+n)??en(n.slice(1)).map(n=>V(e,`${t}/${n}`)).find(Boolean):V(e,t+n)??r(e,t)}function ln(e,t,n,r=sn){let i=/^(?:\.{1,2}|[a-z]:)?\\/iu.test(n)?n.replaceAll(`\\`,`/`):n,a=Nt.test(i);if(a||/^(?:\.{1,2}(?:\/|$)|\/|[a-z]:\/)/iu.test(i)||I(i)){let n=a?B(i):It(t.path,i),r=V(e,n);return r?{to:r}:{to:null,path:n}}if(jt.test(i)&&e.byPath.has(i))return{to:e.byPath.get(i)};let o=zt(L(n)),s=o===null?null:nn(e,t,o);if(s===null)return{to:null,...an(n)};let c=cn(e,s,n.slice(o.length),r);return c?{to:c}:{to:null,package:o}}var H=class extends Error{name=`SourceMapError`},un=new Uint8Array(128).fill(255);for(let[e,t]of[...`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/,;`].entries())un[t.codePointAt(0)]=e;function dn(e){let t=new Int32Array(e.length*2);return t.set(e),t}function fn(e){let{starts:t,columns:n,sources:r,names:i}=e;for(let e=0;e+1<t.length;e++){let[a,o]=[t[e],t[e+1]],s=a+1;for(;s<o&&n[s-1]<=n[s];)s++;if(s>=o)continue;let c=Array.from(n.subarray(a,o),(e,t)=>[e,r[a+t],i[a+t]]).sort((e,t)=>e[0]-t[0]);for(let[e,[t,o,s]]of c.entries())[n[a+e],r[a+e],i[a+e]]=[t,o,s]}return e}function pn(e){let t=[0],n=new Int32Array(1024),r=new Int32Array(1024),i=new Int32Array(1024),a=0;for(let{mappings:o,files:s,line:c,column:l,names:u,nameCount:d}of e){if(typeof o!=`string`)throw new H(`mappings is not a string`);for(;t.length<=c;)t.push(a);let e=[0,0,0,0,0],f=0,p=0,m=1,h=l;for(let c=0;c<=o.length;c++){let l=c<o.length?un[o.codePointAt(c)]??255:64;if(l<32){if(p+=l*m,f===5)throw new H(`mappings: a segment of more than 5 fields at ${c}`);e[f++]+=p%2?(1-p)/2:p/2,p=0,m=1;continue}if(l<64){if(p+=(l-32)*m,m*=32,m>2**30)throw new H(`mappings: a value at ${c} runs past 32 bits`);continue}if(l===255)throw new H(`mappings: ${JSON.stringify(o[c])} at ${c} is not a base64 digit`);if(m!==1)throw new H(`mappings: the value before ${c} is cut off`);if(f>0){if(f===2||f===3)throw new H(`mappings: a segment of ${f} fields before ${c}`);let t=f===1?-1:s[e[1]];if(t===void 0)throw new H(`mappings: source ${e[1]} before ${c} is not in sources`);if(e[0]<0)throw new H(`mappings: a negative generated column before ${c}`);a===n.length&&([n,r,i]=[dn(n),dn(r),dn(i)]),n[a]=e[0]+h,r[a]=t,i[a++]=f===5&&e[4]>=0&&e[4]<d?u+e[4]:-1,f=0}l===65&&(t.push(a),e[0]=0,h=0)}}return t.push(a),fn({starts:Int32Array.from(t),columns:n.slice(0,a),sources:r.slice(0,a),names:i.slice(0,a)})}var mn=new WeakMap,hn=e=>mn.get(e),U=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function W(e,t){if(!e)throw new H(t)}function gn(e,t){if(e===void 0)return[];W(Array.isArray(e),`${t} is not an array`);for(let n of e)W(typeof n==`string`||n===null,`${t} holds ${JSON.stringify(n)}`);return e}function _n(e,t,n,r){let i=e.bySource.get(t);if(i!==void 0)return e.files[i].content??=n,e.files[i].ignored||=r,i;let a=t===null?null:B(t,e.mapPath);return e.files.push({source:t,path:a,package:a===null?null:Ut(a),content:n,ignored:r}),t!==null&&e.bySource.set(t,e.files.length-1),e.files.length-1}function vn(e,t,n,r){W(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),W(e.sourceRoot===void 0||typeof e.sourceRoot==`string`,`sourceRoot is not a string`);let i=gn(e.sources,`sources`),a=gn(e.sourcesContent,`sourcesContent`),o=e.ignoreList??e.x_google_ignoreList??[];W(Array.isArray(o)&&o.every(e=>Number.isInteger(e)&&e>=0&&e<i.length),`ignoreList is not a list of indices into sources`);let s=new Set(o),c=e.sourceRoot?e.sourceRoot.replace(/\/?$/u,`/`):``,l=i.map((e,n)=>_n(t,e===null?null:c+e,a[n]??null,s.has(n))),u=Array.isArray(e.names)?e.names:[];t.parts.push({mappings:e.mappings,files:l,line:n,column:r,names:t.names.length,nameCount:u.length}),t.names.push(...u)}function yn(e,t){W(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),W(Array.isArray(e.sections),`sections is not an array`);for(let[n,r]of e.sections.entries()){let{offset:i,map:a}=U(r)?r:{};W(U(i)&&[i.line,i.column].every(e=>Number.isInteger(e)&&e>=0),`sections[${n}].offset is not a line and a column`),W(U(a)&&a.sections===void 0,`sections[${n}].map is not a plain source map`);let o=e.sections[n-1]?.offset;W(!o||o.line<i.line||o.line===i.line&&o.column<=i.column,`sections[${n}] starts before sections[${n-1}]`),vn(a,t,i.line,i.column)}}function bn(e,t={}){if(!U(t))throw TypeError(`readSourceMap: options is not an object`);if(t.path!==void 0&&typeof t.path!=`string`)throw TypeError(`readSourceMap: options.path is not a string`);let n=e;if(typeof e==`string`||e instanceof Uint8Array)try{let t=typeof e==`string`?e:new TextDecoder(`utf-8`,{fatal:!0}).decode(e);n=JSON.parse(t.replace(/^\)\]\}'[^\n]*\n/u,``))}catch(e){throw new H(`not JSON: ${e.message}`,{cause:e})}W(U(n),`not a JSON object`);let r={files:[],bySource:new Map,mapPath:t.path,parts:[],names:[]};n.sections===void 0?vn(n,r,0,0):yn(n,r);let i={files:r.files};return mn.set(i,{...pn(r.parts),nameList:r.names}),i}var xn=/\r\n?|[\n\u2028\u2029]/gu;function Sn(e){let t=[0];for(let n of e.matchAll(xn))t.push(n.index+n[0].length);return t}function Cn(e,t,n,r){let[i,a]=[t,n];for(;i<a;){let t=i+a>>1;e[t]<=r?i=t+1:a=t}return i-1}function G(e,t){let n=Cn(e,0,e.length,t);return[n,t-e[n]]}function wn(e,[t,n]){if(t>=e.starts.length-1)return-1;let r=e.starts[t],i=Cn(e.columns,r,e.starts[t+1],n);return i<r?-1:i}function Tn(e,t,n,r){let i=hn(e),a=G(t,n),[o,s]=G(t,r),c=new Map,l=wn(i,a);for(let e=a[0];e<=o&&e<i.starts.length-1;e++){let t=e===a[0]&&l>=0?l:i.starts[e];for(let n=t;n<i.starts[e+1];n++){let t=i.sources[n];if(e===o&&i.columns[n]>=s)break;t>=0&&c.set(t,(c.get(t)??0)+1)}}let[u]=[...c].reduce((e,t)=>t[1]>e[1]?t:e,[-1,0]);return u<0?null:e.files[u]}var K=/\s+/uy,En=`
2
+ \r\u2028\u2029`,q=/[\n\r\u2028\u2029]/gu,Dn=/[\n\r\u2028\u2029]/u,J=/[\w$\u0080-￿]+/uy,On=new Set([`return`,`typeof`,`instanceof`,`in`,`of`,`new`,`delete`,`void`,`throw`,`case`,`default`,`extends`,`do`,`else`,`yield`,`await`]),kn=new Set([`if`,`while`,`for`,`with`]),An=new Set([`break`,`continue`,`debugger`]),jn=new Set([`(`,`[`,"${",`,`,`=`,`:`,`?`,`!`,`~`,`+`,`-`,`*`,`/`,`%`,`&`,`|`,`^`,`<`,`>`]);function Mn(e,t){return e?.type===`word`?t&&[`return`,`yield`].includes(e.value)?!1:On.has(e.value)&&![`do`,`else`].includes(e.value):jn.has(e?.value)}function Nn(e){let t=e.at(-1);return t?.type===`word`&&(kn.has(t.value)||t.value===`await`&&e.at(-2)?.value===`for`)}function Pn(e){return e?e.type===`word`?On.has(e.value)||An.has(e.value)||e.label===!0:e.value===`)`?e.control:e.value===`}`?!e.object:e.type===`punctuator`&&![`++`,`--`,`]`].includes(e.value):!0}var Fn=(e,t)=>e.startsWith(`\r
3
+ `,t+1)?3:2,In=/\\(?:u\{([\da-f]+)\}|u([\da-f]{4})|x([\da-f]{2})|([0-3][0-7]{0,2}|[4-7][0-7]?)|(\r\n|[\n\r\u2028\u2029])|(.))/giu,Ln={b:`\b`,f:`\f`,n:`
4
+ `,r:`\r`,t:` `,v:`\v`};function Rn(e){return e.includes(`\\`)?e.replace(In,(e,t,n,r,i,a,o)=>{if(a!==void 0)return``;if(i!==void 0)return String.fromCodePoint(Number.parseInt(i,8));let s=Number.parseInt(t??n??r,16);return Number.isNaN(s)?Ln[o]??o:String.fromCodePoint(Math.min(s,1114111))}):e}function zn(e,t){let n=e[t],r=t+1;for(;r<e.length&&e[r]!==n&&!En.includes(e[r]);)r+=e[r]===`\\`?Fn(e,r):1;return[e[r]===n?Rn(e.slice(t+1,r)):null,r+1]}function Bn(e,t){let n=t+1,r=!1;for(;n<e.length&&!En.includes(e[n])&&(r||e[n]!==`/`);)e[n]===`\\`?n++:e[n]===`[`?r=!0:e[n]===`]`&&(r=!1),n++;return J.lastIndex=n+1,J.test(e)?J.lastIndex:n+1}function Vn(e,t,n){for(let r=t;r<e.length;r++)if(e[r]===`\\`)r++;else{if(e[r]==="`")return r+1;if(e[r]===`$`&&e[r+1]===`{`)return n.push(`template`),r+2}return e.length}function Hn(e){let t=[],n=[],r=[],i=0,a=0;for(;i<e.length;){let o=t.length;if(K.lastIndex=i,K.test(e)&&(i=K.lastIndex),i>=e.length)break;let s=e[i],c=e[i+1];if(J.lastIndex=i,s===`/`&&c===`/`)q.lastIndex=i+2,i=q.test(e)?q.lastIndex-1:e.length;else if(s===`/`&&c===`*`){let t=e.indexOf(`*/`,i+2);i=t<0?e.length:t+2}else if(s===`"`||s===`'`){let[n,r]=zn(e,i);t.push({type:`string`,value:n}),i=r}else if(s==="`"||s===`}`&&n.at(-1)===`template`){s===`}`&&n.pop();let r=n.length,a=Vn(e,i+1,n),o=s==="`"&&n.length===r&&e[a-1]==="`";t.push({type:`string`,value:o?Rn(e.slice(i+1,a-1)):null}),n.length>r&&t.push({type:`punctuator`,value:"${"}),i=a}else if(s===`/`&&Pn(t.at(-1)))i=Bn(e,i),t.push({type:`regex`});else if(J.test(e)){let n=An.has(t.at(-1)?.value)&&!Dn.test(e.slice(a,i));t.push({type:`word`,value:e.slice(i,J.lastIndex),...n&&{label:n}}),i=J.lastIndex}else{s===`{`&&n.push(Mn(t.at(-1),Dn.test(e.slice(a,i)))?`object`:`block`);let o=s===`}`?n.pop():void 0;s===`(`&&r.push(Nn(t));let l=(s===`+`||s===`-`)&&c===s||s===`=`&&c===`>`?s+c:s;t.push({type:`punctuator`,value:l,...s===`)`&&{control:r.pop()===!0},...s===`}`&&{object:o===`object`}}),i+=l.length}t.length>o&&(a=i)}return t}var Y=e=>e?.type===`string`&&e.value!==null,Un=new Set([`type`,`typeof`]),Wn=(e,t)=>e[t+1]?.type===`word`&&(e[t+1].value!==`as`||e[t+2]?.type!==`word`||e[t+2].value===`as`);function Gn(e,t){let n=!1;for(let r=t+1;r<e.length&&e[r].value!==`}`;r++)if(!(r>t+1&&e[r-1].value!==`,`)){if(!Un.has(e[r].value)||!Wn(e,r))return!1;n=!0}return n}function Kn(e,t){for(let n=t;n<e.length;n++){let{value:r}=e[n];if(r===`;`||n>t&&(r===`import`||r===`export`))return null;if(r===`from`&&Y(e[n+1]))return e[n+1].value}return null}function qn(e,t){let[n,r,i]=[e[t].value,e[t+1],e[t+2]],a=n===`import`?`import`:`export-from`;if(n===`import`&&Y(r))return{kind:a,specifier:r.value};if(Un.has(r?.value)&&![`,`,`from`].includes(i?.value)||r?.value===`{`&&Gn(e,t+1)||n===`export`&&![`{`,`*`].includes(r?.value)||n===`import`&&r?.type!==`word`&&![`{`,`*`].includes(r?.value))return null;let o=Kn(e,t+1);return o===null?null:{kind:a,specifier:o}}function Jn(e,t){let[n,r]=[e[t+2],e[t+3]];if(n?.value!==`)`)return Y(n)&&[`)`,`,`].includes(r?.value)?n.value:null}function Yn(e,t=new Set){let n=Hn(e),r=[];for(let[e,i]of n.entries()){if(i.type!==`word`||[`.`,`#`,`function`].includes(n[e-1]?.value)||n[e-1]?.value===`=`&&n[e-3]?.value===`type`&&n[e-4]?.value===`import`)continue;let a=n[e+1]?.value===`(`,o=a?Jn(n,e):void 0;if((i.value===`require`||t.has(i.value))&&o!==void 0)r.push({kind:`require`,specifier:o,...i.value!==`require`&&{callee:i.value}});else if(i.value===`import`&&a)o!==void 0&&r.push({kind:`dynamic-import`,specifier:o});else if(i.value===`import`||i.value===`export`){let t=qn(n,e);t&&r.push(t)}}return r}var Xn=/^[\w$]*__d\(/gmu,Zn=([e,t,n,...r])=>(typeof e==`number`||typeof e==`string`)&&(t===void 0||typeof t==`object`)&&(n===void 0||typeof n==`string`)&&r.length===0;function Qn(e){let t=/\);?\s*$/u.exec(e)?.index,n=null,r=t===void 0?-1:e.lastIndexOf(`},`,t);for(;r>=0&&/[\d"]/u.test(e[r+2]);){let i;try{i=JSON.parse(`[${e.slice(r+2,t)}]`)}catch{break}if(!Zn(i))break;n=i,r=r>0?e.lastIndexOf(`},`,r-1):-1}return n}function $n(e){let t=/^[^(]*\(\s*(?:function\s*[\w$]*\s*)?\(([^)]*)\)/u.exec(e)?.[1].split(`,`).slice(1,4).map(e=>e.trim().replaceAll(`$`,`\\$`));if(!t?.length)return[];let n=e.matchAll(RegExp(`(?<=[^\\w$.#]|\\.\\.\\.)(?:${t.join(`|`)})\\((\\d+|"(?:[^"\\\\]|\\\\.)*")[,)]`,`gu`));return[...new Set([...n].map(e=>JSON.parse(e[1])))]}function er(e,t){if(Array.isArray(e))return e;let n=Object.entries(e??{}).filter(([e])=>/^\d+$/u.test(e)).map(([,e])=>e);return n.length>0?n:$n(t)}function tr(e,t){let n=new Map(t.files.map((e,t)=>[e,t])),r=e.flatMap((e,t)=>e.file?[{k:t,at:n.get(e.file)}]:[]);for(let n=0;n<(r[0]?.k??0);n++)e[n].file=t.files[r[0].at-r[0].k+n]??null;for(let[n,{k:i,at:a}]of r.entries()){let o=r[n+1];if(!(o&&o.at-a!==o.k-i))for(let n=i+1;n<(o?.k??e.length);n++)e[n].file=t.files[a+n-i]??null}}function nr(e,t){let n=[...e.matchAll(Xn)].map(e=>e.index);if(n.length===0)return null;let r=Sn(e),i=t=>e.slice(r[t],r[t+1]),a=[];for(let[o,s]of n.entries()){let[c]=G(r,s),[l]=G(r,(n[o+1]??e.length)-1),u=Qn(i(l));for(;!u&&l>c;)u=Qn(i(--l));if(!u)throw Error(`bundleEdges: the Metro module at line ${c+1} ends in no define params`);let d=r[l+1]??e.length;a.push({id:u[0],file:Tn(t,r,s,d),dependencies:er(u[1],e.slice(s,d))})}tr(a,t);let o=new Map(a.map(e=>[e.id,e])),{edges:s,link:c}=on();for(let{file:e,dependencies:t}of a)for(let n of t)c(e,o.get(n)?.file,`dependency`);return s}var rr=e=>e.path!==null&&![`json`,null].includes(Gt(e.path)),ir=e=>e.path!==null&&Gt(e.path)===null;function ar(e){let t=/^_([A-Za-z]+)\d+$/u.exec(e)?.[1];if(t)return[t,`interopRequireDefault`];let n=/^_(interopRequire(?:Default|Wildcard)|jsx(?:Dev)?Runtime|callSuper)$/u.exec(e)?.[1];return n===`callSuper`?[`getPrototypeOf`,`possibleConstructorReturn`,`interopRequireDefault`]:n?[n]:[]}var or={jsxRuntime:`react/jsx-runtime`,jsxDevRuntime:`react/jsx-dev-runtime`};function sr(e){let{sources:t,names:n,nameList:r}=hn(e),i=new Map,a=new Map,o=e.files.map(()=>new Set);for(let e=0;e<n.length;e++)n[e]<0||t[e]<0||(a.has(n[e])||a.set(n[e],ar(r[n[e]]).length>0),a.get(n[e])&&o[t[e]].add(r[n[e]]));for(let[t,n]of o.entries()){if(n.size===0)continue;let r=e.files[t],a=new Set(Array.from((r.content??``).matchAll(/(?:function|var|let|const)\s+(_[A-Za-z]+\d*)\b/gu),e=>e[1])),o=[...n].filter(e=>!a.has(e)&&!a.has(e.replace(/\d+$/u,``))).flatMap(ar);o.length>0&&i.set(r,o.map(e=>or[e]??`@babel/runtime/helpers/${e}`))}return i}function cr(e,t){let n=new Map;for(let[r,i]of e){let e=n.get(r)??n.set(r,new Map).get(r);for(let n of i)e.set(n,ln(t,r,n,()=>null))}let r=new Set([...n.values()].flatMap(e=>[...e.values()].map(e=>e.to))),i=(e,n)=>t.byRoot.get(n).find(e=>!r.has(e))??t.byRoot.get(n)[0];return(e,r)=>{let a=n.get(e)?.get(r);return a?.to?a:ln(t,e,r,i)}}var lr=e=>/(?:^|\/)__prelude__$/u.test(e.source??``),ur=e=>e?.package?.name===`metro-runtime`&&e.package.path===`src/polyfills/require.js`;function dr(e){if(!e.files.some(lr)&&!ur(e.files[0]))return null;if(!e.files.some(e=>e.content!==null&&!lr(e)&&!ur(e)))throw Error("bundleEdges: the Metro map carries no sourcesContent, which its edges are read from; pass the bundle as `code`");let t=tn(e.files),n=e.files[e.files.findIndex(ir)+1],r=e.files.find(e=>e.package?.name===`metro-runtime`&&e.package.path===`src/modules/asyncRequire.js`),i=new Map(e.files.filter(e=>e.content!==null&&rr(e)).map(e=>[e,Yn(e.content)])),a=sr(e),o=cr([...[...i].map(([e,t])=>[e,t.flatMap(({specifier:e})=>e===null?[]:[e])]),...a],t),{edges:s,add:c,link:l}=on();for(let t of e.files){ir(t)&&l(t,n,`dependency`);for(let{kind:e,specifier:n}of i.get(t)??[]){let i=n===null?{to:null}:o(t,n);i.to!==t&&c(t,`${e}\0${JSON.stringify(n)}`,{from:t,kind:e,specifier:n,...i}),e===`dynamic-import`&&l(t,r,`dependency`)}for(let e of a.get(t)??[])l(t,o(t,e).to,`dependency`)}return s}var fr=(e,t)=>t==null?dr(e):nr(t,e);function pr(e,t){let n=fr(e,t);if(!n)throw Error(`bundleEdges: not a Metro ${t==null?`map`:`bundle`}; edges-lite.js reads only those, edges.js reads others`);return{edges:n}}function mr(e){let t=JSON.parse(e.replace(/^\)\]\}'[^\n]*\n/u,``)),n=bn(t),r=t.sections?t.sections.reduce((e,t)=>e+(t.map.names?.length??0),0):t.names?.length??null;return{json:{version:t.version,file:t.file,sourceRoot:t.sourceRoot},map:n,namesCount:r}}function hr(e){if(e.map)return e.map.files.flatMap(e=>e.source===null?[]:[[e.source,e.content]]);let t=e.json?.sourcesContent??[];return(e.json?.sources??[]).map((e,n)=>[e,t[n]??null])}function gr(e,t){let n=new Map;for(let{from:r,to:i,specifier:a}of t(e).edges){if(r.source===null||i?.source==null||i.source===r.source)continue;let e=typeof a==`string`?[r.source,i.source,a]:[r.source,i.source];n.set(e.join(`\0`),e)}return[...n.values()]}function _r(e){try{return pr(e)}catch{return{edges:[]}}}var vr=Object.freeze([]);function X(e){return e?.edges?e.edges:e?.map?(e.edges=gr(e.map,_r),e.edges):vr}var yr=new WeakMap,br=new WeakMap;function xr(e){let t=X(e);if(!yr.has(t)){let e=new Map;for(let[n,r]of t)e.has(n)||e.set(n,new Set),e.get(n).add(r);yr.set(t,e)}return yr.get(t)}function Sr(e){let t=X(e);if(!br.has(t)){let e=new Map;for(let[n,r,i]of t)i!==void 0&&(e.has(n)||e.set(n,new Map),e.get(n).set(i,r));br.set(t,e)}return br.get(t)}var Cr=new WeakMap,wr=new WeakMap,Tr=new WeakMap,Er=new WeakMap,Dr=new WeakMap,Or=new WeakMap;function Z(e){if(e?.metadataOnly)return new Map;let t=e?.bundle??e?.json;if(t&&Cr.has(t))return Cr.get(t);let n=new Map;if(!e)return n;if(e.kind===`stasis`){if(!e.bundle)return n;let t=e.bundle.formats;for(let[r,i]of e.bundle.sources)typeof i==`string`&&(P.isResourceFormat(t?.get(r))||n.set(r,i))}else if(e.kind===`sourcemap`)for(let[t,r]of hr(e))typeof r==`string`&&n.set(t,r);return t&&Cr.set(t,n),n}function kr(e){let t=1;for(let n=e.indexOf(`
5
+ `);n!==-1;n=e.indexOf(`
6
+ `,n+1))t++;return t}var Ar=new WeakMap;function jr(e){let t=Ar.get(e);if(!t){let n=[...e.keys()].toSorted();t={paths:n,numbers:new Map(n.map((e,t)=>[e,t+1]))},Ar.set(e,t)}return t}function Mr(e,t){let n=Array.isArray(t)?t:[];return{integrity:e.integrity,kind:`sourcemap`,size:e.size,json:{version:3,sources:n.map(([e])=>e),sourcesContent:n.map(([,,e])=>typeof e==`string`?e:null)},fileSizes:new Map(n.map(([e,t])=>[e,t])),npmBinaries:new Map(n.filter(([,,e,t])=>typeof e!=`string`&&typeof t==`string`).map(([e,t,,n])=>[e,{size:t,digest:n}]))}}function Nr(e){let t=e?.bundle??e?.json;if(t&&wr.has(t))return wr.get(t);let n=new Map(Z(e));for(let[t,r]of e?.npmBinaries??[])n.set(t,{format:`digest`,...r});if(e?.kind===`stasis`&&e.bundle){let t=e.bundle.formats;for(let[r,i]of e.bundle.sources){if(typeof i!=`string`)continue;let e=t?.get(r);e===`resource`?n.set(r,i):e===`resource:base64`&&n.set(r,{format:`base64`,data:i})}}return t&&wr.set(t,n),n}var Pr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;function Fr(e){let t=e.endsWith(`=`);if(t?e.length%4!=0||e.at(-3)===`=`:e.length%4==1)return null;let n=t?e.slice(0,e.endsWith(`==`)?-2:-1):e;if(/[^A-Za-z0-9+/]/u.test(n))return null;let r=n.length%4;return r>1&&Pr.indexOf(n.at(-1))&(r===2?15:3)?null:Math.floor(n.length*3/4)}function Ir(e){return typeof e==`string`?t(e):e?.format===`digest`?e.size:e?.format===`base64`?Fr(e.data):null}function Q(e){if(e?.fileSizes)return e.fileSizes;let t=e?.bundle??e?.json;if(t&&Tr.has(t))return Tr.get(t);let n=new Map,r=Nr(e),i=e?.kind===`stasis`?e.bundle?.sources.keys():e&&hr(e).map(([e])=>e);for(let e of i??[])n.set(e,Ir(r.get(e)));return t&&Tr.set(t,n),n}function Lr(e){if(e?.metadataOnly)return e.unsizedFiles??new Set;let t=Q(e);if(Or.has(t))return Or.get(t);let n=new Set;for(let r of Nr(e).keys())t.get(r)===null&&n.add(r);return Or.set(t,n),n}function Rr(e){let t=Q(e);if(Dr.has(t))return Dr.get(t);let n=Lr(e),r=e?.kind===`stasis`?e.bundle?.formats:null,i=new Map;for(let[a,o]of t)o===null&&!n.has(a)||i.set(a,P.isResourceFormat(r?.get(a))||e?.npmBinaries?.has(a)?`resource`:`source`);return Dr.set(t,i),i}function zr(e){let t=Q(e),n=e?.kind===`stasis`?e.bundle?.formats:null;if(!n||n.size===0)return t;if(Er.has(t))return Er.get(t);let r=new Map;for(let[e,i]of t)P.isResourceFormat(n.get(e))||r.set(e,i);return Er.set(t,r),r}var Br=new WeakMap;function Vr(e){if(e?.kind!==`stasis`||!e.bundle?.modules)return null;if(Br.has(e.bundle))return Br.get(e.bundle);let t=new Map;for(let[n,r]of e.bundle.modules)for(let e of Object.keys(r.files))t.set(n===`.`?e:`${n}/${e}`,n);return Br.set(e.bundle,t),t}function Hr(e,t=null,n=(e,t)=>t.name){let r=new Map;if(e?.kind!==`stasis`||!e.bundle?.modules)return r;let i=t===null?null:Vr(e),a=t===null?null:new Set([...t].map(e=>i?.get(e)));for(let[t,i]of e.bundle.modules){if(a&&!a.has(t)||!t.includes(`node_modules`)||!i?.name||typeof i.version!=`string`||!i.version)continue;let e=n(t,i),o=r.get(e);o||(o=new Set,r.set(e,o)),o.add(i.version)}return r}var Ur=Object.freeze({javascript:`JavaScript`,jsx:`JSX`,typescript:`TypeScript`,tsx:`TSX`,json:`JSON`,css:`CSS`,markup:`HTML`,yaml:`YAML`,bash:`Shell`,markdown:`Markdown`,solidity:`Solidity`,php:`PHP`,rust:`Rust`,ruby:`Ruby`,java:`Java`,cpp:`C++`,c:`C`,objectivec:`Objective-C`,python:`Python`,go:`Go`,kotlin:`Kotlin`,swift:`Swift`,dart:`Dart`,sql:`SQL`,lua:`Lua`,csharp:`C#`,scala:`Scala`,vue:`Vue`,svelte:`Svelte`}),Wr=Object.freeze({py:`python`,pyw:`python`,go:`go`,kt:`kotlin`,kts:`kotlin`,swift:`swift`,dart:`dart`,sql:`sql`,lua:`lua`,cs:`csharp`,scala:`scala`,sc:`scala`,vue:`vue`,svelte:`svelte`});function Gr(e){let t=typeof e==`string`?e.slice(e.lastIndexOf(`/`)+1):``,n=t.lastIndexOf(`.`),r=n>0?t.slice(n+1).trim().toLowerCase():``,i=kt(e)??Wr[r];return i?{key:i,label:Ur[i]??i}:r?{key:`extension:${r}`,label:`.${r}`}:{key:`other`,label:`Other`}}function Kr(e,t){let n=new Map,r=0,i=0;for(let[a,o]of e){let e=Gr(a),s=n.get(e.key)??{...e,files:0,lines:0,bytes:0};s.files++,s.lines+=o,s.bytes+=t.get(a)??0,n.set(e.key,s),i+=o,r+=t.get(a)??0}return{files:e.size,lines:i,bytes:r,languages:[...n.values()].toSorted((e,t)=>t.lines-e.lines||e.label.localeCompare(t.label))}}var qr=6,$=new WeakMap,Jr=new Set([`terminal`,`code`,`search`,`compare`]);function Yr(e,t=null){return!!t||Jr.has(e)}var Xr=/^sha512-[A-Za-z0-9+/]{86}==$/u;function Zr(t){if(t.fileHashes)return Promise.resolve(t.fileHashes);if($.has(t))return $.get(t);let n=(async()=>{let n=[...Z(t)],r=new Map;for(let t=0;t<n.length;t+=32){let i=await Promise.all(n.slice(t,t+32).map(async([t,n])=>[t,await e(n)]));for(let[e,t]of i)r.set(e,t)}return t.fileHashes=r,r})();return $.set(t,n),n.catch(()=>$.delete(t)),n}function Qr(e){if(typeof e!=`string`)return 0;let t=/\S/gu,n=/[\r\n]/gu,r=0;for(;t.test(e)&&(r++,n.lastIndex=t.lastIndex,n.test(e));)t.lastIndex=n.lastIndex;return r}function $r(e){return e.lineCounts??=new Map([...Z(e)].map(([e,t])=>[e,Qr(t)]))}function ei(e){return e instanceof Map?Object.fromEntries([...e].map(([e,t])=>[e,ei(t)])):e}async function ti(e){let n=await Zr(e),r=Q(e),i=$r(e),a={version:qr,integrity:e.integrity,kind:e.kind,size:e.size,codeStats:Kr(i,r),files:[...r].map(([e,t])=>[e,t,n.get(e)??null,i.get(e)??null])},o=Lr(e);if(o.size>0&&(a.unsized=[...o]),e.kind===`sourcemap`){let{version:n,file:r,sourceRoot:i,names:o}=e.json,s=hr(e);a.json={version:n,file:r,sourceRoot:i,sources:s.map(([e])=>e)},a.sourceSizes=s.map(([,e])=>typeof e==`string`?t(e):null),a.namesCount=e.namesCount??o?.length??null;let c=new Map(a.files.map(([e],t)=>[e,t]));a.edges=X(e).map(([e,t,...n])=>[c.get(e),c.get(t),...n])}else{let t=e.bundle,n={version:t.version,config:t.config,repo:t.repo,package:t.package,formats:ei(t.formats),imports:ei(t.imports),reason:t.reason,executable:[...t.executable]};if(t.version===0)n.sources=Object.fromEntries([...r.keys()].map(e=>[e,null]));else{let e={},r={};for(let[n,i]of t.modules){let t=n.split(`/`).includes(`node_modules`)?e:r;Object.defineProperty(t,n,{enumerable:!0,value:{name:i.name,version:i.version,ecosystem:i.ecosystem,repo:i.repo,files:Object.fromEntries(Object.keys(i.files).map(e=>[e,null]))}})}n.modules=e,t.config.scope===`full`&&(n.sources=r,n.entries=[...t.entries])}a.bundle=n}return a}function ni(e,t){if(![1,2,3,4,5,qr].includes(e?.version)||e.integrity!==t||![`stasis`,`sourcemap`].includes(e.kind)||!Number.isSafeInteger(e.size)||e.size<0||!Array.isArray(e.files))throw Error(`Invalid bundle metadata`);let n=e.version!==qr,r=e.version===1,i=new Map,a=new Map,o=new Map;for(let t of e.files){if(!Array.isArray(t)||t.length!==4&&!(r&&t.length===3))throw Error(`Invalid bundle metadata file`);let[e,n,s,c]=t;if(typeof e!=`string`||a.has(e)||n!==null&&(!Number.isSafeInteger(n)||n<0)||s!==null&&(typeof s!=`string`||!Xr.test(s))||n===null&&s!==null||r&&n!==null&&s===null||c!=null&&(!Number.isSafeInteger(c)||c<0))throw Error(`Invalid bundle metadata file`);a.set(e,n),s!==null&&i.set(e,s),c!=null&&o.set(e,c)}let s=new Set(e.unsized??[]);if(e.unsized!==void 0&&(r||!Array.isArray(e.unsized)||s.size!==e.unsized.length)||[...s].some(e=>typeof e!=`string`||!a.has(e)||a.get(e)!==null))throw Error(`Invalid bundle metadata`);let c={integrity:t,kind:e.kind,size:e.size,metadataOnly:!0,fileSizes:a,fileHashes:i,lineCounts:o,unsizedFiles:s,stale:n};if(e.kind===`stasis`){c.bundle=P.fromJSON(e.bundle);let t=c.bundle.sources;if(t.size!==a.size||[...t.keys()].some(e=>!a.has(e)))throw Error(`Invalid bundle metadata inventory`);let n=c.bundle.formats;if(!r&&[...a].some(([e,t])=>i.has(e)!==(t!==null&&!P.isResourceFormat(n.get(e))))||[...s].some(e=>n.get(e)!==`resource:base64`))throw Error(`Invalid bundle metadata inventory`)}else{if(!e.json||typeof e.json!=`object`||![null,void 0].includes(e.namesCount)&&(!Number.isSafeInteger(e.namesCount)||e.namesCount<0))throw Error(`Invalid sourcemap metadata`);if(!Array.isArray(e.json.sources)||e.json.sources.some(e=>!a.has(e))||!Array.isArray(e.sourceSizes)||e.sourceSizes.length!==e.json.sources.length||e.sourceSizes.some(e=>e!==null&&(!Number.isSafeInteger(e)||e<0))||[...a].some(([e,t])=>i.has(e)!==(t!==null))||s.size>0)throw Error(`Invalid sourcemap inventory`);c.json=e.json,c.sourceSizes=e.sourceSizes,c.namesCount=e.namesCount,e.edges!==void 0&&(c.edges=ri(e.edges,e.files))}if(e.codeStats===void 0)c.codeStats=Kr(o,a);else{let t=e.codeStats,n=e=>Number.isSafeInteger(e)&&e>=0;if(!t||![t.files,t.lines,t.bytes].every(n)||!Array.isArray(t.languages)||t.languages.some(e=>!e||typeof e.key!=`string`||typeof e.label!=`string`||![e.files,e.lines,e.bytes].every(n)))throw Error(`Invalid bundle code stats`);c.codeStats=t}return c}function ri(e,t){if(!Array.isArray(e))throw Error(`Invalid sourcemap edges`);return e.map(e=>{if(!Array.isArray(e)||![2,3].includes(e.length)||e[0]===e[1]||e.length===3&&typeof e[2]!=`string`||e.slice(0,2).some(e=>!Number.isSafeInteger(e)||e<0||e>=t.length))throw Error(`Invalid sourcemap edges`);return[t[e[0]][0],t[e[1]][0],...e.slice(2)]})}function ii(e,{integrity:t,kind:n,size:r}){if(n===`stasis`)return{integrity:t,kind:n,size:r,bundle:P.parse(e)};if(n!==`sourcemap`)throw Error(`Unsupported bundle format`);return{integrity:t,kind:n,size:r,...mr(e)}}export{xt as a,P as b,kt as c,X as d,xr as e,Sr as f,Z as g,kr as h,jr as i,Mr as j,Nr as k,Ir as l,Q as m,Rr as n,zr as o,Vr as p,Hr as q,Kr as r,Yr as s,Zr as t,Qr as u,$r as v,ti as w,ni as x,ii as y};
@@ -0,0 +1 @@
1
+ import{b as e,c as t}from"./chunk-ZQHLECTI.js";import{f as n,g as r,i,j as a,k as o,m as s}from"./chunk-PXK7EU4V.js";var c,l,u,d=12336,f=26214,p=`0123456789ABCDEFabcdef`,m=`Input is not a hex string`;function h(t){c||=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));let n=t.length;if(r){if(!l){l=new Uint16Array(256);let e=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);for(let t=0;t<256;t++){let n=c[t];e[2*t]=n.charCodeAt(0),e[2*t+1]=n.charCodeAt(1)}}let r=new Uint16Array(n),i=0;for(let e=t.length-3;!(i>=e);i+=4){let e=t[i],n=t[i+1],a=t[i+2],o=t[i+3];r[i]=l[e],r[i+1]=l[n],r[i+2]=l[a],r[i+3]=l[o]}for(;i<n;i++)r[i]=l[t[i]];return e(r)}return i(t,0,n,c)}function g(e){if(typeof e!=`string`)throw TypeError(o);if(e.length%2!=0)throw SyntaxError(m);let r=e.length/2,i=new Uint8Array(r);if(n){if(!u){u=new Uint8Array(f+1);let e=new Uint8Array(2),t=new Uint16Array(e.buffer,e.byteOffset,1),n=[...p].map(e=>[e.charCodeAt(0),parseInt(e,16)]);for(let[r,i]of n){e[0]=r;for(let[r,a]of n)e[1]=r,u[t[0]]=i<<4|a}}let n=t(e,m),a=new Uint16Array(n.buffer,n.byteOffset,n.byteLength/2),o=0;for(let e=r-3;o<e;o+=4){let e=a[o],t=a[o+1],n=a[o+2],r=a[o+3],s=u[e],c=u[t],l=u[n],f=u[r];if(!s&&e!==d||!c&&t!==d||!l&&n!==d||!f&&r!==d)throw SyntaxError(m);i[o]=s,i[o+1]=c,i[o+2]=l,i[o+3]=f}for(;o<r;){let e=a[o],t=u[e];if(!t&&e!==d)throw SyntaxError(m);i[o++]=t}}else{if(!u){u=new Int8Array(128).fill(-1);for(let e=0;e<16;e++){let t=e.toString(16);u[t.charCodeAt(0)]=u[t.toUpperCase().charCodeAt(0)]=e}}let t=0;for(let n=0;n<r;n++){let r=e.charCodeAt(t++),a=e.charCodeAt(t++),o=u[r]<<4|u[a];if(o<0||(127|r|a)!=127)throw SyntaxError(m);i[n]=o}}return i}var{toHex:_}=Uint8Array.prototype;function v(e){return a(e),e.length===0?``:_&&e.toHex===_?e.toHex():h(e)}var y=Uint8Array.fromHex?(e,t=`uint8`)=>s(Uint8Array.fromHex(e),t):(e,t=`uint8`)=>s(g(e),t);export{v as a,y as b};
@@ -0,0 +1,9 @@
1
+ import{a as e,b as t,c as n,n as r}from"./chunk-JMG5DXII.js";var i=class extends n{};function a(e,t,n){if(!e)throw new i(typeof n==`function`?n():n,t.line)}var o=/^(\d{4})-(\d\d)-(\d\d)([Tt])(\d\d):(\d\d):(\d\d)(\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))$/u,s=/^(?:\d{4}-\d\d-\d\d(?:[Tt]\d\d:\d\d:\d\d(?:\.\d+)?)?|\d\d:\d\d:\d\d(?:\.\d+)?)$/u,c=/^(?:\d{4}-\d\d-\d\d[Tt])?\d\d:\d\d(?:[Zz]|[+-]\d\d:\d\d)?$/u,l=[31,28,31,30,31,30,31,31,30,31,30,31];function u(e){let t=o.exec(e);if(t===null)return;let[n,r,i,a,s,c]=[t[1],t[2],t[3],t[5],t[6],t[7]].map(Number),u=n%4==0&&n%100!=0||n%400==0;if(r<1||r>12||i<1||i>(r===2&&u?29:l[r-1])||a>23||s>59||c>60||t[10]!==void 0&&(Number(t[11])>23||Number(t[12])>59))return;let d=[];(t[4]===`t`||t[9]===`z`)&&d.push(`a date-time with a lower-case "t" or "z" is not supported`),n===0&&d.push(`the year 0000 is not supported`),c===60&&d.push(`a leap second is not supported`);let f=t[10]===void 0?0:(t[10]===`-`?-1:1)*(Number(t[11])*60+Number(t[12]));return{year:n,month:r,day:i,hour:a,minute:s,second:c,fraction:t[8]?.slice(1)??``,offset:f,unsupported:d}}var d=class{constructor(e){if(typeof e!=`string`||u(e)?.unsupported.length!==0)throw TypeError(`expected an RFC 3339 offset date-time`);this.text=e,Object.freeze(this)}toString(){return this.text}toJSON(){return this.text}toDate(){let{year:e,month:t,day:n,hour:r,minute:i,second:a,fraction:o,offset:s}=u(this.text),c=new Date(0);return c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,i-s,a,Number(o.padEnd(3,`0`).slice(0,3))),c}},f=e=>u(e)?.unsupported.length===0;function ee(e,n){if(!/^(?:\d{4}-\d\d-\d\d|\d\d:\d\d)/u.test(e))return;let r=u(e);if(r?.unsupported.length===0)return new d(e);throw a(!(/^\d{4}-\d\d-\d\d$/u.test(e)&&/^ \d\d:/u.test(n.text.slice(n.pos,n.pos+4))),n,`a date-time with a space in place of "T" is not supported`),a(!s.test(e),n,()=>`local dates and times are not supported: ${t(e)}`),a(!c.test(e),n,()=>`a date-time or a time without seconds is not supported: ${t(e)}`),a(r?.unsupported.length!==1,n,()=>`${r.unsupported[0]}: ${t(e)}`),new i(`${t(e)} is not a date-time of the form YYYY-MM-DDTHH:MM:SS[.fraction](Z|\xB1HH:MM)`,n.line)}var p=/^[+-]?(?:0|[1-9](?:_?\d)*)$/u,m=/^0(?:x[\dA-Fa-f](?:_?[\dA-Fa-f])*|o[0-7](?:_?[0-7])*|b[01](?:_?[01])*)$/u,h=/^[+-]?(?:inf|nan|(?:0|[1-9](?:_?\d)*)(?:\.\d(?:_?\d)*(?:[Ee][+-]?\d(?:_?\d)*)?|[Ee][+-]?\d(?:_?\d)*))$/u,g=2n**63n,_=BigInt(2**53-1),te={__proto__:null,x:16,o:21,b:63};function v(e,n){let r=p.test(e);if(!r&&!m.test(e))return;let i=e.replaceAll(`_`,``),o=r?i.replace(/^[+-]/u,``):i.slice(2).replace(/^0+/u,``),s=o.length<=(r?19:te[i[1]])?BigInt(r?i:`${i.slice(0,2)}${o||`0`}`):void 0;return a(s!==void 0&&s>=-g&&s<g,n,()=>`integer out of range ${t(e)}`),s>=-_&&s<=_?Number(s):s}var y={__proto__:null,inf:1/0,"+inf":1/0,"-inf":-1/0,nan:NaN,"+nan":NaN,"-nan":NaN};function b(e){if(typeof e!=`string`||!h.test(e))return;if(e in y)return y[e];let t=Number(e.replaceAll(`_`,``)),n=!/[1-9]/u.test(e.split(/[Ee]/u)[0]);return Number.isFinite(t)&&(t!==0||n)?t:null}var x=class{constructor(e){let t=b(e);if(t==null)throw TypeError(`expected a TOML float that a double can hold`);this.text=e,this.value=t,Object.freeze(this)}valueOf(){return this.value}toString(){return this.text}toJSON(){return this.value}};function S(e,n){let r=b(e);if(r!==void 0)return a(r!==null,n,()=>`float out of range ${t(e)}`),new x(e)}var C=64;function w(e){for(;e.text[e.pos]===` `||e.text[e.pos]===` `;)e.pos++}function T(e){if(e.pos>=e.text.length)return`the end of the text`;let n=/^[^\n]*/u.exec(e.text.slice(e.pos,e.pos+64+1))[0].replace(/\r$/u,``);return n===``?`the end of the line`:t(n)}var E=`a carriage return must be followed by a line feed`;function D(t,n,r){throw new i(n===`\r`?E:`${e(n)} is not allowed in ${r}`,t.line)}var O=e=>e.pos>=e.text.length||e.text[e.pos]===`
2
+ `||e.text.startsWith(`\r
3
+ `,e.pos),k=/#[^[\p{Cc}--[\t\u0080-\u009F]]]*/vy;function A(e){e.text[e.pos]===`#`&&(r(e,k),O(e)||D(e,e.text[e.pos],`a comment`))}function j(e){if(e.text[e.pos]===`
4
+ `)e.pos+=1;else if(e.text.startsWith(`\r
5
+ `,e.pos))e.pos+=2;else return!1;return e.line++,!0}function M(e){do w(e),A(e);while(j(e))}var N={__proto__:null,b:`\b`,t:` `,n:`
6
+ `,f:`\f`,r:`\r`,'"':`"`,"\\":`\\`},ne={__proto__:null,'"':/[^"\\[\p{Cc}--[\t\u0080-\u009F]]]*/vy,"'":/[^'[\p{Cc}--[\t\u0080-\u009F]]]*/vy},re=/u([\dA-Fa-f]{4})|U([\dA-Fa-f]{8})/uy;function P(e){let n=e.text[e.pos];if(n in N)return N[e.text[e.pos++]];let i=r(e,re);a(i!==null,e,()=>`unsupported escape ${t(`\\${n??``}`)}`);let o=Number.parseInt(i[1]??i[2],16);return a(o<=1114111&&(o<55296||o>57343),e,()=>`\\${i[0]} is not a Unicode scalar value`),String.fromCodePoint(o)}var ie=/[\t ]*\r?\n(?:[\t ]|\r?\n)*/uy;function ae(e){let t=r(e,ie);return t===null?P(e):(e.line+=t[0].split(`
7
+ `).length-1,``)}var F=(e,t)=>e.text[e.pos+1]===t&&e.text[e.pos+2]===t,I={__proto__:null,'"':/"/uy,"'":/'/uy,'"""':/"{3,5}/uy,"'''":/'{3,5}/uy};function L(e,t){let n=F(e,t),i=I[n?t.repeat(3):t];e.pos+=n?3:1,n&&j(e);let o=``;for(;;){if(o+=r(e,ne[t])[0],n&&j(e)){o+=`
8
+ `;continue}a(!O(e),e,`unterminated string`);let s=r(e,i);if(s!==null)return o+s[0].slice(3);let c=e.text[e.pos++];c===t?o+=c:c===`\\`?o+=n?ae(e):P(e):D(e,c,`a string`)}}var R=/[\w-]+/uy;function z(e){let t=e.text[e.pos];if(t===`"`||t===`'`)return a(!F(e,t),e,`a multi-line string cannot be a key`),L(e,t);let n=r(e,R);return a(n!==null,e,()=>`expected a key, found ${T(e)}`),n[0]}function B(e){let t=[z(e)];for(;;){if(w(e),e.text[e.pos]!==`.`)return t;e.pos++,w(e),t.push(z(e)),a(t.length<=C,e,`a key with too many parts`)}}var V=/[\w+.:-]+/uy;function H(e){let n=r(e,V);a(n!==null,e,()=>`expected a value, found ${T(e)}`);let i=n[0];if(i===`true`)return!0;if(i===`false`)return!1;let o=v(i,e)??S(i,e)??ee(i,e);return a(o!==void 0,e,()=>`expected a value, found ${t(i)}`),o}function U(e,n,r,i){a(n[r]===void 0,e,()=>`duplicate key ${t(r)}`),n[r]=i}function W(e,t){let n=B(e);return a(e.text[e.pos]===`=`,e,()=>`expected "=" after the key, found ${T(e)}`),e.pos++,w(e),{header:!1,keys:n,value:X(e,t)}}function G(e,t){e.pos++;let n=[];for(M(e);e.text[e.pos]!==`]`&&(n.push(X(e,t+1)),M(e),e.text[e.pos]!==`]`);M(e))a(e.text[e.pos]===`,`,e,()=>`expected "," or "]", found ${T(e)}`),e.pos++;return e.pos++,n}var K=e=>typeof e==`object`&&!!e&&Object.getPrototypeOf(e)===null,q=new WeakSet,oe=e=>q.has(e);function J(e,t,n,r,i,o){let s=t;for(let t of r.slice(0,-1)){t in s||n.add(s[t]=Object.create(null));let r=s[t];a(n.has(r),e,()=>o(t,r)),s=r}U(e,s,r.at(-1),i)}var se=e=>Array.isArray(e)?`an array`:K(e)?`an inline table`:`a value`,ce=(e,n)=>`${t(e)} is ${se(n)}, which a dotted key cannot add to`;function Y(e){w(e),a(!O(e)&&e.text[e.pos]!==`#`,e,`an inline table across lines is not supported`)}function le(e,t){e.pos++;let n=Object.create(null);q.add(n);let r=new Set;if(Y(e),e.text[e.pos]===`}`)e.pos++;else do{Y(e),a(e.text[e.pos]!==`}`,e,`a trailing comma in an inline table is not supported`);let{keys:i,value:o}=W(e,t+1);J(e,n,r,i,o,ce),Y(e);let s=e.text[e.pos];a(s===`,`||s===`}`,e,()=>`expected "," or "}" on the inline table's line, found ${T(e)}`)}while(e.text[e.pos++]===`,`);return n}function X(e,t){a(t<=C,e,`nested too deep`);let n=e.text[e.pos];return n===`"`||n===`'`?L(e,n):n===`[`?G(e,t):n===`{`?le(e,t):H(e)}function ue(e){let t=e.text.startsWith(`[[`,e.pos);e.pos+=t?2:1,w(e);let n=B(e),r=t?`]]`:`]`;return a(e.text.startsWith(r,e.pos),e,()=>`expected "${r}", found ${T(e)}`),e.pos+=r.length,{header:!0,keys:n,array:t}}function de(e){w(e);let t=e.text[e.pos];if(t===`[`)return ue(e);if(!(t===`#`||t===`\r`||O(e)))return W(e,0)}function fe(e){if(w(e),A(e),!(j(e)||e.pos===e.text.length))throw a(e.text[e.pos]!==`\r`,e,E),new i(`expected the end of the line, found ${T(e)}`,e.line)}function Z(e,t){return e.arrays.has(t)?`an array of tables`:Array.isArray(t)?`an array`:K(t)?e.fixed.has(t)?`an inline table`:`a table`:`a value`}var Q=e=>t(e.join(`.`));function pe(e,n,r){let i=e.root;for(let o of r){o in i||e.implicit.add(i[o]=Object.create(null));let r=e.arrays.has(i[o])?i[o].at(-1):i[o];a(K(r)&&!e.fixed.has(r),n,()=>`${t(o)} is ${Z(e,r)}, which a header cannot add to`),i=r}return i}function $(e,t,n,r){e.pending.clear();let i=pe(e,t,n.slice(0,-1)),o=n.at(-1);if(r){o in i||e.arrays.add(i[o]=[]),a(e.arrays.has(i[o]),t,()=>`${Q(n)} is ${Z(e,i[o])}, not an array of tables`),i[o].push(e.current=Object.create(null));return}o in i?a(e.implicit.delete(i[o]),t,()=>`${Q(n)} is ${Z(e,i[o])} already`):i[o]=Object.create(null),e.current=i[o]}function me(e,n,r){return!K(r)||e.fixed.has(r)?`${t(n)} is ${Z(e,r)}, which a dotted key cannot add to`:e.implicit.has(r)?`a dotted key through ${t(n)}, a table a header made on its way, is not supported`:`${t(n)} is a table declared elsewhere, which a dotted key cannot add to`}function he(e,t,n,r){J(t,e.current,e.pending,n,r,(t,n)=>me(e,t,n)),K(r)&&e.fixed.add(r)}var ge={__proto__:null,"":`a byte order mark is not read`,"�":`U+FFFD is not supported: a decoder puts it where bytes are not UTF-8`};function _e(e){if(typeof e!=`string`)throw TypeError(`expected a string`);let t=/\p{Cs}|^\uFEFF|\uFFFD/u.exec(e);if(t===null)return;let n=e.slice(0,t.index).split(`
9
+ `).length-1;throw new i(ge[t[0]]??`a lone surrogate is not well-formed Unicode`,n)}function ve(e){_e(e);let t=Object.create(null),n={text:e,pos:0,line:0},r={root:t,current:t,implicit:new Set,pending:new Set,arrays:new Set,fixed:new Set};for(;n.pos<e.length;){let e=de(n);e?.header===!0?$(r,n,e.keys,e.array):e!==void 0&&he(r,n,e.keys,e.value),fe(n)}return t}export{i as a,d as b,f as c,x as d,K as e,oe as f,ve as g};
@@ -0,0 +1 @@
1
+ var e=/^\d+(?:\.[\dA-Za-z]+)*$/u,t=t=>e.test(t),n=e=>/[A-Za-z]/u.test(e),r=e=>(e.match(/\d+|[A-Za-z]+/gu)??[]).map(e=>/^\d/u.test(e)?BigInt(e):e),i=e=>Array.from(e.matchAll(/[.0]+/gu),e=>[e.index,e.index+e[0].length]);function a(e,[t,n],r){for(let i=t;i<n;i++)if(r(e[i-1]))return i}function o(e){let t=e.length;for(;e[t-1]===`.`||e[t-1]===`0`;)t--;let o=t<e.length?a(e,[t,e.length],e=>e!==void 0&&/[A-Za-z.]/u.test(e)):void 0,s=e.slice(0,o);if(!n(e))return r(s);for(let e of i(s)){let t=/[A-Za-z]/u.test(s[e[1]]??``)?a(s,e,e=>e===void 0||e===`.`):void 0;if(t!==void 0)return r(`${s.slice(0,t)}${s.slice(e[1])}`)}return r(s)}var s=(e,t)=>e<t?-1:+(e>t);function c(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let[r,i]=[e[n]??0n,t[n]??0n];if(r!==i)return typeof r==typeof i?s(r,i):typeof r==`string`?-1:1}return 0}var l=(e,t)=>e===t?0:c(o(e),o(t));function u(e){let t=r(e),n=t.findIndex(e=>typeof e==`string`);return n===-1?t:t.slice(0,n)}var d=e=>n(e)?u(e).join(`.`):e;function f(e){let t=u(e);return t.length>1&&t.pop(),t[t.length-1]+=1n,t.join(`.`)}var p={__proto__:null,"=":e=>e===0,"!=":e=>e!==0,">":e=>e>0,"<":e=>e<0,">=":e=>e>=0,"<=":e=>e<=0},m=/^(=|!=|>|<|>=|<=|~>) (\S+)$/u;function h(e,n=t){let r=m.exec(e);return r===null||!n(r[2])?void 0:[r[1],r[2]]}function g(e,[t,n]){return t===`~>`?l(e,n)>=0&&l(d(e),f(n))<0:p[t](l(e,n))}function _(e){let t=e.map(o),r=e.map((e,r)=>n(e)?o(d(e)):t[r]);return{sorted:t.sort(c),release:r.sort(c).at(-1),keys:void 0}}function v(e,[t,n]){let r=o(n);if(t===`!=`)return!(e.keys??=new Set(e.sorted.map(e=>e.join(`.`)))).has(r.join(`.`));let i=c(e.sorted[0],r);return t===`~>`?i>=0&&c(e.release,o(f(n)))<0:p[t](i)&&p[t](c(e.sorted.at(-1),r))}export{t as a,l as b,h as c,g as d,_ as e,v as f};
@@ -0,0 +1,4 @@
1
+ import{a as e,b as t,c as n,d as r}from"./chunk-M3Y6SLC4.js";import{a as i,b as a,c as o,d as s,e as c}from"./chunk-PAD2JHZT.js";import{C as l,F as u,H as d,J as f,M as p,O as m,Q as h,S as g,e as _,f as v,h as y,k as b,m as x,n as S,o as C,p as w,u as T,v as E,w as D,x as O,z as k}from"./chunk-UCP3JRE2.js";import{b as ee}from"./chunk-DEVAORP2.js";import{d as te}from"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{a as ne,d as A,h as j,i as M,j as N,k as P,l as re,o as ie,p as F,r as ae,s as I,t as oe}from"./chunk-JMG5DXII.js";import"./chunk-OOJM4CTU.js";var se=[`name`,`version`,`uid`,`resolved`,`integrity`,`dependencies`,`optionalDependencies`];function ce(e,t){let n=e.indexOf(`@`,1);if(n===-1)throw new A(`${j(e)} is not a pattern of the form name@range`,t);return{name:O(e.slice(0,n),t),range:e.slice(n+1)}}function le(e){if(!e.startsWith(`npm:`))return;let t=e.slice(4),n=t.indexOf(`@`,1);return n===-1?{name:t,range:``}:{name:t.slice(0,n),range:t.slice(n+1)}}var ue=new Set([`github.com`,`gitlab.com`,`bitbucket.com`,`bitbucket.org`]);function L(e){if(/^(?:git:|git\+.+:|ssh:|https?:.+\.git(?:$|#.))/u.test(e))return!0;let t=URL.parse(e);return t!==null&&ue.has(t.hostname)&&`${t.pathname}${t.search}`.split(`/`).filter(Boolean).length===2}var de=/^[^:@%/\s.-][^:@%/\s]*\/[^:@\s/%][^:@\s/%#]*(?:#.*)?$/u;function R(e){return L(e)?`git`:/^https?:\/\//u.test(e)||!e.includes(`@`)&&/\.(?:tgz|tar\.gz)$/u.test(e)?`tarball`:e.startsWith(`github:`)||de.test(e)?`github`:/^(?:file:|\.{1,2}\/|\/)/u.test(e)?`file`:/^(link|gitlab|gist|bitbucket):/u.exec(e)?.[1]??`registry`}var fe={github:{host:`github.com`,archive:e=>[`https://codeload.github.com/${e}/tar.gz/`,``]},gitlab:{host:`gitlab.com`,archive:e=>[`https://gitlab.com/${e}/repository/archive.tar.gz?ref=`,``]},bitbucket:{host:`bitbucket.org`,archive:e=>[`https://bitbucket.org/${e}/get/`,`.tar.gz`]}};function pe(e){let t=e.split(`@`),n=(t.length>2?`${t[1]}@${t[2]}`:e).replace(/#.*/u,``).replace(/^.*:/u,``).replace(/.git$/u,``).split(`/`);return n.length<2?void 0:n.slice(-2).join(`/`)}function z(e){let t=e.replace(/^(?:file|link):/u,``);return t.startsWith(`/`)?`/${t.split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`)}`:u(`.`,t)}function me(e,t,n){let r=k(e,t);if(n!==void 0&&n.valid(r)===null)throw new A(`${j(r)} is not a version semver reads`,t);return r}function he(e,t,n,r,i){if(e.startsWith(`file:`))l(e.slice(e.startsWith(`file:./`)?7:5),r);else if(!h(e))throw new A(`${j(e)} is not an http(s) URL, a file: path or a git URL`,r);if(t!==void 0&&!f(t))throw new A(`${j(t)} is not the hex sha1 of a tarball`,r);let a=n===void 0?void 0:m(n,i).get(`sha1`);if(t!==void 0&&a!==void 0&&a.slice(5)!==te(ee(t)))throw new A(`${j(a)} is not the sha1 after the "#" of resolved`,i);return{type:`tarball`,tarball:e,sha1:t,integrity:n}}function ge(e,t){let n=M(t,`resolved`),r=M(t,`integrity`);if(e.resolved===void 0){if(e.integrity!==void 0)throw new A(`an integrity, with nothing resolved`,r);return}let[i,a,...o]=S(e.resolved,n).split(`#`);if(o.length>0)throw new A(`more than one "#", of which yarn reads the first alone`,n);if(!L(i))return he(i,a,e.integrity,n,r);if(e.integrity!==void 0)throw new A(`an integrity, which yarn does not check for a git repository`,r);if(a===void 0||!d(a))throw new A(`expected a full commit hash after the "#" of ${j(i)}`,n);return{type:`git`,repo:p(i,n),commit:a}}function B(e){if(e!==void 0)return e.type===`git`?`${e.repo}#${e.commit}`:e.tarball.replace(/^file:\.\//u,`file:`)}var _e=e=>e===void 0?`nothing, as for a directory`:e.type===`git`?`a git repository`:`a file: tarball`;function ve(e,t,n){let[r]=e,i=e.find(e=>e.name!==r.name);if(i!==void 0)throw new A(`${j(r.key)} and ${j(i.key)} give it two names, of which yarn installs it under one alone`,n);if(t.name!==void 0){let e=y(t.name,M(n,`name`)),i=e===r.name?`the name its patterns give, which yarn does not write`:`yarn installs this as ${j(e)}, and leaves ${j(r.name)} out, which its patterns ask for`;throw new A(i,M(n,`name`))}let a=e.filter(e=>e.source===`registry`).map(({key:e,name:t,alias:r})=>[e,r===void 0?t:O(r.name,n)]),o=a.find(([,e])=>e!==a[0][1]);if(o!==void 0)throw new A(`${j(a[0][0])} and ${j(o[0])} ask for two packages, ${j(a[0][1])} and ${j(o[1])}`,n);return a[0]?.[1]}function ye({range:e,source:t},n){let r=e.split(`#`)[0];if(t===`file`||t===`link`)return n===void 0;if(t===`tarball`)return n?.tarball===r;if(t===`git`)return n?.repo===r;if(t===`gist`)return n?.repo===`https://gist.github.com/${r.slice(5)}.git`;let{host:i,archive:a}=fe[t],o=pe(e);if(o===void 0||n===void 0)return!1;if(n.type===`git`)return n.repo===`git+ssh://git@${i}/${o}.git`;let[s,c]=a(o),{tarball:l}=n;return l.startsWith(s)&&l.endsWith(c)&&d(l.slice(s.length,l.length-c.length))}function be(e,t){let[n,...r]=e.filter(e=>e.source===`file`||e.source===`link`),i=r.find(e=>n.source===`link`||e.source===`link`||z(e.range)!==z(n.range));if(i!==void 0)throw new A(`${j(n.key)} and ${j(i.key)} share an entry, where yarn writes one for each`,t)}function xe(e,t,{asks:n,version:r},i){let a=e.filter(e=>e.source!==`registry`),o=a.find(e=>!ye(e,t));if(o!==void 0)throw new A(`${j(o.key)} resolves to another source than it names`,M(i,`resolved`));be(e,i);let s=e.find(e=>e.source===`registry`);if((a.length===0||a.some(e=>e.source===`tarball`))&&t?.type===`tarball`&&t.sha1===void 0&&t.integrity===void 0)throw new A(`a tarball with no hash, neither a sha1 after "#" nor an integrity, where yarn writes the sha1`,M(i,`resolved`));if(s!==void 0){if(a.length>0)return{registry:s.key,sources:a.map(e=>e.key)};if(t===void 0&&e.length===1)return{registry:s.key,sources:[]};if(t?.type!==`tarball`||t.tarball.startsWith(`file:`))throw new A(`${j(s.key)} asks for the registry, and resolves to ${_e(t)}`,i);g(t.tarball,n,r,M(i,`resolved`))}}function Se(e,t,n){let r=Object.create(null);for(let[i,a,o]of v(b(e),t)){let e=`${O(i,o)}@${y(a,o)}`;r[i]=e,n.push({targets:r,name:i,range:a,pattern:e,where:o})}return r}function Ce({keys:e,fields:n},r,i){_(n,r,se);let a=e.map(e=>{let{name:t,range:n}=ce(e,M(``,e));return{key:e,name:t,range:n,source:R(n),alias:le(n)}}),o=ve(a,n,r),s=me(n.version,M(r,`version`),i),c=ge(n,r),l=xe(a,c,{asks:o,version:s},r),u=[],{dependencies:d,optionalDependencies:f}=t(n,r,(e,t)=>Se(e,t,u)),p=x(n,`uid`,r,y);if(p===s)throw new A(`the version, which yarn does not write as a uid`,M(r,`uid`));return{pkg:{patterns:e,name:a[0].name,version:s,uid:p,resolution:c,dependencies:d,optionalDependencies:f},patterns:a,handed:l,requests:u}}var we=/^(?![vV=]?\d|[xX*](?:\.|$))[A-Za-z][\w.-]*$/u;function V(e,t){return t===void 0?!/[:/@#]/u.test(e)&&!we.test(e):t.validRange(e)!==null}function Te(e,t,n,r,i){let a=e=>e.source===`registry`&&V(e.range,r),o=t.find(a)??n.patterns.find(a);if(o!==void 0)throw new A(`is ${e.name} ${e.version}, as ${j(n.key)} is, and yarn gives ${j(o.key)} whichever it resolves first`,i)}var H=({integrity:e})=>e===void 0?new Map:m(e),U=e=>JSON.stringify(Object.entries(e).sort(([e],[t])=>e<t?-1:1));function W(e,t,n,r){for(let i of[`dependencies`,`optionalDependencies`])if(U(e[i])!==U(t[i]))throw new A(`other ${i} ${n}`,M(r,i))}function Ee(e,t,n){let r=`than ${j(t.patterns[0])}, of the same ${e.resolution.type===`git`?`commit`:`tarball`}`;if(e.version!==t.version)throw new A(`another version ${r}`,M(n,`version`));W(e,t,r,n);let[i,a]=[e.resolution,t.resolution];if(i.sha1!==void 0&&a.sha1!==void 0&&i.sha1!==a.sha1)throw new A(`another sha1 ${r}`,M(n,`resolved`));let o=H(a);for(let[e,t]of H(i))if(o.has(e)&&o.get(e)!==t)throw new A(`another ${e} integrity ${r}`,M(n,`integrity`))}function De(e,t){let n=Object.create(null),r=[],i=[],a=[],o=new Map,s=new Map,c=new Map;for(let l of e){let[e]=l.keys,u=M(``,e),d=Ce(l,u,t),{pkg:f}=d;for(let e of l.keys)n[e]=f;r.push(...d.patterns),i.push(...d.requests),d.handed!==void 0&&a.push({pkg:f,...d.handed});let p=d.patterns.find(e=>e.source===`file`),m=l.fields.resolved??(p===void 0?void 0:`
2
+ ${z(p.range)}`),h=m===void 0?void 0:`${f.name}
3
+ ${m}`;if(o.has(h))throw new A(`resolves as ${j(o.get(h))} does, which yarn writes as one entry`,u);h!==void 0&&o.set(h,e);let g=B(f.resolution);if(g!==void 0){let e=s.get(g)??s.set(g,[]).get(g);e.length>0&&Ee(f,e[0],u),e.push(f)}if(d.handed?.sources.length===0)continue;let _=`${f.name}
4
+ ${f.version}`,v=c.get(_);v===void 0?c.set(_,{key:e,patterns:d.patterns}):Te(f,d.patterns,v,t,u)}for(let e of a)e.other=s.get(B(e.pkg.resolution))?.find(t=>t!==e.pkg);return{packages:n,patterns:r,requests:i,mixed:a}}var G=`manifests`;function Oe(e,t,n){let r=/^(?:file|link):/u.exec(e)?.[0];if(r===void 0&&!e.startsWith(`/`))return e;let i=e.slice(r?.length??0);if(i.startsWith(`/`)||/^[A-Za-z]:/u.test(i))throw new A(`${j(e)} is an absolute path`,n);let a=l(u(t,i),n);return`${r}${a!==`.`&&/^\.(?:\/|$)/u.test(i)&&!/^\.{0,2}\//u.test(a)?`./`:``}${a}`}var K=(e,t,n)=>n===void 0?e.version===t||void 0:n.satisfies(e.version,t,{loose:!0});function q({name:e,range:t,pattern:n,where:r},i,a){let o=i.get(e);if(o!==void 0&&K(o,t,a)===!0)throw new A(`${j(n)} is satisfied by the workspace ${j(o.dir)}, which yarn links instead`,r)}function J({name:e,range:t,pattern:n,where:r},i,a){let o=i?.get(e);if(o===void 0)throw new A(`${j(n)} is not a pattern of the lockfile${i===void 0?`, nor a workspace's, as only the manifests may say`:``}`,r);if(K(o,t,a)===!1)throw new A(`${j(n)} is not a pattern of the lockfile, nor satisfied by the workspace ${j(o.dir)}, ${o.version}`,r);return`link:${o.dir}`}function Y(e,t,n,r){for(let i of e)i.pattern in t||(i.targets[i.name]=J(i,n,r))}function X(e,{packages:t,workspaces:n,semver:r}){return e.pattern in t?(q(e,n,r),e.pattern):J(e,n,r)}var ke=[`optionalDependencies`,`dependencies`,`devDependencies`];function Ae(t,n,r,i){let a=new Map;for(let e of ke)for(let[n,i,o]of v(b(t[e]),M(r,e))){if(n===`//`)continue;let t=y(i,o),r=a.get(n)??a.set(n,{kind:e,value:t,here:o,range:void 0}).get(n);r.range===void 0&&t!==``&&t!==`*`&&(r.range=t)}let o=Object.create(null);for(let t of e)o[t]=Object.create(null);for(let[e,{kind:t,value:r,here:s,range:c}]of a){let a=Oe(c??r,n,s);o[t][e]=X({name:e,range:a,pattern:`${O(e,s)}@${a}`,where:s},i)}return o}function je(e,t,n){let r=[];for(let[a,o,s]of v(b(e),t)){if(a===`//`)continue;if(/\/$|\/\/|\*$/u.test(a))throw new A(`${j(a)} is a path yarn ignores`,s);let e=a.match(/(?:@[^/]+\/)?[^/]+/gu)??[a],t=i(e.length===1?`**/${a}`:a,s),c=O(e.at(-1),s),l=e.slice(0,-1).find(e=>e!==`**`&&!D(e.replaceAll(/[*?]/gu,`x`)));if(l!==void 0)throw new A(`${j(l)} is not a package name, or a glob of one`,s);let u=y(o,s);if(R(u)===`registry`&&!V(u,n))throw new A(`${j(u)} is a range yarn ignores in a resolution: neither a semver range nor a source`,s);r.push({path:a,tests:t,name:c,range:u,pattern:`${c}@${u}`,where:s})}return r}function Me(t,r,i){let a=Object.values(t).flatMap(t=>e.map(e=>t[e])),o=n([i.map(e=>e.pattern).filter(e=>e in r),...a],r);if(o!==void 0)throw new A(`nothing asks for it: no manifest, no package and no resolution`,M(``,o))}function Ne(e,t){let n=e.workspaces;if(n===void 0)return[];let r=M(t,`workspaces`),a=n;Array.isArray(n)||(_(n,r,[`packages`,`nohoist`]),x(n,`nohoist`,r,C),a=n.packages===void 0?[]:n.packages,r=M(r,`packages`));let o=C(a,r);if(o.length>0&&e.private!==!0)throw new A(`expected true, as yarn has workspaces in a private project alone`,M(t,`private`));return o.map((e,t)=>i(e.replace(/^(?:\.\/)+/u,``).replace(/(?<!\/)\/+$/u,``),`${r}[${t}]`))}var Pe={__proto__:null,depdenencies:`dependencies`,dependancies:`dependencies`,dependecies:`dependencies`,depends:`dependencies`,"dev-dependencies":`devDependencies`,devDependences:`devDependencies`,devDepenencies:`devDependencies`,devEependencies:`devDependencies`,devdependencies:`devDependencies`},Fe=/^[\s\dA-Za-z.+=-]{1,256}$/u;function Ie(e,t,n){let r=S(e,t);if(!Fe.test(r))throw new A(`${j(r)} is not a version`,t);if(n===void 0)return r;let i=n.clean(r,{loose:!0});if(i===null)throw new A(`${j(r)} is not a version semver reads`,t);return i}function Le(e,t,n,r,i){for(let e of Object.keys(Pe))if(Object.hasOwn(t,e))throw new A(`a field yarn does not read, for ${j(Pe[e])}`,M(n,e));if(l(e,n)===`.`)return;if(r.length===0)throw new A(`expected workspaces, as there are manifests of workspaces`,M(M(G,`.`),`workspaces`));if(e.split(`/`).includes(`node_modules`)||!r.some(t=>c(t,e)))throw new A("not a workspace the root's `workspaces` finds",n);if(t.resolutions!==void 0)throw new A(`a workspace's, which yarn does not read`,M(n,`resolutions`));let a=M(n,`name`),o=O(y(t.name,a),a);if(t.version===void 0)throw new A(`expected a version, without which yarn ignores the workspace`,M(n,`version`));return{name:o,dir:e,version:Ie(t.version,M(n,`version`),i)}}function Re(e,t,n,r){_(e,G);let i=M(G,`.`),a=e[`.`];if(a===void 0)throw new A(`expected the manifest beside the lockfile, "."`,G);let o=Ne(_(a,i),i),s=new Map;for(let[t,n,i]of v(e,G)){let e=Le(t,_(n,i),i,o,r);if(e!==void 0){if(s.has(e.name))throw new A(`the name of the workspace ${j(s.get(e.name).dir)} too`,M(i,`name`));s.set(e.name,e)}}for(let e of n)e.pattern in t&&q(e,s,r);Y(n,t,s,r);let c={packages:t,workspaces:s,semver:r},l=w(e,G,(e,t,n)=>Ae(e,n,t,c)),u=je(a.resolutions,M(i,`resolutions`),r);for(let e of u){if(!(e.pattern in t)&&!s.has(e.name))throw new A(`${j(e.pattern)} is not a pattern of the lockfile, where yarn records every resolution's`,e.where);e.target=X(e,c)}return Me(l,t,u),{importers:l,workspaces:s,rules:u,aggregated:Array.isArray(a.workspaces?.packages??a.workspaces)}}var ze=`workspace-aggregator-00000000-0000-0000-0000-000000000000`;function Be(t,{importers:n,workspaces:r,rules:i,aggregated:c},l){let u=i.map(e=>e.tests),d=(e,t)=>t.split(`/`).reduce((e,t)=>e.map((e,n)=>o(u[n],e,t)),e),f=e=>e.startsWith(`link:`)?n[e.slice(5)]:t[e],p=(e,t,r,i)=>{let a=e.patterns===void 0?M(G,Object.keys(n).find(t=>n[t]===e)):M(``,e.patterns[0]);return new A(`${j(e[t][r])} ${i}`,M(M(a,t),r))},m=new Map,h=[],g=new Set,_=new Map,v=(e,t,n,r)=>{let i=e[t][n],a=r===void 0||r.pattern===i,o=a?_.get(i):g.has(i)?r:void 0;if(o!==void 0)throw p(e,t,n,`is asked for both where the resolution ${j(o.path)} applies and where none does, and yarn writes one entry for both`);a?g.add(i):_.set(i,r)},y=new Set,x=(e,t)=>{if(y.has(e))return;let n=m.get(e)??new Set,r=t.join();n.has(r)||(m.set(e,n.add(r)),h.push([e,t]))},S=n[`.`],C=u.map(e=>a(e,1)),w=d(C,ze),T=new Map,E=[],D=(e,n)=>t[e.target]===n||l.get(n)?.sources[0]===e.target,O=(e,n,a,o)=>{let m=e[n][a],h=d(o,a),g=t[m],_=l.get(g),y=_===void 0?``:`the resolution ${j(_.rule.path)} resolves to`,b=e===S&&(!c||r.has(a)),C=e===S&&!b?d(w,a):h,O=i.find((e,t)=>e.name===a&&s(u[t],C[t]));if(b){if(_!==void 0)throw p(e,n,a,`is given what ${y}, which yarn applies to no dependency of the root's own`);if(O!==void 0&&!D(O,g))throw p(e,n,a,`is not given ${j(O.pattern)} as the resolution ${j(O.path)} says, which yarn ignores for the root's own dependencies`);return v(e,n,a,void 0),x(f(m),h)}if(O!==void 0&&!D(O,g))throw p(e,n,a,`is not given ${j(O.pattern)}, which the resolution ${j(O.path)} resolves it to`);if(_?.sources.includes(m))throw p(e,n,a,`asks for what ${y}, as a dependency of its own`);if(_!==void 0&&!_.sources.includes(O?.target))throw p(e,n,a,`is given what ${y}, which yarn does not apply to it here`);v(e,n,a,O),e===S&&O!==void 0&&T.set(m,O),O===void 0?x(f(m),h):O.target.startsWith(`link:`)&&E.push([e[n],a,O.target])},k=()=>{for(;h.length>0;){let[t,n]=h.pop();for(let r of e)for(let e of Object.keys(b(t[r])))O(t,r,e,n)}};for(let e of i)e.pattern in t&&(g.add(e.pattern),x(t[e.pattern],d(C,e.name)));k(),y=new Set(m.keys());for(let t of e)for(let e of Object.keys(S[t]))O(S,t,e,C);for(let[e,{dir:t}]of r)x(n[t],d(w,e));k();for(let[e,t,n]of E)e[t]=n;return{plain:g,own:T}}function Ve(e,t,n,r,i){for(let{key:a,range:o,source:s,alias:c}of t){let t=n?.own.get(a);if(s!==`registry`||t===void 0&&n?.plain.has(a)===!1)continue;let l=c?.range??o,{version:u}=e[a];if(l===``||r.satisfies(u,l)||r.validRange(l)===null)continue;let d=i?`and no resolution gives it`:`which only a resolution may excuse, as the manifests would say`;throw t!==void 0&&(d=`which the root asks for before the resolution ${j(t.path)} applies, so yarn takes it as outdated`),new A(`${u} does not satisfy ${j(l)}, ${d}`,M(``,a))}}function He(e,t,n){let r=t?.workspaces.get(e.name);if(r===void 0)return;let i=t.rules.find(e=>e.target===`link:${r.dir}`);if(i===void 0)return;let a=`than the workspace ${j(r.dir)}, which the resolution ${j(i.path)} gives it`;if(e.version!==r.version)throw new A(`another version ${a}, ${r.version}`,M(n,`version`));return W(e,t.importers[r.dir],a,n),i}function Ue({packages:e,patterns:t,mixed:n},r,i){let a=new Map;for(let{pkg:e,registry:t,sources:i,other:o}of n){let n=M(``,e.patterns[0]);if(i.length===0){let i=He(e,r,n);if(i===void 0)throw new A(`${j(t)} asks for the registry, and resolves to nothing, ${r===void 0?`which only a resolution to a workspace may, as the manifests would say`:`as for a directory`}`,n);a.set(e,{sources:[i.target],rule:i});continue}if(r===void 0)throw new A(`${j(t)} asks for the registry, and is given what ${j(i[0])} names, which only a resolution may, as the manifests would say`,n);let s=i.find(e=>!r.rules.some(t=>t.pattern===e));if(s!==void 0)throw new A(`${j(t)} asks for the registry, and is given what ${j(s)} names, which no resolution does`,n);let c=r.rules.find(e=>i.includes(e.pattern));if(o!==void 0)throw new A(`asks for what the resolution ${j(c.path)} resolves to, as a dependency of its own`,M(``,o.patterns[0]));a.set(e,{sources:i,rule:c})}let o=r!==void 0&&r.rules.length>0?Be(e,r,a):void 0;i!==void 0&&Ve(e,t,o,i,r!==void 0);for(let[t,{sources:n}]of a)n[0].startsWith(`link:`)&&delete e[t.patterns[0]]}var We=[`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.`,`# yarn lockfile v1`],Ge=/^# yarn lockfile v(\d+)$/u,Ke=/[:\s\\",[\]]/u,qe=e=>e.startsWith(`true`)||e.startsWith(`false`)||Ke.test(e)||!/^[A-Za-z]/u.test(e),Je=/[A-Za-z][^\s:\\",[\]]*/uy;function Ye(e,t,n){let[r,i]=oe(e,t,n);if(r.includes(`\\"`))throw N(`${j(r)} is a string yarn reads to another quote`,n);let a=P.exec(r)?.[0];if(a!==void 0)throw N(`an escape for ${ne(a)}, which is not allowed`,n);if(!qe(r))throw N(`${j(r)} is quoted, where yarn writes it bare`,n);return[r,i]}function Xe(e,t,n){if(e[t]===`"`)return Ye(e,t,n);Je.lastIndex=t;let r=Je.exec(e)?.[0];if(r===void 0)throw N(`expected a string, found ${ie(e,t)}`,n);if(qe(r))throw N(`${j(r)} is bare, where yarn quotes it`,n);return[r,t+r.length]}function Z(e,t,n){let[r,i]=Xe(e,t,n);if(r===``)throw N(`an empty key, which yarn does not read`,n);return[r,i]}function Ze(e,t,n){let[r,i]=Xe(e,t,n);if(r.startsWith(`null`)&&e[t]!==`"`)throw N(`${j(r)} is bare, and read as null by some readers`,n);return Q(e,i,n),r}function Q(e,t,n){if(t!==e.length)throw N(`expected the end of the line, found ${j(e.slice(t))}`,n)}function Qe(e,t){if(e.line!==t)throw N(`expected yarn's header, ${j(t)}`,e.number);I(e)}function $e(e){Qe(e,We[0]);let t=Ge.exec(e.line??``)?.[1];if(t!==void 0&&t!==`1`)throw N(`unsupported version: expected "1", found ${j(t)}`,e.number);for(Qe(e,We[1]);e.line?.startsWith(`#`);I(e)){if(/^yarn lockfile v\d+$/u.test(e.line.slice(1).trim()))throw N(`a second lockfile version`,e.number);if(e.line===`#`)throw N(`a comment of "#" alone, which @yarnpkg/parsers does not read`,e.number)}}function $(e,t,n,r,i){let a=Object.create(null);for(let n=e.line;n?.startsWith(` `)&&F(n)>t-2;n=e.line){if(F(n)!==t)throw N(`expected ${t} spaces of indentation, found ${F(n)}`,e.number);let[r,o]=Z(n,t,e.number);i(a,r,o,n,e.number)}if(Object.keys(a).length===0)throw N(n,r);return a}var et=(e,t,n)=>$(e,4,`expected what ${j(t)} holds below it`,n,(n,r,i,a,o)=>{if(a[i]!==` `)throw N(`expected a space and a range after ${j(r)}`,o);let s=Ze(a,i+1,o);if(r in n)throw N(`${j(r)} is in ${j(t)} twice`,o);n[r]=s,I(e)}),tt=(e,t)=>$(e,2,`expected the fields of the entry below it`,t,(t,n,r,i,a)=>{if(n in t)throw N(`the field ${j(n)} twice`,a);if(i[r]===`:`){Q(i,r+1,a),I(e),t[n]=et(e,n,a);return}if(i[r]!==` `)throw N(`expected a space and a value, or ":", after ${j(n)}`,a);t[n]=Ze(i,r+1,a),I(e)});function nt(e,t){let{line:n,number:r}=e,i=[];for(let e=0;;){let[a,o]=Z(n,e,r);if(t.has(a))throw N(`${j(a)} is a key ${t.get(a)===r?`twice`:`at line ${t.get(a)+1} too`}`,r);if(t.set(a,r),i.push(a),n[o]===`:`){Q(n,o+1,r);break}if(!n.startsWith(`, `,o))throw N(`expected ", " and a pattern, or ":", after ${j(a)}`,r);e=o+2}return I(e),{keys:i,fields:tt(e,r)}}function rt(e){re(e,`yarn`);let t=ae(e,P);I(t),$e(t);let n=[],r=new Map,i;for(let e=t.line;e!==void 0;e=t.line){if(e===``){n.length>0&&(i??=t.number),I(t);continue}if(e.startsWith(` `))throw i===void 0?N(`expected an entry, at column 0`,t.number):N(`a blank line within an entry`,i);if(e.startsWith(`#`))throw N(`a comment, which yarn writes in the header alone`,t.number);i=void 0,n.push(nt(t,r))}return n}var it=[`manifests`,`checkVersions`,`semver`],at=[`clean`,`satisfies`,`valid`,`validRange`];function ot(e,t){let n=t===void 0?()=>({dev:void 0,optional:void 0,devOptional:void 0}):r(e,t);for(let t of new Set(Object.values(e)))Object.assign(t,n(t))}function st(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let{manifests:n,semver:r}=T(t,it);E(t,at);let i=De(rt(e),r),{packages:a,requests:o}=i;n===void 0&&Y(o,a);let s=n===void 0?void 0:Re(n,a,o,r);return Ue(i,s,r),ot(a,s?.importers),{packages:a,importers:s?.importers}}export{A as LockfileError,st as parseYarn1Lockfile};
@@ -0,0 +1 @@
1
+ var e=2n**64n-1n,t=`0|[1-9]\\d*`,n=`\\d*[A-Za-z-][\\dA-Za-z-]*|${t}`,r=`(?:${n})(?:\\.(?:${n}))*`,i=`[\\dA-Za-z-]+(?:\\.[\\dA-Za-z-]+)*`,a=`[*Xx]`,o=RegExp(`^(${t})\\.(${t})\\.(${t})(?:-(${r}))?(?:\\+(${i}))?$`,`u`),s=RegExp(`^(?:${r})?$`,`u`),c=RegExp(`^(?:${i})?$`,`u`),l=RegExp(`^ *${a} *$`,`u`),u=RegExp(`^ *(?:(>=|<=|=|>|<|~|\\^) *)?(${t})(?:\\.(?:(${a})(?:\\.${a})?|(${t})(?:\\.(?:(${a})|(${t})(?:-(${r}))?(?:\\+${i})?))?))? *$`,`u`);function d(t){if(t===void 0)return;if(t.length>20)return null;let n=BigInt(t);return n>e?null:n}var f=t=>typeof t==`bigint`&&t>=0n&&t<=e;function p(e){if(typeof e!=`string`)throw TypeError(`expected a string`);return e}function m(e){let t=o.exec(p(e));if(t===null)return;let[n,r,i]=t.slice(1,4).map(d);if(![n,r,i].includes(null))return{major:n,minor:r,patch:i,pre:t[4]??``,build:t[5]??``}}function h(e){let t=u.exec(e);if(t===null)return;let[,n,r,i,a,o,s,c=``]=t,[l,f,p]=[r,a,s].map(d);if(![l,f,p].includes(null))return{op:n??(i||o?`*`:`^`),major:l,minor:f,patch:p,pre:c}}var g=32;function _(e){if(l.test(p(e)))return[];let t=e.split(`,`,g+1);if(t.length>g)return;let n=t.map(h);return n.includes(void 0)?void 0:n}var v=(e,t)=>e===t?0:e<t?-1:1;function y(e,t){if(e===t)return 0;if(e===``)return 1;if(t===``)return-1;let[n,r]=[e.split(`.`),t.split(`.`)];for(let[e,t]of n.entries()){let n=r[e];if(n===void 0)return 1;let[i,a]=[/^\d+$/u.test(t),/^\d+$/u.test(n)];if(i!==a)return i?-1:1;let o=i&&v(t.length,n.length)||v(t,n);if(o!==0)return o}return n.length===r.length?0:-1}function b(e,t){for(let n of[`major`,`minor`,`patch`]){if(e[n]===void 0)return t.pre===e.pre?0:NaN;if(t[n]!==e[n])return v(t[n],e[n])}return y(t.pre,e.pre)}var x=(e,t)=>t.major===e.major&&(e.minor===void 0||t.minor===e.minor)&&b(e,t)>=0;function S(e,t){return t.major===e.major?e.minor===void 0?!0:e.patch===void 0?e.major>0n?t.minor>=e.minor:t.minor===e.minor:(e.major>0n||t.minor===e.minor&&(e.minor>0n||t.patch===e.patch))&&b(e,t)>=0:!1}var C=new Map([[`=`,(e,t)=>b(e,t)===0],[`*`,(e,t)=>b(e,t)===0],[`>`,(e,t)=>b(e,t)>0],[`>=`,(e,t)=>b(e,t)>=0],[`<`,(e,t)=>b(e,t)<0],[`<=`,(e,t)=>b(e,t)<=0],[`~`,x],[`^`,S]]);function w(e){let{major:t,minor:n,patch:r,pre:i,build:a}=e??{};return f(t)&&f(n)&&f(r)&&typeof i==`string`&&s.test(i)&&typeof a==`string`&&c.test(a)?{major:t,minor:n,patch:r,pre:i,build:a}:void 0}function T(e){let{op:t,major:n,minor:r,patch:i,pre:a}=e??{};return C.has(t)&&f(n)&&(r===void 0||f(r))&&(i===void 0||r!==void 0&&t!==`*`&&f(i))&&typeof a==`string`&&s.test(a)&&(a===``||i!==void 0)?{op:t,major:n,minor:r,patch:i,pre:a}:void 0}function E(e){if(!Array.isArray(e))return;let{length:t}=e;if(t>g)return;let n=Array.from({length:t},(t,n)=>T(e[n]));return n.includes(void 0)?void 0:n}function D(e,t){let n=E(e);if(n===void 0)throw TypeError(`expected comparators, as parseVersionReq makes`);let r=w(t);if(r===void 0)throw TypeError(`expected a version, as parseVersion makes`);return n.every(e=>C.get(e.op)(e,r))?r.pre===``||n.some(e=>e.major===r.major&&e.minor===r.minor&&e.patch===r.patch&&e.pre!==``):!1}export{p as a,m as b,_ as c,D as d};
@@ -1,3 +1,3 @@
1
- import{b as e,c as t,m as n,r}from"./chunk-HT2SSA3V.js";import{a as i}from"./chunk-TUII34K2.js";var a=3,o=4,s=/^[\w-]{4}$/u,c=/^[\w-]{8}$/u,l=`AAAA`,u={report:`deepview/finding-link/report/v1
1
+ import{b as e,c as t,m as n,r}from"./chunk-PTFQKLKO.js";import{a as i}from"./chunk-TUII34K2.js";var a=3,o=4,s=/^[\w-]{4}$/u,c=/^[\w-]{8}$/u,l=`AAAA`,u={report:`deepview/finding-link/report/v1
2
2
  `,workspace:`deepview/finding-link/workspace/v1
3
3
  `},d=new Map;function f(e,t){return`${e}\0${t}`}function p(e){return typeof e==`string`&&s.test(e)}async function m(e,t){let n=u[e];if(!n||typeof t!=`string`||!t)return null;let r=f(e,t),o=d.get(r);if(o!==void 0)return o;let s;try{let e=await crypto.subtle.digest(`SHA-256`,i(n+t));s=new Uint8Array(e).slice(0,a).toBase64({alphabet:`base64url`,omitPadding:!0})}catch{return null}return d.set(r,s),s}function h(e,t){return typeof t!=`string`||!t?null:d.get(f(e,t))??null}function g(e,t){let n=[];for(let[r,i]of[[`report`,e],[`workspace`,t]]){if(i==null||i===``){n.push(l);continue}if(!p(i))throw TypeError(`encodeFindingRef: ${r} must be a link hint token, not a name`);n.push(i)}return n.every(e=>e===l)?null:n[0]===l?`w${n[1]}`:n.join(``)}function _(e){let t=[e.slice(0,o),e.slice(o)].map(e=>e===l?null:e);return{report:t[0],workspace:t[1]}}function v({id:e,report:n,workspace:r}={}){if(!t(e))throw TypeError(`encodeFindingRef: a persistent finding id is required`);let i=[`finding=${encodeURIComponent(e)}`],a=g(n,r);return a&&i.push(`v=${a}`),i.join(`&`)}function y(e,t){let n=v(e);return typeof location>`u`?`${t??``}#${n}`:`${location.origin}${t??location.pathname}#${n}`}function b(n){let r=typeof n==`string`?n:typeof location>`u`?``:location.hash;if(!r)return null;let i=r.replace(/^#/u,``);if(!i)return null;let a={id:null,report:null,workspace:null};for(let n of i.split(`&`)){let r=n.indexOf(`=`);if(r<0)continue;let i=n.slice(0,r),o=n.slice(r+1);if(!o)continue;if(i===`v`){if(o.length===5&&o[0]===`w`&&p(o.slice(1))){let e=o.slice(1);Object.assign(a,{report:null,workspace:e===l?null:e});continue}if(!c.test(o))continue;Object.assign(a,_(o));continue}if(i!==`finding`||o.length>e*3)continue;let s;try{s=decodeURIComponent(o)}catch{continue}t(s)&&(a.id=s)}return a.id?a:null}function x(e,{managed:t=!1}={}){if(typeof location>`u`)return null;let i;try{i=new URL(e)}catch{return null}if(i.href!==e||i.protocol!==location.protocol||i.host!==location.host||i.username||i.password)return null;let a=r(i);if(a?.finding)return{id:a.finding.id,fragment:v(a.finding),path:n(a)};if(t&&a?.view!==`home`&&!/\/(?:index|view)\.html$/u.test(i.pathname))return null;let o=b(i.hash);if(!o)return null;let s=v(o);return{id:o.id,fragment:s,path:`/#${s}`}}function S(e,t){if(typeof e!=`string`)return!1;let n=e.replaceAll(`\\`,`/`);return n.startsWith(`${t}/`)||n.includes(`/${t}/`)}function C(e){let t=!1;for(let n of e){for(let e of n.groups??[])for(let n of e){if(S(n.file,`node_modules`))return`node_modules`;S(n.file,`vendor`)&&(t=!0)}let e=n.tree?w(n.tree):n.treeDependencies;if(e===`node_modules`)return`node_modules`;e===`vendor`&&(t=!0)}return t?`vendor`:`dependencies`}function w(e){let t=!1;for(let n of Object.keys(e??{})){if(S(n,`node_modules`))return`node_modules`;S(n,`vendor`)&&(t=!0)}return t?`vendor`:null}export{S as a,C as b,m as c,h as d,v as e,y as f,b as g,x as h};
@@ -1 +1 @@
1
- import{b as e}from"./chunk-NRPC74AM.js";import{a as t,d as n,f as r,h as i}from"./chunk-7C7DWL7I.js";import{d as a}from"./chunk-PNHBZGDD.js";import{a as o,b as s}from"./chunk-2K6UN3PC.js";import{c}from"./chunk-HT2SSA3V.js";import{C as l,D as u,G as d,J as f,K as p,L as m,O as h,q as g}from"./chunk-SXV2T5C4.js";import{a as _}from"./chunk-TUII34K2.js";function v(e,t){let n=s([{groups:[e],tree:t.tree,treeDependencies:t.treeDependencies}]);for(let r of e)l(r,t),r.isApp??=g(r,r.source??t.source),r._depsDirectory=n}function y(e,t){return!(e.isApp??g(e,e._source??e.source))&&o(e.file,e._depsDirectory??t??s([{groups:[[e]]}]))}function ee(e,n,r){let i=t(n);return i===`ignored`&&y(e,r)?void 0:i}function b(e,n,a,o){let s=n.id??String(n._id),c=n._reportName??``;y(n,o)&&(a===`ignored`||a===`untriaged`)?(t(e.get(s))!==`ignored`&&r(e,s,{triage:void 0}),i(e,s,c,a===`ignored`,!0)):(r(e,s,{triage:a===`untriaged`?void 0:a}),a!==`ignored`&&a!==`untriaged`&&i(e,s,c,!1))}function x(e,a){let o=new Set;for(let t of e.values()){let e=t?.ignoredReports;if(!e?.length)continue;let r=new Set(e).size!==e.length;for(let i of e)(r||!n(t,i))&&o.add(i)}if(o.size===0)return!1;let c=!1;for(let l of a){let a=(l.groups??[]).flat();if(!a.some(e=>o.has(e._reportName??l.name??l.fileName??``)))continue;let u=s([l]),d=e=>({...e,_source:e._source??e.source??l.source}),f=new Set(a.filter(e=>y(d(e),u)).map(e=>e.id??String(e._id)));for(let o of a){let a=o.id??String(o._id),s=o._reportName??l.name??l.fileName??``,p=e.get(a);p?.ignoredReports?.includes(s)&&(n(p,s)||y(d(o),u)||(t(p)||(c=r(e,a,{triage:`ignored`})||c),f.has(a)||(c=i(e,a,s,!1)||c)))}for(let t of a){if(!y(d(t),u))continue;let n=t.id??String(t._id),r=t._reportName??l.name??l.fileName??``;e.get(n)?.ignoredReports?.includes(r)&&(c=i(e,n,r,!0,!0)||c)}}return c}async function S(e,t){let r=new Set(Object.values(e??{}).flatMap(e=>Array.isArray(e?.ignoredReports)?e.ignoredReports.filter(t=>typeof t==`string`&&!n(e,t)):[])),i=[];for(let e of r){let n;try{let r=await t(e);if(typeof r!=`string`)continue;n=await h(r)}catch{continue}n&&i.push({...n.data,name:e,groups:[n.findings]})}return i}async function C(e,t){if(e!=null&&(typeof e!=`object`||Array.isArray(e)))return{entries:e,changed:!1};let n=new Map(Object.entries(e??{})),r=x(n,await S(e,t));return{entries:Object.fromEntries(n),changed:r}}var w=`links`;function T(e){if(typeof e==`string`)return e.length>0?e:null;if(!e||typeof e!=`object`||Array.isArray(e))return null;let{id:t}=e;return typeof t==`string`&&t.length>0?t:null}function E(e){if(typeof e==`string`&&!/^\s*\[/u.test(e))return null;let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t)||t.length===0)return null;let n=[],r=0;for(let e of t){if(!Array.isArray(e))return null;let t=new Set;for(let n of e){let e=T(n);if(e===null)return null;c(e)?t.add(e):r++}t.size>1&&n.push([...t])}return{groups:n,skipped:r}}function D(e){let t=new Set;for(let n of e)for(let e of n)t.add(e);return t.size}function te(e,t){for(let n of e)for(let e of n){let r=t.get(e);r||t.set(e,r=new Set);for(let t of n)t!==e&&r.add(t)}return t}var O=1,k=16,A=12,j=1+k+A+16,M=1+k+A;async function N(e,t){let n=await crypto.subtle.importKey(`raw`,_(e),`PBKDF2`,!1,[`deriveKey`]);return crypto.subtle.deriveKey({name:`PBKDF2`,hash:`SHA-256`,salt:t,iterations:3e6},n,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}function P(e){return!(e instanceof Uint8Array)||e.length<j?!1:e[0]===O}async function F(e,t){if(!(e instanceof Uint8Array))throw TypeError(`encryptWithPassword: plaintext Uint8Array required`);if(typeof t!=`string`||!t)throw TypeError(`encryptWithPassword: password required`);let n=new Uint8Array(M+e.length+16);n[0]=O,crypto.getRandomValues(n.subarray(1,1+k)),crypto.getRandomValues(n.subarray(1+k,M));let r=n.subarray(1,1+k),i=n.subarray(1+k,M),a=await N(t,r),o=new Uint8Array(await crypto.subtle.encrypt({name:`AES-GCM`,iv:i,additionalData:n.subarray(0,M)},a,e));return n.set(o,M),n}async function ne(e,t){if(typeof t!=`string`||!t)throw TypeError(`tryDecryptWithPassword: password required`);if(!(e instanceof Uint8Array)||e.length<j||e[0]!==O)return{ok:!1,reason:`malformed`};let n=e.subarray(1,1+k),r=e.subarray(1+k,M),i=e.subarray(M),a=await N(t,n),o;try{o=new Uint8Array(await crypto.subtle.decrypt({name:`AES-GCM`,iv:r,additionalData:e.subarray(0,M)},a,i))}catch{return{ok:!1,reason:`wrong-password`}}return{ok:!0,plaintext:o}}async function I(e,t,n){if(!n||typeof n.malformedMsg!=`string`||typeof n.wrongPasswordMsg!=`string`)throw TypeError(`decryptWithPasswordOrThrow: { malformedMsg, wrongPasswordMsg } strings required`);let r=await ne(e,t);if(r.ok)return r.plaintext;throw r.reason===`wrong-password`?Error(n.wrongPasswordMsg):Error(n.malformedMsg)}var L=P,R=F;function z(e,t){return I(e,t,{malformedMsg:`malformed encrypted bundle`,wrongPasswordMsg:`wrong password or corrupt bundle`})}var B=1,V=1024,H=1024,U=200,W=104857600,G=Math.ceil(W*4/3)+16,K=512,q=64;function J(e){if(!e||typeof e!=`object`)return`payload is not an object`;if(e.version!==B)return`unsupported export version: ${e.version}`;if(!e.workspace||typeof e.workspace!=`object`)return`workspace metadata missing`;if(typeof e.workspace.id!=`string`)return`workspace.id must be a string`;if(typeof e.workspace.name!=`string`)return`workspace.name must be a string`;if(typeof e.workspace.privateKey!=`string`)return`workspace.privateKey must be a string`;if(e.workspace.createdAt!==void 0&&!Number.isFinite(e.workspace.createdAt))return`workspace.createdAt must be a finite number or omitted`;if(!Array.isArray(e.reports))return`reports field must be an array`;if(e.reports.length>H)return`reports count (${e.reports.length}) exceeds cap (${H})`;if(e.bundles!==void 0){if(!Array.isArray(e.bundles))return`bundles field must be an array when present`;if(e.bundles.length>V)return`bundles count (${e.bundles.length}) exceeds cap (${V})`;for(let t of e.bundles){if(typeof t!=`string`)return`bundles entries must be strings`;if(t.length>U)return`bundle integrity exceeds per-entry length cap (${U})`}}if(e.bundleBlobs!==void 0){if(!Array.isArray(e.bundleBlobs))return`bundleBlobs field must be an array when present`;if(e.bundleBlobs.length>q)return`bundleBlobs count (${e.bundleBlobs.length}) exceeds cap (${q})`;for(let t of e.bundleBlobs){if(!t||typeof t!=`object`||Array.isArray(t))return`bundleBlobs entries must be objects`;if(typeof t.integrity!=`string`||t.integrity.length===0)return`bundleBlobs.integrity must be a non-empty string`;if(t.integrity.length>U)return`bundleBlobs.integrity exceeds per-entry length cap (${U})`;if(typeof t.name!=`string`||t.name.length===0)return`bundleBlobs.name must be a non-empty string`;if(t.name.length>K)return`bundleBlobs.name exceeds per-entry length cap (${K})`;if(t.name.includes(`\0`))return`bundleBlobs.name cannot contain NUL`;if(typeof t.data!=`string`)return`bundleBlobs.data must be a base64 string`;if(t.data.length>G)return`bundleBlobs.data exceeds per-blob size cap (${W} bytes raw)`}}return null}async function Y(e){return new Uint8Array(await e.arrayBuffer())}async function X(e,t){if(L(e)){if(typeof t!=`string`||!t)throw TypeError(`parseWorkspaceBundleBytes: password required for encrypted bundle`);let n=await z(e,t);try{return Z(await a(n))}catch(e){throw Error(`wrong password or corrupt bundle`,{cause:e})}}let n;try{n=await a(e)}catch(e){throw Error(`gzip decompression failed: ${e.message}`,{cause:e})}return Z(n)}function Z(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`payload is not JSON: ${e.message}`,{cause:e})}let n=J(t);if(n===null)return t;let r=n.includes(`exceeds cap`);throw Error(r?n:`not a deepview workspace export: ${n}`)}function Q(e,t){let n=e.trimStart().startsWith(`[`)?E(e):null;if(n)return{data:{source:`links`,findings:[],links:n.groups},format:`links`,reason:null};let r=m(e);if(r.data!=null||p(e,t)!==`codex`)return r;try{return{data:{type:`security`,source:`codex-security`,findings:d(e).flatMap(e=>e.data.findings)},format:`codex`,reason:null}}catch(e){return{data:null,format:null,reason:e instanceof Error?e.message:`Invalid Codex CSV`}}}function re(e,t){let n=Q(e,t);return n.data==null?Promise.resolve(null):h(JSON.stringify(n.data))}function ie(e){let t=new Set;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;typeof e.file==`string`&&e.file&&t.add(e.file);for(let n of Array.isArray(e.evidence)?e.evidence:[])typeof n?.file==`string`&&n.file&&t.add(n.file)}return t}function $(e){let t=(f(e)??[]).flat().filter(e=>typeof e==`object`&&!!e),n=s([{groups:[t],tree:e?.tree}]);return{directory:n,own:t.filter(e=>!o(e.file,n))}}function ae(e){let t=new Map;for(let n of $(e).own){let e=u(n);e&&t.set(e.toLowerCase(),e)}return t.size===1?[...t.values()][0]:null}function oe(t){let{directory:n,own:r}=$(t);return e([...ie(r)].filter(e=>!o(e,n)))}var se=[`inprogress`,`fixed`,`invalid`,`deleted`,`ignored`];function ce(e){return typeof e==`string`&&se.includes(e)}function le(e){if(e===null)return null;if(typeof e!=`object`||Array.isArray(e))return`invalid`;let t=e,n={},r=t.color;if(r!=null){if(typeof r!=`string`||r.length>50)return`invalid`;r!==``&&(n.color=r)}let i=t.triage;if(i!=null){if(!ce(i))return`invalid`;n.triage=i}for(let e of[`comment`,`fix`]){let r=t[e];if(r!=null){if(typeof r!=`string`||r.length>1e4)return`invalid`;r!==``&&(n[e]=r)}}let a=t.flagged;if(a!=null){if(typeof a!=`boolean`)return`invalid`;n.flagged=a}return n}export{v as a,y as b,ee as c,b as d,x as e,S as f,C as g,w as h,E as i,D as j,te as k,F as l,I as m,L as n,R as o,H as p,Y as q,X as r,Z as s,Q as t,re as u,ae as v,oe as w,le as x};
1
+ import{b as e}from"./chunk-NRPC74AM.js";import{a as t,d as n,f as r,h as i}from"./chunk-7C7DWL7I.js";import{d as a}from"./chunk-PNHBZGDD.js";import{a as o,b as s}from"./chunk-IZ6MYRYB.js";import{c}from"./chunk-PTFQKLKO.js";import{C as l,D as u,G as d,J as f,K as p,L as m,O as h,q as g}from"./chunk-QRKFPLA4.js";import{a as _}from"./chunk-TUII34K2.js";function v(e,t){let n=s([{groups:[e],tree:t.tree,treeDependencies:t.treeDependencies}]);for(let r of e)l(r,t),r.isApp??=g(r,r.source??t.source),r._depsDirectory=n}function y(e,t){return!(e.isApp??g(e,e._source??e.source))&&o(e.file,e._depsDirectory??t??s([{groups:[[e]]}]))}function ee(e,n,r){let i=t(n);return i===`ignored`&&y(e,r)?void 0:i}function b(e,n,a,o){let s=n.id??String(n._id),c=n._reportName??``;y(n,o)&&(a===`ignored`||a===`untriaged`)?(t(e.get(s))!==`ignored`&&r(e,s,{triage:void 0}),i(e,s,c,a===`ignored`,!0)):(r(e,s,{triage:a===`untriaged`?void 0:a}),a!==`ignored`&&a!==`untriaged`&&i(e,s,c,!1))}function x(e,a){let o=new Set;for(let t of e.values()){let e=t?.ignoredReports;if(!e?.length)continue;let r=new Set(e).size!==e.length;for(let i of e)(r||!n(t,i))&&o.add(i)}if(o.size===0)return!1;let c=!1;for(let l of a){let a=(l.groups??[]).flat();if(!a.some(e=>o.has(e._reportName??l.name??l.fileName??``)))continue;let u=s([l]),d=e=>({...e,_source:e._source??e.source??l.source}),f=new Set(a.filter(e=>y(d(e),u)).map(e=>e.id??String(e._id)));for(let o of a){let a=o.id??String(o._id),s=o._reportName??l.name??l.fileName??``,p=e.get(a);p?.ignoredReports?.includes(s)&&(n(p,s)||y(d(o),u)||(t(p)||(c=r(e,a,{triage:`ignored`})||c),f.has(a)||(c=i(e,a,s,!1)||c)))}for(let t of a){if(!y(d(t),u))continue;let n=t.id??String(t._id),r=t._reportName??l.name??l.fileName??``;e.get(n)?.ignoredReports?.includes(r)&&(c=i(e,n,r,!0,!0)||c)}}return c}async function S(e,t){let r=new Set(Object.values(e??{}).flatMap(e=>Array.isArray(e?.ignoredReports)?e.ignoredReports.filter(t=>typeof t==`string`&&!n(e,t)):[])),i=[];for(let e of r){let n;try{let r=await t(e);if(typeof r!=`string`)continue;n=await h(r)}catch{continue}n&&i.push({...n.data,name:e,groups:[n.findings]})}return i}async function C(e,t){if(e!=null&&(typeof e!=`object`||Array.isArray(e)))return{entries:e,changed:!1};let n=new Map(Object.entries(e??{})),r=x(n,await S(e,t));return{entries:Object.fromEntries(n),changed:r}}var w=`links`;function T(e){if(typeof e==`string`)return e.length>0?e:null;if(!e||typeof e!=`object`||Array.isArray(e))return null;let{id:t}=e;return typeof t==`string`&&t.length>0?t:null}function E(e){if(typeof e==`string`&&!/^\s*\[/u.test(e))return null;let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t)||t.length===0)return null;let n=[],r=0;for(let e of t){if(!Array.isArray(e))return null;let t=new Set;for(let n of e){let e=T(n);if(e===null)return null;c(e)?t.add(e):r++}t.size>1&&n.push([...t])}return{groups:n,skipped:r}}function D(e){let t=new Set;for(let n of e)for(let e of n)t.add(e);return t.size}function te(e,t){for(let n of e)for(let e of n){let r=t.get(e);r||t.set(e,r=new Set);for(let t of n)t!==e&&r.add(t)}return t}var O=1,k=16,A=12,j=1+k+A+16,M=1+k+A;async function N(e,t){let n=await crypto.subtle.importKey(`raw`,_(e),`PBKDF2`,!1,[`deriveKey`]);return crypto.subtle.deriveKey({name:`PBKDF2`,hash:`SHA-256`,salt:t,iterations:3e6},n,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}function P(e){return!(e instanceof Uint8Array)||e.length<j?!1:e[0]===O}async function F(e,t){if(!(e instanceof Uint8Array))throw TypeError(`encryptWithPassword: plaintext Uint8Array required`);if(typeof t!=`string`||!t)throw TypeError(`encryptWithPassword: password required`);let n=new Uint8Array(M+e.length+16);n[0]=O,crypto.getRandomValues(n.subarray(1,1+k)),crypto.getRandomValues(n.subarray(1+k,M));let r=n.subarray(1,1+k),i=n.subarray(1+k,M),a=await N(t,r),o=new Uint8Array(await crypto.subtle.encrypt({name:`AES-GCM`,iv:i,additionalData:n.subarray(0,M)},a,e));return n.set(o,M),n}async function ne(e,t){if(typeof t!=`string`||!t)throw TypeError(`tryDecryptWithPassword: password required`);if(!(e instanceof Uint8Array)||e.length<j||e[0]!==O)return{ok:!1,reason:`malformed`};let n=e.subarray(1,1+k),r=e.subarray(1+k,M),i=e.subarray(M),a=await N(t,n),o;try{o=new Uint8Array(await crypto.subtle.decrypt({name:`AES-GCM`,iv:r,additionalData:e.subarray(0,M)},a,i))}catch{return{ok:!1,reason:`wrong-password`}}return{ok:!0,plaintext:o}}async function I(e,t,n){if(!n||typeof n.malformedMsg!=`string`||typeof n.wrongPasswordMsg!=`string`)throw TypeError(`decryptWithPasswordOrThrow: { malformedMsg, wrongPasswordMsg } strings required`);let r=await ne(e,t);if(r.ok)return r.plaintext;throw r.reason===`wrong-password`?Error(n.wrongPasswordMsg):Error(n.malformedMsg)}var L=P,R=F;function z(e,t){return I(e,t,{malformedMsg:`malformed encrypted bundle`,wrongPasswordMsg:`wrong password or corrupt bundle`})}var B=1,V=1024,H=1024,U=200,W=104857600,G=Math.ceil(W*4/3)+16,K=512,q=64;function J(e){if(!e||typeof e!=`object`)return`payload is not an object`;if(e.version!==B)return`unsupported export version: ${e.version}`;if(!e.workspace||typeof e.workspace!=`object`)return`workspace metadata missing`;if(typeof e.workspace.id!=`string`)return`workspace.id must be a string`;if(typeof e.workspace.name!=`string`)return`workspace.name must be a string`;if(typeof e.workspace.privateKey!=`string`)return`workspace.privateKey must be a string`;if(e.workspace.createdAt!==void 0&&!Number.isFinite(e.workspace.createdAt))return`workspace.createdAt must be a finite number or omitted`;if(!Array.isArray(e.reports))return`reports field must be an array`;if(e.reports.length>H)return`reports count (${e.reports.length}) exceeds cap (${H})`;if(e.bundles!==void 0){if(!Array.isArray(e.bundles))return`bundles field must be an array when present`;if(e.bundles.length>V)return`bundles count (${e.bundles.length}) exceeds cap (${V})`;for(let t of e.bundles){if(typeof t!=`string`)return`bundles entries must be strings`;if(t.length>U)return`bundle integrity exceeds per-entry length cap (${U})`}}if(e.bundleBlobs!==void 0){if(!Array.isArray(e.bundleBlobs))return`bundleBlobs field must be an array when present`;if(e.bundleBlobs.length>q)return`bundleBlobs count (${e.bundleBlobs.length}) exceeds cap (${q})`;for(let t of e.bundleBlobs){if(!t||typeof t!=`object`||Array.isArray(t))return`bundleBlobs entries must be objects`;if(typeof t.integrity!=`string`||t.integrity.length===0)return`bundleBlobs.integrity must be a non-empty string`;if(t.integrity.length>U)return`bundleBlobs.integrity exceeds per-entry length cap (${U})`;if(typeof t.name!=`string`||t.name.length===0)return`bundleBlobs.name must be a non-empty string`;if(t.name.length>K)return`bundleBlobs.name exceeds per-entry length cap (${K})`;if(t.name.includes(`\0`))return`bundleBlobs.name cannot contain NUL`;if(typeof t.data!=`string`)return`bundleBlobs.data must be a base64 string`;if(t.data.length>G)return`bundleBlobs.data exceeds per-blob size cap (${W} bytes raw)`}}return null}async function Y(e){return new Uint8Array(await e.arrayBuffer())}async function X(e,t){if(L(e)){if(typeof t!=`string`||!t)throw TypeError(`parseWorkspaceBundleBytes: password required for encrypted bundle`);let n=await z(e,t);try{return Z(await a(n))}catch(e){throw Error(`wrong password or corrupt bundle`,{cause:e})}}let n;try{n=await a(e)}catch(e){throw Error(`gzip decompression failed: ${e.message}`,{cause:e})}return Z(n)}function Z(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`payload is not JSON: ${e.message}`,{cause:e})}let n=J(t);if(n===null)return t;let r=n.includes(`exceeds cap`);throw Error(r?n:`not a deepview workspace export: ${n}`)}function Q(e,t){let n=e.trimStart().startsWith(`[`)?E(e):null;if(n)return{data:{source:`links`,findings:[],links:n.groups},format:`links`,reason:null};let r=m(e);if(r.data!=null||p(e,t)!==`codex`)return r;try{return{data:{type:`security`,source:`codex-security`,findings:d(e).flatMap(e=>e.data.findings)},format:`codex`,reason:null}}catch(e){return{data:null,format:null,reason:e instanceof Error?e.message:`Invalid Codex CSV`}}}function re(e,t){let n=Q(e,t);return n.data==null?Promise.resolve(null):h(JSON.stringify(n.data))}function ie(e){let t=new Set;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;typeof e.file==`string`&&e.file&&t.add(e.file);for(let n of Array.isArray(e.evidence)?e.evidence:[])typeof n?.file==`string`&&n.file&&t.add(n.file)}return t}function $(e){let t=(f(e)??[]).flat().filter(e=>typeof e==`object`&&!!e),n=s([{groups:[t],tree:e?.tree}]);return{directory:n,own:t.filter(e=>!o(e.file,n))}}function ae(e){let t=new Map;for(let n of $(e).own){let e=u(n);e&&t.set(e.toLowerCase(),e)}return t.size===1?[...t.values()][0]:null}function oe(t){let{directory:n,own:r}=$(t);return e([...ie(r)].filter(e=>!o(e,n)))}var se=[`inprogress`,`fixed`,`invalid`,`deleted`,`ignored`];function ce(e){return typeof e==`string`&&se.includes(e)}function le(e){if(e===null)return null;if(typeof e!=`object`||Array.isArray(e))return`invalid`;let t=e,n={},r=t.color;if(r!=null){if(typeof r!=`string`||r.length>50)return`invalid`;r!==``&&(n.color=r)}let i=t.triage;if(i!=null){if(!ce(i))return`invalid`;n.triage=i}for(let e of[`comment`,`fix`]){let r=t[e];if(r!=null){if(typeof r!=`string`||r.length>1e4)return`invalid`;r!==``&&(n[e]=r)}}let a=t.flagged;if(a!=null){if(typeof a!=`boolean`)return`invalid`;n.flagged=a}return n}export{v as a,y as b,ee as c,b as d,x as e,S as f,C as g,w as h,E as i,D as j,te as k,F as l,I as m,L as n,R as o,H as p,Y as q,X as r,Z as s,Q as t,re as u,ae as v,oe as w,le as x};
@@ -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-ZFXCWNXC.js";import{m as t,p as n,v as r}from"./chunk-CGKPGHST.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{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,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};
@@ -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};