@preventive/triage 1.0.0-alpha.60 → 1.0.0-alpha.61
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/default-scan-models.ts +6 -5
- package/common/managed/comments.ts +9 -0
- package/out/activity.js +1 -1
- package/out/chunk-6CCSTJWB.js +1 -0
- package/out/{chunk-VZJIHHTQ.js → chunk-B3FNMHOE.js} +1 -1
- package/out/chunk-BNH52UHC.js +2 -0
- package/out/chunk-BRO77PQY.js +42 -0
- package/out/chunk-GRGIZOTP.js +4 -0
- package/out/chunk-JJK5OZG2.js +15 -0
- package/out/chunk-OFZYEWBH.js +244 -0
- package/out/{chunk-YGRRXC2L.js → chunk-OIERSXON.js} +1 -1
- package/out/{chunk-TZS7KERJ.js → chunk-QCOGVL37.js} +1 -1
- package/out/{chunk-6VDDCFHT.js → chunk-W3QFV4SP.js} +1 -1
- package/out/chunk-W6VOKW2N.js +12 -0
- package/out/chunk-ZQNEWVGG.js +1 -0
- package/out/client-managed.js +2 -2
- package/out/compare.js +19 -14
- package/out/dialogs.js +38 -38
- package/out/graph.js +12 -12
- package/out/index.html +5 -5
- package/out/scan.js +1 -1
- package/out/terminal.js +12 -12
- package/out/view.css +1 -1
- package/out/view.js +4 -4
- package/package.json +9 -6
- package/server-managed/activity.ts +23 -43
- package/server-managed/agent-merges.ts +2 -2
- package/server-managed/blob-store.ts +10 -1
- package/server-managed/bundle-advisories.ts +3 -2
- package/server-managed/bundle-advisory-inventory.ts +1 -1
- package/server-managed/bundle-build-worker.js +41 -6
- package/server-managed/bundle-build.ts +18 -10
- package/server-managed/bundle-cache.ts +29 -41
- package/server-managed/bundle-catalog.ts +11 -11
- package/server-managed/bundle-commits.ts +9 -16
- package/server-managed/bundle-dependency-reviews.ts +5 -11
- package/server-managed/bundle-summary-cache.ts +23 -14
- package/server-managed/bundle-validation.ts +2 -1
- package/server-managed/combined.ts +1 -5
- package/server-managed/comments.ts +15 -28
- package/server-managed/commit-coauthors.ts +4 -5
- package/server-managed/commit-lockfiles.ts +6 -5
- package/server-managed/comparison.ts +3 -5
- package/server-managed/config.ts +1 -2
- package/server-managed/db-methods.ts +163 -244
- package/server-managed/db-neon.ts +82 -178
- package/server-managed/db-schema.ts +15 -0
- package/server-managed/db.ts +5 -11
- package/server-managed/dependabot-access.ts +2 -1
- package/server-managed/dependabot-alerts.ts +7 -12
- package/server-managed/dependency-review-comments.ts +7 -13
- package/server-managed/dependency-reviews.ts +14 -15
- package/server-managed/github-accounts.ts +4 -5
- package/server-managed/github-actions.ts +6 -6
- package/server-managed/github-app.ts +19 -48
- package/server-managed/github-graphql.ts +5 -2
- package/server-managed/github-issue-links.ts +62 -42
- package/server-managed/github-issue-oauth.ts +7 -24
- package/server-managed/github-issues.ts +9 -7
- package/server-managed/github-link-oauth.ts +7 -20
- package/server-managed/github-oauth.ts +38 -12
- package/server-managed/github-pulls.ts +37 -26
- package/server-managed/github-requests.ts +21 -8
- package/server-managed/github-values.ts +26 -0
- package/server-managed/history-windows.ts +7 -7
- package/server-managed/http.ts +495 -554
- package/server-managed/index.ts +6 -6
- package/server-managed/link-reports.ts +6 -19
- package/server-managed/lockfile-scope.ts +1 -1
- package/server-managed/management.ts +14 -3
- package/server-managed/npm-delta.ts +22 -57
- package/server-managed/npm-insights.ts +31 -26
- package/server-managed/npm-kept.ts +9 -8
- package/server-managed/npm-loads.ts +2 -7
- package/server-managed/npm-manifest.ts +6 -4
- package/server-managed/npm-packages.ts +17 -9
- package/server-managed/npm-patch.ts +8 -16
- package/server-managed/npm-provenance.ts +12 -8
- package/server-managed/npm-risk.ts +9 -7
- package/server-managed/object-storage-disk.ts +2 -3
- package/server-managed/object-storage-vercel.ts +15 -11
- package/server-managed/object-storage.ts +7 -0
- package/server-managed/pretty-print.ts +8 -19
- package/server-managed/public-workspace.ts +50 -46
- package/server-managed/pull-comment-reviews.ts +2 -2
- package/server-managed/pull-dependencies.ts +20 -31
- package/server-managed/pull-dependency-reviews.ts +17 -24
- package/server-managed/pull-reviews.ts +4 -7
- package/server-managed/queue.ts +14 -0
- package/server-managed/release-commits.ts +9 -8
- package/server-managed/rename-diff.ts +17 -60
- package/server-managed/report-migration.ts +5 -8
- package/server-managed/report-sources.ts +6 -10
- package/server-managed/report-store.ts +2 -10
- package/server-managed/repository-actions.ts +7 -8
- package/server-managed/repository-agents.ts +31 -57
- package/server-managed/repository-aliases.ts +3 -9
- package/server-managed/repository-browser.ts +18 -16
- package/server-managed/repository-changes.ts +33 -37
- package/server-managed/repository-code.ts +5 -5
- package/server-managed/repository-dependency-reviews.ts +6 -13
- package/server-managed/repository-discovery.ts +2 -1
- package/server-managed/repository-history.ts +47 -51
- package/server-managed/repository-issues.ts +59 -30
- package/server-managed/repository-pulls.ts +7 -12
- package/server-managed/repository-pulse.ts +51 -45
- package/server-managed/repository-risk-assess.ts +5 -2
- package/server-managed/repository-risk-audit.ts +1 -1
- package/server-managed/repository-risk-read.ts +6 -6
- package/server-managed/repository-risk.ts +32 -40
- package/server-managed/repository-squashes.ts +7 -15
- package/server-managed/request-timing.ts +1 -1
- package/server-managed/sql.ts +18 -0
- package/server-managed/storage-encryption.ts +5 -7
- package/server-managed/team-app.ts +4 -7
- package/server-managed/team-npm-scopes.ts +5 -8
- package/server-managed/team-reports.ts +15 -15
- package/server-managed/type-only-proof.js +108 -0
- package/server-managed/type-only-worker.js +26 -14
- package/server-managed/type-only.ts +72 -62
- package/server-managed/uploads.ts +3 -3
- package/server-managed/upstream-cache.ts +5 -7
- package/server-managed/worker-turns.ts +76 -0
- package/server-managed/workspace-shares.ts +1 -2
- package/out/chunk-2SY4PYUQ.js +0 -4
- package/out/chunk-4HI2MSAV.js +0 -17
- package/out/chunk-4TQKM3JC.js +0 -42
- package/out/chunk-EEQHVKR3.js +0 -1
- package/out/chunk-HNQNDNIE.js +0 -12
- package/out/chunk-OFPDMZJF.js +0 -244
- package/out/chunk-OQRSIBSC.js +0 -1
- package/out/chunk-YTO6AQZM.js +0 -2
|
@@ -6,10 +6,10 @@ export function defaultScanModels(provider: string | null = null) {
|
|
|
6
6
|
'anthropic/claude-fable-5.2',
|
|
7
7
|
'anthropic/claude-sonnet-5.5',
|
|
8
8
|
'anthropic/claude-haiku-5.5',
|
|
9
|
-
'openai/gpt-6-astra',
|
|
10
|
-
'openai/gpt-6-astra-pro',
|
|
11
|
-
'openai/gpt-6.
|
|
12
|
-
'openai/gpt-6.
|
|
9
|
+
'openai/gpt-6.2-astra',
|
|
10
|
+
'openai/gpt-6.2-astra-pro',
|
|
11
|
+
'openai/gpt-6.2-sol',
|
|
12
|
+
'openai/gpt-6.2-sol-pro',
|
|
13
13
|
'openai/gpt-6.1-terra',
|
|
14
14
|
'openai/gpt-6.1-terra-pro',
|
|
15
15
|
'openai/gpt-6-luna',
|
|
@@ -18,10 +18,11 @@ export function defaultScanModels(provider: string | null = null) {
|
|
|
18
18
|
'moonshotai/kimi-k3',
|
|
19
19
|
'google/gemini-4-carbon',
|
|
20
20
|
'google/gemini-4-argon',
|
|
21
|
+
'google/gemini-4-hydrogen',
|
|
21
22
|
'google/gemma-4-31b-it',
|
|
22
23
|
'x-ai/grok-4.7',
|
|
23
24
|
'z-ai/glm-5.3',
|
|
24
|
-
'qwen/
|
|
25
|
+
'qwen/qwen4-max',
|
|
25
26
|
'deepseek/deepseek-v4.1-flash',
|
|
26
27
|
'deepseek/deepseek-v4-pro',
|
|
27
28
|
'mistralai/mistral-large-4-0',
|
|
@@ -6,6 +6,9 @@ export interface ManagedComment {
|
|
|
6
6
|
body: string
|
|
7
7
|
authorId: string | null
|
|
8
8
|
authorLogin: string | null
|
|
9
|
+
// The name its author chose to show (managed_user.name), as it is now: null
|
|
10
|
+
// for one with none, one no longer a user, and to a public link's readers.
|
|
11
|
+
authorName: string | null
|
|
9
12
|
createdAt: number | null
|
|
10
13
|
updatedAt: number | null
|
|
11
14
|
version: number
|
|
@@ -13,6 +16,12 @@ export interface ManagedComment {
|
|
|
13
16
|
|
|
14
17
|
export const MAX_COMMENT_TEXT = 10_000
|
|
15
18
|
|
|
19
|
+
// Who a comment shows as by: its author's name, else their login; null for
|
|
20
|
+
// one with neither, as an imported or legacy one is.
|
|
21
|
+
export function commentAuthorName(comment: { authorName?: string | null; authorLogin?: string | null }): string | null {
|
|
22
|
+
return comment.authorName?.trim() || comment.authorLogin || null
|
|
23
|
+
}
|
|
24
|
+
|
|
16
25
|
// Callers also enforce write access to the report containing the finding.
|
|
17
26
|
// Admins can remove comments with no linked user, but cannot claim authorship.
|
|
18
27
|
export function canDeleteComment(comment: Pick<ManagedComment, 'authorId'>, actor: { id: string; role: string } | null | undefined): boolean {
|
package/out/activity.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,e as r,f as i,h as a,i as o}from"./chunk-VZJIHHTQ.js";import{$e as s,Aa as c,Ea as l,Fa as u,Ff as d,Ga as f,Gf as p,Ha as m,Ia as h,Ka as g,La as _,Se as v,Te as y,Ue as b,Vd as x,Ve as ee,Wd as S,We as te,Xd as ne,Xe as re,Yd as ie,Ye as ae,Zd as oe,Ze as se,_d as ce,_e as le,af as ue,bf as de,cb as fe,cf as pe,db as C,df as me,ef as he,ff as ge,gf as _e,hf as ve,if as ye,jf as be,kf as xe,of as Se,pa as w,sa as Ce,ta as we,tc as Te,ua as Ee,w as T,xa as De,ya as Oe,za as ke}from"./chunk-OFPDMZJF.js";import"./chunk-JCIIBLKR.js";import"./chunk-E3LFSUDJ.js";import"./chunk-JMG5DXII.js";import"./chunk-J2FWBXFV.js";import{M as Ae}from"./chunk-TZS7KERJ.js";import"./chunk-HNQNDNIE.js";import"./chunk-NRPC74AM.js";import"./chunk-7BKKYVWR.js";import"./chunk-7C7DWL7I.js";import"./chunk-PNHBZGDD.js";import{a as je}from"./chunk-4TQKM3JC.js";import"./chunk-IZ6MYRYB.js";import"./chunk-WCPJDAYA.js";import"./chunk-IYPY47MC.js";import{a as E}from"./chunk-PWFUOLZK.js";import"./chunk-PTFQKLKO.js";import"./chunk-QRKFPLA4.js";import{A as Me,B as Ne,d as Pe,e as Fe,f as Ie,g as Le}from"./chunk-74AEKRES.js";import"./chunk-C4Z6ZBXV.js";import{c as D,d as O,g as k,j as Re}from"./chunk-2XUEZHIP.js";import"./chunk-TUII34K2.js";import"./chunk-OOJM4CTU.js";var ze=e=>e.committedAt??-1/0;function Be(e){let t=new Map(e.map((e,t)=>[e.sha,t])),n=new Map(e.map(e=>[e.sha,0]));for(let r of e)for(let e of new Set(r.parents))t.has(e)&&n.set(e,n.get(e)+1);let r=(e,n)=>ze(e)-ze(n)||t.get(n.sha)-t.get(e.sha),i=e.filter(e=>n.get(e.sha)===0).toSorted(r),a=[];for(;i.length>0;){let o=i.pop();a.push(o);for(let a of new Set(o.parents)){if(!t.has(a))continue;let o=n.get(a)-1;if(n.set(a,o),o>0)continue;let s=e[t.get(a)],c=i.length,l=0;for(;l<c;){let e=l+c>>1;r(i[e],s)<0?l=e+1:c=e}i.splice(l,0,s)}}return a}function Ve(e,t){let n=new Map(e.map(e=>[e.sha,e])),r=new Set;for(let e=n.get(t);e&&!r.has(e.sha);e=n.get(e.parents[0]))r.add(e.sha);return r}function He(e,{linear:t=!1,trunk:n=null,colors:r=8}={}){let i=new Set(e.map(e=>e.sha)),a=+(n?.size>0),o=[],s=[],c=[],l=[],u=[],d=0,f=0,p=()=>{let e=o.indexOf(null,a);return e===-1?Math.max(o.length,a):e},m=e=>{if(n?.has(e))return 0;let t=o.indexOf(e);return t===-1?null:t},h=e=>{let t=Math.max(1,r-a),n=new Set([e-1,e+1].filter(e=>o[e]!=null).map(e=>s[e])),i=Array.from({length:t},(e,t)=>t).find(e=>!n.has(a+(f+e)%t))??0,c=a+(f+i)%t;return f=(f+i+1)%t,c};for(let[r,a]of e.entries()){let f=e[r+1],g=t?f?[f.sha]:a.parents.slice(0,1):[...new Set(a.parents)],_=g.filter(e=>i.has(e)),v=m(a.sha),y=v??p(),b=n?.has(a.sha)?0:v===null?h(y):s[y];for(let[e,t]of o.entries())t===a.sha&&(o[e]=null);c.push({commit:a,col:y,color:b});let x=new Set;o[y]=_[0]??null,s[y]=b,_.length>0&&x.add(y);let ee=[];for(let e of _.slice(1)){let t=n?.has(e)?0:o.indexOf(e);if(t===-1||o[t]!==e){let t=p();s[t]=h(t),o[t]=e,x.add(t)}else ee.push(t)}let S=o[y]===null;for(let e of g.filter(e=>!i.has(e)))u.push({row:r,col:y,straight:S,color:b}),S=!1;for(let e=0;e<o.length;e++)o[e]??=null;if(d=Math.max(d,o.length),f){let e=m(f.sha);for(let[t,n]of o.entries())n!==null&&l.push({row:r,from:x.has(t)?y:t,to:n===f.sha?e:t,color:s[t]});for(let t of ee)l.push({row:r,from:y,to:o[t]===f.sha?e:t,color:s[t]})}for(;o.length>0&&o.at(-1)===null;)o.pop()}return{rows:c,segments:l,stubs:u,width:Math.max(d,+(c.length>0))}}function A(e,t,n,{ready:r,failed:i,settled:a=()=>{},retryMs:o,repaint:s}){let c=e.get(t);if(c&&Date.now()<c.until)return c;let l=c?.status===`ready`?c:null;if(l?.rereading)return l;let u=l??{status:`loading`,until:1/0};return l?l.rereading=!0:e.set(t,u),n().then(n=>{if(e.get(t)!==u||l&&Date.now()<l.until)return null;let i=r(n);return e.set(t,i),a(i),null},n=>{if(e.get(t)!==u)return null;if(l)return n?.name!==`AbortError`&&(l.until=Date.now()+o),null;let r=i(n);return r?e.set(t,r):e.delete(t),null}).finally(()=>{l&&(l.rereading=!1),s()}),u}var Ue=12,j=24,We=9,Ge=8,Ke=3,qe=`a[href], .history-commit`,Je=3e5,Ye=15e3,Xe=3e4,Ze=3e3,Qe=10,$e=25,et=new Map,tt=new Set,nt=null,rt=`all`,it=new Set;function M(){let e=T.managedSession?`${T.managedSession.id}\0${T.managedSession.role}`:null;return e!==nt&&(et.clear(),it.clear(),nt=e),et}var N=()=>{for(let e of tt)e.requestUpdate()};function at(e,t,n=new Set){let r={status:`ready`,until:Date.now()+Je,page:1,commits:e.commits,more:e.more===!0,branches:e.branches??[],tags:e.tags??[],defaultBranch:e.defaultBranch??null,unread:e.unread,cut:e.cut===!0,pulls:e.pulls,pullsPending:e.pullsPending===!0,openPulls:e.openPulls,loadingMore:!1,moreError:null,sought:n};return t?.(r),r}function ot(e,t){let n=new Set(e.pulls.map(e=>e.merge)),r=t.filter(e=>!n.has(e.merge));r.length>0&&(e.pulls=[...e.pulls,...r])}function st(e,t,n,r,i,a=1){setTimeout(()=>{M().get(e)===t&&n(r,i).then(o=>(M().get(e)!==t||(ot(t,o.pulls),o.pullsPending&&a<Qe&&st(e,t,n,r,i,a+1)),null),()=>null).finally(N)},Ze)}function ct(e,t,n){return A(M(),e,()=>t(1),{ready:e=>at(e,n),settled:n=>{n.pullsPending&&st(e,n,t,1,null)},failed:e=>e?.name===`AbortError`?null:{status:`error`,until:Date.now()+Xe,error:e?.message||`The history could not be read.`,code:e?.code??null},retryMs:Xe,repaint:N})}function lt(e,t,n,r,i){let a=t.sought;t.sought=new Set(a).add(i),t.refreshing=!0,n(1,null,!0).then(o=>{if(M().get(e)!==t)return null;let s=t.retried===i?0:Math.min(Number(o.retryIn)||0,Ye),c=at(o,r,s>0?a:t.sought);return s>0&&(Object.assign(c,{retried:i,retryAt:Date.now()+s}),setTimeout(N,s)),M().set(e,c),c.pullsPending&&st(e,c,n,1,null),null},()=>null).finally(()=>{t.refreshing=!1,N()})}function ut(e){let t=new Set(e.commits.map(e=>e.sha));e.branches=[...e.branches,...e.unread.flatMap(({name:e,sha:n})=>t.has(n)?[{name:e,sha:n}]:[])],e.unread=e.unread.filter(e=>!t.has(e.sha)),e.asked??=new Set;let n=new Map,r=(t,r)=>{e.asked.has(t)||n.set(t,Math.max(n.get(t)??-1/0,r??0))};for(let n of e.commits)for(let e of n.parents)t.has(e)||r(e,n.committedAt);for(let t of e.unread)r(t.sha,t.at);e.next=[...n].toSorted((e,t)=>t[1]-e[1]).slice(0,$e).map(([e])=>e);for(let t of e.next)e.asked.add(t);return e.more&&=e.next.length>0,e}function dt(e,t,n,r){if(t.loadingMore||!t.more)return;t.loadingMore=!0,t.moreError=null,t.until=Date.now()+Je,N();let i={next:t.next};n(t.page+1,i).then(a=>{if(M().get(e)!==t)return null;let o=new Set(t.commits.map(e=>e.sha));return t.commits=[...t.commits,...a.commits.filter(e=>!o.has(e.sha))],ot(t,a.pulls),t.page+=1,t.more=a.more===!0,r?.(t),t.until=Date.now()+Je,a.pullsPending&&st(e,t,n,t.page,i),null},e=>(e?.name!==`AbortError`&&(t.moreError=e?.message||`More commits could not be read.`),null)).finally(()=>{t.loadingMore=!1,N()})}var ft=/^[a-f\d]{40}$/u,pt=e=>typeof e?.sha==`string`&&ft.test(e.sha)&&Array.isArray(e.parents);function mt(e){if(!Array.isArray(e?.commits))throw Error(`The server answered with no history.`);let t=e.commits.filter(pt),n=Array.isArray(e.unread)?e.unread.filter(e=>typeof e?.name==`string`&&typeof e.sha==`string`&&ft.test(e.sha)):[],r=Array.isArray(e.pulls)?e.pulls.filter(e=>typeof e?.merge==`string`&&ft.test(e.merge)&&Number.isSafeInteger(e.number)&&typeof e.head==`string`&&ft.test(e.head)&&Array.isArray(e.commits)).map(e=>({...e,commits:e.commits.filter(pt)})):[],i=Array.isArray(e.openPulls)?e.openPulls.filter(e=>Number.isSafeInteger(e?.number)&&typeof e.sha==`string`&&ft.test(e.sha)):[];return{...e,commits:t,unread:n,pulls:r,openPulls:i}}function ht(e,t,n){let r=gt(e,t),i=new Map(r.map(e=>[e.sha,e]));if(!i.has(n))return r;let a=new Set;for(let e=[n];e.length>0;){let t=e.pop();a.has(t)||!i.has(t)||(a.add(t),e.push(...i.get(t).parents))}let o=i.get(n);for(let e=new Set;i.has(o.parents[0])&&!e.has(o.sha);o=i.get(o.parents[0]))e.add(o.sha);let s=o.parents.length>0?o.committedAt??1/0:-1/0;return r.filter(e=>!a.has(e.sha)&&(e.committedAt??-1/0)>s)}function gt(e,t){if(t.length===0)return e;let n=new Map(t.map(e=>[e.merge,e])),r=new Set(e.map(e=>e.sha)),i=new Map;for(let e of t)for(let t of e.commits)!r.has(t.sha)&&!i.has(t.sha)&&i.set(t.sha,{...t,pull:e.number});return[...e.map(e=>{let t=n.get(e.sha);return t&&e.parents.length===1&&t.head!==e.parents[0]?{...e,parents:[e.parents[0],t.head]}:e}),...i.values()]}var _t=6e4,vt=60*_t,yt=24*vt;function bt(e,t=Date.now()){if(e==null)return``;let n=t-e;if(n>=-_t&&n<_t)return`now`;if(n>0&&n<vt)return`${Math.floor(n/_t)}m`;if(n>0&&n<yt)return`${Math.floor(n/vt)}h`;if(n>0&&n<7*yt)return`${Math.floor(n/yt)}d`;let r=new Date(e);return r.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,...r.getFullYear()===new Date(t).getFullYear()?{}:{year:`numeric`}})}function xt({branches:e=[],tags:t=[],pulls:n=[],openPulls:r=[]},i){let a=new Map,o=(e,t)=>a.set(e,[...a.get(e)??[],t]);for(let t of e.toSorted((e,t)=>+(t.name===i)-(e.name===i)))o(t.sha,{kind:`branch`,name:t.name,main:t.name===i});let s=new Set;for(let{number:e,sha:t}of[...n.map(e=>({number:e.number,sha:e.head})),...r])s.has(e)||(s.add(e),o(t,{kind:`pull`,name:`#${e}`,number:e}));for(let e of t)o(e.sha,{kind:`tag`,name:e.name});return a}function St(e,t){if(!t)return e;let n=[],r=0;for(let i of e.matchAll(/(?<=^|[\s([])#(\d+)\b/gu))n.push(e.slice(r,i.index),D`<a href="${`${t}/issues/${i[1]}`}" target="_blank" rel="noopener noreferrer" tabindex="-1">${i[0]}</a>`),r=i.index+i[0].length;return r===0?e:[...n,e.slice(r)]}var Ct=e=>We+e*Ue,wt=e=>e*j+j/2;function Tt({row:e,from:t,to:n}){let[r,i,a,o]=[Ct(t),Ct(n),wt(e),wt(e+1)];if(r===i)return`M${r} ${a}V${o}`;let s=(a+o)/2;return`M${r} ${a}C${r} ${s} ${i} ${s} ${i} ${o}`}var Et=({row:e,col:t,straight:n})=>n?`M${Ct(t)} ${wt(e)+6}v${j*.55}`:`M${Ct(t)+4} ${wt(e)+5}l${Ue*.6} ${j*.5}`;function Dt(e,t){let n=Array.from({length:Ge},()=>[]);for(let t of e.segments)n[t.color].push(Tt(t));let r=Array.from({length:Ge},()=>[]);for(let t of e.stubs)r[t.color].push(Et(t));let i=We*2+(e.width-1)*Ue;return D`<svg class="history-graph" width="${i}" height="${e.rows.length*j}" aria-hidden="true">${n.map((e,t)=>e.length>0?O`<path class=${`lane-${t}`} d=${e.join(``)}/>`:k)} ${r.map((e,t)=>e.length>0?O`<path class=${`history-stub lane-${t}`} d=${e.join(``)}/>`:k)} ${e.rows.map(({commit:e,col:n,color:r},i)=>O`<circle class=${`lane-${r}${e.sha===t?` is-shown`:``}`} cx=${Ct(n)} cy=${wt(i)}
|
|
1
|
+
import{a as e,c as t,d as n,e as r,f as i,h as a,i as o}from"./chunk-B3FNMHOE.js";import{$e as s,Aa as c,Ea as l,Fa as u,Ff as d,Ga as f,Gf as p,Ha as m,Ia as h,Ka as g,La as _,Se as v,Te as y,Ue as b,Vd as x,Ve as ee,Wd as S,We as te,Xd as ne,Xe as re,Yd as ie,Ye as ae,Zd as oe,Ze as se,_d as ce,_e as le,af as ue,bf as de,cb as fe,cf as pe,db as C,df as me,ef as he,ff as ge,gf as _e,hf as ve,if as ye,jf as be,kf as xe,of as Se,pa as w,sa as Ce,ta as we,tc as Te,ua as Ee,w as T,xa as De,ya as Oe,za as ke}from"./chunk-OFZYEWBH.js";import"./chunk-JCIIBLKR.js";import"./chunk-E3LFSUDJ.js";import"./chunk-JMG5DXII.js";import"./chunk-J2FWBXFV.js";import{M as Ae}from"./chunk-QCOGVL37.js";import"./chunk-W6VOKW2N.js";import"./chunk-NRPC74AM.js";import"./chunk-7BKKYVWR.js";import"./chunk-7C7DWL7I.js";import"./chunk-PNHBZGDD.js";import{a as je}from"./chunk-BRO77PQY.js";import"./chunk-IZ6MYRYB.js";import"./chunk-WCPJDAYA.js";import"./chunk-IYPY47MC.js";import{a as E}from"./chunk-PWFUOLZK.js";import"./chunk-PTFQKLKO.js";import"./chunk-QRKFPLA4.js";import{A as Me,B as Ne,d as Pe,e as Fe,f as Ie,g as Le}from"./chunk-74AEKRES.js";import"./chunk-C4Z6ZBXV.js";import{c as D,d as O,g as k,j as Re}from"./chunk-2XUEZHIP.js";import"./chunk-TUII34K2.js";import"./chunk-OOJM4CTU.js";var ze=e=>e.committedAt??-1/0;function Be(e){let t=new Map(e.map((e,t)=>[e.sha,t])),n=new Map(e.map(e=>[e.sha,0]));for(let r of e)for(let e of new Set(r.parents))t.has(e)&&n.set(e,n.get(e)+1);let r=(e,n)=>ze(e)-ze(n)||t.get(n.sha)-t.get(e.sha),i=e.filter(e=>n.get(e.sha)===0).toSorted(r),a=[];for(;i.length>0;){let o=i.pop();a.push(o);for(let a of new Set(o.parents)){if(!t.has(a))continue;let o=n.get(a)-1;if(n.set(a,o),o>0)continue;let s=e[t.get(a)],c=i.length,l=0;for(;l<c;){let e=l+c>>1;r(i[e],s)<0?l=e+1:c=e}i.splice(l,0,s)}}return a}function Ve(e,t){let n=new Map(e.map(e=>[e.sha,e])),r=new Set;for(let e=n.get(t);e&&!r.has(e.sha);e=n.get(e.parents[0]))r.add(e.sha);return r}function He(e,{linear:t=!1,trunk:n=null,colors:r=8}={}){let i=new Set(e.map(e=>e.sha)),a=+(n?.size>0),o=[],s=[],c=[],l=[],u=[],d=0,f=0,p=()=>{let e=o.indexOf(null,a);return e===-1?Math.max(o.length,a):e},m=e=>{if(n?.has(e))return 0;let t=o.indexOf(e);return t===-1?null:t},h=e=>{let t=Math.max(1,r-a),n=new Set([e-1,e+1].filter(e=>o[e]!=null).map(e=>s[e])),i=Array.from({length:t},(e,t)=>t).find(e=>!n.has(a+(f+e)%t))??0,c=a+(f+i)%t;return f=(f+i+1)%t,c};for(let[r,a]of e.entries()){let f=e[r+1],g=t?f?[f.sha]:a.parents.slice(0,1):[...new Set(a.parents)],_=g.filter(e=>i.has(e)),v=m(a.sha),y=v??p(),b=n?.has(a.sha)?0:v===null?h(y):s[y];for(let[e,t]of o.entries())t===a.sha&&(o[e]=null);c.push({commit:a,col:y,color:b});let x=new Set;o[y]=_[0]??null,s[y]=b,_.length>0&&x.add(y);let ee=[];for(let e of _.slice(1)){let t=n?.has(e)?0:o.indexOf(e);if(t===-1||o[t]!==e){let t=p();s[t]=h(t),o[t]=e,x.add(t)}else ee.push(t)}let S=o[y]===null;for(let e of g.filter(e=>!i.has(e)))u.push({row:r,col:y,straight:S,color:b}),S=!1;for(let e=0;e<o.length;e++)o[e]??=null;if(d=Math.max(d,o.length),f){let e=m(f.sha);for(let[t,n]of o.entries())n!==null&&l.push({row:r,from:x.has(t)?y:t,to:n===f.sha?e:t,color:s[t]});for(let t of ee)l.push({row:r,from:y,to:o[t]===f.sha?e:t,color:s[t]})}for(;o.length>0&&o.at(-1)===null;)o.pop()}return{rows:c,segments:l,stubs:u,width:Math.max(d,+(c.length>0))}}function A(e,t,n,{ready:r,failed:i,settled:a=()=>{},retryMs:o,repaint:s}){let c=e.get(t);if(c&&Date.now()<c.until)return c;let l=c?.status===`ready`?c:null;if(l?.rereading)return l;let u=l??{status:`loading`,until:1/0};return l?l.rereading=!0:e.set(t,u),n().then(n=>{if(e.get(t)!==u||l&&Date.now()<l.until)return null;let i=r(n);return e.set(t,i),a(i),null},n=>{if(e.get(t)!==u)return null;if(l)return n?.name!==`AbortError`&&(l.until=Date.now()+o),null;let r=i(n);return r?e.set(t,r):e.delete(t),null}).finally(()=>{l&&(l.rereading=!1),s()}),u}var Ue=12,j=24,We=9,Ge=8,Ke=3,qe=`a[href], .history-commit`,Je=3e5,Ye=15e3,Xe=3e4,Ze=3e3,Qe=10,$e=25,et=new Map,tt=new Set,nt=null,rt=`all`,it=new Set;function M(){let e=T.managedSession?`${T.managedSession.id}\0${T.managedSession.role}`:null;return e!==nt&&(et.clear(),it.clear(),nt=e),et}var N=()=>{for(let e of tt)e.requestUpdate()};function at(e,t,n=new Set){let r={status:`ready`,until:Date.now()+Je,page:1,commits:e.commits,more:e.more===!0,branches:e.branches??[],tags:e.tags??[],defaultBranch:e.defaultBranch??null,unread:e.unread,cut:e.cut===!0,pulls:e.pulls,pullsPending:e.pullsPending===!0,openPulls:e.openPulls,loadingMore:!1,moreError:null,sought:n};return t?.(r),r}function ot(e,t){let n=new Set(e.pulls.map(e=>e.merge)),r=t.filter(e=>!n.has(e.merge));r.length>0&&(e.pulls=[...e.pulls,...r])}function st(e,t,n,r,i,a=1){setTimeout(()=>{M().get(e)===t&&n(r,i).then(o=>(M().get(e)!==t||(ot(t,o.pulls),o.pullsPending&&a<Qe&&st(e,t,n,r,i,a+1)),null),()=>null).finally(N)},Ze)}function ct(e,t,n){return A(M(),e,()=>t(1),{ready:e=>at(e,n),settled:n=>{n.pullsPending&&st(e,n,t,1,null)},failed:e=>e?.name===`AbortError`?null:{status:`error`,until:Date.now()+Xe,error:e?.message||`The history could not be read.`,code:e?.code??null},retryMs:Xe,repaint:N})}function lt(e,t,n,r,i){let a=t.sought;t.sought=new Set(a).add(i),t.refreshing=!0,n(1,null,!0).then(o=>{if(M().get(e)!==t)return null;let s=t.retried===i?0:Math.min(Number(o.retryIn)||0,Ye),c=at(o,r,s>0?a:t.sought);return s>0&&(Object.assign(c,{retried:i,retryAt:Date.now()+s}),setTimeout(N,s)),M().set(e,c),c.pullsPending&&st(e,c,n,1,null),null},()=>null).finally(()=>{t.refreshing=!1,N()})}function ut(e){let t=new Set(e.commits.map(e=>e.sha));e.branches=[...e.branches,...e.unread.flatMap(({name:e,sha:n})=>t.has(n)?[{name:e,sha:n}]:[])],e.unread=e.unread.filter(e=>!t.has(e.sha)),e.asked??=new Set;let n=new Map,r=(t,r)=>{e.asked.has(t)||n.set(t,Math.max(n.get(t)??-1/0,r??0))};for(let n of e.commits)for(let e of n.parents)t.has(e)||r(e,n.committedAt);for(let t of e.unread)r(t.sha,t.at);e.next=[...n].toSorted((e,t)=>t[1]-e[1]).slice(0,$e).map(([e])=>e);for(let t of e.next)e.asked.add(t);return e.more&&=e.next.length>0,e}function dt(e,t,n,r){if(t.loadingMore||!t.more)return;t.loadingMore=!0,t.moreError=null,t.until=Date.now()+Je,N();let i={next:t.next};n(t.page+1,i).then(a=>{if(M().get(e)!==t)return null;let o=new Set(t.commits.map(e=>e.sha));return t.commits=[...t.commits,...a.commits.filter(e=>!o.has(e.sha))],ot(t,a.pulls),t.page+=1,t.more=a.more===!0,r?.(t),t.until=Date.now()+Je,a.pullsPending&&st(e,t,n,t.page,i),null},e=>(e?.name!==`AbortError`&&(t.moreError=e?.message||`More commits could not be read.`),null)).finally(()=>{t.loadingMore=!1,N()})}var ft=/^[a-f\d]{40}$/u,pt=e=>typeof e?.sha==`string`&&ft.test(e.sha)&&Array.isArray(e.parents);function mt(e){if(!Array.isArray(e?.commits))throw Error(`The server answered with no history.`);let t=e.commits.filter(pt),n=Array.isArray(e.unread)?e.unread.filter(e=>typeof e?.name==`string`&&typeof e.sha==`string`&&ft.test(e.sha)):[],r=Array.isArray(e.pulls)?e.pulls.filter(e=>typeof e?.merge==`string`&&ft.test(e.merge)&&Number.isSafeInteger(e.number)&&typeof e.head==`string`&&ft.test(e.head)&&Array.isArray(e.commits)).map(e=>({...e,commits:e.commits.filter(pt)})):[],i=Array.isArray(e.openPulls)?e.openPulls.filter(e=>Number.isSafeInteger(e?.number)&&typeof e.sha==`string`&&ft.test(e.sha)):[];return{...e,commits:t,unread:n,pulls:r,openPulls:i}}function ht(e,t,n){let r=gt(e,t),i=new Map(r.map(e=>[e.sha,e]));if(!i.has(n))return r;let a=new Set;for(let e=[n];e.length>0;){let t=e.pop();a.has(t)||!i.has(t)||(a.add(t),e.push(...i.get(t).parents))}let o=i.get(n);for(let e=new Set;i.has(o.parents[0])&&!e.has(o.sha);o=i.get(o.parents[0]))e.add(o.sha);let s=o.parents.length>0?o.committedAt??1/0:-1/0;return r.filter(e=>!a.has(e.sha)&&(e.committedAt??-1/0)>s)}function gt(e,t){if(t.length===0)return e;let n=new Map(t.map(e=>[e.merge,e])),r=new Set(e.map(e=>e.sha)),i=new Map;for(let e of t)for(let t of e.commits)!r.has(t.sha)&&!i.has(t.sha)&&i.set(t.sha,{...t,pull:e.number});return[...e.map(e=>{let t=n.get(e.sha);return t&&e.parents.length===1&&t.head!==e.parents[0]?{...e,parents:[e.parents[0],t.head]}:e}),...i.values()]}var _t=6e4,vt=60*_t,yt=24*vt;function bt(e,t=Date.now()){if(e==null)return``;let n=t-e;if(n>=-_t&&n<_t)return`now`;if(n>0&&n<vt)return`${Math.floor(n/_t)}m`;if(n>0&&n<yt)return`${Math.floor(n/vt)}h`;if(n>0&&n<7*yt)return`${Math.floor(n/yt)}d`;let r=new Date(e);return r.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,...r.getFullYear()===new Date(t).getFullYear()?{}:{year:`numeric`}})}function xt({branches:e=[],tags:t=[],pulls:n=[],openPulls:r=[]},i){let a=new Map,o=(e,t)=>a.set(e,[...a.get(e)??[],t]);for(let t of e.toSorted((e,t)=>+(t.name===i)-(e.name===i)))o(t.sha,{kind:`branch`,name:t.name,main:t.name===i});let s=new Set;for(let{number:e,sha:t}of[...n.map(e=>({number:e.number,sha:e.head})),...r])s.has(e)||(s.add(e),o(t,{kind:`pull`,name:`#${e}`,number:e}));for(let e of t)o(e.sha,{kind:`tag`,name:e.name});return a}function St(e,t){if(!t)return e;let n=[],r=0;for(let i of e.matchAll(/(?<=^|[\s([])#(\d+)\b/gu))n.push(e.slice(r,i.index),D`<a href="${`${t}/issues/${i[1]}`}" target="_blank" rel="noopener noreferrer" tabindex="-1">${i[0]}</a>`),r=i.index+i[0].length;return r===0?e:[...n,e.slice(r)]}var Ct=e=>We+e*Ue,wt=e=>e*j+j/2;function Tt({row:e,from:t,to:n}){let[r,i,a,o]=[Ct(t),Ct(n),wt(e),wt(e+1)];if(r===i)return`M${r} ${a}V${o}`;let s=(a+o)/2;return`M${r} ${a}C${r} ${s} ${i} ${s} ${i} ${o}`}var Et=({row:e,col:t,straight:n})=>n?`M${Ct(t)} ${wt(e)+6}v${j*.55}`:`M${Ct(t)+4} ${wt(e)+5}l${Ue*.6} ${j*.5}`;function Dt(e,t){let n=Array.from({length:Ge},()=>[]);for(let t of e.segments)n[t.color].push(Tt(t));let r=Array.from({length:Ge},()=>[]);for(let t of e.stubs)r[t.color].push(Et(t));let i=We*2+(e.width-1)*Ue;return D`<svg class="history-graph" width="${i}" height="${e.rows.length*j}" aria-hidden="true">${n.map((e,t)=>e.length>0?O`<path class=${`lane-${t}`} d=${e.join(``)}/>`:k)} ${r.map((e,t)=>e.length>0?O`<path class=${`history-stub lane-${t}`} d=${e.join(``)}/>`:k)} ${e.rows.map(({commit:e,col:n,color:r},i)=>O`<circle class=${`lane-${r}${e.sha===t?` is-shown`:``}`} cx=${Ct(n)} cy=${wt(i)}
|
|
2
2
|
r=${e.sha===t?4.5:e.parents.length>1?3:3.5}/>`)}</svg>`}function Ot(e,t,n,r){if(!e?.length)return k;let i=e=>{let t=je({"history-ref":!0,[`is-${e.kind}`]:!0,"is-default":e.main===!0,"is-shown":e.kind===n.kind&&e.name===n.name}),i=D`${e.kind===`tag`?Pe(Ne):e.kind===`pull`?Pe(Me):k}<span>${e.name}</span>`;return e.kind===`pull`&&r?D`<a class="${t}" href="${`${r}/pull/${e.number}`}" target="_blank" rel="noopener noreferrer" tabindex="-1" aria-label="${`Pull request ${e.name} on GitHub`}">${i}</a>`:D`<span class="${t}">${i}</span>`},a=e.slice(Ke);return D`<span class="history-refs" style="${E({"--ref":`var(--lane-${t})`})}">${e.slice(0,Ke).map(i)}${a.length>0?D`<span class="history-ref is-more" data-tooltip="${a.map(e=>e.name).join(`, `)}">+${a.length}</span>`:k}</span>`}function kt(e,t){let{repoId:n,commit:r,path:i}=e,a=t===`all`||t===`unmerged`,o=a?`all\0${n}`:`${n}\0${r}\0${i}`,s=(e,o,s=!1)=>l(n,a?``:r,i,{page:e,all:a,...s?{fresh:!0}:{},...t!==`path`&&e>1?{from:o.next}:{}}).then(e=>{if(!a&&e?.commit!==r)throw Error(`The server answered with another revision's history.`);return mt(e)}),c=t===`path`?null:ut,u=ct(o,s,c);return a&&u.status===`ready`&&!u.refreshing&&!u.sought.has(r)&&!(u.retryAt>Date.now())&&!gt(u.commits,u.pulls??[]).some(e=>e.sha===r)&<(o,u,s,c,r),a&&u.status===`error`&&u.code===`github-token-required`?(it.add(n),kt(e,`revision`)):{mode:t,key:o,entry:u,more:()=>dt(o,u,s,c)}}var At=e=>kt(e,e.path?`path`:`revision`),jt=e=>{tt.add(e)},Mt=e=>{tt.delete(e)};function Nt(e){M().delete(e),N()}var Pt=class extends Re{static properties={repository:{attribute:!1},repo:{attribute:!1},refs:{attribute:!1}};createRenderRoot(){return this}constructor(){super(),this.repository=null,this.repo=null,this.refs=null,this._drawn=null,this._moreButton=null,this._mode=null}connectedCallback(){super.connectedCallback(),tt.add(this)}disconnectedCallback(){super.disconnectedCallback(),tt.delete(this),this._moreButton&&C(this._moreButton),this._moreButton=null}updated(){let e=this.querySelector(`.history-more > button`);this._moreButton&&this._moreButton!==e&&C(this._moreButton),this._moreButton=e,e&&fe(e,t=>{t&&this.readNear(e)})}readNear(e){e===this._moreButton&&e.isConnected&&!e.disabled&&!e.parentElement.querySelector(`[role=alert]`)&&this._mode!==`unmerged`&&e.click()}mode(){let{repoId:e,path:t}=this.repository;return t?`path`:(M(),it.has(e)?`revision`:rt)}history(e){return kt(this.repository,e)}layout(e,t,n){let r=this._drawn;if(r?.commits===t.commits&&r.pulls===t.pulls&&r.mode===e&&r.defaultBranch===n)return r.layout;let i=e===`path`,a=t.branches.find(e=>e.name===n)?.sha,o=i?t.commits:Be(e===`unmerged`?ht(t.commits,t.pulls??[],a):gt(t.commits,t.pulls??[])),s=e===`all`?a:e===`revision`?o[0]?.sha:null,c=He(o,{linear:i,trunk:s&&!i?Ve(o,s):null,colors:Ge});return this._drawn={commits:t.commits,pulls:t.pulls,mode:e,defaultBranch:n,layout:c},c}pick(e){rt=e,N()}open(e,t){let{repoId:n,repo:r,path:i}=this.repository,a=t?.find(e=>e.kind===`branch`)??t?.find(e=>e.kind===`tag`);d({repoId:n,repo:r,path:i,commit:e.sha,bundleTab:`commits`,...a?{revision:{kind:a.kind,name:a.name}}:{}})}keydown(e){let t=[...this.querySelectorAll(`.history-row`)],n=e.target.closest(`.history-row`),r=n?[...n.querySelectorAll(qe)]:[],i=r.indexOf(e.target);if(i===-1)return;let a={ArrowLeft:-1,ArrowRight:1}[e.key],o={ArrowUp:-1,ArrowDown:1}[e.key],s=a?r[i+a]:(o?t[t.indexOf(n)+o]:{Home:t[0],End:t.at(-1)}[e.key])?.querySelector(`.history-commit`);if(s){e.preventDefault();for(let e of this.querySelectorAll(`.history-row :is(${qe})`))e.tabIndex=e===s?0:-1;s.focus()}}render(){if(!this.repository)return k;let{mode:e,key:t,entry:n,more:r}=this.history(this.mode());this._mode=e;let i=n.status===`ready`,a=e===`all`||e===`unmerged`?n.defaultBranch:this.refs?.status===`ready`?this.refs.value.defaultBranch??null:null,o=i?this.layout(e,n,a):null,s=e===`unmerged`?o?.rows.length??0:n.commits?.length??0,c=e===`unmerged`&&o?new Set(o.rows.map(e=>e.commit.sha)):null,l=i&&e===`all`?n.branches.length:c?n.branches.filter(e=>c.has(e.sha)).length:0,u=i?`${s}${n.more||n.cut?`+`:``} commit${s===1?``:`s`}`:``,d=it.has(this.repository.repoId);return D`<div class="history-bar">${ce(`commits`)} ${e===`path`?D`<span class="history-scope">Commits touching <code>${this.repository.path}</code></span>`:d?D`<span class="history-scope">Every branch needs your GitHub sign-in.</span>`:D`<div class="history-modes" role="group" aria-label="Branches"><button type="button" aria-pressed="${String(e===`all`)}" @click="${()=>this.pick(`all`)}">All branches</button> <button type="button" aria-pressed="${String(e===`unmerged`)}" @click="${()=>this.pick(`unmerged`)}">Unmerged</button></div>`} ${i?D`<span class="history-summary">${u}${l>0?` on ${l} branch${l===1?``:`es`}`:``}</span>`:k}</div>${i?this.renderCommits(e,n,r,o,a):n.status===`error`?D`<div class="bundles-slide-placeholder is-error"><p role="alert">${n.error}</p><button type="button" @click="${()=>{M().delete(t),N()}}">Retry</button></div>`:D`<div class="bundles-slide-placeholder" role="status">Reading the history…</div>`}`}renderCommits(e,t,n,r,i){if(r.rows.length===0&&(e!==`unmerged`||!t.more&&!t.moreError))return D`<div class="bundles-slide-placeholder">${e===`unmerged`?`Every branch read is merged.`:`No commits.`}</div>`;let a=this.repository.commit,o=p(this.repository,this.refs),s=xt(t,i),l=Math.max(0,r.rows.findIndex(e=>e.commit.sha===a)),u=We*2+(r.width-1)*Ue,d=this.repo??this.repository.repo,f=d?`https://github.com/${d.split(`/`).map(encodeURIComponent).join(`/`)}`:null;return D`<div class="history-scroll">${e===`all`&&!t.refreshing&&!(t.retryAt>Date.now())&&!r.rows.some(e=>e.commit.sha===a)?D`<p class="history-note"><code>${a.slice(0,7)}</code> isn’t among these commits.</p>`:k}<div class="history-lines" style="${E({"--history-graph":`${u}px`})}">${Dt(r,a)}<ol class="history-list" aria-label="Commits" @keydown="${this.keydown}">${r.rows.map(({commit:e,color:t},n)=>{let r=s.get(e.sha),i=e.committedAt==null?null:new Date(e.committedAt),u=e.sha.slice(0,7);return D`<li class="${je({"history-row":!0,"is-shown":e.sha===a})}">${f?D`<a class="history-sha" href="${`${f}/commit/${e.sha}`}" target="_blank" rel="noopener noreferrer" tabindex="-1" aria-label="${`Commit ${u} on GitHub`}">${u}</a>`:D`<code class="history-sha">${u}</code>`} ${Ot(r,t,o,f)} <span class="history-subject" id="${`history-subject-${e.sha}`}">${St(e.subject||`(no message)`,f)}</span> <button type="button" class="history-commit" id="${`history-commit-${e.sha}`}" tabindex="${n===l?0:-1}" aria-labelledby="${`history-subject-${e.sha} history-commit-${e.sha}`}" aria-current="${e.sha===a?`true`:k}" @click="${()=>this.open(e,r)}"><span class="history-author">${c(e.authorLogin,e.authorName,e.coauthors)}</span> ${i?D`<time class="history-time" datetime="${i.toISOString()}">${bt(e.committedAt)}</time>`:D`<span class="history-time"></span>`}</button></li>`})}</ol></div>${t.cut?D`<p class="history-note">Only the first 5,000 branches by name are read.</p>`:k} ${t.more||t.moreError?D`<div class="history-more">${t.moreError?D`<span role="alert">${t.moreError}</span>`:k} <button type="button" ?disabled="${t.loadingMore}" @click="${n}">${t.loadingMore?`Reading…`:`Older commits`}</button></div>`:k}</div>`}};customElements.get(`repository-history`)||customElements.define(`repository-history`,Pt);function Ft(e){let t=e?.startsWith(`claude/`)?`claude`:e?.startsWith(`codex/`)?`codex`:null,n=t===`claude`?/^claude\/(issue|pr)-([1-9]\d{0,9})-/u.exec(e):null;return{agent:t,issue:n?.[1]===`issue`?Number(n[2]):null,pull:n?.[1]===`pr`?Number(n[2]):null}}var It=e=>e.head&&e.fork?`${e.fork}:${e.head}`:e.head,Lt=e=>[...e.agents,...e.sessions.length>0||e.claude?[`claude`]:[],...e.tasks.length>0||e.codex?[`codex`]:[]],Rt=new Set([`claude`,`codex`]);function zt({pulls:e=[],commits:t=[],branches:n=[]}){let r=new Map,i=e=>{let t=e;for(;r.has(t)&&r.get(t)!==t;)t=r.get(t);return r.set(e,t),t},a=(e,t)=>{let[n,a]=[i(e),i(t)];n!==a&&r.set(a,n)},o=new Map,s=(e,t)=>{for(let n of t)o.set(e,new Set([...o.get(e)??[],n]))},c=(e,t)=>{if(i(e),t.agents.length===0)for(let n of t.sessions)a(e,`session:${n}`);if(t.agents.length===0)for(let n of t.tasks)a(e,`task:${n}`);s(e,Lt(t))},l=new Set(n.map(e=>e.name));for(let e of n){let t=`branch:${e.name}`;c(t,e.signals);let{agent:n}=Ft(e.name);n&&s(t,[n])}let u=new Map;for(let t of e){let e=It(t);e!==null&&t.number>(u.get(e)??0)&&u.set(e,t.number)}for(let t of e){let e=`pull:${t.number}`;c(e,t.signals);let{agent:n,pull:r}=Ft(t.head);n&&s(e,[n]);let i=It(t);if(t.signals.agents.length>0){i!==null&&u.get(i)===t.number&&a(e,`branch:${i}`);continue}i&&(n||Lt(t.signals).length>0||l.has(i))&&a(e,`branch:${i}`),r&&a(e,`pull:${r}`)}for(let e of t)c(`commit:${e.oid}`,e.signals);let d=new Map;for(let e of r.keys()){let t=i(e),n=d.get(t)??{agents:new Set,keys:[]};n.keys.push(e);for(let t of o.get(e)??[])n.agents.add(t);d.set(t,n)}return[...d.values()]}var Bt=e=>(t,n)=>(e(t)??0)-(e(n)??0);function Vt({agents:e,keys:t},{pulls:n,commits:r,issues:i,branches:a}){if(e.size===0)return null;let o=e=>t.filter(t=>t.startsWith(e)).map(t=>t.slice(e.length)),s=o(`pull:`).flatMap(e=>n.get(Number(e))??[]).toSorted(Bt(e=>e.createdAt)),c=o(`commit:`).flatMap(e=>r.get(e)??[]).toSorted(Bt(e=>e.at)),l=[...new Set([...o(`branch:`),...s.flatMap(e=>It(e)??[])])],u=[...new Set([...s.flatMap(e=>e.closes),...s.flatMap(e=>Ft(e.head).issue??[]),...o(`branch:`).flatMap(e=>Ft(e).issue??[])])].flatMap(e=>i.get(e)??[]).toSorted(Bt(e=>e.createdAt)),d=l.flatMap(e=>a.get(e)??[]),f=[...s,...c,...u,...d];if(f.length===0)return null;let[p,m]=[o(`task:`),o(`session:`)],h=f.flatMap(e=>(`createdAt`in e?e.createdAt:e.at)??[]),g=f.flatMap(e=>(`updatedAt`in e?e.updatedAt:e.at)??[]),_=new Set(s.map(e=>e.state)),v=[...s.map(e=>({at:e.createdAt,title:e.title})),...c.map(e=>({at:e.at,title:e.title}))].toSorted(Bt(e=>e.at))[0],y=[...s,...c];return{id:m[0]??p[0]??(s[0]?`pull-${s[0].number}`:c[0]?.oid??l[0]??``),agents:[...[...e].filter(e=>!Rt.has(e)),...[`claude`,`codex`].filter(t=>e.has(t))],sessions:m,tasks:p,title:v?.title??u[0]?.title??l[0]??``,authors:[...new Set(f.flatMap(e=>e.author??[]))],startedAt:h.length>0?Math.min(...h):null,updatedAt:g.length>0?Math.max(...g):null,state:_.has(`open`)?`open`:_.has(`merged`)||c.length>0?`merged`:_.has(`closed`)?`closed`:`branch`,pulls:s.map(({number:e,title:t,state:n,draft:r})=>({number:e,title:t,state:n,draft:r})).toReversed(),commits:c.map(({oid:e,title:t})=>({oid:e,title:t})).toReversed(),issues:u.map(({number:e,title:t,state:n})=>({number:e,title:t,state:n})),branches:l,commitCount:s.reduce((e,t)=>e+t.commits,0)+c.length,additions:y.reduce((e,t)=>e+t.additions,0),deletions:y.reduce((e,t)=>e+t.deletions,0)}}function Ht(e,{branchesSince:t=null}={}){let n={pulls:new Map((e.pulls??[]).map(e=>[e.number,e])),commits:new Map((e.commits??[]).map(e=>[e.oid,e])),issues:new Map((e.issues??[]).map(e=>[e.number,e])),branches:new Map((e.branches??[]).map(e=>[e.name,e]))},r=e=>t!==null&&e.pulls.length===0&&e.commits.length===0&&(e.updatedAt??0)<t;return zt(e).flatMap(e=>Vt(e,n)??[]).filter(e=>!r(e)).toSorted(Bt(e=>e.updatedAt)).toReversed()}var Ut=3e5,Wt=/^[a-z][a-z\d-]{0,31}$/u,Gt=/^(?:app|user)-[1-9]\d{0,11}$/u,Kt=3e4,qt=12,Jt=new Map,Yt=new Set,Xt=null;function Zt(){let e=T.managedSession?`${T.managedSession.id}\0${T.managedSession.role}`:null;return e!==Xt&&(Jt.clear(),Xt=e),Jt}var P=()=>{for(let e of Yt)e.requestUpdate()};S(e=>{e===`agents`&&P()});function Qt(e){if(!Array.isArray(e?.pulls)||!Array.isArray(e.commits))throw Error(`The server answered with no pull requests or commits.`);let t=(Array.isArray(e.agents)?e.agents:[]).filter(e=>typeof e?.id==`string`&&Wt.test(e.id)&&![`claude`,`codex`,`all`].includes(e.id)&&typeof e.name==`string`&&e.name.trim()&&(e.avatar===void 0||typeof e.avatar==`string`&&Gt.test(e.avatar))).map(({id:e,name:t,avatar:n})=>[e,{id:e,name:t.trim().slice(0,64),avatar:n??null}]),n=e=>Array.isArray(e?.signals?.sessions)&&Array.isArray(e.signals.tasks),r=e=>({...e,signals:{...e.signals,agents:Array.isArray(e.signals.agents)?e.signals.agents.filter(e=>typeof e==`string`&&Wt.test(e)&&![`claude`,`codex`,`all`].includes(e)):[]}});return{pulls:e.pulls.filter(e=>Number.isSafeInteger(e?.number)&&typeof e.title==`string`&&Array.isArray(e.closes)&&n(e)).map(r),commits:e.commits.filter(e=>typeof e?.oid==`string`&&/^[a-f\d]{40}$/u.test(e.oid)&&n(e)).map(r),issues:Array.isArray(e.issues)?e.issues.filter(e=>Number.isSafeInteger(e?.number)):[],branches:Array.isArray(e.branches)?e.branches.filter(e=>typeof e?.name==`string`&&n(e)).map(r):[],agents:[...new Map(t).values()],more:e.more===!0,after:e.more===!0?{pulls:e.after?.pulls??null,commits:e.after?.commits??null}:null}}var $t=e=>Object.assign(e,{sessions:Ht(e,{branchesSince:e.after?.pulls?Math.min(...e.pulls.map(e=>e.updatedAt??1/0)):null})});function en(e,t){return A(Zt(),e,()=>t(null).then(e=>(ve(e.agents),e)),{ready:e=>$t({status:`ready`,until:Date.now()+Ut,...e,loadingMore:!1,moreError:null}),failed:e=>e?.name===`AbortError`?null:{status:`error`,until:Date.now()+Kt,error:e?.message||`The agents' work could not be read.`},retryMs:Kt,repaint:P})}function tn(e,t,n){t.loadingMore||!t.more||(t.loadingMore=!0,t.moreError=null,t.until=Date.now()+Ut,P(),n(t.after).then(n=>{if(Zt().get(e)!==t)return null;let r=new Set(t.pulls.map(e=>e.number)),i=new Set(t.commits.map(e=>e.oid));t.pulls=[...t.pulls,...n.pulls.filter(e=>!r.has(e.number))],t.commits=[...t.commits,...n.commits.filter(e=>!i.has(e.oid))],t.more=n.more,t.after=n.after,t.until=Date.now()+Ut;let a=t.sessions.length;return $t(t),t.stalled=t.sessions.length<=a,null},e=>(e?.name!==`AbortError`&&(t.moreError=e?.message||`More could not be read.`),null)).finally(()=>{t.loadingMore=!1,P()}))}function nn(e,t,n){let r=n.trim().toLowerCase().split(/\s+/u).filter(Boolean);return e.filter(e=>{if(t!==`all`&&!e.agents.includes(t))return!1;if(r.length===0)return!0;let n=[e.title,...e.authors,...e.authors.map(we),...e.branches,...e.sessions,...e.tasks,...e.pulls.flatMap(e=>[`#${e.number}`,e.title]),...e.commits.flatMap(e=>[e.oid.slice(0,7),e.title]),...e.issues.flatMap(e=>[`#${e.number}`,e.title])].join(`
|
|
3
3
|
`).toLowerCase();return r.every(e=>n.includes(e))})}var rn={open:`open`,merged:`merged`,closed:`closed`,branch:`draft`},an=e=>(e.agents??[]).map(e=>e.id).filter(t=>(e.sessions??[]).some(e=>e.agents.includes(t))),on=e=>[`claude`,`codex`,...an(e)],sn=[[`pulls`,pe,`pull request`,`pull requests`],[`branches`,me,`branch`,`branches`],[`commits`,he,`commit to the default branch without a pull request`,`commits to the default branch without a pull request`]];function cn(e){if(!e.after?.pulls)return 100;let t=Math.max(e.pulls.length,...e.pulls.map(e=>e.number),...(e.issues??[]).map(e=>e.number));return t>0?Math.min(99,Math.floor(100*e.pulls.length/t)):0}function ln(e,t,n){let r=2*Math.PI*9;return D`<span class="${`history-summary read-gauge${n?` is-reading`:``}`}" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="${e}" aria-label="${t}" data-tooltip="${t}"><svg class="read-gauge-ring" viewBox="0 0 22 22" aria-hidden="true"><circle class="read-gauge-track" cx="11" cy="11" r="9"/>${e>0?O`<circle class="read-gauge-arc" cx="11" cy="11" r="9" transform="rotate(-90 11 11)" stroke-dasharray=${`${r*e/100} ${r}`}/>`:k}</svg> ${e===100?D`<svg class="read-gauge-check" viewBox="0 0 16 16" aria-hidden="true"><path d="m4.25 8.5 2.5 2.5 5-5.5"/></svg>`:D`<span class="read-gauge-value" aria-hidden="true">${e}%</span>`}</span>`}function un(e,t){let n=e.filter(e=>e.agents.includes(t));return{pulls:n.reduce((e,t)=>e+t.pulls.length,0),branches:new Set(n.flatMap(e=>e.branches)).size,commits:n.reduce((e,t)=>e+t.commits.length,0)}}var dn=class extends Re{static properties={repository:{attribute:!1},repo:{attribute:!1},_filter:{state:!0}};createRenderRoot(){return this}constructor(){super(),this.repository=null,this.repo=null,this._filter=``,this._moreButton=null}connectedCallback(){super.connectedCallback(),Yt.add(this)}disconnectedCallback(){super.disconnectedCallback(),Yt.delete(this),this._moreButton&&C(this._moreButton),this._moreButton=null}updated(){let e=this.querySelector(`.issues-more > button`);this._moreButton&&this._moreButton!==e&&C(this._moreButton),this._moreButton=e,e&&fe(e,t=>{t&&this.readNear(e)})}readNear(e){e===this._moreButton&&e.isConnected&&!e.disabled&&!this._filter.trim()&&!e.parentElement.querySelector(`[role=alert]`)&&!this.list().entry.stalled&&e.click()}list(){let{repoId:e}=this.repository,t=`${e}`,n=t=>m(e,t??{}).then(Qt),r=en(t,n);return{key:t,entry:r,more:()=>tn(t,r,n)}}pick(e){oe(this.repository,`agents`,e)}render(){if(!this.repository)return k;let{key:e,entry:t,more:n}=this.list(),r=t.status===`ready`,i=r?t.sessions:[],a=e=>r?D`<span class="n">${(e===`all`?i:i.filter(t=>t.agents.includes(e))).length}${t.more?`+`:``}</span>`:k,o=x(`agents`),s=on(t).includes(o)?o:`all`,c=nn(i,s,this._filter);return D`<div class="history-bar issues-bar">${ce(`agents`)}<div class="history-modes" role="group" aria-label="Agents"><button type="button" aria-pressed="${String(s===`all`)}" @click="${()=>this.pick(`all`)}">All${a(`all`)}</button> ${on(t).map(e=>D`<button type="button" class="${`agent-pick is-${e}`}" aria-pressed="${String(s===e)}" @click="${()=>this.pick(e)}">${be(e)}${ye(e)}${a(e)}</button>`)}</div><input class="issues-filter" type="search" placeholder="Filter" aria-label="Filter the sessions read" .value="${this._filter}" @input="${e=>{this._filter=e.target.value}}"> ${r?this.renderStats(t):k} ${r?ln(cn(t),`${t.pulls.length} pull request${t.pulls.length===1?``:`s`} read`,t.loadingMore):k}</div>${r?this.renderSessions(t,c,n,s):t.status===`error`?D`<div class="bundles-slide-placeholder is-error"><p role="alert">${t.error}</p><button type="button" @click="${()=>{Zt().delete(e),P()}}">Retry</button></div>`:D`<div class="bundles-slide-placeholder" role="status">Reading what the agents did…</div>`}`}renderStats(e){let t={pulls:!!e.after?.pulls,branches:!!e.after?.pulls,commits:!!e.after?.commits},n=t=>e.sessions.some(e=>e.agents.includes(t));return D`<span class="agent-totals">${[...an(e),`claude`,`codex`].filter(n).map(n=>{let r=un(e.sessions,n);return D`<span class="agent-stats" role="group" aria-label="${ye(n)}"><span class="${`agent-mark is-${n}`}">${be(n)}</span> ${sn.filter(([e])=>r[e]>0).map(([e,n,i,a])=>{let o=`${r[e].toLocaleString(`en-US`)}${t[e]?`+`:``}`,s=`${o} ${r[e]===1&&!t[e]?i:a}`;return D`<span class="agent-stat" role="img" aria-label="${s}" data-tooltip="${s}">${n}${o}</span>`})}</span>`})}</span>`}renderSessions(e,t,n,r){let i=r===`all`?`agents' sessions`:`${ye(r)} sessions`;return D`<div class="issues-scroll">${t.length>0?D`<ol class="issues-grid" aria-label="Sessions">${t.map(e=>this.renderSession(e))}</ol>`:D`<p class="history-note">${e.sessions.length>0&&this._filter.trim()?`None of the ${i} read match.`:`No ${i} among those read.`}</p>`} ${e.more||e.moreError?D`<div class="history-more issues-more">${e.moreError?D`<span role="alert">${e.moreError}</span>`:k} <button type="button" ?disabled="${e.loadingMore}" @click="${()=>{e.stalled=!1,n()}}">${e.loadingMore?`Reading…`:`More`}</button></div>`:k}</div>`}openSession(e,t){!xe(e)||e.target?.closest?.(`.agent-chip.is-commit`)||(e.preventDefault(),Ae({repository:{...this.repository,repo:this.repo??this.repository.repo},target:{session:t}}))}openItem(e,t,n){xe(e)&&(e.preventDefault(),e.stopPropagation(),Ae({repository:{...this.repository,repo:this.repo??this.repository.repo},target:{number:t,preview:n}}))}renderSession(e){let t=this.repo??this.repository.repo,n=Se(e,t),r=e.updatedAt==null?null:new Date(e.updatedAt),i=e.authors.find(e=>!De(e)),a=e.pulls.length+e.commits.length,o=a!==e.pulls.length+e.commits.length,s=r?D`<time datetime="${r.toISOString()}">${bt(e.updatedAt)}</time>`:k,c=e.additions||e.deletions?D`<span class="issue-diff"><span class="is-added">+${e.additions.toLocaleString(`en-US`)}</span> <span class="is-deleted">−${e.deletions.toLocaleString(`en-US`)}</span></span>`:k,l=a===1,u=[i?D`<span class="issue-author">${Ee(i)}</span>`:k,l?k:s,a===0?D`<span>no pull request</span>`:o?D`<span>${a} tasks</span>`:k,l?k:c].filter(e=>e!==k),d=[...e.pulls.map(e=>[`is-${e.draft&&e.state===`open`?`draft`:e.state}`,`pull/${e.number}`,`#${e.number}`,{kind:`pulls`,...e}]),...e.commits.map(e=>[`is-commit`,`commit/${e.oid}`,D`<code>${e.oid.slice(0,7)}</code>`,null]),...e.issues.map(e=>[`is-issue is-${e.state===`open`?`open`:`merged`}`,`issues/${e.number}`,D`<span class="sr-only">Issue </span>#${e.number}`,{kind:`issues`,reason:null,...e}])];return D`<li class="${`issue-tile agent-tile is-${rn[e.state]}`}"><div class="issue-body" @click="${t=>this.openSession(t,e)}"><span class="issue-rail">${e.agents.map(e=>D`<span class="${`agent-mark is-${e}`}" role="img" aria-label="${ye(e)}">${be(e)}</span>`)}</span> <span class="issue-lines">${n?D`<a class="issue-name" href="${n}" target="_blank" rel="noopener noreferrer">${e.title||`(no title)`}</a>`:D`<button type="button" class="issue-name">${e.title||`(no title)`}</button>`} ${u.length>0?D`<span class="issue-meta">${u}</span>`:k} ${d.length>0?D`<span class="agent-task-row"><span class="agent-chips">${d.slice(0,qt).map(([e,n,r,i],a)=>D`<a class="${`agent-chip ${e}`}" href="${t?`https://github.com/${t}/${n}`:k}" target="_blank" rel="noopener noreferrer" @click="${i?e=>this.openItem(e,i.number,i):k}" data-rest="${a<d.length-1?d.length-1-a:k}">${r}</a>`)}</span>${l&&(s!==k||c!==k)?D`<span class="issue-meta">${s}${c}</span>`:k}</span>`:k} ${e.branches[0]?D`<span class="issue-branch"><code>${e.branches[0]}</code>${e.branches.length>1?D`<span>+${e.branches.length-1}</span>`:k}</span>`:k}</span></div></li>`}};customElements.get(`repository-agents`)||customElements.define(`repository-agents`,dn);var fn=3e5,pn=3e4,mn=1e3,hn=5,gn=60,_n=5e3,vn=12,F=864e5,I=7*F,yn=8,bn=3,xn=ne,Sn=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],Cn=[1,2,3,4,5,6,0],wn=6,Tn=new Map,En=new Map,Dn=new Map,On=new Map,kn=new Set,An=null,jn=ie,Mn={pulls:`merged`,issues:`closed`},Nn={pulls:[`Pull requests`,[[`merged`,`Merged`,`is:pr is:merged merged:`],[`opened`,`Opened`,`is:pr created:`]]],issues:[`Issues`,[[`closed`,`Closed`,`is:issue is:closed closed:`],[`created`,`Opened`,`is:issue created:`]]]},Pn=[`merged`,`opened`,`closed`,`created`],Fn=se(O`<circle cx="8" cy="8" r="2.75"/><path d="M8 1v4.25M8 10.75V15"/>`),In={agent:`Commit with agents`,without:`Commit without agents`,release:`Release`},Ln=10,Rn=10;function L(){let e=T.managedSession?`${T.managedSession.id}\0${T.managedSession.role}`:null;return e!==An&&(Tn.clear(),En.clear(),Dn.clear(),On.clear(),An=e),Tn}var R=()=>{for(let e of kn)e.requestUpdate()};S(e=>{if(e===`pulse`)for(let e of kn)e.periodShown()});var z=e=>Number.isSafeInteger(e)&&e>=0?e:0,zn=(e,t)=>({count:z(e?.[t]?.count),previous:Number.isSafeInteger(e?.[t]?.previous)?e[t].previous:null,items:Array.isArray(e?.[t]?.items)?e[t].items.filter(e=>Number.isSafeInteger(e?.number)&&typeof e.title==`string`):[]});function Bn(e){if(!Number.isSafeInteger(e?.since)||!xn.some(([t])=>t===e.weeks))throw Error(`The server answered with no period.`);let t=t=>zn(e,t),n=e=>Array.isArray(e)&&e.length===7&&e.every(Array.isArray)?e.map(([e,t])=>[z(e),z(t)]):null,r=e=>Array.isArray(e)&&e.length===7?e.map(z):null,i=Array.isArray(e.stats?.weeks)?e.stats.weeks.filter(e=>Number.isSafeInteger(e?.week)&&Array.isArray(e.days)).map(e=>({...e,dayLines:n(e.dayLines),agentDays:r(e.agentDays),releaseDays:r(e.releaseDays),directDays:r(e.directDays)})):[],a=e.stats&&Array.isArray(e.stats.weeks)&&Array.isArray(e.stats.contributors)&&Array.isArray(e.stats.punch)?{weeks:i,contributors:e.stats.contributors.filter(e=>(typeof e?.login==`string`||typeof e?.name==`string`)&&Array.isArray(e.weeks)).map(e=>({login:typeof e.login==`string`?e.login:null,id:Number.isSafeInteger(e.id)?e.id:null,name:typeof e.name==`string`?e.name:null,weeks:e.weeks,days:Array.isArray(e.days)?e.days:null})),punch:Cn.map(t=>Array.from({length:24},(n,r)=>z(e.stats.punch[t]?.[r]))),periodPunch:e.stats.periodPunch===!0,from:Number.isSafeInteger(e.stats.from)?e.stats.from:null,lines:typeof e.stats.lines==`boolean`?e.stats.lines:null,agents:i.length>0&&i.every(e=>e.agentDays!==null),releases:i.length>0&&i.every(e=>e.releaseDays!==null),direct:i.length>0&&i.every(e=>e.directDays!==null)&&Array.isArray(e.stats.directCommits),directCommits:Array.isArray(e.stats.directCommits)?e.stats.directCommits.filter(e=>typeof e?.sha==`string`&&Number.isSafeInteger(e.at)).map(e=>({sha:e.sha,at:e.at,subject:typeof e.subject==`string`?e.subject:``,login:typeof e.login==`string`?e.login:null,id:Number.isSafeInteger(e.id)?e.id:null,name:typeof e.name==`string`?e.name:null,kind:typeof e.kind==`string`&&Object.hasOwn(In,e.kind)?e.kind:null})):[]}:null;return{weeks:e.weeks,since:e.since,merged:t(`merged`),opened:t(`opened`),closed:t(`closed`),created:t(`created`),stats:a,reading:Number.isSafeInteger(e.reading)?e.reading:null,pulls:Number.isSafeInteger(e.pulls)?e.pulls:null,pending:e.pending===!0,behind:e.behind===!0}}function Vn(e,t){Dn.set(e,t),t.answer.stats&&On.set(e,t.answer)}var B=e=>e.reading??e.pulls,Hn=e=>B(e)===null?e.pending?[_n,vn]:null:[mn,hn];function Un(e,t){let n=`${e}\0${t}`;return A(L(),n,()=>g(e,t).then(Bn),{ready:e=>({status:`ready`,until:Date.now()+fn,answer:e,tries:0,asking:!1}),settled:r=>{Vn(e,r),Hn(r.answer)&&Wn(n,r,e,t,Hn(r.answer)[0])},failed:e=>e?.name===`AbortError`?null:{status:`error`,until:Date.now()+pn,error:e?.message||`The repository’s pulse could not be read.`},retryMs:pn,repaint:R})}function Wn(e,t,n,r,i){t.asking=!0,setTimeout(()=>{L().get(e)===t&&g(n,r).then(Bn).then(i=>{if(L().get(e)!==t)return null;t.behind=i.behind?(t.behind??0)+1:0;let a=B(i)!==null&&B(t.answer)!==null&&B(i)>B(t.answer)||t.behind>0&&t.behind<=gn;t.answer=i,t.until=Date.now()+fn,t.tries=a?0:t.tries+1;let o=Hn(i);return o&&t.tries<o[1]?Wn(e,t,n,r,o[0]):t.asking=!1,null},()=>(t.asking=!1,null)).finally(R)},i)}function Gn(e,t,n){return L(),A(En,[e,t,n.from,n.to??``,n.authors.join(`,`)].join(`\0`),()=>_(e,t,n),{ready:e=>({status:`ready`,until:Date.now()+fn,answer:Object.fromEntries(Pn.map(t=>[t,zn(e,t)]))}),failed:e=>({status:`error`,until:Date.now()+pn,error:e?.message||`These couldn’t be read.`}),retryMs:pn,repaint:R})}var Kn=e=>e.agents===!0&&e.weeks.some(e=>e.agentDays.some(e=>e>0)),qn=e=>e.releases===!0&&e.weeks.some(e=>e.releaseDays.some(e=>e>0)),V=(e,t,n,r=`days`)=>e.reduce((e,i)=>e+i[r].reduce((e,r,a)=>{let o=i.week+a*F;return o>=t&&o<=n?e+z(r):e},0),0);function Jn(e,t=Date.now()){let n=Math.floor(t/F)*F;return n-new Date(n).getUTCDay()*F-(e-1)*I}var Yn=(e,t)=>e.from===null||e.from===void 0||e.from<t;function Xn(e,t,n,r=Date.now()){return{weeks:n,since:e?.since??Jn(n,r),merged:e?.merged??null,opened:e?.opened??null,closed:e?.closed??null,created:e?.created??null,stats:{...t.stats,otherPunch:t.weeks!==n},reading:e?.reading??null,pulls:e?.pulls??null,pending:e?.pending??!1}}function Zn(e,t=Date.now()){let{stats:n,since:r}=e;if(!n)return{commits:null,previous:null,agents:null,previousAgents:null,releases:null,previousReleases:null,additions:null,deletions:null,authors:null};let i=Math.floor(t/F)*F,a=e.weeks*I,o=n.weeks.filter(e=>e.week>=r),s=n.weeks.length>0&&n.weeks[0].week<=r-a&&Yn(n,r-a),c=e=>n.lines===!0?o.reduce((t,n)=>t+z(n[e]),0):null;return{commits:V(n.weeks,r,i),previous:s?V(n.weeks,r-a,i-a):null,agents:n.agents?V(n.weeks,r,i,`agentDays`):null,previousAgents:n.agents&&s?V(n.weeks,r-a,i-a,`agentDays`):null,releases:n.releases?V(n.weeks,r,i,`releaseDays`):null,previousReleases:n.releases&&s?V(n.weeks,r-a,i-a,`releaseDays`):null,additions:c(`additions`),deletions:c(`deletions`),authors:Qn(n.contributors,r).length}}function H({id:e=null,login:t,name:n}){let r=De(t,n);if(r)return`agent:${r}`;let i=Ce(t)?.id;return i==null?e===null?t?`@${t.toLowerCase()}`:`=${n}`:`#${e}`:`user:${i}`}function Qn(e,t,n=1/0){let r=new Map;for(let i of e){let{login:e,name:a}=i,o=H(i);r.set(o,(i.days??i.weeks).reduce((e,[r,i,a,o])=>r>=t&&r<n?{...e,commits:e.commits+z(i),additions:e.additions+z(a),deletions:e.deletions+z(o)}:e,r.get(o)??{key:o,login:e,name:a,commits:0,additions:0,deletions:0}))}return[...r.values()].filter(e=>e.commits>0).toSorted((e,t)=>t.commits-e.commits||(e.login??e.name).localeCompare(t.login??t.name))}function $n(e,t){let n=e.contributors.filter(e=>H(e)===t),r=n.length>0&&n.every(e=>e.days),i=e.weeks.map(({week:e})=>({week:e,days:Array.from({length:7},()=>0),dayLines:Array.from({length:7},()=>[0,0]),agentDays:Array.from({length:7},()=>0),releaseDays:Array.from({length:7},()=>0),directDays:Array.from({length:7},()=>0),commits:0,additions:0,deletions:0}));for(let[e,t,a,o,s,c,l]of n.flatMap(e=>r?e.days:e.weeks)){let n=i[Math.floor((e-(i[0]?.week??0))/I)];if(!n||(n.commits+=z(t),n.additions+=z(a),n.deletions+=z(o),!r))continue;let u=Math.floor((e-n.week)/F);n.days[u]+=z(t),n.dayLines[u]=[n.dayLines[u][0]+z(a),n.dayLines[u][1]+z(o)],n.agentDays[u]+=z(s),n.releaseDays[u]+=z(c),n.directDays[u]+=z(l)}let a=e.agents===!0&&r&&n.every(e=>e.days.every(e=>e.length>4)),o=e.releases===!0&&r&&n.every(e=>e.days.every(e=>e.length>5)),s=e.direct===!0&&r&&n.every(e=>e.days.every(e=>e.length>6));return{...e,weeks:i,agents:a,releases:o,direct:s,byDays:r}}function er(e,t,n,r=null,i=Date.now()){let a=r===null?e:$n(e,r);if(!e?.direct||!a.direct)return null;let o=Math.min(n-F,Math.floor(i/F)*F),s=e.directCommits.filter(e=>e.at>=t&&e.at<o+F&&(r===null||H(e)===r));return{count:V(a.weeks,t,o,`directDays`),items:s}}function tr(e,t=Date.now()){let{stats:n,since:r,weeks:i}=e,a=n.lines===!0;if(i>4)return n.weeks.filter(e=>e.week>=r).map(e=>({from:e.week,to:e.week+I,day:!1,commits:z(e.commits),agents:n.agents?e.agentDays.reduce((e,t)=>e+t,0):null,releases:n.releases?e.releaseDays.reduce((e,t)=>e+t,0):null,additions:a?z(e.additions):null,deletions:a?z(e.deletions):null,future:!1}));let o=Math.floor(t/F)*F;return Array.from({length:i*7},(e,t)=>{let i=r+t*F,s=n.weeks.find(e=>i>=e.week&&i<e.week+I),c=s?Math.floor((i-s.week)/F):0,l=a?s?.dayLines?.[c]??null:null;return{from:i,to:i+F,day:!0,commits:z(s?.days[c]),agents:n.agents?z(s?.agentDays[c]):null,releases:n.releases?z(s?.releaseDays[c]):null,additions:l?.[0]??null,deletions:l?.[1]??null,future:i>o}})}function nr(e,t){if(!e.day||t.every(e=>e.days))return[e.from,e.to,!1];let n=e.from-new Date(e.from).getUTCDay()*F;return[n,n+I,!0]}function rr(e){if(!(e>0))return{top:1,ticks:[0,1]};let t=e/3,n=10**Math.floor(Math.log10(t)),r=Math.max(1,[1,2,5,10].map(e=>e*n).find(e=>e>=t)),i=Math.ceil(e/r)*r;return{top:i,ticks:Array.from({length:i/r+1},(e,t)=>t*r)}}var U=e=>e.toLocaleString(`en-US`),ir=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),W=e=>ir.format(e),G=(e,t,n=`${t}s`)=>`${U(e)} ${e===1?t:n}`,K=(e,t=!1)=>new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,...t?{year:`numeric`}:{},timeZone:`UTC`}),ar=e=>new Date(e).toISOString().slice(0,10),or=(e,t)=>new Date(e).getUTCFullYear()!==new Date(t).getUTCFullYear(),sr=(e,t)=>{let n=Math.floor(t/F)*F,r=or(e,n);return e>=n?K(n,r):`${K(e,r)} \u2013 ${K(n,r)}`},cr=(e,t)=>e.day?new Date(e.from).toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`,...or(e.from,t)?{year:`numeric`}:{},timeZone:`UTC`}):`Week of ${K(e.from,or(e.from,t))}`,lr=(e,t,n={})=>`${cr(e,t)}: ${G(e.commits,`commit`)}${n.agents?`, ${U(e.agents)} with agents`:``}${n.releases?`, ${G(e.releases,`release`)}`:``}${e.additions===null?``:`, +${U(e.additions)} \u2212${U(e.deletions)} lines`}`;function ur(e,t,n){let r=new Date(e[t].from);if(n===1)return`${r.toLocaleDateString(`en-US`,{weekday:`short`,timeZone:`UTC`})} ${r.getUTCDate()}`;if(n===4)return r.getUTCDay()===0?K(e[t].from):``;if(n===13)return t%2==0?K(e[t].from):``;let i=r.getUTCMonth();return(t===0?e.length>3&&new Date(e[3].from).getUTCMonth()===i:new Date(e[t-1].from).getUTCMonth()!==i)?i===0?String(r.getUTCFullYear()):r.toLocaleDateString(`en-US`,{month:`short`,timeZone:`UTC`}):``}var dr=(e,t,n)=>t===null||e===null?null:e===t?`Same as ${n}`:`${e>t?`↑`:`↓`}${t>0?` ${Math.max(1,Math.round(Math.abs(e-t)/t*100))}%`:``} from ${U(t)} ${n}`,fr=(e,t)=>e===0?0:e===t?100:Math.min(99,Math.max(1,Math.round(e/t*100)));function pr(e,t=!1){let[n,r]=t?[`latest `,`: the year shown is as it was before.`]:[``,`.`],i=e.weeks===52?` of the last year`:``;return e.reading===null?e.pulls===null?[`GitHub is still counting this repository\u2019s ${n}commits\u2026`,`GitHub hasn\u2019t counted this repository\u2019s ${n}commits yet.`,`Ask again`]:[`Reading this repository\u2019s pull requests\u2026 ${U(e.pulls)} so far`,`${U(e.pulls)} of this repository\u2019s pull requests read so far${r}`,`Read on`]:[`Reading this repository\u2019s ${n}commits\u2026 ${U(e.reading)}${i} so far`,`${U(e.reading)} of this repository\u2019s commits${i} read so far${r}`,`Read on`]}var mr=(e,t,n)=>e===t?`Same as ${n}`:`${e>t?`↑`:`↓`} from ${t}% ${n}`,hr=D`<svg viewBox="0 0 16 16" width="11" height="11" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 13 13 3M5 3h8v8"/></svg>`,gr=e=>e.endsWith(`[bot]`)?`https://github.com/apps/${encodeURIComponent(e.slice(0,-5))}`:`https://github.com/${encodeURIComponent(e)}`,_r=e=>e.login?Oe(e.login,e.name,e.login):Oe(null,e.name),vr=class extends Re{static properties={repository:{attribute:!1},repo:{attribute:!1},_column:{state:!0},_typed:{state:!0},_picked:{state:!0},_everyone:{state:!0},_person:{state:!0},_allDirect:{state:!0}};createRenderRoot(){return this}constructor(){super(),this.repository=null,this.repo=null,this._column=null,this._typed=!1,this._picked=null,this._everyone=!1,this._person=null,this._allDirect=!1}connectedCallback(){super.connectedCallback(),kn.add(this)}disconnectedCallback(){super.disconnectedCallback(),kn.delete(this)}willUpdate(e){!e.has(`repository`)||e.get(`repository`)?.repoId===this.repository?.repoId||(this._column=null,this._picked=null,this._everyone=!1,this._person=null,this._allDirect=!1)}pick(e){oe(this.repository,`pulse`,xn.find(([t])=>t===e)[1].toLowerCase()),this.periodShown()}periodShown(){this._column=null,this._picked=null,this._everyone=!1,this._allDirect=!1,this.requestUpdate()}showList(e,t){Mn[e]=t,R()}askAgain(){let{repoId:e}=this.repository,t=jn(),n=`${e}\0${t}`,r=L().get(n);r?.status!==`ready`||r.asking||(r.tries=0,Wn(n,r,e,t,0),R())}render(){if(!this.repository)return k;let{repoId:e}=this.repository,t=jn(),n=Un(e,t);n.status===`ready`&&Vn(e,n);let r=Date.now(),i=n.status===`ready`?n.answer:null,a=On.get(e),o=i?.stats&&Yn(i.stats,i.since)?i:a&&n.status!==`error`&&Yn(a.stats,Jn(t,r))?Xn(i,a,t,r):i&&{...i,stats:null},s=!o&&n.status===`loading`?Dn.get(e)??null:null,c=o?{answer:o,asking:n.asking===!0}:s,l=c?.answer.stats&&(B(c.answer)!==null||c.answer.pending);return D`<div class="history-bar">${ce(`pulse`)}<div class="history-modes" role="group" aria-label="Period">${xn.map(([e,n])=>D`<button type="button" aria-pressed="${String(t===e)}" @click="${()=>this.pick(e)}">${n}</button>`)}</div>${c?D`<span class="pulse-range">${sr(c.answer.since,r)}</span>`:k} ${l?D`<span class="pulse-updating" role="status">${this.renderWaiting(c,pr(c.answer,!0))}</span>`:k}</div>${c?D`<div class="${`pulse-scroll${s?` is-reading`:``}`}" aria-busy="${String(n.status!==`ready`)}">${this.renderPulse(c,r)}</div>`:n.status===`error`?D`<div class="bundles-slide-placeholder is-error"><p role="alert">${n.error}</p><button type="button" @click="${()=>{L().delete(`${e}\0${t}`),R()}}">Retry</button></div>`:D`<div class="bundles-slide-placeholder" role="status">Reading the repository’s pulse…</div>`}`}renderPulse(e,t){let{answer:n}=e,r=xn.find(([e])=>e===n.weeks)[2],i=Zn(n,t),a=this.narrowing(n,t),o=n.stats?null:n.reading===null?n.pulls===null?`Counting…`:`Reading pull requests…`:`Reading commits…`,s=o??(n.stats?.lines===null?`Counting…`:null),c=(e,t,i)=>n[t]?this.renderTile(e,U(n[t].count),dr(n[t].count,n[t].previous,r),`${U(n[i].count)} opened`):this.renderTile(e,`–`,`Reading…`,``),l=this.renderLists(n,a,t);return D`<section class="pulse-tiles" aria-label="Figures">${this.renderTile(`Commits`,i.commits===null?`–`:U(i.commits),o??dr(i.commits,i.previous,r),`to the default branch`)} ${this.renderTile(`Contributors`,i.authors===null?`–`:U(i.authors),o,`who made them`)} ${c(`Pull requests merged`,`merged`,`opened`)} ${c(`Issues closed`,`closed`,`created`)} ${n.stats?.lines===!1?k:this.renderTile(`Lines`,i.additions===null?`–`:D`<span class="is-added">+${U(i.additions)}</span> <span class="is-removed">−${U(i.deletions)}</span>`,s,`added and removed`,i.additions===null?k:this.renderRatio(i.additions,i.deletions))} ${i.agents===null||!Kn(n.stats)?k:this.renderAgentsTile(i,r)}</section><div class="${`pulse-grid${l.length>2?` is-lists`:``}`}">${n.stats?D`${this.renderActivity(e,t)}${this.renderContributors(n,t)}`:D`<div class="pulse-pending pulse-wide" role="status">${this.renderWaiting(e,pr(n))}</div>`} ${l} ${n.stats?this.renderPunch(n.stats):k}</div>`}renderAgentsTile(e,t){let n=e.commits-(e.releases??0),r=e.previous===null?null:e.previous-(e.previousReleases??0),i=e.releases>0?`, ${G(e.releases,`release`)} apart`:``;return this.renderTile(D`<span data-tooltip="${`Commits an agent made or co-authored, or merged from an agent’s branch or a pull request labelled for one; releases, tagged commits changing only package.json, lockfiles and changelogs, counted in neither`}">With agents</span>`,n===0?`–`:`${fr(e.agents,n)}%`,e.previousAgents===null||n===0||!r?null:mr(fr(e.agents,n),fr(e.previousAgents,r),t),n===0?`no commits${i}`:`${U(e.agents)} of ${G(n,`commit`)}${i}`)}renderWaiting(e,[t,n,r]){return e.asking?t:D`${n} <button type="button" class="history-link" @click="${()=>this.askAgain()}">${r}</button>`}renderTile(e,t,n,r,i=k){return D`<div class="pulse-tile"><span class="pulse-tile-label">${e}</span> <span class="pulse-tile-value">${t}</span> ${i} <span class="pulse-tile-note">${n??r}</span> ${n?D`<span class="pulse-tile-note">${r}</span>`:k}</div>`}renderRatio(e,t){return e+t===0?k:D`<span class="pulse-ratio" aria-hidden="true">${[[`is-added`,e],[`is-removed`,t]].map(([n,r])=>r>0?D`<span class="${n}" style="${E({"--share":`${r/(e+t)}`})}"></span>`:k)}</span>`}renderActivity(e,t){let{answer:n}=e,r=this._person===null?null:n.stats.contributors.find(e=>H(e)===this._person)??null,i=r?$n(n.stats,this._person):n.stats,a=tr({...n,stats:i},t),o=a[0]?.day?`day`:`week`,s=r?ke(r.login,r.name):null,c=r?D`<span>a ${o} by</span><button type="button" class="pulse-picked is-person" aria-label="${`${s}\u2019s: show everyone\u2019s`}" @click="${()=>this.showPerson(null)}">${_r(r)}<span aria-hidden="true">×</span></button>`:D`<span>a ${o}</span>`,l=r&&!i.byDays&&o===`day`?`GitHub counts each contributor’s commits a week, not a day, in a repository this large: the quarter and the year show theirs.`:a.some(e=>e.commits>0)?null:`No commits${r?` by ${s}`:``} in the period.`;if(l)return D`<figure class="pulse-panel pulse-activity"><figcaption class="pulse-head"><h3>Commits</h3>${c}</figcaption><p class="pulse-note">${l}</p></figure>`;let u=rr(Math.max(...a.map(e=>e.commits))),d=i.lines===!0&&a.every(e=>e.additions!==null)?rr(Math.max(...a.flatMap(e=>[e.additions,e.deletions]))):null,f={agents:Kn(n.stats)&&a.some(e=>e.agents!==null),releases:qn(n.stats)&&a.some(e=>e.releases!==null)},p=f.agents||f.releases,m=n.weeks===1,h=Math.floor(t/F)*F,g=a[this._column]&&!a[this._column].future?this._column:null,_=a.findIndex(e=>e.from===this._picked),v=(e,r,i,o)=>D`<span class="${`pulse-column${r===g?` is-at`:``}${r===_?` is-picked`:``}${e.future?` is-future`:``}${e.day&&n.weeks===4&&[0,6].includes(new Date(e.from).getUTCDay())?` is-weekend`:``}`}" role="${i?`img`:k}" aria-label="${i?lr(e,t,f):k}" aria-hidden="${i?k:`true`}" @pointerenter="${()=>this.point(e.future?null:r)}" @click="${()=>this.pickColumn(a,r)}">${o}</span>`,y=(e,t)=>m&&!e.future?D`<span class="pulse-figure">${t}</span>`:k,b=(e,t,n=k)=>D`<span class="${`pulse-bar${e}`}" style="${E({"--value":`${t}`})}">${n}</span>`,x=e=>{let t=f.releases?e.releases:0,n=e.commits-t;return[...f.agents?[[``,e.agents],[` is-without`,n-e.agents]]:[[``,n]],[` is-release`,t]].map(([e,t])=>t>0?D`<span class="${`pulse-part${e}`}" style="${E({"--part":`${t}`})}"></span>`:k)};return D`<figure class="${`pulse-panel pulse-activity${m?` is-written`:``}`}" tabindex="0" aria-label="${`Commits${d?` and lines`:``} a ${o}${r?` by ${s}`:``}: the arrow keys read each ${o}, Enter picks it for its contributors`}" @keydown="${e=>this.readColumns(e,a)}" @focus="${e=>this.focusColumns(e,a)}" @blur="${()=>this.point(null)}"><figcaption class="pulse-head"><h3>Commits</h3>${c}${p?D`<span class="pulse-legend">${f.agents?D`<span class="pulse-key"></span>With agents<span class="pulse-key is-without"></span>Without`:k}${f.releases?D`<span class="pulse-key is-release"></span>Releases`:k}</span>`:k}</figcaption><div class="pulse-plots" @pointerleave="${()=>this.point(null)}"><div class="pulse-plot">${this.renderTicks(u.ticks.map(e=>[e/u.top,W(e),e===0]))}<div class="pulse-columns">${a.map((e,t)=>v(e,t,!0,D`${y(e,U(e.commits))}${p?b(` is-split`,e.commits/u.top,x(e)):b(``,e.commits/u.top)}`))}</div></div>${d?D`<div class="pulse-head is-sub"><h3>Lines</h3><span>added and removed a ${o}</span> <span class="pulse-legend"><span class="pulse-key is-added"></span>Added<span class="pulse-key is-removed"></span>Removed</span></div><div class="pulse-plot is-diverging">${this.renderTicks([[1,`+${W(d.top)}`],[.5,`0`,!0],[0,`\u2212${W(d.top)}`]])}<div class="pulse-columns">${a.map((e,t)=>v(e,t,!1,D`<span class="pulse-half">${y(e,`+${W(e.additions)}`)}${b(` is-added`,e.additions/d.top)}</span> <span class="pulse-half is-below">${b(` is-removed`,e.deletions/d.top)}${y(e,`\u2212${W(e.deletions)}`)}</span>`))}</div></div>`:i.lines===!1?D`<p class="pulse-note">GitHub doesn’t count lines added and removed in a repository of 10,000 commits or more.</p>`:i.lines===!0?D`<p class="pulse-note">GitHub counts this repository’s lines a week, not a day: the quarter and the year show them.</p>`:D`<p class="pulse-note" role="status">${this.renderWaiting(e,[`GitHub is still counting lines added and removed…`,`GitHub hasn’t counted lines added and removed yet.`,`Ask again`])}</p>`}<div class="${`pulse-axis${m?` is-each`:``}`}" aria-hidden="true">${a.map((e,t)=>D`<span class="${e.future?`is-future`:e.day&&e.from===h?`is-today`:``}">${ur(a,t,n.weeks)}</span>`)}</div>${g===null?k:this.renderTip(n,a,g,t,f,!r)}</div><span class="sr-only" aria-live="polite">${this._typed&&g!==null?lr(a[g],t,f):``}</span></figure>`}renderTip(e,t,n,r,i,a){let o=t[n],s=Math.floor(r/F)*F,[c,l,u]=nr(o,e.stats.contributors),d=a?Qn(e.stats.contributors,c,l).slice(0,bn):[],f=(n+.5)/t.length;return D`<div class="${`pulse-tip${f>.6?` is-left`:``}`}" style="${E({"--x":`${f}`})}" aria-hidden="true"><span class="pulse-tip-when">${cr(o,r)}${o.day?o.from===s?D`<span>today</span>`:k:r<o.to?D`<span>so far</span>`:k}</span> <span class="pulse-tip-row"><span class="${`pulse-tip-key${i.agents||i.releases?` is-none`:``}`}"></span><strong>${U(o.commits)}</strong> ${o.commits===1?`commit`:`commits`}</span> ${i.agents?D`<span class="pulse-tip-row"><span class="pulse-tip-key"></span><strong>${U(o.agents)}</strong> with agents</span>`:k} ${i.releases?D`<span class="pulse-tip-row"><span class="pulse-tip-key is-release"></span><strong>${U(o.releases)}</strong> ${o.releases===1?`release`:`releases`}</span>`:k} ${o.additions===null?k:D`<span class="pulse-tip-row"><span class="pulse-tip-key is-added"></span><strong>+${U(o.additions)}</strong> added</span> <span class="pulse-tip-row"><span class="pulse-tip-key is-removed"></span><strong>−${U(o.deletions)}</strong> removed</span>`} ${d.length>0?D`<span class="pulse-tip-people">${u?D`<span class="pulse-tip-note">Its week’s</span>`:k} ${d.map(e=>D`<span class="pulse-tip-person">${_r(e)}<strong>${U(e.commits)}</strong></span>`)}</span>`:k}</div>`}point(e){this._column=e,this._typed=!1}showPerson(e){this._person=e===this._person?null:e,this._column=null,this._allDirect=!1}pickColumn(e,t){let n=e[t];!n||n.future||(this._picked=this._picked===n.from?null:n.from,this._everyone=!1,this._allDirect=!1)}focusColumns(e,t){if(!e.target.matches?.(`:focus-visible`))return;let n=t.findIndex(e=>e.from===this._picked);this._column=n>=0?n:t.findLastIndex(e=>!e.future),this._typed=!0}readColumns(e,t){let n=t.flatMap((e,t)=>e.future?[]:[t]);if(n.length===0)return;let r=t.findIndex(e=>e.from===this._picked),i=n.indexOf(n.includes(this._column)?this._column:n.includes(r)?r:n.at(-1)),a={ArrowLeft:i-1,ArrowRight:i+1,Home:0,End:n.length-1}[e.key];if(a!==void 0)this._column=n[Math.min(Math.max(a,0),n.length-1)];else if(e.key===`Enter`||e.key===` `)this._column=n[i],this.pickColumn(t,n[i]);else if(e.key===`Escape`&&(this._picked!==null||this._column!==null))this._picked=null,this._column=null;else return;this._typed=!0,e.preventDefault()}renderTicks(e){return D`<div class="pulse-ticks" aria-hidden="true">${e.map(([e,t,n])=>D`<span class="${n?`is-zero`:k}" style="${E({"--at":`${e}`})}"><span>${t}</span></span>`)}</div>`}renderContributors(e,t){let{contributors:n}=e.stats,r=tr(e,t).find(e=>e.from===this._picked)??null,[i,a,o]=r?nr(r,n):[e.since,1/0,!1],s=Qn(n,i,a),c=s[0]?.commits??1,l=e.stats.lines===!0,u=r?o?`Week of ${K(i,or(i,t))}`:cr(r,t):null;return D`<figure class="pulse-panel pulse-people"><figcaption class="pulse-head"><h3>Contributors</h3>${u?D`<button type="button" class="pulse-picked" aria-label="${`${u}: show the whole period\u2019s`}" @click="${()=>{this._picked=null,this._everyone=!1}}">${u}<span aria-hidden="true">×</span></button>`:D`<span>by their commits in the period</span>`}</figcaption>${s.length===0?D`<p class="pulse-note">No commits ${r?o||!r.day?`that week`:`that day`:`in the period`}.</p>`:D`<ol class="${`pulse-ranks${this._person===null?``:` is-picking`}`}">${(this._everyone?s:s.slice(0,yn)).map(e=>D`<li class="${e.key===this._person?`is-person`:k}"><span class="pulse-rank-who"><button type="button" class="pulse-rank-name" aria-pressed="${String(e.key===this._person)}" @click="${()=>this.showPerson(e.key)}">${_r(e)}</button> ${e.login?D`<a class="pulse-rank-profile" href="${gr(e.login)}" target="_blank" rel="noopener noreferrer" aria-label="${`${ke(e.login,e.name)} on GitHub`}">${hr}</a>`:k}</span> <span class="pulse-rank-bar"><span style="${E({"--value":`${e.commits/c}`})}"></span><span class="pulse-rank-value">${U(e.commits)}</span></span> ${l?D`<span class="pulse-rank-lines"><span class="is-added">+${W(e.additions)}</span> <span class="is-removed">−${W(e.deletions)}</span></span>`:k}</li>`)}</ol>${s.length>yn?D`<button type="button" class="history-link pulse-more" @click="${()=>{this._everyone=!this._everyone}}">${this._everyone?`Fewer`:`and ${G(s.length-yn,`more`,`more`)}`}</button>`:k}`}</figure>`}renderPunch(e){let{punch:t}=e,n=Math.max(1,...t.flat());return D`<figure class="${`pulse-panel${e.otherPunch?` is-reading`:``}`}" aria-busy="${String(e.otherPunch===!0)}"><figcaption class="pulse-head"><h3>When commits are made</h3><span>by day and hour, in each author’s own time zone${e.periodPunch?``:`, not only the period’s`}</span></figcaption><div class="pulse-punch">${t.map((e,t)=>D`<span class="pulse-punch-day">${Sn[Cn[t]].slice(0,3)}</span>${e.map((e,r)=>{let i=`${Sn[Cn[t]]}s, ${String(r).padStart(2,`0`)}:00\u2013${String(r+1).padStart(2,`0`)}:00: ${G(e,`commit`)}`;return D`<span class="${`pulse-cell is-${e===0?0:Math.ceil(e/n*wn)}`}" role="img" aria-label="${i}" data-tooltip="${i}"></span>`})}`)} <span></span>${Array.from({length:24},(e,t)=>D`<span class="pulse-punch-hour">${t%6==0?`${t}h`:``}</span>`)}</div><div class="pulse-scale" aria-hidden="true">Fewer${Array.from({length:wn},(e,t)=>D`<span class="${`pulse-cell is-${t+1}`}"></span>`)}More</div></figure>`}renderLists(e,t,n){let r=e.stats?er(e.stats,e.since,1/0,null,n):null,i=r!==null&&r.count>0,a=e.closed&&e.created?e.closed.count+e.created.count:null,o=i&&t?er(e.stats,t.since??e.since,t.until??1/0,t.person??null,n)??{count:0,items:[]}:r;return[this.renderList(e,`pulls`,t),...i?[this.renderDirect(o,t)]:[],...i&&a===0?[]:[this.renderList(e,`issues`,t)]]}renderDirect(e,t){let n=this.repo??this.repository.repo,r=t?.who?ke(t.who.login,t.who.name):null,i=t?[r&&`by ${r}`,t.when].filter(Boolean).join(` `):``,a=t?[r&&`by ${r}`,t.when??`in the period`].filter(Boolean).join(` `):`in the period`,o=this._allDirect?e.items:e.items.slice(0,Ln),s=Math.max(0,e.count-e.items.length);return D`<section class="pulse-panel pulse-list" aria-label="Direct commits"><div class="pulse-head"><h3 data-tooltip="Commits pushed to the default branch, not merged from a pull request">Direct commits</h3>${t?D`<span class="pulse-narrowed">${i}</span>`:k}<span class="pulse-count">${U(e.count)}</span></div>${e.count===0?D`<p class="pulse-note">None ${a}.</p>`:D`<ol>${o.map(e=>D`<li><a class="${`pulse-item is-commit${e.kind?` is-${e.kind}`:``}`}" href="${n?`https://github.com/${n}/commit/${e.sha}`:k}" target="_blank" rel="noopener noreferrer"><span class="issue-state" role="img" aria-label="${e.kind?In[e.kind]:`Commit`}">${Fn}</span> <span class="pulse-item-title">${e.subject||`(no message)`}</span> <span class="pulse-item-meta"><span>${e.sha.slice(0,7)}</span><span>${_r(e)}</span><time datetime="${new Date(e.at).toISOString()}">${bt(e.at)}</time></span></a></li>`)}</ol>`} ${e.items.length>Ln?D`<button type="button" class="history-link pulse-more" @click="${()=>{this._allDirect=!this._allDirect}}">${this._allDirect?`Fewer`:`and ${G(e.items.length-Ln,`more`,`more`)}`}</button>`:k} ${s>0?D`<p class="pulse-note">${e.items.length>0?G(s,`older commit`,`older commits`):G(s,`commit`)} not listed.</p>`:k}</section>`}narrowing(e,t){let n=this._picked===null||!e.stats?null:tr(e,t).find(e=>e.from===this._picked)??null,r=this._person===null||!e.stats?null:e.stats.contributors.filter(e=>H(e)===this._person);if(!n&&!r)return null;let i=[...new Set((r??[]).flatMap(e=>e.login?[e.login]:[]))].slice(0,Rn);return{from:ar(n?.from??e.since),to:n?ar(n.to-F):null,authors:i,nobody:r!==null&&i.length===0,who:r?.[0]??null,when:n?n.day?`on ${cr(n,t)}`:`in the w${cr(n,t).slice(1)}`:null,since:n?.from??e.since,until:n?.to??1/0,person:r?this._person:null}}renderList(e,t,n=null){let[r,i]=Nn[t],[a,,o]=i.find(([e])=>e===Mn[t]),s=n&&!n.nobody?Gn(this.repository.repoId,e.weeks,n):null,c=n?s?.status===`ready`?s.answer:null:e,{count:l,items:u}=c?.[a]??{count:null,items:null},d=this.repo??this.repository.repo,f=n?n.to===null?`>=${n.from}`:`${n.from}..${n.to}`:`>=${ar(e.since)}`,p=(n?.authors??[]).map(e=>` author:${e.endsWith(`[bot]`)?`app/${e.slice(0,-5)}`:e}`).join(``),m=d?`https://github.com/${d}/${t===`pulls`?`pulls`:`issues`}?q=${encodeURIComponent(`${o}${f}${p}`)}`:null,h=n?.who?ke(n.who.login,n.who.name):null,g=n?[h&&`by ${h}`,n.when??`in the period`].filter(Boolean).join(` `):`in the period`,_=n?[h&&`by ${h}`,n.when].filter(Boolean).join(` `):``;return D`<section class="pulse-panel pulse-list" aria-label="${r}"><div class="pulse-head"><h3>${r}</h3>${n?D`<span class="pulse-narrowed">${_}</span>`:k}<div class="history-modes" role="group" aria-label="${`${r} shown`}">${i.map(([e,n])=>D`<button type="button" aria-pressed="${String(e===a)}" @click="${()=>this.showList(t,e)}">${n}<span class="n">${c?.[e]?U(c[e].count):`–`}</span></button>`)}</div></div>${n?.nobody?D`<p class="pulse-note">${h}’s commits name no GitHub account to find their ${r.toLowerCase()} by.</p>`:s?.status===`error`?D`<p class="pulse-note" role="alert">${s.error}</p>`:u===null?D`<p class="pulse-note" role="status">Reading…</p>`:u.length===0?D`<p class="pulse-note">None ${g}.</p>`:D`<ol>${u.map(e=>{let[n,r]=_e(t,e);return D`<li><a class="${`pulse-item is-${n}`}" href="${d?`https://github.com/${d}/${t===`pulls`?`pull`:`issues`}/${e.number}`:k}" target="_blank" rel="noopener noreferrer" @click="${n=>this.openItem(n,t,e)}"><span class="issue-state" role="img" aria-label="${r}">${le[t][n]}</span> <span class="pulse-item-title">${e.title||`(no title)`}</span> <span class="pulse-item-meta"><span>#${e.number}</span>${e.author?D`<span>${Ee(e.author)}</span>`:k} ${e.at==null?k:D`<time datetime="${new Date(e.at).toISOString()}">${bt(e.at)}</time>`}</span></a></li>`})}</ol>`} ${m&&u!==null&&l>u.length?D`<a class="pulse-all" href="${m}" target="_blank" rel="noopener noreferrer">All ${U(l)} on GitHub</a>`:k}</section>`}openItem(e,t,n){xe(e)&&(e.preventDefault(),Ae({repository:{...this.repository,repo:this.repo??this.repository.repo},target:{number:n.number,preview:{...n,kind:t,labels:[],comments:0}}}))}};customElements.get(`repository-pulse`)||customElements.define(`repository-pulse`,vr);var yr=864e5,br=[100,300,1e3];function xr(e,t){return Be(e).filter(e=>e.parents.length<=1&&Number.isFinite(e.committedAt)).slice(0,t).toReversed()}var Sr=1,Cr=.08,wr=.6;function Tr(e){let t=[];for(let[n,r]of e.entries()){let i=n===0?0:(r.committedAt-e[n-1].committedAt)/yr;t.push(n===0?0:t[n-1]+Math.min(wr,Math.max(Cr,i*Sr)))}return t}function Er(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n>0?t.slice(n+1).toLowerCase():``}function Dr(e,t,n){let r=new Set(e.values()),i=Array.from({length:n},(e,t)=>t).filter(e=>!r.has(e)),a=[...t].filter(([t])=>t!==``&&!e.has(t)).toSorted((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]));for(let[t]of a.slice(0,i.length))e.set(t,i.shift());return e}var Or=.9,kr=2,Ar=1,jr=5,Mr=1,Nr=.06;function Pr(){let e=Fr(``,null);return{root:e,dirs:new Map([[``,e]]),files:new Map,going:new Set,users:new Map,beams:[],due:[],layout:!0}}function Fr(e,t){return{path:e,name:e.slice(e.lastIndexOf(`/`)+1),parent:t,dirs:[],files:[],depth:t?t.depth+1:0,x:t?.x??0,y:t?.y??0,tx:t?.tx??0,ty:t?.ty??0,cluster:0,radius:0,node:[0,0],at:[0,0],lx:void 0,ly:void 0,packed:!1,dirty:!0,touched:-1/0}}function Ir(e,t){let n=e.dirs.get(t);if(n)return n;let r=t.lastIndexOf(`/`),i=Ir(e,r===-1?``:t.slice(0,r)),a=Fr(t,i),[o,s]=[0,i.dirs.length];for(;o<s;){let e=o+s>>1;i.dirs[e].name<a.name?o=e+1:s=e}return i.dirs.splice(o,0,a),e.dirs.set(t,a),$r(i),e.layout=!0,a}function Lr(e,t,n,r){let i=e.files.get(t);if(n===`D`&&!i)return null;if(!i){let a=t.lastIndexOf(`/`),o=Ir(e,a===-1?``:t.slice(0,a));i={path:t,name:t.slice(a+1),extension:Er(t),dir:o,ox:0,oy:0,touched:r,kind:n,removed:null},o.files.push(i),e.files.set(t,i),$r(o),e.layout=!0}i.touched=r,i.kind=n,i.removed=n===`D`?i.removed??r:null,n===`D`?e.going.add(i):e.going.delete(i);for(let e=i.dir;e;e=e.parent)e.touched=r;return i}function Rr(e,t){let{dir:n}=t;n.files.splice(n.files.indexOf(t),1),e.files.delete(t.path),e.going.delete(t);let r=n;for(;r.parent&&r.files.length===0&&r.dirs.length===0;r=r.parent)r.parent.dirs.splice(r.parent.dirs.indexOf(r),1),e.dirs.delete(r.path);$r(r),e.layout=!0}var zr=e=>e.flatMap(([e,t,n])=>t===`R`?[[n,`D`],[e,`A`]]:[[e,t]]);function Br(e,t,n,r,i){let a=t.map(t=>{let n=e.users.get(t.key)??{...t,x:NaN,y:NaN,active:r};return e.users.set(t.key,n),n.active=r,n}),o=zr(n),s=o.length>1?Math.min(Nr,i/o.length):0;for(let[t,[n,i]]of o.entries())e.due.push({at:r+t*s,path:n,kind:i,users:a});e.due.sort((e,t)=>e.at-t.at)}function Vr(e,t){for(let[n,r]of zr(t)){let t=Lr(e,n,r,-1/0);t&&r===`D`&&Rr(e,t)}}function Hr(e,t,n,r=[]){let i=new Set([...e.files.values()].filter(e=>e.removed===null).map(e=>e.path));for(let[t,n]of[...e.due.map(e=>[e.path,e.kind]),...r])n===`D`?i.delete(t):i.add(t);let a=new Set(t);return[...t.filter(e=>!i.has(e)).map(e=>[e,`A`]),...n?[]:[...i].filter(e=>!a.has(e)).map(e=>[e,`D`])]}function Ur(e,t){let n=0;for(;n<e.due.length&&e.due[n].at<=t;n++){let{at:t,path:r,kind:i,users:a}=e.due[n],o=Lr(e,r,i,t);if(o)for(let n of a)e.beams.push({user:n,file:o,kind:i,at:t})}n>0&&e.due.splice(0,n),e.beams=e.beams.filter(e=>t-e.at<Or);for(let n of[...e.going])t-n.removed>=Ar&&Rr(e,n);for(let[n,r]of e.users)t-r.active>jr+Mr&&e.users.delete(n)}var Wr=6,Gr=2.2,Kr=12,qr=Math.PI*(3-Math.sqrt(5)),Jr=46,Yr=34,Xr=e=>e===0?0:Wr*.62*Math.sqrt(e)+Gr;function Zr(e){let t=Wr*.62*Math.sqrt(e+.5);return[t*Math.cos(e*qr),t*Math.sin(e*qr)]}function Qr(e){ei(e.root),ti(e.root,-e.root.node[0],-e.root.node[1],0),e.layout=!1}function $r(e){for(let t=e;t&&!t.dirty;t=t.parent)t.dirty=!0}function ei(e){if(!e.dirty)return;for(let t of e.dirs)ei(t);e.cluster=Math.max(Xr(e.files.length),Gr)+Kr/2;let t={x:0,y:0,r:e.cluster},n=e.dirs.map(e=>({child:e,x:e.lx,y:e.ly,r:e.radius}));if(e.packed)mi(t,n);else{ni([t,...n.toSorted((e,t)=>t.r-e.r||(e.child.name<t.child.name?-1:1))]);for(let e of n)[e.x,e.y]=[e.x-t.x,e.y-t.y];[t.x,t.y]=[0,0]}let r=si([t,...n]);e.radius=r.r,e.node=[-r.x,-r.y];for(let e of n)[e.child.lx,e.child.ly]=[e.x,e.y],e.child.at=[e.x-r.x,e.y-r.y];e.packed=!0,e.dirty=!1}function ti(e,t,n,r){let[i,a]=[Math.cos(r),Math.sin(r)],o=([e,r])=>[t+e*i-r*a,n+e*a+r*i];[e.tx,e.ty]=o(e.node);for(let t of e.dirs){let[n,r]=o(t.at);ti(t,n,r,Math.atan2(r-e.ty,n-e.tx))}}function ni(e){let[t,n,r]=e;if(!t||([t.x,t.y]=[0,0],!n)||([t.x,n.x,n.y]=[-n.r,t.r,0],!r))return;ri(n,t,r);let i={c:t},a={c:n},o={c:r};i.next=o.previous=a,a.next=i.previous=o,o.next=a.previous=i;t:for(let t=3;t<e.length;t++){let n=e[t];ri(i.c,a.c,n);let r=a.next,o=a.c.r,s=i.previous,c=i.c.r;do if(o<=c){if(ii(r.c,n)){a=r,i.next=a,a.previous=i,t--;continue t}o+=r.c.r,r=r.next}else{if(ii(s.c,n)){i=s,i.next=a,a.previous=i,t--;continue t}c+=s.c.r,s=s.previous}while(r!==s.next);let l={c:n,previous:i,next:a};i.next=a.previous=a=l;let u=ai(i);for(let e=l.next;e!==a;e=e.next){let t=ai(e);t<u&&([i,u]=[e,t])}a=i.next}}function ri(e,t,n){let[r,i]=[e.x-t.x,e.y-t.y],a=r*r+i*i;if(!a){[n.x,n.y]=[t.x+n.r,t.y];return}let o=(t.r+n.r)**2,s=(e.r+n.r)**2;if(o>s){let t=(a+s-o)/(2*a),c=Math.sqrt(Math.max(0,s/a-t*t));[n.x,n.y]=[e.x-t*r-c*i,e.y-t*i+c*r]}else{let e=(a+o-s)/(2*a),c=Math.sqrt(Math.max(0,o/a-e*e));[n.x,n.y]=[t.x+e*r-c*i,t.y+e*i+c*r]}}var ii=(e,t)=>{let n=e.r+t.r-1e-6;return n>0&&n*n>(t.x-e.x)**2+(t.y-e.y)**2};function ai(e){let[t,n]=[e.c,e.next.c],r=t.r+n.r;return((t.x*n.r+n.x*t.r)/r)**2+((t.y*n.r+n.y*t.r)/r)**2}var oi=64;function si(e){let t=e.toSorted((e,t)=>J(`${e.x},${e.y}`)-J(`${t.x},${t.y}`)),n=[],r=null,i=0;for(let a=0;a<t.length;a++)if(!(r&&di(r,t[a]))){if(n=li(n,t[a]),r=q(n),!Number.isFinite(r.x+r.y+r.r)||++i>oi*t.length)return ci(e);a=-1}return r}function ci(e){let[t,n]=[0,1].map(t=>{let n=e.flatMap(e=>t===0?[e.x-e.r,e.x+e.r]:[e.y-e.r,e.y+e.r]);return(Math.min(...n)+Math.max(...n))/2});return{x:t,y:n,r:Math.max(...e.map(e=>Math.hypot(e.x-t,e.y-n)+e.r))}}function li(e,t){if(e.every(e=>di(t,e)))return[t];for(let n of e)if(!ui(t,n)&&e.every(e=>di(q([n,t]),e)))return[n,t];for(let[n,r]of e.entries())for(let i of e.slice(n+1))if(!ui(q([r,i]),t)&&!ui(q([r,t]),i)&&!ui(q([i,t]),r)&&e.every(e=>di(q([r,i,t]),e)))return[r,i,t];return[...e,t].length<=3?[...e,t]:[t]}var ui=(e,t)=>e.r-t.r>=0&&(e.r-t.r)**2>=(t.x-e.x)**2+(t.y-e.y)**2;function di(e,t){let n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9;return n>0&&n*n>(t.x-e.x)**2+(t.y-e.y)**2}function q([e,t,n]){if(!t)return{x:e.x,y:e.y,r:e.r};if(!n){let[n,r,i]=[t.x-e.x,t.y-e.y,t.r-e.r],a=Math.hypot(n,r)||1e-12;return{x:(e.x+t.x+n/a*i)/2,y:(e.y+t.y+r/a*i)/2,r:(a+e.r+t.r)/2}}let[r,i,a,o,s,c]=[e.x-t.x,e.x-n.x,e.y-t.y,e.y-n.y,t.r-e.r,n.r-e.r],l=e.x**2+e.y**2-e.r**2,[u,d]=[l-t.x**2-t.y**2+t.r**2,l-n.x**2-n.y**2+n.r**2],f=i*a-r*o,[p,m,h,g]=[(a*d-o*u)/(f*2)-e.x,(o*s-a*c)/f,(i*u-r*d)/(f*2)-e.y,(r*c-i*s)/f],[_,v,y]=[m**2+g**2-1,2*(e.r+p*m+h*g),p**2+h**2-e.r**2],b=-(Math.abs(_)>1e-6?(v+Math.sqrt(v*v-4*_*y))/(2*_):y/v);return{x:e.x+p+m*b,y:e.y+h+g*b,r:b}}var fi=60,pi=.5;function mi(e,t){let n=t.filter(e=>e.x!==void 0);for(let r of t)r.x===void 0&&(hi(r,e,n),n.push(r));for(let n=0;n<fi;n++){let n=!1;for(let r of t){let t=Math.hypot(r.x,r.y),i=e.r+r.r;if(t>=i-pi)continue;let a=t>1e-6?Math.atan2(r.y,r.x):J(r.child.name);[r.x,r.y]=[Math.cos(a)*i,Math.sin(a)*i],n=!0}let r=t.toSorted((e,t)=>e.x-e.r-(t.x-t.r));for(let[e,t]of r.entries())for(let i=e+1;i<r.length&&r[i].x-r[i].r<t.x+t.r;i++){let e=r[i],a=t.r+e.r,[o,s]=[e.x-t.x,e.y-t.y];if(Math.abs(s)>=a-pi)continue;let c=Math.hypot(o,s);if(c>=a-pi)continue;let l=c>1e-6?Math.atan2(s,o):J(e.child.name),[u,d]=[e.r**2,t.r**2].map(n=>n/(t.r**2+e.r**2)*(a-c));[t.x,t.y]=[t.x-Math.cos(l)*u,t.y-Math.sin(l)*u],[e.x,e.y]=[e.x+Math.cos(l)*d,e.y+Math.sin(l)*d],n=!0}if(!n)return}}function hi(e,t,n){let r=r=>Math.hypot(r.x,r.y)>=t.r+e.r-pi&&n.every(t=>Math.hypot(t.x-r.x,t.y-r.y)>=t.r+e.r-pi),i=[],a=(t,n)=>{for(let[r,a]of[[t,n],[n,t]]){let t={r:e.r};ri(r,a,t),i.push(t)}};for(let e of n)a(t,e);let o=n.toSorted((e,t)=>e.x-e.r-(t.x-t.r));for(let[t,n]of o.entries())for(let r=t+1;r<o.length&&o[r].x-o[r].r<n.x+n.r+2*e.r;r++){let t=o[r];Math.hypot(t.x-n.x,t.y-n.y)<n.r+t.r+2*e.r&&a(n,t)}let s=J(e.child.name);n.length===0&&i.push({x:Math.cos(s)*(t.r+e.r),y:Math.sin(s)*(t.r+e.r)});let c=null;for(let e of i)r(e)&&(!c||Math.hypot(e.x,e.y)<Math.hypot(c.x,c.y))&&(c=e);let l=Math.max(t.r,...n.map(e=>Math.hypot(e.x,e.y)+e.r))+e.r;[e.x,e.y]=c?[c.x,c.y]:[Math.cos(s)*l,Math.sin(s)*l]}function gi(e,t,n=Yr){let r=e=>1-Math.exp(-t*e),i=r(3),a=r(6),o=r(2.5);for(let t of e.dirs.values()){t.x+=(t.tx-t.x)*i,t.y+=(t.ty-t.y)*i;for(let[e,n]of t.files.entries()){let[t,r]=Zr(e);n.ox+=(t-n.ox)*a,n.oy+=(r-n.oy)*a}}let s=new Map;for(let{user:t,file:n}of e.beams){let e=s.get(t)??s.set(t,{x:0,y:0,count:0}).get(t);e.x+=n.dir.x+n.ox,e.y+=n.dir.y+n.oy,e.count++}for(let[e,t]of s){let[n,r]=[t.x/t.count,t.y/t.count];if(Number.isNaN(e.x)){let t=J(e.key);[e.x,e.y]=[n+Math.cos(t)*Jr*3,r+Math.sin(t)*Jr*3]}let i=Math.hypot(e.x-n,e.y-r)||1,[a,s]=[n+(e.x-n)/i*Jr,r+(e.y-r)/i*Jr];e.x+=(a-e.x)*o,e.y+=(s-e.y)*o}let c=[...e.users.values()].filter(e=>!Number.isNaN(e.x));for(let[e,t]of c.entries())for(let r of c.slice(e+1)){let[e,i]=[r.x-t.x,r.y-t.y],a=Math.hypot(e,i);if(a>=n)continue;let[s,c]=a>0?[e/a,i/a]:[Math.cos(J(r.key)),Math.sin(J(r.key))],l=(n-a)/2*o;[t.x,t.y,r.x,r.y]=[t.x-s*l,t.y-c*l,r.x+s*l,r.y+c*l]}}function J(e){let t=0;for(let n of e)t=t*31+n.codePointAt(0)|0;return(t>>>0)/2**32*2*Math.PI}function _i(e){e.layout&&Qr(e);for(let t of e.dirs.values()){t.x=t.tx,t.y=t.ty;for(let[e,n]of t.files.entries())[n.ox,n.oy]=Zr(e)}}function vi(e){let t={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},n=(e,n,r)=>{t.minX=Math.min(t.minX,e-r),t.minY=Math.min(t.minY,n-r),t.maxX=Math.max(t.maxX,e+r),t.maxY=Math.max(t.maxY,n+r)};for(let t of e.dirs.values())n(t.x,t.y,Xr(t.files.length)+Gr);for(let t of e.users.values())Number.isNaN(t.x)||n(t.x,t.y,14);return t}var yi=[.5,1,2,4,8],bi=20,xi=50,Si=8,Ci={side:40,top:64,bottom:40},wi=3,Ti=10,Y=11,Ei=72,Di=250,Oi=1.8,ki=2,Ai=new Set([`A`,`M`,`D`,`R`]),ji=new Map,Mi=new Map,Ni=new Set,Pi=new Map,Fi=new Set,Ii=new Map,Li=null,Ri=()=>Number(x(`replay`)??300),zi=1;function Bi(){let e=T.managedSession?`${T.managedSession.id}\0${T.managedSession.role}`:null;return e!==Li&&(ji.clear(),Mi.clear(),Ni.clear(),Pi.clear(),Li=e),ji}var Vi=()=>{for(let e of Fi)e.requestUpdate()};S(e=>{e===`replay`&&Vi()});var Hi=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0;function Ui(e,t){let{repoId:n,commit:r,path:i}=e,a=`${n}\0${r}\0${i}\0${t}`,o=Bi().get(a);if(o)return o;let s={key:a,repoId:n,path:i,count:t,commits:null,times:[],reading:!1,treeReading:!1,error:null,counted:``,counts:new Map,colors:new Map,people:null,scene:Pr(),clock:0,next:0,playing:!1,waiting:!1,ended:!1,started:!1};return ji.set(a,s),s}var Wi={files:[],cut:!1},Gi=e=>e.commits[0]?.parents[0]??null,Ki=e=>`${e.repoId}\0${e.path}\0${Gi(e)}`,X=e=>Gi(e)?Pi.get(Ki(e)):Wi,Z=(e,t)=>`${e.repoId}\0${e.path}\0${t}`,qi=(e,t)=>Mi.get(Z(e,t)),Ji=(e,t)=>Ni.has(Z(e,t)),Yi=(e,t)=>Pi.get(Z(e,t)),Xi=(e,t)=>!(!qi(e,t.sha)||Ji(e,t.sha)&&!Yi(e,t.sha));function Zi(e){let t=0;for(;t<(e.commits?.length??0)&&Xi(e,e.commits[t]);)t++;return t}function Qi(e,t){if(!Array.isArray(e)||!Ai.has(e[1]))return null;let n=e=>typeof e==`string`&&(t===``||e.startsWith(`${t}/`))?e.slice(t===``?0:t.length+1):null,[r,i,a]=[n(e[0]),e[1],n(e[2])];return!r||i===`R`&&!a?null:i===`R`?[r,i,a]:[r,i]}function $i(e){let t=X(e),n=e.commits.filter(t=>qi(e,t.sha)),r=`${t?t.files.length:`-`}\0${n.length}`;if(r===e.counted)return;e.counted=r,e.counts=new Map;let i=t=>e.counts.set(Er(t),(e.counts.get(Er(t))??0)+1);for(let e of t?.files??[])i(e);for(let t of n)for(let[n,r]of zr(qi(e,t.sha)))r!==`D`&&i(n);Dr(e.colors,e.counts,Si)}function ea(e){if(e.treeReading||e.error)return;let t=[...e.commits.slice(e.next),...e.commits.slice(0,e.next)],n=Gi(e)&&!X(e),r=n?Gi(e):t.find(t=>Ji(e,t.sha)&&!Yi(e,t.sha))?.sha;if(!r)return;e.treeReading=!0;let i=Z(e,r);f(e.repoId,e.path,r).then(t=>{if(Bi().get(e.key)!==e)return null;let r=Array.isArray(t?.files)?t.files.map(t=>Qi([t,`A`],e.path)?.[0]).filter(Boolean):[];return Pi.set(i,{files:r,cut:t?.cut===!0||!n&&!Array.isArray(t?.files)}),null},t=>(t?.name!==`AbortError`&&(e.error=t?.message||(n?`The files the commits start from could not be read.`:`The files a commit leaves could not be read.`)),null)).finally(()=>{e.treeReading=!1,Vi()})}function ta(e,t,n){let r=qi(e,n.sha),i=Ji(e,n.sha)?Yi(e,n.sha):null;return i?[...r,...Hr(t,i.files,i.cut,zr(r))]:r}function na(e,t){let n=Pr();n.start=X(e),Vr(n,n.start.files.map(e=>[e,`A`]));for(let r of e.commits.slice(0,t))Vr(n,ta(e,n,r));return _i(n),n}function ra(e){if(e.reading||e.error||!e.commits)return;let t=Zi(e)===0?bi:xi,n=[...e.commits.slice(e.next),...e.commits.slice(0,e.next)].filter(t=>!qi(e,t.sha)).slice(0,t).map(e=>e.sha);n.length!==0&&(e.reading=!0,u(e.repoId,e.path,n).then(t=>{if(Bi().get(e.key)!==e)return null;let r=new Map((Array.isArray(t?.changes)?t.changes:[]).filter(e=>typeof e?.sha==`string`).map(e=>[e.sha,e]));for(let t of n)Mi.set(Z(e,t),Array.isArray(r.get(t)?.files)?r.get(t).files.map(t=>Qi(t,e.path)).filter(Boolean):[]),r.get(t)?.more===!0&&Ni.add(Z(e,t));return null},t=>(t?.name!==`AbortError`&&(e.error=t?.message||`What the commits changed could not be read.`),null)).finally(()=>{e.reading=!1,Vi()}))}function ia(e){let t=new Map;for(let{login:n=null,name:r=null,agent:i=null}of[{login:e.authorLogin,name:e.authorName},...e.coauthors??[]]){if(typeof n!=`string`&&typeof r!=`string`)continue;let e=typeof i==`string`&&Object.hasOwn(w,i)?i:De(n,r),a=e?null:Ce(n),o=e?`agent:${e}`:a?`user:${a.id}`:typeof n==`string`?`login:${n.toLowerCase()}`:`name:${r.toLowerCase()}`;if(t.has(o))continue;let s=e?w[e].name:a?a.name??a.login:r??n,c=e?w[e].mark??null:null,l=e?!c&&w[e].avatar?`/api/avatar/${w[e].avatar}`:null:a?`/api/avatar/${encodeURIComponent(a.id)}`:null;t.set(o,{key:o,label:s,letter:s.trim()[0]?.toUpperCase()??`?`,agent:e,mark:c,image:l})}return[...t.values()]}var aa={anthropic:[Fe,4,5,8],openai:[Ie,4,5,8],"github-copilot":[Le,0,0,24]},oa={claude:[`#d97757`,`#fff`],codex:[`#fff`,`#000`],copilot:[`#0d1117`,`#fff`]},sa=new Map,ca=e=>sa.get(e)??sa.set(e,new Path2D(aa[e][0])).get(e);function la(e){let t=Ii.get(e);return t||(t=new Image,t.decoding=`async`,t.src=e,Ii.set(e,t)),t.complete&&t.naturalWidth>0?t:null}var Q=e=>e.toLocaleString(`en-US`),$=e=>new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),ua=e=>e===.5?`½×`:`${e}\xD7`,da=O`<path d="M5 3.25v9.5L12.75 8z" fill="currentColor"/>`,fa=O`<path d="M5.25 3.5v9M10.75 3.5v9"/>`,pa=O`<path d="M3.25 8a4.75 4.75 0 1 0 1.4-3.36M3.25 2.5v2.75H6"/>`,ma=class extends Re{static properties={repository:{attribute:!1},repo:{attribute:!1}};createRenderRoot(){return this}constructor(){super(),this.repository=null,this.repo=null,this.replay=null,this._frame=null,this._last=0,this._camera=null,this._colors=null,this._themes=null,this._resize=null,this._restless=0,this._laidOut=-1/0,this._pointer=null,this._hovered=null,this._shownNext=-1}connectedCallback(){super.connectedCallback(),Fi.add(this),jt(this),this._themes=new AbortController,globalThis.addEventListener(`deepview-theme-changed`,()=>this.themeChanged(),{signal:this._themes.signal}),this._resize=globalThis.ResizeObserver?new ResizeObserver(()=>{this.restless()}):null,this._resize?.observe(this),this._last=performance.now(),this._frame=requestAnimationFrame(e=>this.frame(e))}disconnectedCallback(){super.disconnectedCallback(),Fi.delete(this),Mt(this),this._themes?.abort(),this._resize?.disconnect(),cancelAnimationFrame(this._frame),this._frame=null,this.replay&&![...Fi].some(e=>e.replay===this.replay)&&(this.replay.playing=!1)}updated(){let e=this.replay;if(!e)return;if(this.restless(),!e.commits){let{entry:t,more:n}=At(this.repository);if(t.status!==`ready`)return;if(t.commits.filter(e=>e.parents.length<=1&&Number.isFinite(e.committedAt)).length<e.count&&t.more){!t.loadingMore&&!t.moreError&&n();return}e.commits=xr(t.commits,e.count),e.times=Tr(e.commits)}ea(e),ra(e);let t=X(e);t&&($i(e),e.scene.start!==t&&this.seek(e.next),!e.started&&Zi(e)>0&&(e.started=!0,e.playing=!Hi(),this.requestUpdate()))}pickCount(e){oe(this.repository,`replay`,String(e))}pickSpeed(e){zi=e,Vi()}toggle(){let e=this.replay;e?.commits?.length&&(e.ended?(this.seek(0),e.playing=!0):e.playing=!e.playing,e.started=!0,this.requestUpdate())}seek(e){let t=this.replay;if(!t?.commits||!X(t))return;let n=Math.max(0,Math.min(e,Zi(t)));Object.assign(t,{scene:na(t,n),next:n,clock:n>0?t.times[n-1]:-.001,ended:!1,waiting:!1}),this._camera=null,this.requestUpdate()}restless(){this._restless=performance.now()+3e3}themeChanged(){this.readColors(),this.restless(),this.replay&&this.draw(this.replay,0)}frame(e){this._frame=requestAnimationFrame(e=>this.frame(e));let t=Math.min(.1,Math.max(0,(e-this._last)/1e3));this._last=e;let n=this.replay;n&&(n.playing&&n.commits&&this.play(n,t),n.next!==this._shownNext&&(this._shownNext=n.next,this.requestUpdate()),this._colors||this.readColors(),(n.playing||e<this._restless)&&(Ur(n.scene,n.clock),n.scene.layout&&e-this._laidOut>=Di&&(Qr(n.scene),this._laidOut=e),gi(n.scene,t,Math.max(Yr,Ei/(this._camera?.zoom??1))),this.draw(n,t)))}play(e,t){let n=e.clock+t*zi,r=e.waiting;for(e.waiting=!1;e.next<e.commits.length&&e.times[e.next]<=n;){let t=e.commits[e.next];if(!Xi(e,t)){n=e.times[e.next],e.waiting=!0;break}let r=e.times[e.next],i=(e.times[e.next+1]??r+wr)-r;Br(e.scene,ia(t),ta(e,e.scene,t),r,i*.8),e.next++}e.clock=n,e.next>=e.commits.length&&n>(e.times.at(-1)??0)+ki&&(e.playing=!1,e.ended=!0),(r!==e.waiting||e.ended)&&this.requestUpdate()}readColors(){let e=this.querySelector(`.replay-swatches`);if(!e)return;let t=t=>getComputedStyle(e.querySelector(`.is-${t}`)).color,n={background:t(`background`),text:t(`text`),muted:t(`muted`),surface:t(`surface`),added:t(`added`),modified:t(`modified`),removed:t(`removed`),kinds:Array.from({length:Si},(e,n)=>t(`kind-${n}`)),font:getComputedStyle(this).fontFamily},r=Object.assign(document.createElement(`canvas`),{width:1,height:1}).getContext(`2d`,{willReadFrequently:!0});n.pixels=new Map([n.muted,...n.kinds].map(e=>(r.clearRect(0,0,1,1),r.fillStyle=e,r.fillRect(0,0,1,1),[e,[...r.getImageData(0,0,1,1).data]]))),this._colors=n}draw(e,t){let n=this.querySelector(`canvas`),r=this._colors;if(!n||!r)return;let{clientHeight:i,clientWidth:a}=n;if(a===0||i===0)return;let o=globalThis.devicePixelRatio||1;(n.width!==Math.round(a*o)||n.height!==Math.round(i*o))&&(n.width=Math.round(a*o),n.height=Math.round(i*o));let s=n.getContext(`2d`);if(!s)return;s.setTransform(o,0,0,o,0,0),s.clearRect(0,0,a,i);let{scene:c,clock:l}=e,u=this.aim(c,a,i,t),d=e=>(e-u.x)*u.zoom+a/2,f=e=>(e-u.y)*u.zoom+i/2,p=e=>d(e.dir.x+e.ox),m=e=>f(e.dir.y+e.oy);s.lineCap=`round`,s.strokeStyle=r.muted,s.globalAlpha=.35,s.lineWidth=Math.max(1,Math.min(2.5,1.5*u.zoom)),s.beginPath();for(let e of c.dirs.values())e.parent&&(s.moveTo(d(e.parent.x),f(e.parent.y)),s.lineTo(d(e.x),f(e.y)));s.stroke();let h=Math.max(1.2,Gr*u.zoom),g=h<Oi,_=t=>e.colors.has(t.extension)?r.kinds[e.colors.get(t.extension)]:r.muted,v=[],y=new Map;for(let e of c.files.values()){if(e.removed!==null||l-e.touched<kr){v.push(e);continue}let[t,n]=[p(e),m(e)];if(t<-h||n<-h||t>a+h||n>i+h)continue;let r=_(e);(y.get(r)??y.set(r,[]).get(r)).push(t,n)}if(g)s.globalAlpha=1,s.drawImage(this.dotLayer(n,y,o,h*o,.85),0,0,a,i);else{s.globalAlpha=.85;for(let[e,t]of y){s.fillStyle=e,s.beginPath();for(let e=0;e<t.length;e+=2)s.moveTo(t[e]+h,t[e+1]),s.arc(t[e],t[e+1],h,0,2*Math.PI);s.fill()}}for(let e of v){let t=Math.max(0,1-(l-e.touched)/kr),n=e.removed===null?1:Math.max(0,1-(l-e.removed)/Ar);s.globalAlpha=.85*n+.15*t,s.fillStyle=_(e),s.beginPath(),s.arc(p(e),m(e),h*(1+t)*n,0,2*Math.PI),s.fill()}s.lineWidth=1.5;for(let e of c.beams)Number.isNaN(e.user.x)||(s.globalAlpha=Math.max(0,1-(l-e.at)/Or)*.85,s.strokeStyle=e.kind===`A`?r.added:e.kind===`D`?r.removed:r.modified,s.beginPath(),s.moveTo(d(e.user.x),f(e.user.y)),s.lineTo(p(e.file),m(e.file)),s.stroke());let b=(e,t,n)=>{s.strokeText(e,t,n),s.fillText(e,t,n)};s.lineJoin=`round`,s.globalAlpha=1,s.textBaseline=`middle`,s.font=`11px ${r.font}`,s.fillStyle=r.muted,s.strokeStyle=r.background,s.lineWidth=3;for(let e of c.dirs.values())!e.parent||e.depth>1&&l-e.touched>kr||b(e.name,d(e.x)+Math.max(6,(Xr(e.files.length)+3)*u.zoom),f(e.y));let x=v.filter(e=>e.removed===null);if(x.length<=Ti){s.fillStyle=r.text;for(let e of x)s.globalAlpha=Math.max(0,1-(l-e.touched)/kr),b(e.name,p(e)+h*2+3,m(e))}s.textAlign=`center`;for(let e of c.users.values()){if(Number.isNaN(e.x))continue;let[t,n]=[d(e.x),f(e.y)];s.globalAlpha=Math.max(0,Math.min(1,1-(l-e.active-jr)/Mr));let[i,a]=Object.hasOwn(oa,e.agent)?oa[e.agent]:[r.surface,r.text];s.fillStyle=i,s.beginPath(),s.arc(t,n,Y,0,2*Math.PI),s.fill();let o=e.image?la(e.image):null;if(e.mark&&Object.hasOwn(aa,e.mark)){let[,r,i,o]=aa[e.mark],c=Y*2*.62;s.save(),s.translate(t-c/2,n-c/2),s.scale(c/o,c/o),s.translate(-r,-i),s.fillStyle=a,s.fill(ca(e.mark)),s.restore(),s.beginPath(),s.arc(t,n,Y,0,2*Math.PI)}else o?(s.save(),s.clip(),s.drawImage(o,t-Y,n-Y,Y*2,Y*2),s.restore()):(s.fillStyle=r.text,s.font=`600 11px ${r.font}`,s.fillText(e.letter,t,n+.5));s.strokeStyle=r.muted,s.lineWidth=1,s.stroke(),s.fillStyle=r.text,s.strokeStyle=r.background,s.lineWidth=3,s.font=`11px ${r.font}`,b(e.label,t,n+Y+9)}s.textAlign=`start`,s.globalAlpha=1,this.hover(c,d,f,p,m,h)}dotLayer(e,t,n,r,i){let[a,o]=[e.width,e.height];if(this._dots?.wide!==a||this._dots?.high!==o){let e=new ImageData(a,o);this._dots={wide:a,high:o,image:e,pixels:new Uint32Array(e.data.buffer),layer:Object.assign(document.createElement(`canvas`),{width:a,height:o})}}let{image:s,pixels:c,layer:l}=this._dots;c.fill(0);for(let[e,s]of t){let[t,l,u,d]=this._colors.pixels.get(e)??[128,128,128,255],f=(Math.round(d*i)<<24|u<<16|l<<8|t)>>>0;for(let e=0;e<s.length;e+=2){let t=s[e]*n,i=s[e+1]*n,l=Math.max(0,Math.round(t-r)),u=Math.min(a,Math.round(t+r)),d=Math.min(o,Math.round(i+r));for(let e=Math.max(0,Math.round(i-r));e<d;e++)for(let t=e*a+l,n=e*a+u;t<n;t++)c[t]=f}}return l.getContext(`2d`).putImageData(s,0,0),l}aim(e,t,n,r){let i=vi(e),a=Number.isFinite(i.minX),o=a?Math.max(.02,Math.min(wi,(t-2*Ci.side)/Math.max(1,i.maxX-i.minX),(n-Ci.top-Ci.bottom)/Math.max(1,i.maxY-i.minY))):1,s={x:a?(i.minX+i.maxX)/2:0,y:a?(i.minY+i.maxY)/2-(Ci.top-Ci.bottom)/2/o:0,zoom:o};if(this._camera){let e=1-Math.exp(-r*1.8);this._camera.x+=(s.x-this._camera.x)*e,this._camera.y+=(s.y-this._camera.y)*e,this._camera.zoom=Math.exp(Math.log(this._camera.zoom)+(Math.log(s.zoom)-Math.log(this._camera.zoom))*e)}else this._camera=s;return this._camera}hover(e,t,n,r,i,a){let o=this._pointer,s=null;if(o){let c=(e,t)=>Math.hypot(e-o.x,t-o.y),l=[...e.users.values()].find(e=>!Number.isNaN(e.x)&&c(t(e.x),n(e.y))<=Y+2),u=a+4,d=null;if(!l)for(let t of e.files.values()){let e=c(r(t),i(t));e<=u&&([u,d]=[e,t])}let f=l||d?null:[...e.dirs.values()].find(e=>e.parent&&c(t(e.x),n(e.y))<=6);s=l?l.label:d?this.pathName(d.path):f?`${this.pathName(f.path)}/`:null}let c=s?{text:s,x:o.x,y:o.y}:null;(c?.text!==this._hovered?.text||c?.x!==this._hovered?.x||c?.y!==this._hovered?.y)&&(this._hovered=c,this.requestUpdate())}pathName(e){return this.repository.path?`${this.repository.path}/${e}`:e}pointer(e){let t=e.currentTarget.getBoundingClientRect();this._pointer=e.type===`pointerleave`?null:{x:e.clientX-t.left,y:e.clientY-t.top},this.restless()}render(){if(!this.repository)return k;let e=Ui(this.repository,Ri());this.replay&&this.replay!==e&&(this.replay.playing=!1),this.replay=e;let t=e.commits?null:At(this.repository),n=e.commits?.length??0,r=Zi(e),i=e.next>0?e.commits[e.next-1]:null,a=e.commits?e.people??=new Set(e.commits.flatMap(e=>ia(e).map(e=>e.key))).size:0,o=(e.commits?X(e):null)?.cut||e.commits?.some(t=>Ji(e,t.sha)&&Yi(e,t.sha)?.cut),s=e.commits&&n>0?`${Q(n)} commit${n===1?``:`s`} by ${Q(a)}, ${$(e.commits[0].committedAt)} \u2013 ${$(e.commits.at(-1).committedAt)}${o?`, drawn in part: more files than are read`:``}`:``;return D`<div class="history-bar">${ce(`replay`)}<div class="history-modes" role="group" aria-label="Commits played">${br.map(t=>D`<button type="button" aria-pressed="${String(e.count===t)}" @click="${()=>this.pickCount(t)}">Last ${Q(t)}</button>`)}</div>${s?D`<span class="history-summary">${s}</span>`:k}</div><div class="replay-stage"><canvas class="replay-canvas" role="img" aria-label="${i?`The repository\u2019s files as of ${$(i.committedAt)}, ${Q(e.next)} of ${Q(n)} commits played`:`The repository’s files, as its commits change them`}" @pointermove="${this.pointer}" @pointerleave="${this.pointer}"></canvas>${i?D`<div class="replay-day"><time datetime="${new Date(i.committedAt).toISOString()}">${$(i.committedAt)}</time> <span>${Q(e.next)} of ${Q(n)}</span></div>${this.renderCommit(i)}`:k} ${this.renderKey(e)} ${this.renderStatus(e,t,r)} ${this._hovered?D`<div class="replay-tip" style="${E({left:`${this._hovered.x}px`,top:`${this._hovered.y}px`})}">${this._hovered.text}</div>`:k}<div class="replay-swatches" aria-hidden="true">${[`background`,`text`,`muted`,`surface`,`added`,`modified`,`removed`,...Array.from({length:Si},(e,t)=>`kind-${t}`)].map(e=>D`<span class="${`is-${e}`}"></span>`)}</div></div>${this.renderControls(e,n,r)}`}renderCommit(e){let t=this.repo??this.repository.repo,n=t?`https://github.com/${t.split(`/`).map(encodeURIComponent).join(`/`)}`:null,r=e.sha.slice(0,7);return D`<p class="replay-commit">${n?D`<a class="replay-sha" href="${`${n}/commit/${e.sha}`}" target="_blank" rel="noopener noreferrer" aria-label="${`Commit ${r} on GitHub`}">${r}</a>`:D`<code class="replay-sha">${r}</code>`} <span class="replay-commit-subject">${St(e.subject||`(no message)`,n)}</span> <span class="replay-commit-author">${c(e.authorLogin,e.authorName,e.coauthors)}</span></p>`}renderKey(e){if(e.colors.size===0)return k;let t=[...e.colors].toSorted((t,n)=>(e.counts.get(n[0])??0)-(e.counts.get(t[0])??0));return D`<ul class="replay-key" aria-label="Kinds of files">${t.map(([e,t])=>D`<li><span class="${`replay-dot is-kind-${t}`}"></span>.${e}</li>`)}<li><span class="replay-dot is-muted"></span>Other</li><li class="replay-beams"><span class="replay-beam is-added"></span>Added</li><li><span class="replay-beam is-modified"></span>Modified</li><li><span class="replay-beam is-removed"></span>Removed</li></ul>`}renderStatus(e,t,n){if(t?.entry.status===`error`)return D`<div class="replay-status is-error"><p role="alert">${t.entry.error}</p><button type="button" @click="${()=>Nt(t.key)}">Retry</button></div>`;if(e.error)return D`<div class="replay-status is-error"><p role="alert">${e.error}</p><button type="button" @click="${()=>{e.error=null,Vi()}}">Retry</button></div>`;if(t?.entry.status===`ready`&&t.entry.moreError)return D`<div class="replay-status is-error"><p role="alert">${t.entry.moreError}</p><button type="button" @click="${()=>t.more()}">Retry</button></div>`;if(t){let e=t.entry.status===`ready`?t.entry.commits.length:0;return D`<div class="replay-status" role="status">${e>0?`Reading commits\u2026 ${Q(e)} so far`:`Reading the history…`}</div>`}return e.commits.length===0?D`<div class="replay-status">No commits to play.</div>`:X(e)?n===0?D`<div class="replay-status" role="status">Reading what the commits changed…</div>`:e.waiting?D`<div class="replay-status is-waiting" role="status">Reading what the next commits changed…</div>`:k:D`<div class="replay-status" role="status">Reading the files as they were before ${$(e.commits[0].committedAt)}…</div>`}renderControls(e,t,n){let r=e.ended?`Play again`:e.playing?`Pause`:`Play`,i=n>0&&!!(e.commits&&X(e)),a=e=>`${t>0?e/t*100:0}%`;return D`<div class="replay-controls"><button type="button" class="replay-play" aria-label="${r}" ?disabled="${!i}" @click="${()=>this.toggle()}"><svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e.ended?pa:e.playing?fa:da}</svg></button><div class="replay-track" style="${E({"--buffered":a(n),"--played":a(e.next)})}"><input type="range" min="0" max="${t}" step="1" .value="${String(e.next)}" aria-label="Commits played" ?disabled="${!i}" aria-valuetext="${`${Q(e.next)} of ${Q(t)} commits`}" @input="${e=>this.seek(Number(e.target.value))}"></div><div class="history-modes" role="group" aria-label="Speed">${yi.map(e=>D`<button type="button" aria-pressed="${String(zi===e)}" @click="${()=>this.pickSpeed(e)}">${ua(e)}</button>`)}</div></div>`}};customElements.get(`repository-replay`)||customElements.define(`repository-replay`,ma);var ha=3e5,ga=3e4,_a=8,va=20,ya=new Map,ba=new Set,xa=null;function Sa(){let e=T.managedSession?`${T.managedSession.id}\0${T.managedSession.role}`:null;return e!==xa&&(ya.clear(),xa=e),ya}var Ca=()=>{for(let e of ba)e.requestUpdate()};S(e=>{(e===`issues`||e===`pulls`)&&Ca()}),v(e=>{for(let t of ba)(!e||t.repository?.repoId===e.repoId)&&t.requestUpdate()});function wa(e){if(!Array.isArray(e?.items))throw Error(`The server answered with no list.`);return{items:e.items.filter(e=>Number.isSafeInteger(e?.number)&&typeof e.title==`string`&&Array.isArray(e.labels)),counts:{open:e.counts?.open??0,closed:e.counts?.closed??0},more:e.more===!0,after:e.more===!0?e.after:null,readAt:t(e)}}function Ta(e,t,n,s){let c=e=>e.state===`open`==(n===`open`),l=s.items.map(t=>r(e,t.number)??{item:t,readAt:s.readAt}),u=l.map(({item:e})=>e),d=new Set(u.map(e=>e.number)),f=s.more?s.items.at(-1)?.updatedAt??0:null,p=i(e,t).filter(({item:e,readAt:t})=>t>s.readAt&&!d.has(e.number)&&c(e)&&(f===null||(e.updatedAt??0)>=f)).toSorted((e,t)=>(t.item.updatedAt??0)-(e.item.updatedAt??0));for(let{item:e}of p){let t=u.findIndex(t=>(t.updatedAt??0)<(e.updatedAt??0));u.splice(t===-1?u.length:t,0,e)}let m=s.countsAt??s.readAt,h=e=>{let t=a(e.item),n=e.item.closedAt??e.item.mergedAt??null;return(t===`closed`?n!==null&&n<=m:(e.item.updatedAt??1/0)<=m)?t:s.counted?.get(e.item.number)??o(e,m)},g=new Map(i(e,t).map(e=>[e.item.number,e]));for(let e of l)g.has(e.item.number)||g.set(e.item.number,e);let _=0;for(let e of g.values()){let t=h(e);t!==a(e.item)&&(_+=t===n?1:-1)}let v=n===`open`?`closed`:`open`;return{items:u,counts:{[n]:Math.max(0,s.counts[n]-_),[v]:Math.max(0,s.counts[v]+_)}}}function Ea(e,t,n){let r=new Map(i(e,t).map(e=>[e.item.number,o(e,n.countsAt)]));for(let e of n.items)r.has(e.number)||r.set(e.number,a(e));n.counted=r}function Da(e,t,n){return A(Sa(),e,()=>t(null),{ready:e=>{let t={status:`ready`,until:Date.now()+ha,...e,countsAt:e.readAt,loadingMore:!1,moreError:null};return n(t),t},failed:e=>e?.name===`AbortError`?null:{status:`error`,until:Date.now()+ga,error:e?.message||`The list could not be read.`},retryMs:ga,repaint:Ca})}function Oa(e,t,n,r){t.loadingMore||!t.more||(t.loadingMore=!0,t.moreError=null,t.until=Date.now()+ha,Ca(),n(t.after).then(n=>{if(Sa().get(e)!==t)return null;let i=new Set(t.items.map(e=>e.number));return t.items=[...t.items,...n.items.filter(e=>!i.has(e.number))],n.readAt>=t.countsAt&&(t.counts=n.counts,t.countsAt=n.readAt,r(t)),t.more=n.more,t.after=n.after,t.until=Date.now()+ha,null},e=>(e?.name!==`AbortError`&&(t.moreError=e?.message||`More could not be read.`),null)).finally(()=>{t.loadingMore=!1,Ca()}))}function ka(e,t){let n=t.trim().toLowerCase().split(/\s+/u).filter(Boolean);return n.length===0?e:e.filter(e=>{let t=[`#${e.number}`,e.title,e.author??``,we(e.author)??``,e.head??``,...e.labels.map(e=>e.name)].join(`
|
|
4
4
|
`).toLowerCase();return n.every(e=>t.includes(e))})}var Aa=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumSignificantDigits:2}),ja=e=>e<1e3?String(e):Aa.format(e);function Ma(e){let t=e.labels.length+(e.moreLabels??0),n=e.labels.slice(0,t>_a?_a-1:_a),r=e=>D`<span class="issue-label" style="${E(e.color?{"--label":`#${e.color}`}:{})}" data-tooltip-truncated data-tooltip="${e.name}">${e.name}</span>`,i=e=>D`${r(e[0])}${e.length>1?D`<span class="issue-labels-rest" style="${E({"--labels":String(e.length-1)})}">${i(e.slice(1))}</span>`:k}`;return D`${n.length>0?i(n):k}${t>n.length?D`<span class="issue-label is-more">+${t-n.length}</span>`:k}`}var Na={git:`from git`,tarball:`a tarball not npm’s registry’s`,integrity:`locked with no integrity`};function Pa({versions:e,count:t,unread:n,unchecked:r,cut:i}){let a=t-Math.min(e.length,va);return[t>0?`${e.slice(0,va).map(e=>`${e.name}${e.version?`@${e.version}`:``} (${Na[e.unsupported]})`).join(`, `)}${a>0?` and ${a.toLocaleString(`en-US`)} more`:``} can\u2019t be reviewed`:null,n.length>0||r>0||i?`not every lockfile it changes was read`:null].filter(Boolean).join(`; `)}function Fa(e){if(e.status!==`ready`)return k;let{versions:t,fresh:n,updated:r,more:i,toReview:a}=ee(e),o=e.review?re(e).count:0,s=ae(e);if(t.length===0&&o===0&&!s)return k;let c=i?`+`:``,l=t=>{let n=te(t,e.review);return n===`unsupported`?`, can\u2019t be reviewed: ${Na[t.unsupported]}`:n===`baseline`?`, needs no review`:t.reviewed?`, reviewed`:t.rejected?`, rejected`:n?`, ${t.reviews}/${e.review.required} reviews`:``},u=e=>`${e.name}@${e.version??`?`}${e.patch?`, patched`:``}${e.was?` (was ${e.was.join(`, `)}${l(e)})`:` (new${l(e)})`}`,d=t.length-va,f=[t.length>0?`New in its lockfiles: ${t.slice(0,va).map(u).join(`, `)}${d>0?` and ${d.toLocaleString(`en-US`)}${c} more`:i?` and more`:``}`:null,o>0?`${o.toLocaleString(`en-US`)} other ${o===1?`version`:`versions`} in its lockfiles unreviewed`:null,s?`Its review fails: ${Pa(s)}`:null].filter(Boolean).join(`. `),p=[n?`${n.toLocaleString(`en-US`)} new`:null,r?`${r.toLocaleString(`en-US`)} updated`:null].filter(Boolean).join(`, `),m=a&&o?`${a.toLocaleString(`en-US`)} + ${o.toLocaleString(`en-US`)} to review`:a?`${a.toLocaleString(`en-US`)} to review`:o?`${o.toLocaleString(`en-US`)} unreviewed`:``;return D`<span class="issue-deps" data-tooltip="${f}">${ge}<span class="issue-deps-names">${[...new Set(t.map(e=>e.name))].join(`, `)}</span> ${p?D`<span class="issue-deps-count">${p}${c}</span>`:k} ${s?D`<span class="issue-deps-review is-failed">${s.count>0?`${s.count.toLocaleString(`en-US`)} can\u2019t be reviewed`:`lockfiles unread`}</span>`:e.review?m?D`<span class="issue-deps-review is-wanted">${m}</span>`:D`<span class="issue-deps-review is-passed" role="img" aria-label="Every version reviewed">${ue.success[1]}</span>`:k}</span>`}var Ia=class extends Te{static properties={repository:{attribute:!1},repo:{attribute:!1},kind:{},_filter:{state:!0}};createRenderRoot(){return this}constructor(){super(),this.repository=null,this.repo=null,this.kind=`issues`,this._filter=``,this._moreButton=null}connectedCallback(){super.connectedCallback(),ba.add(this)}disconnectedCallback(){super.disconnectedCallback(),ba.delete(this),this._moreButton&&C(this._moreButton),this._moreButton=null}updated(){let e=this.querySelector(`.issues-more > button`);this._moreButton&&this._moreButton!==e&&C(this._moreButton),this._moreButton=e,e&&fe(e,t=>{t&&this.readNear(e)})}readNear(e){e===this._moreButton&&e.isConnected&&!e.disabled&&!this._filter.trim()&&!e.parentElement.querySelector(`[role=alert]`)&&e.click()}list(e){let{repoId:t}=this.repository,r=this.kind,i=`${t}\0${r}\0${e}`,a=i=>h(t,r,{state:e,after:i}).then(wa).then(e=>(n(t,e.items,e.readAt,r),e)),o=e=>Ea(t,r,e),s=Da(i,a,o);return{key:i,entry:s,more:()=>Oa(i,s,a,o)}}pick(e){oe(this.repository,this.kind,e)}render(){if(!this.repository)return k;let e=x(this.kind)??`open`,{key:t,entry:n,more:r}=this.list(e),i=n.status===`ready`,a=this.kind===`pulls`?`pull requests`:`issues`,o=e===`open`?`closed`:`open`,s=Sa().get(`${this.repository.repoId}\0${this.kind}\0${o}`),c=i?Ta(this.repository.repoId,this.kind,e,n):null,l=c?c.counts:s?.status===`ready`?Ta(this.repository.repoId,this.kind,o,s).counts:null,u=e=>l?D`<span class="n">${l[e].toLocaleString(`en-US`)}</span>`:k,d=c?ka(c.items,this._filter):[];return D`<div class="history-bar issues-bar">${ce(this.kind)}<div class="history-modes" role="group" aria-label="${this.kind===`pulls`?`Pull requests`:`Issues`}"><button type="button" aria-pressed="${String(e===`open`)}" @click="${()=>this.pick(`open`)}">Open${u(`open`)}</button> <button type="button" aria-pressed="${String(e===`closed`)}" @click="${()=>this.pick(`closed`)}">Closed${u(`closed`)}</button></div><input class="issues-filter" type="search" placeholder="Filter" aria-label="${`Filter the ${a} read`}" .value="${this._filter}" @input="${e=>{this._filter=e.target.value}}"> ${c&&this._filter.trim()?D`<span class="history-summary">${d.length} of ${c.items.length} read</span>`:k}</div>${c?this.renderTiles(n,c.items,d,r,`${e} ${a}`):n.status===`error`?D`<div class="bundles-slide-placeholder is-error"><p role="alert">${n.error}</p><button type="button" @click="${()=>{Sa().delete(t),Ca()}}">Retry</button></div>`:D`<div class="bundles-slide-placeholder" role="status">Reading the ${a}…</div>`}`}renderTiles(e,t,n,r,i){if(t.length===0)return D`<div class="bundles-slide-placeholder">No ${i}.</div>`;let a=this.repo??this.repository.repo,o=this.kind===`pulls`?`pull`:`issues`;return D`<div class="issues-scroll">${n.length===0?D`<p class="history-note">None of the ${i} read match.</p>`:D`<ol class="issues-grid" aria-label="${i}">${n.map(e=>{let[t,n]=_e(this.kind,e),r=this.renderTile(e,t,n);return D`<li class="${je({"issue-tile":!0,[`is-${t}`]:!0})}">${a?D`<a class="issue-body" href="${`https://github.com/${a}/${o}/${e.number}`}" target="_blank" rel="noopener noreferrer" @click="${t=>this.openTile(t,e)}">${r}</a>`:D`<div class="issue-body" @click="${t=>this.openTile(t,e)}">${r}</div>`}</li>`})}</ol>`} ${e.more||e.moreError?D`<div class="history-more issues-more">${e.moreError?D`<span role="alert">${e.moreError}</span>`:k} <button type="button" ?disabled="${e.loadingMore}" @click="${r}">${e.loadingMore?`Reading…`:`More`}</button></div>`:k}</div>`}openTile(e,t){xe(e)&&(e.preventDefault(),Ae({repository:{...this.repository,repo:this.repo??this.repository.repo},target:{number:t.number,preview:{...t,kind:this.kind}}}))}renderTile(t,n,r){let i=this.kind===`pulls`,a=i&&t.state===`open`&&y(t)?b(this.repository.repoId,t.number,!0,{listed:!0}):null,o=t.updatedAt==null?null:new Date(t.updatedAt),c=i&&t.checks?ue[t.checks]:null,l=i&&t.state===`open`&&t.review?de[t.review]:null,u=t.comments>0?`${t.comments.toLocaleString(`en-US`)} comment${t.comments===1?``:`s`}`:null,d=(e,[n,r])=>D`<span class="${`issue-${e} is-${t[e]}`}" role="img" aria-label="${n}" data-tooltip="${n}">${r}</span>`;return D`<span class="issue-rail"><span class="issue-state" role="img" aria-label="${r}">${le[this.kind][n]}</span> ${i?D`<span class="issue-marks">${l?d(`review`,l):k}${c?d(`checks`,c):k}</span>`:k} ${u?D`<span class="issue-comments" role="img" aria-label="${u}" data-tooltip="${u}">${s}<span>${ja(t.comments)}</span></span>`:k} </span><span class="issue-lines"><span class="issue-name">${t.title||`(no title)`}</span> <span class="issue-meta"><span class="issue-number">#${t.number}</span> <span class="issue-author">${Ee(t.author,t.author??`ghost`)}</span> ${o?D`<time datetime="${o.toISOString()}">${bt(t.updatedAt)}</time>`:k} </span>${t.labels.length>0||t.moreLabels>0?D`<span class="issue-labels">${Ma(t)}</span>`:k} ${i&&t.head?D`<span class="issue-branch"><code>${t.head}</code>${t.base?D`<span aria-hidden="true">→</span><code>${t.base}</code>`:k} <span class="issue-diff"><span class="is-added">+${t.additions.toLocaleString(`en-US`)}</span> <span class="is-deleted">−${t.deletions.toLocaleString(`en-US`)}</span></span></span>`:k} ${i&&t.state===`open`?e(t.reviews):k} ${a?Fa(a):k}</span>`}};customElements.get(`repository-issues`)||customElements.define(`repository-issues`,Ia);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e=null){let t=[`anthropic/claude-opus-5.5`,`anthropic/claude-fable-5.2`,`anthropic/claude-sonnet-5.5`,`anthropic/claude-haiku-5.5`,`openai/gpt-6.2-astra`,`openai/gpt-6.2-astra-pro`,`openai/gpt-6.2-sol`,`openai/gpt-6.2-sol-pro`,`openai/gpt-6.1-terra`,`openai/gpt-6.1-terra-pro`,`openai/gpt-6-luna`,`openai/gpt-6-luna-pro`,`moonshotai/kimi-k3.1-pro`,`moonshotai/kimi-k3`,`google/gemini-4-carbon`,`google/gemini-4-argon`,`google/gemini-4-hydrogen`,`google/gemma-4-31b-it`,`x-ai/grok-4.7`,`z-ai/glm-5.3`,`qwen/qwen4-max`,`deepseek/deepseek-v4.1-flash`,`deepseek/deepseek-v4-pro`,`mistralai/mistral-large-4-0`],n=e===`moonshot`?`moonshotai`:e,r=t.filter(t=>![`anthropic`,`openai`,`moonshot`].includes(e??``)||t.startsWith(`${n}/`)).map(e=>({id:e,efforts:[`low`,`medium`,`high`,`xhigh`,`max`]}));return{models:r,defaultModel:r[0].id}}export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$e as e,Ze as t,a as n,bf as r,ua as i,w as a}from"./chunk-
|
|
1
|
+
import{$e as e,Ze as t,a as n,bf as r,ua as i,w as a}from"./chunk-OFZYEWBH.js";import{c as o,d as s,g as c}from"./chunk-2XUEZHIP.js";var l=t(s`<path d="M3.5 8.4l2.9 2.9 6.1-6.6"/>`),u=t(s`<circle class="fill" cx="8" cy="8" r="3"/>`),d=t(s`<path d="M4.2 4.2l7.6 7.6M11.8 4.2l-7.6 7.6"/>`),f=t(s`<circle class="dotted" cx="8" cy="8" r="5.5"/>`),p=t(s`<path d="M2.6 3.2h7.6v5.3H6.3L4 10.4V8.5H2.6z"/><path d="M12.2 6.2h1.2v5.3H12v1.9l-2.3-1.9H7"/>`),m={approved:[`approved`,r.approved[1],`Approved`],changes:[`changes`,r.changes[1],`Changes requested`],commented:[`commented`,e,`Commented`],dismissed:[`dismissed`,e,`Review dismissed`]},h={done:[`reviewed`,l,`Reviewed`],running:[`running`,u,`Reviewing`],failed:[`failed`,d,`Review failed`],requested:[`requested`,f,`Asked to review again`]},g=[`requested`,f,`Review requested`],_=e=>e.slice(0,7),v=e=>new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),y=(e,t,n=!1)=>`${e.toLocaleString(`en-US`)}${n?`+`:``} ${t}${e===1&&!n?``:`s`}`;function b(e){return e?e.failed?h.failed:e.requested?h.requested:h[e.code?.status]??null:null}function x(e){let t=b(e.codex),n=e.codex?.code?.commit??null;return[...t?[{who:i(e.codex.login,`Codex`),standing:t,commit:n,stale:n!==null&&n!==e.head}]:[],...e.reviewers.map(t=>({who:i(t.login,t.login??`someone`),standing:m[t.state]??g,requested:t.requested&&!!m[t.state],workflow:t.workflow??null,commit:t.commit,at:t.at,stale:t.commit!==null&&t.commit!==e.head}))]}var S=e=>(e.moreReviews??0)+(e.moreRequests??0),C=e=>[e.moreReviews>0?y(e.moreReviews,`more review`):null,e.moreRequests>0?y(e.moreRequests,`more review request`):null].filter(Boolean).join(` and `);function w(e){if(!e.head)return!0;let t=e.codex?.code;return t?.status===`done`&&t.commit===e.head||e.reviewers.some(t=>m[t.state]&&t.state!==`dismissed`&&t.commit===e.head)?!0:e.moreReviews>0&&null}var T=e=>e?o`<span class="${`review-severity is-${e}`}">${e.toUpperCase()}</span>`:c;function E(e){if(!e)return c;let t=x(e),{open:n,more:r,severity:i}=e.threads,a=n>0?`${y(n,`open review thread`,r)}${i?`, the gravest ${i.toUpperCase()}`:``}`:r?`No open review thread among those read; more on GitHub`:null,s=w(e);return o`<span class="issue-reviews">${t.map(({who:e,standing:[t,n,r],commit:i,stale:a,requested:s})=>{let c=`${r}${s?`, and requested again`:``}${a?`, on an earlier commit (${_(i)})`:i?`, on the latest commit`:``}`;return o`<span class="${`review-mark is-${t}${a?` is-stale`:``}`}"><span class="review-glyph" role="img" aria-label="${c}" data-tooltip="${c}">${n}</span><span class="review-who">${e}</span></span>`})} ${S(e)>0?o`<span class="review-more" data-tooltip="${`${C(e)}, on GitHub`}">+${S(e)}</span>`:c} ${a?o`<span class="review-threads" role="img" aria-label="${a}" data-tooltip="${a}">${p}<span>${n}${r?`+`:``}</span>${T(i)}</span>`:c} ${s===!1?o`<span class="review-unreviewed" data-tooltip="${t.length>0?`No review is on the latest commit`:`No reviews yet`}">Unreviewed</span>`:s===null?o`<span class="review-unreviewed" data-tooltip="No review read is on the latest commit; more on GitHub">Unreviewed?</span>`:c}</span>`}function D(e,t,n){if(!e)return c;let r=o`<code>${_(e)}</code>`;return o`<span class="review-on">on ${n?o`<a href="${`https://github.com/${n}/commit/${e}`}" target="_blank" rel="noopener noreferrer">${r}</a>`:r}${e===t?`, the latest commit`:`, an earlier commit`}</span>`}function O(e,t){if(!e)return c;let{head:n,codex:r}=e,a=(e,[a,s,c],l)=>o`<li class="review-row">${i(r.login,`Codex`)} <span class="${`review-state is-${a}`}">${s}${l}: ${c.toLowerCase()}</span>${D(e.commit,n,t)}</li>`,s=[...r?.code?[a(r.code,b(r)??h.done,`Code review`)]:[],...r?.security?[a(r.security,h[r.security.status]??h.done,`Security review`)]:[],...x({...e,codex:null}).map(({who:e,standing:[r,i,a],commit:s,at:l,requested:u,workflow:d})=>o`<li class="review-row">${e} <span class="${`review-state is-${r}`}">${i}${a}${u?`, requested again`:``}</span>${d?o`<span class="review-on">by the workflow <code>${d}</code></span>`:c}${D(s,n,t)}${l?o`<time datetime="${new Date(l).toISOString()}">${v(l)}</time>`:c}</li>`)],{open:l,resolved:u,more:d,list:f=[]}=e.threads;return o`<section class="repo-item-section"><h4>Reviews</h4>${s.length>0?o`<ul>${s}</ul>`:o`<p class="repo-item-quiet">No reviews yet.</p>`} ${S(e)>0?o`<p class="repo-item-quiet">And ${C(e)}, on GitHub.</p>`:c} ${w(e)===null?o`<p class="repo-item-quiet">No review read is on the latest commit, <code>${_(n)}</code>; one of those on GitHub may be.</p>`:s.length>0&&!w(e)?o`<p class="repo-item-quiet">No review is on the latest commit, <code>${_(n)}</code>.</p>`:c}</section>${l>0||u>0?o`<section class="repo-item-section"><h4>Open threads</h4>${f.length>0?o`<ul>${f.map(e=>o`<li><a class="repo-item-row review-thread" href="${e.url??c}" target="_blank" rel="noopener noreferrer">${T(e.severity)}<span class="repo-item-title">${e.title||`(no comment)`}</span> ${e.path?o`<code class="review-path">${e.path}${e.line?`:${e.line}`:``}</code>`:c} ${e.outdated?o`<span class="repo-item-quiet">outdated</span>`:c}</a></li>`)}</ul>`:o`<p class="repo-item-quiet">${d?`None open among those read.`:`None open.`}</p>`} ${u>0||d?o`<p class="repo-item-quiet">${u>0?`${y(u,`thread`)} resolved`:``}${d?`${u>0?`; `:``}more on GitHub`:``}.</p>`:c}</section>`:c}`}var k=n({items:new Map,changes:0}),A=null,j=()=>a.managedSession?`${a.managedSession.id}\0${a.managedSession.role}`:null,M=(e,t,n)=>`${e}\0${t}\0${n}`,N=e=>Number.isSafeInteger(e?.readAt)&&e.readAt>0?e.readAt:Date.now();function P(e,t,n,r=null){let i=j();i!==A&&(k.items.clear(),A=i);let a=!1;for(let o of t){let t=M(i,e,o.number),s=k.items.get(t);if(s&&s.readAt>n)continue;let c=s&&(s.item.state===`open`?`open`:`closed`),l=!c||c===(o.state===`open`?`open`:`closed`)?s?.moved??null:{from:c,before:s.readAt};k.items.set(t,{item:{...o,kind:o.kind??r??s?.item.kind??null},readAt:n,moved:l}),a=!0}a&&k.changes++}var F=(e,t)=>k.items.get(M(j(),e,t))??null;function I(e,t){let n=M(j(),e,``);return k.changes,[...k.items].flatMap(([e,r])=>e.startsWith(n)&&r.item.kind===t?[r]:[])}var L=()=>k.changes,R=e=>e.state===`open`?`open`:`closed`;function z(e,t){let n=R(e.item);if(e.readAt<=t||!e.moved)return n;if(e.moved.before>=t)return e.moved.from;let r=e.item.closedAt??e.item.mergedAt??null;return n===`closed`&&r!==null&&r>t?e.moved.from:n}export{E as a,O as b,N as c,P as d,F as e,I as f,L as g,R as h,z as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,g as t,h as n,k as r}from"./chunk-JJK5OZG2.js";import{k as i}from"./chunk-W6VOKW2N.js";function a(e,t){return e?e.base===``?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}var o=(e,t)=>`${`../`.repeat(e.base.split(`/`).length-1)}${t}`;function s({root:e,paths:t},n,r){if(!e||n===`.`)return n;for(let e of r){let r=t.get(`${n}/${e}`);if(r?.endsWith(`/${e}`))return r.slice(0,-e.length-1)}let i=a(e,`${n}/`);return i===null?o(e,n):i.slice(0,-1)||`.`}function c(e,t){if(!e)return{prefix:t,from:null,to:null};let n=t.startsWith(e.other)?t:``;return{prefix:n,from:`./${e.base}${n.slice(e.other.length)}`,to:`./${n||e.other}`}}function l(e){let t=i(e),n=new Map;for(let[r,i]of Object.entries(e?.bundle?.reason??{})){let e=new Set(Array.isArray(i)?i.filter(e=>t.has(e)):[]);e.size>0&&n.set(r,e)}return{stasis:e?.kind===`stasis`,files:t,trees:n}}var u=[[`extra`,`add`],[`metro`,`bundle:metro`]];function d(e){if(e.length!==2)return e;let t=(t,n)=>e.find((r,i)=>r.trees.has(n)&&!r.trees.has(t)&&e[1-i].trees.has(t)&&!e[1-i].trees.has(n)),n=e.map(()=>new Map);for(let[r,i]of u){let a=t(r,i);a&&n[e.indexOf(a)].set(i,r)}let r=t(`metro`,`bundle:metro`);return r&&t(`run`,`bundle`)===r&&n[e.indexOf(r)].set(`bundle`,`run`),e.map((e,t)=>n[t].size===0?e:{...e,trees:new Map([...e.trees].map(([e,r])=>[n[t].get(e)??e,r])),actual:new Map([...n[t]].map(([e,t])=>[t,e]))})}function f(e,t){if(!e.stasis||e.trees.size!==1)return null;let[[n,r]]=e.trees;return r.size===e.files.size&&!t.some(t=>t!==e&&t.trees.has(n))?n:null}var p=e=>e.trees.size===0||e.trees.size===1&&[...e.trees.values()][0].size===e.files.size,m=`reasons:`,h=(e,t)=>`${m}${JSON.stringify([e,t].toSorted())}`;function g(e){if(!e.startsWith(m))return null;try{let t=JSON.parse(e.slice(m.length));return Array.isArray(t)&&t.length===2&&t.every(e=>typeof e==`string`)?t:null}catch{return null}}function _(...e){let t=d(e.map(l));if(t.length===2&&!t.some(p)){let[e,n]=t.map(e=>[...e.trees.keys()].toSorted()),r=e.filter(e=>n.includes(e)),[i,a]=[e,n].map(e=>e.filter(e=>!r.includes(e)));if(i.length>0&&a.length>0)return[...r.map(e=>({id:`reason:${e}`,label:e})),...i.flatMap(e=>a.map(t=>({id:h(e,t),label:`${e} \u2192 ${t}`})))]}let n=t.filter(e=>f(e,t)===null),r=new Set(n.flatMap(e=>[...e.trees.keys()])),i=e=>n.some(t=>t.stasis&&(t.trees.get(e)?.size??0)<t.files.size);return[...r].some(i)?[...r].toSorted().map(e=>({id:`reason:${e}`,label:e})):[]}function v(e,t,n=``){if(!n)return[``,``];let r=g(n),i=d([e,t].map(l)),a=n.startsWith(`reason:`)?n.slice(7):null;return i.map(e=>{let t=r?r.find(t=>e.trees.has(t)):f(e,i)??a;return t==null?n:`reason:${e.actual?.get(t)??t}`})}function y(e,t=``){let n=i(e);if(!t||e?.kind!==`stasis`)return n;let r=e?.bundle?.reason?.[t.replace(/^reason:/u,``)],a=new Set(Array.isArray(r)?r:[]);return new Map([...n].filter(([e])=>a.has(e)))}function b(e,t,n,r){return JSON.stringify([e,t,n,r])}function x(e,t=``){let n=new Map;if(e?.kind!==`stasis`||!e.bundle)return n;let r=t?i(e):null,a=t?y(e,t):null;for(let[t,i]of e.bundle.imports)for(let[e,o]of i)for(let[i,s]of o){let o=typeof s==`string`?[[null,s]]:s;for(let[s,c]of o){if(a&&!a.has(e)&&(r.has(e)||!a.has(c)))continue;let o=b(e,i,t,s);n.set(o,{key:o,parent:e,specifier:i,conditions:t,platform:s,target:c})}}return n}var S=(e,{lo:t,start:n},r)=>e[n+(r-t)/2];function C(e,t,{low:n,high:r},i,a){return e===-t||e-1<n||e!==t&&e+1<=r&&S(i,a,e-1)<S(i,a,e+1)?e+1:e-1}function w(e,t,n,{first:r,n:i,m:a,d:o,...s}){e.a.fill(1,0,r).fill(1,i),e.b.fill(1,0,r).fill(1,a);let c=i,l=a;for(let r=o;r>0;r--){let i=c-l,a=C(i,r,s,t,n[r]),o=S(t,n[r],a);for(let t=a>i?o:o+1;t<c;t++)e.a[t]=e.b[t-i]=1;c=o,l=c-a}for(let t=r;t<c;t++)e.a[t]=e.b[t]=1}function T(e,t,n){let r=0,i=t.length,a=e.length,o=2*(a+i);for(;r<a&&r<i&&e[r]===t[r];)r++;for(;a>r&&i>r&&e[a-1]===t[i-1];)a--,i--;let s={high:a-r,low:r-i},c=[r],l=[{lo:1,start:0}];for(let u=0;u<=s.high-s.low;u++){let d=l[u],f=Math.min(u,s.high),p=Math.max(-u,s.low+(s.low+u&1));l.push({lo:p,start:c.length});for(let m=p;m<=f;m+=2){let f=C(m,u,s,c,d),p=S(c,d,f),h=f>m?p:p+1,g=h;for(;h<a&&h-m<i&&e[h]===t[h-m];)h++;if(o+=2+h-g,c.push(h),h>=a&&h-m>=i)return w(n,c,l,{first:r,n:a,m:i,d:u,...s}),o}}throw Error(`no edit script between two lines`)}var E=/[\p{L}\p{N}_$]+|\s+|[^\p{L}\p{N}_$\s]/gu,D=2e3,ee=800,O=.6;function k(e,t){if(e.length>D)return null;let n=e.match(E)??[];return n.length>ee?null:{line:e,tokens:n,words:n.map(e=>(t.has(e)||t.set(e,t.size),t.get(e)))}}function A({tokens:e,line:t},n){let r=[];for(let i=0,a=0;a<e.length;i+=e[a++].length){if(n[a])continue;let o=r.at(-1);o&&/^\s*$/u.test(t.slice(o[1],i))?o[1]=i+e[a].length:r.push([i,i+e[a].length])}return r}var j=(e,t)=>e.reduce((e,[t,n])=>e+n-t,0)/Math.max(1,t.length);function M(e,t){let n={a:e.words.map(()=>0),b:t.words.map(()=>0)},r=T(e.words,t.words,n),i={a:A(e,n.a),b:A(t,n.b)};return{ranges:i,share:n.a.includes(1)?Math.min(j(i.a,e.line),j(i.b,t.line)):1,steps:r}}function te(e,t){if(e===t)return{a:[],b:[]};let n=new Map,r=k(e,n),i=k(t,n);if(r===null||i===null)return null;let{ranges:a,share:o}=M(r,i);return o<=O?a:null}var N=200,P=5e6,F=6,I=60,L=3;function R(e){let t=new Map;for(let n of e?.tokens??[])t.set(n,(t.get(n)??0)+1);return t}function z(e,t){let n=new Map,r=[e,t].map(e=>e.map(e=>k(e,n))),i=r.map(e=>e.map(R)),a=0,o=(e,t,n)=>{let r=0;for(let[i,o]of e)if(a+=L,(r+=i.length*Math.max(0,o-(t.get(i)??0)))>O*n.length)return 1/0;return r/Math.max(1,n.length)},s=(n,a)=>r[0][n]===null||r[1][a]===null?1/0:Math.min(o(i[0][n],i[1][a],e[n]),o(i[1][a],i[0][n],t[a])),c=(e,t)=>{if(a+=I,s(e,t)===1/0)return 1/0;let{share:n,steps:i}=M(r[0][e],r[1][t]);return a+=i,n<=O?n:1/0},l=new Float64Array(e.length*t.length).fill(NaN);return{share:(n,r)=>{let i=n*t.length+r;return Number.isNaN(l[i])&&(l[i]=e[n]===t[r]?0:c(n,r)),l[i]},floor:s,spent:()=>a}}function B(e,t,{share:n,spent:r}){let i=Array.from({length:e+1},()=>new Float64Array(t+1)),a=(e,t)=>n(e,t)===1/0?-1/0:1e3-n(e,t)+i[e][t];for(let n=0;n<e;n++)for(let e=0;e<t;e++)if(i[n+1][e+1]=Math.max(i[n][e+1],i[n+1][e],a(n,e)),r()>P)return null;let o=[];for(let n=e,r=t;n>0&&r>0;)i[n][r]===i[n][r-1]?r--:i[n][r]===i[n-1][r]?n--:o.push([--n,--r]);return o.toReversed()}function V(e,t,{share:n,floor:r}){let i=[];for(let a=0,o=0;a<e&&o<t;a++){let e=null,s=1/0,c=Array.from({length:Math.min(t,o+F)-o},(e,t)=>[o+t,r(a,o+t)]);for(let[t,r]of c.toSorted((e,t)=>e[1]-t[1]||e[0]-t[0])){if(r>s)break;(n(a,t)<s||n(a,t)===s&&t<e)&&([e,s]=[t,n(a,t)])}e!==null&&(i.push([a,e]),o=e+1)}return i}function H(e,t){if(e.length>N||t.length>N)return[];let n=z(e,t);return B(e.length,t.length,n)??V(e.length,t.length,n)}var U=(e,n,r)=>t(e,n,{...r,discard:!1});function W(e){if(e===null)return``;let t=e.type===`symlink`?e.target:e.data;if(typeof t==`string`)return t.includes(`\0`)?void 0:t;if(!t.includes(0))try{return r(t)}catch{return}}var G=new Set([`none`,`all`,`change`,`trailing`]);function K({horizon:e=1/0,whitespace:t=`none`,ignoreCase:n=!1}={}){if(e!==1/0&&!(Number.isSafeInteger(e)&&e>=0))throw RangeError(`horizon must be a whole number or Infinity, not ${e}`);if(!G.has(t))throw RangeError(`whitespace must be 'none', 'all', 'change' or 'trailing', not ${t}`);if(typeof n!=`boolean`)throw TypeError(`ignoreCase must be a boolean, not ${typeof n}`);return{horizon:e,whitespace:t,ignoreCase:n}}var q=e=>e.reduce((e,{a0:t,a1:n,b0:r,b1:i})=>e+n-t+i-r,0),J=e=>e===``?[]:e.split(/(?<=\n)/u),Y=e=>({...e,ignoreCase:!1,whitespace:`none`}),X=e=>(e.whitespace??`none`)!==`none`||!!e.ignoreCase;function Z(t,r,i,a,o){let s=J(t),c=J(r),l=(e,t,n,r)=>({a0:e,a1:t,b0:n,b1:r,remove:s.slice(e,t),insert:c.slice(n,r)}),u=o.flatMap(({a0:e,a1:t,b0:n,b1:r})=>e===t||n===r?[l(e,t,n,r)]:U(s.slice(e,t).join(``),c.slice(n,r).join(``),i).map(t=>l(e+t.a0,e+t.a1,n+t.b0,n+t.b1))),d=q(u)<q(a)&&(a=>{try{return n(t,r,a,{format:`normal`,ignoreCase:i.ignoreCase,whitespace:i.whitespace}),!0}catch(t){if(t instanceof e)return!1;throw t}})(u)?u:a;return q(d)<q(o)?d:o}function ne(e,t,n){let r=U(e,t,n);return X(n)?Z(e,t,n,r,U(e,t,Y(n))):r}function re(e,t,n){let r=W(e),i=W(t);if(r===void 0||i===void 0)return{binary:!0,blocks:[],insertions:null,deletions:null};let a=r===i?[]:ne(r,i,n),o=(e,t)=>a.reduce((n,r)=>n+r[t]-r[e],0);return{binary:!1,blocks:a,insertions:o(`b0`,`b1`),deletions:o(`a0`,`a1`)}}function ie(t,r,i,a){let{whitespace:o,ignoreCase:s}=K(a);try{return n(t,r,i,{format:`normal`,whitespace:o,ignoreCase:s}),!0}catch(t){if(t instanceof e)return!1;throw t}}var Q=/[ \t\n\v\f\r]/u,$=e=>{let t=e.split(`
|
|
2
|
+
`);return t.at(-1)===``&&t.pop(),t};function ae(e,t){for(let n=0,r=0;;n++,r++){let i=``,a=``;for(;n<e.length&&Q.test(e[n]);)i+=e[n++];for(;r<t.length&&Q.test(t[r]);)a+=t[r++];if(i!==a&&new Set(i+a).size>1)return!0;if(n>=e.length||r>=t.length)return!1}}function oe(e,t,n){try{if(!ie(e,t,n,{whitespace:`all`}))return!0}catch{return!0}let r=$(e),i=$(t),a=0,o=0;for(let e=0;e<=n.length;e++){let t=e<n.length?n[e].a0:r.length;for(;a<t;a++,o++)if(r[a]!==i[o]&&ae(r[a],i[o]))return!0;e<n.length&&({a1:a,b1:o}=n[e])}return!1}function se(e,t,{extension:n=!0}={}){let r=e.split(`/`),i=t.split(`/`),a=0;for(;a<r.length-1&&a<i.length-1&&r[a]===i[a];)a++;let o=0;for(;o<r.length-a-1&&o<i.length-a-1&&r.at(-1-o)===i.at(-1-o);)o++;let s={head:a?`${r.slice(0,a).join(`/`)}/`:``,from:r.slice(a,r.length-o).join(`/`),to:i.slice(a,i.length-o).join(`/`),tail:o?`/${r.slice(-o).join(`/`)}`:``},c=s.from.lastIndexOf(`.`);return n&&!s.from.includes(`/`)&&!s.to.includes(`/`)&&c>0&&s.to.lastIndexOf(`.`)===c&&s.from.slice(0,c)===s.to.slice(0,c)?{...s,head:s.head+s.from.slice(0,c),from:s.from.slice(c),to:s.to.slice(c)}:s}export{te as a,H as b,W as c,K as d,re as e,oe as f,se as g,a as h,o as i,s as j,c as k,_ as l,v as m,y as n,b as o,x as p};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import{b as e,h as t}from"./chunk-IZ6MYRYB.js";import{a as n}from"./chunk-WCPJDAYA.js";import{a as r,b as i,e as a}from"./chunk-IYPY47MC.js";import{A as o,B as s,D as c,E as l,b as u,c as d,d as f,j as p,m,p as h,s as g,t as _,w as v,z as y}from"./chunk-QRKFPLA4.js";import{B as b,b as x,c as S,i as C,x as w,z as T}from"./chunk-74AEKRES.js";import{a as E,b as D,c as O}from"./chunk-C4Z6ZBXV.js";import{c as k,f as A,g as j,i as ee}from"./chunk-2XUEZHIP.js";var te=D(class extends O{constructor(e){if(super(e),e.type!==E.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return A}});function ne(e){let t=typeof e==`string`?e.trim():``;return/^[0-9a-f]{7,64}$/iu.test(t)?t:``}function re(e){return ne(e?.commit)}function ie(e,t){return typeof e==`string`&&typeof t==`string`&&e!==``&&e.toLowerCase()===t.toLowerCase()}function ae(e,t){return ie(t,c(e))?re(e?.repo):``}var oe=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`),se=e=>x(e)?e:oe(S(String(e))),M=globalThis.trustedTypes?.createPolicy(`deepview`,{createHTML:se,createScriptURL:e=>{let t=new URL(e,globalThis.location.href);if(t.origin!==globalThis.location.origin)throw TypeError(`Not a same-origin script: ${t.href}`);return t.href}}),N=e=>M?M.createHTML(e):se(e),ce=e=>M?M.createScriptURL(String(e)):e,P={showAll:!1,packagesView:!1,dependencyPackagesView:!1,flowPackagesView:!1,bundleIssues:!1,bundleLayout:`graph`,lockfileLayout:`dependencies`,bundleReason:null,bundleReasonFor:null,selected:null,focusedPkg:null,topPkgsTab:`issues`,edgeOpacity:.22,nodeSize:1,showLabels:!1,selectedSeverities:new Set,selectedColors:new Set,pathFilter:``,hidden:new Set,solo:null,graphState:null,layoutCache:null,keptViewport:null};function le({keepViewport:e=!1}={}){P.graphState?._cleanup?P.graphState._cleanup({keepViewport:e}):e||(P.keptViewport=null),P.graphState=null}function F(e){return e.id??String(e._id)}function ue(e){let t=h(e);return t!==``&&t!==`revalidation`}var de=[{value:`confirmed`,label:`Confirmed`,kinds:[`confirmed`,`partial`,`revalidation`]},{value:`unreachable`,label:`Unreachable`,kinds:[`unreachable`]},{value:`refuted`,label:`Refuted`,kinds:[`refuted`]}];function fe(e){return de.find(t=>t.value===e)?.kinds??null}var pe=[``,`exclude`,`only`];function me(e,t){let n=fe(e);return n?.includes(`partial`)?t===`only`?[`partial`]:t===`exclude`?[`confirmed`]:n:n}function I(e){if(e.confidence!==void 0)return e.confidence;if(e.critical===!0||e._source)return 10}var he=e=>e.confidence!==void 0||e.critical===!0;function ge(e){return e.every(e=>e.every(e=>I(e)!==void 0))&&e.some(e=>e.some(he))}function _e(e,t,n){return e.some(e=>{let r=[`refuted`,`unreachable`].includes(n(e))?0:I(e);return r===void 0?t===0:r>=t})}function ve(e,t){let n=e.map(t).filter(e=>e.length>0);if(!n.some(e=>e.some(e=>I(e)!==void 0)))return 0;let r=e=>n.reduce((t,n)=>t+ +!!n.some(t=>(I(t)??-1)>=e),0),i;for(i=r(6)<=25?6:r(7)<=25?7:8;i>0&&r(i-1)===r(i);)i--;return i}function ye(e,t){return ge(e)?t:0}function be(e,t,n){let r=new Set(e.ruledOutIds??[]);for(let t of e)for(let e of t)[`refuted`,`unreachable`].includes(n(e))&&r.add(F(e));for(let i of e){let e=t(i);if(e.length!==0&&e.some(e=>me(`confirmed`,``).includes(n(e)||(e._source&&!e._sourcePass?`revalidation`:``)))){for(let e of i)if(r.add(F(e)),e.isApp&&Array.isArray(e.revalidateInputs))for(let t of e.revalidateInputs)t&&r.add(t)}}return r}function xe(e,t,n,r){let i=ye(e,t),a=e.filter(e=>_e(e,i,r));if(a.length===0)return!1;let o=new Set(me(`confirmed`,``));return e.some(e=>e.some(e=>o.has(r(e))))?a.every(e=>e.every(e=>n.has(F(e)))):!1}function Se(e,{tabs:t,kindOf:n,severityMode:r}){let i=e.map(t).filter(e=>e.length>0),a=be(e,t,n);if(!xe(i,ve(e,t),a,n))return!1;let o=ye(i,6);return i.every(e=>!_e(e,o,n)||!e.some(e=>m(e,r)!==`low`)||e.every(e=>a.has(F(e))))}function Ce(e){if(!e)return e;let t="`".repeat(Math.max(0,...[...e.matchAll(/`+/gu)].map(e=>e[0].length))+1),n=/^`|`$/u.test(e)||e.startsWith(` `)&&e.endsWith(` `)&&e.trim()!==``?` `:``;return`${t}${n}${e}${n}${t}`}var L=!0;function we(e,t=!1){L=e!==!1&&!t}function Te(){return L}function R(e){return L?h(e):``}function Ee(e){return h(e)!==``}function De(e){return e.some(e=>(e.groups??[]).some(e=>e.some(ue)))}function Oe(e){let t=R(e);return t&&t!==`revalidation`?t:null}function ke(e){return R(e)===`revalidation`}var Ae=new Set([`refuted`,`unreachable`]);function je(e){return Ae.has(R(e))}function Me(e){return Ae.has(R(e))}function Ne(e){let t=new Set(e);return de.filter(e=>e.kinds.some(e=>t.has(e)))}function z(e){return RegExp(`(^|/)${e}/`,`u`)}function Pe(e){return RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,`u`)}var Fe=z(`node_modules`),Ie=z(`vendor`),B=`node_modules`,Le=z(B),Re=Pe(B);function ze(e){e!==B&&(B=e,Le=z(e),Re=Pe(e))}var Be=null;function Ve(t){Be?.length===t.length&&Be.every((e,n)=>e===t[n])||(Be=[...t],ze(e(t)))}function He(){return B}function V(e){return Le.test(e)}var Ue=new WeakSet;function We(e){let t=!1;for(let n of e??[])for(let e of n.groups??[])for(let n of e){if(n.isApp!==!1)continue;let e=Ue.has(n);`isUpstream`in n&&!e||(V(n.file)?(n.isUpstream!==!0&&(t=!0),n.isUpstream=!0,Ue.add(n)):e&&(t=!0,delete n.isUpstream,Ue.delete(n)))}return t}function Ge(e){let t=typeof e==`string`?e:``;return Fe.test(t)||Ie.test(t)||Le.test(t)}var Ke=/^(.*(?:^|\/)node_modules\/(?:@[^/]+\/[^/]+|[^/]+))(?:\/|$)/u;function qe(e){return Ke.exec(typeof e==`string`?e:``)?.[1]??null}function Je(e){return typeof e!=`number`||!Number.isFinite(e)?null:n(e)}function Ye(e){if(e.length<=1)return{prefix:``,stripped:[...e]};let t=e.map(e=>e.split(`/`)),n=Math.min(...t.map(e=>e.length)),r=0;for(let e=0;e<n-1&&t.every(n=>n[e]===t[0][e]);e++)r=e+1;return r>0&&t[0][r-1].startsWith(`@`)&&r--,r>0&&t[0][r-1]===`node_modules`&&r--,r===0?{prefix:``,stripped:[...e]}:{prefix:`${t[0].slice(0,r).join(`/`)}/`,stripped:t.map(e=>e.slice(r).join(`/`))}}function Xe(e){return e.match(Re)?.[1]??e}var H={on:new WeakMap,off:new WeakMap};function Ze(e){let t=L?H.on:H.off,n=t.get(e);if(n===void 0){let r=L?[Oe(e),e.revalidateVerdict,e.revalidateRecommendation]:[];n=[e.file,e.title,e.description,e.impact,e.reproduction,Kt(e),e.recommendation,e.confidenceReason,...r,e.discoveredIn,e.repo?.github].filter(Boolean).join(`
|
|
2
|
+
`).toLowerCase(),t.set(e,n)}return n}function Qe(e){H.on.delete(e),H.off.delete(e)}function $e(e){return[typeof e?.category==`string`?e.category.trim():``,g(e,L)].filter(Boolean).join(` · `)}function et(e){if(e.length===0)return``;let t=e[0];for(let n=1;n<e.length;n++){for(;t&&!e[n].startsWith(t);)t=t.slice(0,-1);if(!t)return``}return t}function tt(e){if(!e)return``;let t=e.match(/github\.com\/([^/?#]+\/[^/?#]+?)(?:\.git)?(?:[/?#]|$)/iu);return t?t[1]:e}function nt(e){if(!e)return null;let t=e.trim().replace(/\/$/u,``);return t?/^https?:\/\//iu.test(t)?t:/^github\.com\//iu.test(t)?`https://${t}`:`https://github.com/${t}`:null}var rt=/^(?:@[\w.-]+\/)?[\w.-]+@[^/\s@]+$/u;function it(e){return rt.test(e||``)}function at(e){if(e==null||typeof e==`string`)return{id:e??``,prefix:``,commit:``};let t=l(e);return{id:typeof e.github==`string`?e.github:``,prefix:t?`${t}/`:``,commit:re(e)}}function ot(e,t,n,r=``){if(it(e))return null;let i=at(t),a=at(n),o=ne(r);if(i.id){let t=c({repo:{github:i.id}}),n=nt(t??i.id),r=ie(t,c({repo:{github:a.id}}));return`${n}/blob/${i.commit||(r?a.commit:``)||(r||!Ge(e)?o:``)||`HEAD`}/${i.prefix}${Xe(e)}`}if(V(e))return null;let s=nt(a.id);return s?`${s}/blob/${a.commit||o||`HEAD`}/${a.prefix}${e}`:null}function st(e,t){let n=e?.file??``,r=U(e,t);return r?k`<a href="${ct(r)}" target="_blank" rel="noopener">${n}</a>`:n}function ct(e){return e.replace(/#L\d+(?:-L?\d+)?$/u,``)}function lt({start:e,end:t}){return t>e?`#L${e}-L${t}`:`#L${e}`}function U(e,t){if(!e)return null;if(s(e.location))return e.location;let n=ot(e.file,e.repo,t,e.auditedCommit);if(!n)return null;let r=K(e.line);if(r)return`${n}${lt(r)}`;let i=parseInt(e.line,10);return Number.isFinite(i)?`${n}#L${i}`:n}var ut=/^https?:\/\/(?:www\.)?github\.com\/([^/\s]+\/[^/\s]+)\/(?:blob|tree|blame)\/[^/\s]+\/(\S+)$/u,dt=/#L(\d+)(?:-L?(\d+))?$/u;function ft(e){let t=typeof e==`string`?ut.exec(e):null;if(!t)return``;let n=t[2],r=dt.exec(n);if(!r)return`${t[1]}/${n}`;n=n.slice(0,r.index);let i=r[2]?`${r[1]}-${r[2]}`:r[1];return`${t[1]}/${n}:${i}`}var pt=/^(?:\s+\S|[-*+] |\d+[.)] |>|#{1,6}(?:[ \t]|$)|\||`{3}|~{3})/u;function mt(e){return e.split(/(\n{2,})/u).map(e=>{if(/^\n+$/u.test(e))return e;let t=e.split(`
|
|
3
|
+
`);return t.some(e=>pt.test(e)||G.test(e))?e:t.map(e=>e.trim()).filter(Boolean).join(` `)}).join(``)}function ht(e,t,n){let r=t?/^\n*/u.exec(e)[0]:``,i=e.slice(r.length),a=n?/\n*$/u.exec(i)[0]:``;return r+mt(i.slice(0,i.length-a.length))+a}function gt(e){if(!e)return e;let t=e.replaceAll(`\r
|
|
4
|
+
`,`
|
|
5
|
+
`),n=u(t);if(n.length===0)return mt(t);let r=[],i=0;for(let[e,a]of n)e>i&&r.push(ht(t.slice(i,e),i>0,!0)),r.push(t.slice(e,a)),i=a;return i<t.length&&r.push(ht(t.slice(i),!0,!1)),r.join(``)}var _t=/^( *)(`{3,}|~{3,})(.*)$/u,vt=/^[a-z0-9+#._-]{1,20}$/u;function yt(e,t){let n=0;for(;n<t&&e[n]===` `;)n++;return e.slice(n)}function bt(e){let t=e.split(`
|
|
6
|
+
`),n=_t.exec(t[0]),r=(n?.[2]??"```").slice(0,3),i=(n?.[3]??``).trim().split(/\s+/u)[0].toLowerCase(),a=!!(t.length>1?_t.exec(t.at(-1)):null)?.[2].startsWith(r),o=n?.[1].length??0,s=t.slice(1,a?-1:void 0);return{lang:vt.test(i)?i:``,code:(o>0?s.map(e=>yt(e,o)):s).join(`
|
|
7
|
+
`)}}function xt(e){let t=u(e||``);if(t.length===0)return[e];let n=[],r=0,i=(e,t)=>{let r=(t?e.replace(/^\n+/u,``):e).replace(/\n+$/u,``);r&&n.push(r)};for(let[a,o]of t)a>r&&i(e.slice(r,a),r>0),n.push(bt(e.slice(a,o))),r=o;return r<e.length&&i(e.slice(r),!0),n}var W=/^( *)(?:[-*+]|(\d{1,9})[.)]) +(?=\S)/u,G=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/u;function St(e){return/^ */u.exec(e)[0].length}function Ct(e){let t=e.length;for(;t>0&&!e[t-1].trim();)t--;return e.slice(0,t).join(`
|
|
8
|
+
`)}function wt(e){let t=[],n=0;for(let r of e)t.push(n),n+=r.length+1;return t}function Tt(e){let t=typeof e==`string`?e:``;if(!t)return[e];let n=u(t),r=t.split(`
|
|
9
|
+
`),i=wt(r),a=e=>!d(n,i[e])&&!G.test(r[e])&&W.test(r[e]),o=[],s=0,c=0,l=e=>{let t=r.slice(s,e).join(`
|
|
10
|
+
`).replace(/^\n+/u,``).replace(/\n+$/u,``);t.trim()&&o.push(t)};for(;c<r.length;){if(!a(c)){c++;continue}l(c);let e=W.exec(r[c]),t=!!e[2],u=[],f=null,p=!1;for(;c<r.length;){let e=r[c];if(!d(n,i[c])){if(!e.trim()){f.lines.push(``),p=!0,c++;continue}let n=St(e),r=G.test(e)?null:W.exec(e);if(r&&(!f||n<f.column)){if(!!r[2]!==t)break;f&&u.push(Ct(f.lines)),f={column:r[0].length,lines:[e.slice(r[0].length)]},p=!1,c++;continue}if(n<f.column&&(p||Et.test(e)||G.test(e)||kt.test(e)))break}f.lines.push(yt(e,f.column)),p=!1,c++}f&&u.push(Ct(f.lines)),o.push({ordered:t,start:t?Number(e[2]):null,items:u}),s=c}return o.length===0?[e]:(l(r.length),o)}var Et=/^ {0,3}(#{1,6})[ \t]+(\S.*?)(?:[ \t]+#+)?[ \t]*$/u,Dt=/^ {0,3}-+[ \t]*$/u;function Ot(e){let t=e.split(`
|
|
11
|
+
`),n=[],r=0,i=e=>{let i=t.slice(r,e).join(`
|
|
12
|
+
`).replaceAll(/^(?:[ \t]*\n)+|(?:\n[ \t]*)+$/gu,``);i.trim()&&n.push(i)};return t.forEach((e,a)=>{let o=Et.exec(e),s=G.test(e)&&(a===r||!t[a-1].trim()||!Dt.test(e));!o&&!s||(i(a),n.push(o?{level:o[1].length,text:o[2]}:{rule:!0}),r=a+1)}),n.length===0?[e]:(i(t.length),n)}var kt=/^ {0,3}>/u,At=/^ {0,3}> ?/u,jt=/^[ \t]*\[!(note|tip|important|warning|caution)\][ \t]*$/iu,Mt=/^ {0,3}(?:`{3}|~{3})/u,Nt=/^(?: {0,3}> ?| *(?:[-*+]|\d{1,9}[.)])(?: +|$))*/u,Pt=16,Ft=e=>Et.test(e)||G.test(e)||Mt.test(e);function It(e,t){let n=_t.exec(t);return n?e?n[2][0]===e[0]&&n[2].length>=e.length&&!n[3].trim()?``:e:n[2][0]==="`"&&n[3].includes("`")?``:n[2]:e}function Lt(e){let t=0,n=e.length;for(;t<n&&!e[t].trim();)t++;for(;n>t&&!e[n-1].trim();)n--;return e.slice(t,n).join(`
|
|
13
|
+
`)}function Rt(e,{alerts:t=!0}={}){let n=typeof e==`string`?e:``;if(!/^ {0,3}>/mu.test(n))return[e];let r=u(n),i=n.split(`
|
|
14
|
+
`),a=wt(i),o=e=>kt.test(i[e])&&!d(r,a[e]),s=[],c=0,l=0;for(;l<i.length;){if(!o(l)){l++;continue}l>c&&s.push(i.slice(c,l).join(`
|
|
15
|
+
`));let e=[],n=``,r=!1;for(;l<i.length;l++){let t=i[l];if(o(l)){let i=t.replace(At,``),a=n!==``;n=It(n,i);let o=i.replace(Nt,``);r=!a&&!n&&o.trim()!==``&&!Ft(o),e.push(i)}else if(r&&t.trim()&&!Ft(t)&&!W.test(t))e.push(t);else break}let a=t?jt.exec(e[0]):null,u=a?Lt(e.slice(1)):``;s.push({quote:!0,alert:u?a[1].toLowerCase():null,body:u||Lt(e)}),c=l}return c<i.length&&s.push(i.slice(c).join(`
|
|
16
|
+
`)),s}function zt(e,t=Pt){return t<=0?e:Rt(e).map(e=>typeof e==`string`?e:zt(e.body,t-1)).join(`
|
|
17
|
+
`)}var Bt=/^(\d+)(?:\s*-\s*(\d+))?$/u;function K(e){if(typeof e==`number`)return Number.isFinite(e)&&e>=1?{start:Math.floor(e),end:Math.floor(e)}:null;let t=Bt.exec(String(e??``).trim());if(!t)return null;let n=parseInt(t[1],10),r=t[2]===void 0?n:parseInt(t[2],10);return!Number.isFinite(n)||n<1||!Number.isFinite(r)||r<1?null:{start:Math.min(n,r),end:Math.max(n,r)}}function Vt(e){return e?e.start===e.end?String(e.start):`${e.start}-${e.end}`:``}function Ht(e){if(e&&typeof e==`object`){let t=K(e.start);if(!t)return null;let n=K(e.end)??t;return{start:t.start,end:Math.max(t.start,n.end)}}return K(e)}function Ut(e,t,n=4){let r=typeof e==`string`&&e!==``?e.split(`
|
|
18
|
+
`):[];if(r.length===0)return{text:``,startLine:1,lines:[]};let i=Ht(t),a=i&&{start:Math.min(i.start,r.length),end:Math.min(i.end,r.length)},o=a?Math.max(1,a.start-n):1,s=a?Math.min(r.length,a.end+n):Math.min(r.length,n*2+1),c=r.slice(o-1,s);return{text:c.join(`
|
|
19
|
+
`),startLine:o,lines:c}}function Wt(e,t,n,r){if(s(e?.url))return e.url;let i=e?.file;if(typeof i!=`string`||i===``)return null;let a=t?.file??``,o=t?.repo?.github,c=t?.auditedCommit,l=()=>o?U({file:i,line:e?.line,repo:t.repo,auditedCommit:c},n):null;if(r===0&&i===a)return l();let u=qe(i);return u!==null&&u===qe(a)?l():Ge(i)?null:o&&!Ge(a)?l():U({file:i,line:e?.line,auditedCommit:c},n)}function Gt(e,{spaced:t=!1,link:n=e=>e.url,lineLinks:r=!1}={}){let i=Array.isArray(e?.evidence)?e.evidence:[];return i.length===0?``:i.map((e,t)=>{let i=y(e),a=n(e,t),s=[`${t+1}. ${a?`[${i}](${a})`:r?Ce(i):i}`],c=r?Jt(o(e),a):o(e);if(c)for(let e of c.split(`
|
|
20
|
+
`))s.push(` ${e}`);return s.join(`
|
|
21
|
+
`)}).join(t?`
|
|
22
|
+
|
|
23
|
+
`:`
|
|
24
|
+
`)}function Kt(e,{repoFallback:t}={}){let n=t!==void 0,r=Gt(e,{link:n?(n,r)=>Wt(n,e,t,r):void 0,lineLinks:n});return r?`**Evidence:**
|
|
25
|
+
${r}`:``}var qt=/\(\s*(?:lines?|L)\s*(\d+)(?:\s*(?:-|–|—|to)\s*L?(\d+))?\s*\)/giu;function Jt(e,t){if(!e||!t||!ut.test(t)||!/\(\s*(?:lines?|L)\s*\d/iu.test(e))return e;let n=ct(t),r=e=>{let t=Yt(e);return e.replace(qt,(e,r,i,a)=>{let o=d(t,a)?null:K(i?`${r}-${i}`:r);return o?`([${e.slice(1,-1).trim()}](${n}${lt(o)}))`:e})},i=``,a=0;for(let[t,n]of u(e))i+=r(e.slice(a,t))+e.slice(t,n),a=n;return i+r(e.slice(a))}function Yt(e){let t=[],n=[...e.matchAll(/`+/gu)].map(e=>[e.index,e.index+e[0].length]),r=[],i=new Map;for(let e=n.length-1;e>=0;e--){let t=n[e][1]-n[e][0];r[e]=i.get(t),i.set(t,e)}for(let e=0;e<n.length;e++)r[e]!==void 0&&(t.push([n[e][0],n[r[e]][1]]),e=r[e]);let[a,o,s,c]=[`
|
|
26
|
+
`,`]`,`)`,`>`].map(t=>{let n=Array.from({length:e.length+1},()=>1/0);for(let r=e.length-1;r>=0;r--)n[r]=e[r]===t?r:n[r+1];return n}),l=t.length,u=0;for(let n=0;n<e.length;n++){for(;u<l&&t[u][1]<=n;)u++;if(u<l&&t[u][0]<=n){n=t[u][1]-1;continue}let r=-1;if(e[n]===`[`&&o[n+1]<a[n]){r=o[n+1]+1;let t=e[r]===`(`?s[r]:e[r]===`[`?o[r+1]:1/0;t<a[r]&&(r=t+1)}else if(e[n]===`<`&&c[n+1]<a[n])r=c[n+1]+1;else if((e[n]===`h`||e[n]===`H`)&&/^https?:\/\//iu.test(e.slice(n,n+8))&&!/\w/u.test(e[n-1]??``))for(r=n;r<e.length&&!/\s/u.test(e[r]);)r++;r>n&&(t.push([n,r]),n=r-1)}t.sort((e,t)=>e[0]-t[0]);let d=[];for(let[e,n]of t){let t=d.at(-1);t&&e<t[1]?t[1]=Math.max(t[1],n):d.push([e,n])}return d}function Xt(e){let t=/^\[([^\]]+)\]\(([^)\s]+)\)$/u.exec(e);return!t||!s(t[2])?null:{label:f(t[1].trim())||t[2],url:t[2]}}function Zt(e,t){let n=parseInt(e?.line,10);if(!Number.isFinite(n))return j;let r=U(e,t),i=`line ${n}`;return r?k`<a href="${r}" target="_blank" rel="noopener">${i}</a>`:i}function Qt(e,t){return!e||!t?null:`${/^https?:/iu.test(e)?e.replace(/\/$/u,``):`https://github.com/${e}`}/commit/${t}`}var $t=[[`Impact`,`impact`],[`Reproduction`,`reproduction`],[`Recommendation`,`recommendation`],[`Confidence reason`,`confidenceReason`],[`Revalidation verdict`,`revalidateVerdict`],[`Revalidation recommendation`,`revalidateRecommendation`]];function en(e,t){let n=[];t&&n.push(`Repo: ${t}`);let r=y(e);r&&n.push(`Location: ${r}`),e?.confidence!=null&&n.push(`Confidence: ${e.confidence}/10`);let i=R(e);i&&n.push(`Revalidation: ${i}`);let a=[];n.length>0&&a.push(n.join(`
|
|
27
|
+
`));let{title:o,body:s}=v(e);o&&a.push(`# ${o}`),s&&a.push(s.trim());let c=Gt(e,{spaced:!0});c&&a.push(`# Evidence
|
|
28
|
+
|
|
29
|
+
${c}`);for(let[t,n]of $t){if(!L&&n.startsWith(`revalidate`))continue;let r=_(e?.[n],e)?.trim();r&&a.push(`# ${t}
|
|
30
|
+
|
|
31
|
+
${r}`)}return a.join(`
|
|
32
|
+
|
|
33
|
+
`)}function tn(e,{title:t,body:n,labels:r=[]}={}){let i=nt(e);if(!i)return null;let a;try{a=new URL(i).host.toLowerCase()}catch{return null}if(a!==`github.com`)return null;let o=new URLSearchParams;t&&o.set(`title`,t),n&&o.set(`body`,n),r.length>0&&o.set(`labels`,r.join(`,`));let s=o.toString();return s?`${i}/issues/new?${s}`:`${i}/issues/new`}var nn=/^[a-zA-Z\d](?:-?[a-zA-Z\d])*$/u,rn=/^[a-zA-Z\d._-]+$/u,an=/^[1-9]\d{0,9}$/u,on=/^[a-fA-F\d]{7,40}$/u,sn=/^#[\w-]+$/u,cn=/^GHSA(?:-[0-9a-z]{4}){3}$/u;function ln(e){return e.length<=39&&nn.test(e)}function un(e){return e.length<=100&&e!==`.`&&e!==`..`&&rn.test(e)}function dn(e){let t;try{t=new URL(e)}catch{return null}if(t.href!==e||t.protocol!==`https:`||t.hostname.toLowerCase()!==`github.com`||t.port||t.username||t.password)return null;let n=t.pathname.split(`/`);if(n.at(-1)===``&&n.pop(),n.length===3&&n[1]===`advisories`){let e=n[2];return cn.test(e)?{url:`https://github.com/advisories/${e}`,label:e}:null}if(n.length===6&&n[3]===`security`&&n[4]===`advisories`){let[,e,t,,,r]=n;return!ln(e)||!un(t)||!cn.test(r)?null:{url:`https://github.com/${e}/${t}/security/advisories/${r}`,label:r}}if(n.length!==5)return null;let[,r,i,a,o]=n;if(!ln(r)||!un(i))return null;let s;if(a===`issues`||a===`pull`){if(!an.test(o))return null;s=`${r}/${i}#${o}`}else if(a===`commit`){if(!on.test(o))return null;s=`${r}/${i}@${o.slice(0,7)}`}else return null;return{url:`https://github.com/${r}/${i}/${a}/${o}${sn.test(t.hash)?t.hash:``}`,label:s}}var fn=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/u;function pn(e){if(typeof e!=`string`)return null;let t=mn(e);return t!==e||fn.test(e)?t.slice(0,8):null}function mn(e){let t=String(e);return t.startsWith(`https://chatgpt.com/codex/cloud/security/findings/`)?t.slice(50):t}function hn(e,n){let r=t(e,{managed:n});if(!r)return null;let i=pn(r.id);return{url:n?r.path:`#${r.fragment}`,label:i?`finding ${i}`:`finding`,self:!0}}var gn=/https?:\/\/[^\s<>"'`(){}[\]|\\^]+/giu,_n=new Set([`)`,`.`,`,`,`!`,`?`,`;`,`:`,`'`,`"`,`*`,`]`,`}`,`>`]);function vn(e){let t=e.length;for(;t>0&&_n.has(e[t-1]);)t--;return t===e.length?e:e.slice(0,t)}function yn(e,{managed:t=!1}={}){if(typeof e!=`string`||e.length===0)return[];let n=[],r=0;gn.lastIndex=0;let i;for(;(i=gn.exec(e))!==null;){let a=vn(i[0]),o=a?dn(a)??hn(a,t):null;o&&(i.index>r&&n.push(e.slice(r,i.index)),n.push(o),r=i.index+a.length,gn.lastIndex=r)}return r<e.length&&n.push(e.slice(r)),n}var bn={commit:T},xn=8;function Sn(e){let t;try{t=e?JSON.parse(e):null}catch{return null}let n=e=>typeof e==`string`&&e?e:null;return t&&{tags:Array.isArray(t.tags)?t.tags.filter(n):[],details:typeof t.title==`string`?{title:t.title,authorName:n(t.authorName),authorLogin:n(t.authorLogin),date:Number.isSafeInteger(t.date)?t.date:null}:null}}function Cn({title:e,authorName:t,authorLogin:n,date:r}){let i=document.createElement(`div`);i.className=`tooltip-commit-details`;let a=document.createElement(`span`);a.className=`tooltip-commit-message`,a.textContent=e;let o=document.createElement(`span`);return o.className=`tooltip-commit-meta`,o.textContent=[t&&n&&t!==n?`${t} (@${n})`:t??(n&&`@${n}`),r===null?``:new Date(r).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})].filter(Boolean).join(` · `),i.append(...e?[a]:[],o),i}var q;function wn(){return q||(q=document.createElement(`div`),q.id=`styled-tooltip`,q.setAttribute(`popover`,`manual`),document.body.append(q),q)}function Tn(e){typeof e.showPopover==`function`&&(e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover())}var J=null,En=``,Y=null,X=null,Dn=0,On=0,kn=!1;function Z(){if(!kn){kn=!0,document.addEventListener(`mousemove`,e=>{Dn=e.clientX,On=e.clientY},{passive:!0});for(let e of[`pointerdown`,`wheel`,`scroll`])document.addEventListener(e,()=>$(),{capture:!0,passive:!0});document.addEventListener(`keydown`,e=>{e.key===`Escape`&&$()}),window.addEventListener(`blur`,()=>$())}}var An=100,jn=14,Mn=8,Q=8;function Nn(e,{placement:t=`cursor`}={}){Z(),clearTimeout(Y),Y=null,X=null,e.prepareTooltip?.(e),t=e.dataset.tooltipPlacement??t;let n=wn(),i=e.dataset.tooltip??``,a=Object.hasOwn(bn,e.dataset.tooltipIcon??``)?e.dataset.tooltipIcon:``,o=e.dataset.tooltipRepo??``,s=r(e.dataset.tooltipCommit),c=Sn(e.dataset.tooltipCommitInfo),l=[`stasis`,`sourcemap`].includes(e.dataset.tooltipBundle)?e.dataset.tooltipBundle:``,u=e.dataset.tooltipStats??``,d=e.dataset.tooltipBuilt===`true`,f=e.dataset.tooltipPackage??``,p=e.dataset.tooltipEcosystem??``,m=e.dataset.tooltipVersion??``,h=e.dataset.tooltipFiles??``,g=e.dataset.tooltipLoc??``,_=e.dataset.tooltipSize??``,v=e.tooltipContent??null,y=v??JSON.stringify([i,a,o,s,c,l,u,d,f,p,m,h,g,_]);if(!i){$();return}if(J===e&&En===y)return;if(n.textContent=a||v?``:i,v){let e=document.createElement(`div`);e.className=`tooltip-rich`,ee(v,e),n.append(e)}if(a){let e=document.createElement(`span`);e.className=`tooltip-text`,e.innerHTML=N(bn[a]);let t=document.createElement(`span`);t.textContent=i,e.append(t),n.append(e)}if(f){let t=document.createElement(`div`);t.className=`tooltip-package`;let r=(e.querySelector(`[data-tooltip-package-icon] svg`)??e.querySelector(`svg`))?.cloneNode(!0);r&&t.append(r);let i=document.createElement(`span`);i.className=`tooltip-package-details`;let a=(e,t)=>/^\d+$/u.test(e)?`${Number(e).toLocaleString()} ${t}`:``;for(let e of[f,m,a(h,h===`1`?`file`:`files`),a(g,`LoC`),_].filter(Boolean)){let t=document.createElement(`span`);t.textContent=e,i.append(t)}t.append(i),n.append(t)}if(o||s){let e=document.createElement(`div`);if(e.className=`tooltip-repo`,o){e.innerHTML=N(w);let t=document.createElement(`span`);t.textContent=o,e.append(t)}if(s){let t=document.createElement(`span`);t.className=`tooltip-commit`,t.innerHTML=N(T);let n=document.createElement(`span`);n.textContent=s.slice(0,7),t.append(n),e.append(t)}if(n.append(e),s&&c?.tags.length){let e=document.createElement(`div`);e.className=`tooltip-tags`;for(let t of c.tags.slice(0,xn)){let n=document.createElement(`span`);n.className=`tooltip-tag`,n.innerHTML=N(b);let r=document.createElement(`span`);r.textContent=t,n.append(r),e.append(n)}if(c.tags.length>xn){let t=document.createElement(`span`);t.className=`tooltip-tag-more`,t.textContent=`+${(c.tags.length-xn).toLocaleString()} more`,e.append(t)}n.append(e)}}if(c?.details&&n.append(Cn(c.details)),l||u||d){let e=document.createElement(`div`);if(e.className=`tooltip-bundle`,l===`stasis`){let t=document.createElement(`img`);t.src=`./stasis.svg`,t.alt=``,e.append(t)}else e.innerHTML=N(C);let t=document.createElement(`span`);t.textContent=[l===`stasis`?`Stasis`:l===`sourcemap`?`Sourcemap`:``,d?`Built on server`:``,u].filter(Boolean).join(` · `),e.append(t),n.append(e)}Tn(n),n.style.left=`0px`,n.style.top=`0px`,n.style.transform=`none`,n.classList.add(`visible`);let x=Dn,S=On+jn;if(t===`right`||t===`right-start`){let n=e.getBoundingClientRect();x=n.right+Mn,S=n.top+(t===`right`?n.height/2:0)}let E=window.innerWidth-n.offsetWidth-Q,D=Math.max(Q,Math.min(x,E));n.style.left=`${Math.round(D)}px`;let O=n.offsetHeight,k=t===`right`?S-O/2:S,A=window.innerHeight-O-Q,j=Math.max(Q,Math.min(k,A));n.style.top=`${Math.round(j)}px`,J=e,En=y}function $(e){e&&!e.contains(J)&&!e.contains(X)||(clearTimeout(Y),Y=null,X=null,q&&(q.classList.remove(`visible`),typeof q.hidePopover==`function`&&q.matches(`:popover-open`)&&q.hidePopover()),J=null)}function Pn(e,{gate:t,placement:n}={}){Z();let r=()=>e.isConnected!==!1&&(!Object.hasOwn(e.dataset,`tooltipTruncated`)||e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&(!t||t(e));if(!r()){$();return}e===J||e===X||($(),X=e,Y=setTimeout(()=>{Y=null,X=null,r()&&Nn(e,{placement:n})},An))}var Fn=new WeakSet;function In(e,t){for(let n of e.composedPath()){if(n===t)break;if(n.nodeType===1&&Object.hasOwn(n.dataset,`tooltip`))return n}return null}function Ln(e,t){!e||Fn.has(e)||(Fn.add(e),e.ownerDocument&&Z(),e.addEventListener(`mouseover`,n=>{if(n.buttons){$();return}let r=In(n,e);if(!r){$();return}r!==J&&Pn(r,t)}),e.addEventListener(`mouseout`,t=>{let n=In(t,e),r=t.relatedTarget?.closest?.(`[data-tooltip]`)??null;n&&n===r||$()}),e.addEventListener(`scroll`,()=>$(e),{capture:!0,passive:!0}))}var Rn=!1;function zn(){Rn||(Rn=!0,Z(),document.addEventListener(`tooltip-root-connected`,e=>{Ln(e.composedPath()[0]?.shadowRoot)}),document.body.addEventListener(`mouseover`,e=>{if(e.target.closest(`[data-tooltip-managed]`))return;if(e.buttons){$();return}let t=e.target.closest(`[data-tooltip]`);!t||t===J||Pn(t)}),document.body.addEventListener(`mouseout`,e=>{e.target.closest(`[data-tooltip-managed]`)||e.relatedTarget?.closest?.(`[data-tooltip-managed]`)||!J&&!Y||(J??X)?.contains(e.relatedTarget)||$()}))}function Bn(e){return`tree-`+e.replaceAll(/[^\w-]+/gu,`_`)}var Vn=()=>Object.fromEntries(p.map(e=>[e,0]));function Hn(e,t){let n=new Map;for(let r of e)for(let e of r){n.has(e.file)||n.set(e.file,Vn());let r=n.get(e.file),i=m(e,t);r[i]!==void 0&&r[i]++}return n}var Un={trees:[],merged:null};function Wn(e){let t=e.map(e=>e?.tree??null);return t.length===Un.trees.length&&t.every((e,t)=>e===Un.trees[t])||(Un={trees:t,merged:Gn(e)}),Un.merged}function Gn(e){let t=null;for(let n of e)if(n?.tree){t||={};for(let e of Object.keys(n.tree)){let r=n.tree[e];if(!t[e]){t[e]={...r,imports:[...r.imports??[]]};continue}let i=new Set(t[e].imports);for(let n of r.imports??[])i.has(n)||(i.add(n),t[e].imports.push(n));t[e].size==null&&r.size!=null&&(t[e].size=r.size)}}return t}function Kn(e,t){let n=Object.keys(e),r=new Map(n.map((e,t)=>[e,t])),i=n.map(()=>Vn()),a=n.map(()=>[]);for(let[t,i]of n.entries())for(let n of e[i].imports??[]){let e=r.get(n);e!==void 0&&a[e].push(t)}let o=new Uint32Array(n.length),s=0;for(let[e,n]of t){let t=r.get(e);if(t===void 0||!n)continue;let c=p.map(e=>[e,n[e]??0]).filter(([,e])=>e!==0);if(c.length===0)continue;let l=++s,u=[],d=e=>{o[e]!==l&&(o[e]=l,u.push(e))};for(let e of a[t])d(e);for(;u.length>0;){let e=u.pop();for(let[t,n]of c)i[e][t]+=n;for(let t of a[e])d(t)}}return new Map(n.map((e,t)=>[e,i[t]]))}function qn(e,t,n){let r=t.get(e),i=n.get(e);return Jn(r)>0||Jn(i)>0}function Jn(e){if(!e)return 0;let t=0;for(let n of p)t+=e[n]??0;return t}function Yn(e){if(!e)return null;let t=He(),n=RegExp(`^(?:.*/)?${t}/(@[^/]+/[^/]+|[^/]+)`,`u`),r=e.match(n);return r?r[1]:`__own__`}function Xn(e){return new Set(e.filter(e=>!V(e)))}var Zn=[`#4e9af1`,`#f28e2b`,`#59a14f`,`#e15759`,`#76b7b2`,`#edc948`,`#b07aa1`,`#ff9da7`,`#9c755f`,`#5cd1e5`,`#f1ce63`,`#d37295`,`#a0cbe8`,`#86bcb6`,`#8cd17d`,`#b6992d`,`#499894`,`#e15759`,`#e879c7`,`#d4a6c8`],Qn=[`#2f8aef`,`#d2691e`,`#2ea043`,`#e63946`,`#2e9a92`,`#b88817`,`#9560e8`,`#d24a9c`,`#8a5d40`,`#0891b2`,`#a07a14`,`#c14e8e`,`#1f7ad0`,`#549b94`,`#3fb95f`,`#a07a14`,`#2a8278`,`#cb2c40`,`#c026d3`,`#965f93`];function $n(){if(typeof document>`u`)return!1;let e=document.body?.classList;return!!e&&(e.contains(`theme-light`)||e.contains(`theme-pink`)||e.contains(`theme-w95`)||e.contains(`theme-paper`))}var er=new Map;function tr(e){let t=$n()?Qn:Zn;return t[e%t.length]}var nr=()=>$n()?`#8c959f`:`#6e7681`;function rr(e){let t=$n(),n=t?Qn:Zn,r=e??`__own__`,i=`${t?`l`:`d`}:${r}`;if(er.has(i))return er.get(i);let a=0;for(let e of r)a=a*37+e.codePointAt(0)|0;let o=n[((a%n.length+n.length)%n.length*7+3)%n.length];return er.set(i,o),o}function ir(e,t){if(!t||t===`/`||t===`__own__`)return e;for(let n of[`node_modules`,`dependencies`,He()]){let r=n+`/`+t+`/`,i=e.indexOf(r);if(i>=0)return e.slice(i+r.length)}return e.startsWith(t+`/`)?e.slice(t.length+1):e}function ar(e){let t=e.origFile??e.file,n=ir(t,e.pkg),r=n===t?t:`${a(e.pkg)}/${n}`;return r===t?e.file:r}var or={package:`@babel/core`,path:/^lib\/config\//u},sr={package:`@babel/core`,path:/^lib\/config\/files\/(?:module-types|plugins)\.js$/u},cr=Object.freeze([{id:`react-native-codegen-discovery`,reason:`Codegen discovers package metadata and React Native configuration.`,from:{package:`react-native`,path:/^scripts\/codegen\/generate-artifacts-executor\.js$/u},to:{path:/(?:^|\/)(?:package\.json|react-native\.config\.js)$/u}},{id:`react-native-release-version`,reason:`The CLI release checker reads the installed React Native version.`,from:{package:`@react-native-community/cli-tools`,path:/^build\/releaseChecker\/index\.js$/u},to:{package:`react-native`,path:/^package\.json$/u}},{id:`react-native-platform-config`,reason:`React Native configuration loads platform CLIs supplied by the host project.`,from:{package:`react-native`,path:/^react-native\.config\.js$/u},to:{package:/^@react-native-community\/cli-platform-(?:android|ios)$/u,path:/^build\/index\.js$/u}},{id:`babel-project-config`,reason:`Babel discovers project configuration.`,from:or,to:{path:/(?:^|\/)babel\.config\.js$/u}},{id:`babel-typescript-preset`,reason:`Babel configuration loads the TypeScript preset.`,from:or,to:{package:`@babel/preset-typescript`,path:/./u}},{id:`babel-react-native-preset`,reason:`Babel config loaders load the configured React Native preset.`,from:sr,to:{package:`@react-native/babel-preset`,path:/^(?:src\/)?index\.js$/u}},{id:`babel-reanimated-plugin`,reason:`Babel config loaders load the configured Reanimated plugin, including scoped copies.`,from:sr,to:{package:/^(?:@[^/]+\/)?react-native-reanimated$/u,path:/^plugin\/index\.js$/u}},{id:`babel-transform-plugin`,reason:`Babel config loaders load configured transform plugins.`,from:sr,to:{package:/^@babel\/plugin-transform-[^/]+$/u,path:/^lib\/index\.js$/u}},{id:`cosmiconfig-config`,reason:`Cosmiconfig loads discovered configuration, including dependency configuration.`,from:{package:`cosmiconfig`,path:/^dist\/loaders\.js$/u},to:{path:/\.config\.js$/u}},{id:`import-fresh-own-config`,reason:`import-fresh loads host-project configuration.`,from:{package:`import-fresh`,path:/./u},to:{path:/\.config\.js$/u},ownSourceOnly:!0}].map(e=>Object.freeze({...e,from:Object.freeze(e.from),to:Object.freeze(e.to)})));function lr(e){return typeof e==`string`&&!e.includes(`\\`)&&!e.includes(`:`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`)}function ur(e,t){let n=e.package;return n!==void 0&&t.ownSource===!0?!1:(n===void 0||(typeof n==`string`?n===t.package:n.test(t.package??``)))&&e.path.test(t.path)}function dr(e,t){if(e?.ownSource!==!0&&lr(e?.path)&&lr(t?.path))return cr.find(n=>(!n.ownSourceOnly||t.ownSource===!0)&&ur(n.from,e)&&ur(n.to,t))}function fr(e,t){let n=e.split(/(?:^|\/)node_modules\//u).slice(1).at(-1)?.match(/^(@[^/]+\/[^/]+|[^/]+)\/(.+)$/u);return{package:n?.[1],path:n?.[2]??e.replace(/^\/+/u,``),ownSource:t??i(e)===`__own__`}}function pr(e,t,n,r){return!dr(fr(e,r),fr(t,n))}function mr(e,t=e=>e.file){let n=new Map(e.nodes.map(e=>[e.file,e])),r=new Map(e.nodes.map(e=>[t(e),new Set]));for(let[i,a]of e.importsOf){let o=n.get(i);if(o)for(let s of a){let a=n.get(s);a&&pr(o.origFile??i,a.origFile??s,e.ownSourceFiles?.has(s),e.ownSourceFiles?.has(i))&&r.get(t(o)).add(t(a))}}return r}var hr=class{constructor(e){this.nodes=[...e];for(let[e,t]of this.nodes.entries())t.position=e;for(let e=(this.nodes.length>>1)-1;e>=0;e--)this.down(e)}before(e,t){return Math.abs(e.balance)>Math.abs(t.balance)||Math.abs(e.balance)===Math.abs(t.balance)&&(e.balance>t.balance||e.balance===t.balance&&e.tie<t.tie)}swap(e,t){let n=this.nodes,r=n[e];n[e]=n[t],n[t]=r,n[e].position=e,n[t].position=t}down(e){let t=this.nodes;for(;2*e+1<t.length;){let n=2*e+1;if(n+1<t.length&&this.before(t[n+1],t[n])&&n++,!this.before(t[n],t[e]))break;this.swap(e,n),e=n}}update(e){if(e.position<0)return;let t=e.position;for(;t>0;){let n=t-1>>1;if(!this.before(e,this.nodes[n]))break;this.swap(t,n),t=n}this.down(t)}take(){let e=this.nodes[0],t=this.nodes.pop();return e.position=-1,this.nodes.length>0&&(this.nodes[0]=t,t.position=0,this.down(0)),e}};function gr(e,t){for(let n=0;n<8;n++){let r=!1;for(let i=0;i<e.length-1;i++){let a=n%2?e.length-2-i:i,o=e[a],s=e[a+1];(t.get(s)?.get(o)?.cycleCount??0)<=(t.get(o)?.get(s)?.cycleCount??0)||(e[a]=s,e[a+1]=o,r=!0)}if(!r)break}return e}function _r(e){let t=[],n=new Set;for(let t of e.values())t.outgoing.sort((e,t)=>t[1]-e[1]||e[0].tie-t[0].tie);for(let r of e.values()){if(n.has(r))continue;let e=[{node:r,next:0}];for(n.add(r);e.length>0;){let r=e.at(-1);if(r.next===r.node.outgoing.length){t.push(r.node.id),e.pop();continue}let i=r.node.outgoing[r.next++][0];n.has(i)||(n.add(i),e.push({node:i,next:0}))}}return t.toReversed()}function vr(e,t){let n=new Map(e.map((e,t)=>[e,t])),r=0;for(let e of t.values())for(let[t,i]of e.outgoing)n.get(e.id)<n.get(t.id)&&(r+=i);return r}function yr(e,t){let n=vr(e,t),r=n,i=0;for(let a=0;a<e.length-1;a++)n-=t.get(e[a]).originalBalance,n>r&&(r=n,i=a+1);return[...e.slice(i),...e.slice(0,i)]}function br(e,t){if(e.length<2)return e;let n=new Map(e.map((e,t)=>[e,{id:e,tie:t,balance:0,incoming:[],outgoing:[]}]));for(let e of n.values())for(let r of t.get(e.id)?.values()??[]){let t=n.get(r.to);!t||t===e||!r.cycleCount||(e.outgoing.push([t,r.cycleCount]),t.incoming.push([e,r.cycleCount]),e.balance+=r.cycleCount,t.balance-=r.cycleCount)}for(let e of n.values())e.originalBalance=e.balance;let r=[],i=new hr(n.values()),a=[];for(;i.nodes.length>0;){let e=i.take();e.balance>=0?r.push(e.id):a.push(e.id);for(let[t,n]of e.outgoing)t.position<0||(t.balance+=n,i.update(t));for(let[t,n]of e.incoming)t.position<0||(t.balance-=n,i.update(t))}let o=e,s=vr(e,n);for(let i of[[...r,...a.toReversed()],_r(n),e,e.toReversed()]){let e=gr(yr(i,n),t),r=vr(e,n);r>s&&(o=e,s=r)}return o}function xr(e,t){let n=new Set(e),r=new Map(e.map(e=>[e,[]]));for(let[e,i]of t)for(let t of i)n.has(e)&&n.has(t)&&r.get(t).push(e);let i=[],a=new Set;for(let r of e){if(a.has(r))continue;a.add(r);let e=[[r,(t.get(r)??[])[Symbol.iterator]()]];for(;e.length>0;){let[r,o]=e.at(-1),s=o.next();if(s.done){i.push(r),e.pop();continue}n.has(s.value)&&!a.has(s.value)&&(a.add(s.value),e.push([s.value,(t.get(s.value)??[])[Symbol.iterator]()]))}}let o=new Map,s=[];for(let e of i.toReversed()){if(o.has(e))continue;let t=[],n=s.length,i=[e];for(o.set(e,n);i.length>0;){let e=i.pop();t.push(e);for(let t of r.get(e))o.has(t)||(o.set(t,n),i.push(t))}s.push(t.toSorted())}return{groups:s,componentOf:o}}function Sr(e,{expanded:t=new Set,order:n=`structure`,query:r=``,neighborhood:i=null,cyclesOnly:o=!1}={}){let s=new Map,c=new Map,l=new Map;for(let n of e.nodes){let e=t.has(n.pkg),r=`${e?`f`:`p`}:${e?n.file:n.pkg}`;s.has(r)||s.set(r,{id:r,pkg:n.pkg,file:e?n.file:null,label:e?ar(n):a(n.pkg),files:[],size:0,issues:0,incoming:0,outgoing:0,importers:0,dependencies:0});let i=s.get(r);i.files.push(n.file),i.size+=n.size??0,i.issues+=n.totalIssues??0,c.set(n.file,r),l.set(n.file,n.origFile??n.file)}let u=new Map,d=new Set,f=new Set,p=new Map([...s.keys()].map(e=>[e,new Set])),m=0;for(let[t,n]of e.importsOf){let r=c.get(t);if(r)for(let i of new Set(n)){let n=c.get(i);if(!n)continue;u.has(r)||u.set(r,new Map),u.get(r).has(n)||u.get(r).set(n,{from:r,to:n,count:0,cycleCount:0,examples:[]});let a=u.get(r).get(n);a.count++;let h=pr(l.get(t),l.get(i),e.ownSourceFiles?.has(i),e.ownSourceFiles?.has(t));a.examples.length<80&&(!o||h)&&a.examples.push([t,i]),m++,s.get(r).outgoing++,s.get(n).incoming++,r!==n&&(f.add(r),d.add(n)),h&&(a.cycleCount++,(r!==n||s.get(r).file)&&p.get(r).add(n))}}let h=[...s.keys()].toSorted(),{groups:g,componentOf:_}=xr(h,p),v=new Set(g.flatMap(e=>e.length>1||p.get(e[0]).has(e[0])?e:[]));for(let e of s.values())e.cyclic=v.has(e.id),e.component=_.get(e.id);let y=e.ownSourcePackages??new Set(e.layerRoots?.roots??[]),b=e=>e.pkg===`__own__`?0:y.has(e.pkg)?1:2,x=e=>d.has(e.id)&&f.has(e.id)?0:1,S=new Map(g.map((e,t)=>[t,e.reduce((e,t)=>Math.min(e,b(s.get(t))),2)])),C=(e,t)=>e.pkg.localeCompare(t.pkg)||e.label.localeCompare(t.label),w=new Map;if(n===`structure`){for(let e of g)if(!(e.length<2))for(let t of Map.groupBy(e,e=>b(s.get(e))).values())br(t.toSorted((e,t)=>C(s.get(e),s.get(t))),u).forEach((e,t)=>w.set(e,t))}if(o){m=0,d.clear(),f.clear();for(let e of s.values())e.incoming=0,e.outgoing=0}for(let[e,t]of u){for(let n of t.values())if(n.cyclic=n.cycleCount>0&&v.has(e)&&_.get(e)===_.get(n.to)&&(e!==n.to||s.get(e).file!==null),o){if(!n.cyclic){t.delete(n.to);continue}n.count=n.cycleCount,m+=n.count,s.get(e).outgoing+=n.count,s.get(n.to).incoming+=n.count,e!==n.to&&(f.add(e),d.add(n.to))}t.size===0&&u.delete(e)}for(let[e,t]of u)for(let n of t.keys())e!==n&&(s.get(e).dependencies++,s.get(n).importers++);let T=r.trim().toLowerCase(),E=new Set(h.filter(e=>!T||s.get(e).files.some(e=>e.toLowerCase().includes(T))||s.get(e).label.toLowerCase().includes(T))),D=new Set(i?[i]:E);if(T||i)for(let[e,t]of u)for(let n of t.keys())(i?e===i:E.has(e))&&D.add(n),(i?n===i:E.has(n))&&D.add(e);let O=(e,t)=>{if(n===`structure`){let n=S.get(e.component)-S.get(t.component);if(n)return n;let r=x(e)-x(t);if(r)return r;let i=e.component-t.component;if(i)return i}let r=b(e)-b(t);if(r)return r;if(n===`importers`)return t.importers-e.importers||C(e,t);if(n===`imports`)return t.dependencies-e.dependencies||C(e,t);let i=x(e)-x(t);if(i)return i;if(n===`structure`&&e.component===t.component){let n=(w.get(e.id)??0)-(w.get(t.id)??0);if(n)return n}return C(e,t)},k=[...s.values()].filter(e=>D.has(e.id)&&(!o||e.cyclic)).toSorted(O),A=new Map(k.map((e,t)=>[e.id,t])),j=[];for(let[e,t]of u)if(A.has(e))for(let n of t.values())A.has(n.to)&&j.push({...n,row:A.get(e),col:A.get(n.to)});return{rows:k,byId:s,cells:u,visibleCells:j,index:A,matches:E,importCount:m,totalRows:s.size,cycleCount:g.filter(e=>v.has(e[0])).length}}export{te as a,ie as b,ae as c,N as d,ce as e,P as f,le as g,F as h,ue as i,de as j,fe as k,pe as l,me as m,I as n,ge as o,ve as p,be as q,xe as r,Se as s,Ce as t,we as u,Te as v,R as w,Ee as x,De as y,Oe as z,ke as A,je as B,Me as C,Ne as D,Ve as E,He as F,V as G,We as H,Je as I,Ye as J,Ze as K,Qe as L,$e as M,et as N,tt as O,st as P,U as Q,ft as R,gt as S,xt as T,Tt as U,Ot as V,Pt as W,Rt as X,zt as Y,K as Z,Vt as _,Ut as $,Wt as aa,Kt as ba,Xt as ca,Zt as da,Qt as ea,en as fa,tn as ga,pn as ha,mn as ia,yn as ja,Nn as ka,$ as la,Pn as ma,Ln as na,zn as oa,Bn as pa,Hn as qa,Wn as ra,Kn as sa,qn as ta,Jn as ua,Yn as va,Xn as wa,tr as xa,nr as ya,rr as za,br as Aa,ir as Ba,ar as Ca,pr as Da,mr as Ea,xr as Fa,Sr as Ga};
|
|
34
|
+
/*! Bundled license information:
|
|
35
|
+
|
|
36
|
+
lit-html/directives/class-map.js:
|
|
37
|
+
(**
|
|
38
|
+
* @license
|
|
39
|
+
* Copyright 2018 Google LLC
|
|
40
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
+
*)
|
|
42
|
+
*/
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Jb as e,Kb as t,Lb as n,Nb as r,Ob as i,Pb as a,Ub as o,jc as s,pc as c,w as l}from"./chunk-OFZYEWBH.js";import{j as u,k as d}from"./chunk-BRO77PQY.js";import{e as f,f as p,g as m,j as h}from"./chunk-QRKFPLA4.js";import{c as g}from"./chunk-2XUEZHIP.js";var _=`.md-quote,.md-alert{margin:0;&:not(:first-child),+*{margin-top:.5lh}>:first-child{margin-top:0}>:last-child{margin-bottom:0}}.md-quote{padding-inline-start:.85em;border-inline-start:.25em solid rgb(from currentcolor r g b / .3);color:rgb(from currentcolor r g b / calc(alpha*.78));.md-quote{color:inherit}}.md-alert{--md-alert: var(--info);padding:.35lh .85em;border-inline-start:.25em solid var(--md-alert);background:rgb(from var(--md-alert) r g b / .06);border-radius:0 var(--ui-radius, 4px) var(--ui-radius, 4px) 0}.md-alert-tip{--md-alert: var(--green)}.md-alert-important{--md-alert: var(--purple)}.md-alert-warning{--md-alert: var(--warning)}.md-alert-caution{--md-alert: var(--critical)}.md-alert-title{display:flex;align-items:center;gap:.45em;margin-bottom:.2lh;color:var(--md-alert);font-weight:600}.md-alert-icon{flex:none;width:1.05em;height:1.05em}
|
|
2
|
+
`,v=`.token.comment,.token.prolog,.token.cdata{color:var(--code-comment);font-style:italic}.token.punctuation{color:var(--muted)}.token.string,.token.attr-value,.token.char,.token.regex{color:var(--code-string)}.token.number,.token.boolean,.token.constant,.token.symbol{color:var(--code-number)}.token.keyword,.token.builtin,.token.important,.token.atrule{color:var(--code-keyword)}.token.function,.token.class-name,.token.tag{color:var(--code-function)}.token.operator,.token.entity,.token.url,.token.attr-name,.token.selector{color:var(--code-operator)}.token.variable,.token.property,.token.parameter{color:var(--code-variable)}.token.annotation{color:var(--code-function)}.token.deleted{color:var(--code-deleted)}.token.inserted{color:var(--code-inserted)}.token.italic{font-style:italic}.token.bold{font-weight:700}.code-control{padding:0 .3em;margin:0 .1em;border-radius:3px;font-size:.8em;line-height:0;font-style:normal;font-weight:400;color:var(--warning);background:rgb(from var(--warning) r g b / .14);box-shadow:inset 0 0 0 1px rgb(from var(--warning) r g b / .45);white-space:nowrap;user-select:none}
|
|
3
|
+
`,y=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`,b=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.8" y="5" width="20.4" height="14" rx="2"/><path d="M5.6 15.6V8.4l3.1 3.6 3.1-3.6v7.2"/><path d="M16.9 8.4v7.2m-2.6-2.9 2.6 2.9 2.6-2.9"/></svg>`,x=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M6 9V2h12v7"/><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><rect x="6" y="14" width="12" height="8"/></svg>`;function S(e,t){let n=u.find(t=>t.value===e)?.label??e;return d(e)?.includes(`partial`)?t===`exclude`?`${n} (full only)`:t===`only`?`${n} (partial only)`:n:n}function C(e){return h.filter(t=>e.has(t)).map(e=>f[e]??e).join(`, `)}function w(r=l){let i=[];if(r.filterSeverities.size>0&&i.push({key:`severity`,label:`Severity`,value:C(r.filterSeverities),clear:{filterSeverities:new Set}}),r.filterColors.size>0&&i.push({key:`marks`,label:`Marks`,value:[...r.filterColors].map(e=>m[e]??e).join(`, `),clear:{filterColors:new Set}}),r.filterSources.size===1&&i.push({key:`source`,label:`Source`,value:r.filterSources.has(`own`)?`Sources only`:`Dependencies only`,clear:{filterSources:new Set}}),r.filterAnalyzer&&i.push({key:`analyzer`,label:`Analyzer`,value:r.filterAnalyzer===e?`(none)`:r.filterAnalyzer,clear:{filterAnalyzer:``}}),r.filterModel&&i.push({key:`model`,label:`Model`,value:r.filterModel===n?`(none)`:r.filterModel,clear:{filterModel:``}}),r.filterValidationModel&&i.push({key:`validationModel`,label:`Validation model`,value:r.filterValidationModel===n?`(none)`:r.filterValidationModel,clear:{filterValidationModel:``}}),r.filterRepo&&i.push({key:`repo`,label:`Repository`,value:r.filterRepo===t?`(no repo)`:r.filterRepo,clear:{filterRepo:``}}),d(r.filterRevalidate)&&i.push({key:`revalidate`,label:`Revalidation`,value:S(r.filterRevalidate,r.filterPartial),clear:{filterRevalidate:``,filterPartial:``}}),!r.filterRevalidate&&(r.filterConfMin>0||r.filterConfMax<10)){let e;e=r.filterConfMin>0&&r.filterConfMax<10?`${r.filterConfMin}\u2013${r.filterConfMax}`:r.filterConfMin>0?`\u2265 ${r.filterConfMin}`:`\u2264 ${r.filterConfMax}`,i.push({key:`confidence`,label:`Confidence`,value:e,clear:{filterConfMin:0,filterConfMax:10}})}r.filterInclude&&i.push({key:`search`,label:r.filterIncludeNegate?`Excluding`:`Search`,value:`"${r.filterInclude}"`,clear:{filterInclude:``,filterIncludeNegate:!1}});for(let[e,t]of[[`filterComment`,`comment`],[`filterIssue`,`issue`],[`filterFix`,`fix`],[`filterFlagged`,`flag`]]){let n=r[e];n&&i.push({key:`annotation:${t}`,label:`Annotation`,value:`${n===`with`?`With`:`Without`} ${t}`,clear:{[e]:``}})}return!l.currentWorkspace&&r.filterDuplicates&&i.push({key:`duplicates`,label:`Duplicates`,value:r.filterDuplicates===`with`?`Only rows linked to other reports`:`Exclude rows linked to other reports`,clear:{filterDuplicates:``}}),r.filterCrossContext&&i.push({key:`cross-context`,label:`Context`,value:r.filterCrossContext===`with`?`Only rows across multiple repos or packages`:`Exclude rows across multiple repos or packages`,clear:{filterCrossContext:``}}),r.filterAppStacked&&i.push({key:`app-stacked`,label:`App stack`,value:r.filterAppStacked===`with`?`Only rows with multiple App findings`:`Exclude rows with multiple App findings`,clear:{filterAppStacked:``}}),r.filterSecurity&&i.push({key:`security`,label:`Security`,value:r.filterSecurity===`with`?`Only security-related rows`:`Exclude security-related rows`,clear:{filterSecurity:``}}),i}function T(){return c().filter(e=>s(e).commonTriage===l.shownTriage)}function E(){return l.shownTriage?p[l.shownTriage]??l.shownTriage:null}function D(e,t=r()){let n=T(),s=n.length;i(t);let c;try{c=o(n).length}finally{a()}return{included:c,total:s,excluded:s-c,fields:t,filters:w(t),bucketLabel:E(),focusedOnly:e===`print`&&l.viewMode===`focus`}}var O=`.managed-comment{container:managed-comment / inline-size;white-space:normal}.managed-comment-row{display:grid;grid-template-columns:minmax(0,max-content) minmax(0,1fr) auto;align-items:start;gap:.35rem .65rem;line-height:1.5}.managed-comment-author{grid-column:1;grid-row:1;display:flex;align-items:center;gap:.45rem;min-width:0;max-width:14rem;& strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}}.managed-comment-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:1.3rem;height:1.3rem;overflow:hidden;border-radius:50%;background:rgb(from var(--muted) r g b / .15);color:var(--muted);font-size:.65rem;font-weight:600;& img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}& img[hidden]{display:none}}.managed-comment-body{grid-column:2;grid-row:1;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;& a{color:var(--accent);text-decoration:none}& a:hover{text-decoration:underline}& a.comment-self-ref{text-decoration:underline dotted;text-underline-offset:2px}& a.comment-self-ref:hover{text-decoration:underline solid}}.managed-comment-time{color:var(--muted);font-size:.7rem;font-weight:400;white-space:nowrap;text-align:right}.managed-comment-meta{grid-column:3;grid-row:1;justify-self:end;display:flex;align-items:center;gap:.5rem;min-height:1.3rem}.managed-comment-actions{display:flex;align-items:center;gap:.15rem}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr) auto;.managed-comment-body{grid-column:1}.managed-comment-meta{grid-column:2}}@container managed-comment (max-width: 28rem){.managed-comment-row:has(.managed-comment-meta){grid-template-columns:minmax(0,max-content) minmax(0,1fr);.managed-comment-meta{grid-column:1 / -1;grid-row:1}.managed-comment-author,.managed-comment-body{grid-row:2}}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr)}.managed-comment-author{max-width:9rem}}
|
|
4
|
+
`;export{_ as a,v as b,y as c,b as d,x as e,w as f,T as g,E as h,D as i,O as j};
|