@preventive/triage 1.0.0-alpha.43 → 1.0.0-alpha.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/common/bundle-compare-diff.js +2 -167
  2. package/common/bundle-compare-versions.js +172 -0
  3. package/common/bundle-comparison.d.ts +8 -0
  4. package/common/bundle-comparison.js +62 -0
  5. package/common/bundle-sources.js +20 -1
  6. package/common/default-scan-models.ts +1 -1
  7. package/common/dependency-reviews.d.ts +0 -5
  8. package/common/dependency-reviews.js +0 -17
  9. package/common/managed/agent-tasks.ts +292 -0
  10. package/common/managed/github-agents.ts +92 -0
  11. package/common/managed/github-logins.ts +49 -0
  12. package/common/managed/roles.ts +7 -0
  13. package/common/managed/routes.js +91 -10
  14. package/common/managed/team-app.d.ts +5 -2
  15. package/common/managed/team-app.js +2 -2
  16. package/common/server-info.ts +11 -0
  17. package/common/workspace-app.js +19 -3
  18. package/out/brotli-fallback.js +3 -3
  19. package/out/chunk-2XUEZHIP.js +18 -18
  20. package/out/chunk-2ZDZWLFY.js +1 -0
  21. package/out/chunk-3PS4KWD2.js +10 -0
  22. package/out/chunk-5DHL5NG3.js +2 -0
  23. package/out/chunk-6HNXNIQY.js +52 -0
  24. package/out/chunk-7C7DWL7I.js +1 -0
  25. package/out/chunk-AFLZH7WG.js +1 -0
  26. package/out/chunk-BC2UCLFJ.js +1 -0
  27. package/out/chunk-C4Z6ZBXV.js +6 -6
  28. package/out/chunk-GDPCLSOS.js +2 -0
  29. package/out/chunk-GO7FT4OD.js +1 -0
  30. package/out/chunk-HMAJDVXN.js +1 -0
  31. package/out/chunk-I2MDGSQX.js +3 -0
  32. package/out/chunk-IYPY47MC.js +1 -0
  33. package/out/chunk-IZ7POWI3.js +18 -0
  34. package/out/chunk-JCIIBLKR.js +1 -0
  35. package/out/chunk-NPW52BM2.js +17 -0
  36. package/out/chunk-NRPC74AM.js +1 -1
  37. package/out/chunk-NV7ES4EW.js +1 -0
  38. package/out/chunk-OKRLLE5I.js +17 -0
  39. package/out/chunk-OOJM4CTU.js +1 -1
  40. package/out/chunk-PNHBZGDD.js +1 -1
  41. package/out/chunk-PTGDYLNS.js +36 -0
  42. package/out/chunk-PXK7EU4V.js +1 -0
  43. package/out/chunk-Q6MVYGYV.js +3 -0
  44. package/out/chunk-QB4CBOX2.js +1 -0
  45. package/out/chunk-QRD6GIG5.js +229 -0
  46. package/out/chunk-R3NZFXVR.js +1 -0
  47. package/out/chunk-R5O6FAW4.js +1 -1
  48. package/out/chunk-SXV2T5C4.js +80 -0
  49. package/out/chunk-TUII34K2.js +1 -1
  50. package/out/chunk-VFWMQ3LG.js +2 -0
  51. package/out/chunk-VH4XMZIW.js +2 -0
  52. package/out/chunk-WFYLMF6Z.js +10 -0
  53. package/out/chunk-WI7Z5A2T.js +6 -0
  54. package/out/chunk-WQ74ZBZF.js +7 -0
  55. package/out/chunk-XVBEOGOS.js +3 -0
  56. package/out/client-managed-import.js +3 -3
  57. package/out/client-managed.js +31 -35
  58. package/out/client-sync.js +11 -11
  59. package/out/compare.js +35 -0
  60. package/out/dialogs.js +51 -0
  61. package/out/github-issue-authorized.html +1 -1
  62. package/out/github-issue-authorized.js +1 -1
  63. package/out/graph.js +17 -17
  64. package/out/index.html +31 -31
  65. package/out/prism.js +14 -14
  66. package/out/scan.js +2 -0
  67. package/out/terminal.js +294 -293
  68. package/out/view.css +1 -1
  69. package/out/view.js +16 -107
  70. package/package.json +55 -6
  71. package/risk/actions/findings.js +156 -0
  72. package/risk/actions/resolve.js +219 -0
  73. package/risk/actions/scripts/commands.js +182 -0
  74. package/risk/actions/scripts/grade.js +113 -0
  75. package/risk/actions/scripts/packages.js +123 -0
  76. package/risk/actions/scripts/shell.js +165 -0
  77. package/risk/actions/uses.js +76 -0
  78. package/risk/actions/workflow.js +110 -0
  79. package/risk/files/hosts.js +6 -6
  80. package/risk/files/readability.js +23 -17
  81. package/risk/files/runs-code.js +18 -6
  82. package/risk/files/script.js +7 -3
  83. package/risk/files/stamps.js +8 -7
  84. package/risk/index.d.ts +68 -1
  85. package/risk/index.js +6 -2
  86. package/risk/npm/assess.js +13 -8
  87. package/risk/npm/compare.js +34 -10
  88. package/risk/npm/dependencies.js +11 -0
  89. package/risk/npm/files.js +413 -2
  90. package/risk/npm/tarball.js +56 -73
  91. package/server-managed/agent-merges.ts +198 -0
  92. package/server-managed/app-agents.ts +30 -0
  93. package/server-managed/avatar-store.ts +1 -0
  94. package/server-managed/commit-coauthors.ts +83 -0
  95. package/server-managed/commit-lockfiles.ts +62 -0
  96. package/server-managed/comparison.ts +41 -0
  97. package/server-managed/db-methods.ts +29 -10
  98. package/server-managed/db-neon.ts +30 -2
  99. package/server-managed/db-schema.ts +9 -2
  100. package/server-managed/db.ts +7 -0
  101. package/server-managed/dependabot-access.ts +60 -0
  102. package/server-managed/dependabot-alerts.ts +185 -0
  103. package/server-managed/dependency-review-comments.ts +97 -0
  104. package/server-managed/dependency-reviews.ts +65 -15
  105. package/server-managed/github-accounts.ts +33 -0
  106. package/server-managed/github-actions.ts +71 -0
  107. package/server-managed/github-app.ts +23 -9
  108. package/server-managed/github-errors.ts +2 -0
  109. package/server-managed/github-link-oauth.ts +69 -0
  110. package/server-managed/github-links.ts +204 -0
  111. package/server-managed/github-oauth.ts +5 -2
  112. package/server-managed/github-users.ts +30 -0
  113. package/server-managed/http.ts +1219 -81
  114. package/server-managed/index.ts +6 -2
  115. package/server-managed/locked-packages.ts +48 -16
  116. package/server-managed/lockfile-scope.ts +49 -0
  117. package/server-managed/npm-delta-worker.js +23 -0
  118. package/server-managed/npm-delta.ts +173 -0
  119. package/server-managed/npm-insights.ts +20 -11
  120. package/server-managed/npm-kept.ts +51 -4
  121. package/server-managed/npm-loads.ts +20 -13
  122. package/server-managed/npm-packages.ts +24 -64
  123. package/server-managed/pretty-print.ts +14 -9
  124. package/server-managed/public-workspace.ts +26 -8
  125. package/server-managed/pull-comment-reviews.ts +161 -0
  126. package/server-managed/pull-dependencies.ts +280 -0
  127. package/server-managed/pull-dependency-reviews.ts +318 -0
  128. package/server-managed/pull-reviews.ts +205 -0
  129. package/server-managed/release-commits.ts +84 -0
  130. package/server-managed/repository-actions.ts +209 -0
  131. package/server-managed/repository-agents.ts +220 -0
  132. package/server-managed/repository-browser.ts +54 -13
  133. package/server-managed/repository-changes.ts +284 -0
  134. package/server-managed/repository-code.ts +52 -0
  135. package/server-managed/repository-dependency-reviews.ts +135 -0
  136. package/server-managed/repository-history.ts +445 -0
  137. package/server-managed/repository-issues.ts +181 -0
  138. package/server-managed/repository-pulse.ts +432 -0
  139. package/server-managed/repository-risk-read.ts +165 -0
  140. package/server-managed/repository-risk.ts +116 -106
  141. package/server-managed/reviewed-dependencies.ts +149 -0
  142. package/server-managed/session.ts +9 -5
  143. package/server-managed/sql.ts +1 -1
  144. package/server-managed/storage-stores.ts +5 -0
  145. package/server-managed/team-app.ts +54 -14
  146. package/server-managed/workspace-shares.ts +4 -1
  147. package/server.ts +11 -0
  148. package/out/chunk-2KBF5TZ7.js +0 -2
  149. package/out/chunk-35VE6CDH.js +0 -2
  150. package/out/chunk-3BZ7JERB.js +0 -1
  151. package/out/chunk-4F6JSF57.js +0 -3
  152. package/out/chunk-4XCDFGDP.js +0 -10
  153. package/out/chunk-7RU5EDRO.js +0 -226
  154. package/out/chunk-A7M4GV7M.js +0 -1
  155. package/out/chunk-CLPKNNC7.js +0 -51
  156. package/out/chunk-CMQA4DM6.js +0 -1
  157. package/out/chunk-CVVJAXVY.js +0 -2
  158. package/out/chunk-DIJJNTRH.js +0 -10
  159. package/out/chunk-GJ4IUCNS.js +0 -1
  160. package/out/chunk-GNXOKIGP.js +0 -80
  161. package/out/chunk-GZ4MS3TE.js +0 -13
  162. package/out/chunk-IU3CCINR.js +0 -3
  163. package/out/chunk-K3X5EJBQ.js +0 -2
  164. package/out/chunk-KEX2ATEW.js +0 -2
  165. package/out/chunk-KYCNJVB7.js +0 -1
  166. package/out/chunk-LAAB5SZT.js +0 -2
  167. package/out/chunk-NWZ4PVPN.js +0 -1
  168. package/out/chunk-OSIMGFUF.js +0 -1
  169. package/out/chunk-RFZQQXSG.js +0 -17
  170. package/out/chunk-RSHMVYNS.js +0 -1
  171. package/out/chunk-TZ5KB2Y5.js +0 -10
  172. package/out/chunk-UNTRGE26.js +0 -2
  173. package/out/chunk-UXNUAIIC.js +0 -33
  174. package/out/chunk-UYAXVRVL.js +0 -1
  175. package/out/chunk-V3ME6FI5.js +0 -2
  176. package/out/chunk-V5O7M2YT.js +0 -1
  177. package/out/chunk-VIHGO77Y.js +0 -1
  178. package/out/chunk-VQJCXGIY.js +0 -7
  179. package/out/chunk-W4J3MGLB.js +0 -1
  180. package/out/chunk-WGG7KQUH.js +0 -1
  181. package/out/chunk-WZDTZE64.js +0 -1
  182. package/out/chunk-XOCAPDCM.js +0 -1
  183. package/out/chunk-XYFXXB2G.js +0 -10
  184. package/out/chunk-YVZH5SHP.js +0 -1
  185. package/out/chunk-ZBBOBQ43.js +0 -1
  186. package/out/chunk-ZMQQCGF6.js +0 -2
@@ -0,0 +1 @@
1
+ var e={view:`.bundle-code-view`,pane:`.bundle-code-rail`,property:`--bundle-code-rail-width`,axis:`x`,grow:1,keys:{ArrowLeft:-16,ArrowRight:16},initial:()=>320,bounds:e=>({min:Math.min(180,e*.4),max:e*.6}),preferred:null},t={view:`.bundle-code-main`,pane:`.bundle-code-terminal`,property:`--bundle-code-terminal-height`,axis:`y`,grow:-1,keys:{ArrowUp:16,ArrowDown:-16},initial:e=>e*.4,bounds:e=>({min:Math.min(96,e*.4),max:e*.85}),preferred:null},n=class extends HTMLElement{static split=e;constructor(){super(),this._split=this.constructor.split,this._drag=null,this.addEventListener(`pointerdown`,e=>this._startDrag(e)),this.addEventListener(`pointermove`,e=>{this._drag?.id===e.pointerId&&(this._split.preferred=this._apply(this._drag.size+this._split.grow*(this._client(e)-this._drag.at)))});for(let e of[`pointerup`,`pointercancel`,`lostpointercapture`])this.addEventListener(e,e=>{this._drag?.id===e.pointerId&&this._endDrag()});this.addEventListener(`keydown`,e=>this._onKeyDown(e)),this.addEventListener(`dblclick`,()=>{this._split.preferred=null,this._apply(this._preferred())})}connectedCallback(){this._view=this.closest(this._split.view),this._view&&(this._observer=new ResizeObserver(()=>this._apply(this._preferred())),this._observer.observe(this._view),this._apply(this._preferred()))}disconnectedCallback(){this._observer?.disconnect(),this._endDrag(),this._view=null}_client(e){return this._split.axis===`x`?e.clientX:e.clientY}_measure(e){let t=e.getBoundingClientRect();return this._split.axis===`x`?t.width:t.height}_preferred(){return this._split.preferred??this._split.initial(this._view?this._measure(this._view):0)}_bounds(){return this._split.bounds(this._measure(this._view))}_apply(e){if(!this._view)return e;let{min:t,max:n}=this._bounds();if(n===0)return e;let r=Math.max(t,Math.min(n,e));return this._view.style.setProperty(this._split.property,`${r}px`),this.setAttribute(`aria-valuemin`,String(Math.round(t))),this.setAttribute(`aria-valuemax`,String(Math.round(n))),this.setAttribute(`aria-valuenow`,String(Math.round(r))),this.setAttribute(`aria-valuetext`,`${Math.round(r)} pixels`),r}_paneSize(){return this._measure(this._view.querySelector(this._split.pane))}_startDrag(e){e.button!==0||!e.isPrimary||this._drag||!this._view||(e.preventDefault(),this._drag={id:e.pointerId,at:this._client(e),size:this._paneSize(),view:this.closest(`.bundle-code-view`)},this.setPointerCapture(e.pointerId),this.classList.add(`dragging`),this._drag.view?.classList.add(`splitting`))}_endDrag(){if(!this._drag)return;let{id:e,view:t}=this._drag;this._drag=null,this.classList.remove(`dragging`),t?.classList.remove(`splitting`),this.hasPointerCapture(e)&&this.releasePointerCapture(e)}_onKeyDown(e){if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||!this._view)return;let{min:t,max:n}=this._bounds(),r=this._split.keys[e.key],i=r===void 0?{Home:t,End:n}[e.key]:this._paneSize()+r;i!==void 0&&(e.preventDefault(),e.stopPropagation(),this._split.preferred=this._apply(i))}};customElements.define(`bundle-code-splitter`,n),customElements.define(`bundle-code-terminal-splitter`,class extends n{static split=t});
@@ -1,2 +1,2 @@
1
1
  var e=`.detail-action{width:22px;height:22px;display:grid;place-items:center;padding:0;background:transparent;border:0;border-radius:var(--ui-radius, 4px);color:var(--muted);font:500 16px/1 ui-monospace,monospace;cursor:default;&:hover{color:var(--accent);background:var(--surface-active)}&:focus-visible{outline:2px solid var(--accent);outline-offset:1px}}
2
- `;export{e as a};
2
+ `;export{e as a};
@@ -0,0 +1,80 @@
1
+ var e=new TextEncoder;function t(t){if(typeof t!=`string`)throw TypeError(`encodeUtf8 expects a string, got ${typeof t}`);if(!t.isWellFormed())throw TypeError(`encodeUtf8: input contains lone surrogates`);return e.encode(t)}async function n(e){let n=typeof e==`string`?t(e):e,r=new Uint8Array(await crypto.subtle.digest(`SHA-512`,n));return`sha512-${btoa(String.fromCodePoint(...r))}`}async function r(e){let n=t(JSON.stringify(e)),r=await crypto.subtle.digest(`SHA-256`,n),i=new Uint8Array(r,0,16);i[6]=i[6]&15|64,i[8]=i[8]&63|128;let a=Array.from(i,e=>e.toString(16).padStart(2,`0`)).join(``);return`${a.slice(0,8)}-${a.slice(8,12)}-${a.slice(12,16)}-${a.slice(16,20)}-${a.slice(20,32)}`}async function i(e){if(typeof crypto?.subtle?.digest!=`function`)return null;let t=a(e);try{return await r(t)}catch{return null}}function a(e){if(e._idBasis)return e._idBasis;let{severity:t,description:n}=e;return e.fileHash?{severity:t,description:n,fileHash:e.fileHash}:e.location?{severity:t,description:n,location:e.location}:{severity:t,description:n,file:e.file,line:e.line}}var o=new Map([[`CRITICAL`,`critical`],[`HIGH`,`high`],[`MEDIUM`,`medium`],[`LOW`,`low`],[`INFO`,`informational`],[`INFORMATIONAL`,`informational`],[`INFORMATIVE`,`informative`]]);function s(e){return typeof e==`string`&&e.trim().toLowerCase()===`informative`?`informational`:e}function c(e,t=e.severity){let n=s(e.severity);return n!==e.severity&&(!e.id&&!e._idBasis&&(e._idBasis=a({...e,severity:t})),e.severity=n),e.correctedSeverity!==void 0&&(e.correctedSeverity=s(e.correctedSeverity)),e}var l={critical:`Critical`,high:`High`,medium:`Medium`,low:`Low`,high_bug:`High bug`,bug:`Bug`,informational:`Informational`},u={inprogress:`In progress`,fixed:`Fixed`,invalid:`Invalid`,deleted:`Deleted`,ignored:`Ignored`},d={red:`Red`,blue:`Blue`,green:`Green`,gray:`Gray`,none:`Unmarked`},f={"claude-security":`Claude Security`,"codex-security":`Codex Security`,deepsec:`DeepSec`,piolium:`Piolium`,"markdown-generic":`Markdown (generic)`};function p(e){return l[s(e)]??String(e??``)}var m=/^( *)(`{3,}|~{3,})(.*)$/u,h=/^ {0,3}(?:#{1,6}(?:[ \t]|$)|>|([-*_])(?:[ \t]*\1){2,}[ \t]*$)/u,g=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/u,_=/^ {0,3}(?:=+|-+)[ \t]*$/u,v=/^( *)(?:[-*+]|\d{1,9}[.)]) +(?=\S)/u,ee=/^ *(?:[-*+]|\d{1,9}[.)])[ \t]*$/u,y=/^\s*$/u,te=[[/^<(script|pre|textarea|style)(?:\s|>|$)/iu,/<\/(?:script|pre|textarea|style)>/iu,e=>`</${e[1].toLowerCase()}>`],[/^<!--/u,/-->/u,`-->`],[/^<\?/u,/\?>/u,`?>`],[/^<![A-Za-z]/u,/>/u,`<!-- -->`],[/^<!\[CDATA\[/u,/\]\]>/u,`]]>`],[/^<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|search|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/iu,y,null]],ne=/^(?:<[A-Za-z][\dA-Za-z-]*(?:\s+[:A-Z_a-z][\w.:-]*(?:\s*=\s*(?:[^\s"'<=>`]+|'[^']*'|"[^"]*"))?)*\s*\/?>|<\/[A-Za-z][\dA-Za-z-]*\s*>)\s*$/u;function b(e,t,n=t){let r=/^ */u.exec(e)[0].length;if(r>3)return null;if(t&&n&&_.test(e))return!0;let i=m.exec(e);if(i&&!(i[2][0]==="`"&&i[3].includes("`")))return{fence:i[2]};let a=e.slice(r);for(let[e,t,n]of te){let r=e.exec(a);if(r)return{html:t,close:typeof n==`function`?n(r):n}}if(!t&&ne.test(a))return{html:y,close:null};let o=g.test(e)?null:v.exec(e);if(o&&!(t&&n&&/^ *(?:\d*[02-9]|\d+\d)[.)]/u.test(o[0]))){let e=/ +$/u.exec(o[0])[0].length;return{item:e>4?o[0].length-e+1:o[0].length}}let s=g.test(e)||t&&n?null:ee.exec(e);return s?{item:s[0].trimEnd().length+1}:h.test(e)||null}function x(e){return ie(e).ranges}function re(e,t){let n=e.replace(/^(?: {0,3}> ?)+/u,``),r=b(n,t);for(;r?.item;)n=n.slice(r.item),r=b(n,!1);return n.trim()!==``&&!r&&/^ */u.exec(n)[0].length<4}function ie(e){let t=[],n=-1,r=``,i=null,a=0,o=[],s=!1,c=!1,l=!1,u=0;for(let d of e.split(`
2
+ `)){let e=u;u+=d.length+1;let f=/^ */u.exec(d)[0].length;if(n!==-1||i){let o=a>0&&d.trim()!==``&&f<a,s=!o&&(i?i.ends.test(d):f<=a+3&&ae(r,d));if((o||s)&&(n!==-1&&t.push([n,o?e-1:e+d.length]),n=-1,i=null),!o)continue}if(!d.trim()){l&&o.pop(),l=!1,s=!1;continue}let p=o.length;for(;p>0&&f<o[p-1];)p--;let m=p>0?o[p-1]:0,h=d.slice(m),g=b(h,s,p===o.length&&!c);if(s&&!g)continue;for(o.length=p;g?.item;)m+=g.item,h=h.slice(g.item),o.push(m),g=b(h,!1);l=h.trim()===``,g?.fence?[n,r,a]=[e,g.fence,m]:g?.html&&([i,a]=[g.html.test(h)?null:{ends:g.html,close:g.close},m]);let _=s&&c;c=/^ {0,3}>/u.test(h),s=c?re(h,_):!g&&!l&&/^ */u.exec(h)[0].length<4}n!==-1&&t.push([n,e.length]);let d=n===-1?i?.close:r;return{ranges:t,closer:d?` `.repeat(a)+d:null}}function ae(e,t){let n=m.exec(t);return n!==null&&n[2][0]===e[0]&&n[2].length>=e.length&&!n[3].trim()}function S(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i][1]<=t?n=i+1:r=i}return n<e.length&&t>=e[n][0]}function C(e){return String(e??``).replaceAll(/\r\n?/gu,`
3
+ `)}var oe=/^## +(.*)$/gmu,se=/^### +(.*)$/gmu,w=/^#### +(.*)$/gmu,ce=/^##### +(.*)$/gmu,le=/^(.+):(\d+(?:-\d+)?)$/u;function T(e){return/^[0-9a-f]{7,64}$/iu.test(e)}function ue(e,t){let n=x(e);return[...e.matchAll(t)].filter(e=>!S(n,e.index))}function de(e,t){let n=ue(e,t);return[e.slice(0,n[0]?.index),...n.map((t,r)=>e.slice(t.index+t[0].length,n[r+1]?.index))]}function E(e,t){let n=ue(e,t);return{head:e.slice(0,n[0]?.index),subs:n.map((t,r)=>({heading:t[1],body:e.slice(t.index+t[0].length+1,n[r+1]?.index)}))}}function D(e,t){return E(e,t).subs}function O(e){let t=e.indexOf(`
4
+ `);return t===-1?{title:e.trim(),body:``}:{title:e.slice(0,t).trim(),body:e.slice(t+1)}}function fe(e){let t=e.split(`
5
+ `).map(e=>e.trim()).filter(e=>e.startsWith(`|`)&&!(/^[\s:|-]+$/u.test(e)&&e.includes(`-`))).map(e=>e.replace(/^\|/u,``).replace(/\|$/u,``).split(`|`).map(e=>e.trim()));if(t.length<2)return[];let n=t[0].map(e=>e.toLowerCase());return t.slice(1).filter(e=>e.length!==n.length||e.some((e,t)=>e.toLowerCase()!==n[t])).map(e=>Object.fromEntries(n.flatMap((t,n)=>t?[[t,e[n]??``]]:[])))}function pe(e){let t=Object.create(null),n=Object.create(null),r=[],i=null,a=``,o=[],s=``,c=(e,r,i)=>{!e||e in t||(t[e]=i.trim(),n[e]=r)},l=()=>{i&&c(i,a,o.join(`
6
+ `)),i=null,a=``,o=[]},u=e=>{(i?o:r).push(e)};for(let t of e.split(`
7
+ `)){let e=/^ {0,3}(```|~~~)/u.exec(t),n=e!==null&&(!s||e[1]===s);if(n&&(s=s?``:e[1]),n||s){u(t);continue}if(!t.trim()){i?l():r.push(t);continue}let d=/^\s*(?:[-*] +)?\*\*([^:*]+):\*\*\s*(.*)$/u.exec(t);if(d){l();let e=d[1].trim(),t=d[2],n;for(;(n=/\s+[\u00B7\u2022]\s+\*\*([^:*]+):\*\*\s*/u.exec(t))!==null;)c(e.toLowerCase(),e,t.slice(0,n.index)),e=n[1].trim(),t=t.slice(n.index+n[0].length);i=e.toLowerCase(),a=e,o=[t];continue}if(/^\s*(?:#{1,6} |\||[-=*_]{3,}\s*$)/u.test(t)){l();continue}u(t)}return l(),{fields:t,labels:n,prose:r.join(`
8
+ `).trim()}}function me(e){let t=(e||``).trim(),n=``,r=k(t);r&&(t=r.label.trim(),n=r.url.trim());let i=/#L(\d+)/u.exec(n)?.[1]??``,a=[...t.matchAll(/`([^`]+)`/gu)].map(e=>e[1].trim()).find(e=>!e.includes(`(`)&&(e.includes(`/`)||/\.\w/u.test(e)))??(t.replaceAll("`",``).trim().split(/[\s,]+/u).find(Boolean)||``),o=/^(.*?)#L(\d+)(?:-L?\d+)?$/u.exec(a);o&&(a=o[1],i||=o[2]);let s=le.exec(a);return s?(i||=s[2],{file:s[1],line:i,locationLink:n}):{file:a,line:i||`?`,locationLink:n}}function he(e){return e.replaceAll(`**`,``)}function k(e){let t=String(e??``),n=ge(t,_e(t)),r=ve(t),i=t.indexOf(`]`);for(let e=t.indexOf(`[`);e!==-1;e=t.indexOf(`[`,e+1)){for(;i!==-1&&i<=e;)i=t.indexOf(`]`,i+1);for(let a of[i,n.get(e)??-1]){if(a===-1||a===e+1||t[a+1]!==`(`)continue;let n=ye(t,a+1,r);if(n!==null)return{label:t.slice(e+1,a),url:n,index:e}}}return null}function ge(e,t){let n=new Map,r=[];for(let i=0;i<e.length;i++){let a=e[i];Ce(e,i)?i++:a==="`"?i=t.get(i)??i:a===`[`?r.push(i):a===`]`&&r.length>0&&n.set(r.pop(),i)}return n}function _e(e){let t=[];for(let n=e.indexOf("`");n!==-1;n=e.indexOf("`",n)){let r=1;for(;e[n+r]==="`";)r++;t.push([n,r]),n+=r}let n=new Map,r=new Map;for(let e=t.length-1;e>=0;e--){let[i,a]=t[e],o=r.get(a);o!==void 0&&n.set(i,o+a-1),r.set(a,i)}return n}function ve(e){let t=e.length,n=new Int32Array(t+1).fill(-1),r=new Int32Array(t+1).fill(-1),i=new Int32Array(t+1).fill(-1),a=new Int32Array(t+1).fill(-1);for(let o=t-1;o>=0;o--)n[o]=e[o]===`)`?o:n[o+1],r[o]=/\s/u.test(e[o])?o:r[o+1],i[o]=e[o]===`>`?o:i[o+1],a[o]=e[o]===`
9
+ `?o:a[o+1];let o=new Map,s=[];for(let n=0;n<t;n++){let t=e[n];Ce(e,n)?n++:r[n]===n?s.length=0:t===`(`?s.push(n):t===`)`&&s.length>0&&o.set(s.pop(),n)}return{balanced:o,nextClose:n,nextSpace:r,nextAngle:i,nextLine:a}}function ye(e,t,n){let r=be(e,t,n);if(r)return r;let i=n.balanced.get(t);if(i!==void 0)return i>t+1?e.slice(t+1,i):null;let a=n.nextClose[t+1],o=n.nextSpace[t+1];return a===-1||a===t+1||o!==-1&&o<a?null:e.slice(t+1,a)}function be(e,t,n){if(e[t+1]!==`<`)return``;let r=n.nextAngle[t+2],i=n.nextLine[t+2];return r===-1||i!==-1&&i<r||e[r+1]!==`)`?``:e.slice(t+2,r)}var xe=/\\([!-/:-@[-`{-~])/gu,Se=/[!-/:-@[-`{-~]/u;function Ce(e,t){return e[t]===`\\`&&Se.test(e[t+1]??``)}function we(e){return typeof e==`string`?e.replace(xe,`$1`):e}function Te(e){let t=/^\[(.+)\]$/u.exec(e.trim());return t?t[1].trim():e.trim()}function A(e){let t=(e||``).trim();return/^[-\u2013\u2014]+$/u.test(t)?``:t}var Ee={critical:6,high:5,medium:4,low:3,high_bug:2,bug:1,informational:0},j=[`critical`,`high`,`medium`,`low`,`high_bug`,`bug`,`informational`];function De(e){return e=s(e),e!=null&&e in Ee?e:null}function Oe(e){return De(e?.correctedSeverity)??s(e?.severity)}function ke(e){let t=De(e?.correctedSeverity);return t!=null&&t!==s(e?.severity)}function Ae(e,t){return t===`original`?s(e?.severity):Oe(e)}function je(e){let t=e?._correctedByReport;return t&&new Set(Object.values(t).map(e=>s(e?.severity))).size>1?t:null}var Me=[`revalidation`,`refuted`,`unreachable`,`confirmed`,`partial`,`unknown`],Ne=new Set(Me);function M(e){return Ne.has(e?.revalidate)?e.revalidate:``}function Pe(e,t=e?.source){return Object.hasOwn(f,t)||M(e)===`revalidation`}function Fe(e,t=e?._source??e?.source){let n=typeof t==`string`&&t!==``&&t!==`deepview`,r=n?t:e?.analyzer??e?.type??e?._analyzer;return e?.security===!0||(r===`security`||r===`dependencies`)&&e?.security!==!1||n&&[`critical`,`high`,`medium`,`low`].includes(e?.severity)}function Ie(e){return e&&e.replace(/^[^/]+\//u,``).replace(/^claude-/u,``).replaceAll(`-`,` `)}function Le(e,t=!0){let n=t&&M(e)===`revalidation`?`revalidate`:``;return[e?.type,n,Ie(e?.model),e?.effort,e?.exportsMode].filter(Boolean).join(` · `)}function N(e,t){if(!e)return e;let n=e;t?.exportsMode===`isolate`&&(n=n.replace(/^\((?:[^()]|\([^()]*\))*\): \[export:\s*\w+\] /u,``),n=n.replace(/^\[export:\s*\w+\] /u,``));let r=[t?.exportName,t?.methodName].filter(Boolean).map(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/gu,`\\$&`));for(let e of r)n=n.replaceAll(RegExp(`\\[export:\\s*${e}\\]\\s*`,`gu`),``);for(let e of r)n=n.replace(RegExp(`^\\(\`?${e}\`?\\): `,`u`),``);return n}function Re(e){let t=e?.exportName,n=e?.methodName;return t&&n&&t!==n?`${t}.${n}`:t||n||``}function P(e){return e?e.split(`
10
+ `).find(e=>e.trim())?.trim()??``:``}function ze(e){return typeof e?.title==`string`?e.title.trim():``}function F(e){return ze(e)||P(N(e?.description,e))}function Be(e){let t=N(e?.description,e)||``,n=ze(e);if(n){let e=t.trim(),r=O(e);return{title:n,body:r.title===n?r.body.replace(/^\s+/u,``):e}}let r=t.indexOf(`
11
+ `);if(r<0||x(t.slice(0,r))[0]?.[0]===0)return{title:``,body:t};let i=t.slice(r+1).replace(/^\s+/u,``);return i?{title:t.slice(0,r).trim(),body:i}:{title:``,body:t}}function Ve(e){let t=ze(e);if(!t)return N(e?.description,e)||``;let{body:n}=Be(e);return n?`${t}
12
+
13
+ ${n}`:t}var He=/^\*\*([^*\n]+):\*\*[ \t]*/u;function Ue(e){let t=[];for(let n of de(e||``,/\n{2,}/gu)){if(!n.trim())continue;let e=He.exec(n);if(e){t.push({label:e[1].trim(),body:n.slice(e[0].length).trim()});continue}let r=t.at(-1);r&&r.label===null?r.body+=`
14
+
15
+ ${n}`:t.push({label:null,body:n})}return t}function I(e){return Number.isFinite(parseInt(e?.line,10))?`${e.file}:${e.line}`:e?.file??``}function We(e){let t=e=>typeof e==`string`?e:``;return`${t(e?.observation)}
16
+ ${t(e?.text)}`.trim()}function L(e){if(typeof e!=`string`||e.length===0)return!1;try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function Ge(e){return String(e??``).replaceAll(/\s*\n\s*/gu,` `).replaceAll(`|`,`\\|`).trim()}function R(e){let t=String(e??``);if(t===``)return``;let n=Math.max(0,...[...t.matchAll(/`+/gu)].map(e=>e[0].length)),r="`".repeat(n+1),i=t.startsWith("`")||t.endsWith("`")?` `:``;return`${r}${i}${t}${i}${r}`}function Ke(e){return String(e??``).replaceAll(/[[\]]/gu,`\\$&`)}function z(e,t){return`[${e}](${/[\s()<>]/u.test(t)?`<${t.replaceAll(`>`,`%3E`)}>`:t})`}function qe(e){return L(e)?`<${e}>`:String(e??``)}function Je(e,t){let n=String(e??``).toLowerCase().replaceAll(/[^\p{L}\p{N}\p{M}\s_-]/gu,``).replaceAll(/\s/gu,`-`),r=n;for(let e=1;t.has(r);e++)r=`${n}-${e}`;return t.add(r),r}function B(e,t){return`${`#`.repeat(Math.min(6,Math.max(1,e)))} ${t}`}function Ye(e,t,n=[]){return[e,e.map((e,t)=>n[t]===`right`?`---:`:`---`),...t].map(e=>`| ${e.join(` | `)} |`).join(`
17
+ `)}function Xe(e){let t=e instanceof Date?e:new Date(e);if(Number.isNaN(t.getTime()))return``;let n=e=>String(e).padStart(2,`0`);return`${t.getUTCFullYear()}-${n(t.getUTCMonth()+1)}-${n(t.getUTCDate())} ${n(t.getUTCHours())}:${n(t.getUTCMinutes())} UTC`}function V(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function Ze(e){return e.filter(e=>typeof e==`string`&&e.trim()).map(e=>e.replace(/\s+$/u,``)).join(`
18
+
19
+ `)}var Qe=/^( {0,3})(\\*#)/u;function H(e){let t=C(e).trim();if(!t)return``;let n=$e(t,e=>e.replace(Qe,`$1\\$2`)),{closer:r}=ie(n);return r===null?n:`${n}
20
+ ${r}`}function $e(e,t){let n=x(e),r=0;return e.split(`
21
+ `).map(e=>{let i=r;return r+=e.length+1,S(n,i)?e:t(e)}).join(`
22
+ `)}function U(e){return $e(String(e??``),e=>e.replace(/^( {0,3})\\(\\*#)/u,`$1$2`))}function et(e,t){let n=` `.repeat(e.length);return t.split(`
23
+ `).map(e=>e?n+e:``).join(`
24
+ `)}var tt=[`type`,`model`,`think`,`effort`,`exportsMode`];function nt(e,t){if(!t.source)for(let n of tt)e[n]==null&&t[n]!=null&&(e[n]=t[n])}var rt=/^(?:https?:\/\/)?(?:www\.)?github\.com\/([^/?#]+)\/([^/?#]+?)(?:\.git)?(?:[/?#].*)?$/iu,it=/^[\w.-]+\/[\w.-]+$/u;function at(e){return it.test(e)}function ot(e){let t=e?.repo?.github;if(typeof t!=`string`)return null;let n=t.trim().replace(/\/+$/u,``);if(!n)return null;let r=rt.exec(n),i=(r?`${r[1]}/${r[2]}`:n).replace(/\.git$/u,``);return at(i)?i:null}function st(e){let t=(typeof e?.directory==`string`?e.directory.trim():``).replace(/^(?:\.\/)+/u,``).replaceAll(/^\/+|\/+$/gu,``).replaceAll(/\/{2,}/gu,`/`);return!t||t===`.`||/[?#]/u.test(t)||t.split(`/`).includes(`..`)?``:t}var ct=[`finding_url`,`repository`,`title`,`description`,`severity`,`configured_scan_id`,`relevant_paths`];function lt(e){let t=[],n=[],r=``,i=!1;for(let a=0;a<e.length;a++){let o=e[a];i?o===`"`?e[a+1]===`"`?(r+=`"`,a++):i=!1:r+=o:o===`"`?i=!0:o===`,`?(n.push(r),r=``):o===`
25
+ `||o===`\r`?(n.push(r),t.push(n),n=[],r=``,o===`\r`&&e[a+1]===`
26
+ `&&a++):r+=o}for((r!==``||n.length>0)&&(n.push(r),t.push(n));t.length>0&&t.at(-1).length===1&&t.at(-1)[0]===``;)t.pop();return t}function ut(e,t){return t.map(t=>{let n=Object.create(null);return e.forEach((e,r)=>{n[e]=t[r]??``}),n})}function dt(e){let t=lt(e);if(t.length<2)throw Error(`Codex CSV: empty or missing header row`);let[n,...r]=t;for(let e of ct)if(!n.includes(e))throw Error(`Codex CSV: missing required column "${e}"`);let i=Map.groupBy(ut(n,r).filter(e=>e.configured_scan_id),e=>e.configured_scan_id);if(i.size===0)throw Error(`Codex CSV: no rows with a configured_scan_id`);let a=[];for(let[e,t]of i){let n=new Set(t.map(e=>e.repository).filter(Boolean));if(n.size>1)throw Error(`Codex CSV: scan ${e} contains multiple repositories: ${[...n].join(`, `)}`);let r=`${[...n][0]||`unknown-repo`}:${e.replace(/^[^:]+:/u,``)}`;a.push({displayName:r,data:{type:`security`,source:`codex-security`,findings:t.map(ft)}})}return a}function ft(e){let t=e.relevant_paths.split(` | `).map(e=>e.trim()).find(Boolean)||`unknown`,n=[e.title,e.description].filter(Boolean).join(`
27
+
28
+ `),r={id:e.finding_url,file:t,line:`?`,severity:(e.severity||`medium`).toLowerCase(),description:n,repo:{github:e.repository}};return e.commit_hash&&(r.commitHash=e.commit_hash),e.detected_at&&(r.detectedAt=e.detected_at),e.committed_at&&(r.committedAt=e.committed_at),c(r)}function pt(){let e=[],t=new Map,n=n=>{if(!t.has(n)){let r={security:!1};r.parent=r,t.set(n,r),typeof n==`string`&&e.push(n)}return t.get(n)},r=e=>{let t=e;for(;t.parent!==t;)t=t.parent;for(;e.parent!==e;){let n=e.parent;e.parent=t,e=n}return t};return{nodeFor:n,root:r,join:(e,t)=>{e=r(e),t=r(t),e!==t&&(t.parent=e,e.security||=t.security)},ids:e}}function mt(e,{source:t,linkedIds:n=()=>[],knownRows:r=()=>[]}={}){let{nodeFor:i,root:a,join:o,ids:s}=pt(),c=[],l=(e,n=!1)=>{let r;for(let s of e){if(!s||typeof s!=`object`)continue;let e=i(s.id||s);a(e).security||=n?s.isSecurity===!0:Fe(s,s._source??s.source??t),r?o(r,e):r=e,n||c.push([s,e])}};for(let t of e)l(t);let u=new Set;for(let e=0;e<s.length;e++){let t=s[e],a=i(t);for(let e of n(t))o(a,i(e));for(let e of r([t]))u.has(e)||(u.add(e),l(e.members,!0))}let d=!1;for(let[e,t]of c){let n=a(t).security;e.isSecurity!==n&&(e.isSecurity=n,d=!0)}return d}var ht=/^## ([A-Z][A-Z_]*)\s*\(\d+\)\s*\n/mu,gt=new Map([...o,[`HIGH_BUG`,`high_bug`],[`BUG`,`bug`]]),_t=e=>String(e??``).toLowerCase().replaceAll(/[^a-z]+/gu,``),vt=new Map([[`high`,8],[`medium`,6],[`low`,4]]);function yt(e){if(e!==void 0)return vt.get(_t(e))??vt.get(`medium`)}var bt=new Map([[`confirmed`,`confirmed`],[`falsepositive`,`refuted`],[`uncertain`,`unknown`]]);function xt(e){let t=C(e).trim().split(ht);if(t.length===1)return null;let n=[];for(let e=1;e<t.length;e+=2){let r=gt.get(t[e].toUpperCase())??`medium`;for(let i of de(t[e+1],/^### /gmu).slice(1)){let e=St(i,r);if(!e)continue;let t=i.indexOf(`
29
+ ### `);t!==-1&&(e._idBasis=a(St(i.slice(0,t+1),r))),n.push(e)}}return n.length===0?null:{type:`security`,source:`deepsec`,findings:n}}function St(e,t){let{title:n,body:r}=O(e);if(!n)return null;let i=r.replace(/\n---\s*$/u,``).trim(),a=Object.fromEntries([...i.matchAll(/^- \*\*([^:*]+):\*\*\s*(.+)$/gmu)].map(e=>[e[1].trim().toLowerCase(),e[2].trim()])),o=/^\*\*Recommendation:\*\*\s*/mu.exec(i),s=o?i.slice(0,o.index):i,l=o?i.slice(o.index+o[0].length).trim():``,u=[n,s.split(`
30
+ `).filter(e=>!/^\s*- \*\*/u.test(e)).join(`
31
+ `).replaceAll(`**`,``).trim()].filter(Boolean).join(`
32
+
33
+ `),d={file:(a.file||`unknown`).replace(/^`(.*)`$/u,`$1`),line:(a.lines||``).split(`,`).map(e=>e.trim()).find(Boolean)||`?`,severity:t,description:u};l&&(d.recommendation=l.replaceAll(`**`,``));let f=yt(a.confidence);f!==void 0&&(d.confidence=f);let p=bt.get(_t(a.revalidation));return p&&(d.revalidate=p,d.revalidateSource=`deepsec`,a.reasoning&&(d.revalidateVerdict=a.reasoning.replaceAll(`**`,``))),a.slug&&(d.slug=a.slug),c(d,t===`informative`?`medium`:t)}var W=120;function Ct(e){let t=F(e)||I(e)||`Untitled finding`;return t.length>W?`${t.slice(0,W-1).trimEnd()}\u2026`:t}function wt(e){let t=String(e??``).trim();return L(t)?qe(t):at(t)?z(t,`https://github.com/${t}`):t}function Tt(e,t,n){return t?f[t]??String(t):Le(e,n)}var Et=[[`Impact`,`impact`,!1],[`Reproduction`,`reproduction`,!1],[`Recommendation`,`recommendation`,!1],[`Confidence reasoning`,`confidenceReason`,!1],[`Revalidation verdict`,`revalidateVerdict`,!0],[`Revalidation recommendation`,`revalidateRecommendation`,!0]],Dt=[[`Status`,`status`],[`Branch`,`branch`],[`Date created`,`dateCreated`],[`Detected at`,`detectedAt`],[`Committed at`,`committedAt`],[`PoC status`,`pocStatus`],[`Variant of`,`parent`],[`Slug`,`slug`],[`Priority`,`priority`]],Ot=[[`Detailed report`,`reportPath`],[`Commit audited`,`auditedCommit`],[`ID`,`id`]];function G(e){return typeof e==`number`?Number.isFinite(e)?String(e):``:typeof e==`string`?e.replaceAll(/\s*\n\s*/gu,` `).trim():``}function kt(e){return typeof e==`string`?e.trim():``}function At(e,t){let n=t.severityMode===`original`,r=p(Ae(e,t.severityMode));ke(e)&&(r+=n?` \u2014 corrected to ${p(Oe(e))}`:` \u2014 corrected from ${p(e.severity)}`);let i=je(e);if(i){let e=Object.entries(i).map(([e,t])=>`${e||`this report`}: ${p(t?.severity)}`);r+=` (varies across reports \u2014 ${e.join(`; `)})`}return e.critical===!0&&(r+=` · flagged critical by the analyzer`),r}function jt(e,t){let n=I(e);if(!n)return``;let r=t.hooks.location(e),i=L(r)?z(R(n),r):R(n),a=Re(e);return a?`${i} \xB7 ${R(a)}`:i}function Mt(e){if(!e)return``;let t=[],n=u[e.triage]??(e.ignored?u.ignored:``);return n&&t.push(n),e.color&&t.push(`${d[e.color]??e.color} mark`),e.flagged===!0&&t.push(`Flagged`),t.join(` · `)}function Nt(e,t){let n=G(e.commitHash);if(!n)return``;let r=t.hooks.commit(e);return L(r)?z(R(n.slice(0,7)),r):R(n)}function Pt(e,t,n){let r=[],i=(e,t)=>{t&&r.push(`- **${e}:** ${t}`)};i(`Location`,jt(e,t)),i(`Severity`,At(e,t)),e.confidence!==void 0&&e.confidence!==null&&i(`Confidence`,`${e.confidence}/10`),t.showAnalyzer&&i(`Analyzer`,t.analyzerOf(e)),i(`Category`,G(e.category));let a=t.revalidation?M(e):``;a&&i(`Revalidation`,a===`revalidation`?`the revalidation pass itself`:a);let o=G(e.revalidateSource);a&&i(`Revalidated by`,f[o]??o),i(`Triage`,Mt(n)),n?.fix&&i(`Fix`,qe(String(n.fix).trim())),t.showReport&&i(`Report`,R(t.hooks.report(e)??``));let s=G(e.repo?.github);s&&s!==t.repo&&i(`Repository`,wt(s)),i(`Introduced in`,Nt(e,t));let c=G(e.discoveredIn);c&&c!==String(e.file??``).trim()&&i(`Found while analyzing`,R(c));let l=e.package?.npm,u=G(l?.name);u&&i(`Package`,R(G(l.version)?`${u}@${G(l.version)}`:u));for(let[t,n]of Dt)i(t,G(e[n]));for(let[t,n]of Ot)i(t,R(G(e[n])));return r.join(`
34
+ `)}function K(e,t,n){let r=H(n);return r?`${B(e,t)}
35
+
36
+ ${r}`:B(e,t)}function Ft(e,t){return(Array.isArray(e.evidence)?e.evidence:[]).map((n,r)=>{let i=`${r+1}. `,a=I(n),o=t.hooks.evidence(n,e,r),s=``;a?s=L(o)?z(R(a),o):R(a):L(o)&&(s=qe(o));let c=H(We(n)),l=i+(s||`(no reference)`);return c?`${l}
37
+
38
+ ${et(i,c)}`:l}).join(`
39
+
40
+ `)}function It(e,t,n){let r=Be(e),i=C(r.body),a=F(e),o=a.length>W,s=!o&&!r.title&&i.trim()===a,c=o&&P(i)!==a?`${a}
41
+
42
+ ${i}`:i,l=Ue(s?``:c),u=l.findIndex(e=>e.label!==null),d=u===-1?l:l.slice(0,u),f=u===-1?[]:l.slice(u),p=d.map(e=>H(e.body)),m=Ft(e,t);m&&p.push(`${B(n,`Evidence`)}
43
+
44
+ ${m}`);for(let e of f)p.push(e.label===null?H(e.body):K(n,e.label,e.body));return p}function Lt(e,t,n){let r=t.hooks.annotation(e),i=[Pt(e,t,r),...It(e,t,n)];for(let[r,a,o]of Et){if(o&&!t.revalidation)continue;let s=e[a],c=typeof s==`string`?N(s,e):``;c.trim()&&i.push(K(n,r,c))}ke(e)&&kt(e.correctedSeverityReason)&&i.push(K(n,`Severity correction`,e.correctedSeverityReason));let a=kt(r?.comment);return a&&i.push(K(n,`Comment`,a)),i}function Rt(e,t,{headingText:n,depth:r}){let i=[B(r,n)];if(e.length===1)return Ze([...i,...Lt(e[0],t,r+1)]);let a=[...new Set(e.map(e=>t.hooks.report(e)).filter(Boolean))],o=a.length>1?` \u2014 reported in ${a.map(e=>R(e)).join(`, `)}`:``;i.push(`${V(e.length,`case`)} of this finding${o}.`);let s=F(e[0]);return e.forEach((n,a)=>{let o=I(n);i.push(B(r+1,`Case ${a+1} of ${e.length}${o?` \u2014 ${R(o)}`:``}`));let c=F(n);c&&c!==s&&i.push(H(c)),i.push(...Lt(n,t,r+2))}),Ze(i)}var zt=new Map(Object.entries(l).map(([e,t])=>[t.toLowerCase(),e])),Bt=new Map(Object.entries(f).map(([e,t])=>[t.toLowerCase(),e]));function q(e){let t=/(`+)(.+?)\1(?!`)/u.exec(String(e??``));if(!t)return null;let n=t[2];if(n.length>2&&n.startsWith(` `)&&n.endsWith(` `)){let e=n.slice(1,-1);if(e.startsWith("`")||e.endsWith("`"))return e}return n}function J(e){let t=k(String(e??``));return t?.index===0?{label:t.label,url:t.url}:null}function Vt(e){let t=/^<(https?:[^>\s]*)>$/u.exec(e.trim());return t?t[1]:null}function Ht(e){let t=le.exec(e);return t?{file:t[1],line:t[2]}:{file:e,line:`?`}}function Ut(e){let t=e.indexOf(`.`);return t>0?{exportName:e.slice(0,t),methodName:e.slice(t+1)}:{exportName:e}}function Wt(e){let t=String(e??``).trim();return zt.get(t.toLowerCase())??t}function Gt(e){let t={},n=e.trim(),r=/ \u00B7 (`+)(.+?)\1$/u.exec(n);r&&(Object.assign(t,Ut(q(r[0]))),n=n.slice(0,r.index));let i=J(n),a=q(i?i.label:n);return a!==null&&Object.assign(t,Ht(a)),i&&L(i.url)&&(t.location=i.url),t}var Kt=` · flagged critical by the analyzer`,qt=` (varies across reports — `;function Jt(e){let t={},n=e.trim();n.endsWith(Kt)&&(t.critical=!0,n=n.slice(0,-Kt.length));let r=n.indexOf(qt);r!==-1&&(n=n.slice(0,r));let i=/^(.*?) \u2014 corrected (from|to) (.*)$/u.exec(n);return i?[t.severity,t.correctedSeverity]=(i[2]===`from`?[i[3],i[1]]:[i[1],i[3]]).map(Wt):t.severity=Wt(n),t}var Yt=new Set([`max`,`xhigh`,`high`,`medium`,`low`,`minimal`]),Xt=new Set([`list`,`isolate`]);function Zt(e){return/\d/u.test(e)||/^(?:opus|sonnet|haiku|gpt|gemini|fable|mythos|llama|mistral)\b/iu.test(e)}function Qt(e){let t=e.trim(),n=Bt.get(t.toLowerCase());if(n)return{source:n};let r={},i=[];for(let e of t.split(` · `).map(e=>e.trim()).filter(Boolean))e===`revalidate`&&!r.revalidate?r.revalidate=`revalidation`:Xt.has(e)&&!r.exportsMode?r.exportsMode=e:Yt.has(e)&&!r.effort?r.effort=e:i.push(e);return i.length>1?[r.type,r.model]=i:i.length===1&&(r[Zt(i[0])?`model`:`type`]=i[0]),{run:r}}function $t(e){let t=e.trim(),n=J(t);return n?n.label.trim():Vt(t)??t}function en(e){let t=J(e.trim());if(t){let e=t.url.split(`/`).at(-1)??``;return T(e)?e:q(t.label)??e}return q(e)??e.trim()}function tn(e){let t=q(e)??e.trim(),n=t.lastIndexOf(`@`);return{npm:n>0?{name:t.slice(0,n),version:t.slice(n+1)}:{name:t}}}function nn(e){let t=e.trim().toLowerCase();return t===`the revalidation pass itself`?`revalidation`:Me.includes(t)?t:void 0}var rn=new Map([...[[`Category`,`category`],...Dt].map(([e,t])=>[e.toLowerCase(),(e,n)=>{e[t]=n}]),...[...Ot,[`Found while analyzing`,`discoveredIn`]].map(([e,t])=>[e.toLowerCase(),(e,n)=>{e[t]=q(n)??n}]),[`location`,(e,t)=>Object.assign(e,Gt(t))],[`severity`,(e,t)=>Object.assign(e,Jt(t))],[`confidence`,(e,t)=>{let n=/^(\d+(?:\.\d+)?)\/10$/u.exec(t);n&&(e.confidence=Number(n[1]))}],[`revalidation`,(e,t)=>{let n=nn(t);n&&(e.revalidate=n)}],[`revalidated by`,(e,t)=>{let n=t.trim();n&&(e.revalidateSource=Bt.get(n.toLowerCase())??n)}],[`repository`,(e,t)=>{e.repo={github:$t(t)}}],[`introduced in`,(e,t)=>{e.commitHash=en(t)}],[`package`,(e,t)=>{e.package=tn(t)}],[`priority`,(e,t)=>{e.priority=/^-?\d+(?:\.\d+)?$/u.test(t)?Number(t):t}]]);function an(e,t,n){let r=rn.get(t.trim().toLowerCase());r&&r(e,n.trim())}var on=/^- \*\*([^*\n]+?):\*\* ?(.*)$/u;function sn(e){let t=e.split(`
45
+ `),n=0,r=()=>{for(;n<t.length&&!t[n].trim();)n++},i=()=>{let e=[];for(let r;(r=on.exec(t[n]??``))!==null;n++)e.push([r[1].trim(),r[2].trim()]);return e};r();let a=i();if(a.length>0)return{title:``,facts:a,rest:t.slice(n).join(`
46
+ `)};let o=[];for(;n<t.length&&t[n].trim();)o.push(t[n++]);return r(),a=i(),a.length===0?{title:``,facts:a,rest:e}:{title:U(o.join(`
47
+ `).trim()),facts:a,rest:t.slice(n).join(`
48
+ `)}}var cn=/^(\d+)\. (.*)$/u;function ln(e){let t=[],n=x(e),r=0;for(let i of e.split(`
49
+ `)){let e=S(n,r)?null:cn.exec(i);r+=i.length+1,e?t.push({ref:e[2].trim(),indent:e[1].length+2,note:[]}):t.length>0&&t.at(-1).note.push(i)}return t.map(e=>un(e))}function un({ref:e,indent:t,note:n}){let r={},i=J(e),a=Vt(e),o=a===null?q(i?i.label:e):null;o!==null&&Object.assign(r,Ht(o));let s=i?i.url:a;L(s)&&(r.url=s);let c=U(n.map(e=>e.slice(Math.min(t,/^ */u.exec(e)[0].length))).join(`
50
+ `).trim());return c&&(r.text=c),r}var dn=new Map(Et.map(([e,t])=>[e.toLowerCase(),t])),fn=[...dn.keys()];function pn(e){let t=e.length,n=1/0;for(let r=e.length-1;r>=0;r--){let i=fn.indexOf(e[r].label.toLowerCase());if(i===-1||i>=n)break;n=i,t=r}return{paragraphs:e.slice(0,t),fields:e.slice(t).map(e=>[dn.get(e.label.toLowerCase()),e.body])}}function mn(e,t,n){let r=[],i=P(t),a=e.endsWith(`…`)?e.slice(0,-1).trimEnd():``;!e||i===e||a&&i.startsWith(a)?r.push(t):r.push(e,t);for(let{label:e,body:t}of n)r.push(t?`**${e}:** ${t}`:`**${e}:**`);return r.filter(Boolean).join(`
51
+
52
+ `)}var hn=/^<!--\s*DeepView findings export\b[^>]*-->/u,gn=/^Case \d+ of \d+(?:\s|$)/u,_n=/^- \*\*([^*\n]+?):\*\* ?(.*)$/gmu,vn=new Set([`evidence`,`severity correction`,`comment`]);function yn(e){let t=C(e).trim();if(!hn.test(t))return null;let{head:n,subs:r}=E(t,oe),i=[];for(let{heading:e,body:t}of r){if(e.trim().toLowerCase()===`summary`)continue;let n=bn(e);for(let e of D(t,se))i.push(Sn(e,n))}return Tn(xn(n),i)}function bn(e){let t=/^(.*?)\s*\(\d+\)\s*$/u.exec(e.trim());return Wt(t?t[1]:e)}function xn(e){let t=new Map;for(let n of e.matchAll(_n)){let e=n[1].trim().toLowerCase();t.has(e)||t.set(e,n[2].trim())}return{sources:(t.get(`source`)??``).split(`,`).map(e=>Qt(e).source).filter(Boolean),analyzers:(t.get(`analyzer`)??t.get(`analyzers`)??``).split(`;`).map(e=>e.trim()).filter(Boolean),repo:t.has(`repository`)?$t(t.get(`repository`)):``}}function Sn({heading:e,body:t},n){let r=e.trim().replace(/^\d+\.\s+/u,``),i=D(t,w).filter(e=>gn.test(e.heading.trim()));return i.length===0?[Cn(t,w,r,n)]:i.map(e=>Cn(e.body,ce,r,n))}function Cn(e,t,n,r){let{title:i,facts:a,rest:o}=sn(e),{head:s,subs:l}=E(o,t),u=l.map(e=>({label:e.heading.trim(),body:e.body.trim()})),d={file:`unknown`,line:`?`},f=null;for(let[e,t]of a)e.trim().toLowerCase()===`analyzer`?f=Qt(t):an(d,e,t);d.severity||=r||`medium`;let p=i||n,m=p!==`Untitled finding`&&p!==I(d),{paragraphs:h,fields:g}=pn(u.filter(e=>!vn.has(e.label.toLowerCase())).map(e=>({label:e.label,body:U(e.body)})));d.description=mn(m?p:``,U(s.trim()),h);let _=u.filter(e=>e.label.toLowerCase()===`evidence`).flatMap(e=>ln(e.body));_.length>0&&(d.evidence=_);for(let[e,t]of g)d[e]=t;let v=u.find(e=>e.label.toLowerCase()===`severity correction`);return v?.body&&(d.correctedSeverityReason=U(v.body)),{finding:c(d),analyzer:f}}function wn(e,t){let n={source:null,run:{}};if(t.some(e=>e.analyzer!==null)){let e=new Set(t.map(e=>e.analyzer?.source??null));e.size===1&&!e.has(null)&&([n.source]=e);for(let e of t)e.analyzer?.run?Object.assign(e.finding,e.analyzer.run):e.analyzer?.source&&!n.source&&(e.finding.source=e.analyzer.source);return n}let r=e.analyzers.length===1?Qt(e.analyzers[0]):null;return r?.source?n.source=r.source:r?.run?n.run=r.run:e.analyzers.length===0&&e.sources.length===1&&([n.source]=e.sources),n}function Tn(e,t){let n=t.flat(),{source:r,run:i}=wn(e,n),a={},o=new Set(n.map(e=>e.finding.type).filter(Boolean)),s=i.type??(o.size===1?[...o][0]:null)??(r?`security`:null);s&&(a.type=s),r&&(a.source=r);for(let e of[`model`,`effort`,`exportsMode`])i[e]&&(a[e]=i[e]);e.repo&&(a.repo={github:e.repo});let c=t.map(e=>e.map(e=>e.finding));return c.every(e=>e.length===1)?a.findings=c.flat():a.groups=c,a}var En=`markdown-generic`,Dn=[`#`,`id`,`product`,`priority`,`vulnerability`],On=[`title`,`description`,`root cause`,`code references`,`attack scenario`,`steps to reproduce`,`impact`,`patch`],kn=/^(?:#{3,6}[ \t]+)?(?:\*\*)?(Title|Description|Root Cause|Code references|Attack Scenario|Steps to Reproduce(?:[ \t]+.*?)?|Impact|Patch):?(?:\*\*)?(?:[ \t]+#+)?[ \t]*$/gimu,An={P0:`critical`,P1:`high`,P2:`medium`,P3:`low`,P4:`informational`},Y=e=>e.trim().slice(1,-1).split(`|`).map(e=>e.trim());function X(e,t){if(!e)throw Error(`Markdown (generic): unsupported ${t}`)}function jn(e){return[...new Set(e.split(`
53
+ `).map(e=>e.trim()).filter(Boolean))].map(e=>{X(/^https?:\/\/[^\s()[\]{}"'<>`\\]+$/iu.test(e)&&!/[.,;!?]$/u.test(e),`link syntax; use bare URLs on separate lines`);let t;try{t=new URL(e)}catch{X(!1,`URL`)}let[n,r,i,a,...o]=t.pathname.slice(1).split(`/`);X([`github.com`,`www.github.com`].includes(t.hostname)&&!t.username&&!t.password&&!t.port&&[n,r].every(e=>e&&/^[\w-][\w.-]*$/u.test(e)),`repository URL`),X(o.every(Boolean),`repository path; empty components`);let s=`${n}/${r.replace(/\.git$/iu,``)}`.toLowerCase(),c=/^#L(\d+)(?:-L?(\d+))?$/u.exec(t.hash),l=i===`blob`?o.slice(0,-1):i===`tree`?o:[];try{l=l.map(decodeURIComponent)}catch{X(!1,`repository directory encoding`)}return X(l.every(e=>e===e.trim()&&!/[\\/:?#\p{Cc}]/u.test(e)),`repository directory`),{repo:s,ref:a,directory:l,...i===`blob`&&o.length&&{evidence:{file:o.join(`/`),line:c?c.slice(1).filter(Boolean).join(`-`):`?`,url:e}}}})}function Mn(e,t,n,r){let i=jn(n),a=i[0]?.repo;X(a&&i.every(e=>e.repo===a),`repository set for finding ${e.id}; expected exactly one repository`),X(!e.group.github||e.group.github===a,`repository set for product ${e.product}; expected exactly one repository`);let o=r.get(a);X(o===void 0||o===e.prefix,`repository ID prefixes for ${a}; expected ${o}, got ${e.prefix} (${e.id})`),r.set(a,e.prefix),e.group.github=a,e.group.directories.push(...i.map(e=>e.directory));let s=i.flatMap(e=>e.evidence??[]);if(s.length){Object.assign(t,{file:s[0].file,line:s[0].line,location:s[0].url,evidence:s});let e=i.find(e=>e.evidence).ref;T(e)&&(t.commitHash=e)}}function Nn(e){let t=e[0];for(let n of e.slice(1)){let e=0;for(;e<t.length&&t[e]===n[e];)e++;t=t.slice(0,e)}return t.join(`/`)}function Pn(e){let t=C(e).trim(),n=[...t.matchAll(/^## +(.*)$/gmu)];if(!n.some(e=>/^\d+\.\s+\S+/u.test(e[1]))&&(n.length||t.startsWith(`# `)))return null;let r=[...t.matchAll(/^\|[^\n]*\|$/gmu)].find(([e])=>Y(e).map(e=>e.toLowerCase()).join()===Dn.join());if(!r)return null;let i=t.slice(0,r.index).trim();X(!i||/^# [^\n]+$/u.test(i),`summary preamble`),X(r.index<(n[0]?.index??t.length),`summary position`);let a=t.slice(r.index,n[0]?.index).trim().split(`
54
+ `),o=new Set(Y(a[0]).map(e=>e.toLowerCase()));X(a[1]&&Y(a[1]).length===5&&Y(a[1]).every(e=>/^:?-{3,}:?$/u.test(e)),`summary separator`);let s=new Map,c=new Map,l=new Map;for(let e of a.slice(2).filter(e=>e.trim())){X(/^\|.*\|$/u.test(e)&&Y(e).length===5,`summary row`);let[t,n,r,i]=Y(e),a=/^(.+-)\d+$/u.exec(n)?.[1];X(/^\d+$/u.test(t)&&a&&r&&Object.hasOwn(An,i)&&!l.has(n),`summary values for ${n}`);let o=s.get(r)??{directories:[],rows:[]},c={raw:e,id:n,prefix:a,product:r,priority:i,group:o};l.set(n,c),o.rows.push(c),s.set(r,o)}X(l.size,`empty summary`);for(let[e,r]of n.entries()){let i=/^\d+\.\s+(\S+)\s*$/u.exec(r[1])?.[1],a=l.get(i);X(a&&!a.finding,`finding section ${r[1]}`);let s=t.slice(r.index,n[e+1]?.index),u=s.slice(r[0].length+1),d=new Map,f=[...u.matchAll(kn)];for(let[e,t]of f.entries()){let n=t[1],r=n.toLowerCase().replace(/^steps to reproduce\b.*$/u,`steps to reproduce`);X(!d.has(r),`duplicate section ${n}`),d.set(r,{heading:n,body:u.slice(t.index+t[0].length,f[e+1]?.index).trim()})}X(On.every(e=>d.has(e)),`missing required headers for ${i}`),X(!u.slice(0,f[0].index).trim(),`text before field headers for ${i}`);let p=d.get(`title`)?.body;X(p,`missing Title for ${i}`);let m={sourceId:i,_idBasis:{source:En,row:a.raw.trim(),section:s.trim()},product:a.product,priority:a.priority,severity:An[a.priority],file:`unknown`,line:`?`};o.has(`vulnerability`)&&(m.security=!0);let h=[p];for(let[e,t]of d)e===`title`||e===`code references`||(e===`steps to reproduce`?m.reproduction=t.body:e===`patch`?m.recommendation=t.body:h.push(e===`description`?t.body:`**${t.heading}:**
55
+ ${t.body}`));m.description=h.join(`
56
+
57
+ `),Mn(a,m,d.get(`code references`).body,c),a.finding=m}return X([...l.values()].every(e=>e.finding),`missing finding sections`),[...s].map(([e,t])=>({displayName:e,data:{type:`security`,source:En,product:e,repo:{github:t.github,directory:Nn(t.directories)},findings:t.rows.map(({finding:e})=>({...e,repo:{github:t.github}}))}}))}function Fn(e){let t=Pn(e);return t===null?null:t.length===1?t[0].data:{type:`security`,source:En,findings:t.flatMap(({data:e})=>e.findings)}}var In=new Set([`critical`,`high`,`medium`,`low`,`high_bug`,`bug`,`informational`]);function Ln(e){let t=Rn(e);if(!t)return null;let{severity:n,description:r,location:i,file:a,line:o}=t;return i?{severity:n,description:r,location:i}:{severity:n,description:r,file:a,line:o}}function Rn(e){let t=e.indexOf(`
58
+ `),n=(t===-1?e:e.slice(0,t)).trim();if(!n)return null;let{sectionsText:r,metaText:i}=zn(t===-1?``:e.slice(t+1)),a=Bn(r),o=Vn(i),{file:s,line:c,locationLink:l}=Hn(a.location||``),u=(o.severity||``).toLowerCase();return{severity:In.has(u)?u:`medium`,description:Un(n,a),location:l,file:s||`unknown`,line:c}}function zn(e){let t=/^---\s*$/mu,n=t.exec(e);if(!n)return{sectionsText:e,metaText:``};let r=e.slice(0,n.index).trim(),i=e.slice(n.index+n[0].length).replace(/^\n/u,``),a=t.exec(i);return{sectionsText:r,metaText:a?i.slice(0,a.index):i}}function Bn(e){let t={},n=e.split(/^## /mu);for(let e=1;e<n.length;e++){let r=n[e],i=r.indexOf(`
59
+ `),a=(i===-1?r:r.slice(0,i)).trim().toLowerCase(),o=(i===-1?``:r.slice(i+1)).trim();a&&(t[a]=o)}return t}function Vn(e){let t={};for(let n of e.matchAll(/\*\*([^:]+):\*\*\s*(.+)/gu))t[n[1].trim().toLowerCase()]=n[2].trim();return t}function Hn(e){let t=``,n=`?`,r=``,i=e.match(/\[([^\]]+)\]\(([^)]+)\)/u);if(i){t=i[1].trim(),r=i[2];let e=i[2].match(/#L(\d+)/u);e&&(n=e[1])}else t=e.trim(),r=e.trim();let a=t.match(/^(.+):(\d+)$/u);return a&&(t=a[1],n===`?`&&(n=a[2])),{file:t,line:n,locationLink:r}}function Un(e,t){let n=[e];return t.details&&n.push(t.details),t.impact&&n.push(`Impact: ${t.impact}`),t[`reproduction steps`]&&n.push(`Reproduction: ${t[`reproduction steps`]}`),Wn(n.join(`
60
+
61
+ `))}function Wn(e){return e.replaceAll(`**`,``)}var Gn=new Set([...j,`informative`]);function Kn(e){let t=C(e).trim();if(!t.startsWith(`# `))return null;let n=de(t,/^# /gmu).slice(1).filter(e=>e.trim().length>0).map(e=>qn(e)).filter(Boolean);return n.length===0?null:{type:`security`,source:`claude-security`,findings:n}}function qn(e){let{title:t,body:n}=O(e);if(!t)return null;let{sectionsText:r,metaText:i}=Jn(n),a=Yn(r),o=Object.fromEntries([...i.matchAll(/\*\*([^:]+):\*\*\s*(.+)/gu)].map(e=>[e[1].trim().toLowerCase(),e[2].trim()])),s=nr(a.evidence||``),{file:l,line:u,locationLink:d}=Xn(a.location||s[0]?.ref||``),f=(o.severity||``).toLowerCase(),p=Gn.has(f)?f:`medium`,m=ir(t,a,s.length>0),h={file:l||`unknown`,line:u,severity:p,description:m};d&&(h.location=d),s.length>0&&(h.evidence=s.map(rr)),a[`reproduction steps`]&&(h.reproduction=Zn(a[`reproduction steps`])),a[`recommended fix`]&&(h.recommendation=a[`recommended fix`]),o.repository&&(h.repo={github:o.repository}),o.branch&&(h.branch=o.branch),o[`date created`]&&(h.dateCreated=o[`date created`]),o.status&&(h.status=o.status),o.category&&(h.category=o.category);let g=e.indexOf(`
62
+ # `),_=Ln(g===-1?e:e.slice(0,g+1));return _&&(h._idBasis=_),c(h)}function Jn(e){let t=/^---\s*$/mu,n=t.exec(e);if(!n)return{sectionsText:e,metaText:``};let r=e.slice(0,n.index).trim(),i=e.slice(n.index+n[0].length).replace(/^\n/u,``),a=t.exec(i);return{sectionsText:r,metaText:a?i.slice(0,a.index):i}}function Yn(e){let t=e.split(/^## /mu).slice(1).map(e=>O(e));return Object.fromEntries(t.filter(e=>e.title).map(e=>[e.title.toLowerCase(),e.body.trim()]))}function Xn(e){let t=``,n=`?`,r=``,i=k(e);if(i){t=i.label.trim(),r=i.url.trim();let e=r.match(/#L(\d+)(?:-L?(\d+))?/u);e&&(n=e[2]?`${e[1]}-${e[2]}`:e[1])}else t=e.trim(),r=e.trim();t=we(t.replaceAll("`",``)).trim();let a=t.match(/^(.+):(\d+)(?:\s*[-\u2013\u2014]\s*L?(\d+))?$/u);return a&&(t=a[1],n===`?`&&(n=a[3]?`${a[2]}-${a[3]}`:a[2])),{file:t,line:n,locationLink:r,linked:i!==null}}function Zn(e){let t=e.split(`
63
+ `),n=t.findIndex(e=>e.trim());if(n===-1||!v.test(t[n])||t.some((e,t)=>t!==n&&v.test(e)))return e;let r=t[n].replace(/^ */u,``),i=r.replace(v,``);if(!i.trim())return e;let a=er(i)??er(r);if(a===null&&(v.test(i)||$n.test(r)))return e;let o=a===null?[i]:a.length===1?[a[0].step]:a.map(({number:e,step:t})=>`${e}. ${t}`);return t.splice(n,1,...o),t.join(`
64
+ `)}var Qn=/(?:^|[ \t])(\d{1,9})\)(?=[ \t]|$)/gu,$n=/^\d{1,9}\)(?=[ \t]|$)/u;function er(e){let t=[...e.matchAll(Qn)];if(t.length===0||t[0].index!==0)return null;let n=[];for(let[r,i]of t.entries()){let a=Number(i[1]);if(r>0&&a<=n[r-1].number)return null;let o=e.slice(i.index+i[0].length,t[r+1]?.index).trim();if(!o)return null;n.push({number:a,step:o})}return n}var tr=/^[ \t]*(?:\d+[.)]|[-*+])\s+/u;function nr(e){let t=[];for(let n of e.split(`
65
+ `))tr.test(n)?t.push({ref:n.replace(tr,``).trim(),note:[]}):t.length>0&&n.trim()&&t.at(-1).note.push(n.trim());if(t.length===0){let n=e.split(`
66
+ `).map(e=>e.trim()).filter(Boolean),r=n.findIndex(e=>k(e)!==null);if(r===-1&&n.length!==1)return[];let i=r===-1?0:r;t.push({ref:n[i],note:n.filter((e,t)=>t!==i)})}return t.filter(e=>e.ref)}function rr({ref:e,note:t}){let{file:n,line:r,locationLink:i,linked:a}=Xn(e),o={file:n||`unknown`,line:r};i&&a&&(o.url=i);let s=t.join(`
67
+ `);return s&&(o.text=s),o}function ir(e,t,n){let r=[e];return t.details&&r.push(t.details),t.evidence&&!n&&r.push(`**Evidence:**
68
+ ${t.evidence}`),t.impact&&r.push(`**Impact:** ${t.impact}`),r.join(`
69
+
70
+ `)}function ar(e){let t=(e||``).trim(),n=``,r=/\[([^\]]+)\]\(([^)]+)\)/u.exec(t);r&&(t=r[1].trim(),n=r[2].trim());let i=``,a=/#L(\d+)/u.exec(n);a&&(i=a[1]);let o=[...t.matchAll(/`([^`]+)`/gu)].map(e=>e[1].trim()).find(e=>!e.includes(`(`)&&(e.includes(`/`)||/\.\w/u.test(e)))??(t.replaceAll("`",``).trim().split(/[\s,]+/u).find(Boolean)||``),s=/^(.*?)#L(\d+)(?:-L?\d+)?$/u.exec(o);s&&(o=s[1],i||=s[2]);let c=/^(.+):(\d+(?:-\d+)?)$/u.exec(o);return c?(i||=c[2],{file:c[1],line:i,locationLink:n}):{file:o,line:i||`?`,locationLink:n}}function or({severity:e,description:t,ref:n,lineBullet:r=``,id:i=``}){let a=ar(n),o=a.file||`unknown`,s=a.line===`?`&&r?r:a.line,c=a.locationLink||(o===`unknown`&&i?`piolium:${i}`:``);return c?{severity:e,description:t,location:c}:{severity:e,description:t,file:o,line:s}}function Z(e){let t=((e||``).trim().split(/\s+/u)[0]||``).replaceAll(/[`*]+/gu,``);return o.get(t.toUpperCase())??``}function sr(...e){return{severity:e.find(Boolean)||`medium`,identitySeverity:e.find(e=>e&&e!==`informative`)||`medium`}}function cr(e){let t=/^([CHML])-?\d+$/iu.exec((e||``).trim());return t?{C:`critical`,H:`high`,M:`medium`,L:`low`}[t[1].toUpperCase()]:``}function lr(e){return Z(/^(critical|high|medium|low|informational|informative|info)(?:[ -](?:severity|risk))?(?:[ -]findings?)?(?:\s*\(\d+\))?$/iu.exec((e||``).trim())?.[1])}function ur(e){return Z(/^(critical|high|medium|low|informational|informative|info)\b/iu.exec((e||``).trim())?.[1])}function dr(e){return/^variants?\s*(?:\(\d+\))?\s*:?$/iu.test((e||``).trim())}function fr(e){let t=/^([CHML]-?\d{1,4}|(?:p|q|b|r|m|l|x|diff)\d{0,4}-\d{2,4})(?:-([A-Za-z0-9][\w-]*))?$/iu.exec(e||``);return t?{id:t[1].toUpperCase(),slug:t[2]||``}:null}function pr(e){return(e||``).replaceAll(`-`,` `)}function mr(e){let t=(e||``).trim(),n=/^\[([^\]]+)\]\([^)]*\)$/u.exec(t);return Te(n?n[1]:t).toUpperCase()}function hr(e){let t=/^\[([^\]]+)\]\(([^)]+)\)\s*[:\u2014\u2013-]*\s*(.*)$/u.exec(e);return t?{text:t[3]?`${t[1].trim()} ${t[3].trim()}`:t[1].trim(),link:t[2].trim()}:null}function gr(e){let t=e.search(/\s/u),n=fr((t===-1?e:e.slice(0,t)).replace(/[:.,\u2014\u2013-]+$/u,``));if(!n)return null;let r=(t===-1?``:e.slice(t+1)).replace(/^[:\u2014\u2013-]+\s*/u,``).trim();return{id:n.id,slug:n.slug,rest:r}}function _r(e){let{text:t,link:n}=hr(e)??{text:e,link:``},r=/^\[([^\]]+)\] *(.*)$/u.exec(t);if(r){let e=fr(r[1].trim());return e?{id:e.id,title:r[2].trim()||pr(e.slug)||e.id,link:n}:{id:r[1].trim().toUpperCase(),title:r[2].trim(),link:n}}let i=gr(t);return i?{id:i.id,title:i.rest||pr(i.slug)||i.id,link:n}:{id:``,title:t.trim(),link:n}}function vr(e){let t={},n=t=>{let n=t.exec(e||``)?.[1];return n===void 0?``:(/`([^`]+)`/u.exec(n)?.[1]??n.split(/\s+/u)[0]??``).trim()},r=n(/^\s*(?:[-*] +)?\*\*Target:?\*\*\s*(.*)$/imu);at(r)&&(t.repo=r);let i=n(/^\s*(?:[-*] +)?\*\*Commit[^:*]*:?\*\*\s*(.*)$/imu);return T(i)&&(t.commitHash=i),t}var yr=[`key code reference`,`key code`,`code reference`,`location`,`affected file`,`file`,`path`];function br(e){return{id:mr(e.id||``),title:A(e.title),severity:A(e.severity),pocStatus:A(e[`poc status`]||e.poc),status:A(e.status),parent:mr(A(e.parent||``)),location:A(e.location)}}function xr(e,t=``){let{severity:n,identitySeverity:r}=sr(Z(e.severity),t,cr(e.id)),i=Sr({ref:e.location||``,id:e.id,severity:n,identitySeverity:r,description:he(e.title||e.id)});for(let t of[`pocStatus`,`status`,`parent`])e[t]&&(i[t]=e[t]);return c(i)}function Sr({ref:e,lineBullet:t=``,id:n,severity:r,identitySeverity:i,description:a}){let{file:o,line:s,locationLink:c}=me(e),l={file:o||`unknown`,line:s===`?`&&t?t:s,severity:r,description:a};return c?l.location=c:l.file===`unknown`&&n&&(l.location=`piolium:${n}`),l._idBasis=or({severity:i,description:a,ref:e,lineBullet:t,id:n}),l}function Cr(e,t,n){let r=[];for(let i of e.split(`
71
+ `)){let e=/^\s{0,3}(?:[-*+]|\d{1,3}[.)])\s+(.+)$/u.exec(i);if(!e)continue;let a=e[1].trim();if(/^\*\*[^:*]+:\*\*/u.test(a))continue;let o=hr(a),s=o?.link??``;if(o)a=o.text;else{let e=/^\*\*([^*]+)\*\*\s*[:\u2014\u2013-]*\s*(.*)$/u.exec(a);e&&(a=e[2]?`${e[1].trim()} ${e[2].trim()}`:e[1].trim())}if(/^(?:none\b|no |n\/a\b)/iu.test(a))continue;let l=gr(a),u=l?.id??``,d=a;if(l){let e=pr(l.slug);d=e&&l.rest?`${e}
72
+
73
+ ${l.rest}`:l.rest||e||l.id}let f=n.get(u),{severity:p,identitySeverity:m}=sr(Z(f?.severity),t,cr(u)),h={file:`unknown`,line:`?`,severity:p,description:he(d)};u?h.location=`piolium:${u}`:s&&(h.location=s),s.endsWith(`report.md`)&&(h.reportPath=s);for(let e of[`pocStatus`,`status`,`parent`])f?.[e]&&(h[e]=f[e]);r.push({id:u,finding:c(h,m)})}return r}function wr(e,t,n,r=``){let i=[];for(let a of fe(e)){let e=br(a);!e.id&&!e.title||(!e.parent&&n&&(e.parent=n),e.id&&!t.has(e.id)&&t.set(e.id,e),i.push({id:e.id,finding:xr(e,r)}))}if(i.length>0)return i;let a=Cr(e,r,t);for(let e of a)n&&!e.finding.parent&&(e.finding.parent=n);return a}var Tr=new Set([`technical findings detail`,`technical findings`,`detailed findings`,`findings detail`,`findings`]),Er=/^(?:summary of findings\b|deferred|methodolog|executive|conclusion|attack surface|coverage|discoveries|scope\b|table of contents|contents\b|appendix|recommendation|remediation)/u;function Dr(e){let{id:t}=_r(e);return!!(t&&fr(t))}function Or(e){let t=D(e,se);return(t.length>0?t:D(e,w)).some(({heading:e})=>Dr(e))}function kr(e){let t=C(e).trim();if(!/^# +Security Audit Report\b/mu.test(t)&&!/^## +Technical Findings Detail\s*$/imu.test(t)&&!/^## +Findings by Severity\b/imu.test(t))return null;let{head:n,subs:r}=E(t,oe),i=Ir(r),a=new Map(fe(i[`summary of findings`]||``).map(br).filter(e=>e.id).map(e=>[e.id,e])),o=vr(n),s=[],c=new Set,l=[],u=({id:e,finding:t})=>{s.push(t),e&&c.add(e)},d=e=>{for(let t of e)u(t)};for(let[e,t]of Object.entries(i)){let n=lr(e);n||Tr.has(e)||e.startsWith(`findings by severity`)?d(Pr(t,n,a,l)):!Er.test(e)&&Or(t)&&d(Pr(t,ur(e),a,l))}for(let e of l)(!e.id||!c.has(e.id))&&u(e);for(let e of a.values())c.has(e.id)||u({id:e.id,finding:xr(e)});if(s.length===0)return null;for(let e of s)o.repo&&(e.repo={github:o.repo}),o.commitHash&&!e.auditedCommit&&(e.auditedCommit=o.commitHash);return{type:`security`,source:`piolium`,findings:s}}function Ar(e,t,n,r){let i=[],a=``;for(let{heading:o,body:s}of e){let e=lr(o);if(e)i.push(...Pr(s,e,t,n)),a=``;else if(dr(o))i.push(...Mr(s,t,a,n,r));else{let e=jr(o,s,t,n,r);i.push(...e),a=e[0]?.id||a}}return i}function jr(e,t,n,r,i){let{head:a,subs:o}=E(t,w),s=Fr(e,a,n,i),c=s!==null&&!s.id&&o.some(e=>!dr(e.heading)&&Dr(e.heading)),l=s&&!c?[s]:[];return l.push(...Nr(o,n,r,i,s?.id||``)),l}function Mr(e,t,n,r,i){let{head:a,subs:o}=E(e,w);return r.push(...wr(a,t,n,i)),Nr(o,t,r,i,``)}function Nr(e,t,n,r,i){let a=[],o=``;for(let{heading:s,body:c}of e){if(dr(s)){n.push(...wr(c,t,i??o,r));continue}let e=Fr(s,c,t,r);e&&(a.push(e),o=e.id||o)}return a}function Pr(e,t,n,r){let i=D(e,se);if(i.length>0)return Ar(i,n,r,t);let a=Nr(D(e,w),n,r,t,null);if(a.length>0)return a;let o=fe(e).map(br).filter(e=>e.id||e.title);for(let e of o)!e.severity&&t&&(e.severity=t),e.id&&!n.has(e.id)?n.set(e.id,e):e.id||r.push({id:``,finding:xr(e,t)});return o.length===0&&r.push(...Cr(e,t,n)),[]}function Fr(e,t,n,r=``){let i=e.trim();if(!i)return null;let{id:a,title:o,link:s}=_r(i),l=n.get(a);if(!a&&o){let e=o.toLowerCase();l=[...n.values()].find(t=>t.title.toLowerCase()===e),a=l?.id??``}let{fields:u,labels:d,prose:f}=pe(t),{severity:p,identitySeverity:m}=sr(Z(u.severity),Z(l?.severity),r,cr(a)),h=/\d+/u.exec(u.line||u.lines||``)?.[0]??``,g=/\*\*Variant of:?\*\*\s*\[?([^\]\s)]+)/iu.exec(t),_=f.split(`
74
+ `).filter(e=>!/^\s*<a\s[^>]*>\s*<\/a>\s*$/iu.test(e)&&!/\*\*Variant of:?\*\*/iu.test(e)).join(`
75
+ `).trim(),v=Sr({ref:yr.map(e=>u[e]).find(Boolean)??``,lineBullet:h,id:a,severity:p,identitySeverity:m,description:Rr(o||a,u,d,_)}),ee=u[`poc status`]||u.poc||l?.pocStatus;ee&&(v.pocStatus=ee);let y=u[`detailed report`]||(s.endsWith(`report.md`)?s:``);y&&(v.reportPath=y),l?.status&&(v.status=l.status);let te=l?.parent||(g?mr(g[1]):``);return te&&(v.parent=te),{id:a,finding:c(v)}}function Ir(e){let t=Object.create(null);for(let{heading:n,body:r}of e){let e=n.trim().toLowerCase();e&&(t[e]=e in t?`${t[e]}
76
+ ${r}`:r)}return t}var Lr=new Set([...yr,`severity`,`summary`,`files`,`poc`,`poc status`,`line`,`lines`,`detailed report`,`proof of concept`,`evidence`,`variant of`,`pattern`,`status`,`id`,`title`]);function Rr(e,t,n,r){let i=[e];t.summary&&i.push(t.summary),r&&i.push(r);for(let[e,r]of Object.entries(t))!r||Lr.has(e)||i.push(`**${n[e]||e}:** ${r}`);return i.filter(Boolean).join(`
77
+
78
+ `)}var zr=`<!-- DeepView findings export -->`,Br={annotation:()=>null,location:e=>typeof e?.location==`string`?e.location:null,evidence:e=>typeof e?.url==`string`?e.url:null,commit:()=>null,report:()=>null};function Vr(e,t){let n=e=>typeof e?.source==`string`&&e.source?e.source:null;if(e.length===1)return t=>n(t)??e[0].source??null;let r=new Map(e.map(e=>[e.name,e.source??null]));return e=>n(e)??r.get(t.report(e))??null}function Hr(e,t,n){let r=e.view?.revalidation!==!1,i=(Array.isArray(e.reports)?e.reports:[]).filter(e=>e&&typeof e==`object`),a=Vr(i,t),o=e=>Tt(e,a(e),r),s=new Set(n.map(o)),c=new Set(n.map(e=>t.report(e)).filter(Boolean));return{hooks:t,analyzerOf:o,severityMode:e.view?.severityMode===`original`?`original`:`corrected`,revalidation:r,showAnalyzer:s.size>1,showReport:c.size>1||i.length>1,repo:typeof e.repo==`string`&&e.repo?e.repo:null}}function Ur(e){if(!e)return``;let t=[e.bucket?`${e.bucket} findings`:`Live findings`];return e.severityMode===`original`?t.push(`original analyzer severities`):e.severityMode===`corrected`&&t.push(`corrected severities`),e.revalidation===!1?t.push(`code view — the revalidation pass is not applied`):e.revalidation===!0&&(e.revalidationDetail===!0?t.push(`detailed app view — the revalidation pass is applied, with the rows it re-rated`):e.revalidationDetail===!1?t.push(`app view — the revalidation pass is applied, standing in for the rows it re-rated`):t.push(`app view — the revalidation pass is applied`)),t.join(` · `)}function Wr(e){if(!e)return``;let t=Number(e.included)||0,n=Number(e.total)||0;return n===0?`no findings`:t>=n?`all ${V(n,`finding`)}`:`${t} of ${V(n,`finding`)} (${n-t} filtered out)`}function Gr(e,t,n){let r=[],i=(e,t)=>{t&&r.push(`- **${e}:** ${t}`)},a=Array.isArray(e.reports)?e.reports:[],o=[...new Set(a.map(e=>f[e?.source]??``).filter(Boolean))];i(`Source`,o.join(`, `));let s=a.map(e=>e?.name).filter(Boolean);i(s.length===1?`Report`:`Reports`,s.map(e=>R(e)).join(`, `)),i(`Workspace`,typeof e.workspace==`string`?e.workspace.trim():``),t.repo&&i(`Repository`,wt(t.repo));let c=[...new Set(n.map(t.analyzerOf).filter(Boolean))],l=c.length===o.length&&c.every(e=>o.includes(e));return c.length>0&&!l&&i(c.length===1?`Analyzer`:`Analyzers`,c.join(`; `)),e.generatedAt&&i(`Exported`,Xe(e.generatedAt)),i(`View`,Ur(e.view)),Array.isArray(e.filters)&&i(`Filters`,e.filters.length>0?e.filters.map(e=>`${e.label}: ${e.value}`).join(` · `):`none`),i(`Included`,Wr(e.counts)),r.join(`
79
+ `)}function Kr(e,t){let n=Map.groupBy(e,e=>Ae(e[0],t.severityMode)??`informational`),r=[...j,...[...n.keys()].filter(e=>!j.includes(e))],i=new Set,a=[];for(let e of r)for(let t of n.get(e)??[]){let n=a.length+1,r=Ct(t[0]),o=`${n}. ${r}`;a.push({group:t,number:n,severity:e,title:r,headingText:o,slug:Je(o,i)})}return a}function qr(e){let t=new Map;for(let n of e)t.set(n.severity,(t.get(n.severity)??0)+1);return t}var Jr=[[`flagged`,e=>e.flagged===!0],[`colour-marked`,e=>e.color],[`commented`,e=>e.comment],[`with a fix link`,e=>e.fix]];function Yr(e,t){let n=e.flatMap(({group:e})=>e.map(e=>t.hooks.annotation(e))).filter(Boolean),r=Jr.map(([e,t])=>[n.filter(t).length,e]).filter(([e])=>e>0).map(([e,t])=>`${e} ${t}`);return r.length>0?`Annotations: ${r.join(`, `)}.`:``}function Xr(e){let t=e.some(({group:e})=>e.some(e=>e.confidence!==void 0&&e.confidence!==null)),n=[`#`,`Severity`,`Finding`,`Location`];return t&&n.push(`Confidence`),Ye(n,e.map(e=>{let n=e.group[0],r=e.group.length>1?` (${V(e.group.length,`case`)})`:``,i=I(n),a=[String(e.number),p(e.severity),z(Ge(Ke(e.title)),`#${e.slug}`)+r,i?Ge(R(i)):``];return t&&a.push(n.confidence===void 0||n.confidence===null?``:`${n.confidence}/10`),a}),[`right`])}function Zr(e,t){let n=[B(2,`Summary`)];if(e.length===0)return[...n,`No findings are included.`];let r=[...qr(e)].map(([e,t])=>[p(e),String(t)]);r.push([`**Total**`,`**${e.length}**`]),n.push(Ye([`Severity`,`Findings`],r,[`left`,`right`]));let i=Yr(e,t);return i&&n.push(i),n.push(Xr(e)),n}function Qr(e,t){let n=qr(e),r=[],i=null;for(let a of e)a.severity!==i&&(i=a.severity,r.push(B(2,`${p(i)} (${n.get(i)})`))),r.push(Rt(a.group,t,{headingText:a.headingText,depth:3}));return r}function $r(e={},t={}){let n=Object.fromEntries(Object.entries(Br).map(([e,n])=>[e,typeof t?.[e]==`function`?t[e]:n])),r=(Array.isArray(e.groups)?e.groups:[]).map(e=>Array.isArray(e)?e:[e]).map(e=>e.filter(e=>e&&typeof e==`object`)).filter(e=>e.length>0),i=r.flat(),a=Hr(e,n,i),o=Kr(r,a);return`${Ze([zr,B(1,typeof e.title==`string`&&e.title.trim()?e.title.trim():`Findings`),Gr(e,a,i),...Zr(o,a),...Qr(o,a)])}
80
+ `}var ei=[[`deepview-md`,yn],[`markdown-generic`,Fn],[`deepsec`,xt],[`piolium`,kr],[`claude-security`,Kn]];function Q(e){return Array.isArray(e?.findings)?e.findings:Array.isArray(e?.groups)?e.groups:null}function ti(e,t){return typeof t==`string`&&/\.csv$/iu.test(t)?`codex`:$(e).format}function $(e){let t;try{let t=JSON.parse(e);if(Q(t)){for(let e of ri(Q(t)))c(e);return{data:t,format:`json`,reason:null}}return{data:null,format:null,reason:`JSON, but not a report: no findings array`}}catch(e){t=e}for(let[t,n]of ei)try{let r=n(e);if(r)return{data:r,format:t,reason:null}}catch(e){if(t!==`markdown-generic`)throw e;return{data:null,format:t,reason:e.message}}return{data:null,format:null,reason:`Not JSON, and not a recognized markdown format. (JSON error: ${t.message})`}}function ni(e){let{data:t}=$(e);return t?{count:Q(t).length,source:t.source,recognized:!0}:{count:0,recognized:!1}}function ri(e){return e.flat().filter(e=>e&&typeof e==`object`)}async function ii(e){for(let t of e)c(t);let t=e.filter(e=>!e.id);if(t.length===0)return;let n=await Promise.all(t.map(i));t.forEach((e,t)=>{n[t]&&(e.id=n[t])})}async function ai(e){let{data:t,format:n}=$(e);if(!t)return null;let r=ri(Q(t));return await ii(r),{format:n,data:t,findings:r}}export{n as a,x as b,S as c,we as d,l as e,u as f,d as g,f as h,Ee as i,j,Oe as k,ke as l,Ae as m,je as n,Me as o,M as p,Pe as q,Ie as r,Le as s,N as t,Re as u,F as v,Be as w,Ve as x,Ue as y,I as z,We as A,L as B,nt as C,ot as D,st as E,Pn as F,dt as G,mt as H,$r as I,Q as J,ti as K,$ as L,ni as M,ii as N,ai as O};
@@ -1 +1 @@
1
- var f=new TextEncoder,c=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function u(e){if(typeof e!="string")throw new TypeError(`encodeUtf8 expects a string, got ${typeof e}`);if(!e.isWellFormed())throw new TypeError("encodeUtf8: input contains lone surrogates");return f.encode(e)}var i=2;function d(e){if(typeof e!="string")throw new TypeError(`utf8ByteLength expects a string, got ${typeof e}`);if(/[\u0100-\uFFFF]/.test(e))return f.encode(e).byteLength;let n=/[\u0080-\u00FF]/gu,r=e.length;for(;n.test(e);){let t=n.lastIndex-1;for(let o=0;t<e.length&&o<i;t++)e.codePointAt(t)>127?(r++,o=0):o++;n.lastIndex=t}return r}function l(e){if(!ArrayBuffer.isView(e)&&!(e instanceof ArrayBuffer))throw new TypeError(`decodeUtf8 expects a BufferSource, got ${e===null?"null":typeof e}`);return c.decode(e)}export{u as a,d as b,l as c};
1
+ var e=new TextEncoder,t=new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});function n(t){if(typeof t!=`string`)throw TypeError(`encodeUtf8 expects a string, got ${typeof t}`);if(!t.isWellFormed())throw TypeError(`encodeUtf8: input contains lone surrogates`);return e.encode(t)}var r=2;function i(t){if(typeof t!=`string`)throw TypeError(`utf8ByteLength expects a string, got ${typeof t}`);if(/[\u0100-\uFFFF]/.test(t))return e.encode(t).byteLength;let n=/[\u0080-\u00FF]/gu,i=t.length;for(;n.test(t);){let e=n.lastIndex-1;for(let n=0;e<t.length&&n<r;e++)t.codePointAt(e)>127?(i++,n=0):n++;n.lastIndex=e}return i}function a(e){if(!ArrayBuffer.isView(e)&&!(e instanceof ArrayBuffer))throw TypeError(`decodeUtf8 expects a BufferSource, got ${e===null?`null`:typeof e}`);return t.decode(e)}export{n as a,i as b,a as c};
@@ -0,0 +1,2 @@
1
+ import{a as e,c as t,j as n}from"./chunk-2XUEZHIP.js";var r=`:host{display:inline-flex;flex-shrink:0;vertical-align:middle;--switch-track-width: 26px;--switch-track-height: 14px}button,.checkbox-mode{align-items:center;gap:8px;box-sizing:border-box;height:30px;margin:0;padding:0 .6rem;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);background:transparent;color:var(--muted);font:inherit;font-size:.78rem;font-weight:500;line-height:1;white-space:nowrap;cursor:default}button{display:var(--switch-button-display, inline-flex);&:hover:not(:disabled){color:var(--text);background:rgb(from var(--text) r g b / .04)}&[aria-pressed=true]{color:var(--text)}&:disabled{opacity:.4}&:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}}.checkbox-mode{display:var(--switch-checkbox-display, none);border:0;color:var(--text);&:has(:disabled){opacity:.4}& input{width:.85rem;height:.85rem;margin:0;accent-color:var(--accent)}}.track{position:relative;flex-shrink:0;width:var(--switch-track-width);height:var(--switch-track-height);background:var(--border);border-radius:var(--ui-radius, 8px);transition:background .15s;&:after{content:"";position:absolute;top:2px;left:2px;width:calc(var(--switch-track-height) - 4px);height:calc(var(--switch-track-height) - 4px);border-radius:50%;background:var(--muted);transition:transform .15s,background .15s}}button[aria-pressed=true] .track{background:color-mix(in oklch,var(--accent) 22%,transparent);&:after{transform:translate(calc(var(--switch-track-width) - var(--switch-track-height)));background:var(--accent)}}:host([borderless]) :is(button,.checkbox-mode){height:100%;border:0;border-radius:0}:host([compact]){--switch-track-width: 22px;--switch-track-height: 12px}:host([compact]) :is(button,.checkbox-mode){height:auto;gap:7px;padding:2px 8px;border-radius:var(--ui-radius, 6px);font-size:.68rem;line-height:1.2}:host-context(body.theme-w95){.checkbox-mode{padding:0 4px;color:#000;font-size:11px;font-weight:400}.checkbox-mode input{appearance:none;width:13px;height:13px;background:#fff;box-shadow:var(--w95-sunken);&:checked{background:var(--w95-check),#fff}}}
2
+ `,i=class extends n{static properties={checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},label:{type:String},accessibleLabel:{type:String,attribute:`accessible-label`}};static styles=e(r);constructor(){super(),this.checked=!1,this.disabled=!1,this.label=``,this.accessibleLabel=``}_checkboxClick(e){(this.disabled||e.target.tagName!==`INPUT`)&&e.stopPropagation()}render(){return t`<button type="button" part="button" aria-pressed="${String(this.checked)}" aria-label="${this.accessibleLabel||this.label}" ?disabled="${this.disabled}"><span>${this.label}</span><span class="track" part="track" aria-hidden="true"></span></button> <label class="checkbox-mode" @click="${this._checkboxClick}"><input type="checkbox" part="checkbox" .checked="${this.checked}" ?disabled="${this.disabled}" aria-label="${this.accessibleLabel||this.label}"> <span>${this.label}</span></label>`}};customElements.get(`mode-switch`)||customElements.define(`mode-switch`,i);
@@ -0,0 +1,2 @@
1
+ var e=/[\p{Cc}\p{Zl}\p{Zp}\p{Bidi_Control}]/gu,t=(e,t)=>e.length>t?e.slice(0,e.codePointAt(t-1)>65535?t-1:t):e,n=e=>`U+${e.codePointAt(0).toString(16).toUpperCase().padStart(4,`0`)}`,r=t=>JSON.stringify(t).replaceAll(e,e=>`\\u${e.codePointAt(0).toString(16).padStart(4,`0`)}`);function i(e){let n=t(e,64);return n===e?r(e):`${r(n)}...`}var a=class extends Error{constructor(e,t){super(t===void 0?e:`${e} at line ${t+1}`),this.name=new.target.name,this.line=t}},o=class extends Error{constructor(e,t){super(t===void 0?e:`${t}: ${e}`),this.name=`LockfileError`,this.where=t}},s=(e,t)=>{throw new o(e,t)};function c(e,t){try{return e()}catch(e){return t(e)}}function l(e){let n=t(e,200);return r(n===e?e:`${n}\u2026`)}var u=/^[A-Za-z_$][\w$]*$/u;function d(e,t){return u.test(t)?e===``?t:`${e}.${t}`:`${e}[${l(t)}]`}var f=(e,t)=>new o(`${e} at line ${Math.max(t,0)+1}`),p=/[\p{Cc}\p{Cs}\uFEFF\uFFFE\uFFFF\u2028\u2029]/u,m=[`<<<<<<<`,`=======`,`>>>>>>>`];function h(e,t){if(m.every(t=>e.includes(t)))throw new o(`${t} reads a file with ${m.map(e=>l(e)).join(`, `)} in it as a merge conflict`)}function g(e,t){let n=/^\{(\r?\n)([\t ]+)"/u.exec(e);if(n===null)throw f(`expected "{" alone on the first line and an indented key on the next, as ${t} writes the file`,0);return n.slice(1)}function _(e,t){t.lastIndex=e.pos;let n=t.exec(e.text);return n!==null&&(e.pos=t.lastIndex),n}var v=(e,t)=>t<e.length?l(e.slice(t)):`the end of the line`,y=e=>/^ */u.exec(e)[0].length,b=2**20,x=(e,t)=>({text:e,forbidden:t,pos:0,number:-1,line:void 0,crlf:void 0});function S(e){let{text:t,pos:r}=e;if(e.line=void 0,r>=t.length)return;let i=t.indexOf(`
2
+ `,r);i===-1&&(i=t.length),e.pos=i+1,e.number++;let a=i<t.length&&t[i-1]===`\r`,o=t.slice(r,a?i-1:i);if(o.length>b)throw f(`a line longer than ${b} characters`,e.number);let s=e.forbidden.exec(o)?.[0];if(s!==void 0)throw f(`${n(s)} is not allowed`,e.number);if(i<t.length&&a!==(e.crlf??=a))throw f(`a ${a?`CRLF`:`LF`} line end, after ${e.crlf?`CRLF`:`LF`} ones`,e.number);e.line=o}function C(e,t,n){let r=t+1;for(;r<e.length&&e[r]!==`"`;)r+=e[r]===`\\`?2:1;if(r>=e.length)throw f(`a string with no closing quote`,n);let i=e.slice(t,++r);if(!i.includes(`\\`))return[i.slice(1,-1),r];let a=c(()=>JSON.parse(i),()=>{throw f(`${l(i)} is not a string as JSON writes it`,n)});if(JSON.stringify(a)!==i)throw f(`${l(i)} is not written as JSON writes ${l(a)}`,n);return[a,r]}export{n as a,i as b,a as c,o as d,s as e,c as f,l as g,d as h,f as i,p as j,h as k,g as l,_ as m,v as n,y as o,b as p,x as q,S as r,C as s};
@@ -0,0 +1,10 @@
1
+ import{a as e,b as t,c as n}from"./chunk-C4Z6ZBXV.js";import{f as r,g as i}from"./chunk-2XUEZHIP.js";var a=class extends n{constructor(t){if(super(t),this.it=i,t.type!==e.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===i||e==null)return this._t=void 0,this.it=e;if(e===r)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};a.directiveName=`unsafeHTML`,a.resultType=1;var o=t(a),s=/^/u,c=/^true$/u,l=/^[\w .,#%()-]*$/u,u=Object.fromEntries([`fill`,`fill-opacity`,`fill-rule`,`clip-rule`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`,`stroke-opacity`,`stroke-dasharray`,`opacity`,`transform`].map(e=>[e,l])),d=(...e)=>({...u,...Object.fromEntries(e.map(e=>[e,l]))}),f=new Set;function p(e){for(let t of e)f.add(t)}var m=e=>{let[t,...n]=e.split(` `);return t===`token`&&n.every(e=>f.has(e)||/^language-[\w-]+$/u.test(e))},h={__proto__:null,span:{class:{test:e=>m(e)||/^(?:code-control|evd-lineno|report-logo brand-[\w-]+)$/u.test(e)},title:s,"data-tooltip":s,"aria-hidden":c},mark:{class:/^diff-word$/u},code:{class:/^evd-line$/u},button:{type:/^button$/u,class:/^bundle-source-link$/u,"data-bundle-source-link":s},a:{class:/^source-node-doc$/u,href:/^https:\/\/nodejs\.org\/api\/[\w/-]+\.html(?:#[\w-]*)?$/u,target:/^_blank$/u,rel:/^noopener noreferrer$/u,"aria-label":s},svg:{...d(`viewBox`,`width`,`height`),class:/^file-icon(?: brand-[\w-]+)?$/u,"aria-hidden":c},g:u,path:{...d(`d`),class:/^(?:bg|fg)$/u},rect:d(`x`,`y`,`width`,`height`,`rx`,`ry`),circle:d(`cx`,`cy`,`r`),ellipse:d(`cx`,`cy`,`rx`,`ry`),line:d(`x1`,`y1`,`x2`,`y2`),polyline:d(`points`),polygon:d(`points`)},g=/<(?:([a-z]+)((?:[\t\n\f\r ]+[a-zA-Z][\w-]*="[^"]*")*)[\t\n\f\r ]*\/?|\/([a-z]+)[\t\n\f\r ]*)>/uy,_=/([a-zA-Z][\w-]*)="([^"]*)"/gu;function v(e){if(typeof e!=`string`)return!1;for(let t=e.indexOf(`<`);t!==-1;t=e.indexOf(`<`,g.lastIndex)){g.lastIndex=t;let[,n,r,i]=g.exec(e)??[],a=h[n??i];if(!a)return!1;for(let[,e,t]of r?.matchAll(_)??[])if(!Object.hasOwn(a,e)||!a[e].test(t))return!1}return!0}function y(e){return console.error(`Not markup this app writes, shown as text instead:`,e.length>300?`${e.slice(0,300)}\u2026`:e),e}var b=new Set;function x(e){return e==null||e===i?e:b.has(e)?o(e):v(e)?(b.size>=256&&b.clear(),b.add(e),o(e)):y(String(e))}var S=`m5.875 10.154 1.376-.772.023-.067-.023-.037h-.067l-.23-.015-.787-.02-.681-.03-.661-.035-.166-.035-.156-.205.016-.103.14-.094.2.018.442.03.665.046.481.028.714.075h.113l.016-.047-.039-.028-.03-.028-.687-.466-.744-.492-.39-.284-.21-.143-.106-.135-.046-.294.19-.21.258.017.065.018.26.2.557.43.726.535.106.089.042-.03.006-.022-.048-.08-.395-.713-.422-.726-.187-.301-.05-.18a1 1 0 0 1-.03-.213l.218-.296.12-.039.29.039.123.106.18.413.293.65.453.884.133.262.07.242.027.075h.046v-.043l.038-.497.069-.611.067-.787.023-.221.11-.266.218-.143.17.081.14.2-.02.13-.083.54-.163.846-.106.567h.062l.07-.07.287-.382.482-.602.213-.239.248-.264.159-.125h.301l.221.329-.099.34-.31.393-.256.333-.369.496-.23.397.021.032.055-.006.832-.177.45-.081.537-.092.243.113.026.115-.096.236-.573.141-.673.135-1.003.237-.012.01.014.017.452.042.193.01h.473l.88.066.23.153.138.186-.023.141-.354.181-.478-.113-1.116-.266-.383-.096h-.053v.032l.32.312.584.528.731.68.037.168-.094.133-.099-.014-.643-.484-.248-.218-.561-.472H9.08v.05l.129.189.684 1.027.035.315-.05.103-.177.062-.194-.036-.4-.561-.413-.632-.333-.567-.041.023-.197 2.116-.092.108-.212.082-.177-.135-.094-.218.094-.43.113-.561.092-.447.083-.554.05-.184-.004-.013-.04.006-.418.574-.636.858-.503.539-.12.048-.21-.108.02-.193.117-.172.696-.886.42-.549.27-.317-.001-.046h-.016l-1.85 1.201-.328.042-.142-.132.018-.218.067-.071.556-.383Z`,C=`M11.04 8.364a1.72 1.72 0 0 0-.152-1.432 1.8 1.8 0 0 0-1.925-.846 1.8 1.8 0 0 0-.778-.498 1.8 1.8 0 0 0-.927-.05 1.8 1.8 0 0 0-.827.414 1.77 1.77 0 0 0-.507.767 1.8 1.8 0 0 0-.683.297 1.75 1.75 0 0 0-.499.549 1.75 1.75 0 0 0 .22 2.07 1.72 1.72 0 0 0 .151 1.432 1.8 1.8 0 0 0 1.926.846 1.77 1.77 0 0 0 1.333.587c.78 0 1.47-.496 1.707-1.227a1.8 1.8 0 0 0 .684-.298 1.75 1.75 0 0 0 .499-.548 1.75 1.75 0 0 0-.222-2.063m-2.667 3.678a1.33 1.33 0 0 1-.851-.304l.042-.024 1.413-.804a.23.23 0 0 0 .116-.199V8.747l.597.34q.01.005.011.015v1.629a1.323 1.323 0 0 1-1.328 1.31m-2.857-1.203a1.3 1.3 0 0 1-.158-.879l.042.025 1.414.805a.23.23 0 0 0 .23 0l1.729-.982v.68a.02.02 0 0 1-.01.018l-1.431.814a1.34 1.34 0 0 1-1.816-.48m-.372-3.037a1.32 1.32 0 0 1 .7-.574v1.656a.22.22 0 0 0 .114.197l1.72.979-.598.34a.02.02 0 0 1-.021 0L5.63 9.587a1.304 1.304 0 0 1-.487-1.791zm4.907 1.125L8.327 7.94l.596-.34a.02.02 0 0 1 .02 0l1.43.814a1.3 1.3 0 0 1 .512.528 1.3 1.3 0 0 1-.118 1.4 1.33 1.33 0 0 1-.595.436V9.122a.23.23 0 0 0-.12-.195m.594-.881-.042-.025-1.411-.812a.23.23 0 0 0-.232 0l-1.727.983v-.68a.02.02 0 0 1 .008-.018l1.429-.813a1.34 1.34 0 0 1 1.425.061 1.3 1.3 0 0 1 .55 1.298zM6.908 9.252l-.597-.34a.02.02 0 0 1-.012-.016V7.271c0-.249.073-.493.209-.703s.329-.378.557-.483a1.35 1.35 0 0 1 1.415.18l-.042.023-1.413.804a.23.23 0 0 0-.116.2zm.324-.69.77-.438.77.438v.875l-.768.437-.77-.437z`,w=`M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z`,T=`M11.998 24c-.321 0-.641-.084-.922-.247l-2.936-1.737c-.438-.245-.224-.332-.08-.383c.585-.203.703-.25 1.328-.604c.065-.037.151-.023.218.017l2.256 1.339c.082.045.197.045.272 0l8.795-5.076c.082-.047.134-.141.134-.238V6.921c0-.099-.053-.192-.137-.242l-8.791-5.072c-.081-.047-.189-.047-.271 0L3.075 6.68C2.99 6.729 2.936 6.825 2.936 6.921v10.15c0 .097.054.189.139.235l2.409 1.392c1.307.654 2.108-.116 2.108-.89V7.787c0-.142.114-.253.256-.253h1.115c.139 0 .255.112.255.253v10.021c0 1.745-.95 2.745-2.604 2.745c-.508 0-.909 0-2.026-.551L2.28 18.675c-.57-.329-.922-.945-.922-1.604V6.921c0-.659.353-1.275.922-1.603l8.795-5.082c.557-.315 1.296-.315 1.848 0l8.794 5.082c.57.329.924.944.924 1.603v10.15c0 .659-.354 1.273-.924 1.604l-8.794 5.078C12.643 23.916 12.324 24 11.998 24zM19.099 13.993c0-1.9-1.284-2.406-3.987-2.763c-2.731-.361-3.009-.548-3.009-1.187c0-.528.235-1.233 2.258-1.233c1.807 0 2.473.389 2.747 1.607c.024.115.129.199.247.199h1.141c.071 0 .138-.031.186-.081c.048-.054.074-.123.067-.196c-.177-2.098-1.571-3.076-4.388-3.076c-2.508 0-4.004 1.058-4.004 2.833c0 1.925 1.488 2.457 3.895 2.695c2.88.282 3.103.703 3.103 1.269c0 .983-.789 1.402-2.642 1.402c-2.327 0-2.839-.584-3.011-1.742c-.02-.124-.126-.215-.253-.215h-1.137c-.141 0-.254.112-.254.253c0 1.482.806 3.248 4.655 3.248C17.501 17.007 19.099 15.91 19.099 13.993z`,E=`<svg class="file-icon" viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2 2 5v6l6 3 6-3V5L8 2Z"/><path d="M2 5l6 3 6-3"/><path d="M8 8v6"/></svg>`,D=`<svg class="file-icon" viewBox="0 0 16 16" width="14" height="14" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M1 1h14v14H1Zm3 3v8h4V6h2v6h2V4Z"/></svg>`,O=`<svg class="file-icon" viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="4" width="11" height="9" rx="1.2"/><path d="M6 4V3h4v1"/></svg>`,k=`<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><path d="m4.5 4.5 7 2-5 5z"/><circle cx="4.5" cy="4.5" r="2" fill="currentColor"/><circle cx="11.5" cy="6.5" r="2" fill="currentColor"/><circle cx="6.5" cy="11.5" r="2" fill="currentColor"/></svg>`,A=`<svg viewBox="0 0 16 16" width="16" height="16" fill="currentColor" aria-hidden="true"><rect x="1" y="1.5" width="14" height="3" rx=".5"/><rect x="1" y="6.5" width="8" height="3" rx=".5"/><rect x="11" y="6.5" width="4" height="3" rx=".5"/><rect x="1" y="11.5" width="4" height="3" rx=".5"/><rect x="7" y="11.5" width="8" height="3" rx=".5"/></svg>`,j=`<svg viewBox="0 0 16 16" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M1 1h4v4H1zm5 5h4v4H6zm5 5h4v4h-4z"/><path d="M6 1h4v4H6zm5 0h4v4h-4zM1 6h4v4H1zm10 0h4v4h-4zM1 11h4v4H1zm5 0h4v4H6z" opacity=".35"/></svg>`,M=`<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="2.5" r="1.5" fill="currentColor"/><circle cx="3" cy="13" r="1.5" fill="currentColor"/><circle cx="8" cy="13" r="1.5" fill="currentColor"/><circle cx="13" cy="13" r="1.5" fill="currentColor"/><path d="M8 4v3M8 7H3m5 0h5M3 7v4M8 7v4M13 7v4"/></svg>`,N=`<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>`,P=`<svg class="file-icon" viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6.67 8.67a3.33 3.33 0 0 0 5.03.36l2-2a3.33 3.33 0 0 0-4.71-4.71l-1.15 1.14"/><path d="M9.33 7.33a3.33 3.33 0 0 0-5.03-.36l-2 2a3.33 3.33 0 0 0 4.71 4.71l1.14-1.14"/></svg>`,F=`<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 1.5H2.5a1 1 0 0 0-1 1V5m9.5-3.5h2.5a1 1 0 0 1 1 1V5M1.5 11v2.5a1 1 0 0 0 1 1H5m6 0h2.5a1 1 0 0 0 1-1V11"/><circle cx="7.25" cy="7.25" r="2.75"/><path d="m9.25 9.25 2.25 2.25"/></svg>`,I=`<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 1.5H4a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V5.5L9 1.5ZM9 1.5v4h4M5.5 8h5m-5 3h3.5"/></svg>`,L=`<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20V2H6.5A2.5 2.5 0 0 0 4 4.5zM4 19.5A2.5 2.5 0 0 0 6.5 22H20v-5"/></svg>`,R=`<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m4.5 4.5-3 3.5 3 3.5m7-7 3 3.5-3 3.5M9.5 2l-3 12"/></svg>`,z=`<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6.5 3.5 1.6 3.9L12 9l-3.9 1.6-1.6 3.9-1.6-3.9L1 9l3.9-1.6 1.6-3.9ZM12 1.5v4m-2-2h4"/></svg>`,B=`<svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg>`,V=`<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 1.5v2"/><rect x="2" y="3.5" width="12" height="10" rx="2.5"/><path d="M6 7.5v2m4-2v2"/></svg>`,H=`<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" aria-hidden="true"><path d="M1 8h3.5m7 0H15"/><circle cx="8" cy="8" r="3.5"/></svg>`,U=`<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="4" cy="3.5" r="1.5"/><circle cx="4" cy="12.5" r="1.5"/><circle cx="12" cy="12.5" r="1.5"/><path d="M4 5v6M12 11V6a2 2 0 0 0-2-2H7m1.5-1.5L7 4l1.5 1.5"/></svg>`,W=`<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round" aria-hidden="true"><path d="M2 2h5.5l6.5 6.5-5.5 5.5L2 7.5Z"/><circle cx="5" cy="5" r="1"/></svg>`,G=`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m10 2 4 4-8 8H2v-4l8-8Zm-1 1 4 4"/></svg>`,K=`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 4h12M6 4V2h4v2M4 4l.6 10h6.8L12 4M6.5 7v4m3-4v4"/></svg>`;export{p as a,v as b,y as c,x as d,S as e,C as f,w as g,T as h,E as i,D as j,O as k,k as l,A as m,j as n,M as o,N as p,P as q,F as r,I as s,L as t,R as u,z as v,B as w,V as x,H as y,U as z,W as A,G as B,K as C};
2
+ /*! Bundled license information:
3
+
4
+ lit-html/directives/unsafe-html.js:
5
+ (**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ *)
10
+ */
@@ -0,0 +1,6 @@
1
+ import{a as e}from"./chunk-SXV2T5C4.js";import{b as t}from"./chunk-TUII34K2.js";var n={__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`},r={__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 i(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 a(e,t,a){if(typeof t==`string`&&r[t])return r[t];if(typeof e!=`string`)return null;let o=e.slice(e.lastIndexOf(`/`)+1),s=o.lastIndexOf(`.`);if(s<=0)return null;let c=o.slice(s+1).toLowerCase();return c===`map`?i(a)?`json`:null:n[c]??null}var o=new Set([`module`,`commonjs`,`json`,`module-typescript`,`commonjs-typescript`]),s=new Set([`solidity`,`php`,`shell`,`rust`]),c=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`]),l=new Set([`resource`,`resource:base64`]),u=new Set([`stat:file`,`stat:directory`]),d=new Set([...o,...s,...c,...l,`patch`,`directory`,...u]),f=e=>u.has(e),p=e=>e===`directory`||e===`stat:directory`?`directory`:`file`;function m(e,t,n){if(e===t)return e;let r=f(e);if(r!==f(t)&&p(e)===p(t))return r?t:e;throw Error(`format conflict for '${n}' ('${t}' vs '${e}')`)}function h(e,t){return t===``?e:e===`.`?t:`${e}/${t}`}var ee=/^(?=[A-Za-z0-9-]{1,39}\/)[A-Za-z0-9](?:-?[A-Za-z0-9])*\/(?!\.\.?$)[\w.-]{1,100}$/u,te=/^(?!\.\.?(?:\/|$))[\w.~@+-]+(?:\/(?!\.\.?(?:\/|$))[\w.~@+-]+)*$/u,ne=/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u,g={github:e=>typeof e==`string`&&ee.test(e),directory:e=>typeof e==`string`&&e.length<=1024&&(e===``||te.test(e)),commit:e=>typeof e==`string`&&ne.test(e)},re=(e,t)=>e?.toLowerCase()===t?.toLowerCase(),_=(e,t,n)=>{if(e===void 0)return;x(e)||y(!1,`${n} must be an object`);for(let r of Object.keys(e))Object.hasOwn(t,r)||y(!1,`unknown ${n} key '${r}'`);let r=Object.entries(t).map(([t,r])=>typeof r==`object`?[t,_(e[t],r,`${n}.${t}`)]:(e[t]!==void 0&&!r(e[t])&&y(!1,`invalid ${n}.${t}: ${JSON.stringify(e[t])}`),[t,e[t]])).filter(([,e])=>e!==void 0);return r.length===0?void 0:Object.freeze(S(r))},ie=(e,t=`bundle repo`)=>_(e,g,t),ae=(e,t)=>t??(O(e)?`npm`:void 0),oe=(e,{ecosystem:t,repo:n},r)=>{if(n===void 0)return;ae(e,t)===void 0&&y(!1,`${r}: '${e}' is no dependency's bucket, and carries no repo`);let i=ie(n,`${r} module '${e}' repo`);return i?.github===void 0&&y(!1,`${r} module '${e}' repo has no github`),i},v=({name:e,version:t,ecosystem:n,repo:r,files:i})=>({name:e,version:t,...n===void 0?{}:{ecosystem:n},...r===void 0?{}:{repo:r},files:i});function se({name:e,version:t,ecosystem:n,repo:r,files:i},a,o){return y(n===void 0||typeof n==`string`),v({name:e,version:t??void 0,ecosystem:n,repo:oe(a,{ecosystem:n,repo:r},o),files:S(Object.entries(i))})}function ce(e,{scope:t=`full`}={}){let n=new Set;for(let[r,{files:i}]of e)if(t===`full`||O(r))for(let e of Object.keys(i))n.add(h(r,e));return n}function le(e,{what:t,files:n,formats:r,scope:i}){if(e.includes(`\\`))return`holds a '\\'`;if(w(e))return`escapes the root`;if(i!==`full`&&!O(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`:f(a)?`is a payload-free '${a}' record, not a file`:null}function ue(e,{what:t,files:n,formats:r,scope:i}){for(let a of e){let e=le(a,{what:t,files:n,formats:r,scope:i});y(e===null,`${t}: executable entry '${a}' ${e}`)}}function de(e,{what:t,files:n,formats:r,scope:i=`full`}){if(e===void 0)return new Set;let a=`${t}: executable`;y(Array.isArray(e),`${a} must be an array of file paths`);let o=new Set;for(let t of e)y(typeof t==`string`&&t!==``,`${a} entry must be a non-empty string`),y(!o.has(t),`${a} entry '${t}' is listed twice`),o.add(t);return ue(o,{what:t,files:n,formats:r,scope:i}),o}function fe(e,{what:t,modules:n,formats:r,scope:i}){if(e.size!==0)return ue(e,{what:t,files:ce(n,{scope:i}),formats:r,scope:i}),C(e)}function y(e,t){if(!e)throw Error(t)}function pe(e,t){let[n,r]=[e.split(`/`),t.split(`/`)];for(;n.length>0&&n[0]===r[0];)n.shift(),r.shift();if(n.length===0&&r.length===0)return 0;if(n.length<2)return r.length<2&&n>r?1:-1;if(r.length<2)return 1;if(n[0]===`*`)return-1;if(r[0]===`*`||n[0]===`node_modules`)return 1;if(r[0]===`node_modules`)return-1;let[i,a]=[n,r].map(e=>e.join(String.fromCodePoint(0)));if(i<a)return-1;if(i>a)return 1;throw Error(`Unreachable`)}var b=(e,t)=>pe(e[0],t[0]),x=e=>e&&[null,Object.prototype].includes(Object.getPrototypeOf(e)),S=e=>Object.setPrototypeOf(Object.fromEntries(e),null),C=e=>[...e].toSorted(pe),me=(e,{sorted:t=!0}={})=>S((t?[...e].toSorted(b):[...e]).map(([e,n])=>[e,n instanceof Map?me(n,{sorted:t}):n])),he=(e,t)=>e.get(t)??e.set(t,new Map).get(t),ge=e=>new Map(Object.entries(e).map(([e,t])=>[e,x(t)?ge(t):t]));function w(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 _e=e=>e.includes(`\\`)||w(e),T=(e,t)=>y(!_e(e),`${t}: path '${e}' escapes the root or holds a '\\'`),ve=(e,t)=>y(typeof e==`string`&&e!==``&&!_e(e),`${t}: invalid entry ${JSON.stringify(e)}`);function ye(e,t){y(Array.isArray(e),`${t}: entries must be an array of file paths`);let n=new Set;for(let r of e)ve(r,t),y(!n.has(r),`${t}: entry '${r}' is listed twice`),n.add(r);return n}function be(e,t){for(let n of e)ve(n,t);return C(e)}function xe(e,t){T(e,`formats`),y(d.has(t),`unknown format '${t}' for ${e}`)}function Se(e){y(x(e));let t=new Map;for(let[n,r]of Object.entries(e)){xe(n,r);let e=n===``?`.`:n;y(!t.has(e),`duplicate format key '${e}'`),t.set(e,r)}return t}function Ce(e){for(let[t,n]of e)xe(t,n);return me(e)}function we(e){for(let[,t]of e){y(t instanceof Map);for(let[e,n]of t){T(e,`imports`),y(n instanceof Map);for(let[,e]of n){if(typeof e==`string`){T(e,`imports`);continue}y(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)y(typeof t==`string`&&t.length>0&&!t.includes(`/`),`invalid platform key '${t}'`),y(typeof n==`string`),T(n,`imports`)}}}}function Te(e){y(x(e));let t=ge(e);return we(t),t}function Ee(e){return we(e),me(e)}function De(e,{skipEmpty:t=!1,repo:n=!0,what:r}={}){let i={modules:[],sources:[]};for(let[a,o]of e){if(t&&Object.keys(o.files).length===0)continue;let e=O(a);e&&y(o.name&&o.version&&o.files);let s=S(Object.entries(o.files).toSorted(b));i[e?`modules`:`sources`].push([a,v({...o,repo:n?oe(a,o,r):void 0,files:s})])}return{modules:S(i.modules.toSorted(b)),sources:S(i.sources.toSorted(b))}}function Oe(e,t){let n=e instanceof Map;if(n!==t instanceof Map)return!1;if(!n)return e===t;if(e.size!==t.size)return!1;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}var ke=e=>e instanceof Map?`{${[...e].map(([e,t])=>`${e}: ${t}`).join(`, `)}}`:e;function Ae(e,t,n){let r=new Map,i=e=>{for(let[t,i]of e){let e=he(r,t);for(let[t,r]of i){let i=he(e,t);for(let[e,a]of r)i.has(e)?y(Oe(i.get(e),a),`${n}: import '${e}' from '${t}' resolves differently ('${ke(i.get(e))}' vs '${ke(a)}')`):i.set(e,a instanceof Map?new Map(a):a)}}};return i(e),i(t),r}function je(e,t,n){let r=new Map,i=e=>{for(let[t,i]of e){let e=r.get(t);if(e===void 0){r.set(t,i);continue}try{r.set(t,m(i,e,t))}catch(e){throw Error(`${n}: ${e.message}`,{cause:e})}}};return i(e),i(t),r}function Me(e,t,n,r){if(e.size===0)return new Set(t);let i=ce(n,{scope:r}),a=new Set(t);for(let t of e)i.has(t)||a.add(t);return a}var Ne=/(?:^|\/)\.{0,2}(?:\/|$)/u;function E(e,t,n){let r=h(e,t);return(r!==`.`||t!==``)&&Ne.test(r)&&y(!1,`${n}: non-canonical file key ${JSON.stringify(r)}`),r.includes(`\\`)&&y(!1,`${n}: file key '${r}' holds a '\\', which no path may`),r}function D(e,t,n){let r=new Map;for(let[i,{files:a}]of e){typeof i!=`string`&&y(!1,`${t}: bucket dir ${String(i)} is not a string`),T(i,t);for(let e of Object.keys(a)){let a=E(i,e,t),o=r.get(a);o!==void 0&&n(a,o,i),r.set(a,i)}}return r}var Pe=(e,t)=>n=>y(!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 Fe(e,t,n){let r=new Map,i=e=>{for(let[t,i]of e){let e=r.get(t);if(e===void 0){r.set(t,v({...i,files:Object.assign(Object.create(null),i.files)}));continue}y(e.name===i.name,`${n}: module '${t}' name mismatch ('${e.name}' vs '${i.name}')`),y(e.version===i.version,`${n}: module '${t}' version mismatch ('${e.version}' vs '${i.version}')`+(e.version==null==(i.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)`)),y(e.ecosystem===i.ecosystem,`${n}: module '${t}' ecosystem mismatch ('${e.ecosystem??`(none)`}' vs '${i.ecosystem??`(none)`}')`),e.repo===void 0&&i.repo!==void 0&&r.set(t,v({...e,repo:i.repo}));for(let[r,a]of Object.entries(i.files))Object.hasOwn(e.files,r)?y(e.files[r]===a,`${n}: content mismatch for '${h(t,r)}'`):e.files[r]=a}};return i(e),i(t),D(r,n,(e,t,r)=>y(!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)`)),r}function O(e){return e.split(`/`).includes(`node_modules`)}function Ie(e){let t=e.length;for(;(t=e.lastIndexOf(`node_modules/`,t-1))!==-1;)if(t===0||e[t-1]===`/`)return t;return-1}function Le(e){let t=Ie(e);if(t===-1)return null;let n=t+13,r=e.slice(n).split(`/`),i=r[0].startsWith(`@`)?2:1;if(r.length<=i||r.slice(0,i).some(e=>!e))return null;let a=r.slice(0,i).join(`/`);return{dir:e.slice(0,n)+a,rel:r.slice(i).join(`/`),name:a}}var k=1,Re=0,ze=Pe(`bundle`,`artifact (bundle=replace)`),Be=e=>Le(e)??{dir:`.`,rel:e===`.`?``:e,name:null};function Ve(){throw Error(`bundle: file contents are not retained by this contents-free Bundle`)}var He=(e,{files:t,...n})=>{let r=Object.create(null);for(let[n,i]of Object.entries(t))typeof i!=`symbol`&&y(!1,`bundle: file '${h(e,n)}' is not a placeholder`),Object.defineProperty(r,n,{get:Ve,enumerable:!0});return{...n,files:Object.freeze(r)}},A=(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??{})){if(!Array.isArray(t))continue;let r=n.get(e);r===void 0&&n.set(e,r=new Set);for(let e of t)r.add(e)}return S([...n.keys()].toSorted().map(e=>[e,C(n.get(e))]))},Ue=(e,t)=>Object.hasOwn(g,e)&&g[e](t),We=(e,t)=>e?.github===void 0||!re(e.github,t?.github)?void 0:S(Object.keys(g).filter(n=>e[n]!==void 0&&(n===`github`||e[n]===t[n])).map(t=>[t,e[t]])),Ge=e=>{if(!x(e)||e.root!==!0||Object.hasOwn(e,`directory`))return e;let{root:t,...n}=e;return n},Ke=e=>typeof e==`string`&&/^[\w.+@/~'!()*-]+$/u.test(e),j={name:Ke,version:Ke},qe={npm:j,composer:j,cargo:j},Je=(e,t)=>S(Object.keys(qe).map(n=>{let[r,i]=[e?.[n],t?.[n]];return[n,r?.name!==void 0&&r.name===i?.name?S(Object.entries(r).filter(([e,t])=>t===i[e])):void 0]})),M=class e{static VERSION=k;version=k;config;entries;modules;formats;imports;executable;reason;#e;get repo(){return this.#e}set repo(e){this.#e=ie(e)}#t;get package(){return this.#t}set package(e){this.#t=_(e,qe,`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=k}={}){y([Re,k].includes(l)),y([`node_modules`,`full`].includes(e.scope)),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=ie(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(h(t,r),i);return e}static isResourceFormat(e){return e===`resource`||e===`resource:base64`||e===`directory`}get hasCode(){for(let[t,{files:n}]of this.modules)for(let r of Object.keys(n))if(!e.isResourceFormat(this.formats.get(h(t,r))))return!0;return!1}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=Be(n);return E(e.dir,e.rel,`bundle`)}if(e.length===4&&(t===`sources`||t===`modules`)&&r===`files`&&typeof i==`string`)return E(n,i,`bundle`)}}static fromJSON(t,{contents:n=!0}={}){y(t.version===k||t.version===Re),y([`node_modules`,`full`].includes(t.config?.scope));let r=Se(t.formats),i=new Map,a=new Set;if(t.version===k){let e=t.config.scope===`full`;if(t.modules!==void 0){y(typeof t.modules==`object`&&t.modules!==null);for(let[e,n]of Object.entries(t.modules))y(O(e)),T(e,`bundle`),y(n?.name&&n.version&&n.files),i.set(e,se(n,e,`bundle`))}if(e){y(t.sources&&typeof t.sources==`object`);for(let[e,n]of Object.entries(t.sources))y(!O(e)),T(e,`bundle`),y(n?.name&&n.files),i.set(e,se(n,e,`bundle`));t.entries!==void 0&&(a=ye(t.entries,`bundle`))}else y(t.entries===void 0),y(t.sources===void 0)}else{y(t.sources);for(let[e,n]of Object.entries(t.sources)){T(e,`bundle`);let{dir:t,rel:r,name:a}=Be(e);y(!w(t)&&!w(r)),i.has(t)||i.set(t,{name:a,version:null,files:Object.create(null)});let{files:o}=i.get(t);y(!Object.hasOwn(o,r),`bundle: duplicate file key '.' (v0 '' and '.')`),o[r]=n}}let o=D(i,`bundle`,ze),s=Te(t.imports);if(!n)for(let[e,t]of i)i.set(e,He(e,t));return new e({version:t.version,config:t.config,entries:a,modules:i,formats:r,imports:s,executable:t.version===k?de(t.executable,{what:`bundle`,files:o,formats:r,scope:t.config.scope}):new Set,reason:x(t.reason)?t.reason:void 0,repo:Ge(t.repo),package:t.package})}serialize(){D(this.modules,`bundle`,ze);let{modules:e,sources:t}=De(this.modules,{skipEmpty:!0,what:`bundle`}),n=this.config.scope===`full`,r={version:k,config:this.config};this.repo!==void 0&&(r.repo=this.repo),this.package!==void 0&&(r.package=this.package),n&&(r.entries=be(this.entries,`bundle`)),r.formats=Ce(this.formats),r.imports=Ee(this.imports);let i=fe(this.executable,{what:`bundle`,modules:this.modules,formats:this.formats,scope:this.config.scope});return i!==void 0&&(r.executable=i),this.reason!==void 0&&(r.reason=A(this.reason,void 0)),n&&(r.sources=t),r.modules=e,JSON.stringify(r,void 0,2)}withReason(t){let{version:n,config:r,entries:i,modules:a,formats:o,imports:s,executable:c,repo:l,package:u}=this,d=A(this.reason,{[t]:[...this.sources.keys()]});return new e({version:n,config:r,entries:i,modules:a,formats:o,imports:s,executable:c,reason:d,repo:l,package:u})}merge(t){return y(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:Fe(this.modules,t.modules,`bundle merge`),formats:je(this.formats,t.formats,`bundle merge`),imports:Ae(this.imports,t.imports,`bundle merge`),executable:Me(this.executable,t.executable,t.modules,this.config.scope),reason:A(this.reason,t.reason),repo:We(this.repo,t.repo),package:Je(this.package,t.package)})}},Ye=/^webpack(?:-internal)?:\/\/[^/]*\//u,Xe=/^[a-z][\d+.a-z-]*:/iu,Ze=/^file:/iu,Qe=/^(?:file|ftp|https?|wss?):/iu,$e=/^(?:[a-z][\d+.a-z-]*:\/\/[^/]*\/?|\/\/[^/]+\/|[a-z]:\/|\/)?/iu,N=e=>$e.exec(e)[0],P=e=>N(e).includes(`://`),F=e=>e.replace(P(e)?/[#?].*$/su:/\?.*$/su,``),et=e=>e.slice(e.lastIndexOf(`/`)+1),I=(e,t)=>URL.parse(e,t)?.href??null;function L(e){let t=N(e),n=t.includes(`://`)&&I(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 tt(e,t){let n=N(t);return P(e)&&!n.includes(`:`)?I(t,e)??L(`${e}/../${t}`):L(n===`/`?N(e).replace(/\/?$/u,``)+t:n?t:`${e}/../${t}`)}function nt(e){try{return decodeURIComponent(e)}catch{return e}}function R(e,t){let n=e.replaceAll(`\\`,`/`);if(Ye.test(n))return L(n.replace(Ye,``));let r=Qe.test(n)?I(n)??n:n,i=/^file:\/\/([^/#]*)([^#]*)/isu.exec(r);if(i){let[,e,t]=i;return L(nt(e&&e.toLowerCase()!==`localhost`?`//${e}${t}`:t).replace(/^\/(?=[a-z]:\/)/iu,``))}if(Xe.test(r)&&!N(r).includes(`:`))return r;if(t===void 0)return L(r);if(Ze.test(t)&&!N(r))return R(I(r,t)??r);let a=R(t);return N(r)&&!P(a)?L(r):tt(a,r)}var rt=/^(?:@[\dA-Za-z~-][\w.~-]*\/)?[\dA-Za-z~-][\w.~-]*$/u;function z(e){let t=e.split(`/`).slice(0,e.startsWith(`@`)?2:1).join(`/`);return rt.test(t)?t:null}var it=new Set([`.pnpm`,`.bun`,`.deno`]),at=/^\d+\.\d+\.\d+(?:-[\d.a-z-]+)?(?:\+[\d.a-z-]+)?$/iu;function ot(e,t){let n=`${t.replace(`/`,`+`)}@`,r=e.startsWith(n)?e.slice(n.length).split(/[(_]/u)[0]:null;return at.test(r)?r:null}function st(e){let t=F(e).split(`/`),n=t.lastIndexOf(`node_modules`),r=n<0?null:z(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:it.has(t[n-2])?ot(t[n-1],r):null,root:a,path:e.slice(a.length+1)}}var ct=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 lt(e){let t=et(F(e));return/^[\w-]+$/u.test(t)?`jsx`:ct.get(/\.([\da-z]+)$/iu.exec(t)?.[1].toLowerCase())??null}var ut=[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.tsx`,`.mts`,`.cts`,`.json`],dt=[`.ios`,`.android`,`.web`];function ft(e){let t=e.map(e=>/\.[a-z]+(?=\.\w+$)/u.exec(et(F(e.path??``)))?.[0]),[[n,r],[,i]]=dt.map(e=>[e,t.filter(t=>t===e).length]).toSorted((e,t)=>t[1]-e[1]);return[...r===i?[]:[n],`.native`,``,`.browser`,`.node`]}var pt=new Map([[`.js`,[`.ts`,`.tsx`]],[`.jsx`,[`.tsx`]],[`.mjs`,[`.mts`]],[`.cjs`,[`.cts`]]]),mt=[`index`,`main`,`browser`,`node`],ht=[``,`src/`,`lib/`,`dist/`,`build/`],gt=new Set([`lib`,`dist`,`build`,`out`,`esm`,`cjs`]);function*_t(e,t){yield e;let n=/\.[^./]+$/u.exec(e)?.[0];for(let t of pt.get(n)??[])yield e.slice(0,-n.length)+t;for(let n of e.endsWith(`/`)?[`${e}index`]:[e,`${e}/index`])for(let e of ut)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*vt(e){let t=e;for(;;){t.startsWith(`src/`)||(yield`src/${t}`),t!==e&&(yield t);let n=t.indexOf(`/`);if(n<0||!gt.has(t.slice(0,n)))return;t=t.slice(n+1)}}function yt(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:ft(e),found:new Map}}function B(e,t){if(!e.found.has(t)){let n=F(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 bt(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 xt=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 St(e){if(e.startsWith(`node:`)||xt.has(e))return{builtin:!0};let t=z(F(e));return t===null?{}:{package:t}}function Ct(){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 wt(e,t){for(let n of mt)for(let r of ht){let i=B(e,`${t}/${r}${n}`);if(i)return i}let n=e.byRoot.get(t);return n?.length===1?n[0]:null}function Tt(e,t,n,r){return/^\/[^?]/u.test(n)?B(e,t+n)??vt(n.slice(1)).map(n=>B(e,`${t}/${n}`)).find(Boolean):B(e,t+n)??r(e,t)}function Et(e,t,n,r=wt){let i=/^(?:\.{1,2}|[a-z]:)?\\/iu.test(n)?n.replaceAll(`\\`,`/`):n,a=Qe.test(i);if(a||/^(?:\.{1,2}(?:\/|$)|\/|[a-z]:\/)/iu.test(i)||P(i)){let n=a?R(i):tt(t.path,i),r=B(e,n);return r?{to:r}:{to:null,path:n}}if(Xe.test(i)&&e.byPath.has(i))return{to:e.byPath.get(i)};let o=z(F(n)),s=o===null?null:bt(e,t,o);if(s===null)return{to:null,...St(n)};let c=Tt(e,s,n.slice(o.length),r);return c?{to:c}:{to:null,package:o}}var V=class extends Error{name=`SourceMapError`},Dt=new Uint8Array(128).fill(255);for(let[e,t]of[...`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/,;`].entries())Dt[t.codePointAt(0)]=e;function H(e){let t=new Int32Array(e.length*2);return t.set(e),t}function Ot(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 kt(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 V(`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?Dt[o.codePointAt(c)]??255:64;if(l<32){if(p+=l*m,f===5)throw new V(`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 V(`mappings: a value at ${c} runs past 32 bits`);continue}if(l===255)throw new V(`mappings: ${JSON.stringify(o[c])} at ${c} is not a base64 digit`);if(m!==1)throw new V(`mappings: the value before ${c} is cut off`);if(f>0){if(f===2||f===3)throw new V(`mappings: a segment of ${f} fields before ${c}`);let t=f===1?-1:s[e[1]];if(t===void 0)throw new V(`mappings: source ${e[1]} before ${c} is not in sources`);if(e[0]<0)throw new V(`mappings: a negative generated column before ${c}`);a===n.length&&([n,r,i]=[H(n),H(r),H(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),Ot({starts:Int32Array.from(t),columns:n.slice(0,a),sources:r.slice(0,a),names:i.slice(0,a)})}var At=new WeakMap,jt=e=>At.get(e),U=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function W(e,t){if(!e)throw new V(t)}function Mt(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 Nt(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:R(t,e.mapPath);return e.files.push({source:t,path:a,package:a===null?null:st(a),content:n,ignored:r}),t!==null&&e.bySource.set(t,e.files.length-1),e.files.length-1}function Pt(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=Mt(e.sources,`sources`),a=Mt(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)=>Nt(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 Ft(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}]`),Pt(a,t,i.line,i.column)}}function It(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 V(`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?Pt(n,r,0,0):Ft(n,r);let i={files:r.files};return At.set(i,{...kt(r.parts),nameList:r.names}),i}var Lt=/\r\n?|[\n\u2028\u2029]/gu;function Rt(e){let t=[0];for(let n of e.matchAll(Lt))t.push(n.index+n[0].length);return t}function zt(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=zt(e,0,e.length,t);return[n,t-e[n]]}function Bt(e,[t,n]){if(t>=e.starts.length-1)return-1;let r=e.starts[t],i=zt(e.columns,r,e.starts[t+1],n);return i<r?-1:i}function Vt(e,t,n,r){let i=jt(e),a=G(t,n),[o,s]=G(t,r),c=new Map,l=Bt(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,Ht=`
2
+ \r\u2028\u2029`,q=/[\n\r\u2028\u2029]/gu,Ut=/[\n\r\u2028\u2029]/u,J=/[\w$\u0080-￿]+/uy,Wt=new Set([`return`,`typeof`,`instanceof`,`in`,`of`,`new`,`delete`,`void`,`throw`,`case`,`default`,`extends`,`do`,`else`,`yield`,`await`]),Gt=new Set([`if`,`while`,`for`,`with`]),Kt=new Set([`break`,`continue`,`debugger`]),qt=new Set([`(`,`[`,"${",`,`,`=`,`:`,`?`,`!`,`~`,`+`,`-`,`*`,`/`,`%`,`&`,`|`,`^`,`<`,`>`]);function Jt(e,t){return e?.type===`word`?t&&[`return`,`yield`].includes(e.value)?!1:Wt.has(e.value)&&![`do`,`else`].includes(e.value):qt.has(e?.value)}function Yt(e){let t=e.at(-1);return t?.type===`word`&&(Gt.has(t.value)||t.value===`await`&&e.at(-2)?.value===`for`)}function Xt(e){return e?e.type===`word`?Wt.has(e.value)||Kt.has(e.value)||e.label===!0:e.value===`)`?e.control:e.value===`}`?!e.object:e.type===`punctuator`&&![`++`,`--`,`]`].includes(e.value):!0}var Zt=(e,t)=>e.startsWith(`\r
3
+ `,t+1)?3:2,Qt=/\\(?: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,$t={b:`\b`,f:`\f`,n:`
4
+ `,r:`\r`,t:` `,v:`\v`};function en(e){return e.includes(`\\`)?e.replace(Qt,(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)?$t[o]??o:String.fromCodePoint(Math.min(s,1114111))}):e}function tn(e,t){let n=e[t],r=t+1;for(;r<e.length&&e[r]!==n&&!Ht.includes(e[r]);)r+=e[r]===`\\`?Zt(e,r):1;return[e[r]===n?en(e.slice(t+1,r)):null,r+1]}function nn(e,t){let n=t+1,r=!1;for(;n<e.length&&!Ht.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 rn(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 an(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]=tn(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=rn(e,i+1,n),o=s==="`"&&n.length===r&&e[a-1]==="`";t.push({type:`string`,value:o?en(e.slice(i+1,a-1)):null}),n.length>r&&t.push({type:`punctuator`,value:"${"}),i=a}else if(s===`/`&&Xt(t.at(-1)))i=nn(e,i),t.push({type:`regex`});else if(J.test(e)){let n=Kt.has(t.at(-1)?.value)&&!Ut.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(Jt(t.at(-1),Ut.test(e.slice(a,i)))?`object`:`block`);let o=s===`}`?n.pop():void 0;s===`(`&&r.push(Yt(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 on=e=>e?.type===`string`&&e.value!==null,sn=new Set([`type`,`typeof`]),cn=(e,t)=>e[t+1]?.type===`word`&&(e[t+1].value!==`as`||e[t+2]?.type!==`word`||e[t+2].value===`as`);function ln(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(!sn.has(e[r].value)||!cn(e,r))return!1;n=!0}return n}function un(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`&&on(e[n+1]))return e[n+1].value}return null}function dn(e,t){let[n,r,i]=[e[t].value,e[t+1],e[t+2]],a=n===`import`?`import`:`export-from`;if(n===`import`&&on(r))return{kind:a,specifier:r.value};if(sn.has(r?.value)&&![`,`,`from`].includes(i?.value)||r?.value===`{`&&ln(e,t+1)||n===`export`&&![`{`,`*`].includes(r?.value)||n===`import`&&r?.type!==`word`&&![`{`,`*`].includes(r?.value))return null;let o=un(e,t+1);return o===null?null:{kind:a,specifier:o}}function fn(e,t){let[n,r]=[e[t+2],e[t+3]];if(n?.value!==`)`)return on(n)&&[`)`,`,`].includes(r?.value)?n.value:null}function pn(e,t=new Set){let n=an(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?fn(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=dn(n,e);t&&r.push(t)}}return r}var mn=/^[\w$]*__d\(/gmu,hn=([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 gn(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(!hn(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 vn(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 yn(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 bn(e,t){let n=[...e.matchAll(mn)].map(e=>e.index);if(n.length===0)return null;let r=Rt(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=gn(i(l));for(;!u&&l>c;)u=gn(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:Vt(t,r,s,d),dependencies:vn(u[1],e.slice(s,d))})}yn(a,t);let o=new Map(a.map(e=>[e.id,e])),{edges:s,link:c}=Ct();for(let{file:e,dependencies:t}of a)for(let n of t)c(e,o.get(n)?.file,`dependency`);return s}var xn=e=>e.path!==null&&![`json`,null].includes(lt(e.path)),Sn=e=>e.path!==null&&lt(e.path)===null;function Cn(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 wn={jsxRuntime:`react/jsx-runtime`,jsxDevRuntime:`react/jsx-dev-runtime`};function Tn(e){let{sources:t,names:n,nameList:r}=jt(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],Cn(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(Cn);o.length>0&&i.set(r,o.map(e=>wn[e]??`@babel/runtime/helpers/${e}`))}return i}function En(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,Et(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:Et(t,e,r,i)}}var Dn=e=>/(?:^|\/)__prelude__$/u.test(e.source??``),On=e=>e?.package?.name===`metro-runtime`&&e.package.path===`src/polyfills/require.js`;function kn(e){if(!e.files.some(Dn)&&!On(e.files[0]))return null;if(!e.files.some(e=>e.content!==null&&!Dn(e)&&!On(e)))throw Error("bundleEdges: the Metro map carries no sourcesContent, which its edges are read from; pass the bundle as `code`");let t=yt(e.files),n=e.files[e.files.findIndex(Sn)+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&&xn(e)).map(e=>[e,pn(e.content)])),a=Tn(e),o=En([...[...i].map(([e,t])=>[e,t.flatMap(({specifier:e})=>e===null?[]:[e])]),...a],t),{edges:s,add:c,link:l}=Ct();for(let t of e.files){Sn(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 An=(e,t)=>t==null?kn(e):bn(t,e);function jn(e,t){let n=An(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 Mn(e){let t=JSON.parse(e.replace(/^\)\]\}'[^\n]*\n/u,``)),n=It(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 Nn(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 Pn(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 Fn(e){try{return jn(e)}catch{return{edges:[]}}}var In=Object.freeze([]);function Ln(e){return e?.edges?e.edges:e?.map?(e.edges=Pn(e.map,Fn),e.edges):In}var Rn=new WeakMap,zn=new WeakMap;function Bn(e){let t=Ln(e);if(!Rn.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);Rn.set(t,e)}return Rn.get(t)}function Vn(e){let t=Ln(e);if(!zn.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));zn.set(t,e)}return zn.get(t)}var Hn=new WeakMap,Un=new WeakMap,Wn=new WeakMap,Gn=new WeakMap,Kn=new WeakMap,Y=new WeakMap;function X(e){if(e?.metadataOnly)return new Map;let t=e?.bundle??e?.json;if(t&&Hn.has(t))return Hn.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`&&(M.isResourceFormat(t?.get(r))||n.set(r,i))}else if(e.kind===`sourcemap`)for(let[t,r]of Nn(e))typeof r==`string`&&n.set(t,r);return t&&Hn.set(t,n),n}function qn(e){let t=1;for(let n=e.indexOf(`
5
+ `);n!==-1;n=e.indexOf(`
6
+ `,n+1))t++;return t}var Jn=new WeakMap;function Yn(e){let t=Jn.get(e);if(!t){let n=[...e.keys()].toSorted();t={paths:n,numbers:new Map(n.map((e,t)=>[e,t+1]))},Jn.set(e,t)}return t}function Xn(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 Zn(e){let t=e?.bundle??e?.json;if(t&&Un.has(t))return Un.get(t);let n=new Map(X(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&&Un.set(t,n),n}var Qn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;function $n(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&&Qn.indexOf(n.at(-1))&(r===2?15:3)?null:Math.floor(n.length*3/4)}function er(e){return typeof e==`string`?t(e):e?.format===`digest`?e.size:e?.format===`base64`?$n(e.data):null}function Z(e){if(e?.fileSizes)return e.fileSizes;let t=e?.bundle??e?.json;if(t&&Wn.has(t))return Wn.get(t);let n=new Map,r=Zn(e),i=e?.kind===`stasis`?e.bundle?.sources.keys():e&&Nn(e).map(([e])=>e);for(let e of i??[])n.set(e,er(r.get(e)));return t&&Wn.set(t,n),n}function tr(e){if(e?.metadataOnly)return e.unsizedFiles??new Set;let t=Z(e);if(Y.has(t))return Y.get(t);let n=new Set;for(let r of Zn(e).keys())t.get(r)===null&&n.add(r);return Y.set(t,n),n}function nr(e){let t=Z(e);if(Kn.has(t))return Kn.get(t);let n=tr(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,M.isResourceFormat(r?.get(a))||e?.npmBinaries?.has(a)?`resource`:`source`);return Kn.set(t,i),i}function rr(e){let t=Z(e),n=e?.kind===`stasis`?e.bundle?.formats:null;if(!n||n.size===0)return t;if(Gn.has(t))return Gn.get(t);let r=new Map;for(let[e,i]of t)M.isResourceFormat(n.get(e))||r.set(e,i);return Gn.set(t,r),r}function ir(e){if(e?.kind!==`stasis`||!e.bundle?.modules)return null;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 t}function ar(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:ir(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 or=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`}),sr=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 cr(e){let t=typeof e==`string`?e.slice(e.lastIndexOf(`/`)+1):``,n=t.lastIndexOf(`.`),r=n>0?t.slice(n+1).trim().toLowerCase():``,i=a(e)??sr[r];return i?{key:i,label:or[i]??i}:r?{key:`extension:${r}`,label:`.${r}`}:{key:`other`,label:`Other`}}function lr(e,t){let n=new Map,r=0,i=0;for(let[a,o]of e){let e=cr(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 ur=6,Q=new WeakMap,dr=new Set([`terminal`,`code`,`search`,`compare`]);function fr(e,t=null){return!!t||dr.has(e)}var pr=/^sha512-[A-Za-z0-9+/]{86}==$/u;function mr(t){if(t.fileHashes)return Promise.resolve(t.fileHashes);if(Q.has(t))return Q.get(t);let n=(async()=>{let n=[...X(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 Q.set(t,n),n.catch(()=>Q.delete(t)),n}function hr(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 gr(e){return e.lineCounts??=new Map([...X(e)].map(([e,t])=>[e,hr(t)]))}function $(e){return e instanceof Map?Object.fromEntries([...e].map(([e,t])=>[e,$(t)])):e}async function _r(e){let n=await mr(e),r=Z(e),i=gr(e),a={version:ur,integrity:e.integrity,kind:e.kind,size:e.size,codeStats:lr(i,r),files:[...r].map(([e,t])=>[e,t,n.get(e)??null,i.get(e)??null])},o=tr(e);if(o.size>0&&(a.unsized=[...o]),e.kind===`sourcemap`){let{version:n,file:r,sourceRoot:i,names:o}=e.json,s=Nn(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=Ln(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:$(t.formats),imports:$(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 vr(e,t){if(![1,2,3,4,5,ur].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!==ur,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`||!pr.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=M.parse(JSON.stringify(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&&!M.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=yr(e.edges,e.files))}if(e.codeStats===void 0)c.codeStats=lr(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 yr(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 br(e,{integrity:t,kind:n,size:r}){if(n===`stasis`)return{integrity:t,kind:n,size:r,bundle:M.parse(e)};if(n!==`sourcemap`)throw Error(`Unsupported bundle format`);return{integrity:t,kind:n,size:r,...Mn(e)}}export{a,lr as b,Ue as c,M as d,Bn as e,Vn as f,X as g,qn as h,Yn as i,Xn as j,Zn as k,er as l,Z as m,nr as n,rr as o,ir as p,ar as q,fr as r,mr as s,hr as t,gr as u,_r as v,vr as w,br as x};
@@ -0,0 +1,7 @@
1
+ import{a as e}from"./chunk-TUII34K2.js";var t=`deepview-objstore.v1.put`,n=`deepview-objstore.v1.delete`,r=`deepview-objstore.v1.fetch`,i=`deepview-objstore.v1.fetch-rest`,a=`deepview-objstore.v1.put-rest`,o=`deepview-objstore.v1.delete-rest`;function s(e){return e==null?``:String(e)}function c(e){return e??``}function l(n,r){return e([t,n.workspaceTag,n.resourceTag,s(n.prevVersion),c(n.prevIncarnation),n.contentHash,String(n.expectedLength),r].join(`
2
+ `))}function u(t,r){return e([n,t.workspaceTag,t.resourceTag,s(t.prevVersion),c(t.prevIncarnation),r].join(`
3
+ `))}function d(t,n,i){return e([r,t,n,i].join(`
4
+ `))}async function f(e,t){return new Uint8Array(await crypto.subtle.sign({name:`Ed25519`},e,t)).toBase64({alphabet:`base64url`,omitPadding:!0})}function p(e,t,n){return f(e,l(t,n))}function m(e,t,n){return f(e,u(t,n))}function h(e,t,n,r){return f(e,d(t,n,r))}function g(t,n,r){return e([i,t,n,String(r)].join(`
5
+ `))}function _(e,t,n,r){return f(e,g(t,n,r))}function v(t,n){return e([a,t.workspaceTag,t.resourceTag,s(t.prevVersion),c(t.prevIncarnation),t.contentHash,String(t.expectedLength),String(n)].join(`
6
+ `))}function y(e,t,n){return f(e,v(t,n))}function b(t,n){return e([o,t.workspaceTag,t.resourceTag,s(t.prevVersion),c(t.prevIncarnation),String(n)].join(`
7
+ `))}function x(e,t,n){return f(e,b(t,n))}async function S(e){let t=await crypto.subtle.digest(`SHA-256`,e);return new Uint8Array(t).toBase64({alphabet:`base64url`,omitPadding:!0})}var C=`/api/config`,w=`http://127.0.0.1:3123/`;function T(e){if(typeof e!=`string`||!e.trim())return null;try{let t=new URL(e);return![`http:`,`https:`].includes(t.protocol)||t.username||t.password||t.search||t.hash?null:(t.pathname=t.pathname.replace(/\/+$/u,``)+`/`,t.href)}catch{return null}}var E=`deepview.sync.serverInfo`,D=`deepview.sync.standaloneProbe`;function O(){try{return localStorage.getItem(D)===`1`}catch{return!1}}function k(){try{localStorage.setItem(D,`1`)}catch{}}function A(e){return e===`managed+e2e`||e===`e2e+managed`}function j(e,t){return(e===`managed`||A(e))&&/^\/(?:team|manage|npm|my|repo)(?:\/|$)/u.test(t)}function M(e,t=null){return t&&(A(e)||e===t)?t:e===`managed`||e===`managed+e2e`?`managed`:`e2e`}function N(e,t){return e&&A(e.mode)&&t.mode===`e2e`?{...e,githubNewIssueLabels:t.githubNewIssueLabels??``,...t.deepviewScanServer?{deepviewScanServer:t.deepviewScanServer}:{}}:t}function P(e){if(typeof e!=`object`||!e)return null;let t=e.mode;if(t!==`e2e`&&t!==`managed`&&t!==`managed+e2e`&&t!==`e2e+managed`)return null;let n=null,r=e.managed;if(typeof r==`object`&&r){let e=r.loginPath,t=r.cookieName;typeof e==`string`&&typeof t==`string`&&(n={loginPath:e,cookieName:t},r.allowShare===!0&&(n.allowShare=!0))}let i=t===`managed`?null:T(e.deepviewScanServer),a=e.githubNewIssueLabels;return{mode:t,managed:n,...i?{deepviewScanServer:i}:{},...typeof a==`string`&&a.length<=4096?{githubNewIssueLabels:a}:{}}}async function F(){try{let e=await fetch(C,{credentials:`same-origin`,cache:`no-store`,headers:{accept:`application/json`}});if(e.status===404)return`standalone`;if(!e.ok)return null;let t=await e.json(),n=P(t);return n&&t.session!==void 0?{...n,session:t.session}:n}catch{return null}}async function I(e,t=3e3){let n;try{return await Promise.race([e,new Promise(e=>{n=setTimeout(()=>e(null),t)})])}catch{return null}finally{clearTimeout(n)}}function L(){try{let e=localStorage.getItem(E);if(e==null)return null;let t=P(JSON.parse(e));return t?{mode:t.mode,managed:t.managed}:null}catch{return null}}function R(e){try{localStorage.setItem(E,JSON.stringify({mode:e.mode,managed:e.managed})),localStorage.removeItem(D)}catch{}}var z=`deepview.objstore-presence.`;function B(e){return z+e}function V(e){try{let t=localStorage.getItem(B(e));if(!t)return null;let n=JSON.parse(t);return!n||typeof n!=`object`?null:{names:n.names&&typeof n.names==`object`?n.names:{},bundles:n.bundles&&typeof n.bundles==`object`?n.bundles:{},bundleNames:n.bundleNames&&typeof n.bundleNames==`object`?n.bundleNames:{},baselines:H(n.baselines,n.localVersions)}}catch{return null}}function H(e,t){let n={};if(t&&typeof t==`object`)for(let[e,r]of Object.entries(t))Number.isSafeInteger(r)&&r>=0&&(n[e]={version:r,incarnation:null,synced:!0,hash:null});if(e&&typeof e==`object`)for(let[t,r]of Object.entries(e))!r||typeof r!=`object`||!Number.isSafeInteger(r.version)||r.version<0||r.incarnation!=null&&typeof r.incarnation!=`string`||(n[t]={version:r.version,incarnation:r.incarnation??null,synced:r.synced===!0,hash:typeof r.hash==`string`?r.hash:null});return n}function U(e,t,n,r){let i=V(e),a=Object.entries((t===`bundle`?i?.bundles:i?.names)??{}).find(([,e])=>e===n)?.[0],o=i?.baselines?.[a];return{synced:a!==void 0&&(t===`bundle`||o?.synced===!0&&o.hash===r),cached:!0}}export{p as a,m as b,h as c,_ as d,y as e,x as f,S as g,w as h,T as i,O as j,k,A as l,j as m,M as n,N as o,P as p,F as q,I as r,L as s,R as t,B as u,V as v,U as w};
@@ -0,0 +1,3 @@
1
+ import{Bb as e,Sb as t,Yb as n,qb as r,rb as i,sb as a,ub as o,v as s,vb as c,wb as l}from"./chunk-QRD6GIG5.js";import{c as u,d}from"./chunk-PTGDYLNS.js";import{e as f,f as p,g as m,j as h}from"./chunk-SXV2T5C4.js";import{c as g}from"./chunk-2XUEZHIP.js";var _=`.token.comment,.token.prolog,.token.cdata{color:var(--code-comment);font-style:italic}.token.punctuation{color:var(--muted)}.token.string,.token.attr-value,.token.char,.token.regex{color:var(--code-string)}.token.number,.token.boolean,.token.constant,.token.symbol{color:var(--code-number)}.token.keyword,.token.builtin,.token.important,.token.atrule{color:var(--code-keyword)}.token.function,.token.class-name,.token.tag{color:var(--code-function)}.token.operator,.token.entity,.token.url,.token.attr-name,.token.selector{color:var(--code-operator)}.token.variable,.token.property,.token.parameter{color:var(--code-variable)}.token.annotation{color:var(--code-function)}.token.deleted{color:var(--code-deleted)}.token.inserted{color:var(--code-inserted)}.token.italic{font-style:italic}.token.bold{font-weight:700}.code-control{padding:0 .3em;margin:0 .1em;border-radius:3px;font-size:.8em;line-height:0;font-style:normal;font-weight:400;color:var(--warning);background:rgb(from var(--warning) r g b / .14);box-shadow:inset 0 0 0 1px rgb(from var(--warning) r g b / .45);white-space:nowrap;user-select:none}
2
+ `,v=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`,y=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.8" y="5" width="20.4" height="14" rx="2"/><path d="M5.6 15.6V8.4l3.1 3.6 3.1-3.6v7.2"/><path d="M16.9 8.4v7.2m-2.6-2.9 2.6 2.9 2.6-2.9"/></svg>`,b=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M6 9V2h12v7"/><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><rect x="6" y="14" width="12" height="8"/></svg>`;function x(e,t){let n=u.find(t=>t.value===e)?.label??e;return d(e)?.includes(`partial`)?t===`exclude`?`${n} (full only)`:t===`only`?`${n} (partial only)`:n:n}function S(e){return h.filter(t=>e.has(t)).map(e=>f[e]??e).join(`, `)}function C(e=s){let t=[];if(e.filterSeverities.size>0&&t.push({key:`severity`,label:`Severity`,value:S(e.filterSeverities),clear:{filterSeverities:new Set}}),e.filterColors.size>0&&t.push({key:`marks`,label:`Marks`,value:[...e.filterColors].map(e=>m[e]??e).join(`, `),clear:{filterColors:new Set}}),e.filterSources.size===1&&t.push({key:`source`,label:`Source`,value:e.filterSources.has(`own`)?`Sources only`:`Dependencies only`,clear:{filterSources:new Set}}),e.filterAnalyzer&&t.push({key:`analyzer`,label:`Analyzer`,value:e.filterAnalyzer===r?`(none)`:e.filterAnalyzer,clear:{filterAnalyzer:``}}),e.filterModel&&t.push({key:`model`,label:`Model`,value:e.filterModel===a?`(none)`:e.filterModel,clear:{filterModel:``}}),e.filterRepo&&t.push({key:`repo`,label:`Repository`,value:e.filterRepo===i?`(no repo)`:e.filterRepo,clear:{filterRepo:``}}),d(e.filterRevalidate)&&t.push({key:`revalidate`,label:`Revalidation`,value:x(e.filterRevalidate,e.filterPartial),clear:{filterRevalidate:``,filterPartial:``}}),!e.filterRevalidate&&(e.filterConfMin>0||e.filterConfMax<10)){let n;n=e.filterConfMin>0&&e.filterConfMax<10?`${e.filterConfMin}\u2013${e.filterConfMax}`:e.filterConfMin>0?`\u2265 ${e.filterConfMin}`:`\u2264 ${e.filterConfMax}`,t.push({key:`confidence`,label:`Confidence`,value:n,clear:{filterConfMin:0,filterConfMax:10}})}e.filterInclude&&t.push({key:`search`,label:e.filterIncludeNegate?`Excluding`:`Search`,value:`"${e.filterInclude}"`,clear:{filterInclude:``,filterIncludeNegate:!1}});for(let[n,r]of[[`filterComment`,`comment`],[`filterFix`,`fix`],[`filterFlagged`,`flag`]]){let i=e[n];i&&t.push({key:`annotation:${r}`,label:`Annotation`,value:`${i===`with`?`With`:`Without`} ${r}`,clear:{[n]:``}})}return!s.currentWorkspace&&e.filterDuplicates&&t.push({key:`duplicates`,label:`Duplicates`,value:e.filterDuplicates===`with`?`Only rows linked to other reports`:`Exclude rows linked to other reports`,clear:{filterDuplicates:``}}),e.filterCrossContext&&t.push({key:`cross-context`,label:`Context`,value:e.filterCrossContext===`with`?`Only rows across multiple repos or packages`:`Exclude rows across multiple repos or packages`,clear:{filterCrossContext:``}}),e.filterAppStacked&&t.push({key:`app-stacked`,label:`App stack`,value:e.filterAppStacked===`with`?`Only rows with multiple App findings`:`Exclude rows with multiple App findings`,clear:{filterAppStacked:``}}),e.filterSecurity&&t.push({key:`security`,label:`Security`,value:e.filterSecurity===`with`?`Only security-related rows`:`Exclude security-related rows`,clear:{filterSecurity:``}}),t}function w(){return n().filter(e=>t(e).commonTriage===s.shownTriage)}function T(){return s.shownTriage?p[s.shownTriage]??s.shownTriage:null}function E(t,n=o()){let r=w(),i=r.length;c(n);let a;try{a=e(r).length}finally{l()}return{included:a,total:i,excluded:i-a,fields:n,filters:C(n),bucketLabel:T(),focusedOnly:t===`print`&&s.viewMode===`focus`}}var D=`.managed-comment{container:managed-comment / inline-size;white-space:normal}.managed-comment-row{display:grid;grid-template-columns:minmax(0,max-content) minmax(0,1fr) auto;align-items:start;gap:.35rem .65rem;line-height:1.5}.managed-comment-author{grid-column:1;grid-row:1;display:flex;align-items:center;gap:.45rem;min-width:0;max-width:14rem;& strong{overflow:hidden;text-overflow:ellipsis;font-weight:600}}.managed-comment-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:1.3rem;height:1.3rem;overflow:hidden;border-radius:50%;background:rgb(from var(--muted) r g b / .15);color:var(--muted);font-size:.65rem;font-weight:600;& img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}& img[hidden]{display:none}}.managed-comment-body{grid-column:2;grid-row:1;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;& a{color:var(--accent);text-decoration:none}& a:hover{text-decoration:underline}& a.comment-self-ref{text-decoration:underline dotted;text-underline-offset:2px}& a.comment-self-ref:hover{text-decoration:underline solid}}.managed-comment-time{color:var(--muted);font-size:.7rem;font-weight:400;white-space:nowrap;text-align:right}.managed-comment-meta{grid-column:3;grid-row:1;justify-self:end;display:flex;align-items:center;gap:.5rem;min-height:1.3rem}.managed-comment-actions{display:flex;align-items:center;gap:.15rem}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr) auto;.managed-comment-body{grid-column:1}.managed-comment-meta{grid-column:2}}@container managed-comment (max-width: 28rem){.managed-comment-row:has(.managed-comment-meta){grid-template-columns:minmax(0,max-content) minmax(0,1fr);.managed-comment-meta{grid-column:1 / -1;grid-row:1}.managed-comment-author,.managed-comment-body{grid-row:2}}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr)}.managed-comment-author{max-width:9rem}}
3
+ `;export{_ as a,v as b,y as c,b as d,C as e,w as f,T as g,E as h,D as i};