codecharta-visualization 2.7.0 → 2.9.0

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.
@@ -0,0 +1 @@
1
+ import{e as $o,h as or,i as rr,j as sr,k as ar,l as cr,o as Rn,p as Bn,q as _r}from"./chunk-T52C2UQI.js";import{A as z,Aa as Yi,Bc as Nn,Bj as qo,C as Ze,Cj as zo,D as y,Db as Ji,Df as xo,E as D,Eg as Nt,Ej as Xo,F as T,Fa as Et,Fb as v,Fc as eo,Ff as yo,Fj as Yo,G as ee,Ga as Dt,Gb as we,Gc as to,Gi as Be,Gj as Zo,Ha as V,Hb as Se,Hi as kt,Ia as ge,Ih as Lo,Ij as Jo,Ja as Ce,Jh as Ao,K as U,Ka as he,Kf as Co,Kj as Qo,L as ie,La as x,Lf as wo,Lg as Eo,Lj as er,Ma as L,Mg as Do,Mi as Fo,Mj as tr,Ml as fr,Na as ae,Nf as So,O as ji,Oa as Tt,Oj as nr,Pd as ke,Pi as Go,Pj as ir,Pl as gr,Qh as No,Ql as xr,Rd as oo,Ri as Vo,Rj as dr,Rl as yr,Sh as ko,Sj as lr,Sl as Cr,T as c,Tc as no,Tf as bo,Th as Re,Tj as pr,Tl as wr,Uf as vo,Uj as hr,Va as Le,Vd as ro,Wa as oe,Wd as so,Wh as Ro,Xa as Ae,Xd as ao,Xh as Bo,Y as P,Yb as Qi,Z as qi,_j as Fn,a as p,aa as bt,ab as Ne,ak as ur,am as Sr,b as m,ba as vt,bk as mr,bm as Rt,c as St,cb as g,ck as Gn,cm as Vn,db as te,dc as It,dm as le,em as br,fa as O,fb as $,ga as S,gb as M,ge as co,ha as b,hf as po,ia as ye,ib as Qe,if as Ot,jf as ho,ka as N,kf as uo,la as k,lf as ve,lj as Ho,ma as _,mf as Pt,mh as _e,na as d,nf as Mt,nh as To,oa as l,od as io,of as et,pa as w,pf as kn,ph as Io,qa as Z,qb as Zi,qf as Lt,qh as Oo,qj as Wo,ra as J,rf as ue,rh as Po,rj as Uo,sa as de,se as lo,sf as mo,sh as Mo,ta as q,tf as fo,ua as A,uf as At,va as zi,vf as go,wa as E,wj as Ko,xa as Je,xf as _o,xj as jo,ya as u,za as Xi}from"./chunk-6XSAPXQT.js";function K(t,n,e){let i=t.get(n);i?i.push(e):t.set(n,[e])}function tt(t){return t.reduce((n,e)=>Math.min(n,e),Number.POSITIVE_INFINITY)}function Ee(t){return t.reduce((n,e)=>Math.max(n,e),Number.NEGATIVE_INFINITY)}var sc={x:0,y:0,width:0,height:0};function Hn(t,n){return t.x<n.x+n.width&&n.x<t.x+t.width&&t.y<n.y+n.height&&n.y<t.y+t.height}function me(t){if(t.length===0)return sc;let n=tt(t.map(r=>r.x)),e=tt(t.map(r=>r.y)),i=Ee(t.map(r=>r.x+r.width)),o=Ee(t.map(r=>r.y+r.height));return{x:n,y:e,width:i-n,height:o-e}}var it=.94,Bt={x:0,y:1},ac=1;function Ir(t,n,e){let i=Math.max(t.width,t.height)*ac,o=ot({x:-i,y:-i,width:t.width+2*i,height:t.height+2*i},n,1),r=dc(e,o)?o:cc(t,[o,e],n);return{xAxis:{type:"value",show:!1,min:r.x[0],max:r.x[1]},yAxis:{type:"value",show:!1,inverse:!0,min:r.y[0],max:r.y[1]}}}function cc(t,n,{width:e,height:i}){let o=t.width/2,r=t.height/2,s=Math.max(...n.flatMap(({x:f})=>f.map(C=>Math.abs(C-o)))),a=Math.max(...n.flatMap(({y:f})=>f.map(C=>Math.abs(C-r)))),h={x:o-s,y:r-a,width:2*s,height:2*a};return ot(h,{width:e,height:i},1)}function dc(t,n){return n.x[0]<=t.x[0]&&t.x[1]<=n.x[1]&&n.y[0]<=t.y[0]&&t.y[1]<=n.y[1]}function Or({x:t,y:n}){let e=[];return e[Bt.x]={type:"inside",xAxisIndex:0,filterMode:"none",startValue:t[0],endValue:t[1]},e[Bt.y]={type:"inside",yAxisIndex:0,filterMode:"none",startValue:n[0],endValue:n[1]},e}function Pr({x:t,y:n}){return{type:"dataZoom",batch:[{dataZoomIndex:Bt.x,startValue:t[0],endValue:t[1]},{dataZoomIndex:Bt.y,startValue:n[0],endValue:n[1]}]}}function Mr(t,n){let[e]=t.boxes;return ot(e??{x:0,y:0,width:t.width,height:t.height},n,it)}var vr={share:.8,maxPixelsPerUnit:1.5};function Lr(t,n,e,i){let o=new Set(t),r=n.boxes.filter(a=>o.has(a.path));if(r.length===0)return null;let s=me(r);return i&&lc(kr(i,e),s)?i:ot(s,e,vr.share,vr.maxPixelsPerUnit)}function lc({x:t,y:n},e){return t[0]<=e.x&&e.x+e.width<=t[1]&&n[0]<=e.y&&e.y+e.height<=n[1]}function Ar(t,n,e,i){let o={x:nt(t.x,e.x-n.x),y:nt(t.y,e.y-n.y)},r=kr(o,i);return Fe(r.x)*it<e.width||Fe(r.y)*it<e.height?ot(e,i,it):{x:nt(o.x,Er(r.x,e.x,e.x+e.width)),y:nt(o.y,Er(r.y,e.y,e.y+e.height))}}function Er(t,n,e){let i=Fe(t)*(1-it)/2;return Math.min(0,n-i-t[0])+Math.max(0,e+i-t[1])}function Nr({height:t,coveredBottom:n=0}){return Math.max(t-n,0)}function kr({x:t,y:n},e){let i=e.height>0?Nr(e)/e.height:1;return{x:t,y:[n[0],n[0]+Fe(n)*i]}}function Rr({shownWindow:t,reach:n,viewport:e},[i,o]){return{x:Dr(t.x,-i*Fe(t.x)/e.width,n.x),y:Dr(t.y,-o*Fe(t.y)/e.height,n.y)}}function Dr(t,n,[e,i]){return nt(t,Math.min(Math.max(n,e-t[0]),i-t[1]))}function nt([t,n],e){return[t+e,n+e]}function Fe([t,n]){return n-t}function ot(t,n,e,i=Number.POSITIVE_INFINITY){let o=Nr(n),r=Math.min(Math.min(n.width/t.width,o/t.height)*e,i);if(!(Number.isFinite(r)&&r>0))return pc(t);let s=n.width/r/2,a=t.x+t.width/2,h=t.y+t.height/2-o/r/2;return{x:[a-s,a+s],y:[h,h+n.height/r]}}function Br(t,n,e){return{x:Tr(t.x,n.width,e.width),y:Tr(t.y,n.height,e.height)}}function Tr([t,n],e,i){let o=(t+n)/2,r=(n-t)*i/e/2;return[o-r,o+r]}function pc({x:t,y:n,width:e,height:i}){return{x:[t,t+e],y:[n,n+i]}}var $n="other",Ft=new Map(Object.entries({class:{label:"Class",letter:"C",tint:"#dbe7f5"},valueclass:{label:"Value class",letter:"D",tint:"#d8eef0"},interface:{label:"Interface",letter:"I",tint:"#dff3e4"},enum:{label:"Enum",letter:"E",tint:"#fdecc8"},annotation:{label:"Annotation",letter:"@",tint:"#efe1f7"},function:{label:"Function",letter:"\u0192",tint:"#fde2e0"},variable:{label:"Variable",letter:"V",tint:"#e6e9ee"},[$n]:{label:"Other",letter:"?",tint:"#f1f2f4"}})),Ge={stroke:"#7d8898",letter:"#374151"},Wn=[...Ft].map(([t,n])=>p({kind:t},n));function rt(t){return Ft.get(t??$n)??Ft.get($n)}function Gt(t){return Ft.get(t)?.label??t}var W={x:0,y:0,rotation:0,scaleX:1,scaleY:1},st={cursor:"pointer"};function Ve(t){let n=m(p({type:"group"},W),{emphasisDisabled:!0,children:t});return t.length===0?m(p({},n),{$mergeChildren:!1}):n}function Fr(t,n){return m(p({},t),{children:t.children.map(e=>m(p({},e),{z2:n}))})}var Vt=[5,4],Gr=[7,4],hc=[2,4],uc=[9,3,2,3],Ht={dash:null,head:"filled"},$t="usage",De=[{usage:"inheritance",label:"Inherits from",dash:null,head:"hollow"},{usage:"implementation",label:"Implements",dash:Gr,head:"hollow"},{usage:"instantiation",label:"Creates",dash:Gr,head:"open"},{usage:"argument",label:"Takes as argument",dash:hc,head:"open"},{usage:"return_value",label:"Returns",dash:uc,head:"filled"},{usage:"constant_access",label:"Reads a constant of",dash:null,head:"dot"},p({usage:$t,label:"Uses"},Ht)],mc="feedbackContainerLevel";function at(t,n){return n==="edgeType"&&t===mc}function Wt(t,n){return at(t,n)?{dash:Vt,head:"filled"}:Ht}function Vr(t,n){return n==="edgeType"?Wt(t.type,n):De.find(e=>e.usage===fc(t))??Ht}function Un(t){return De.find(n=>t.includes(n.usage))??Ht}function fc(t){let[n,...e]=t.declarationEdges;return n===void 0||e.length>0?null:Kn(t)[0]??null}function Kn(t){let n=new Set(t.declarationEdges.flatMap(i=>i.usage));return[...De.map(i=>i.usage).filter(i=>n.delete(i)),...[...n].sort((i,o)=>i.localeCompare(o))]}function He(t){return De.find(n=>n.usage===t)?.label??t.replaceAll("_"," ")}var Wr="#1f2937",Ut="#1b9cfc",Kt="#1f2937",jt=2,ct=4,Hr=["#f4f6f9","#e9edf2","#dfe5ec","#d5dce5"],Ur="#b8c2cf",Kr="#dbe7f5",jr="#7a9cc6",$r=["#f8f6fd","#f0ecfa","#e9e3f7","#e1d9f3"],qr="#c6bce2",zr="#e6e0f7",Xr="#8f7fc7",Te="#ffffff",Yr="#f7f9fc",jn="#9aa5b4",Zr="#fbfcfe",qn="#8a94a3",zn="#c3cbd6",qt="#dc2626",be={regular:"Dependency",cyclic:"In a cycle",feedbackContainerLevel:"Points upward",feedbackLeafLevel:"Points upward and closes a cycle"};function $e(t,n){return n==="usage"?t:m(p({},t),{feedbackLeafLevel:t.feedbackContainerLevel})}function dt(t,n){let e=$e(t,n);return ve.map(i=>({type:i,label:be[i],color:e[i],ownColor:t[i],isDashed:at(i,n)}))}var Jr=.12,Qr=.3,es=1,gc=.65,_c=[1,3,5],xc=2,yc=16;function ts(t){let[n,e,i]=_c.map(o=>Number.parseInt(t.slice(o,o+xc),yc));return`rgba(${n}, ${e}, ${i}, ${gc})`}function ns(t){return Hr[Math.min(t,Hr.length-1)]}function is(t){return $r[Math.min(t,$r.length-1)]}var lt="sans-serif";var os=[0,0];function Cc(t){let n=new Map;return(e,i,o)=>{let r=`${i}|${e}`,s=n.get(r)??wc(t,e,i);n.set(r,s);let a=o/100;return[s[0]*a,s[1]*a]}}var rs,Xn=(t,n,e)=>(rs??=Cc(document.createElement("canvas").getContext("2d")),rs(t,n,e));function wc(t,n,e){if(!t)return os;t.font=`${e} 100px ${lt}`,t.textAlign="center",t.textBaseline="middle";let i=t.measureText(n),o=[(i.actualBoundingBoxLeft-i.actualBoundingBoxRight)/2,(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)/2];return o.every(Number.isFinite)?o:os}function Ie(t,n){return{color:t.feedbackContainerLevel,isDashed:at("feedbackContainerLevel",n)}}var zt={radiusPx:7,centreInsetPx:14,fontSizePx:10,lineWidthPx:.8},cs=18,Xt={radiusPx:7,centreInsetPx:14,fontSizePx:10,outlinePx:1},Sc=2,Q={heightPx:15,overhangPx:6,risePx:9,outlinePx:1.2,fontSizePx:10,numberLeftPx:17,numberRoomPx:5,digitWidthPx:6,gapPx:3},Zn="#ffffff",pt="bold",ss=99,bc={line:"M2.9 1.7A3.4 3.4 0 1 1 1.7-2.9",head:"M4.1-1.5L2.8-5.1L.3-1.2z",lineWidthPx:1.5},vc={line:"M0 4.4V-1.2",head:"M-3.3-.6L0-4.7L3.3-.6z",lineWidthPx:1.5},Ec=[3,2],We={radiusPx:3.5,lineWidthPx:2,insetPx:1},Jn=["betweenFiles","insideFiles","declaration"],ht={insideFiles:{fill:Zn,line:qt},betweenFiles:{fill:qt,line:Zn},declaration:{fill:Te,line:qt}},as="2",Qn={count:as,widthPx:Q.numberLeftPx+as.length*Q.digitWidthPx+Q.numberRoomPx,heightPx:Q.heightPx,outlinePx:Q.outlinePx,numberLeftPx:Q.numberLeftPx,fontSizePx:Q.fontSizePx,fontWeight:pt,fontFamily:lt,ringRadiusPx:We.radiusPx,ringLineWidthPx:We.lineWidthPx},Ue=[{mark:"betweenFiles",label:"Cycles between files"},{mark:"insideFiles",label:"Cycles inside a file"},{mark:"declaration",label:"Declaration in a cycle"},{mark:"upward",label:"Upward dependencies inside"}],Yt="cycleBadge",ei="upwardBadge";function Zt(t,{color:n,isDashed:e}){return t==="upward"?{colors:{fill:Zn,line:n},glyph:vc,lineDash:e?Ec:null}:{colors:ht[t],glyph:bc,lineDash:null}}function ds(t,n,{opacity:e,scale:i}){let{letter:o,tint:r}=rt(t.declarationKind),s={cx:n.x+zt.centreInsetPx*i,cy:n.y+n.height/2},a={fill:r,stroke:Ge.stroke,lineWidth:zt.lineWidthPx,opacity:e};return[m(p({type:"circle"},W),{silent:!0,shape:m(p({},s),{r:zt.radiusPx*i}),style:a}),ps(o,s,{fontSize:zt.fontSizePx*i,fill:Ge.letter,opacity:e})]}function ls(t,n,{opacity:e,scale:i}){if(t.isExpanded||t.declarationCount<Sc)return[];let o={cx:n.x+n.width-Xt.centreInsetPx*i,cy:n.y+n.height/2},r={fill:Te,stroke:qn,lineWidth:Xt.outlinePx,opacity:e};return[m(p({type:"circle"},W),{silent:!0,shape:m(p({},o),{r:Xt.radiusPx*i}),style:r}),ps(String(t.declarationCount),o,{fontSize:Xt.fontSizePx*i,fill:qn,opacity:e})]}var Dc=.7;function ti(t,n,e,{opacity:i,zoom:o}){let r={opacity:i,scale:Math.max(Dc,Math.min(1,o))};return t.kind==="declaration"?e.isInCycle?[Tc(n,r)]:[]:Ic(n,e,r)}function Tc(t,{opacity:n,scale:e}){let i={cx:t.x+t.width-We.insetPx,cy:t.y+We.insetPx},{fill:o,line:r}=ht.declaration,s={fill:o,stroke:r,lineWidth:We.lineWidthPx*e,opacity:n};return m(p({type:"circle"},W),{silent:!0,shape:m(p({},i),{r:We.radiusPx*e}),style:s})}function Ic(t,n,e){let i={right:t.x+t.width+Q.overhangPx*e.scale,top:t.y-Q.risePx*e.scale},o=(C,I)=>m(p({},Zt(C,n.upwardLine)),{info:I}),r=Yn(i,n.upwardCount,o("upward",ei),e),s=m(p({},i),{right:r.rightOfNextBadge}),a=Yn(s,n.insideFilesCount,o("insideFiles",Yt),e),h=m(p({},i),{right:a.rightOfNextBadge});return[...Yn(h,n.betweenFilesCount,o("betweenFiles",Yt),e).elements,...a.elements,...r.elements]}function Yn({right:t,top:n},e,i,o){if(e===0)return{rightOfNextBadge:t,elements:[]};let{colors:r,glyph:s,lineDash:a,info:h}=i,{opacity:f,scale:C}=o,I=e>ss?`${ss}+`:String(e),H=Q.heightPx*C,xe=Q.numberLeftPx*C,G=xe+(I.length*Q.digitWidthPx+Q.numberRoomPx)*C,se=t-G,Xe={x:se,y:n,width:G,height:H,r:H/2},Ye={fill:r.fill,stroke:r.line,lineWidth:Q.outlinePx,lineDash:a,opacity:f},Ln=n+H/2,An=p({info:h},st),wt=[m(p(p({type:"rect"},W),An),{shape:Xe,style:Ye}),...Oc(s,{x:se+H/2,y:Ln},r.line,o),p(p({},Pc(I,{x:se+xe,y:Ln},r.line,o)),An)];return{rightOfNextBadge:se-Q.gapPx*C,elements:wt}}function Oc(t,n,e,{opacity:i,scale:o}){let r=m(p(p({},W),n),{scaleX:o,scaleY:o,silent:!0}),s={fill:null,stroke:e,lineWidth:t.lineWidthPx,lineCap:"round",opacity:i};return[m(p({type:"path"},r),{shape:{pathData:t.line},style:s}),m(p({type:"path"},r),{shape:{pathData:t.head},style:{fill:e,stroke:null,opacity:i}})]}function Pc(t,n,e,{opacity:i,scale:o}){let r=Q.fontSizePx*o,[,s]=Xn(t,pt,r),a={align:"left",verticalAlign:"middle",fontSize:r,fontWeight:pt,fontFamily:lt};return m(p({type:"text"},W),{style:m(p({text:t,x:n.x,y:n.y+s},a),{fill:e,opacity:i})})}function ps(t,{cx:n,cy:e},i){let[o,r]=Xn(t,pt,i.fontSize),s={fontWeight:pt,fontFamily:lt};return m(p({type:"text"},W),{silent:!0,style:p(p({text:t,x:n+o,y:e+r,align:"center",verticalAlign:"middle"},s),i)})}function re(t){return ni(t.kind)||t.kind==="file"&&t.declarationCount>0}function ni(t){return t==="folder"||t==="package"}var R={nodeWidth:160,nodeHeight:40,padding:12,headerHeight:28,gapBetweenNodes:20,gapBetweenRows:14,gapBetweenLevels:36,declarationWidth:132,declarationHeight:26};var Mc=1,Jt=class{constructor(n,e){this.rectangleOf=e;let i=me(n.map(e)),o=Math.max(1,Math.ceil(Math.sqrt(n.length)));this.columns=hs(i.x,i.width,o),this.rows=hs(i.y,i.height,o),this.cells=Array.from({length:o*o},()=>[]);for(let r of n)this.forEachCellUnder(e(r),s=>s.push(r))}itemsNear(n){let e=new Set;return this.forEachCellUnder(n,i=>{for(let o of i)e.add(o)}),[...e]}forEachCellUnder(n,e){let[i,o]=us(this.columns,n.x,n.x+n.width),[r,s]=us(this.rows,n.y,n.y+n.height);for(let a=r;a<=s;a++)for(let h=i;h<=o;h++)e(this.cells[a*this.columns.cellCount+h])}};function hs(t,n,e){return{origin:t,cellSize:n/e||Mc,cellCount:e}}function us(t,n,e){return[ms(t,n),ms(t,e)]}function ms({origin:t,cellSize:n,cellCount:e},i){let o=Math.floor((i-t)/n);return Math.min(e-1,Math.max(0,o))}var gs={seeThroughPaths:new Set,bandCutouts:new Map},fs={width:48,height:12};function _s(t,n){let e=t.flatMap((o,r)=>o.kind==="box"?[{box:o.box,paintIndex:r}]:[]),i=new Jt(e,({box:o})=>o);return{seeThroughPaths:Lc(e,i,n),bandCutouts:Nc(t,i,n)}}function ut(t){return{left:t.x+R.padding,right:t.x+t.width-R.padding,y:t.y-R.gapBetweenLevels/2}}function Lc(t,n,e){let i=new Set;for(let o of t)re(o.box)&&n.itemsNear(o.box).some(r=>Ac(o,r,e))&&i.add(o.box.path);return i}function Ac(t,n,e){let i=!e(t.box.path,n.box.path)&&!e(n.box.path,t.box.path);return n.paintIndex<t.paintIndex&&i&&Hn(t.box,n.box)}function Nc(t,n,e){let i=new Map;return t.forEach((o,r)=>{if(o.kind!=="band")return;let s=kc(o.band,r,n).filter(h=>!e(h.path,o.band.containerPath)),a=Rc(o.band,s);(a.hiddenSpans.length>0||a.isLabelHidden)&&i.set(o.band,a)}),i}function kc(t,n,e){let i=ut(t),o={x:i.left,y:i.y,width:i.right-i.left,height:0};return e.itemsNear(me([o,xs(t)])).filter(({paintIndex:r})=>r>n).sort((r,s)=>r.paintIndex-s.paintIndex).map(({box:r})=>r)}function Rc(t,n){let{left:e,right:i,y:o}=ut(t),r=t.isTopmost?[]:n.filter(a=>a.y<=o&&o<=a.y+a.height&&a.x<i&&a.x+a.width>e).map(a=>[Math.max(e,a.x),Math.min(i,a.x+a.width)]),s=xs(t);return{hiddenSpans:r,isLabelHidden:n.some(a=>Hn(a,s))}}function xs(t){return p({x:ut(t).left,y:t.y-fs.height},fs)}var Bc={hiddenSpans:[],isLabelHidden:!1},Fc=12,Gc=11,Vc=16,Hc=10,ys=8,$c=36,Wc=4,Oe=1,Uc=2.5,Kc=2,jc=[4,4],qc=.6;function Cs(t,n,e){let i=Ds(t,e),o=Qt(n.isMissedBySearch),r=Xc(t,i,n),s=ii(t,i),a=ti(t,i,n.badges,{opacity:o,zoom:s});return Ve(t.isExpanded?r:[...r,...Ss(t,i,n,s),...a])}function ws(t,n,e){let i=Ds(t,e),o=ii(t,i),r=ti(t,i,n.badges,{opacity:Qt(n.isMissedBySearch),zoom:o});return Ve([...Ss(t,i,n,o),...r])}function ii(t,n){return n.height/t.height}function zc(t){let n=Math.min(1,t);return n<qc?null:n}function Xc(t,n,{emphasis:e,isSeeThrough:i,isMissedBySearch:o}){let r=ed(t,e),s=i?ts(r.fill):r.fill,a=Qt(o),h=m(p(p({type:"rect"},W),re(t)&&!t.isExpanded?st:{}),{shape:m(p({},n),{r:ct}),style:m(p({},r),{fill:s,opacity:a})});return[...Yc(t,n,a),h]}function Yc(t,n,e){if(!vs(t))return[];let i=Wc*Math.min(1,ii(t,n)),o=m(p({},n),{x:n.x+i,y:n.y+i,r:ct});return[m(p(p({type:"rect"},W),st),{shape:o,style:m(p({},Ts(t)),{fill:null,opacity:e})})]}function Ss(t,n,{isMissedBySearch:e},i){let o=Qt(e),r=zc(i),s=t.kind==="declaration",a={opacity:o,scale:r??0},h=bs(t)?ls(t,n,a):[],f=r===null?[]:[...h,...s?ds(t,n,a):[]],C=nd(t,n,{opacity:o,hasKindIcon:s,markScale:r??0});return C?[C,...f]:f}function bs(t){return t.kind==="file"&&t.declarationCount>0}function vs(t){return bs(t)&&!t.isExpanded}function Qt(t){return t?Qr:es}function Es(t,n,e=Bc){let i=ut(t),o=e.isLabelHidden?[]:[Zc(t,i,n)],r=t.isTopmost?[]:Jc(i,e.hiddenSpans,n);return Ve([...o,...r])}function Zc(t,{left:n},e){let[i,o]=e([n,t.y]);return m(p({type:"text"},W),{silent:!0,style:{text:`level ${t.level}`,x:i,y:o-Kc,align:"left",verticalAlign:"bottom",fontSize:Hc,fill:zn}})}function Jc({left:t,right:n,y:e},i,o){return Qc([t,n],i).map(([r,s])=>{let[a,h]=o([r,e]),[f]=o([s,e]);return m(p({type:"line"},W),{silent:!0,shape:{x1:a,y1:h,x2:f,y2:h},style:{stroke:zn,lineWidth:Oe,lineDash:jc}})})}function Qc([t,n],e){let i=[],o=t;for(let[r,s]of[...e].sort(([a],[h])=>a-h))r>o&&i.push([o,Math.min(r,n)]),o=Math.max(o,s);return o<n&&i.push([o,n]),i}function Ds(t,n){let[e,i]=n([t.x,t.y]),[o,r]=n([t.x+t.width,t.y+t.height]);return{x:e,y:i,width:o-e,height:r-i}}function ed(t,n){let e=Ts(t);return n==="selected"?m(p({},e),{stroke:Ut,lineWidth:Uc}):n==="hovered"?m(p({},e),{stroke:Kt,lineWidth:jt}):e}function Ts(t){switch(t.kind){case"declaration":return{fill:Yr,stroke:jn,lineWidth:Oe};case"file":return{fill:t.isExpanded?Zr:Te,stroke:jn,lineWidth:Oe};case"package":return t.isExpanded?{fill:is(t.depth),stroke:qr,lineWidth:Oe}:{fill:zr,stroke:Xr,lineWidth:Oe};default:return t.isExpanded?{fill:ns(t.depth),stroke:Ur,lineWidth:Oe}:{fill:Kr,stroke:jr,lineWidth:Oe}}}function td(t,n,{hasKindIcon:e,markScale:i}){let o=vs(t)?Vc*i:0,r=e?cs*i:0;return{countWidth:o,iconWidth:r,width:n.width-2*(ys+o)-r}}function nd(t,n,e){let{countWidth:i,iconWidth:o,width:r}=td(t,n,e);if(r<$c)return null;let s=t.isExpanded;return m(p({type:"text"},W),{silent:!0,style:{text:t.name,x:s?n.x+ys+i:n.x+(n.width+o)/2,y:id(t,n),width:r,overflow:"truncate",align:s?"left":"center",verticalAlign:"middle",fontSize:t.kind==="declaration"?Gc:Fc,fontWeight:ni(t.kind)?"bold":"normal",fill:Wr,opacity:e.opacity}})}function id(t,n){return t.isExpanded?n.y+od(t,n)/2:n.y+n.height/2}function od(t,n){return n.height*R.headerHeight/t.height}var rd=8,sd=4,ad=3,cd=1.5,dd=24,ld=40,pd=.35,hd=14,Is={start:1/3,end:2/3},ud=0,md=1.5,Os={extraWidthPx:6,opacity:.35},Ps=m(p({},W),{silent:!1}),fd={top:[0,-1],bottom:[0,1],left:[-1,0],right:[1,0]};function ks(t,{isDimmed:n,isSelected:e,widthPx:i,color:o,line:r},s){let a=xd(t,Ns(s(t.start)),Ns(s(t.end))),h=n?Jr:1,f={x1:a.start[0],y1:a.start[1],cpx1:a.startPull[0],cpy1:a.startPull[1],cpx2:a.endPull[0],cpy2:a.endPull[1],x2:a.end[0],y2:a.end[1]},C={fill:null,opacity:h};return Ve([...e?[gd(f,m(p({},C),{stroke:Ut,lineWidth:i+Os.extraWidthPx,opacity:Os.opacity}))]:[],m(p({type:"bezierCurve"},Ps),{shape:f,style:m(p({},C),{stroke:o,lineWidth:i,lineDash:r.dash})}),p(p({},_d(r.head,wd(a,i),{color:o,opacity:h,widthPx:i})),Ps)])}function gd(t,n){return m(p({type:"bezierCurve"},W),{silent:!0,shape:t,style:n})}function _d(t,n,{color:e,opacity:i,widthPx:o}){let r=Math.min(o,md);switch(t){case"hollow":return m(p({type:"polygon"},W),{shape:{points:n},style:{fill:Te,stroke:e,lineWidth:r,opacity:i}});case"open":{let[s,a,h]=n,f={points:[a,s,h]};return m(p({type:"polyline"},W),{shape:f,style:{fill:null,stroke:e,lineWidth:r,opacity:i}})}case"dot":{let[[s,a],h,f]=n,C=Math.hypot(h[0]-f[0],h[1]-f[1])/2;return m(p({type:"circle"},W),{shape:{cx:s,cy:a,r:C},style:{fill:e,opacity:i}})}default:return m(p({type:"polygon"},W),{shape:{points:n},style:{fill:e,opacity:i}})}}function xd(t,n,e){switch(t.bend){case"straight":return Ms(n,e,ud);case"arc":return Ms(n,e,hd);case"aside":return yd(t.startSide,n,e);default:return Cd(t,n,e)}}function yd(t,n,e){let i=Math.max(ld,Math.abs(e[1]-n[1])*pd),o=t==="left"?Math.min(n[0],e[0])-i:Math.max(n[0],e[0])+i;return{start:n,startPull:[o,n[1]],endPull:[o,e[1]],end:e}}function Ms(t,n,e){return{start:t,startPull:As(t,n,Is.start,e),endPull:As(t,n,Is.end,e),end:n}}function Cd({startSide:t,endSide:n},e,i){let r=Math.abs(t==="top"||t==="bottom"?i[1]-e[1]:i[0]-e[0]),s=Math.max(r/2,dd);return{start:e,startPull:Ls(e,t,s),endPull:Ls(i,n,s),end:i}}function Ls(t,n,e){let[i,o]=fd[n];return[t[0]+i*e,t[1]+o*e]}function As(t,n,e,i){let o=n[0]-t[0],r=n[1]-t[1],s=Math.hypot(o,r)||1;return[t[0]+o*e+r/s*i,t[1]+r*e-o/s*i]}function Ns(t){return[t[0],t[1]]}function wd({endPull:t,end:n},e){let i=Math.max(rd,e*ad),o=Math.max(sd,e*cd),r=Math.atan2(n[1]-t[1],n[0]-t[0]),s=n[0]-Math.cos(r)*i,a=n[1]-Math.sin(r)*i,h=Math.sin(r)*o,f=-Math.cos(r)*o;return[n,[s+h,a+f],[s-h,a-f]]}function fe(t,n){return`${t}/${n}`}var oi="package:";function Rs(t){return`${oi}${t}`}function Pe(t){return t.startsWith(oi)}function Bs(t){return t.slice(oi.length)}function mt(t){return t.slice(t.lastIndexOf("/")+1)}function en(t){return t.slice(0,Math.max(t.lastIndexOf("/"),0))}function Fs(t,n,e){return n!==null&&e(t.fromPath,n)!==e(t.toPath,n)}function ft(t,{selectedEdgeId:n,highlightedEdgeIds:e}){return t.id===n||e.has(t.id)}function Gs(t,n){if(t===null)return()=>!0;let e=new Set,i=o=>n.has(o)?n.get(o).parentPath??"":en(o);for(let o of t)for(let r=o;r!==""&&!e.has(r);r=i(r))e.add(r);return o=>e.has(o)||Sd(o).some(r=>t.has(r))}function Sd(t){let n=[];for(let e=en(t);e!=="";e=en(e))n.push(e);return n}var tn="graph",gt={gridIndex:0};function pe(t,n,e=`${n}s`){return`${t} ${t===1?n:e}`}function Hs(t,n,e){return({dataIndex:i})=>{let o=t[i];switch(o?.kind){case"box":return bd(o.box,e);case"edge":return Td(o.edge,n,e);default:return""}}}function bd(t,{cycleMarks:n,upwardMarks:e}){if(t.kind==="declaration")return[...[`<b>${le(t.name)}</b>`,le(t.declarationKind??"")],...Dd(n.declarationsInCycles.get(t.path))].join("<br/>");let i=Pe(t.path)?`Package ${t.name}`:mt(t.path),o=[`<b>${le(i)}</b>`];return t.isInLevelBand&&o.push(`Level ${t.level}`),o.push(...vd(t,n),...Ed(e.get(t.path)??0)),re(t)&&o.push(`<i>Double-click to ${t.isExpanded?"close":"open"}</i>`),o.join("<br/>")}function vd(t,{cyclesInsideFiles:n,cyclesBetweenFiles:e}){let i=n.get(t.path)??0,o=e.get(t.path)??0;return[...o>0?[`${pe(o,"cycle")} between files`]:[],...i>0?[`${pe(i,"cycle")} inside ${t.kind==="file"?"this file":"files"}`]:[]]}function Ed(t){return t>0?[`${pe(t,"upward dependency","upward dependencies")} inside`]:[]}function Dd(t){return[...t?.isWithOtherFiles?["In a cycle with other files"]:[],...t?.isWithinItsFile?["In a cycle inside this file"]:[]]}function Td(t,n,{edgeMetric:e}){let i=n.get(t.fromPath),o=n.get(t.toPath),r=`<b>${le(i.name)} \u2192 ${le(o.name)}</b>`;if(!ue(e))return[r,`${le(e??"")} ${Id(t.weight)}`].join("<br/>");let s=be[t.type],[a,...h]=t.declarationEdges;if(a===void 0)return[r,`${pe(t.weight,"dependency","dependencies")} \xB7 ${s}`].join("<br/>");if(h.length>0)return[r,`${t.declarationEdges.length} declaration edges \xB7 ${s}`,"<i>Click to list them</i>"].join("<br/>");let C=[Kn(t).map(He).map(le).join(", "),s].filter(Boolean).join(" \xB7 ");return i.kind==="declaration"&&o.kind==="declaration"?[r,C].join("<br/>"):[`<b>${le(a.fromLeaf)} \u2192 ${le(a.toLeaf)}</b>`,C,`drawn as ${le(i.name)} \u2192 ${le(o.name)}`].join("<br/>")}var Vs=1e3;function Id(t){return Math.round(t*Vs)/Vs}var Od={bottom:"high",top:"low",right:"low",left:"high"},Pd={low:.42,high:.58},$s=.1,Md=.5;function Ks(t,n,e){let{edgeStyle:i}=e,o=t.map(f=>Ad(n.get(f.fromPath),n.get(f.toPath),i)),r=e.isAnchoredAtSideMiddle&&Pt(i),s=e.edgeShape==="straight"&&Mt(i),a=Ld({edges:t,sides:o,byPath:n},i,r),h=new Set(t.map(f=>f.id));return t.map((f,C)=>{let{startSide:I,endSide:H}=o[C],xe=h.has(`${f.toPath}|${f.fromPath}`),G=Nd(o[C],s,xe);return{start:Us(n.get(f.fromPath),I,a(C,"start")),startSide:I,end:Us(n.get(f.toPath),H,a(C,"end")),endSide:H,bend:r&&xe&&G!=="aside"?"arc":G}})}function Ld(t,n,e){return e?()=>Md:n==="combined"?i=>Pd[js(t.sides[i])]:kd(t)}function Ad(t,n,e){return n.y>=t.y+t.height?e==="aside"?{startSide:"left",endSide:"left"}:{startSide:"bottom",endSide:"top"}:n.y+n.height<=t.y?e==="aside"?{startSide:"right",endSide:"right"}:{startSide:"top",endSide:"bottom"}:n.x>=t.x+t.width?{startSide:"right",endSide:"left"}:{startSide:"left",endSide:"right"}}function Nd({startSide:t,endSide:n},e,i){return t===n?"aside":e?i?"arc":"straight":"sCurve"}function js({startSide:t}){return Od[t]}function kd(t){let n=Rd(t),e=new Map;for(let i of n.values())i.sort((o,r)=>o.along-r.along||Ws(o.lane)-Ws(r.lane)||o.id.localeCompare(r.id)),i.forEach(({key:o},r)=>e.set(o,$s+(1-2*$s)*(r+1)/(i.length+1)));return(i,o)=>e.get(`${i}|${o}`)}function Rd({edges:t,sides:n,byPath:e}){let i=new Map;return t.forEach((o,r)=>{let s=[[o.fromPath,n[r].startSide,o.toPath,"start"],[o.toPath,n[r].endSide,o.fromPath,"end"]];for(let[a,h,f,C]of s){let I=Bd(h,e.get(f));K(i,`${a}|${h}`,{key:`${r}|${C}`,along:I,lane:js(n[r]),id:o.id})}}),i}function Ws(t){return t==="low"?0:1}function Bd(t,n){return t==="top"||t==="bottom"?n.x+n.width/2:n.y+n.height/2}function Us(t,n,e){switch(n){case"top":return[t.x+t.width*e,t.y];case"bottom":return[t.x+t.width*e,t.y+t.height];case"left":return[t.x,t.y+t.height*e];default:return[t.x+t.width,t.y+t.height*e]}}var Fd={perDoublingPx:.5,maxExtraPx:2.5},Gd={perDoublingPx:1,maxExtraPx:5};function zs(t,{thickness:n,factor:e}){return Hd(Vd(t,n)*e)}function Vd(t,n){switch(n){case"thin":return .6;case"uniform":return 1.6;case"strong":return qs(t,Gd);default:return qs(t,Fd)}}function qs(t,{perDoublingPx:n,maxExtraPx:e}){return 1.2+Math.min(e,Math.log2(t)*n)}function Hd(t){return Math.round(t*100)/100}function Xs(t){let n=new Map(t.map(e=>[e.path,e.parentPath]));return(e,i)=>{for(let o=e;o!=null;o=n.get(o))if(o===i)return!0;return!1}}var Ys=new WeakMap;function nn(t){let n=Ys.get(t);if(n)return n;let e={byPath:new Map(t.boxes.map(i=>[i.path,i])),isInside:Xs(t.boxes)};return Ys.set(t,e),e}function on(t){let n=new Map,e=[];return t.forEach((i,o)=>{i.depth>0&&K(n,e[i.depth-1],o),i.isExpanded&&(e[i.depth]=o)}),n}function ri(t,n){let{boxes:e}=t;if(e.length===0)return[];let i=on(e),o=Wd(t.bands),r=h=>n.indexOf(e[h].path),s=[],a=h=>{let f=e[h];s.push({kind:"box",box:f});for(let I of o.get(f.path)??[])s.push({kind:"band",band:I});[...i.get(h)??[]].sort((I,H)=>r(I)-r(H)||I-H).forEach(a)};return a(0),s}function si(t){let n=[],e=[];for(let i of t){if(i.kind==="box"&&!i.box.isExpanded){e.push(i);continue}n.push(i),i.kind==="box"&&e.push({kind:"title",box:i.box})}return{underEdges:n,overEdges:e}}function ai(t,n,e){let{underEdges:i,overEdges:o}=si(ri(t,n));return $d([...i,...o],e)}function $d(t,[n,e]){for(let i=t.length-1;i>=0;i--){let o=t[i];if(o.kind==="box"&&n>=o.box.x&&n<=o.box.x+o.box.width&&e>=o.box.y&&e<=o.box.y+o.box.height)return o.box.path}return null}function Wd(t){let n=new Map;for(let e of t)K(n,e.containerPath,e);return n}var Ud=0,Kd=Number.POSITIVE_INFINITY,jd={x:[0,2],y:[1,3]};function Zs(t,n,e){let{byPath:i,isInside:o}=nn(t.layout),r=h=>Fs(h,t.hoveredPath,o),s=Jd(t,r),a=qd(t,s,{byPath:i,isInside:o,isOfHovered:r});return m(p({animation:!1,aria:{enabled:!0,label:{description:ol(t.layout,s)}},hoverLayerThreshold:Kd,tooltip:{show:!0,confine:!0,formatter:Hs(a.items,i,t)},grid:{left:0,right:0,top:0,bottom:0}},Ir(t.layout,n,e)),{dataZoom:Or(e),series:[zd(a,i)]})}function qd(t,n,e){let i=ri(t.layout,t.raisedPaths),o=t.raisedPaths.length>0?_s(i,e.isInside):gs,r=Gs(t.searchedPaths,e.byPath),s=nl(t),a=I=>m(p({},tl(I,t,o,r(I.path))),{badges:s(I)}),{underEdges:h,overEdges:f}=si(i),C=Yd(t,n,{isFound:r,isOfHovered:e.isOfHovered});return{items:[...h,...Xd(t,n,e.byPath,C),...f],draw:(I,H)=>Qd(I,a,o,H)}}function zd({items:t,draw:n},e){return{id:tn,type:"custom",data:t.map(i=>el(i,e)),encode:jd,renderItem:({dataIndex:i},o)=>Fr(n(t[i],o.coord),i),progressive:Ud,clip:!0}}function Xd(t,n,e,i){let o=Ks(n,e,t),r=tt(n.map(a=>a.weight)),s=$e(t.edgeColors,t.lineStyleShows);return n.map((a,h)=>({kind:"edge",edge:a,route:o[h],look:{isDimmed:i(a),isSelected:a.id===t.selectedEdgeId,widthPx:zs(a.weight/r,t.edgeWidth),color:s[a.type],line:Vr(a,t.lineStyleShows)}}))}function Yd(t,n,{isFound:e,isOfHovered:i}){return t.highlightedEdgeIds.size>0?o=>!ft(o,t):n.some(i)?o=>!i(o)&&!ft(o,t):o=>!e(o.fromPath)&&!e(o.toPath)&&!ft(o,t)}var Js={regular:0,cyclic:1,feedbackContainerLevel:2,feedbackLeafLevel:3},Zd=Object.keys(Js).length;function Jd(t,n){let e=s=>t.shownEdgeTypes.includes(s.type),i=s=>n(s)&&(!t.isHoverLimitedToShownEdgeTypes||e(s)),o=new Set(t.edges.filter(s=>i(s)||ft(s,t))),r=s=>Js[s.type]+(o.has(s)?Zd:0);return t.edges.filter(s=>e(s)||o.has(s)).sort((s,a)=>r(s)-r(a))}function Qd(t,n,e,i){switch(t.kind){case"box":return Cs(t.box,n(t.box),i);case"band":return Es(t.band,i,e.bandCutouts.get(t.band));case"title":return ws(t.box,n(t.box),i);default:return ks(t.route,t.look,i)}}function el(t,n){switch(t.kind){case"box":return{name:t.box.path,value:rn(t.box)};case"band":return{value:rn(t.band)};case"title":return{titledBoxPath:t.box.path,value:rn(t.box)};default:return{isEdge:!0,edgeId:t.edge.id,value:rn(me([n.get(t.edge.fromPath),n.get(t.edge.toPath)]))}}}function tl(t,n,{seeThroughPaths:e},i){let o=re(t)&&t.path===n.draggingPath;return{emphasis:il(t,n),isSeeThrough:o||e.has(t.path),isMissedBySearch:!i}}function nl({cycleMarks:t,upwardMarks:n,edgeColors:e,lineStyleShows:i}){let o=Ie(e,i);return({path:r})=>({insideFilesCount:t.cyclesInsideFiles.get(r)??0,betweenFilesCount:t.cyclesBetweenFiles.get(r)??0,isInCycle:t.declarationsInCycles.has(r),upwardCount:n.get(r)??0,upwardLine:o})}function il(t,{selectedPath:n,hoveredPath:e}){return t.path===n?"selected":t.path===e?"hovered":"none"}function rn({x:t,y:n,width:e,height:i}){return[t,n,t+e,n+i]}function ol(t,n){return`Dependency graph with ${t.boxes.filter(i=>i.kind==="file").length} files and ${n.length} edges shown, arranged in rows by level.`}var rl=(t,n)=>n.path;function sl(t,n){if(t&1){let e=A();Z(0,"li")(1,"button",1),Je("focus",function(){let o=D(e).$implicit,r=u();return T(r.focus(o.path))})("blur",function(){D(e);let o=u();return T(o.boxFocused.emit(null))})("click",function(){let o=D(e).$implicit,r=u();return T(r.boxClicked.emit(o.path))})("keydown.space",function(o){let r=D(e).$implicit,s=u();return T(s.toggleFromKeyboard(o,r))})("keyup.space",function(o){return o.preventDefault()}),J()()}if(t&2){let e=n.$implicit,i=u();c(),O("tabindex",e.path===i.tabStop()?0:-1)("aria-label",i.labelOf(e))("aria-expanded",i.canBeOpened(e)?e.isExpanded:null)("aria-pressed",e.path===i.selectedPath())}}var al={folder:"Folder",package:"Package",file:"File",declaration:"Declaration"},Qs={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1},ea=(()=>{class t{constructor(){this.boxes=M.required(),this.selectedPath=M(null),this.boxClicked=$(),this.boxToggled=$(),this.boxFocused=$(),this.lastFocusedPath=U(null),this.tabStop=g(()=>{let e=this.boxes(),i=o=>o!==null&&e.some(r=>r.path===o);return[this.lastFocusedPath(),this.selectedPath()].find(i)??e[0]?.path??null}),this.canBeOpened=re}labelOf(e){return`${al[e.kind]} ${e.name}`}focus(e){this.lastFocusedPath.set(e),this.boxFocused.emit(e)}toggleFromKeyboard(e,i){e.preventDefault(),re(i)&&this.boxToggled.emit(i.path)}moveFocus(e){let i=[...e.currentTarget.querySelectorAll("button")],o=i[i.indexOf(e.target)+(Qs[e.key]??0)];Qs[e.key]!==void 0&&o&&(e.preventDefault(),o.focus())}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-dependency-graph-box-list"]],inputs:{boxes:[1,"boxes"],selectedPath:[1,"selectedPath"]},outputs:{boxClicked:"boxClicked",boxToggled:"boxToggled",boxFocused:"boxFocused"},decls:3,vars:0,consts:[["aria-label","Boxes of the dependency graph","data-testid","dependency-graph-boxes",1,"sr-only",3,"keydown"],["type","button",3,"focus","blur","click","keydown.space","keyup.space"]],template:function(i,o){i&1&&(Z(0,"ul",0),Je("keydown",function(s){return o.moveFocus(s)}),N(1,sl,2,4,"li",null,rl),J()),i&2&&(c(),k(o.boxes()))},encapsulation:2})}}return t})();var sn=class{constructor(n){this.handlers=n,this.firstClick=null,this.doubleClick=()=>{let e=this.firstClick;this.firstClick=null,e&&ta(e,Date.now())&&(this.cancelPendingSelection(),this.handlers.onBoxToggled(e.path))}}click(n){this.firstClick=this.firstClickAfter({path:n,at:Date.now()}),this.cancelPendingSelection(),this.pendingSelection=setTimeout(()=>{this.pendingSelection=void 0,this.handlers.onBoxClicked(n)},250)}forget(){this.cancelPendingSelection(),this.firstClick=null}firstClickAfter(n){let e=this.firstClick;return!e||!ta(e,n.at)?n:e.path===n.path?e:null}cancelPendingSelection(){clearTimeout(this.pendingSelection),this.pendingSelection=void 0}};function ta(t,n){return n-t.at<=500}var ci=3,cl=0,an=class{constructor(n,e){this.chart=n,this.handlers=e,this.drag=null,this.pending=[0,0],this.hasJustDragged=!1}press(n,e){if(this.hasJustDragged=!1,!dl(e)||!this.handlers.canDragBox(n))return;let i=[e.offsetX,e.offsetY];this.drag={path:n,last:this.toLayout(e),pressedAt:i,hasMoved:!1}}move(n){let e=this.drag;if(!e)return;n.__ecRoamConsumed=!0,e.hasMoved||=Math.hypot(n.offsetX-e.pressedAt[0],n.offsetY-e.pressedAt[1])>ci;let i=this.toLayout(n);this.pending=[this.pending[0]+i[0]-e.last[0],this.pending[1]+i[1]-e.last[1]],e.last=i,this.frame??=requestAnimationFrame(()=>this.flush(e.path))}release(){let n=this.drag;this.drag=null,n&&(this.flush(n.path),this.hasJustDragged=n.hasMoved,this.handlers.onBoxDragEnded())}takeClickThatEndedDrag(){let n=this.hasJustDragged;return this.hasJustDragged=!1,n}cancel(){this.frame!==void 0&&cancelAnimationFrame(this.frame),this.frame=void 0,this.drag=null,this.pending=[0,0]}flush(n){this.frame!==void 0&&(cancelAnimationFrame(this.frame),this.frame=void 0);let[e,i]=this.pending;this.pending=[0,0],(e!==0||i!==0)&&this.handlers.onBoxDragged(n,e,i)}toLayout(n){return _t(this.chart,n)}};function dl({event:t}){return!t||!("button"in t)||t.button===cl}function _t(t,{offsetX:n,offsetY:e}){let[i,o]=t.convertFromPixel(gt,[n,e]);return[i,o]}var ll="input, textarea, select",Ke="data-panning",cn=class{constructor(){this.isPointerOver=!1,this.held=!1,this.notePointerEntered=()=>{this.isPointerOver=!0},this.notePointerLeft=()=>{this.isPointerOver=!1},this.press=n=>{if(n.key===" "){if(this.held){n.preventDefault();return}!this.isPointerOver||n.defaultPrevented||pl(n.target)||(n.preventDefault(),this.held=!0,this.container?.setAttribute(Ke,""))}},this.release=n=>{n.key===" "&&this.held&&(n.preventDefault(),this.letGo())},this.letGo=()=>{this.held=!1,this.container?.removeAttribute(Ke)}}get isHeld(){return this.held}listenOver(n){this.container=n,n.addEventListener("mouseenter",this.notePointerEntered),n.addEventListener("mouseleave",this.notePointerLeft),window.addEventListener("keydown",this.press),window.addEventListener("keyup",this.release),window.addEventListener("blur",this.letGo)}stopListening(){this.letGo(),this.container?.removeEventListener("mouseenter",this.notePointerEntered),this.container?.removeEventListener("mouseleave",this.notePointerLeft),window.removeEventListener("keydown",this.press),window.removeEventListener("keyup",this.release),window.removeEventListener("blur",this.letGo),this.container=void 0,this.isPointerOver=!1}};function pl(t){return t instanceof HTMLElement&&(t.isContentEditable||t.matches(ll))}var hl=2,ul=2,dn=class{constructor(n){this.chart=n,this.pan=null,this.swallowsNextContextMenu=!1,this.forgetThePan=()=>{this.swallowsNextContextMenu=!1},this.press=e=>{let i=e.button===hl?this.chart.view():null;if(i===null)return;let o=[e.clientX,e.clientY];this.pan={view:i,pressedAt:o,pointer:o,hasMoved:!1,hasSetPanningAttribute:!1,hasSystemAskedForMenu:!1}},this.move=e=>{let i=this.pan;if(i){if((e.buttons&ul)===0){this.release();return}i.pointer=[e.clientX,e.clientY],!(!i.hasMoved&&ml(i.pressedAt,i.pointer)<=ci)&&(i.hasMoved=!0,this.setPanningAttribute(i),this.frame??=requestAnimationFrame(()=>this.showPanned(i)))}},this.release=()=>{let e=this.pan;if(this.pan=null,!!e){if(this.showPanned(e),e.hasSetPanningAttribute&&this.container?.removeAttribute(Ke),e.hasMoved){this.swallowsNextContextMenu=!e.hasSystemAskedForMenu;return}e.openMenu?.()}},this.noteMenuAskedFor=e=>{if(this.pan){this.pan.hasSystemAskedForMenu=!0;return}this.swallowsNextContextMenu&&(this.swallowsNextContextMenu=!1,e.preventDefault(),e.stopPropagation())}}listenOver(n){this.container=n,n.addEventListener("mousedown",this.press),window.addEventListener("mousedown",this.forgetThePan,!0),window.addEventListener("mousemove",this.move),window.addEventListener("mouseup",this.release),window.addEventListener("contextmenu",this.noteMenuAskedFor,!0)}stopListening(){this.release(),this.container?.removeEventListener("mousedown",this.press),window.removeEventListener("mousedown",this.forgetThePan,!0),window.removeEventListener("mousemove",this.move),window.removeEventListener("mouseup",this.release),window.removeEventListener("contextmenu",this.noteMenuAskedFor,!0),this.container=void 0,this.swallowsNextContextMenu=!1}openMenuUnlessDragStarts(n){if(this.pan){this.pan.openMenu=n;return}n()}showPanned(n){if(this.frame!==void 0&&(cancelAnimationFrame(this.frame),this.frame=void 0),!n.hasMoved)return;let e=[n.pointer[0]-n.pressedAt[0],n.pointer[1]-n.pressedAt[1]];this.chart.show(Rr(n.view,e))}setPanningAttribute(n){n.hasSetPanningAttribute||!this.container||this.container.hasAttribute(Ke)||(n.hasSetPanningAttribute=!0,this.container.setAttribute(Ke,""))}};function ml(t,n){return Math.hypot(n[0]-t[0],n[1]-t[1])}gr([_r,Sr,xr,Cr,yr,wr]);var fl=120,ln=class{constructor(n,e){this.chartRegistry=n,this.handlers=e,this.pathUnderPointer=null,this.clickGesture=new sn(this.handlers),this.panKey=new cn,this.rightDragPan=new dn({view:()=>this.pannableView(),show:i=>this.chart?.dispatchAction(Pr(i))}),this.containerSizeObserver=new Rt,this.partClickHandlers={[Yt]:i=>this.handlers.onCycleBadgeClicked(i),[ei]:i=>this.handlers.onUpwardBadgeClicked(i)},this.containerSize=this.containerSizeObserver.size}attachTo(n){this.chart&&this.attachedContainer===n||(this.dispose(),this.attachedContainer=n,this.chart=fr(n),this.dragGesture=new an(this.chart,m(p({},this.handlers),{canDragBox:e=>!this.panKey.isHeld&&this.handlers.canDragBox(e)})),this.listenToChart(this.chart),this.listenToRenderSurface(this.chart.getZr(),this.dragGesture),this.listenToContainer(n),this.chartRegistry.register(this.chart))}render(n){this.chart&&(this.attachedContainer?.setAttribute("aria-busy","true"),this.resizeToContainer(this.chart),this.chart.setOption(n))}shownWindowFor(n){if(!this.chart||!this.chartSize)return null;let e=Br(this.shownWindow(this.chart,this.chartSize),this.chartSize,n);return[...e.x,...e.y].every(Number.isFinite)?e:null}pixelRectOf({x:n,y:e,width:i,height:o}){if(!this.chart||!this.chartSize)return null;let[r,s]=this.chart.convertToPixel(gt,[n,e]),[a,h]=this.chart.convertToPixel(gt,[n+i,e+o]);return{x:r,y:s,width:a-r,height:h-s}}dispose(){this.clickGesture.forget(),this.cancelPointerLeave(),this.reportPointerLeft(),this.attachedContainer?.removeEventListener("contextmenu",Vn),this.attachedContainer?.removeEventListener("dblclick",this.clickGesture.doubleClick),this.containerSizeObserver.disconnect(),this.panKey.stopListening(),this.rightDragPan.stopListening(),this.dragGesture?.cancel(),this.dragGesture=void 0,this.chart&&this.chartRegistry.unregister(this.chart),this.chart?.dispose(),this.chart=void 0,this.chartSize=void 0,this.attachedContainer=void 0}listenToChart(n){n.on("mousedown",e=>this.startDragging(e)),n.on("click",e=>this.reportClick(e)),n.on("mouseover",e=>this.reportPointerEntered(e)),n.on("mouseout",()=>this.reportPointerLeftAfterGrace()),n.on("contextmenu",e=>this.reportRightClick(e)),n.on("finished",()=>this.reportRendered())}listenToRenderSurface(n,e){n.on("mousemove",i=>{e.move(i),i.target||this.reportPointerOverNothing()}),n.on("mouseup",()=>e.release()),n.on("globalout",()=>{e.release(),this.reportPointerOverNothing()})}listenToContainer(n){n.addEventListener("contextmenu",Vn),n.addEventListener("dblclick",this.clickGesture.doubleClick),this.containerSizeObserver.observe(n),this.panKey.listenOver(n),this.rightDragPan.listenOver(n)}pannableView(){return!this.chart||!this.chartSize||this.chartSize.width<=0||this.chartSize.height<=0?null:{shownWindow:this.shownWindow(this.chart,this.chartSize),reach:gl(this.chart),viewport:this.chartSize}}shownWindow(n,{width:e,height:i}){let[o,r]=_t(n,{offsetX:0,offsetY:0}),[s,a]=_t(n,{offsetX:e,offsetY:i});return{x:[o,s],y:[r,a]}}resizeToContainer(n){let e=this.containerSize();e.width===this.chartSize?.width&&e.height===this.chartSize?.height||(this.chartSize=e,n.resize())}startDragging(n){let e=this.boxUnder(n);e!==null&&n.event&&this.dragGesture?.press(e,n.event)}reportClick(n){if(this.dragGesture?.takeClickThatEndedDrag())return;if(n.data?.edgeId!==void 0){this.clickGesture.forget(),this.handlers.onEdgeClicked(n.data.edgeId);return}let e=this.boxUnder(n);if(e===null)return;let i=typeof n.info=="string"?this.partClickHandlers[n.info]:void 0;if(i){this.clickGesture.forget(),i(e);return}this.clickGesture.click(e)}reportRightClick(n){let e=this.boxUnder(n),i=n.event?.event;if(e!==null&&i){let{clientX:o,clientY:r}=i;this.rightDragPan.openMenuUnlessDragStarts(()=>this.handlers.onBoxRightClicked(e,o,r))}}boxUnder(n){return n.data?.isEdge&&n.event&&this.chart?this.handlers.boxAt(_t(this.chart,n.event)):_l(n)}reportRendered(){this.attachedContainer?.setAttribute("aria-busy","false"),this.handlers.onRendered()}reportPointerEntered(n){let e=this.boxUnder(n);e!==null&&(this.cancelPointerLeave(),e!==this.pathUnderPointer&&(this.pathUnderPointer=e,this.handlers.onBoxHovered(e)))}reportPointerLeftAfterGrace(){this.cancelPointerLeave(),this.pointerLeaveTimeout=setTimeout(()=>{this.pointerLeaveTimeout=void 0,this.reportPointerLeft()},fl)}reportPointerOverNothing(){this.pathUnderPointer!==null&&this.pointerLeaveTimeout===void 0&&this.reportPointerLeftAfterGrace()}reportPointerLeft(){this.pathUnderPointer!==null&&(this.pathUnderPointer=null,this.handlers.onBoxHovered(null))}cancelPointerLeave(){this.pointerLeaveTimeout!==void 0&&(clearTimeout(this.pointerLeaveTimeout),this.pointerLeaveTimeout=void 0)}};function gl(t){let{xAxis:n,yAxis:e}=t.getOption();return{x:[n[0].min,n[0].max],y:[e[0].min,e[0].max]}}function _l({seriesId:t,name:n,data:e}){return t!==tn?null:e?.titledBoxPath||n||null}var xl=["chartContainer"];function yl(t,n){if(t&1&&(ee(),w(0,"rect",5)),t&2){let e=n.$implicit,i=u(2);O("x",e.x)("y",e.y)("width",e.width)("height",e.height)("rx",i.pointedAtOutline.cornerRadiusPx)("stroke",i.pointedAtOutline.color)("stroke-width",i.pointedAtOutline.lineWidthPx)("stroke-dasharray",i.pointedAtOutline.dashes)}}function Cl(t,n){if(t&1&&(ee(),d(0,"svg",4),N(1,yl,1,8,":svg:rect",5,ye),l()),t&2){let e=u();ge("--%NS%marching-ants-period",e.pointedAtOutline.dashPeriodPx,"px"),c(),k(e.pointedAtRects())}}var wl=()=>!1,Sl=()=>null,bl=new Set,pn={dashPx:6,gapPx:4},di=(()=>{class t{constructor(){this.scene=M.required(),this.graphIdentity=M.required(),this.fitRequest=M(0),this.viewRequest=M(null),this.coveredBottom=M(0),this.canDragBox=M(wl),this.boxAt=M(Sl),this.pointedAtPaths=M(bl),this.boxClicked=$(),this.boxToggled=$(),this.cycleBadgeClicked=$(),this.upwardBadgeClicked=$(),this.edgeClicked=$(),this.boxHovered=$(),this.boxFocused=$(),this.boxRightClicked=$(),this.rendered=$(),this.boxDragged=$(),this.boxDragEnded=$(),this.chartContainer=Qe.required("chartContainer"),this.fittedGraphIdentity=null,this.handledFitRequest=0,this.coveredBottomAtTheFit=0,this.handledViewRequest=null,this.toggledBox=null,this.pointedAtRects=U([]),this.pointedAtOutline={color:Kt,lineWidthPx:jt,cornerRadiusPx:ct,dashes:`${pn.dashPx} ${pn.gapPx}`,dashPeriodPx:pn.dashPx+pn.gapPx},this.chartHost=new ln(y(pr),{onBoxClicked:e=>this.boxClicked.emit(e),onBoxToggled:e=>this.toggle(e),onCycleBadgeClicked:e=>this.cycleBadgeClicked.emit(e),onUpwardBadgeClicked:e=>this.upwardBadgeClicked.emit(e),onEdgeClicked:e=>this.edgeClicked.emit(e),onBoxHovered:e=>this.boxHovered.emit(e),onBoxRightClicked:(e,i,o)=>this.boxRightClicked.emit({path:e,clientX:i,clientY:o}),onRendered:()=>this.reportDrawn(),canDragBox:e=>this.canDragBox()(e),onBoxDragged:(e,i,o)=>this.boxDragged.emit({path:e,deltaX:i,deltaY:o}),onBoxDragEnded:()=>this.boxDragEnded.emit(),boxAt:e=>this.boxAt()(e)}),ie(()=>this.chartHost.attachTo(this.chartContainer().nativeElement)),ie(()=>this.renderOnceTheContainerIsMeasured()),ie(()=>this.placePointedAtRects())}ngOnDestroy(){this.chartHost.dispose()}reportDrawn(){this.placePointedAtRects(),this.rendered.emit()}placePointedAtRects(){let e=this.pointedAtPaths(),i=e.size===0?[]:te(this.scene).layout.boxes.filter(o=>e.has(o.path));this.pointedAtRects.set(i.flatMap(o=>this.chartHost.pixelRectOf(o)??[]))}focusBox(e){this.boxHovered.emit(e),e!==null&&this.boxFocused.emit(e)}toggle(e){let i=this.scene().layout,o=i.boxes.find(r=>r.path===e);this.toggledBox=o?{box:o,layout:i}:null,this.boxToggled.emit(e)}renderOnceTheContainerIsMeasured(){let e=m(p({},this.chartHost.containerSize()),{coveredBottom:this.coveredBottom()});if(e.width===0||e.height===0)return;let i=this.scene();this.chartHost.render(Zs(i,e,this.windowToShow(i,e)))}windowToShow(e,i){let o=this.consumeToggledBox(e.layout),r=this.consumeDueFit(i)?null:this.shownWindowKeeping(o,i),s=this.consumeDueViewRequest();return(s&&Lr(s,e.layout,i,r))??r??Mr(e.layout,i)}shownWindowKeeping(e,i){let o=this.chartHost.shownWindowFor(i);return o&&e?Ar(o,...e,i):o}consumeToggledBox(e){let i=this.toggledBox;if(i===null||i.layout===e)return null;this.toggledBox=null;let o=e.boxes.find(r=>r.path===i.box.path);return o&&o.isExpanded!==i.box.isExpanded?[i.box,o]:null}consumeDueViewRequest(){let e=this.viewRequest();return e===null||e.id===this.handledViewRequest?null:(this.handledViewRequest=e.id,e.paths)}consumeDueFit({coveredBottom:e}){let i=this.graphIdentity(),o=this.fitRequest(),r=i!==this.fittedGraphIdentity||o>0&&o!==this.handledFitRequest,s=this.coveredBottomAtTheFit===0&&e>0;return this.fittedGraphIdentity=i,this.handledFitRequest=o,(r||s)&&(this.coveredBottomAtTheFit=e),r||s}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-dependency-graph"]],viewQuery:function(i,o){i&1&&Et(o.chartContainer,xl,5),i&2&&Dt()},hostAttrs:[1,"relative","block","h-full","w-full"],inputs:{scene:[1,"scene"],graphIdentity:[1,"graphIdentity"],fitRequest:[1,"fitRequest"],viewRequest:[1,"viewRequest"],coveredBottom:[1,"coveredBottom"],canDragBox:[1,"canDragBox"],boxAt:[1,"boxAt"],pointedAtPaths:[1,"pointedAtPaths"]},outputs:{boxClicked:"boxClicked",boxToggled:"boxToggled",cycleBadgeClicked:"cycleBadgeClicked",upwardBadgeClicked:"upwardBadgeClicked",edgeClicked:"edgeClicked",boxHovered:"boxHovered",boxFocused:"boxFocused",boxRightClicked:"boxRightClicked",rendered:"rendered",boxDragged:"boxDragged",boxDragEnded:"boxDragEnded"},decls:4,vars:3,consts:[["chartContainer",""],["data-testid","dependency-graph",1,"h-full","w-full","data-panning:*:cursor-grab!"],["aria-hidden","true","data-testid","dependency-graph-pointed-at",1,"pointer-events-none","absolute","inset-0","h-full","w-full",3,"--%NS%marching-ants-period"],[3,"boxClicked","boxToggled","boxFocused","boxes","selectedPath"],["aria-hidden","true","data-testid","dependency-graph-pointed-at",1,"pointer-events-none","absolute","inset-0","h-full","w-full"],["fill","none",1,"animate-marching-ants","motion-reduce:animate-none"]],template:function(i,o){i&1&&(w(0,"div",1,0),S(2,Cl,3,2,":svg:svg",2),d(3,"cc-dependency-graph-box-list",3),E("boxClicked",function(s){return o.boxClicked.emit(s)})("boxToggled",function(s){return o.toggle(s)})("boxFocused",function(s){return o.focusBox(s)}),l()),i&2&&(c(2),b(o.pointedAtRects().length>0?2:-1),c(),_("boxes",o.scene().layout.boxes)("selectedPath",o.scene().selectedPath))},dependencies:[ea],encapsulation:2})}}return t})();function li(t,n){if(n.size===0)return t;let e=vl(n,nn(t).isInside),i=t.boxes.map(r=>Il(r,e(r.path)));El(i);let o=new Map(i.map(r=>[r.path,r]));return m(p({},t),{boxes:i,bands:t.bands.map(r=>Tl(r,o))})}function pi(t,n){let e=t.boxes.find(i=>i.path===n);return e!==void 0&&e.depth>0}function vl(t,n){let e=[...t];return i=>e.filter(([o])=>n(i,o)).reduce(([o,r],[,[s,a]])=>[o+s,r+a],[0,0])}function El(t){let n=on(t);for(let e=t.length-1;e>=0;e--){let i=n.get(e);if(i){let o=t[e];t[e]=p(p({},o),me([o,...i.map(r=>Dl(t[r]))]))}}}function Dl(t){let{padding:n,headerHeight:e}=R;return{x:t.x-n,y:t.y-n-e,width:t.width+2*n,height:t.height+2*n+e}}function Tl(t,n){let e=n.get(t.containerPath),i=me(t.memberPaths.map(o=>n.get(o)));return m(p({},t),{x:e.x,width:e.width,y:i.y,height:i.height})}function Il(t,[n,e]){return n===0&&e===0?t:m(p({},t),{x:t.x+n,y:t.y+e})}var je={cyclesInsideFiles:new Map,cyclesBetweenFiles:new Map,declarationsInCycles:new Map};function hi(t,n){let e=i=>n.includes(i);return{cyclesInsideFiles:e("insideFiles")?t.cyclesInsideFiles:je.cyclesInsideFiles,cyclesBetweenFiles:e("betweenFiles")?t.cyclesBetweenFiles:je.cyclesBetweenFiles,declarationsInCycles:e("declaration")?t.declarationsInCycles:je.declarationsInCycles}}function ui(t,n){let e=new Map,i=new Map,o=new Map;for(let r of t){let s=new Set(r.map(n.fileOf)),a=s.size>1;Ol(r,a,o);let h=new Set(r.map(f=>n.representatives.get(f)));for(let f of Pl(r,n)){let C=h.has(f),I=!C&&s.has(f);a&&(C||I)?na(i,f):!a&&C&&na(e,f)}}return{cyclesInsideFiles:e,cyclesBetweenFiles:i,declarationsInCycles:o}}function Ol(t,n,e){for(let i of t){let o=e.get(i)??{isWithinItsFile:!1,isWithOtherFiles:!1};e.set(i,{isWithinItsFile:o.isWithinItsFile||!n,isWithOtherFiles:o.isWithOtherFiles||n})}}function Pl(t,{representatives:n,parentOf:e}){let i=new Set;for(let o of t){let r=n.get(o),s=r===o?e(o):r;for(let a=s;a;a=e(a))i.add(a)}return i}function na(t,n){t.set(n,(t.get(n)??0)+1)}function hn(t,n){return`${t}|${n}`}function ra(t){return typeof t=="number"&&t>0}function mi(t,n){let e=new Map,i=(o,r)=>{let s=r??o.path;for(let h of[...o.foldedPaths??[],o.path])e.set(h,s);let a=r!==null||!n.has(o.path);for(let h of o.children)i(h,a?s:null)};return i(t,null),e}var Ml=1,ia=[];function fi(t,n,e,{declarationEdges:i,hierarchy:o,isInside:r}){let s=new Map,a=ue(e),h=a?i:ia,f=kl(h),C=un(t,o),I=sa(t);for(let G of t){let se=e===null?void 0:G.attributes?.[e];if(!ra(se))continue;let Xe=f.get(xt(G.fromNodeName,G.toNodeName))??ia;for(let Ye of Al({edge:G,weight:se,declarationEdges:Xe,hierarchy:o,pointsUpward:C},n))oa(s,Ye,r)}let H=G=>gi(G)||!I.has(xt(G.fromNodeName,G.toNodeName));for(let G of h.filter(H)){let se=p(p({},mn(G,n)),aa(G,C(G)));oa(s,se,r)}let xe=a?Lt:()=>"regular";return[...s].map(Ln=>{var[G,An]=Ln,wt=An,{isCyclic:se,isPointingUpwards:Xe}=wt,Ye=St(wt,["isCyclic","isPointingUpwards"]);return m(p({id:G},Ye),{type:xe({isCyclic:se,isPointingUpwards:Xe})})})}function gi(t){return t.fromNodeName===t.toNodeName}function un(t,n){let e=sa(t);return i=>(n!=="packages"&&!gi(i)?e.get(xt(i.fromNodeName,i.toNodeName)):void 0)??!!i.isPointingUpwards}function sa(t){let n=new Map;for(let e of t.filter(Ll)){let i=xt(e.fromNodeName,e.toNodeName);n.set(i,!!e.isPointingUpwards||n.get(i)===!0)}return n}function Ll(t){return ra(t.attributes?.[kn])}function Al({edge:t,weight:n,declarationEdges:e,hierarchy:i,pointsUpward:o},r){let s=r.get(t.fromNodeName),a=r.get(t.toNodeName),h=e.map(I=>mn(I,r)),f=h.some(I=>I.fromPath!==s||I.toPath!==a),C=i==="packages"&&e.length>0;if(!f&&!C){let I=!!t.isPointingUpwards;return[{fromPath:s,toPath:a,weight:n,isCyclic:!!t.isCyclic,isPointingUpwards:I,declarationEdges:e}]}return e.map((I,H)=>p(p({},h[H]),aa(I,o(I))))}function aa(t,n){return{weight:t.attributes[kn]??Ml,isCyclic:!!t.isCyclic,isPointingUpwards:n,declarationEdges:[t]}}function mn(t,n){let e=(i,o)=>n.get(fe(i,o))??n.get(i);return{fromPath:e(t.fromNodeName,t.fromLeaf),toPath:e(t.toNodeName,t.toLeaf)}}function oa(t,n,e){let{fromPath:i,toPath:o,weight:r,isCyclic:s,isPointingUpwards:a,declarationEdges:h}=n;if(i===void 0||o===void 0||Nl(i,o,e))return;let f=hn(i,o),C=t.get(f);if(C===void 0){t.set(f,{fromPath:i,toPath:o,weight:r,isCyclic:s,isPointingUpwards:a,declarationEdges:[...h]});return}C.weight+=r,C.isCyclic||=s,C.isPointingUpwards||=a,C.declarationEdges.push(...h)}function Nl(t,n,e){return t===n||e(t,n)||e(n,t)}function kl(t){let n=new Map;for(let e of t)gi(e)||K(n,xt(e.fromNodeName,e.toNodeName),e);return n}function xt(t,n){return`${t}|${n}`}var fn=0,Rl={};function gn(t,n,e=Rl){if(t.isExcluded||t.path===void 0)return null;if(t.type!==Qi.FOLDER)return Bl(t,n[t.path],e[t.path]);let i=(t.children??[]).map(s=>gn(s,n,e)).filter(s=>s!==null);if(i.length===0)return null;let o=n[t.path]??fn,[r]=i;return i.length===1&&r.kind==="folder"?m(p({},r),{name:`${t.name}/${r.name}`,level:o,foldedPaths:[t.path,...r.foldedPaths??[]]}):{path:t.path,name:t.name,level:o,kind:"folder",children:i}}function Bl(t,n,e={}){if(n===void 0)return null;let i=Object.entries(e).map(([o,r])=>Fl(fe(t.path,o),r));return{path:t.path,name:t.name,level:n,kind:"file",children:i}}function Fl(t,n){return{path:t,name:n.name,level:n.level??fn,kind:"declaration",children:[],declarationKind:n.kind}}var Gl=new Set(["folder","package"]);function _n(t){let n=new Set([t.path]),e=t;for(;e.children.length===1&&Gl.has(e.children[0].kind);)e=e.children[0],n.add(e.path);return n}var ha=16/10,ca=6,da=2,Vl={gapBetweenNodes:R.gapBetweenNodes,gapBetweenRows:R.gapBetweenRows,gapBetweenGroups:R.gapBetweenLevels,unwrappedRowWidth:ca*R.nodeWidth+(ca-1)*R.gapBetweenNodes},ua=8,la=6,Hl=da*R.declarationWidth+(da-1)*ua,ma={gapBetweenNodes:ua,gapBetweenRows:la,gapBetweenGroups:la,unwrappedRowWidth:Hl},$l=m(p({},ma),{gapBetweenGroups:R.gapBetweenLevels}),xn=class{constructor(n){this.expandedPaths=n,this.plans=new Map}isOpen(n){return n.children.length>0&&this.expandedPaths.has(n.path)}sizeOf(n){return this.isOpen(n)?this.planOf(n):n.kind==="declaration"?{width:R.declarationWidth,height:R.declarationHeight}:{width:R.nodeWidth,height:R.nodeHeight}}planOf(n){let e=this.plans.get(n.path);return e||(e=this.planContainer(n),this.plans.set(n.path,e)),e}planContainer(n){let e=n.kind==="file",i=!e||this.stacksSeveralLevels(n),r=e?i?$l:ma:Vl,s=Wl(n.children),a=Kl(s,I=>this.sizeOf(I).width,r),h=R.nodeWidth-2*R.padding,f=e?h:0;return ql(a,I=>m(p({},this.packRows(s,I,r,f)),{isLeveled:i}))}stacksSeveralLevels(n){return new Set(n.children.map(e=>e.level)).size>1}packRows(n,e,i,o){let r=n.flatMap((h,f)=>this.wrapGroup(h,f,e,i)),s=Math.max(o,Ee(r.map(h=>h.width))),a=r.reduce((h,f,C)=>h+f.height+(C===0?0:_i(f,r[C-1],i)),0);return{rows:r,innerWidth:s,spacing:i,width:s+2*R.padding,height:R.headerHeight+a+2*R.padding}}wrapGroup(n,e,i,o){let r=[],s=null;for(let a of n){let h=this.sizeOf(a),f=s?s.width+o.gapBetweenNodes+h.width:h.width;s&&f<=i?(s.nodes.push(a),s.width=f,s.height=Math.max(s.height,h.height)):(s={group:e,level:a.level,nodes:[a],width:h.width,height:h.height},r.push(s))}return r}};function Wl(t){let n=new Map;for(let e of t)K(n,e.level,e);return[...n.entries()].sort(([e],[i])=>i-e).map(([,e])=>Ul(e))}function Ul(t){return t.toSorted((n,e)=>n.name.localeCompare(e.name))}function Kl(t,n,e){let i=t.map(h=>jl(h.map(n),e.gapBetweenNodes)),o=Ee(i.map(h=>h.at(-1))),r=Ee(t.flat().map(n)),s=Math.max(r,Math.min(e.unwrappedRowWidth,o));return[...new Set([s,...i.flat().filter(h=>h>s)])].sort((h,f)=>h-f)}function jl(t,n){let e=-n;return t.map(i=>e+=n+i)}function ql(t,n){let e=zl(a=>n(t[a])),i=0,o=t.length-1;for(;i<o;){let a=Math.floor((i+o)/2);fa(e(a))<ha?i=a+1:o=a}let r=e(i);if(i===0)return r;let s=e(i-1);return pa(s)<pa(r)?s:r}function zl(t){let n=new Map;return e=>(n.has(e)||n.set(e,t(e)),n.get(e))}function fa({width:t,height:n}){return t/n}function pa(t){return Math.abs(Math.log(fa(t)/ha))}function _i(t,n,e){return t.group===n.group?e.gapBetweenRows:e.gapBetweenGroups}function yi(t,n){let e=new xn(n),i=e.sizeOf(t),o={boxes:[],bands:[],width:i.width,height:i.height};return new xi(e,o).place(t,{x:0,y:0},{depth:0,parentPath:null,isInLevelBand:!1}),o}var xi=class{constructor(n,e){this.measurer=n,this.layout=e}place(n,{x:e,y:i},{depth:o,parentPath:r,isInLevelBand:s}){let a=this.measurer.isOpen(n),h=this.measurer.sizeOf(n);this.layout.boxes.push(p(m(p({path:n.path,parentPath:r,name:n.name,kind:n.kind,isExpanded:a,level:n.level,isInLevelBand:s,depth:o},Xl(n)),{x:e,y:i}),h)),a&&this.placeRows(n,e,i+R.headerHeight+R.padding,o+1)}placeRows(n,e,i,o){let{rows:r,innerWidth:s,width:a,spacing:h,isLeveled:f}=this.measurer.planOf(n),C=i,I=null;r.forEach((H,xe)=>{let G=r[xe-1];G&&(C+=_i(H,G,h)),f&&(I=this.bandReaching({row:H,previous:G,current:I},n,{x:e,y:C,width:a,height:0}));let se=e+R.padding+(s-H.width)/2;this.placeRow(H,{x:se,y:C},{parentPath:n.path,childDepth:o,band:I,spacing:h}),C+=H.height})}bandReaching({row:n,previous:e,current:i},o,r){let s=i;return(s===null||e?.level!==n.level)&&(s=p({containerPath:o.path,level:n.level,isTopmost:!e,memberPaths:[]},r),this.layout.bands.push(s)),s.height=r.y+n.height-s.y,s}placeRow(n,{x:e,y:i},{parentPath:o,childDepth:r,band:s,spacing:a}){let h=e;for(let f of n.nodes)s?.memberPaths.push(f.path),this.place(f,{x:h,y:i},{depth:r,parentPath:o,isInLevelBand:s!==null}),h+=this.measurer.sizeOf(f).width+a.gapBetweenNodes}};function Xl(t){return t.kind==="file"?{declarationCount:t.children.length}:t.kind==="declaration"?{declarationKind:t.declarationKind}:{}}function Yl(t,n){let e=new Map;for(let{namespace:o,level:r=fn}of Object.values(t??{}))o!==void 0&&n[o]!==void 0&&K(e,o,r);let[i]=[...e].sort(([o,r],[s,a])=>a.length-r.length||o.localeCompare(s));return i?{packageKey:i[0],level:Math.max(...i[1])}:null}function wi(t,n,e){if(t.kind!=="folder")return t;let i=new Map,o=s=>{let a=Yl(e[s.path],n);return a&&K(i,a.packageKey,m(p({},s),{level:a.level})),a!==null},r=t.children.flatMap(s=>_a(s,o));return m(p({},t),{children:[...new Ci(n,i).topLevel(),...r]})}function _a(t,n){if(t.kind==="file")return n(t)?[]:[t];let e=t.children.flatMap(i=>_a(i,n));return e.length===0?[]:[m(p({},t),{children:e})]}var Ci=class{constructor(n,e){this.namespaces=n,this.filesByPackage=e,this.keysByParent=new Map;for(let i of Object.keys(n))K(this.keysByParent,this.parentOf(i),i)}topLevel(){return this.below(null)}parentOf(n){let e=this.namespaces[n].parent;if(e===void 0||this.namespaces[e]===void 0)return null;let i=new Set;for(let o=e;o!==void 0&&!i.has(o);o=this.namespaces[o]?.parent){if(o===n)return null;i.add(o)}return e}below(n){return(this.keysByParent.get(n)??[]).flatMap(e=>this.nodeOf(e,n))}nodeOf(n,e){let i=this.filesByPackage.get(n)??[],o=Rs(n),r=this.namespaces[n].level,s=this.below(n),[a]=s;if(i.length===0&&s.length===1){let f=ga(Bs(a.path),e);return[m(p({},a),{name:f,level:r,foldedPaths:[o,...a.foldedPaths??[]]})]}let h=[...s,...i];return h.length===0?[]:[{path:o,name:ga(n,e),level:r,kind:"package",children:h}]}};function ga(t,n){let e=`${n}${po}`;return n!==null&&t.startsWith(e)?t.slice(e.length):t}function Si(t){let n=new Map,e=new Map,i=o=>{for(let r of[o.path,...o.foldedPaths??[]])n.set(r,o);for(let r of o.children)e.set(r.path,o),i(r)};return i(t),{root:t,nodeAt:n,parentOf:e}}function yn({nodeAt:t},n){return t.get(n)?.path??null}function bi(t,n){let e=t.nodeAt.get(n);return e?Zl(t,e).map(i=>i.path):null}function vi({parentOf:t},n,e){for(let i=t.get(n);i;i=t.get(i.path))if(i.path===e)return!0;return!1}function Zl({parentOf:t},n){let e=[];for(let i=t.get(n.path);i;i=t.get(i.path))e.unshift(i);return e}var Ei=new Map;function Di(t,n,e){let i=new Map;for(let o of t.filter(e)){let{fromPath:r,toPath:s}=mn(o,n),a=r===fe(o.fromNodeName,o.fromLeaf);r!==void 0&&r===s&&!a&&i.set(r,(i.get(r)??0)+1)}return i}var xa=Se(Co,So,ke,fo,Ot,({unifiedMapNode:t},n,e,i,{leaves:o})=>{let r=e&&n.get(e)||t;return r?gn(r,i,o):null});function ya(t){return t.map(({file:n})=>n.fileMeta.fileChecksum).toSorted((n,e)=>n.localeCompare(e))}var Ca=Se(Nn,t=>JSON.stringify(ya(t))),wa=Se(Nn,ke,(t,n)=>JSON.stringify({fileChecksums:ya(t),focusedNodePath:n??null})),Sa=Se(ke,Boolean),ba=Se(ro,vo,(t,n)=>tr(t)?null:n);var F=(()=>{class t{constructor(e){this.store=e,this.tree$=this.store.select(xa),this.layoutIdentity$=this.store.select(wa),this.loadedFilesIdentity$=this.store.select(Ca),this.hasDependencyData$=this.store.select(go),this.isFocused$=this.store.select(Sa),this.focusedNodePath$=this.store.select(ke),this.edges$=this.store.select(_o),this.declarations$=this.store.select(Ot),this.hasDeclarations$=this.store.select(ho),this.hasPackages$=this.store.select(uo),this.sharedEdgeMetric$=this.store.select(no),this.edgeMetricData$=this.store.select(yo),this.persistedSettings$=this.store.select(Do),this.hoveredNodePath$=this.store.select(oo),this.selectedNodePath$=this.store.select(so),this.isDeltaState$=this.store.select(eo),this.searchedPaths$=this.store.select(ba)}static{this.\u0275fac=function(i){return new(i||t)(Ze(we))}}static{this.\u0275prov=z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ne=(()=>{class t{constructor(){this.readStore=y(F),this.currentLayoutIdentity=v(this.readStore.layoutIdentity$,{requireSync:!0}),this.currentLoadedFilesIdentity=v(this.readStore.loadedFilesIdentity$,{requireSync:!0}),this.layoutIdentityOfTheOpenedBoxes=U(null),this.openedBoxes=U(new Set),this.movedBoxes=U(new Map),this.draggedOrder=U([]),this.boxBeingDragged=U(null),this.fitRequestCount=U(0),this.hoveredInGraph=U(null),this.askedIntoView=U(null),this.pixelsUnderTheBar=U(0),this.revealsAwaitingAdoption=null,this.adoptedTree=null,this.loadedFilesIdentityOfTheOpenedBoxes=null,this.adoptedLayoutIdentity=this.layoutIdentityOfTheOpenedBoxes.asReadonly(),this.expandedPaths=this.openedBoxes.asReadonly(),this.boxOffsets=this.movedBoxes.asReadonly(),this.raisedPaths=this.draggedOrder.asReadonly(),this.draggingPath=this.boxBeingDragged.asReadonly(),this.fitRequest=this.fitRequestCount.asReadonly(),this.hoveredBoxPath=this.hoveredInGraph.asReadonly(),this.viewRequest=this.askedIntoView.asReadonly(),this.coveredBottom=this.pixelsUnderTheBar.asReadonly()}adoptTree(e){let i=this.currentLayoutIdentity(),o=this.adoptedTree?.root.path;if(this.adoptedTree=e,i===te(this.layoutIdentityOfTheOpenedBoxes)){e.root.path!==o&&this.openTheMovedRoot(e.root);return}let r=te(this.currentLoadedFilesIdentity);if(r===this.loadedFilesIdentityOfTheOpenedBoxes){this.keepOpenedBoxesAcrossFocusChange(e,i,o);return}this.loadedFilesIdentityOfTheOpenedBoxes=r,this.startOver(e.root,i)}coverBottom(e){this.pixelsUnderTheBar.set(e)}hoverInGraph(e){this.hoveredInGraph.set(e)}bringIntoView(e){this.askedIntoView.update(i=>({id:(i?.id??0)+1,paths:e}))}requestFit(){this.fitRequestCount.update(e=>e+1)}placeBox(e,i){this.boxBeingDragged.set(e),this.movedBoxes.update(o=>new Map(o).set(e,i)),this.draggedOrder().at(-1)!==e&&this.draggedOrder.update(o=>[...o.filter(r=>r!==e),e])}endDragging(){this.boxBeingDragged.set(null)}resetLayout(){this.movedBoxes.set(new Map),this.draggedOrder.set([])}reveal(e){this.openBoxesHolding(e);let i=te(this.currentLayoutIdentity);i!==te(this.layoutIdentityOfTheOpenedBoxes)&&this.awaitAdoptionToReveal(i,e)}openBox(e){this.reveal([e]);let i=(this.adoptedTree&&yn(this.adoptedTree,e))??e;this.openedBoxes.update(o=>new Set([...o,i]))}toggle(e){this.openedBoxes.update(i=>{let o=new Set(i);return o.delete(e)||o.add(e),o})}startOver(e,i){this.layoutIdentityOfTheOpenedBoxes.set(i),this.openedBoxes.set(_n(e)),this.resetLayout(),this.revealTheAwaitingPaths(i)}keepOpenedBoxesAcrossFocusChange(e,i,o){this.layoutIdentityOfTheOpenedBoxes.set(i),this.openTheMovedRoot(e.root);let r=this.revealTheAwaitingPaths(i),s=o===void 0?null:yn(e,o);s!==null&&s!==e.root.path&&!r&&(this.openBoxesHolding([o]),this.bringIntoView([s]))}openTheMovedRoot(e){te(this.openedBoxes).has(e.path)||this.openedBoxes.update(i=>new Set([...i,..._n(e)]))}awaitAdoptionToReveal(e,i){let o=this.revealsAwaitingAdoption,r=o?.layoutIdentity===e?o.paths:[];this.revealsAwaitingAdoption={layoutIdentity:e,paths:[...r,...i]}}revealTheAwaitingPaths(e){let i=this.revealsAwaitingAdoption;return this.revealsAwaitingAdoption=null,i?.layoutIdentity!==e?!1:(this.openBoxesHolding(i.paths),!0)}openBoxesHolding(e){let i=o=>(this.adoptedTree&&bi(this.adoptedTree,o))??[];this.openedBoxes.update(o=>new Set([...o,...e.flatMap(Ql),...e.flatMap(i)]))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Ql(t){let n=t.split("/");return n.slice(2).map((e,i)=>n.slice(0,i+2).join("/"))}var j=(()=>{class t{constructor(e,i){this.store=e,this.nodeInteraction=i}selectNode(e){this.nodeInteraction.selectNode(e)}clearSelection(){this.nodeInteraction.clearSelection()}hoverNode(e){this.nodeInteraction.hoverNode(e)}openContextMenu(e,i,o){this.store.dispatch(lo({value:{nodeId:e,xPositionOfRightClickEvent:i,yPositionOfRightClickEvent:o,origin:"dependencyMap"}}))}setEdgeMetric(e){this.store.dispatch(io({value:e}))}changeSettings(e){this.store.dispatch(Eo({value:e}))}unfocus(){this.store.dispatch(co())}static{this.\u0275fac=function(i){return new(i||t)(Ze(we),Ze(Nt))}}static{this.\u0275prov=z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function ep(t,n){if(t&1&&(ee(),de(0,"rect"),Z(1,"g"),de(2,"path",1)(3,"path",2),J(),Z(4,"text",3),x(5),J()),t&2){let e=n,i=u();O("x",i.pillShape.x)("y",i.pillShape.y)("width",i.pillShape.width)("height",i.pillShape.height)("rx",i.pillShape.cornerRadius)("stroke-width",i.sizes.outlinePx)("stroke-dasharray",i.dash())("fill",e.colors.fill)("stroke",e.colors.line),c(),O("transform",i.glyphPlace),c(),O("d",e.glyph.line)("stroke-width",e.glyph.lineWidthPx)("stroke",e.colors.line),c(),O("d",e.glyph.head)("fill",e.colors.line),c(),O("x",i.sizes.numberLeftPx)("y",i.centre.y)("font-size",i.sizes.fontSizePx)("font-weight",i.sizes.fontWeight)("font-family",i.sizes.fontFamily)("fill",e.colors.line),c(),ae(" ",i.sizes.count," ")}}function tp(t,n){if(t&1&&(ee(),de(0,"circle")),t&2){let e=u();O("cx",e.centre.x)("cy",e.centre.y)("r",e.sizes.ringRadiusPx)("stroke-width",e.sizes.ringLineWidthPx)("fill",e.ringColors.fill)("stroke",e.ringColors.line)}}var ce=Qn,Ti={x:ce.widthPx/2,y:ce.heightPx/2},np={x:ce.outlinePx/2,y:ce.outlinePx/2,width:ce.widthPx-ce.outlinePx,height:ce.heightPx-ce.outlinePx,cornerRadius:(ce.heightPx-ce.outlinePx)/2},Cn=(()=>{class t{constructor(){this.mark=M.required(),this.upwardLine=M.required(),this.pill=g(()=>{let e=this.mark();return e==="declaration"?null:Zt(e,this.upwardLine())}),this.ringColors=ht.declaration,this.dash=g(()=>this.pill()?.lineDash?.join(" ")??null),this.sizes=ce,this.centre=Ti,this.pillShape=np,this.viewBox=`0 0 ${ce.widthPx} ${ce.heightPx}`,this.glyphPlace=`translate(${Ti.y} ${Ti.y})`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-box-badge-sample"]],hostAttrs:[1,"inline-flex","shrink-0"],inputs:{mark:[1,"mark"],upwardLine:[1,"upwardLine"]},decls:3,vars:5,consts:[["aria-hidden","true"],["fill","none","stroke-linecap","round"],["stroke","none"],["dominant-baseline","central"]],template:function(i,o){if(i&1&&(ee(),Z(0,"svg",0),S(1,ep,6,22)(2,tp,1,6,":svg:circle"),J()),i&2){let r;O("viewBox",o.viewBox)("width",o.sizes.widthPx)("height",o.sizes.heightPx)("data-mark",o.mark()),c(),b((r=o.pill())?1:2,r)}},encapsulation:2})}}return t})();var wn="min-w-[148px]",Sn="flex min-h-[17.5px] items-center justify-center";function va(t,n){let e=n.filter(i=>t.includes(i.mark));return e.length===n.length?"All":e.length===0?"None":e.map(i=>i.label).join(", ")}function Ea(t,n,e){return et.filter(i=>i===n?e:t.includes(i))}function Da(t){return et.filter(n=>!t.includes(n))}var Ta=(t,n)=>n.mark;function ip(t,n){if(t&1&&w(0,"cc-box-badge-sample",3),t&2){let e=n.$implicit,i=u();_("mark",e.mark)("upwardLine",i.upwardLine())}}function op(t,n){t&1&&(d(0,"span",4),x(1,"None"),l())}function rp(t,n){if(t&1){let e=A();d(0,"li",9)(1,"input",11,0),E("change",function(){let o=D(e).$implicit,r=V(2),s=u();return T(s.toggle(o.mark,r.checked))}),l(),w(3,"cc-box-badge-sample",3),d(4,"label",12),x(5),l()()}if(t&2){let e=n.$implicit,i=u();c(),_("id","dependency-bar-box-badges-"+e.mark)("checked",e.isShown),O("data-testid","dependency-bar-box-badges-"+e.mark),c(2),_("mark",e.mark)("upwardLine",i.upwardLine()),c(),O("for","dependency-bar-box-badges-"+e.mark),c(),L(e.label)}}var Ia=(()=>{class t{constructor(){this.writeStore=y(j),this.readStore=y(F),this.settings=v(this.readStore.persistedSettings$,{requireSync:!0}),this.popoverId="dependency-bar-box-badges-popover",this.anchorName="dependency-bar-box-badges-card",this.resetKeys=["preferences.dependencyGraph.shownBoxBadges"],this.cardWidthClass=wn,this.sampleRowClass=Sn,this.shownBadges=g(()=>this.settings().shownBoxBadges),this.entries=g(()=>Ue.map(e=>m(p({},e),{isShown:this.shownBadges().includes(e.mark)}))),this.shownEntries=g(()=>this.entries().filter(e=>e.isShown)),this.chosenLabel=g(()=>va(this.shownBadges(),Ue)),this.upwardLine=g(()=>Ie(this.settings().edgeColors,this.settings().lineStyleShows))}toggle(e,i){this.show(Ea(this.shownBadges(),e,i))}showAll(){this.show([...et])}showNone(){this.show([])}invert(){this.show(Da(this.shownBadges()))}show(e){this.writeStore.changeSettings({shownBoxBadges:e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-box-badges-segment"]],hostAttrs:[1,"contents"],decls:13,vars:12,consts:[["boxBadgeCheckbox",""],["label","Badges","testId","dependency-bar-box-badges-segment",3,"searchPopoverId","searchAnchorName","minWidthClass"],["body","","data-testid","dependency-bar-box-badges-shown",3,"title"],[3,"mark","upwardLine"],["aria-hidden","true",1,"text-sm","font-semibold","leading-tight"],[1,"sr-only"],["ariaLabel","Badges","contentClass","gap-2 p-2",3,"popoverId","anchorName"],[3,"selectAll","selectNone","invert"],[1,"m-0","flex","list-none","flex-col","gap-0.5","p-0"],[1,"flex","items-center","gap-2","rounded-md","px-2","py-1","hover:bg-base-200"],["tooltip","Show every badge again","label","Reset badges",3,"settingsKeys","small"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary","shrink-0",3,"change","id","checked"],[1,"min-w-0","flex-1","cursor-pointer","text-sm"]],template:function(i,o){i&1&&(d(0,"cc-axis-card",1)(1,"div",2),N(2,ip,1,2,"cc-box-badge-sample",3,Ta,!1,op,2,0,"span",4),d(5,"span",5),x(6),l()()(),d(7,"cc-settings-popover-shell",6)(8,"cc-selection-shortcuts",7),E("selectAll",function(){return o.showAll()})("selectNone",function(){return o.showNone()})("invert",function(){return o.invert()}),l(),d(9,"ul",8),N(10,rp,6,7,"li",9,Ta),l(),w(12,"cc-reset-settings-button",10),l()),i&2&&(_("searchPopoverId",o.popoverId)("searchAnchorName",o.anchorName)("minWidthClass",o.cardWidthClass),c(),he(o.sampleRowClass+" gap-1"),_("title",o.chosenLabel()),c(),k(o.shownEntries()),c(4),L(o.chosenLabel()),c(),_("popoverId",o.popoverId)("anchorName",o.anchorName),c(3),k(o.entries()),c(2),_("settingsKeys",o.resetKeys)("small",!0))},dependencies:[_e,Cn,Be,kt,Re],encapsulation:2})}}return t})();var Oa=(()=>{class t{constructor(){this.readStore=y(F),this.writeStore=y(j),this.popoverId="dependency-bar-edge-metric-popover",this.anchorName="dependency-bar-edge-metric-card",this.edgeMetric=v(this.readStore.sharedEdgeMetric$,{requireSync:!0}),this.edgeMetricData=v(this.readStore.edgeMetricData$,{requireSync:!0}),this.descriptors=v(y(xo).descriptors$,{initialValue:{}})}pick(e){this.writeStore.setEdgeMetric(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-edge-metric-segment"]],hostAttrs:[1,"contents"],decls:2,vars:8,consts:[["label","Edge metric","testId","dependency-bar-edge-metric-segment",3,"metricName","searchPopoverId","searchAnchorName"],["placeholder","Edge Metric (highest value)",3,"metricSelected","popoverId","anchorName","options","descriptors","selected"]],template:function(i,o){i&1&&(w(0,"cc-axis-card",0),d(1,"cc-metric-select-popover",1),E("metricSelected",function(s){return o.pick(s)}),l()),i&2&&(_("metricName",o.edgeMetric())("searchPopoverId",o.popoverId)("searchAnchorName",o.anchorName),c(),_("popoverId",o.popoverId)("anchorName",o.anchorName)("options",o.edgeMetricData())("descriptors",o.descriptors())("selected",o.edgeMetric()))},dependencies:[_e,Ro],encapsulation:2})}}return t})();var sp=["*"],ap=(t,n)=>n.value;function cp(t,n){if(t&1){let e=A();d(0,"label",5)(1,"input",6),E("click",function(){let o=D(e).$implicit,r=u();return T(r.choose.emit(o.value))}),l(),d(2,"span",7)(3,"span",8),x(4),l(),d(5,"span",9),x(6),l()(),w(7,"i",10),l()}if(t&2){let e=n.$implicit,i=u();Ce("bg-base-200",e.value===i.chosen()),O("data-testid",i.idPrefix()+"-"+e.value),c(),_("name",i.popoverId()+"-value")("checked",e.value===i.chosen()),c(3),L(e.label),c(2),L(e.hint),c(),Ce("invisible",e.value!==i.chosen())}}var bn=(()=>{class t{constructor(){this.popoverId=M.required(),this.anchorName=M.required(),this.title=M.required(),this.idPrefix=M.required(),this.choices=M.required(),this.chosen=M.required(),this.widthClass=M("w-80"),this.choose=$(),this.chosenLabel=g(()=>this.choices().find(e=>e.value===this.chosen())?.label??"")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-choice-list-popover"]],hostAttrs:[1,"contents"],inputs:{popoverId:[1,"popoverId"],anchorName:[1,"anchorName"],title:[1,"title"],idPrefix:[1,"idPrefix"],choices:[1,"choices"],chosen:[1,"chosen"],widthClass:[1,"widthClass"]},outputs:{choose:"choose"},ngContentSelectors:sp,decls:9,vars:9,consts:[[3,"popoverId","anchorName","widthClass","ariaLabel","testId"],[1,"text-sm","font-semibold","whitespace-nowrap"],[1,"text-primary"],["role","radiogroup",1,"flex","flex-col","gap-0.5"],[1,"flex","cursor-pointer","items-center","gap-2","rounded-md","px-2","py-1","text-left","hover:bg-base-200","has-[:focus-visible]:outline-2",3,"bg-base-200"],[1,"flex","cursor-pointer","items-center","gap-2","rounded-md","px-2","py-1","text-left","hover:bg-base-200","has-[:focus-visible]:outline-2"],["type","radio",1,"sr-only",3,"click","name","checked"],[1,"flex","min-w-0","flex-1","flex-col"],[1,"text-sm","font-medium"],[1,"text-xs","opacity-70"],["aria-hidden","true",1,"fa","fa-check","text-primary"]],template:function(i,o){i&1&&(Xi(),d(0,"cc-settings-popover-shell",0)(1,"span",1),x(2),d(3,"span",2),x(4),l()(),d(5,"div",3),N(6,cp,8,9,"label",4,ap),l(),Yi(8),l()),i&2&&(_("popoverId",o.popoverId())("anchorName",o.anchorName())("widthClass",o.widthClass())("ariaLabel",o.title())("testId",o.idPrefix()+"-popover"),c(2),ae(" ",o.title()," "),c(),O("data-testid",o.idPrefix()+"-title"),c(),L(o.chosenLabel()),c(),O("aria-label",o.title()),c(),k(o.choices()))},dependencies:[Re],encapsulation:2})}}return t})();var dp=(t,n)=>n.value;function lp(t,n){if(t&1){let e=A();Z(0,"input",4),Je("change",function(){let o=D(e).$implicit,r=u();return T(r.choose.emit(o.value))}),J()}if(t&2){let e=n.$implicit,i=u();zi("name",i.idPrefix())("title",e.hint)("checked",e.value===i.chosen()),O("aria-label",e.label)("data-testid",i.idPrefix()+"-"+e.value)}}var vn=(()=>{class t{constructor(){this.label=M.required(),this.idPrefix=M.required(),this.choices=M.required(),this.chosen=M.required(),this.choose=$(),this.chosenHint=g(()=>this.choices().find(e=>e.value===this.chosen())?.hint??"")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-choice-row"]],hostAttrs:[1,"flex","flex-col","gap-1"],inputs:{label:[1,"label"],idPrefix:[1,"idPrefix"],choices:[1,"choices"],chosen:[1,"chosen"]},outputs:{choose:"choose"},decls:7,vars:4,consts:[[1,"text-xs","uppercase","tracking-wider","opacity-60"],["role","radiogroup",1,"join","w-full"],["type","radio",1,"join-item","btn","btn-sm","flex-1",3,"name","title","checked"],[1,"m-0","text-xs","opacity-70"],["type","radio",1,"join-item","btn","btn-sm","flex-1",3,"change","name","title","checked"]],template:function(i,o){i&1&&(Z(0,"span",0),x(1),J(),Z(2,"div",1),N(3,lp,1,5,"input",2,dp),J(),Z(5,"p",3),x(6),J()),i&2&&(c(),L(o.label()),c(),O("aria-label",o.label()),c(),k(o.choices()),c(2),O("data-testid",o.idPrefix()+"-hint"),c(),L(o.chosenHint()))},encapsulation:2})}}return t})();var En="w-96 max-w-[95vw]";var Ii=[{value:"combined",label:"Combined",hint:"One spot on each side for the edges leaving and one for those arriving"},{value:"spread",label:"Spread",hint:"Each edge with its own spot on the box"},{value:"aside",label:"Aside",hint:"Upward edges bow out to the right of the boxes, downward ones to the left"}],Pa=[{value:"curved",label:"Curved",hint:"Leave and enter each box square to its side"},{value:"straight",label:"Straight",hint:"A straight line from box to box"}],Dn=[{value:"byCount",label:"By count",hint:"Width grows with the dependencies an edge stands for"},{value:"thin",label:"Thin",hint:"Every edge a hairline, easiest to see through"},{value:"uniform",label:"Uniform",hint:"Every edge the same width"},{value:"strong",label:"Strong",hint:"Grows with the dependencies, twice as pronounced"}],Ma=[{value:"edgeType",label:"Edge type",hint:"Dashed where an edge points upward without closing a cycle"},{value:"usage",label:"Kind of use",hint:"Dashes and arrowhead tell how one declaration uses the other"}];function yt(t,n){return t.find(e=>e.value===n)?.label??null}var pp={min:.25,max:3,step:.25},La=(()=>{class t{constructor(){this.writeStore=y(j),this.settings=v(y(F).persistedSettings$,{requireSync:!0}),this.edgeThicknessChoices=Dn,this.lineStyleMeaningChoices=Ma,this.widthFactorRange=pp,this.resetKeys=["preferences.dependencyGraph.edgeStyle","preferences.dependencyGraph.edgeShape","preferences.dependencyGraph.isAnchoredAtSideMiddle","preferences.dependencyGraph.edgeWidth","preferences.dependencyGraph.lineStyleShows"],this.edgeWidth=g(()=>this.settings().edgeWidth),this.lineStyleShows=g(()=>this.settings().lineStyleShows)}drawEdgesThick(e){this.writeStore.changeSettings({edgeWidth:m(p({},this.edgeWidth()),{thickness:e})})}scaleEdgeWidth(e){this.writeStore.changeSettings({edgeWidth:m(p({},this.edgeWidth()),{factor:e})})}setLineStyleMeaning(e){this.writeStore.changeSettings({lineStyleShows:e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-edge-line-settings"]],hostAttrs:[1,"flex","flex-col","gap-2.5","border-t","border-base-300","pt-2.5"],decls:7,vars:10,consts:[["label","Line thickness","idPrefix","dependency-bar-edge-thickness",3,"choose","choices","chosen"],[1,"flex","flex-col","gap-1"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],["ariaLabel","Line width factor",3,"valueChange","min","max","step","value"],["label","Line style shows","idPrefix","dependency-bar-line-style-shows",3,"choose","choices","chosen"],["tooltip","Reset the edge style, the line shape, the line thickness and what the line style shows to their defaults","label","Reset edge style",3,"settingsKeys","small"]],template:function(i,o){i&1&&(d(0,"cc-choice-row",0),E("choose",function(s){return o.drawEdgesThick(s)}),l(),d(1,"div",1)(2,"span",2),x(3,"Width factor"),l(),d(4,"cc-slider-number-input",3),E("valueChange",function(s){return o.scaleEdgeWidth(s)}),l()(),d(5,"cc-choice-row",4),E("choose",function(s){return o.setLineStyleMeaning(s)}),l(),w(6,"cc-reset-settings-button",5)),i&2&&(_("choices",o.edgeThicknessChoices)("chosen",o.edgeWidth().thickness),c(4),_("min",o.widthFactorRange.min)("max",o.widthFactorRange.max)("step",o.widthFactorRange.step)("value",o.edgeWidth().factor),c(),_("choices",o.lineStyleMeaningChoices)("chosen",o.lineStyleShows()),c(),_("settingsKeys",o.resetKeys)("small",!0))},dependencies:[vn,Be,Fo],encapsulation:2})}}return t})();function hp(t,n){if(t&1){let e=A();d(0,"label",6)(1,"input",7,0),E("change",function(){D(e);let o=V(2),r=u(2);return T(r.anchorAtSideMiddle(o.checked))}),l(),d(3,"span",8),x(4,"Start and end at the middle of the side"),l()()}if(t&2){let e=u(2);c(),_("checked",e.isAnchoredAtSideMiddle())}}function up(t,n){if(t&1){let e=A();d(0,"div",4)(1,"cc-choice-row",5),E("choose",function(o){D(e);let r=u();return T(r.shapeEdges(o))}),l(),S(2,hp,5,1,"label",6),l()}if(t&2){let e=u();c(),_("choices",e.edgeShapeChoices)("chosen",e.edgeShape()),c(),b(e.canAnchorAtSideMiddle()?2:-1)}}var Aa=(()=>{class t{constructor(){this.writeStore=y(j),this.settings=v(y(F).persistedSettings$,{requireSync:!0}),this.stylePopoverId="dependency-bar-edge-style-popover",this.styleAnchorName="dependency-bar-edge-style-card",this.popoverWidthClass=En,this.edgeStyleChoices=Ii,this.edgeShapeChoices=Pa,this.edgeStyle=g(()=>this.settings().edgeStyle),this.edgeStyleLabel=g(()=>yt(Ii,this.edgeStyle())),this.edgeThicknessLabel=g(()=>yt(Dn,this.settings().edgeWidth.thickness)),this.edgeShape=g(()=>this.settings().edgeShape),this.canDrawStraight=g(()=>Mt(this.edgeStyle())),this.canAnchorAtSideMiddle=g(()=>Pt(this.edgeStyle())),this.isAnchoredAtSideMiddle=g(()=>this.settings().isAnchoredAtSideMiddle)}drawEdgesAs(e){this.writeStore.changeSettings({edgeStyle:e})}shapeEdges(e){this.writeStore.changeSettings({edgeShape:e})}anchorAtSideMiddle(e){this.writeStore.changeSettings({isAnchoredAtSideMiddle:e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-edge-style-segment"]],hostAttrs:[1,"contents"],decls:6,vars:10,consts:[["sideMiddleCheckbox",""],["label","Edge style","testId","dependency-bar-edge-style-segment",3,"metricName","searchPopoverId","searchAnchorName"],["body","","data-testid","dependency-bar-edge-thickness-value",1,"text-center","text-xs","opacity-70"],["title","Edges drawn","idPrefix","dependency-bar-edge-style",3,"choose","popoverId","anchorName","widthClass","choices","chosen"],[1,"flex","flex-col","gap-2.5","border-t","border-base-300","pt-2.5"],["label","Line shape","idPrefix","dependency-bar-edge-shape",3,"choose","choices","chosen"],[1,"flex","cursor-pointer","items-center","gap-2"],["type","checkbox","data-testid","dependency-bar-edge-style-side-middle",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked"],[1,"text-sm"]],template:function(i,o){i&1&&(d(0,"cc-axis-card",1)(1,"div",2),x(2),l()(),d(3,"cc-choice-list-popover",3),E("choose",function(s){return o.drawEdgesAs(s)}),S(4,up,3,3,"div",4),w(5,"cc-edge-line-settings"),l()),i&2&&(_("metricName",o.edgeStyleLabel())("searchPopoverId",o.stylePopoverId)("searchAnchorName",o.styleAnchorName),c(2),L(o.edgeThicknessLabel()),c(),_("popoverId",o.stylePopoverId)("anchorName",o.styleAnchorName)("widthClass",o.popoverWidthClass)("choices",o.edgeStyleChoices)("chosen",o.edgeStyle()),c(),b(o.canDrawStraight()?4:-1))},dependencies:[_e,bn,vn,La],encapsulation:2})}}return t})();var Tn=(()=>{class t{constructor(){this.color=M.required(),this.isDashed=M.required(),this.dash=Vt.join(" ")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-edge-type-sample"]],hostAttrs:[1,"inline-flex","shrink-0"],inputs:{color:[1,"color"],isDashed:[1,"isDashed"]},decls:2,vars:2,consts:[["viewBox","0 0 24 8","aria-hidden","true",1,"h-2","w-6"],["x1","0","y1","4","x2","24","y2","4","stroke-width","2"]],template:function(i,o){i&1&&(ee(),Z(0,"svg",0),de(1,"line",1),J()),i&2&&(c(),O("stroke",o.color())("stroke-dasharray",o.isDashed()?o.dash:null))},encapsulation:2})}}return t})();function Na(t,n){let e=n.filter(i=>t.includes(i));return e.length===n.length?"All":e.length===0?"None":ve.filter(i=>e.includes(i)).map(i=>be[i]).join(", ")}function Oi(t,n){return ve.filter(e=>t.includes(e)||n.includes(e))}function Pi(t,n){return ve.filter(e=>t.includes(e)&&!n.includes(e))}function ka(t,n){return ve.filter(e=>t.includes(e)!==n.includes(e))}var Ra=(t,n)=>n.type;function mp(t,n){if(t&1&&w(0,"cc-edge-type-sample",4),t&2){let e=n.$implicit;_("color",e.color)("isDashed",e.isDashed)}}function fp(t,n){t&1&&(d(0,"span",5),x(1,"None"),l())}function gp(t,n){if(t&1){let e=A();d(0,"li",19)(1,"input",20,1),E("change",function(){let o=D(e).$implicit,r=V(2),s=u();return T(s.toggle(o.type,r.checked))}),l(),d(3,"cc-inline-color-picker",21),E("colorChange",function(o){let r=D(e).$implicit,s=u();return T(s.recolor(r.type,o))}),l(),w(4,"cc-edge-type-sample",4),d(5,"label",22),x(6),l()()}if(t&2){let e=n.$implicit;he(e.isCarried?"hover:bg-base-200":"opacity-50"),c(),_("id","dependency-bar-edges-"+e.type)("checked",e.isShown)("disabled",!e.isCarried),O("data-testid","dependency-bar-edges-"+e.type),c(2),_("hexColor",e.ownColor)("ariaLabel","Colour of: "+e.label),O("data-testid","dependency-bar-edge-color-"+e.type),c(),_("color",e.color)("isDashed",e.isDashed),c(),he(e.isCarried?"cursor-pointer":"cursor-not-allowed"),O("for","dependency-bar-edges-"+e.type),c(),L(e.label)}}function _p(t,n){t&1&&(d(0,"p",11),x(1," An upward edge that closes a cycle is drawn in the colour of the upward edges, solid. Its own colour shows once the line style shows the kind of use. "),l())}function xp(t,n){t&1&&x(0," The box under the pointer shows only its edges of the ticked types. ")}function yp(t,n){t&1&&x(0," The box under the pointer shows all of its edges, also those of types not ticked. ")}var Ba=(()=>{class t{constructor(){this.readStore=y(F),this.writeStore=y(j),this.edgeMetric=v(this.readStore.sharedEdgeMetric$,{requireSync:!0}),this.settings=v(this.readStore.persistedSettings$,{requireSync:!0}),this.popoverId="dependency-bar-edges-popover",this.anchorName="dependency-bar-edges-card",this.popoverWidthClass=En,this.cardWidthClass=wn,this.sampleRowClass=Sn,this.shownTypesResetKeys=["preferences.dependencyGraph.shownEdgeTypes","preferences.dependencyGraph.isHoverLimitedToShownEdgeTypes"],this.colorResetKeys=["preferences.dependencyGraph.edgeColors"],this.carriedTypes=g(()=>mo(this.edgeMetric())),this.shownTypes=g(()=>this.settings().shownEdgeTypes),this.entries=g(()=>dt(this.settings().edgeColors,this.settings().lineStyleShows).map(e=>{let i=this.carriedTypes().includes(e.type);return m(p({},e),{isCarried:i,isShown:i&&this.shownTypes().includes(e.type)})})),this.shownEntries=g(()=>this.entries().filter(e=>e.isShown)),this.showsEveryColor=g(()=>this.settings().lineStyleShows==="usage"),this.isHoverLimited=g(()=>this.settings().isHoverLimitedToShownEdgeTypes),this.chosenLabel=g(()=>Na(this.shownTypes(),this.carriedTypes()))}toggle(e,i){this.show(i?Oi(this.shownTypes(),[e]):Pi(this.shownTypes(),[e]))}showAll(){this.show(Oi(this.shownTypes(),this.carriedTypes()))}showNone(){this.show(Pi(this.shownTypes(),this.carriedTypes()))}invert(){this.show(ka(this.shownTypes(),this.carriedTypes()))}limitHover(e){this.writeStore.changeSettings({isHoverLimitedToShownEdgeTypes:e})}recolor(e,i){this.writeStore.changeSettings({edgeColors:m(p({},this.settings().edgeColors),{[e]:i})})}show(e){this.writeStore.changeSettings({shownEdgeTypes:e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-edge-types-segment"]],hostAttrs:[1,"contents"],decls:24,vars:18,consts:[["hoverLimitCheckbox",""],["edgeTypeCheckbox",""],["label","Edges shown","testId","dependency-bar-edges-segment",3,"searchPopoverId","searchAnchorName","minWidthClass"],["body","","data-testid","dependency-bar-edges-shown",3,"title"],[3,"color","isDashed"],["aria-hidden","true",1,"text-sm","font-semibold","leading-tight"],[1,"sr-only"],["ariaLabel","Edges shown","contentClass","gap-2 p-2",3,"popoverId","anchorName","widthClass"],[3,"selectAll","selectNone","invert"],[1,"m-0","flex","list-none","flex-col","gap-0.5","p-0"],[1,"flex","items-center","gap-2","rounded-md","px-2","py-1",3,"class"],["data-testid","dependency-bar-edge-color-note",1,"m-0","px-2","text-xs","opacity-70"],[1,"flex","cursor-pointer","items-center","gap-2","border-t","border-base-300","px-2","pt-2"],["type","checkbox","data-testid","dependency-bar-edges-respect-on-hover",1,"checkbox","checkbox-sm","checkbox-primary","shrink-0",3,"change","checked"],[1,"text-sm"],["data-testid","dependency-bar-edges-hover-note",1,"m-0","px-2","text-xs","opacity-70"],[1,"flex","gap-2","[&_button]:flex-1"],["tooltip","Show the edges in cycles and those pointing upward again, no plain dependencies, and every edge on hover","label","Reset edges shown",3,"settingsKeys","small"],["tooltip","Reset the edge colours to their defaults","label","Reset colours",3,"settingsKeys","small"],[1,"flex","items-center","gap-2","rounded-md","px-2","py-1"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary","shrink-0",3,"change","id","checked","disabled"],[3,"colorChange","hexColor","ariaLabel"],[1,"min-w-0","flex-1","text-sm"]],template:function(i,o){if(i&1){let r=A();d(0,"cc-axis-card",2)(1,"div",3),N(2,mp,1,2,"cc-edge-type-sample",4,Ra,!1,fp,2,0,"span",5),d(5,"span",6),x(6),l()()(),d(7,"cc-settings-popover-shell",7)(8,"cc-selection-shortcuts",8),E("selectAll",function(){return o.showAll()})("selectNone",function(){return o.showNone()})("invert",function(){return o.invert()}),l(),d(9,"ul",9),N(10,gp,7,15,"li",10,Ra),l(),S(12,_p,2,0,"p",11),d(13,"label",12)(14,"input",13,0),E("change",function(){D(r);let a=V(15);return T(o.limitHover(a.checked))}),l(),d(16,"span",14),x(17,"Respect on hover"),l()(),d(18,"p",15),S(19,xp,1,0)(20,yp,1,0),l(),d(21,"div",16),w(22,"cc-reset-settings-button",17)(23,"cc-reset-settings-button",18),l()()}i&2&&(_("searchPopoverId",o.popoverId)("searchAnchorName",o.anchorName)("minWidthClass",o.cardWidthClass),c(),he(o.sampleRowClass+" gap-1.5"),_("title",o.chosenLabel()),c(),k(o.shownEntries()),c(4),L(o.chosenLabel()),c(),_("popoverId",o.popoverId)("anchorName",o.anchorName)("widthClass",o.popoverWidthClass),c(3),k(o.entries()),c(2),b(o.showsEveryColor()?-1:12),c(2),_("checked",o.isHoverLimited()),c(5),b(o.isHoverLimited()?19:20),c(3),_("settingsKeys",o.shownTypesResetKeys)("small",!0),c(),_("settingsKeys",o.colorResetKeys)("small",!0))},dependencies:[_e,Tn,Lo,Be,Re,kt],encapsulation:2})}}return t})();function Cp(t,n){t&1&&w(0,"cc-bar-tools-divider",2)}var Fa=(()=>{class t{constructor(){this.writeStore=y(j),this.viewStore=y(ne),this.isFocused=v(y(F).isFocused$,{requireSync:!0}),this.hasMovedBoxes=g(()=>this.viewStore.boxOffsets().size>0),this.hasSomethingToUndo=g(()=>this.isFocused()||this.hasMovedBoxes())}showWholeGraph(){this.viewStore.requestFit()}resetLayout(){this.viewStore.resetLayout()}unfocus(){this.writeStore.unfocus()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-graph-view-tools"]],hostAttrs:[1,"flex","items-center","gap-0.5"],features:[Le([{provide:dr,useExisting:hr}])],decls:5,vars:3,consts:[["testId","dependency-bar-unfocus",3,"unfocused","isFocused"],["label","Reset layout","icon","fa fa-undo","tooltip","Put every dragged box back in its place","highlighted","","testId","dependency-reset-layout",3,"activated","revealed"],["data-testid","dependency-tools-divider"],["label","Show whole graph","icon","fa-solid fa-expand","testId","dependency-reset-view",3,"activated"],["view","dependencies"]],template:function(i,o){i&1&&(d(0,"cc-unfocus-tool",0),E("unfocused",function(){return o.unfocus()}),l(),d(1,"cc-bar-tool",1),E("activated",function(){return o.resetLayout()}),l(),S(2,Cp,1,0,"cc-bar-tools-divider",2),d(3,"cc-bar-tool",3),E("activated",function(){return o.showWholeGraph()}),l(),w(4,"cc-toolbox-screenshot-button",4)),i&2&&(_("isFocused",o.isFocused()),c(),_("revealed",o.hasMovedBoxes()),c(),b(o.hasSomethingToUndo()?2:-1))},dependencies:[Oo,Po,lr,Go],encapsulation:2})}}return t})();function X(t){return fe(t.fromNodeName,t.fromLeaf)}function Y(t){return fe(t.toNodeName,t.toLeaf)}function Ga({leaves:t,leafEdges:n},e){let i=new Map,o=new Map;for(let[a,h]of Object.entries(t)){if(e&&!e.has(a))continue;let f=Object.entries(h).map(([C,I])=>({path:fe(a,C),filePath:a,leaf:I}));o.set(a,f);for(let C of f)i.set(C.path,C)}let r=new Map,s=new Map;for(let a of n)i.has(X(a))&&i.has(Y(a))&&(K(r,X(a),a),K(s,Y(a),a));return{declarations:i,declarationsOfFile:o,outgoing:r,incoming:s}}function Va(t){let n=wp(t),e=new Map;for(let[i,o]of n)for(let r of o){let s=Sp(Y(r),i,n);if(s!==null){let a=[r,...s],h=vp(a);e.set(h,e.get(h)??a)}}return[...e.values()]}function wp(t){let n=new Map;for(let[e,i]of t.outgoing){let o=i.filter(r=>r.isCyclic);o.length>0&&n.set(e,o)}return n}function Ha(t){return t.map(X)}function $a(t,n){return n.filter(e=>e.some(i=>t.has(X(i))))}function Sp(t,n,e){let i=new Map([[t,null]]),o=[t];for(let r=0;r<o.length&&!i.has(n);r++)for(let s of e.get(o[r])??[]){let a=Y(s);i.has(a)||(i.set(a,s),o.push(a))}return t===n?[]:bp(i,n)}function bp(t,n){if(!t.has(n))return null;let e=[];for(let i=t.get(n);i;i=t.get(X(i)))e.unshift(i);return e}function vp(t){let n=t.map(Y),e=n.reduce((i,o,r)=>o<n[i]?r:i,0);return[...n.slice(e),...n.slice(0,e)].join("|")}var qe=(()=>{class t{constructor(){this.readStore=y(F),this.writeStore=y(j),this.viewStore=y(ne),this.edges=v(this.readStore.edges$,{requireSync:!0}),this.folderTree=v(this.readStore.tree$,{requireSync:!0}),this.hasPackages=v(this.readStore.hasPackages$,{requireSync:!0}),this.declarations=v(this.readStore.declarations$,{requireSync:!0}),this.edgeMetric=v(this.readStore.sharedEdgeMetric$,{requireSync:!0}),this.settings=v(this.readStore.persistedSettings$,{requireSync:!0}),this.hierarchy=g(()=>this.hasPackages()?this.settings().hierarchy:"folders"),this.tree=g(()=>{let e=this.folderTree(),{namespaces:i,leaves:o}=this.declarations();return e&&this.hierarchy()==="packages"?wi(e,i,o):e}),this.treeIndex=g(()=>{let e=this.tree();return e&&Si(e)}),this.drawnFilePaths=g(()=>new Set([...this.treeIndex()?.nodeAt.values()??[]].flatMap(e=>e.kind==="file"?[e.path]:[]))),this.declarationIndex=g(()=>Ga(this.declarations(),this.drawnFilePaths())),this.cycleChains=g(()=>Va(this.declarationIndex())),this.layout=g(()=>{let e=this.tree();return e?yi(e,this.viewStore.expandedPaths()):null}),this.shownLayout=g(()=>{let e=this.layout();return e?li(e,this.viewStore.boxOffsets()):null}),this.boxes=g(()=>new Map(this.layout()?.boxes.map(e=>[e.path,e]))),this.representatives=g(()=>{let e=this.tree();return e?mi(e,this.viewStore.expandedPaths()):new Map}),this.projectedEdges=g(()=>{let e=this.treeIndex();return fi(this.edges(),this.representatives(),this.edgeMetric(),{declarationEdges:this.declarations().leafEdges,hierarchy:this.hierarchy(),isInside:(i,o)=>!!e&&vi(e,i,o)})}),this.pointsUpward=g(()=>un(this.edges(),this.hierarchy()))}showHierarchy(e){this.writeStore.changeSettings({hierarchy:e}),this.viewStore.resetLayout(),this.viewStore.requestFit()}boxStandingFor(e){return e===null?null:this.representatives().get(e)??null}nodePathOf(e){return Pe(e)?null:this.declarationIndex().declarations.get(e)?.filePath??e}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Wa=[{value:"folders",label:"Folders",hint:"The files in the folders they lie in"},{value:"packages",label:"Packages",hint:"The files in the packages their declarations declare"}],Ua=(()=>{class t{constructor(){this.graphModel=y(qe),this.popoverId="dependency-bar-hierarchy-popover",this.anchorName="dependency-bar-hierarchy-card",this.hierarchyChoices=Wa,this.hierarchy=this.graphModel.hierarchy,this.hierarchyLabel=g(()=>yt(Wa,this.hierarchy()))}show(e){this.graphModel.showHierarchy(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-hierarchy-segment"]],hostAttrs:[1,"contents"],decls:2,vars:7,consts:[["label","Hierarchy","testId","dependency-bar-hierarchy-segment",3,"metricName","searchPopoverId","searchAnchorName"],["title","Files nested in their","idPrefix","dependency-bar-hierarchy",3,"choose","popoverId","anchorName","choices","chosen"]],template:function(i,o){i&1&&(w(0,"cc-axis-card",0),d(1,"cc-choice-list-popover",1),E("choose",function(s){return o.show(s)}),l()),i&2&&(_("metricName",o.hierarchyLabel())("searchPopoverId",o.popoverId)("searchAnchorName",o.anchorName),c(),_("popoverId",o.popoverId)("anchorName",o.anchorName)("choices",o.hierarchyChoices)("chosen",o.hierarchy()))},dependencies:[_e,bn],encapsulation:2})}}return t})();function Dp(t,n){t&1&&w(0,"cc-box-badges-segment")}function Tp(t,n){t&1&&w(0,"cc-hierarchy-segment")}var Mi=(()=>{class t{constructor(){this.barBottom=To,this.viewStore=y(ne),this.readStore=y(F),this.ownSize=new Rt,this.hasPackages=v(this.readStore.hasPackages$,{requireSync:!0}),this.hasDeclarations=v(this.readStore.hasDeclarations$,{requireSync:!0}),this.ownSize.observe(y(ji).nativeElement),ie(()=>{let{height:e}=this.ownSize.size();this.viewStore.coverBottom(e>0?e+12:0)})}ngOnDestroy(){this.ownSize.disconnect(),this.viewStore.coverBottom(0)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-dependency-bar"]],hostVars:2,hostBindings:function(i,o){i&2&&ge("bottom",o.barBottom)},features:[bt([Io])],decls:7,vars:2,template:function(i,o){i&1&&(d(0,"cc-bar-tools-tab"),w(1,"cc-graph-view-tools"),l(),w(2,"cc-edge-types-segment")(3,"cc-edge-style-segment")(4,"cc-edge-metric-segment"),S(5,Dp,1,0,"cc-box-badges-segment"),S(6,Tp,1,0,"cc-hierarchy-segment")),i&2&&(c(5),b(o.hasDeclarations()?5:-1),c(),b(o.hasPackages()?6:-1))},dependencies:[Mo,Ia,Ba,Aa,Oa,Fa,Ua],encapsulation:2})}}return t})();var In=(()=>{class t{constructor(){this.kind=M.required(),this.look=g(()=>rt(this.kind())),this.colors=Ge}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-declaration-kind-icon"]],hostAttrs:["aria-hidden","true",1,"flex","h-[15px]","w-[15px]","shrink-0","items-center","justify-center","rounded-full","border","text-[10px]","leading-none","font-bold"],hostVars:7,hostBindings:function(i,o){i&2&&(O("title",o.look().label),ge("background-color",o.look().tint)("border-color",o.colors.stroke)("color",o.colors.letter))},inputs:{kind:[1,"kind"]},decls:1,vars:1,template:function(i,o){i&1&&x(0),i&2&&L(o.look().letter)},encapsulation:2})}}return t})();function Ip(t,n){t&1&&(ee(),de(0,"polygon",2))}function Op(t,n){t&1&&(ee(),de(0,"polyline",3))}function Pp(t,n){t&1&&(ee(),de(0,"circle",4))}function Mp(t,n){t&1&&(ee(),de(0,"polygon",5))}var On=(()=>{class t{constructor(){this.line=M.required(),this.color=M.required(),this.label=M(null)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-line-style-sample"]],hostAttrs:[1,"inline-flex","shrink-0"],inputs:{line:[1,"line"],color:[1,"color"],label:[1,"label"]},decls:6,vars:7,consts:[["viewBox","0 0 44 12",1,"h-3","w-11"],["x1","2","y1","6","x2","32","y2","6","stroke-width","1.6"],["points","41,6 32,2 32,10","fill","var(--color-base-100, #fff)","stroke-width","1.3"],["points","32,2 41,6 32,10","fill","none","stroke-width","1.5"],["cx","37","cy","6","r","3.5","stroke","none"],["points","41,6 32,2 32,10","stroke","none"]],template:function(i,o){if(i&1&&(ee(),Z(0,"svg",0),de(1,"line",1),S(2,Ip,1,0,":svg:polygon",2)(3,Op,1,0,":svg:polyline",3)(4,Pp,1,0,":svg:circle",4)(5,Mp,1,0,":svg:polygon",5),J()),i&2){let r;O("role",o.label()===null?null:"img")("aria-label",o.label())("aria-hidden",o.label()===null?"true":null)("stroke",o.color())("fill",o.color()),c(),O("stroke-dasharray",o.line().dash?.join(" ")??null),c(),b((r=o.line().head)==="hollow"?2:r==="open"?3:r==="dot"?4:5)}},encapsulation:2})}}return t})();var Lp=(t,n)=>n.type,Ap=(t,n)=>n.usage,Np=(t,n)=>n.mark,kp=(t,n)=>n.kind;function Rp(t,n){if(t&1&&(d(0,"li",3),w(1,"cc-edge-type-sample",7),d(2,"span"),x(3),l()()),t&2){let e=n.$implicit;c(),_("color",e.color)("isDashed",e.isDashed),c(2),L(e.label)}}function Bp(t,n){if(t&1&&(d(0,"li",3),w(1,"cc-line-style-sample",11),d(2,"span"),x(3),l()()),t&2){let e=n.$implicit,i=u(2);c(),_("line",e)("color",i.usageColor()),c(2),L(e.label)}}function Fp(t,n){if(t&1&&(d(0,"section",4)(1,"span",8),x(2,"Kind of use"),l(),d(3,"ul",9),N(4,Bp,4,3,"li",3,Ap),l(),d(6,"p",10),x(7,"An edge standing for several dependencies stays a plain line."),l()()),t&2){let e=u();c(4),k(e.usageLegend())}}function Gp(t,n){if(t&1&&(d(0,"li",3),w(1,"cc-box-badge-sample",14),d(2,"span"),x(3),l()()),t&2){let e=n.$implicit,i=u(2);c(),_("mark",e.mark)("upwardLine",i.upwardLine()),c(2),L(e.label)}}function Vp(t,n){if(t&1&&(d(0,"section",5)(1,"span",12),x(2,"Badges"),l(),d(3,"ul",13),N(4,Gp,4,3,"li",3,Np),l()()),t&2){let e=u();c(4),k(e.badgeLegend())}}function Hp(t,n){if(t&1&&(d(0,"li",3),w(1,"cc-declaration-kind-icon",17),d(2,"span"),x(3),l()()),t&2){let e=n.$implicit;c(),_("kind",e.kind),c(2),L(e.label)}}function $p(t,n){if(t&1&&(d(0,"section",6)(1,"span",15),x(2,"Declarations"),l(),d(3,"ul",16),N(4,Hp,4,2,"li",3,kp),l()()),t&2){let e=u();c(4),k(e.kindLegend())}}var Li=(()=>{class t{constructor(){this.readStore=y(F),this.edgeMetric=v(this.readStore.sharedEdgeMetric$,{requireSync:!0}),this.settings=v(this.readStore.persistedSettings$,{requireSync:!0}),this.hasDeclarations=v(this.readStore.hasDeclarations$,{requireSync:!0}),this.isDependencyMetric=g(()=>ue(this.edgeMetric())),this.edgeLegend=g(()=>{let[e,...i]=dt(this.settings().edgeColors,this.settings().lineStyleShows);return this.isDependencyMetric()?[e,...i]:[m(p({},e),{label:this.edgeMetric()??""})]}),this.usageLegend=g(()=>this.isDependencyMetric()&&this.hasDeclarations()&&this.settings().lineStyleShows==="usage"?De:[]),this.badgeLegend=g(()=>this.isDependencyMetric()&&this.hasDeclarations()?Ue.filter(e=>this.settings().shownBoxBadges.includes(e.mark)):[]),this.upwardLine=g(()=>Ie(this.settings().edgeColors,this.settings().lineStyleShows)),this.kindLegend=g(()=>this.hasDeclarations()?Wn:[]),this.usageColor=g(()=>this.settings().edgeColors.regular)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-dependency-edge-legend"]],hostAttrs:[1,"flex","flex-col","gap-3"],decls:9,vars:4,consts:[["aria-labelledby","dependency-edge-legend-title",1,"flex","flex-col","gap-1"],["id","dependency-edge-legend-title",1,"text-xs","uppercase","tracking-wider","opacity-60"],["data-testid","dependency-edge-legend",1,"m-0","flex","list-none","flex-col","gap-1","p-0","text-sm"],[1,"flex","items-center","gap-2"],["aria-labelledby","dependency-usage-legend-title",1,"flex","flex-col","gap-1","border-t","border-base-300","pt-2"],["aria-labelledby","dependency-badge-legend-title",1,"flex","flex-col","gap-1","border-t","border-base-300","pt-2"],["aria-labelledby","dependency-kind-legend-title",1,"flex","flex-col","gap-1","border-t","border-base-300","pt-2"],[3,"color","isDashed"],["id","dependency-usage-legend-title",1,"text-xs","uppercase","tracking-wider","opacity-60"],["data-testid","dependency-usage-legend",1,"m-0","flex","list-none","flex-col","gap-1","p-0","text-sm"],[1,"m-0","text-xs","opacity-70"],[3,"line","color"],["id","dependency-badge-legend-title",1,"text-xs","uppercase","tracking-wider","opacity-60"],["data-testid","dependency-badge-legend",1,"m-0","flex","list-none","flex-col","gap-1","p-0","text-sm"],[3,"mark","upwardLine"],["id","dependency-kind-legend-title",1,"text-xs","uppercase","tracking-wider","opacity-60"],["data-testid","dependency-kind-legend",1,"m-0","flex","list-none","flex-col","gap-1","p-0","text-sm"],[3,"kind"]],template:function(i,o){i&1&&(d(0,"section",0)(1,"span",1),x(2),l(),d(3,"ul",2),N(4,Rp,4,3,"li",3,Lp),l()(),S(6,Fp,8,0,"section",4),S(7,Vp,6,0,"section",5),S(8,$p,6,0,"section",6)),i&2&&(c(2),L(o.isDependencyMetric()?"Dependencies":"Edges"),c(2),k(o.edgeLegend()),c(2),b(o.usageLegend().length>0?6:-1),c(),b(o.badgeLegend().length>0?7:-1),c(),b(o.kindLegend().length>0?8:-1))},dependencies:[Cn,In,Tn,On],encapsulation:2})}}return t})();var Ni={cycles:"Cycles",upward:"Upward",uses:"Uses",usedBy:"Used by",standsFor:"Stands for",declarations:"Declarations"},ja=20,Wp="this file";function qa(t,n){return t.kind==="edge"?Qp(t.edge,`${t.fromName} \u2192 ${t.toName}`,n):m(p({},Up(t,n)),{parent:t.parent&&Kp(t.parent)})}function Up({node:t,isOpen:n},e){switch(t.kind){case"declaration":return Xp(t,e);case"file":return jp(t,n,e);default:return Zp(t,e)}}function Kp(t){let n=t.kind==="file"?"file":"folder",e=Pe(t.path)?`package ${t.name}`:t.path;return{path:t.path,name:t.name,kind:n,shownAs:e}}function jp(t,n,e){let i=e.index.declarationsOfFile.get(t.path)??[],{inside:o,outgoing:r,incoming:s}=Bi(i,e.index),a=Fi(i,e);return m(p(p({kind:"file",title:t.name,parent:null,path:t.path,copyText:t.path,badges:[...qp(i),...Ri(a.cycleCount)],declarations:nh(i,e.rowLimit),sections:ki({insideOwnFile:o,uses:r,usedBy:s},ze(i),e)},a),Qa(o,ze(i),e)),{action:zp(i,n)})}function qp(t){let n=[...new Set(t.flatMap(({leaf:e})=>e.namespace===void 0?[]:[e.namespace]))];return[{text:"file"},...n.map(e=>({text:`package ${e}`})),{text:pe(t.length,"declaration")}]}function zp(t,n){return t.length===0?null:n?"close":"open"}function Xp(t,n){let e=n.index.declarations.get(t.path),i=e?[e]:[],{inside:o,outgoing:r,incoming:s}=Bi(i,n.index),a=[...o.filter(C=>X(C)===t.path),...r],h=[...o.filter(C=>Y(C)===t.path),...s],f=Fi(i,n);return m(p(p({kind:"declaration",title:t.name,parent:null,path:t.path,copyText:e?.filePath??null,badges:[...Yp(t,e),...Ri(f.cycleCount)],declarations:null,sections:ki({uses:a,usedBy:h},ze(i),n)},f),Ja),{action:null})}function Yp(t,n){let{namespace:e,level:i}=n?.leaf??{};return[{text:Gt(t.declarationKind??"")},...e===void 0?[]:[{text:`package ${e}`}],...i===void 0?[]:[{text:`level ${i}`}]]}function Zp(t,n){let e=ec(t),i=e.flatMap(h=>n.index.declarationsOfFile.get(h.path)??[]),o=Fi(i,n),r=Bi(i,n.index),s=ze(i),a=t.kind==="package";return m(p(p({kind:"folder",title:t.name,parent:null,path:t.path,copyText:a?t.name:t.path,badges:[{text:a?"package":"folder"},{text:pe(e.length,"file")},...Jp(i.length,r,n),...Ri(o.cycleCount)],declarations:null,sections:ki({uses:r.outgoing,usedBy:r.incoming},s,n)},o),Qa(r.inside,s,n)),{action:null})}function Jp(t,{inside:n,outgoing:e,incoming:i},o){let r=[...n,...e,...i];return[{text:pe(t,"declaration")},{text:`${r.filter(s=>s.isCyclic).length} cyclic`},{text:`${r.filter(o.pointsUpward).length} upward`}]}function ki({insideOwnFile:t=[],uses:n,usedBy:e},i,o){return[Ai("uses",[{heading:Wp,declarationEdges:t},...Ka(n,s=>s.toNodeName)],i,o),Ai("usedBy",Ka(e,s=>s.fromNodeName),i,o)]}function Qp(t,n,e){let i=s=>e.index.declarations.has(s),o=t.declarationEdges.filter(s=>i(X(s))&&i(Y(s))),r=i(t.fromPath)&&i(t.toPath);return m(p({kind:"edge",title:n,parent:null,path:t.id,copyText:null,badges:[{text:eh(t,e.edgeMetric)},...th(o)],declarations:null,sections:[Ai("standsFor",[{heading:null,declarationEdges:o}],new Set,e)],cycles:[],cycleCount:0},Ja),{action:o.length>0&&!r?"unfold":null})}function eh(t,n){return ue(n)?pe(t.weight,"dependency","dependencies"):`${n} ${t.weight}`}function Ri(t){return t===0?[]:[{text:pe(t,"cycle"),isAboutCycles:!0}]}function ze(t){return new Set(t.map(n=>n.path))}function th(t){let n=new Map;for(let e of t.flatMap(i=>i.usage))n.set(e,(n.get(e)??0)+1);return[...n].sort(([e,i],[o,r])=>r-i||e.localeCompare(o)).map(([e,i])=>({text:`${He(e)} ${i}`}))}function nh(t,n){let e=t.map(i=>({reference:Pn(i),detail:ih(i)})).sort((i,o)=>i.reference.name.localeCompare(o.reference.name));return{count:e.length,items:e.slice(0,n),hiddenCount:za(e,n)}}function ih({leaf:t}){return[Gt(t.kind).toLowerCase(),...t.level===void 0?[]:[`level ${t.level}`]].join(" \xB7 ")}function Bi(t,n){let e=ze(t),i=t.flatMap(({path:r})=>n.outgoing.get(r)??[]),o=t.flatMap(({path:r})=>n.incoming.get(r)??[]);return{inside:i.filter(r=>e.has(Y(r))),outgoing:i.filter(r=>!e.has(Y(r))),incoming:o.filter(r=>!e.has(X(r)))}}function za(t,n){return Math.max(0,t.length-n)}function Ka(t,n){let e=new Map;for(let i of t)K(e,n(i),i);return[...e.entries()].map(([i,o])=>({heading:Gi(i),declarationEdges:o})).sort((i,o)=>i.heading.name.localeCompare(o.heading.name)||i.heading.path.localeCompare(o.heading.path))}function Ai(t,n,e,i){let{rowLimit:o}=i,r=n.filter(s=>s.declarationEdges.length>0);return{id:t,title:Ni[t],count:r.reduce((s,a)=>s+a.declarationEdges.length,0),groups:r.map(({heading:s,declarationEdges:a})=>{let h=a.map(f=>Xa(f,e,i)).sort(sh);return{heading:s,dependencies:h.slice(0,o),hiddenCount:za(h,o)}})}}function Xa(t,n,{index:e,pointsUpward:i}){return m(p({from:Pn(e.declarations.get(X(t))),to:Pn(e.declarations.get(Y(t))),isFromOwn:n.has(X(t)),isToOwn:n.has(Y(t)),specificUsages:t.usage.filter(o=>o!==$t).map(He)},Ya(t,{pointsUpward:i})),{declarationEdge:t})}function Ya(t,{pointsUpward:n}){return{line:Un(t.usage),type:Lt({isCyclic:t.isCyclic,isPointingUpwards:n(t)})}}var oh={feedbackContainerLevel:0,feedbackLeafLevel:1,cyclic:2,regular:3},rh={feedbackLeafLevel:0,feedbackContainerLevel:1,cyclic:2,regular:3};function Za(t){return(n,e)=>t[n.type]-t[e.type]||n.from.name.localeCompare(e.from.name)||n.to.name.localeCompare(e.to.name)}var sh=Za(oh),ah=Za(rh),Ja={upwardDependencies:[],upwardCount:0};function Qa(t,n,e){let i=r=>e.lineStyleShows==="usage"?r.line:Wt(r.type,e.lineStyleShows),o=t.filter(e.pointsUpward).map(r=>Xa(r,n,e)).map(r=>({dependency:m(p({},r),{line:i(r)}),files:[...new Set([r.declarationEdge.fromNodeName,r.declarationEdge.toNodeName])].map(Gi)})).sort((r,s)=>ah(r.dependency,s.dependency));return{upwardDependencies:o.slice(0,e.rowLimit),upwardCount:o.length}}function Fi(t,n){let{index:e,cycles:i,rowLimit:o}=n,r=ze(t),s=$a(r,i).map(a=>{let h=dh(a,r);return{steps:h.map(f=>({reference:Pn(e.declarations.get(X(f))),linkToNext:Ya(f,n)})),files:[...new Set(h.map(f=>f.fromNodeName))].map(Gi),declarationEdges:h}});return{cycleCount:s.length,cycles:s.toSorted(ch).slice(0,o)}}function ch(t,n){return n.files.length-t.files.length||n.steps.length-t.steps.length||t.steps[0].reference.name.localeCompare(n.steps[0].reference.name)}function dh(t,n){let e=Math.max(0,t.findIndex(i=>n.has(X(i))));return[...t.slice(e),...t.slice(0,e)]}function ec(t){return t.kind==="file"?[t]:t.children.flatMap(ec)}function Pn({path:t,leaf:n}){return{path:t,name:n.name,kind:"declaration",declarationKind:n.kind}}function Gi(t){return{path:t,name:mt(t),kind:"file"}}var tc=[],nc={subjectId:null,isDismissed:!1,showsAllRows:!1},Me=(()=>{class t{constructor(){this.graphModel=y(qe),this.viewStore=y(ne),this.writeStore=y(j),this.readStore=y(F),this.selectedNodePath$=this.readStore.selectedNodePath$,this.sharedSelectedPath=v(this.selectedNodePath$,{requireSync:!0}),this.isDeltaState=v(this.readStore.isDeltaState$,{requireSync:!0}),this.selectedInGraph=U(null),this.pointedAtEdges=U(tc),this.pointedAtNodePath=U(null),this.touchedView=U(nc),this.sectionAskedFor=U(null),this.openedSections=U(new Set),this.edgeColors=g(()=>{let{edgeColors:e,lineStyleShows:i}=this.graphModel.settings();return $e(e,i)}),this.selection=g(()=>{let e=this.selectedInGraph(),i=this.sharedSelectedPath();return e?.sharedPath===i&&e.layoutIdentity===this.viewStore.adoptedLayoutIdentity()?e.selection:i?{kind:"box",path:i}:null}),this.selectedEdge=g(()=>{let e=this.selection();return e?.kind==="edge"?this.graphModel.projectedEdges().find(i=>i.id===e.id)??null:null}),this.openSections=this.openedSections.asReadonly(),this.sectionRequest=g(()=>{let e=this.sectionAskedFor(),i=this.selection();return e&&i?.kind==="box"&&i.path===e.boxPath?{id:e.id,sectionId:e.sectionId}:null}),this.selectedBoxPath=g(()=>{let e=this.selection();return e?.kind==="box"?this.graphModel.boxStandingFor(e.path):null}),this.selectedEdgeId=g(()=>this.selectedEdge()?.id??null),this.subject=g(()=>{let e=this.selection(),i=this.selectedEdge();if(i){let a=h=>this.graphModel.boxes().get(h)?.name??h;return{kind:"edge",edge:i,fromName:a(i.fromPath),toName:a(i.toPath)}}let o=this.graphModel.treeIndex(),r=e?.kind==="box"?o?.nodeAt.get(e.path):void 0;if(!r)return null;let s=o.parentOf.get(r.path)??null;return{kind:"box",node:r,parent:s,isOpen:this.viewStore.expandedPaths().has(r.path)}}),this.subjectId=g(()=>{let e=this.subject();return e&&(e.kind==="edge"?`edge ${e.edge.id}`:`box ${e.node.path}`)}),this.subjectView=g(()=>{let e=this.touchedView();return e.subjectId===this.subjectId()?e:nc}),this.model=g(()=>{let e=this.subject(),i=this.graphModel.declarationIndex(),{isDismissed:o,showsAllRows:r}=this.subjectView();return!e||i.declarations.size===0||o?null:qa(e,{index:i,rowLimit:r?Number.POSITIVE_INFINITY:ja,cycles:this.graphModel.cycleChains(),edgeMetric:this.graphModel.edgeMetric(),pointsUpward:this.graphModel.pointsUpward(),lineStyleShows:this.graphModel.settings().lineStyleShows})}),this.isShown=g(()=>this.model()!==null&&!this.isDeltaState()),this.highlightedEdgeIds=g(()=>{let e=i=>this.graphModel.boxStandingFor(i);return new Set(this.pointedAtEdges().map(i=>hn(e(X(i)),e(Y(i)))))}),this.pointedAtBoxPaths=g(()=>{let e=this.pointedAtEdges().flatMap(r=>[X(r),Y(r)]),i=this.pointedAtNodePath(),o=i===null?e:[...e,i];return new Set(o.map(r=>this.graphModel.boxStandingFor(r)).filter(r=>r!==null))}),this.selectedNodePath$.pipe(Ji()).subscribe(e=>{te(this.selectedInGraph)?.sharedPath!==e&&this.selectedInGraph.set(null),this.showAgain()}),ie(()=>{this.subjectId(),te(()=>this.pointAtNode(null))})}select(e){let i=this.graphModel.nodePathOf(e);this.selectInGraph(i===e?null:{kind:"box",path:e},i),this.sectionAskedFor.set(null),i===null?this.writeStore.clearSelection():this.writeStore.selectNode(i)}selectEdge(e){this.selectInGraph({kind:"edge",id:e},null),this.writeStore.clearSelection()}showSectionOf(e,i){let o=(this.sectionAskedFor()?.id??0)+1;this.select(e),this.openedSections.update(r=>new Set([...r,i])),this.sectionAskedFor.set({id:o,boxPath:e,sectionId:i})}toggleSection(e){this.openedSections.update(i=>{let o=new Set(i);return o.delete(e)||o.add(e),o})}answerSectionRequest(){this.sectionAskedFor.set(null)}goTo(e){this.viewStore.reveal([e.path]),this.select(e.path),this.pointAtEdges(null),this.pointAtNode(null),this.bringIntoView([e.path])}pointAtEdges(e){this.pointedAtEdges.set(e??tc)}pointAtNode(e){this.pointedAtNodePath.set(e)}perform(e){let i=this.subject();i?.kind==="edge"&&e==="unfold"?(this.selectedInGraph.set(null),this.revealEndsOf(i.edge.declarationEdges)):i?.kind==="box"&&e==="open"?(this.viewStore.openBox(i.node.path),this.bringIntoView([i.node.path])):i?.kind==="box"&&this.viewStore.toggle(i.node.path)}showCycle(e){this.revealEndsOf(e.declarationEdges),this.pointAtEdges(e.declarationEdges)}showUpwardDependency({dependency:e}){this.revealEndsOf([e.declarationEdge]),this.pointAtEdges([e.declarationEdge])}showAllRows(){this.touchedView.set({subjectId:this.subjectId(),isDismissed:!1,showsAllRows:!0})}dismiss(){this.touchedView.set(m(p({},this.subjectView()),{subjectId:this.subjectId(),isDismissed:!0})),this.pointAtEdges(null),this.pointAtNode(null)}selectInGraph(e,i){let o=te(this.viewStore.adoptedLayoutIdentity);this.selectedInGraph.set(e&&{selection:e,sharedPath:i,layoutIdentity:o}),this.showAgain()}showAgain(){this.touchedView.update(e=>e.isDismissed?m(p({},e),{isDismissed:!1}):e)}revealEndsOf(e){let i=[...new Set(e.flatMap(o=>[X(o),Y(o)]))];this.viewStore.reveal(i),this.bringIntoView(i)}bringIntoView(e){this.viewStore.bringIntoView(e.flatMap(i=>this.graphModel.boxStandingFor(i)??[]))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=z({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ic=(()=>{class t{constructor(){this.pointingChange=$()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=qi({type:t,selectors:[["","ccPointing",""]],hostBindings:function(i,o){i&1&&E("mouseenter",function(){return o.pointingChange.emit(!0)})("mouseleave",function(){return o.pointingChange.emit(!1)})("focusin",function(){return o.pointingChange.emit(!0)})("focusout",function(){return o.pointingChange.emit(!1)})},outputs:{pointingChange:"pointingChange"}})}}return t})();var lh=["cyclesSection"],ph=["upwardSection"],Ct=t=>({$implicit:t}),Hi=(t,n)=>({$implicit:t,count:n}),hh=t=>({$implicit:"cycles",count:t}),Vi=t=>({$implicit:t,isOwn:!1}),uh=t=>({$implicit:t,testId:"dependency-inspector-more-cycles"}),mh=t=>({$implicit:"upward",count:t}),fh=t=>({$implicit:t,testId:"dependency-inspector-more-upward"}),oc=(t,n)=>({$implicit:t,isOwn:n}),gh=t=>({$implicit:"declarations",count:t}),_h=(t,n)=>n.text,xh=(t,n)=>n.id,yh=(t,n)=>n.path,Ch=(t,n)=>n.reference.path;function wh(t,n){if(t&1&&w(0,"cc-declaration-kind-icon",8),t&2){let e=u().$implicit;_("kind",e.declarationKind)}}function Sh(t,n){if(t&1&&w(0,"i",11),t&2){let e=u().$implicit,i=u();he(i.icons[e.kind])}}function bh(t,n){if(t&1){let e=A();d(0,"button",7),E("click",function(){let o=D(e).$implicit,r=u();return T(r.goTo(o))}),S(1,wh,1,1,"cc-declaration-kind-icon",8)(2,Sh,1,2,"i",9),d(3,"span",10),x(4),l()()}if(t&2){let e=n.$implicit;_("title",e.path),c(),b(e.kind==="declaration"?1:2),c(3),L(e.name)}}function vh(t,n){if(t&1&&(d(0,"span",12),q(1,13),l()),t&2){let e=n.$implicit,i=n.isOwn;u();let o=V(2);he(i?"border-primary":"border-base-300"),c(),_("ngTemplateOutlet",o)("ngTemplateOutletContext",oe(4,Ct,e))}}function Eh(t,n){if(t&1&&w(0,"i",17),t&2){let e=u().$implicit,i=u();he(i.isOpen(e)?"fa-chevron-down":"fa-chevron-right")}}function Dh(t,n){if(t&1&&(d(0,"span",14),S(1,Eh,1,2,"i",15),x(2),l(),d(3,"span",16),x(4),l()),t&2){let e=n.$implicit,i=n.count,o=u();c(),b(o.foldsItsSections()?1:-1),c(),ae(" ",o.sectionTitles[e]," "),c(2),L(i)}}function Th(t,n){if(t&1){let e=A();d(0,"button",21),E("click",function(){D(e);let o=u().$implicit,r=u();return T(r.toggleSection(o))}),q(1,13),l()}if(t&2){let e=u(),i=e.$implicit,o=e.count,r=u(),s=V(6);O("aria-expanded",r.isOpen(i)),c(),_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ae(3,Hi,i,o))}}function Ih(t,n){if(t&1&&(d(0,"div",20),q(1,13),l()),t&2){let e=u(),i=e.$implicit,o=e.count;u();let r=V(6);c(),_("ngTemplateOutlet",r)("ngTemplateOutletContext",Ae(2,Hi,i,o))}}function Oh(t,n){if(t&1&&(d(0,"h3",18),S(1,Th,2,6,"button",19)(2,Ih,2,5,"div",20),l()),t&2){let e=u();c(),b(e.foldsItsSections()?1:2)}}function Ph(t,n){if(t&1){let e=A();d(0,"button",22),E("click",function(){D(e);let o=u();return T(o.showAllRows())}),x(1),l()}if(t&2){let e=n.$implicit,i=n.testId;O("data-testid",i),c(),ae(" and ",e," more ")}}function Mh(t,n){if(t&1){let e=A();d(0,"button",39),E("click",function(){let o=D(e),r=u(2);return T(r.goTo(o))}),x(1),l()}t&2&&(c(),ae(" ",n.shownAs," "))}function Lh(t,n){if(t&1&&(d(0,"span",40),x(1),l()),t&2){let e=n.$implicit;he(e.isAboutCycles?"badge-info badge-soft border-info":"badge-ghost border-base-300"),c(),L(e.text)}}function Ah(t,n){if(t&1){let e=A();d(0,"button",41),E("click",function(){D(e);let o=u(2);return T(o.copyPath())}),w(1,"i",42),l()}if(t&2){let e=u(2);_("title",e.copied()?"Copied!":"Copy path"),O("aria-label",e.copied()?"Copied!":"Copy path"),c(),Ce("fa-copy",!e.copied())("fa-check",e.copied())}}function Nh(t,n){if(t&1){let e=A();d(0,"button",43),E("click",function(){let o=D(e),r=u(2);return T(r.perform(o))}),x(1),l()}if(t&2){let e=u(2);c(),ae(" ",e.actionLabels[n]," ")}}function kh(t,n){if(t&1&&(d(0,"span",52),x(1),l()),t&2){let e=u().$implicit,i=u().$implicit,o=u(4);ge("color",o.edgeColors()[e.linkToNext.type]),c(),ae("\u21A9 ",i.steps[0].reference.name)}}function Rh(t,n){if(t&1&&w(0,"cc-line-style-sample",51),t&2){let e=u().$implicit,i=u(5);_("line",e.linkToNext.line)("color",i.edgeColors()[e.linkToNext.type])("label","uses")}}function Bh(t,n){if(t&1&&(q(0,13),S(1,kh,2,3,"span",50)(2,Rh,1,3,"cc-line-style-sample",51)),t&2){let e=n.$implicit,i=n.$index,o=n.$count;u(5);let r=V(4);_("ngTemplateOutlet",r)("ngTemplateOutletContext",oe(3,Vi,e.reference)),c(),b(i===o-1?1:2)}}function Fh(t,n){if(t&1&&x(0),t&2){let e=n.$implicit,i=n.$index,o=n.$count;Tt(" ",e.name,"",i===o-1?"":","," ")}}function Gh(t,n){if(t&1){let e=A();d(0,"div",45),E("pointingChange",function(o){let r=D(e).$implicit,s=u(4);return T(s.pointAtEdges(o?r.declarationEdges:null))}),d(1,"div",46),N(2,Bh,3,5,null,null,ye),l(),d(4,"div",47)(5,"span",48),x(6),N(7,Fh,1,2,null,null,yh),l(),d(9,"button",49),E("click",function(){let o=D(e).$implicit,r=u(4);return T(r.showCycle(o))}),x(10,"Show in graph"),l()()()}if(t&2){let e=n.$implicit;c(2),k(e.steps),c(4),ae(" ",e.files.length===1?"inside":"across"," "),c(),k(e.files)}}function Vh(t,n){if(t&1&&q(0,13),t&2){let e=u(3);u();let i=V(10);_("ngTemplateOutlet",i)("ngTemplateOutletContext",oe(2,uh,e.cycleCount-e.cycles.length))}}function Hh(t,n){if(t&1&&(N(0,Gh,11,1,"div",44,ye),S(2,Vh,1,4,"ng-container",13)),t&2){let e=u(2);k(e.cycles),c(2),b(e.cycleCount>e.cycles.length?2:-1)}}function $h(t,n){if(t&1&&(d(0,"section",37,5),q(2,13),S(3,Hh,3,1),l()),t&2){let e=u(),i=u(),o=V(8);O("aria-label",i.sectionTitles.cycles),c(2),_("ngTemplateOutlet",o)("ngTemplateOutletContext",oe(4,hh,e.cycleCount)),c(),b(i.showsBodyOf("cycles")?3:-1)}}function Wh(t,n){if(t&1&&x(0),t&2){let e=u().$implicit;ae(" inside ",e.files[0].name," ")}}function Uh(t,n){if(t&1&&x(0),t&2){let e=u().$implicit;Tt(" from ",e.files[0].name," to ",e.files[1].name," ")}}function Kh(t,n){if(t&1){let e=A();d(0,"div",54),E("pointingChange",function(o){let r=D(e).$implicit,s=u(4);return T(s.pointAtEdges(o?[r.dependency.declarationEdge]:null))}),d(1,"div",46),q(2,13),w(3,"cc-line-style-sample",51),q(4,13),l(),d(5,"div",47)(6,"span",55)(7,"span",56),x(8),l(),d(9,"span",57),S(10,Wh,1,1)(11,Uh,1,2),l()(),d(12,"button",49),E("click",function(){let o=D(e).$implicit,r=u(4);return T(r.showUpwardDependency(o))}),x(13,"Show in graph"),l()()()}if(t&2){let e=n.$implicit,i=u(4),o=V(4);c(2),_("ngTemplateOutlet",o)("ngTemplateOutletContext",oe(11,Vi,e.dependency.from)),c(),_("line",e.dependency.line)("color",i.edgeColors()[e.dependency.type])("label",e.dependency.specificUsages.join(", ")||"uses"),c(),_("ngTemplateOutlet",o)("ngTemplateOutletContext",oe(13,Vi,e.dependency.to)),c(3),ge("color",i.edgeColors()[e.dependency.type]),c(),L(i.edgeTypeLabels[e.dependency.type]),c(2),b(e.files.length===1?10:11)}}function jh(t,n){if(t&1&&q(0,13),t&2){let e=u(3);u();let i=V(10);_("ngTemplateOutlet",i)("ngTemplateOutletContext",oe(2,fh,e.upwardCount-e.upwardDependencies.length))}}function qh(t,n){if(t&1&&(N(0,Kh,14,15,"div",53,ye),S(2,jh,1,4,"ng-container",13)),t&2){let e=u(2);k(e.upwardDependencies),c(2),b(e.upwardCount>e.upwardDependencies.length?2:-1)}}function zh(t,n){if(t&1&&(d(0,"section",38,6),q(2,13),S(3,qh,3,1),l()),t&2){let e=u(),i=u(),o=V(8);O("aria-label",i.sectionTitles.upward),c(2),_("ngTemplateOutlet",o)("ngTemplateOutletContext",oe(4,mh,e.upwardCount)),c(),b(i.showsBodyOf("upward")?3:-1)}}function Xh(t,n){if(t&1&&(d(0,"span"),x(1),l()),t&2){let e=u();c(),L(e)}}function Yh(t,n){if(t&1){let e=A();d(0,"span",64),E("pointingChange",function(o){D(e);let r=u(),s=u(6);return T(s.pointAtNode(o?r.path:null))}),q(1,13),l()}if(t&2){let e=u();u(6);let i=V(2);c(),_("ngTemplateOutlet",i)("ngTemplateOutletContext",oe(2,Ct,e))}}function Zh(t,n){if(t&1&&(d(0,"div",60),S(1,Xh,2,1,"span")(2,Yh,2,4,"span",62),d(3,"span",63),x(4),l()()),t&2){let e=u().$implicit;c(),b(typeof n=="string"?1:2),c(3),L(e.dependencies.length+e.hiddenCount)}}function Jh(t,n){if(t&1&&(d(0,"span",68),x(1),l()),t&2){let e=u(2).$implicit,i=u(6);ge("color",i.edgeColors()[e.type]),c(),Tt(" ",e.specificUsages.length>0?"\xB7 ":"","",i.edgeTypeLabels[e.type])}}function Qh(t,n){if(t&1&&(d(0,"div",66)(1,"span",57),x(2),l(),S(3,Jh,2,4,"span",67),l()),t&2){let e=u().$implicit;c(2),L(e.specificUsages.join(", ")),c(),b(e.type!=="regular"?3:-1)}}function eu(t,n){if(t&1){let e=A();d(0,"div",65),E("pointingChange",function(o){let r=D(e).$implicit,s=u(6);return T(s.pointAtEdges(o?[r.declarationEdge]:null))}),d(1,"div",46),q(2,13),w(3,"cc-line-style-sample",51),q(4,13),l(),S(5,Qh,4,2,"div",66),l()}if(t&2){let e=n.$implicit,i=u(6),o=V(4);c(2),_("ngTemplateOutlet",o)("ngTemplateOutletContext",Ae(8,oc,e.from,e.isFromOwn)),c(),_("line",e.line)("color",i.edgeColors()[e.type])("label",e.specificUsages.join(", ")||"uses"),c(),_("ngTemplateOutlet",o)("ngTemplateOutletContext",Ae(11,oc,e.to,e.isToOwn)),c(),b(e.specificUsages.length>0||e.type!=="regular"?5:-1)}}function tu(t,n){if(t&1&&q(0,13),t&2){let e=u().$implicit;u(5);let i=V(10);_("ngTemplateOutlet",i)("ngTemplateOutletContext",oe(2,Ct,e.hiddenCount))}}function nu(t,n){if(t&1&&(d(0,"div",59),S(1,Zh,5,2,"div",60),N(2,eu,6,14,"div",61,ye),S(4,tu,1,4,"ng-container",13),l()),t&2){let e,i=n.$implicit;c(),b((e=i.heading)?1:-1,e),c(),k(i.dependencies),c(2),b(i.hiddenCount>0?4:-1)}}function iu(t,n){if(t&1&&N(0,nu,5,2,"div",59,ye),t&2){let e=u(2).$implicit;k(e.groups)}}function ou(t,n){if(t&1&&(d(0,"section",58),q(1,13),S(2,iu,2,0),l()),t&2){let e=u().$implicit,i=u(2),o=V(8);O("aria-label",e.title),c(),_("ngTemplateOutlet",o)("ngTemplateOutletContext",Ae(4,Hi,e.id,e.count)),c(),b(i.showsBodyOf(e.id)?2:-1)}}function ru(t,n){if(t&1&&S(0,ou,3,7,"section",58),t&2){let e=n.$implicit;b(e.count>0?0:-1)}}function su(t,n){if(t&1){let e=A();d(0,"li",72),E("pointingChange",function(o){let r=D(e).$implicit,s=u(5);return T(s.pointAtNode(o?r.reference.path:null))}),q(1,13),d(2,"span",73),x(3),l()()}if(t&2){let e=n.$implicit;u(5);let i=V(2);c(),_("ngTemplateOutlet",i)("ngTemplateOutletContext",oe(3,Ct,e.reference)),c(2),L(e.detail)}}function au(t,n){if(t&1&&q(0,13),t&2){let e=u(3);u(2);let i=V(10);_("ngTemplateOutlet",i)("ngTemplateOutletContext",oe(2,Ct,e.hiddenCount))}}function cu(t,n){if(t&1&&(d(0,"ul",70),N(1,su,4,5,"li",71,Ch),l(),S(3,au,1,4,"ng-container",13)),t&2){let e=u(2);c(),k(e.items),c(2),b(e.hiddenCount>0?3:-1)}}function du(t,n){if(t&1&&(d(0,"section",69),q(1,13),S(2,cu,4,1),l()),t&2){let e=u(),i=u(2),o=V(8);O("aria-label",i.sectionTitles.declarations),c(),_("ngTemplateOutlet",o)("ngTemplateOutletContext",oe(4,gh,e.count)),c(),b(i.showsBodyOf("declarations")?2:-1)}}function lu(t,n){t&1&&S(0,du,3,6,"section",69),t&2&&b(n.count>0?0:-1)}function pu(t,n){if(t&1){let e=A();d(0,"header",23)(1,"div",24)(2,"span",25),x(3,"Inspector"),l(),d(4,"button",26),E("click",function(){D(e);let o=u();return T(o.dismiss())}),w(5,"i",27),l()(),d(6,"div",28)(7,"div",29),S(8,Mh,2,1,"button",30),d(9,"h2",31),x(10),l(),d(11,"div",32),N(12,Lh,2,3,"span",33,_h),l()(),S(14,Ah,2,6,"button",34),l(),S(15,Nh,2,1,"button",35),l(),d(16,"div",36),S(17,$h,4,6,"section",37),S(18,zh,4,6,"section",38),N(19,ru,1,1,null,null,xh),S(21,lu,1,1),l()}if(t&2){let e,i,o,r=n;c(8),b((e=r.parent)?8:-1,e),c(),_("title",r.path),c(),ae(" ",r.title," "),c(2),k(r.badges),c(2),b(r.copyText?14:-1),c(),b((i=r.action)?15:-1,i),c(2),b(r.cycleCount>0?17:-1),c(),b(r.upwardCount>0?18:-1),c(),k(r.sections),c(2),b((o=r.declarations)?21:-1,o)}}var hu={open:"Open in graph",close:"Close in graph",unfold:"Unfold in graph"},uu={folder:"fa fa-folder-o",file:"fa fa-file-o"},rc=(()=>{class t{constructor(){this.store=y(Me),this.model=this.store.model,this.edgeColors=this.store.edgeColors,this.cyclesSection=Qe("cyclesSection"),this.upwardSection=Qe("upwardSection"),this.shownPath=g(()=>this.model()?.path),this.clipboard=y(Fn),this.actionLabels=hu,this.edgeTypeLabels=be,this.copied=this.clipboard.copied,this.icons=uu,this.sectionTitles=Ni,this.foldsItsSections=g(()=>this.model()?.kind!=="edge"),ie(()=>{let e=this.store.sectionRequest(),i={cycles:this.cyclesSection(),upward:this.upwardSection()},o=e&&i[e.sectionId]?.nativeElement;o&&(o.scrollIntoView({block:"start"}),te(()=>this.store.answerSectionRequest()))}),ie(()=>{this.shownPath(),te(()=>this.clipboard.reset())})}async copyPath(){let e=this.model()?.copyText;e&&await this.clipboard.copy(e).catch(()=>{})}isOpen(e){return this.store.openSections().has(e)}showsBodyOf(e){return!this.foldsItsSections()||this.isOpen(e)}toggleSection(e){this.store.toggleSection(e)}goTo(e){this.store.goTo(e)}pointAtEdges(e){this.store.pointAtEdges(e)}pointAtNode(e){this.store.pointAtNode(e)}perform(e){this.store.perform(e)}showCycle(e){this.store.showCycle(e)}showUpwardDependency(e){this.store.showUpwardDependency(e)}showAllRows(){this.store.showAllRows()}dismiss(){this.store.dismiss()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-dependency-inspector"]],viewQuery:function(i,o){i&1&&Et(o.cyclesSection,lh,5)(o.upwardSection,ph,5),i&2&&Dt(2)},hostAttrs:[1,"absolute","inset-y-0","right-0","flex","w-[var(--cc-inspector-width)]","max-w-[90vw]","flex-col","bg-base-100","shadow-[-2px_0_8px_-2px_rgba(0,0,0,0.15)]","transition-transform","duration-300"],hostVars:5,hostBindings:function(i,o){i&2&&(O("aria-hidden",o.model()===null),Ce("translate-x-full",o.model()===null)("pointer-events-none",o.model()===null))},features:[Le([Fn])],decls:12,vars:1,consts:[["referenceButton",""],["chip",""],["sectionTitleAndCount",""],["sectionHeader",""],["moreRows",""],["cyclesSection",""],["upwardSection",""],["type","button",1,"inline-flex","max-w-full","min-w-0","cursor-pointer","items-center","gap-1","rounded-sm","border-0","bg-transparent","p-0","text-left","hover:underline",3,"click","title"],[3,"kind"],["aria-hidden","true",1,"shrink-0","text-xs","opacity-60",3,"class"],[1,"truncate"],["aria-hidden","true",1,"shrink-0","text-xs","opacity-60"],[1,"inline-flex","max-w-full","min-w-0","items-center","rounded-sm","border","bg-base-200/60","py-px","pr-1.5","pl-1","text-[12.5px]"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"flex","items-center","gap-1.5"],["aria-hidden","true",1,"fa","w-2.5","text-[10px]",3,"class"],[1,"tracking-normal","tabular-nums"],["aria-hidden","true",1,"fa","w-2.5","text-[10px]"],[1,"m-0","text-xs","font-normal","tracking-widest","uppercase"],["type","button",1,"flex","w-full","cursor-pointer","items-center","justify-between","gap-2","border-0","bg-transparent","p-0","tracking-widest","uppercase","opacity-60","hover:opacity-100"],[1,"flex","items-center","justify-between","gap-2","opacity-60"],["type","button",1,"flex","w-full","cursor-pointer","items-center","justify-between","gap-2","border-0","bg-transparent","p-0","tracking-widest","uppercase","opacity-60","hover:opacity-100",3,"click"],["type","button",1,"btn","btn-ghost","btn-xs","self-start",3,"click"],[1,"shrink-0","px-3","py-2"],[1,"flex","items-center","justify-between"],[1,"text-xs","tracking-widest","uppercase","opacity-60"],["type","button","aria-label","Close inspector","title","Close inspector",1,"btn","btn-ghost","btn-xs","btn-square",3,"click"],["aria-hidden","true",1,"fa","fa-times"],[1,"mt-1","flex","items-start","justify-between","gap-2"],[1,"min-w-0"],["type","button","data-testid","dependency-inspector-parent",1,"m-0","block","cursor-pointer","border-0","bg-transparent","p-0","text-left","text-sm","leading-snug","break-all","opacity-60","hover:underline"],["data-testid","dependency-inspector-title",1,"m-0","text-lg","leading-snug","font-semibold","break-all","text-primary",3,"title"],["data-testid","dependency-inspector-badges",1,"mt-1","flex","flex-wrap","gap-1"],[1,"badge","badge-sm","h-auto","min-h-5","max-w-full","py-0.5","text-left","leading-tight","whitespace-normal","[overflow-wrap:anywhere]",3,"class"],["type","button","data-testid","dependency-inspector-copy",1,"btn","btn-ghost","btn-sm","btn-square","shrink-0",3,"title"],["type","button","data-testid","dependency-inspector-action",1,"btn","btn-xs","btn-outline","mt-2"],["data-testid","dependency-inspector-body",1,"min-h-0","flex-1","overflow-y-auto","pb-[var(--cc-legend-drawer-clearance,9rem)]","text-sm"],["data-testid","dependency-inspector-cycles",1,"flex","flex-col","gap-2","border-t","border-base-300","px-3","py-2"],["data-testid","dependency-inspector-upward",1,"flex","flex-col","gap-2","border-t","border-base-300","px-3","py-2"],["type","button","data-testid","dependency-inspector-parent",1,"m-0","block","cursor-pointer","border-0","bg-transparent","p-0","text-left","text-sm","leading-snug","break-all","opacity-60","hover:underline",3,"click"],[1,"badge","badge-sm","h-auto","min-h-5","max-w-full","py-0.5","text-left","leading-tight","whitespace-normal","[overflow-wrap:anywhere]"],["type","button","data-testid","dependency-inspector-copy",1,"btn","btn-ghost","btn-sm","btn-square","shrink-0",3,"click","title"],["aria-hidden","true",1,"fa"],["type","button","data-testid","dependency-inspector-action",1,"btn","btn-xs","btn-outline","mt-2",3,"click"],["data-testid","dependency-inspector-cycle","ccPointing","",1,"flex","flex-col","gap-1","rounded-md","border","border-base-300","p-1.5","hover:bg-base-200/60"],["data-testid","dependency-inspector-cycle","ccPointing","",1,"flex","flex-col","gap-1","rounded-md","border","border-base-300","p-1.5","hover:bg-base-200/60",3,"pointingChange"],[1,"flex","min-w-0","flex-wrap","items-center","gap-x-0.5","gap-y-1"],[1,"flex","items-baseline","justify-between","gap-2","text-xs"],["data-testid","dependency-inspector-cycle-where",1,"min-w-0","opacity-60","[overflow-wrap:anywhere]"],["type","button",1,"btn","btn-ghost","btn-xs","shrink-0",3,"click"],["data-testid","dependency-inspector-cycle-closing",1,"ml-1","text-xs",3,"color"],[3,"line","color","label"],["data-testid","dependency-inspector-cycle-closing",1,"ml-1","text-xs"],["data-testid","dependency-inspector-upward-dependency","ccPointing","",1,"flex","flex-col","gap-1","rounded-md","border","border-base-300","p-1.5","hover:bg-base-200/60"],["data-testid","dependency-inspector-upward-dependency","ccPointing","",1,"flex","flex-col","gap-1","rounded-md","border","border-base-300","p-1.5","hover:bg-base-200/60",3,"pointingChange"],["data-testid","dependency-inspector-upward-where",1,"min-w-0","[overflow-wrap:anywhere]"],[1,"font-semibold"],[1,"opacity-60"],[1,"flex","flex-col","gap-2","border-t","border-base-300","px-3","py-2"],["data-testid","dependency-inspector-group",1,"flex","flex-col","gap-1","rounded-md","border","border-base-300","p-1.5"],[1,"flex","min-w-0","items-baseline","justify-between","gap-2","text-[13px]","opacity-70"],["data-testid","dependency-inspector-row","ccPointing","",1,"flex","flex-col","gap-0.5","rounded-sm","px-0.5","hover:bg-base-200/60"],["data-testid","dependency-inspector-group-file","ccPointing","",1,"inline-flex","min-w-0"],[1,"shrink-0","tabular-nums"],["data-testid","dependency-inspector-group-file","ccPointing","",1,"inline-flex","min-w-0",3,"pointingChange"],["data-testid","dependency-inspector-row","ccPointing","",1,"flex","flex-col","gap-0.5","rounded-sm","px-0.5","hover:bg-base-200/60",3,"pointingChange"],[1,"pl-0.5","text-xs"],["data-testid","dependency-inspector-row-type",1,"font-semibold",3,"color"],["data-testid","dependency-inspector-row-type",1,"font-semibold"],[1,"flex","flex-col","gap-1.5","border-t","border-base-300","px-3","py-2"],[1,"m-0","flex","list-none","flex-col","gap-1","p-0"],["data-testid","dependency-inspector-declaration","ccPointing","",1,"flex","min-w-0","items-baseline","justify-between","gap-2"],["data-testid","dependency-inspector-declaration","ccPointing","",1,"flex","min-w-0","items-baseline","justify-between","gap-2",3,"pointingChange"],[1,"shrink-0","text-xs","opacity-60"]],template:function(i,o){if(i&1&&(w(0,"cc-inspector-resize-handle"),vt(1,bh,5,3,"ng-template",null,0,Ne)(3,vh,2,6,"ng-template",null,1,Ne)(5,Dh,5,3,"ng-template",null,2,Ne)(7,Oh,3,1,"ng-template",null,3,Ne)(9,Ph,2,2,"ng-template",null,4,Ne),S(11,pu,22,8)),i&2){let r;c(11),b((r=o.model())?11:-1,r)}},dependencies:[Zi,In,Ao,On,ic],encapsulation:2})}}return t})();function mu(t,n){t&1&&(d(0,"div",0)(1,"output",2)(2,"span"),x(3,"The dependency view shows a single map. Leave compare mode to see its dependencies."),l()()())}function fu(t,n){if(t&1){let e=A();d(0,"div",1)(1,"div",3)(2,"cc-dependency-graph",4),E("boxClicked",function(o){D(e);let r=u();return T(r.select(o))})("boxToggled",function(o){D(e);let r=u();return T(r.toggle(o))})("cycleBadgeClicked",function(o){D(e);let r=u();return T(r.showCyclesOf(o))})("upwardBadgeClicked",function(o){D(e);let r=u();return T(r.showUpwardOf(o))})("edgeClicked",function(o){D(e);let r=u();return T(r.selectEdge(o))})("boxHovered",function(o){D(e);let r=u();return T(r.hover(o))})("boxFocused",function(o){D(e);let r=u();return T(r.bringIntoView(o))})("boxRightClicked",function(o){D(e);let r=u();return T(r.openContextMenu(o))})("rendered",function(){D(e);let o=u();return T(o.markReady())})("boxDragged",function(o){D(e);let r=u();return T(r.moveBox(o))})("boxDragEnded",function(){D(e);let o=u();return T(o.endDragging())}),l()(),w(3,"cc-dependency-inspector"),l()}if(t&2){let e=u();c(2),_("scene",n)("graphIdentity",e.graphIdentity())("fitRequest",e.fitRequest())("viewRequest",e.viewRequest())("coveredBottom",e.coveredBottom())("canDragBox",e.canDragBox)("boxAt",e.boxAt)("pointedAtPaths",e.pointedAtBoxPaths())}}function gu(t,n){if(t&1){let e=A();d(0,"span"),x(1,"Nothing in the focused folder carries dependency levels."),l(),d(2,"button",5),E("click",function(){D(e);let o=u(2);return T(o.unfocus())}),x(3,"Unfocus"),l()}}function _u(t,n){t&1&&(d(0,"span"),x(1,"Every file that carries dependency levels is excluded. Include some again from the Excluded list in the explorer."),l())}function xu(t,n){if(t&1&&(d(0,"div",0)(1,"output",2),S(2,gu,4,0)(3,_u,2,0,"span"),l()()),t&2){let e=u();c(2),b(e.isFocused()?2:3)}}function yu(t,n){t&1&&(d(0,"div",0)(1,"output",2)(2,"span"),x(3,"No file in view carries dependency levels."),l()()())}var $i=(()=>{class t{constructor(){this.readStore=y(F),this.writeStore=y(j),this.viewStore=y(ne),this.viewReadinessStore=y(No),this.graphModel=y(qe),this.inspectorStore=y(Me),this.isDeltaState=v(this.readStore.isDeltaState$,{requireSync:!0}),this.isLoadingFile=v(y(to).isLoadingFile$,{initialValue:!1}),this.hasDependencyData=v(this.readStore.hasDependencyData$,{requireSync:!0}),this.isFocused=v(this.readStore.isFocused$,{requireSync:!0}),this.graphIdentity=g(()=>this.viewStore.adoptedLayoutIdentity()??""),this.fitRequest=this.viewStore.fitRequest,this.viewRequest=this.viewStore.viewRequest,this.pointedAtBoxPaths=this.inspectorStore.pointedAtBoxPaths,this.coveredBottom=this.viewStore.coveredBottom,this.hoveredPath=v(this.readStore.hoveredNodePath$,{requireSync:!0}),this.searchedPaths=v(this.readStore.searchedPaths$,{requireSync:!0}),this.boxAt=e=>{let i=this.graphModel.shownLayout();return i===null?null:ai(i,this.viewStore.raisedPaths(),e)},this.canDragBox=e=>{let i=this.graphModel.shownLayout();return i!==null&&pi(i,e)},this.searchedBoxPaths=g(()=>{let e=this.searchedPaths(),i=this.graphModel.representatives();return e&&new Set([...e,...[...e].flatMap(o=>i.get(o)??[])])}),this.cycleMarks=g(()=>{let{shownBoxBadges:e}=this.graphModel.settings();if(!Jn.some(r=>e.includes(r))||!ue(this.graphModel.edgeMetric()))return je;let o=ui(this.graphModel.cycleChains().map(Ha),{representatives:this.graphModel.representatives(),parentOf:r=>this.graphModel.boxes().get(r)?.parentPath,fileOf:r=>this.graphModel.declarationIndex().declarations.get(r)?.filePath});return hi(o,e)}),this.upwardMarks=g(()=>this.graphModel.settings().shownBoxBadges.includes("upward")&&ue(this.graphModel.edgeMetric())?Di(this.graphModel.declarations().leafEdges,this.graphModel.representatives(),this.graphModel.pointsUpward()):Ei),this.scene=g(()=>{let e=this.graphModel.shownLayout();if(!e)return null;let s=this.graphModel.settings(),{shownBoxBadges:i,hierarchy:o}=s,r=St(s,["shownBoxBadges","hierarchy"]);return m(p({},r),{cycleMarks:this.cycleMarks(),upwardMarks:this.upwardMarks(),layout:e,edges:this.graphModel.projectedEdges(),edgeMetric:this.graphModel.edgeMetric(),hoveredPath:this.graphModel.boxStandingFor(this.viewStore.hoveredBoxPath()??this.hoveredPath()),selectedPath:this.inspectorStore.selectedBoxPath(),selectedEdgeId:this.inspectorStore.selectedEdgeId(),highlightedEdgeIds:this.inspectorStore.highlightedEdgeIds(),raisedPaths:this.viewStore.raisedPaths(),draggingPath:this.viewStore.draggingPath(),searchedPaths:this.searchedBoxPaths()})}),ie(()=>{let e=this.graphModel.treeIndex();e&&this.viewStore.adoptTree(e)}),ie(()=>{(!this.scene()||this.isDeltaState())&&this.markReady()})}select(e){this.inspectorStore.select(e)}selectEdge(e){this.inspectorStore.selectEdge(e)}showCyclesOf(e){this.inspectorStore.showSectionOf(e,"cycles")}showUpwardOf(e){this.inspectorStore.showSectionOf(e,"upward")}toggle(e){let i=this.graphModel.boxes().get(e);i&&re(i)&&this.viewStore.toggle(e)}bringIntoView(e){this.viewStore.bringIntoView([e])}hover(e){this.viewStore.hoverInGraph(e),this.writeStore.hoverNode(e===null?null:this.graphModel.nodePathOf(e))}openContextMenu({path:e,clientX:i,clientY:o}){let r=this.graphModel.nodePathOf(e);r!==null&&this.writeStore.openContextMenu(r,i,o)}moveBox({path:e,deltaX:i,deltaY:o}){let[r,s]=this.viewStore.boxOffsets().get(e)??[0,0];this.viewStore.placeBox(e,[r+i,s+o])}endDragging(){this.viewStore.endDragging()}unfocus(){this.writeStore.unfocus()}markReady(){this.viewReadinessStore.markReady("dependencies")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-dependency-map"]],hostAttrs:[1,"fixed","inset-x-0","z-0","top-[var(--cc-bars-height,49px)]","bottom-[var(--cc-bottom-bar-height,32px)]"],hostVars:2,hostBindings:function(i,o){i&2&&Ce("hidden",o.isLoadingFile())},decls:4,vars:1,consts:[[1,"flex","h-full","items-center","justify-center","p-4"],[1,"relative","h-full","overflow-hidden"],[1,"alert","max-w-md"],[1,"h-full"],[3,"boxClicked","boxToggled","cycleBadgeClicked","upwardBadgeClicked","edgeClicked","boxHovered","boxFocused","boxRightClicked","rendered","boxDragged","boxDragEnded","scene","graphIdentity","fitRequest","viewRequest","coveredBottom","canDragBox","boxAt","pointedAtPaths"],["type","button","data-testid","dependency-unfocus",1,"btn","btn-sm",3,"click"]],template:function(i,o){if(i&1&&S(0,mu,4,0,"div",0)(1,fu,4,8,"div",1)(2,xu,4,1,"div",0)(3,yu,4,0,"div",0),i&2){let r;b(o.isDeltaState()?0:(r=o.scene())?1:o.hasDependencyData()?2:3,r)}},dependencies:[di,rc],encapsulation:2})}}return t})();var Mn=(()=>{class t{constructor(){this.writeStore=y(j),this.viewStore=y(ne),this.focusedNodePath=v(y(F).focusedNodePath$,{requireSync:!0})}receive(e){Cu(e,this.focusedNodePath())||this.writeStore.unfocus(),this.viewStore.requestFit()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=z({token:t,factory:t.\u0275fac})}}return t})();function Cu(t,n){return!n||t===n||t.startsWith(`${n}/`)}function wu(t,n,e){let i=t.length>0?t.filter(s=>It(s)):n,o=i.filter(s=>s.isExcluded).length;return{shown:i.filter(s=>!s.isExcluded&&e.has(s.path)).length,flattened:0,excluded:o,noArea:0}}var Su=Se(bo,wo,At,wu),Wi=(()=>{class t{constructor(){this.counts$=y(we).select(Su)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=z({token:t,factory:t.\u0275fac})}}return t})();var Ui=(()=>{class t{constructor(){this.store=y(we),this.pathsWithDependencyLevels=v(this.store.select(At),{requireSync:!0})}project(e){return br(e,{pathsWithDependencyLevels:this.pathsWithDependencyLevels(),hidesExcludedNodes:!0})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=z({token:t,factory:t.\u0275fac})}}return t})();var Ki=(()=>{class t{constructor(){this.nodeInteraction=y(Nt),this.sharedViewReadWindow=y(ao),this.viewStore=y(ne),this.selectedNodePath=v(this.sharedViewReadWindow.selectedNodePath$,{requireSync:!0}),this.hoveredNodePath=v(this.sharedViewReadWindow.hoveredNodePath$,{requireSync:!0})}isSelected(e){return this.selectedNodePath()===e.path}isHovered(e){return this.hoveredNodePath()===e.path}select(e){this.nodeInteraction.selectNode(e.path),It(e)?this.viewStore.reveal([e.path]):this.viewStore.openBox(e.path)}deselect(){this.nodeInteraction.clearSelection()}hover(e){this.nodeInteraction.hoverNode(e.path)}hoverEnd(){this.nodeInteraction.hoverNode(null)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=z({token:t,factory:t.\u0275fac})}}return t})();function bu(t,n){t&1&&w(0,"cc-dependency-edge-legend")}var dw=(()=>{class t{constructor(){this.isInspectorShown=y(Me).isShown}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["cc-dependency-view"]],features:[Le([Ui,{provide:Yo,useExisting:Ui},Ki,{provide:Zo,useExisting:Ki},Gn,{provide:Jo,useExisting:Gn},Bn,{provide:Xo,useExisting:Bn},Wi,{provide:zo,useExisting:Wi},Rn,{provide:Ko,useExisting:Rn},{provide:qo,useExisting:Vo},ir(cr),nr(ar),{provide:rr,useValue:"dependencies"},Mn,{provide:or,useExisting:Mn},{provide:Uo,useValue:{showRules:!0,showSearch:!0,showCounts:!0,canFlatten:!1,modes:[Wo]}},{provide:ur,useValue:{focusableNodes:"folders",showMapActions:!1,showExclude:!0}},er("dependencies"),Bo()]),bt([sr])],decls:9,vars:1,consts:[["view","dependencies"],["collapsedContent","",1,"flex-1","min-w-0"],[3,"isMovedAsideByInspector"]],template:function(i,o){i&1&&(w(0,"cc-loading-file-progress-spinner",0)(1,"cc-dependency-map"),d(2,"cc-sidebar-explorer"),w(3,"cc-explorer-search-bar",1),l(),w(4,"cc-node-context-menu")(5,"cc-dependency-bar"),d(6,"cc-legend-drawer",2),vt(7,bu,1,0,"ng-template"),l(),w(8,"cc-bottom-bar")),i&2&&(c(6),_("isMovedAsideByInspector",o.isInspectorShown()))},dependencies:[Qo,jo,$i,Mi,$o,Li,mr,Ho,ko],encapsulation:2})}}return t})();export{dw as DependencyViewComponent};