@preventive/triage 1.0.0-alpha.54 → 1.0.0-alpha.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/managed/routes.js +6 -2
- package/common/managed/team-filters.js +26 -0
- package/out/activity.js +1 -1
- package/out/{chunk-VZMELPVL.js → chunk-3TFOB75M.js} +1 -1
- package/out/{chunk-L4CTEMRG.js → chunk-5PKS6FVK.js} +1 -1
- package/out/{chunk-WNSVBOSO.js → chunk-6GAPL5ZA.js} +24 -23
- package/out/{chunk-WHVXTJHK.js → chunk-ATTKQVZH.js} +1 -1
- package/out/chunk-CGKPGHST.js +6 -0
- package/out/{chunk-2K6UN3PC.js → chunk-IZ6MYRYB.js} +1 -1
- package/out/{chunk-DTM47KGS.js → chunk-J2FWBXFV.js} +1 -1
- package/out/{chunk-ORIP5INC.js → chunk-J4CLTPOR.js} +1 -1
- package/out/{chunk-J7A5OSZE.js → chunk-PKQBEPZU.js} +46 -46
- package/out/chunk-PTFQKLKO.js +1 -0
- package/out/{chunk-UBOCLLF2.js → chunk-WST3LUUL.js} +1 -1
- package/out/{chunk-VC72ZO3P.js → chunk-X655SAHV.js} +1 -1
- package/out/{chunk-I47TYPXO.js → chunk-ZFXCWNXC.js} +1 -1
- package/out/client-managed-import.js +1 -1
- package/out/client-managed.js +2 -2
- package/out/compare.js +1 -1
- package/out/dialogs.js +1 -1
- package/out/graph.js +1 -1
- package/out/index.html +8 -8
- package/out/scan.js +1 -1
- package/out/view.js +1 -1
- package/package.json +4 -3
- package/server-managed/bundle-build-worker.js +40 -33
- package/server-managed/stasis-config.ts +9 -0
- package/out/chunk-FHIVVVUA.js +0 -6
- package/out/chunk-HT2SSA3V.js +0 -1
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import{b as e,h as t}from"./chunk-
|
|
2
|
-
`).toLowerCase(),t.set(e,n)}return n}function Ze(e){H.on.delete(e),H.off.delete(e)}function Qe(e){return[typeof e?.category==`string`?e.category.trim():``,g(e,L)].filter(Boolean).join(` · `)}function $e(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 et(e){if(!e)return``;let t=e.match(/github\.com\/([^/?#]+\/[^/?#]+?)(?:\.git)?(?:[/?#]|$)/iu);return t?t[1]:e}function tt(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 nt=/^(?:@[\w.-]+\/)?[\w.-]+@[^/\s@]+$/u;function rt(e){return nt.test(e||``)}function it(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:re(e)}}function at(e,t,n,r=``){if(rt(e))return null;let i=it(t),a=it(n),o=ne(r);if(i.id){let t=c({repo:{github:i.id}}),n=tt(t??i.id),r=ie(t,c({repo:{github:a.id}}));return`${n}/blob/${i.commit||(r?a.commit:``)||(r||!We(e)?o:``)||`HEAD`}/${i.prefix}${Ye(e)}`}if(V(e))return null;let s=tt(a.id);return s?`${s}/blob/${a.commit||o||`HEAD`}/${a.prefix}${e}`:null}function ot(e,t){let n=e?.file??``,r=U(e,t);return r?k`<a href="${st(r)}" target="_blank" rel="noopener">${n}</a>`:n}function st(e){return e.replace(/#L\d+(?:-L?\d+)?$/u,``)}function U(e,t){if(!e)return null;if(s(e.location))return e.location;let n=at(e.file,e.repo,t,e.auditedCommit);if(!n)return null;let r=K(e.line);if(r
|
|
3
|
-
`);return t.some(e=>
|
|
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 O}from"./chunk-C4Z6ZBXV.js";import{c as k,f as A,g as j,i as ee}from"./chunk-2XUEZHIP.js";var te=D(class extends O{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 A}});function ne(e){let t=typeof e==`string`?e.trim():``;return/^[0-9a-f]{7,64}$/iu.test(t)?t:``}function re(e){return ne(e?.commit)}function ie(e,t){return typeof e==`string`&&typeof t==`string`&&e!==``&&e.toLowerCase()===t.toLowerCase()}function ae(e,t){return ie(t,c(e))?re(e?.repo):``}var oe=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`),se=e=>x(e)?e:oe(S(String(e))),M=globalThis.trustedTypes?.createPolicy(`deepview`,{createHTML:se,createScriptURL:e=>{let t=new URL(e,globalThis.location.href);if(t.origin!==globalThis.location.origin)throw TypeError(`Not a same-origin script: ${t.href}`);return t.href}}),N=e=>M?M.createHTML(e):se(e),ce=e=>M?M.createScriptURL(String(e)):e,P={showAll:!1,packagesView:!1,dependencyPackagesView:!1,flowPackagesView:!1,bundleIssues:!1,bundleLayout:`graph`,lockfileLayout:`dependencies`,bundleReason:null,bundleReasonFor:null,selected:null,focusedPkg:null,topPkgsTab:`issues`,edgeOpacity:.22,nodeSize:1,showLabels:!1,selectedSeverities:new Set,selectedColors:new Set,pathFilter:``,hidden:new Set,solo:null,graphState:null,layoutCache:null,keptViewport:null};function le({keepViewport:e=!1}={}){P.graphState?._cleanup?P.graphState._cleanup({keepViewport:e}):e||(P.keptViewport=null),P.graphState=null}function F(e){return e.id??String(e._id)}function ue(e){let t=h(e);return t!==``&&t!==`revalidation`}var de=[{value:`confirmed`,label:`Confirmed`,kinds:[`confirmed`,`partial`,`revalidation`]},{value:`unreachable`,label:`Unreachable`,kinds:[`unreachable`]},{value:`refuted`,label:`Refuted`,kinds:[`refuted`]}];function fe(e){return de.find(t=>t.value===e)?.kinds??null}var pe=[``,`exclude`,`only`];function me(e,t){let n=fe(e);return n?.includes(`partial`)?t===`only`?[`partial`]:t===`exclude`?[`confirmed`]:n:n}function I(e){if(e.confidence!==void 0)return e.confidence;if(e.critical===!0||e._source)return 10}var he=e=>e.confidence!==void 0||e.critical===!0;function ge(e){return e.every(e=>e.every(e=>I(e)!==void 0))&&e.some(e=>e.some(he))}function _e(e,t,n){return e.some(e=>{let r=[`refuted`,`unreachable`].includes(n(e))?0:I(e);return r===void 0?t===0:r>=t})}function ve(e,t){let n=e.map(t).filter(e=>e.length>0);if(!n.some(e=>e.some(e=>I(e)!==void 0)))return 0;let r=e=>n.reduce((t,n)=>t+ +!!n.some(t=>(I(t)??-1)>=e),0),i;for(i=r(6)<=25?6:r(7)<=25?7:8;i>0&&r(i-1)===r(i);)i--;return i}function ye(e,t){return ge(e)?t:0}function be(e,t,n){let r=new Set(e.ruledOutIds??[]);for(let t of e)for(let e of t)[`refuted`,`unreachable`].includes(n(e))&&r.add(F(e));for(let i of e){let e=t(i);if(e.length!==0&&e.some(e=>me(`confirmed`,``).includes(n(e)||(e._source&&!e._sourcePass?`revalidation`:``)))){for(let e of i)if(r.add(F(e)),e.isApp&&Array.isArray(e.revalidateInputs))for(let t of e.revalidateInputs)t&&r.add(t)}}return r}function xe(e,t,n,r){let i=ye(e,t),a=e.filter(e=>_e(e,i,r));if(a.length===0)return!1;let o=new Set(me(`confirmed`,``));return e.some(e=>e.some(e=>o.has(r(e))))?a.every(e=>e.every(e=>n.has(F(e)))):!1}function Se(e,{tabs:t,kindOf:n,severityMode:r}){let i=e.map(t).filter(e=>e.length>0),a=be(e,t,n);if(!xe(i,ve(e,t),a,n))return!1;let o=ye(i,6);return i.every(e=>!_e(e,o,n)||!e.some(e=>m(e,r)!==`low`)||e.every(e=>a.has(F(e))))}var L=!0;function Ce(e,t=!1){L=e!==!1&&!t}function we(){return L}function R(e){return L?h(e):``}function Te(e){return h(e)!==``}function Ee(e){return e.some(e=>(e.groups??[]).some(e=>e.some(ue)))}function De(e){let t=R(e);return t&&t!==`revalidation`?t:null}function Oe(e){return R(e)===`revalidation`}var ke=new Set([`refuted`,`unreachable`]);function Ae(e){return ke.has(R(e))}function je(e){return ke.has(R(e))}function Me(e){let t=new Set(e);return de.filter(e=>e.kinds.some(e=>t.has(e)))}function z(e){return RegExp(`(^|/)${e}/`,`u`)}function Ne(e){return RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,`u`)}var Pe=z(`node_modules`),Fe=z(`vendor`),B=`node_modules`,Ie=z(B),Le=Ne(B);function Re(e){e!==B&&(B=e,Ie=z(e),Le=Ne(e))}var ze=null;function Be(t){ze?.length===t.length&&ze.every((e,n)=>e===t[n])||(ze=[...t],Re(e(t)))}function Ve(){return B}function V(e){return Ie.test(e)}var He=new WeakSet;function Ue(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=He.has(n);`isUpstream`in n&&!e||(V(n.file)?(n.isUpstream!==!0&&(t=!0),n.isUpstream=!0,He.add(n)):e&&(t=!0,delete n.isUpstream,He.delete(n)))}return t}function We(e){let t=typeof e==`string`?e:``;return Pe.test(t)||Fe.test(t)||Ie.test(t)}var Ge=/^(.*(?:^|\/)node_modules\/(?:@[^/]+\/[^/]+|[^/]+))(?:\/|$)/u;function Ke(e){return Ge.exec(typeof e==`string`?e:``)?.[1]??null}function qe(e){return typeof e!=`number`||!Number.isFinite(e)?null:n(e)}function Je(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 Ye(e){return e.match(Le)?.[1]??e}var H={on:new WeakMap,off:new WeakMap};function Xe(e){let t=L?H.on:H.off,n=t.get(e);if(n===void 0){let r=L?[De(e),e.revalidateVerdict,e.revalidateRecommendation]:[];n=[e.file,e.title,e.description,e.impact,e.reproduction,Gt(e),e.recommendation,e.confidenceReason,...r,e.discoveredIn,e.repo?.github].filter(Boolean).join(`
|
|
2
|
+
`).toLowerCase(),t.set(e,n)}return n}function Ze(e){H.on.delete(e),H.off.delete(e)}function Qe(e){return[typeof e?.category==`string`?e.category.trim():``,g(e,L)].filter(Boolean).join(` · `)}function $e(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 et(e){if(!e)return``;let t=e.match(/github\.com\/([^/?#]+\/[^/?#]+?)(?:\.git)?(?:[/?#]|$)/iu);return t?t[1]:e}function tt(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 nt=/^(?:@[\w.-]+\/)?[\w.-]+@[^/\s@]+$/u;function rt(e){return nt.test(e||``)}function it(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:re(e)}}function at(e,t,n,r=``){if(rt(e))return null;let i=it(t),a=it(n),o=ne(r);if(i.id){let t=c({repo:{github:i.id}}),n=tt(t??i.id),r=ie(t,c({repo:{github:a.id}}));return`${n}/blob/${i.commit||(r?a.commit:``)||(r||!We(e)?o:``)||`HEAD`}/${i.prefix}${Ye(e)}`}if(V(e))return null;let s=tt(a.id);return s?`${s}/blob/${a.commit||o||`HEAD`}/${a.prefix}${e}`:null}function ot(e,t){let n=e?.file??``,r=U(e,t);return r?k`<a href="${st(r)}" target="_blank" rel="noopener">${n}</a>`:n}function st(e){return e.replace(/#L\d+(?:-L?\d+)?$/u,``)}function ct({start:e,end:t}){return t>e?`#L${e}-L${t}`:`#L${e}`}function U(e,t){if(!e)return null;if(s(e.location))return e.location;let n=at(e.file,e.repo,t,e.auditedCommit);if(!n)return null;let r=K(e.line);if(r)return`${n}${ct(r)}`;let i=parseInt(e.line,10);return Number.isFinite(i)?`${n}#L${i}`:n}var lt=/^https?:\/\/(?:www\.)?github\.com\/([^/\s]+\/[^/\s]+)\/(?:blob|tree|blame)\/[^/\s]+\/(\S+)$/u,ut=/#L(\d+)(?:-L?(\d+))?$/u;function dt(e){let t=typeof e==`string`?lt.exec(e):null;if(!t)return``;let n=t[2],r=ut.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 ft=/^(?:\s+\S|[-*+] |\d+[.)] |>|#{1,6}(?:[ \t]|$)|\||`{3}|~{3})/u;function pt(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=>ft.test(e)||G.test(e))?e:t.map(e=>e.trim()).filter(Boolean).join(` `)}).join(``)}function mt(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+pt(i.slice(0,i.length-a.length))+a}function ht(e){if(!e)return e;let t=e.replaceAll(`\r
|
|
4
4
|
`,`
|
|
5
|
-
`),n=u(t);if(n.length===0)return
|
|
6
|
-
`),n=
|
|
7
|
-
`)}}function
|
|
8
|
-
`)}function
|
|
9
|
-
`),i=
|
|
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=W.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=
|
|
5
|
+
`),n=u(t);if(n.length===0)return pt(t);let r=[],i=0;for(let[e,a]of n)e>i&&r.push(mt(t.slice(i,e),i>0,!0)),r.push(t.slice(e,a)),i=a;return i<t.length&&r.push(mt(t.slice(i),!0,!1)),r.join(``)}var gt=/^( *)(`{3,}|~{3,})(.*)$/u,_t=/^[a-z0-9+#._-]{1,20}$/u;function vt(e,t){let n=0;for(;n<t&&e[n]===` `;)n++;return e.slice(n)}function yt(e){let t=e.split(`
|
|
6
|
+
`),n=gt.exec(t[0]),r=(n?.[2]??"```").slice(0,3),i=(n?.[3]??``).trim().split(/\s+/u)[0].toLowerCase(),a=!!(t.length>1?gt.exec(t.at(-1)):null)?.[2].startsWith(r),o=n?.[1].length??0,s=t.slice(1,a?-1:void 0);return{lang:_t.test(i)?i:``,code:(o>0?s.map(e=>vt(e,o)):s).join(`
|
|
7
|
+
`)}}function bt(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(yt(e.slice(a,o))),r=o;return r<e.length&&i(e.slice(r),!0),n}var W=/^( *)(?:[-*+]|(\d{1,9})[.)]) +(?=\S)/u,G=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/u;function xt(e){return/^ */u.exec(e)[0].length}function St(e){let t=e.length;for(;t>0&&!e[t-1].trim();)t--;return e.slice(0,t).join(`
|
|
8
|
+
`)}function Ct(e){let t=[],n=0;for(let r of e)t.push(n),n+=r.length+1;return t}function wt(e){let t=typeof e==`string`?e:``;if(!t)return[e];let n=u(t),r=t.split(`
|
|
9
|
+
`),i=Ct(r),a=e=>!d(n,i[e])&&!G.test(r[e])&&W.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=W.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=xt(e),r=G.test(e)?null:W.exec(e);if(r&&(!f||n<f.column)){if(!!r[2]!==t)break;f&&u.push(St(f.lines)),f={column:r[0].length,lines:[e.slice(r[0].length)]},p=!1,c++;continue}if(n<f.column&&(p||Tt.test(e)||G.test(e)||Ot.test(e)))break}f.lines.push(vt(e,f.column)),p=!1,c++}f&&u.push(St(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 Tt=/^ {0,3}(#{1,6})[ \t]+(\S.*?)(?:[ \t]+#+)?[ \t]*$/u,Et=/^ {0,3}-+[ \t]*$/u;function Dt(e){let t=e.split(`
|
|
11
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=
|
|
13
|
-
`)}function
|
|
14
|
-
`),a=
|
|
15
|
-
`));let e=[],n=``,r=!1;for(;l<i.length;l++){let t=i[l];if(o(l)){let i=t.replace(
|
|
16
|
-
`)),s}function
|
|
17
|
-
`)}var
|
|
18
|
-
`):[];if(r.length===0)return{text:``,startLine:1,lines:[]};let i=
|
|
19
|
-
`),startLine:o,lines:c}}function
|
|
20
|
-
`))
|
|
12
|
+
`).replaceAll(/^(?:[ \t]*\n)+|(?:\n[ \t]*)+$/gu,``);i.trim()&&n.push(i)};return t.forEach((e,a)=>{let o=Tt.exec(e),s=G.test(e)&&(a===r||!t[a-1].trim()||!Et.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 Ot=/^ {0,3}>/u,kt=/^ {0,3}> ?/u,At=/^[ \t]*\[!(note|tip|important|warning|caution)\][ \t]*$/iu,jt=/^ {0,3}(?:`{3}|~{3})/u,Mt=/^(?: {0,3}> ?| *(?:[-*+]|\d{1,9}[.)])(?: +|$))*/u,Nt=16,Pt=e=>Tt.test(e)||G.test(e)||jt.test(e);function Ft(e,t){let n=gt.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 It(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 Lt(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=Ct(i),o=e=>Ot.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(kt,``),a=n!==``;n=Ft(n,i);let o=i.replace(Mt,``);r=!a&&!n&&o.trim()!==``&&!Pt(o),e.push(i)}else if(r&&t.trim()&&!Pt(t)&&!W.test(t))e.push(t);else break}let a=t?At.exec(e[0]):null,u=a?It(e.slice(1)):``;s.push({quote:!0,alert:u?a[1].toLowerCase():null,body:u||It(e)}),c=l}return c<i.length&&s.push(i.slice(c).join(`
|
|
16
|
+
`)),s}function Rt(e,t=Nt){return t<=0?e:Lt(e).map(e=>typeof e==`string`?e:Rt(e.body,t-1)).join(`
|
|
17
|
+
`)}var zt=/^(\d+)(?:\s*-\s*(\d+))?$/u;function K(e){if(typeof e==`number`)return Number.isFinite(e)&&e>=1?{start:Math.floor(e),end:Math.floor(e)}:null;let t=zt.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 Bt(e){return e?e.start===e.end?String(e.start):`${e.start}-${e.end}`:``}function Vt(e){if(e&&typeof e==`object`){let t=K(e.start);if(!t)return null;let n=K(e.end)??t;return{start:t.start,end:Math.max(t.start,n.end)}}return K(e)}function Ht(e,t,n=4){let r=typeof e==`string`&&e!==``?e.split(`
|
|
18
|
+
`):[];if(r.length===0)return{text:``,startLine:1,lines:[]};let i=Vt(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 Ut(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?U({file:i,line:e?.line,repo:t.repo,auditedCommit:c},n):null;if(r===0&&i===a)return l();let u=Ke(i);return u!==null&&u===Ke(a)?l():We(i)?null:o&&!We(a)?l():U({file:i,line:e?.line,auditedCommit:c},n)}function Wt(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?qt(o(e),a):o(e);if(c)for(let e of c.split(`
|
|
20
|
+
`))s.push(` ${e}`);return s.join(`
|
|
21
21
|
`)}).join(t?`
|
|
22
22
|
|
|
23
23
|
`:`
|
|
24
|
-
`)}function
|
|
25
|
-
${
|
|
26
|
-
|
|
24
|
+
`)}function Gt(e,{repoFallback:t}={}){let n=t!==void 0,r=Wt(e,{link:n?(n,r)=>Ut(n,e,t,r):void 0,lineLinks:n});return r?`**Evidence:**
|
|
25
|
+
${r}`:``}var Kt=/\(\s*(?:lines?|L)\s*(\d+)(?:\s*(?:-|–|—|to)\s*L?(\d+))?\s*\)/giu;function qt(e,t){if(!e||!t||!lt.test(t)||!/\(\s*(?:lines?|L)\s*\d/iu.test(e))return e;let n=st(t),r=e=>{let t=Jt(e);return e.replace(Kt,(e,r,i,a)=>{let o=d(t,a)?null:K(i?`${r}-${i}`:r);return o?`([${e.slice(1,-1).trim()}](${n}${ct(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 Jt(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 Yt(e){let t=/^\[([^\]]+)\]\(([^)\s]+)\)$/u.exec(e);return!t||!s(t[2])?null:{label:f(t[1].trim())||t[2],url:t[2]}}function Xt(e,t){let n=parseInt(e?.line,10);if(!Number.isFinite(n))return j;let r=U(e,t),i=`line ${n}`;return r?k`<a href="${r}" target="_blank" rel="noopener">${i}</a>`:i}function Zt(e,t){return!e||!t?null:`${/^https?:/iu.test(e)?e.replace(/\/$/u,``):`https://github.com/${e}`}/commit/${t}`}var Qt=[[`Impact`,`impact`],[`Reproduction`,`reproduction`],[`Recommendation`,`recommendation`],[`Confidence reason`,`confidenceReason`],[`Revalidation verdict`,`revalidateVerdict`],[`Revalidation recommendation`,`revalidateRecommendation`]];function $t(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=R(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=Wt(e,{spaced:!0});c&&a.push(`# Evidence
|
|
27
28
|
|
|
28
|
-
${c}`);for(let[t,n]of
|
|
29
|
+
${c}`);for(let[t,n]of Qt){if(!L&&n.startsWith(`revalidate`))continue;let r=_(e?.[n],e)?.trim();r&&a.push(`# ${t}
|
|
29
30
|
|
|
30
31
|
${r}`)}return a.join(`
|
|
31
32
|
|
|
32
|
-
`)}function Xt(e,{title:t,body:n,labels:r=[]}={}){let i=tt(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 Zt=/^[a-zA-Z\d](?:-?[a-zA-Z\d])*$/u,Qt=/^[a-zA-Z\d._-]+$/u,$t=/^[1-9]\d{0,9}$/u,en=/^[a-fA-F\d]{7,40}$/u,tn=/^#[\w-]+$/u,nn=/^GHSA(?:-[0-9a-z]{4}){3}$/u;function rn(e){return e.length<=39&&Zt.test(e)}function an(e){return e.length<=100&&e!==`.`&&e!==`..`&&Qt.test(e)}function on(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 nn.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!rn(e)||!an(t)||!nn.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(!rn(r)||!an(i))return null;let s;if(a===`issues`||a===`pull`){if(!$t.test(o))return null;s=`${r}/${i}#${o}`}else if(a===`commit`){if(!en.test(o))return null;s=`${r}/${i}@${o.slice(0,7)}`}else return null;return{url:`https://github.com/${r}/${i}/${a}/${o}${tn.test(t.hash)?t.hash:``}`,label:s}}var sn=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/u;function cn(e){if(typeof e!=`string`)return null;let t=ln(e);return t!==e||sn.test(e)?t.slice(0,8):null}function ln(e){let t=String(e);return t.startsWith(`https://chatgpt.com/codex/cloud/security/findings/`)?t.slice(50):t}function un(e,n){let r=t(e,{managed:n});if(!r)return null;let i=cn(r.id);return{url:n?r.path:`#${r.fragment}`,label:i?`finding ${i}`:`finding`,self:!0}}var dn=/https?:\/\/[^\s<>"'`(){}[\]|\\^]+/giu,fn=new Set([`)`,`.`,`,`,`!`,`?`,`;`,`:`,`'`,`"`,`*`,`]`,`}`,`>`]);function pn(e){let t=e.length;for(;t>0&&fn.has(e[t-1]);)t--;return t===e.length?e:e.slice(0,t)}function mn(e,{managed:t=!1}={}){if(typeof e!=`string`||e.length===0)return[];let n=[],r=0;dn.lastIndex=0;let i;for(;(i=dn.exec(e))!==null;){let a=pn(i[0]),o=a?on(a)??un(a,t):null;o&&(i.index>r&&n.push(e.slice(r,i.index)),n.push(o),r=i.index+a.length,dn.lastIndex=r)}return r<e.length&&n.push(e.slice(r)),n}var hn={commit:T},gn=8;function _n(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 vn({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 q;function yn(){return q||(q=document.createElement(`div`),q.id=`styled-tooltip`,q.setAttribute(`popover`,`manual`),document.body.append(q),q)}function bn(e){typeof e.showPopover==`function`&&(e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover())}var J=null,xn=``,Y=null,X=null,Sn=0,Cn=0,wn=!1;function Z(){if(!wn){wn=!0,document.addEventListener(`mousemove`,e=>{Sn=e.clientX,Cn=e.clientY},{passive:!0});for(let e of[`pointerdown`,`wheel`,`scroll`])document.addEventListener(e,()=>$(),{capture:!0,passive:!0});document.addEventListener(`keydown`,e=>{e.key===`Escape`&&$()}),window.addEventListener(`blur`,()=>$())}}var Tn=100,En=14,Dn=8,Q=8;function On(e,{placement:t=`cursor`}={}){Z(),clearTimeout(Y),Y=null,X=null,e.prepareTooltip?.(e),t=e.dataset.tooltipPlacement??t;let n=yn(),i=e.dataset.tooltip??``,a=Object.hasOwn(hn,e.dataset.tooltipIcon??``)?e.dataset.tooltipIcon:``,o=e.dataset.tooltipRepo??``,s=r(e.dataset.tooltipCommit),c=_n(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){$();return}if(J===e&&xn===y)return;if(n.textContent=a||v?``:i,v){let e=document.createElement(`div`);e.className=`tooltip-rich`,ee(v,e),n.append(e)}if(a){let e=document.createElement(`span`);e.className=`tooltip-text`,e.innerHTML=N(hn[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=N(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=N(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,gn)){let n=document.createElement(`span`);n.className=`tooltip-tag`,n.innerHTML=N(b);let r=document.createElement(`span`);r.textContent=t,n.append(r),e.append(n)}if(c.tags.length>gn){let t=document.createElement(`span`);t.className=`tooltip-tag-more`,t.textContent=`+${(c.tags.length-gn).toLocaleString()} more`,e.append(t)}n.append(e)}}if(c?.details&&n.append(vn(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=N(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)}bn(n),n.style.left=`0px`,n.style.top=`0px`,n.style.transform=`none`,n.classList.add(`visible`);let x=Sn,S=Cn+En;if(t===`right`||t===`right-start`){let n=e.getBoundingClientRect();x=n.right+Dn,S=n.top+(t===`right`?n.height/2:0)}let E=window.innerWidth-n.offsetWidth-Q,D=Math.max(Q,Math.min(x,E));n.style.left=`${Math.round(D)}px`;let O=n.offsetHeight,k=t===`right`?S-O/2:S,A=window.innerHeight-O-Q,j=Math.max(Q,Math.min(k,A));n.style.top=`${Math.round(j)}px`,J=e,xn=y}function $(e){e&&!e.contains(J)&&!e.contains(X)||(clearTimeout(Y),Y=null,X=null,q&&(q.classList.remove(`visible`),typeof q.hidePopover==`function`&&q.matches(`:popover-open`)&&q.hidePopover()),J=null)}function kn(e,{gate:t,placement:n}={}){Z();let r=()=>e.isConnected!==!1&&(!Object.hasOwn(e.dataset,`tooltipTruncated`)||e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&(!t||t(e));if(!r()){$();return}e===J||e===X||($(),X=e,Y=setTimeout(()=>{Y=null,X=null,r()&&On(e,{placement:n})},Tn))}var An=new WeakSet;function jn(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 Mn(e,t){!e||An.has(e)||(An.add(e),e.ownerDocument&&Z(),e.addEventListener(`mouseover`,n=>{if(n.buttons){$();return}let r=jn(n,e);if(!r){$();return}r!==J&&kn(r,t)}),e.addEventListener(`mouseout`,t=>{let n=jn(t,e),r=t.relatedTarget?.closest?.(`[data-tooltip]`)??null;n&&n===r||$()}),e.addEventListener(`scroll`,()=>$(e),{capture:!0,passive:!0}))}var Nn=!1;function Pn(){Nn||(Nn=!0,Z(),document.addEventListener(`tooltip-root-connected`,e=>{Mn(e.composedPath()[0]?.shadowRoot)}),document.body.addEventListener(`mouseover`,e=>{if(e.target.closest(`[data-tooltip-managed]`))return;if(e.buttons){$();return}let t=e.target.closest(`[data-tooltip]`);!t||t===J||kn(t)}),document.body.addEventListener(`mouseout`,e=>{e.target.closest(`[data-tooltip-managed]`)||e.relatedTarget?.closest?.(`[data-tooltip-managed]`)||!J&&!Y||(J??X)?.contains(e.relatedTarget)||$()}))}function Fn(e){return`tree-`+e.replaceAll(/[^\w-]+/gu,`_`)}var In=()=>Object.fromEntries(p.map(e=>[e,0]));function Ln(e,t){let n=new Map;for(let r of e)for(let e of r){n.has(e.file)||n.set(e.file,In());let r=n.get(e.file),i=m(e,t);r[i]!==void 0&&r[i]++}return n}var Rn={trees:[],merged:null};function zn(e){let t=e.map(e=>e?.tree??null);return t.length===Rn.trees.length&&t.every((e,t)=>e===Rn.trees[t])||(Rn={trees:t,merged:Bn(e)}),Rn.merged}function Bn(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 Vn(e,t){let n=Object.keys(e),r=new Map(n.map((e,t)=>[e,t])),i=n.map(()=>In()),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 Hn(e,t,n){let r=t.get(e),i=n.get(e);return Un(r)>0||Un(i)>0}function Un(e){if(!e)return 0;let t=0;for(let n of p)t+=e[n]??0;return t}function Wn(e){if(!e)return null;let t=Ve(),n=RegExp(`^(?:.*/)?${t}/(@[^/]+/[^/]+|[^/]+)`,`u`),r=e.match(n);return r?r[1]:`__own__`}function Gn(e){return new Set(e.filter(e=>!V(e)))}var Kn=[`#4e9af1`,`#f28e2b`,`#59a14f`,`#e15759`,`#76b7b2`,`#edc948`,`#b07aa1`,`#ff9da7`,`#9c755f`,`#5cd1e5`,`#f1ce63`,`#d37295`,`#a0cbe8`,`#86bcb6`,`#8cd17d`,`#b6992d`,`#499894`,`#e15759`,`#e879c7`,`#d4a6c8`],qn=[`#2f8aef`,`#d2691e`,`#2ea043`,`#e63946`,`#2e9a92`,`#b88817`,`#9560e8`,`#d24a9c`,`#8a5d40`,`#0891b2`,`#a07a14`,`#c14e8e`,`#1f7ad0`,`#549b94`,`#3fb95f`,`#a07a14`,`#2a8278`,`#cb2c40`,`#c026d3`,`#965f93`];function Jn(){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 Yn=new Map;function Xn(e){let t=Jn()?qn:Kn;return t[e%t.length]}var Zn=()=>Jn()?`#8c959f`:`#6e7681`;function Qn(e){let t=Jn(),n=t?qn:Kn,r=e??`__own__`,i=`${t?`l`:`d`}:${r}`;if(Yn.has(i))return Yn.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 Yn.set(i,o),o}var $n={package:`@babel/core`,path:/^lib\/config\//u},er={package:`@babel/core`,path:/^lib\/config\/files\/(?:module-types|plugins)\.js$/u},tr=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:$n,to:{path:/(?:^|\/)babel\.config\.js$/u}},{id:`babel-typescript-preset`,reason:`Babel configuration loads the TypeScript preset.`,from:$n,to:{package:`@babel/preset-typescript`,path:/./u}},{id:`babel-react-native-preset`,reason:`Babel config loaders load the configured React Native preset.`,from:er,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:er,to:{package:/^(?:@[^/]+\/)?react-native-reanimated$/u,path:/^plugin\/index\.js$/u}},{id:`babel-transform-plugin`,reason:`Babel config loaders load configured transform plugins.`,from:er,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 nr(e){return typeof e==`string`&&!e.includes(`\\`)&&!e.includes(`:`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`)}function rr(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 ir(e,t){if(e?.ownSource!==!0&&nr(e?.path)&&nr(t?.path))return tr.find(n=>(!n.ownSourceOnly||t.ownSource===!0)&&rr(n.from,e)&&rr(n.to,t))}function ar(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 or(e,t,n,r){return!ir(ar(e,r),ar(t,n))}function sr(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&&or(o.origFile??i,a.origFile??s,e.ownSourceFiles?.has(s),e.ownSourceFiles?.has(i))&&r.get(t(o)).add(t(a))}}return r}var cr=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 lr(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 ur(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 dr(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 fr(e,t){let n=dr(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 pr(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 cr(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=dr(e,n);for(let i of[[...r,...a.toReversed()],ur(n),e,e.toReversed()]){let e=lr(fr(i,n),t),r=dr(e,n);r>s&&(o=e,s=r)}return o}function mr(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 hr(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=or(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:_}=mr(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())pr(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 O=(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)},k=[...s.values()].filter(e=>D.has(e.id)&&(!o||e.cyclic)).toSorted(O),A=new Map(k.map((e,t)=>[e.id,t])),j=[];for(let[e,t]of u)if(A.has(e))for(let n of t.values())A.has(n.to)&&j.push({...n,row:A.get(e),col:A.get(n.to)});return{rows:k,byId:s,cells:u,visibleCells:j,index:A,matches:E,importCount:m,totalRows:s.size,cycleCount:g.filter(e=>v.has(e[0])).length}}export{te as a,ae as b,N as c,ce as d,P as e,le as f,F as g,ue as h,de as i,fe as j,pe as k,me as l,I as m,ge as n,ve as o,be as p,xe as q,Se as r,Ce as s,we as t,R as u,Te as v,Ee as w,De as x,Oe as y,Ae as z,je as A,Me as B,Be as C,Ve as D,V as E,Ue as F,qe as G,Je as H,Xe as I,Ze as J,Qe as K,$e as L,et as M,ot as N,U as O,ut as P,mt as Q,yt as R,Ct as S,Et as T,Mt as U,It as V,Lt as W,K as X,zt as Y,Vt as Z,Ht as _,Wt as $,Gt as aa,Kt as ba,qt as ca,Yt as da,Xt as ea,cn as fa,ln as ga,mn as ha,On as ia,$ as ja,kn as ka,Mn as la,Pn as ma,Fn as na,Ln as oa,zn as pa,Vn as qa,Hn as ra,Un as sa,Wn as ta,Gn as ua,Xn as va,Zn as wa,Qn as xa,pr as ya,or as za,sr as Aa,mr as Ba,hr as Ca};
|
|
33
|
+
`)}function en(e,{title:t,body:n,labels:r=[]}={}){let i=tt(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 tn=/^[a-zA-Z\d](?:-?[a-zA-Z\d])*$/u,nn=/^[a-zA-Z\d._-]+$/u,rn=/^[1-9]\d{0,9}$/u,an=/^[a-fA-F\d]{7,40}$/u,on=/^#[\w-]+$/u,sn=/^GHSA(?:-[0-9a-z]{4}){3}$/u;function cn(e){return e.length<=39&&tn.test(e)}function ln(e){return e.length<=100&&e!==`.`&&e!==`..`&&nn.test(e)}function un(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 sn.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!cn(e)||!ln(t)||!sn.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(!cn(r)||!ln(i))return null;let s;if(a===`issues`||a===`pull`){if(!rn.test(o))return null;s=`${r}/${i}#${o}`}else if(a===`commit`){if(!an.test(o))return null;s=`${r}/${i}@${o.slice(0,7)}`}else return null;return{url:`https://github.com/${r}/${i}/${a}/${o}${on.test(t.hash)?t.hash:``}`,label:s}}var dn=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/u;function fn(e){if(typeof e!=`string`)return null;let t=pn(e);return t!==e||dn.test(e)?t.slice(0,8):null}function pn(e){let t=String(e);return t.startsWith(`https://chatgpt.com/codex/cloud/security/findings/`)?t.slice(50):t}function mn(e,n){let r=t(e,{managed:n});if(!r)return null;let i=fn(r.id);return{url:n?r.path:`#${r.fragment}`,label:i?`finding ${i}`:`finding`,self:!0}}var hn=/https?:\/\/[^\s<>"'`(){}[\]|\\^]+/giu,gn=new Set([`)`,`.`,`,`,`!`,`?`,`;`,`:`,`'`,`"`,`*`,`]`,`}`,`>`]);function _n(e){let t=e.length;for(;t>0&&gn.has(e[t-1]);)t--;return t===e.length?e:e.slice(0,t)}function vn(e,{managed:t=!1}={}){if(typeof e!=`string`||e.length===0)return[];let n=[],r=0;hn.lastIndex=0;let i;for(;(i=hn.exec(e))!==null;){let a=_n(i[0]),o=a?un(a)??mn(a,t):null;o&&(i.index>r&&n.push(e.slice(r,i.index)),n.push(o),r=i.index+a.length,hn.lastIndex=r)}return r<e.length&&n.push(e.slice(r)),n}var yn={commit:T},bn=8;function xn(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 Sn({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 q;function Cn(){return q||(q=document.createElement(`div`),q.id=`styled-tooltip`,q.setAttribute(`popover`,`manual`),document.body.append(q),q)}function wn(e){typeof e.showPopover==`function`&&(e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover())}var J=null,Tn=``,Y=null,X=null,En=0,Dn=0,On=!1;function Z(){if(!On){On=!0,document.addEventListener(`mousemove`,e=>{En=e.clientX,Dn=e.clientY},{passive:!0});for(let e of[`pointerdown`,`wheel`,`scroll`])document.addEventListener(e,()=>$(),{capture:!0,passive:!0});document.addEventListener(`keydown`,e=>{e.key===`Escape`&&$()}),window.addEventListener(`blur`,()=>$())}}var kn=100,An=14,jn=8,Q=8;function Mn(e,{placement:t=`cursor`}={}){Z(),clearTimeout(Y),Y=null,X=null,e.prepareTooltip?.(e),t=e.dataset.tooltipPlacement??t;let n=Cn(),i=e.dataset.tooltip??``,a=Object.hasOwn(yn,e.dataset.tooltipIcon??``)?e.dataset.tooltipIcon:``,o=e.dataset.tooltipRepo??``,s=r(e.dataset.tooltipCommit),c=xn(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){$();return}if(J===e&&Tn===y)return;if(n.textContent=a||v?``:i,v){let e=document.createElement(`div`);e.className=`tooltip-rich`,ee(v,e),n.append(e)}if(a){let e=document.createElement(`span`);e.className=`tooltip-text`,e.innerHTML=N(yn[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=N(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=N(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,bn)){let n=document.createElement(`span`);n.className=`tooltip-tag`,n.innerHTML=N(b);let r=document.createElement(`span`);r.textContent=t,n.append(r),e.append(n)}if(c.tags.length>bn){let t=document.createElement(`span`);t.className=`tooltip-tag-more`,t.textContent=`+${(c.tags.length-bn).toLocaleString()} more`,e.append(t)}n.append(e)}}if(c?.details&&n.append(Sn(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=N(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)}wn(n),n.style.left=`0px`,n.style.top=`0px`,n.style.transform=`none`,n.classList.add(`visible`);let x=En,S=Dn+An;if(t===`right`||t===`right-start`){let n=e.getBoundingClientRect();x=n.right+jn,S=n.top+(t===`right`?n.height/2:0)}let E=window.innerWidth-n.offsetWidth-Q,D=Math.max(Q,Math.min(x,E));n.style.left=`${Math.round(D)}px`;let O=n.offsetHeight,k=t===`right`?S-O/2:S,A=window.innerHeight-O-Q,j=Math.max(Q,Math.min(k,A));n.style.top=`${Math.round(j)}px`,J=e,Tn=y}function $(e){e&&!e.contains(J)&&!e.contains(X)||(clearTimeout(Y),Y=null,X=null,q&&(q.classList.remove(`visible`),typeof q.hidePopover==`function`&&q.matches(`:popover-open`)&&q.hidePopover()),J=null)}function Nn(e,{gate:t,placement:n}={}){Z();let r=()=>e.isConnected!==!1&&(!Object.hasOwn(e.dataset,`tooltipTruncated`)||e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&(!t||t(e));if(!r()){$();return}e===J||e===X||($(),X=e,Y=setTimeout(()=>{Y=null,X=null,r()&&Mn(e,{placement:n})},kn))}var Pn=new WeakSet;function Fn(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 In(e,t){!e||Pn.has(e)||(Pn.add(e),e.ownerDocument&&Z(),e.addEventListener(`mouseover`,n=>{if(n.buttons){$();return}let r=Fn(n,e);if(!r){$();return}r!==J&&Nn(r,t)}),e.addEventListener(`mouseout`,t=>{let n=Fn(t,e),r=t.relatedTarget?.closest?.(`[data-tooltip]`)??null;n&&n===r||$()}),e.addEventListener(`scroll`,()=>$(e),{capture:!0,passive:!0}))}var Ln=!1;function Rn(){Ln||(Ln=!0,Z(),document.addEventListener(`tooltip-root-connected`,e=>{In(e.composedPath()[0]?.shadowRoot)}),document.body.addEventListener(`mouseover`,e=>{if(e.target.closest(`[data-tooltip-managed]`))return;if(e.buttons){$();return}let t=e.target.closest(`[data-tooltip]`);!t||t===J||Nn(t)}),document.body.addEventListener(`mouseout`,e=>{e.target.closest(`[data-tooltip-managed]`)||e.relatedTarget?.closest?.(`[data-tooltip-managed]`)||!J&&!Y||(J??X)?.contains(e.relatedTarget)||$()}))}function zn(e){return`tree-`+e.replaceAll(/[^\w-]+/gu,`_`)}var Bn=()=>Object.fromEntries(p.map(e=>[e,0]));function Vn(e,t){let n=new Map;for(let r of e)for(let e of r){n.has(e.file)||n.set(e.file,Bn());let r=n.get(e.file),i=m(e,t);r[i]!==void 0&&r[i]++}return n}var Hn={trees:[],merged:null};function Un(e){let t=e.map(e=>e?.tree??null);return t.length===Hn.trees.length&&t.every((e,t)=>e===Hn.trees[t])||(Hn={trees:t,merged:Wn(e)}),Hn.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(()=>Bn()),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=Ve(),n=RegExp(`^(?:.*/)?${t}/(@[^/]+/[^/]+|[^/]+)`,`u`),r=e.match(n);return r?r[1]:`__own__`}function Yn(e){return new Set(e.filter(e=>!V(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 O=(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)},k=[...s.values()].filter(e=>D.has(e.id)&&(!o||e.cyclic)).toSorted(O),A=new Map(k.map((e,t)=>[e.id,t])),j=[];for(let[e,t]of u)if(A.has(e))for(let n of t.values())A.has(n.to)&&j.push({...n,row:A.get(e),col:A.get(n.to)});return{rows:k,byId:s,cells:u,visibleCells:j,index:A,matches:E,importCount:m,totalRows:s.size,cycleCount:g.filter(e=>v.has(e[0])).length}}export{te as a,ae as b,N as c,ce as d,P as e,le as f,F as g,ue as h,de as i,fe as j,pe as k,me as l,I as m,ge as n,ve as o,be as p,xe as q,Se as r,Ce as s,we as t,R as u,Te as v,Ee as w,De as x,Oe as y,Ae as z,je as A,Me as B,Be as C,Ve as D,V as E,Ue as F,qe as G,Je as H,Xe as I,Ze as J,Qe as K,$e as L,et as M,ot as N,U as O,dt as P,ht as Q,bt as R,wt as S,Dt as T,Nt as U,Lt as V,Rt as W,K as X,Bt as Y,Ht as Z,Ut as _,Gt as $,Yt as aa,Xt as ba,Zt as ca,$t as da,en as ea,fn as fa,pn as ga,vn as ha,Mn as ia,$ as ja,Nn as ka,In as la,Rn as ma,zn as na,Vn as oa,Un as pa,Gn as qa,Kn as ra,qn as sa,Jn as ta,Yn as ua,er as va,tr as wa,nr as xa,_r as ya,ur as za,dr as Aa,vr as Ba,yr as Ca};
|
|
33
34
|
/*! Bundled license information:
|
|
34
35
|
|
|
35
36
|
lit-html/directives/class-map.js:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$e as e,Ze as t,a as n,bf as r,ua as i,w as a}from"./chunk-
|
|
1
|
+
import{$e as e,Ze as t,a as n,bf as r,ua as i,w as a}from"./chunk-PKQBEPZU.js";import{c as o,d as s,g as c}from"./chunk-2XUEZHIP.js";var l=t(s`<path d="M3.5 8.4l2.9 2.9 6.1-6.6"/>`),u=t(s`<circle class="fill" cx="8" cy="8" r="3"/>`),d=t(s`<path d="M4.2 4.2l7.6 7.6M11.8 4.2l-7.6 7.6"/>`),f=t(s`<circle class="dotted" cx="8" cy="8" r="5.5"/>`),p=t(s`<path d="M2.6 3.2h7.6v5.3H6.3L4 10.4V8.5H2.6z"/><path d="M12.2 6.2h1.2v5.3H12v1.9l-2.3-1.9H7"/>`),m={approved:[`approved`,r.approved[1],`Approved`],changes:[`changes`,r.changes[1],`Changes requested`],commented:[`commented`,e,`Commented`],dismissed:[`dismissed`,e,`Review dismissed`]},h={done:[`reviewed`,l,`Reviewed`],running:[`running`,u,`Reviewing`],failed:[`failed`,d,`Review failed`],requested:[`requested`,f,`Asked to review again`]},g=[`requested`,f,`Review requested`],_=e=>e.slice(0,7),v=e=>new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),y=(e,t,n=!1)=>`${e.toLocaleString(`en-US`)}${n?`+`:``} ${t}${e===1&&!n?``:`s`}`;function b(e){return e?e.failed?h.failed:e.requested?h.requested:h[e.code?.status]??null:null}function x(e){let t=b(e.codex),n=e.codex?.code?.commit??null;return[...t?[{who:i(e.codex.login,`Codex`),standing:t,commit:n,stale:n!==null&&n!==e.head}]:[],...e.reviewers.map(t=>({who:i(t.login,t.login??`someone`),standing:m[t.state]??g,requested:t.requested&&!!m[t.state],workflow:t.workflow??null,commit:t.commit,at:t.at,stale:t.commit!==null&&t.commit!==e.head}))]}var S=e=>(e.moreReviews??0)+(e.moreRequests??0),C=e=>[e.moreReviews>0?y(e.moreReviews,`more review`):null,e.moreRequests>0?y(e.moreRequests,`more review request`):null].filter(Boolean).join(` and `);function w(e){if(!e.head)return!0;let t=e.codex?.code;return t?.status===`done`&&t.commit===e.head||e.reviewers.some(t=>m[t.state]&&t.state!==`dismissed`&&t.commit===e.head)?!0:e.moreReviews>0&&null}var T=e=>e?o`<span class="${`review-severity is-${e}`}">${e.toUpperCase()}</span>`:c;function E(e){if(!e)return c;let t=x(e),{open:n,more:r,severity:i}=e.threads,a=n>0?`${y(n,`open review thread`,r)}${i?`, the gravest ${i.toUpperCase()}`:``}`:r?`No open review thread among those read; more on GitHub`:null,s=w(e);return o`<span class="issue-reviews">${t.map(({who:e,standing:[t,n,r],commit:i,stale:a,requested:s})=>{let c=`${r}${s?`, and requested again`:``}${a?`, on an earlier commit (${_(i)})`:i?`, on the latest commit`:``}`;return o`<span class="${`review-mark is-${t}${a?` is-stale`:``}`}"><span class="review-glyph" role="img" aria-label="${c}" data-tooltip="${c}">${n}</span><span class="review-who">${e}</span></span>`})} ${S(e)>0?o`<span class="review-more" data-tooltip="${`${C(e)}, on GitHub`}">+${S(e)}</span>`:c} ${a?o`<span class="review-threads" role="img" aria-label="${a}" data-tooltip="${a}">${p}<span>${n}${r?`+`:``}</span>${T(i)}</span>`:c} ${s===!1?o`<span class="review-unreviewed" data-tooltip="${t.length>0?`No review is on the latest commit`:`No reviews yet`}">Unreviewed</span>`:s===null?o`<span class="review-unreviewed" data-tooltip="No review read is on the latest commit; more on GitHub">Unreviewed?</span>`:c}</span>`}function D(e,t,n){if(!e)return c;let r=o`<code>${_(e)}</code>`;return o`<span class="review-on">on ${n?o`<a href="${`https://github.com/${n}/commit/${e}`}" target="_blank" rel="noopener noreferrer">${r}</a>`:r}${e===t?`, the latest commit`:`, an earlier commit`}</span>`}function O(e,t){if(!e)return c;let{head:n,codex:r}=e,a=(e,[a,s,c],l)=>o`<li class="review-row">${i(r.login,`Codex`)} <span class="${`review-state is-${a}`}">${s}${l}: ${c.toLowerCase()}</span>${D(e.commit,n,t)}</li>`,s=[...r?.code?[a(r.code,b(r)??h.done,`Code review`)]:[],...r?.security?[a(r.security,h[r.security.status]??h.done,`Security review`)]:[],...x({...e,codex:null}).map(({who:e,standing:[r,i,a],commit:s,at:l,requested:u,workflow:d})=>o`<li class="review-row">${e} <span class="${`review-state is-${r}`}">${i}${a}${u?`, requested again`:``}</span>${d?o`<span class="review-on">by the workflow <code>${d}</code></span>`:c}${D(s,n,t)}${l?o`<time datetime="${new Date(l).toISOString()}">${v(l)}</time>`:c}</li>`)],{open:l,resolved:u,more:d,list:f=[]}=e.threads;return o`<section class="repo-item-section"><h4>Reviews</h4>${s.length>0?o`<ul>${s}</ul>`:o`<p class="repo-item-quiet">No reviews yet.</p>`} ${S(e)>0?o`<p class="repo-item-quiet">And ${C(e)}, on GitHub.</p>`:c} ${w(e)===null?o`<p class="repo-item-quiet">No review read is on the latest commit, <code>${_(n)}</code>; one of those on GitHub may be.</p>`:s.length>0&&!w(e)?o`<p class="repo-item-quiet">No review is on the latest commit, <code>${_(n)}</code>.</p>`:c}</section>${l>0||u>0?o`<section class="repo-item-section"><h4>Open threads</h4>${f.length>0?o`<ul>${f.map(e=>o`<li><a class="repo-item-row review-thread" href="${e.url??c}" target="_blank" rel="noopener noreferrer">${T(e.severity)}<span class="repo-item-title">${e.title||`(no comment)`}</span> ${e.path?o`<code class="review-path">${e.path}${e.line?`:${e.line}`:``}</code>`:c} ${e.outdated?o`<span class="repo-item-quiet">outdated</span>`:c}</a></li>`)}</ul>`:o`<p class="repo-item-quiet">${d?`None open among those read.`:`None open.`}</p>`} ${u>0||d?o`<p class="repo-item-quiet">${u>0?`${y(u,`thread`)} resolved`:``}${d?`${u>0?`; `:``}more on GitHub`:``}.</p>`:c}</section>`:c}`}var k=n({items:new Map,changes:0}),A=null,j=()=>a.managedSession?`${a.managedSession.id}\0${a.managedSession.role}`:null,M=(e,t,n)=>`${e}\0${t}\0${n}`,N=e=>Number.isSafeInteger(e?.readAt)&&e.readAt>0?e.readAt:Date.now();function P(e,t,n,r=null){let i=j();i!==A&&(k.items.clear(),A=i);let a=!1;for(let o of t){let t=M(i,e,o.number),s=k.items.get(t);if(s&&s.readAt>n)continue;let c=s&&(s.item.state===`open`?`open`:`closed`),l=!c||c===(o.state===`open`?`open`:`closed`)?s?.moved??null:{from:c,before:s.readAt};k.items.set(t,{item:{...o,kind:o.kind??r??s?.item.kind??null},readAt:n,moved:l}),a=!0}a&&k.changes++}var F=(e,t)=>k.items.get(M(j(),e,t))??null;function I(e,t){let n=M(j(),e,``);return k.changes,[...k.items].flatMap(([e,r])=>e.startsWith(n)&&r.item.kind===t?[r]:[])}var L=()=>k.changes,R=e=>e.state===`open`?`open`:`closed`;function z(e,t){let n=R(e.item);if(e.readAt<=t||!e.moved)return n;if(e.moved.before>=t)return e.moved.from;let r=e.item.closedAt??e.item.mergedAt??null;return n===`closed`&&r!==null&&r>t?e.moved.from:n}export{E as a,O as b,N as c,P as d,F as e,I as f,L as g,R as h,z as i};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as e}from"./chunk-QRKFPLA4.js";import{b as t}from"./chunk-TUII34K2.js";var n=new Set([`module`,`commonjs`,`json`,`module-typescript`,`commonjs-typescript`]),r=new Set([`solidity`,`php`,`shell`,`rust`,`teal`]),i=new Set([`java`,`kotlin`,`gradle`,`objc`,`objcpp`,`swift`,`c`,`cpp`,`c-header`,`cpp-header`,`ruby`,`python`,`cmake`,`podspec`,`podfile`,`podfile-lock`,`template`,`xml`,`env`,`fastlane`,`pbxproj`]),a=new Set([`resource`,`resource:base64`]),o=new Set([`stat:file`,`stat:directory`]),s=new Set([...n,...r,...i,...a,`patch`,`directory`,...o]),c=e=>o.has(e),l=e=>e===`directory`||e===`stat:directory`?`directory`:`file`;function u(e,t,n){if(e===t)return e;let r=c(e);if(r!==c(t)&&l(e)===l(t))return r?t:e;throw Error(`format conflict for '${n}' ('${t}' vs '${e}')`)}var d=(e,t)=>t===``?e:e===`.`?t:`${e}/${t}`,f=/^(?=[A-Za-z0-9-]{1,39}\/)[A-Za-z0-9](?:-?[A-Za-z0-9])*\/(?!\.\.?$)[\w.-]{1,100}$/u,p=/^(?!\.\.?(?:\/|$))[\w.~@+-]+(?:\/(?!\.\.?(?:\/|$))[\w.~@+-]+)*$/u,m=/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u,h={github:e=>typeof e==`string`&&f.test(e),directory:e=>typeof e==`string`&&e.length<=1024&&(e===``||p.test(e)),commit:e=>typeof e==`string`&&m.test(e)},ee=(e,t)=>e?.toLowerCase()===t?.toLowerCase(),g=(e,t,n)=>{if(e===void 0)return;T(e)||S(!1,`${n} must be an object`);for(let r of Object.keys(e))Object.hasOwn(t,r)||S(!1,`unknown ${n} key '${r}'`);let r=Object.entries(t).map(([t,r])=>typeof r==`object`?[t,g(e[t],r,`${n}.${t}`)]:(e[t]!==void 0&&!r(e[t])&&S(!1,`invalid ${n}.${t}: ${JSON.stringify(e[t])}`),[t,e[t]])).filter(([,e])=>e!==void 0);return r.length===0?void 0:Object.freeze(E(r))},te=(e,t=`bundle repo`)=>g(e,h,t),_=(e,t)=>t??(j(e)?`npm`:void 0),ne=(e,t,n,r,i)=>(a,{ecosystem:o,[e]:s},c)=>{if(s===void 0)return;r(a,o)||S(!1,`${c}: '${a}' is no ${i} bucket, and carries no ${e}`);let l=g(s,t,`${c} module '${a}' ${e}`);return l?.[n]===void 0&&S(!1,`${c} module '${a}' ${e} has no ${n}`),l},re=ne(`repo`,h,`github`,(e,t)=>_(e,t)!==void 0,`dependency's`),ie={sha1:/^sha1-[A-Za-z\d+/]{27}=$/u,sha256:/^sha256-[A-Za-z\d+/]{43}=$/u,sha512:/^sha512-[A-Za-z\d+/]{86}==$/u},ae={integrity:e=>typeof e==`string`&&ie.sha256.test(e)},oe=(e,t)=>j(e)&&_(e,t)===`npm`,se={npm:`sha512`,cargo:`sha256`,composer:`sha1`,soldeer:`sha256`},ce=(e,{ecosystem:t,integrity:n},r)=>{if(n===void 0)return;let i=_(e,t);return(!Object.hasOwn(se,i)||i===`npm`&&!j(e))&&S(!1,`${r}: '${e}' is no npm, cargo, composer or soldeer dependency's bucket, and carries no integrity`),(typeof n!=`string`||!ie[se[i]].test(n))&&S(!1,`invalid ${r} module '${e}' integrity: ${JSON.stringify(n)}`),n},le=ne(`patch`,ae,`integrity`,oe,`npm dependency's`),ue=e=>typeof e==`string`&&/^[\w.+@/~'!()*-]+$/u.test(e),v={name:ue,version:ue},de=e=>typeof e==`string`&&e!==``&&!e.includes(`\\`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`),fe=(e,t,n)=>typeof e==`string`&&de(n)&&e===`${t}/${n}`,pe={vendored:()=>!0,subpackages:(e,t,n)=>fe(e.name,t,n)},me=(e,t)=>{for(let n=t.lastIndexOf(`/`);n>0;n=t.lastIndexOf(`/`,n-1))if(Object.hasOwn(e,t.slice(0,n)))return t.slice(0,n)};function he(e,t){if(e===void 0)return;let n=new Set(Object.keys(t).map(t=>me(e,t)).filter(e=>e!==void 0));return n.size===0?void 0:Object.freeze(E(C(n).map(t=>[t,e[t]])))}var ge=(e,t,{name:n,ecosystem:r,files:i,[e]:a},o)=>{if(a===void 0)return;_(t,r)===void 0&&S(!1,`${o}: '${t}' is no dependency's bucket, and carries no ${e}`),T(a)||S(!1,`${o} module '${t}' ${e} must be an object`);let s=E(Object.entries(a).map(([r,i])=>{de(r)||S(!1,`${o} module '${t}' ${e}: invalid directory ${JSON.stringify(r)}`);let a=g(i,v,`${o} module '${t}' ${e} '${r}'`);return a?.name===void 0&&S(!1,`${o} module '${t}' ${e} '${r}' has no name`),pe[e](a,n,r)||S(!1,`${o} module '${t}' ${e} '${r}' is named '${a.name}', not '${n}/${r}'`),[r,a]})),c=he(s,i),l=Object.keys(s).find(e=>!Object.hasOwn(c??{},e));return l!==void 0&&S(!1,`${o} module '${t}' ${e} '${l}' holds none of its files`),c},y={integrity:ce,repo:re,patch:le},_e=Object.keys(pe),b=[...Object.keys(y),..._e],ve=[`ecosystem`,...b],x=e=>{let t={name:e.name,version:e.version};for(let n of ve)e[n]!==void 0&&(t[n]=e[n]);return t.files=e.files,t},ye=[`integrity`,`patch`],be=(e,t)=>e[t]??(t===`patch`&&e.integrity!==void 0?null:void 0),xe=(e,t,n,r)=>{let[i,a]=[t[e],n[e]].map(e=>JSON.stringify(e)??`none`);i!==a&&S(!1,`${r} ${e} mismatch (${i} vs ${a})`)};function Se(e,t,n=`module`){let r;for(let i of Object.keys(y))ye.includes(i)&&be(e,i)!==void 0&&be(t,i)!==void 0?xe(i,e,t,n):e[i]===void 0&&t[i]!==void 0&&((r??={})[i]=t[i]);for(let n of _e)t[n]===void 0||Object.keys(t[n]).every(t=>Object.hasOwn(e[n]??{},t))||((r??={})[n]=Object.freeze(E([...Object.entries(t[n]),...Object.entries(e[n]??{})])));return r===void 0?e:x({...e,...r})}function Ce(e,t,n,r,i){let a={};for(let[i,o]of Object.entries(y))a[i]=r.includes(i)?o(e,t,n):void 0;for(let o of _e)a[o]=r.includes(o)?ge(o,e,{...t,[o]:i(o)},n):void 0;return a}function we(e,t,n,r=b){let{name:i,version:a,ecosystem:o}=e;S(o===void 0||typeof o==`string`),T(e.files)||S(!1,`${n}: module '${t}' files must be an object`);let s=E(Object.entries(e.files));return x({name:i,version:a??void 0,ecosystem:o,...Ce(t,{...e,files:s},n,r,t=>e[t]),files:s})}function Te(e,{scope:t=`full`}={}){let n=new Set;for(let[r,{files:i}]of e)if(t===`full`||j(r))for(let e of Object.keys(i))n.add(d(r,e));return n}function Ee(e,{what:t,files:n,formats:r,scope:i}){if(e.includes(`\\`))return`holds a '\\'`;if(O(e))return`escapes the root`;if(i!==`full`&&!j(e))return`is outside node_modules, which a '${i}'-scope ${t} does not record`;if(!n.has(e))return`names no file the ${t} records`;let a=r.get(e);return a===`directory`?`is a directory capture, not a file`:c(a)?`is a payload-free '${a}' record, not a file`:null}function De(e,{what:t,files:n,formats:r,scope:i}){for(let a of e){let e=Ee(a,{what:t,files:n,formats:r,scope:i});S(e===null,`${t}: executable entry '${a}' ${e}`)}}function Oe(e,t,n,r){S(Array.isArray(e),`${t} must be an array of file paths`);let i=new Set;for(let t of e)r(t),S(!i.has(t),`${n} '${t}' is listed twice`),i.add(t);return i}function ke(e,{what:t,files:n,formats:r,scope:i=`full`}){if(e===void 0)return new Set;let a=`${t}: executable entry`,o=Oe(e,`${t}: executable`,a,e=>S(typeof e==`string`&&e!==``,`${a} must be a non-empty string`));return De(o,{what:t,files:n,formats:r,scope:i}),o}function Ae(e,{what:t,modules:n,formats:r,scope:i}){if(e.size!==0)return De(e,{what:t,files:Te(n,{scope:i}),formats:r,scope:i}),D(e)}function S(e,t){if(!e)throw Error(t)}var je=`stasis.lock.json`,Me=new Set([`node_modules`,`full`]),Ne=(e,t)=>S(Me.has(e),`${t} scope must be node_modules or full, got ${JSON.stringify(e)}`),Pe=e=>e.slice(e.lastIndexOf(`/`)+1).toLowerCase()===je;function Fe(e,t){let n=0;for(;n<e.length&&e[n]===t[n];)n++;let r=e.length-n,i=t.length-n;if(r===0&&i===0)return 0;if(r<2)return i<2&&(e[n]??``)>(t[n]??``)?1:-1;if(i<2)return 1;if(e[n]===`*`)return-1;if(t[n]===`*`||e[n]===`node_modules`)return 1;if(t[n]===`node_modules`)return-1;let a=e.slice(n).join(`\0`),o=t.slice(n).join(`\0`);if(a<o)return-1;if(a>o)return 1;throw Error(`Unreachable`)}var C=(e,t=e=>e)=>Array.from(e,e=>({item:e,segments:t(e).split(`/`)})).toSorted((e,t)=>Fe(e.segments,t.segments)).map(({item:e})=>e),w=([e])=>e;function T(e){if(!e)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var E=e=>Object.setPrototypeOf(Object.fromEntries(e),null),D=e=>C(e),Ie=(e,{sorted:t=!0}={})=>E((t?C(e,w):[...e]).map(([e,n])=>[e,n instanceof Map?Ie(n,{sorted:t}):n]));function Le(e,t,n){let r=e.get(t);return r===void 0&&e.set(t,r=n()),r}var Re=(e,t)=>Le(e,t,()=>new Map),ze=e=>new Map(Object.entries(e).map(([e,t])=>[e,T(t)?ze(t):t]));function O(e){if(e.startsWith(`/`))return!0;if(!e.includes(`..`))return!1;let t=0;for(let n of e.split(`/`))if(n!==`.`&&n!==``){if(n!==`..`)t++;else if(--t<0)return!0}return!1}var Be=e=>e.includes(`\\`)||O(e),k=(e,t)=>S(!Be(e),`${t}: path '${e}' escapes the root or holds a '\\'`),Ve=e=>typeof e==`string`&&e!==``&&!Be(e),He=(e,t)=>S(Ve(e),`${t}: invalid entry ${JSON.stringify(e)}`),Ue=(e,t)=>Oe(e,`${t}: entries`,`${t}: entry`,e=>He(e,t));function We(e,t){for(let n of e)He(n,t);return D(e)}function Ge(e,t){k(e,`formats`),S(s.has(t),`unknown format '${t}' for ${e}`)}function Ke(e){S(T(e));let t=new Map;for(let[n,r]of Object.entries(e)){Ge(n,r);let e=n===``?`.`:n;S(!t.has(e),`duplicate format key '${e}'`),t.set(e,r)}return t}function qe(e,t,n){for(let[r,i]of e)c(i)&&t.has(r)&&S(!1,`${n}: '${r}' is a payload-free '${i}' record, yet carries content`)}function Je(e){for(let[t,n]of e)Ge(t,n);return Ie(e)}function Ye(e){for(let[,t]of e){S(t instanceof Map);for(let[e,n]of t){k(e,`imports`),S(n instanceof Map);for(let[,e]of n){if(typeof e==`string`){k(e,`imports`);continue}S(e instanceof Map&&e.size>0,`import target must be a file or a non-empty {platform: file} map`);for(let[t,n]of e)S(typeof t==`string`&&t.length>0&&!t.includes(`/`),`invalid platform key '${t}'`),S(typeof n==`string`),k(n,`imports`)}}}}function Xe(e){S(T(e));let t=ze(e);return Ye(t),t}function Ze(e){return Ye(e),Ie(e)}function Qe(e,{skipEmpty:t=!1,metadata:n=!0,what:r}={}){let i=n===!0?b:n===!1?[]:n,a={modules:[],sources:[]};for(let[n,o]of e){if(t&&Object.keys(o.files).length===0)continue;let e=j(n);e&&S(o.name&&o.version&&o.files);let s=E(C(Object.entries(o.files),w));a[e?`modules`:`sources`].push([n,x({...o,...Ce(n,{...o,files:s},r,i,e=>he(o[e],s)),files:s})])}return{modules:E(C(a.modules,w)),sources:E(C(a.sources,w))}}function $e(e,t,n){let r=new Map;for(let i of e.config.scope===`full`?[`modules`,`sources`]:[`modules`]){if(i===`modules`&&e.modules===void 0)continue;S(T(e[i]),`${t}: ${i} must be an object`);let a=i===`modules`;for(let[o,s]of Object.entries(e[i]))S(j(o)===a),k(o,t),S(s?.name&&(s.version||!a)&&s.files),r.set(o,we(s,o,t,n))}return r}function et({config:{scope:e},entries:t,modules:n,formats:r,imports:i,executable:a},o,s){let c=e===`full`,l=Qe(n,{...s,what:o});return{entries:c?We(t,o):void 0,sources:c?l.sources:void 0,modules:l.modules,formats:r===null?void 0:Je(r),imports:i===null?void 0:Ze(i),executable:Ae(a,{what:o,modules:n,formats:r??new Map,scope:e})}}function tt(e,t){return!(e instanceof Map)||!(t instanceof Map)?e===t:e.size===t.size&&e.entries().every(([e,n])=>t.get(e)===n)}var nt=e=>e instanceof Map?`{${[...e].map(([e,t])=>`${e}: ${t}`).join(`, `)}}`:e;function rt(e,t,n){let r=new Map;for(let i of[e,t])for(let[e,t]of i){let i=Re(r,e);for(let[e,r]of t){let t=Re(i,e);for(let[i,a]of r)t.has(i)?S(tt(t.get(i),a),`${n}: import '${i}' from '${e}' resolves differently ('${nt(t.get(i))}' vs '${nt(a)}')`):t.set(i,a instanceof Map?new Map(a):a)}}return r}function it(e,t,n){let r=e.get(t);e.set(t,r===void 0?n:u(n,r,t))}function at(e,t,n){let r=new Map;try{for(let n of[e,t])for(let[e,t]of n)it(r,e,t)}catch(e){throw Error(`${n}: ${e.message}`,{cause:e})}return r}var ot=(e,t,n,r)=>e.size===0?new Set(t):new Set(t).union(e.difference(Te(n,{scope:r}))),st=/(?:^|\/)\.{0,2}(?:\/|$)/u;function A(e,t,n){let r=d(e,t);return(r!==`.`||t!==``)&&st.test(r)&&S(!1,`${n}: non-canonical file key ${JSON.stringify(r)}`),r.includes(`\\`)&&S(!1,`${n}: file key '${r}' holds a '\\', which no path may`),r}function ct(e,t,n){let r=new Map;for(let[i,{files:a}]of e){typeof i!=`string`&&S(!1,`${t}: bucket dir ${String(i)} is not a string`),k(i,t);for(let e of Object.keys(a)){let a=A(i,e,t),o=r.get(a);o!==void 0&&n(a,o,i),r.set(a,i)}}return r}var lt=(e,t)=>n=>S(!1,`duplicate file key '${n}' across ${e} buckets -- module bucketing changed between writes (a workspace package without a version now owns its own bucket); regenerate the ${t}`);function ut(e,t,n,{held:r=!1}={}){let i=new Map;for(let a of[e,t])for(let[e,t]of a){let a=i.get(e);if(a===void 0){i.set(e,x({...t,files:Object.assign(Object.create(null),t.files)}));continue}S(a.name===t.name,`${n}: module '${e}' name mismatch ('${a.name}' vs '${t.name}')`),S(a.version===t.version,`${n}: module '${e}' version mismatch ('${a.version}' vs '${t.version}')`+(a.version==null==(t.version==null)?``:` -- an artifact from an older stasis may record a placeholder version for a workspace package without one; regenerate it (bundle=replace / lock=replace)`)),S(a.ecosystem===t.ecosystem,`${n}: module '${e}' ecosystem mismatch ('${a.ecosystem??`(none)`}' vs '${t.ecosystem??`(none)`}')`),i.set(e,Se(a,t,`${n}: module '${e}'`));for(let i of ye){if(a[i]===void 0==(t[i]===void 0)||r&&a[i]===void 0)continue;let[o,s]=a[i]===void 0?[t,a]:[a,t],c=Object.keys(s.files).find(e=>!Object.hasOwn(o.files,e));c!==void 0&&S(!1,`${n}: module '${e}' ${i} is recorded of one side's files, not of '${d(e,c)}' the other adds`)}for(let[r,i]of Object.entries(t.files))Object.hasOwn(a.files,r)?S(a.files[r]===i,`${n}: content mismatch for '${d(e,r)}'`):a.files[r]=i}return ct(i,n,(e,t,r)=>S(!1,`${n}: file '${e}' is bucketed under both '${t}' and '${r}' -- module bucketing changed between the artifacts (a workspace package without a version now owns its own bucket); regenerate the artifact (bundle=replace / lock=replace)`)),i}var j=e=>e===`node_modules`||e.startsWith(`node_modules/`)||e.endsWith(`/node_modules`)||e.includes(`/node_modules/`),dt=`node_modules/`;function ft(e){let t=e.length;for(;(t=e.lastIndexOf(dt,t-1))!==-1;)if(t===0||e[t-1]===`/`)return t;return-1}function pt(e){let t=ft(e);if(t===-1)return null;let n=t+dt.length,r=e.slice(n).split(`/`),i=r[0].startsWith(`@`)?2:1,a=r.slice(0,i);if(r.length<=i||a.includes(``))return null;let o=a.join(`/`);return{dir:e.slice(0,n)+o,rel:r.slice(i).join(`/`),name:o}}var M=1,mt=0,ht=lt(`bundle`,`artifact (bundle=replace)`),gt=(e,t)=>{let n=ct(e,`bundle`,ht);for(let e of n.keys())S(!Pe(e),`bundle: ${e} is a stasis lockfile, which no bundle may carry`);return qe(t,n,`bundle`),n},_t=e=>pt(e)??{dir:`.`,rel:e===`.`?``:e,name:null};function vt(e){S(T(e),`bundle: sources must be an object`);let t=new Map;for(let[n,r]of Object.entries(e)){k(n,`bundle`);let{dir:e,rel:i,name:a}=_t(n);S(!O(e)&&!O(i));let{files:o}=Le(t,e,()=>({name:a,version:null,files:Object.create(null)}));S(!Object.hasOwn(o,i),`bundle: duplicate file key '.' (v0 '' and '.')`),o[i]=r}return t}function yt(){throw Error(`bundle: file contents are not retained by this contents-free Bundle`)}var bt=(e,{files:t,...n})=>{let r=Object.create(null);for(let[n,i]of Object.entries(t))typeof i!=`symbol`&&S(!1,`bundle: file '${d(e,n)}' is not a placeholder`),Object.defineProperty(r,n,{get:yt,enumerable:!0});return{...n,files:Object.freeze(r)}},N=(e,t)=>{if(e===void 0&&t===void 0)return;let n=new Map;for(let r of[e,t])for(let[e,t]of Object.entries(r??{}))Array.isArray(t)&&n.set(e,new Set([...n.get(e)??[],...t]));return E([...n.keys()].toSorted().map(e=>[e,D(n.get(e))]))},xt=(e,t)=>Object.hasOwn(h,e)&&h[e](t),St=(e,t)=>e?.github===void 0||!ee(e.github,t?.github)?void 0:E(Object.keys(h).filter(n=>e[n]!==void 0&&(n===`github`||e[n]===t[n])).map(t=>[t,e[t]])),Ct=e=>{if(!T(e)||e.root!==!0||Object.hasOwn(e,`directory`))return e;let{root:t,...n}=e;return n},wt={npm:v,composer:v,cargo:v},Tt=(e,t)=>E(Object.keys(wt).map(n=>{let[r,i]=[e?.[n],t?.[n]];return[n,r?.name!==void 0&&r.name===i?.name?E(Object.entries(r).filter(([e,t])=>t===i[e])):void 0]})),P=class e{static VERSION=M;#e;get repo(){return this.#e}set repo(e){this.#e=te(e)}#t;get package(){return this.#t}set package(e){this.#t=g(e,wt,`bundle package`)}constructor({config:e={scope:`full`},entries:t,modules:n,formats:r,imports:i,executable:a,reason:o,repo:s,package:c,version:l=M}={}){S([mt,M].includes(l)),Ne(e.scope,`bundle`),this.version=l,this.config=e,this.entries=t??new Set,this.modules=n??new Map,this.formats=r??new Map,this.imports=i??new Map,this.executable=a??new Set,this.reason=o,this.repo=s,this.package=c}get sources(){let e=new Map;for(let[t,{files:n}]of this.modules)for(let[r,i]of Object.entries(n))e.set(d(t,r),i);return e}static isResourceFormat(e){return a.has(e)||e===`directory`}get hasCode(){return this.modules.entries().some(([t,{files:n}])=>Object.keys(n).some(n=>!e.isResourceFormat(this.formats.get(d(t,n)))))}static parse(t){return e.fromJSON(JSON.parse(t))}static fileKeyAt(e){let[t,n,r,i]=e;if(typeof n==`string`){if(e.length===2&&t===`sources`){let e=_t(n);return A(e.dir,e.rel,`bundle`)}if(e.length===4&&(t===`sources`||t===`modules`)&&r===`files`&&typeof i==`string`)return A(n,i,`bundle`)}}static fromJSON(t,{contents:n=!0}={}){S(t.version===M||t.version===mt),Ne(t.config?.scope,`bundle`);let r=Ke(t.formats),i=t.version===M;i&&t.config.scope!==`full`&&S(t.entries===void 0&&t.sources===void 0);let a=i?$e(t,`bundle`):vt(t.sources),o=gt(a,r),s=Xe(t.imports);if(!n)for(let[e,t]of a)a.set(e,bt(e,t));return new e({version:t.version,config:t.config,entries:i&&t.entries!==void 0?Ue(t.entries,`bundle`):new Set,modules:a,formats:r,imports:s,executable:i?ke(t.executable,{what:`bundle`,files:o,formats:r,scope:t.config.scope}):new Set,reason:T(t.reason)?t.reason:void 0,repo:Ct(t.repo),package:t.package})}serialize(){gt(this.modules,this.formats);let{entries:e,sources:t,modules:n,formats:r,imports:i,executable:a}=et(this,`bundle`,{skipEmpty:!0});return JSON.stringify({version:M,config:this.config,repo:this.repo,package:this.package,entries:e,formats:r,imports:i,executable:a,reason:N(this.reason,void 0),sources:t,modules:n},void 0,2)}withReason(t,n=[...this.sources.keys()]){let{version:r,config:i,entries:a,modules:o,formats:s,imports:c,executable:l,repo:u,package:d}=this,f=N(this.reason,{[t]:n});return new e({version:r,config:i,entries:a,modules:o,formats:s,imports:c,executable:l,reason:f,repo:u,package:d})}merge(t){return S(this.config.scope===t.config.scope,`bundle merge: scope mismatch ('${this.config.scope}' vs '${t.config.scope}')`),new e({config:{scope:this.config.scope},entries:new Set([...this.entries,...t.entries]),modules:ut(this.modules,t.modules,`bundle merge`),formats:at(this.formats,t.formats,`bundle merge`),imports:rt(this.imports,t.imports,`bundle merge`),executable:ot(this.executable,t.executable,t.modules,this.config.scope),reason:N(this.reason,t.reason),repo:St(this.repo,t.repo),package:Tt(this.package,t.package)})}},Et={__proto__:null,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`jsx`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsx:`tsx`,json:`json`,css:`css`,html:`markup`,htm:`markup`,xml:`markup`,svg:`markup`,yml:`yaml`,yaml:`yaml`,sh:`bash`,bash:`bash`,md:`markdown`,markdown:`markdown`,sol:`solidity`,php:`php`,phtml:`php`,rs:`rust`,rb:`ruby`,py:`python`,pyw:`python`,pyi:`python`,java:`java`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,"c++":`cpp`,hpp:`cpp`,hh:`cpp`,hxx:`cpp`,"h++":`cpp`,h:`cpp`,c:`c`,m:`objectivec`,mm:`objectivec`},Dt={__proto__:null,module:`javascript`,commonjs:`javascript`,"module-typescript":`typescript`,"commonjs-typescript":`typescript`,json:`json`,solidity:`solidity`,php:`php`,shell:`bash`,rust:`rust`,java:`java`,objc:`objectivec`,objcpp:`objectivec`,c:`c`,"c-header":`c`,cpp:`cpp`,"cpp-header":`cpp`,ruby:`ruby`,podspec:`ruby`,podfile:`ruby`,fastlane:`ruby`,"podfile-lock":`yaml`,xml:`markup`};function Ot(e){if(typeof e!=`string`)return!1;let t=e.length-1,n=0;for(;n<t&&/\s/u.test(e[n]);)n++;for(;t>n&&/\s/u.test(e[t]);)t--;return n<t&&e[n]===`{`&&e[t]===`}`}function kt(e,t,n){if(typeof t==`string`&&Dt[t])return Dt[t];if(typeof e!=`string`)return null;let r=e.slice(e.lastIndexOf(`/`)+1),i=r.lastIndexOf(`.`);if(i<=0)return null;let a=r.slice(i+1).toLowerCase();return a===`map`?Ot(n)?`json`:null:Et[a]??null}var At=/^webpack(?:-internal)?:\/\/[^/]*\//u,jt=/^[a-z][\d+.a-z-]*:/iu,Mt=/^file:/iu,Nt=/^(?:file|ftp|https?|wss?):/iu,Pt=/^(?:[a-z][\d+.a-z-]*:\/\/[^/]*\/?|\/\/[^/]+\/|[a-z]:\/|\/)?/iu,F=e=>Pt.exec(e)[0],I=e=>F(e).includes(`://`),L=e=>e.replace(I(e)?/[#?].*$/su:/\?.*$/su,``),Ft=e=>e.slice(e.lastIndexOf(`/`)+1),R=(e,t)=>URL.parse(e,t)?.href??null;function z(e){let t=F(e),n=t.includes(`://`)&&R(e);if(n)return n;let r=[];for(let n of e.slice(t.length).split(`/`))n===``||n===`.`||(n===`..`?r.length>0&&r.at(-1)!==`..`?r.pop():t||r.push(`..`):r.push(n));let i=/^[a-z]:\/$/iu.test(t)?t.toUpperCase():t.startsWith(`//`)?t.toLowerCase():t;return i?i.replace(/\/?$/u,`/`)+r.join(`/`):r.join(`/`)||`.`}function It(e,t){let n=F(t);return I(e)&&!n.includes(`:`)?R(t,e)??z(`${e}/../${t}`):z(n===`/`?F(e).replace(/\/?$/u,``)+t:n?t:`${e}/../${t}`)}function Lt(e){try{return decodeURIComponent(e)}catch{return e}}function B(e,t){let n=e.replaceAll(`\\`,`/`);if(At.test(n))return z(n.replace(At,``));let r=Nt.test(n)?R(n)??n:n,i=/^file:\/\/([^/#]*)([^#]*)/isu.exec(r);if(i){let[,e,t]=i;return z(Lt(e&&e.toLowerCase()!==`localhost`?`//${e}${t}`:t).replace(/^\/(?=[a-z]:\/)/iu,``))}if(jt.test(r)&&!F(r).includes(`:`))return r;if(t===void 0)return z(r);if(Mt.test(t)&&!F(r))return B(R(r,t)??r);let a=B(t);return F(r)&&!I(a)?z(r):It(a,r)}var Rt=/^(?:@[\dA-Za-z~-][\w.~-]*\/)?[\dA-Za-z~-][\w.~-]*$/u;function zt(e){let t=e.split(`/`).slice(0,e.startsWith(`@`)?2:1).join(`/`);return Rt.test(t)?t:null}var Bt=new Set([`.pnpm`,`.bun`,`.deno`]),Vt=/^\d+\.\d+\.\d+(?:-[\d.a-z-]+)?(?:\+[\d.a-z-]+)?$/iu;function Ht(e,t){let n=`${t.replace(`/`,`+`)}@`,r=e.startsWith(n)?e.slice(n.length).split(/[(_]/u)[0]:null;return Vt.test(r)?r:null}function Ut(e){let t=L(e).split(`/`),n=t.lastIndexOf(`node_modules`),r=n<0?null:zt(t.slice(n+1).join(`/`));if(r===null)return null;let i=n+1+r.split(`/`).length;if(i>=t.length||t.slice(i).includes(``))return null;let a=t.slice(0,i).join(`/`);return{name:r,version:Bt.has(t[n-2])?Ht(t[n-1],r):null,root:a,path:e.slice(a.length+1)}}var Wt=new Map([[`js`,`jsx`],[`mjs`,`jsx`],[`cjs`,`jsx`],[`jsx`,`jsx`],[`es`,`jsx`],[`es6`,`jsx`],[`ts`,`ts`],[`mts`,`ts`],[`cts`,`ts`],[`tsx`,`tsx`],[`json`,`json`]]);function Gt(e){let t=Ft(L(e));return/^[\w-]+$/u.test(t)?`jsx`:Wt.get(/\.([\da-z]+)$/iu.exec(t)?.[1].toLowerCase())??null}var Kt=[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.tsx`,`.mts`,`.cts`,`.json`],qt=[`.ios`,`.android`,`.web`];function Jt(e){let t=e.map(e=>/\.[a-z]+(?=\.\w+$)/u.exec(Ft(L(e.path??``)))?.[0]),[[n,r],[,i]]=qt.map(e=>[e,t.filter(t=>t===e).length]).toSorted((e,t)=>t[1]-e[1]);return[...r===i?[]:[n],`.native`,``,`.browser`,`.node`]}var Yt=new Map([[`.js`,[`.ts`,`.tsx`]],[`.jsx`,[`.tsx`]],[`.mjs`,[`.mts`]],[`.cjs`,[`.cts`]]]),Xt=[`index`,`main`,`browser`,`node`],Zt=[``,`src/`,`lib/`,`dist/`,`build/`],Qt=new Set([`lib`,`dist`,`build`,`out`,`esm`,`cjs`]);function*$t(e,t){yield e;let n=/\.[^./]+$/u.exec(e)?.[0];for(let t of Yt.get(n)??[])yield e.slice(0,-n.length)+t;for(let n of e.endsWith(`/`)?[`${e}index`]:[e,`${e}/index`])for(let e of Kt)for(let r of t)yield n+r+e;if(n)for(let r of t.filter(Boolean))yield e.slice(0,-n.length)+r+n}function*en(e){let t=e;for(;;){t.startsWith(`src/`)||(yield`src/${t}`),t!==e&&(yield t);let n=t.indexOf(`/`);if(n<0||!Qt.has(t.slice(0,n)))return;t=t.slice(n+1)}}function tn(e){let t=new Map,n=new Map,r=new Map;for(let i of e)i.path!==null&&t.set(i.path,i),i.package&&(n.set(i.package.name,(n.get(i.package.name)??new Set).add(i.package.root)),(r.get(i.package.root)??r.set(i.package.root,[]).get(i.package.root)).push(i));return{byPath:t,roots:n,byRoot:r,platforms:Jt(e),found:new Map}}function V(e,t){if(!e.found.has(t)){let n=L(t),r=$t(n,e.platforms).map(e=>e+t.slice(n.length));e.found.set(t,e.byPath.get(r.find(t=>e.byPath.has(t)))??null)}return e.found.get(t)}function nn(e,t,n){let r=e.roots.get(n);if(!r)return null;let i=t.path.split(`/`);for(let e=i.length-1;e>=0;e--){let t=[...i.slice(0,e),`node_modules`,n].join(`/`);if(r.has(t))return t}return r.size===1?[...r][0]:null}var rn=new Set(`assert.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.domain.events.fs.http.http2.https.inspector.module.net.os.path.perf_hooks.process.punycode.querystring.readline.repl.stream.string_decoder.sys.timers.tls.trace_events.tty.url.util.v8.vm.wasi.worker_threads.zlib._http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert/strict.dns/promises.fs/promises.inspector/promises.path/posix.path/win32.readline/promises.stream/consumers.stream/promises.stream/web.timers/promises.util/types`.split(`.`));function an(e){if(e.startsWith(`node:`)||rn.has(e))return{builtin:!0};let t=zt(L(e));return t===null?{}:{package:t}}function on(){let e=[],t=new Map,n=(n,r,i)=>{let a=t.get(n)??t.set(n,new Set).get(n);a.has(r)||(a.add(r),e.push(i))};return{edges:e,add:n,link:(e,t,r)=>{e&&t&&t!==e&&n(e,t,{from:e,to:t,kind:r})}}}function sn(e,t){for(let n of Xt)for(let r of Zt){let i=V(e,`${t}/${r}${n}`);if(i)return i}let n=e.byRoot.get(t);return n?.length===1?n[0]:null}function cn(e,t,n,r){return/^\/[^?]/u.test(n)?V(e,t+n)??en(n.slice(1)).map(n=>V(e,`${t}/${n}`)).find(Boolean):V(e,t+n)??r(e,t)}function ln(e,t,n,r=sn){let i=/^(?:\.{1,2}|[a-z]:)?\\/iu.test(n)?n.replaceAll(`\\`,`/`):n,a=Nt.test(i);if(a||/^(?:\.{1,2}(?:\/|$)|\/|[a-z]:\/)/iu.test(i)||I(i)){let n=a?B(i):It(t.path,i),r=V(e,n);return r?{to:r}:{to:null,path:n}}if(jt.test(i)&&e.byPath.has(i))return{to:e.byPath.get(i)};let o=zt(L(n)),s=o===null?null:nn(e,t,o);if(s===null)return{to:null,...an(n)};let c=cn(e,s,n.slice(o.length),r);return c?{to:c}:{to:null,package:o}}var H=class extends Error{name=`SourceMapError`},un=new Uint8Array(128).fill(255);for(let[e,t]of[...`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/,;`].entries())un[t.codePointAt(0)]=e;function dn(e){let t=new Int32Array(e.length*2);return t.set(e),t}function fn(e){let{starts:t,columns:n,sources:r,names:i}=e;for(let e=0;e+1<t.length;e++){let[a,o]=[t[e],t[e+1]],s=a+1;for(;s<o&&n[s-1]<=n[s];)s++;if(s>=o)continue;let c=Array.from(n.subarray(a,o),(e,t)=>[e,r[a+t],i[a+t]]).sort((e,t)=>e[0]-t[0]);for(let[e,[t,o,s]]of c.entries())[n[a+e],r[a+e],i[a+e]]=[t,o,s]}return e}function pn(e){let t=[0],n=new Int32Array(1024),r=new Int32Array(1024),i=new Int32Array(1024),a=0;for(let{mappings:o,files:s,line:c,column:l,names:u,nameCount:d}of e){if(typeof o!=`string`)throw new H(`mappings is not a string`);for(;t.length<=c;)t.push(a);let e=[0,0,0,0,0],f=0,p=0,m=1,h=l;for(let c=0;c<=o.length;c++){let l=c<o.length?un[o.codePointAt(c)]??255:64;if(l<32){if(p+=l*m,f===5)throw new H(`mappings: a segment of more than 5 fields at ${c}`);e[f++]+=p%2?(1-p)/2:p/2,p=0,m=1;continue}if(l<64){if(p+=(l-32)*m,m*=32,m>2**30)throw new H(`mappings: a value at ${c} runs past 32 bits`);continue}if(l===255)throw new H(`mappings: ${JSON.stringify(o[c])} at ${c} is not a base64 digit`);if(m!==1)throw new H(`mappings: the value before ${c} is cut off`);if(f>0){if(f===2||f===3)throw new H(`mappings: a segment of ${f} fields before ${c}`);let t=f===1?-1:s[e[1]];if(t===void 0)throw new H(`mappings: source ${e[1]} before ${c} is not in sources`);if(e[0]<0)throw new H(`mappings: a negative generated column before ${c}`);a===n.length&&([n,r,i]=[dn(n),dn(r),dn(i)]),n[a]=e[0]+h,r[a]=t,i[a++]=f===5&&e[4]>=0&&e[4]<d?u+e[4]:-1,f=0}l===65&&(t.push(a),e[0]=0,h=0)}}return t.push(a),fn({starts:Int32Array.from(t),columns:n.slice(0,a),sources:r.slice(0,a),names:i.slice(0,a)})}var mn=new WeakMap,hn=e=>mn.get(e),U=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function W(e,t){if(!e)throw new H(t)}function gn(e,t){if(e===void 0)return[];W(Array.isArray(e),`${t} is not an array`);for(let n of e)W(typeof n==`string`||n===null,`${t} holds ${JSON.stringify(n)}`);return e}function _n(e,t,n,r){let i=e.bySource.get(t);if(i!==void 0)return e.files[i].content??=n,e.files[i].ignored||=r,i;let a=t===null?null:B(t,e.mapPath);return e.files.push({source:t,path:a,package:a===null?null:Ut(a),content:n,ignored:r}),t!==null&&e.bySource.set(t,e.files.length-1),e.files.length-1}function vn(e,t,n,r){W(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),W(e.sourceRoot===void 0||typeof e.sourceRoot==`string`,`sourceRoot is not a string`);let i=gn(e.sources,`sources`),a=gn(e.sourcesContent,`sourcesContent`),o=e.ignoreList??e.x_google_ignoreList??[];W(Array.isArray(o)&&o.every(e=>Number.isInteger(e)&&e>=0&&e<i.length),`ignoreList is not a list of indices into sources`);let s=new Set(o),c=e.sourceRoot?e.sourceRoot.replace(/\/?$/u,`/`):``,l=i.map((e,n)=>_n(t,e===null?null:c+e,a[n]??null,s.has(n))),u=Array.isArray(e.names)?e.names:[];t.parts.push({mappings:e.mappings,files:l,line:n,column:r,names:t.names.length,nameCount:u.length}),t.names.push(...u)}function yn(e,t){W(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),W(Array.isArray(e.sections),`sections is not an array`);for(let[n,r]of e.sections.entries()){let{offset:i,map:a}=U(r)?r:{};W(U(i)&&[i.line,i.column].every(e=>Number.isInteger(e)&&e>=0),`sections[${n}].offset is not a line and a column`),W(U(a)&&a.sections===void 0,`sections[${n}].map is not a plain source map`);let o=e.sections[n-1]?.offset;W(!o||o.line<i.line||o.line===i.line&&o.column<=i.column,`sections[${n}] starts before sections[${n-1}]`),vn(a,t,i.line,i.column)}}function bn(e,t={}){if(!U(t))throw TypeError(`readSourceMap: options is not an object`);if(t.path!==void 0&&typeof t.path!=`string`)throw TypeError(`readSourceMap: options.path is not a string`);let n=e;if(typeof e==`string`||e instanceof Uint8Array)try{let t=typeof e==`string`?e:new TextDecoder(`utf-8`,{fatal:!0}).decode(e);n=JSON.parse(t.replace(/^\)\]\}'[^\n]*\n/u,``))}catch(e){throw new H(`not JSON: ${e.message}`,{cause:e})}W(U(n),`not a JSON object`);let r={files:[],bySource:new Map,mapPath:t.path,parts:[],names:[]};n.sections===void 0?vn(n,r,0,0):yn(n,r);let i={files:r.files};return mn.set(i,{...pn(r.parts),nameList:r.names}),i}var xn=/\r\n?|[\n\u2028\u2029]/gu;function Sn(e){let t=[0];for(let n of e.matchAll(xn))t.push(n.index+n[0].length);return t}function Cn(e,t,n,r){let[i,a]=[t,n];for(;i<a;){let t=i+a>>1;e[t]<=r?i=t+1:a=t}return i-1}function G(e,t){let n=Cn(e,0,e.length,t);return[n,t-e[n]]}function wn(e,[t,n]){if(t>=e.starts.length-1)return-1;let r=e.starts[t],i=Cn(e.columns,r,e.starts[t+1],n);return i<r?-1:i}function Tn(e,t,n,r){let i=hn(e),a=G(t,n),[o,s]=G(t,r),c=new Map,l=wn(i,a);for(let e=a[0];e<=o&&e<i.starts.length-1;e++){let t=e===a[0]&&l>=0?l:i.starts[e];for(let n=t;n<i.starts[e+1];n++){let t=i.sources[n];if(e===o&&i.columns[n]>=s)break;t>=0&&c.set(t,(c.get(t)??0)+1)}}let[u]=[...c].reduce((e,t)=>t[1]>e[1]?t:e,[-1,0]);return u<0?null:e.files[u]}var K=/\s+/uy,En=`
|
|
2
|
+
\r\u2028\u2029`,q=/[\n\r\u2028\u2029]/gu,Dn=/[\n\r\u2028\u2029]/u,J=/[\w$\u0080-]+/uy,On=new Set([`return`,`typeof`,`instanceof`,`in`,`of`,`new`,`delete`,`void`,`throw`,`case`,`default`,`extends`,`do`,`else`,`yield`,`await`]),kn=new Set([`if`,`while`,`for`,`with`]),An=new Set([`break`,`continue`,`debugger`]),jn=new Set([`(`,`[`,"${",`,`,`=`,`:`,`?`,`!`,`~`,`+`,`-`,`*`,`/`,`%`,`&`,`|`,`^`,`<`,`>`]);function Mn(e,t){return e?.type===`word`?t&&[`return`,`yield`].includes(e.value)?!1:On.has(e.value)&&![`do`,`else`].includes(e.value):jn.has(e?.value)}function Nn(e){let t=e.at(-1);return t?.type===`word`&&(kn.has(t.value)||t.value===`await`&&e.at(-2)?.value===`for`)}function Pn(e){return e?e.type===`word`?On.has(e.value)||An.has(e.value)||e.label===!0:e.value===`)`?e.control:e.value===`}`?!e.object:e.type===`punctuator`&&![`++`,`--`,`]`].includes(e.value):!0}var Fn=(e,t)=>e.startsWith(`\r
|
|
3
|
+
`,t+1)?3:2,In=/\\(?:u\{([\da-f]+)\}|u([\da-f]{4})|x([\da-f]{2})|([0-3][0-7]{0,2}|[4-7][0-7]?)|(\r\n|[\n\r\u2028\u2029])|(.))/giu,Ln={b:`\b`,f:`\f`,n:`
|
|
4
|
+
`,r:`\r`,t:` `,v:`\v`};function Rn(e){return e.includes(`\\`)?e.replace(In,(e,t,n,r,i,a,o)=>{if(a!==void 0)return``;if(i!==void 0)return String.fromCodePoint(Number.parseInt(i,8));let s=Number.parseInt(t??n??r,16);return Number.isNaN(s)?Ln[o]??o:String.fromCodePoint(Math.min(s,1114111))}):e}function zn(e,t){let n=e[t],r=t+1;for(;r<e.length&&e[r]!==n&&!En.includes(e[r]);)r+=e[r]===`\\`?Fn(e,r):1;return[e[r]===n?Rn(e.slice(t+1,r)):null,r+1]}function Bn(e,t){let n=t+1,r=!1;for(;n<e.length&&!En.includes(e[n])&&(r||e[n]!==`/`);)e[n]===`\\`?n++:e[n]===`[`?r=!0:e[n]===`]`&&(r=!1),n++;return J.lastIndex=n+1,J.test(e)?J.lastIndex:n+1}function Vn(e,t,n){for(let r=t;r<e.length;r++)if(e[r]===`\\`)r++;else{if(e[r]==="`")return r+1;if(e[r]===`$`&&e[r+1]===`{`)return n.push(`template`),r+2}return e.length}function Hn(e){let t=[],n=[],r=[],i=0,a=0;for(;i<e.length;){let o=t.length;if(K.lastIndex=i,K.test(e)&&(i=K.lastIndex),i>=e.length)break;let s=e[i],c=e[i+1];if(J.lastIndex=i,s===`/`&&c===`/`)q.lastIndex=i+2,i=q.test(e)?q.lastIndex-1:e.length;else if(s===`/`&&c===`*`){let t=e.indexOf(`*/`,i+2);i=t<0?e.length:t+2}else if(s===`"`||s===`'`){let[n,r]=zn(e,i);t.push({type:`string`,value:n}),i=r}else if(s==="`"||s===`}`&&n.at(-1)===`template`){s===`}`&&n.pop();let r=n.length,a=Vn(e,i+1,n),o=s==="`"&&n.length===r&&e[a-1]==="`";t.push({type:`string`,value:o?Rn(e.slice(i+1,a-1)):null}),n.length>r&&t.push({type:`punctuator`,value:"${"}),i=a}else if(s===`/`&&Pn(t.at(-1)))i=Bn(e,i),t.push({type:`regex`});else if(J.test(e)){let n=An.has(t.at(-1)?.value)&&!Dn.test(e.slice(a,i));t.push({type:`word`,value:e.slice(i,J.lastIndex),...n&&{label:n}}),i=J.lastIndex}else{s===`{`&&n.push(Mn(t.at(-1),Dn.test(e.slice(a,i)))?`object`:`block`);let o=s===`}`?n.pop():void 0;s===`(`&&r.push(Nn(t));let l=(s===`+`||s===`-`)&&c===s||s===`=`&&c===`>`?s+c:s;t.push({type:`punctuator`,value:l,...s===`)`&&{control:r.pop()===!0},...s===`}`&&{object:o===`object`}}),i+=l.length}t.length>o&&(a=i)}return t}var Y=e=>e?.type===`string`&&e.value!==null,Un=new Set([`type`,`typeof`]),Wn=(e,t)=>e[t+1]?.type===`word`&&(e[t+1].value!==`as`||e[t+2]?.type!==`word`||e[t+2].value===`as`);function Gn(e,t){let n=!1;for(let r=t+1;r<e.length&&e[r].value!==`}`;r++)if(!(r>t+1&&e[r-1].value!==`,`)){if(!Un.has(e[r].value)||!Wn(e,r))return!1;n=!0}return n}function Kn(e,t){for(let n=t;n<e.length;n++){let{value:r}=e[n];if(r===`;`||n>t&&(r===`import`||r===`export`))return null;if(r===`from`&&Y(e[n+1]))return e[n+1].value}return null}function qn(e,t){let[n,r,i]=[e[t].value,e[t+1],e[t+2]],a=n===`import`?`import`:`export-from`;if(n===`import`&&Y(r))return{kind:a,specifier:r.value};if(Un.has(r?.value)&&![`,`,`from`].includes(i?.value)||r?.value===`{`&&Gn(e,t+1)||n===`export`&&![`{`,`*`].includes(r?.value)||n===`import`&&r?.type!==`word`&&![`{`,`*`].includes(r?.value))return null;let o=Kn(e,t+1);return o===null?null:{kind:a,specifier:o}}function Jn(e,t){let[n,r]=[e[t+2],e[t+3]];if(n?.value!==`)`)return Y(n)&&[`)`,`,`].includes(r?.value)?n.value:null}function Yn(e,t=new Set){let n=Hn(e),r=[];for(let[e,i]of n.entries()){if(i.type!==`word`||[`.`,`#`,`function`].includes(n[e-1]?.value)||n[e-1]?.value===`=`&&n[e-3]?.value===`type`&&n[e-4]?.value===`import`)continue;let a=n[e+1]?.value===`(`,o=a?Jn(n,e):void 0;if((i.value===`require`||t.has(i.value))&&o!==void 0)r.push({kind:`require`,specifier:o,...i.value!==`require`&&{callee:i.value}});else if(i.value===`import`&&a)o!==void 0&&r.push({kind:`dynamic-import`,specifier:o});else if(i.value===`import`||i.value===`export`){let t=qn(n,e);t&&r.push(t)}}return r}var Xn=/^[\w$]*__d\(/gmu,Zn=([e,t,n,...r])=>(typeof e==`number`||typeof e==`string`)&&(t===void 0||typeof t==`object`)&&(n===void 0||typeof n==`string`)&&r.length===0;function Qn(e){let t=/\);?\s*$/u.exec(e)?.index,n=null,r=t===void 0?-1:e.lastIndexOf(`},`,t);for(;r>=0&&/[\d"]/u.test(e[r+2]);){let i;try{i=JSON.parse(`[${e.slice(r+2,t)}]`)}catch{break}if(!Zn(i))break;n=i,r=r>0?e.lastIndexOf(`},`,r-1):-1}return n}function $n(e){let t=/^[^(]*\(\s*(?:function\s*[\w$]*\s*)?\(([^)]*)\)/u.exec(e)?.[1].split(`,`).slice(1,4).map(e=>e.trim().replaceAll(`$`,`\\$`));if(!t?.length)return[];let n=e.matchAll(RegExp(`(?<=[^\\w$.#]|\\.\\.\\.)(?:${t.join(`|`)})\\((\\d+|"(?:[^"\\\\]|\\\\.)*")[,)]`,`gu`));return[...new Set([...n].map(e=>JSON.parse(e[1])))]}function er(e,t){if(Array.isArray(e))return e;let n=Object.entries(e??{}).filter(([e])=>/^\d+$/u.test(e)).map(([,e])=>e);return n.length>0?n:$n(t)}function tr(e,t){let n=new Map(t.files.map((e,t)=>[e,t])),r=e.flatMap((e,t)=>e.file?[{k:t,at:n.get(e.file)}]:[]);for(let n=0;n<(r[0]?.k??0);n++)e[n].file=t.files[r[0].at-r[0].k+n]??null;for(let[n,{k:i,at:a}]of r.entries()){let o=r[n+1];if(!(o&&o.at-a!==o.k-i))for(let n=i+1;n<(o?.k??e.length);n++)e[n].file=t.files[a+n-i]??null}}function nr(e,t){let n=[...e.matchAll(Xn)].map(e=>e.index);if(n.length===0)return null;let r=Sn(e),i=t=>e.slice(r[t],r[t+1]),a=[];for(let[o,s]of n.entries()){let[c]=G(r,s),[l]=G(r,(n[o+1]??e.length)-1),u=Qn(i(l));for(;!u&&l>c;)u=Qn(i(--l));if(!u)throw Error(`bundleEdges: the Metro module at line ${c+1} ends in no define params`);let d=r[l+1]??e.length;a.push({id:u[0],file:Tn(t,r,s,d),dependencies:er(u[1],e.slice(s,d))})}tr(a,t);let o=new Map(a.map(e=>[e.id,e])),{edges:s,link:c}=on();for(let{file:e,dependencies:t}of a)for(let n of t)c(e,o.get(n)?.file,`dependency`);return s}var rr=e=>e.path!==null&&![`json`,null].includes(Gt(e.path)),ir=e=>e.path!==null&&Gt(e.path)===null;function ar(e){let t=/^_([A-Za-z]+)\d+$/u.exec(e)?.[1];if(t)return[t,`interopRequireDefault`];let n=/^_(interopRequire(?:Default|Wildcard)|jsx(?:Dev)?Runtime|callSuper)$/u.exec(e)?.[1];return n===`callSuper`?[`getPrototypeOf`,`possibleConstructorReturn`,`interopRequireDefault`]:n?[n]:[]}var or={jsxRuntime:`react/jsx-runtime`,jsxDevRuntime:`react/jsx-dev-runtime`};function sr(e){let{sources:t,names:n,nameList:r}=hn(e),i=new Map,a=new Map,o=e.files.map(()=>new Set);for(let e=0;e<n.length;e++)n[e]<0||t[e]<0||(a.has(n[e])||a.set(n[e],ar(r[n[e]]).length>0),a.get(n[e])&&o[t[e]].add(r[n[e]]));for(let[t,n]of o.entries()){if(n.size===0)continue;let r=e.files[t],a=new Set(Array.from((r.content??``).matchAll(/(?:function|var|let|const)\s+(_[A-Za-z]+\d*)\b/gu),e=>e[1])),o=[...n].filter(e=>!a.has(e)&&!a.has(e.replace(/\d+$/u,``))).flatMap(ar);o.length>0&&i.set(r,o.map(e=>or[e]??`@babel/runtime/helpers/${e}`))}return i}function cr(e,t){let n=new Map;for(let[r,i]of e){let e=n.get(r)??n.set(r,new Map).get(r);for(let n of i)e.set(n,ln(t,r,n,()=>null))}let r=new Set([...n.values()].flatMap(e=>[...e.values()].map(e=>e.to))),i=(e,n)=>t.byRoot.get(n).find(e=>!r.has(e))??t.byRoot.get(n)[0];return(e,r)=>{let a=n.get(e)?.get(r);return a?.to?a:ln(t,e,r,i)}}var lr=e=>/(?:^|\/)__prelude__$/u.test(e.source??``),ur=e=>e?.package?.name===`metro-runtime`&&e.package.path===`src/polyfills/require.js`;function dr(e){if(!e.files.some(lr)&&!ur(e.files[0]))return null;if(!e.files.some(e=>e.content!==null&&!lr(e)&&!ur(e)))throw Error("bundleEdges: the Metro map carries no sourcesContent, which its edges are read from; pass the bundle as `code`");let t=tn(e.files),n=e.files[e.files.findIndex(ir)+1],r=e.files.find(e=>e.package?.name===`metro-runtime`&&e.package.path===`src/modules/asyncRequire.js`),i=new Map(e.files.filter(e=>e.content!==null&&rr(e)).map(e=>[e,Yn(e.content)])),a=sr(e),o=cr([...[...i].map(([e,t])=>[e,t.flatMap(({specifier:e})=>e===null?[]:[e])]),...a],t),{edges:s,add:c,link:l}=on();for(let t of e.files){ir(t)&&l(t,n,`dependency`);for(let{kind:e,specifier:n}of i.get(t)??[]){let i=n===null?{to:null}:o(t,n);i.to!==t&&c(t,`${e}\0${JSON.stringify(n)}`,{from:t,kind:e,specifier:n,...i}),e===`dynamic-import`&&l(t,r,`dependency`)}for(let e of a.get(t)??[])l(t,o(t,e).to,`dependency`)}return s}var fr=(e,t)=>t==null?dr(e):nr(t,e);function pr(e,t){let n=fr(e,t);if(!n)throw Error(`bundleEdges: not a Metro ${t==null?`map`:`bundle`}; edges-lite.js reads only those, edges.js reads others`);return{edges:n}}function mr(e){let t=JSON.parse(e.replace(/^\)\]\}'[^\n]*\n/u,``)),n=bn(t),r=t.sections?t.sections.reduce((e,t)=>e+(t.map.names?.length??0),0):t.names?.length??null;return{json:{version:t.version,file:t.file,sourceRoot:t.sourceRoot},map:n,namesCount:r}}function hr(e){if(e.map)return e.map.files.flatMap(e=>e.source===null?[]:[[e.source,e.content]]);let t=e.json?.sourcesContent??[];return(e.json?.sources??[]).map((e,n)=>[e,t[n]??null])}function gr(e,t){let n=new Map;for(let{from:r,to:i,specifier:a}of t(e).edges){if(r.source===null||i?.source==null||i.source===r.source)continue;let e=typeof a==`string`?[r.source,i.source,a]:[r.source,i.source];n.set(e.join(`\0`),e)}return[...n.values()]}function _r(e){try{return pr(e)}catch{return{edges:[]}}}var vr=Object.freeze([]);function X(e){return e?.edges?e.edges:e?.map?(e.edges=gr(e.map,_r),e.edges):vr}var yr=new WeakMap,br=new WeakMap;function xr(e){let t=X(e);if(!yr.has(t)){let e=new Map;for(let[n,r]of t)e.has(n)||e.set(n,new Set),e.get(n).add(r);yr.set(t,e)}return yr.get(t)}function Sr(e){let t=X(e);if(!br.has(t)){let e=new Map;for(let[n,r,i]of t)i!==void 0&&(e.has(n)||e.set(n,new Map),e.get(n).set(i,r));br.set(t,e)}return br.get(t)}var Cr=new WeakMap,wr=new WeakMap,Tr=new WeakMap,Er=new WeakMap,Dr=new WeakMap,Or=new WeakMap;function Z(e){if(e?.metadataOnly)return new Map;let t=e?.bundle??e?.json;if(t&&Cr.has(t))return Cr.get(t);let n=new Map;if(!e)return n;if(e.kind===`stasis`){if(!e.bundle)return n;let t=e.bundle.formats;for(let[r,i]of e.bundle.sources)typeof i==`string`&&(P.isResourceFormat(t?.get(r))||n.set(r,i))}else if(e.kind===`sourcemap`)for(let[t,r]of hr(e))typeof r==`string`&&n.set(t,r);return t&&Cr.set(t,n),n}function kr(e){let t=1;for(let n=e.indexOf(`
|
|
5
|
+
`);n!==-1;n=e.indexOf(`
|
|
6
|
+
`,n+1))t++;return t}var Ar=new WeakMap;function jr(e){let t=Ar.get(e);if(!t){let n=[...e.keys()].toSorted();t={paths:n,numbers:new Map(n.map((e,t)=>[e,t+1]))},Ar.set(e,t)}return t}function Mr(e,t){let n=Array.isArray(t)?t:[];return{integrity:e.integrity,kind:`sourcemap`,size:e.size,json:{version:3,sources:n.map(([e])=>e),sourcesContent:n.map(([,,e])=>typeof e==`string`?e:null)},fileSizes:new Map(n.map(([e,t])=>[e,t])),npmBinaries:new Map(n.filter(([,,e,t])=>typeof e!=`string`&&typeof t==`string`).map(([e,t,,n])=>[e,{size:t,digest:n}]))}}function Nr(e){let t=e?.bundle??e?.json;if(t&&wr.has(t))return wr.get(t);let n=new Map(Z(e));for(let[t,r]of e?.npmBinaries??[])n.set(t,{format:`digest`,...r});if(e?.kind===`stasis`&&e.bundle){let t=e.bundle.formats;for(let[r,i]of e.bundle.sources){if(typeof i!=`string`)continue;let e=t?.get(r);e===`resource`?n.set(r,i):e===`resource:base64`&&n.set(r,{format:`base64`,data:i})}}return t&&wr.set(t,n),n}var Pr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;function Fr(e){let t=e.endsWith(`=`);if(t?e.length%4!=0||e.at(-3)===`=`:e.length%4==1)return null;let n=t?e.slice(0,e.endsWith(`==`)?-2:-1):e;if(/[^A-Za-z0-9+/]/u.test(n))return null;let r=n.length%4;return r>1&&Pr.indexOf(n.at(-1))&(r===2?15:3)?null:Math.floor(n.length*3/4)}function Ir(e){return typeof e==`string`?t(e):e?.format===`digest`?e.size:e?.format===`base64`?Fr(e.data):null}function Q(e){if(e?.fileSizes)return e.fileSizes;let t=e?.bundle??e?.json;if(t&&Tr.has(t))return Tr.get(t);let n=new Map,r=Nr(e),i=e?.kind===`stasis`?e.bundle?.sources.keys():e&&hr(e).map(([e])=>e);for(let e of i??[])n.set(e,Ir(r.get(e)));return t&&Tr.set(t,n),n}function Lr(e){if(e?.metadataOnly)return e.unsizedFiles??new Set;let t=Q(e);if(Or.has(t))return Or.get(t);let n=new Set;for(let r of Nr(e).keys())t.get(r)===null&&n.add(r);return Or.set(t,n),n}function Rr(e){let t=Q(e);if(Dr.has(t))return Dr.get(t);let n=Lr(e),r=e?.kind===`stasis`?e.bundle?.formats:null,i=new Map;for(let[a,o]of t)o===null&&!n.has(a)||i.set(a,P.isResourceFormat(r?.get(a))||e?.npmBinaries?.has(a)?`resource`:`source`);return Dr.set(t,i),i}function zr(e){let t=Q(e),n=e?.kind===`stasis`?e.bundle?.formats:null;if(!n||n.size===0)return t;if(Er.has(t))return Er.get(t);let r=new Map;for(let[e,i]of t)P.isResourceFormat(n.get(e))||r.set(e,i);return Er.set(t,r),r}var Br=new WeakMap;function Vr(e){if(e?.kind!==`stasis`||!e.bundle?.modules)return null;if(Br.has(e.bundle))return Br.get(e.bundle);let t=new Map;for(let[n,r]of e.bundle.modules)for(let e of Object.keys(r.files))t.set(n===`.`?e:`${n}/${e}`,n);return Br.set(e.bundle,t),t}function Hr(e,t=null,n=(e,t)=>t.name){let r=new Map;if(e?.kind!==`stasis`||!e.bundle?.modules)return r;let i=t===null?null:Vr(e),a=t===null?null:new Set([...t].map(e=>i?.get(e)));for(let[t,i]of e.bundle.modules){if(a&&!a.has(t)||!t.includes(`node_modules`)||!i?.name||typeof i.version!=`string`||!i.version)continue;let e=n(t,i),o=r.get(e);o||(o=new Set,r.set(e,o)),o.add(i.version)}return r}var Ur=Object.freeze({javascript:`JavaScript`,jsx:`JSX`,typescript:`TypeScript`,tsx:`TSX`,json:`JSON`,css:`CSS`,markup:`HTML`,yaml:`YAML`,bash:`Shell`,markdown:`Markdown`,solidity:`Solidity`,php:`PHP`,rust:`Rust`,ruby:`Ruby`,java:`Java`,cpp:`C++`,c:`C`,objectivec:`Objective-C`,python:`Python`,go:`Go`,kotlin:`Kotlin`,swift:`Swift`,dart:`Dart`,sql:`SQL`,lua:`Lua`,csharp:`C#`,scala:`Scala`,vue:`Vue`,svelte:`Svelte`}),Wr=Object.freeze({py:`python`,pyw:`python`,go:`go`,kt:`kotlin`,kts:`kotlin`,swift:`swift`,dart:`dart`,sql:`sql`,lua:`lua`,cs:`csharp`,scala:`scala`,sc:`scala`,vue:`vue`,svelte:`svelte`});function Gr(e){let t=typeof e==`string`?e.slice(e.lastIndexOf(`/`)+1):``,n=t.lastIndexOf(`.`),r=n>0?t.slice(n+1).trim().toLowerCase():``,i=kt(e)??Wr[r];return i?{key:i,label:Ur[i]??i}:r?{key:`extension:${r}`,label:`.${r}`}:{key:`other`,label:`Other`}}function Kr(e,t){let n=new Map,r=0,i=0;for(let[a,o]of e){let e=Gr(a),s=n.get(e.key)??{...e,files:0,lines:0,bytes:0};s.files++,s.lines+=o,s.bytes+=t.get(a)??0,n.set(e.key,s),i+=o,r+=t.get(a)??0}return{files:e.size,lines:i,bytes:r,languages:[...n.values()].toSorted((e,t)=>t.lines-e.lines||e.label.localeCompare(t.label))}}var qr=6,$=new WeakMap,Jr=new Set([`terminal`,`code`,`search`,`compare`]);function Yr(e,t=null){return!!t||Jr.has(e)}var Xr=/^sha512-[A-Za-z0-9+/]{86}==$/u;function Zr(t){if(t.fileHashes)return Promise.resolve(t.fileHashes);if($.has(t))return $.get(t);let n=(async()=>{let n=[...Z(t)],r=new Map;for(let t=0;t<n.length;t+=32){let i=await Promise.all(n.slice(t,t+32).map(async([t,n])=>[t,await e(n)]));for(let[e,t]of i)r.set(e,t)}return t.fileHashes=r,r})();return $.set(t,n),n.catch(()=>$.delete(t)),n}function Qr(e){if(typeof e!=`string`)return 0;let t=/\S/gu,n=/[\r\n]/gu,r=0;for(;t.test(e)&&(r++,n.lastIndex=t.lastIndex,n.test(e));)t.lastIndex=n.lastIndex;return r}function $r(e){return e.lineCounts??=new Map([...Z(e)].map(([e,t])=>[e,Qr(t)]))}function ei(e){return e instanceof Map?Object.fromEntries([...e].map(([e,t])=>[e,ei(t)])):e}async function ti(e){let n=await Zr(e),r=Q(e),i=$r(e),a={version:qr,integrity:e.integrity,kind:e.kind,size:e.size,codeStats:Kr(i,r),files:[...r].map(([e,t])=>[e,t,n.get(e)??null,i.get(e)??null])},o=Lr(e);if(o.size>0&&(a.unsized=[...o]),e.kind===`sourcemap`){let{version:n,file:r,sourceRoot:i,names:o}=e.json,s=hr(e);a.json={version:n,file:r,sourceRoot:i,sources:s.map(([e])=>e)},a.sourceSizes=s.map(([,e])=>typeof e==`string`?t(e):null),a.namesCount=e.namesCount??o?.length??null;let c=new Map(a.files.map(([e],t)=>[e,t]));a.edges=X(e).map(([e,t,...n])=>[c.get(e),c.get(t),...n])}else{let t=e.bundle,n={version:t.version,config:t.config,repo:t.repo,package:t.package,formats:ei(t.formats),imports:ei(t.imports),reason:t.reason,executable:[...t.executable]};if(t.version===0)n.sources=Object.fromEntries([...r.keys()].map(e=>[e,null]));else{let e={},r={};for(let[n,i]of t.modules){let t=n.split(`/`).includes(`node_modules`)?e:r;Object.defineProperty(t,n,{enumerable:!0,value:{name:i.name,version:i.version,ecosystem:i.ecosystem,repo:i.repo,files:Object.fromEntries(Object.keys(i.files).map(e=>[e,null]))}})}n.modules=e,t.config.scope===`full`&&(n.sources=r,n.entries=[...t.entries])}a.bundle=n}return a}function ni(e,t){if(![1,2,3,4,5,qr].includes(e?.version)||e.integrity!==t||![`stasis`,`sourcemap`].includes(e.kind)||!Number.isSafeInteger(e.size)||e.size<0||!Array.isArray(e.files))throw Error(`Invalid bundle metadata`);let n=e.version!==qr,r=e.version===1,i=new Map,a=new Map,o=new Map;for(let t of e.files){if(!Array.isArray(t)||t.length!==4&&!(r&&t.length===3))throw Error(`Invalid bundle metadata file`);let[e,n,s,c]=t;if(typeof e!=`string`||a.has(e)||n!==null&&(!Number.isSafeInteger(n)||n<0)||s!==null&&(typeof s!=`string`||!Xr.test(s))||n===null&&s!==null||r&&n!==null&&s===null||c!=null&&(!Number.isSafeInteger(c)||c<0))throw Error(`Invalid bundle metadata file`);a.set(e,n),s!==null&&i.set(e,s),c!=null&&o.set(e,c)}let s=new Set(e.unsized??[]);if(e.unsized!==void 0&&(r||!Array.isArray(e.unsized)||s.size!==e.unsized.length)||[...s].some(e=>typeof e!=`string`||!a.has(e)||a.get(e)!==null))throw Error(`Invalid bundle metadata`);let c={integrity:t,kind:e.kind,size:e.size,metadataOnly:!0,fileSizes:a,fileHashes:i,lineCounts:o,unsizedFiles:s,stale:n};if(e.kind===`stasis`){c.bundle=P.fromJSON(e.bundle);let t=c.bundle.sources;if(t.size!==a.size||[...t.keys()].some(e=>!a.has(e)))throw Error(`Invalid bundle metadata inventory`);let n=c.bundle.formats;if(!r&&[...a].some(([e,t])=>i.has(e)!==(t!==null&&!P.isResourceFormat(n.get(e))))||[...s].some(e=>n.get(e)!==`resource:base64`))throw Error(`Invalid bundle metadata inventory`)}else{if(!e.json||typeof e.json!=`object`||![null,void 0].includes(e.namesCount)&&(!Number.isSafeInteger(e.namesCount)||e.namesCount<0))throw Error(`Invalid sourcemap metadata`);if(!Array.isArray(e.json.sources)||e.json.sources.some(e=>!a.has(e))||!Array.isArray(e.sourceSizes)||e.sourceSizes.length!==e.json.sources.length||e.sourceSizes.some(e=>e!==null&&(!Number.isSafeInteger(e)||e<0))||[...a].some(([e,t])=>i.has(e)!==(t!==null))||s.size>0)throw Error(`Invalid sourcemap inventory`);c.json=e.json,c.sourceSizes=e.sourceSizes,c.namesCount=e.namesCount,e.edges!==void 0&&(c.edges=ri(e.edges,e.files))}if(e.codeStats===void 0)c.codeStats=Kr(o,a);else{let t=e.codeStats,n=e=>Number.isSafeInteger(e)&&e>=0;if(!t||![t.files,t.lines,t.bytes].every(n)||!Array.isArray(t.languages)||t.languages.some(e=>!e||typeof e.key!=`string`||typeof e.label!=`string`||![e.files,e.lines,e.bytes].every(n)))throw Error(`Invalid bundle code stats`);c.codeStats=t}return c}function ri(e,t){if(!Array.isArray(e))throw Error(`Invalid sourcemap edges`);return e.map(e=>{if(!Array.isArray(e)||![2,3].includes(e.length)||e[0]===e[1]||e.length===3&&typeof e[2]!=`string`||e.slice(0,2).some(e=>!Number.isSafeInteger(e)||e<0||e>=t.length))throw Error(`Invalid sourcemap edges`);return[t[e[0]][0],t[e[1]][0],...e.slice(2)]})}function ii(e,{integrity:t,kind:n,size:r}){if(n===`stasis`)return{integrity:t,kind:n,size:r,bundle:P.parse(e)};if(n!==`sourcemap`)throw Error(`Unsupported bundle format`);return{integrity:t,kind:n,size:r,...mr(e)}}export{xt as a,P as b,kt as c,X as d,xr as e,Sr as f,Z as g,kr as h,jr as i,Mr as j,Nr as k,Ir as l,Q as m,Rr as n,zr as o,Vr as p,Hr as q,Kr as r,Yr as s,Zr as t,Qr as u,$r as v,ti as w,ni as x,ii as y};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as e,c as t,m as n,r}from"./chunk-
|
|
1
|
+
import{b as e,c as t,m as n,r}from"./chunk-PTFQKLKO.js";import{a as i}from"./chunk-TUII34K2.js";var a=3,o=4,s=/^[\w-]{4}$/u,c=/^[\w-]{8}$/u,l=`AAAA`,u={report:`deepview/finding-link/report/v1
|
|
2
2
|
`,workspace:`deepview/finding-link/workspace/v1
|
|
3
3
|
`},d=new Map;function f(e,t){return`${e}\0${t}`}function p(e){return typeof e==`string`&&s.test(e)}async function m(e,t){let n=u[e];if(!n||typeof t!=`string`||!t)return null;let r=f(e,t),o=d.get(r);if(o!==void 0)return o;let s;try{let e=await crypto.subtle.digest(`SHA-256`,i(n+t));s=new Uint8Array(e).slice(0,a).toBase64({alphabet:`base64url`,omitPadding:!0})}catch{return null}return d.set(r,s),s}function h(e,t){return typeof t!=`string`||!t?null:d.get(f(e,t))??null}function g(e,t){let n=[];for(let[r,i]of[[`report`,e],[`workspace`,t]]){if(i==null||i===``){n.push(l);continue}if(!p(i))throw TypeError(`encodeFindingRef: ${r} must be a link hint token, not a name`);n.push(i)}return n.every(e=>e===l)?null:n[0]===l?`w${n[1]}`:n.join(``)}function _(e){let t=[e.slice(0,o),e.slice(o)].map(e=>e===l?null:e);return{report:t[0],workspace:t[1]}}function v({id:e,report:n,workspace:r}={}){if(!t(e))throw TypeError(`encodeFindingRef: a persistent finding id is required`);let i=[`finding=${encodeURIComponent(e)}`],a=g(n,r);return a&&i.push(`v=${a}`),i.join(`&`)}function y(e,t){let n=v(e);return typeof location>`u`?`${t??``}#${n}`:`${location.origin}${t??location.pathname}#${n}`}function b(n){let r=typeof n==`string`?n:typeof location>`u`?``:location.hash;if(!r)return null;let i=r.replace(/^#/u,``);if(!i)return null;let a={id:null,report:null,workspace:null};for(let n of i.split(`&`)){let r=n.indexOf(`=`);if(r<0)continue;let i=n.slice(0,r),o=n.slice(r+1);if(!o)continue;if(i===`v`){if(o.length===5&&o[0]===`w`&&p(o.slice(1))){let e=o.slice(1);Object.assign(a,{report:null,workspace:e===l?null:e});continue}if(!c.test(o))continue;Object.assign(a,_(o));continue}if(i!==`finding`||o.length>e*3)continue;let s;try{s=decodeURIComponent(o)}catch{continue}t(s)&&(a.id=s)}return a.id?a:null}function x(e,{managed:t=!1}={}){if(typeof location>`u`)return null;let i;try{i=new URL(e)}catch{return null}if(i.href!==e||i.protocol!==location.protocol||i.host!==location.host||i.username||i.password)return null;let a=r(i);if(a?.finding)return{id:a.finding.id,fragment:v(a.finding),path:n(a)};if(t&&a?.view!==`home`&&!/\/(?:index|view)\.html$/u.test(i.pathname))return null;let o=b(i.hash);if(!o)return null;let s=v(o);return{id:o.id,fragment:s,path:`/#${s}`}}function S(e,t){if(typeof e!=`string`)return!1;let n=e.replaceAll(`\\`,`/`);return n.startsWith(`${t}/`)||n.includes(`/${t}/`)}function C(e){let t=!1;for(let n of e){for(let e of n.groups??[])for(let n of e){if(S(n.file,`node_modules`))return`node_modules`;S(n.file,`vendor`)&&(t=!0)}let e=n.tree?w(n.tree):n.treeDependencies;if(e===`node_modules`)return`node_modules`;e===`vendor`&&(t=!0)}return t?`vendor`:`dependencies`}function w(e){let t=!1;for(let n of Object.keys(e??{})){if(S(n,`node_modules`))return`node_modules`;S(n,`vendor`)&&(t=!0)}return t?`vendor`:null}export{S as a,C as b,m as c,h as d,v as e,y as f,b as g,x as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./chunk-NRPC74AM.js";import{a as t,d as n,f as r,h as i}from"./chunk-7C7DWL7I.js";import{d as a}from"./chunk-PNHBZGDD.js";import{a as o,b as s}from"./chunk-
|
|
1
|
+
import{b as e}from"./chunk-NRPC74AM.js";import{a as t,d as n,f as r,h as i}from"./chunk-7C7DWL7I.js";import{d as a}from"./chunk-PNHBZGDD.js";import{a as o,b as s}from"./chunk-IZ6MYRYB.js";import{c}from"./chunk-PTFQKLKO.js";import{C as l,D as u,G as d,J as f,K as p,L as m,O as h,q as g}from"./chunk-QRKFPLA4.js";import{a as _}from"./chunk-TUII34K2.js";function v(e,t){let n=s([{groups:[e],tree:t.tree,treeDependencies:t.treeDependencies}]);for(let r of e)l(r,t),r.isApp??=g(r,r.source??t.source),r._depsDirectory=n}function y(e,t){return!(e.isApp??g(e,e._source??e.source))&&o(e.file,e._depsDirectory??t??s([{groups:[[e]]}]))}function ee(e,n,r){let i=t(n);return i===`ignored`&&y(e,r)?void 0:i}function b(e,n,a,o){let s=n.id??String(n._id),c=n._reportName??``;y(n,o)&&(a===`ignored`||a===`untriaged`)?(t(e.get(s))!==`ignored`&&r(e,s,{triage:void 0}),i(e,s,c,a===`ignored`,!0)):(r(e,s,{triage:a===`untriaged`?void 0:a}),a!==`ignored`&&a!==`untriaged`&&i(e,s,c,!1))}function x(e,a){let o=new Set;for(let t of e.values()){let e=t?.ignoredReports;if(!e?.length)continue;let r=new Set(e).size!==e.length;for(let i of e)(r||!n(t,i))&&o.add(i)}if(o.size===0)return!1;let c=!1;for(let l of a){let a=(l.groups??[]).flat();if(!a.some(e=>o.has(e._reportName??l.name??l.fileName??``)))continue;let u=s([l]),d=e=>({...e,_source:e._source??e.source??l.source}),f=new Set(a.filter(e=>y(d(e),u)).map(e=>e.id??String(e._id)));for(let o of a){let a=o.id??String(o._id),s=o._reportName??l.name??l.fileName??``,p=e.get(a);p?.ignoredReports?.includes(s)&&(n(p,s)||y(d(o),u)||(t(p)||(c=r(e,a,{triage:`ignored`})||c),f.has(a)||(c=i(e,a,s,!1)||c)))}for(let t of a){if(!y(d(t),u))continue;let n=t.id??String(t._id),r=t._reportName??l.name??l.fileName??``;e.get(n)?.ignoredReports?.includes(r)&&(c=i(e,n,r,!0,!0)||c)}}return c}async function S(e,t){let r=new Set(Object.values(e??{}).flatMap(e=>Array.isArray(e?.ignoredReports)?e.ignoredReports.filter(t=>typeof t==`string`&&!n(e,t)):[])),i=[];for(let e of r){let n;try{let r=await t(e);if(typeof r!=`string`)continue;n=await h(r)}catch{continue}n&&i.push({...n.data,name:e,groups:[n.findings]})}return i}async function C(e,t){if(e!=null&&(typeof e!=`object`||Array.isArray(e)))return{entries:e,changed:!1};let n=new Map(Object.entries(e??{})),r=x(n,await S(e,t));return{entries:Object.fromEntries(n),changed:r}}var w=`links`;function T(e){if(typeof e==`string`)return e.length>0?e:null;if(!e||typeof e!=`object`||Array.isArray(e))return null;let{id:t}=e;return typeof t==`string`&&t.length>0?t:null}function E(e){if(typeof e==`string`&&!/^\s*\[/u.test(e))return null;let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t)||t.length===0)return null;let n=[],r=0;for(let e of t){if(!Array.isArray(e))return null;let t=new Set;for(let n of e){let e=T(n);if(e===null)return null;c(e)?t.add(e):r++}t.size>1&&n.push([...t])}return{groups:n,skipped:r}}function D(e){let t=new Set;for(let n of e)for(let e of n)t.add(e);return t.size}function te(e,t){for(let n of e)for(let e of n){let r=t.get(e);r||t.set(e,r=new Set);for(let t of n)t!==e&&r.add(t)}return t}var O=1,k=16,A=12,j=1+k+A+16,M=1+k+A;async function N(e,t){let n=await crypto.subtle.importKey(`raw`,_(e),`PBKDF2`,!1,[`deriveKey`]);return crypto.subtle.deriveKey({name:`PBKDF2`,hash:`SHA-256`,salt:t,iterations:3e6},n,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}function P(e){return!(e instanceof Uint8Array)||e.length<j?!1:e[0]===O}async function F(e,t){if(!(e instanceof Uint8Array))throw TypeError(`encryptWithPassword: plaintext Uint8Array required`);if(typeof t!=`string`||!t)throw TypeError(`encryptWithPassword: password required`);let n=new Uint8Array(M+e.length+16);n[0]=O,crypto.getRandomValues(n.subarray(1,1+k)),crypto.getRandomValues(n.subarray(1+k,M));let r=n.subarray(1,1+k),i=n.subarray(1+k,M),a=await N(t,r),o=new Uint8Array(await crypto.subtle.encrypt({name:`AES-GCM`,iv:i,additionalData:n.subarray(0,M)},a,e));return n.set(o,M),n}async function ne(e,t){if(typeof t!=`string`||!t)throw TypeError(`tryDecryptWithPassword: password required`);if(!(e instanceof Uint8Array)||e.length<j||e[0]!==O)return{ok:!1,reason:`malformed`};let n=e.subarray(1,1+k),r=e.subarray(1+k,M),i=e.subarray(M),a=await N(t,n),o;try{o=new Uint8Array(await crypto.subtle.decrypt({name:`AES-GCM`,iv:r,additionalData:e.subarray(0,M)},a,i))}catch{return{ok:!1,reason:`wrong-password`}}return{ok:!0,plaintext:o}}async function I(e,t,n){if(!n||typeof n.malformedMsg!=`string`||typeof n.wrongPasswordMsg!=`string`)throw TypeError(`decryptWithPasswordOrThrow: { malformedMsg, wrongPasswordMsg } strings required`);let r=await ne(e,t);if(r.ok)return r.plaintext;throw r.reason===`wrong-password`?Error(n.wrongPasswordMsg):Error(n.malformedMsg)}var L=P,R=F;function z(e,t){return I(e,t,{malformedMsg:`malformed encrypted bundle`,wrongPasswordMsg:`wrong password or corrupt bundle`})}var B=1,V=1024,H=1024,U=200,W=104857600,G=Math.ceil(W*4/3)+16,K=512,q=64;function J(e){if(!e||typeof e!=`object`)return`payload is not an object`;if(e.version!==B)return`unsupported export version: ${e.version}`;if(!e.workspace||typeof e.workspace!=`object`)return`workspace metadata missing`;if(typeof e.workspace.id!=`string`)return`workspace.id must be a string`;if(typeof e.workspace.name!=`string`)return`workspace.name must be a string`;if(typeof e.workspace.privateKey!=`string`)return`workspace.privateKey must be a string`;if(e.workspace.createdAt!==void 0&&!Number.isFinite(e.workspace.createdAt))return`workspace.createdAt must be a finite number or omitted`;if(!Array.isArray(e.reports))return`reports field must be an array`;if(e.reports.length>H)return`reports count (${e.reports.length}) exceeds cap (${H})`;if(e.bundles!==void 0){if(!Array.isArray(e.bundles))return`bundles field must be an array when present`;if(e.bundles.length>V)return`bundles count (${e.bundles.length}) exceeds cap (${V})`;for(let t of e.bundles){if(typeof t!=`string`)return`bundles entries must be strings`;if(t.length>U)return`bundle integrity exceeds per-entry length cap (${U})`}}if(e.bundleBlobs!==void 0){if(!Array.isArray(e.bundleBlobs))return`bundleBlobs field must be an array when present`;if(e.bundleBlobs.length>q)return`bundleBlobs count (${e.bundleBlobs.length}) exceeds cap (${q})`;for(let t of e.bundleBlobs){if(!t||typeof t!=`object`||Array.isArray(t))return`bundleBlobs entries must be objects`;if(typeof t.integrity!=`string`||t.integrity.length===0)return`bundleBlobs.integrity must be a non-empty string`;if(t.integrity.length>U)return`bundleBlobs.integrity exceeds per-entry length cap (${U})`;if(typeof t.name!=`string`||t.name.length===0)return`bundleBlobs.name must be a non-empty string`;if(t.name.length>K)return`bundleBlobs.name exceeds per-entry length cap (${K})`;if(t.name.includes(`\0`))return`bundleBlobs.name cannot contain NUL`;if(typeof t.data!=`string`)return`bundleBlobs.data must be a base64 string`;if(t.data.length>G)return`bundleBlobs.data exceeds per-blob size cap (${W} bytes raw)`}}return null}async function Y(e){return new Uint8Array(await e.arrayBuffer())}async function X(e,t){if(L(e)){if(typeof t!=`string`||!t)throw TypeError(`parseWorkspaceBundleBytes: password required for encrypted bundle`);let n=await z(e,t);try{return Z(await a(n))}catch(e){throw Error(`wrong password or corrupt bundle`,{cause:e})}}let n;try{n=await a(e)}catch(e){throw Error(`gzip decompression failed: ${e.message}`,{cause:e})}return Z(n)}function Z(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`payload is not JSON: ${e.message}`,{cause:e})}let n=J(t);if(n===null)return t;let r=n.includes(`exceeds cap`);throw Error(r?n:`not a deepview workspace export: ${n}`)}function Q(e,t){let n=e.trimStart().startsWith(`[`)?E(e):null;if(n)return{data:{source:`links`,findings:[],links:n.groups},format:`links`,reason:null};let r=m(e);if(r.data!=null||p(e,t)!==`codex`)return r;try{return{data:{type:`security`,source:`codex-security`,findings:d(e).flatMap(e=>e.data.findings)},format:`codex`,reason:null}}catch(e){return{data:null,format:null,reason:e instanceof Error?e.message:`Invalid Codex CSV`}}}function re(e,t){let n=Q(e,t);return n.data==null?Promise.resolve(null):h(JSON.stringify(n.data))}function ie(e){let t=new Set;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;typeof e.file==`string`&&e.file&&t.add(e.file);for(let n of Array.isArray(e.evidence)?e.evidence:[])typeof n?.file==`string`&&n.file&&t.add(n.file)}return t}function $(e){let t=(f(e)??[]).flat().filter(e=>typeof e==`object`&&!!e),n=s([{groups:[t],tree:e?.tree}]);return{directory:n,own:t.filter(e=>!o(e.file,n))}}function ae(e){let t=new Map;for(let n of $(e).own){let e=u(n);e&&t.set(e.toLowerCase(),e)}return t.size===1?[...t.values()][0]:null}function oe(t){let{directory:n,own:r}=$(t);return e([...ie(r)].filter(e=>!o(e,n)))}var se=[`inprogress`,`fixed`,`invalid`,`deleted`,`ignored`];function ce(e){return typeof e==`string`&&se.includes(e)}function le(e){if(e===null)return null;if(typeof e!=`object`||Array.isArray(e))return`invalid`;let t=e,n={},r=t.color;if(r!=null){if(typeof r!=`string`||r.length>50)return`invalid`;r!==``&&(n.color=r)}let i=t.triage;if(i!=null){if(!ce(i))return`invalid`;n.triage=i}for(let e of[`comment`,`fix`]){let r=t[e];if(r!=null){if(typeof r!=`string`||r.length>1e4)return`invalid`;r!==``&&(n[e]=r)}}let a=t.flagged;if(a!=null){if(typeof a!=`boolean`)return`invalid`;n.flagged=a}return n}export{v as a,y as b,ee as c,b as d,x as e,S as f,C as g,w as h,E as i,D as j,te as k,F as l,I as m,L as n,R as o,H as p,Y as q,X as r,Z as s,Q as t,re as u,ae as v,oe as w,le as x};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ka as e}from"./chunk-
|
|
1
|
+
import{Ka as e}from"./chunk-ZFXCWNXC.js";import{m as t,p as n,v as r}from"./chunk-CGKPGHST.js";import{a as i}from"./chunk-WCPJDAYA.js";import{b as a}from"./chunk-IYPY47MC.js";import{D as o,J as s,L as c,q as l}from"./chunk-QRKFPLA4.js";function u(e){let{data:t}=c(e);return t&&d(t)>0?t:null}function d(e){return(s(e)??[]).filter(t=>(Array.isArray(t)?t:[t]).some(t=>t&&typeof t==`object`&&l(t,t.source??e.source))).length}function f(e,t){let n=[],r=new Map;for(let{name:t,content:i,fallbackRepo:a}of e){if(typeof i!=`string`)continue;let e=u(i);if(!e)continue;let c=s(e),l=o(e)??o({repo:{github:a}}),f=new Set(l?[l]:[]);if(!l)for(let e of c.flat()){if(/(?:^|\/)(?:node_modules|dependencies)\//u.test(e?.file??``))continue;let t=o(e);t&&f.add(t)}for(let e of f)r.set(e,{id:e,label:e});n.push({id:t,filename:t,repoIds:[...f],analyzer:e.source,appFindings:d(e)})}let i=new Set(n.map(e=>e.id));return{merge:{bundles:[],results:[]},link:{reports:n,repositories:[...r.values()],workspaces:t.map(e=>({id:e.id,label:e.name,reports:e.reports.filter(e=>i.has(e))})).filter(e=>e.reports.length>0)}}}function p(e,t){let n=(e.reports??[]).filter(e=>e.visible&&e.repoId!=null).flatMap(e=>{let t=u(e.content??``);return t?[{id:e.id,filename:e.filename,repoIds:[e.repoId],repo:e.repoFullName,directory:e.repoDirectory,analyzer:e.analyzer,appFindings:d(t)}]:[]}),r=new Map((e.repos??[]).map(e=>[e.repoId,{id:e.repoId,label:e.fullName}]));for(let e of n)r.has(e.repoIds[0])||r.set(e.repoIds[0],{id:e.repoIds[0],label:e.repo??String(e.repoIds[0])});let a=t.results??[],o=new Set(a.map(e=>e.bundleId));return{merge:{bundles:(t.bundles??[]).filter(e=>o.has(e.id)).map(e=>({...e,size:i(e.byteSize)})),results:a},link:{repositories:[...r.values()].filter(e=>n.some(t=>t.repoIds.includes(e.id))),reports:n}}}var m=new Map([[`openai/gpt-6-astra`,`GPT-6 Astra`],[`openai/gpt-6-astra-pro`,`GPT-6 Astra Pro`],[`openai/gpt-5.6-sol`,`GPT-5.6 Sol`],[`openai/gpt-5.6-terra`,`GPT-5.6 Terra`],[`openai/gpt-5.6-luna`,`GPT-5.6 Luna`],[`anthropic/claude-fable-5.1`,`Claude Fable 5.1`],[`anthropic/claude-opus-5`,`Claude Opus 5`],[`anthropic/claude-sonnet-5`,`Claude Sonnet 5`],[`moonshotai/kimi-k3`,`Kimi K3`],[`z-ai/glm-5.3`,`GLM 5.3`],[`qwen/qwen3.8-max`,`Qwen3.8 Max`],[`deepseek/deepseek-v4.1-flash`,`DeepSeek V4.1 Flash`],[`deepseek/deepseek-v4-pro`,`DeepSeek V4 Pro`]]),h=new Map([[`openai`,`OpenAI`],[`anthropic`,`Anthropic`],[`moonshotai`,`Moonshot AI`],[`google`,`Google`],[`nvidia`,`NVIDIA`],[`qwen`,`Qwen`],[`deepseek`,`DeepSeek`],[`x-ai`,`xAI`],[`z-ai`,`Z.ai`],[`mistralai`,`Mistral AI`],[`meta`,`Meta`],[`unbiased`,`Unbiased`]]),g=new Map([[`meta-llama`,`meta`]]),_=new Map([[`gpt`,`GPT`],[`gptoss`,`GPT OSS`],[`oss`,`OSS`],[`o`,`O`],[`ai`,`AI`],[`api`,`API`],[`4o`,`4o`],[`k3`,`K3`],[`k4`,`K4`],[`qwen`,`Qwen`],[`kimi`,`Kimi`],[`mimo`,`MiMo`],[`gemini`,`Gemini`],[`claude`,`Claude`],[`fable`,`Fable`],[`opus`,`Opus`],[`sonnet`,`Sonnet`],[`astra`,`Astra`],[`terra`,`Terra`],[`luna`,`Luna`],[`codex`,`Codex`],[`deepseek`,`DeepSeek`],[`nemotron`,`Nemotron`],[`gemma`,`Gemma`]]);function v(e){let t=e.replace(/:free$/u,``).replaceAll(`_`,`-`).split(`-`).filter(Boolean),n=[];for(let e=0;e<t.length;e++){let r=t[e],i=t[e+1];if(/^\d+$/u.test(r)&&/^\d+$/u.test(i??``)){n.push(`${r}.${i}`),e++;continue}let a=_.get(r.toLowerCase());n.push(a??(/^(?:[a-z]+\d+|\d+[a-z]+)$/iu.test(r)?r.toUpperCase():r[0]?.toUpperCase()+r.slice(1)))}return n.join(` `).replace(/^GPT (\d)/u,`GPT-$1`)}function y(e){return m.get(e)??v(e.includes(`/`)?e.slice(e.indexOf(`/`)+1):e)}function b(e){let t=e.includes(`/`)?e.split(`/`)[0].replace(/^~/u,``):`other`,n=g.get(t)??t;return{key:n,name:h.get(n)??(n===`other`?`Other`:v(n))}}function x(e){return e===`xhigh`?`Extra high`:e?e[0].toUpperCase()+e.slice(1):`Unavailable`}function S(e){return e.efforts.includes(`max`)?`max`:e.efforts.at(-1)??null}async function C(e,t=fetch){let n=await t(`/api/admin/scan/models`,{credentials:`same-origin`,headers:{accept:`application/json`},signal:e});if(!n.ok)throw Error(`HTTP ${n.status}`);return w(await n.json())}function w(e){if(!Array.isArray(e?.models))throw Error(`No model catalogue returned`);let t=e.models.filter(e=>typeof e?.id==`string`&&e.id.length>0).map(e=>({id:e.id,efforts:Array.isArray(e.efforts)?[...new Set(e.efforts.filter(e=>typeof e==`string`&&e.length>0))]:[]}));if(t.length===0)throw Error(`No models available`);return{models:t,defaultModel:t.find(t=>t.id===e.defaultModel)?.id??t[0].id}}function T(e,t=[]){let n=new Map,r=e.flatMap(e=>{let r=t.filter(t=>t.bundles?.includes(e.integrity));return(r.length>0?r.map(e=>({id:e.id,label:e.name})):[{id:`unattached`,label:`Unattached`}]).map(t=>(n.set(t.id,t),{id:e.integrity,integrity:e.integrity,filename:e.name,repoId:t.id,repo:t.label,files:null,reasons:[],size:`—`}))});return{repositories:[...n.values()],bundles:r,reports:[],scans:[]}}function E(o,s){if(s.error)throw Error(s.error);let c=n(s),l=s.kind===`stasis`?s.bundle?.formats:null,u=r(s),d=[...t(s)].filter(([,e])=>e!=null).map(([e,t])=>({path:e,format:l?.get(e)??null,bytes:t,lines:u.get(e)??0,size:i(t),module:a(e,{packageDir:c?.get(e)})})),f=[{id:`all`,label:`All`,filePaths:null},...[...e(s,d.map(e=>e.path))].map(([e,t])=>({id:`reason:${e}`,label:e,filePaths:[...t]}))];return{...o,files:d,reasons:f,size:i(s.size)}}export{T as a,E as b,f as c,p as d,y as e,b as f,x as g,S as h,C as i,w as j};
|