codecharta-visualization 2.5.2 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundler/browser/{chunk-OUNZ5VH4.js → chunk-7GO57JCA.js} +11 -11
- package/dist/bundler/browser/{chunk-VY6TRIWG.js → chunk-KMX4CLN6.js} +188 -188
- package/dist/bundler/browser/index.html +1 -1
- package/dist/bundler/browser/{main-FTLK4SLY.js → main-4I3B3Q54.js} +19 -5
- package/dist/bundler/browser/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$a as yu,$b as Ku,$c as Gt,$d as Ap,$e as Jp,$f as ft,$h as C0,A as W,Aa as $r,Ab as Ne,Ac as hp,Ad as qp,Ae as ks,Af as nr,Ag as js,Ah as m0,Ai as
|
|
1
|
+
import{$a as yu,$b as Ku,$c as Gt,$d as Ap,$e as Jp,$f as ft,$h as C0,A as W,Aa as $r,Ab as Ne,Ac as hp,Ad as qp,Ae as ks,Af as nr,Ag as js,Ah as m0,Ai as N0,B as E,Ba as ze,Bb as dt,Bc as mp,Bd as dd,Be as md,Bf as df,Bg as Wi,Bh as Us,Bi as P0,C as T,Ca as We,Cb as st,Cc as up,Cd as fo,Ce as ud,Cf as hf,Cg as vd,Ch as Hr,Ci as Sd,D as ae,Da as Dt,Db as Bu,Dc as as,Dd as Bt,De as pd,Df as rr,Dg as Ii,Dh as u0,Di as B0,E as se,Ea as g,Eb as Vu,Ec as pp,Ed as ms,Ee as Op,Ef as ar,Eg as Bf,Eh as Gs,Ei as V0,F as Ho,Fa as Te,Fb as Wu,Fc as Vn,Fd as us,Fe as qs,Ff as Ps,Fg as ur,Fh as Ur,Fi as W0,G as zr,Ga as ge,Gb as Ou,Gc as fp,Gd as go,Ge as zp,Gf as mf,Gg as Vf,Gh as p0,Gi as O0,H as Tn,Ha as Yi,Hb as jr,Hc as gp,Hd as Un,He as $p,Hf as uf,Hg as Ai,Hh as f0,Hi as z0,I as cu,Ia as bu,Ib as oi,Ic as bp,Id as Tp,Ie as jp,If as Bs,Ig as Hs,Ih as Gr,Ii as $0,J as Se,Ja as Ua,Jb as Ji,Jc as vp,Jd as ps,Je as Hp,Jf as Vs,Jg as pr,Jh as Xs,Ji as j0,K as du,Ka as Ga,Kb as Ja,Kc as xp,Kd as bo,Ke as qi,Kf as Ws,Kg as Wf,Kh as g0,Ki as yd,L as za,La as Xa,Lb as eo,Lc as ai,Ld as vo,Le as Ts,Lf as Vt,Lg as Of,Lh as b0,Li as H0,M as hu,Ma as vu,Mb as es,Mc as to,Md as fs,Me as Up,Mf as pf,Mg as fr,Mh as br,N as Nt,Na as Dn,Nb as cd,Nc as io,Nd as gs,Ne as Gp,Nf as ff,Ng as gr,Nh as v0,O as mu,Oa as bi,Ob as Ni,Oc as Pt,Od as Gn,Oe as Rs,Of as gf,Og as Qt,Oh as x0,P as Rn,Pa as xu,Pb as Go,Pc as ss,Pd as bs,Pe as fd,Pf as bf,Pg as zf,Ph as w0,Q as uu,Qb as ni,Qc as wp,Qd as Xo,Qe as Is,Qf as vf,Qg as $f,R as Uo,Ra as pt,Rb as xi,Rc as Sp,Rd as Xn,Re as Xp,Rf as xf,S as h,Sa as vi,Sb as ts,Sc as yp,Sd as xo,Sf as sr,Sh as wd,T as In,Ta as Fn,Tb as zu,Tc as xe,Td as wo,Te as Yn,Tf as wf,Th as S0,U as An,Ua as Ka,Ub as $u,Uc as Ci,Ud as vs,Ue as As,Uf as Sf,Uh as y0,V as ne,Vb as Uw,Vc as Mi,Vd as Rp,Ve as Kp,Vf as yf,W as k,Wa as wu,Wb as ju,Wc as _i,Wd as xs,We as Qp,Wf as Cf,X as $a,Xa as Y,Xb as Hu,Xc as _t,Xe as Zp,Xf as Mf,Y as ja,Ya as Su,Yb as Uu,Yc as Ei,Yd as Ip,Ye as Jn,Yf as _f,Z as pu,Za as _e,Zb as Gu,Zc as Ut,Zd as ws,Ze as Yp,Zf as Ef,_ as Zi,_a as Z,_b as Xu,_c as oo,_d as Ss,_e as Ds,_f as kt,a as ke,aa as ot,ab as Je,ac as Qu,ad as no,ae as Pi,af as Co,ag as qt,ai as M0,b as et,ba as K,bb as Ln,bc as Zu,bd as ro,be as hd,bf as Mo,bg as kf,bh as jf,bi as _0,c as qn,ca as Q,cb as ld,cc as Yu,cd as ki,ce as Dp,cf as er,cg as lr,ch as Hf,d as Ye,da as ii,db as Cu,dc as Ju,dd as ls,de as Fp,df as Et,dg as qf,dh as Uf,ea as Pe,eb as Mu,ec as ep,ed as Wn,ee as Ue,ef as Bi,eg as Vi,eh as Gf,f as sd,fa as Be,fb as _u,fc as tp,fd as On,fe as Ke,ff as ef,fg as _o,fh as Xf,g as tu,ga as F,gb as Eu,gc as ip,gd as Cp,ge as Ko,gf as tf,gh as Kf,h as iu,ha as x,hc as is,hd as zn,he as Kn,hf as of,hg as Tf,hh as Qf,hi as E0,i as qe,ia as v,ib as Qa,ic as Pn,id as $n,ie as Lp,if as Fs,ig as Rf,ih as Zf,ii as k0,j as St,ja as V,jb as ku,jc as wi,jd as ao,je as So,jf as nf,jg as If,jh as Yf,k as ou,ka as y,kb as qu,kc as op,kd as so,ke as Qo,kf as Ls,kg as Af,kh as Jf,l as Ki,la as M,lb as Tu,lc as np,ld as lo,le as Xt,lf as tr,lg as Df,lh as e0,li as q0,m as De,ma as pe,mb as Ru,mc as rp,md as cs,me as lt,mf as Ns,mh as t0,mi as T0,n as nu,nb as Iu,nc as Bn,nd as jn,ne as yo,nf as rf,ng as Ff,nh as i0,ni as R0,o as jt,oa as we,ob as Au,oc as ap,od as co,oe as Np,of as ir,og as Lf,oh as o0,p as ut,pa as ce,pb as Du,pc as os,pd as ho,pe as ys,pg as Nf,ph as n0,q as ru,qa as z,qb as Nn,qc as sp,qd as mo,qe as Qn,qf as af,qg as Os,qh as r0,r as au,ra as ie,rb as Za,rc as ns,rd as uo,re as Cs,rf as sf,rg as zs,rh as a0,ri as I0,s as Qi,sa as B,sb as Ya,sc as Re,sd as po,se as Ms,sf as Kt,sg as cr,sh as s0,t as Oa,ta as fu,tb as Fu,tc as lp,td as Hn,te as Pp,tf as gd,tg as dr,th as l0,ti as A0,u as pi,ua as gu,ub as Lu,uc as ri,ud as Mp,ue as Bp,uf as lf,ug as $s,uh as ko,ui as D0,v as Ht,va as Ha,vb as Nu,vc as cp,vd as ds,ve as Vp,vf as cf,vg as hr,vh as c0,vi as Ks,w as su,wa as fi,wb as D,wc as dp,wd as _p,we as _s,wg as mr,wh as d0,wi as Qs,x as Le,xa as gi,xb as he,xc as rs,xd as hs,xe as Es,xf as or,xg as Eo,xh as xd,xi as F0,y as lu,ya as rt,yb as Ae,yc as Si,yd as Ep,ye as Wp,yf as Ti,yg as bd,yh as qo,z as ti,za as at,zb as Pu,zc as yi,zd as kp,ze as Zn,zf as Ri,zg as Pf,zh as h0,zi as L0}from"./chunk-KMX4CLN6.js";var i1=Ye((Qd,t1)=>{"use strict";var{hasOwnProperty:ta}=Object.prototype,rn=Kd();rn.configure=Kd;rn.stringify=rn;rn.default=rn;Qd.stringify=rn;Qd.configure=Kd;t1.exports=rn;var m5=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Io(e){return e.length<5e3&&!m5.test(e)?`"${e}"`:JSON.stringify(e)}function Gd(e,o){if(e.length>200||o)return e.sort(o);for(let t=1;t<e.length;t++){let i=e[t],n=t;for(;n!==0&&e[n-1]>i;)e[n]=e[n-1],n--;e[n]=i}return e}var u5=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Xd(e){return u5.call(e)!==void 0&&e.length!==0}function Jg(e,o,t){e.length<t&&(t=e.length);let i=o===","?"":" ",n=`"0":${i}${e[0]}`;for(let r=1;r<t;r++)n+=`${o}"${r}":${i}${e[r]}`;return n}function p5(e){if(ta.call(e,"circularValue")){let o=e.circularValue;if(typeof o=="string")return`"${o}"`;if(o==null)return o;if(o===Error||o===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function f5(e){let o;if(ta.call(e,"deterministic")&&(o=e.deterministic,typeof o!="boolean"&&typeof o!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return o===void 0?!0:o}function g5(e,o){let t;if(ta.call(e,o)&&(t=e[o],typeof t!="boolean"))throw new TypeError(`The "${o}" argument must be of type boolean`);return t===void 0?!0:t}function e1(e,o){let t;if(ta.call(e,o)){if(t=e[o],typeof t!="number")throw new TypeError(`The "${o}" argument must be of type number`);if(!Number.isInteger(t))throw new TypeError(`The "${o}" argument must be an integer`);if(t<1)throw new RangeError(`The "${o}" argument must be >= 1`)}return t===void 0?1/0:t}function nn(e){return e===1?"1 item":`${e} items`}function b5(e){let o=new Set;for(let t of e)(typeof t=="string"||typeof t=="number")&&o.add(String(t));return o}function v5(e){if(ta.call(e,"strict")){let o=e.strict;if(typeof o!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(o)return t=>{let i=`Object can not safely be stringified. Received type ${typeof t}`;throw typeof t!="function"&&(i+=` (${t.toString()})`),new Error(i)}}}function Kd(e){e=ke({},e);let o=v5(e);o&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let t=p5(e),i=g5(e,"bigint"),n=f5(e),r=typeof n=="function"?n:void 0,a=e1(e,"maximumDepth"),s=e1(e,"maximumBreadth");function l(p,f,S,R,L,j){let q=f[p];switch(typeof q=="object"&&q!==null&&typeof q.toJSON=="function"&&(q=q.toJSON(p)),q=R.call(f,p,q),typeof q){case"string":return Io(q);case"object":{if(q===null)return"null";if(S.indexOf(q)!==-1)return t;let P="",O=",",H=j;if(Array.isArray(q)){if(q.length===0)return"[]";if(a<S.length+1)return'"[Array]"';S.push(q),L!==""&&(j+=L,P+=`
|
|
2
2
|
${j}`,O=`,
|
|
3
3
|
${j}`);let $=Math.min(q.length,s),Ee=0;for(;Ee<$-1;Ee++){let Fe=l(String(Ee),q,S,R,L,j);P+=Fe!==void 0?Fe:"null",P+=O}let be=l(String(Ee),q,S,R,L,j);if(P+=be!==void 0?be:"null",q.length-1>s){let Fe=q.length-s-1;P+=`${O}"... ${nn(Fe)} not stringified"`}return L!==""&&(P+=`
|
|
4
4
|
${H}`),S.pop(),`[${P}]`}let G=Object.keys(q),J=G.length;if(J===0)return"{}";if(a<S.length+1)return'"[Object]"';let X="",me="";L!==""&&(j+=L,O=`,
|
|
@@ -90,8 +90,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/)
|
|
|
90
90
|
|
|
91
91
|
## [unreleased] (Added \u{1F680} | Changed | Removed | Fixed \u{1F41E} | Chore \u{1F468}\u200D\u{1F4BB} \u{1F469}\u200D\u{1F4BB})
|
|
92
92
|
|
|
93
|
+
## [2.5.3] - 2026-09-22
|
|
94
|
+
|
|
95
|
+
### Changed
|
|
96
|
+
|
|
97
|
+
- **The explorer floats over the view**: resizing, collapsing or expanding the explorer no longer shifts the settings bar or redraws the word cloud.
|
|
98
|
+
|
|
99
|
+
### Fixed \u{1F41E}
|
|
100
|
+
|
|
101
|
+
- **Release notes after an update**: the "What's new" dialog lists every change since your last visit, removals included, stays closed when there are none, and links to the full release notes on GitHub.
|
|
102
|
+
|
|
93
103
|
## [2.5.2] - 2026-09-22
|
|
94
104
|
|
|
105
|
+
### Chore \u{1F468}\u200D\u{1F4BB} \u{1F469}\u200D
|
|
106
|
+
|
|
107
|
+
- **Bump dependencies**: Stay safe :)
|
|
108
|
+
|
|
95
109
|
## [2.5.1] - 2026-09-21
|
|
96
110
|
|
|
97
111
|
### Changed
|
|
@@ -3493,9 +3507,9 @@ Fixed release issues
|
|
|
3493
3507
|
|
|
3494
3508
|
- SonarImporter for importing projects from SonarQube.
|
|
3495
3509
|
- ValidationTool for validating an existing json file.
|
|
3496
|
-
`;var P4=["Added
|
|
3497
|
-
`),a=this.findVersionLine(r,i),s=this.findVersionLine(r,t);if(a===-1||s===-1)return[];let l=r.slice(a,s+1);return this.extractCategories(l)}extractCategories(t){let i=[];for(let n of P4){let r=new RegExp(`<h3>${n}
|
|
3498
|
-
`)})}return i}findAllIndexes(t,i){return t.reduce((n,r,a)=>(i.test(r)&&n.push(a),n),[])}findVersionLine(t,i){let n=new RegExp(String.raw`\[${i}]`);return t.findIndex(r=>n.test(r))}findEndOfChanges(t,i){return i+t.slice(i+1).findIndex(n=>/<h3>/.test(n)||/<h2>/.test(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var B4=["dialog"],V4=(e,o)=>o.title;function W4(e,o){if(e&1&&(x(0,"div",15)(1,"div",24)(2,"span",25),g(3),v(),x(4,"h3",26),g(5),v(),x(6,"span",27),g(7),v()(),V(8,"div",28),v()),e&2){let t=o.$implicit,i=B();h(),F("ngClass",i.getCategoryHeaderClass(t.title)),h(),F("ngClass",i.getCategoryIconClass(t.title)),h(),ge(" ",i.getCategoryEmoji(t.title)," "),h(2),ge(" ",i.getCategoryLabel(t.title)," "),h(),F("ngClass",i.getCategoryCountClass(t.title)),h(),ge(" ",i.getChangeCount(t.changes)," "),h(),F("innerHTML",t.changes,mu)}}var Ld={"Added \u{1F680}":{emoji:"\u{1F680}",label:"Added",type:"added"},"Fixed \u{1F41E}":{emoji:"\u{1F41E}",label:"Fixed",type:"fixed"},Changed:{emoji:"\u2728",label:"Changed",type:"changed"},"Removed \u{1F5D1}":{emoji:"\u{1F5D1}",label:"Removed",type:"removed"},"Chore \u{1F468}\u200D\u{1F4BB} \u{1F469}\u200D\u{1F4BB}":{emoji:"\u{1F527}",label:"Maintenance",type:"chore"}},Nd={added:{header:"bg-success/5",icon:"bg-success/10",count:"bg-success/10 text-success"},fixed:{header:"bg-info/5",icon:"bg-info/10",count:"bg-info/10 text-info"},changed:{header:"bg-warning/5",icon:"bg-warning/10",count:"bg-warning/10 text-warning"},removed:{header:"bg-error/5",icon:"bg-error/10",count:"bg-error/10 text-error"},chore:{header:"bg-neutral/5",icon:"bg-neutral/10",count:"bg-neutral/10 text-neutral"}},Pd=(()=>{class e{constructor(t,i){this.versionService=t,this.changelogParserService=i,this.dialogElement=Je.required("dialog"),this.previousVersion=this.versionService.previousVersion,this.currentVersion=this.versionService.currentVersion,this.shouldShowChangelog=this.versionService.shouldShowChangelog,this.changes=Y(()=>{let n=this.previousVersion();return n?this.changelogParserService.parseChangesBetweenVersions(n,this.currentVersion):[]}),du(()=>{this.shouldShowChangelog()&&this.open()})}open(){this.dialogElement().nativeElement.showModal()}close(){this.versionService.acknowledgeChangelog(),this.dialogElement().nativeElement.close()}getCategoryEmoji(t){return Ld[t]?.emoji??"\u{1F4DD}"}getCategoryLabel(t){return Ld[t]?.label??t}getCategoryType(t){return Ld[t]?.type??"default"}getCategoryHeaderClass(t){let i=this.getCategoryType(t);return Nd[i]?.header??"bg-base-200"}getCategoryIconClass(t){let i=this.getCategoryType(t);return Nd[i]?.icon??"bg-base-300"}getCategoryCountClass(t){let i=this.getCategoryType(t);return Nd[i]?.count??"bg-base-300 text-base-content"}getChangeCount(t){return(t.match(/<li>/gi)||[]).length}static{this.\u0275fac=function(i){return new(i||e)(ne(Zs),ne(nl))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-changelog-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,B4,5),i&2&&at()},decls:33,vars:2,consts:[["dialog",""],[1,"modal","backdrop-blur-sm"],[1,"modal-box","max-w-2xl","p-0","overflow-hidden","bg-gradient-to-b","from-base-100","to-base-200","shadow-2xl"],[1,"relative","px-8","pt-8","pb-6","bg-gradient-to-br","from-primary/5","via-transparent","to-accent/5"],[1,"absolute","top-0","right-0","w-32","h-32","bg-gradient-to-bl","from-primary/10","to-transparent","rounded-bl-full"],[1,"relative"],[1,"inline-block","px-3","py-1","mb-3","text-xs","font-semibold","tracking-wider","uppercase","rounded-full","bg-primary/10","text-primary"],[1,"text-3xl","font-bold","tracking-tight","text-base-content"],[1,"flex","items-center","gap-3","mt-3"],[1,"inline-flex","items-center","px-3","py-1.5","text-sm","font-mono","font-medium","rounded-lg","bg-base-200","text-base-content/70","border","border-base-300"],["fill","none","stroke","currentColor","viewBox","0 0 24 24",1,"w-5","h-5","text-base-content/40"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M13 7l5 5m0 0l-5 5m5-5H6"],[1,"inline-flex","items-center","px-3","py-1.5","text-sm","font-mono","font-semibold","rounded-lg","bg-primary/10","text-primary","border","border-primary/20"],[1,"px-8","py-6","max-h-[60vh]","overflow-y-auto"],[1,"flex","flex-col","gap-4"],[1,"rounded-xl","overflow-hidden","bg-base-100","border","border-base-300/50","shadow-sm"],[1,"px-8","py-5","border-t","border-base-300/50","bg-base-200/50"],[1,"flex","items-center","justify-between"],["href","https://codecharta.com/news/","target","_blank","rel","noopener noreferrer",1,"inline-flex","items-center","gap-2","text-sm","font-medium","transition-colors","text-primary","hover:text-primary/80"],["fill","none","stroke","currentColor","viewBox","0 0 24 24",1,"w-4","h-4"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"],[1,"btn","btn-primary","btn-sm","px-6",3,"click"],["method","dialog",1,"modal-backdrop","bg-base-content/60"],[3,"click"],[1,"flex","items-center","gap-3","px-4","py-3","border-b","border-base-200",3,"ngClass"],[1,"flex","items-center","justify-center","w-8","h-8","rounded-lg","text-base",3,"ngClass"],[1,"text-base","font-semibold","text-base-content"],[1,"ml-auto","px-2","py-0.5","text-xs","font-semibold","rounded-full",3,"ngClass"],[1,"px-6","py-4","text-sm","text-base-content/80","leading-snug","[&_a]:text-primary","[&_a]:hover:underline",3,"innerHTML"]],template:function(i,n){i&1&&(x(0,"dialog",1,0)(2,"div",2)(3,"div",3),V(4,"div",4),x(5,"div",5)(6,"span",6),g(7," Release Notes "),v(),x(8,"h2",7),g(9," What's new in CodeCharta? "),v(),x(10,"div",8)(11,"span",9),g(12),v(),Ho(),x(13,"svg",10),V(14,"path",11),v(),zr(),x(15,"span",12),g(16),v()()()(),x(17,"div",13)(18,"div",14),Pe(19,W4,9,7,"div",15,V4),v()(),x(21,"div",16)(22,"div",17)(23,"a",18)(24,"span"),g(25,"View full changelog"),v(),Ho(),x(26,"svg",19),V(27,"path",20),v()(),zr(),x(28,"button",21),z("click",function(){return n.close()}),g(29," Got it "),v()()()(),x(30,"form",22)(31,"button",23),z("click",function(){return n.close()}),g(32,"close"),v()()()),i&2&&(h(12),ge(" ",n.previousVersion()," "),h(4),ge(" ",n.currentVersion," "),h(3),Be(n.changes()))},dependencies:[Eu],encapsulation:2})}}return e})();var fg=(()=>{class e{constructor(t,i){this.versionService=t,this.changelogParserService=i}get currentVersion(){return this.versionService.currentVersion}get previousVersion(){return this.versionService.previousVersion}get shouldShowChangelog(){return this.versionService.shouldShowChangelog}synchronizeVersion(){this.versionService.synchronizeVersion()}acknowledgeChangelog(){this.versionService.acknowledgeChangelog()}parseChangesBetweenVersions(t,i){return this.changelogParserService.parseChangesBetweenVersions(t,i)}static{this.\u0275fac=function(i){return new(i||e)(E(Zs),E(nl))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var gg=[kp,xp,bp,wp,fp,yi];var bg=(()=>{class e{constructor(t,i,n,r,a){this.store=t,this.threeSceneService=i,this.threeMapControlsService=n,this.actions$=r,this.globalSettingsFacade=a,this.autoFitRequests$=Ki(this.actions$.pipe(st(ri),qe(s=>({force:s.forceAutoFit}))),this.store.select(Bn).pipe(pi(1),qe(()=>({force:!1}))),St(gg.map(s=>this.store.select(s))).pipe(pi(1),qe(()=>({force:!1})))),this.autoFitTo$=Ne(()=>this.autoFitRequests$.pipe(ti(this.globalSettingsFacade.resetCameraIfNewFileIsLoaded$()),De(([s,l])=>l||s.force),Ht(()=>this.threeSceneService.mapMeshChanged$.pipe(ut(1))),Le(()=>{this.threeMapControlsService.autoFitTo()})),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||e)(E(he),E(ft),E(qt),E(dt),E(b0))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var vg=[us,go,Un,ps,bo,vo,Ip,ws,Ss,ms,_i,ai,to,io,po,uo,$n,Wn,On,ls,co,oo,Ci,ho,mo,Si,so,cs,yf,Ei,Gt,Ut,jn,Pi,fs,gs,Gn,bs,ki,Mi,_t,Hn,Xn,xo,wo,no,ro,lo,ao,Qt];var en=Object.freeze({geometry:!0,colors:!0,labels:!0,arrows:!0}),O4=new Map([[Si.type,{labels:!0}],[so.type,{labels:!0}],[ao.type,{labels:!0}],[lo.type,{labels:!0}],[po.type,{labels:!0}],[uo.type,{labels:!0}],[no.type,{labels:!0}],[ro.type,{labels:!0}],[Gt.type,{arrows:!0}],[oo.type,{arrows:!0}],[Ci.type,{arrows:!0}],[ho.type,{arrows:!0}],[mo.type,{arrows:!0}],[_t.type,{colors:!0}],[Ei.type,{colors:!0}],[Ut.type,{colors:!0}],[ai.type,{colors:!0}],[to.type,{colors:!0}],[io.type,{colors:!0}],[_i.type,{colors:!0}],[$n.type,{colors:!0}],[Xn.type,{colors:!0}],[xo.type,{colors:!0}],[wo.type,{colors:!0}],[co.type,{labels:!0,arrows:!0}]]);function xg(e){let o=O4.get(e.type);return o?wg(o):ke({},en)}function wg(e){let o=e.geometry===!0,t=o||e.colors===!0;return{geometry:o,colors:t,labels:t||e.labels===!0,arrows:o||e.arrows===!0}}function Sg(e){return wg({geometry:e.some(({geometry:o})=>o),colors:e.some(({colors:o})=>o),labels:e.some(({labels:o})=>o),arrows:e.some(({arrows:o})=>o)})}function Cg(e,o,t,i){let n=new Map;for(let r of e){let a=o(r),s=n.get(a);s?s.push(r):n.set(a,[r])}return[...n.values()].flatMap(r=>Bd(r,t,i))}function Bd(e,o,t){let i=Math.floor(t);if(Number.isNaN(i)||i<=0)return[];let n=r=>z4(o(r));return e.length<=i?[...e].sort((r,a)=>n(a)-n(r)):$4(e,n,i)}function z4(e){return Number.isNaN(e)?Number.NEGATIVE_INFINITY:e}function $4(e,o,t){let i=[],n=Number.POSITIVE_INFINITY;for(let r of e){let a=o(r);if(i.length<t)yg(i,r,a,o);else if(a>n)i.pop(),yg(i,r,a,o);else continue;i.length===t&&(n=o(i[t-1]))}return i}function yg(e,o,t,i){let n=e.length;for(;n>0&&i(e[n-1])<t;)n--;e.splice(n,0,o)}var Mg=Ae(nf,Vn,rs,(e,o,t)=>new Set(j4(e,o,t))),j4=(e,o,t)=>{let i=[],n=Math.floor(t);if(Number.isNaN(n)||n<=0)return i;let r=e.get(o);if(r===void 0)return i;for(let a of r.keys())if(i.push(a),i.length>=n)break;return i};var _g=(e,o,t,i,n)=>{for(let r of o)if(r.visible=ni.none,r.attributes[t]!==void 0){let a=e.has(r.fromNodeName),s=e.has(r.toNodeName),l=i&&s,d=n&&a;d&&l?r.visible=ni.both:d?r.visible=ni.from:l&&(r.visible=ni.to)}};var Eg=Ae(Mg,Rs,Vn,Sp,yp,(e,o,t,i,n)=>{let r=Ou(o);return _g(e,r,t,i,n),r});var wr=(()=>{class e{constructor(t,i,n,r){this.store=t,this.ccStateSnapshot=i,this.mapStateReadWindow=n,this.sharedViewReadWindow=r}getState(){return this.ccStateSnapshot.get()}getMapState(){return this.mapStateReadWindow.getMapState()}getEdges(){return Rs(this.ccStateSnapshot.get())}getEdgeVisibility(){return Eg(this.ccStateSnapshot.get())}getHoveredNodeId(){return this.sharedViewReadWindow.getHoveredNodeId()}getIdToNode(){return ef(this.ccStateSnapshot.get())}setHoveredNodeId(t){this.store.dispatch(Xo({value:t}))}setRightClickedNodeData(t){this.store.dispatch(Ap({value:t}))}setColorLabels(t){this.store.dispatch(_i({value:t}))}static{this.\u0275fac=function(i){return new(i||e)(E(he),E(Vt),E(xe),E(Bt))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var al=class e{constructor(o,t,i){this.badge=null,this.labelSize=i;let n=document.createElement("div");if(this.content=document.createElement("div"),this.content.style.cssText=e.buildContentStyles(i),o){let r=document.createElement("span");r.style.cssText="display: block; font-weight: 500;",r.textContent=o,this.content.appendChild(r)}if(t){let r=document.createElement("span");r.style.cssText=`display: block; font-size: ${10*i}px; color: #666; margin-top: 1px;`,r.textContent=t,this.content.appendChild(r)}n.appendChild(this.content),this.cssObject=new Ef(n),this.cssObject.center.set(.5,1)}getContentRect(){return this.content.getBoundingClientRect()}getContentElement(){return this.content}setOpacity(o){this.content.style.opacity=o}setTransform(o){this.content.style.transform=`translateY(${-20+o}px)`}setTransition(o){this.content.style.transition=o}setBadge(o){this.clearBadge(),this.badge=document.createElement("div"),this.badge.textContent=`+${o} more`,this.badge.style.cssText=`
|
|
3510
|
+
`;var P4=["Added","Fixed","Changed","Removed","Chore"],nl=(()=>{class e{parseChangesBetweenVersions(t,i){Ge.use(mg());let r=Ge.parse(ug).split(`
|
|
3511
|
+
`),a=this.findVersionLine(r,i),s=this.findVersionLine(r,t);if(a===-1||s===-1)return[];let l=r.slice(a,s+1);return this.extractCategories(l)}extractCategories(t){let i=[];for(let n of P4){let r=new RegExp(String.raw`<h3>${n}\b[^<]*</h3>`),a=this.findAllIndexes(t,r),s=[];for(let l of a){let d=l+2,c=this.findEndOfChanges(t,l);for(let m of t.slice(d,c))s.push(m)}s.length>0&&i.push({title:n,changes:s.join(`
|
|
3512
|
+
`)})}return i}findAllIndexes(t,i){return t.reduce((n,r,a)=>(i.test(r)&&n.push(a),n),[])}findVersionLine(t,i){let n=new RegExp(String.raw`\[${i}]`);return t.findIndex(r=>n.test(r))}findEndOfChanges(t,i){return i+t.slice(i+1).findIndex(n=>/<h3>/.test(n)||/<h2>/.test(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var B4=["dialog"],V4=(e,o)=>o.title;function W4(e,o){if(e&1&&(x(0,"div",15)(1,"div",24)(2,"span",25),g(3),v(),x(4,"h3",26),g(5),v(),x(6,"span",27),g(7),v()(),V(8,"div",28),v()),e&2){let t=o.$implicit,i=B();h(),F("ngClass",i.getCategoryHeaderClass(t.title)),h(),F("ngClass",i.getCategoryIconClass(t.title)),h(),ge(" ",i.getCategoryEmoji(t.title)," "),h(2),ge(" ",i.getCategoryLabel(t.title)," "),h(),F("ngClass",i.getCategoryCountClass(t.title)),h(),ge(" ",i.getChangeCount(t.changes)," "),h(),F("innerHTML",t.changes,mu)}}var Ld={Added:{emoji:"\u{1F680}",label:"Added",type:"added"},Fixed:{emoji:"\u{1F41E}",label:"Fixed",type:"fixed"},Changed:{emoji:"\u2728",label:"Changed",type:"changed"},Removed:{emoji:"\u{1F5D1}",label:"Removed",type:"removed"},Chore:{emoji:"\u{1F527}",label:"Maintenance",type:"chore"}},Nd={added:{header:"bg-success/5",icon:"bg-success/10",count:"bg-success/10 text-success"},fixed:{header:"bg-info/5",icon:"bg-info/10",count:"bg-info/10 text-info"},changed:{header:"bg-warning/5",icon:"bg-warning/10",count:"bg-warning/10 text-warning"},removed:{header:"bg-error/5",icon:"bg-error/10",count:"bg-error/10 text-error"},chore:{header:"bg-neutral/5",icon:"bg-neutral/10",count:"bg-neutral/10 text-neutral"}},Pd=(()=>{class e{constructor(t,i){this.versionService=t,this.changelogParserService=i,this.dialogElement=Je.required("dialog"),this.previousVersion=this.versionService.previousVersion,this.currentVersion=this.versionService.currentVersion,this.shouldShowChangelog=this.versionService.shouldShowChangelog,this.changes=Y(()=>{let n=this.previousVersion();return n?this.changelogParserService.parseChangesBetweenVersions(n,this.currentVersion):[]}),du(()=>{if(this.shouldShowChangelog()){if(this.changes().length===0){this.versionService.acknowledgeChangelog();return}this.open()}})}open(){this.dialogElement().nativeElement.showModal()}close(){this.versionService.acknowledgeChangelog(),this.dialogElement().nativeElement.close()}getCategoryEmoji(t){return Ld[t]?.emoji??"\u{1F4DD}"}getCategoryLabel(t){return Ld[t]?.label??t}getCategoryType(t){return Ld[t]?.type??"default"}getCategoryHeaderClass(t){let i=this.getCategoryType(t);return Nd[i]?.header??"bg-base-200"}getCategoryIconClass(t){let i=this.getCategoryType(t);return Nd[i]?.icon??"bg-base-300"}getCategoryCountClass(t){let i=this.getCategoryType(t);return Nd[i]?.count??"bg-base-300 text-base-content"}getChangeCount(t){return(t.match(/<li>/gi)||[]).length}static{this.\u0275fac=function(i){return new(i||e)(ne(Zs),ne(nl))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-changelog-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,B4,5),i&2&&at()},decls:33,vars:2,consts:[["dialog",""],[1,"modal","backdrop-blur-sm"],[1,"modal-box","max-w-2xl","p-0","overflow-hidden","bg-gradient-to-b","from-base-100","to-base-200","shadow-2xl"],[1,"relative","px-8","pt-8","pb-6","bg-gradient-to-br","from-primary/5","via-transparent","to-accent/5"],[1,"absolute","top-0","right-0","w-32","h-32","bg-gradient-to-bl","from-primary/10","to-transparent","rounded-bl-full"],[1,"relative"],[1,"inline-block","px-3","py-1","mb-3","text-xs","font-semibold","tracking-wider","uppercase","rounded-full","bg-primary/10","text-primary"],[1,"text-3xl","font-bold","tracking-tight","text-base-content"],[1,"flex","items-center","gap-3","mt-3"],[1,"inline-flex","items-center","px-3","py-1.5","text-sm","font-mono","font-medium","rounded-lg","bg-base-200","text-base-content/70","border","border-base-300"],["fill","none","stroke","currentColor","viewBox","0 0 24 24",1,"w-5","h-5","text-base-content/40"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M13 7l5 5m0 0l-5 5m5-5H6"],[1,"inline-flex","items-center","px-3","py-1.5","text-sm","font-mono","font-semibold","rounded-lg","bg-primary/10","text-primary","border","border-primary/20"],[1,"px-8","py-6","max-h-[60vh]","overflow-y-auto"],[1,"flex","flex-col","gap-4"],[1,"rounded-xl","overflow-hidden","bg-base-100","border","border-base-300/50","shadow-sm"],[1,"px-8","py-5","border-t","border-base-300/50","bg-base-200/50"],[1,"flex","items-center","justify-between"],["href","https://github.com/MaibornWolff/codecharta/releases","target","_blank","rel","noopener noreferrer",1,"inline-flex","items-center","gap-2","text-sm","font-medium","transition-colors","text-primary","hover:text-primary/80"],["fill","none","stroke","currentColor","viewBox","0 0 24 24",1,"w-4","h-4"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"],[1,"btn","btn-primary","btn-sm","px-6",3,"click"],["method","dialog",1,"modal-backdrop","bg-base-content/60"],[3,"click"],[1,"flex","items-center","gap-3","px-4","py-3","border-b","border-base-200",3,"ngClass"],[1,"flex","items-center","justify-center","w-8","h-8","rounded-lg","text-base",3,"ngClass"],[1,"text-base","font-semibold","text-base-content"],[1,"ml-auto","px-2","py-0.5","text-xs","font-semibold","rounded-full",3,"ngClass"],[1,"px-6","py-4","text-sm","text-base-content/80","leading-snug","[&_a]:text-primary","[&_a]:hover:underline",3,"innerHTML"]],template:function(i,n){i&1&&(x(0,"dialog",1,0)(2,"div",2)(3,"div",3),V(4,"div",4),x(5,"div",5)(6,"span",6),g(7," Release Notes "),v(),x(8,"h2",7),g(9," What's new in CodeCharta? "),v(),x(10,"div",8)(11,"span",9),g(12),v(),Ho(),x(13,"svg",10),V(14,"path",11),v(),zr(),x(15,"span",12),g(16),v()()()(),x(17,"div",13)(18,"div",14),Pe(19,W4,9,7,"div",15,V4),v()(),x(21,"div",16)(22,"div",17)(23,"a",18)(24,"span"),g(25,"View full changelog"),v(),Ho(),x(26,"svg",19),V(27,"path",20),v()(),zr(),x(28,"button",21),z("click",function(){return n.close()}),g(29," Got it "),v()()()(),x(30,"form",22)(31,"button",23),z("click",function(){return n.close()}),g(32,"close"),v()()()),i&2&&(h(12),ge(" ",n.previousVersion()," "),h(4),ge(" ",n.currentVersion," "),h(3),Be(n.changes()))},dependencies:[Eu],encapsulation:2})}}return e})();var fg=(()=>{class e{constructor(t,i){this.versionService=t,this.changelogParserService=i}get currentVersion(){return this.versionService.currentVersion}get previousVersion(){return this.versionService.previousVersion}get shouldShowChangelog(){return this.versionService.shouldShowChangelog}synchronizeVersion(){this.versionService.synchronizeVersion()}acknowledgeChangelog(){this.versionService.acknowledgeChangelog()}parseChangesBetweenVersions(t,i){return this.changelogParserService.parseChangesBetweenVersions(t,i)}static{this.\u0275fac=function(i){return new(i||e)(E(Zs),E(nl))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var gg=[kp,xp,bp,wp,fp,yi];var bg=(()=>{class e{constructor(t,i,n,r,a){this.store=t,this.threeSceneService=i,this.threeMapControlsService=n,this.actions$=r,this.globalSettingsFacade=a,this.autoFitRequests$=Ki(this.actions$.pipe(st(ri),qe(s=>({force:s.forceAutoFit}))),this.store.select(Bn).pipe(pi(1),qe(()=>({force:!1}))),St(gg.map(s=>this.store.select(s))).pipe(pi(1),qe(()=>({force:!1})))),this.autoFitTo$=Ne(()=>this.autoFitRequests$.pipe(ti(this.globalSettingsFacade.resetCameraIfNewFileIsLoaded$()),De(([s,l])=>l||s.force),Ht(()=>this.threeSceneService.mapMeshChanged$.pipe(ut(1))),Le(()=>{this.threeMapControlsService.autoFitTo()})),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||e)(E(he),E(ft),E(qt),E(dt),E(b0))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var vg=[us,go,Un,ps,bo,vo,Ip,ws,Ss,ms,_i,ai,to,io,po,uo,$n,Wn,On,ls,co,oo,Ci,ho,mo,Si,so,cs,yf,Ei,Gt,Ut,jn,Pi,fs,gs,Gn,bs,ki,Mi,_t,Hn,Xn,xo,wo,no,ro,lo,ao,Qt];var en=Object.freeze({geometry:!0,colors:!0,labels:!0,arrows:!0}),O4=new Map([[Si.type,{labels:!0}],[so.type,{labels:!0}],[ao.type,{labels:!0}],[lo.type,{labels:!0}],[po.type,{labels:!0}],[uo.type,{labels:!0}],[no.type,{labels:!0}],[ro.type,{labels:!0}],[Gt.type,{arrows:!0}],[oo.type,{arrows:!0}],[Ci.type,{arrows:!0}],[ho.type,{arrows:!0}],[mo.type,{arrows:!0}],[_t.type,{colors:!0}],[Ei.type,{colors:!0}],[Ut.type,{colors:!0}],[ai.type,{colors:!0}],[to.type,{colors:!0}],[io.type,{colors:!0}],[_i.type,{colors:!0}],[$n.type,{colors:!0}],[Xn.type,{colors:!0}],[xo.type,{colors:!0}],[wo.type,{colors:!0}],[co.type,{labels:!0,arrows:!0}]]);function xg(e){let o=O4.get(e.type);return o?wg(o):ke({},en)}function wg(e){let o=e.geometry===!0,t=o||e.colors===!0;return{geometry:o,colors:t,labels:t||e.labels===!0,arrows:o||e.arrows===!0}}function Sg(e){return wg({geometry:e.some(({geometry:o})=>o),colors:e.some(({colors:o})=>o),labels:e.some(({labels:o})=>o),arrows:e.some(({arrows:o})=>o)})}function Cg(e,o,t,i){let n=new Map;for(let r of e){let a=o(r),s=n.get(a);s?s.push(r):n.set(a,[r])}return[...n.values()].flatMap(r=>Bd(r,t,i))}function Bd(e,o,t){let i=Math.floor(t);if(Number.isNaN(i)||i<=0)return[];let n=r=>z4(o(r));return e.length<=i?[...e].sort((r,a)=>n(a)-n(r)):$4(e,n,i)}function z4(e){return Number.isNaN(e)?Number.NEGATIVE_INFINITY:e}function $4(e,o,t){let i=[],n=Number.POSITIVE_INFINITY;for(let r of e){let a=o(r);if(i.length<t)yg(i,r,a,o);else if(a>n)i.pop(),yg(i,r,a,o);else continue;i.length===t&&(n=o(i[t-1]))}return i}function yg(e,o,t,i){let n=e.length;for(;n>0&&i(e[n-1])<t;)n--;e.splice(n,0,o)}var Mg=Ae(nf,Vn,rs,(e,o,t)=>new Set(j4(e,o,t))),j4=(e,o,t)=>{let i=[],n=Math.floor(t);if(Number.isNaN(n)||n<=0)return i;let r=e.get(o);if(r===void 0)return i;for(let a of r.keys())if(i.push(a),i.length>=n)break;return i};var _g=(e,o,t,i,n)=>{for(let r of o)if(r.visible=ni.none,r.attributes[t]!==void 0){let a=e.has(r.fromNodeName),s=e.has(r.toNodeName),l=i&&s,d=n&&a;d&&l?r.visible=ni.both:d?r.visible=ni.from:l&&(r.visible=ni.to)}};var Eg=Ae(Mg,Rs,Vn,Sp,yp,(e,o,t,i,n)=>{let r=Ou(o);return _g(e,r,t,i,n),r});var wr=(()=>{class e{constructor(t,i,n,r){this.store=t,this.ccStateSnapshot=i,this.mapStateReadWindow=n,this.sharedViewReadWindow=r}getState(){return this.ccStateSnapshot.get()}getMapState(){return this.mapStateReadWindow.getMapState()}getEdges(){return Rs(this.ccStateSnapshot.get())}getEdgeVisibility(){return Eg(this.ccStateSnapshot.get())}getHoveredNodeId(){return this.sharedViewReadWindow.getHoveredNodeId()}getIdToNode(){return ef(this.ccStateSnapshot.get())}setHoveredNodeId(t){this.store.dispatch(Xo({value:t}))}setRightClickedNodeData(t){this.store.dispatch(Ap({value:t}))}setColorLabels(t){this.store.dispatch(_i({value:t}))}static{this.\u0275fac=function(i){return new(i||e)(E(he),E(Vt),E(xe),E(Bt))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var al=class e{constructor(o,t,i){this.badge=null,this.labelSize=i;let n=document.createElement("div");if(this.content=document.createElement("div"),this.content.style.cssText=e.buildContentStyles(i),o){let r=document.createElement("span");r.style.cssText="display: block; font-weight: 500;",r.textContent=o,this.content.appendChild(r)}if(t){let r=document.createElement("span");r.style.cssText=`display: block; font-size: ${10*i}px; color: #666; margin-top: 1px;`,r.textContent=t,this.content.appendChild(r)}n.appendChild(this.content),this.cssObject=new Ef(n),this.cssObject.center.set(.5,1)}getContentRect(){return this.content.getBoundingClientRect()}getContentElement(){return this.content}setOpacity(o){this.content.style.opacity=o}setTransform(o){this.content.style.transform=`translateY(${-20+o}px)`}setTransition(o){this.content.style.transition=o}setBadge(o){this.clearBadge(),this.badge=document.createElement("div"),this.badge.textContent=`+${o} more`,this.badge.style.cssText=`
|
|
3499
3513
|
font-size: ${10*this.labelSize}px;
|
|
3500
3514
|
color: #888;
|
|
3501
3515
|
margin-top: 2px;
|
|
@@ -3530,7 +3544,7 @@ Fixed release issues
|
|
|
3530
3544
|
`),h(),ze("left",n.currentRightLabelLeftPosition,"px")("visibility",n.doLeftRightLabelOverlap?"hidden":"visible"),h(2),ge(" ",n.rightValueLabel,`
|
|
3531
3545
|
`),h(),ze("left",n.combinedCurrentLeftRightLabelLeftPosition,"px")("visibility",n.doLeftRightLabelOverlap?"visible":"hidden"),h(2),Yi(" ",n.leftValueLabel," - ",n.rightValueLabel,`
|
|
3532
3546
|
`),h(),ze("right",0,"px")("visibility",n.hideMaxLabel?"hidden":"visible"),h(2),ge(" ",n.maxValue,`
|
|
3533
|
-
`))},encapsulation:2})}}return e})();var Dr=(e,o,t)=>Math.min(Math.max(e,o),t),N3=({minValue:e,maxValue:o,currentLeftValue:t,currentRightValue:i,sliderWidth:n})=>{let r=o-e;if(r<=0)return{leftEnd:n,rightStart:n};let a=(t-e)/r,s=(i-e)/r,l=Dr(a*n,0,n),d=Dr(s*n,l,n);return{leftEnd:l,rightStart:d}},_8=({thumbX:e,minValue:o,maxValue:t,sliderWidth:i})=>{let n=(t-o)/i,r=o+e*n;return Math.round(r)},P3=e=>V3(e,{lowerBound:0,upperBound:e.otherThumbX}),B3=e=>V3(e,{lowerBound:e.otherThumbX,upperBound:e.sliderWidth}),V3=({deltaX:e,thumbScreenX:o,thumbRadius:t,sliderBoundingClientRectX:i,sliderWidth:n,minValue:r,maxValue:a},{lowerBound:s,upperBound:l})=>{let d=o+e-i+t,c=Dr(d,s,l);return{updatedThumbX:c,upcomingValue:_8({thumbX:c,minValue:r,maxValue:a,sliderWidth:n})}};var E8=["rangeSliderContainer"],k8=["leftThumb"],q8=["rightThumb"],W3=(()=>{class e{get segmentWidths(){let t=Dr(this.sliderRangePosition.leftEnd,0,this.actualSliderWidth),i=Dr(this.sliderRangePosition.rightStart,t,this.actualSliderWidth);return{left:t,middle:i-t,right:this.actualSliderWidth-i}}constructor(t){this.changeDetectorRef=t,this.sliderWidth=150,this.sliderRangePosition={leftEnd:0,rightStart:0},this.thumbRadius=7,this.actualSliderWidth=this.sliderWidth,this.currentlySliding=void 0,this.activeMouseMoveHandler=null,this.activeMouseUpHandler=null,this.handleLeftThumbMoved=i=>{if(this.abortSlidingWhenHidden())return;let n=P3({deltaX:i.movementX,thumbScreenX:this.leftThumb.nativeElement.getBoundingClientRect().x,thumbRadius:this.thumbRadius,otherThumbX:this.sliderRangePosition.rightStart,sliderBoundingClientRectX:this.sliderContainer.nativeElement.getBoundingClientRect().x,sliderWidth:this.actualSliderWidth,minValue:this.minValue,maxValue:this.maxValue});this.sliderRangePosition={leftEnd:n.updatedThumbX,rightStart:this.sliderRangePosition.rightStart},this.upcomingLeftValue=n.upcomingValue,this.changeDetectorRef.markForCheck(),this.handleValueChange({newLeftValue:n.upcomingValue})},this.handleRightThumbMoved=i=>{if(this.abortSlidingWhenHidden())return;let n=B3({deltaX:i.movementX,thumbScreenX:this.rightThumb.nativeElement.getBoundingClientRect().x,thumbRadius:this.thumbRadius,otherThumbX:this.sliderRangePosition.leftEnd,sliderBoundingClientRectX:this.sliderContainer.nativeElement.getBoundingClientRect().x,sliderWidth:this.actualSliderWidth,minValue:this.minValue,maxValue:this.maxValue});this.sliderRangePosition={leftEnd:this.sliderRangePosition.leftEnd,rightStart:n.updatedThumbX},this.upcomingRightValue=n.upcomingValue,this.changeDetectorRef.markForCheck(),this.handleValueChange({newRightValue:n.upcomingValue})}}ngOnChanges(t){t.sliderWidth&&(this.actualSliderWidth=this.sliderWidth),this.currentlySliding||(t.currentLeftValue&&(this.upcomingLeftValue=this.currentLeftValue),t.currentRightValue&&(this.upcomingRightValue=this.currentRightValue),this.updateSliderRangePosition())}ngAfterViewInit(){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(t=>{let i=t.at(-1).contentRect.width;i>0&&i!==this.actualSliderWidth&&(this.actualSliderWidth=i,this.currentlySliding||this.updateSliderRangePosition(),this.changeDetectorRef.markForCheck())}),this.resizeObserver.observe(this.sliderContainer.nativeElement))}ngOnDestroy(){this.stopSliding(),this.resizeObserver?.disconnect()}setCurrentlySliding(t){switch(this.stopSliding(),this.currentlySliding=t,this.currentlySliding){case"leftThumb":this.activeMouseMoveHandler=this.handleLeftThumbMoved,this.rightThumb.nativeElement.style.zIndex="0",this.leftThumb.nativeElement.style.zIndex="1";break;case"rightThumb":this.activeMouseMoveHandler=this.handleRightThumbMoved,this.leftThumb.nativeElement.style.zIndex="0",this.rightThumb.nativeElement.style.zIndex="1";break;default:return}this.activeMouseUpHandler=()=>this.stopSliding(),document.addEventListener("mousemove",this.activeMouseMoveHandler),document.addEventListener("mouseup",this.activeMouseUpHandler)}stopSliding(){this.currentlySliding=void 0,this.activeMouseMoveHandler&&(document.removeEventListener("mousemove",this.activeMouseMoveHandler),this.activeMouseMoveHandler=null),this.activeMouseUpHandler&&(document.removeEventListener("mouseup",this.activeMouseUpHandler),this.activeMouseUpHandler=null)}handleLeftThumbKeydown(t){let i=this.calculateValueFromKeyboard(t,this.upcomingLeftValue,this.minValue,this.upcomingRightValue);i===void 0||i===this.upcomingLeftValue||(t.preventDefault(),this.upcomingLeftValue=i,this.updateSliderRangePosition(),this.handleValueChange({newLeftValue:i}))}handleRightThumbKeydown(t){let i=this.calculateValueFromKeyboard(t,this.upcomingRightValue,this.upcomingLeftValue,this.maxValue);i===void 0||i===this.upcomingRightValue||(t.preventDefault(),this.upcomingRightValue=i,this.updateSliderRangePosition(),this.handleValueChange({newRightValue:i}))}calculateValueFromKeyboard(t,i,n,r){let a;switch(t.key){case"ArrowLeft":case"ArrowDown":a=i-1;break;case"ArrowRight":case"ArrowUp":a=i+1;break;case"Home":a=n;break;case"End":a=r;break;default:return}return Math.max(n,Math.min(r,a))}handleCurrentLeftInputChanged(t){let i=xd(t,this.minValue,this.upcomingRightValue,this.upcomingLeftValue);i!==void 0&&(this.upcomingLeftValue=i,this.updateSliderRangePosition(),this.handleValueChange({newLeftValue:i}))}handleCurrentRightInputChanged(t){let i=xd(t,this.upcomingLeftValue,this.maxValue,this.upcomingRightValue);i!==void 0&&(this.upcomingRightValue=i,this.updateSliderRangePosition(),this.handleValueChange({newRightValue:i}))}updateSliderRangePosition(){this.sliderRangePosition=N3({minValue:this.minValue,maxValue:this.maxValue,currentLeftValue:this.upcomingLeftValue??this.currentLeftValue,currentRightValue:this.upcomingRightValue??this.currentRightValue,sliderWidth:this.actualSliderWidth})}abortSlidingWhenHidden(){return this.sliderContainer.nativeElement.getBoundingClientRect().width===0?(this.stopSliding(),!0):!1}static{this.\u0275fac=function(i){return new(i||e)(ne(Ln))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-metric-color-range-slider"]],viewQuery:function(i,n){if(i&1&&Ha(E8,5)(k8,5)(q8,5),i&2){let r;fi(r=gi())&&(n.sliderContainer=r.first),fi(r=gi())&&(n.leftThumb=r.first),fi(r=gi())&&(n.rightThumb=r.first)}},inputs:{minValue:"minValue",maxValue:"maxValue",currentLeftValue:"currentLeftValue",currentRightValue:"currentRightValue",leftColor:"leftColor",middleColor:"middleColor",rightColor:"rightColor",handleValueChange:"handleValueChange",sliderWidth:"sliderWidth"},features:[za],decls:15,vars:34,consts:[["rangeSliderContainer",""],["leftThumb",""],["rightThumb",""],[1,"flex","items-center","gap-2"],["type","number","aria-label","Lower color range value input",1,"input","input-sm","input-bordered","w-16","text-center",3,"input","value","min","max"],[1,"flex","flex-1","mx-2","relative","leading-[48px]"],[1,"inline-block","border-b-4","border-solid"],["aria-hidden","true",1,"cursor-pointer","absolute","-top-1","rounded-full","border-[7px]","border-primary",3,"mousedown"],["type","range","step","1","aria-label","Lower color range value",1,"absolute","inset-0","m-0","h-full","w-full","opacity-0","pointer-events-none",3,"keydown","min","max","value"],["type","range","step","1","aria-label","Upper color range value",1,"absolute","inset-0","m-0","h-full","w-full","opacity-0","pointer-events-none",3,"keydown","min","max","value"],[3,"minValue","maxValue","leftValueLabel","rightValueLabel","sliderRangePosition","sliderWidth"],["type","number","aria-label","Upper color range value input",1,"input","input-sm","input-bordered","w-16","text-center",3,"input","value","min","max"]],template:function(i,n){i&1&&(x(0,"div",3)(1,"input",4),z("input",function(a){return n.handleCurrentLeftInputChanged(a)}),v(),x(2,"div",5,0),V(4,"span",6)(5,"span",6)(6,"span",6),x(7,"div",7,1),z("mousedown",function(){return n.setCurrentlySliding("leftThumb")}),v(),x(9,"div",7,2),z("mousedown",function(){return n.setCurrentlySliding("rightThumb")}),v(),x(11,"input",8),z("keydown",function(a){return n.handleLeftThumbKeydown(a)}),v(),x(12,"input",9),z("keydown",function(a){return n.handleRightThumbKeydown(a)}),v(),V(13,"cc-range-slider-labels",10),v(),x(14,"input",11),z("input",function(a){return n.handleCurrentRightInputChanged(a)}),v()()),i&2&&(h(),F("value",n.currentLeftValue)("min",n.minValue)("max",n.upcomingRightValue),h(3),ze("width",n.segmentWidths.left,"px")("border-bottom-color",n.leftColor),h(),ze("width",n.segmentWidths.middle,"px")("border-bottom-color",n.middleColor),h(),ze("width",n.segmentWidths.right,"px")("border-bottom-color",n.rightColor),h(),ze("left",n.sliderRangePosition.leftEnd-n.thumbRadius,"px"),h(2),ze("left",n.sliderRangePosition.rightStart-n.thumbRadius,"px"),h(2),F("min",n.minValue)("max",n.currentRightValue)("value",n.currentLeftValue),h(),F("min",n.currentLeftValue)("max",n.maxValue)("value",n.currentRightValue),h(),F("minValue",n.minValue)("maxValue",n.maxValue)("leftValueLabel",n.upcomingLeftValue)("rightValueLabel",n.upcomingRightValue)("sliderRangePosition",n.sliderRangePosition)("sliderWidth",n.actualSliderWidth),h(),F("value",n.currentRightValue)("min",n.upcomingLeftValue)("max",n.maxValue))},dependencies:[L3],encapsulation:2})}}return e})();var O3=(()=>{class e{constructor(t,i,n,r){this.mapStateReadWindow=t,this.metricsBarReadStore=i,this.metricsBarWriteStore=n,this.metricsLensFacade=r,this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.sliderValues=D(this.metricsBarReadStore.metricColorRangeValues$,{initialValue:{values:[],min:0,max:0,from:0,to:0}}),this.sliderColors=D(this.metricsBarReadStore.metricColorRangeColors$,{initialValue:{leftColor:"#000",middleColor:"#000",rightColor:"#000"}}),this.isAttributeDirectionInversed=D(St([this.mapStateReadWindow.colorMetric$,this.metricsLensFacade.descriptors$]).pipe(qe(([a,s])=>s[a]?.direction===1)),{initialValue:!1}),this.pendingLeftValue=null,this.pendingRightValue=null,this.commitColorRange=Vi(()=>{let a={};this.pendingLeftValue!==null&&(a.from=this.pendingLeftValue),this.pendingRightValue!==null&&(a.to=this.pendingRightValue),this.pendingLeftValue=null,this.pendingRightValue=null,this.metricsBarWriteStore.setColorRange(a)},d0),this.handleValueChange=({newLeftValue:a,newRightValue:s})=>{this.pendingLeftValue=a??this.pendingLeftValue,this.pendingRightValue=s??this.pendingRightValue,this.commitColorRange()}}ngOnDestroy(){this.commitColorRange.flush()}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(ht),ne(Qe),ne(Jn))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-color-range-section"]],hostAttrs:[1,"contents"],decls:7,vars:23,consts:[[1,"block",3,"minValue","maxValue","currentLeftValue","currentRightValue","leftColor","middleColor","rightColor","handleValueChange","sliderWidth"],[1,"flex","items-center","justify-between","gap-2"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],[1,"truncate","text-xs","opacity-60"],[3,"minValue","maxValue","currentLeftValue","currentRightValue","leftColor","middleColor","rightColor","colorMetric","values","isAttributeDirectionInverted","diagramWidth","diagramHeight","showAxisLabels"]],template:function(i,n){i&1&&(V(0,"cc-metric-color-range-slider",0),x(1,"div",1)(2,"span",2),g(3,"Distribution"),v(),x(4,"span",3),g(5),v()(),V(6,"cc-metric-color-range-diagram",4)),i&2&&(F("minValue",n.sliderValues().min)("maxValue",n.sliderValues().max)("currentLeftValue",n.sliderValues().from)("currentRightValue",n.sliderValues().to)("leftColor",n.sliderColors().leftColor)("middleColor",n.sliderColors().middleColor)("rightColor",n.sliderColors().rightColor)("handleValueChange",n.handleValueChange)("sliderWidth",220),h(5),ge("",n.colorMetric()," \xD7 quantile %"),h(),F("minValue",n.sliderValues().min)("maxValue",n.sliderValues().max)("currentLeftValue",n.sliderValues().from)("currentRightValue",n.sliderValues().to)("leftColor",n.sliderColors().leftColor)("middleColor",n.sliderColors().middleColor)("rightColor",n.sliderColors().rightColor)("colorMetric",n.colorMetric())("values",n.sliderValues().values)("isAttributeDirectionInverted",n.isAttributeDirectionInversed())("diagramWidth",380)("diagramHeight",190)("showAxisLabels",!1))},dependencies:[W3,F3],encapsulation:2})}}return e})();function T8(e,o){if(e&1){let t=we();y(0,"button",6),ie("click",function(){ae(t);let n=B();return se(n.resetThresholds())}),pe(1,"i",7),M()}}var z3=(()=>{class e{constructor(t,i,n,r){this.mapStateReadWindow=t,this.fileStoreReadWindow=i,this.metricsBarReadStore=n,this.metricsBarWriteStore=r,this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Pt}),this.selectedColorMetricData=D(this.metricsBarReadStore.selectedColorMetricData$,{initialValue:{values:[],minValue:0,maxValue:0}}),this.canResetThresholds=Y(()=>!this.isDeltaState()&&this.colorMetric()!=="unary"),this.swatchGradient=Y(()=>{let a=this.mapColors();return this.isDeltaState()?`linear-gradient(90deg, ${a.positiveDelta}, ${a.negativeDelta})`:`linear-gradient(90deg, ${a.positive}, ${a.neutral}, ${a.negative})`})}resetThresholds(){this.metricsBarWriteStore.setColorRange(yr(this.selectedColorMetricData()))}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(Re),ne(ht),ne(Qe))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-color-settings-header"]],hostAttrs:[1,"contents"],decls:8,vars:4,consts:[[1,"flex","items-center","justify-between","gap-2"],[1,"flex","min-w-0","items-center","gap-2"],[1,"inline-block","h-3.5","w-3.5","shrink-0","rounded-full"],[1,"truncate","text-sm"],[1,"font-semibold","text-primary"],["title","Reset slider thresholds to default","aria-label","Reset thresholds",1,"btn","btn-ghost","btn-xs","btn-square"],["title","Reset slider thresholds to default","aria-label","Reset thresholds",1,"btn","btn-ghost","btn-xs","btn-square",3,"click"],[1,"fa","fa-undo"]],template:function(i,n){i&1&&(y(0,"div",0)(1,"div",1),pe(2,"span",2),y(3,"span",3),g(4,"Color by "),y(5,"span",4),g(6),M()()(),K(7,T8,2,0,"button",5),M()),i&2&&(h(2),ze("background",n.swatchGradient()),h(4),Te(n.colorMetric()),h(),Q(n.canResetThresholds()?7:-1))},encapsulation:2})}}return e})();var $3=(()=>{class e{constructor(){this.override=Z.required(),this.recolorOverride=_e(),this.unpinOverride=_e()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-folder-override-row"]],hostAttrs:[1,"contents"],inputs:{override:[1,"override"]},outputs:{recolorOverride:"recolorOverride",unpinOverride:"unpinOverride"},decls:8,vars:7,consts:[[1,"flex","shrink-0","items-center","gap-2","rounded-md","border","border-base-300","px-2","py-1",3,"title"],[3,"colorChange","hexColor","ariaLabel"],[1,"min-w-0","flex-1","truncate","text-sm"],[1,"text-xs","opacity-60","tabular-nums",3,"title"],[1,"btn","btn-ghost","btn-xs","btn-square",3,"click","title"],[1,"fa","fa-times"]],template:function(i,n){i&1&&(x(0,"div",0)(1,"cc-inline-color-picker",1),z("colorChange",function(a){return n.recolorOverride.emit(a)}),v(),x(2,"span",2),g(3),v(),x(4,"span",3),g(5),v(),x(6,"button",4),z("click",function(){return n.unpinOverride.emit()}),V(7,"i",5),v()()),i&2&&(F("title",n.override().path),h(),F("hexColor",n.override().color)("ariaLabel","Recolor "+n.override().path),h(2),Te(n.override().path),h(),F("title",n.override().fileCount+" files"),h(),Te(n.override().fileCount),h(),F("title","Unpin "+n.override().path))},dependencies:[Eo],encapsulation:2})}}return e})();var R8=["pinInput"];function I8(e,o){if(e&1){let t=we();y(0,"button",2),ie("click",function(){ae(t);let n=B();return se(n.startPinning())}),pe(1,"i",3),y(2,"span"),g(3,"Pin a folder color\u2026"),M()()}}function A8(e,o){if(e&1){let t=we();y(0,"li",8)(1,"button",10),ie("mousedown",function(n){return n.preventDefault()})("click",function(){let n=ae(t).$implicit,r=B(2);return se(r.handlePin(n))}),y(2,"span",11),g(3),M()()()}if(e&2){let t=o.$implicit;h(),ce("title",t),h(2),Te(t)}}function D8(e,o){e&1&&(y(0,"li",9),g(1,"No folders found"),M())}function F8(e,o){if(e&1){let t=we();y(0,"div",4),pe(1,"i",5),y(2,"input",6,0),ie("input",function(n){ae(t);let r=B();return se(r.handleSearchTermChange(n.target.value))})("keydown.escape",function(n){ae(t);let r=B();return se(r.handleSearchEscape(n))})("blur",function(){ae(t);let n=B();return se(n.handleSearchBlur())}),M()(),y(4,"ul",7),Pe(5,A8,4,2,"li",8,ii,!1,D8,2,0,"li",9),M()}if(e&2){let t=B();h(2),ce("value",t.searchTerm()),h(3),Be(t.folderSuggestions())}}var L8=8,j3=(()=>{class e{constructor(t){this.metricsBarReadStore=t,this.pinFolder=_e(),this.folderPaths=D(this.metricsBarReadStore.markableFolderPaths$,{initialValue:[]}),this.overrides=D(this.metricsBarReadStore.markedPackagesWithCounts$,{initialValue:[]}),this.isPinning=Se(!1),this.searchTerm=Se(""),this.pinInput=Je("pinInput"),this.folderSuggestions=Y(()=>{let i=this.searchTerm().toLowerCase(),n=new Set(this.overrides().map(a=>a.path)),r=[];for(let a of this.folderPaths())if(!(n.has(a)||!a.toLowerCase().includes(i))&&(r.push(a),r.length>=L8))break;return r})}startPinning(){this.isPinning.set(!0),setTimeout(()=>this.pinInput()?.nativeElement.focus())}stopPinning(){this.isPinning.set(!1),this.searchTerm.set("")}handleSearchTermChange(t){this.searchTerm.set(t)}handleSearchBlur(){this.searchTerm().trim()===""&&this.stopPinning()}handleSearchEscape(t){t.preventDefault(),this.stopPinning()}handlePin(t){this.pinFolder.emit(t),this.stopPinning()}static{this.\u0275fac=function(i){return new(i||e)(ne(ht))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-pin-folder-search"]],viewQuery:function(i,n){i&1&&rt(n.pinInput,R8,5),i&2&&at()},hostAttrs:[1,"contents"],outputs:{pinFolder:"pinFolder"},decls:2,vars:1,consts:[["pinInput",""],[1,"btn","btn-ghost","btn-sm","w-full","justify-start","gap-2","border","border-dashed","border-base-300","font-normal"],[1,"btn","btn-ghost","btn-sm","w-full","justify-start","gap-2","border","border-dashed","border-base-300","font-normal",3,"click"],[1,"fa","fa-plus"],[1,"input","input-sm","input-bordered","flex","items-center","gap-2"],[1,"fa","fa-search","opacity-60"],["type","text","placeholder","Search folders\u2026","aria-label","Search folders",1,"grow",3,"input","keydown.escape","blur","value"],[1,"m-0","flex","max-h-40","list-none","flex-col","overflow-y-auto","p-0"],[1,"flex"],[1,"px-2","py-1","text-xs","opacity-60"],[1,"btn","btn-ghost","btn-xs","w-full","flex-nowrap","justify-start","font-normal",3,"mousedown","click","title"],[1,"min-w-0","truncate"]],template:function(i,n){i&1&&K(0,I8,4,0,"button",1)(1,F8,8,2),i&2&&Q(n.isPinning()?1:0)},encapsulation:2})}}return e})();var N8=(e,o)=>o.path;function P8(e,o){if(e&1&&(x(0,"span",2),g(1),v()),e&2){let t=B();h(),ge("",t.overrides().length," pinned")}}function B8(e,o){if(e&1){let t=we();x(0,"cc-folder-override-row",7),z("recolorOverride",function(n){let r=ae(t).$implicit,a=B(2);return se(a.handleRecolor(r.path,n))})("unpinOverride",function(){let n=ae(t).$implicit,r=B(2);return se(r.handleUnpin(n.path))}),v()}if(e&2){let t=o.$implicit;F("override",t)}}function V8(e,o){if(e&1&&(x(0,"div",4),Pe(1,B8,1,1,"cc-folder-override-row",6,N8),v()),e&2){let t=B();h(),Be(t.overrides())}}var H3=(()=>{class e{constructor(t,i,n){this.mapStateReadWindow=t,this.metricsBarReadStore=i,this.metricsBarWriteStore=n,this.overrides=D(this.metricsBarReadStore.markedPackagesWithCounts$,{initialValue:[]}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Pt})}handlePin(t){this.metricsBarWriteStore.markPackage({path:t,color:this.nextMarkingColor(t)})}handleRecolor(t,i){this.metricsBarWriteStore.markPackage({path:t,color:i})}handleUnpin(t){this.metricsBarWriteStore.unmarkPackage(t)}nextMarkingColor(t){let i=this.mapColors().markingColors,n=this.findMarkedParentColor(t),r=i.filter(s=>s!==n);if(r.length===0)return i[0];let a=new Set(this.overrides().map(s=>s.color));return r.find(s=>!a.has(s))??r[this.overrides().length%r.length]}findMarkedParentColor(t){let i,n=0;for(let r of this.overrides())t.startsWith(`${r.path}/`)&&r.path.length>n&&(i=r.color,n=r.path.length);return i}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(ht),ne(Qe))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-folder-overrides"]],hostAttrs:[1,"contents"],decls:8,vars:2,consts:[[1,"flex","items-center","justify-between","gap-2"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],[1,"text-xs","opacity-60"],[1,"m-0","text-xs","opacity-60"],[1,"flex","max-h-36","flex-col","gap-0.5","overflow-y-auto"],[3,"pinFolder"],[3,"override"],[3,"recolorOverride","unpinOverride","override"]],template:function(i,n){i&1&&(x(0,"div",0)(1,"span",1),g(2,"Folder Overrides"),v(),K(3,P8,2,1,"span",2),v(),x(4,"p",3),g(5,"These folders\u2019 floors are tinted with the pinned color."),v(),K(6,V8,3,0,"div",4),x(7,"cc-pin-folder-search",5),z("pinFolder",function(a){return n.handlePin(a)}),v()),i&2&&(h(3),Q(n.overrides().length>0?3:-1),h(3),Q(n.overrides().length>0?6:-1))},dependencies:[$3,j3],encapsulation:2})}}return e})();var U3=(()=>{class e{constructor(t,i){this.mapStateReadWindow=t,this.metricsBarWriteStore=i,this.groupName=Z.required(),this.colorMode=D(this.mapStateReadWindow.colorMode$,{initialValue:"absolute"})}handleColorModeChange(t){this.metricsBarWriteStore.setColorMode(t)}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(Qe))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-gradient-mode-picker"]],hostAttrs:[1,"contents"],inputs:{groupName:[1,"groupName"]},decls:8,vars:8,consts:[[1,"flex","flex-col","gap-1"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],["role","radiogroup","aria-label","Gradient mode",1,"join","w-full"],["type","radio","aria-label","Absolute",1,"join-item","btn","btn-sm","flex-1",3,"change","name","checked"],["type","radio","aria-label","Focused",1,"join-item","btn","btn-sm","flex-1",3,"change","name","checked"],["type","radio","aria-label","Weighted",1,"join-item","btn","btn-sm","flex-1",3,"change","name","checked"],["type","radio","aria-label","Relative",1,"join-item","btn","btn-sm","flex-1",3,"change","name","checked"]],template:function(i,n){i&1&&(y(0,"div",0)(1,"span",1),g(2,"Gradient Mode"),M(),y(3,"div",2)(4,"input",3),ie("change",function(){return n.handleColorModeChange("absolute")}),M(),y(5,"input",4),ie("change",function(){return n.handleColorModeChange("focusedGradient")}),M(),y(6,"input",5),ie("change",function(){return n.handleColorModeChange("weightedGradient")}),M(),y(7,"input",6),ie("change",function(){return n.handleColorModeChange("trueGradient")}),M()()()),i&2&&(h(4),ce("name",n.groupName())("checked",n.colorMode()==="absolute"),h(),ce("name",n.groupName())("checked",n.colorMode()==="focusedGradient"),h(),ce("name",n.groupName())("checked",n.colorMode()==="weightedGradient"),h(),ce("name",n.groupName())("checked",n.colorMode()==="trueGradient"))},encapsulation:2})}}return e})();function W8(e,o){if(e&1){let t=we();x(0,"label",1)(1,"input",3),z("change",function(){ae(t);let n=B();return se(n.handleIsColorRangeInvertedChange())}),v(),x(2,"span",4),g(3,"Invert colors"),v()()}if(e&2){let t=B();h(),F("checked",t.isColorRangeInverted())}}function O8(e,o){if(e&1){let t=we();x(0,"label",1)(1,"input",3),z("change",function(){ae(t);let n=B();return se(n.handleAreDeltaColorsInvertedChange())}),v(),x(2,"span",4),g(3,"Invert colors"),v()()}if(e&2){let t=B();h(),F("checked",t.areDeltaColorsInverted())}}var G3=(()=>{class e{constructor(t,i,n){this.fileStoreReadWindow=t,this.mapStateReadWindow=i,this.metricsBarWriteStore=n,this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Pt}),this.isColorRangeInverted=Y(()=>this.mapColors().isColorRangeInverted??!1),this.areDeltaColorsInverted=Y(()=>this.mapColors().areDeltaColorsInverted??!1)}handleIsColorRangeInvertedChange(){this.metricsBarWriteStore.invertColorRange()}handleAreDeltaColorsInvertedChange(){this.metricsBarWriteStore.invertDeltaColors()}resetColorsKeys(){return this.isDeltaState()?["mapState.mapColors.positiveDelta","mapState.mapColors.negativeDelta","mapState.mapColors.selected","mapState.mapColors.areDeltaColorsInverted"]:["mapState.mapColors.positive","mapState.mapColors.negative","mapState.mapColors.neutral","mapState.mapColors.selected","mapState.mapColors.isColorRangeInverted","mapState.colorMode"]}static{this.\u0275fac=function(i){return new(i||e)(ne(Re),ne(xe),ne(Qe))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-invert-reset-row"]],hostAttrs:[1,"contents"],decls:4,vars:4,consts:[[1,"flex","items-center","justify-between","gap-2"],[1,"flex","cursor-pointer","items-center","gap-2"],["label","Reset colors",3,"settingsKeys","tooltip","small"],["type","checkbox",1,"toggle","toggle-sm","toggle-primary",3,"change","checked"],[1,"text-sm"]],template:function(i,n){i&1&&(x(0,"div",0),K(1,W8,4,1,"label",1)(2,O8,4,1,"label",1),V(3,"cc-reset-settings-button",2),v()),i&2&&(h(),Q(n.isDeltaState()?2:1),h(2),F("settingsKeys",n.resetColorsKeys())("tooltip",n.isDeltaState()?"Reset color values to default":"Reset color values and gradient mode to default")("small",!0))},dependencies:[ko],encapsulation:2})}}return e})();function z8(e,o){if(e&1&&V(0,"cc-color-range-section")(1,"cc-gradient-mode-picker",1),e&2){let t=B();h(),F("groupName",t.popoverId()+"-gradient-mode")}}var cc=(()=>{class e{constructor(t,i){this.mapStateReadWindow=t,this.fileStoreReadWindow=i,this.popoverId=Z.required(),this.anchorName=Z.required(),this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.hasRangeSection=Y(()=>!this.isDeltaState()&&this.colorMetric()!=="unary")}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(Re))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-color-settings-popover"]],hostAttrs:[1,"contents"],inputs:{popoverId:[1,"popoverId"],anchorName:[1,"anchorName"]},decls:6,vars:4,consts:[[3,"popoverId","anchorName","widthClass"],[3,"groupName"]],template:function(i,n){i&1&&(x(0,"cc-settings-popover-shell",0),V(1,"cc-color-settings-header"),K(2,z8,2,1),V(3,"cc-color-bands-section")(4,"cc-invert-reset-row")(5,"cc-folder-overrides"),v()),i&2&&(F("popoverId",n.popoverId())("anchorName",n.anchorName())("widthClass","max-w-[95vw] "+(n.hasRangeSection()?"w-[420px]":"w-80")),h(2),Q(n.hasRangeSection()?2:-1))},dependencies:[Ai,z3,O3,U3,b2,G3,H3],encapsulation:2})}}return e})();var X3=(()=>{class e{constructor(t,i,n){this.mapStateReadWindow=t,this.preferencesReadWindow=i,this.metricsBarWriteStore=n,this.searchPopoverId="metric-select-popover-color",this.searchAnchorName="metric-segment-color",this.settingsPopoverId="metric-settings-popover-color",this.settingsAnchorName="metric-segment-color-cog",this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.isLinked=D(this.preferencesReadWindow.isColorMetricLinkedToHeightMetric$,{initialValue:!1})}handleMetricSelected(t){this.metricsBarWriteStore.setColorMetric(t)}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(sr),ne(Qe))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-color-segment"]],hostAttrs:[1,"contents"],decls:5,vars:14,consts:[["label","Color",3,"metricName","hasCog","cogPopoverId","cogAnchorName","searchPopoverId","searchAnchorName","disabled","testId","cogTestId"],["body","",1,"flex","flex-col","items-stretch","gap-1"],["metricFor","colorMetric"],["placeholder","Color Metric (highest value)","kind","node",3,"metricSelected","popoverId","anchorName","selected"],[3,"popoverId","anchorName"]],template:function(i,n){i&1&&(x(0,"cc-axis-card",0)(1,"div",1),V(2,"cc-metric-meta-value",2),v()(),x(3,"cc-metric-bar-select-popover",3),z("metricSelected",function(a){return n.handleMetricSelected(a)}),v(),V(4,"cc-color-settings-popover",4)),i&2&&(F("metricName",n.colorMetric())("hasCog",!0)("cogPopoverId",n.settingsPopoverId)("cogAnchorName",n.settingsAnchorName)("searchPopoverId",n.searchPopoverId)("searchAnchorName",n.searchAnchorName)("disabled",n.isLinked())("testId","metric-segment-color")("cogTestId","metric-segment-color-cog"),h(3),F("popoverId",n.searchPopoverId)("anchorName",n.searchAnchorName)("selected",n.colorMetric()),h(),F("popoverId",n.settingsPopoverId)("anchorName",n.settingsAnchorName))},dependencies:[_o,_r,ql,cc],encapsulation:2})}}return e})();var K3=(()=>{class e{constructor(){this.mapStateReadWindow=T(xe),this.metricsBarWriteStore=T(Qe),this.isEdgeMetricVisible=D(this.mapStateReadWindow.isEdgeMetricVisible$,{initialValue:!0})}toggle(){this.metricsBarWriteStore.toggleEdgeMetricVisible()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-edge-metric-toggle"]],decls:4,vars:1,consts:[[1,"flex","items-center","gap-2","cursor-pointer"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked"]],template:function(i,n){i&1&&(y(0,"label",0)(1,"input",1),ie("change",function(){return n.toggle()}),M(),y(2,"span"),g(3,"Disable edge metric"),M()()),i&2&&(h(),ce("checked",!n.isEdgeMetricVisible()))},encapsulation:2})}}return e})();var Q3=(()=>{class e{constructor(){this.mapStateReadWindow=T(xe),this.metricsBarReadStore=T(ht),this.metricsBarWriteStore=T(Qe),this.popoverId=Z.required(),this.anchorName=Z.required(),this.amountOfBuildingsWithSelectedEdgeMetric=D(this.metricsBarReadStore.amountOfBuildingsWithSelectedEdgeMetric$,{initialValue:0}),this.edgePreviewLabel=D(this.metricsBarReadStore.amountOfBuildingsWithSelectedEdgeMetric$.pipe(qe(t=>`Preview the edges of up to ${t} buildings with the highest amount of incoming and outgoing edges`)),{initialValue:""}),this.amountOfEdgePreviews=D(this.mapStateReadWindow.amountOfEdgePreviews$,{initialValue:0}),this.edgeHeight=D(this.mapStateReadWindow.edgeHeight$,{initialValue:1}),this.showOutgoingEdges=D(this.mapStateReadWindow.showOutgoingEdges$,{initialValue:!1}),this.showIncomingEdges=D(this.mapStateReadWindow.showIncomingEdges$,{initialValue:!1}),this.showOnlyBuildingsWithEdges=D(this.mapStateReadWindow.showOnlyBuildingsWithEdges$,{initialValue:!1}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Pt}),this.outgoingEdgeColor=Y(()=>this.mapColors().outgoingEdge),this.incomingEdgeColor=Y(()=>this.mapColors().incomingEdge),this.resetKeys=["mapState.amountOfEdgePreviews","mapState.edgeHeight","mapState.mapColors.outgoingEdge","mapState.showOutgoingEdges","mapState.mapColors.incomingEdge","mapState.showIncomingEdges","mapState.showOnlyBuildingsWithEdges","mapState.isEdgeMetricVisible"]}setAmountOfEdgePreviews(t){this.metricsBarWriteStore.setAmountOfEdgePreviews(t)}setEdgeHeight(t){this.metricsBarWriteStore.setEdgeHeight(t)}setShowOutgoingEdges(t){let i=t.target.checked;this.metricsBarWriteStore.setShowOutgoingEdges(i)}setShowIncomingEdges(t){let i=t.target.checked;this.metricsBarWriteStore.setShowIncomingEdges(i)}setShowOnlyBuildingsWithEdges(t){let i=t.target.checked;this.metricsBarWriteStore.setShowOnlyBuildingsWithEdges(i)}setMapColor(t,i){this.metricsBarWriteStore.setMapColors({[t]:i})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-edge-settings-popover"]],hostAttrs:[1,"contents"],inputs:{popoverId:[1,"popoverId"],anchorName:[1,"anchorName"]},decls:32,vars:18,consts:[["widthClass","w-80",3,"popoverId","anchorName"],[3,"title"],[1,"text-sm"],["ariaLabel","Edge preview amount",3,"valueChange","min","max","value","disabled"],["title","Adjust the curve height"],["ariaLabel","Edge height",3,"valueChange","min","max","value","disabled"],[1,"flex","flex-col","gap-2"],[1,"flex","items-center","gap-2"],["ariaLabel","Outgoing edge color",3,"colorChange","hexColor"],[1,"min-w-0","flex-1","truncate","text-sm"],[1,"flex","items-center","gap-2","cursor-pointer"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked"],["ariaLabel","Incoming edge color",3,"colorChange","hexColor"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked","disabled"],["tooltip","Reset edge metric settings to their defaults","label","Reset edge metric settings",3,"settingsKeys"]],template:function(i,n){i&1&&(x(0,"cc-settings-popover-shell",0)(1,"div",1)(2,"span",2),g(3,"Preview"),v(),x(4,"cc-slider-number-input",3),z("valueChange",function(a){return n.setAmountOfEdgePreviews(a)}),v()(),x(5,"div",4)(6,"span",2),g(7,"Height"),v(),x(8,"cc-slider-number-input",5),z("valueChange",function(a){return n.setEdgeHeight(a)}),v()(),x(9,"div",6)(10,"div",7)(11,"cc-inline-color-picker",8),z("colorChange",function(a){return n.setMapColor("outgoingEdge",a)}),v(),x(12,"span",9),g(13,"Outgoing Edge"),v(),x(14,"label",10)(15,"input",11),z("change",function(a){return n.setShowOutgoingEdges(a)}),v(),x(16,"span"),g(17,"Show"),v()()(),x(18,"div",7)(19,"cc-inline-color-picker",12),z("colorChange",function(a){return n.setMapColor("incomingEdge",a)}),v(),x(20,"span",9),g(21,"Incoming Edge"),v(),x(22,"label",10)(23,"input",11),z("change",function(a){return n.setShowIncomingEdges(a)}),v(),x(24,"span"),g(25,"Show"),v()()()(),x(26,"label",10)(27,"input",13),z("change",function(a){return n.setShowOnlyBuildingsWithEdges(a)}),v(),x(28,"span"),g(29,"Only show nodes with edges"),v()(),V(30,"cc-edge-metric-toggle")(31,"cc-reset-settings-button",14),v()),i&2&&(F("popoverId",n.popoverId())("anchorName",n.anchorName()),h(),F("title",n.edgePreviewLabel()),h(3),F("min",0)("max",n.amountOfBuildingsWithSelectedEdgeMetric())("value",n.amountOfEdgePreviews())("disabled",n.amountOfBuildingsWithSelectedEdgeMetric()===0),h(4),F("min",1)("max",9)("value",n.edgeHeight())("disabled",n.amountOfBuildingsWithSelectedEdgeMetric()===0),h(3),F("hexColor",n.outgoingEdgeColor()),h(4),F("checked",n.showOutgoingEdges()),h(4),F("hexColor",n.incomingEdgeColor()),h(4),F("checked",n.showIncomingEdges()),h(4),F("checked",n.showOnlyBuildingsWithEdges())("disabled",n.amountOfBuildingsWithSelectedEdgeMetric()===0),h(4),F("settingsKeys",n.resetKeys))},dependencies:[Eo,ko,K3,Ai,qo],encapsulation:2})}}return e})();function $8(e,o){e&1&&(V(0,"cc-metric-chooser-type",5),x(1,"span"),g(2),v()),e&2&&(F("metricFor","edgeMetric"),h(2),Te(o))}function j8(e,o){e&1&&(x(0,"span",2),g(1,"\xA0"),v())}var Y3=(()=>{class e{constructor(){this.mapStateReadWindow=T(xe),this.metricsBarWriteStore=T(Qe),this.nodeSelectionService=T(Er),this.searchPopoverId="metric-select-popover-edge",this.searchAnchorName="metric-segment-edges",this.settingsPopoverId="metric-settings-popover-edge",this.settingsAnchorName="metric-segment-edges-cog",this.edgeMetric=D(this.mapStateReadWindow.edgeMetric$,{initialValue:""}),this.isEdgeMetricVisible=D(this.mapStateReadWindow.isEdgeMetricVisible$,{initialValue:!0}),this.hoveredNode=D(this.nodeSelectionService.createNodeObservable()),this.hoveredEdgeValue=Y(()=>{let t=this.hoveredNode(),i=this.edgeMetric();if(!t||!i)return null;let n=t.edgeAttributes?.[i];return n?`${Z3(n.incoming)} / ${Z3(n.outgoing)}`:null})}handleMetricSelected(t){this.metricsBarWriteStore.setEdgeMetric(t)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-edge-segment"]],hostAttrs:[1,"contents"],decls:6,vars:15,consts:[["label","Edges",3,"metricName","hasCog","cogPopoverId","cogAnchorName","searchPopoverId","searchAnchorName","dimmed","testId","cogTestId"],["body","",1,"flex","items-center","justify-center","gap-1","text-xs","opacity-60","leading-tight","min-h-4"],["aria-hidden","true"],["placeholder","Edge Metric (highest value)","kind","edge",3,"metricSelected","popoverId","anchorName","selected"],[3,"popoverId","anchorName"],["attributeType","edges",3,"metricFor"]],template:function(i,n){if(i&1&&(x(0,"cc-axis-card",0)(1,"div",1),K(2,$8,3,2)(3,j8,2,0,"span",2),v()(),x(4,"cc-metric-bar-select-popover",3),z("metricSelected",function(a){return n.handleMetricSelected(a)}),v(),V(5,"cc-edge-settings-popover",4)),i&2){let r;F("metricName",n.edgeMetric())("hasCog",!0)("cogPopoverId",n.settingsPopoverId)("cogAnchorName",n.settingsAnchorName)("searchPopoverId",n.searchPopoverId)("searchAnchorName",n.searchAnchorName)("dimmed",!n.isEdgeMetricVisible())("testId","metric-segment-edges")("cogTestId","metric-segment-edges-cog"),h(2),Q((r=n.hoveredEdgeValue())?2:3,r),h(2),F("popoverId",n.searchPopoverId)("anchorName",n.searchAnchorName)("selected",n.edgeMetric()),h(),F("popoverId",n.settingsPopoverId)("anchorName",n.settingsAnchorName)}},dependencies:[_o,kl,_r,Q3],encapsulation:2})}}return e})();function Z3(e){return typeof e=="number"?e.toLocaleString():"-"}function H8(e,o){if(e&1){let t=we();x(0,"label",4)(1,"input",6),z("change",function(n){ae(t);let r=B();return se(r.toggleInvertHeight(n))}),v(),x(2,"span"),g(3,"Invert Height"),v()()}if(e&2){let t=B();h(),F("checked",t.invertHeight())}}var J3=(()=>{class e{constructor(){this.mapStateReadWindow=T(xe),this.fileStoreReadWindow=T(Re),this.metricsBarWriteStore=T(Qe),this.popoverId=Z.required(),this.anchorName=Z.required(),this.scalingY=D(this.mapStateReadWindow.scaling$,{initialValue:{x:1,y:1,z:1}}),this.invertHeight=D(this.mapStateReadWindow.invertHeight$,{initialValue:!1}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.resetKeys=["mapState.scaling.y","mapState.invertHeight"]}setScalingY(t){this.metricsBarWriteStore.setScaling({y:t})}toggleInvertHeight(t){let i=t.target.checked;this.metricsBarWriteStore.setInvertHeight(i)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-height-settings-popover"]],hostAttrs:[1,"contents"],inputs:{popoverId:[1,"popoverId"],anchorName:[1,"anchorName"]},decls:7,vars:7,consts:[[3,"popoverId","anchorName"],["title","Height scaling"],[1,"text-sm"],["ariaLabel","Height",3,"valueChange","min","max","value"],[1,"flex","items-center","gap-2","cursor-pointer"],["tooltip","Reset height metric settings to their defaults","label","Reset height metric settings",3,"settingsKeys"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked"]],template:function(i,n){i&1&&(x(0,"cc-settings-popover-shell",0)(1,"div",1)(2,"span",2),g(3,"Height"),v(),x(4,"cc-slider-number-input",3),z("valueChange",function(a){return n.setScalingY(a)}),v()(),K(5,H8,4,1,"label",4),V(6,"cc-reset-settings-button",5),v()),i&2&&(F("popoverId",n.popoverId())("anchorName",n.anchorName()),h(4),F("min",1)("max",25)("value",n.scalingY().y),h(),Q(n.isDeltaState()?-1:5),h(),F("settingsKeys",n.resetKeys))},dependencies:[ko,Ai,qo],encapsulation:2})}}return e})();var ev=(()=>{class e{constructor(){this.searchPopoverId="metric-select-popover-height",this.searchAnchorName="metric-segment-height",this.settingsPopoverId="metric-settings-popover-height",this.settingsAnchorName="metric-segment-height-cog",this.mapStateReadWindow=T(xe),this.metricsBarWriteStore=T(Qe),this.heightMetric=D(this.mapStateReadWindow.heightMetric$,{initialValue:""})}handleMetricSelected(t){this.metricsBarWriteStore.setHeightMetric(t)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-height-segment"]],hostAttrs:[1,"contents"],decls:2,vars:7,consts:[["label","Height","metricFor","heightMetric","placeholder","Height Metric (highest value)","testIdPrefix","metric-segment-height",3,"metricSelected","metricName","searchPopoverId","searchAnchorName","settingsPopoverId","settingsAnchorName"],[3,"popoverId","anchorName"]],template:function(i,n){i&1&&(x(0,"cc-metric-segment",0),z("metricSelected",function(a){return n.handleMetricSelected(a)}),V(1,"cc-height-settings-popover",1),v()),i&2&&(F("metricName",n.heightMetric())("searchPopoverId",n.searchPopoverId)("searchAnchorName",n.searchAnchorName)("settingsPopoverId",n.settingsPopoverId)("settingsAnchorName",n.settingsAnchorName),h(),F("popoverId",n.settingsPopoverId)("anchorName",n.settingsAnchorName))},dependencies:[Tl,J3],encapsulation:2})}}return e})();var Rt={areaMetric:{group:"area",label:"Area metric",isMetricSelection:!0,isAppliedFirst:!0,read:e=>e.state.mapState.areaMetric,patch:e=>({mapState:{areaMetric:e.areaMetric}})},margin:{group:"area",label:"Margin",read:e=>e.state.mapState.margin,patch:e=>({mapState:{margin:e.margin}})},invertArea:{group:"area",label:"Invert area",read:e=>e.state.mapState.invertArea,patch:e=>({mapState:{invertArea:e.invertArea}})},enableFloorLabels:{group:"area",label:"Floor labels",read:e=>e.state.mapState.enableFloorLabels,patch:e=>({mapState:{enableFloorLabels:e.enableFloorLabels}})},heightMetric:{group:"height",label:"Height metric",isMetricSelection:!0,isAppliedFirst:!0,read:e=>e.state.mapState.heightMetric,patch:e=>({mapState:{heightMetric:e.heightMetric}})},heightScaling:{group:"height",label:"Height scaling",read:e=>e.state.mapState.scaling.y,patch:e=>({mapState:{scaling:{y:e.heightScaling}}})},invertHeight:{group:"height",label:"Invert height",read:e=>e.state.mapState.invertHeight,patch:e=>({mapState:{invertHeight:e.invertHeight}})},colorMetric:{group:"color",label:"Color metric",isMetricSelection:!0,isAppliedFirst:!0,read:e=>e.state.mapState.colorMetric,patch:e=>({mapState:{colorMetric:e.colorMetric}})},isColorMetricLinkedToHeightMetric:{group:"color",label:"Color follows height metric",isAppliedFirst:!0,read:e=>e.state.preferences.isColorMetricLinkedToHeightMetric,patch:e=>({preferences:{isColorMetricLinkedToHeightMetric:e.isColorMetricLinkedToHeightMetric}})},colorRange:{group:"color",label:"Color range",read:e=>ke({},e.state.mapState.colorRange),patch:e=>({mapState:{colorRange:e.colorRange}})},colorMode:{group:"color",label:"Gradient mode",read:e=>e.state.mapState.colorMode,patch:e=>({mapState:{colorMode:e.colorMode}})},mapColors:{group:"color",label:"Colors",read:e=>U8(e.state.mapState.mapColors),patch:e=>({mapState:{mapColors:e.mapColors}})},markedPackages:{group:"color",label:"Folder color overrides",read:e=>[...e.state.sharedView.markedPackages],patch:e=>({sharedView:{markedPackages:[...e.markedPackages]}})},edgeMetric:{group:"edge",label:"Edge metric",isMetricSelection:!0,isAppliedFirst:!0,read:e=>e.state.mapState.edgeMetric,patch:e=>({mapState:{edgeMetric:e.edgeMetric}})},isEdgeMetricVisible:{group:"edge",label:"Edge metric enabled",read:e=>e.state.mapState.isEdgeMetricVisible,patch:e=>({mapState:{isEdgeMetricVisible:e.isEdgeMetricVisible}})},amountOfEdgePreviews:{group:"edge",label:"Edge previews",read:e=>e.state.mapState.amountOfEdgePreviews,patch:e=>({mapState:{amountOfEdgePreviews:e.amountOfEdgePreviews}})},edgeHeight:{group:"edge",label:"Edge curve height",read:e=>e.state.mapState.edgeHeight,patch:e=>({mapState:{edgeHeight:e.edgeHeight}})},showOutgoingEdges:{group:"edge",label:"Show outgoing edges",read:e=>e.state.mapState.showOutgoingEdges,patch:e=>({mapState:{showOutgoingEdges:e.showOutgoingEdges}})},showIncomingEdges:{group:"edge",label:"Show incoming edges",read:e=>e.state.mapState.showIncomingEdges,patch:e=>({mapState:{showIncomingEdges:e.showIncomingEdges}})},showOnlyBuildingsWithEdges:{group:"edge",label:"Only nodes with edges",read:e=>e.state.mapState.showOnlyBuildingsWithEdges,patch:e=>({mapState:{showOnlyBuildingsWithEdges:e.showOnlyBuildingsWithEdges}})},edgeColors:{group:"edge",label:"Edge colors",read:e=>({outgoingEdge:e.state.mapState.mapColors.outgoingEdge,incomingEdge:e.state.mapState.mapColors.incomingEdge}),patch:e=>({mapState:{mapColors:ke({},e.edgeColors)}})},amountOfTopLabels:{group:"labels",label:"Top labels",read:e=>e.state.mapState.amountOfTopLabels,patch:e=>({mapState:{amountOfTopLabels:e.amountOfTopLabels}})},labelsPerMap:{group:"labels",label:"Top labels scope",read:e=>e.state.mapState.labelsPerMap,patch:e=>({mapState:{labelsPerMap:e.labelsPerMap}})},labelSize:{group:"labels",label:"Label size",read:e=>e.state.mapState.labelSize,patch:e=>({mapState:{labelSize:e.labelSize}})},labelMode:{group:"labels",label:"Label mode",read:e=>e.state.mapState.labelMode,patch:e=>({mapState:{labelMode:e.labelMode}})},showMetricLabelNodeName:{group:"labels",label:"Show node names",read:e=>e.state.mapState.showMetricLabelNodeName,patch:e=>({mapState:{showMetricLabelNodeName:e.showMetricLabelNodeName}})},showMetricLabelNameValue:{group:"labels",label:"Show metric values",read:e=>e.state.mapState.showMetricLabelNameValue,patch:e=>({mapState:{showMetricLabelNameValue:e.showMetricLabelNameValue}})},groupLabelCollisions:{group:"labels",label:"Group overlapping labels",read:e=>e.state.mapState.groupLabelCollisions,patch:e=>({mapState:{groupLabelCollisions:e.groupLabelCollisions}})},colorLabels:{group:"labels",label:"Labels by color metric",read:e=>ke({},e.state.mapState.colorLabels),patch:e=>({mapState:{colorLabels:e.colorLabels}})},camera:{group:"camera",label:"Position and zoom",read:e=>({position:ke({},e.camera.position),target:ke({},e.camera.target)})},excludedNodes:{group:"filters",label:"Excluded nodes",read:e=>[...e.state.sharedView.excludedNodes],patch:e=>({sharedView:{excludedNodes:[...e.excludedNodes]}})},flattenedNodes:{group:"filters",label:"Flattened nodes",read:e=>[...e.state.sharedView.flattenedNodes],patch:e=>({sharedView:{flattenedNodes:[...e.flattenedNodes]}})},metricRules:{group:"filters",label:"Flattened and excluded by metric",read:e=>[...e.state.sharedView.metricRules],patch:e=>({sharedView:{metricRules:[...e.metricRules]}})},focusedNodePath:{group:"filters",label:"Focused folder",read:e=>[...e.state.sharedView.focusedNodePath],patch:e=>({sharedView:{focusedNodePath:[...e.focusedNodePath]}})}};function U8(e){let n=e,{outgoingEdge:o,incomingEdge:t}=n;return qn(n,["outgoingEdge","incomingEdge"])}var wn=Object.keys(Rt),ya={area:"Area",height:"Height",color:"Color",edge:"Edges",labels:"Labels",camera:"Camera",filters:"Filters"},dc=Object.keys(ya),hc={area:"fa-th-large",height:"fa-bar-chart",color:"fa-paint-brush",edge:"fa-share-alt",labels:"fa-tags",camera:"fa-video-camera",filters:"fa-filter"};function Jh(e){return!!Rt[e].isMetricSelection}var sG=wn.filter(Jh);function em(e){return!!Rt[e].isAppliedFirst}function tv(e,o){return Object.fromEntries(Object.entries(e).filter(([t])=>o.has(t)))}function iv(e,o){let t={};for(let i of wn){if(!o.has(i))continue;let n=Rt[i].read(e);n!==void 0&&(t[i]=n)}return t}var mc=".ccscenario",uc=3;function tm(e){return wn.filter(o=>e.settings[o]!==void 0)}function ov(e){let o=new Set(tm(e).map(t=>Rt[t].group));return dc.filter(t=>o.has(t))}function nv(e){return et(ke(ke({schemaVersion:uc,name:e.name},e.description?{description:e.description}:{}),e.mapFileNames?.length>0?{mapFileNames:e.mapFileNames}:{}),{settings:e.settings})}function rv(e){return{id:crypto.randomUUID(),name:e.name,description:e.description,mapFileNames:e.mapFileNames,createdAt:Date.now(),settings:e.settings}}var sv=(e,o)=>o.key;function G8(e,o){if(e&1){let t=we();y(0,"label",8)(1,"input",12),ie("change",function(n){let r=ae(t).$implicit,a=B(2);return se(a.toggleSetting(r.key,n.target.checked))}),M(),y(2,"span",13),g(3),M()()}if(e&2){let t=o.$implicit;h(),ce("checked",t.selected),ot("data-testid","scenario-setting-"+t.key),h(2),Te(t.label)}}function X8(e,o){if(e&1){let t=we();y(0,"div",7)(1,"label",8)(2,"input",9),ie("change",function(n){let r=ae(t).$implicit,a=B();return se(a.toggleGroup(r,n.target.checked))}),M(),pe(3,"i"),y(4,"span",10),g(5),M()(),y(6,"div",11),Pe(7,G8,4,3,"label",8,sv),M()()}if(e&2){let t=o.$implicit;h(2),ce("checked",t.allSelected)("indeterminate",t.someSelected&&!t.allSelected),ot("data-testid","scenario-group-"+t.key),h(),Dt(Dn("fa ",t.icon," w-4 text-center opacity-60")),h(2),Te(t.label),h(2),Be(t.settings)}}var pc=(()=>{class e{constructor(){this.availableKeys=Z.required(),this.defaultKeys=Z.required(),this.selectedKeys=yu.required(),this.isDefaultSelection=Y(()=>{let t=this.selectedKeys(),i=this.defaultKeys();return t.size===i.length&&i.every(n=>t.has(n))}),this.groups=Y(()=>{let t=this.selectedKeys(),i=this.availableKeys();return dc.map(n=>this.toPickerGroup(n,i,t)).filter(n=>n.settings.length>0)})}selectAll(){this.selectedKeys.set(new Set(this.availableKeys()))}selectNone(){this.selectedKeys.set(new Set)}resetSelection(){this.selectedKeys.set(new Set(this.defaultKeys()))}toggleSetting(t,i){this.selectedKeys.update(n=>av(n,[t],i))}toggleGroup(t,i){this.selectedKeys.update(n=>av(n,t.settings.map(r=>r.key),i))}toPickerGroup(t,i,n){let r=i.filter(a=>Rt[a].group===t).map(a=>({key:a,label:Rt[a].label,selected:n.has(a)}));return{key:t,label:ya[t],icon:hc[t],settings:r,allSelected:r.length>0&&r.every(a=>a.selected),someSelected:r.some(a=>a.selected)}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-scenario-settings-picker"]],inputs:{availableKeys:[1,"availableKeys"],defaultKeys:[1,"defaultKeys"],selectedKeys:[1,"selectedKeys"]},outputs:{selectedKeys:"selectedKeysChange"},decls:13,vars:1,consts:[[1,"mb-1","flex","items-center","justify-between","gap-2"],[1,"text-xs","uppercase","tracking-wide","opacity-60"],[1,"join"],["type","button","data-testid","scenario-settings-select-all",1,"btn","btn-xs","join-item",3,"click"],["type","button","data-testid","scenario-settings-select-none",1,"btn","btn-xs","join-item",3,"click"],["type","button","data-testid","scenario-settings-reset",1,"btn","btn-xs","join-item",3,"click","disabled"],[1,"flex","flex-col","gap-2","max-h-64","overflow-y-auto","pr-1"],[1,"flex","flex-col","gap-1"],[1,"flex","items-center","gap-2","cursor-pointer"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked","indeterminate"],[1,"text-sm","font-semibold"],[1,"flex","flex-col","gap-0.5","pl-7"],["type","checkbox",1,"checkbox","checkbox-xs","checkbox-primary",3,"change","checked"],[1,"text-xs"]],template:function(i,n){i&1&&(y(0,"div",0)(1,"span",1),g(2,"Toggle all"),M(),y(3,"div",2)(4,"button",3),ie("click",function(){return n.selectAll()}),g(5," On "),M(),y(6,"button",4),ie("click",function(){return n.selectNone()}),g(7," Off "),M(),y(8,"button",5),ie("click",function(){return n.resetSelection()}),g(9," Reset "),M()()(),y(10,"div",6),Pe(11,X8,9,7,"div",7,sv),M()),i&2&&(h(8),ce("disabled",n.isDefaultSelection()),h(3),Be(n.groups()))},encapsulation:2})}}return e})();function av(e,o,t){let i=new Set(e);for(let n of o)t?i.add(n):i.delete(n);return i}function fc(e){return`${e} ${e===1?"setting":"settings"}`}var gc=(()=>{class e{constructor(t,i){this.store=t,this.ccStateSnapshot=i}getValue(){return this.ccStateSnapshot.get()}setStatePatch(t){this.store.dispatch(Qt({value:t}))}static{this.\u0275fac=function(i){return new(i||e)(E(he),E(Vt))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var K8=["areaMetric","heightMetric","colorMetric"],bc=(()=>{class e{constructor(t,i,n,r){this.scenariosStore=t,this.threeCameraService=i,this.threeMapControlsService=n,this.threeRendererService=r}getAvailableMetricNames(t){return{nodeMetrics:new Set(t.nodeMetricData.map(i=>i.name)),edgeMetrics:new Set(t.edgeMetricData.map(i=>i.name))}}getMissingMetrics(t,i){let n=this.getAvailableMetricNames(i),r=K8.map(a=>t[a]).filter(a=>!!a);return{nodeMetrics:[...new Set(r.filter(a=>!n.nodeMetrics.has(a)))],edgeMetrics:t.edgeMetric&&!n.edgeMetrics.has(t.edgeMetric)?[t.edgeMetric]:[]}}hasMissingMetrics(t){return t.nodeMetrics.length>0||t.edgeMetrics.length>0}buildOrderedStatePatches(t,i,n){let r=this.getApplicableKeys(t,i,n);return[this.mergePatchesOf(t,r.filter(em)),this.mergePatchesOf(t,r.filter(a=>!em(a)))].filter(a=>Object.keys(a).length>0)}getCameraVectors(t){if(!t.camera)return;let{position:i,target:n}=t.camera;return{position:new Ke(i.x,i.y,i.z),target:new Ke(n.x,n.y,n.z)}}async applyScenario(t,i,n){bd(!0);try{let r=i.has("camera")?this.getCameraVectors(t.settings):void 0,a=r!==void 0,s=this.buildOrderedStatePatches(t.settings,i,n),l=a&&s.length>0?this.scenariosStore.getValue().preferences.resetCameraIfNewFileIsLoaded:void 0;l&&s.length>0&&(s[0].preferences=et(ke({},s[0].preferences),{resetCameraIfNewFileIsLoaded:!1}));for(let d of s)this.scenariosStore.setStatePatch(d),await new Promise(c=>setTimeout(c));if(a&&this.threeCameraService.camera){let{position:d,target:c}=r;this.threeCameraService.camera.position.set(d.x,d.y,d.z),this.threeMapControlsService.setControlTarget(c),this.threeCameraService.camera.lookAt(c),this.threeCameraService.camera.updateProjectionMatrix(),this.threeMapControlsService.updateControls()}l&&setTimeout(()=>{this.scenariosStore.setStatePatch({preferences:{resetCameraIfNewFileIsLoaded:!0}})}),this.threeRendererService.render()}finally{bd(!1)}}getApplicableKeys(t,i,n){let r=n?this.getAvailableMetricNames(n):void 0;return[...i].filter(a=>t[a]!==void 0&&Rt[a].patch!==void 0&&this.isMetricAvailable(a,t,r))}isMetricAvailable(t,i,n){if(!n||!Jh(t))return!0;let r=i[t]??"";return t==="edgeMetric"?r===""||n.edgeMetrics.has(r):n.nodeMetrics.has(r)}mergePatchesOf(t,i){let n={};for(let r of i){let a=Rt[r].patch;a&&(n=dv(n,a(t)))}return n}static{this.\u0275fac=function(i){return new(i||e)(E(gc),E(ar),E(qt),E(kt))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function dv(e,o){let t=ke({},e);for(let[i,n]of Object.entries(o)){let r=t[i];t[i]=cv(n)&&cv(r)?dv(ke({},r),n):n}return t}function cv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Q8=["dialog"];function Z8(e,o){if(e&1&&(x(0,"div",4)(1,"span",13),V(2,"i",14),x(3,"span",15),g(4),v()()()),e&2){let t=B();h(),F("title",t.scenario().mapFileNames.join(", ")),h(3),Te(t.scenario().mapFileNames.join(", "))}}function Y8(e,o){if(e&1&&(x(0,"li"),g(1),v()),e&2){let t=o.$implicit;h(),ge("",t," (node metric)")}}function J8(e,o){if(e&1&&(x(0,"li"),g(1),v()),e&2){let t=o.$implicit;h(),ge("",t," (edge metric)")}}function e7(e,o){if(e&1&&(x(0,"div",7),V(1,"i",16),x(2,"div")(3,"strong"),g(4,"Some metrics are not available in the current map and will not be applied:"),v(),x(5,"ul",17),Pe(6,Y8,2,1,"li",null,ii),Pe(8,J8,2,1,"li",null,ii),v()()()),e&2){let t=B();h(6),Be(t.missingMetrics().nodeMetrics),h(2),Be(t.missingMetrics().edgeMetrics)}}var im=(()=>{class e{constructor(t){this.scenarioApplier=t,this.scenario=Z.required(),this.metricData=Z.required(),this.closed=_e(),this.dialogElement=Je.required("dialog"),this.availableKeys=Y(()=>tm(this.scenario())),this.defaultKeys=Y(()=>this.availableKeys().filter(i=>Rt[i].group!=="camera")),this.selectedKeys=Su(()=>new Set(this.defaultKeys())),this.missingMetrics=Y(()=>this.scenarioApplier.getMissingMetrics(tv(this.scenario().settings,this.selectedKeys()),this.metricData())),this.hasMissing=Y(()=>this.scenarioApplier.hasMissingMetrics(this.missingMetrics())),this.hasAnySelected=Y(()=>this.selectedKeys().size>0),this.applySelectedLabel=Y(()=>`Apply ${fc(this.selectedKeys().size)}`),this.destroyRef=T(Tn)}ngAfterViewInit(){let t=this.dialogElement().nativeElement,i=()=>this.closed.emit();t.addEventListener("close",i),this.destroyRef.onDestroy(()=>t.removeEventListener("close",i)),t.showModal()}async apply(){await this.applyKeys(this.selectedKeys())}async applyAll(){await this.applyKeys(new Set(this.availableKeys()))}async applyKeys(t){this.dialogElement().nativeElement.close(),await this.scenarioApplier.applyScenario(this.scenario(),t,this.metricData())}close(){this.dialogElement().nativeElement.close()}static{this.\u0275fac=function(i){return new(i||e)(ne(bc))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-apply-scenario-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,Q8,5),i&2&&at()},inputs:{scenario:[1,"scenario"],metricData:[1,"metricData"]},outputs:{closed:"closed"},decls:20,vars:9,consts:[["dialog",""],["aria-labelledby","apply-scenario-title",1,"modal"],[1,"modal-box","max-w-md"],["id","apply-scenario-title",1,"text-xl","font-bold","mb-1","truncate",3,"title"],[1,"mb-3"],[1,"text-sm","text-base-content/60","mb-3"],[3,"selectedKeysChange","availableKeys","defaultKeys","selectedKeys"],[1,"alert","alert-warning","mt-4","text-sm"],[1,"modal-action"],[1,"btn",3,"click"],["title","Apply everything this scenario holds, the camera included","data-testid","apply-scenario-all",1,"btn","btn-outline",3,"click"],["data-testid","apply-scenario-selected",1,"btn","btn-primary",3,"click","disabled"],["method","dialog",1,"modal-backdrop"],[1,"badge","badge-sm","badge-outline","gap-1","max-w-full","overflow-hidden",3,"title"],[1,"fa","fa-map-pin","text-[9px]","shrink-0"],[1,"truncate"],[1,"fa","fa-exclamation-triangle"],[1,"list-disc","pl-5","mt-1"]],template:function(i,n){if(i&1){let r=we();x(0,"dialog",1,0)(2,"div",2)(3,"h2",3),g(4),v(),K(5,Z8,5,2,"div",4),x(6,"p",5),g(7,"Select which settings to apply:"),v(),x(8,"cc-scenario-settings-picker",6),Xa("selectedKeysChange",function(s){return ae(r),Ga(n.selectedKeys,s)||(n.selectedKeys=s),se(s)}),v(),K(9,e7,10,0,"div",7),x(10,"div",8)(11,"button",9),z("click",function(){return n.close()}),g(12,"Cancel"),v(),x(13,"button",10),z("click",function(){return n.applyAll()}),g(14," Apply all "),v(),x(15,"button",11),z("click",function(){return n.apply()}),g(16),v()()(),x(17,"form",12)(18,"button"),g(19,"close"),v()()()}i&2&&(h(3),F("title","Apply: "+n.scenario().name),h(),ge("Apply: ",n.scenario().name),h(),Q(n.scenario().mapFileNames?.length?5:-1),h(3),F("availableKeys",n.availableKeys())("defaultKeys",n.defaultKeys()),Ua("selectedKeys",n.selectedKeys),h(),Q(n.hasMissing()?9:-1),h(6),F("disabled",!n.hasAnySelected()),h(),ge(" ",n.applySelectedLabel()," "))},dependencies:[mr,hr,cr,dr,pc],encapsulation:2})}}return e})();function uv(e){return e.settings?t7(e.settings):o7(e.sections??{})}function t7(e){let o=e;if(!o.blacklist)return e;let n=o,{blacklist:t}=n,i=qn(n,["blacklist"]);return gv(et(ke({},i),{excludedNodes:t.filter(r=>r.type!=="flatten").map(({path:r})=>({path:r})),flattenedNodes:t.filter(r=>r.type==="flatten").map(({path:r})=>({path:r}))}))}function pv(e){let i=e,{sections:o}=i,t=qn(i,["sections"]);return et(ke({},t),{settings:uv(e)})}var i7=new Set([1,2,uc]);function fv(e){let o=e;if(!(!o?.name||!i7.has(o.schemaVersion))&&!(!o.sections&&!o.settings))return{schemaVersion:uc,name:o.name,description:o.description,mapFileNames:o.mapFileNames,settings:uv(o)}}function o7(e){let{metrics:o,colors:t,camera:i,filters:n,labelsAndFolders:r}=e,c=t?.mapColors??{},{outgoingEdge:a,incomingEdge:s}=c,l=qn(c,["outgoingEdge","incomingEdge"]),d=a!==void 0||s!==void 0;return gv({areaMetric:o?.areaMetric,enableFloorLabels:r?.enableFloorLabels,heightMetric:o?.heightMetric,colorMetric:o?.colorMetric,isColorMetricLinkedToHeightMetric:o?.isColorMetricLinkedToHeightMetric,colorRange:t?.colorRange,colorMode:t?.colorMode,mapColors:Object.keys(l).length>0?l:void 0,markedPackages:r?.markedPackages,edgeMetric:o?.edgeMetric,edgeColors:d?{outgoingEdge:a,incomingEdge:s}:void 0,amountOfTopLabels:r?.amountOfTopLabels,labelSize:r?.labelSize,labelMode:r?.labelMode,showMetricLabelNodeName:r?.showMetricLabelNodeName,showMetricLabelNameValue:r?.showMetricLabelNameValue,groupLabelCollisions:r?.groupLabelCollisions,colorLabels:r?.colorLabels,camera:i,excludedNodes:n?.blacklist?.filter(m=>m.type!=="flatten"),flattenedNodes:n?.blacklist?.filter(m=>m.type==="flatten"),focusedNodePath:n?.focusedNodePath})}function gv(e){return Object.fromEntries(Object.entries(e).filter(([,o])=>o!==void 0))}var vc=(()=>{class e{async readAll(){return(await(await Gr()).getAll(Ur)).map(pv)}async add(t){let n=(await Gr()).transaction(Ur,"readwrite");await Promise.all([n.store.add(t),n.done])}async update(t){let n=(await Gr()).transaction(Ur,"readwrite");await Promise.all([n.store.put(t),n.done])}async delete(t){let n=(await Gr()).transaction(Ur,"readwrite");await Promise.all([n.store.delete(t),n.done])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var vv={position:{x:0,y:300,z:1e3},target:{x:0,y:0,z:0}},xc={positive:"#69AE40",neutral:"#ddcc00",negative:"#820E0E"},n7={positive:xc.negative,neutral:xc.neutral,negative:xc.positive,isColorRangeInverted:!0},r7=[{id:"built-in-rloc",name:"Real Lines of Code",description:"Visualize code size using real lines of code",metric:"rloc",colorRange:{from:250,to:500}},{id:"built-in-complexity",name:"Complexity",description:"Visualize cyclomatic complexity",metric:"complexity",colorRange:{from:50,to:100}},{id:"built-in-comment-lines",name:"Comment Lines",description:"Visualize comment density",metric:"comment_lines",colorRange:{from:50,to:100}},{id:"built-in-code-smells",name:"Code Smells",description:"Visualize code smell density",metric:"sonar_code_smells",colorRange:{from:10,to:50}},{id:"built-in-logic-complexity",name:"Logic Complexity",description:"Visualize cognitive/logic complexity",metric:"logic_complexity",colorRange:{from:40,to:80}},{id:"built-in-max-complexity-per-function",name:"Max Complexity per Function",description:"Visualize maximum complexity per function",metric:"max_complexity_per_function",colorRange:{from:10,to:20}},{id:"built-in-authors",name:"Authors",description:"Visualize the number of authors per file",metric:"number_of_authors",colorRange:{from:2,to:3},colorMode:Go.absolute,mapColors:n7}],xv=r7.map(e=>({id:e.id,name:e.name,description:e.description,createdAt:0,isBuiltIn:!0,settings:{areaMetric:"rloc",heightMetric:e.metric,colorMetric:e.metric,isColorMetricLinkedToHeightMetric:!0,colorRange:e.colorRange,colorMode:e.colorMode??Go.weightedGradient,mapColors:e.mapColors??xc}})),ji=(()=>{class e{constructor(t,i,n,r){this.scenariosStore=t,this.threeCameraService=i,this.threeMapControlsService=n,this.db=r,this.scenarios$=new tu([])}async loadScenarios(){try{let t=await this.db.readAll();t.sort((i,n)=>n.createdAt-i.createdAt),this.scenarios$.next([...t,...xv])}catch(t){console.error("Failed to load scenarios from IndexedDB:",t),this.scenarios$.next([...xv])}}async saveScenario(t){let i=this.buildScenario(t,this.readCurrentSource());try{await this.db.add(i),await this.loadScenarios()}catch(n){console.error("Failed to save scenario:",n)}return i}async removeScenario(t){try{await this.db.delete(t),await this.loadScenarios()}catch(i){console.error("Failed to remove scenario:",i)}}buildScenario(t,i){return{id:crypto.randomUUID(),name:t.name,description:t.description,mapFileNames:t.mapFileNames,createdAt:Date.now(),settings:iv(i,t.selectedKeys)}}readCurrentSource(){return{state:this.scenariosStore.getValue(),camera:this.readCurrentCamera()}}readCurrentCamera(){let t=this.threeCameraService.camera?.position,i=this.threeMapControlsService.controls?.target;return{position:t?{x:t.x,y:t.y,z:t.z}:vv.position,target:i?{x:i.x,y:i.y,z:i.z}:vv.target}}static{this.\u0275fac=function(i){return new(i||e)(E(gc),E(ar),E(qt),E(vc))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var a7=["dialog"];function s7(e,o){e&1&&(x(0,"span",8),g(1,"A name is required."),v())}var nm=wn.filter(e=>Rt[e].group!=="camera"),rm=(()=>{class e{constructor(t,i){this.scenariosService=t,this.fileStoreReadWindow=i,this.dialogElement=Je.required("dialog"),this.name=Se(""),this.description=Se(""),this.bindToMap=Se(!1),this.nameValid=Y(()=>this.name().trim().length>0),this.availableKeys=wn,this.defaultKeys=nm,this.selectedKeys=Se(new Set(nm)),this.selectionSummary=Y(()=>`${this.selectedKeys().size} of ${this.availableKeys.length} settings`),this.saveLabel=Y(()=>`Save ${fc(this.selectedKeys().size)}`),this.visibleFileNames=D(this.fileStoreReadWindow.files$.pipe(qe(n=>Pn(n).map(r=>r.fileMeta.fileName))),{initialValue:[]}),this.hasFiles=Y(()=>this.visibleFileNames().length>0)}open(){this.name.set(""),this.description.set(""),this.bindToMap.set(!1),this.selectedKeys.set(new Set(nm)),this.dialogElement().nativeElement.showModal()}close(){this.dialogElement().nativeElement.close()}async save(){if(!this.nameValid()||this.selectedKeys().size===0)return;let t=this.bindToMap()&&this.hasFiles()?this.visibleFileNames():void 0;await this.scenariosService.saveScenario({name:this.name(),description:this.description()||void 0,mapFileNames:t,selectedKeys:this.selectedKeys()}),this.close()}static{this.\u0275fac=function(i){return new(i||e)(ne(ji),ne(Re))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-save-scenario-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,a7,5),i&2&&at()},decls:38,vars:13,consts:[["dialog",""],["aria-labelledby","save-scenario-title",1,"modal"],[1,"modal-box","max-w-md"],["id","save-scenario-title",1,"text-xl","font-bold","mb-4"],[1,"form-control","mb-4"],["for","scenario-name",1,"label"],[1,"label-text"],["id","scenario-name","placeholder","Enter scenario name",1,"input","input-bordered","w-full",3,"ngModelChange","ngModel"],[1,"label-text-alt","text-error"],["for","scenario-description",1,"label"],["id","scenario-description","rows","3","placeholder","Describe what this scenario captures",1,"textarea","textarea-bordered","w-full",3,"ngModelChange","ngModel"],[1,"label","cursor-pointer","justify-start","gap-3"],["type","checkbox",1,"checkbox","checkbox-sm",3,"ngModelChange","ngModel","disabled"],[1,"mb-4","rounded-md","border","border-base-300","p-2"],["data-testid","save-scenario-extended-settings",1,"cursor-pointer","text-sm"],[1,"text-xs","opacity-60"],[1,"m-0","mt-2","text-xs","opacity-60"],[1,"mt-2"],[3,"selectedKeysChange","availableKeys","defaultKeys","selectedKeys"],[1,"modal-action"],[1,"btn",3,"click"],["data-testid","save-scenario-submit",1,"btn","btn-primary",3,"click","disabled"],["method","dialog",1,"modal-backdrop"],[3,"click"]],template:function(i,n){if(i&1){let r=we();x(0,"dialog",1,0)(2,"div",2)(3,"h2",3),g(4,"Save Scenario"),v(),x(5,"div",4)(6,"label",5)(7,"span",6),g(8,"Scenario Name"),v()(),x(9,"input",7),z("ngModelChange",function(s){return n.name.set(s)}),v(),In(),K(10,s7,2,0,"span",8),v(),x(11,"div",4)(12,"label",9)(13,"span",6),g(14,"Description (optional)"),v()(),x(15,"textarea",10),z("ngModelChange",function(s){return n.description.set(s)}),v(),In(),v(),x(16,"div",4)(17,"label",11)(18,"input",12),z("ngModelChange",function(s){return n.bindToMap.set(s)}),v(),In(),x(19,"span",6),g(20," Bind to current maps "),v()()(),x(21,"details",13)(22,"summary",14),g(23," Extended settings "),x(24,"span",15),g(25),v()(),x(26,"p",16),g(27,"Uncheck what this scenario should not carry."),v(),x(28,"div",17)(29,"cc-scenario-settings-picker",18),Xa("selectedKeysChange",function(s){return ae(r),Ga(n.selectedKeys,s)||(n.selectedKeys=s),se(s)}),v()()(),x(30,"div",19)(31,"button",20),z("click",function(){return n.close()}),g(32,"Cancel"),v(),x(33,"button",21),z("click",function(){return n.save()}),g(34),v()()(),x(35,"form",22)(36,"button",23),z("click",function(){return n.close()}),g(37,"close"),v()()()}i&2&&(h(9),F("ngModel",n.name()),An(),h(),Q(!n.nameValid()&&n.name().length>0?10:-1),h(5),F("ngModel",n.description()),An(),h(2),We("opacity-40",!n.hasFiles()),h(),F("ngModel",n.bindToMap())("disabled",!n.hasFiles()),An(),h(7),ge("(",n.selectionSummary(),")"),h(4),F("availableKeys",n.availableKeys)("defaultKeys",n.defaultKeys),Ua("selectedKeys",n.selectedKeys),h(4),F("disabled",!n.nameValid()||n.selectedKeys().size===0),h(),ge(" ",n.saveLabel()," "))},dependencies:[mr,hr,Os,Nf,zs,cr,$s,dr,pc],encapsulation:2})}}return e})();var l7=["dialog"],wc=(()=>{class e{constructor(){this.scenarioName=Z.required(),this.confirmed=_e(),this.cancelled=_e(),this.dialogElement=Je.required("dialog")}open(){this.dialogElement().nativeElement.showModal()}close(){this.dialogElement().nativeElement.close()}confirm(){this.close(),this.confirmed.emit()}cancel(){this.close(),this.cancelled.emit()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-delete-confirm-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,l7,5),i&2&&at()},inputs:{scenarioName:[1,"scenarioName"]},outputs:{confirmed:"confirmed",cancelled:"cancelled"},decls:15,vars:1,consts:[["dialog",""],["aria-labelledby","delete-confirm-title",1,"modal"],[1,"modal-box","max-w-sm"],["id","delete-confirm-title",1,"text-lg","font-bold","mb-2"],[1,"modal-action"],[1,"btn",3,"click"],[1,"btn","btn-error",3,"click"],["method","dialog",1,"modal-backdrop"],[3,"click"]],template:function(i,n){i&1&&(y(0,"dialog",1,0)(2,"div",2)(3,"h3",3),g(4,"Delete Scenario"),M(),y(5,"p"),g(6),M(),y(7,"div",4)(8,"button",5),ie("click",function(){return n.cancel()}),g(9,"Cancel"),M(),y(10,"button",6),ie("click",function(){return n.confirm()}),g(11,"Delete"),M()()(),y(12,"form",7)(13,"button",8),ie("click",function(){return n.cancel()}),g(14,"close"),M()()()),i&2&&(h(6),ge('Are you sure you want to delete "',n.scenarioName(),'"?'))},encapsulation:2})}}return e})();var c7=["dialog"];function d7(e,o){if(e&1&&(y(0,"li"),g(1),M()),e&2){let t=o.$implicit;h(),Te(t)}}function h7(e,o){if(e&1&&(y(0,"div",5)(1,"div"),pe(2,"i",11),y(3,"strong"),g(4,"Already existing:"),M(),y(5,"ul",12),Pe(6,d7,2,1,"li",null,ii),M()()()),e&2){let t=B();h(6),Be(t.feedback().duplicates)}}function m7(e,o){if(e&1&&(y(0,"li"),g(1),M()),e&2){let t=o.$implicit;h(),Te(t)}}function u7(e,o){if(e&1&&(y(0,"div",6)(1,"div"),pe(2,"i",13),y(3,"strong"),g(4,"Invalid scenario files:"),M(),y(5,"ul",12),Pe(6,m7,2,1,"li",null,ii),M()()()),e&2){let t=B();h(6),Be(t.feedback().invalid)}}function p7(e,o){if(e&1&&(y(0,"li"),g(1),M()),e&2){let t=o.$implicit;h(),Te(t)}}function f7(e,o){if(e&1&&(y(0,"div",6)(1,"div"),pe(2,"i",13),y(3,"strong"),g(4,"Could not read (bad format):"),M(),y(5,"ul",12),Pe(6,p7,2,1,"li",null,ii),M()()()),e&2){let t=B();h(6),Be(t.feedback().parseErrors)}}var Sc=(()=>{class e{constructor(){this.closed=_e(),this.dialogElement=Je.required("dialog"),this.feedback=Se({duplicates:[],invalid:[],parseErrors:[]})}open(t){let{duplicates:i,invalid:n,parseErrors:r}=t;(i.length>0||n.length>0||r.length>0)&&(this.feedback.set({duplicates:i,invalid:n,parseErrors:r}),this.dialogElement().nativeElement.showModal())}close(){this.dialogElement().nativeElement.close(),this.feedback.set({duplicates:[],invalid:[],parseErrors:[]}),this.closed.emit()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-import-feedback-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,c7,5),i&2&&at()},outputs:{closed:"closed"},decls:15,vars:3,consts:[["dialog",""],["aria-labelledby","import-feedback-title",1,"modal"],[1,"modal-box","max-w-lg"],["id","import-feedback-title",1,"text-lg","font-bold","mb-2"],[1,"flex","flex-col","gap-2"],[1,"alert","alert-warning","text-sm"],[1,"alert","alert-error","text-sm"],[1,"modal-action"],[1,"btn",3,"click"],["method","dialog",1,"modal-backdrop"],[3,"click"],[1,"fa","fa-exclamation-triangle","mr-1"],[1,"list-disc","list-inside","ml-1"],[1,"fa","fa-exclamation-circle","mr-1"]],template:function(i,n){i&1&&(y(0,"dialog",1,0)(2,"div",2)(3,"h3",3),g(4,"Import Results"),M(),y(5,"div",4),K(6,h7,8,0,"div",5),K(7,u7,8,0,"div",6),K(8,f7,8,0,"div",6),M(),y(9,"div",7)(10,"button",8),ie("click",function(){return n.close()}),g(11,"OK"),M()()(),y(12,"form",9)(13,"button",10),ie("click",function(){return n.close()}),g(14,"close"),M()()()),i&2&&(h(6),Q(n.feedback().duplicates.length?6:-1),h(),Q(n.feedback().invalid.length?7:-1),h(),Q(n.feedback().parseErrors.length?8:-1))},encapsulation:2})}}return e})();function g7(e,o){if(e&1){let t=we();y(0,"button",0),ie("click",function(n){return ae(t),B().exportRequested.emit(),se(n.stopPropagation())}),pe(1,"i",1),M(),y(2,"button",2),ie("click",function(n){return ae(t),B().deleteRequested.emit(),se(n.stopPropagation())}),pe(3,"i",3),M()}}var wv=(()=>{class e{constructor(){this.isBuiltIn=Z.required(),this.exportRequested=_e(),this.deleteRequested=_e()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-scenario-item-actions"]],inputs:{isBuiltIn:[1,"isBuiltIn"]},outputs:{exportRequested:"exportRequested",deleteRequested:"deleteRequested"},decls:1,vars:1,consts:[["title","Export scenario",1,"btn","btn-ghost","btn-sm",3,"click"],[1,"fa","fa-download"],["title","Delete scenario",1,"btn","btn-ghost","btn-sm",3,"click"],[1,"fa","fa-trash"]],template:function(i,n){i&1&&K(0,g7,4,0),i&2&&Q(n.isBuiltIn()?-1:0)},encapsulation:2})}}return e})();function b7(e,o){e&1&&(y(0,"span",1),g(1,"Built-in"),M())}function v7(e,o){if(e&1&&(y(0,"span",2),g(1),M()),e&2){let t=B();h(),Te(t.view().formattedDate)}}function x7(e,o){if(e&1&&(y(0,"span",3),pe(1,"i",6),y(2,"span",7),g(3),M()()),e&2){let t=B();ce("title","Bound to "+t.view().scenario.mapFileNames.join(", ")),h(3),Te(t.view().scenario.mapFileNames.join(", "))}}function w7(e,o){if(e&1&&pe(0,"i",8),e&2){let t=o.$implicit,i=B();Dt(Dn("fa ",i.groupIcons[t])),ce("title",i.groupLabels[t])}}var Sv=(()=>{class e{constructor(){this.view=Z.required(),this.groupLabels=ya,this.groupIcons=hc}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-scenario-item-badges"]],hostAttrs:[1,"block","overflow-hidden"],inputs:{view:[1,"view"]},decls:7,vars:2,consts:[[1,"flex","items-center","gap-3","mt-1","min-w-0"],[1,"badge","badge-xs","badge-info"],[1,"text-[11px]","text-base-content/40"],[1,"badge","badge-xs","badge-outline","gap-1","max-w-full","overflow-hidden",3,"title"],[1,"flex","gap-1.5","text-[11px]","text-base-content/40"],[3,"class","title"],[1,"fa","fa-map-pin","text-[9px]","shrink-0"],[1,"truncate"],[3,"title"]],template:function(i,n){i&1&&(y(0,"div",0),K(1,b7,2,0,"span",1)(2,v7,2,1,"span",2),K(3,x7,4,2,"span",3),y(4,"span",4),Pe(5,w7,1,4,"i",5,ii),M()()),i&2&&(h(),Q(n.view().scenario.isBuiltIn?1:2),h(2),Q(n.view().mapBound?3:-1),h(2),Be(n.view().groupKeys))},encapsulation:2})}}return e})();function S7(e,o){e&1&&(x(0,"span",3),V(1,"i",7),v())}function y7(e,o){if(e&1&&(x(0,"div",4),g(1),v()),e&2){let t=B();h(),Te(t.view().scenario.description)}}var yv=(()=>{class e{constructor(){this.view=Z.required(),this.applyRequested=_e(),this.exportRequested=_e(),this.deleteRequested=_e()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-scenario-item"]],inputs:{view:[1,"view"]},outputs:{applyRequested:"applyRequested",exportRequested:"exportRequested",deleteRequested:"deleteRequested"},decls:8,vars:8,consts:[["type","button",1,"flex","items-center","w-full","px-4","py-2","border-t","border-base-300","hover:bg-base-200","cursor-pointer","bg-transparent","text-left",3,"click"],[1,"flex-1","min-w-0"],[1,"font-medium","text-sm","truncate",3,"title"],["title","Some metrics in this scenario are not available",1,"text-warning","ml-1"],[1,"text-xs","text-base-content/50","truncate"],[3,"view"],[3,"exportRequested","deleteRequested","isBuiltIn"],[1,"fa","fa-exclamation-triangle","text-xs"]],template:function(i,n){i&1&&(x(0,"button",0),z("click",function(){return n.applyRequested.emit()}),x(1,"div",1)(2,"div",2),g(3),K(4,S7,2,0,"span",3),v(),K(5,y7,2,1,"div",4),V(6,"cc-scenario-item-badges",5),v(),x(7,"cc-scenario-item-actions",6),z("exportRequested",function(){return n.exportRequested.emit()})("deleteRequested",function(){return n.deleteRequested.emit()}),v()()),i&2&&(h(),We("opacity-40",n.view().mapMismatch),h(),F("title",n.view().scenario.name),h(),ge(" ",n.view().scenario.name," "),h(),Q(n.view().warning?4:-1),h(),Q(n.view().scenario.description?5:-1),h(),F("view",n.view()),h(),F("isBuiltIn",!!n.view().scenario.isBuiltIn))},dependencies:[Sv,wv],encapsulation:2})}}return e})();var Fr=class{static downloadData(o,t){let i=new Blob([o],{type:"text/json"}),n=document.createElement("a");n.download=t,n.href=window.URL.createObjectURL(i),n.dataset.downloadurl=["text/json",n.download,n.href].join(":"),n.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!1,view:window}))}};var Cv=(()=>{class e{constructor(t,i){this.scenariosService=t,this.db=i}exportScenario(t){let i=nv(t),n=t.name.replaceAll(/[^\w-]/g,"_");Fr.downloadData(JSON.stringify(i,null,2),n+mc)}async importScenarioFiles(t){let i=this.scenariosService.scenarios$.getValue(),n={imported:0,duplicates:[],invalid:[],parseErrors:[]};for(let r of t){let a;try{let l=await r.text();a=fv(JSON.parse(l))}catch{n.parseErrors.push(r.name);continue}if(!a){n.invalid.push(r.name);continue}if(this.isDuplicate(a,i)){n.duplicates.push(a.name);continue}let s=rv(a);i.push(s),await this.db.add(s),n.imported++}return n.imported>0&&await this.scenariosService.loadScenarios(),n}isDuplicate(t,i){return i.some(n=>n.name===t.name&&rp(n.settings,t.settings))}static{this.\u0275fac=function(i){return new(i||e)(E(ji),E(vc))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Mv=(()=>{class e{constructor(t){this.store=t,this.metricData$=this.store.select(er)}static{this.\u0275fac=function(i){return new(i||e)(E(he))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var _7=[{priority:0,label:"Current Map",icon:"fa-map-pin"},{priority:1,label:"Global",icon:"fa-globe"},{priority:2,label:"Built-in",icon:"fa-cube"},{priority:3,label:"Other Maps",icon:"fa-map-o"}],_v=(()=>{class e{constructor(t){this.scenarioApplier=t}groupScenarios(t,i){let n=new Map;for(let r of t){let a=this.getScenarioPriority(r,i),s=n.get(a);s?s.push(r):n.set(a,[r])}return _7.filter(r=>n.has(r.priority)).map(r=>({label:r.label,icon:r.icon,scenarios:n.get(r.priority)??[]}))}toScenarioView(t,i,n){let r=(t.mapFileNames?.length??0)>0,a=r&&!t.mapFileNames.some(l=>i.has(l)),s=this.scenarioApplier.hasMissingMetrics(this.scenarioApplier.getMissingMetrics(t.settings,n));return{scenario:t,warning:s,mapMismatch:a,mapBound:r,groupKeys:ov(t),formattedDate:new Date(t.createdAt).toLocaleDateString()}}getScenarioPriority(t,i){let n=(t.mapFileNames?.length??0)>0;return n&&t.mapFileNames?.some(r=>i.has(r))?0:!n&&!t.isBuiltIn?1:t.isBuiltIn?2:3}static{this.\u0275fac=function(i){return new(i||e)(E(bc))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var k7=["dialog"],q7=["fileInput"],T7=(e,o)=>o.label,R7=(e,o)=>o.scenario.id;function I7(e,o){e&1&&(x(0,"p",13),g(1,"No scenarios found."),v())}function A7(e,o){if(e&1){let t=we();x(0,"cc-scenario-item",25),z("applyRequested",function(){let n=ae(t).$implicit,r=B(2);return se(r.applyScenario(n.scenario))})("exportRequested",function(){let n=ae(t).$implicit,r=B(2);return se(r.exportScenario(n.scenario))})("deleteRequested",function(){let n=ae(t).$implicit,r=B(2);return se(r.requestDelete(n.scenario))}),v()}if(e&2){let t=o.$implicit;F("view",t)}}function D7(e,o){if(e&1&&(x(0,"div",19),V(1,"input",20),x(2,"div",21),V(3,"i"),g(4),x(5,"span",22),g(6),v()(),x(7,"div",23),Pe(8,A7,1,1,"cc-scenario-item",24,R7),v()()),e&2){let t=o.$implicit,i=o.$index;We("mt-1",i!==0),h(),F("checked",i===0),ot("aria-label",t.label),h(2),Dt(Dn("fa ",t.icon," mr-2")),h(),ge(" ",t.label," "),h(2),Te(t.scenarios.length),h(2),Be(t.scenarios)}}var am=(()=>{class e{constructor(t,i,n,r,a){this.scenariosService=t,this.importExportService=i,this.scenarioDialogStore=n,this.fileStoreReadWindow=r,this.helpers=a,this.dialogElement=Je.required("dialog"),this.deleteConfirmDialogRef=Je.required(wc),this.importFeedbackDialogRef=Je.required(Sc),this.fileInput=Je.required("fileInput"),this.applyRequested=_e(),this.deleteTarget=Se(null),this.acceptExtensions=`${mc},.json`,this.scenarios=D(this.scenariosService.scenarios$,{initialValue:[]}),this.metricData=D(this.scenarioDialogStore.metricData$,{requireSync:!0}),this.searchTerm=Se(""),this.visibleFileNames=D(this.fileStoreReadWindow.files$.pipe(qe(s=>new Set(Pn(s).map(l=>l.fileMeta.fileName)))),{initialValue:new Set}),this.filteredScenarios=Y(()=>{let s=this.searchTerm().toLowerCase(),l=this.scenarios(),d=this.visibleFileNames();return(s?l.filter(m=>m.name.toLowerCase().includes(s)||m.description?.toLowerCase().includes(s)):[...l]).sort((m,u)=>this.helpers.getScenarioPriority(m,d)-this.helpers.getScenarioPriority(u,d))}),this.groupedScenarios=Y(()=>{let s=this.visibleFileNames(),l=this.metricData();return this.helpers.groupScenarios(this.filteredScenarios(),s).map(c=>et(ke({},c),{scenarios:c.scenarios.map(m=>this.helpers.toScenarioView(m,s,l))}))})}async open(){await this.scenariosService.loadScenarios(),this.dialogElement().nativeElement.showModal()}close(){this.dialogElement().nativeElement.close()}applyScenario(t){this.close(),this.applyRequested.emit({scenario:t,metricData:this.metricData()})}exportScenario(t){this.importExportService.exportScenario(t)}openImportDialog(){this.fileInput().nativeElement.click()}async handleImportFiles(t){let i=t.target;if(!i.files||i.files.length===0)return;let n=await this.importExportService.importScenarioFiles(i.files);i.value="",this.importFeedbackDialogRef().open(n)}requestDelete(t){this.deleteTarget.set(t),this.deleteConfirmDialogRef().open()}cancelDelete(){this.deleteTarget.set(null)}async confirmDelete(){let t=this.deleteTarget();t&&(this.deleteTarget.set(null),await this.scenariosService.removeScenario(t.id))}static{this.\u0275fac=function(i){return new(i||e)(ne(ji),ne(Cv),ne(Mv),ne(Re),ne(_v))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-scenario-list-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,k7,5)(n.deleteConfirmDialogRef,wc,5)(n.importFeedbackDialogRef,Sc,5)(n.fileInput,q7,5),i&2&&at(4)},outputs:{applyRequested:"applyRequested"},decls:23,vars:4,consts:[["dialog",""],["fileInput",""],["aria-labelledby","scenario-list-title",1,"modal"],[1,"modal-box","max-w-xl"],[1,"flex","items-center","justify-between","mb-4"],["id","scenario-list-title",1,"text-xl","font-bold"],[1,"flex","items-center","gap-1"],["title","Import scenarios",1,"btn","btn-sm","btn-ghost",3,"click"],[1,"fa","fa-upload"],[1,"btn","btn-sm","btn-ghost",3,"click"],[1,"fa","fa-close"],["type","file","aria-label","Import scenarios","multiple","",1,"hidden",3,"change","accept"],["placeholder","Search scenarios...","aria-label","Search scenarios",1,"input","input-bordered","w-full","mb-4",3,"ngModelChange","ngModel"],[1,"text-center","py-8","text-base-content/50"],[1,"max-h-[60vh]","overflow-y-auto"],[1,"collapse","collapse-arrow","border","border-base-300",3,"mt-1"],["method","dialog",1,"modal-backdrop"],[3,"click"],[3,"confirmed","cancelled","scenarioName"],[1,"collapse","collapse-arrow","border","border-base-300"],["type","radio","name","scenario-accordion",3,"checked"],[1,"collapse-title","font-semibold","text-sm","bg-primary","text-primary-content"],[1,"badge","badge-sm","ml-2"],[1,"collapse-content","px-0"],[3,"view"],[3,"applyRequested","exportRequested","deleteRequested","view"]],template:function(i,n){i&1&&(x(0,"dialog",2,0)(2,"div",3)(3,"div",4)(4,"h2",5),g(5,"Scenarios"),v(),x(6,"div",6)(7,"button",7),z("click",function(){return n.openImportDialog()}),V(8,"i",8),v(),x(9,"button",9),z("click",function(){return n.close()}),V(10,"i",10),v()()(),x(11,"input",11,1),z("change",function(a){return n.handleImportFiles(a)}),v(),x(13,"input",12),z("ngModelChange",function(a){return n.searchTerm.set(a)}),v(),In(),K(14,I7,2,0,"p",13),x(15,"div",14),Pe(16,D7,10,9,"div",15,T7),v()(),x(18,"form",16)(19,"button",17),z("click",function(){return n.close()}),g(20,"close"),v()()(),x(21,"cc-delete-confirm-dialog",18),z("confirmed",function(){return n.confirmDelete()})("cancelled",function(){return n.cancelDelete()}),v(),V(22,"cc-import-feedback-dialog")),i&2&&(h(11),F("accept",n.acceptExtensions),h(2),F("ngModel",n.searchTerm()),An(),h(),Q(n.filteredScenarios().length===0?14:-1),h(2),Be(n.groupedScenarios()),h(5),F("scenarioName",n.deleteTarget()?.name??""))},dependencies:[mr,hr,Os,zs,cr,$s,dr,wc,Sc,yv],encapsulation:2})}}return e})();var F7=["listDialog"],L7=["saveDialog"];function N7(e,o){if(e&1){let t=we();x(0,"cc-apply-scenario-dialog",16),z("closed",function(){ae(t);let n=B();return se(n.handleApplyClosed())}),v()}if(e&2){let t=o;F("scenario",t.scenario)("metricData",t.metricData)}}var Ev=(()=>{class e{constructor(){this.scenariosService=T(ji),this.listDialog=Je.required("listDialog"),this.saveDialog=Je.required("saveDialog"),this.applyTarget=Se(null),this.scenarios=D(this.scenariosService.scenarios$,{initialValue:[]}),this.scenariosCountLabel=Y(()=>{let t=this.scenarios().length;return`${t} ${t===1?"scenario":"scenarios"} available`})}async ngOnInit(){await this.scenariosService.loadScenarios()}openScenarioList(){this.listDialog().open()}openSaveDialog(){this.saveDialog().open()}handleApplyRequested(t){this.applyTarget.set(t)}handleApplyClosed(){this.applyTarget.set(null)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-labels-scenarios-segment"]],viewQuery:function(i,n){i&1&&rt(n.listDialog,F7,5)(n.saveDialog,L7,5),i&2&&at(2)},hostAttrs:[1,"group","flex","flex-col","items-stretch","px-3","py-2","transition-colors","relative"],decls:23,vars:2,consts:[["listDialog",""],["saveDialog",""],[1,"flex","flex-col","items-stretch","gap-1.5","px-2","py-1","rounded-md","transition-colors","max-w-[220px]","min-w-[160px]"],["data-testid","metric-segment-labels",1,"flex","flex-col","gap-1"],[1,"flex","items-center","justify-between","gap-1"],[1,"text-[10px]","uppercase","tracking-wide","opacity-70"],["type","button","popovertarget","metric-settings-popover-labels","data-anchor-name","metric-segment-labels","title","Label Settings",1,"btn","btn-ghost","btn-xs","btn-square",2,"anchor-name","--metric-segment-labels"],[1,"fa","fa-cog","text-[10px]"],[1,"border-t","border-base-300","-mx-1"],["data-testid","metric-segment-scenario",1,"flex","flex-col","gap-1"],["type","button","title","Save current state as scenario","data-testid","metric-segment-scenario-save",1,"btn","btn-ghost","btn-xs","btn-square",3,"click"],[1,"fa","fa-plus","text-[10px]"],["type","button","title","Open saved scenarios",1,"text-sm","font-semibold","leading-tight","text-center","bg-transparent","border-0","p-0","rounded-sm","cursor-pointer","hover:bg-base-200","whitespace-nowrap","overflow-hidden","text-ellipsis",3,"click"],["popoverId","metric-settings-popover-labels","anchorName","metric-segment-labels","widthClass","w-80"],[3,"applyRequested"],[3,"scenario","metricData"],[3,"closed","scenario","metricData"]],template:function(i,n){if(i&1&&(x(0,"div",2)(1,"div",3)(2,"div",4)(3,"span",5),g(4,"Labels"),v(),x(5,"button",6),V(6,"i",7),v()()(),V(7,"div",8),x(8,"div",9)(9,"div",4)(10,"span",5),g(11,"Scenarios"),v(),x(12,"button",10),z("click",function(){return n.openSaveDialog()}),V(13,"i",11),v()(),x(14,"button",12),z("click",function(){return n.openScenarioList()}),g(15),v()()(),x(16,"cc-settings-popover-shell",13),V(17,"cc-label-settings-panel"),v(),x(18,"cc-scenario-list-dialog",14,0),z("applyRequested",function(a){return n.handleApplyRequested(a)}),v(),V(20,"cc-save-scenario-dialog",null,1),K(22,N7,1,2,"cc-apply-scenario-dialog",15)),i&2){let r;h(15),ge(" ",n.scenariosCountLabel()," "),h(7),Q((r=n.applyTarget())?22:-1,r)}},dependencies:[$d,am,rm,im,Ai],encapsulation:2})}}return e})();var kv=(()=>{class e{constructor(){this.preferencesReadWindow=T(sr),this.metricsBarWriteStore=T(Qe),this.isLinked=D(this.preferencesReadWindow.isColorMetricLinkedToHeightMetric$,{initialValue:!1}),this.iconClass=Y(()=>this.isLinked()?"fa fa-link":"fa fa-unlink"),this.title=Y(()=>this.isLinked()?"Unlink Height and Color Metric":"Link Height and Color Metric"),this.buttonClass=Y(()=>this.isLinked()?"btn btn-circle btn-sm ring-2 ring-primary text-primary bg-primary/10 border-0":"btn btn-circle btn-sm ring-1 ring-base-300 text-base-content/60 border-0 cc-link-button-dashed")}toggle(){this.metricsBarWriteStore.toggleIsHeightAndColorMetricLinked()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-link-color-height-button"]],hostAttrs:[1,"self-center","px-1"],decls:2,vars:8,consts:[["type","button",3,"click","title"]],template:function(i,n){i&1&&(y(0,"button",0),ie("click",function(){return n.toggle()}),pe(1,"i"),M()),i&2&&(Dt(n.buttonClass()),ce("title",n.title()),ot("aria-label",n.title())("data-testid","metric-link-button")("aria-pressed",n.isLinked()),h(),Dt(n.iconClass()))},encapsulation:2})}}return e})();function P7(e,o){e&1&&V(0,"cc-link-color-height-button")(1,"cc-color-segment")}function B7(e,o){if(e&1&&V(0,"cc-axis-card",0)(1,"cc-color-settings-popover",1),e&2){let t=B();F("metricName","Settings")("hasCog",!0)("cogPopoverId",t.deltaColorSettingsPopoverId)("cogAnchorName",t.deltaColorSettingsAnchorName)("testId","metric-segment-color-settings")("cogTestId","metric-segment-color-settings-cog"),h(),F("popoverId",t.deltaColorSettingsPopoverId)("anchorName",t.deltaColorSettingsAnchorName)}}function V7(e,o){e&1&&V(0,"cc-edge-segment")}var sm=(()=>{class e{constructor(){this.barBottom=Tf,this.fileStoreReadWindow=T(Re),this.metricsBarReadStore=T(ht),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.hasEdgeMetric=D(this.metricsBarReadStore.metricData$.pipe(qe(t=>t.edgeMetricData.length>0)),{initialValue:!1}),this.showColorMetricSegment=Y(()=>!this.isDeltaState()),this.deltaColorSettingsPopoverId="metric-settings-popover-color-delta",this.deltaColorSettingsAnchorName="metric-segment-color-settings"}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-metrics-bar"]],hostVars:2,hostBindings:function(i,n){i&2&&ze("bottom",n.barBottom)},features:[bi([{provide:fr,useValue:mf}]),Zi([Rf,gr])],decls:6,vars:2,consts:[["label","Color",3,"metricName","hasCog","cogPopoverId","cogAnchorName","testId","cogTestId"],[3,"popoverId","anchorName"]],template:function(i,n){i&1&&(V(0,"cc-area-segment")(1,"cc-height-segment"),K(2,P7,2,0)(3,B7,2,8),K(4,V7,1,0,"cc-edge-segment"),V(5,"cc-labels-scenarios-segment")),i&2&&(h(2),Q(n.showColorMetricSegment()?2:3),h(2),Q(n.hasEdgeMetric()?4:-1))},dependencies:[f2,_o,X3,cc,Y3,ev,Ev,kv],encapsulation:2})}}return e})();var lm=(()=>{class e extends $0{constructor(){super(...arguments),this.areaMetric=D(T(xe).areaMetric$,{requireSync:!0}),this.pathToNode=T(he).selectSignal(tf)}isEnabledFor(t){let i=this.pathToNode().get(t);return i!==void 0&&ts(i,this.areaMetric())}static{this.\u0275fac=(()=>{let t;return function(n){return(t||(t=hu(e)))(n||e)}})()}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var W7=(e,o,t,i)=>{let n=e.length>0?e.filter(d=>xi(d)):o,r=0,a=0,s=0,l=0;for(let d of n)i(d)&&r++,d.isExcluded&&a++,!i(d)&&!d.isExcluded&&(s++,ts(d,t)||l++);return{shown:s,flattened:r,excluded:a,noArea:l}},qv=Ae(af,Bi,yi,Ls,W7);var cm=(()=>{class e{constructor(){this.store=T(he),this.counts$=this.store.select(qv)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var Tv=Ae(Xp,e=>e?.map?Ji(e.map).descendants().map(({data:o})=>o).filter(o=>xi(o)):[]);var Ca=Ae(Tv,e=>{let o=new Map;for(let t of O7(e))o.set(t,e.map(i=>i.attributes?.[t]??0).filter(i=>typeof i=="number"&&!Number.isNaN(i)));return o});function O7(e){let o=new Set;for(let t of e)for(let i of Object.keys(t.attributes??{}))i!==zu&&o.add(i);return o}var dm=(()=>{class e{constructor(){this.store=T(he),this.metricValues$=this.store.select(Ca),this.descriptors$=this.store.select(Yn)}addRule(t){Wi(this.store,t.type,ws({rule:et(ke({},t),{id:z7()})}))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();function z7(){return`metric-rule-${crypto.randomUUID()}`}var hm=(()=>{class e{constructor(){this.mapStateReadWindow=T(xe),this.sharedViewReadWindow=T(Bt),this.store=T(he),this.idToBuildingService=T(nr),this.areaMetric=D(this.mapStateReadWindow.areaMetric$,{requireSync:!0}),this.buildingIds=D(this.idToBuildingService.buildingIds$,{requireSync:!0}),this.rootUnary=D(this.store.select(of),{requireSync:!0}),this.markedPackages=D(this.sharedViewReadWindow.markedPackages$,{requireSync:!0}),this.isFlattened=D(this.store.select(Ls),{requireSync:!0})}project(t){return j0(t,{areaMetric:this.areaMetric(),buildingIds:this.buildingIds(),rootUnary:this.rootUnary(),isFlattened:this.isFlattened(),hidesExcludedNodes:!0,markedPackages:this.markedPackages()})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var Nv=sd(Uw());var Rv=e=>/[*?]/.test(e);var $7={gt:">",gte:"\u2265",lt:"<",lte:"\u2264",eq:"="};function Iv(e){if(e.operator==="between"){let o=Math.min(e.value,e.upperValue??e.value),t=Math.max(e.value,e.upperValue??e.value);return`${e.metric} ${o}\u2026${t}`}return`${e.metric} ${$7[e.operator]} ${e.value}`}var j7=(e,o)=>(o.get(e.metric)??[]).filter(t=>$u(e,t)).length,Av=(e,o,t)=>e.filter(i=>i.type===t).map(i=>({id:i.id,label:Iv(i),affectedCount:j7(i,o),kind:"METRIC",metricRule:i})),Dv=Ae(dd,Ca,(e,o)=>Av(e,o,"flatten")),Fv=Ae(dd,Ca,(e,o)=>Av(e,o,"exclude"));var Pv=(e,o,t)=>{if(e.length===0)return[];let i=o.map(a=>ju(a.path)),{rules:n,combinedPositivePrefilter:r}=H7(e);return U7(n,r,i),n.map(({item:a,affectedCount:s})=>({id:`${t}/${a.path}`,label:a.path,item:a,effect:t,affectedCount:s,kind:Rv(a.path)?"RULE":"MANUAL"})).sort((a,s)=>a.label.localeCompare(s.label))};function H7(e){let o=(0,Nv.default)();return{rules:e.map(i=>{let{ignoredNodePaths:n,condition:r}=Hu(i.path);return r&&Uu(o,i.path),{item:i,ignoredNodePaths:n,condition:r,affectedCount:0}}),combinedPositivePrefilter:o}}function U7(e,o,t){let i=e.filter(r=>r.condition),n=e.filter(r=>!r.condition);for(let r of t)i.length>0&&o.ignores(r)&&Lv(i,r,!0),Lv(n,r,!1)}function Lv(e,o,t){for(let i of e)i.ignoredNodePaths.ignores(o)===t&&i.affectedCount++}var Bv=Ae(hs,Bi,Dv,(e,o,t)=>[...t,...Pv(e,o,"flatten")]),Vv=Ae(ds,Bi,Fv,(e,o,t)=>[...t,...Pv(e,o,"exclude")]);var Wv=(e,o)=>{let t=o.trim().split(",");return o.trim().startsWith("!")?(t[0]=t[0].slice(1),t.some(i=>e.some(n=>`!${Sr(i)}`===n.path))):t.some(i=>e.some(n=>Sr(i)===n.path))};var yc=Ae(fo,P0);var Ov=e=>Ae(fo,yc,e,(o,t,i)=>t||Wv(i,o)),zv=Ov(hs),$v=Ov(ds);var mm=(()=>{class e{constructor(){this.store=T(he),this.flattenRules$=this.store.select(Bv),this.excludeRules$=this.store.select(Vv),this.isFlattenPatternDisabled$=this.store.select(zv),this.isExcludePatternDisabled$=this.store.select($v)}removeRule(t){if(t.kind==="METRIC"){Wi(this.store,t.metricRule.type,Ss({id:t.metricRule.id}));return}let i=t.effect==="flatten"?vo({items:[t.item]}):Un({items:[t.item]});Wi(this.store,t.effect,i)}clearRules(t){Wi(this.store,t,ms({ruleEffect:t}))}ruleFromSearchPattern(t){Wi(this.store,t,F1(t))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var jv={patternSelector:fo,setPattern:Pi,isPatternEmptySelector:yc,searchedNodePathsSelector:sf};var um=(()=>{class e{constructor(){this.store=T(he),this.sharedViewReadWindow=T(Bt),this.threeSceneService=T(ft),this.idToBuildingService=T(nr),this.threeRendererService=T(kt),this.codeMapMouseEventService=T(on),this.codeMapTooltipService=T(or),this.selectedBuildingId=D(this.sharedViewReadWindow.selectedBuildingId$,{requireSync:!0}),this.hoveredNodeId=D(this.sharedViewReadWindow.hoveredNodeId$,{requireSync:!0})}isSelected(t){return this.selectedBuildingId()===t.path}isHovered(t){return this.hoveredNodeId()===t.path}select(t){this.store.dispatch(hd({value:t.path}));let i=this.idToBuildingService.get(t.id);this.codeMapMouseEventService.drawLabelSelectedBuilding(i),this.threeSceneService.selectBuilding(i),this.threeSceneService.clearConstantHighlight(),this.threeRendererService.render()}deselect(){this.store.dispatch(hd({value:null})),this.threeSceneService.clearSelection(),this.threeSceneService.clearConstantHighlight(),this.threeRendererService.render()}hover(t,i){this.store.dispatch(Xo({value:t.path})),this.codeMapMouseEventService.hoverNode(t.path),this.codeMapTooltipService.show(t,i.right,i.top)}hoverEnd(){this.store.dispatch(Xo({value:null})),this.codeMapMouseEventService.unhoverNode(),this.codeMapTooltipService.hide()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var Hv={options:Object.values(es),optionSelector:vf,ascendingSelector:xf,setOption:Cf,toggleAscending:()=>Mf()};var Uv=(e,o)=>e!==es.AREA_SIZE?Ae(Et,t=>Sd(yd(t.unifiedMapNode),e,o)):Ae(Et,yi,(t,i)=>Sd(yd(t.unifiedMapNode),e,o,i));var pm=(()=>{class e{constructor(){this.store=T(he)}rootNodeFor(t,i){return this.store.select(Uv(t,i))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var G7=2e3,Gv=(()=>{class e{constructor(){this.actions$=T(dt),this.sharedViewReadWindow=T(Bt),this.revealService=T(Qs),this.actions$.pipe(st(ri),Ht(()=>this.sharedViewReadWindow.selectedBuildingId$.pipe(De(Boolean),ut(1),su(ou(G7)))),Lu()).subscribe(t=>this.revealService.revealNode(t,{expand:!1}))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275dir=$a({type:e,selectors:[["","ccRevealsSelectedNodeAfterLoad",""]]})}}return e})();var Xv=(()=>{class e{constructor(){this.store=T(he),this.selection=T(Ks),this.revealService=T(Qs),H0("metrics",t=>this.showNode(t))}showNode(t){this.store.select(rf(t)).pipe(ut(1)).subscribe(i=>{i&&(this.selection.select(i),this.revealService.revealNode(t))})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275dir=$a({type:e,selectors:[["","ccShowsHandedOverNode",""]]})}}return e})();var Kv=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-metrics-view"]],features:[bi([hm,{provide:D0,useExisting:hm},um,{provide:Ks,useExisting:um},lm,{provide:F0,useExisting:lm},pm,{provide:A0,useExisting:pm},cm,{provide:I0,useExisting:cm},mm,{provide:T0,useExisting:mm},dm,{provide:q0,useExisting:dm},V0(Hv),B0(jv),{provide:E0,useValue:k0},{provide:O0,useValue:W0},N0("metrics"),Of()]),Zi([Gv,Xv])],decls:10,vars:0,consts:[["view","metrics"],["collapsedContent","",1,"flex-1","min-w-0"]],template:function(i,n){i&1&&(V(0,"cc-loading-file-progress-spinner",0)(1,"cc-code-map"),x(2,"cc-sidebar-explorer"),V(3,"cc-explorer-search-bar",1),v(),V(4,"cc-sidebar-inspector")(5,"cc-node-context-menu")(6,"cc-metrics-bar")(7,"cc-legend-panel")(8,"cc-file-extension-bar")(9,"cc-bottom-bar"))},dependencies:[rh,sm,z0,L0,R0,ih,oh,ah,_0,Vf],encapsulation:2})}}return e})();var Q7=[{path:vd.metrics,component:Kv},{path:vd.domain,loadComponent:()=>import("./chunk-OUNZ5VH4.js").then(e=>e.DomainViewComponent)}],Z7={provide:Cu,useClass:T1},Y7=[Fu(Q7),Z7],fm={providers:[qu(Ru(),Tu()),Pu(R1,{metaReducers:[I1]}),...Y7,{provide:Du,useClass:vl},Bu([...jg,...r1,...Xg,...Gg,...s1,...c1,...q1,...D1,...N1]),{provide:pu,useFactory:e=>()=>e.synchronizeVersion(),deps:[fg],multi:!0}]};var Cc=class{parse(o,t={}){t=Object.assign({binary:!1},t);let i=t.binary,n=[],r=0;o.traverse(function(L){if(L.isMesh){let j=L.geometry,q=j.index,P=j.getAttribute("position");r+=q!==null?q.count/3:P.count/3,n.push({object3d:L,geometry:j})}});let a,s=80;if(i===!0){let L=r*2+r*3*4*4+80+4,j=new ArrayBuffer(L);a=new DataView(j),a.setUint32(s,r,!0),s+=4}else a="",a+=`solid exported
|
|
3547
|
+
`))},encapsulation:2})}}return e})();var Dr=(e,o,t)=>Math.min(Math.max(e,o),t),N3=({minValue:e,maxValue:o,currentLeftValue:t,currentRightValue:i,sliderWidth:n})=>{let r=o-e;if(r<=0)return{leftEnd:n,rightStart:n};let a=(t-e)/r,s=(i-e)/r,l=Dr(a*n,0,n),d=Dr(s*n,l,n);return{leftEnd:l,rightStart:d}},_8=({thumbX:e,minValue:o,maxValue:t,sliderWidth:i})=>{let n=(t-o)/i,r=o+e*n;return Math.round(r)},P3=e=>V3(e,{lowerBound:0,upperBound:e.otherThumbX}),B3=e=>V3(e,{lowerBound:e.otherThumbX,upperBound:e.sliderWidth}),V3=({deltaX:e,thumbScreenX:o,thumbRadius:t,sliderBoundingClientRectX:i,sliderWidth:n,minValue:r,maxValue:a},{lowerBound:s,upperBound:l})=>{let d=o+e-i+t,c=Dr(d,s,l);return{updatedThumbX:c,upcomingValue:_8({thumbX:c,minValue:r,maxValue:a,sliderWidth:n})}};var E8=["rangeSliderContainer"],k8=["leftThumb"],q8=["rightThumb"],W3=(()=>{class e{get segmentWidths(){let t=Dr(this.sliderRangePosition.leftEnd,0,this.actualSliderWidth),i=Dr(this.sliderRangePosition.rightStart,t,this.actualSliderWidth);return{left:t,middle:i-t,right:this.actualSliderWidth-i}}constructor(t){this.changeDetectorRef=t,this.sliderWidth=150,this.sliderRangePosition={leftEnd:0,rightStart:0},this.thumbRadius=7,this.actualSliderWidth=this.sliderWidth,this.currentlySliding=void 0,this.activeMouseMoveHandler=null,this.activeMouseUpHandler=null,this.handleLeftThumbMoved=i=>{if(this.abortSlidingWhenHidden())return;let n=P3({deltaX:i.movementX,thumbScreenX:this.leftThumb.nativeElement.getBoundingClientRect().x,thumbRadius:this.thumbRadius,otherThumbX:this.sliderRangePosition.rightStart,sliderBoundingClientRectX:this.sliderContainer.nativeElement.getBoundingClientRect().x,sliderWidth:this.actualSliderWidth,minValue:this.minValue,maxValue:this.maxValue});this.sliderRangePosition={leftEnd:n.updatedThumbX,rightStart:this.sliderRangePosition.rightStart},this.upcomingLeftValue=n.upcomingValue,this.changeDetectorRef.markForCheck(),this.handleValueChange({newLeftValue:n.upcomingValue})},this.handleRightThumbMoved=i=>{if(this.abortSlidingWhenHidden())return;let n=B3({deltaX:i.movementX,thumbScreenX:this.rightThumb.nativeElement.getBoundingClientRect().x,thumbRadius:this.thumbRadius,otherThumbX:this.sliderRangePosition.leftEnd,sliderBoundingClientRectX:this.sliderContainer.nativeElement.getBoundingClientRect().x,sliderWidth:this.actualSliderWidth,minValue:this.minValue,maxValue:this.maxValue});this.sliderRangePosition={leftEnd:this.sliderRangePosition.leftEnd,rightStart:n.updatedThumbX},this.upcomingRightValue=n.upcomingValue,this.changeDetectorRef.markForCheck(),this.handleValueChange({newRightValue:n.upcomingValue})}}ngOnChanges(t){t.sliderWidth&&(this.actualSliderWidth=this.sliderWidth),this.currentlySliding||(t.currentLeftValue&&(this.upcomingLeftValue=this.currentLeftValue),t.currentRightValue&&(this.upcomingRightValue=this.currentRightValue),this.updateSliderRangePosition())}ngAfterViewInit(){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(t=>{let i=t.at(-1).contentRect.width;i>0&&i!==this.actualSliderWidth&&(this.actualSliderWidth=i,this.currentlySliding||this.updateSliderRangePosition(),this.changeDetectorRef.markForCheck())}),this.resizeObserver.observe(this.sliderContainer.nativeElement))}ngOnDestroy(){this.stopSliding(),this.resizeObserver?.disconnect()}setCurrentlySliding(t){switch(this.stopSliding(),this.currentlySliding=t,this.currentlySliding){case"leftThumb":this.activeMouseMoveHandler=this.handleLeftThumbMoved,this.rightThumb.nativeElement.style.zIndex="0",this.leftThumb.nativeElement.style.zIndex="1";break;case"rightThumb":this.activeMouseMoveHandler=this.handleRightThumbMoved,this.leftThumb.nativeElement.style.zIndex="0",this.rightThumb.nativeElement.style.zIndex="1";break;default:return}this.activeMouseUpHandler=()=>this.stopSliding(),document.addEventListener("mousemove",this.activeMouseMoveHandler),document.addEventListener("mouseup",this.activeMouseUpHandler)}stopSliding(){this.currentlySliding=void 0,this.activeMouseMoveHandler&&(document.removeEventListener("mousemove",this.activeMouseMoveHandler),this.activeMouseMoveHandler=null),this.activeMouseUpHandler&&(document.removeEventListener("mouseup",this.activeMouseUpHandler),this.activeMouseUpHandler=null)}handleLeftThumbKeydown(t){let i=this.calculateValueFromKeyboard(t,this.upcomingLeftValue,this.minValue,this.upcomingRightValue);i===void 0||i===this.upcomingLeftValue||(t.preventDefault(),this.upcomingLeftValue=i,this.updateSliderRangePosition(),this.handleValueChange({newLeftValue:i}))}handleRightThumbKeydown(t){let i=this.calculateValueFromKeyboard(t,this.upcomingRightValue,this.upcomingLeftValue,this.maxValue);i===void 0||i===this.upcomingRightValue||(t.preventDefault(),this.upcomingRightValue=i,this.updateSliderRangePosition(),this.handleValueChange({newRightValue:i}))}calculateValueFromKeyboard(t,i,n,r){let a;switch(t.key){case"ArrowLeft":case"ArrowDown":a=i-1;break;case"ArrowRight":case"ArrowUp":a=i+1;break;case"Home":a=n;break;case"End":a=r;break;default:return}return Math.max(n,Math.min(r,a))}handleCurrentLeftInputChanged(t){let i=xd(t,this.minValue,this.upcomingRightValue,this.upcomingLeftValue);i!==void 0&&(this.upcomingLeftValue=i,this.updateSliderRangePosition(),this.handleValueChange({newLeftValue:i}))}handleCurrentRightInputChanged(t){let i=xd(t,this.upcomingLeftValue,this.maxValue,this.upcomingRightValue);i!==void 0&&(this.upcomingRightValue=i,this.updateSliderRangePosition(),this.handleValueChange({newRightValue:i}))}updateSliderRangePosition(){this.sliderRangePosition=N3({minValue:this.minValue,maxValue:this.maxValue,currentLeftValue:this.upcomingLeftValue??this.currentLeftValue,currentRightValue:this.upcomingRightValue??this.currentRightValue,sliderWidth:this.actualSliderWidth})}abortSlidingWhenHidden(){return this.sliderContainer.nativeElement.getBoundingClientRect().width===0?(this.stopSliding(),!0):!1}static{this.\u0275fac=function(i){return new(i||e)(ne(Ln))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-metric-color-range-slider"]],viewQuery:function(i,n){if(i&1&&Ha(E8,5)(k8,5)(q8,5),i&2){let r;fi(r=gi())&&(n.sliderContainer=r.first),fi(r=gi())&&(n.leftThumb=r.first),fi(r=gi())&&(n.rightThumb=r.first)}},inputs:{minValue:"minValue",maxValue:"maxValue",currentLeftValue:"currentLeftValue",currentRightValue:"currentRightValue",leftColor:"leftColor",middleColor:"middleColor",rightColor:"rightColor",handleValueChange:"handleValueChange",sliderWidth:"sliderWidth"},features:[za],decls:15,vars:34,consts:[["rangeSliderContainer",""],["leftThumb",""],["rightThumb",""],[1,"flex","items-center","gap-2"],["type","number","aria-label","Lower color range value input",1,"input","input-sm","input-bordered","w-16","text-center",3,"input","value","min","max"],[1,"flex","flex-1","mx-2","relative","leading-[48px]"],[1,"inline-block","border-b-4","border-solid"],["aria-hidden","true",1,"cursor-pointer","absolute","-top-1","rounded-full","border-[7px]","border-primary",3,"mousedown"],["type","range","step","1","aria-label","Lower color range value",1,"absolute","inset-0","m-0","h-full","w-full","opacity-0","pointer-events-none",3,"keydown","min","max","value"],["type","range","step","1","aria-label","Upper color range value",1,"absolute","inset-0","m-0","h-full","w-full","opacity-0","pointer-events-none",3,"keydown","min","max","value"],[3,"minValue","maxValue","leftValueLabel","rightValueLabel","sliderRangePosition","sliderWidth"],["type","number","aria-label","Upper color range value input",1,"input","input-sm","input-bordered","w-16","text-center",3,"input","value","min","max"]],template:function(i,n){i&1&&(x(0,"div",3)(1,"input",4),z("input",function(a){return n.handleCurrentLeftInputChanged(a)}),v(),x(2,"div",5,0),V(4,"span",6)(5,"span",6)(6,"span",6),x(7,"div",7,1),z("mousedown",function(){return n.setCurrentlySliding("leftThumb")}),v(),x(9,"div",7,2),z("mousedown",function(){return n.setCurrentlySliding("rightThumb")}),v(),x(11,"input",8),z("keydown",function(a){return n.handleLeftThumbKeydown(a)}),v(),x(12,"input",9),z("keydown",function(a){return n.handleRightThumbKeydown(a)}),v(),V(13,"cc-range-slider-labels",10),v(),x(14,"input",11),z("input",function(a){return n.handleCurrentRightInputChanged(a)}),v()()),i&2&&(h(),F("value",n.currentLeftValue)("min",n.minValue)("max",n.upcomingRightValue),h(3),ze("width",n.segmentWidths.left,"px")("border-bottom-color",n.leftColor),h(),ze("width",n.segmentWidths.middle,"px")("border-bottom-color",n.middleColor),h(),ze("width",n.segmentWidths.right,"px")("border-bottom-color",n.rightColor),h(),ze("left",n.sliderRangePosition.leftEnd-n.thumbRadius,"px"),h(2),ze("left",n.sliderRangePosition.rightStart-n.thumbRadius,"px"),h(2),F("min",n.minValue)("max",n.currentRightValue)("value",n.currentLeftValue),h(),F("min",n.currentLeftValue)("max",n.maxValue)("value",n.currentRightValue),h(),F("minValue",n.minValue)("maxValue",n.maxValue)("leftValueLabel",n.upcomingLeftValue)("rightValueLabel",n.upcomingRightValue)("sliderRangePosition",n.sliderRangePosition)("sliderWidth",n.actualSliderWidth),h(),F("value",n.currentRightValue)("min",n.upcomingLeftValue)("max",n.maxValue))},dependencies:[L3],encapsulation:2})}}return e})();var O3=(()=>{class e{constructor(t,i,n,r){this.mapStateReadWindow=t,this.metricsBarReadStore=i,this.metricsBarWriteStore=n,this.metricsLensFacade=r,this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.sliderValues=D(this.metricsBarReadStore.metricColorRangeValues$,{initialValue:{values:[],min:0,max:0,from:0,to:0}}),this.sliderColors=D(this.metricsBarReadStore.metricColorRangeColors$,{initialValue:{leftColor:"#000",middleColor:"#000",rightColor:"#000"}}),this.isAttributeDirectionInversed=D(St([this.mapStateReadWindow.colorMetric$,this.metricsLensFacade.descriptors$]).pipe(qe(([a,s])=>s[a]?.direction===1)),{initialValue:!1}),this.pendingLeftValue=null,this.pendingRightValue=null,this.commitColorRange=Vi(()=>{let a={};this.pendingLeftValue!==null&&(a.from=this.pendingLeftValue),this.pendingRightValue!==null&&(a.to=this.pendingRightValue),this.pendingLeftValue=null,this.pendingRightValue=null,this.metricsBarWriteStore.setColorRange(a)},d0),this.handleValueChange=({newLeftValue:a,newRightValue:s})=>{this.pendingLeftValue=a??this.pendingLeftValue,this.pendingRightValue=s??this.pendingRightValue,this.commitColorRange()}}ngOnDestroy(){this.commitColorRange.flush()}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(ht),ne(Qe),ne(Jn))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-color-range-section"]],hostAttrs:[1,"contents"],decls:7,vars:23,consts:[[1,"block",3,"minValue","maxValue","currentLeftValue","currentRightValue","leftColor","middleColor","rightColor","handleValueChange","sliderWidth"],[1,"flex","items-center","justify-between","gap-2"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],[1,"truncate","text-xs","opacity-60"],[3,"minValue","maxValue","currentLeftValue","currentRightValue","leftColor","middleColor","rightColor","colorMetric","values","isAttributeDirectionInverted","diagramWidth","diagramHeight","showAxisLabels"]],template:function(i,n){i&1&&(V(0,"cc-metric-color-range-slider",0),x(1,"div",1)(2,"span",2),g(3,"Distribution"),v(),x(4,"span",3),g(5),v()(),V(6,"cc-metric-color-range-diagram",4)),i&2&&(F("minValue",n.sliderValues().min)("maxValue",n.sliderValues().max)("currentLeftValue",n.sliderValues().from)("currentRightValue",n.sliderValues().to)("leftColor",n.sliderColors().leftColor)("middleColor",n.sliderColors().middleColor)("rightColor",n.sliderColors().rightColor)("handleValueChange",n.handleValueChange)("sliderWidth",220),h(5),ge("",n.colorMetric()," \xD7 quantile %"),h(),F("minValue",n.sliderValues().min)("maxValue",n.sliderValues().max)("currentLeftValue",n.sliderValues().from)("currentRightValue",n.sliderValues().to)("leftColor",n.sliderColors().leftColor)("middleColor",n.sliderColors().middleColor)("rightColor",n.sliderColors().rightColor)("colorMetric",n.colorMetric())("values",n.sliderValues().values)("isAttributeDirectionInverted",n.isAttributeDirectionInversed())("diagramWidth",380)("diagramHeight",190)("showAxisLabels",!1))},dependencies:[W3,F3],encapsulation:2})}}return e})();function T8(e,o){if(e&1){let t=we();y(0,"button",6),ie("click",function(){ae(t);let n=B();return se(n.resetThresholds())}),pe(1,"i",7),M()}}var z3=(()=>{class e{constructor(t,i,n,r){this.mapStateReadWindow=t,this.fileStoreReadWindow=i,this.metricsBarReadStore=n,this.metricsBarWriteStore=r,this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Pt}),this.selectedColorMetricData=D(this.metricsBarReadStore.selectedColorMetricData$,{initialValue:{values:[],minValue:0,maxValue:0}}),this.canResetThresholds=Y(()=>!this.isDeltaState()&&this.colorMetric()!=="unary"),this.swatchGradient=Y(()=>{let a=this.mapColors();return this.isDeltaState()?`linear-gradient(90deg, ${a.positiveDelta}, ${a.negativeDelta})`:`linear-gradient(90deg, ${a.positive}, ${a.neutral}, ${a.negative})`})}resetThresholds(){this.metricsBarWriteStore.setColorRange(yr(this.selectedColorMetricData()))}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(Re),ne(ht),ne(Qe))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-color-settings-header"]],hostAttrs:[1,"contents"],decls:8,vars:4,consts:[[1,"flex","items-center","justify-between","gap-2"],[1,"flex","min-w-0","items-center","gap-2"],[1,"inline-block","h-3.5","w-3.5","shrink-0","rounded-full"],[1,"truncate","text-sm"],[1,"font-semibold","text-primary"],["title","Reset slider thresholds to default","aria-label","Reset thresholds",1,"btn","btn-ghost","btn-xs","btn-square"],["title","Reset slider thresholds to default","aria-label","Reset thresholds",1,"btn","btn-ghost","btn-xs","btn-square",3,"click"],[1,"fa","fa-undo"]],template:function(i,n){i&1&&(y(0,"div",0)(1,"div",1),pe(2,"span",2),y(3,"span",3),g(4,"Color by "),y(5,"span",4),g(6),M()()(),K(7,T8,2,0,"button",5),M()),i&2&&(h(2),ze("background",n.swatchGradient()),h(4),Te(n.colorMetric()),h(),Q(n.canResetThresholds()?7:-1))},encapsulation:2})}}return e})();var $3=(()=>{class e{constructor(){this.override=Z.required(),this.recolorOverride=_e(),this.unpinOverride=_e()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-folder-override-row"]],hostAttrs:[1,"contents"],inputs:{override:[1,"override"]},outputs:{recolorOverride:"recolorOverride",unpinOverride:"unpinOverride"},decls:8,vars:7,consts:[[1,"flex","shrink-0","items-center","gap-2","rounded-md","border","border-base-300","px-2","py-1",3,"title"],[3,"colorChange","hexColor","ariaLabel"],[1,"min-w-0","flex-1","truncate","text-sm"],[1,"text-xs","opacity-60","tabular-nums",3,"title"],[1,"btn","btn-ghost","btn-xs","btn-square",3,"click","title"],[1,"fa","fa-times"]],template:function(i,n){i&1&&(x(0,"div",0)(1,"cc-inline-color-picker",1),z("colorChange",function(a){return n.recolorOverride.emit(a)}),v(),x(2,"span",2),g(3),v(),x(4,"span",3),g(5),v(),x(6,"button",4),z("click",function(){return n.unpinOverride.emit()}),V(7,"i",5),v()()),i&2&&(F("title",n.override().path),h(),F("hexColor",n.override().color)("ariaLabel","Recolor "+n.override().path),h(2),Te(n.override().path),h(),F("title",n.override().fileCount+" files"),h(),Te(n.override().fileCount),h(),F("title","Unpin "+n.override().path))},dependencies:[Eo],encapsulation:2})}}return e})();var R8=["pinInput"];function I8(e,o){if(e&1){let t=we();y(0,"button",2),ie("click",function(){ae(t);let n=B();return se(n.startPinning())}),pe(1,"i",3),y(2,"span"),g(3,"Pin a folder color\u2026"),M()()}}function A8(e,o){if(e&1){let t=we();y(0,"li",8)(1,"button",10),ie("mousedown",function(n){return n.preventDefault()})("click",function(){let n=ae(t).$implicit,r=B(2);return se(r.handlePin(n))}),y(2,"span",11),g(3),M()()()}if(e&2){let t=o.$implicit;h(),ce("title",t),h(2),Te(t)}}function D8(e,o){e&1&&(y(0,"li",9),g(1,"No folders found"),M())}function F8(e,o){if(e&1){let t=we();y(0,"div",4),pe(1,"i",5),y(2,"input",6,0),ie("input",function(n){ae(t);let r=B();return se(r.handleSearchTermChange(n.target.value))})("keydown.escape",function(n){ae(t);let r=B();return se(r.handleSearchEscape(n))})("blur",function(){ae(t);let n=B();return se(n.handleSearchBlur())}),M()(),y(4,"ul",7),Pe(5,A8,4,2,"li",8,ii,!1,D8,2,0,"li",9),M()}if(e&2){let t=B();h(2),ce("value",t.searchTerm()),h(3),Be(t.folderSuggestions())}}var L8=8,j3=(()=>{class e{constructor(t){this.metricsBarReadStore=t,this.pinFolder=_e(),this.folderPaths=D(this.metricsBarReadStore.markableFolderPaths$,{initialValue:[]}),this.overrides=D(this.metricsBarReadStore.markedPackagesWithCounts$,{initialValue:[]}),this.isPinning=Se(!1),this.searchTerm=Se(""),this.pinInput=Je("pinInput"),this.folderSuggestions=Y(()=>{let i=this.searchTerm().toLowerCase(),n=new Set(this.overrides().map(a=>a.path)),r=[];for(let a of this.folderPaths())if(!(n.has(a)||!a.toLowerCase().includes(i))&&(r.push(a),r.length>=L8))break;return r})}startPinning(){this.isPinning.set(!0),setTimeout(()=>this.pinInput()?.nativeElement.focus())}stopPinning(){this.isPinning.set(!1),this.searchTerm.set("")}handleSearchTermChange(t){this.searchTerm.set(t)}handleSearchBlur(){this.searchTerm().trim()===""&&this.stopPinning()}handleSearchEscape(t){t.preventDefault(),this.stopPinning()}handlePin(t){this.pinFolder.emit(t),this.stopPinning()}static{this.\u0275fac=function(i){return new(i||e)(ne(ht))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-pin-folder-search"]],viewQuery:function(i,n){i&1&&rt(n.pinInput,R8,5),i&2&&at()},hostAttrs:[1,"contents"],outputs:{pinFolder:"pinFolder"},decls:2,vars:1,consts:[["pinInput",""],[1,"btn","btn-ghost","btn-sm","w-full","justify-start","gap-2","border","border-dashed","border-base-300","font-normal"],[1,"btn","btn-ghost","btn-sm","w-full","justify-start","gap-2","border","border-dashed","border-base-300","font-normal",3,"click"],[1,"fa","fa-plus"],[1,"input","input-sm","input-bordered","flex","items-center","gap-2"],[1,"fa","fa-search","opacity-60"],["type","text","placeholder","Search folders\u2026","aria-label","Search folders",1,"grow",3,"input","keydown.escape","blur","value"],[1,"m-0","flex","max-h-40","list-none","flex-col","overflow-y-auto","p-0"],[1,"flex"],[1,"px-2","py-1","text-xs","opacity-60"],[1,"btn","btn-ghost","btn-xs","w-full","flex-nowrap","justify-start","font-normal",3,"mousedown","click","title"],[1,"min-w-0","truncate"]],template:function(i,n){i&1&&K(0,I8,4,0,"button",1)(1,F8,8,2),i&2&&Q(n.isPinning()?1:0)},encapsulation:2})}}return e})();var N8=(e,o)=>o.path;function P8(e,o){if(e&1&&(x(0,"span",2),g(1),v()),e&2){let t=B();h(),ge("",t.overrides().length," pinned")}}function B8(e,o){if(e&1){let t=we();x(0,"cc-folder-override-row",7),z("recolorOverride",function(n){let r=ae(t).$implicit,a=B(2);return se(a.handleRecolor(r.path,n))})("unpinOverride",function(){let n=ae(t).$implicit,r=B(2);return se(r.handleUnpin(n.path))}),v()}if(e&2){let t=o.$implicit;F("override",t)}}function V8(e,o){if(e&1&&(x(0,"div",4),Pe(1,B8,1,1,"cc-folder-override-row",6,N8),v()),e&2){let t=B();h(),Be(t.overrides())}}var H3=(()=>{class e{constructor(t,i,n){this.mapStateReadWindow=t,this.metricsBarReadStore=i,this.metricsBarWriteStore=n,this.overrides=D(this.metricsBarReadStore.markedPackagesWithCounts$,{initialValue:[]}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Pt})}handlePin(t){this.metricsBarWriteStore.markPackage({path:t,color:this.nextMarkingColor(t)})}handleRecolor(t,i){this.metricsBarWriteStore.markPackage({path:t,color:i})}handleUnpin(t){this.metricsBarWriteStore.unmarkPackage(t)}nextMarkingColor(t){let i=this.mapColors().markingColors,n=this.findMarkedParentColor(t),r=i.filter(s=>s!==n);if(r.length===0)return i[0];let a=new Set(this.overrides().map(s=>s.color));return r.find(s=>!a.has(s))??r[this.overrides().length%r.length]}findMarkedParentColor(t){let i,n=0;for(let r of this.overrides())t.startsWith(`${r.path}/`)&&r.path.length>n&&(i=r.color,n=r.path.length);return i}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(ht),ne(Qe))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-folder-overrides"]],hostAttrs:[1,"contents"],decls:8,vars:2,consts:[[1,"flex","items-center","justify-between","gap-2"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],[1,"text-xs","opacity-60"],[1,"m-0","text-xs","opacity-60"],[1,"flex","max-h-36","flex-col","gap-0.5","overflow-y-auto"],[3,"pinFolder"],[3,"override"],[3,"recolorOverride","unpinOverride","override"]],template:function(i,n){i&1&&(x(0,"div",0)(1,"span",1),g(2,"Folder Overrides"),v(),K(3,P8,2,1,"span",2),v(),x(4,"p",3),g(5,"These folders\u2019 floors are tinted with the pinned color."),v(),K(6,V8,3,0,"div",4),x(7,"cc-pin-folder-search",5),z("pinFolder",function(a){return n.handlePin(a)}),v()),i&2&&(h(3),Q(n.overrides().length>0?3:-1),h(3),Q(n.overrides().length>0?6:-1))},dependencies:[$3,j3],encapsulation:2})}}return e})();var U3=(()=>{class e{constructor(t,i){this.mapStateReadWindow=t,this.metricsBarWriteStore=i,this.groupName=Z.required(),this.colorMode=D(this.mapStateReadWindow.colorMode$,{initialValue:"absolute"})}handleColorModeChange(t){this.metricsBarWriteStore.setColorMode(t)}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(Qe))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-gradient-mode-picker"]],hostAttrs:[1,"contents"],inputs:{groupName:[1,"groupName"]},decls:8,vars:8,consts:[[1,"flex","flex-col","gap-1"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],["role","radiogroup","aria-label","Gradient mode",1,"join","w-full"],["type","radio","aria-label","Absolute",1,"join-item","btn","btn-sm","flex-1",3,"change","name","checked"],["type","radio","aria-label","Focused",1,"join-item","btn","btn-sm","flex-1",3,"change","name","checked"],["type","radio","aria-label","Weighted",1,"join-item","btn","btn-sm","flex-1",3,"change","name","checked"],["type","radio","aria-label","Relative",1,"join-item","btn","btn-sm","flex-1",3,"change","name","checked"]],template:function(i,n){i&1&&(y(0,"div",0)(1,"span",1),g(2,"Gradient Mode"),M(),y(3,"div",2)(4,"input",3),ie("change",function(){return n.handleColorModeChange("absolute")}),M(),y(5,"input",4),ie("change",function(){return n.handleColorModeChange("focusedGradient")}),M(),y(6,"input",5),ie("change",function(){return n.handleColorModeChange("weightedGradient")}),M(),y(7,"input",6),ie("change",function(){return n.handleColorModeChange("trueGradient")}),M()()()),i&2&&(h(4),ce("name",n.groupName())("checked",n.colorMode()==="absolute"),h(),ce("name",n.groupName())("checked",n.colorMode()==="focusedGradient"),h(),ce("name",n.groupName())("checked",n.colorMode()==="weightedGradient"),h(),ce("name",n.groupName())("checked",n.colorMode()==="trueGradient"))},encapsulation:2})}}return e})();function W8(e,o){if(e&1){let t=we();x(0,"label",1)(1,"input",3),z("change",function(){ae(t);let n=B();return se(n.handleIsColorRangeInvertedChange())}),v(),x(2,"span",4),g(3,"Invert colors"),v()()}if(e&2){let t=B();h(),F("checked",t.isColorRangeInverted())}}function O8(e,o){if(e&1){let t=we();x(0,"label",1)(1,"input",3),z("change",function(){ae(t);let n=B();return se(n.handleAreDeltaColorsInvertedChange())}),v(),x(2,"span",4),g(3,"Invert colors"),v()()}if(e&2){let t=B();h(),F("checked",t.areDeltaColorsInverted())}}var G3=(()=>{class e{constructor(t,i,n){this.fileStoreReadWindow=t,this.mapStateReadWindow=i,this.metricsBarWriteStore=n,this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Pt}),this.isColorRangeInverted=Y(()=>this.mapColors().isColorRangeInverted??!1),this.areDeltaColorsInverted=Y(()=>this.mapColors().areDeltaColorsInverted??!1)}handleIsColorRangeInvertedChange(){this.metricsBarWriteStore.invertColorRange()}handleAreDeltaColorsInvertedChange(){this.metricsBarWriteStore.invertDeltaColors()}resetColorsKeys(){return this.isDeltaState()?["mapState.mapColors.positiveDelta","mapState.mapColors.negativeDelta","mapState.mapColors.selected","mapState.mapColors.areDeltaColorsInverted"]:["mapState.mapColors.positive","mapState.mapColors.negative","mapState.mapColors.neutral","mapState.mapColors.selected","mapState.mapColors.isColorRangeInverted","mapState.colorMode"]}static{this.\u0275fac=function(i){return new(i||e)(ne(Re),ne(xe),ne(Qe))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-invert-reset-row"]],hostAttrs:[1,"contents"],decls:4,vars:4,consts:[[1,"flex","items-center","justify-between","gap-2"],[1,"flex","cursor-pointer","items-center","gap-2"],["label","Reset colors",3,"settingsKeys","tooltip","small"],["type","checkbox",1,"toggle","toggle-sm","toggle-primary",3,"change","checked"],[1,"text-sm"]],template:function(i,n){i&1&&(x(0,"div",0),K(1,W8,4,1,"label",1)(2,O8,4,1,"label",1),V(3,"cc-reset-settings-button",2),v()),i&2&&(h(),Q(n.isDeltaState()?2:1),h(2),F("settingsKeys",n.resetColorsKeys())("tooltip",n.isDeltaState()?"Reset color values to default":"Reset color values and gradient mode to default")("small",!0))},dependencies:[ko],encapsulation:2})}}return e})();function z8(e,o){if(e&1&&V(0,"cc-color-range-section")(1,"cc-gradient-mode-picker",1),e&2){let t=B();h(),F("groupName",t.popoverId()+"-gradient-mode")}}var cc=(()=>{class e{constructor(t,i){this.mapStateReadWindow=t,this.fileStoreReadWindow=i,this.popoverId=Z.required(),this.anchorName=Z.required(),this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.hasRangeSection=Y(()=>!this.isDeltaState()&&this.colorMetric()!=="unary")}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(Re))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-color-settings-popover"]],hostAttrs:[1,"contents"],inputs:{popoverId:[1,"popoverId"],anchorName:[1,"anchorName"]},decls:6,vars:4,consts:[[3,"popoverId","anchorName","widthClass"],[3,"groupName"]],template:function(i,n){i&1&&(x(0,"cc-settings-popover-shell",0),V(1,"cc-color-settings-header"),K(2,z8,2,1),V(3,"cc-color-bands-section")(4,"cc-invert-reset-row")(5,"cc-folder-overrides"),v()),i&2&&(F("popoverId",n.popoverId())("anchorName",n.anchorName())("widthClass","max-w-[95vw] "+(n.hasRangeSection()?"w-[420px]":"w-80")),h(2),Q(n.hasRangeSection()?2:-1))},dependencies:[Ai,z3,O3,U3,b2,G3,H3],encapsulation:2})}}return e})();var X3=(()=>{class e{constructor(t,i,n){this.mapStateReadWindow=t,this.preferencesReadWindow=i,this.metricsBarWriteStore=n,this.searchPopoverId="metric-select-popover-color",this.searchAnchorName="metric-segment-color",this.settingsPopoverId="metric-settings-popover-color",this.settingsAnchorName="metric-segment-color-cog",this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.isLinked=D(this.preferencesReadWindow.isColorMetricLinkedToHeightMetric$,{initialValue:!1})}handleMetricSelected(t){this.metricsBarWriteStore.setColorMetric(t)}static{this.\u0275fac=function(i){return new(i||e)(ne(xe),ne(sr),ne(Qe))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-color-segment"]],hostAttrs:[1,"contents"],decls:5,vars:14,consts:[["label","Color",3,"metricName","hasCog","cogPopoverId","cogAnchorName","searchPopoverId","searchAnchorName","disabled","testId","cogTestId"],["body","",1,"flex","flex-col","items-stretch","gap-1"],["metricFor","colorMetric"],["placeholder","Color Metric (highest value)","kind","node",3,"metricSelected","popoverId","anchorName","selected"],[3,"popoverId","anchorName"]],template:function(i,n){i&1&&(x(0,"cc-axis-card",0)(1,"div",1),V(2,"cc-metric-meta-value",2),v()(),x(3,"cc-metric-bar-select-popover",3),z("metricSelected",function(a){return n.handleMetricSelected(a)}),v(),V(4,"cc-color-settings-popover",4)),i&2&&(F("metricName",n.colorMetric())("hasCog",!0)("cogPopoverId",n.settingsPopoverId)("cogAnchorName",n.settingsAnchorName)("searchPopoverId",n.searchPopoverId)("searchAnchorName",n.searchAnchorName)("disabled",n.isLinked())("testId","metric-segment-color")("cogTestId","metric-segment-color-cog"),h(3),F("popoverId",n.searchPopoverId)("anchorName",n.searchAnchorName)("selected",n.colorMetric()),h(),F("popoverId",n.settingsPopoverId)("anchorName",n.settingsAnchorName))},dependencies:[_o,_r,ql,cc],encapsulation:2})}}return e})();var K3=(()=>{class e{constructor(){this.mapStateReadWindow=T(xe),this.metricsBarWriteStore=T(Qe),this.isEdgeMetricVisible=D(this.mapStateReadWindow.isEdgeMetricVisible$,{initialValue:!0})}toggle(){this.metricsBarWriteStore.toggleEdgeMetricVisible()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-edge-metric-toggle"]],decls:4,vars:1,consts:[[1,"flex","items-center","gap-2","cursor-pointer"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked"]],template:function(i,n){i&1&&(y(0,"label",0)(1,"input",1),ie("change",function(){return n.toggle()}),M(),y(2,"span"),g(3,"Disable edge metric"),M()()),i&2&&(h(),ce("checked",!n.isEdgeMetricVisible()))},encapsulation:2})}}return e})();var Q3=(()=>{class e{constructor(){this.mapStateReadWindow=T(xe),this.metricsBarReadStore=T(ht),this.metricsBarWriteStore=T(Qe),this.popoverId=Z.required(),this.anchorName=Z.required(),this.amountOfBuildingsWithSelectedEdgeMetric=D(this.metricsBarReadStore.amountOfBuildingsWithSelectedEdgeMetric$,{initialValue:0}),this.edgePreviewLabel=D(this.metricsBarReadStore.amountOfBuildingsWithSelectedEdgeMetric$.pipe(qe(t=>`Preview the edges of up to ${t} buildings with the highest amount of incoming and outgoing edges`)),{initialValue:""}),this.amountOfEdgePreviews=D(this.mapStateReadWindow.amountOfEdgePreviews$,{initialValue:0}),this.edgeHeight=D(this.mapStateReadWindow.edgeHeight$,{initialValue:1}),this.showOutgoingEdges=D(this.mapStateReadWindow.showOutgoingEdges$,{initialValue:!1}),this.showIncomingEdges=D(this.mapStateReadWindow.showIncomingEdges$,{initialValue:!1}),this.showOnlyBuildingsWithEdges=D(this.mapStateReadWindow.showOnlyBuildingsWithEdges$,{initialValue:!1}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Pt}),this.outgoingEdgeColor=Y(()=>this.mapColors().outgoingEdge),this.incomingEdgeColor=Y(()=>this.mapColors().incomingEdge),this.resetKeys=["mapState.amountOfEdgePreviews","mapState.edgeHeight","mapState.mapColors.outgoingEdge","mapState.showOutgoingEdges","mapState.mapColors.incomingEdge","mapState.showIncomingEdges","mapState.showOnlyBuildingsWithEdges","mapState.isEdgeMetricVisible"]}setAmountOfEdgePreviews(t){this.metricsBarWriteStore.setAmountOfEdgePreviews(t)}setEdgeHeight(t){this.metricsBarWriteStore.setEdgeHeight(t)}setShowOutgoingEdges(t){let i=t.target.checked;this.metricsBarWriteStore.setShowOutgoingEdges(i)}setShowIncomingEdges(t){let i=t.target.checked;this.metricsBarWriteStore.setShowIncomingEdges(i)}setShowOnlyBuildingsWithEdges(t){let i=t.target.checked;this.metricsBarWriteStore.setShowOnlyBuildingsWithEdges(i)}setMapColor(t,i){this.metricsBarWriteStore.setMapColors({[t]:i})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-edge-settings-popover"]],hostAttrs:[1,"contents"],inputs:{popoverId:[1,"popoverId"],anchorName:[1,"anchorName"]},decls:32,vars:18,consts:[["widthClass","w-80",3,"popoverId","anchorName"],[3,"title"],[1,"text-sm"],["ariaLabel","Edge preview amount",3,"valueChange","min","max","value","disabled"],["title","Adjust the curve height"],["ariaLabel","Edge height",3,"valueChange","min","max","value","disabled"],[1,"flex","flex-col","gap-2"],[1,"flex","items-center","gap-2"],["ariaLabel","Outgoing edge color",3,"colorChange","hexColor"],[1,"min-w-0","flex-1","truncate","text-sm"],[1,"flex","items-center","gap-2","cursor-pointer"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked"],["ariaLabel","Incoming edge color",3,"colorChange","hexColor"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked","disabled"],["tooltip","Reset edge metric settings to their defaults","label","Reset edge metric settings",3,"settingsKeys"]],template:function(i,n){i&1&&(x(0,"cc-settings-popover-shell",0)(1,"div",1)(2,"span",2),g(3,"Preview"),v(),x(4,"cc-slider-number-input",3),z("valueChange",function(a){return n.setAmountOfEdgePreviews(a)}),v()(),x(5,"div",4)(6,"span",2),g(7,"Height"),v(),x(8,"cc-slider-number-input",5),z("valueChange",function(a){return n.setEdgeHeight(a)}),v()(),x(9,"div",6)(10,"div",7)(11,"cc-inline-color-picker",8),z("colorChange",function(a){return n.setMapColor("outgoingEdge",a)}),v(),x(12,"span",9),g(13,"Outgoing Edge"),v(),x(14,"label",10)(15,"input",11),z("change",function(a){return n.setShowOutgoingEdges(a)}),v(),x(16,"span"),g(17,"Show"),v()()(),x(18,"div",7)(19,"cc-inline-color-picker",12),z("colorChange",function(a){return n.setMapColor("incomingEdge",a)}),v(),x(20,"span",9),g(21,"Incoming Edge"),v(),x(22,"label",10)(23,"input",11),z("change",function(a){return n.setShowIncomingEdges(a)}),v(),x(24,"span"),g(25,"Show"),v()()()(),x(26,"label",10)(27,"input",13),z("change",function(a){return n.setShowOnlyBuildingsWithEdges(a)}),v(),x(28,"span"),g(29,"Only show nodes with edges"),v()(),V(30,"cc-edge-metric-toggle")(31,"cc-reset-settings-button",14),v()),i&2&&(F("popoverId",n.popoverId())("anchorName",n.anchorName()),h(),F("title",n.edgePreviewLabel()),h(3),F("min",0)("max",n.amountOfBuildingsWithSelectedEdgeMetric())("value",n.amountOfEdgePreviews())("disabled",n.amountOfBuildingsWithSelectedEdgeMetric()===0),h(4),F("min",1)("max",9)("value",n.edgeHeight())("disabled",n.amountOfBuildingsWithSelectedEdgeMetric()===0),h(3),F("hexColor",n.outgoingEdgeColor()),h(4),F("checked",n.showOutgoingEdges()),h(4),F("hexColor",n.incomingEdgeColor()),h(4),F("checked",n.showIncomingEdges()),h(4),F("checked",n.showOnlyBuildingsWithEdges())("disabled",n.amountOfBuildingsWithSelectedEdgeMetric()===0),h(4),F("settingsKeys",n.resetKeys))},dependencies:[Eo,ko,K3,Ai,qo],encapsulation:2})}}return e})();function $8(e,o){e&1&&(V(0,"cc-metric-chooser-type",5),x(1,"span"),g(2),v()),e&2&&(F("metricFor","edgeMetric"),h(2),Te(o))}function j8(e,o){e&1&&(x(0,"span",2),g(1,"\xA0"),v())}var Y3=(()=>{class e{constructor(){this.mapStateReadWindow=T(xe),this.metricsBarWriteStore=T(Qe),this.nodeSelectionService=T(Er),this.searchPopoverId="metric-select-popover-edge",this.searchAnchorName="metric-segment-edges",this.settingsPopoverId="metric-settings-popover-edge",this.settingsAnchorName="metric-segment-edges-cog",this.edgeMetric=D(this.mapStateReadWindow.edgeMetric$,{initialValue:""}),this.isEdgeMetricVisible=D(this.mapStateReadWindow.isEdgeMetricVisible$,{initialValue:!0}),this.hoveredNode=D(this.nodeSelectionService.createNodeObservable()),this.hoveredEdgeValue=Y(()=>{let t=this.hoveredNode(),i=this.edgeMetric();if(!t||!i)return null;let n=t.edgeAttributes?.[i];return n?`${Z3(n.incoming)} / ${Z3(n.outgoing)}`:null})}handleMetricSelected(t){this.metricsBarWriteStore.setEdgeMetric(t)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-edge-segment"]],hostAttrs:[1,"contents"],decls:6,vars:15,consts:[["label","Edges",3,"metricName","hasCog","cogPopoverId","cogAnchorName","searchPopoverId","searchAnchorName","dimmed","testId","cogTestId"],["body","",1,"flex","items-center","justify-center","gap-1","text-xs","opacity-60","leading-tight","min-h-4"],["aria-hidden","true"],["placeholder","Edge Metric (highest value)","kind","edge",3,"metricSelected","popoverId","anchorName","selected"],[3,"popoverId","anchorName"],["attributeType","edges",3,"metricFor"]],template:function(i,n){if(i&1&&(x(0,"cc-axis-card",0)(1,"div",1),K(2,$8,3,2)(3,j8,2,0,"span",2),v()(),x(4,"cc-metric-bar-select-popover",3),z("metricSelected",function(a){return n.handleMetricSelected(a)}),v(),V(5,"cc-edge-settings-popover",4)),i&2){let r;F("metricName",n.edgeMetric())("hasCog",!0)("cogPopoverId",n.settingsPopoverId)("cogAnchorName",n.settingsAnchorName)("searchPopoverId",n.searchPopoverId)("searchAnchorName",n.searchAnchorName)("dimmed",!n.isEdgeMetricVisible())("testId","metric-segment-edges")("cogTestId","metric-segment-edges-cog"),h(2),Q((r=n.hoveredEdgeValue())?2:3,r),h(2),F("popoverId",n.searchPopoverId)("anchorName",n.searchAnchorName)("selected",n.edgeMetric()),h(),F("popoverId",n.settingsPopoverId)("anchorName",n.settingsAnchorName)}},dependencies:[_o,kl,_r,Q3],encapsulation:2})}}return e})();function Z3(e){return typeof e=="number"?e.toLocaleString():"-"}function H8(e,o){if(e&1){let t=we();x(0,"label",4)(1,"input",6),z("change",function(n){ae(t);let r=B();return se(r.toggleInvertHeight(n))}),v(),x(2,"span"),g(3,"Invert Height"),v()()}if(e&2){let t=B();h(),F("checked",t.invertHeight())}}var J3=(()=>{class e{constructor(){this.mapStateReadWindow=T(xe),this.fileStoreReadWindow=T(Re),this.metricsBarWriteStore=T(Qe),this.popoverId=Z.required(),this.anchorName=Z.required(),this.scalingY=D(this.mapStateReadWindow.scaling$,{initialValue:{x:1,y:1,z:1}}),this.invertHeight=D(this.mapStateReadWindow.invertHeight$,{initialValue:!1}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.resetKeys=["mapState.scaling.y","mapState.invertHeight"]}setScalingY(t){this.metricsBarWriteStore.setScaling({y:t})}toggleInvertHeight(t){let i=t.target.checked;this.metricsBarWriteStore.setInvertHeight(i)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-height-settings-popover"]],hostAttrs:[1,"contents"],inputs:{popoverId:[1,"popoverId"],anchorName:[1,"anchorName"]},decls:7,vars:7,consts:[[3,"popoverId","anchorName"],["title","Height scaling"],[1,"text-sm"],["ariaLabel","Height",3,"valueChange","min","max","value"],[1,"flex","items-center","gap-2","cursor-pointer"],["tooltip","Reset height metric settings to their defaults","label","Reset height metric settings",3,"settingsKeys"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked"]],template:function(i,n){i&1&&(x(0,"cc-settings-popover-shell",0)(1,"div",1)(2,"span",2),g(3,"Height"),v(),x(4,"cc-slider-number-input",3),z("valueChange",function(a){return n.setScalingY(a)}),v()(),K(5,H8,4,1,"label",4),V(6,"cc-reset-settings-button",5),v()),i&2&&(F("popoverId",n.popoverId())("anchorName",n.anchorName()),h(4),F("min",1)("max",25)("value",n.scalingY().y),h(),Q(n.isDeltaState()?-1:5),h(),F("settingsKeys",n.resetKeys))},dependencies:[ko,Ai,qo],encapsulation:2})}}return e})();var ev=(()=>{class e{constructor(){this.searchPopoverId="metric-select-popover-height",this.searchAnchorName="metric-segment-height",this.settingsPopoverId="metric-settings-popover-height",this.settingsAnchorName="metric-segment-height-cog",this.mapStateReadWindow=T(xe),this.metricsBarWriteStore=T(Qe),this.heightMetric=D(this.mapStateReadWindow.heightMetric$,{initialValue:""})}handleMetricSelected(t){this.metricsBarWriteStore.setHeightMetric(t)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-height-segment"]],hostAttrs:[1,"contents"],decls:2,vars:7,consts:[["label","Height","metricFor","heightMetric","placeholder","Height Metric (highest value)","testIdPrefix","metric-segment-height",3,"metricSelected","metricName","searchPopoverId","searchAnchorName","settingsPopoverId","settingsAnchorName"],[3,"popoverId","anchorName"]],template:function(i,n){i&1&&(x(0,"cc-metric-segment",0),z("metricSelected",function(a){return n.handleMetricSelected(a)}),V(1,"cc-height-settings-popover",1),v()),i&2&&(F("metricName",n.heightMetric())("searchPopoverId",n.searchPopoverId)("searchAnchorName",n.searchAnchorName)("settingsPopoverId",n.settingsPopoverId)("settingsAnchorName",n.settingsAnchorName),h(),F("popoverId",n.settingsPopoverId)("anchorName",n.settingsAnchorName))},dependencies:[Tl,J3],encapsulation:2})}}return e})();var Rt={areaMetric:{group:"area",label:"Area metric",isMetricSelection:!0,isAppliedFirst:!0,read:e=>e.state.mapState.areaMetric,patch:e=>({mapState:{areaMetric:e.areaMetric}})},margin:{group:"area",label:"Margin",read:e=>e.state.mapState.margin,patch:e=>({mapState:{margin:e.margin}})},invertArea:{group:"area",label:"Invert area",read:e=>e.state.mapState.invertArea,patch:e=>({mapState:{invertArea:e.invertArea}})},enableFloorLabels:{group:"area",label:"Floor labels",read:e=>e.state.mapState.enableFloorLabels,patch:e=>({mapState:{enableFloorLabels:e.enableFloorLabels}})},heightMetric:{group:"height",label:"Height metric",isMetricSelection:!0,isAppliedFirst:!0,read:e=>e.state.mapState.heightMetric,patch:e=>({mapState:{heightMetric:e.heightMetric}})},heightScaling:{group:"height",label:"Height scaling",read:e=>e.state.mapState.scaling.y,patch:e=>({mapState:{scaling:{y:e.heightScaling}}})},invertHeight:{group:"height",label:"Invert height",read:e=>e.state.mapState.invertHeight,patch:e=>({mapState:{invertHeight:e.invertHeight}})},colorMetric:{group:"color",label:"Color metric",isMetricSelection:!0,isAppliedFirst:!0,read:e=>e.state.mapState.colorMetric,patch:e=>({mapState:{colorMetric:e.colorMetric}})},isColorMetricLinkedToHeightMetric:{group:"color",label:"Color follows height metric",isAppliedFirst:!0,read:e=>e.state.preferences.isColorMetricLinkedToHeightMetric,patch:e=>({preferences:{isColorMetricLinkedToHeightMetric:e.isColorMetricLinkedToHeightMetric}})},colorRange:{group:"color",label:"Color range",read:e=>ke({},e.state.mapState.colorRange),patch:e=>({mapState:{colorRange:e.colorRange}})},colorMode:{group:"color",label:"Gradient mode",read:e=>e.state.mapState.colorMode,patch:e=>({mapState:{colorMode:e.colorMode}})},mapColors:{group:"color",label:"Colors",read:e=>U8(e.state.mapState.mapColors),patch:e=>({mapState:{mapColors:e.mapColors}})},markedPackages:{group:"color",label:"Folder color overrides",read:e=>[...e.state.sharedView.markedPackages],patch:e=>({sharedView:{markedPackages:[...e.markedPackages]}})},edgeMetric:{group:"edge",label:"Edge metric",isMetricSelection:!0,isAppliedFirst:!0,read:e=>e.state.mapState.edgeMetric,patch:e=>({mapState:{edgeMetric:e.edgeMetric}})},isEdgeMetricVisible:{group:"edge",label:"Edge metric enabled",read:e=>e.state.mapState.isEdgeMetricVisible,patch:e=>({mapState:{isEdgeMetricVisible:e.isEdgeMetricVisible}})},amountOfEdgePreviews:{group:"edge",label:"Edge previews",read:e=>e.state.mapState.amountOfEdgePreviews,patch:e=>({mapState:{amountOfEdgePreviews:e.amountOfEdgePreviews}})},edgeHeight:{group:"edge",label:"Edge curve height",read:e=>e.state.mapState.edgeHeight,patch:e=>({mapState:{edgeHeight:e.edgeHeight}})},showOutgoingEdges:{group:"edge",label:"Show outgoing edges",read:e=>e.state.mapState.showOutgoingEdges,patch:e=>({mapState:{showOutgoingEdges:e.showOutgoingEdges}})},showIncomingEdges:{group:"edge",label:"Show incoming edges",read:e=>e.state.mapState.showIncomingEdges,patch:e=>({mapState:{showIncomingEdges:e.showIncomingEdges}})},showOnlyBuildingsWithEdges:{group:"edge",label:"Only nodes with edges",read:e=>e.state.mapState.showOnlyBuildingsWithEdges,patch:e=>({mapState:{showOnlyBuildingsWithEdges:e.showOnlyBuildingsWithEdges}})},edgeColors:{group:"edge",label:"Edge colors",read:e=>({outgoingEdge:e.state.mapState.mapColors.outgoingEdge,incomingEdge:e.state.mapState.mapColors.incomingEdge}),patch:e=>({mapState:{mapColors:ke({},e.edgeColors)}})},amountOfTopLabels:{group:"labels",label:"Top labels",read:e=>e.state.mapState.amountOfTopLabels,patch:e=>({mapState:{amountOfTopLabels:e.amountOfTopLabels}})},labelsPerMap:{group:"labels",label:"Top labels scope",read:e=>e.state.mapState.labelsPerMap,patch:e=>({mapState:{labelsPerMap:e.labelsPerMap}})},labelSize:{group:"labels",label:"Label size",read:e=>e.state.mapState.labelSize,patch:e=>({mapState:{labelSize:e.labelSize}})},labelMode:{group:"labels",label:"Label mode",read:e=>e.state.mapState.labelMode,patch:e=>({mapState:{labelMode:e.labelMode}})},showMetricLabelNodeName:{group:"labels",label:"Show node names",read:e=>e.state.mapState.showMetricLabelNodeName,patch:e=>({mapState:{showMetricLabelNodeName:e.showMetricLabelNodeName}})},showMetricLabelNameValue:{group:"labels",label:"Show metric values",read:e=>e.state.mapState.showMetricLabelNameValue,patch:e=>({mapState:{showMetricLabelNameValue:e.showMetricLabelNameValue}})},groupLabelCollisions:{group:"labels",label:"Group overlapping labels",read:e=>e.state.mapState.groupLabelCollisions,patch:e=>({mapState:{groupLabelCollisions:e.groupLabelCollisions}})},colorLabels:{group:"labels",label:"Labels by color metric",read:e=>ke({},e.state.mapState.colorLabels),patch:e=>({mapState:{colorLabels:e.colorLabels}})},camera:{group:"camera",label:"Position and zoom",read:e=>({position:ke({},e.camera.position),target:ke({},e.camera.target)})},excludedNodes:{group:"filters",label:"Excluded nodes",read:e=>[...e.state.sharedView.excludedNodes],patch:e=>({sharedView:{excludedNodes:[...e.excludedNodes]}})},flattenedNodes:{group:"filters",label:"Flattened nodes",read:e=>[...e.state.sharedView.flattenedNodes],patch:e=>({sharedView:{flattenedNodes:[...e.flattenedNodes]}})},metricRules:{group:"filters",label:"Flattened and excluded by metric",read:e=>[...e.state.sharedView.metricRules],patch:e=>({sharedView:{metricRules:[...e.metricRules]}})},focusedNodePath:{group:"filters",label:"Focused folder",read:e=>[...e.state.sharedView.focusedNodePath],patch:e=>({sharedView:{focusedNodePath:[...e.focusedNodePath]}})}};function U8(e){let n=e,{outgoingEdge:o,incomingEdge:t}=n;return qn(n,["outgoingEdge","incomingEdge"])}var wn=Object.keys(Rt),ya={area:"Area",height:"Height",color:"Color",edge:"Edges",labels:"Labels",camera:"Camera",filters:"Filters"},dc=Object.keys(ya),hc={area:"fa-th-large",height:"fa-bar-chart",color:"fa-paint-brush",edge:"fa-share-alt",labels:"fa-tags",camera:"fa-video-camera",filters:"fa-filter"};function Jh(e){return!!Rt[e].isMetricSelection}var sG=wn.filter(Jh);function em(e){return!!Rt[e].isAppliedFirst}function tv(e,o){return Object.fromEntries(Object.entries(e).filter(([t])=>o.has(t)))}function iv(e,o){let t={};for(let i of wn){if(!o.has(i))continue;let n=Rt[i].read(e);n!==void 0&&(t[i]=n)}return t}var mc=".ccscenario",uc=3;function tm(e){return wn.filter(o=>e.settings[o]!==void 0)}function ov(e){let o=new Set(tm(e).map(t=>Rt[t].group));return dc.filter(t=>o.has(t))}function nv(e){return et(ke(ke({schemaVersion:uc,name:e.name},e.description?{description:e.description}:{}),e.mapFileNames?.length>0?{mapFileNames:e.mapFileNames}:{}),{settings:e.settings})}function rv(e){return{id:crypto.randomUUID(),name:e.name,description:e.description,mapFileNames:e.mapFileNames,createdAt:Date.now(),settings:e.settings}}var sv=(e,o)=>o.key;function G8(e,o){if(e&1){let t=we();y(0,"label",8)(1,"input",12),ie("change",function(n){let r=ae(t).$implicit,a=B(2);return se(a.toggleSetting(r.key,n.target.checked))}),M(),y(2,"span",13),g(3),M()()}if(e&2){let t=o.$implicit;h(),ce("checked",t.selected),ot("data-testid","scenario-setting-"+t.key),h(2),Te(t.label)}}function X8(e,o){if(e&1){let t=we();y(0,"div",7)(1,"label",8)(2,"input",9),ie("change",function(n){let r=ae(t).$implicit,a=B();return se(a.toggleGroup(r,n.target.checked))}),M(),pe(3,"i"),y(4,"span",10),g(5),M()(),y(6,"div",11),Pe(7,G8,4,3,"label",8,sv),M()()}if(e&2){let t=o.$implicit;h(2),ce("checked",t.allSelected)("indeterminate",t.someSelected&&!t.allSelected),ot("data-testid","scenario-group-"+t.key),h(),Dt(Dn("fa ",t.icon," w-4 text-center opacity-60")),h(2),Te(t.label),h(2),Be(t.settings)}}var pc=(()=>{class e{constructor(){this.availableKeys=Z.required(),this.defaultKeys=Z.required(),this.selectedKeys=yu.required(),this.isDefaultSelection=Y(()=>{let t=this.selectedKeys(),i=this.defaultKeys();return t.size===i.length&&i.every(n=>t.has(n))}),this.groups=Y(()=>{let t=this.selectedKeys(),i=this.availableKeys();return dc.map(n=>this.toPickerGroup(n,i,t)).filter(n=>n.settings.length>0)})}selectAll(){this.selectedKeys.set(new Set(this.availableKeys()))}selectNone(){this.selectedKeys.set(new Set)}resetSelection(){this.selectedKeys.set(new Set(this.defaultKeys()))}toggleSetting(t,i){this.selectedKeys.update(n=>av(n,[t],i))}toggleGroup(t,i){this.selectedKeys.update(n=>av(n,t.settings.map(r=>r.key),i))}toPickerGroup(t,i,n){let r=i.filter(a=>Rt[a].group===t).map(a=>({key:a,label:Rt[a].label,selected:n.has(a)}));return{key:t,label:ya[t],icon:hc[t],settings:r,allSelected:r.length>0&&r.every(a=>a.selected),someSelected:r.some(a=>a.selected)}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-scenario-settings-picker"]],inputs:{availableKeys:[1,"availableKeys"],defaultKeys:[1,"defaultKeys"],selectedKeys:[1,"selectedKeys"]},outputs:{selectedKeys:"selectedKeysChange"},decls:13,vars:1,consts:[[1,"mb-1","flex","items-center","justify-between","gap-2"],[1,"text-xs","uppercase","tracking-wide","opacity-60"],[1,"join"],["type","button","data-testid","scenario-settings-select-all",1,"btn","btn-xs","join-item",3,"click"],["type","button","data-testid","scenario-settings-select-none",1,"btn","btn-xs","join-item",3,"click"],["type","button","data-testid","scenario-settings-reset",1,"btn","btn-xs","join-item",3,"click","disabled"],[1,"flex","flex-col","gap-2","max-h-64","overflow-y-auto","pr-1"],[1,"flex","flex-col","gap-1"],[1,"flex","items-center","gap-2","cursor-pointer"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked","indeterminate"],[1,"text-sm","font-semibold"],[1,"flex","flex-col","gap-0.5","pl-7"],["type","checkbox",1,"checkbox","checkbox-xs","checkbox-primary",3,"change","checked"],[1,"text-xs"]],template:function(i,n){i&1&&(y(0,"div",0)(1,"span",1),g(2,"Toggle all"),M(),y(3,"div",2)(4,"button",3),ie("click",function(){return n.selectAll()}),g(5," On "),M(),y(6,"button",4),ie("click",function(){return n.selectNone()}),g(7," Off "),M(),y(8,"button",5),ie("click",function(){return n.resetSelection()}),g(9," Reset "),M()()(),y(10,"div",6),Pe(11,X8,9,7,"div",7,sv),M()),i&2&&(h(8),ce("disabled",n.isDefaultSelection()),h(3),Be(n.groups()))},encapsulation:2})}}return e})();function av(e,o,t){let i=new Set(e);for(let n of o)t?i.add(n):i.delete(n);return i}function fc(e){return`${e} ${e===1?"setting":"settings"}`}var gc=(()=>{class e{constructor(t,i){this.store=t,this.ccStateSnapshot=i}getValue(){return this.ccStateSnapshot.get()}setStatePatch(t){this.store.dispatch(Qt({value:t}))}static{this.\u0275fac=function(i){return new(i||e)(E(he),E(Vt))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var K8=["areaMetric","heightMetric","colorMetric"],bc=(()=>{class e{constructor(t,i,n,r){this.scenariosStore=t,this.threeCameraService=i,this.threeMapControlsService=n,this.threeRendererService=r}getAvailableMetricNames(t){return{nodeMetrics:new Set(t.nodeMetricData.map(i=>i.name)),edgeMetrics:new Set(t.edgeMetricData.map(i=>i.name))}}getMissingMetrics(t,i){let n=this.getAvailableMetricNames(i),r=K8.map(a=>t[a]).filter(a=>!!a);return{nodeMetrics:[...new Set(r.filter(a=>!n.nodeMetrics.has(a)))],edgeMetrics:t.edgeMetric&&!n.edgeMetrics.has(t.edgeMetric)?[t.edgeMetric]:[]}}hasMissingMetrics(t){return t.nodeMetrics.length>0||t.edgeMetrics.length>0}buildOrderedStatePatches(t,i,n){let r=this.getApplicableKeys(t,i,n);return[this.mergePatchesOf(t,r.filter(em)),this.mergePatchesOf(t,r.filter(a=>!em(a)))].filter(a=>Object.keys(a).length>0)}getCameraVectors(t){if(!t.camera)return;let{position:i,target:n}=t.camera;return{position:new Ke(i.x,i.y,i.z),target:new Ke(n.x,n.y,n.z)}}async applyScenario(t,i,n){bd(!0);try{let r=i.has("camera")?this.getCameraVectors(t.settings):void 0,a=r!==void 0,s=this.buildOrderedStatePatches(t.settings,i,n),l=a&&s.length>0?this.scenariosStore.getValue().preferences.resetCameraIfNewFileIsLoaded:void 0;l&&s.length>0&&(s[0].preferences=et(ke({},s[0].preferences),{resetCameraIfNewFileIsLoaded:!1}));for(let d of s)this.scenariosStore.setStatePatch(d),await new Promise(c=>setTimeout(c));if(a&&this.threeCameraService.camera){let{position:d,target:c}=r;this.threeCameraService.camera.position.set(d.x,d.y,d.z),this.threeMapControlsService.setControlTarget(c),this.threeCameraService.camera.lookAt(c),this.threeCameraService.camera.updateProjectionMatrix(),this.threeMapControlsService.updateControls()}l&&setTimeout(()=>{this.scenariosStore.setStatePatch({preferences:{resetCameraIfNewFileIsLoaded:!0}})}),this.threeRendererService.render()}finally{bd(!1)}}getApplicableKeys(t,i,n){let r=n?this.getAvailableMetricNames(n):void 0;return[...i].filter(a=>t[a]!==void 0&&Rt[a].patch!==void 0&&this.isMetricAvailable(a,t,r))}isMetricAvailable(t,i,n){if(!n||!Jh(t))return!0;let r=i[t]??"";return t==="edgeMetric"?r===""||n.edgeMetrics.has(r):n.nodeMetrics.has(r)}mergePatchesOf(t,i){let n={};for(let r of i){let a=Rt[r].patch;a&&(n=dv(n,a(t)))}return n}static{this.\u0275fac=function(i){return new(i||e)(E(gc),E(ar),E(qt),E(kt))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function dv(e,o){let t=ke({},e);for(let[i,n]of Object.entries(o)){let r=t[i];t[i]=cv(n)&&cv(r)?dv(ke({},r),n):n}return t}function cv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Q8=["dialog"];function Z8(e,o){if(e&1&&(x(0,"div",4)(1,"span",13),V(2,"i",14),x(3,"span",15),g(4),v()()()),e&2){let t=B();h(),F("title",t.scenario().mapFileNames.join(", ")),h(3),Te(t.scenario().mapFileNames.join(", "))}}function Y8(e,o){if(e&1&&(x(0,"li"),g(1),v()),e&2){let t=o.$implicit;h(),ge("",t," (node metric)")}}function J8(e,o){if(e&1&&(x(0,"li"),g(1),v()),e&2){let t=o.$implicit;h(),ge("",t," (edge metric)")}}function e7(e,o){if(e&1&&(x(0,"div",7),V(1,"i",16),x(2,"div")(3,"strong"),g(4,"Some metrics are not available in the current map and will not be applied:"),v(),x(5,"ul",17),Pe(6,Y8,2,1,"li",null,ii),Pe(8,J8,2,1,"li",null,ii),v()()()),e&2){let t=B();h(6),Be(t.missingMetrics().nodeMetrics),h(2),Be(t.missingMetrics().edgeMetrics)}}var im=(()=>{class e{constructor(t){this.scenarioApplier=t,this.scenario=Z.required(),this.metricData=Z.required(),this.closed=_e(),this.dialogElement=Je.required("dialog"),this.availableKeys=Y(()=>tm(this.scenario())),this.defaultKeys=Y(()=>this.availableKeys().filter(i=>Rt[i].group!=="camera")),this.selectedKeys=Su(()=>new Set(this.defaultKeys())),this.missingMetrics=Y(()=>this.scenarioApplier.getMissingMetrics(tv(this.scenario().settings,this.selectedKeys()),this.metricData())),this.hasMissing=Y(()=>this.scenarioApplier.hasMissingMetrics(this.missingMetrics())),this.hasAnySelected=Y(()=>this.selectedKeys().size>0),this.applySelectedLabel=Y(()=>`Apply ${fc(this.selectedKeys().size)}`),this.destroyRef=T(Tn)}ngAfterViewInit(){let t=this.dialogElement().nativeElement,i=()=>this.closed.emit();t.addEventListener("close",i),this.destroyRef.onDestroy(()=>t.removeEventListener("close",i)),t.showModal()}async apply(){await this.applyKeys(this.selectedKeys())}async applyAll(){await this.applyKeys(new Set(this.availableKeys()))}async applyKeys(t){this.dialogElement().nativeElement.close(),await this.scenarioApplier.applyScenario(this.scenario(),t,this.metricData())}close(){this.dialogElement().nativeElement.close()}static{this.\u0275fac=function(i){return new(i||e)(ne(bc))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-apply-scenario-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,Q8,5),i&2&&at()},inputs:{scenario:[1,"scenario"],metricData:[1,"metricData"]},outputs:{closed:"closed"},decls:20,vars:9,consts:[["dialog",""],["aria-labelledby","apply-scenario-title",1,"modal"],[1,"modal-box","max-w-md"],["id","apply-scenario-title",1,"text-xl","font-bold","mb-1","truncate",3,"title"],[1,"mb-3"],[1,"text-sm","text-base-content/60","mb-3"],[3,"selectedKeysChange","availableKeys","defaultKeys","selectedKeys"],[1,"alert","alert-warning","mt-4","text-sm"],[1,"modal-action"],[1,"btn",3,"click"],["title","Apply everything this scenario holds, the camera included","data-testid","apply-scenario-all",1,"btn","btn-outline",3,"click"],["data-testid","apply-scenario-selected",1,"btn","btn-primary",3,"click","disabled"],["method","dialog",1,"modal-backdrop"],[1,"badge","badge-sm","badge-outline","gap-1","max-w-full","overflow-hidden",3,"title"],[1,"fa","fa-map-pin","text-[9px]","shrink-0"],[1,"truncate"],[1,"fa","fa-exclamation-triangle"],[1,"list-disc","pl-5","mt-1"]],template:function(i,n){if(i&1){let r=we();x(0,"dialog",1,0)(2,"div",2)(3,"h2",3),g(4),v(),K(5,Z8,5,2,"div",4),x(6,"p",5),g(7,"Select which settings to apply:"),v(),x(8,"cc-scenario-settings-picker",6),Xa("selectedKeysChange",function(s){return ae(r),Ga(n.selectedKeys,s)||(n.selectedKeys=s),se(s)}),v(),K(9,e7,10,0,"div",7),x(10,"div",8)(11,"button",9),z("click",function(){return n.close()}),g(12,"Cancel"),v(),x(13,"button",10),z("click",function(){return n.applyAll()}),g(14," Apply all "),v(),x(15,"button",11),z("click",function(){return n.apply()}),g(16),v()()(),x(17,"form",12)(18,"button"),g(19,"close"),v()()()}i&2&&(h(3),F("title","Apply: "+n.scenario().name),h(),ge("Apply: ",n.scenario().name),h(),Q(n.scenario().mapFileNames?.length?5:-1),h(3),F("availableKeys",n.availableKeys())("defaultKeys",n.defaultKeys()),Ua("selectedKeys",n.selectedKeys),h(),Q(n.hasMissing()?9:-1),h(6),F("disabled",!n.hasAnySelected()),h(),ge(" ",n.applySelectedLabel()," "))},dependencies:[mr,hr,cr,dr,pc],encapsulation:2})}}return e})();function uv(e){return e.settings?t7(e.settings):o7(e.sections??{})}function t7(e){let o=e;if(!o.blacklist)return e;let n=o,{blacklist:t}=n,i=qn(n,["blacklist"]);return gv(et(ke({},i),{excludedNodes:t.filter(r=>r.type!=="flatten").map(({path:r})=>({path:r})),flattenedNodes:t.filter(r=>r.type==="flatten").map(({path:r})=>({path:r}))}))}function pv(e){let i=e,{sections:o}=i,t=qn(i,["sections"]);return et(ke({},t),{settings:uv(e)})}var i7=new Set([1,2,uc]);function fv(e){let o=e;if(!(!o?.name||!i7.has(o.schemaVersion))&&!(!o.sections&&!o.settings))return{schemaVersion:uc,name:o.name,description:o.description,mapFileNames:o.mapFileNames,settings:uv(o)}}function o7(e){let{metrics:o,colors:t,camera:i,filters:n,labelsAndFolders:r}=e,c=t?.mapColors??{},{outgoingEdge:a,incomingEdge:s}=c,l=qn(c,["outgoingEdge","incomingEdge"]),d=a!==void 0||s!==void 0;return gv({areaMetric:o?.areaMetric,enableFloorLabels:r?.enableFloorLabels,heightMetric:o?.heightMetric,colorMetric:o?.colorMetric,isColorMetricLinkedToHeightMetric:o?.isColorMetricLinkedToHeightMetric,colorRange:t?.colorRange,colorMode:t?.colorMode,mapColors:Object.keys(l).length>0?l:void 0,markedPackages:r?.markedPackages,edgeMetric:o?.edgeMetric,edgeColors:d?{outgoingEdge:a,incomingEdge:s}:void 0,amountOfTopLabels:r?.amountOfTopLabels,labelSize:r?.labelSize,labelMode:r?.labelMode,showMetricLabelNodeName:r?.showMetricLabelNodeName,showMetricLabelNameValue:r?.showMetricLabelNameValue,groupLabelCollisions:r?.groupLabelCollisions,colorLabels:r?.colorLabels,camera:i,excludedNodes:n?.blacklist?.filter(m=>m.type!=="flatten"),flattenedNodes:n?.blacklist?.filter(m=>m.type==="flatten"),focusedNodePath:n?.focusedNodePath})}function gv(e){return Object.fromEntries(Object.entries(e).filter(([,o])=>o!==void 0))}var vc=(()=>{class e{async readAll(){return(await(await Gr()).getAll(Ur)).map(pv)}async add(t){let n=(await Gr()).transaction(Ur,"readwrite");await Promise.all([n.store.add(t),n.done])}async update(t){let n=(await Gr()).transaction(Ur,"readwrite");await Promise.all([n.store.put(t),n.done])}async delete(t){let n=(await Gr()).transaction(Ur,"readwrite");await Promise.all([n.store.delete(t),n.done])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var vv={position:{x:0,y:300,z:1e3},target:{x:0,y:0,z:0}},xc={positive:"#69AE40",neutral:"#ddcc00",negative:"#820E0E"},n7={positive:xc.negative,neutral:xc.neutral,negative:xc.positive,isColorRangeInverted:!0},r7=[{id:"built-in-rloc",name:"Real Lines of Code",description:"Visualize code size using real lines of code",metric:"rloc",colorRange:{from:250,to:500}},{id:"built-in-complexity",name:"Complexity",description:"Visualize cyclomatic complexity",metric:"complexity",colorRange:{from:50,to:100}},{id:"built-in-comment-lines",name:"Comment Lines",description:"Visualize comment density",metric:"comment_lines",colorRange:{from:50,to:100}},{id:"built-in-code-smells",name:"Code Smells",description:"Visualize code smell density",metric:"sonar_code_smells",colorRange:{from:10,to:50}},{id:"built-in-logic-complexity",name:"Logic Complexity",description:"Visualize cognitive/logic complexity",metric:"logic_complexity",colorRange:{from:40,to:80}},{id:"built-in-max-complexity-per-function",name:"Max Complexity per Function",description:"Visualize maximum complexity per function",metric:"max_complexity_per_function",colorRange:{from:10,to:20}},{id:"built-in-authors",name:"Authors",description:"Visualize the number of authors per file",metric:"number_of_authors",colorRange:{from:2,to:3},colorMode:Go.absolute,mapColors:n7}],xv=r7.map(e=>({id:e.id,name:e.name,description:e.description,createdAt:0,isBuiltIn:!0,settings:{areaMetric:"rloc",heightMetric:e.metric,colorMetric:e.metric,isColorMetricLinkedToHeightMetric:!0,colorRange:e.colorRange,colorMode:e.colorMode??Go.weightedGradient,mapColors:e.mapColors??xc}})),ji=(()=>{class e{constructor(t,i,n,r){this.scenariosStore=t,this.threeCameraService=i,this.threeMapControlsService=n,this.db=r,this.scenarios$=new tu([])}async loadScenarios(){try{let t=await this.db.readAll();t.sort((i,n)=>n.createdAt-i.createdAt),this.scenarios$.next([...t,...xv])}catch(t){console.error("Failed to load scenarios from IndexedDB:",t),this.scenarios$.next([...xv])}}async saveScenario(t){let i=this.buildScenario(t,this.readCurrentSource());try{await this.db.add(i),await this.loadScenarios()}catch(n){console.error("Failed to save scenario:",n)}return i}async removeScenario(t){try{await this.db.delete(t),await this.loadScenarios()}catch(i){console.error("Failed to remove scenario:",i)}}buildScenario(t,i){return{id:crypto.randomUUID(),name:t.name,description:t.description,mapFileNames:t.mapFileNames,createdAt:Date.now(),settings:iv(i,t.selectedKeys)}}readCurrentSource(){return{state:this.scenariosStore.getValue(),camera:this.readCurrentCamera()}}readCurrentCamera(){let t=this.threeCameraService.camera?.position,i=this.threeMapControlsService.controls?.target;return{position:t?{x:t.x,y:t.y,z:t.z}:vv.position,target:i?{x:i.x,y:i.y,z:i.z}:vv.target}}static{this.\u0275fac=function(i){return new(i||e)(E(gc),E(ar),E(qt),E(vc))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var a7=["dialog"];function s7(e,o){e&1&&(x(0,"span",8),g(1,"A name is required."),v())}var nm=wn.filter(e=>Rt[e].group!=="camera"),rm=(()=>{class e{constructor(t,i){this.scenariosService=t,this.fileStoreReadWindow=i,this.dialogElement=Je.required("dialog"),this.name=Se(""),this.description=Se(""),this.bindToMap=Se(!1),this.nameValid=Y(()=>this.name().trim().length>0),this.availableKeys=wn,this.defaultKeys=nm,this.selectedKeys=Se(new Set(nm)),this.selectionSummary=Y(()=>`${this.selectedKeys().size} of ${this.availableKeys.length} settings`),this.saveLabel=Y(()=>`Save ${fc(this.selectedKeys().size)}`),this.visibleFileNames=D(this.fileStoreReadWindow.files$.pipe(qe(n=>Pn(n).map(r=>r.fileMeta.fileName))),{initialValue:[]}),this.hasFiles=Y(()=>this.visibleFileNames().length>0)}open(){this.name.set(""),this.description.set(""),this.bindToMap.set(!1),this.selectedKeys.set(new Set(nm)),this.dialogElement().nativeElement.showModal()}close(){this.dialogElement().nativeElement.close()}async save(){if(!this.nameValid()||this.selectedKeys().size===0)return;let t=this.bindToMap()&&this.hasFiles()?this.visibleFileNames():void 0;await this.scenariosService.saveScenario({name:this.name(),description:this.description()||void 0,mapFileNames:t,selectedKeys:this.selectedKeys()}),this.close()}static{this.\u0275fac=function(i){return new(i||e)(ne(ji),ne(Re))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-save-scenario-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,a7,5),i&2&&at()},decls:38,vars:13,consts:[["dialog",""],["aria-labelledby","save-scenario-title",1,"modal"],[1,"modal-box","max-w-md"],["id","save-scenario-title",1,"text-xl","font-bold","mb-4"],[1,"form-control","mb-4"],["for","scenario-name",1,"label"],[1,"label-text"],["id","scenario-name","placeholder","Enter scenario name",1,"input","input-bordered","w-full",3,"ngModelChange","ngModel"],[1,"label-text-alt","text-error"],["for","scenario-description",1,"label"],["id","scenario-description","rows","3","placeholder","Describe what this scenario captures",1,"textarea","textarea-bordered","w-full",3,"ngModelChange","ngModel"],[1,"label","cursor-pointer","justify-start","gap-3"],["type","checkbox",1,"checkbox","checkbox-sm",3,"ngModelChange","ngModel","disabled"],[1,"mb-4","rounded-md","border","border-base-300","p-2"],["data-testid","save-scenario-extended-settings",1,"cursor-pointer","text-sm"],[1,"text-xs","opacity-60"],[1,"m-0","mt-2","text-xs","opacity-60"],[1,"mt-2"],[3,"selectedKeysChange","availableKeys","defaultKeys","selectedKeys"],[1,"modal-action"],[1,"btn",3,"click"],["data-testid","save-scenario-submit",1,"btn","btn-primary",3,"click","disabled"],["method","dialog",1,"modal-backdrop"],[3,"click"]],template:function(i,n){if(i&1){let r=we();x(0,"dialog",1,0)(2,"div",2)(3,"h2",3),g(4,"Save Scenario"),v(),x(5,"div",4)(6,"label",5)(7,"span",6),g(8,"Scenario Name"),v()(),x(9,"input",7),z("ngModelChange",function(s){return n.name.set(s)}),v(),In(),K(10,s7,2,0,"span",8),v(),x(11,"div",4)(12,"label",9)(13,"span",6),g(14,"Description (optional)"),v()(),x(15,"textarea",10),z("ngModelChange",function(s){return n.description.set(s)}),v(),In(),v(),x(16,"div",4)(17,"label",11)(18,"input",12),z("ngModelChange",function(s){return n.bindToMap.set(s)}),v(),In(),x(19,"span",6),g(20," Bind to current maps "),v()()(),x(21,"details",13)(22,"summary",14),g(23," Extended settings "),x(24,"span",15),g(25),v()(),x(26,"p",16),g(27,"Uncheck what this scenario should not carry."),v(),x(28,"div",17)(29,"cc-scenario-settings-picker",18),Xa("selectedKeysChange",function(s){return ae(r),Ga(n.selectedKeys,s)||(n.selectedKeys=s),se(s)}),v()()(),x(30,"div",19)(31,"button",20),z("click",function(){return n.close()}),g(32,"Cancel"),v(),x(33,"button",21),z("click",function(){return n.save()}),g(34),v()()(),x(35,"form",22)(36,"button",23),z("click",function(){return n.close()}),g(37,"close"),v()()()}i&2&&(h(9),F("ngModel",n.name()),An(),h(),Q(!n.nameValid()&&n.name().length>0?10:-1),h(5),F("ngModel",n.description()),An(),h(2),We("opacity-40",!n.hasFiles()),h(),F("ngModel",n.bindToMap())("disabled",!n.hasFiles()),An(),h(7),ge("(",n.selectionSummary(),")"),h(4),F("availableKeys",n.availableKeys)("defaultKeys",n.defaultKeys),Ua("selectedKeys",n.selectedKeys),h(4),F("disabled",!n.nameValid()||n.selectedKeys().size===0),h(),ge(" ",n.saveLabel()," "))},dependencies:[mr,hr,Os,Nf,zs,cr,$s,dr,pc],encapsulation:2})}}return e})();var l7=["dialog"],wc=(()=>{class e{constructor(){this.scenarioName=Z.required(),this.confirmed=_e(),this.cancelled=_e(),this.dialogElement=Je.required("dialog")}open(){this.dialogElement().nativeElement.showModal()}close(){this.dialogElement().nativeElement.close()}confirm(){this.close(),this.confirmed.emit()}cancel(){this.close(),this.cancelled.emit()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-delete-confirm-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,l7,5),i&2&&at()},inputs:{scenarioName:[1,"scenarioName"]},outputs:{confirmed:"confirmed",cancelled:"cancelled"},decls:15,vars:1,consts:[["dialog",""],["aria-labelledby","delete-confirm-title",1,"modal"],[1,"modal-box","max-w-sm"],["id","delete-confirm-title",1,"text-lg","font-bold","mb-2"],[1,"modal-action"],[1,"btn",3,"click"],[1,"btn","btn-error",3,"click"],["method","dialog",1,"modal-backdrop"],[3,"click"]],template:function(i,n){i&1&&(y(0,"dialog",1,0)(2,"div",2)(3,"h3",3),g(4,"Delete Scenario"),M(),y(5,"p"),g(6),M(),y(7,"div",4)(8,"button",5),ie("click",function(){return n.cancel()}),g(9,"Cancel"),M(),y(10,"button",6),ie("click",function(){return n.confirm()}),g(11,"Delete"),M()()(),y(12,"form",7)(13,"button",8),ie("click",function(){return n.cancel()}),g(14,"close"),M()()()),i&2&&(h(6),ge('Are you sure you want to delete "',n.scenarioName(),'"?'))},encapsulation:2})}}return e})();var c7=["dialog"];function d7(e,o){if(e&1&&(y(0,"li"),g(1),M()),e&2){let t=o.$implicit;h(),Te(t)}}function h7(e,o){if(e&1&&(y(0,"div",5)(1,"div"),pe(2,"i",11),y(3,"strong"),g(4,"Already existing:"),M(),y(5,"ul",12),Pe(6,d7,2,1,"li",null,ii),M()()()),e&2){let t=B();h(6),Be(t.feedback().duplicates)}}function m7(e,o){if(e&1&&(y(0,"li"),g(1),M()),e&2){let t=o.$implicit;h(),Te(t)}}function u7(e,o){if(e&1&&(y(0,"div",6)(1,"div"),pe(2,"i",13),y(3,"strong"),g(4,"Invalid scenario files:"),M(),y(5,"ul",12),Pe(6,m7,2,1,"li",null,ii),M()()()),e&2){let t=B();h(6),Be(t.feedback().invalid)}}function p7(e,o){if(e&1&&(y(0,"li"),g(1),M()),e&2){let t=o.$implicit;h(),Te(t)}}function f7(e,o){if(e&1&&(y(0,"div",6)(1,"div"),pe(2,"i",13),y(3,"strong"),g(4,"Could not read (bad format):"),M(),y(5,"ul",12),Pe(6,p7,2,1,"li",null,ii),M()()()),e&2){let t=B();h(6),Be(t.feedback().parseErrors)}}var Sc=(()=>{class e{constructor(){this.closed=_e(),this.dialogElement=Je.required("dialog"),this.feedback=Se({duplicates:[],invalid:[],parseErrors:[]})}open(t){let{duplicates:i,invalid:n,parseErrors:r}=t;(i.length>0||n.length>0||r.length>0)&&(this.feedback.set({duplicates:i,invalid:n,parseErrors:r}),this.dialogElement().nativeElement.showModal())}close(){this.dialogElement().nativeElement.close(),this.feedback.set({duplicates:[],invalid:[],parseErrors:[]}),this.closed.emit()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-import-feedback-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,c7,5),i&2&&at()},outputs:{closed:"closed"},decls:15,vars:3,consts:[["dialog",""],["aria-labelledby","import-feedback-title",1,"modal"],[1,"modal-box","max-w-lg"],["id","import-feedback-title",1,"text-lg","font-bold","mb-2"],[1,"flex","flex-col","gap-2"],[1,"alert","alert-warning","text-sm"],[1,"alert","alert-error","text-sm"],[1,"modal-action"],[1,"btn",3,"click"],["method","dialog",1,"modal-backdrop"],[3,"click"],[1,"fa","fa-exclamation-triangle","mr-1"],[1,"list-disc","list-inside","ml-1"],[1,"fa","fa-exclamation-circle","mr-1"]],template:function(i,n){i&1&&(y(0,"dialog",1,0)(2,"div",2)(3,"h3",3),g(4,"Import Results"),M(),y(5,"div",4),K(6,h7,8,0,"div",5),K(7,u7,8,0,"div",6),K(8,f7,8,0,"div",6),M(),y(9,"div",7)(10,"button",8),ie("click",function(){return n.close()}),g(11,"OK"),M()()(),y(12,"form",9)(13,"button",10),ie("click",function(){return n.close()}),g(14,"close"),M()()()),i&2&&(h(6),Q(n.feedback().duplicates.length?6:-1),h(),Q(n.feedback().invalid.length?7:-1),h(),Q(n.feedback().parseErrors.length?8:-1))},encapsulation:2})}}return e})();function g7(e,o){if(e&1){let t=we();y(0,"button",0),ie("click",function(n){return ae(t),B().exportRequested.emit(),se(n.stopPropagation())}),pe(1,"i",1),M(),y(2,"button",2),ie("click",function(n){return ae(t),B().deleteRequested.emit(),se(n.stopPropagation())}),pe(3,"i",3),M()}}var wv=(()=>{class e{constructor(){this.isBuiltIn=Z.required(),this.exportRequested=_e(),this.deleteRequested=_e()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-scenario-item-actions"]],inputs:{isBuiltIn:[1,"isBuiltIn"]},outputs:{exportRequested:"exportRequested",deleteRequested:"deleteRequested"},decls:1,vars:1,consts:[["title","Export scenario",1,"btn","btn-ghost","btn-sm",3,"click"],[1,"fa","fa-download"],["title","Delete scenario",1,"btn","btn-ghost","btn-sm",3,"click"],[1,"fa","fa-trash"]],template:function(i,n){i&1&&K(0,g7,4,0),i&2&&Q(n.isBuiltIn()?-1:0)},encapsulation:2})}}return e})();function b7(e,o){e&1&&(y(0,"span",1),g(1,"Built-in"),M())}function v7(e,o){if(e&1&&(y(0,"span",2),g(1),M()),e&2){let t=B();h(),Te(t.view().formattedDate)}}function x7(e,o){if(e&1&&(y(0,"span",3),pe(1,"i",6),y(2,"span",7),g(3),M()()),e&2){let t=B();ce("title","Bound to "+t.view().scenario.mapFileNames.join(", ")),h(3),Te(t.view().scenario.mapFileNames.join(", "))}}function w7(e,o){if(e&1&&pe(0,"i",8),e&2){let t=o.$implicit,i=B();Dt(Dn("fa ",i.groupIcons[t])),ce("title",i.groupLabels[t])}}var Sv=(()=>{class e{constructor(){this.view=Z.required(),this.groupLabels=ya,this.groupIcons=hc}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-scenario-item-badges"]],hostAttrs:[1,"block","overflow-hidden"],inputs:{view:[1,"view"]},decls:7,vars:2,consts:[[1,"flex","items-center","gap-3","mt-1","min-w-0"],[1,"badge","badge-xs","badge-info"],[1,"text-[11px]","text-base-content/40"],[1,"badge","badge-xs","badge-outline","gap-1","max-w-full","overflow-hidden",3,"title"],[1,"flex","gap-1.5","text-[11px]","text-base-content/40"],[3,"class","title"],[1,"fa","fa-map-pin","text-[9px]","shrink-0"],[1,"truncate"],[3,"title"]],template:function(i,n){i&1&&(y(0,"div",0),K(1,b7,2,0,"span",1)(2,v7,2,1,"span",2),K(3,x7,4,2,"span",3),y(4,"span",4),Pe(5,w7,1,4,"i",5,ii),M()()),i&2&&(h(),Q(n.view().scenario.isBuiltIn?1:2),h(2),Q(n.view().mapBound?3:-1),h(2),Be(n.view().groupKeys))},encapsulation:2})}}return e})();function S7(e,o){e&1&&(x(0,"span",3),V(1,"i",7),v())}function y7(e,o){if(e&1&&(x(0,"div",4),g(1),v()),e&2){let t=B();h(),Te(t.view().scenario.description)}}var yv=(()=>{class e{constructor(){this.view=Z.required(),this.applyRequested=_e(),this.exportRequested=_e(),this.deleteRequested=_e()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-scenario-item"]],inputs:{view:[1,"view"]},outputs:{applyRequested:"applyRequested",exportRequested:"exportRequested",deleteRequested:"deleteRequested"},decls:8,vars:8,consts:[["type","button",1,"flex","items-center","w-full","px-4","py-2","border-t","border-base-300","hover:bg-base-200","cursor-pointer","bg-transparent","text-left",3,"click"],[1,"flex-1","min-w-0"],[1,"font-medium","text-sm","truncate",3,"title"],["title","Some metrics in this scenario are not available",1,"text-warning","ml-1"],[1,"text-xs","text-base-content/50","truncate"],[3,"view"],[3,"exportRequested","deleteRequested","isBuiltIn"],[1,"fa","fa-exclamation-triangle","text-xs"]],template:function(i,n){i&1&&(x(0,"button",0),z("click",function(){return n.applyRequested.emit()}),x(1,"div",1)(2,"div",2),g(3),K(4,S7,2,0,"span",3),v(),K(5,y7,2,1,"div",4),V(6,"cc-scenario-item-badges",5),v(),x(7,"cc-scenario-item-actions",6),z("exportRequested",function(){return n.exportRequested.emit()})("deleteRequested",function(){return n.deleteRequested.emit()}),v()()),i&2&&(h(),We("opacity-40",n.view().mapMismatch),h(),F("title",n.view().scenario.name),h(),ge(" ",n.view().scenario.name," "),h(),Q(n.view().warning?4:-1),h(),Q(n.view().scenario.description?5:-1),h(),F("view",n.view()),h(),F("isBuiltIn",!!n.view().scenario.isBuiltIn))},dependencies:[Sv,wv],encapsulation:2})}}return e})();var Fr=class{static downloadData(o,t){let i=new Blob([o],{type:"text/json"}),n=document.createElement("a");n.download=t,n.href=window.URL.createObjectURL(i),n.dataset.downloadurl=["text/json",n.download,n.href].join(":"),n.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!1,view:window}))}};var Cv=(()=>{class e{constructor(t,i){this.scenariosService=t,this.db=i}exportScenario(t){let i=nv(t),n=t.name.replaceAll(/[^\w-]/g,"_");Fr.downloadData(JSON.stringify(i,null,2),n+mc)}async importScenarioFiles(t){let i=this.scenariosService.scenarios$.getValue(),n={imported:0,duplicates:[],invalid:[],parseErrors:[]};for(let r of t){let a;try{let l=await r.text();a=fv(JSON.parse(l))}catch{n.parseErrors.push(r.name);continue}if(!a){n.invalid.push(r.name);continue}if(this.isDuplicate(a,i)){n.duplicates.push(a.name);continue}let s=rv(a);i.push(s),await this.db.add(s),n.imported++}return n.imported>0&&await this.scenariosService.loadScenarios(),n}isDuplicate(t,i){return i.some(n=>n.name===t.name&&rp(n.settings,t.settings))}static{this.\u0275fac=function(i){return new(i||e)(E(ji),E(vc))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Mv=(()=>{class e{constructor(t){this.store=t,this.metricData$=this.store.select(er)}static{this.\u0275fac=function(i){return new(i||e)(E(he))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var _7=[{priority:0,label:"Current Map",icon:"fa-map-pin"},{priority:1,label:"Global",icon:"fa-globe"},{priority:2,label:"Built-in",icon:"fa-cube"},{priority:3,label:"Other Maps",icon:"fa-map-o"}],_v=(()=>{class e{constructor(t){this.scenarioApplier=t}groupScenarios(t,i){let n=new Map;for(let r of t){let a=this.getScenarioPriority(r,i),s=n.get(a);s?s.push(r):n.set(a,[r])}return _7.filter(r=>n.has(r.priority)).map(r=>({label:r.label,icon:r.icon,scenarios:n.get(r.priority)??[]}))}toScenarioView(t,i,n){let r=(t.mapFileNames?.length??0)>0,a=r&&!t.mapFileNames.some(l=>i.has(l)),s=this.scenarioApplier.hasMissingMetrics(this.scenarioApplier.getMissingMetrics(t.settings,n));return{scenario:t,warning:s,mapMismatch:a,mapBound:r,groupKeys:ov(t),formattedDate:new Date(t.createdAt).toLocaleDateString()}}getScenarioPriority(t,i){let n=(t.mapFileNames?.length??0)>0;return n&&t.mapFileNames?.some(r=>i.has(r))?0:!n&&!t.isBuiltIn?1:t.isBuiltIn?2:3}static{this.\u0275fac=function(i){return new(i||e)(E(bc))}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var k7=["dialog"],q7=["fileInput"],T7=(e,o)=>o.label,R7=(e,o)=>o.scenario.id;function I7(e,o){e&1&&(x(0,"p",13),g(1,"No scenarios found."),v())}function A7(e,o){if(e&1){let t=we();x(0,"cc-scenario-item",25),z("applyRequested",function(){let n=ae(t).$implicit,r=B(2);return se(r.applyScenario(n.scenario))})("exportRequested",function(){let n=ae(t).$implicit,r=B(2);return se(r.exportScenario(n.scenario))})("deleteRequested",function(){let n=ae(t).$implicit,r=B(2);return se(r.requestDelete(n.scenario))}),v()}if(e&2){let t=o.$implicit;F("view",t)}}function D7(e,o){if(e&1&&(x(0,"div",19),V(1,"input",20),x(2,"div",21),V(3,"i"),g(4),x(5,"span",22),g(6),v()(),x(7,"div",23),Pe(8,A7,1,1,"cc-scenario-item",24,R7),v()()),e&2){let t=o.$implicit,i=o.$index;We("mt-1",i!==0),h(),F("checked",i===0),ot("aria-label",t.label),h(2),Dt(Dn("fa ",t.icon," mr-2")),h(),ge(" ",t.label," "),h(2),Te(t.scenarios.length),h(2),Be(t.scenarios)}}var am=(()=>{class e{constructor(t,i,n,r,a){this.scenariosService=t,this.importExportService=i,this.scenarioDialogStore=n,this.fileStoreReadWindow=r,this.helpers=a,this.dialogElement=Je.required("dialog"),this.deleteConfirmDialogRef=Je.required(wc),this.importFeedbackDialogRef=Je.required(Sc),this.fileInput=Je.required("fileInput"),this.applyRequested=_e(),this.deleteTarget=Se(null),this.acceptExtensions=`${mc},.json`,this.scenarios=D(this.scenariosService.scenarios$,{initialValue:[]}),this.metricData=D(this.scenarioDialogStore.metricData$,{requireSync:!0}),this.searchTerm=Se(""),this.visibleFileNames=D(this.fileStoreReadWindow.files$.pipe(qe(s=>new Set(Pn(s).map(l=>l.fileMeta.fileName)))),{initialValue:new Set}),this.filteredScenarios=Y(()=>{let s=this.searchTerm().toLowerCase(),l=this.scenarios(),d=this.visibleFileNames();return(s?l.filter(m=>m.name.toLowerCase().includes(s)||m.description?.toLowerCase().includes(s)):[...l]).sort((m,u)=>this.helpers.getScenarioPriority(m,d)-this.helpers.getScenarioPriority(u,d))}),this.groupedScenarios=Y(()=>{let s=this.visibleFileNames(),l=this.metricData();return this.helpers.groupScenarios(this.filteredScenarios(),s).map(c=>et(ke({},c),{scenarios:c.scenarios.map(m=>this.helpers.toScenarioView(m,s,l))}))})}async open(){await this.scenariosService.loadScenarios(),this.dialogElement().nativeElement.showModal()}close(){this.dialogElement().nativeElement.close()}applyScenario(t){this.close(),this.applyRequested.emit({scenario:t,metricData:this.metricData()})}exportScenario(t){this.importExportService.exportScenario(t)}openImportDialog(){this.fileInput().nativeElement.click()}async handleImportFiles(t){let i=t.target;if(!i.files||i.files.length===0)return;let n=await this.importExportService.importScenarioFiles(i.files);i.value="",this.importFeedbackDialogRef().open(n)}requestDelete(t){this.deleteTarget.set(t),this.deleteConfirmDialogRef().open()}cancelDelete(){this.deleteTarget.set(null)}async confirmDelete(){let t=this.deleteTarget();t&&(this.deleteTarget.set(null),await this.scenariosService.removeScenario(t.id))}static{this.\u0275fac=function(i){return new(i||e)(ne(ji),ne(Cv),ne(Mv),ne(Re),ne(_v))}}static{this.\u0275cmp=k({type:e,selectors:[["cc-scenario-list-dialog"]],viewQuery:function(i,n){i&1&&rt(n.dialogElement,k7,5)(n.deleteConfirmDialogRef,wc,5)(n.importFeedbackDialogRef,Sc,5)(n.fileInput,q7,5),i&2&&at(4)},outputs:{applyRequested:"applyRequested"},decls:23,vars:4,consts:[["dialog",""],["fileInput",""],["aria-labelledby","scenario-list-title",1,"modal"],[1,"modal-box","max-w-xl"],[1,"flex","items-center","justify-between","mb-4"],["id","scenario-list-title",1,"text-xl","font-bold"],[1,"flex","items-center","gap-1"],["title","Import scenarios",1,"btn","btn-sm","btn-ghost",3,"click"],[1,"fa","fa-upload"],[1,"btn","btn-sm","btn-ghost",3,"click"],[1,"fa","fa-close"],["type","file","aria-label","Import scenarios","multiple","",1,"hidden",3,"change","accept"],["placeholder","Search scenarios...","aria-label","Search scenarios",1,"input","input-bordered","w-full","mb-4",3,"ngModelChange","ngModel"],[1,"text-center","py-8","text-base-content/50"],[1,"max-h-[60vh]","overflow-y-auto"],[1,"collapse","collapse-arrow","border","border-base-300",3,"mt-1"],["method","dialog",1,"modal-backdrop"],[3,"click"],[3,"confirmed","cancelled","scenarioName"],[1,"collapse","collapse-arrow","border","border-base-300"],["type","radio","name","scenario-accordion",3,"checked"],[1,"collapse-title","font-semibold","text-sm","bg-primary","text-primary-content"],[1,"badge","badge-sm","ml-2"],[1,"collapse-content","px-0"],[3,"view"],[3,"applyRequested","exportRequested","deleteRequested","view"]],template:function(i,n){i&1&&(x(0,"dialog",2,0)(2,"div",3)(3,"div",4)(4,"h2",5),g(5,"Scenarios"),v(),x(6,"div",6)(7,"button",7),z("click",function(){return n.openImportDialog()}),V(8,"i",8),v(),x(9,"button",9),z("click",function(){return n.close()}),V(10,"i",10),v()()(),x(11,"input",11,1),z("change",function(a){return n.handleImportFiles(a)}),v(),x(13,"input",12),z("ngModelChange",function(a){return n.searchTerm.set(a)}),v(),In(),K(14,I7,2,0,"p",13),x(15,"div",14),Pe(16,D7,10,9,"div",15,T7),v()(),x(18,"form",16)(19,"button",17),z("click",function(){return n.close()}),g(20,"close"),v()()(),x(21,"cc-delete-confirm-dialog",18),z("confirmed",function(){return n.confirmDelete()})("cancelled",function(){return n.cancelDelete()}),v(),V(22,"cc-import-feedback-dialog")),i&2&&(h(11),F("accept",n.acceptExtensions),h(2),F("ngModel",n.searchTerm()),An(),h(),Q(n.filteredScenarios().length===0?14:-1),h(2),Be(n.groupedScenarios()),h(5),F("scenarioName",n.deleteTarget()?.name??""))},dependencies:[mr,hr,Os,zs,cr,$s,dr,wc,Sc,yv],encapsulation:2})}}return e})();var F7=["listDialog"],L7=["saveDialog"];function N7(e,o){if(e&1){let t=we();x(0,"cc-apply-scenario-dialog",16),z("closed",function(){ae(t);let n=B();return se(n.handleApplyClosed())}),v()}if(e&2){let t=o;F("scenario",t.scenario)("metricData",t.metricData)}}var Ev=(()=>{class e{constructor(){this.scenariosService=T(ji),this.listDialog=Je.required("listDialog"),this.saveDialog=Je.required("saveDialog"),this.applyTarget=Se(null),this.scenarios=D(this.scenariosService.scenarios$,{initialValue:[]}),this.scenariosCountLabel=Y(()=>{let t=this.scenarios().length;return`${t} ${t===1?"scenario":"scenarios"} available`})}async ngOnInit(){await this.scenariosService.loadScenarios()}openScenarioList(){this.listDialog().open()}openSaveDialog(){this.saveDialog().open()}handleApplyRequested(t){this.applyTarget.set(t)}handleApplyClosed(){this.applyTarget.set(null)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-labels-scenarios-segment"]],viewQuery:function(i,n){i&1&&rt(n.listDialog,F7,5)(n.saveDialog,L7,5),i&2&&at(2)},hostAttrs:[1,"group","flex","flex-col","items-stretch","px-3","py-2","transition-colors","relative"],decls:23,vars:2,consts:[["listDialog",""],["saveDialog",""],[1,"flex","flex-col","items-stretch","gap-1.5","px-2","py-1","rounded-md","transition-colors","max-w-[220px]","min-w-[160px]"],["data-testid","metric-segment-labels",1,"flex","flex-col","gap-1"],[1,"flex","items-center","justify-between","gap-1"],[1,"text-[10px]","uppercase","tracking-wide","opacity-70"],["type","button","popovertarget","metric-settings-popover-labels","data-anchor-name","metric-segment-labels","title","Label Settings",1,"btn","btn-ghost","btn-xs","btn-square",2,"anchor-name","--metric-segment-labels"],[1,"fa","fa-cog","text-[10px]"],[1,"border-t","border-base-300","-mx-1"],["data-testid","metric-segment-scenario",1,"flex","flex-col","gap-1"],["type","button","title","Save current state as scenario","data-testid","metric-segment-scenario-save",1,"btn","btn-ghost","btn-xs","btn-square",3,"click"],[1,"fa","fa-plus","text-[10px]"],["type","button","title","Open saved scenarios",1,"text-sm","font-semibold","leading-tight","text-center","bg-transparent","border-0","p-0","rounded-sm","cursor-pointer","hover:bg-base-200","whitespace-nowrap","overflow-hidden","text-ellipsis",3,"click"],["popoverId","metric-settings-popover-labels","anchorName","metric-segment-labels","widthClass","w-80"],[3,"applyRequested"],[3,"scenario","metricData"],[3,"closed","scenario","metricData"]],template:function(i,n){if(i&1&&(x(0,"div",2)(1,"div",3)(2,"div",4)(3,"span",5),g(4,"Labels"),v(),x(5,"button",6),V(6,"i",7),v()()(),V(7,"div",8),x(8,"div",9)(9,"div",4)(10,"span",5),g(11,"Scenarios"),v(),x(12,"button",10),z("click",function(){return n.openSaveDialog()}),V(13,"i",11),v()(),x(14,"button",12),z("click",function(){return n.openScenarioList()}),g(15),v()()(),x(16,"cc-settings-popover-shell",13),V(17,"cc-label-settings-panel"),v(),x(18,"cc-scenario-list-dialog",14,0),z("applyRequested",function(a){return n.handleApplyRequested(a)}),v(),V(20,"cc-save-scenario-dialog",null,1),K(22,N7,1,2,"cc-apply-scenario-dialog",15)),i&2){let r;h(15),ge(" ",n.scenariosCountLabel()," "),h(7),Q((r=n.applyTarget())?22:-1,r)}},dependencies:[$d,am,rm,im,Ai],encapsulation:2})}}return e})();var kv=(()=>{class e{constructor(){this.preferencesReadWindow=T(sr),this.metricsBarWriteStore=T(Qe),this.isLinked=D(this.preferencesReadWindow.isColorMetricLinkedToHeightMetric$,{initialValue:!1}),this.iconClass=Y(()=>this.isLinked()?"fa fa-link":"fa fa-unlink"),this.title=Y(()=>this.isLinked()?"Unlink Height and Color Metric":"Link Height and Color Metric"),this.buttonClass=Y(()=>this.isLinked()?"btn btn-circle btn-sm ring-2 ring-primary text-primary bg-primary/10 border-0":"btn btn-circle btn-sm ring-1 ring-base-300 text-base-content/60 border-0 cc-link-button-dashed")}toggle(){this.metricsBarWriteStore.toggleIsHeightAndColorMetricLinked()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-link-color-height-button"]],hostAttrs:[1,"self-center","px-1"],decls:2,vars:8,consts:[["type","button",3,"click","title"]],template:function(i,n){i&1&&(y(0,"button",0),ie("click",function(){return n.toggle()}),pe(1,"i"),M()),i&2&&(Dt(n.buttonClass()),ce("title",n.title()),ot("aria-label",n.title())("data-testid","metric-link-button")("aria-pressed",n.isLinked()),h(),Dt(n.iconClass()))},encapsulation:2})}}return e})();function P7(e,o){e&1&&V(0,"cc-link-color-height-button")(1,"cc-color-segment")}function B7(e,o){if(e&1&&V(0,"cc-axis-card",0)(1,"cc-color-settings-popover",1),e&2){let t=B();F("metricName","Settings")("hasCog",!0)("cogPopoverId",t.deltaColorSettingsPopoverId)("cogAnchorName",t.deltaColorSettingsAnchorName)("testId","metric-segment-color-settings")("cogTestId","metric-segment-color-settings-cog"),h(),F("popoverId",t.deltaColorSettingsPopoverId)("anchorName",t.deltaColorSettingsAnchorName)}}function V7(e,o){e&1&&V(0,"cc-edge-segment")}var sm=(()=>{class e{constructor(){this.barBottom=Tf,this.fileStoreReadWindow=T(Re),this.metricsBarReadStore=T(ht),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.hasEdgeMetric=D(this.metricsBarReadStore.metricData$.pipe(qe(t=>t.edgeMetricData.length>0)),{initialValue:!1}),this.showColorMetricSegment=Y(()=>!this.isDeltaState()),this.deltaColorSettingsPopoverId="metric-settings-popover-color-delta",this.deltaColorSettingsAnchorName="metric-segment-color-settings"}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-metrics-bar"]],hostVars:2,hostBindings:function(i,n){i&2&&ze("bottom",n.barBottom)},features:[bi([{provide:fr,useValue:mf}]),Zi([Rf,gr])],decls:6,vars:2,consts:[["label","Color",3,"metricName","hasCog","cogPopoverId","cogAnchorName","testId","cogTestId"],[3,"popoverId","anchorName"]],template:function(i,n){i&1&&(V(0,"cc-area-segment")(1,"cc-height-segment"),K(2,P7,2,0)(3,B7,2,8),K(4,V7,1,0,"cc-edge-segment"),V(5,"cc-labels-scenarios-segment")),i&2&&(h(2),Q(n.showColorMetricSegment()?2:3),h(2),Q(n.hasEdgeMetric()?4:-1))},dependencies:[f2,_o,X3,cc,Y3,ev,Ev,kv],encapsulation:2})}}return e})();var lm=(()=>{class e extends $0{constructor(){super(...arguments),this.areaMetric=D(T(xe).areaMetric$,{requireSync:!0}),this.pathToNode=T(he).selectSignal(tf)}isEnabledFor(t){let i=this.pathToNode().get(t);return i!==void 0&&ts(i,this.areaMetric())}static{this.\u0275fac=(()=>{let t;return function(n){return(t||(t=hu(e)))(n||e)}})()}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var W7=(e,o,t,i)=>{let n=e.length>0?e.filter(d=>xi(d)):o,r=0,a=0,s=0,l=0;for(let d of n)i(d)&&r++,d.isExcluded&&a++,!i(d)&&!d.isExcluded&&(s++,ts(d,t)||l++);return{shown:s,flattened:r,excluded:a,noArea:l}},qv=Ae(af,Bi,yi,Ls,W7);var cm=(()=>{class e{constructor(){this.store=T(he),this.counts$=this.store.select(qv)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var Tv=Ae(Xp,e=>e?.map?Ji(e.map).descendants().map(({data:o})=>o).filter(o=>xi(o)):[]);var Ca=Ae(Tv,e=>{let o=new Map;for(let t of O7(e))o.set(t,e.map(i=>i.attributes?.[t]??0).filter(i=>typeof i=="number"&&!Number.isNaN(i)));return o});function O7(e){let o=new Set;for(let t of e)for(let i of Object.keys(t.attributes??{}))i!==zu&&o.add(i);return o}var dm=(()=>{class e{constructor(){this.store=T(he),this.metricValues$=this.store.select(Ca),this.descriptors$=this.store.select(Yn)}addRule(t){Wi(this.store,t.type,ws({rule:et(ke({},t),{id:z7()})}))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();function z7(){return`metric-rule-${crypto.randomUUID()}`}var hm=(()=>{class e{constructor(){this.mapStateReadWindow=T(xe),this.sharedViewReadWindow=T(Bt),this.store=T(he),this.idToBuildingService=T(nr),this.areaMetric=D(this.mapStateReadWindow.areaMetric$,{requireSync:!0}),this.buildingIds=D(this.idToBuildingService.buildingIds$,{requireSync:!0}),this.rootUnary=D(this.store.select(of),{requireSync:!0}),this.markedPackages=D(this.sharedViewReadWindow.markedPackages$,{requireSync:!0}),this.isFlattened=D(this.store.select(Ls),{requireSync:!0})}project(t){return j0(t,{areaMetric:this.areaMetric(),buildingIds:this.buildingIds(),rootUnary:this.rootUnary(),isFlattened:this.isFlattened(),hidesExcludedNodes:!0,markedPackages:this.markedPackages()})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var Nv=sd(Uw());var Rv=e=>/[*?]/.test(e);var $7={gt:">",gte:"\u2265",lt:"<",lte:"\u2264",eq:"="};function Iv(e){if(e.operator==="between"){let o=Math.min(e.value,e.upperValue??e.value),t=Math.max(e.value,e.upperValue??e.value);return`${e.metric} ${o}\u2026${t}`}return`${e.metric} ${$7[e.operator]} ${e.value}`}var j7=(e,o)=>(o.get(e.metric)??[]).filter(t=>$u(e,t)).length,Av=(e,o,t)=>e.filter(i=>i.type===t).map(i=>({id:i.id,label:Iv(i),affectedCount:j7(i,o),kind:"METRIC",metricRule:i})),Dv=Ae(dd,Ca,(e,o)=>Av(e,o,"flatten")),Fv=Ae(dd,Ca,(e,o)=>Av(e,o,"exclude"));var Pv=(e,o,t)=>{if(e.length===0)return[];let i=o.map(a=>ju(a.path)),{rules:n,combinedPositivePrefilter:r}=H7(e);return U7(n,r,i),n.map(({item:a,affectedCount:s})=>({id:`${t}/${a.path}`,label:a.path,item:a,effect:t,affectedCount:s,kind:Rv(a.path)?"RULE":"MANUAL"})).sort((a,s)=>a.label.localeCompare(s.label))};function H7(e){let o=(0,Nv.default)();return{rules:e.map(i=>{let{ignoredNodePaths:n,condition:r}=Hu(i.path);return r&&Uu(o,i.path),{item:i,ignoredNodePaths:n,condition:r,affectedCount:0}}),combinedPositivePrefilter:o}}function U7(e,o,t){let i=e.filter(r=>r.condition),n=e.filter(r=>!r.condition);for(let r of t)i.length>0&&o.ignores(r)&&Lv(i,r,!0),Lv(n,r,!1)}function Lv(e,o,t){for(let i of e)i.ignoredNodePaths.ignores(o)===t&&i.affectedCount++}var Bv=Ae(hs,Bi,Dv,(e,o,t)=>[...t,...Pv(e,o,"flatten")]),Vv=Ae(ds,Bi,Fv,(e,o,t)=>[...t,...Pv(e,o,"exclude")]);var Wv=(e,o)=>{let t=o.trim().split(",");return o.trim().startsWith("!")?(t[0]=t[0].slice(1),t.some(i=>e.some(n=>`!${Sr(i)}`===n.path))):t.some(i=>e.some(n=>Sr(i)===n.path))};var yc=Ae(fo,P0);var Ov=e=>Ae(fo,yc,e,(o,t,i)=>t||Wv(i,o)),zv=Ov(hs),$v=Ov(ds);var mm=(()=>{class e{constructor(){this.store=T(he),this.flattenRules$=this.store.select(Bv),this.excludeRules$=this.store.select(Vv),this.isFlattenPatternDisabled$=this.store.select(zv),this.isExcludePatternDisabled$=this.store.select($v)}removeRule(t){if(t.kind==="METRIC"){Wi(this.store,t.metricRule.type,Ss({id:t.metricRule.id}));return}let i=t.effect==="flatten"?vo({items:[t.item]}):Un({items:[t.item]});Wi(this.store,t.effect,i)}clearRules(t){Wi(this.store,t,ms({ruleEffect:t}))}ruleFromSearchPattern(t){Wi(this.store,t,F1(t))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var jv={patternSelector:fo,setPattern:Pi,isPatternEmptySelector:yc,searchedNodePathsSelector:sf};var um=(()=>{class e{constructor(){this.store=T(he),this.sharedViewReadWindow=T(Bt),this.threeSceneService=T(ft),this.idToBuildingService=T(nr),this.threeRendererService=T(kt),this.codeMapMouseEventService=T(on),this.codeMapTooltipService=T(or),this.selectedBuildingId=D(this.sharedViewReadWindow.selectedBuildingId$,{requireSync:!0}),this.hoveredNodeId=D(this.sharedViewReadWindow.hoveredNodeId$,{requireSync:!0})}isSelected(t){return this.selectedBuildingId()===t.path}isHovered(t){return this.hoveredNodeId()===t.path}select(t){this.store.dispatch(hd({value:t.path}));let i=this.idToBuildingService.get(t.id);this.codeMapMouseEventService.drawLabelSelectedBuilding(i),this.threeSceneService.selectBuilding(i),this.threeSceneService.clearConstantHighlight(),this.threeRendererService.render()}deselect(){this.store.dispatch(hd({value:null})),this.threeSceneService.clearSelection(),this.threeSceneService.clearConstantHighlight(),this.threeRendererService.render()}hover(t,i){this.store.dispatch(Xo({value:t.path})),this.codeMapMouseEventService.hoverNode(t.path),this.codeMapTooltipService.show(t,i.right,i.top)}hoverEnd(){this.store.dispatch(Xo({value:null})),this.codeMapMouseEventService.unhoverNode(),this.codeMapTooltipService.hide()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var Hv={options:Object.values(es),optionSelector:vf,ascendingSelector:xf,setOption:Cf,toggleAscending:()=>Mf()};var Uv=(e,o)=>e!==es.AREA_SIZE?Ae(Et,t=>Sd(yd(t.unifiedMapNode),e,o)):Ae(Et,yi,(t,i)=>Sd(yd(t.unifiedMapNode),e,o,i));var pm=(()=>{class e{constructor(){this.store=T(he)}rootNodeFor(t,i){return this.store.select(Uv(t,i))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=W({token:e,factory:e.\u0275fac})}}return e})();var G7=2e3,Gv=(()=>{class e{constructor(){this.actions$=T(dt),this.sharedViewReadWindow=T(Bt),this.revealService=T(Qs),this.actions$.pipe(st(ri),Ht(()=>this.sharedViewReadWindow.selectedBuildingId$.pipe(De(Boolean),ut(1),su(ou(G7)))),Lu()).subscribe(t=>this.revealService.revealNode(t,{expand:!1}))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275dir=$a({type:e,selectors:[["","ccRevealsSelectedNodeAfterLoad",""]]})}}return e})();var Xv=(()=>{class e{constructor(){this.store=T(he),this.selection=T(Ks),this.revealService=T(Qs),H0("metrics",t=>this.showNode(t))}showNode(t){this.store.select(rf(t)).pipe(ut(1)).subscribe(i=>{i&&(this.selection.select(i),this.revealService.revealNode(t))})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275dir=$a({type:e,selectors:[["","ccShowsHandedOverNode",""]]})}}return e})();var Kv=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=k({type:e,selectors:[["cc-metrics-view"]],features:[bi([hm,{provide:D0,useExisting:hm},um,{provide:Ks,useExisting:um},lm,{provide:F0,useExisting:lm},pm,{provide:A0,useExisting:pm},cm,{provide:I0,useExisting:cm},mm,{provide:T0,useExisting:mm},dm,{provide:q0,useExisting:dm},V0(Hv),B0(jv),{provide:E0,useValue:k0},{provide:O0,useValue:W0},N0("metrics"),Of()]),Zi([Gv,Xv])],decls:10,vars:0,consts:[["view","metrics"],["collapsedContent","",1,"flex-1","min-w-0"]],template:function(i,n){i&1&&(V(0,"cc-loading-file-progress-spinner",0)(1,"cc-code-map"),x(2,"cc-sidebar-explorer"),V(3,"cc-explorer-search-bar",1),v(),V(4,"cc-sidebar-inspector")(5,"cc-node-context-menu")(6,"cc-metrics-bar")(7,"cc-legend-panel")(8,"cc-file-extension-bar")(9,"cc-bottom-bar"))},dependencies:[rh,sm,z0,L0,R0,ih,oh,ah,_0,Vf],encapsulation:2})}}return e})();var Q7=[{path:vd.metrics,component:Kv},{path:vd.domain,loadComponent:()=>import("./chunk-7GO57JCA.js").then(e=>e.DomainViewComponent)}],Z7={provide:Cu,useClass:T1},Y7=[Fu(Q7),Z7],fm={providers:[qu(Ru(),Tu()),Pu(R1,{metaReducers:[I1]}),...Y7,{provide:Du,useClass:vl},Bu([...jg,...r1,...Xg,...Gg,...s1,...c1,...q1,...D1,...N1]),{provide:pu,useFactory:e=>()=>e.synchronizeVersion(),deps:[fg],multi:!0}]};var Cc=class{parse(o,t={}){t=Object.assign({binary:!1},t);let i=t.binary,n=[],r=0;o.traverse(function(L){if(L.isMesh){let j=L.geometry,q=j.index,P=j.getAttribute("position");r+=q!==null?q.count/3:P.count/3,n.push({object3d:L,geometry:j})}});let a,s=80;if(i===!0){let L=r*2+r*3*4*4+80+4,j=new ArrayBuffer(L);a=new DataView(j),a.setUint32(s,r,!0),s+=4}else a="",a+=`solid exported
|
|
3534
3548
|
`;let l=new Ke,d=new Ke,c=new Ke,m=new Ke,u=new Ke,p=new Ke;for(let L=0,j=n.length;L<j;L++){let q=n[L].object3d,P=n[L].geometry,O=P.index,H=P.getAttribute("position");if(O!==null)for(let G=0;G<O.count;G+=3){let J=O.getX(G+0),X=O.getX(G+1),me=O.getX(G+2);f(J,X,me,H,q)}else for(let G=0;G<H.count;G+=3){let J=G+0,X=G+1,me=G+2;f(J,X,me,H,q)}}return i===!1&&(a+=`endsolid exported
|
|
3535
3549
|
`),a;function f(L,j,q,P,O){l.fromBufferAttribute(P,L),d.fromBufferAttribute(P,j),c.fromBufferAttribute(P,q),O.isSkinnedMesh===!0&&(O.applyBoneTransform(L,l),O.applyBoneTransform(j,d),O.applyBoneTransform(q,c)),l.applyMatrix4(O.matrixWorld),d.applyMatrix4(O.matrixWorld),c.applyMatrix4(O.matrixWorld),S(l,d,c),R(l),R(d),R(c),i===!0?(a.setUint16(s,0,!0),s+=2):(a+=` endloop
|
|
3536
3550
|
`,a+=` endfacet
|