@preventive/triage 1.0.0-alpha.55 → 1.0.0-alpha.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/finding-repo.d.ts +5 -0
- package/common/finding-repo.js +67 -0
- package/common/managed/report-filter.ts +17 -6
- package/common/repo-commit.d.ts +4 -0
- package/common/repo-commit.js +30 -0
- package/out/activity.js +1 -1
- package/out/{chunk-PKQBEPZU.js → chunk-3K56AIDY.js} +52 -52
- package/out/chunk-4TQKM3JC.js +42 -0
- package/out/{chunk-CGKPGHST.js → chunk-5AXC5J2C.js} +1 -1
- package/out/{chunk-3TFOB75M.js → chunk-CV74F3PY.js} +1 -1
- package/out/{chunk-5PKS6FVK.js → chunk-EVPQPPBG.js} +1 -1
- package/out/{chunk-ZFXCWNXC.js → chunk-EXL3LU6T.js} +1 -1
- package/out/{chunk-ATTKQVZH.js → chunk-HJG6J5O2.js} +1 -1
- package/out/{chunk-WST3LUUL.js → chunk-MEVBIFRP.js} +1 -1
- package/out/{chunk-J4CLTPOR.js → chunk-SWJYGMWI.js} +1 -1
- package/out/{chunk-X655SAHV.js → chunk-VNEOBPBV.js} +1 -1
- package/out/client-managed.js +1 -1
- package/out/compare.js +1 -1
- package/out/dialogs.js +1 -1
- package/out/graph.js +8 -8
- package/out/index.html +5 -5
- package/out/scan.js +1 -1
- package/out/view.js +4 -4
- package/package.json +7 -3
- package/server-managed/bundle-build-worker.js +18 -4
- package/server-managed/github-issues.ts +5 -2
- package/server-managed/http.ts +9 -2
- package/server-managed/report-sources.ts +8 -1
- package/server-managed/team-reports.ts +5 -1
- package/out/chunk-6GAPL5ZA.js +0 -42
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import{b as e,h as t}from"./chunk-IZ6MYRYB.js";import{a as n}from"./chunk-WCPJDAYA.js";import{a as r,b as i,e as a}from"./chunk-IYPY47MC.js";import{A as o,B as s,D as c,E as l,b as u,c as d,d as f,j as p,m,p as h,s as g,t as _,w as v,z as y}from"./chunk-QRKFPLA4.js";import{B as b,b as x,c as S,i as C,x as w,z as T}from"./chunk-74AEKRES.js";import{a as E,b as D,c as ee}from"./chunk-C4Z6ZBXV.js";import{c as O,f as k,g as A,i as te}from"./chunk-2XUEZHIP.js";var ne=D(class extends ee{constructor(e){if(super(e),e.type!==E.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return k}});function re(e){let t=typeof e==`string`?e.trim():``;return/^[0-9a-f]{7,64}$/iu.test(t)?t:``}function ie(e){return re(e?.commit)}function ae(e,t){return typeof e==`string`&&typeof t==`string`&&e!==``&&e.toLowerCase()===t.toLowerCase()}function oe(e,t){return ae(t,c(e))?ie(e?.repo):``}var se=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`),ce=e=>x(e)?e:se(S(String(e))),j=globalThis.trustedTypes?.createPolicy(`deepview`,{createHTML:ce,createScriptURL:e=>{let t=new URL(e,globalThis.location.href);if(t.origin!==globalThis.location.origin)throw TypeError(`Not a same-origin script: ${t.href}`);return t.href}}),M=e=>j?j.createHTML(e):ce(e),le=e=>j?j.createScriptURL(String(e)):e,N={showAll:!1,packagesView:!1,dependencyPackagesView:!1,flowPackagesView:!1,bundleIssues:!1,bundleLayout:`graph`,lockfileLayout:`dependencies`,bundleReason:null,bundleReasonFor:null,selected:null,focusedPkg:null,topPkgsTab:`issues`,edgeOpacity:.22,nodeSize:1,showLabels:!1,selectedSeverities:new Set,selectedColors:new Set,pathFilter:``,hidden:new Set,solo:null,graphState:null,layoutCache:null,keptViewport:null};function ue({keepViewport:e=!1}={}){N.graphState?._cleanup?N.graphState._cleanup({keepViewport:e}):e||(N.keptViewport=null),N.graphState=null}function P(e){return e.id??String(e._id)}function de(e){let t=h(e);return t!==``&&t!==`revalidation`}var fe=[{value:`confirmed`,label:`Confirmed`,kinds:[`confirmed`,`partial`,`revalidation`]},{value:`unreachable`,label:`Unreachable`,kinds:[`unreachable`]},{value:`refuted`,label:`Refuted`,kinds:[`refuted`]}];function pe(e){return fe.find(t=>t.value===e)?.kinds??null}var me=[``,`exclude`,`only`];function he(e,t){let n=pe(e);return n?.includes(`partial`)?t===`only`?[`partial`]:t===`exclude`?[`confirmed`]:n:n}function F(e){if(e.confidence!==void 0)return e.confidence;if(e.critical===!0||e._source)return 10}var ge=e=>e.confidence!==void 0||e.critical===!0;function _e(e){return e.every(e=>e.every(e=>F(e)!==void 0))&&e.some(e=>e.some(ge))}function ve(e,t,n){return e.some(e=>{let r=[`refuted`,`unreachable`].includes(n(e))?0:F(e);return r===void 0?t===0:r>=t})}function ye(e,t){let n=e.map(t).filter(e=>e.length>0);if(!n.some(e=>e.some(e=>F(e)!==void 0)))return 0;let r=e=>n.reduce((t,n)=>t+ +!!n.some(t=>(F(t)??-1)>=e),0),i;for(i=r(6)<=25?6:r(7)<=25?7:8;i>0&&r(i-1)===r(i);)i--;return i}function be(e,t){return _e(e)?t:0}function xe(e,t,n){let r=new Set(e.ruledOutIds??[]);for(let t of e)for(let e of t)[`refuted`,`unreachable`].includes(n(e))&&r.add(P(e));for(let i of e){let e=t(i);if(e.length!==0&&e.some(e=>he(`confirmed`,``).includes(n(e)||(e._source&&!e._sourcePass?`revalidation`:``)))){for(let e of i)if(r.add(P(e)),e.isApp&&Array.isArray(e.revalidateInputs))for(let t of e.revalidateInputs)t&&r.add(t)}}return r}function Se(e,t,n,r){let i=be(e,t),a=e.filter(e=>ve(e,i,r));if(a.length===0)return!1;let o=new Set(he(`confirmed`,``));return e.some(e=>e.some(e=>o.has(r(e))))?a.every(e=>e.every(e=>n.has(P(e)))):!1}function Ce(e,{tabs:t,kindOf:n,severityMode:r}){let i=e.map(t).filter(e=>e.length>0),a=xe(e,t,n);if(!Se(i,ye(e,t),a,n))return!1;let o=be(i,6);return i.every(e=>!ve(e,o,n)||!e.some(e=>m(e,r)!==`low`)||e.every(e=>a.has(P(e))))}var I=!0;function we(e,t=!1){I=e!==!1&&!t}function Te(){return I}function L(e){return I?h(e):``}function Ee(e){return h(e)!==``}function De(e){return e.some(e=>(e.groups??[]).some(e=>e.some(de)))}function Oe(e){let t=L(e);return t&&t!==`revalidation`?t:null}function ke(e){return L(e)===`revalidation`}var Ae=new Set([`refuted`,`unreachable`]);function je(e){return Ae.has(L(e))}function Me(e){return Ae.has(L(e))}function Ne(e){let t=new Set(e);return fe.filter(e=>e.kinds.some(e=>t.has(e)))}function R(e){return RegExp(`(^|/)${e}/`,`u`)}function Pe(e){return RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,`u`)}var Fe=R(`node_modules`),Ie=R(`vendor`),z=`node_modules`,Le=R(z),Re=Pe(z);function ze(e){e!==z&&(z=e,Le=R(e),Re=Pe(e))}var Be=null;function Ve(t){Be?.length===t.length&&Be.every((e,n)=>e===t[n])||(Be=[...t],ze(e(t)))}function He(){return z}function B(e){return Le.test(e)}var Ue=new WeakSet;function We(e){let t=!1;for(let n of e??[])for(let e of n.groups??[])for(let n of e){if(n.isApp!==!1)continue;let e=Ue.has(n);`isUpstream`in n&&!e||(B(n.file)?(n.isUpstream!==!0&&(t=!0),n.isUpstream=!0,Ue.add(n)):e&&(t=!0,delete n.isUpstream,Ue.delete(n)))}return t}function Ge(e){let t=typeof e==`string`?e:``;return Fe.test(t)||Ie.test(t)||Le.test(t)}var Ke=/^(.*(?:^|\/)node_modules\/(?:@[^/]+\/[^/]+|[^/]+))(?:\/|$)/u;function qe(e){return Ke.exec(typeof e==`string`?e:``)?.[1]??null}function Je(e){return typeof e!=`number`||!Number.isFinite(e)?null:n(e)}function Ye(e){if(e.length<=1)return{prefix:``,stripped:[...e]};let t=e.map(e=>e.split(`/`)),n=Math.min(...t.map(e=>e.length)),r=0;for(let e=0;e<n-1&&t.every(n=>n[e]===t[0][e]);e++)r=e+1;return r>0&&t[0][r-1].startsWith(`@`)&&r--,r>0&&t[0][r-1]===`node_modules`&&r--,r===0?{prefix:``,stripped:[...e]}:{prefix:`${t[0].slice(0,r).join(`/`)}/`,stripped:t.map(e=>e.slice(r).join(`/`))}}function Xe(e){return e.match(Re)?.[1]??e}var V={on:new WeakMap,off:new WeakMap};function Ze(e){let t=I?V.on:V.off,n=t.get(e);if(n===void 0){let r=I?[Oe(e),e.revalidateVerdict,e.revalidateRecommendation]:[];n=[e.file,e.title,e.description,e.impact,e.reproduction,Kt(e),e.recommendation,e.confidenceReason,...r,e.discoveredIn,e.repo?.github].filter(Boolean).join(`
|
|
2
|
+
`).toLowerCase(),t.set(e,n)}return n}function Qe(e){V.on.delete(e),V.off.delete(e)}function $e(e){return[typeof e?.category==`string`?e.category.trim():``,g(e,I)].filter(Boolean).join(` · `)}function et(e){if(e.length===0)return``;let t=e[0];for(let n=1;n<e.length;n++){for(;t&&!e[n].startsWith(t);)t=t.slice(0,-1);if(!t)return``}return t}function tt(e){if(!e)return``;let t=e.match(/github\.com\/([^/?#]+\/[^/?#]+?)(?:\.git)?(?:[/?#]|$)/iu);return t?t[1]:e}function nt(e){if(!e)return null;let t=e.trim().replace(/\/$/u,``);return t?/^https?:\/\//iu.test(t)?t:/^github\.com\//iu.test(t)?`https://${t}`:`https://github.com/${t}`:null}var rt=/^(?:@[\w.-]+\/)?[\w.-]+@[^/\s@]+$/u;function it(e){return rt.test(e||``)}function at(e){if(e==null||typeof e==`string`)return{id:e??``,prefix:``,commit:``};let t=l(e);return{id:typeof e.github==`string`?e.github:``,prefix:t?`${t}/`:``,commit:ie(e)}}function ot(e,t,n,r=``){if(it(e))return null;let i=at(t),a=at(n),o=re(r);if(i.id){let t=c({repo:{github:i.id}}),n=nt(t??i.id),r=ae(t,c({repo:{github:a.id}}));return`${n}/blob/${i.commit||(r?a.commit:``)||(r||!Ge(e)?o:``)||`HEAD`}/${i.prefix}${Xe(e)}`}if(B(e))return null;let s=nt(a.id);return s?`${s}/blob/${a.commit||o||`HEAD`}/${a.prefix}${e}`:null}function st(e,t){let n=e?.file??``,r=H(e,t);return r?O`<a href="${ct(r)}" target="_blank" rel="noopener">${n}</a>`:n}function ct(e){return e.replace(/#L\d+(?:-L?\d+)?$/u,``)}function lt({start:e,end:t}){return t>e?`#L${e}-L${t}`:`#L${e}`}function H(e,t){if(!e)return null;if(s(e.location))return e.location;let n=ot(e.file,e.repo,t,e.auditedCommit);if(!n)return null;let r=G(e.line);if(r)return`${n}${lt(r)}`;let i=parseInt(e.line,10);return Number.isFinite(i)?`${n}#L${i}`:n}var ut=/^https?:\/\/(?:www\.)?github\.com\/([^/\s]+\/[^/\s]+)\/(?:blob|tree|blame)\/[^/\s]+\/(\S+)$/u,dt=/#L(\d+)(?:-L?(\d+))?$/u;function ft(e){let t=typeof e==`string`?ut.exec(e):null;if(!t)return``;let n=t[2],r=dt.exec(n);if(!r)return`${t[1]}/${n}`;n=n.slice(0,r.index);let i=r[2]?`${r[1]}-${r[2]}`:r[1];return`${t[1]}/${n}:${i}`}var pt=/^(?:\s+\S|[-*+] |\d+[.)] |>|#{1,6}(?:[ \t]|$)|\||`{3}|~{3})/u;function mt(e){return e.split(/(\n{2,})/u).map(e=>{if(/^\n+$/u.test(e))return e;let t=e.split(`
|
|
3
|
+
`);return t.some(e=>pt.test(e)||W.test(e))?e:t.map(e=>e.trim()).filter(Boolean).join(` `)}).join(``)}function ht(e,t,n){let r=t?/^\n*/u.exec(e)[0]:``,i=e.slice(r.length),a=n?/\n*$/u.exec(i)[0]:``;return r+mt(i.slice(0,i.length-a.length))+a}function gt(e){if(!e)return e;let t=e.replaceAll(`\r
|
|
4
|
+
`,`
|
|
5
|
+
`),n=u(t);if(n.length===0)return mt(t);let r=[],i=0;for(let[e,a]of n)e>i&&r.push(ht(t.slice(i,e),i>0,!0)),r.push(t.slice(e,a)),i=a;return i<t.length&&r.push(ht(t.slice(i),!0,!1)),r.join(``)}var _t=/^( *)(`{3,}|~{3,})(.*)$/u,vt=/^[a-z0-9+#._-]{1,20}$/u;function yt(e,t){let n=0;for(;n<t&&e[n]===` `;)n++;return e.slice(n)}function bt(e){let t=e.split(`
|
|
6
|
+
`),n=_t.exec(t[0]),r=(n?.[2]??"```").slice(0,3),i=(n?.[3]??``).trim().split(/\s+/u)[0].toLowerCase(),a=!!(t.length>1?_t.exec(t.at(-1)):null)?.[2].startsWith(r),o=n?.[1].length??0,s=t.slice(1,a?-1:void 0);return{lang:vt.test(i)?i:``,code:(o>0?s.map(e=>yt(e,o)):s).join(`
|
|
7
|
+
`)}}function xt(e){let t=u(e||``);if(t.length===0)return[e];let n=[],r=0,i=(e,t)=>{let r=(t?e.replace(/^\n+/u,``):e).replace(/\n+$/u,``);r&&n.push(r)};for(let[a,o]of t)a>r&&i(e.slice(r,a),r>0),n.push(bt(e.slice(a,o))),r=o;return r<e.length&&i(e.slice(r),!0),n}var U=/^( *)(?:[-*+]|(\d{1,9})[.)]) +(?=\S)/u,W=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/u;function St(e){return/^ */u.exec(e)[0].length}function Ct(e){let t=e.length;for(;t>0&&!e[t-1].trim();)t--;return e.slice(0,t).join(`
|
|
8
|
+
`)}function wt(e){let t=[],n=0;for(let r of e)t.push(n),n+=r.length+1;return t}function Tt(e){let t=typeof e==`string`?e:``;if(!t)return[e];let n=u(t),r=t.split(`
|
|
9
|
+
`),i=wt(r),a=e=>!d(n,i[e])&&!W.test(r[e])&&U.test(r[e]),o=[],s=0,c=0,l=e=>{let t=r.slice(s,e).join(`
|
|
10
|
+
`).replace(/^\n+/u,``).replace(/\n+$/u,``);t.trim()&&o.push(t)};for(;c<r.length;){if(!a(c)){c++;continue}l(c);let e=U.exec(r[c]),t=!!e[2],u=[],f=null,p=!1;for(;c<r.length;){let e=r[c];if(!d(n,i[c])){if(!e.trim()){f.lines.push(``),p=!0,c++;continue}let n=St(e),r=W.test(e)?null:U.exec(e);if(r&&(!f||n<f.column)){if(!!r[2]!==t)break;f&&u.push(Ct(f.lines)),f={column:r[0].length,lines:[e.slice(r[0].length)]},p=!1,c++;continue}if(n<f.column&&(p||Et.test(e)||W.test(e)||kt.test(e)))break}f.lines.push(yt(e,f.column)),p=!1,c++}f&&u.push(Ct(f.lines)),o.push({ordered:t,start:t?Number(e[2]):null,items:u}),s=c}return o.length===0?[e]:(l(r.length),o)}var Et=/^ {0,3}(#{1,6})[ \t]+(\S.*?)(?:[ \t]+#+)?[ \t]*$/u,Dt=/^ {0,3}-+[ \t]*$/u;function Ot(e){let t=e.split(`
|
|
11
|
+
`),n=[],r=0,i=e=>{let i=t.slice(r,e).join(`
|
|
12
|
+
`).replaceAll(/^(?:[ \t]*\n)+|(?:\n[ \t]*)+$/gu,``);i.trim()&&n.push(i)};return t.forEach((e,a)=>{let o=Et.exec(e),s=W.test(e)&&(a===r||!t[a-1].trim()||!Dt.test(e));!o&&!s||(i(a),n.push(o?{level:o[1].length,text:o[2]}:{rule:!0}),r=a+1)}),n.length===0?[e]:(i(t.length),n)}var kt=/^ {0,3}>/u,At=/^ {0,3}> ?/u,jt=/^[ \t]*\[!(note|tip|important|warning|caution)\][ \t]*$/iu,Mt=/^ {0,3}(?:`{3}|~{3})/u,Nt=/^(?: {0,3}> ?| *(?:[-*+]|\d{1,9}[.)])(?: +|$))*/u,Pt=16,Ft=e=>Et.test(e)||W.test(e)||Mt.test(e);function It(e,t){let n=_t.exec(t);return n?e?n[2][0]===e[0]&&n[2].length>=e.length&&!n[3].trim()?``:e:n[2][0]==="`"&&n[3].includes("`")?``:n[2]:e}function Lt(e){let t=0,n=e.length;for(;t<n&&!e[t].trim();)t++;for(;n>t&&!e[n-1].trim();)n--;return e.slice(t,n).join(`
|
|
13
|
+
`)}function Rt(e,{alerts:t=!0}={}){let n=typeof e==`string`?e:``;if(!/^ {0,3}>/mu.test(n))return[e];let r=u(n),i=n.split(`
|
|
14
|
+
`),a=wt(i),o=e=>kt.test(i[e])&&!d(r,a[e]),s=[],c=0,l=0;for(;l<i.length;){if(!o(l)){l++;continue}l>c&&s.push(i.slice(c,l).join(`
|
|
15
|
+
`));let e=[],n=``,r=!1;for(;l<i.length;l++){let t=i[l];if(o(l)){let i=t.replace(At,``),a=n!==``;n=It(n,i);let o=i.replace(Nt,``);r=!a&&!n&&o.trim()!==``&&!Ft(o),e.push(i)}else if(r&&t.trim()&&!Ft(t)&&!U.test(t))e.push(t);else break}let a=t?jt.exec(e[0]):null,u=a?Lt(e.slice(1)):``;s.push({quote:!0,alert:u?a[1].toLowerCase():null,body:u||Lt(e)}),c=l}return c<i.length&&s.push(i.slice(c).join(`
|
|
16
|
+
`)),s}function zt(e,t=Pt){return t<=0?e:Rt(e).map(e=>typeof e==`string`?e:zt(e.body,t-1)).join(`
|
|
17
|
+
`)}var Bt=/^(\d+)(?:\s*-\s*(\d+))?$/u;function G(e){if(typeof e==`number`)return Number.isFinite(e)&&e>=1?{start:Math.floor(e),end:Math.floor(e)}:null;let t=Bt.exec(String(e??``).trim());if(!t)return null;let n=parseInt(t[1],10),r=t[2]===void 0?n:parseInt(t[2],10);return!Number.isFinite(n)||n<1||!Number.isFinite(r)||r<1?null:{start:Math.min(n,r),end:Math.max(n,r)}}function Vt(e){return e?e.start===e.end?String(e.start):`${e.start}-${e.end}`:``}function Ht(e){if(e&&typeof e==`object`){let t=G(e.start);if(!t)return null;let n=G(e.end)??t;return{start:t.start,end:Math.max(t.start,n.end)}}return G(e)}function Ut(e,t,n=4){let r=typeof e==`string`&&e!==``?e.split(`
|
|
18
|
+
`):[];if(r.length===0)return{text:``,startLine:1,lines:[]};let i=Ht(t),a=i&&{start:Math.min(i.start,r.length),end:Math.min(i.end,r.length)},o=a?Math.max(1,a.start-n):1,s=a?Math.min(r.length,a.end+n):Math.min(r.length,n*2+1),c=r.slice(o-1,s);return{text:c.join(`
|
|
19
|
+
`),startLine:o,lines:c}}function Wt(e,t,n,r){if(s(e?.url))return e.url;let i=e?.file;if(typeof i!=`string`||i===``)return null;let a=t?.file??``,o=t?.repo?.github,c=t?.auditedCommit,l=()=>o?H({file:i,line:e?.line,repo:t.repo,auditedCommit:c},n):null;if(r===0&&i===a)return l();let u=qe(i);return u!==null&&u===qe(a)?l():Ge(i)?null:o&&!Ge(a)?l():H({file:i,line:e?.line,auditedCommit:c},n)}function Gt(e,{spaced:t=!1,link:n=e=>e.url,lineLinks:r=!1}={}){let i=Array.isArray(e?.evidence)?e.evidence:[];return i.length===0?``:i.map((e,t)=>{let i=y(e),a=n(e,t),s=[`${t+1}. ${a?`[${i}](${a})`:i}`],c=r?Jt(o(e),a):o(e);if(c)for(let e of c.split(`
|
|
20
|
+
`))s.push(` ${e}`);return s.join(`
|
|
21
|
+
`)}).join(t?`
|
|
22
|
+
|
|
23
|
+
`:`
|
|
24
|
+
`)}function Kt(e,{repoFallback:t}={}){let n=t!==void 0,r=Gt(e,{link:n?(n,r)=>Wt(n,e,t,r):void 0,lineLinks:n});return r?`**Evidence:**
|
|
25
|
+
${r}`:``}var qt=/\(\s*(?:lines?|L)\s*(\d+)(?:\s*(?:-|–|—|to)\s*L?(\d+))?\s*\)/giu;function Jt(e,t){if(!e||!t||!ut.test(t)||!/\(\s*(?:lines?|L)\s*\d/iu.test(e))return e;let n=ct(t),r=e=>{let t=Yt(e);return e.replace(qt,(e,r,i,a)=>{let o=d(t,a)?null:G(i?`${r}-${i}`:r);return o?`([${e.slice(1,-1).trim()}](${n}${lt(o)}))`:e})},i=``,a=0;for(let[t,n]of u(e))i+=r(e.slice(a,t))+e.slice(t,n),a=n;return i+r(e.slice(a))}function Yt(e){let t=[],n=[...e.matchAll(/`+/gu)].map(e=>[e.index,e.index+e[0].length]),r=[],i=new Map;for(let e=n.length-1;e>=0;e--){let t=n[e][1]-n[e][0];r[e]=i.get(t),i.set(t,e)}for(let e=0;e<n.length;e++)r[e]!==void 0&&(t.push([n[e][0],n[r[e]][1]]),e=r[e]);let[a,o,s,c]=[`
|
|
26
|
+
`,`]`,`)`,`>`].map(t=>{let n=Array.from({length:e.length+1},()=>1/0);for(let r=e.length-1;r>=0;r--)n[r]=e[r]===t?r:n[r+1];return n}),l=t.length,u=0;for(let n=0;n<e.length;n++){for(;u<l&&t[u][1]<=n;)u++;if(u<l&&t[u][0]<=n){n=t[u][1]-1;continue}let r=-1;if(e[n]===`[`&&o[n+1]<a[n]){r=o[n+1]+1;let t=e[r]===`(`?s[r]:e[r]===`[`?o[r+1]:1/0;t<a[r]&&(r=t+1)}else if(e[n]===`<`&&c[n+1]<a[n])r=c[n+1]+1;else if((e[n]===`h`||e[n]===`H`)&&/^https?:\/\//iu.test(e.slice(n,n+8))&&!/\w/u.test(e[n-1]??``))for(r=n;r<e.length&&!/\s/u.test(e[r]);)r++;r>n&&(t.push([n,r]),n=r-1)}t.sort((e,t)=>e[0]-t[0]);let d=[];for(let[e,n]of t){let t=d.at(-1);t&&e<t[1]?t[1]=Math.max(t[1],n):d.push([e,n])}return d}function Xt(e){let t=/^\[([^\]]+)\]\(([^)\s]+)\)$/u.exec(e);return!t||!s(t[2])?null:{label:f(t[1].trim())||t[2],url:t[2]}}function Zt(e,t){let n=parseInt(e?.line,10);if(!Number.isFinite(n))return A;let r=H(e,t),i=`line ${n}`;return r?O`<a href="${r}" target="_blank" rel="noopener">${i}</a>`:i}function Qt(e,t){return!e||!t?null:`${/^https?:/iu.test(e)?e.replace(/\/$/u,``):`https://github.com/${e}`}/commit/${t}`}var $t=[[`Impact`,`impact`],[`Reproduction`,`reproduction`],[`Recommendation`,`recommendation`],[`Confidence reason`,`confidenceReason`],[`Revalidation verdict`,`revalidateVerdict`],[`Revalidation recommendation`,`revalidateRecommendation`]];function en(e,t){let n=[];t&&n.push(`Repo: ${t}`);let r=y(e);r&&n.push(`Location: ${r}`),e?.confidence!=null&&n.push(`Confidence: ${e.confidence}/10`);let i=L(e);i&&n.push(`Revalidation: ${i}`);let a=[];n.length>0&&a.push(n.join(`
|
|
27
|
+
`));let{title:o,body:s}=v(e);o&&a.push(`# ${o}`),s&&a.push(s.trim());let c=Gt(e,{spaced:!0});c&&a.push(`# Evidence
|
|
28
|
+
|
|
29
|
+
${c}`);for(let[t,n]of $t){if(!I&&n.startsWith(`revalidate`))continue;let r=_(e?.[n],e)?.trim();r&&a.push(`# ${t}
|
|
30
|
+
|
|
31
|
+
${r}`)}return a.join(`
|
|
32
|
+
|
|
33
|
+
`)}function tn(e,{title:t,body:n,labels:r=[]}={}){let i=nt(e);if(!i)return null;let a;try{a=new URL(i).host.toLowerCase()}catch{return null}if(a!==`github.com`)return null;let o=new URLSearchParams;t&&o.set(`title`,t),n&&o.set(`body`,n),r.length>0&&o.set(`labels`,r.join(`,`));let s=o.toString();return s?`${i}/issues/new?${s}`:`${i}/issues/new`}var nn=/^[a-zA-Z\d](?:-?[a-zA-Z\d])*$/u,rn=/^[a-zA-Z\d._-]+$/u,an=/^[1-9]\d{0,9}$/u,on=/^[a-fA-F\d]{7,40}$/u,sn=/^#[\w-]+$/u,cn=/^GHSA(?:-[0-9a-z]{4}){3}$/u;function ln(e){return e.length<=39&&nn.test(e)}function un(e){return e.length<=100&&e!==`.`&&e!==`..`&&rn.test(e)}function dn(e){let t;try{t=new URL(e)}catch{return null}if(t.href!==e||t.protocol!==`https:`||t.hostname.toLowerCase()!==`github.com`||t.port||t.username||t.password)return null;let n=t.pathname.split(`/`);if(n.at(-1)===``&&n.pop(),n.length===3&&n[1]===`advisories`){let e=n[2];return cn.test(e)?{url:`https://github.com/advisories/${e}`,label:e}:null}if(n.length===6&&n[3]===`security`&&n[4]===`advisories`){let[,e,t,,,r]=n;return!ln(e)||!un(t)||!cn.test(r)?null:{url:`https://github.com/${e}/${t}/security/advisories/${r}`,label:r}}if(n.length!==5)return null;let[,r,i,a,o]=n;if(!ln(r)||!un(i))return null;let s;if(a===`issues`||a===`pull`){if(!an.test(o))return null;s=`${r}/${i}#${o}`}else if(a===`commit`){if(!on.test(o))return null;s=`${r}/${i}@${o.slice(0,7)}`}else return null;return{url:`https://github.com/${r}/${i}/${a}/${o}${sn.test(t.hash)?t.hash:``}`,label:s}}var fn=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/u;function pn(e){if(typeof e!=`string`)return null;let t=mn(e);return t!==e||fn.test(e)?t.slice(0,8):null}function mn(e){let t=String(e);return t.startsWith(`https://chatgpt.com/codex/cloud/security/findings/`)?t.slice(50):t}function hn(e,n){let r=t(e,{managed:n});if(!r)return null;let i=pn(r.id);return{url:n?r.path:`#${r.fragment}`,label:i?`finding ${i}`:`finding`,self:!0}}var gn=/https?:\/\/[^\s<>"'`(){}[\]|\\^]+/giu,_n=new Set([`)`,`.`,`,`,`!`,`?`,`;`,`:`,`'`,`"`,`*`,`]`,`}`,`>`]);function vn(e){let t=e.length;for(;t>0&&_n.has(e[t-1]);)t--;return t===e.length?e:e.slice(0,t)}function yn(e,{managed:t=!1}={}){if(typeof e!=`string`||e.length===0)return[];let n=[],r=0;gn.lastIndex=0;let i;for(;(i=gn.exec(e))!==null;){let a=vn(i[0]),o=a?dn(a)??hn(a,t):null;o&&(i.index>r&&n.push(e.slice(r,i.index)),n.push(o),r=i.index+a.length,gn.lastIndex=r)}return r<e.length&&n.push(e.slice(r)),n}var bn={commit:T},xn=8;function Sn(e){let t;try{t=e?JSON.parse(e):null}catch{return null}let n=e=>typeof e==`string`&&e?e:null;return t&&{tags:Array.isArray(t.tags)?t.tags.filter(n):[],details:typeof t.title==`string`?{title:t.title,authorName:n(t.authorName),authorLogin:n(t.authorLogin),date:Number.isSafeInteger(t.date)?t.date:null}:null}}function Cn({title:e,authorName:t,authorLogin:n,date:r}){let i=document.createElement(`div`);i.className=`tooltip-commit-details`;let a=document.createElement(`span`);a.className=`tooltip-commit-message`,a.textContent=e;let o=document.createElement(`span`);return o.className=`tooltip-commit-meta`,o.textContent=[t&&n&&t!==n?`${t} (@${n})`:t??(n&&`@${n}`),r===null?``:new Date(r).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})].filter(Boolean).join(` · `),i.append(...e?[a]:[],o),i}var K;function wn(){return K||(K=document.createElement(`div`),K.id=`styled-tooltip`,K.setAttribute(`popover`,`manual`),document.body.append(K),K)}function Tn(e){typeof e.showPopover==`function`&&(e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover())}var q=null,En=``,J=null,Y=null,Dn=0,On=0,kn=!1;function X(){if(!kn){kn=!0,document.addEventListener(`mousemove`,e=>{Dn=e.clientX,On=e.clientY},{passive:!0});for(let e of[`pointerdown`,`wheel`,`scroll`])document.addEventListener(e,()=>Q(),{capture:!0,passive:!0});document.addEventListener(`keydown`,e=>{e.key===`Escape`&&Q()}),window.addEventListener(`blur`,()=>Q())}}var An=100,jn=14,Mn=8,Z=8;function Nn(e,{placement:t=`cursor`}={}){X(),clearTimeout(J),J=null,Y=null,e.prepareTooltip?.(e),t=e.dataset.tooltipPlacement??t;let n=wn(),i=e.dataset.tooltip??``,a=Object.hasOwn(bn,e.dataset.tooltipIcon??``)?e.dataset.tooltipIcon:``,o=e.dataset.tooltipRepo??``,s=r(e.dataset.tooltipCommit),c=Sn(e.dataset.tooltipCommitInfo),l=[`stasis`,`sourcemap`].includes(e.dataset.tooltipBundle)?e.dataset.tooltipBundle:``,u=e.dataset.tooltipStats??``,d=e.dataset.tooltipBuilt===`true`,f=e.dataset.tooltipPackage??``,p=e.dataset.tooltipEcosystem??``,m=e.dataset.tooltipVersion??``,h=e.dataset.tooltipFiles??``,g=e.dataset.tooltipLoc??``,_=e.dataset.tooltipSize??``,v=e.tooltipContent??null,y=v??JSON.stringify([i,a,o,s,c,l,u,d,f,p,m,h,g,_]);if(!i){Q();return}if(q===e&&En===y)return;if(n.textContent=a||v?``:i,v){let e=document.createElement(`div`);e.className=`tooltip-rich`,te(v,e),n.append(e)}if(a){let e=document.createElement(`span`);e.className=`tooltip-text`,e.innerHTML=M(bn[a]);let t=document.createElement(`span`);t.textContent=i,e.append(t),n.append(e)}if(f){let t=document.createElement(`div`);t.className=`tooltip-package`;let r=(e.querySelector(`[data-tooltip-package-icon] svg`)??e.querySelector(`svg`))?.cloneNode(!0);r&&t.append(r);let i=document.createElement(`span`);i.className=`tooltip-package-details`;let a=(e,t)=>/^\d+$/u.test(e)?`${Number(e).toLocaleString()} ${t}`:``;for(let e of[f,m,a(h,h===`1`?`file`:`files`),a(g,`LoC`),_].filter(Boolean)){let t=document.createElement(`span`);t.textContent=e,i.append(t)}t.append(i),n.append(t)}if(o||s){let e=document.createElement(`div`);if(e.className=`tooltip-repo`,o){e.innerHTML=M(w);let t=document.createElement(`span`);t.textContent=o,e.append(t)}if(s){let t=document.createElement(`span`);t.className=`tooltip-commit`,t.innerHTML=M(T);let n=document.createElement(`span`);n.textContent=s.slice(0,7),t.append(n),e.append(t)}if(n.append(e),s&&c?.tags.length){let e=document.createElement(`div`);e.className=`tooltip-tags`;for(let t of c.tags.slice(0,xn)){let n=document.createElement(`span`);n.className=`tooltip-tag`,n.innerHTML=M(b);let r=document.createElement(`span`);r.textContent=t,n.append(r),e.append(n)}if(c.tags.length>xn){let t=document.createElement(`span`);t.className=`tooltip-tag-more`,t.textContent=`+${(c.tags.length-xn).toLocaleString()} more`,e.append(t)}n.append(e)}}if(c?.details&&n.append(Cn(c.details)),l||u||d){let e=document.createElement(`div`);if(e.className=`tooltip-bundle`,l===`stasis`){let t=document.createElement(`img`);t.src=`./stasis.svg`,t.alt=``,e.append(t)}else e.innerHTML=M(C);let t=document.createElement(`span`);t.textContent=[l===`stasis`?`Stasis`:l===`sourcemap`?`Sourcemap`:``,d?`Built on server`:``,u].filter(Boolean).join(` · `),e.append(t),n.append(e)}Tn(n),n.style.left=`0px`,n.style.top=`0px`,n.style.transform=`none`,n.classList.add(`visible`);let x=Dn,S=On+jn;if(t===`right`||t===`right-start`){let n=e.getBoundingClientRect();x=n.right+Mn,S=n.top+(t===`right`?n.height/2:0)}let E=window.innerWidth-n.offsetWidth-Z,D=Math.max(Z,Math.min(x,E));n.style.left=`${Math.round(D)}px`;let ee=n.offsetHeight,O=t===`right`?S-ee/2:S,k=window.innerHeight-ee-Z,A=Math.max(Z,Math.min(O,k));n.style.top=`${Math.round(A)}px`,q=e,En=y}function Q(e){e&&!e.contains(q)&&!e.contains(Y)||(clearTimeout(J),J=null,Y=null,K&&(K.classList.remove(`visible`),typeof K.hidePopover==`function`&&K.matches(`:popover-open`)&&K.hidePopover()),q=null)}function Pn(e,{gate:t,placement:n}={}){X();let r=()=>e.isConnected!==!1&&(!Object.hasOwn(e.dataset,`tooltipTruncated`)||e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&(!t||t(e));if(!r()){Q();return}e===q||e===Y||(Q(),Y=e,J=setTimeout(()=>{J=null,Y=null,r()&&Nn(e,{placement:n})},An))}var Fn=new WeakSet;function In(e,t){for(let n of e.composedPath()){if(n===t)break;if(n.nodeType===1&&Object.hasOwn(n.dataset,`tooltip`))return n}return null}function Ln(e,t){!e||Fn.has(e)||(Fn.add(e),e.ownerDocument&&X(),e.addEventListener(`mouseover`,n=>{if(n.buttons){Q();return}let r=In(n,e);if(!r){Q();return}r!==q&&Pn(r,t)}),e.addEventListener(`mouseout`,t=>{let n=In(t,e),r=t.relatedTarget?.closest?.(`[data-tooltip]`)??null;n&&n===r||Q()}),e.addEventListener(`scroll`,()=>Q(e),{capture:!0,passive:!0}))}var Rn=!1;function zn(){Rn||(Rn=!0,X(),document.addEventListener(`tooltip-root-connected`,e=>{Ln(e.composedPath()[0]?.shadowRoot)}),document.body.addEventListener(`mouseover`,e=>{if(e.target.closest(`[data-tooltip-managed]`))return;if(e.buttons){Q();return}let t=e.target.closest(`[data-tooltip]`);!t||t===q||Pn(t)}),document.body.addEventListener(`mouseout`,e=>{e.target.closest(`[data-tooltip-managed]`)||e.relatedTarget?.closest?.(`[data-tooltip-managed]`)||!q&&!J||(q??Y)?.contains(e.relatedTarget)||Q()}))}function Bn(e){return`tree-`+e.replaceAll(/[^\w-]+/gu,`_`)}var Vn=()=>Object.fromEntries(p.map(e=>[e,0]));function Hn(e,t){let n=new Map;for(let r of e)for(let e of r){n.has(e.file)||n.set(e.file,Vn());let r=n.get(e.file),i=m(e,t);r[i]!==void 0&&r[i]++}return n}var $={trees:[],merged:null};function Un(e){let t=e.map(e=>e?.tree??null);return t.length===$.trees.length&&t.every((e,t)=>e===$.trees[t])||($={trees:t,merged:Wn(e)}),$.merged}function Wn(e){let t=null;for(let n of e)if(n?.tree){t||={};for(let e of Object.keys(n.tree)){let r=n.tree[e];if(!t[e]){t[e]={...r,imports:[...r.imports??[]]};continue}let i=new Set(t[e].imports);for(let n of r.imports??[])i.has(n)||(i.add(n),t[e].imports.push(n));t[e].size==null&&r.size!=null&&(t[e].size=r.size)}}return t}function Gn(e,t){let n=Object.keys(e),r=new Map(n.map((e,t)=>[e,t])),i=n.map(()=>Vn()),a=n.map(()=>[]);for(let[t,i]of n.entries())for(let n of e[i].imports??[]){let e=r.get(n);e!==void 0&&a[e].push(t)}let o=new Uint32Array(n.length),s=0;for(let[e,n]of t){let t=r.get(e);if(t===void 0||!n)continue;let c=p.map(e=>[e,n[e]??0]).filter(([,e])=>e!==0);if(c.length===0)continue;let l=++s,u=[],d=e=>{o[e]!==l&&(o[e]=l,u.push(e))};for(let e of a[t])d(e);for(;u.length>0;){let e=u.pop();for(let[t,n]of c)i[e][t]+=n;for(let t of a[e])d(t)}}return new Map(n.map((e,t)=>[e,i[t]]))}function Kn(e,t,n){let r=t.get(e),i=n.get(e);return qn(r)>0||qn(i)>0}function qn(e){if(!e)return 0;let t=0;for(let n of p)t+=e[n]??0;return t}function Jn(e){if(!e)return null;let t=He(),n=RegExp(`^(?:.*/)?${t}/(@[^/]+/[^/]+|[^/]+)`,`u`),r=e.match(n);return r?r[1]:`__own__`}function Yn(e){return new Set(e.filter(e=>!B(e)))}var Xn=[`#4e9af1`,`#f28e2b`,`#59a14f`,`#e15759`,`#76b7b2`,`#edc948`,`#b07aa1`,`#ff9da7`,`#9c755f`,`#5cd1e5`,`#f1ce63`,`#d37295`,`#a0cbe8`,`#86bcb6`,`#8cd17d`,`#b6992d`,`#499894`,`#e15759`,`#e879c7`,`#d4a6c8`],Zn=[`#2f8aef`,`#d2691e`,`#2ea043`,`#e63946`,`#2e9a92`,`#b88817`,`#9560e8`,`#d24a9c`,`#8a5d40`,`#0891b2`,`#a07a14`,`#c14e8e`,`#1f7ad0`,`#549b94`,`#3fb95f`,`#a07a14`,`#2a8278`,`#cb2c40`,`#c026d3`,`#965f93`];function Qn(){if(typeof document>`u`)return!1;let e=document.body?.classList;return!!e&&(e.contains(`theme-light`)||e.contains(`theme-pink`)||e.contains(`theme-w95`)||e.contains(`theme-paper`))}var $n=new Map;function er(e){let t=Qn()?Zn:Xn;return t[e%t.length]}var tr=()=>Qn()?`#8c959f`:`#6e7681`;function nr(e){let t=Qn(),n=t?Zn:Xn,r=e??`__own__`,i=`${t?`l`:`d`}:${r}`;if($n.has(i))return $n.get(i);let a=0;for(let e of r)a=a*37+e.codePointAt(0)|0;let o=n[((a%n.length+n.length)%n.length*7+3)%n.length];return $n.set(i,o),o}var rr={package:`@babel/core`,path:/^lib\/config\//u},ir={package:`@babel/core`,path:/^lib\/config\/files\/(?:module-types|plugins)\.js$/u},ar=Object.freeze([{id:`react-native-codegen-discovery`,reason:`Codegen discovers package metadata and React Native configuration.`,from:{package:`react-native`,path:/^scripts\/codegen\/generate-artifacts-executor\.js$/u},to:{path:/(?:^|\/)(?:package\.json|react-native\.config\.js)$/u}},{id:`react-native-release-version`,reason:`The CLI release checker reads the installed React Native version.`,from:{package:`@react-native-community/cli-tools`,path:/^build\/releaseChecker\/index\.js$/u},to:{package:`react-native`,path:/^package\.json$/u}},{id:`react-native-platform-config`,reason:`React Native configuration loads platform CLIs supplied by the host project.`,from:{package:`react-native`,path:/^react-native\.config\.js$/u},to:{package:/^@react-native-community\/cli-platform-(?:android|ios)$/u,path:/^build\/index\.js$/u}},{id:`babel-project-config`,reason:`Babel discovers project configuration.`,from:rr,to:{path:/(?:^|\/)babel\.config\.js$/u}},{id:`babel-typescript-preset`,reason:`Babel configuration loads the TypeScript preset.`,from:rr,to:{package:`@babel/preset-typescript`,path:/./u}},{id:`babel-react-native-preset`,reason:`Babel config loaders load the configured React Native preset.`,from:ir,to:{package:`@react-native/babel-preset`,path:/^(?:src\/)?index\.js$/u}},{id:`babel-reanimated-plugin`,reason:`Babel config loaders load the configured Reanimated plugin, including scoped copies.`,from:ir,to:{package:/^(?:@[^/]+\/)?react-native-reanimated$/u,path:/^plugin\/index\.js$/u}},{id:`babel-transform-plugin`,reason:`Babel config loaders load configured transform plugins.`,from:ir,to:{package:/^@babel\/plugin-transform-[^/]+$/u,path:/^lib\/index\.js$/u}},{id:`cosmiconfig-config`,reason:`Cosmiconfig loads discovered configuration, including dependency configuration.`,from:{package:`cosmiconfig`,path:/^dist\/loaders\.js$/u},to:{path:/\.config\.js$/u}},{id:`import-fresh-own-config`,reason:`import-fresh loads host-project configuration.`,from:{package:`import-fresh`,path:/./u},to:{path:/\.config\.js$/u},ownSourceOnly:!0}].map(e=>Object.freeze({...e,from:Object.freeze(e.from),to:Object.freeze(e.to)})));function or(e){return typeof e==`string`&&!e.includes(`\\`)&&!e.includes(`:`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`)}function sr(e,t){let n=e.package;return n!==void 0&&t.ownSource===!0?!1:(n===void 0||(typeof n==`string`?n===t.package:n.test(t.package??``)))&&e.path.test(t.path)}function cr(e,t){if(e?.ownSource!==!0&&or(e?.path)&&or(t?.path))return ar.find(n=>(!n.ownSourceOnly||t.ownSource===!0)&&sr(n.from,e)&&sr(n.to,t))}function lr(e,t){let n=e.split(/(?:^|\/)node_modules\//u).slice(1).at(-1)?.match(/^(@[^/]+\/[^/]+|[^/]+)\/(.+)$/u);return{package:n?.[1],path:n?.[2]??e.replace(/^\/+/u,``),ownSource:t??i(e)===`__own__`}}function ur(e,t,n,r){return!cr(lr(e,r),lr(t,n))}function dr(e,t=e=>e.file){let n=new Map(e.nodes.map(e=>[e.file,e])),r=new Map(e.nodes.map(e=>[t(e),new Set]));for(let[i,a]of e.importsOf){let o=n.get(i);if(o)for(let s of a){let a=n.get(s);a&&ur(o.origFile??i,a.origFile??s,e.ownSourceFiles?.has(s),e.ownSourceFiles?.has(i))&&r.get(t(o)).add(t(a))}}return r}var fr=class{constructor(e){this.nodes=[...e];for(let[e,t]of this.nodes.entries())t.position=e;for(let e=(this.nodes.length>>1)-1;e>=0;e--)this.down(e)}before(e,t){return Math.abs(e.balance)>Math.abs(t.balance)||Math.abs(e.balance)===Math.abs(t.balance)&&(e.balance>t.balance||e.balance===t.balance&&e.tie<t.tie)}swap(e,t){let n=this.nodes,r=n[e];n[e]=n[t],n[t]=r,n[e].position=e,n[t].position=t}down(e){let t=this.nodes;for(;2*e+1<t.length;){let n=2*e+1;if(n+1<t.length&&this.before(t[n+1],t[n])&&n++,!this.before(t[n],t[e]))break;this.swap(e,n),e=n}}update(e){if(e.position<0)return;let t=e.position;for(;t>0;){let n=t-1>>1;if(!this.before(e,this.nodes[n]))break;this.swap(t,n),t=n}this.down(t)}take(){let e=this.nodes[0],t=this.nodes.pop();return e.position=-1,this.nodes.length>0&&(this.nodes[0]=t,t.position=0,this.down(0)),e}};function pr(e,t){for(let n=0;n<8;n++){let r=!1;for(let i=0;i<e.length-1;i++){let a=n%2?e.length-2-i:i,o=e[a],s=e[a+1];(t.get(s)?.get(o)?.cycleCount??0)<=(t.get(o)?.get(s)?.cycleCount??0)||(e[a]=s,e[a+1]=o,r=!0)}if(!r)break}return e}function mr(e){let t=[],n=new Set;for(let t of e.values())t.outgoing.sort((e,t)=>t[1]-e[1]||e[0].tie-t[0].tie);for(let r of e.values()){if(n.has(r))continue;let e=[{node:r,next:0}];for(n.add(r);e.length>0;){let r=e.at(-1);if(r.next===r.node.outgoing.length){t.push(r.node.id),e.pop();continue}let i=r.node.outgoing[r.next++][0];n.has(i)||(n.add(i),e.push({node:i,next:0}))}}return t.toReversed()}function hr(e,t){let n=new Map(e.map((e,t)=>[e,t])),r=0;for(let e of t.values())for(let[t,i]of e.outgoing)n.get(e.id)<n.get(t.id)&&(r+=i);return r}function gr(e,t){let n=hr(e,t),r=n,i=0;for(let a=0;a<e.length-1;a++)n-=t.get(e[a]).originalBalance,n>r&&(r=n,i=a+1);return[...e.slice(i),...e.slice(0,i)]}function _r(e,t){if(e.length<2)return e;let n=new Map(e.map((e,t)=>[e,{id:e,tie:t,balance:0,incoming:[],outgoing:[]}]));for(let e of n.values())for(let r of t.get(e.id)?.values()??[]){let t=n.get(r.to);!t||t===e||!r.cycleCount||(e.outgoing.push([t,r.cycleCount]),t.incoming.push([e,r.cycleCount]),e.balance+=r.cycleCount,t.balance-=r.cycleCount)}for(let e of n.values())e.originalBalance=e.balance;let r=[],i=new fr(n.values()),a=[];for(;i.nodes.length>0;){let e=i.take();e.balance>=0?r.push(e.id):a.push(e.id);for(let[t,n]of e.outgoing)t.position<0||(t.balance+=n,i.update(t));for(let[t,n]of e.incoming)t.position<0||(t.balance-=n,i.update(t))}let o=e,s=hr(e,n);for(let i of[[...r,...a.toReversed()],mr(n),e,e.toReversed()]){let e=pr(gr(i,n),t),r=hr(e,n);r>s&&(o=e,s=r)}return o}function vr(e,t){let n=new Set(e),r=new Map(e.map(e=>[e,[]]));for(let[e,i]of t)for(let t of i)n.has(e)&&n.has(t)&&r.get(t).push(e);let i=[],a=new Set;for(let r of e){if(a.has(r))continue;a.add(r);let e=[[r,(t.get(r)??[])[Symbol.iterator]()]];for(;e.length>0;){let[r,o]=e.at(-1),s=o.next();if(s.done){i.push(r),e.pop();continue}n.has(s.value)&&!a.has(s.value)&&(a.add(s.value),e.push([s.value,(t.get(s.value)??[])[Symbol.iterator]()]))}}let o=new Map,s=[];for(let e of i.toReversed()){if(o.has(e))continue;let t=[],n=s.length,i=[e];for(o.set(e,n);i.length>0;){let e=i.pop();t.push(e);for(let t of r.get(e))o.has(t)||(o.set(t,n),i.push(t))}s.push(t.toSorted())}return{groups:s,componentOf:o}}function yr(e,{expanded:t=new Set,order:n=`structure`,query:r=``,neighborhood:i=null,cyclesOnly:o=!1}={}){let s=new Map,c=new Map,l=new Map;for(let n of e.nodes){let e=t.has(n.pkg),r=`${e?`f`:`p`}:${e?n.file:n.pkg}`;s.has(r)||s.set(r,{id:r,pkg:n.pkg,file:e?n.file:null,label:e?n.file:a(n.pkg),files:[],size:0,issues:0,incoming:0,outgoing:0,importers:0,dependencies:0});let i=s.get(r);i.files.push(n.file),i.size+=n.size??0,i.issues+=n.totalIssues??0,c.set(n.file,r),l.set(n.file,n.origFile??n.file)}let u=new Map,d=new Set,f=new Set,p=new Map([...s.keys()].map(e=>[e,new Set])),m=0;for(let[t,n]of e.importsOf){let r=c.get(t);if(r)for(let i of new Set(n)){let n=c.get(i);if(!n)continue;u.has(r)||u.set(r,new Map),u.get(r).has(n)||u.get(r).set(n,{from:r,to:n,count:0,cycleCount:0,examples:[]});let a=u.get(r).get(n);a.count++;let h=ur(l.get(t),l.get(i),e.ownSourceFiles?.has(i),e.ownSourceFiles?.has(t));a.examples.length<80&&(!o||h)&&a.examples.push([t,i]),m++,s.get(r).outgoing++,s.get(n).incoming++,r!==n&&(f.add(r),d.add(n)),h&&(a.cycleCount++,(r!==n||s.get(r).file)&&p.get(r).add(n))}}let h=[...s.keys()].toSorted(),{groups:g,componentOf:_}=vr(h,p),v=new Set(g.flatMap(e=>e.length>1||p.get(e[0]).has(e[0])?e:[]));for(let e of s.values())e.cyclic=v.has(e.id),e.component=_.get(e.id);let y=e.ownSourcePackages??new Set(e.layerRoots?.roots??[]),b=e=>e.pkg===`__own__`?0:y.has(e.pkg)?1:2,x=e=>d.has(e.id)&&f.has(e.id)?0:1,S=new Map(g.map((e,t)=>[t,e.reduce((e,t)=>Math.min(e,b(s.get(t))),2)])),C=(e,t)=>e.pkg.localeCompare(t.pkg)||e.label.localeCompare(t.label),w=new Map;if(n===`structure`){for(let e of g)if(!(e.length<2))for(let t of Map.groupBy(e,e=>b(s.get(e))).values())_r(t.toSorted((e,t)=>C(s.get(e),s.get(t))),u).forEach((e,t)=>w.set(e,t))}if(o){m=0,d.clear(),f.clear();for(let e of s.values())e.incoming=0,e.outgoing=0}for(let[e,t]of u){for(let n of t.values())if(n.cyclic=n.cycleCount>0&&v.has(e)&&_.get(e)===_.get(n.to)&&(e!==n.to||s.get(e).file!==null),o){if(!n.cyclic){t.delete(n.to);continue}n.count=n.cycleCount,m+=n.count,s.get(e).outgoing+=n.count,s.get(n.to).incoming+=n.count,e!==n.to&&(f.add(e),d.add(n.to))}t.size===0&&u.delete(e)}for(let[e,t]of u)for(let n of t.keys())e!==n&&(s.get(e).dependencies++,s.get(n).importers++);let T=r.trim().toLowerCase(),E=new Set(h.filter(e=>!T||s.get(e).files.some(e=>e.toLowerCase().includes(T))||s.get(e).label.toLowerCase().includes(T))),D=new Set(i?[i]:E);if(T||i)for(let[e,t]of u)for(let n of t.keys())(i?e===i:E.has(e))&&D.add(n),(i?n===i:E.has(n))&&D.add(e);let ee=(e,t)=>{if(n===`structure`){let n=S.get(e.component)-S.get(t.component);if(n)return n;let r=x(e)-x(t);if(r)return r;let i=e.component-t.component;if(i)return i}let r=b(e)-b(t);if(r)return r;if(n===`importers`)return t.importers-e.importers||C(e,t);if(n===`imports`)return t.dependencies-e.dependencies||C(e,t);let i=x(e)-x(t);if(i)return i;if(n===`structure`&&e.component===t.component){let n=(w.get(e.id)??0)-(w.get(t.id)??0);if(n)return n}return C(e,t)},O=[...s.values()].filter(e=>D.has(e.id)&&(!o||e.cyclic)).toSorted(ee),k=new Map(O.map((e,t)=>[e.id,t])),A=[];for(let[e,t]of u)if(k.has(e))for(let n of t.values())k.has(n.to)&&A.push({...n,row:k.get(e),col:k.get(n.to)});return{rows:O,byId:s,cells:u,visibleCells:A,index:k,matches:E,importCount:m,totalRows:s.size,cycleCount:g.filter(e=>v.has(e[0])).length}}export{ne as a,ae as b,oe as c,M as d,le as e,N as f,ue as g,P as h,de as i,fe as j,pe as k,me as l,he as m,F as n,_e as o,ye as p,xe as q,Se as r,Ce as s,we as t,Te as u,L as v,Ee as w,De as x,Oe as y,ke as z,je as A,Me as B,Ne as C,Ve as D,He as E,B as F,We as G,Je as H,Ye as I,Ze as J,Qe as K,$e as L,et as M,tt as N,st as O,H as P,ft as Q,gt as R,xt as S,Tt as T,Ot as U,Pt as V,Rt as W,zt as X,G as Y,Vt as Z,Ut as _,Wt as $,Kt as aa,Xt as ba,Zt as ca,Qt as da,en as ea,tn as fa,pn as ga,mn as ha,yn as ia,Nn as ja,Q as ka,Pn as la,Ln as ma,zn as na,Bn as oa,Hn as pa,Un as qa,Gn as ra,Kn as sa,qn as ta,Jn as ua,Yn as va,er as wa,tr as xa,nr as ya,_r as za,ur as Aa,dr as Ba,vr as Ca,yr as Da};
|
|
34
|
+
/*! Bundled license information:
|
|
35
|
+
|
|
36
|
+
lit-html/directives/class-map.js:
|
|
37
|
+
(**
|
|
38
|
+
* @license
|
|
39
|
+
* Copyright 2018 Google LLC
|
|
40
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
+
*)
|
|
42
|
+
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
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=`
|
|
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,patch:le,repo:re},_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
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
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
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(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Jb as e,Kb as t,Lb as n,Nb as r,Ob as i,Pb as a,Ub as o,jc as s,pc as c,w as l}from"./chunk-
|
|
1
|
+
import{Jb as e,Kb as t,Lb as n,Nb as r,Ob as i,Pb as a,Ub as o,jc as s,pc as c,w as l}from"./chunk-3K56AIDY.js";import{j as u,k as d}from"./chunk-4TQKM3JC.js";import{e as f,f as p,g as m,j as h}from"./chunk-QRKFPLA4.js";import{c as g}from"./chunk-2XUEZHIP.js";var _=`.md-quote,.md-alert{margin:0;&:not(:first-child),+*{margin-top:.5lh}>:first-child{margin-top:0}>:last-child{margin-bottom:0}}.md-quote{padding-inline-start:.85em;border-inline-start:.25em solid rgb(from currentcolor r g b / .3);color:rgb(from currentcolor r g b / calc(alpha*.78));.md-quote{color:inherit}}.md-alert{--md-alert: var(--info);padding:.35lh .85em;border-inline-start:.25em solid var(--md-alert);background:rgb(from var(--md-alert) r g b / .06);border-radius:0 var(--ui-radius, 4px) var(--ui-radius, 4px) 0}.md-alert-tip{--md-alert: var(--green)}.md-alert-important{--md-alert: var(--purple)}.md-alert-warning{--md-alert: var(--warning)}.md-alert-caution{--md-alert: var(--critical)}.md-alert-title{display:flex;align-items:center;gap:.45em;margin-bottom:.2lh;color:var(--md-alert);font-weight:600}.md-alert-icon{flex:none;width:1.05em;height:1.05em}
|
|
2
2
|
`,v=`.token.comment,.token.prolog,.token.cdata{color:var(--code-comment);font-style:italic}.token.punctuation{color:var(--muted)}.token.string,.token.attr-value,.token.char,.token.regex{color:var(--code-string)}.token.number,.token.boolean,.token.constant,.token.symbol{color:var(--code-number)}.token.keyword,.token.builtin,.token.important,.token.atrule{color:var(--code-keyword)}.token.function,.token.class-name,.token.tag{color:var(--code-function)}.token.operator,.token.entity,.token.url,.token.attr-name,.token.selector{color:var(--code-operator)}.token.variable,.token.property,.token.parameter{color:var(--code-variable)}.token.annotation{color:var(--code-function)}.token.deleted{color:var(--code-deleted)}.token.inserted{color:var(--code-inserted)}.token.italic{font-style:italic}.token.bold{font-weight:700}.code-control{padding:0 .3em;margin:0 .1em;border-radius:3px;font-size:.8em;line-height:0;font-style:normal;font-weight:400;color:var(--warning);background:rgb(from var(--warning) r g b / .14);box-shadow:inset 0 0 0 1px rgb(from var(--warning) r g b / .45);white-space:nowrap;user-select:none}
|
|
3
3
|
`,y=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`,b=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.8" y="5" width="20.4" height="14" rx="2"/><path d="M5.6 15.6V8.4l3.1 3.6 3.1-3.6v7.2"/><path d="M16.9 8.4v7.2m-2.6-2.9 2.6 2.9 2.6-2.9"/></svg>`,x=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M6 9V2h12v7"/><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><rect x="6" y="14" width="12" height="8"/></svg>`;function S(e,t){let n=u.find(t=>t.value===e)?.label??e;return d(e)?.includes(`partial`)?t===`exclude`?`${n} (full only)`:t===`only`?`${n} (partial only)`:n:n}function C(e){return h.filter(t=>e.has(t)).map(e=>f[e]??e).join(`, `)}function w(r=l){let i=[];if(r.filterSeverities.size>0&&i.push({key:`severity`,label:`Severity`,value:C(r.filterSeverities),clear:{filterSeverities:new Set}}),r.filterColors.size>0&&i.push({key:`marks`,label:`Marks`,value:[...r.filterColors].map(e=>m[e]??e).join(`, `),clear:{filterColors:new Set}}),r.filterSources.size===1&&i.push({key:`source`,label:`Source`,value:r.filterSources.has(`own`)?`Sources only`:`Dependencies only`,clear:{filterSources:new Set}}),r.filterAnalyzer&&i.push({key:`analyzer`,label:`Analyzer`,value:r.filterAnalyzer===e?`(none)`:r.filterAnalyzer,clear:{filterAnalyzer:``}}),r.filterModel&&i.push({key:`model`,label:`Model`,value:r.filterModel===n?`(none)`:r.filterModel,clear:{filterModel:``}}),r.filterRepo&&i.push({key:`repo`,label:`Repository`,value:r.filterRepo===t?`(no repo)`:r.filterRepo,clear:{filterRepo:``}}),d(r.filterRevalidate)&&i.push({key:`revalidate`,label:`Revalidation`,value:S(r.filterRevalidate,r.filterPartial),clear:{filterRevalidate:``,filterPartial:``}}),!r.filterRevalidate&&(r.filterConfMin>0||r.filterConfMax<10)){let e;e=r.filterConfMin>0&&r.filterConfMax<10?`${r.filterConfMin}\u2013${r.filterConfMax}`:r.filterConfMin>0?`\u2265 ${r.filterConfMin}`:`\u2264 ${r.filterConfMax}`,i.push({key:`confidence`,label:`Confidence`,value:e,clear:{filterConfMin:0,filterConfMax:10}})}r.filterInclude&&i.push({key:`search`,label:r.filterIncludeNegate?`Excluding`:`Search`,value:`"${r.filterInclude}"`,clear:{filterInclude:``,filterIncludeNegate:!1}});for(let[e,t]of[[`filterComment`,`comment`],[`filterFix`,`fix`],[`filterFlagged`,`flag`]]){let n=r[e];n&&i.push({key:`annotation:${t}`,label:`Annotation`,value:`${n===`with`?`With`:`Without`} ${t}`,clear:{[e]:``}})}return!l.currentWorkspace&&r.filterDuplicates&&i.push({key:`duplicates`,label:`Duplicates`,value:r.filterDuplicates===`with`?`Only rows linked to other reports`:`Exclude rows linked to other reports`,clear:{filterDuplicates:``}}),r.filterCrossContext&&i.push({key:`cross-context`,label:`Context`,value:r.filterCrossContext===`with`?`Only rows across multiple repos or packages`:`Exclude rows across multiple repos or packages`,clear:{filterCrossContext:``}}),r.filterAppStacked&&i.push({key:`app-stacked`,label:`App stack`,value:r.filterAppStacked===`with`?`Only rows with multiple App findings`:`Exclude rows with multiple App findings`,clear:{filterAppStacked:``}}),r.filterSecurity&&i.push({key:`security`,label:`Security`,value:r.filterSecurity===`with`?`Only security-related rows`:`Exclude security-related rows`,clear:{filterSecurity:``}}),i}function T(){return c().filter(e=>s(e).commonTriage===l.shownTriage)}function E(){return l.shownTriage?p[l.shownTriage]??l.shownTriage:null}function D(e,t=r()){let n=T(),s=n.length;i(t);let c;try{c=o(n).length}finally{a()}return{included:c,total:s,excluded:s-c,fields:t,filters:w(t),bucketLabel:E(),focusedOnly:e===`print`&&l.viewMode===`focus`}}var O=`.managed-comment{container:managed-comment / inline-size;white-space:normal}.managed-comment-row{display:grid;grid-template-columns:minmax(0,max-content) minmax(0,1fr) auto;align-items:start;gap:.35rem .65rem;line-height:1.5}.managed-comment-author{grid-column:1;grid-row:1;display:flex;align-items:center;gap:.45rem;min-width:0;max-width:14rem;& strong{overflow:hidden;text-overflow:ellipsis;font-weight:600}}.managed-comment-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:1.3rem;height:1.3rem;overflow:hidden;border-radius:50%;background:rgb(from var(--muted) r g b / .15);color:var(--muted);font-size:.65rem;font-weight:600;& img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}& img[hidden]{display:none}}.managed-comment-body{grid-column:2;grid-row:1;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;& a{color:var(--accent);text-decoration:none}& a:hover{text-decoration:underline}& a.comment-self-ref{text-decoration:underline dotted;text-underline-offset:2px}& a.comment-self-ref:hover{text-decoration:underline solid}}.managed-comment-time{color:var(--muted);font-size:.7rem;font-weight:400;white-space:nowrap;text-align:right}.managed-comment-meta{grid-column:3;grid-row:1;justify-self:end;display:flex;align-items:center;gap:.5rem;min-height:1.3rem}.managed-comment-actions{display:flex;align-items:center;gap:.15rem}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr) auto;.managed-comment-body{grid-column:1}.managed-comment-meta{grid-column:2}}@container managed-comment (max-width: 28rem){.managed-comment-row:has(.managed-comment-meta){grid-template-columns:minmax(0,max-content) minmax(0,1fr);.managed-comment-meta{grid-column:1 / -1;grid-row:1}.managed-comment-author,.managed-comment-body{grid-row:2}}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr)}.managed-comment-author{max-width:9rem}}
|
|
4
4
|
`;export{_ as a,v as b,y as c,b as d,x as e,w as f,T as g,E as h,D as i,O as j};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e,f as t,g as n,k as r}from"./chunk-4HI2MSAV.js";import{k as i}from"./chunk-
|
|
1
|
+
import{e,f as t,g as n,k as r}from"./chunk-4HI2MSAV.js";import{k as i}from"./chunk-5AXC5J2C.js";function a(e,t){return e?e.base===``?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}var o=(e,t)=>`${`../`.repeat(e.base.split(`/`).length-1)}${t}`;function s({root:e,paths:t},n,r){if(!e||n===`.`)return n;for(let e of r){let r=t.get(`${n}/${e}`);if(r?.endsWith(`/${e}`))return r.slice(0,-e.length-1)}let i=a(e,`${n}/`);return i===null?o(e,n):i.slice(0,-1)||`.`}function c(e,t){if(!e)return{prefix:t,from:null,to:null};let n=t.startsWith(e.other)?t:``;return{prefix:n,from:`./${e.base}${n.slice(e.other.length)}`,to:`./${n||e.other}`}}function l(e){let t=i(e),n=new Map;for(let[r,i]of Object.entries(e?.bundle?.reason??{})){let e=new Set(Array.isArray(i)?i.filter(e=>t.has(e)):[]);e.size>0&&n.set(r,e)}return{stasis:e?.kind===`stasis`,files:t,trees:n}}var u=[[`extra`,`add`],[`metro`,`bundle:metro`]];function d(e){if(e.length!==2)return e;let t=(t,n)=>e.find((r,i)=>r.trees.has(n)&&!r.trees.has(t)&&e[1-i].trees.has(t)&&!e[1-i].trees.has(n)),n=e.map(()=>new Map);for(let[r,i]of u){let a=t(r,i);a&&n[e.indexOf(a)].set(i,r)}let r=t(`metro`,`bundle:metro`);return r&&t(`run`,`bundle`)===r&&n[e.indexOf(r)].set(`bundle`,`run`),e.map((e,t)=>n[t].size===0?e:{...e,trees:new Map([...e.trees].map(([e,r])=>[n[t].get(e)??e,r])),actual:new Map([...n[t]].map(([e,t])=>[t,e]))})}function f(e,t){if(!e.stasis||e.trees.size!==1)return null;let[[n,r]]=e.trees;return r.size===e.files.size&&!t.some(t=>t!==e&&t.trees.has(n))?n:null}var p=e=>e.trees.size===0||e.trees.size===1&&[...e.trees.values()][0].size===e.files.size,m=`reasons:`,h=(e,t)=>`${m}${JSON.stringify([e,t].toSorted())}`;function g(e){if(!e.startsWith(m))return null;try{let t=JSON.parse(e.slice(m.length));return Array.isArray(t)&&t.length===2&&t.every(e=>typeof e==`string`)?t:null}catch{return null}}function _(...e){let t=d(e.map(l));if(t.length===2&&!t.some(p)){let[e,n]=t.map(e=>[...e.trees.keys()].toSorted()),r=e.filter(e=>n.includes(e)),[i,a]=[e,n].map(e=>e.filter(e=>!r.includes(e)));if(i.length>0&&a.length>0)return[...r.map(e=>({id:`reason:${e}`,label:e})),...i.flatMap(e=>a.map(t=>({id:h(e,t),label:`${e} \u2192 ${t}`})))]}let n=t.filter(e=>f(e,t)===null),r=new Set(n.flatMap(e=>[...e.trees.keys()])),i=e=>n.some(t=>t.stasis&&(t.trees.get(e)?.size??0)<t.files.size);return[...r].some(i)?[...r].toSorted().map(e=>({id:`reason:${e}`,label:e})):[]}function v(e,t,n=``){if(!n)return[``,``];let r=g(n),i=d([e,t].map(l)),a=n.startsWith(`reason:`)?n.slice(7):null;return i.map(e=>{let t=r?r.find(t=>e.trees.has(t)):f(e,i)??a;return t==null?n:`reason:${e.actual?.get(t)??t}`})}function y(e,t=``){let n=i(e);if(!t||e?.kind!==`stasis`)return n;let r=e?.bundle?.reason?.[t.replace(/^reason:/u,``)],a=new Set(Array.isArray(r)?r:[]);return new Map([...n].filter(([e])=>a.has(e)))}function b(e,t,n,r){return JSON.stringify([e,t,n,r])}function x(e,t=``){let n=new Map;if(e?.kind!==`stasis`||!e.bundle)return n;let r=t?i(e):null,a=t?y(e,t):null;for(let[t,i]of e.bundle.imports)for(let[e,o]of i)for(let[i,s]of o){let o=typeof s==`string`?[[null,s]]:s;for(let[s,c]of o){if(a&&!a.has(e)&&(r.has(e)||!a.has(c)))continue;let o=b(e,i,t,s);n.set(o,{key:o,parent:e,specifier:i,conditions:t,platform:s,target:c})}}return n}var S=(e,{lo:t,start:n},r)=>e[n+(r-t)/2];function C(e,t,{low:n,high:r},i,a){return e===-t||e-1<n||e!==t&&e+1<=r&&S(i,a,e-1)<S(i,a,e+1)?e+1:e-1}function w(e,t,n,{first:r,n:i,m:a,d:o,...s}){e.a.fill(1,0,r).fill(1,i),e.b.fill(1,0,r).fill(1,a);let c=i,l=a;for(let r=o;r>0;r--){let i=c-l,a=C(i,r,s,t,n[r]),o=S(t,n[r],a);for(let t=a>i?o:o+1;t<c;t++)e.a[t]=e.b[t-i]=1;c=o,l=c-a}for(let t=r;t<c;t++)e.a[t]=e.b[t]=1}function T(e,t,n){let r=0,i=t.length,a=e.length,o=2*(a+i);for(;r<a&&r<i&&e[r]===t[r];)r++;for(;a>r&&i>r&&e[a-1]===t[i-1];)a--,i--;let s={high:a-r,low:r-i},c=[r],l=[{lo:1,start:0}];for(let u=0;u<=s.high-s.low;u++){let d=l[u],f=Math.min(u,s.high),p=Math.max(-u,s.low+(s.low+u&1));l.push({lo:p,start:c.length});for(let m=p;m<=f;m+=2){let f=C(m,u,s,c,d),p=S(c,d,f),h=f>m?p:p+1,g=h;for(;h<a&&h-m<i&&e[h]===t[h-m];)h++;if(o+=2+h-g,c.push(h),h>=a&&h-m>=i)return w(n,c,l,{first:r,n:a,m:i,d:u,...s}),o}}throw Error(`no edit script between two lines`)}var E=/[\p{L}\p{N}_$]+|\s+|[^\p{L}\p{N}_$\s]/gu,D=2e3,ee=800,O=.6;function k(e,t){if(e.length>D)return null;let n=e.match(E)??[];return n.length>ee?null:{line:e,tokens:n,words:n.map(e=>(t.has(e)||t.set(e,t.size),t.get(e)))}}function A({tokens:e,line:t},n){let r=[];for(let i=0,a=0;a<e.length;i+=e[a++].length){if(n[a])continue;let o=r.at(-1);o&&/^\s*$/u.test(t.slice(o[1],i))?o[1]=i+e[a].length:r.push([i,i+e[a].length])}return r}var j=(e,t)=>e.reduce((e,[t,n])=>e+n-t,0)/Math.max(1,t.length);function M(e,t){let n={a:e.words.map(()=>0),b:t.words.map(()=>0)},r=T(e.words,t.words,n),i={a:A(e,n.a),b:A(t,n.b)};return{ranges:i,share:n.a.includes(1)?Math.min(j(i.a,e.line),j(i.b,t.line)):1,steps:r}}function te(e,t){if(e===t)return{a:[],b:[]};let n=new Map,r=k(e,n),i=k(t,n);if(r===null||i===null)return null;let{ranges:a,share:o}=M(r,i);return o<=O?a:null}var N=200,P=5e6,F=6,I=60,L=3;function R(e){let t=new Map;for(let n of e?.tokens??[])t.set(n,(t.get(n)??0)+1);return t}function z(e,t){let n=new Map,r=[e,t].map(e=>e.map(e=>k(e,n))),i=r.map(e=>e.map(R)),a=0,o=(e,t,n)=>{let r=0;for(let[i,o]of e)if(a+=L,(r+=i.length*Math.max(0,o-(t.get(i)??0)))>O*n.length)return 1/0;return r/Math.max(1,n.length)},s=(n,a)=>r[0][n]===null||r[1][a]===null?1/0:Math.min(o(i[0][n],i[1][a],e[n]),o(i[1][a],i[0][n],t[a])),c=(e,t)=>{if(a+=I,s(e,t)===1/0)return 1/0;let{share:n,steps:i}=M(r[0][e],r[1][t]);return a+=i,n<=O?n:1/0},l=new Float64Array(e.length*t.length).fill(NaN);return{share:(n,r)=>{let i=n*t.length+r;return Number.isNaN(l[i])&&(l[i]=e[n]===t[r]?0:c(n,r)),l[i]},floor:s,spent:()=>a}}function B(e,t,{share:n,spent:r}){let i=Array.from({length:e+1},()=>new Float64Array(t+1)),a=(e,t)=>n(e,t)===1/0?-1/0:1e3-n(e,t)+i[e][t];for(let n=0;n<e;n++)for(let e=0;e<t;e++)if(i[n+1][e+1]=Math.max(i[n][e+1],i[n+1][e],a(n,e)),r()>P)return null;let o=[];for(let n=e,r=t;n>0&&r>0;)i[n][r]===i[n][r-1]?r--:i[n][r]===i[n-1][r]?n--:o.push([--n,--r]);return o.toReversed()}function V(e,t,{share:n,floor:r}){let i=[];for(let a=0,o=0;a<e&&o<t;a++){let e=null,s=1/0,c=Array.from({length:Math.min(t,o+F)-o},(e,t)=>[o+t,r(a,o+t)]);for(let[t,r]of c.toSorted((e,t)=>e[1]-t[1]||e[0]-t[0])){if(r>s)break;(n(a,t)<s||n(a,t)===s&&t<e)&&([e,s]=[t,n(a,t)])}e!==null&&(i.push([a,e]),o=e+1)}return i}function H(e,t){if(e.length>N||t.length>N)return[];let n=z(e,t);return B(e.length,t.length,n)??V(e.length,t.length,n)}var U=(e,n,r)=>t(e,n,{...r,discard:!1});function W(e){if(e===null)return``;let t=e.type===`symlink`?e.target:e.data;if(typeof t==`string`)return t.includes(`\0`)?void 0:t;if(!t.includes(0))try{return r(t)}catch{return}}var G=new Set([`none`,`all`,`change`,`trailing`]);function K({horizon:e=1/0,whitespace:t=`none`,ignoreCase:n=!1}={}){if(e!==1/0&&!(Number.isSafeInteger(e)&&e>=0))throw RangeError(`horizon must be a whole number or Infinity, not ${e}`);if(!G.has(t))throw RangeError(`whitespace must be 'none', 'all', 'change' or 'trailing', not ${t}`);if(typeof n!=`boolean`)throw TypeError(`ignoreCase must be a boolean, not ${typeof n}`);return{horizon:e,whitespace:t,ignoreCase:n}}var q=e=>e.reduce((e,{a0:t,a1:n,b0:r,b1:i})=>e+n-t+i-r,0),J=e=>e===``?[]:e.split(/(?<=\n)/u),Y=e=>({...e,ignoreCase:!1,whitespace:`none`}),X=e=>(e.whitespace??`none`)!==`none`||!!e.ignoreCase;function Z(t,r,i,a,o){let s=J(t),c=J(r),l=(e,t,n,r)=>({a0:e,a1:t,b0:n,b1:r,remove:s.slice(e,t),insert:c.slice(n,r)}),u=o.flatMap(({a0:e,a1:t,b0:n,b1:r})=>e===t||n===r?[l(e,t,n,r)]:U(s.slice(e,t).join(``),c.slice(n,r).join(``),i).map(t=>l(e+t.a0,e+t.a1,n+t.b0,n+t.b1))),d=q(u)<q(a)&&(a=>{try{return n(t,r,a,{format:`normal`,ignoreCase:i.ignoreCase,whitespace:i.whitespace}),!0}catch(t){if(t instanceof e)return!1;throw t}})(u)?u:a;return q(d)<q(o)?d:o}function ne(e,t,n){let r=U(e,t,n);return X(n)?Z(e,t,n,r,U(e,t,Y(n))):r}function re(e,t,n){let r=W(e),i=W(t);if(r===void 0||i===void 0)return{binary:!0,blocks:[],insertions:null,deletions:null};let a=r===i?[]:ne(r,i,n),o=(e,t)=>a.reduce((n,r)=>n+r[t]-r[e],0);return{binary:!1,blocks:a,insertions:o(`b0`,`b1`),deletions:o(`a0`,`a1`)}}function ie(t,r,i,a){let{whitespace:o,ignoreCase:s}=K(a);try{return n(t,r,i,{format:`normal`,whitespace:o,ignoreCase:s}),!0}catch(t){if(t instanceof e)return!1;throw t}}var Q=/[ \t\n\v\f\r]/u,$=e=>{let t=e.split(`
|
|
2
2
|
`);return t.at(-1)===``&&t.pop(),t};function ae(e,t){for(let n=0,r=0;;n++,r++){let i=``,a=``;for(;n<e.length&&Q.test(e[n]);)i+=e[n++];for(;r<t.length&&Q.test(t[r]);)a+=t[r++];if(i!==a&&new Set(i+a).size>1)return!0;if(n>=e.length||r>=t.length)return!1}}function oe(e,t,n){try{if(!ie(e,t,n,{whitespace:`all`}))return!0}catch{return!0}let r=$(e),i=$(t),a=0,o=0;for(let e=0;e<=n.length;e++){let t=e<n.length?n[e].a0:r.length;for(;a<t;a++,o++)if(r[a]!==i[o]&&ae(r[a],i[o]))return!0;e<n.length&&({a1:a,b1:o}=n[e])}return!1}function se(e,t,{extension:n=!0}={}){let r=e.split(`/`),i=t.split(`/`),a=0;for(;a<r.length-1&&a<i.length-1&&r[a]===i[a];)a++;let o=0;for(;o<r.length-a-1&&o<i.length-a-1&&r.at(-1-o)===i.at(-1-o);)o++;let s={head:a?`${r.slice(0,a).join(`/`)}/`:``,from:r.slice(a,r.length-o).join(`/`),to:i.slice(a,i.length-o).join(`/`),tail:o?`/${r.slice(-o).join(`/`)}`:``},c=s.from.lastIndexOf(`.`);return n&&!s.from.includes(`/`)&&!s.to.includes(`/`)&&c>0&&s.to.lastIndexOf(`.`)===c&&s.from.slice(0,c)===s.to.slice(0,c)?{...s,head:s.head+s.from.slice(0,c),from:s.from.slice(c),to:s.to.slice(c)}:s}export{te as a,H as b,W as c,K as d,re as e,oe as f,se as g,a as h,o as i,s as j,c as k,_ as l,v as m,y as n,b as o,x as p};
|