@preventive/triage 1.0.0-alpha.76 → 1.0.0-alpha.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/code-language.js +3 -2
- package/out/activity.js +1 -1
- package/out/{chunk-MFAB7P3T.js → chunk-5DWOFBKS.js} +1 -1
- package/out/{chunk-O6FA2R5G.js → chunk-EMNIV37E.js} +1 -1
- package/out/{chunk-W5PRH5D7.js → chunk-G6YPDPW7.js} +1 -1
- package/out/{chunk-24LZZYAP.js → chunk-N7TD27UJ.js} +1 -1
- package/out/{chunk-62QT2RXR.js → chunk-OWIBDEJJ.js} +1 -1
- package/out/{chunk-HLMQ7QYS.js → chunk-S5PPXPAT.js} +1 -1
- package/out/{chunk-EYTPAODY.js → chunk-SDLETN3Z.js} +1 -1
- package/out/{chunk-RHOQDAU4.js → chunk-WB3NRZL7.js} +1 -1
- package/out/{chunk-UZC7POI4.js → chunk-Z6DL5PPO.js} +2 -2
- package/out/client-managed.js +1 -1
- package/out/compare.js +11 -11
- package/out/dialogs.js +1 -1
- package/out/index.html +4 -4
- package/out/prism.js +1 -1
- package/out/scan.js +1 -1
- package/out/view.js +1 -1
- package/package.json +2 -2
- package/server-managed/dependency-review-comments.ts +35 -27
- package/server-managed/pretty-print.ts +1 -1
- package/server-managed/pull-dependency-reviews.ts +23 -12
package/out/client-managed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as e,d as t,i as n}from"./chunk-RHOQDAU4.js";import{a as r}from"./chunk-6VOB5WXX.js";import{A as i,B as a,a as o,b as s,c,d as l,e as u,f as d,g as ee,h as te,i as ne,j as re,k as ie,l as ae,m as oe,n as se,o as ce,p as le,q as ue,r as de,s as fe,t as pe,u as me,v as he,w as ge,x as _e,y as ve,z as ye}from"./chunk-EYTPAODY.js";import"./chunk-6CCSTJWB.js";import{$a as be,H as xe,I as Se,Ka as Ce,Sa as we,Ta as Te,X as Ee,Ya as De,Za as Oe,a as ke,ab as Ae,bb as je,cb as Me,db as Ne,eb as f,fb as Pe,g as Fe,gb as p,hb as Ie,i as Le,ja as Re,ka as ze,m as Be,ma as Ve,n as m,z as He}from"./chunk-O6FA2R5G.js";import{y as Ue}from"./chunk-62QT2RXR.js";import"./chunk-S5HSDGTP.js";import{b as We}from"./chunk-NRPC74AM.js";import"./chunk-PNHBZGDD.js";import{a as h,e as Ge}from"./chunk-74JZTGTO.js";import"./chunk-IYPY47MC.js";import{C as Ke,D as qe,d as g,h as Je,i as Ye,j as Xe,x as _,y as Ze}from"./chunk-ITUKKCCK.js";import{a as Qe,d as $e}from"./chunk-PWFUOLZK.js";import"./chunk-C4Z6ZBXV.js";import{m as et,r as tt}from"./chunk-WGQ7D5DB.js";import{B as nt,D as rt,J as it}from"./chunk-QRKFPLA4.js";import{a as v,b as at,c as y,d as ot,g as b,j as st}from"./chunk-2XUEZHIP.js";import"./chunk-TUII34K2.js";import"./chunk-OOJM4CTU.js";function ct(e){let t=document.createElement(`input`);t.type=`file`,t.multiple=!0,t.addEventListener(`change`,()=>{e([...t.files])},{once:!0}),t.click()}function lt(e,t,n){let r=0,i=e=>Array.from(e.dataTransfer?.types??[]).includes(`Files`),a=e=>{i(e)&&(e.preventDefault(),r+=1,n(!0))},o=e=>{i(e)&&e.preventDefault()},s=e=>{i(e)&&(r=Math.max(0,r-1),r===0&&n(!1))},c=e=>{i(e)&&(e.preventDefault(),e.stopPropagation(),r=0,n(!1),t([...e.dataTransfer.files]))};return e.addEventListener(`dragenter`,a),e.addEventListener(`dragover`,o),e.addEventListener(`dragleave`,s),e.addEventListener(`drop`,c),()=>{e.removeEventListener(`dragenter`,a),e.removeEventListener(`dragover`,o),e.removeEventListener(`dragleave`,s),e.removeEventListener(`drop`,c)}}async function ut(e,t,n,r){let i=e.appState.generation;try{return await e.appState.mutate(()=>n(t),r)}catch(t){throw i===e.appState.generation&&e.appState.invalidate(r),t}}async function dt(e,t,n,r){if(e._busy||!e._csrf)throw Error(`Wait for the current operation to finish, then try again.`);e._busy=!0;try{await ut(e,t,n,r)}finally{await e._load(),e._busy=!1;let t=e._queue.splice(0);t.length>0&&e._upload(t)}}async function ft(e,t,n,r){if(t.length===0||(e._queue.push(...t),e._busy))return;e._busy=!0,e._error=null;let i=e.appState.generation,a=[],o=0;try{for(;e._queue.length>0;){if(e.appState.generation!==i){e._queue=[];break}let t=e._queue.shift();try{await ut(e,t,n,r)}catch(n){if(n?.name===`AbortError`||e.appState.generation!==i){e._queue=[];break}a.push(`${t.name}: ${String(n?.message??n)}`)}o++}}finally{a.length>0&&(e._error=o===1?`Upload failed: ${a[0]}`:`Upload failed for ${a.length} of ${o} files: ${a.join(`; `)}`),e._busy=!1,await e._load({preserveError:!0})}}var x=class extends st{static properties={session:{attribute:!1},allowShare:{attribute:!1},_loading:{state:!0},_data:{state:!0},_error:{state:!0}};constructor(){super(),this.session=null,this.allowShare=!1,this.appState=u,this._loading=!1,this._loadRequest=null,this._data=null,this._error=null}get _role(){return this.session?.role??null}get _csrf(){return this.session?.csrfToken??null}get _me(){return this.session?.id??null}connectedCallback(){super.connectedCallback(),this._load()}disconnectedCallback(){this._loadRequest?.abort(),super.disconnectedCallback()}async _load({preserveError:e=!1}={}){let{collection:t}=this.constructor;if(!t)return;e||(this._error=null);let[n,r,i]=t;await this._loadCollection(n,r,i,e=>this._show(e))}_show(e){this._data=e}async _loadCollection(e,t,n,r){this._loading=!0,await this._read(`_loadRequest`,e,t,n,{apply:r,settled:()=>{this._loading=!1},failed:t=>{this.appState.read(e)===void 0&&(this._error=String(t?.message??t))}})}async _read(e,t,n,r,{apply:i,answered:a,failed:o,settled:s}){this[e]?.abort();let c=this[e]=new AbortController;try{await this.appState.load(t,n,r,{signal:c.signal,apply:i}),c.signal.aborted||a?.()}catch(e){!c.signal.aborted&&e?.name!==`AbortError`&&o(e)}finally{this[e]===c&&s()}}_nav(){return Pe(this.constructor.view,this._role,this.allowShare)}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}_list(e,t,n){return y`<div class="manage-list" aria-busy="${this._loading}">${e==null?this._error?b:S(t):n()}</div>`}},pt=class{constructor(e,t=()=>!0){this.host=e,this.accepts=t,this.active=!1,e.addController(this)}hostConnected(){this.teardown=lt(this.host,e=>{this.accepts()&&this.host._upload(e)},e=>{this.active=this.accepts()&&e,this.host.requestUpdate()})}hostDisconnected(){this.teardown?.()}overlay(e){return this.active?y`<div class="dropzone">${e}</div>`:b}card(e,t,n,r=`Uploading…`){return y`<span class="drop-icon" aria-hidden="true">${p(`upload`)}</span><span class="drop-copy"><strong>${e}</strong><span>${t}</span></span><button type="button" class="drop-browse" ?disabled="${n}" @click="${()=>ct(e=>{this.host._upload(e)})}">${this.host._busy?r:`Browse files`}</button>`}};function S(e){return y`<div class="loading-rows" role="status"><span class="sr-only">${e}</span><div aria-hidden="true">${[0,1,2,3].map(()=>y`<div class="loading-row"><span></span><span></span></div>`)}</div></div>`}var C=e=>e?y`<p class="msg error" role="alert">${e}</p>`:b,w=(e,t)=>y`<div class="empty"><strong>${e}</strong><p>${t}</p></div>`;function mt(e){let t=e.split(`/`);return t.at(-1)===`stasis.config.json`&&!t.includes(`node_modules`)}var ht=class extends Te{get changeEvent(){return`local-item-change`}get searchLabel(){return`Search local files`}get optionsLabel(){return`Local files`}get noMatchesLabel(){return`No matching files.`}get emptyLabel(){return`No local files available.`}choices(){let e=this._query.trim().toLocaleLowerCase(),t=this.options.filter(t=>`${t.label} ${t.secondary??``}`.toLocaleLowerCase().includes(e));return{pinned:[],sections:[{options:t}],count:t.length,total:this.options.length,showFacets:!1}}};customElements.define(`managed-local-item-selector`,ht);var gt=class{constructor(e,t,n){this.host=e,this.kind=t,this.upload=n,this.source=null,this.hasData=!1,this.open=!1,this.options=[],this.value=null,this.busy=!1,this.loading=!1,this.error=``,this.success=``,this.generation=0,this.readAbort=null,this.onChange=e=>{if(e?.kind){if(e.kind!==this.kind)return;if(e.value!==this.value){this.refresh();return}}this.readAbort&&!this.readAbort.signal.aborted&&(this.readAbort.abort(),this.error=`The local ${this.kind} changed or the list was refreshed. Select it again before importing.`),this.options=[],this.value=null,this.success=``,this.refresh()},this.onBlur=()=>{this.readAbort&&!this.readAbort.signal.aborted&&this.onChange()},this.onVisibilityChange=()=>{globalThis.document?.visibilityState===`hidden`&&this.onBlur()},e.addController(this)}listeners(){return[[globalThis,`focus`,this.onChange],[globalThis,`blur`,this.onBlur],[globalThis,`storage`,this.onChange],[globalThis.document,`visibilitychange`,this.onVisibilityChange]]}hostConnected(){for(let[e,t,n]of this.listeners())e?.addEventListener(t,n);this.connectSource()}hostUpdated(){this.connectSource()}connectSource(){this.source!==this.host.localImportSource&&(this.unsubscribe?.(),this.abort?.abort(),this.source=this.host.localImportSource,this.unsubscribe=this.source?.subscribe(this.onChange),this.onChange())}hostDisconnected(){++this.generation,this.abort?.abort(),this.unsubscribe?.(),this.source=null;for(let[e,t,n]of this.listeners())e?.removeEventListener(t,n)}async refresh(){let e=++this.generation,t=this.source;this.loading=!0,this.host.requestUpdate();try{let n=t?await t.hasData(this.kind):!1;if(e!==this.generation)return;this.hasData=n;let r=this.open&&!t?.locked?await t?.list(this.kind)??[]:[];if(e!==this.generation)return;this.options=r,r.some(e=>e.value===this.value)||(this.value=null)}catch(t){e===this.generation&&(this.error=String(t?.message??t))}finally{e===this.generation&&(this.loading=!1,this.host.requestUpdate())}}toggle(){this.busy||(this.open=!this.open,this.error=``,this.success=``,this.options=[],this.value=null,this.refresh())}async busyWith(e){let t=this.abort=new AbortController;this.busy=!0,this.error=``,this.host.requestUpdate();try{await e(t)}catch(e){t.signal.aborted||(this.error=String(e?.message??e))}finally{this.readAbort===t&&(this.readAbort=null),this.busy=!1,this.host.requestUpdate()}}async unlock(){this.busy||await this.busyWith(async e=>{await this.source.unlock({signal:e.signal})&&!e.signal.aborted&&await this.refresh()})}async importSelected(){if(this.busy||this.loading||!this.value||this.source?.locked)return;this.success=``;let e=this.options.find(e=>e.value===this.value)?.label;await this.busyWith(async t=>{this.readAbort=t,await this.source.importItem(this.kind,this.value,e=>(this.readAbort=null,this.upload(e)),{signal:t.signal}),!t.signal.aborted&&!this.source?.locked&&(this.success=`Imported ${e}.`,this.value=null)})}renderAction(){return this.hasData||this.open?y`<button type="button" class="local-import-toggle" aria-expanded="${this.open}" aria-controls="local-import-panel" ?disabled="${this.busy}" @click="${()=>this.toggle()}">Import</button>`:b}renderPanel(e){if(!this.open)return b;let t=this.source?.locked;return y`<section class="local-import-panel" id="local-import-panel" aria-label="${`Import local ${this.kind}`}"><div class="local-import-copy"><strong>Import local ${this.kind}</strong><p>${t?`Unlock local data with your passkey to choose a file.`:`Copy a file from this browser to the managed workspace. The local copy stays on this device.`}</p></div><div class="local-import-controls">${t?y`<button type="button" class="local-import-submit" ?disabled="${this.busy}" @click="${()=>this.unlock()}">${this.busy?`Waiting for passkey…`:`Unlock with passkey`}</button>`:y`<managed-local-item-selector label="${`Choose local ${this.kind}`}" placeholder="${this.loading?`Loading local files…`:`Choose local ${this.kind}\u2026`}" .options="${this.options}" .value="${this.value}" ?disabled="${this.busy||this.loading}" @local-item-change="${e=>{this.value=e.detail.value,this.success=``,this.host.requestUpdate()}}"></managed-local-item-selector><button type="button" class="local-import-submit" ?disabled="${e||this.busy||this.loading||!this.value}" @click="${()=>this.importSelected()}">${this.busy?`Importing…`:`Import ${this.kind}`}</button>`} <button type="button" class="local-import-close" ?disabled="${this.busy}" @click="${()=>this.toggle()}">Close</button></div>${!t&&!this.loading&&this.options.length===0?y`<p class="local-import-message">No local ${this.kind}s available.</p>`:b} ${this.error?y`<p class="local-import-message error" role="alert">${this.error} <button type="button" ?disabled="${this.busy}" @click="${()=>{this.error=``,this.refresh()}}">Retry</button></p>`:b} ${this.success?y`<p class="local-import-message" role="status">${this.success}</p>`:b}</section>`}},T=e=>e?AbortSignal.any([e,u.sessionController.signal]):u.sessionController.signal,_t=()=>new DOMException(`Managed session changed`,`AbortError`),E=e=>e.json();async function vt({signal:e}={}){e=T(e),e.throwIfAborted();let t=await l(`/api/admin/bundles`,{credentials:`same-origin`,signal:e});if(e.throwIfAborted(),!t.ok)throw Object.assign(Error(`Bundle catalogue request failed (${t.status})`),{status:t.status});let n=await t.json();return e.throwIfAborted(),n.bundles??[]}async function D(e,t,n){let r=u.generation,i=await l(`/api/bundles/${encodeURIComponent(e)}/${t}`,{credentials:`same-origin`,signal:n});if(n?.throwIfAborted(),!i.ok)throw Object.assign(Error(`Bundle ${t} request failed (${i.status})`),{status:i.status});let a=t===`contents`?await i.text():await i.json();if(n?.throwIfAborted(),r!==u.generation)throw _t();return a}function yt(e,{signal:t}={}){return u.load(`bundle-metadata:${e}`,`bundle metadata`,t=>D(e,`metadata`,t),{signal:t,retryInvalidated:!0})}async function bt(e,{signal:t}={}){t=T(t);let n=await D(e,`metadata`,t),r=n?.bundle?.repo??null,i=rt({repo:r});if(!i)return r;let a=new URLSearchParams({repo:i,directory:r.directory??``}),o=new Set(n.unsized??[]),s=We((n.files??[]).filter(([e,t])=>t!=null||o.has(e)).map(([e])=>e));s&&a.set(`filePrefix`,s);let c=await l(`/api/admin/repositories/resolve?${a}`,{credentials:`same-origin`,cache:`no-store`,signal:t});if(t.throwIfAborted(),!c.ok)throw Error(`Repository suggestion request failed (${c.status})`);let{location:u}=await c.json();return t.throwIfAborted(),u?{...r,github:u.github,...u.mapped?{directory:u.directory}:{},repoId:u.repoId}:r}async function xt(e,{signal:t}={}){t=T(t);try{return await D(e,`contents`,t)}catch(e){throw e.name!==`AbortError`&&u.notify(`Couldn't load bundle contents: ${e.message}`),e}}function St(e,t,n=``,r=!1,i=!1){let a=n?`${n.startsWith(`entry:`)?`entry`:`reason`}=${encodeURIComponent(n.slice(n.indexOf(`:`)+1))}`:``,o=[t?`team=${encodeURIComponent(t)}`:``,a,r?`repoAdvisories=true`:``,i?`details=true`:``].filter(Boolean).join(`&`);return D(e,`advisories${o?`?${o}`:``}`,u.sessionController.signal)}var Ct={"patch-not-found":`The patch isn’t at the commit it was looked for at.`,"patch-mismatch":`The file at the commit the patch was read at isn’t the patch its lockfile names.`,"patch-unreadable":`The patch isn’t written as git writes one, so pnpm versions may apply it differently.`,"patch-unsupported":`The patch changes a file’s bytes, or gives it a mode other than 644 or 755, which isn’t reviewed here.`,"patch-does-not-apply":`The patch doesn’t apply to this version, though pnpm may still install part of it.`,"patch-too-large":`The patch is too large to read here.`,"no-repository":`The repository the patch is in isn’t available to you.`,"no-directory":`Only some of the repository the patch is in is available to you.`,"github-token-required":`Reading the patch needs your GitHub sign-in.`,"patch-not-kept":`The patch isn’t kept here: a review of a version it patches keeps it, as does a team’s Dependencies tab of its repository’s default branch.`},wt=e=>e?{patchHash:e.hash,...e.repoId==null?{}:{patchRepoId:String(e.repoId),patchCommit:e.commit},...e.path==null?{}:{patchPath:e.path}}:{},O={...Ct,"bad-tarball":`This package's tarball couldn't be read.`,"tarball-conflict":`This package's tarball isn't shown, as it doesn't install as one set of files: it holds two different files at one path, or at paths that are one on macOS or Windows, or a file within another, which installers each install their own way.`,"upstream-invalid":`The npm registry's answer for this package couldn't be read.`,"upstream-too-large":`The npm registry's answer for this package is too large to read here.`,400:`Not an npm package name and version.`,404:`No such package version, or it is not available to you.`,413:`This package is too large to open here.`,429:`Too many packages are loading. Try again shortly.`,502:`The npm registry couldn't be reached.`},Tt=15e3,k=new Map;function Et(e){if(k.has(e))return;let t=new AbortController,n=l(e,{credentials:`same-origin`,signal:AbortSignal.any([t.signal,u.sessionController.signal])});n.catch(()=>{});let r={reading:n,until:Date.now()+Tt,generation:u.generation};k.set(e,r),setTimeout(()=>{k.get(e)===r&&(k.delete(e),t.abort())},Tt)}function Dt(e,t){let n=k.get(e);return n?(k.delete(e),n.until>Date.now()&&n.generation===t?n.reading:null):null}var Ot=(e,t)=>new Promise((n,r)=>{let i=()=>r(t.reason);t.aborted?i():(t.addEventListener(`abort`,i,{once:!0}),e.then(n,r).finally(()=>t.removeEventListener(`abort`,i)))});async function A(e,t,n,r,i={}){r=T(r);let a=u.generation,o=()=>l(e,{credentials:`same-origin`,...i,signal:r}),s=i.method?null:Dt(e,a),c=s&&await Ot(s,r).then(e=>e.ok?e:null,e=>{if(r.aborted)throw e;return null})||await o();if(r.throwIfAborted(),!c.ok){let e=await c.json().catch(()=>null),n=e?.error??null;throw Object.assign(Error(t[n]??t[c.status]??`Request failed (${c.status})`),{status:c.status,code:n,...typeof e?.commit==`string`?{commit:e.commit}:{}})}let d=await n(c);if(r.throwIfAborted(),a!==u.generation)throw _t();return d}var j=(e,t,n)=>A(`/api/npm/${e}?${new URLSearchParams(t)}`,O,E,n),kt={"no-repository":`This repository is not available to you.`,"no-directory":`This directory is not at that commit, or not available to you.`,"directory-too-large":`This directory is too large to open here. Open one of its directories instead.`,"directory-unreadable":`GitHub’s archive of this directory couldn’t be read here, as when a symlink in it points outside the repository.`,"repository-busy":`Too many directories and packages are loading. Try again shortly.`,"repository-changed":`The repository changed while it was read. Try again.`,"github-rate-limited":`GitHub’s API rate limit has been reached. Try again later.`,"github-unauthorized":`GitHub authentication has expired or was revoked. Sign in again.`,"github-status-403":`GitHub denied this request. Check repository access and the GitHub App’s read permissions.`,"github-malformed":`GitHub’s archive of this directory could not be verified against its commit.`,"github-unreachable":`Could not connect to GitHub. Try again shortly.`,"github-moved":`GitHub moved this repository, as when it is renamed. Try again shortly.`,"github-timeout":`GitHub took too long to answer. Try again shortly.`,400:`Not a repository directory and commit.`,403:`Repository access is required to read its files.`,404:`This repository, commit or directory is unavailable.`,413:`This directory is too large to open here.`,429:`Too many directories and packages are loading. Try again shortly.`,502:`GitHub couldn’t be reached.`},M=(e,t,n,r=kt)=>A(`/api/admin/repositories/${e}?${new URLSearchParams(t)}`,r,E,n);function At(e,t,n,{signal:r}={}){return M(`code`,{repoId:e,ref:t,path:n},r)}async function jt({signal:e}={}){return(await M(`browsable`,{},e)).repos??[]}function Mt(e,{signal:t}={}){return M(`refs`,{repoId:e},t)}function Nt(e,t,n,{signal:r,commitOnly:i=!1}={}){return M(`contents`,{repoId:e,ref:t,path:n,...i?{listing:`none`}:{}},r)}var Pt={...kt,"no-directory":`This directory’s history is not available to you.`,"github-malformed":`GitHub answered with a history that couldn’t be read.`,"github-token-required":`Reading every branch needs your GitHub sign-in.`,400:`Not a repository’s history.`};function Ft(e,t,n,{page:r=1,all:i=!1,fresh:a=!1,from:o=null,signal:s}={}){return M(`history`,{repoId:e,ref:t,path:n,page:r,...i?{all:`true`}:{},...a?{fresh:`true`}:{},...o?{from:o.join(`,`)}:{}},s,Pt)}var It={...Pt,"no-directory":`This directory’s changes are not available to you.`,"github-malformed":`GitHub answered with a commit’s files that couldn’t be read.`,400:`Not a repository’s commits.`};function Lt(e,t,n,{signal:r}={}){return M(`changes`,{repoId:e,path:t,shas:n.join(`,`)},r,It)}function Rt(e,t,n,{signal:r}={}){return M(`tree`,{repoId:e,path:t,commit:n},r,It)}var N={...kt,"no-directory":`Issues and pull requests show only with access to the whole repository.`,"github-malformed":`GitHub answered with a list that couldn’t be read.`,"github-token-required":`Reading issues and pull requests needs your GitHub sign-in.`,"github-status-403":`GitHub refused to list these. The GitHub App reading this repository needs Issues: read and Pull requests: read, which an owner of its installation approves.`,400:`Not a repository’s issues or pull requests.`},zt=(e,t,n,r)=>`/api/admin/repositories/issues?${new URLSearchParams({repoId:e,kind:t,state:n,...r?{after:r}:{}})}`;function Bt(e,t,{state:n=`open`,after:r=null,signal:i}={}){return A(zt(e,t,n,r),N,E,i)}var Vt={...N,"no-directory":`Agents show only with access to the whole repository.`,"github-token-required":`Reading what the agents did needs your GitHub sign-in.`,400:`Not a repository’s agents.`},Ht=(e,t,n)=>`/api/admin/repositories/agents?${new URLSearchParams({repoId:e,...t?{pulls:t}:{},...n?{commits:n}:{}})}`;function Ut(e,{pulls:t=null,commits:n=null,signal:r}={}){return A(Ht(e,t,n),Vt,E,r)}var Wt={...N,"github-not-found":`GitHub has no issue or pull request of that number here.`,400:`Not an issue or pull request of a repository.`};function Gt(e,t,{signal:n}={}){return M(`item`,{repoId:e,number:t},n,Wt)}var Kt={...Wt,"github-not-found":`GitHub has no pull request of that number here.`,"github-malformed":`GitHub answered with a pull request or lockfile that couldn’t be read.`,"github-status-403":`GitHub refused to read its lockfiles. The GitHub App reading this repository needs Contents: read and Pull requests: read, which an owner of its installation approves.`,400:`Not a pull request of a repository.`},qt=({review:e,listed:t})=>({...e?{review:`1`}:{},...t?{listed:`1`}:{}});function Jt(e,t,{review:n=!1,listed:r=!1,signal:i}={}){return M(`pull-dependencies`,{repoId:e,number:t,...qt({review:n,listed:r})},i,Kt)}async function Yt(e,t,{review:n=!1,listed:r=!1,signal:i}={}){let{pulls:a,users:o,deltas:s}=await M(`pull-dependencies`,{repoId:e,numbers:t.join(`,`),...qt({review:n,listed:r})},i,Kt);return Xt(a,o,s)}var Xt=(e,t,n)=>new Map((Array.isArray(e)?e:[]).filter(e=>Number.isSafeInteger(e?.number)).map(e=>[e.number,typeof e.error==`string`?Object.assign(Error(Kt[e.error]??`It couldn\u2019t be read (${e.error}).`),{code:e.error}):{...e,...t?{users:t}:{},...Array.isArray(n)&&n.length>0?{deltas:n}:{}}])),Zt={...Wt,"github-not-found":`GitHub has none of a lockfile it lists on the default branch.`,"github-malformed":`GitHub answered with a lockfile that couldn’t be read.`,"github-status-403":`GitHub refused to read its lockfiles. The GitHub App reading this repository needs Contents: read, which an owner of its installation approves.`,400:`Not a repository.`},Qt={...Zt,"no-bundle":`This bundle is not available to you.`,"bundle-unavailable":`This bundle’s packages couldn’t be read.`,"directory-package-malformed":`This bundle records a package installed from a directory with an integrity, or naming no directory.`,"payload-too-large":`This bundle holds too many packages to check here.`,"repository-changed":`The bundle or its repository changed while it was read. Try again.`,"github-not-found":`GitHub has none of the commit this bundle was built from, or of a lockfile it lists there.`,400:`Not a bundle.`};function $t(e,{signal:t}={}){return A(`/api/bundles/${encodeURIComponent(e)}/dependency-review`,Qt,E,t)}var en={...Qt,"unsupported-bundle":`Only Stasis bundles are validated.`,"validation-busy":`Other bundles are being validated. Try again shortly.`,"validation-failed":`The validation failed. Try again.`,"csrf-missing":`Your session is missing its request token. Reload the page.`,"csrf-mismatch":`Your session changed. Reload the page.`,429:`Other bundles are being validated. Try again shortly.`},tn=e=>`/api/bundles/${encodeURIComponent(e)}/validation`;function nn(e,{signal:t}={}){return A(tn(e),en,E,t)}function rn(e,t,{signal:n}={}){return A(tn(e),en,e=>e.json().catch(()=>null),n,{method:`POST`,headers:{"x-csrf-token":t}})}var an={"no-team":`This team is not available to you.`,400:`Not a team’s repositories.`},on=`GitHub failed to answer. Try again shortly.`,sn={...N,"github-status-502":on,"github-status-504":on,"time-up":`Reading them took too long.`},cn=e=>`Not all its open pull requests were read. ${sn[e]??`(${e})`}`;function ln(e,t,{repoIds:n=null,signal:r}={}){let i=n?`?${new URLSearchParams({repoIds:n.join(`,`)})}`:``;return A(`/api/teams/${encodeURIComponent(e)}/dependencies${i}`,an,async e=>{for await(let n of On(e))t(typeof n.error==`string`?{...n,error:Zt[n.error]??Zt[n.status]??`It couldn\u2019t be read (${n.error}).`,code:n.error}:Array.isArray(n.dependencies)?{...n,dependencies:Xt(n.dependencies,n.users)}:typeof n.pulls?.error==`string`?{...n,pulls:{...n.pulls,error:cn(n.pulls.error)}}:n)},r)}function un(e,t,n,r,{signal:i}={}){let a=JSON.stringify({since:t,versions:n.map(({name:e,version:t})=>[e,t])});return A(`/api/teams/${encodeURIComponent(e)}/dependency-reviews/changed`,an,e=>e.json().then(e=>({now:Number.isSafeInteger(e?.now)?e.now:null,versions:Array.isArray(e?.versions)?e.versions.flatMap(e=>Array.isArray(e)&&typeof e[0]==`string`&&typeof e[1]==`string`?[{name:e[0],version:e[1]}]:[]):[]})),i,{method:`POST`,headers:{"content-type":`application/json`,"x-csrf-token":r},body:a})}var dn={...N,"no-directory":`Pulse shows only with access to the whole repository.`,"github-malformed":`GitHub answered with statistics that couldn’t be read.`,"github-token-required":`Reading a repository’s pulse needs your GitHub sign-in.`,"github-status-403":`GitHub refused to read these. The GitHub App reading this repository needs Contents, Issues and Pull requests: read, which an owner of its installation approves.`,400:`Not a repository’s pulse.`},fn=(e,t)=>`/api/admin/repositories/pulse?${new URLSearchParams({repoId:e,weeks:t})}`;function pn(e,t,{signal:n}={}){return A(fn(e,t),dn,E,n)}function mn(e,t,{state:n=`open`,weeks:r=4}={}){t===`issues`||t===`pulls`?Et(zt(e,t,n,null)):t===`agents`?Et(Ht(e,null,null)):t===`pulse`&&Et(fn(e,r))}function hn(e,t,{from:n,to:r=null,authors:i=[]},{signal:a}={}){return M(`pulse/items`,{repoId:e,weeks:t,from:n,...r===null?{}:{to:r},...i.length>0?{authors:i.join(`,`)}:{}},a,dn)}function gn(e,t,{signal:n,patch:r=null}={}){return j(`package`,{name:e,version:t,...wt(r)},n)}function _n(e,{signal:t}={}){return j(`versions`,{name:e},t)}function vn(e,{signal:t}={}){return j(`stats`,{name:e},t)}function yn(e,{signal:t}={}){return j(`advisories`,{name:e},t)}function bn(e,t,{signal:n}={}){return j(`tags`,{name:e,version:t},n)}function xn(e,t,{signal:n}={}){return j(`socket`,{name:e,version:t},n)}function Sn(e,t,n=null,{signal:r}={}){return j(`risk`,{name:e,version:t,...n===null?{}:{otherVersion:n}},r)}function Cn(e,t,{signal:n}={}){return j(`provenance`,{name:e,version:t},n)}var P={404:`This file is no longer available.`,409:`This file has changed since it was opened.`,413:`This file is too large to pretty-print.`,422:`This file couldn't be read as code.`,"pretty-mismatch":`Pretty-printing would change more than its layout, so it is shown as published.`,unsupported:`This kind of file can't be checked once pretty-printed, so it is shown as published.`,429:`Too many files are being pretty-printed. Try again shortly.`,502:`The npm registry couldn't be reached.`};function wn(e,t,n,{signal:r}={}){return A(`/api/bundles/${encodeURIComponent(e)}/pretty?${new URLSearchParams({path:t,hash:n})}`,P,En,r)}function Tn(e,t,n,r,{signal:i}={}){return A(`/api/npm/pretty?${new URLSearchParams({name:e,version:t,path:n,hash:r})}`,{...O,...P},En,i)}var En=async e=>({text:await e.text(),source:e.headers.get(`x-source-hash`)});async function*Dn(e){let t=e.body.pipeThrough(new TextDecoderStream).getReader(),n=[];for(;;){let{done:e,value:r}=await t.read();if(e)return;let i=0;for(let e=r.indexOf(`
|
|
1
|
+
import{b as e,d as t,i as n}from"./chunk-WB3NRZL7.js";import{a as r}from"./chunk-6VOB5WXX.js";import{A as i,B as a,a as o,b as s,c,d as l,e as u,f as d,g as ee,h as te,i as ne,j as re,k as ie,l as ae,m as oe,n as se,o as ce,p as le,q as ue,r as de,s as fe,t as pe,u as me,v as he,w as ge,x as _e,y as ve,z as ye}from"./chunk-SDLETN3Z.js";import"./chunk-6CCSTJWB.js";import{$a as be,H as xe,I as Se,Ka as Ce,Sa as we,Ta as Te,X as Ee,Ya as De,Za as Oe,a as ke,ab as Ae,bb as je,cb as Me,db as Ne,eb as f,fb as Pe,g as Fe,gb as p,hb as Ie,i as Le,ja as Re,ka as ze,m as Be,ma as Ve,n as m,z as He}from"./chunk-EMNIV37E.js";import{y as Ue}from"./chunk-OWIBDEJJ.js";import"./chunk-S5HSDGTP.js";import{b as We}from"./chunk-NRPC74AM.js";import"./chunk-PNHBZGDD.js";import{a as h,e as Ge}from"./chunk-74JZTGTO.js";import"./chunk-IYPY47MC.js";import{C as Ke,D as qe,d as g,h as Je,i as Ye,j as Xe,x as _,y as Ze}from"./chunk-ITUKKCCK.js";import{a as Qe,d as $e}from"./chunk-PWFUOLZK.js";import"./chunk-C4Z6ZBXV.js";import{m as et,r as tt}from"./chunk-WGQ7D5DB.js";import{B as nt,D as rt,J as it}from"./chunk-QRKFPLA4.js";import{a as v,b as at,c as y,d as ot,g as b,j as st}from"./chunk-2XUEZHIP.js";import"./chunk-TUII34K2.js";import"./chunk-OOJM4CTU.js";function ct(e){let t=document.createElement(`input`);t.type=`file`,t.multiple=!0,t.addEventListener(`change`,()=>{e([...t.files])},{once:!0}),t.click()}function lt(e,t,n){let r=0,i=e=>Array.from(e.dataTransfer?.types??[]).includes(`Files`),a=e=>{i(e)&&(e.preventDefault(),r+=1,n(!0))},o=e=>{i(e)&&e.preventDefault()},s=e=>{i(e)&&(r=Math.max(0,r-1),r===0&&n(!1))},c=e=>{i(e)&&(e.preventDefault(),e.stopPropagation(),r=0,n(!1),t([...e.dataTransfer.files]))};return e.addEventListener(`dragenter`,a),e.addEventListener(`dragover`,o),e.addEventListener(`dragleave`,s),e.addEventListener(`drop`,c),()=>{e.removeEventListener(`dragenter`,a),e.removeEventListener(`dragover`,o),e.removeEventListener(`dragleave`,s),e.removeEventListener(`drop`,c)}}async function ut(e,t,n,r){let i=e.appState.generation;try{return await e.appState.mutate(()=>n(t),r)}catch(t){throw i===e.appState.generation&&e.appState.invalidate(r),t}}async function dt(e,t,n,r){if(e._busy||!e._csrf)throw Error(`Wait for the current operation to finish, then try again.`);e._busy=!0;try{await ut(e,t,n,r)}finally{await e._load(),e._busy=!1;let t=e._queue.splice(0);t.length>0&&e._upload(t)}}async function ft(e,t,n,r){if(t.length===0||(e._queue.push(...t),e._busy))return;e._busy=!0,e._error=null;let i=e.appState.generation,a=[],o=0;try{for(;e._queue.length>0;){if(e.appState.generation!==i){e._queue=[];break}let t=e._queue.shift();try{await ut(e,t,n,r)}catch(n){if(n?.name===`AbortError`||e.appState.generation!==i){e._queue=[];break}a.push(`${t.name}: ${String(n?.message??n)}`)}o++}}finally{a.length>0&&(e._error=o===1?`Upload failed: ${a[0]}`:`Upload failed for ${a.length} of ${o} files: ${a.join(`; `)}`),e._busy=!1,await e._load({preserveError:!0})}}var x=class extends st{static properties={session:{attribute:!1},allowShare:{attribute:!1},_loading:{state:!0},_data:{state:!0},_error:{state:!0}};constructor(){super(),this.session=null,this.allowShare=!1,this.appState=u,this._loading=!1,this._loadRequest=null,this._data=null,this._error=null}get _role(){return this.session?.role??null}get _csrf(){return this.session?.csrfToken??null}get _me(){return this.session?.id??null}connectedCallback(){super.connectedCallback(),this._load()}disconnectedCallback(){this._loadRequest?.abort(),super.disconnectedCallback()}async _load({preserveError:e=!1}={}){let{collection:t}=this.constructor;if(!t)return;e||(this._error=null);let[n,r,i]=t;await this._loadCollection(n,r,i,e=>this._show(e))}_show(e){this._data=e}async _loadCollection(e,t,n,r){this._loading=!0,await this._read(`_loadRequest`,e,t,n,{apply:r,settled:()=>{this._loading=!1},failed:t=>{this.appState.read(e)===void 0&&(this._error=String(t?.message??t))}})}async _read(e,t,n,r,{apply:i,answered:a,failed:o,settled:s}){this[e]?.abort();let c=this[e]=new AbortController;try{await this.appState.load(t,n,r,{signal:c.signal,apply:i}),c.signal.aborted||a?.()}catch(e){!c.signal.aborted&&e?.name!==`AbortError`&&o(e)}finally{this[e]===c&&s()}}_nav(){return Pe(this.constructor.view,this._role,this.allowShare)}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}_list(e,t,n){return y`<div class="manage-list" aria-busy="${this._loading}">${e==null?this._error?b:S(t):n()}</div>`}},pt=class{constructor(e,t=()=>!0){this.host=e,this.accepts=t,this.active=!1,e.addController(this)}hostConnected(){this.teardown=lt(this.host,e=>{this.accepts()&&this.host._upload(e)},e=>{this.active=this.accepts()&&e,this.host.requestUpdate()})}hostDisconnected(){this.teardown?.()}overlay(e){return this.active?y`<div class="dropzone">${e}</div>`:b}card(e,t,n,r=`Uploading…`){return y`<span class="drop-icon" aria-hidden="true">${p(`upload`)}</span><span class="drop-copy"><strong>${e}</strong><span>${t}</span></span><button type="button" class="drop-browse" ?disabled="${n}" @click="${()=>ct(e=>{this.host._upload(e)})}">${this.host._busy?r:`Browse files`}</button>`}};function S(e){return y`<div class="loading-rows" role="status"><span class="sr-only">${e}</span><div aria-hidden="true">${[0,1,2,3].map(()=>y`<div class="loading-row"><span></span><span></span></div>`)}</div></div>`}var C=e=>e?y`<p class="msg error" role="alert">${e}</p>`:b,w=(e,t)=>y`<div class="empty"><strong>${e}</strong><p>${t}</p></div>`;function mt(e){let t=e.split(`/`);return t.at(-1)===`stasis.config.json`&&!t.includes(`node_modules`)}var ht=class extends Te{get changeEvent(){return`local-item-change`}get searchLabel(){return`Search local files`}get optionsLabel(){return`Local files`}get noMatchesLabel(){return`No matching files.`}get emptyLabel(){return`No local files available.`}choices(){let e=this._query.trim().toLocaleLowerCase(),t=this.options.filter(t=>`${t.label} ${t.secondary??``}`.toLocaleLowerCase().includes(e));return{pinned:[],sections:[{options:t}],count:t.length,total:this.options.length,showFacets:!1}}};customElements.define(`managed-local-item-selector`,ht);var gt=class{constructor(e,t,n){this.host=e,this.kind=t,this.upload=n,this.source=null,this.hasData=!1,this.open=!1,this.options=[],this.value=null,this.busy=!1,this.loading=!1,this.error=``,this.success=``,this.generation=0,this.readAbort=null,this.onChange=e=>{if(e?.kind){if(e.kind!==this.kind)return;if(e.value!==this.value){this.refresh();return}}this.readAbort&&!this.readAbort.signal.aborted&&(this.readAbort.abort(),this.error=`The local ${this.kind} changed or the list was refreshed. Select it again before importing.`),this.options=[],this.value=null,this.success=``,this.refresh()},this.onBlur=()=>{this.readAbort&&!this.readAbort.signal.aborted&&this.onChange()},this.onVisibilityChange=()=>{globalThis.document?.visibilityState===`hidden`&&this.onBlur()},e.addController(this)}listeners(){return[[globalThis,`focus`,this.onChange],[globalThis,`blur`,this.onBlur],[globalThis,`storage`,this.onChange],[globalThis.document,`visibilitychange`,this.onVisibilityChange]]}hostConnected(){for(let[e,t,n]of this.listeners())e?.addEventListener(t,n);this.connectSource()}hostUpdated(){this.connectSource()}connectSource(){this.source!==this.host.localImportSource&&(this.unsubscribe?.(),this.abort?.abort(),this.source=this.host.localImportSource,this.unsubscribe=this.source?.subscribe(this.onChange),this.onChange())}hostDisconnected(){++this.generation,this.abort?.abort(),this.unsubscribe?.(),this.source=null;for(let[e,t,n]of this.listeners())e?.removeEventListener(t,n)}async refresh(){let e=++this.generation,t=this.source;this.loading=!0,this.host.requestUpdate();try{let n=t?await t.hasData(this.kind):!1;if(e!==this.generation)return;this.hasData=n;let r=this.open&&!t?.locked?await t?.list(this.kind)??[]:[];if(e!==this.generation)return;this.options=r,r.some(e=>e.value===this.value)||(this.value=null)}catch(t){e===this.generation&&(this.error=String(t?.message??t))}finally{e===this.generation&&(this.loading=!1,this.host.requestUpdate())}}toggle(){this.busy||(this.open=!this.open,this.error=``,this.success=``,this.options=[],this.value=null,this.refresh())}async busyWith(e){let t=this.abort=new AbortController;this.busy=!0,this.error=``,this.host.requestUpdate();try{await e(t)}catch(e){t.signal.aborted||(this.error=String(e?.message??e))}finally{this.readAbort===t&&(this.readAbort=null),this.busy=!1,this.host.requestUpdate()}}async unlock(){this.busy||await this.busyWith(async e=>{await this.source.unlock({signal:e.signal})&&!e.signal.aborted&&await this.refresh()})}async importSelected(){if(this.busy||this.loading||!this.value||this.source?.locked)return;this.success=``;let e=this.options.find(e=>e.value===this.value)?.label;await this.busyWith(async t=>{this.readAbort=t,await this.source.importItem(this.kind,this.value,e=>(this.readAbort=null,this.upload(e)),{signal:t.signal}),!t.signal.aborted&&!this.source?.locked&&(this.success=`Imported ${e}.`,this.value=null)})}renderAction(){return this.hasData||this.open?y`<button type="button" class="local-import-toggle" aria-expanded="${this.open}" aria-controls="local-import-panel" ?disabled="${this.busy}" @click="${()=>this.toggle()}">Import</button>`:b}renderPanel(e){if(!this.open)return b;let t=this.source?.locked;return y`<section class="local-import-panel" id="local-import-panel" aria-label="${`Import local ${this.kind}`}"><div class="local-import-copy"><strong>Import local ${this.kind}</strong><p>${t?`Unlock local data with your passkey to choose a file.`:`Copy a file from this browser to the managed workspace. The local copy stays on this device.`}</p></div><div class="local-import-controls">${t?y`<button type="button" class="local-import-submit" ?disabled="${this.busy}" @click="${()=>this.unlock()}">${this.busy?`Waiting for passkey…`:`Unlock with passkey`}</button>`:y`<managed-local-item-selector label="${`Choose local ${this.kind}`}" placeholder="${this.loading?`Loading local files…`:`Choose local ${this.kind}\u2026`}" .options="${this.options}" .value="${this.value}" ?disabled="${this.busy||this.loading}" @local-item-change="${e=>{this.value=e.detail.value,this.success=``,this.host.requestUpdate()}}"></managed-local-item-selector><button type="button" class="local-import-submit" ?disabled="${e||this.busy||this.loading||!this.value}" @click="${()=>this.importSelected()}">${this.busy?`Importing…`:`Import ${this.kind}`}</button>`} <button type="button" class="local-import-close" ?disabled="${this.busy}" @click="${()=>this.toggle()}">Close</button></div>${!t&&!this.loading&&this.options.length===0?y`<p class="local-import-message">No local ${this.kind}s available.</p>`:b} ${this.error?y`<p class="local-import-message error" role="alert">${this.error} <button type="button" ?disabled="${this.busy}" @click="${()=>{this.error=``,this.refresh()}}">Retry</button></p>`:b} ${this.success?y`<p class="local-import-message" role="status">${this.success}</p>`:b}</section>`}},T=e=>e?AbortSignal.any([e,u.sessionController.signal]):u.sessionController.signal,_t=()=>new DOMException(`Managed session changed`,`AbortError`),E=e=>e.json();async function vt({signal:e}={}){e=T(e),e.throwIfAborted();let t=await l(`/api/admin/bundles`,{credentials:`same-origin`,signal:e});if(e.throwIfAborted(),!t.ok)throw Object.assign(Error(`Bundle catalogue request failed (${t.status})`),{status:t.status});let n=await t.json();return e.throwIfAborted(),n.bundles??[]}async function D(e,t,n){let r=u.generation,i=await l(`/api/bundles/${encodeURIComponent(e)}/${t}`,{credentials:`same-origin`,signal:n});if(n?.throwIfAborted(),!i.ok)throw Object.assign(Error(`Bundle ${t} request failed (${i.status})`),{status:i.status});let a=t===`contents`?await i.text():await i.json();if(n?.throwIfAborted(),r!==u.generation)throw _t();return a}function yt(e,{signal:t}={}){return u.load(`bundle-metadata:${e}`,`bundle metadata`,t=>D(e,`metadata`,t),{signal:t,retryInvalidated:!0})}async function bt(e,{signal:t}={}){t=T(t);let n=await D(e,`metadata`,t),r=n?.bundle?.repo??null,i=rt({repo:r});if(!i)return r;let a=new URLSearchParams({repo:i,directory:r.directory??``}),o=new Set(n.unsized??[]),s=We((n.files??[]).filter(([e,t])=>t!=null||o.has(e)).map(([e])=>e));s&&a.set(`filePrefix`,s);let c=await l(`/api/admin/repositories/resolve?${a}`,{credentials:`same-origin`,cache:`no-store`,signal:t});if(t.throwIfAborted(),!c.ok)throw Error(`Repository suggestion request failed (${c.status})`);let{location:u}=await c.json();return t.throwIfAborted(),u?{...r,github:u.github,...u.mapped?{directory:u.directory}:{},repoId:u.repoId}:r}async function xt(e,{signal:t}={}){t=T(t);try{return await D(e,`contents`,t)}catch(e){throw e.name!==`AbortError`&&u.notify(`Couldn't load bundle contents: ${e.message}`),e}}function St(e,t,n=``,r=!1,i=!1){let a=n?`${n.startsWith(`entry:`)?`entry`:`reason`}=${encodeURIComponent(n.slice(n.indexOf(`:`)+1))}`:``,o=[t?`team=${encodeURIComponent(t)}`:``,a,r?`repoAdvisories=true`:``,i?`details=true`:``].filter(Boolean).join(`&`);return D(e,`advisories${o?`?${o}`:``}`,u.sessionController.signal)}var Ct={"patch-not-found":`The patch isn’t at the commit it was looked for at.`,"patch-mismatch":`The file at the commit the patch was read at isn’t the patch its lockfile names.`,"patch-unreadable":`The patch isn’t written as git writes one, so pnpm versions may apply it differently.`,"patch-unsupported":`The patch changes a file’s bytes, or gives it a mode other than 644 or 755, which isn’t reviewed here.`,"patch-does-not-apply":`The patch doesn’t apply to this version, though pnpm may still install part of it.`,"patch-too-large":`The patch is too large to read here.`,"no-repository":`The repository the patch is in isn’t available to you.`,"no-directory":`Only some of the repository the patch is in is available to you.`,"github-token-required":`Reading the patch needs your GitHub sign-in.`,"patch-not-kept":`The patch isn’t kept here: a review of a version it patches keeps it, as does a team’s Dependencies tab of its repository’s default branch.`},wt=e=>e?{patchHash:e.hash,...e.repoId==null?{}:{patchRepoId:String(e.repoId),patchCommit:e.commit},...e.path==null?{}:{patchPath:e.path}}:{},O={...Ct,"bad-tarball":`This package's tarball couldn't be read.`,"tarball-conflict":`This package's tarball isn't shown, as it doesn't install as one set of files: it holds two different files at one path, or at paths that are one on macOS or Windows, or a file within another, which installers each install their own way.`,"upstream-invalid":`The npm registry's answer for this package couldn't be read.`,"upstream-too-large":`The npm registry's answer for this package is too large to read here.`,400:`Not an npm package name and version.`,404:`No such package version, or it is not available to you.`,413:`This package is too large to open here.`,429:`Too many packages are loading. Try again shortly.`,502:`The npm registry couldn't be reached.`},Tt=15e3,k=new Map;function Et(e){if(k.has(e))return;let t=new AbortController,n=l(e,{credentials:`same-origin`,signal:AbortSignal.any([t.signal,u.sessionController.signal])});n.catch(()=>{});let r={reading:n,until:Date.now()+Tt,generation:u.generation};k.set(e,r),setTimeout(()=>{k.get(e)===r&&(k.delete(e),t.abort())},Tt)}function Dt(e,t){let n=k.get(e);return n?(k.delete(e),n.until>Date.now()&&n.generation===t?n.reading:null):null}var Ot=(e,t)=>new Promise((n,r)=>{let i=()=>r(t.reason);t.aborted?i():(t.addEventListener(`abort`,i,{once:!0}),e.then(n,r).finally(()=>t.removeEventListener(`abort`,i)))});async function A(e,t,n,r,i={}){r=T(r);let a=u.generation,o=()=>l(e,{credentials:`same-origin`,...i,signal:r}),s=i.method?null:Dt(e,a),c=s&&await Ot(s,r).then(e=>e.ok?e:null,e=>{if(r.aborted)throw e;return null})||await o();if(r.throwIfAborted(),!c.ok){let e=await c.json().catch(()=>null),n=e?.error??null;throw Object.assign(Error(t[n]??t[c.status]??`Request failed (${c.status})`),{status:c.status,code:n,...typeof e?.commit==`string`?{commit:e.commit}:{}})}let d=await n(c);if(r.throwIfAborted(),a!==u.generation)throw _t();return d}var j=(e,t,n)=>A(`/api/npm/${e}?${new URLSearchParams(t)}`,O,E,n),kt={"no-repository":`This repository is not available to you.`,"no-directory":`This directory is not at that commit, or not available to you.`,"directory-too-large":`This directory is too large to open here. Open one of its directories instead.`,"directory-unreadable":`GitHub’s archive of this directory couldn’t be read here, as when a symlink in it points outside the repository.`,"repository-busy":`Too many directories and packages are loading. Try again shortly.`,"repository-changed":`The repository changed while it was read. Try again.`,"github-rate-limited":`GitHub’s API rate limit has been reached. Try again later.`,"github-unauthorized":`GitHub authentication has expired or was revoked. Sign in again.`,"github-status-403":`GitHub denied this request. Check repository access and the GitHub App’s read permissions.`,"github-malformed":`GitHub’s archive of this directory could not be verified against its commit.`,"github-unreachable":`Could not connect to GitHub. Try again shortly.`,"github-moved":`GitHub moved this repository, as when it is renamed. Try again shortly.`,"github-timeout":`GitHub took too long to answer. Try again shortly.`,400:`Not a repository directory and commit.`,403:`Repository access is required to read its files.`,404:`This repository, commit or directory is unavailable.`,413:`This directory is too large to open here.`,429:`Too many directories and packages are loading. Try again shortly.`,502:`GitHub couldn’t be reached.`},M=(e,t,n,r=kt)=>A(`/api/admin/repositories/${e}?${new URLSearchParams(t)}`,r,E,n);function At(e,t,n,{signal:r}={}){return M(`code`,{repoId:e,ref:t,path:n},r)}async function jt({signal:e}={}){return(await M(`browsable`,{},e)).repos??[]}function Mt(e,{signal:t}={}){return M(`refs`,{repoId:e},t)}function Nt(e,t,n,{signal:r,commitOnly:i=!1}={}){return M(`contents`,{repoId:e,ref:t,path:n,...i?{listing:`none`}:{}},r)}var Pt={...kt,"no-directory":`This directory’s history is not available to you.`,"github-malformed":`GitHub answered with a history that couldn’t be read.`,"github-token-required":`Reading every branch needs your GitHub sign-in.`,400:`Not a repository’s history.`};function Ft(e,t,n,{page:r=1,all:i=!1,fresh:a=!1,from:o=null,signal:s}={}){return M(`history`,{repoId:e,ref:t,path:n,page:r,...i?{all:`true`}:{},...a?{fresh:`true`}:{},...o?{from:o.join(`,`)}:{}},s,Pt)}var It={...Pt,"no-directory":`This directory’s changes are not available to you.`,"github-malformed":`GitHub answered with a commit’s files that couldn’t be read.`,400:`Not a repository’s commits.`};function Lt(e,t,n,{signal:r}={}){return M(`changes`,{repoId:e,path:t,shas:n.join(`,`)},r,It)}function Rt(e,t,n,{signal:r}={}){return M(`tree`,{repoId:e,path:t,commit:n},r,It)}var N={...kt,"no-directory":`Issues and pull requests show only with access to the whole repository.`,"github-malformed":`GitHub answered with a list that couldn’t be read.`,"github-token-required":`Reading issues and pull requests needs your GitHub sign-in.`,"github-status-403":`GitHub refused to list these. The GitHub App reading this repository needs Issues: read and Pull requests: read, which an owner of its installation approves.`,400:`Not a repository’s issues or pull requests.`},zt=(e,t,n,r)=>`/api/admin/repositories/issues?${new URLSearchParams({repoId:e,kind:t,state:n,...r?{after:r}:{}})}`;function Bt(e,t,{state:n=`open`,after:r=null,signal:i}={}){return A(zt(e,t,n,r),N,E,i)}var Vt={...N,"no-directory":`Agents show only with access to the whole repository.`,"github-token-required":`Reading what the agents did needs your GitHub sign-in.`,400:`Not a repository’s agents.`},Ht=(e,t,n)=>`/api/admin/repositories/agents?${new URLSearchParams({repoId:e,...t?{pulls:t}:{},...n?{commits:n}:{}})}`;function Ut(e,{pulls:t=null,commits:n=null,signal:r}={}){return A(Ht(e,t,n),Vt,E,r)}var Wt={...N,"github-not-found":`GitHub has no issue or pull request of that number here.`,400:`Not an issue or pull request of a repository.`};function Gt(e,t,{signal:n}={}){return M(`item`,{repoId:e,number:t},n,Wt)}var Kt={...Wt,"github-not-found":`GitHub has no pull request of that number here.`,"github-malformed":`GitHub answered with a pull request or lockfile that couldn’t be read.`,"github-status-403":`GitHub refused to read its lockfiles. The GitHub App reading this repository needs Contents: read and Pull requests: read, which an owner of its installation approves.`,400:`Not a pull request of a repository.`},qt=({review:e,listed:t})=>({...e?{review:`1`}:{},...t?{listed:`1`}:{}});function Jt(e,t,{review:n=!1,listed:r=!1,signal:i}={}){return M(`pull-dependencies`,{repoId:e,number:t,...qt({review:n,listed:r})},i,Kt)}async function Yt(e,t,{review:n=!1,listed:r=!1,signal:i}={}){let{pulls:a,users:o,deltas:s}=await M(`pull-dependencies`,{repoId:e,numbers:t.join(`,`),...qt({review:n,listed:r})},i,Kt);return Xt(a,o,s)}var Xt=(e,t,n)=>new Map((Array.isArray(e)?e:[]).filter(e=>Number.isSafeInteger(e?.number)).map(e=>[e.number,typeof e.error==`string`?Object.assign(Error(Kt[e.error]??`It couldn\u2019t be read (${e.error}).`),{code:e.error}):{...e,...t?{users:t}:{},...Array.isArray(n)&&n.length>0?{deltas:n}:{}}])),Zt={...Wt,"github-not-found":`GitHub has none of a lockfile it lists on the default branch.`,"github-malformed":`GitHub answered with a lockfile that couldn’t be read.`,"github-status-403":`GitHub refused to read its lockfiles. The GitHub App reading this repository needs Contents: read, which an owner of its installation approves.`,400:`Not a repository.`},Qt={...Zt,"no-bundle":`This bundle is not available to you.`,"bundle-unavailable":`This bundle’s packages couldn’t be read.`,"directory-package-malformed":`This bundle records a package installed from a directory with an integrity, or naming no directory.`,"payload-too-large":`This bundle holds too many packages to check here.`,"repository-changed":`The bundle or its repository changed while it was read. Try again.`,"github-not-found":`GitHub has none of the commit this bundle was built from, or of a lockfile it lists there.`,400:`Not a bundle.`};function $t(e,{signal:t}={}){return A(`/api/bundles/${encodeURIComponent(e)}/dependency-review`,Qt,E,t)}var en={...Qt,"unsupported-bundle":`Only Stasis bundles are validated.`,"validation-busy":`Other bundles are being validated. Try again shortly.`,"validation-failed":`The validation failed. Try again.`,"csrf-missing":`Your session is missing its request token. Reload the page.`,"csrf-mismatch":`Your session changed. Reload the page.`,429:`Other bundles are being validated. Try again shortly.`},tn=e=>`/api/bundles/${encodeURIComponent(e)}/validation`;function nn(e,{signal:t}={}){return A(tn(e),en,E,t)}function rn(e,t,{signal:n}={}){return A(tn(e),en,e=>e.json().catch(()=>null),n,{method:`POST`,headers:{"x-csrf-token":t}})}var an={"no-team":`This team is not available to you.`,400:`Not a team’s repositories.`},on=`GitHub failed to answer. Try again shortly.`,sn={...N,"github-status-502":on,"github-status-504":on,"time-up":`Reading them took too long.`},cn=e=>`Not all its open pull requests were read. ${sn[e]??`(${e})`}`;function ln(e,t,{repoIds:n=null,signal:r}={}){let i=n?`?${new URLSearchParams({repoIds:n.join(`,`)})}`:``;return A(`/api/teams/${encodeURIComponent(e)}/dependencies${i}`,an,async e=>{for await(let n of On(e))t(typeof n.error==`string`?{...n,error:Zt[n.error]??Zt[n.status]??`It couldn\u2019t be read (${n.error}).`,code:n.error}:Array.isArray(n.dependencies)?{...n,dependencies:Xt(n.dependencies,n.users)}:typeof n.pulls?.error==`string`?{...n,pulls:{...n.pulls,error:cn(n.pulls.error)}}:n)},r)}function un(e,t,n,r,{signal:i}={}){let a=JSON.stringify({since:t,versions:n.map(({name:e,version:t})=>[e,t])});return A(`/api/teams/${encodeURIComponent(e)}/dependency-reviews/changed`,an,e=>e.json().then(e=>({now:Number.isSafeInteger(e?.now)?e.now:null,versions:Array.isArray(e?.versions)?e.versions.flatMap(e=>Array.isArray(e)&&typeof e[0]==`string`&&typeof e[1]==`string`?[{name:e[0],version:e[1]}]:[]):[]})),i,{method:`POST`,headers:{"content-type":`application/json`,"x-csrf-token":r},body:a})}var dn={...N,"no-directory":`Pulse shows only with access to the whole repository.`,"github-malformed":`GitHub answered with statistics that couldn’t be read.`,"github-token-required":`Reading a repository’s pulse needs your GitHub sign-in.`,"github-status-403":`GitHub refused to read these. The GitHub App reading this repository needs Contents, Issues and Pull requests: read, which an owner of its installation approves.`,400:`Not a repository’s pulse.`},fn=(e,t)=>`/api/admin/repositories/pulse?${new URLSearchParams({repoId:e,weeks:t})}`;function pn(e,t,{signal:n}={}){return A(fn(e,t),dn,E,n)}function mn(e,t,{state:n=`open`,weeks:r=4}={}){t===`issues`||t===`pulls`?Et(zt(e,t,n,null)):t===`agents`?Et(Ht(e,null,null)):t===`pulse`&&Et(fn(e,r))}function hn(e,t,{from:n,to:r=null,authors:i=[]},{signal:a}={}){return M(`pulse/items`,{repoId:e,weeks:t,from:n,...r===null?{}:{to:r},...i.length>0?{authors:i.join(`,`)}:{}},a,dn)}function gn(e,t,{signal:n,patch:r=null}={}){return j(`package`,{name:e,version:t,...wt(r)},n)}function _n(e,{signal:t}={}){return j(`versions`,{name:e},t)}function vn(e,{signal:t}={}){return j(`stats`,{name:e},t)}function yn(e,{signal:t}={}){return j(`advisories`,{name:e},t)}function bn(e,t,{signal:n}={}){return j(`tags`,{name:e,version:t},n)}function xn(e,t,{signal:n}={}){return j(`socket`,{name:e,version:t},n)}function Sn(e,t,n=null,{signal:r}={}){return j(`risk`,{name:e,version:t,...n===null?{}:{otherVersion:n}},r)}function Cn(e,t,{signal:n}={}){return j(`provenance`,{name:e,version:t},n)}var P={404:`This file is no longer available.`,409:`This file has changed since it was opened.`,413:`This file is too large to pretty-print.`,422:`This file couldn't be read as code.`,"pretty-mismatch":`Pretty-printing would change more than its layout, so it is shown as published.`,unsupported:`This kind of file can't be checked once pretty-printed, so it is shown as published.`,429:`Too many files are being pretty-printed. Try again shortly.`,502:`The npm registry couldn't be reached.`};function wn(e,t,n,{signal:r}={}){return A(`/api/bundles/${encodeURIComponent(e)}/pretty?${new URLSearchParams({path:t,hash:n})}`,P,En,r)}function Tn(e,t,n,r,{signal:i}={}){return A(`/api/npm/pretty?${new URLSearchParams({name:e,version:t,path:n,hash:r})}`,{...O,...P},En,i)}var En=async e=>({text:await e.text(),source:e.headers.get(`x-source-hash`)});async function*Dn(e){let t=e.body.pipeThrough(new TextDecoderStream).getReader(),n=[];for(;;){let{done:e,value:r}=await t.read();if(e)return;let i=0;for(let e=r.indexOf(`
|
|
2
2
|
`);e!==-1;i=e+1,e=r.indexOf(`
|
|
3
3
|
`,i))n.push(r.slice(i,e)),yield JSON.parse(n.join(``)),n=[];n.push(r.slice(i))}}async function*On(e){let t=u.generation;for await(let n of Dn(e)){if(t!==u.generation)throw _t();yield n}}function kn(e,t,n,{signal:r}={}){return F(`/api/npm/pretty?${new URLSearchParams({name:e,version:t})}`,O,n,r)}function An(e,t,n,{signal:r}={}){return F(`/api/bundles/${encodeURIComponent(e)}/pretty?${new URLSearchParams({other:t})}`,P,n,r)}function jn(e,t,n,r,{signal:i}={}){return F(`/api/npm/pretty?${new URLSearchParams({name:e,version:t,otherVersion:n})}`,O,r,i)}function F(e,t,n,r,i=P){return A(e,t,async e=>{for await(let{error:t,status:r,...a}of On(e))await n(t?{...a,status:r,message:i[t]??i[r]??`Request failed (${r})`}:a)},r)}var Mn={...P,413:`This file is too large to compare with renamed names hidden.`,422:`This file couldn't be compared as code.`,"diff-busy":`Too many files are being compared. Try again shortly.`,504:`Comparing this file took too long.`},Nn=(e,t)=>A(e,Mn,E,t);function Pn(e,t,{path:n,hash:r,otherPath:i,otherHash:a},{signal:o}={}){return Nn(`/api/bundles/${encodeURIComponent(e)}/rename-diff?${new URLSearchParams({path:n,hash:r,other:t,otherPath:i,otherHash:a})}`,o)}function Fn(e,t,n,{path:r,hash:i,otherPath:a,otherHash:o},{signal:s}={}){return Nn(`/api/npm/rename-diff?${new URLSearchParams({name:e,version:t,path:r,hash:i,otherVersion:n,otherPath:a,otherHash:o})}`,s)}var In=(e,t)=>new URLSearchParams({other:e,...t?{scope:t}:{}});function Ln(e,t,n,{signal:r,scope:i=``}={}){return F(`/api/bundles/${encodeURIComponent(e)}/rename-diff?${In(t,i)}`,P,n,r,Mn)}function Rn(e,t,n,r,{signal:i}={}){return F(`/api/npm/rename-diff?${new URLSearchParams({name:e,version:t,otherVersion:n})}`,O,r,i,Mn)}function zn(e,t,n,{signal:r,scope:i=``}={}){return F(`/api/bundles/${encodeURIComponent(e)}/type-only?${In(t,i)}&runs=1`,P,n,r)}function Bn(e,t,n,r,{signal:i}={}){return F(`/api/npm/type-only?${new URLSearchParams({name:e,version:t,otherVersion:n,runs:`1`})}`,O,r,i)}var Vn={...O,"delta-busy":`Too many packages are being counted. Try again shortly.`,"delta-timeout":`Counting its lines took too long.`,"delta-failed":`Its lines couldn’t be counted.`};function Hn(e,t,{signal:n}={}){return A(`/api/npm/deltas?${new URLSearchParams({versions:JSON.stringify(e)})}`,Vn,async e=>{for await(let{error:n,status:r,...i}of On(e))t(n?{...i,error:Vn[n]??Vn[r]??`Request failed (${r})`}:i)},n)}var Un={404:`This bundle is no longer available.`,422:`This bundle couldn't be read.`,429:`Too many bundles are being compared. Try again shortly.`},Wn=async e=>{let t=await e.json();return t.files.basePaths=new Map(t.files.basePaths),t};function Gn(e,t,{signal:n,scope:r=``}={}){return A(`/api/bundles/${encodeURIComponent(e)}/comparison?${In(t,r)}`,Un,Wn,n)}function Kn(e,t,n,{signal:r,otherName:i=e,patch:a=null,otherPatch:o=null}={}){return A(`/api/npm/comparison?${new URLSearchParams({name:e,version:t,otherVersion:n,...i===e?{}:{otherName:i},...wt(a),...o?{otherPatchHash:o.hash}:{}})}`,O,Wn,r)}async function I(e,t){let n=await l(e,{signal:t,credentials:`same-origin`,headers:{accept:`application/json`}});if(!n.ok)throw Error(`HTTP ${n.status}`);return n.json()}function L(e,t,n,{signal:r,token:i=!!t}={}){let a={"content-type":`application/json`};return i&&(a[`x-csrf-token`]=t),l(e,{method:`POST`,credentials:`same-origin`,...r?{signal:r}:{},headers:a,body:JSON.stringify(n)})}async function R(e,t,n){let r=await L(e,t,n);if(!r.ok)throw Error(`HTTP ${r.status}`);return r}function qn(e,t){return async(n=``,r={})=>{let i=await l(`${e}${n}`,{credentials:`same-origin`,...r}),a=await i.json();if(!i.ok)throw Error(t[a?.error]??`HTTP ${i.status}`);return a}}async function Jn(e){let t=await e.json().then(e=>typeof e?.error==`string`?e.error:``,()=>``);return[`repo-forbidden`,`forbidden`].includes(t)?`choose a repository and directory within your team access`:`HTTP 403${t?`: ${t}`:``}`}async function Yn(e,t,n){let r=n?{"x-csrf-token":n}:{},i=await l(`/api/admin/${e}/${encodeURIComponent(t)}`,{method:`DELETE`,credentials:`same-origin`,headers:r});if(!i.ok)throw Error(`HTTP ${i.status}`)}function Xn(e,t,n,r){let i={"content-type":r,[`x-${e}-filename`]:encodeURIComponent(t.name)};return n&&(i[`x-csrf-token`]=n),l(`/api/admin/${e}s`,{method:`POST`,credentials:`same-origin`,headers:i,body:t})}async function Zn(e,t,n,r,i,a){let o=new URLSearchParams({page:String(t),limit:`100`,kind:n,q:r.trim()});i&&o.set(`repo`,i),a&&o.set(`actor`,a);let s=await I(`/api/admin/history?${o}`,e);if(!Array.isArray(s?.history)||!Number.isSafeInteger(s.total)||s.total<0||!Number.isSafeInteger(s.page)||s.page<1)throw Error(`No history returned`);return s}async function Qn(e){let t=await I(`/api/admin/users`,e);return Array.isArray(t?.users)?t.users:[]}async function $n(e,t,n){await R(`/api/admin/set-role`,n,{userId:e,role:t})}function er(e,t,n,r){let i=new URLSearchParams({scope:e});return e===`installed`&&i.set(`showAll`,String(t)),n&&i.set(`refresh`,`true`),I(`/api/admin/repositories?${i}`,r)}async function tr(e,t,n){await R(`/api/admin/repositories/select`,n,{repoId:e,selected:t})}async function nr(e,{enabled:t,required:n,since:r,lockfiles:i},a){let o=await L(`/api/admin/repositories/dependency-review`,a,{repoId:e,enabled:t,required:n,since:r,...i?{lockfiles:i}:{}});if(!o.ok)throw Error(o.status===400?`Enter 1 to 10 required reviews, the commit as its full 40-character id, and at most 100 lockfiles by their paths in the repository; a stasis.config.json only among those reviewed alone.`:`HTTP ${o.status}`);return(await o.json()).dependencyReview}async function rr(e,t){let n=await I(`/api/admin/repositories/lockfiles?repoId=${encodeURIComponent(e)}`,t);return{paths:Array.isArray(n?.lockfiles)?n.lockfiles.flatMap(e=>typeof e?.path==`string`?[e.path]:[]):[],configs:Array.isArray(n?.configs)?n.configs.filter(e=>typeof e==`string`):[]}}var ir={400:`Enter a repository as owner/repo or a GitHub repository URL.`,403:`You do not have permission to add arbitrary public repositories.`,404:`No public repository was found at that address.`,409:`Choose a public, non-archived repository.`};async function ar(e,t){let n=await L(`/api/admin/repositories/add-public`,t,{repository:e},{token:!0});if(!n.ok)throw Error(ir[n.status]??`GitHub lookup failed (HTTP ${n.status}). Try again.`)}async function or(e,t){let n=await I(`/api/admin/repositories/impact?repoId=${encodeURIComponent(e)}`,t);if(n?.repoId!==e||!Array.isArray(n.reports)||!Array.isArray(n.bundles)||!Number.isSafeInteger(n.triageCount)||n.triageCount<0)throw Error(`Invalid repository data`);return n}var sr={"github-app-not-configured":`The GitHub App is not configured on this server.`,"repo-identity-changed":`The repository has changed on GitHub. Refresh and check its connection.`,"repo-connection-changed":`The connection or your permissions changed. Refresh and try again.`,"repo-not-connected":`This repository is no longer connected.`,forbidden:`Administrator access is required to connect the GitHub App.`};async function cr(e,t){let n=await L(`/api/admin/repositories/connect-app`,t,{repoId:e},{token:!0}),r=await n.json();if(!n.ok)throw Error(sr[r.error]??`Could not connect the GitHub App (HTTP ${n.status}). Try again.`);if(r.connected===!0)return r;if(r.connected!==!1||typeof r.installUrl!=`string`||!/^https:\/\/github\.com\/apps\/[^/?#]+\/installations\/new$/u.test(r.installUrl))throw Error(`Invalid GitHub installation response.`);return r}async function lr(e,t,n,r){return(await R(`/api/admin/repositories/remove`,r,{repoId:e,fullName:t,acknowledge:!0,deleteTriage:n})).json()}function ur(e){return I(`/api/admin/reports`,e)}var dr={"unsupported-entries":`Select JavaScript/TypeScript files (including JSX/TSX) or Solidity files. Stasis cannot mix languages or use JSON or Rust as remote entry points.`,"bad-conditions":`Check the export conditions and selected platforms.`,"metro-conditions":`Stasis’s Metro preset requires the react-native condition without manual changes.`,"config-invalid":`Stasis can’t read the stasis.config.json these entry points are under, build them with the options it sets, or lay out the lockfiles it names. Check it at this revision.`,"config-mixed":`Entry points listed in a stasis.config.json are built with its options, alone. Select only those it lists, or only other files.`,"config-conditions":`These entry points are listed in stasis.config.json, which sets their options, so they take no conditions. Reload the directory and try again.`,"config-runs-code":`stasis.config.json sets an option for these entry points that runs the repository’s code, such as babel. Bundles built here never run it.`,"config-policy":`The bundle holds a path or package that stasis.config.json’s allowedPaths, disallowedPaths, allowedModules or disallowedModules refuses, or that its excludeModules excludes.`,"stasis-lock":`The build doesn’t agree with the repository’s stasis.lock.json, or stasis.config.json’s lock = frozen needs one that isn’t there. Update it at this revision.`,"commit-not-own":`Stasis can’t find this commit in the history of the repository’s branches or tags: it may be a fork’s, which GitHub serves through the repository too. Pick a commit of its default branch, a branch or a tag.`,"build-lockfile":`Stasis needs a supported lockfile: pnpm-lock.yaml, yarn.lock (Yarn 1), package-lock.json, or soldeer.lock.`,"build-scope":`Your team needs access to the bundle’s project root, including its lockfile and dependencies.`,"build-busy":`A bundle is already being built, or the server is busy. Try again shortly.`,"build-timeout":`The bundle build timed out. Try a smaller selection or retry.`,"too-large":`This bundle exceeds the server’s size limit.`,"build-memory":`Building this selection needs more memory than the server gives a build. Select fewer entry points, or build it with stasis github-bundle and upload the bundle.`,"github-rate-limited":`GitHub’s API rate limit has been reached. Retry after the limit resets.`,"github-build-failed":`Could not fetch the repository from GitHub. Check access and retry.`,"repository-changed":`The repository connection changed during the build. Reload and try again.`,"bundle-conflict":`This bundle already exists but is outside your current access.`,"build-failed":`Stasis could not build this selection. Check that its lockfile is supported and all entry points and imports exist at this commit.`};async function fr(e,t,n){let r=await L(`/api/admin/bundles/create`,t,e,{signal:n,token:!0}),i=await r.json();if(!r.ok)throw Error(dr[i.error]??(r.status===401?`Sign in again to create a bundle.`:r.status===403||r.status===404?`Repository access is required to create this bundle.`:`Could not create the bundle. Try again.`));return i}async function pr(e,t){let n=(await I(`/api/config`)).managed?.uploadMaxBytes?.reports;if(Number.isSafeInteger(n)&&n>0){if(e.size>n)throw Error(`too large`)}else if(e.size>3145728)return mr(e,t);let r=je(await e.text(),e.name);if(!r)return mr(e,t);let i=[],a=[];for(let{name:e,content:n}of r)try{a.push(await mr(new File([n],e,{type:`application/json`}),t))}catch(t){i.push(`${e}: ${String(t?.message??t)}`)}if(i.length>0)throw Error(`${i.length} of ${r.length} products failed (${i.join(`; `)})`);return a.at(-1)}async function mr(e,t){let n=await Xn(`report`,e,t,e.type||`application/json`);if(!n.ok){if(n.status===413)throw Error(`too large`);if(n.status===403)throw Error(await Jn(n));let e=await n.json().catch(()=>null);if(e?.error===`storage-encryption-required`)throw Error(`Link reports require managed storage encryption. Configure MANAGED_STORAGE_ENCRYPTION_KEY.`);if(e?.error===`invalid-report`)throw Error(typeof e.reason==`string`&&e.reason?`This file is not a report: ${e.reason}`:`This file is not a recognized report.`);let t=e?.error===`repo-not-connected`&&typeof e.repo==`string`?`: ${e.repo} is not connected`:``;throw Error(`HTTP ${n.status}${t}`)}return n.json()}async function hr(e,t,n){await R(`/api/admin/reports/set-visible`,n,{reportId:e,visible:t})}async function gr(e,t,n){let r=await L(`/api/admin/reports/set-opening`,n,{reportId:e,confirmedDefault:t});if(!r.ok)throw Error(r.status===409?`this report already opens as an App view, or has no Confirmed findings`:`HTTP ${r.status}`)}async function _r(e,t,n,r){let i=await L(`/api/admin/reports/set-repo`,r,{reportId:e,repoId:t,directory:n});if(!i.ok)throw i.status===409?Error(`this report already defines its repository`):i.status===403?Error(await Jn(i)):Error(i.status===400?`invalid repository or directory`:`HTTP ${i.status}`);return i.json()}async function vr(e,t){let n=await l(`/api/admin/reports/${encodeURIComponent(e)}/location`,{signal:t,credentials:`same-origin`});if(!n.ok)throw Error(`Report location suggestion request failed (${n.status})`);return(await n.json())?.location??null}function yr(e,t){return Yn(`reports`,e,t)}function br(e){return I(`/api/admin/bundles`,e)}async function xr(e,t){let n=await Xn(`bundle`,e,t,`application/octet-stream`);if(!n.ok)throw Error(n.status===413?`too large`:n.status===403?await Jn(n):`HTTP ${n.status}`);return n.json()}async function Sr(e,t){let n=await I(`/api/admin/bundles/${encodeURIComponent(e)}/usage`,t);if(n?.bundleId!==e||!Array.isArray(n.reports)||!n.reports.every(e=>typeof e?.filename==`string`)||!Number.isSafeInteger(n.otherReports)||n.otherReports<0)throw Error(`Invalid bundle usage`);return n}function Cr(e,t){return Yn(`bundles`,e,t)}async function wr(e,t,n){await R(`/api/admin/bundles/set-visible`,n,{bundleId:e,visible:t})}async function Tr(e,t,n,r){let i=await L(`/api/admin/bundles/set-repo`,r,{bundleId:e,repoId:t,directory:n});if(!i.ok)throw Error(i.status===403?await Jn(i):i.status===400?`invalid repository or directory`:`HTTP ${i.status}`)}function Er(e){return I(`/api/admin/teams`,e)}async function Dr(e,t,n){let r=await L(`/api/admin/teams${e}`,t,n);if(!r.ok)throw Error(r.status===409?`name already taken`:`HTTP ${r.status}`)}var Or=`.local-import-toggle{flex-shrink:0;margin-block:calc(-.25rem - 1px);margin-left:auto;padding:.25rem .6rem;border:1px solid var(--border);border-radius:var(--ui-radius, 6px);background:transparent;color:var(--muted);font:inherit;font-size:.75rem;line-height:1.5}.local-import-toggle:hover,.local-import-toggle[aria-expanded=true]{color:var(--text);background:rgb(from var(--text) r g b / .06)}.local-import-panel{display:grid;gap:.8rem;padding:1rem;margin-bottom:1.25rem;border:1px solid var(--border);border-radius:var(--ui-radius, 8px);background:rgb(from var(--accent) r g b / .025)}.local-import-copy strong{font-size:.82rem;font-weight:600}.local-import-copy p,.local-import-message{margin:.3rem 0 0;color:var(--muted);font-size:.75rem;line-height:1.5}.local-import-controls{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem}managed-local-item-selector{flex:1 1 16rem;min-width:0}.local-import-controls button,.local-import-message button{padding:.35rem .7rem;border:1px solid var(--border);border-radius:var(--ui-radius, 5px);background:transparent;color:var(--text);font:inherit;font-size:.75rem;line-height:1.5}.local-import-controls .local-import-submit{border-color:rgb(from var(--accent) r g b / .4);background:rgb(from var(--accent) r g b / .1);color:var(--accent)}.local-import-controls .local-import-close{color:var(--muted)}.local-import-panel button:disabled,.local-import-toggle:disabled{opacity:.5}.local-import-panel button:focus-visible,.local-import-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.local-import-message.error{color:var(--critical)}
|
|
4
4
|
`,kr=`.home-section{margin-block:1.1rem 2rem}.section-heading{display:flex;align-items:baseline;gap:1rem;margin-bottom:.85rem}.section-heading h2{margin:0;font-size:.86rem;font-weight:600}.section-heading>span{color:var(--muted);font-size:.75rem}.pages{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.9rem}.page{display:flex;flex-direction:column;gap:.85rem;padding:1.35rem;border:1px solid var(--border);border-radius:var(--ui-radius, 12px);color:var(--text);background:var(--panel);text-align:left;font:inherit}.page:hover{background:var(--panel-hover);border-color:color-mix(in srgb,var(--muted) 60%,var(--border))}.page-top{display:flex;align-items:center;gap:.75rem;width:100%}.page-icon{display:grid;place-items:center;flex-shrink:0;width:2.5rem;height:2.5rem;border:1px solid color-mix(in srgb,var(--accent) 16%,var(--border));border-radius:var(--ui-radius, 9px);background:color-mix(in srgb,var(--accent) 7%,var(--panel));color:var(--accent)}.page-bundle .page-icon{color:var(--green);border-color:color-mix(in srgb,var(--green) 18%,var(--border));background:color-mix(in srgb,var(--green) 6%,var(--panel))}.page-scan .page-icon{color:var(--scan-icon-color, var(--yellow));border-color:color-mix(in srgb,var(--scan-icon-color, var(--yellow)) 18%,var(--border));background:color-mix(in srgb,var(--scan-icon-color, var(--yellow)) 6%,var(--panel))}:host-context(body.theme-light) .page-scan .page-icon{--scan-icon-color: #bf8700}:host-context(body.theme-green) :is(.page-bundle,.page-scan) .page-icon,:host-context(body.theme-pink) :is(.page-bundle,.page-scan) .page-icon{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 16%,var(--border));background:color-mix(in srgb,var(--accent) 7%,var(--panel))}.page-icon svg{width:1.2rem;height:1.2rem}.arrow{display:flex;margin-left:auto;flex-shrink:0;color:var(--muted)}.arrow svg{width:1rem;height:1rem}.page:hover .arrow{color:var(--text)}.page-copy{display:grid;gap:.45rem}.page>.page-copy{margin-inline-start:3.25rem}.page-copy strong,.page-title{font-size:1rem;font-weight:600;letter-spacing:-.015em}.page-copy>span{color:var(--muted);font-size:.8rem;line-height:1.65}.workspace-pages .page{padding:1.2rem 1.35rem}.workspace-pages .page-icon{width:2rem;height:2rem;color:var(--muted);background:transparent;border-color:var(--border)}.workspace-pages .page-title{font-size:.9rem}.workspace-pages .page-copy{margin-inline-start:2.75rem}.history-link{display:flex;align-items:center;gap:1rem;width:100%;padding:1.25rem 0;border:0;border-top:1px solid var(--border);text-align:left;color:var(--text);background:transparent}.history-link>.page-icon{color:var(--muted);background:transparent;border-color:var(--border)}.history-link .page-copy strong{font-size:.85rem}.history-cta{display:flex;align-items:center;gap:.6rem;flex-shrink:0;margin-left:auto;color:var(--muted);font-size:.78rem}.history-cta svg{width:1rem;height:1rem}.history-link:hover .history-cta{color:var(--accent)}@container (max-width: 48rem){.pages{grid-template-columns:1fr;gap:.65rem}.page,.workspace-pages .page{gap:.65rem;padding:1.15rem}.page-top .arrow{display:none}.workspace-pages .page-icon{width:2.5rem;height:2.5rem}.workspace-pages .page-copy{margin-inline-start:3.25rem}.page-copy{gap:.2rem}.page-copy strong,.page-title{font-size:.95rem}.section-heading>span{display:none}.history-cta{font-size:0}}
|