codecharta-visualization 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundler/browser/{chunk-F5WTPUXL.js → chunk-Q2ESIN7E.js} +18 -18
- package/dist/bundler/browser/chunk-W62KZUC2.js +17 -0
- package/dist/bundler/browser/index.html +2 -2
- package/dist/bundler/browser/{main-FOTAA6ZL.js → main-RCRI6XNH.js} +59 -46
- package/dist/bundler/browser/package.json +1 -1
- package/dist/bundler/browser/styles-4C6GEAO3.css +1 -0
- package/package.json +1 -1
- package/dist/bundler/browser/chunk-LBJ456D5.js +0 -17
- package/dist/bundler/browser/styles-E4W757FS.css +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{$ as z,$b as vp,$c as Cn,$d as Kp,$g as gf,$h as Qc,A as M,Aa as yt,Ab as mn,Ac as Ap,Ad as Qa,Ae as cs,Af as Ru,Ag as lo,Ah as If,B as q,Ba as g,Bb as Na,Bc as Fp,Bd as Ya,Be as jc,Bf as Au,C as ce,Ca as qe,Cb as Ft,Cc as Lp,Cd as Pn,Ce as ds,Cf as Fu,Cg as cf,D as de,Da as ge,Db as Ba,Dc as Ai,Dd as Za,De as hu,Df as Lu,Dg as df,E as To,Ea as Yi,Eb as Vc,Ec as gn,Ed as Do,Ee as hs,Ef as Pu,F as Ir,Fa as Pm,Fb as Di,Fc as bn,Fd as Ka,Fe as mu,Ff as Nu,Fg as hf,G as sn,Ga as Nm,Gb as np,Gc as Lt,Gd as Nn,Ge as pu,Gf as kt,Gh as Df,H as qm,Ha as cn,Hb as Xt,Hc as ja,Hd as Bn,He as uu,Hf as ft,Hg as mf,Hh as Rf,I as be,Ia as Zi,Ib as oi,Ic as Pp,Id as Ja,Ie as zn,If as Vt,Ig as Ss,J as Tm,Ja as Bm,Jb as Fx,Jc as Np,Jd as Gp,Je as ms,Jf as Bu,Jg as Cs,K as Ia,Kb as rp,Kc as Bp,Kd as es,Kf as Zn,Kg as Kn,Kh as Af,L as Im,La as rt,Lb as ap,Lc as ve,Le as ps,Lf as Vu,Lg as Jn,Lh as Ff,M as At,Ma as fi,Mb as sp,Mc as eo,Md as Xp,Me as fu,Mf as Pi,Mg as Ms,N as Dm,Na as gi,Nb as lp,Nc as vi,Nd as Fi,Ne as ao,Nf as Ei,Ng as er,O as ln,Oa as Aa,Ob as Ki,Oc as to,Od as Wc,Oe as so,Of as Wu,Og as co,P as Rm,Pb as Va,Pc as Pt,Pd as Qp,Pe as $n,Pg as ho,Q as Io,Qa as Vm,Qb as Lx,Qc as io,Qd as Yp,Qe as Et,Qf as Ou,Qg as Uc,Qh as Lf,R as h,Ra as Z,Rb as Px,Rc as xi,Rd as Ge,Re as Li,Rg as _s,S as te,Sa as Ce,Sb as cp,Sc as vn,Sd as Ye,Se as gu,Sg as Nr,Sh as Pf,T as _,Ta as H,Tb as dp,Tc as wi,Td as Ro,Te as bu,Tg as Gc,Th as Nf,U as Da,Ua as je,Ub as hp,Uc as xn,Ud as Vn,Ue as vu,Ug as ki,Uh as Ts,V as Xi,Va as dn,Vb as mp,Vc as wn,Vd as Zp,Ve as us,Vg as pf,Vh as Is,W as Qi,Wa as Bc,Wb as pp,Wc as yi,Wd as no,We as xu,Wg as tr,Wh as Bf,Xa as Wm,Xb as up,Xc as Ha,Xd as Ao,Xe as jn,Xg as uf,Y as Am,Ya as Om,Yb as fp,Yc as yn,Yd as Qt,Ye as fs,Yg as ff,Yh as Vf,Z as dt,Za as zm,Zb as gp,Zc as Sn,Zd as st,Ze as wu,Zg as Es,Zh as Wf,_ as O,_a as $m,_b as bp,_c as Vp,_d as ro,_e as Hn,_g as ks,_h as Of,a as xe,aa as Gt,ab as Fa,ac as pn,ad as Ua,ae as ts,af as yu,ah as bf,ai as zf,b as nt,ba as Pe,bb as jm,bc as Ri,bd as Mn,be as Wn,bf as Su,bg as zu,bh as mo,bi as $f,c as Je,ca as Ne,cb as Hm,cc as xp,cd as _n,ce as is,cf as Yt,cg as $u,ch as Wt,ci as jf,da as F,db as Um,dc as wp,dd as En,de as os,df as Hc,dg as ju,dh as vf,di as Hf,e as qa,ea as v,eb as Gm,ec as un,ed as Ga,ee as Jp,ef as Cu,eg as Hu,eh as xf,ei as Uf,f as wm,fa as b,fb as Xm,fc as yp,fd as kn,fe as eu,ff as Mu,fg as Uu,fh as Xc,fi as Gf,g as ym,ga as L,gb as Qm,gc as Wa,gd as qn,ge as tu,gg as Gu,gh as ir,gi as Xf,h as ke,ha as y,hb as hn,hc as Sp,hd as Tn,he as ns,hf as Un,hg as Xu,hh as wf,hi as Yc,i as It,ia as S,ib as La,ic as Cp,id as In,ie as rs,if as Mi,ig as Qu,ih as yf,ii as Qf,j as Sm,ja as fe,jb as Pa,jc as Oa,jd as Dn,je as iu,jf as _i,jg as Yu,jh as qs,k as Ui,kb as Ym,kc as Te,kd as Rn,ke as On,kf as Gn,kg as Zu,kh as Sf,l as Ie,la as Me,lb as Zm,lc as Mp,ld as An,le as as,lf as _u,lg as Ku,lh as Cf,m as Cm,ma as le,mb as Km,mc as ni,md as Wp,me as Oc,mf as Eu,mg as Ju,mh as or,n as ti,na as W,nb as D,nc as _p,nd as Ar,ne as zc,nf as Xn,ng as ef,nh as Mf,o as ut,oa as Y,ob as he,oc as Ep,od as Op,oe as $c,of as Qn,og as tf,oh as _f,p as Mm,pa as A,pb as Re,pc as za,pd as zp,pe as ou,pf as gs,pg as of,ph as Ef,q as _m,qa as Fm,qb as Jm,qc as Ji,qd as $p,qe as ss,qf as ku,qg as nf,r as Gi,ra as Lm,rb as Ae,rc as bi,rd as jp,re as nu,rf as bs,rg as rf,s as Ta,sa as Ra,sb as ht,sc as kp,sd as oo,se as ru,sf as vs,sg as af,sh as kf,t as mi,ta as pi,tb as at,tc as qp,td as Nt,te as au,tf as xs,tg as Fr,u as Ut,ua as ui,ub as ep,uc as Tp,ud as Hp,ue as su,uf as Bt,ug as sf,v as Em,va as tt,vb as tp,vc as $a,vd as Xa,ve as Ci,vf as qu,vg as ws,w as Fe,wa as it,wb as ip,wc as Ip,wd as Si,we as ls,wf as Tu,wg as Lr,x as km,xa as Dr,xb as op,xc as fn,xd as Fn,xe as lu,xf as Iu,xg as lf,y as $t,ya as Oe,yb as Rr,yc as Dp,yd as Ln,ye as cu,yf as Yn,yg as Pr,yh as qf,z as N,za as Le,zb as ii,zc as Rp,zd as Up,ze as du,zf as Du,zg as ys,zh as Tf}from"./chunk-F5WTPUXL.js";var D3=Je((DZ,I3)=>{"use strict";I3.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Co=Je(en=>{"use strict";var Ph,P8=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];en.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17};en.getSymbolTotalCodewords=function(n){return P8[n]};en.getBCHDigit=function(t){let n=0;for(;t!==0;)n++,t>>>=1;return n};en.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');Ph=n};en.isKanjiModeEnabled=function(){return typeof Ph<"u"};en.toSJIS=function(n){return Ph(n)}});var hc=Je(ei=>{"use strict";ei.L={bit:1};ei.M={bit:0};ei.Q={bit:3};ei.H={bit:2};function N8(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return ei.L;case"m":case"medium":return ei.M;case"q":case"quartile":return ei.Q;case"h":case"high":return ei.H;default:throw new Error("Unknown EC Level: "+t)}}ei.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4};ei.from=function(n,e){if(ei.isValid(n))return n;try{return N8(n)}catch{return e}}});var F3=Je((FZ,A3)=>{"use strict";function R3(){this.buffer=[],this.length=0}R3.prototype={get:function(t){let n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)===1},put:function(t,n){for(let e=0;e<n;e++)this.putBit((t>>>n-e-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}};A3.exports=R3});var P3=Je((LZ,L3)=>{"use strict";function pa(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}pa.prototype.set=function(t,n,e,i){let o=t*this.size+n;this.data[o]=e,i&&(this.reservedBit[o]=!0)};pa.prototype.get=function(t,n){return this.data[t*this.size+n]};pa.prototype.xor=function(t,n,e){this.data[t*this.size+n]^=e};pa.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]};L3.exports=pa});var N3=Je(mc=>{"use strict";var B8=Co().getSymbolSize;mc.getRowColCoords=function(n){if(n===1)return[];let e=Math.floor(n/7)+2,i=B8(n),o=i===145?26:Math.ceil((i-13)/(2*e-2))*2,r=[i-7];for(let a=1;a<e-1;a++)r[a]=r[a-1]-o;return r.push(6),r.reverse()};mc.getPositions=function(n){let e=[],i=mc.getRowColCoords(n),o=i.length;for(let r=0;r<o;r++)for(let a=0;a<o;a++)r===0&&a===0||r===0&&a===o-1||r===o-1&&a===0||e.push([i[r],i[a]]);return e}});var W3=Je(V3=>{"use strict";var V8=Co().getSymbolSize,B3=7;V3.getPositions=function(n){let e=V8(n);return[[0,0],[e-B3,0],[0,e-B3]]}});var O3=Je(ot=>{"use strict";ot.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var tn={N1:3,N2:3,N3:40,N4:10};ot.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7};ot.from=function(n){return ot.isValid(n)?parseInt(n,10):void 0};ot.getPenaltyN1=function(n){let e=n.size,i=0,o=0,r=0,a=null,s=null;for(let l=0;l<e;l++){o=r=0,a=s=null;for(let d=0;d<e;d++){let c=n.get(l,d);c===a?o++:(o>=5&&(i+=tn.N1+(o-5)),a=c,o=1),c=n.get(d,l),c===s?r++:(r>=5&&(i+=tn.N1+(r-5)),s=c,r=1)}o>=5&&(i+=tn.N1+(o-5)),r>=5&&(i+=tn.N1+(r-5))}return i};ot.getPenaltyN2=function(n){let e=n.size,i=0;for(let o=0;o<e-1;o++)for(let r=0;r<e-1;r++){let a=n.get(o,r)+n.get(o,r+1)+n.get(o+1,r)+n.get(o+1,r+1);(a===4||a===0)&&i++}return i*tn.N2};ot.getPenaltyN3=function(n){let e=n.size,i=0,o=0,r=0;for(let a=0;a<e;a++){o=r=0;for(let s=0;s<e;s++)o=o<<1&2047|n.get(a,s),s>=10&&(o===1488||o===93)&&i++,r=r<<1&2047|n.get(s,a),s>=10&&(r===1488||r===93)&&i++}return i*tn.N3};ot.getPenaltyN4=function(n){let e=0,i=n.data.length;for(let r=0;r<i;r++)e+=n.data[r];return Math.abs(Math.ceil(e*100/i/5)-10)*tn.N4};function W8(t,n,e){switch(t){case ot.Patterns.PATTERN000:return(n+e)%2===0;case ot.Patterns.PATTERN001:return n%2===0;case ot.Patterns.PATTERN010:return e%3===0;case ot.Patterns.PATTERN011:return(n+e)%3===0;case ot.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(e/3))%2===0;case ot.Patterns.PATTERN101:return n*e%2+n*e%3===0;case ot.Patterns.PATTERN110:return(n*e%2+n*e%3)%2===0;case ot.Patterns.PATTERN111:return(n*e%3+(n+e)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}ot.applyMask=function(n,e){let i=e.size;for(let o=0;o<i;o++)for(let r=0;r<i;r++)e.isReserved(r,o)||e.xor(r,o,W8(n,r,o))};ot.getBestMask=function(n,e){let i=Object.keys(ot.Patterns).length,o=0,r=1/0;for(let a=0;a<i;a++){e(a),ot.applyMask(a,n);let s=ot.getPenaltyN1(n)+ot.getPenaltyN2(n)+ot.getPenaltyN3(n)+ot.getPenaltyN4(n);ot.applyMask(a,n),s<r&&(r=s,o=a)}return o}});var Bh=Je(Nh=>{"use strict";var Mo=hc(),pc=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],uc=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Nh.getBlocksCount=function(n,e){switch(e){case Mo.L:return pc[(n-1)*4+0];case Mo.M:return pc[(n-1)*4+1];case Mo.Q:return pc[(n-1)*4+2];case Mo.H:return pc[(n-1)*4+3];default:return}};Nh.getTotalCodewordsCount=function(n,e){switch(e){case Mo.L:return uc[(n-1)*4+0];case Mo.M:return uc[(n-1)*4+1];case Mo.Q:return uc[(n-1)*4+2];case Mo.H:return uc[(n-1)*4+3];default:return}}});var z3=Je(gc=>{"use strict";var ua=new Uint8Array(512),fc=new Uint8Array(256);(function(){let n=1;for(let e=0;e<255;e++)ua[e]=n,fc[n]=e,n<<=1,n&256&&(n^=285);for(let e=255;e<512;e++)ua[e]=ua[e-255]})();gc.log=function(n){if(n<1)throw new Error("log("+n+")");return fc[n]};gc.exp=function(n){return ua[n]};gc.mul=function(n,e){return n===0||e===0?0:ua[fc[n]+fc[e]]}});var $3=Je(fa=>{"use strict";var Vh=z3();fa.mul=function(n,e){let i=new Uint8Array(n.length+e.length-1);for(let o=0;o<n.length;o++)for(let r=0;r<e.length;r++)i[o+r]^=Vh.mul(n[o],e[r]);return i};fa.mod=function(n,e){let i=new Uint8Array(n);for(;i.length-e.length>=0;){let o=i[0];for(let a=0;a<e.length;a++)i[a]^=Vh.mul(e[a],o);let r=0;for(;r<i.length&&i[r]===0;)r++;i=i.slice(r)}return i};fa.generateECPolynomial=function(n){let e=new Uint8Array([1]);for(let i=0;i<n;i++)e=fa.mul(e,new Uint8Array([1,Vh.exp(i)]));return e}});var U3=Je((zZ,H3)=>{"use strict";var j3=$3();function Wh(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Wh.prototype.initialize=function(n){this.degree=n,this.genPoly=j3.generateECPolynomial(this.degree)};Wh.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");let e=new Uint8Array(n.length+this.degree);e.set(n);let i=j3.mod(e,this.genPoly),o=this.degree-i.length;if(o>0){let r=new Uint8Array(this.degree);return r.set(i,o),r}return i};H3.exports=Wh});var Oh=Je(G3=>{"use strict";G3.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40}});var zh=Je(zi=>{"use strict";var X3="[0-9]+",O8="[A-Z $%*+\\-./:]+",ga="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ga=ga.replace(/u/g,"\\u");var z8="(?:(?![A-Z0-9 $%*+\\-./:]|"+ga+`)(?:.|[\r
|
|
1
|
+
import{$ as z,$b as vp,$c as Cn,$d as Kp,$g as gf,$h as Qc,A as M,Aa as St,Ab as mn,Ac as Ap,Ad as Qa,Ae as cs,Af as Ru,Ag as lo,Ah as If,B as q,Ba as g,Bb as Na,Bc as Fp,Bd as Ya,Be as jc,Bf as Au,C as ce,Ca as qe,Cb as Ft,Cc as Lp,Cd as Pn,Ce as ds,Cf as Fu,Cg as cf,D as de,Da as ge,Db as Ba,Dc as Ai,Dd as Za,De as hu,Df as Lu,Dg as df,E as To,Ea as Yi,Eb as Vc,Ec as gn,Ed as Do,Ee as hs,Ef as Pu,F as Ir,Fa as Pm,Fb as Di,Fc as bn,Fd as Ka,Fe as mu,Ff as Nu,Fg as hf,G as sn,Ga as Nm,Gb as np,Gc as Lt,Gd as Nn,Ge as pu,Gf as kt,Gh as Df,H as qm,Ha as cn,Hb as Xt,Hc as ja,Hd as Bn,He as uu,Hf as ft,Hg as mf,Hh as Rf,I as be,Ia as Zi,Ib as oi,Ic as Pp,Id as Ja,Ie as zn,If as Vt,Ig as ys,J as Tm,Ja as Bm,Jb as Fx,Jc as Np,Jd as Gp,Je as ms,Jf as Bu,Jg as Cs,K as Ia,Kb as rp,Kc as Bp,Kd as es,Kf as Zn,Kg as Kn,Kh as Af,L as Im,La as rt,Lb as ap,Lc as ve,Le as ps,Lf as Vu,Lg as Jn,Lh as Ff,M as At,Ma as fi,Mb as sp,Mc as eo,Md as Xp,Me as fu,Mf as Pi,Mg as Ms,N as Dm,Na as gi,Nb as lp,Nc as vi,Nd as Fi,Ne as ao,Nf as Ei,Ng as er,O as ln,Oa as Aa,Ob as Ki,Oc as to,Od as Wc,Oe as so,Of as Wu,Og as co,P as Rm,Pb as Va,Pc as Pt,Pd as Qp,Pe as $n,Pg as ho,Q as Io,Qa as Vm,Qb as Lx,Qc as io,Qd as Yp,Qe as Et,Qf as Ou,Qg as Uc,Qh as Lf,R as h,Ra as Z,Rb as Px,Rc as xi,Rd as Ge,Re as Li,Rg as _s,S as te,Sa as Ce,Sb as cp,Sc as vn,Sd as Ye,Se as gu,Sg as Nr,Sh as Pf,T as _,Ta as H,Tb as dp,Tc as wi,Td as Ro,Te as bu,Tg as Gc,Th as Nf,U as Da,Ua as je,Ub as hp,Uc as xn,Ud as Vn,Ue as vu,Ug as ki,Uh as Ts,V as Xi,Va as dn,Vb as mp,Vc as wn,Vd as Zp,Ve as us,Vg as pf,Vh as Is,W as Qi,Wa as Bc,Wb as pp,Wc as Si,Wd as no,We as xu,Wg as tr,Wh as Bf,Xa as Wm,Xb as up,Xc as Ha,Xd as Ao,Xe as jn,Xg as uf,Y as Am,Ya as Om,Yb as fp,Yc as Sn,Yd as Qt,Ye as fs,Yg as ff,Yh as Vf,Z as dt,Za as zm,Zb as gp,Zc as yn,Zd as st,Ze as wu,Zg as Es,Zh as Wf,_ as O,_a as $m,_b as bp,_c as Vp,_d as ro,_e as Hn,_g as ks,_h as Of,a as xe,aa as Gt,ab as Fa,ac as pn,ad as Ua,ae as ts,af as Su,ah as bf,ai as zf,b as nt,ba as Pe,bb as jm,bc as Ri,bd as Mn,be as Wn,bf as yu,bg as zu,bh as mo,bi as $f,c as Je,ca as Ne,cb as Hm,cc as xp,cd as _n,ce as is,cf as Yt,cg as $u,ch as Wt,ci as jf,da as F,db as Um,dc as wp,dd as En,de as os,df as Hc,dg as ju,dh as vf,di as Hf,e as qa,ea as v,eb as Gm,ec as un,ed as Ga,ee as Jp,ef as Cu,eg as Hu,eh as xf,ei as Uf,f as wm,fa as b,fb as Xm,fc as Sp,fd as kn,fe as eu,ff as Mu,fg as Uu,fh as Xc,fi as Gf,g as Sm,ga as L,gb as Qm,gc as Wa,gd as qn,ge as tu,gg as Gu,gh as ir,gi as Xf,h as ke,ha as S,hb as hn,hc as yp,hd as Tn,he as ns,hf as Un,hg as Xu,hh as wf,hi as Yc,i as It,ia as y,ib as La,ic as Cp,id as In,ie as rs,if as Mi,ig as Qu,ih as Sf,ii as Qf,j as ym,ja as fe,jb as Pa,jc as Oa,jd as Dn,je as iu,jf as _i,jg as Yu,jh as qs,k as Ui,kb as Ym,kc as Te,kd as Rn,ke as On,kf as Gn,kg as Zu,kh as yf,l as Ie,la as Me,lb as Zm,lc as Mp,ld as An,le as as,lf as _u,lg as Ku,lh as Cf,m as Cm,ma as le,mb as Km,mc as ni,md as Wp,me as Oc,mf as Eu,mg as Ju,mh as or,n as ti,na as W,nb as D,nc as _p,nd as Ar,ne as zc,nf as Xn,ng as ef,nh as Mf,o as ut,oa as Y,ob as he,oc as Ep,od as Op,oe as $c,of as Qn,og as tf,oh as _f,p as Mm,pa as A,pb as Re,pc as za,pd as zp,pe as ou,pf as gs,pg as of,ph as Ef,q as _m,qa as Fm,qb as Jm,qc as Ji,qd as $p,qe as ss,qf as ku,qg as nf,r as Gi,ra as Lm,rb as Ae,rc as bi,rd as jp,re as nu,rf as bs,rg as rf,s as Ta,sa as Ra,sb as ht,sc as kp,sd as oo,se as ru,sf as vs,sg as af,sh as kf,t as mi,ta as pi,tb as at,tc as qp,td as Nt,te as au,tf as xs,tg as Fr,u as Ut,ua as ui,ub as ep,uc as Tp,ud as Hp,ue as su,uf as Bt,ug as sf,v as Em,va as tt,vb as tp,vc as $a,vd as Xa,ve as Ci,vf as qu,vg as ws,w as Fe,wa as it,wb as ip,wc as Ip,wd as yi,we as ls,wf as Tu,wg as Lr,x as km,xa as Dr,xb as op,xc as fn,xd as Fn,xe as lu,xf as Iu,xg as lf,y as $t,ya as Oe,yb as Rr,yc as Dp,yd as Ln,ye as cu,yf as Yn,yg as Pr,yh as qf,z as N,za as Le,zb as ii,zc as Rp,zd as Up,ze as du,zf as Du,zg as Ss,zh as Tf}from"./chunk-Q2ESIN7E.js";var D3=Je((DZ,I3)=>{"use strict";I3.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Co=Je(en=>{"use strict";var Ph,P8=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];en.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17};en.getSymbolTotalCodewords=function(n){return P8[n]};en.getBCHDigit=function(t){let n=0;for(;t!==0;)n++,t>>>=1;return n};en.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');Ph=n};en.isKanjiModeEnabled=function(){return typeof Ph<"u"};en.toSJIS=function(n){return Ph(n)}});var hc=Je(ei=>{"use strict";ei.L={bit:1};ei.M={bit:0};ei.Q={bit:3};ei.H={bit:2};function N8(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return ei.L;case"m":case"medium":return ei.M;case"q":case"quartile":return ei.Q;case"h":case"high":return ei.H;default:throw new Error("Unknown EC Level: "+t)}}ei.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4};ei.from=function(n,e){if(ei.isValid(n))return n;try{return N8(n)}catch{return e}}});var F3=Je((FZ,A3)=>{"use strict";function R3(){this.buffer=[],this.length=0}R3.prototype={get:function(t){let n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)===1},put:function(t,n){for(let e=0;e<n;e++)this.putBit((t>>>n-e-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}};A3.exports=R3});var P3=Je((LZ,L3)=>{"use strict";function pa(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}pa.prototype.set=function(t,n,e,i){let o=t*this.size+n;this.data[o]=e,i&&(this.reservedBit[o]=!0)};pa.prototype.get=function(t,n){return this.data[t*this.size+n]};pa.prototype.xor=function(t,n,e){this.data[t*this.size+n]^=e};pa.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]};L3.exports=pa});var N3=Je(mc=>{"use strict";var B8=Co().getSymbolSize;mc.getRowColCoords=function(n){if(n===1)return[];let e=Math.floor(n/7)+2,i=B8(n),o=i===145?26:Math.ceil((i-13)/(2*e-2))*2,r=[i-7];for(let a=1;a<e-1;a++)r[a]=r[a-1]-o;return r.push(6),r.reverse()};mc.getPositions=function(n){let e=[],i=mc.getRowColCoords(n),o=i.length;for(let r=0;r<o;r++)for(let a=0;a<o;a++)r===0&&a===0||r===0&&a===o-1||r===o-1&&a===0||e.push([i[r],i[a]]);return e}});var W3=Je(V3=>{"use strict";var V8=Co().getSymbolSize,B3=7;V3.getPositions=function(n){let e=V8(n);return[[0,0],[e-B3,0],[0,e-B3]]}});var O3=Je(ot=>{"use strict";ot.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var tn={N1:3,N2:3,N3:40,N4:10};ot.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7};ot.from=function(n){return ot.isValid(n)?parseInt(n,10):void 0};ot.getPenaltyN1=function(n){let e=n.size,i=0,o=0,r=0,a=null,s=null;for(let l=0;l<e;l++){o=r=0,a=s=null;for(let d=0;d<e;d++){let c=n.get(l,d);c===a?o++:(o>=5&&(i+=tn.N1+(o-5)),a=c,o=1),c=n.get(d,l),c===s?r++:(r>=5&&(i+=tn.N1+(r-5)),s=c,r=1)}o>=5&&(i+=tn.N1+(o-5)),r>=5&&(i+=tn.N1+(r-5))}return i};ot.getPenaltyN2=function(n){let e=n.size,i=0;for(let o=0;o<e-1;o++)for(let r=0;r<e-1;r++){let a=n.get(o,r)+n.get(o,r+1)+n.get(o+1,r)+n.get(o+1,r+1);(a===4||a===0)&&i++}return i*tn.N2};ot.getPenaltyN3=function(n){let e=n.size,i=0,o=0,r=0;for(let a=0;a<e;a++){o=r=0;for(let s=0;s<e;s++)o=o<<1&2047|n.get(a,s),s>=10&&(o===1488||o===93)&&i++,r=r<<1&2047|n.get(s,a),s>=10&&(r===1488||r===93)&&i++}return i*tn.N3};ot.getPenaltyN4=function(n){let e=0,i=n.data.length;for(let r=0;r<i;r++)e+=n.data[r];return Math.abs(Math.ceil(e*100/i/5)-10)*tn.N4};function W8(t,n,e){switch(t){case ot.Patterns.PATTERN000:return(n+e)%2===0;case ot.Patterns.PATTERN001:return n%2===0;case ot.Patterns.PATTERN010:return e%3===0;case ot.Patterns.PATTERN011:return(n+e)%3===0;case ot.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(e/3))%2===0;case ot.Patterns.PATTERN101:return n*e%2+n*e%3===0;case ot.Patterns.PATTERN110:return(n*e%2+n*e%3)%2===0;case ot.Patterns.PATTERN111:return(n*e%3+(n+e)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}ot.applyMask=function(n,e){let i=e.size;for(let o=0;o<i;o++)for(let r=0;r<i;r++)e.isReserved(r,o)||e.xor(r,o,W8(n,r,o))};ot.getBestMask=function(n,e){let i=Object.keys(ot.Patterns).length,o=0,r=1/0;for(let a=0;a<i;a++){e(a),ot.applyMask(a,n);let s=ot.getPenaltyN1(n)+ot.getPenaltyN2(n)+ot.getPenaltyN3(n)+ot.getPenaltyN4(n);ot.applyMask(a,n),s<r&&(r=s,o=a)}return o}});var Bh=Je(Nh=>{"use strict";var Mo=hc(),pc=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],uc=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Nh.getBlocksCount=function(n,e){switch(e){case Mo.L:return pc[(n-1)*4+0];case Mo.M:return pc[(n-1)*4+1];case Mo.Q:return pc[(n-1)*4+2];case Mo.H:return pc[(n-1)*4+3];default:return}};Nh.getTotalCodewordsCount=function(n,e){switch(e){case Mo.L:return uc[(n-1)*4+0];case Mo.M:return uc[(n-1)*4+1];case Mo.Q:return uc[(n-1)*4+2];case Mo.H:return uc[(n-1)*4+3];default:return}}});var z3=Je(gc=>{"use strict";var ua=new Uint8Array(512),fc=new Uint8Array(256);(function(){let n=1;for(let e=0;e<255;e++)ua[e]=n,fc[n]=e,n<<=1,n&256&&(n^=285);for(let e=255;e<512;e++)ua[e]=ua[e-255]})();gc.log=function(n){if(n<1)throw new Error("log("+n+")");return fc[n]};gc.exp=function(n){return ua[n]};gc.mul=function(n,e){return n===0||e===0?0:ua[fc[n]+fc[e]]}});var $3=Je(fa=>{"use strict";var Vh=z3();fa.mul=function(n,e){let i=new Uint8Array(n.length+e.length-1);for(let o=0;o<n.length;o++)for(let r=0;r<e.length;r++)i[o+r]^=Vh.mul(n[o],e[r]);return i};fa.mod=function(n,e){let i=new Uint8Array(n);for(;i.length-e.length>=0;){let o=i[0];for(let a=0;a<e.length;a++)i[a]^=Vh.mul(e[a],o);let r=0;for(;r<i.length&&i[r]===0;)r++;i=i.slice(r)}return i};fa.generateECPolynomial=function(n){let e=new Uint8Array([1]);for(let i=0;i<n;i++)e=fa.mul(e,new Uint8Array([1,Vh.exp(i)]));return e}});var U3=Je((zZ,H3)=>{"use strict";var j3=$3();function Wh(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Wh.prototype.initialize=function(n){this.degree=n,this.genPoly=j3.generateECPolynomial(this.degree)};Wh.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");let e=new Uint8Array(n.length+this.degree);e.set(n);let i=j3.mod(e,this.genPoly),o=this.degree-i.length;if(o>0){let r=new Uint8Array(this.degree);return r.set(i,o),r}return i};H3.exports=Wh});var Oh=Je(G3=>{"use strict";G3.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40}});var zh=Je(zi=>{"use strict";var X3="[0-9]+",O8="[A-Z $%*+\\-./:]+",ga="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ga=ga.replace(/u/g,"\\u");var z8="(?:(?![A-Z0-9 $%*+\\-./:]|"+ga+`)(?:.|[\r
|
|
2
2
|
]))+`;zi.KANJI=new RegExp(ga,"g");zi.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");zi.BYTE=new RegExp(z8,"g");zi.NUMERIC=new RegExp(X3,"g");zi.ALPHANUMERIC=new RegExp(O8,"g");var $8=new RegExp("^"+ga+"$"),j8=new RegExp("^"+X3+"$"),H8=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");zi.testKanji=function(n){return $8.test(n)};zi.testNumeric=function(n){return j8.test(n)};zi.testAlphanumeric=function(n){return H8.test(n)}});var _o=Je(gt=>{"use strict";var U8=Oh(),$h=zh();gt.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};gt.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};gt.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};gt.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};gt.MIXED={bit:-1};gt.getCharCountIndicator=function(n,e){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!U8.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?n.ccBits[0]:e<27?n.ccBits[1]:n.ccBits[2]};gt.getBestModeForData=function(n){return $h.testNumeric(n)?gt.NUMERIC:$h.testAlphanumeric(n)?gt.ALPHANUMERIC:$h.testKanji(n)?gt.KANJI:gt.BYTE};gt.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")};gt.isValid=function(n){return n&&n.bit&&n.ccBits};function G8(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return gt.NUMERIC;case"alphanumeric":return gt.ALPHANUMERIC;case"kanji":return gt.KANJI;case"byte":return gt.BYTE;default:throw new Error("Unknown mode: "+t)}}gt.from=function(n,e){if(gt.isValid(n))return n;try{return G8(n)}catch{return e}}});var J3=Je(on=>{"use strict";var bc=Co(),X8=Bh(),Q3=hc(),Eo=_o(),jh=Oh(),Z3=7973,Y3=bc.getBCHDigit(Z3);function Q8(t,n,e){for(let i=1;i<=40;i++)if(n<=on.getCapacity(i,e,t))return i}function K3(t,n){return Eo.getCharCountIndicator(t,n)+4}function Y8(t,n){let e=0;return t.forEach(function(i){let o=K3(i.mode,n);e+=o+i.getBitsLength()}),e}function Z8(t,n){for(let e=1;e<=40;e++)if(Y8(t,e)<=on.getCapacity(e,n,Eo.MIXED))return e}on.from=function(n,e){return jh.isValid(n)?parseInt(n,10):e};on.getCapacity=function(n,e,i){if(!jh.isValid(n))throw new Error("Invalid QR Code version");typeof i>"u"&&(i=Eo.BYTE);let o=bc.getSymbolTotalCodewords(n),r=X8.getTotalCodewordsCount(n,e),a=(o-r)*8;if(i===Eo.MIXED)return a;let s=a-K3(i,n);switch(i){case Eo.NUMERIC:return Math.floor(s/10*3);case Eo.ALPHANUMERIC:return Math.floor(s/11*2);case Eo.KANJI:return Math.floor(s/13);case Eo.BYTE:default:return Math.floor(s/8)}};on.getBestVersionForData=function(n,e){let i,o=Q3.from(e,Q3.M);if(Array.isArray(n)){if(n.length>1)return Z8(n,o);if(n.length===0)return 1;i=n[0]}else i=n;return Q8(i.mode,i.getLength(),o)};on.getEncodedBits=function(n){if(!jh.isValid(n)||n<7)throw new Error("Invalid QR Code version");let e=n<<12;for(;bc.getBCHDigit(e)-Y3>=0;)e^=Z3<<bc.getBCHDigit(e)-Y3;return n<<12|e}});var ov=Je(iv=>{"use strict";var Hh=Co(),tv=1335,K8=21522,ev=Hh.getBCHDigit(tv);iv.getEncodedBits=function(n,e){let i=n.bit<<3|e,o=i<<10;for(;Hh.getBCHDigit(o)-ev>=0;)o^=tv<<Hh.getBCHDigit(o)-ev;return(i<<10|o)^K8}});var rv=Je((XZ,nv)=>{"use strict";var J8=_o();function Cr(t){this.mode=J8.NUMERIC,this.data=t.toString()}Cr.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)};Cr.prototype.getLength=function(){return this.data.length};Cr.prototype.getBitsLength=function(){return Cr.getBitsLength(this.data.length)};Cr.prototype.write=function(n){let e,i,o;for(e=0;e+3<=this.data.length;e+=3)i=this.data.substr(e,3),o=parseInt(i,10),n.put(o,10);let r=this.data.length-e;r>0&&(i=this.data.substr(e),o=parseInt(i,10),n.put(o,r*3+1))};nv.exports=Cr});var sv=Je((QZ,av)=>{"use strict";var e7=_o(),Uh=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Mr(t){this.mode=e7.ALPHANUMERIC,this.data=t}Mr.getBitsLength=function(n){return 11*Math.floor(n/2)+6*(n%2)};Mr.prototype.getLength=function(){return this.data.length};Mr.prototype.getBitsLength=function(){return Mr.getBitsLength(this.data.length)};Mr.prototype.write=function(n){let e;for(e=0;e+2<=this.data.length;e+=2){let i=Uh.indexOf(this.data[e])*45;i+=Uh.indexOf(this.data[e+1]),n.put(i,11)}this.data.length%2&&n.put(Uh.indexOf(this.data[e]),6)};av.exports=Mr});var cv=Je((YZ,lv)=>{"use strict";var t7=_o();function _r(t){this.mode=t7.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}_r.getBitsLength=function(n){return n*8};_r.prototype.getLength=function(){return this.data.length};_r.prototype.getBitsLength=function(){return _r.getBitsLength(this.data.length)};_r.prototype.write=function(t){for(let n=0,e=this.data.length;n<e;n++)t.put(this.data[n],8)};lv.exports=_r});var hv=Je((ZZ,dv)=>{"use strict";var i7=_o(),o7=Co();function Er(t){this.mode=i7.KANJI,this.data=t}Er.getBitsLength=function(n){return n*13};Er.prototype.getLength=function(){return this.data.length};Er.prototype.getBitsLength=function(){return Er.getBitsLength(this.data.length)};Er.prototype.write=function(t){let n;for(n=0;n<this.data.length;n++){let e=o7.toSJIS(this.data[n]);if(e>=33088&&e<=40956)e-=33088;else if(e>=57408&&e<=60351)e-=49472;else throw new Error("Invalid SJIS character: "+this.data[n]+`
|
|
3
3
|
Make sure your charset is UTF-8`);e=(e>>>8&255)*192+(e&255),t.put(e,13)}};dv.exports=Er});var mv=Je((KZ,Gh)=>{"use strict";var ba={single_source_shortest_paths:function(t,n,e){var i={},o={};o[n]=0;var r=ba.PriorityQueue.make();r.push(n,0);for(var a,s,l,d,c,m,p,u,k;!r.empty();){a=r.pop(),s=a.value,d=a.cost,c=t[s]||{};for(l in c)c.hasOwnProperty(l)&&(m=c[l],p=d+m,u=o[l],k=typeof o[l]>"u",(k||u>p)&&(o[l]=p,r.push(l,p),i[l]=s))}if(typeof e<"u"&&typeof o[e]>"u"){var E=["Could not find a path from ",n," to ",e,"."].join("");throw new Error(E)}return i},extract_shortest_path_from_predecessor_list:function(t,n){for(var e=[],i=n,o;i;)e.push(i),o=t[i],i=t[i];return e.reverse(),e},find_path:function(t,n,e){var i=ba.single_source_shortest_paths(t,n,e);return ba.extract_shortest_path_from_predecessor_list(i,e)},PriorityQueue:{make:function(t){var n=ba.PriorityQueue,e={},i;t=t||{};for(i in n)n.hasOwnProperty(i)&&(e[i]=n[i]);return e.queue=[],e.sorter=t.sorter||n.default_sorter,e},default_sorter:function(t,n){return t.cost-n.cost},push:function(t,n){var e={value:t,cost:n};this.queue.push(e),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof Gh<"u"&&(Gh.exports=ba)});var wv=Je(kr=>{"use strict";var Ke=_o(),fv=rv(),gv=sv(),bv=cv(),vv=hv(),va=zh(),vc=Co(),n7=mv();function pv(t){return unescape(encodeURIComponent(t)).length}function xa(t,n,e){let i=[],o;for(;(o=t.exec(e))!==null;)i.push({data:o[0],index:o.index,mode:n,length:o[0].length});return i}function xv(t){let n=xa(va.NUMERIC,Ke.NUMERIC,t),e=xa(va.ALPHANUMERIC,Ke.ALPHANUMERIC,t),i,o;return vc.isKanjiModeEnabled()?(i=xa(va.BYTE,Ke.BYTE,t),o=xa(va.KANJI,Ke.KANJI,t)):(i=xa(va.BYTE_KANJI,Ke.BYTE,t),o=[]),n.concat(e,i,o).sort(function(a,s){return a.index-s.index}).map(function(a){return{data:a.data,mode:a.mode,length:a.length}})}function Xh(t,n){switch(n){case Ke.NUMERIC:return fv.getBitsLength(t);case Ke.ALPHANUMERIC:return gv.getBitsLength(t);case Ke.KANJI:return vv.getBitsLength(t);case Ke.BYTE:return bv.getBitsLength(t)}}function r7(t){return t.reduce(function(n,e){let i=n.length-1>=0?n[n.length-1]:null;return i&&i.mode===e.mode?(n[n.length-1].data+=e.data,n):(n.push(e),n)},[])}function a7(t){let n=[];for(let e=0;e<t.length;e++){let i=t[e];switch(i.mode){case Ke.NUMERIC:n.push([i,{data:i.data,mode:Ke.ALPHANUMERIC,length:i.length},{data:i.data,mode:Ke.BYTE,length:i.length}]);break;case Ke.ALPHANUMERIC:n.push([i,{data:i.data,mode:Ke.BYTE,length:i.length}]);break;case Ke.KANJI:n.push([i,{data:i.data,mode:Ke.BYTE,length:pv(i.data)}]);break;case Ke.BYTE:n.push([{data:i.data,mode:Ke.BYTE,length:pv(i.data)}])}}return n}function s7(t,n){let e={},i={start:{}},o=["start"];for(let r=0;r<t.length;r++){let a=t[r],s=[];for(let l=0;l<a.length;l++){let d=a[l],c=""+r+l;s.push(c),e[c]={node:d,lastCount:0},i[c]={};for(let m=0;m<o.length;m++){let p=o[m];e[p]&&e[p].node.mode===d.mode?(i[p][c]=Xh(e[p].lastCount+d.length,d.mode)-Xh(e[p].lastCount,d.mode),e[p].lastCount+=d.length):(e[p]&&(e[p].lastCount=d.length),i[p][c]=Xh(d.length,d.mode)+4+Ke.getCharCountIndicator(d.mode,n))}}o=s}for(let r=0;r<o.length;r++)i[o[r]].end=0;return{map:i,table:e}}function uv(t,n){let e,i=Ke.getBestModeForData(t);if(e=Ke.from(n,i),e!==Ke.BYTE&&e.bit<i.bit)throw new Error('"'+t+'" cannot be encoded with mode '+Ke.toString(e)+`.
|
|
4
|
-
Suggested mode is: `+Ke.toString(i));switch(e===Ke.KANJI&&!vc.isKanjiModeEnabled()&&(e=Ke.BYTE),e){case Ke.NUMERIC:return new fv(t);case Ke.ALPHANUMERIC:return new gv(t);case Ke.KANJI:return new vv(t);case Ke.BYTE:return new bv(t)}}kr.fromArray=function(n){return n.reduce(function(e,i){return typeof i=="string"?e.push(uv(i,null)):i.data&&e.push(uv(i.data,i.mode)),e},[])};kr.fromString=function(n,e){let i=xv(n,vc.isKanjiModeEnabled()),o=a7(i),r=s7(o,e),a=n7.find_path(r.map,"start","end"),s=[];for(let l=1;l<a.length-1;l++)s.push(r.table[a[l]].node);return kr.fromArray(r7(s))};kr.rawSplit=function(n){return kr.fromArray(xv(n,vc.isKanjiModeEnabled()))}});var
|
|
4
|
+
Suggested mode is: `+Ke.toString(i));switch(e===Ke.KANJI&&!vc.isKanjiModeEnabled()&&(e=Ke.BYTE),e){case Ke.NUMERIC:return new fv(t);case Ke.ALPHANUMERIC:return new gv(t);case Ke.KANJI:return new vv(t);case Ke.BYTE:return new bv(t)}}kr.fromArray=function(n){return n.reduce(function(e,i){return typeof i=="string"?e.push(uv(i,null)):i.data&&e.push(uv(i.data,i.mode)),e},[])};kr.fromString=function(n,e){let i=xv(n,vc.isKanjiModeEnabled()),o=a7(i),r=s7(o,e),a=n7.find_path(r.map,"start","end"),s=[];for(let l=1;l<a.length-1;l++)s.push(r.table[a[l]].node);return kr.fromArray(r7(s))};kr.rawSplit=function(n){return kr.fromArray(xv(n,vc.isKanjiModeEnabled()))}});var yv=Je(Sv=>{"use strict";var wc=Co(),Qh=hc(),l7=F3(),c7=P3(),d7=N3(),h7=W3(),Kh=O3(),Jh=Bh(),m7=U3(),xc=J3(),p7=ov(),u7=_o(),Yh=wv();function f7(t,n){let e=t.size,i=h7.getPositions(n);for(let o=0;o<i.length;o++){let r=i[o][0],a=i[o][1];for(let s=-1;s<=7;s++)if(!(r+s<=-1||e<=r+s))for(let l=-1;l<=7;l++)a+l<=-1||e<=a+l||(s>=0&&s<=6&&(l===0||l===6)||l>=0&&l<=6&&(s===0||s===6)||s>=2&&s<=4&&l>=2&&l<=4?t.set(r+s,a+l,!0,!0):t.set(r+s,a+l,!1,!0))}}function g7(t){let n=t.size;for(let e=8;e<n-8;e++){let i=e%2===0;t.set(e,6,i,!0),t.set(6,e,i,!0)}}function b7(t,n){let e=d7.getPositions(n);for(let i=0;i<e.length;i++){let o=e[i][0],r=e[i][1];for(let a=-2;a<=2;a++)for(let s=-2;s<=2;s++)a===-2||a===2||s===-2||s===2||a===0&&s===0?t.set(o+a,r+s,!0,!0):t.set(o+a,r+s,!1,!0)}}function v7(t,n){let e=t.size,i=xc.getEncodedBits(n),o,r,a;for(let s=0;s<18;s++)o=Math.floor(s/3),r=s%3+e-8-3,a=(i>>s&1)===1,t.set(o,r,a,!0),t.set(r,o,a,!0)}function Zh(t,n,e){let i=t.size,o=p7.getEncodedBits(n,e),r,a;for(r=0;r<15;r++)a=(o>>r&1)===1,r<6?t.set(r,8,a,!0):r<8?t.set(r+1,8,a,!0):t.set(i-15+r,8,a,!0),r<8?t.set(8,i-r-1,a,!0):r<9?t.set(8,15-r-1+1,a,!0):t.set(8,15-r-1,a,!0);t.set(i-8,8,1,!0)}function x7(t,n){let e=t.size,i=-1,o=e-1,r=7,a=0;for(let s=e-1;s>0;s-=2)for(s===6&&s--;;){for(let l=0;l<2;l++)if(!t.isReserved(o,s-l)){let d=!1;a<n.length&&(d=(n[a]>>>r&1)===1),t.set(o,s-l,d),r--,r===-1&&(a++,r=7)}if(o+=i,o<0||e<=o){o-=i,i=-i;break}}}function w7(t,n,e){let i=new l7;e.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),u7.getCharCountIndicator(l.mode,t)),l.write(i)});let o=wc.getSymbolTotalCodewords(t),r=Jh.getTotalCodewordsCount(t,n),a=(o-r)*8;for(i.getLengthInBits()+4<=a&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);let s=(a-i.getLengthInBits())/8;for(let l=0;l<s;l++)i.put(l%2?17:236,8);return S7(i,t,n)}function S7(t,n,e){let i=wc.getSymbolTotalCodewords(n),o=Jh.getTotalCodewordsCount(n,e),r=i-o,a=Jh.getBlocksCount(n,e),s=i%a,l=a-s,d=Math.floor(i/a),c=Math.floor(r/a),m=c+1,p=d-c,u=new m7(p),k=0,E=new Array(a),P=new Array(a),$=0,ee=new Uint8Array(t.buffer);for(let ie=0;ie<a;ie++){let oe=ie<l?c:m;E[ie]=ee.slice(k,k+oe),P[ie]=u.encode(E[ie]),k+=oe,$=Math.max($,oe)}let B=new Uint8Array(i),j=0,G,K;for(G=0;G<$;G++)for(K=0;K<a;K++)G<E[K].length&&(B[j++]=E[K][G]);for(G=0;G<p;G++)for(K=0;K<a;K++)B[j++]=P[K][G];return B}function y7(t,n,e,i){let o;if(Array.isArray(t))o=Yh.fromArray(t);else if(typeof t=="string"){let d=n;if(!d){let c=Yh.rawSplit(t);d=xc.getBestVersionForData(c,e)}o=Yh.fromString(t,d||40)}else throw new Error("Invalid data");let r=xc.getBestVersionForData(o,e);if(!r)throw new Error("The amount of data is too big to be stored in a QR Code");if(!n)n=r;else if(n<r)throw new Error(`
|
|
5
5
|
The chosen QR Code version cannot contain this amount of data.
|
|
6
6
|
Minimum version required to store current data is: `+r+`.
|
|
7
|
-
`);let a=w7(n,e,o),s=wc.getSymbolSize(n),l=new c7(s);return f7(l,n),g7(l),b7(l,n),Zh(l,e,0),n>=7&&v7(l,n),x7(l,a),isNaN(i)&&(i=Kh.getBestMask(l,Zh.bind(null,l,e))),Kh.applyMask(i,l),Zh(l,e,i),{modules:l,version:n,errorCorrectionLevel:e,maskPattern:i,segments:o}}
|
|
8
|
-
`;return typeof i=="function"&&i(null,p),p}});var Tv=Je(wa=>{"use strict";var k7=D3(),om=
|
|
9
|
-
]`).replace("lheading",l0).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),Zx=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kx=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,d0=/^( {2,}|\\)\n(?!\s*$)/,Jx=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,nr=/[\p{P}\p{S}]/u,Ns=/[\s\p{P}\p{S}]/u,ad=/[^\s\p{P}\p{S}]/u,
|
|
7
|
+
`);let a=w7(n,e,o),s=wc.getSymbolSize(n),l=new c7(s);return f7(l,n),g7(l),b7(l,n),Zh(l,e,0),n>=7&&v7(l,n),x7(l,a),isNaN(i)&&(i=Kh.getBestMask(l,Zh.bind(null,l,e))),Kh.applyMask(i,l),Zh(l,e,i),{modules:l,version:n,errorCorrectionLevel:e,maskPattern:i,segments:o}}Sv.create=function(n,e){if(typeof n>"u"||n==="")throw new Error("No input text");let i=Qh.M,o,r;return typeof e<"u"&&(i=Qh.from(e.errorCorrectionLevel,Qh.M),o=xc.from(e.version),r=Kh.from(e.maskPattern),e.toSJISFunc&&wc.setToSJISFunction(e.toSJISFunc)),y7(n,o,i,r)}});var em=Je(nn=>{"use strict";function Cv(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let n=t.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+t);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(i){return[i,i]}))),n.length===6&&n.push("F","F");let e=parseInt(n.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:e&255,hex:"#"+n.slice(0,6).join("")}}nn.getOptions=function(n){n||(n={}),n.color||(n.color={});let e=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,i=n.width&&n.width>=21?n.width:void 0,o=n.scale||4;return{width:i,scale:i?4:o,margin:e,color:{dark:Cv(n.color.dark||"#000000ff"),light:Cv(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}};nn.getScale=function(n,e){return e.width&&e.width>=n+e.margin*2?e.width/(n+e.margin*2):e.scale};nn.getImageWidth=function(n,e){let i=nn.getScale(n,e);return Math.floor((n+e.margin*2)*i)};nn.qrToImageData=function(n,e,i){let o=e.modules.size,r=e.modules.data,a=nn.getScale(o,i),s=Math.floor((o+i.margin*2)*a),l=i.margin*a,d=[i.color.light,i.color.dark];for(let c=0;c<s;c++)for(let m=0;m<s;m++){let p=(c*s+m)*4,u=i.color.light;if(c>=l&&m>=l&&c<s-l&&m<s-l){let k=Math.floor((c-l)/a),E=Math.floor((m-l)/a);u=d[r[k*o+E]?1:0]}n[p++]=u.r,n[p++]=u.g,n[p++]=u.b,n[p]=u.a}}});var Mv=Je(Sc=>{"use strict";var tm=em();function C7(t,n,e){t.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=e,n.width=e,n.style.height=e+"px",n.style.width=e+"px"}function M7(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}Sc.render=function(n,e,i){let o=i,r=e;typeof o>"u"&&(!e||!e.getContext)&&(o=e,e=void 0),e||(r=M7()),o=tm.getOptions(o);let a=tm.getImageWidth(n.modules.size,o),s=r.getContext("2d"),l=s.createImageData(a,a);return tm.qrToImageData(l.data,n,o),C7(s,r,a),s.putImageData(l,0,0),r};Sc.renderToDataURL=function(n,e,i){let o=i;typeof o>"u"&&(!e||!e.getContext)&&(o=e,e=void 0),o||(o={});let r=Sc.render(n,e,o),a=o.type||"image/png",s=o.rendererOpts||{};return r.toDataURL(a,s.quality)}});var kv=Je(Ev=>{"use strict";var _7=em();function _v(t,n){let e=t.a/255,i=n+'="'+t.hex+'"';return e<1?i+" "+n+'-opacity="'+e.toFixed(2).slice(1)+'"':i}function im(t,n,e){let i=t+n;return typeof e<"u"&&(i+=" "+e),i}function E7(t,n,e){let i="",o=0,r=!1,a=0;for(let s=0;s<t.length;s++){let l=Math.floor(s%n),d=Math.floor(s/n);!l&&!r&&(r=!0),t[s]?(a++,s>0&&l>0&&t[s-1]||(i+=r?im("M",l+e,.5+d+e):im("m",o,0),o=0,r=!1),l+1<n&&t[s+1]||(i+=im("h",a),a=0)):o++}return i}Ev.render=function(n,e,i){let o=_7.getOptions(e),r=n.modules.size,a=n.modules.data,s=r+o.margin*2,l=o.color.light.a?"<path "+_v(o.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",d="<path "+_v(o.color.dark,"stroke")+' d="'+E7(a,r,o.margin)+'"/>',c='viewBox="0 0 '+s+" "+s+'"',p='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+c+' shape-rendering="crispEdges">'+l+d+`</svg>
|
|
8
|
+
`;return typeof i=="function"&&i(null,p),p}});var Tv=Je(wa=>{"use strict";var k7=D3(),om=yv(),qv=Mv(),q7=kv();function nm(t,n,e,i,o){let r=[].slice.call(arguments,1),a=r.length,s=typeof r[a-1]=="function";if(!s&&!k7())throw new Error("Callback required as last argument");if(s){if(a<2)throw new Error("Too few arguments provided");a===2?(o=e,e=n,n=i=void 0):a===3&&(n.getContext&&typeof o>"u"?(o=i,i=void 0):(o=i,i=e,e=n,n=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(e=n,n=i=void 0):a===2&&!n.getContext&&(i=e,e=n,n=void 0),new Promise(function(l,d){try{let c=om.create(e,i);l(t(c,n,i))}catch(c){d(c)}})}try{let l=om.create(e,i);o(null,t(l,n,i))}catch(l){o(l)}}wa.create=om.create;wa.toCanvas=nm.bind(null,qv.render);wa.toDataURL=nm.bind(null,qv.renderToDataURL);wa.toString=nm.bind(null,function(t,n,e){return q7.render(t,e)})});var Yf="codeChartaVersion",Zf=(()=>{class t{constructor(){this.localStorageRepo=q(ip)}readSavedVersion(){return this.localStorageRepo.read(Yf)}writeSavedVersion(e){this.localStorageRepo.write(Yf,e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Kf=(()=>{class t{constructor(){this.versionRepo=q(Zf),this.currentVersion=tp.version,this.previousVersion=be(null),this.shouldShowChangelog=be(!1)}getSavedVersion(){return this.versionRepo.readSavedVersion()}saveCurrentVersion(){this.versionRepo.writeSavedVersion(this.currentVersion)}setPreviousVersion(e){this.previousVersion.set(e)}setShouldShowChangelog(e){this.shouldShowChangelog.set(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ds=(()=>{class t{constructor(e){this.versionStore=e}get currentVersion(){return this.versionStore.currentVersion}get previousVersion(){return this.versionStore.previousVersion}get shouldShowChangelog(){return this.versionStore.shouldShowChangelog}synchronizeVersion(){let e=this.versionStore.getSavedVersion();if(e===null){this.versionStore.saveCurrentVersion();return}this.compareVersion(e,this.currentVersion)<0&&(this.versionStore.setPreviousVersion(e),this.versionStore.setShouldShowChangelog(!0),this.versionStore.saveCurrentVersion())}acknowledgeChangelog(){this.versionStore.setShouldShowChangelog(!1)}compareVersion(e,i){let o=this.parseSemver(e),r=this.parseSemver(i);return o.major!==r.major?o.major>r.major?1:-1:o.minor!==r.minor?o.minor>r.minor?1:-1:o.patch!==r.patch?o.patch>r.patch?1:-1:0}parseSemver(e){let i=e.split(".");return{major:Number.parseInt(i[0])||0,minor:Number.parseInt(i[1])||0,patch:Number.parseInt(i[2])||0}}static{this.\u0275fac=function(i){return new(i||t)(M(Kf))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function ed(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Po=ed();function a0(t){Po=t}var Fo={exec:()=>null};function ze(t,n=""){let e=typeof t=="string"?t:t.source,i={replace:(o,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(Dt.caret,"$1"),e=e.replace(o,a),i},getRegex:()=>new RegExp(e,n)};return i}var Bx=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Dt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Vx=/^(?:[ \t]*(?:\n|$))+/,Wx=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ox=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Or=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zx=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,td=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,s0=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,l0=ze(s0).replace(/bull/g,td).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),$x=ze(s0).replace(/bull/g,td).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),id=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,jx=/^[^\n]+/,od=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Hx=ze(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",od).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ux=ze(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,td).getRegex(),Ps="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",nd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Gx=ze("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",nd).replace("tag",Ps).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),c0=ze(id).replace("hr",Or).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ps).getRegex(),Xx=ze(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",c0).getRegex(),rd={blockquote:Xx,code:Wx,def:Hx,fences:Ox,heading:zx,hr:Or,html:Gx,lheading:l0,list:Ux,newline:Vx,paragraph:c0,table:Fo,text:jx},e0=ze("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Or).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ps).getRegex(),Qx=nt(xe({},rd),{lheading:$x,table:e0,paragraph:ze(id).replace("hr",Or).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",e0).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ps).getRegex()}),Yx=nt(xe({},rd),{html:ze(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",nd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Fo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ze(id).replace("hr",Or).replace("heading",` *#{1,6} *[^
|
|
9
|
+
]`).replace("lheading",l0).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),Zx=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kx=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,d0=/^( {2,}|\\)\n(?!\s*$)/,Jx=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,nr=/[\p{P}\p{S}]/u,Ns=/[\s\p{P}\p{S}]/u,ad=/[^\s\p{P}\p{S}]/u,e4=ze(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ns).getRegex(),h0=/(?!~)[\p{P}\p{S}]/u,t4=/(?!~)[\s\p{P}\p{S}]/u,i4=/(?:[^\s\p{P}\p{S}]|~)/u,o4=ze(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Bx?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),m0=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,n4=ze(m0,"u").replace(/punct/g,nr).getRegex(),r4=ze(m0,"u").replace(/punct/g,h0).getRegex(),p0="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",a4=ze(p0,"gu").replace(/notPunctSpace/g,ad).replace(/punctSpace/g,Ns).replace(/punct/g,nr).getRegex(),s4=ze(p0,"gu").replace(/notPunctSpace/g,i4).replace(/punctSpace/g,t4).replace(/punct/g,h0).getRegex(),l4=ze("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ad).replace(/punctSpace/g,Ns).replace(/punct/g,nr).getRegex(),c4=ze(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,nr).getRegex(),d4="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",h4=ze(d4,"gu").replace(/notPunctSpace/g,ad).replace(/punctSpace/g,Ns).replace(/punct/g,nr).getRegex(),m4=ze(/\\(punct)/,"gu").replace(/punct/g,nr).getRegex(),p4=ze(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),u4=ze(nd).replace("(?:-->|$)","-->").getRegex(),f4=ze("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",u4).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),As=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,g4=ze(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",As).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),u0=ze(/^!?\[(label)\]\[(ref)\]/).replace("label",As).replace("ref",od).getRegex(),f0=ze(/^!?\[(ref)\](?:\[\])?/).replace("ref",od).getRegex(),b4=ze("reflink|nolink(?!\\()","g").replace("reflink",u0).replace("nolink",f0).getRegex(),t0=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,sd={_backpedal:Fo,anyPunctuation:m4,autolink:p4,blockSkip:o4,br:d0,code:Kx,del:Fo,delLDelim:Fo,delRDelim:Fo,emStrongLDelim:n4,emStrongRDelimAst:a4,emStrongRDelimUnd:l4,escape:Zx,link:g4,nolink:f0,punctuation:e4,reflink:u0,reflinkSearch:b4,tag:f4,text:Jx,url:Fo},v4=nt(xe({},sd),{link:ze(/^!?\[(label)\]\((.*?)\)/).replace("label",As).getRegex(),reflink:ze(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",As).getRegex()}),Zc=nt(xe({},sd),{emStrongRDelimAst:s4,emStrongLDelim:r4,delLDelim:c4,delRDelim:h4,url:ze(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",t0).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ze(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",t0).getRegex()}),x4=nt(xe({},Zc),{br:ze(d0).replace("{2,}","*").getRegex(),text:ze(Zc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Rs={normal:rd,gfm:Qx,pedantic:Yx},Br={normal:sd,gfm:Zc,breaks:x4,pedantic:v4},w4={"&":"&","<":"<",">":">",'"':""","'":"'"},i0=t=>w4[t];function qi(t,n){if(n){if(Dt.escapeTest.test(t))return t.replace(Dt.escapeReplace,i0)}else if(Dt.escapeTestNoEncode.test(t))return t.replace(Dt.escapeReplaceNoEncode,i0);return t}function o0(t){try{t=encodeURI(t).replace(Dt.percentDecode,"%")}catch{return null}return t}function n0(t,n){let e=t.replace(Dt.findPipe,(r,a,s)=>{let l=!1,d=a;for(;--d>=0&&s[d]==="\\";)l=!l;return l?"|":" |"}),i=e.split(Dt.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),n)if(i.length>n)i.splice(n);else for(;i.length<n;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(Dt.slashPipe,"|");return i}function Vr(t,n,e){let i=t.length;if(i===0)return"";let o=0;for(;o<i;){let r=t.charAt(i-o-1);if(r===n&&!e)o++;else if(r!==n&&e)o++;else break}return t.slice(0,i-o)}function S4(t,n){if(t.indexOf(n[1])===-1)return-1;let e=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===n[0])e++;else if(t[i]===n[1]&&(e--,e<0))return i;return e>0?-2:-1}function y4(t,n=0){let e=n,i="";for(let o of t)if(o===" "){let r=4-e%4;i+=" ".repeat(r),e+=r}else i+=o,e++;return i}function r0(t,n,e,i,o){let r=n.href,a=n.title||null,s=t[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:e,href:r,title:a,text:s,tokens:i.inlineTokens(s)};return i.state.inLink=!1,l}function C4(t,n,e){let i=t.match(e.other.indentCodeCompensation);if(i===null)return n;let o=i[1];return n.split(`
|
|
10
10
|
`).map(r=>{let a=r.match(e.other.beginningSpace);if(a===null)return r;let[s]=a;return s.length>=o.length?r.slice(o.length):r}).join(`
|
|
11
11
|
`)}var Fs=class{options;rules;lexer;constructor(t){this.options=t||Po}space(t){let n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){let n=this.rules.block.code.exec(t);if(n){let e=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Vr(e,`
|
|
12
|
-
`)}}}fences(t){let n=this.rules.block.fences.exec(t);if(n){let e=n[0],i=
|
|
12
|
+
`)}}}fences(t){let n=this.rules.block.fences.exec(t);if(n){let e=n[0],i=C4(e,n[3]||"",this.rules);return{type:"code",raw:e,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:i}}}heading(t){let n=this.rules.block.heading.exec(t);if(n){let e=n[2].trim();if(this.rules.other.endingHash.test(e)){let i=Vr(e,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(e=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(t){let n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:Vr(n[0],`
|
|
13
13
|
`)}}blockquote(t){let n=this.rules.block.blockquote.exec(t);if(n){let e=Vr(n[0],`
|
|
14
14
|
`).split(`
|
|
15
15
|
`),i="",o="",r=[];for(;e.length>0;){let a=!1,s=[],l;for(l=0;l<e.length;l++)if(this.rules.other.blockquoteStart.test(e[l]))s.push(e[l]),a=!0;else if(!a)s.push(e[l]);else break;e=e.slice(l);let d=s.join(`
|
|
@@ -21,7 +21,7 @@ ${c}`:c;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
21
21
|
`),E=this.blockquote(k);r[r.length-1]=E,i=i.substring(0,i.length-u.raw.length)+E.raw,o=o.substring(0,o.length-u.text.length)+E.text;break}else if(p?.type==="list"){let u=p,k=u.raw+`
|
|
22
22
|
`+e.join(`
|
|
23
23
|
`),E=this.list(k);r[r.length-1]=E,i=i.substring(0,i.length-p.raw.length)+E.raw,o=o.substring(0,o.length-u.raw.length)+E.raw,e=k.substring(r.at(-1).raw.length).split(`
|
|
24
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:r,text:o}}}list(t){let n=this.rules.block.list.exec(t);if(n){let e=n[1].trim(),i=e.length>1,o={type:"list",raw:"",ordered:i,start:i?+e.slice(0,-1):"",loose:!1,items:[]};e=i?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=i?e:"[*+-]");let r=this.rules.other.listItemRegex(e),a=!1;for(;t;){let l=!1,d="",c="";if(!(n=r.exec(t))||this.rules.block.hr.test(t))break;d=n[0],t=t.substring(d.length);let m=
|
|
24
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:r,text:o}}}list(t){let n=this.rules.block.list.exec(t);if(n){let e=n[1].trim(),i=e.length>1,o={type:"list",raw:"",ordered:i,start:i?+e.slice(0,-1):"",loose:!1,items:[]};e=i?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=i?e:"[*+-]");let r=this.rules.other.listItemRegex(e),a=!1;for(;t;){let l=!1,d="",c="";if(!(n=r.exec(t))||this.rules.block.hr.test(t))break;d=n[0],t=t.substring(d.length);let m=y4(n[2].split(`
|
|
25
25
|
`,1)[0],n[1].length),p=t.split(`
|
|
26
26
|
`,1)[0],u=!m.trim(),k=0;if(this.options.pedantic?(k=2,c=m.trimStart()):u?k=n[1].length+1:(k=m.search(this.rules.other.nonSpaceChar),k=k>4?1:k,c=m.slice(k),k+=n[1].length),u&&this.rules.other.blankLine.test(p)&&(d+=p+`
|
|
27
27
|
`,t=t.substring(p.length+1),l=!0),!l){let E=this.rules.other.nextBulletRegex(k),P=this.rules.other.hrRegex(k),$=this.rules.other.fencesBeginRegex(k),ee=this.rules.other.headingBeginRegex(k),B=this.rules.other.htmlBeginRegex(k),j=this.rules.other.blockquoteBeginRegex(k);for(;t;){let G=t.split(`
|
|
@@ -30,7 +30,7 @@ ${c}`:c;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
30
30
|
`+p}u=!p.trim(),d+=G+`
|
|
31
31
|
`,t=t.substring(G.length+1),m=K.slice(k)}}o.loose||(a?o.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(a=!0)),o.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),o.raw+=d}let s=o.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let l of o.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(l.raw);if(d){let c={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};l.checked=c.checked,o.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!o.loose){let d=l.tokens.filter(m=>m.type==="space"),c=d.length>0&&d.some(m=>this.rules.other.anyLine.test(m.raw));o.loose=c}}if(o.loose)for(let l of o.items){l.loose=!0;for(let d of l.tokens)d.type==="text"&&(d.type="paragraph")}return o}}html(t){let n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){let n=this.rules.block.def.exec(t);if(n){let e=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:e,raw:n[0],href:i,title:o}}}table(t){let n=this.rules.block.table.exec(t);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let e=n0(n[1]),i=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
32
32
|
`):[],r={type:"table",raw:n[0],header:[],align:[],rows:[]};if(e.length===i.length){for(let a of i)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<e.length;a++)r.header.push({text:e[a],tokens:this.lexer.inline(e[a]),header:!0,align:r.align[a]});for(let a of o)r.rows.push(n0(a,r.header.length).map((s,l)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:r.align[l]})));return r}}lheading(t){let n=this.rules.block.lheading.exec(t);if(n){let e=n[1].trim();return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(t){let n=this.rules.block.paragraph.exec(t);if(n){let e=n[1].charAt(n[1].length-1)===`
|
|
33
|
-
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:e,tokens:this.lexer.inline(e)}}}text(t){let n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){let n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(t){let n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){let n=this.rules.inline.link.exec(t);if(n){let e=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let r=Vr(e.slice(0,-1),"\\");if((e.length-r.length)%2===0)return}else{let r=
|
|
33
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:e,tokens:this.lexer.inline(e)}}}text(t){let n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){let n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(t){let n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){let n=this.rules.inline.link.exec(t);if(n){let e=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let r=Vr(e.slice(0,-1),"\\");if((e.length-r.length)%2===0)return}else{let r=S4(n[2],"()");if(r===-2)return;if(r>-1){let a=(n[0].indexOf("!")===0?5:4)+n[1].length+r;n[2]=n[2].substring(0,r),n[0]=n[0].substring(0,a).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(i);r&&(i=r[1],o=r[3])}else o=n[3]?n[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?i=i.slice(1):i=i.slice(1,-1)),r0(n,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(t,n){let e;if((e=this.rules.inline.reflink.exec(t))||(e=this.rules.inline.nolink.exec(t))){let i=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=n[i.toLowerCase()];if(!o){let r=e[0].charAt(0);return{type:"text",raw:r,text:r}}return r0(e,o,e[0],this.lexer,this.rules)}}emStrong(t,n,e=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!e||this.rules.inline.punctuation.exec(e))){let o=[...i[0]].length-1,r,a,s=o,l=0,d=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+o);(i=d.exec(n))!==null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(a=[...r].length,i[3]||i[4]){s+=a;continue}else if((i[5]||i[6])&&o%3&&!((o+a)%3)){l+=a;continue}if(s-=a,s>0)continue;a=Math.min(a,a+s+l);let c=[...i[0]][0].length,m=t.slice(0,o+i.index+c+a);if(Math.min(o,a)%2){let u=m.slice(1,-1);return{type:"em",raw:m,text:u,tokens:this.lexer.inlineTokens(u)}}let p=m.slice(2,-2);return{type:"strong",raw:m,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){let n=this.rules.inline.code.exec(t);if(n){let e=n[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(e),o=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return i&&o&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:n[0],text:e}}}br(t){let n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t,n,e=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!e||this.rules.inline.punctuation.exec(e))){let o=[...i[0]].length-1,r,a,s=o,l=this.rules.inline.delRDelim;for(l.lastIndex=0,n=n.slice(-1*t.length+o);(i=l.exec(n))!==null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r||(a=[...r].length,a!==o))continue;if(i[3]||i[4]){s+=a;continue}if(s-=a,s>0)continue;a=Math.min(a,a+s);let d=[...i[0]][0].length,c=t.slice(0,o+i.index+d+a),m=c.slice(o,-o);return{type:"del",raw:c,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(t){let n=this.rules.inline.autolink.exec(t);if(n){let e,i;return n[2]==="@"?(e=n[1],i="mailto:"+e):(e=n[1],i=e),{type:"link",raw:n[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(t){let n;if(n=this.rules.inline.url.exec(t)){let e,i;if(n[2]==="@")e=n[0],i="mailto:"+e;else{let o;do o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(o!==n[0]);e=n[0],n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(t){let n=this.rules.inline.text.exec(t);if(n){let e=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:e}}}},ri=class Kc{tokens;options;state;inlineQueue;tokenizer;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||Po,this.options.tokenizer=this.options.tokenizer||new Fs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:Dt,block:Rs.normal,inline:Br.normal};this.options.pedantic?(e.block=Rs.pedantic,e.inline=Br.pedantic):this.options.gfm&&(e.block=Rs.gfm,this.options.breaks?e.inline=Br.breaks:e.inline=Br.gfm),this.tokenizer.rules=e}static get rules(){return{block:Rs,inline:Br}}static lex(n,e){return new Kc(e).lex(n)}static lexInline(n,e){return new Kc(e).inlineTokens(n)}lex(n){n=n.replace(Dt.carriageReturn,`
|
|
34
34
|
`),this.blockTokens(n,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let i=this.inlineQueue[e];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,e=[],i=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(n=n.replace(Dt.tabCharGlobal," ").replace(Dt.spaceLine,""));n;){let o;if(this.options.extensions?.block?.some(a=>(o=a.call({lexer:this},n,e))?(n=n.substring(o.raw.length),e.push(o),!0):!1))continue;if(o=this.tokenizer.space(n)){n=n.substring(o.raw.length);let a=e.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
|
|
35
35
|
`:e.push(o);continue}if(o=this.tokenizer.code(n)){n=n.substring(o.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
36
36
|
`)?"":`
|
|
@@ -62,8 +62,8 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
62
62
|
`}tablerow({text:t}){return`<tr>
|
|
63
63
|
${t}</tr>
|
|
64
64
|
`}tablecell(t){let n=this.parser.parseInline(t.tokens),e=t.header?"th":"td";return(t.align?`<${e} align="${t.align}">`:`<${e}>`)+n+`</${e}>
|
|
65
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${qi(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:e}){let i=this.parser.parseInline(e),o=o0(t);if(o===null)return i;t=o;let r='<a href="'+t+'"';return n&&(r+=' title="'+qi(n)+'"'),r+=">"+i+"</a>",r}image({href:t,title:n,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let o=o0(t);if(o===null)return qi(e);t=o;let r=`<img src="${t}" alt="${qi(e)}"`;return n&&(r+=` title="${qi(n)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:qi(t.text)}},ld=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},ai=class Jc{options;renderer;textRenderer;constructor(n){this.options=n||Po,this.options.renderer=this.options.renderer||new Ls,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ld}static parse(n,e){return new Jc(e).parse(n)}static parseInline(n,e){return new Jc(e).parseInline(n)}parse(n){this.renderer.parser=this;let e="";for(let i=0;i<n.length;i++){let o=n[i];if(this.options.extensions?.renderers?.[o.type]){let a=o,s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){e+=s||"";continue}}let r=o;switch(r.type){case"space":{e+=this.renderer.space(r);break}case"hr":{e+=this.renderer.hr(r);break}case"heading":{e+=this.renderer.heading(r);break}case"code":{e+=this.renderer.code(r);break}case"table":{e+=this.renderer.table(r);break}case"blockquote":{e+=this.renderer.blockquote(r);break}case"list":{e+=this.renderer.list(r);break}case"checkbox":{e+=this.renderer.checkbox(r);break}case"html":{e+=this.renderer.html(r);break}case"def":{e+=this.renderer.def(r);break}case"paragraph":{e+=this.renderer.paragraph(r);break}case"text":{e+=this.renderer.text(r);break}default:{let a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return e}parseInline(n,e=this.renderer){this.renderer.parser=this;let i="";for(let o=0;o<n.length;o++){let r=n[o];if(this.options.extensions?.renderers?.[r.type]){let s=this.options.extensions.renderers[r.type].call({parser:this},r);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){i+=s||"";continue}}let a=r;switch(a.type){case"escape":{i+=e.text(a);break}case"html":{i+=e.html(a);break}case"link":{i+=e.link(a);break}case"image":{i+=e.image(a);break}case"checkbox":{i+=e.checkbox(a);break}case"strong":{i+=e.strong(a);break}case"em":{i+=e.em(a);break}case"codespan":{i+=e.codespan(a);break}case"br":{i+=e.br(a);break}case"del":{i+=e.del(a);break}case"text":{i+=e.text(a);break}default:{let s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return i}},Wr=class{options;block;constructor(t){this.options=t||Po}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ri.lex:ri.lexInline}provideParser(t=this.block){return t?ai.parse:ai.parseInline}},
|
|
66
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+qi(e.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(e);throw e}}},Lo=new
|
|
65
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${qi(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:e}){let i=this.parser.parseInline(e),o=o0(t);if(o===null)return i;t=o;let r='<a href="'+t+'"';return n&&(r+=' title="'+qi(n)+'"'),r+=">"+i+"</a>",r}image({href:t,title:n,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let o=o0(t);if(o===null)return qi(e);t=o;let r=`<img src="${t}" alt="${qi(e)}"`;return n&&(r+=` title="${qi(n)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:qi(t.text)}},ld=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},ai=class Jc{options;renderer;textRenderer;constructor(n){this.options=n||Po,this.options.renderer=this.options.renderer||new Ls,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ld}static parse(n,e){return new Jc(e).parse(n)}static parseInline(n,e){return new Jc(e).parseInline(n)}parse(n){this.renderer.parser=this;let e="";for(let i=0;i<n.length;i++){let o=n[i];if(this.options.extensions?.renderers?.[o.type]){let a=o,s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){e+=s||"";continue}}let r=o;switch(r.type){case"space":{e+=this.renderer.space(r);break}case"hr":{e+=this.renderer.hr(r);break}case"heading":{e+=this.renderer.heading(r);break}case"code":{e+=this.renderer.code(r);break}case"table":{e+=this.renderer.table(r);break}case"blockquote":{e+=this.renderer.blockquote(r);break}case"list":{e+=this.renderer.list(r);break}case"checkbox":{e+=this.renderer.checkbox(r);break}case"html":{e+=this.renderer.html(r);break}case"def":{e+=this.renderer.def(r);break}case"paragraph":{e+=this.renderer.paragraph(r);break}case"text":{e+=this.renderer.text(r);break}default:{let a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return e}parseInline(n,e=this.renderer){this.renderer.parser=this;let i="";for(let o=0;o<n.length;o++){let r=n[o];if(this.options.extensions?.renderers?.[r.type]){let s=this.options.extensions.renderers[r.type].call({parser:this},r);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){i+=s||"";continue}}let a=r;switch(a.type){case"escape":{i+=e.text(a);break}case"html":{i+=e.html(a);break}case"link":{i+=e.link(a);break}case"image":{i+=e.image(a);break}case"checkbox":{i+=e.checkbox(a);break}case"strong":{i+=e.strong(a);break}case"em":{i+=e.em(a);break}case"codespan":{i+=e.codespan(a);break}case"br":{i+=e.br(a);break}case"del":{i+=e.del(a);break}case"text":{i+=e.text(a);break}default:{let s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return i}},Wr=class{options;block;constructor(t){this.options=t||Po}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ri.lex:ri.lexInline}provideParser(t=this.block){return t?ai.parse:ai.parseInline}},M4=class{defaults=ed();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ai;Renderer=Ls;TextRenderer=ld;Lexer=ri;Tokenizer=Fs;Hooks=Wr;constructor(...t){this.use(...t)}walkTokens(t,n){let e=[];for(let i of t)switch(e=e.concat(n.call(this,i)),i.type){case"table":{let o=i;for(let r of o.header)e=e.concat(this.walkTokens(r.tokens,n));for(let r of o.rows)for(let a of r)e=e.concat(this.walkTokens(a.tokens,n));break}case"list":{let o=i;e=e.concat(this.walkTokens(o.items,n));break}default:{let o=i;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(r=>{let a=o[r].flat(1/0);e=e.concat(this.walkTokens(a,n))}):o.tokens&&(e=e.concat(this.walkTokens(o.tokens,n)))}}return e}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(e=>{let i=xe({},e);if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let r=n.renderers[o.name];r?n.renderers[o.name]=function(...a){let s=o.renderer.apply(this,a);return s===!1&&(s=r.apply(this,a)),s}:n.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=n[o.level];r?r.unshift(o.tokenizer):n[o.level]=[o.tokenizer],o.start&&(o.level==="block"?n.startBlock?n.startBlock.push(o.start):n.startBlock=[o.start]:o.level==="inline"&&(n.startInline?n.startInline.push(o.start):n.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(n.childTokens[o.name]=o.childTokens)}),i.extensions=n),e.renderer){let o=this.defaults.renderer||new Ls(this.defaults);for(let r in e.renderer){if(!(r in o))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let a=r,s=e.renderer[a],l=o[a];o[a]=(...d)=>{let c=s.apply(o,d);return c===!1&&(c=l.apply(o,d)),c||""}}i.renderer=o}if(e.tokenizer){let o=this.defaults.tokenizer||new Fs(this.defaults);for(let r in e.tokenizer){if(!(r in o))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,s=e.tokenizer[a],l=o[a];o[a]=(...d)=>{let c=s.apply(o,d);return c===!1&&(c=l.apply(o,d)),c}}i.tokenizer=o}if(e.hooks){let o=this.defaults.hooks||new Wr;for(let r in e.hooks){if(!(r in o))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let a=r,s=e.hooks[a],l=o[a];Wr.passThroughHooks.has(r)?o[a]=d=>{if(this.defaults.async&&Wr.passThroughHooksRespectAsync.has(r))return(async()=>{let m=await s.call(o,d);return l.call(o,m)})();let c=s.call(o,d);return l.call(o,c)}:o[a]=(...d)=>{if(this.defaults.async)return(async()=>{let m=await s.apply(o,d);return m===!1&&(m=await l.apply(o,d)),m})();let c=s.apply(o,d);return c===!1&&(c=l.apply(o,d)),c}}i.hooks=o}if(e.walkTokens){let o=this.defaults.walkTokens,r=e.walkTokens;i.walkTokens=function(a){let s=[];return s.push(r.call(this,a)),o&&(s=s.concat(o.call(this,a))),s}}this.defaults=xe(xe({},this.defaults),i)}),this}setOptions(t){return this.defaults=xe(xe({},this.defaults),t),this}lexer(t,n){return ri.lex(t,n??this.defaults)}parser(t,n){return ai.parse(t,n??this.defaults)}parseMarkdown(t){return(n,e)=>{let i=xe({},e),o=xe(xe({},this.defaults),i),r=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let a=o.hooks?await o.hooks.preprocess(n):n,s=await(o.hooks?await o.hooks.provideLexer(t):t?ri.lex:ri.lexInline)(a,o),l=o.hooks?await o.hooks.processAllTokens(s):s;o.walkTokens&&await Promise.all(this.walkTokens(l,o.walkTokens));let d=await(o.hooks?await o.hooks.provideParser(t):t?ai.parse:ai.parseInline)(l,o);return o.hooks?await o.hooks.postprocess(d):d})().catch(r);try{o.hooks&&(n=o.hooks.preprocess(n));let a=(o.hooks?o.hooks.provideLexer(t):t?ri.lex:ri.lexInline)(n,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let s=(o.hooks?o.hooks.provideParser(t):t?ai.parse:ai.parseInline)(a,o);return o.hooks&&(s=o.hooks.postprocess(s)),s}catch(a){return r(a)}}}onError(t,n){return e=>{if(e.message+=`
|
|
66
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+qi(e.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(e);throw e}}},Lo=new M4;function Xe(t,n){return Lo.parse(t,n)}Xe.options=Xe.setOptions=function(t){return Lo.setOptions(t),Xe.defaults=Lo.defaults,a0(Xe.defaults),Xe};Xe.getDefaults=ed;Xe.defaults=Po;Xe.use=function(...t){return Lo.use(...t),Xe.defaults=Lo.defaults,a0(Xe.defaults),Xe};Xe.walkTokens=function(t,n){return Lo.walkTokens(t,n)};Xe.parseInline=Lo.parseInline;Xe.Parser=ai;Xe.parser=ai.parse;Xe.Renderer=Ls;Xe.TextRenderer=ld;Xe.Lexer=ri;Xe.lexer=ri.lex;Xe.Tokenizer=Fs;Xe.Hooks=Wr;Xe.parse=Xe;var tM=Xe.options,iM=Xe.setOptions,oM=Xe.use,nM=Xe.walkTokens,rM=Xe.parseInline;var aM=ai.parse,sM=ri.lex;function g0(){return{mangle:!1,walkTokens(t){if(t.type!=="link"||!t.href.startsWith("mailto:"))return;let n=t.href.substring(7),e=_4(n);t.href=`mailto:${e}`,!(t.tokens.length!==1||t.tokens[0].type!=="text"||t.tokens[0].text!==n)&&(t.text=e,t.tokens[0].text=e)}}}function _4(t){let n="",e,i,o=t.length;for(e=0;e<o;e++)i=t.charCodeAt(e),Math.random()>.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}var b0=`# Change Log - Visualization
|
|
67
67
|
|
|
68
68
|
All notable changes to this project will be documented in this file.
|
|
69
69
|
|
|
@@ -72,37 +72,50 @@ and this project adheres to [Semantic Versioning](http://semver.org/)
|
|
|
72
72
|
|
|
73
73
|
## [unreleased] (Added \u{1F680} | Changed | Removed | Fixed \u{1F41E} | Chore \u{1F468}\u200D\u{1F4BB} \u{1F469}\u200D\u{1F4BB})
|
|
74
74
|
|
|
75
|
+
## [2.2.0] - 2026-09-09
|
|
76
|
+
|
|
77
|
+
### Added \u{1F680}
|
|
78
|
+
|
|
79
|
+
- **Search marks the cloud**: searching words in the domain explorer marks every match in the word cloud.
|
|
80
|
+
- **Click the empty cloud to let go**: clicking the cloud where no word is drawn unpins the open word and puts the cloud back on the whole project.
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
|
|
84
|
+
- **Pinned word**: the word you open stays in a strip at the top of the domain explorer, with its breakdown and a button to unpin it.
|
|
85
|
+
- **Clicking a word keeps your search**: opening a word from the cloud no longer replaces the explorer's word search with it.
|
|
86
|
+
- **Search word**: the cloud's right-click menu offers **Search word**, which puts the word into the explorer's word search, in place of **Show occurrences**.
|
|
87
|
+
- **Domain percentages name their total**: a word reads "2% of all words \xB7 42" and a row of its breakdown "62% of \\"invoice\\" \xB7 26", with the breakdown's bar tinted apart from the word's.
|
|
88
|
+
|
|
89
|
+
### Fixed \u{1F41E}
|
|
90
|
+
|
|
91
|
+
- **Cloud lost its mark on a word**: the word you opened stopped being marked in the cloud once you picked a folder below it.
|
|
92
|
+
|
|
75
93
|
## [2.1.1] - 2026-09-07
|
|
76
94
|
|
|
77
95
|
### Fixed \u{1F41E}
|
|
78
96
|
|
|
79
|
-
- **
|
|
80
|
-
- **
|
|
97
|
+
- **Map did not render on phones**: a phone asked for a drawing buffer far larger than its GPU allows, so the map stayed blank; a lost graphics context is now reported and re-rendered instead of leaving a silently empty map.
|
|
98
|
+
- **Phone tab died while a map loaded**: the floor labels claimed hundreds of megabytes on a map of any size, and the browser tab was killed before the map appeared.
|
|
81
99
|
|
|
82
100
|
## [2.1.0] - 2026-09-04
|
|
83
101
|
|
|
84
102
|
### Added \u{1F680}
|
|
85
103
|
|
|
86
|
-
- **
|
|
87
|
-
- **
|
|
88
|
-
- **
|
|
89
|
-
- **
|
|
90
|
-
- **
|
|
91
|
-
- **
|
|
92
|
-
- **Node actions in a word's breakdown**:
|
|
93
|
-
- **
|
|
104
|
+
- **Browse a project's words**: the domain explorer switches between **Files** and **Words**; word mode lists every word with its share of all occurrences and its count, and opening one breaks it down over the file tree.
|
|
105
|
+
- **Sort the word list**: by **Occurrences**, **Name** or **Relevance**, in either direction.
|
|
106
|
+
- **A big vocabulary opens fast**: a project with thousands of words opens and scrolls like a small one.
|
|
107
|
+
- **Hide a word**: the cloud's right-click menu drops a word from the cloud and the word list, and a **Hidden** chip in the explorer lists what is hidden and brings words back.
|
|
108
|
+
- **The cloud and the explorer point at each other**: clicking a word in the cloud opens it in the explorer, and the word the explorer has open is marked in the cloud.
|
|
109
|
+
- **Jump between the views from a node**: the domain view's file explorer offers **Show in Metrics**, and the metric view offers **Show in Domain** whenever the loaded file carries domain data.
|
|
110
|
+
- **Node actions in a word's breakdown**: right-clicking a file or folder under an opened word offers the same node menu the file explorer does.
|
|
111
|
+
- **Nodes without domain words are marked**: the domain view's file explorer greys them out, with a hint on hover.
|
|
94
112
|
|
|
95
113
|
### Fixed \u{1F41E}
|
|
96
114
|
|
|
97
|
-
- **
|
|
98
|
-
- **
|
|
99
|
-
- **
|
|
100
|
-
- **
|
|
101
|
-
- **Endless spinner on the first visit to the metric view**: starting the app on the domain view and then switching to the metric view left its loading spinner up for the rest of the session, with the map never drawn. The deferred map build ran before the view had mounted the canvas the floor labels measure, and the resulting error ended the render stream that both the map and the spinner hang off. The build now waits for that canvas, reads the current map data rather than the last data-plus-action pair, and reports a failed render instead of ending the stream.
|
|
102
|
-
|
|
103
|
-
### Chore \u{1F468}\u200D\u{1F4BB} \u{1F469}\u200D\u{1F4BB}
|
|
104
|
-
|
|
105
|
-
- **Type check passes again**: the node context menu's spec configured a view without the menu's \`jumpTargetView\`, so \`tsc\` failed on the test sources while Jest ran fine. The case now states that such a view offers no jump at all, and asserts it.
|
|
115
|
+
- **Inspector could not be closed for a node without a building**: its close button did nothing for a folder, or for a file with no area in the chosen metric.
|
|
116
|
+
- **Map screenshot showed the top bar's drawer handle**: the handle hanging below the top bar was captured in map screenshots, leaving an empty band above the map.
|
|
117
|
+
- **Context menu actions were swallowed after a view switch**: leaving a view with its node context menu open made the next click on a menu entry do nothing.
|
|
118
|
+
- **Endless spinner on the first visit to the metric view**: switching to the metric view from the domain view left its spinner up and the map undrawn.
|
|
106
119
|
|
|
107
120
|
## [2.0.0] - 2026-09-02
|
|
108
121
|
|
|
@@ -3383,9 +3396,9 @@ Fixed release issues
|
|
|
3383
3396
|
|
|
3384
3397
|
- SonarImporter for importing projects from SonarQube.
|
|
3385
3398
|
- ValidationTool for validating an existing json file.
|
|
3386
|
-
`;var
|
|
3387
|
-
`),a=this.findVersionLine(r,i),s=this.findVersionLine(r,e);if(a===-1||s===-1)return[];let l=r.slice(a,s+1);return this.extractCategories(l)}extractCategories(e){let i=[];for(let o of
|
|
3388
|
-
`)})}return i}findAllIndexes(e,i){return e.reduce((o,r,a)=>(i.test(r)&&o.push(a),o),[])}findVersionLine(e,i){let o=new RegExp(`\\[${i}]`);return e.findIndex(r=>o.test(r))}findEndOfChanges(e,i){return i+e.slice(i+1).findIndex(o=>/<h3>/.test(o)||/<h2>/.test(o))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var qw=["dialog"],Tw=(t,n)=>n.title;function Iw(t,n){if(t&1&&(v(0,"div",15)(1,"div",24)(2,"span",25),g(3),b(),v(4,"h3",26),g(5),b(),v(6,"span",27),g(7),b()(),L(8,"div",28),b()),t&2){let e=n.$implicit,i=A();h(),F("ngClass",i.getCategoryHeaderClass(e.title)),h(),F("ngClass",i.getCategoryIconClass(e.title)),h(),ge(" ",i.getCategoryEmoji(e.title)," "),h(2),ge(" ",i.getCategoryLabel(e.title)," "),h(),F("ngClass",i.getCategoryCountClass(e.title)),h(),ge(" ",i.getChangeCount(e.changes)," "),h(),F("innerHTML",e.changes,Dm)}}var cd={"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"}},dd={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"}},hd=(()=>{class t{constructor(e,i){this.versionService=e,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=Z(()=>{let o=this.previousVersion();return o?this.changelogParserService.parseChangesBetweenVersions(o,this.currentVersion):[]}),Tm(()=>{this.shouldShowChangelog()&&this.open()})}open(){this.dialogElement().nativeElement.showModal()}close(){this.versionService.acknowledgeChangelog(),this.dialogElement().nativeElement.close()}getCategoryEmoji(e){return cd[e]?.emoji??"\u{1F4DD}"}getCategoryLabel(e){return cd[e]?.label??e}getCategoryType(e){return cd[e]?.type??"default"}getCategoryHeaderClass(e){let i=this.getCategoryType(e);return dd[i]?.header??"bg-base-200"}getCategoryIconClass(e){let i=this.getCategoryType(e);return dd[i]?.icon??"bg-base-300"}getCategoryCountClass(e){let i=this.getCategoryType(e);return dd[i]?.count??"bg-base-300 text-base-content"}getChangeCount(e){return(e.match(/<li>/gi)||[]).length}static{this.\u0275fac=function(i){return new(i||t)(te(Ds),te(Bs))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-changelog-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,qw,5),i&2&&it()},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,o){i&1&&(v(0,"dialog",1,0)(2,"div",2)(3,"div",3),L(4,"div",4),v(5,"div",5)(6,"span",6),g(7," Release Notes "),b(),v(8,"h2",7),g(9," What's new in CodeCharta? "),b(),v(10,"div",8)(11,"span",9),g(12),b(),To(),v(13,"svg",10),L(14,"path",11),b(),Ir(),v(15,"span",12),g(16),b()()()(),v(17,"div",13)(18,"div",14),Pe(19,Iw,9,7,"div",15,Tw),b()(),v(21,"div",16)(22,"div",17)(23,"a",18)(24,"span"),g(25,"View full changelog"),b(),To(),v(26,"svg",19),L(27,"path",20),b()(),Ir(),v(28,"button",21),W("click",function(){return o.close()}),g(29," Got it "),b()()()(),v(30,"form",22)(31,"button",23),W("click",function(){return o.close()}),g(32,"close"),b()()()),i&2&&(h(12),ge(" ",o.previousVersion()," "),h(4),ge(" ",o.currentVersion," "),h(3),Ne(o.changes()))},dependencies:[$m],encapsulation:2,changeDetection:0})}}return t})();var x0=(()=>{class t{constructor(e,i){this.versionService=e,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(e,i){return this.changelogParserService.parseChangesBetweenVersions(e,i)}static{this.\u0275fac=function(i){return new(i||t)(M(Ds),M(Bs))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var w0=[$p,Lp,Ap,Pp,Dp,bi];var y0=(()=>{class t{constructor(e,i,o,r,a){this.store=e,this.threeSceneService=i,this.threeMapControlsService=o,this.actions$=r,this.globalSettingsFacade=a,this.autoFitRequests$=Ui(this.actions$.pipe(at(ni),ke(s=>({force:s.forceAutoFit}))),this.store.select(un).pipe(mi(1),ke(()=>({force:!1}))),It(w0.map(s=>this.store.select(s))).pipe(mi(1),ke(()=>({force:!1})))),this.autoFitTo$=Ae(()=>this.autoFitRequests$.pipe($t(this.globalSettingsFacade.resetCameraIfNewFileIsLoaded$()),Ie(([s,l])=>l||s.force),Ut(()=>this.threeSceneService.mapMeshChanged$.pipe(ut(1))),Fe(()=>{this.threeMapControlsService.autoFitTo()})),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(ft),M(Vt),M(ht),M(Cf))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var S0=[to,Ai,gn,bn,Rn,Dn,Ua,yn,Sn,Ha,qn,vn,eo,Tn,In,Ji,_n,Ga,Au,io,wi,xi,kn,Fi,Qa,Ya,Pn,Za,yi,vi,Pt,An,Ka,Nn,Bn,xn,wn,En,Mn,Ei];function M0(t,n,e,i){let o=new Map;for(let r of t){let a=n(r),s=o.get(a);s?s.push(r):o.set(a,[r])}return[...o.values()].flatMap(r=>md(r,e,i))}function md(t,n,e){let i=Math.floor(e);if(Number.isNaN(i)||i<=0)return[];let o=r=>Dw(n(r));return t.length<=i?[...t].sort((r,a)=>o(a)-o(r)):Rw(t,o,i)}function Dw(t){return Number.isNaN(t)?Number.NEGATIVE_INFINITY:t}function Rw(t,n,e){let i=[],o=Number.POSITIVE_INFINITY;for(let r of t){let a=n(r);if(i.length<e)C0(i,r,a,n);else if(a>o)i.pop(),C0(i,r,a,n);else continue;i.length===e&&(o=n(i[e-1]))}return i}function C0(t,n,e,i){let o=t.length;for(;o>0&&i(t[o-1])<e;)o--;t.splice(o,0,n)}var _0=Re(xu,fn,za,(t,n,e)=>new Set(Aw(t,n,e))),Aw=(t,n,e)=>{let i=[],o=Math.floor(e);if(Number.isNaN(o)||o<=0)return i;let r=t.get(n);if(r===void 0)return i;for(let a of r.keys())if(i.push(a),i.length>=o)break;return i};var E0=(t,n,e,i,o)=>{for(let r of n)if(r.visible=oi.none,r.attributes[e]!==void 0){let a=t.has(r.fromNodeName),s=t.has(r.toNodeName),l=i&&s,d=o&&a;d&&l?r.visible=oi.both:d?r.visible=oi.from:l&&(r.visible=oi.to)}};var k0=Re(_0,cs,fn,Np,Bp,(t,n,e,i,o)=>{let r=op(n);return E0(t,r,e,i,o),r});var ar=(()=>{class t{constructor(e,i,o,r){this.store=e,this.ccStateSnapshot=i,this.mapStateReadWindow=o,this.sharedViewReadWindow=r}getState(){return this.ccStateSnapshot.get()}getMapState(){return this.mapStateReadWindow.getMapState()}getEdges(){return cs(this.ccStateSnapshot.get())}getEdgeVisibility(){return k0(this.ccStateSnapshot.get())}getHoveredNodeId(){return this.sharedViewReadWindow.getHoveredNodeId()}getIdToNode(){return gu(this.ccStateSnapshot.get())}setHoveredNodeId(e){this.store.dispatch(Do({value:e}))}setRightClickedNodeData(e){this.store.dispatch(Xp({value:e}))}setColorLabels(e){this.store.dispatch(to({value:e}))}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(Bt),M(ve),M(Nt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ws=class t{constructor(n,e,i){this.badge=null,this.labelSize=i;let o=document.createElement("div");if(this.content=document.createElement("div"),this.content.style.cssText=t.buildContentStyles(i),n){let r=document.createElement("span");r.style.cssText="display: block; font-weight: 500;",r.textContent=n,this.content.appendChild(r)}if(e){let r=document.createElement("span");r.style.cssText=`display: block; font-size: ${10*i}px; color: #666; margin-top: 1px;`,r.textContent=e,this.content.appendChild(r)}o.appendChild(this.content),this.cssObject=new Nu(o),this.cssObject.center.set(.5,1)}getContentRect(){return this.content.getBoundingClientRect()}getContentElement(){return this.content}setOpacity(n){this.content.style.opacity=n}setTransform(n){this.content.style.transform=`translateY(${-20+n}px)`}setTransition(n){this.content.style.transition=n}setBadge(n){this.clearBadge(),this.badge=document.createElement("div"),this.badge.textContent=`+${n} more`,this.badge.style.cssText=`
|
|
3399
|
+
`;var k4=["Added \u{1F680}","Fixed \u{1F41E}","Changed","Removed \u{1F5D1}","Chore \u{1F468}\u200D\u{1F4BB} \u{1F469}\u200D\u{1F4BB}"],Bs=(()=>{class t{parseChangesBetweenVersions(e,i){Xe.use(g0());let r=Xe.parse(b0).split(`
|
|
3400
|
+
`),a=this.findVersionLine(r,i),s=this.findVersionLine(r,e);if(a===-1||s===-1)return[];let l=r.slice(a,s+1);return this.extractCategories(l)}extractCategories(e){let i=[];for(let o of k4){let r=new RegExp(`<h3>${o}</h3>`),a=this.findAllIndexes(e,r),s=[];for(let l of a){let d=l+2,c=this.findEndOfChanges(e,l);for(let m of e.slice(d,c))s.push(m)}s.length>0&&i.push({title:o,changes:s.join(`
|
|
3401
|
+
`)})}return i}findAllIndexes(e,i){return e.reduce((o,r,a)=>(i.test(r)&&o.push(a),o),[])}findVersionLine(e,i){let o=new RegExp(`\\[${i}]`);return e.findIndex(r=>o.test(r))}findEndOfChanges(e,i){return i+e.slice(i+1).findIndex(o=>/<h3>/.test(o)||/<h2>/.test(o))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var q4=["dialog"],T4=(t,n)=>n.title;function I4(t,n){if(t&1&&(v(0,"div",15)(1,"div",24)(2,"span",25),g(3),b(),v(4,"h3",26),g(5),b(),v(6,"span",27),g(7),b()(),L(8,"div",28),b()),t&2){let e=n.$implicit,i=A();h(),F("ngClass",i.getCategoryHeaderClass(e.title)),h(),F("ngClass",i.getCategoryIconClass(e.title)),h(),ge(" ",i.getCategoryEmoji(e.title)," "),h(2),ge(" ",i.getCategoryLabel(e.title)," "),h(),F("ngClass",i.getCategoryCountClass(e.title)),h(),ge(" ",i.getChangeCount(e.changes)," "),h(),F("innerHTML",e.changes,Dm)}}var cd={"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"}},dd={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"}},hd=(()=>{class t{constructor(e,i){this.versionService=e,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=Z(()=>{let o=this.previousVersion();return o?this.changelogParserService.parseChangesBetweenVersions(o,this.currentVersion):[]}),Tm(()=>{this.shouldShowChangelog()&&this.open()})}open(){this.dialogElement().nativeElement.showModal()}close(){this.versionService.acknowledgeChangelog(),this.dialogElement().nativeElement.close()}getCategoryEmoji(e){return cd[e]?.emoji??"\u{1F4DD}"}getCategoryLabel(e){return cd[e]?.label??e}getCategoryType(e){return cd[e]?.type??"default"}getCategoryHeaderClass(e){let i=this.getCategoryType(e);return dd[i]?.header??"bg-base-200"}getCategoryIconClass(e){let i=this.getCategoryType(e);return dd[i]?.icon??"bg-base-300"}getCategoryCountClass(e){let i=this.getCategoryType(e);return dd[i]?.count??"bg-base-300 text-base-content"}getChangeCount(e){return(e.match(/<li>/gi)||[]).length}static{this.\u0275fac=function(i){return new(i||t)(te(Ds),te(Bs))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-changelog-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,q4,5),i&2&&it()},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,o){i&1&&(v(0,"dialog",1,0)(2,"div",2)(3,"div",3),L(4,"div",4),v(5,"div",5)(6,"span",6),g(7," Release Notes "),b(),v(8,"h2",7),g(9," What's new in CodeCharta? "),b(),v(10,"div",8)(11,"span",9),g(12),b(),To(),v(13,"svg",10),L(14,"path",11),b(),Ir(),v(15,"span",12),g(16),b()()()(),v(17,"div",13)(18,"div",14),Pe(19,I4,9,7,"div",15,T4),b()(),v(21,"div",16)(22,"div",17)(23,"a",18)(24,"span"),g(25,"View full changelog"),b(),To(),v(26,"svg",19),L(27,"path",20),b()(),Ir(),v(28,"button",21),W("click",function(){return o.close()}),g(29," Got it "),b()()()(),v(30,"form",22)(31,"button",23),W("click",function(){return o.close()}),g(32,"close"),b()()()),i&2&&(h(12),ge(" ",o.previousVersion()," "),h(4),ge(" ",o.currentVersion," "),h(3),Ne(o.changes()))},dependencies:[$m],encapsulation:2,changeDetection:0})}}return t})();var x0=(()=>{class t{constructor(e,i){this.versionService=e,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(e,i){return this.changelogParserService.parseChangesBetweenVersions(e,i)}static{this.\u0275fac=function(i){return new(i||t)(M(Ds),M(Bs))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var w0=[$p,Lp,Ap,Pp,Dp,bi];var S0=(()=>{class t{constructor(e,i,o,r,a){this.store=e,this.threeSceneService=i,this.threeMapControlsService=o,this.actions$=r,this.globalSettingsFacade=a,this.autoFitRequests$=Ui(this.actions$.pipe(at(ni),ke(s=>({force:s.forceAutoFit}))),this.store.select(un).pipe(mi(1),ke(()=>({force:!1}))),It(w0.map(s=>this.store.select(s))).pipe(mi(1),ke(()=>({force:!1})))),this.autoFitTo$=Ae(()=>this.autoFitRequests$.pipe($t(this.globalSettingsFacade.resetCameraIfNewFileIsLoaded$()),Ie(([s,l])=>l||s.force),Ut(()=>this.threeSceneService.mapMeshChanged$.pipe(ut(1))),Fe(()=>{this.threeMapControlsService.autoFitTo()})),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(ft),M(Vt),M(ht),M(Cf))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var y0=[to,Ai,gn,bn,Rn,Dn,Ua,Sn,yn,Ha,qn,vn,eo,Tn,In,Ji,_n,Ga,Au,io,wi,xi,kn,Fi,Qa,Ya,Pn,Za,Si,vi,Pt,An,Ka,Nn,Bn,xn,wn,En,Mn,Ei];function M0(t,n,e,i){let o=new Map;for(let r of t){let a=n(r),s=o.get(a);s?s.push(r):o.set(a,[r])}return[...o.values()].flatMap(r=>md(r,e,i))}function md(t,n,e){let i=Math.floor(e);if(Number.isNaN(i)||i<=0)return[];let o=r=>D4(n(r));return t.length<=i?[...t].sort((r,a)=>o(a)-o(r)):R4(t,o,i)}function D4(t){return Number.isNaN(t)?Number.NEGATIVE_INFINITY:t}function R4(t,n,e){let i=[],o=Number.POSITIVE_INFINITY;for(let r of t){let a=n(r);if(i.length<e)C0(i,r,a,n);else if(a>o)i.pop(),C0(i,r,a,n);else continue;i.length===e&&(o=n(i[e-1]))}return i}function C0(t,n,e,i){let o=t.length;for(;o>0&&i(t[o-1])<e;)o--;t.splice(o,0,n)}var _0=Re(xu,fn,za,(t,n,e)=>new Set(A4(t,n,e))),A4=(t,n,e)=>{let i=[],o=Math.floor(e);if(Number.isNaN(o)||o<=0)return i;let r=t.get(n);if(r===void 0)return i;for(let a of r.keys())if(i.push(a),i.length>=o)break;return i};var E0=(t,n,e,i,o)=>{for(let r of n)if(r.visible=oi.none,r.attributes[e]!==void 0){let a=t.has(r.fromNodeName),s=t.has(r.toNodeName),l=i&&s,d=o&&a;d&&l?r.visible=oi.both:d?r.visible=oi.from:l&&(r.visible=oi.to)}};var k0=Re(_0,cs,fn,Np,Bp,(t,n,e,i,o)=>{let r=op(n);return E0(t,r,e,i,o),r});var ar=(()=>{class t{constructor(e,i,o,r){this.store=e,this.ccStateSnapshot=i,this.mapStateReadWindow=o,this.sharedViewReadWindow=r}getState(){return this.ccStateSnapshot.get()}getMapState(){return this.mapStateReadWindow.getMapState()}getEdges(){return cs(this.ccStateSnapshot.get())}getEdgeVisibility(){return k0(this.ccStateSnapshot.get())}getHoveredNodeId(){return this.sharedViewReadWindow.getHoveredNodeId()}getIdToNode(){return gu(this.ccStateSnapshot.get())}setHoveredNodeId(e){this.store.dispatch(Do({value:e}))}setRightClickedNodeData(e){this.store.dispatch(Xp({value:e}))}setColorLabels(e){this.store.dispatch(to({value:e}))}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(Bt),M(ve),M(Nt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ws=class t{constructor(n,e,i){this.badge=null,this.labelSize=i;let o=document.createElement("div");if(this.content=document.createElement("div"),this.content.style.cssText=t.buildContentStyles(i),n){let r=document.createElement("span");r.style.cssText="display: block; font-weight: 500;",r.textContent=n,this.content.appendChild(r)}if(e){let r=document.createElement("span");r.style.cssText=`display: block; font-size: ${10*i}px; color: #666; margin-top: 1px;`,r.textContent=e,this.content.appendChild(r)}o.appendChild(this.content),this.cssObject=new Nu(o),this.cssObject.center.set(.5,1)}getContentRect(){return this.content.getBoundingClientRect()}getContentElement(){return this.content}setOpacity(n){this.content.style.opacity=n}setTransform(n){this.content.style.transform=`translateY(${-20+n}px)`}setTransition(n){this.content.style.transition=n}setBadge(n){this.clearBadge(),this.badge=document.createElement("div"),this.badge.textContent=`+${n} more`,this.badge.style.cssText=`
|
|
3389
3402
|
font-size: ${10*this.labelSize}px;
|
|
3390
3403
|
color: #888;
|
|
3391
3404
|
margin-top: 2px;
|
|
@@ -3408,22 +3421,22 @@ Fixed release issues
|
|
|
3408
3421
|
transform: translateY(${-20}px);
|
|
3409
3422
|
opacity: 0;
|
|
3410
3423
|
transition: opacity 0.2s ease-out;
|
|
3411
|
-
`}};var Os=(()=>{class t{constructor(e){this.ccStateSnapshot=e}getValue(){return this.ccStateSnapshot.get()}isLabelsPerMapActive(){return fs(this.ccStateSnapshot.get())}static{this.\u0275fac=function(i){return new(i||t)(M(Bt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var zs=(()=>{class t{constructor(e,i){this.stateAccessStore=e,this.threeSceneService=i,this.labels=[],this.suppressedLabel=null}getLabels(){return this.labels}getSuppressedLabel(){return this.suppressedLabel}addLeafLabel(e,i,o=!1){let{mapState:r}=this.stateAccessStore.getValue(),{scaling:a,showMetricLabelNodeName:s,showMetricLabelNameValue:l,labelMode:d,labelSize:c}=r,{heightMetric:m,colorMetric:p}=r,u=new Ye(a.x,a.y,a.z),k="";if(s||o&&!l)k=e.name;else if(!l)return;let E="";if(l){let ie=d===Di.Color?p:m;E=`${e.attributes[ie]} ${ie}`}let P=new Ws(k,E,c),$=P.cssObject;$.userData={node:e};let ee=e.height+Math.abs(e.heightDelta??0),B=Math.max(ee,i),j=(e.x0-Hc+e.width/2)*u.x,G=(e.y0-Hc+e.length/2)*u.z;$.position.set(j,(e.z0+B)*u.y,G);let K=new Ye(j,(e.z0+ee)*u.y,G);this.threeSceneService.labels.add($),this.labels.push({labelElement:P,node:e,buildingTop:K,appliedOffset:0})}clearLabels(){this.threeSceneService.labels.clear(),this.labels=[],this.suppressedLabel=null}clearTemporaryLabel(e){let i=this.labels.findIndex(({node:o})=>o===e);if(i>-1){let o=this.labels[i];o===this.suppressedLabel&&(this.suppressedLabel=null),this.threeSceneService.labels.remove(o.labelElement.cssObject),this.labels.splice(i,1)}}hasLabelForNode(e){return this.labels.some(i=>i.node===e)}suppressLabelForNode(e){this.restoreSuppressedLabel();let i=this.labels.find(o=>o.node===e);i&&(this.suppressedLabel=i,i.labelElement.setTransition("opacity 0.2s ease-out"),i.labelElement.setOpacity("0"))}restoreSuppressedLabel(){this.suppressedLabel&&(this.suppressedLabel.labelElement.setOpacity("1"),this.suppressedLabel=null)}static{this.\u0275fac=function(i){return new(i||t)(M(Os),M(ft))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $s=(()=>{class t{constructor(e,i){this.threeRendererService=e,this.threeSceneService=i,this.connectorSegments=null,this.connectorPositions=null,this.connectorsDirty=!0,this.lastDrawnVertexCount=0,this.projectionVec=new Ye}drawConnectors(e,i){this.connectorSegments||this.initConnectors();let o=this.threeRendererService.camera;if(!o)return;let r=this.threeRendererService.labelRenderer?.domElement,a=r?r.clientHeight:window.innerHeight;if(a===0)return;let s=this.connectorPositions,l=0;for(let d of e){if(d.hidden||d.offset>100||d.label===i)continue;let c=d.label.buildingTop,m=d.label.labelElement.cssObject.position;if(m.y-c.y<.5)continue;if(l>=400)break;this.projectionVec.copy(m).project(o);let u=-20+d.offset;this.projectionVec.y-=u*2/a,this.projectionVec.unproject(o);let k=l*3;s[k]=c.x,s[k+1]=c.y,s[k+2]=c.z,l++;let E=l*3;s[E]=this.projectionVec.x,s[E+1]=this.projectionVec.y,s[E+2]=this.projectionVec.z,l++}this.connectorSegments.geometry.setDrawRange(0,l),this.connectorSegments.geometry.attributes.position.needsUpdate=!0,l!==this.lastDrawnVertexCount&&(this.connectorsDirty=!0),this.lastDrawnVertexCount=l}clearConnectors(){this.connectorSegments&&this.connectorSegments.geometry.setDrawRange(0,0),this.connectorsDirty=!0,this.lastDrawnVertexCount=0}isDirty(){return this.connectorsDirty}markClean(){this.connectorsDirty=!1}destroy(){this.connectorSegments&&(this.connectorSegments.geometry.dispose(),this.connectorSegments.material.dispose(),this.threeSceneService.scene.remove(this.connectorSegments),this.connectorSegments=null,this.connectorPositions=null)}initConnectors(){let e=400;this.connectorPositions=new Float32Array(e*3);let i=new Qt;i.setAttribute("position",new no(this.connectorPositions,3)),i.setDrawRange(0,0);let o=new os({color:11842740,transparent:!0,opacity:.9,depthTest:!0});this.connectorSegments=new eu(i,o),this.connectorSegments.frustumCulled=!1,this.threeSceneService.scene.add(this.connectorSegments)}static{this.\u0275fac=function(i){return new(i||t)(M(kt),M(ft))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var R0=(()=>{class t{constructor(e,i,o,r,a){this.threeRendererService=e,this.tooltipService=i,this.labelCreationService=o,this.stateAccessStore=r,this.connectorDrawingService=a,this._suppressLayout=!1,this.threeRendererService.afterRender$.subscribe(()=>this.updateLabelLayout())}setSuppressLayout(e){this._suppressLayout=e}updateLabelLayout(){let e=this.labelCreationService.getLabels();if(this._suppressLayout||e.length===0){this.connectorDrawingService.clearConnectors(),this.clearBadges(e);return}this.clearBadges(e);let i=this.collectLabelInfos(e),o=this.tooltipService.getRect();this.resolveCollisions(i),this.resolveTooltipCollisions(i,o),this.applyCollisionOffsets(i);let r=this.labelCreationService.getSuppressedLabel();this.connectorDrawingService.drawConnectors(i,r),this.connectorDrawingService.isDirty()&&(this.connectorDrawingService.markClean(),this.threeRendererService.render())}destroy(){this.clearBadges(this.labelCreationService.getLabels()),this.labelCreationService.clearLabels(),this.connectorDrawingService.destroy()}clearBadges(e){for(let i of e)i.labelElement.clearBadge()}collectLabelInfos(e){let i=[];for(let o of e){let r=o.labelElement.getContentRect(),a={top:r.top-o.appliedOffset,bottom:r.bottom-o.appliedOffset,left:r.left,right:r.right,width:r.width,height:r.height,x:r.x,y:r.y-o.appliedOffset};i.push({label:o,rect:a,offset:0,hidden:!1})}return i}resolveCollisions(e){let{mapState:i}=this.stateAccessStore.getValue();if(!i.groupLabelCollisions)return;let o=this.labelCreationService.getSuppressedLabel(),r=e.filter(l=>l.label!==o);if(r.length===0)return;let a=this.buildCollisionGroups(r,this.stateAccessStore.isLabelsPerMapActive()),s=i.labelMode===Di.Color?i.colorMetric:i.heightMetric;for(let l of a){if(l.length<=1)continue;let d=this.pickGroupWinner(l,s);for(let c of l)c!==d&&(c.hidden=!0);d.label.labelElement.setBadge(l.length-1)}}buildCollisionGroups(e,i){let o=e.length,r=Array.from({length:o},(c,m)=>m),a=i?e.map(c=>es(c.label.node.path)):void 0,s=c=>{for(;r[c]!==c;)r[c]=r[r[c]],c=r[c];return c},l=(c,m)=>{let p=s(c),u=s(m);p!==u&&(r[p]=u)};for(let c=0;c<o;c++)for(let m=c+1;m<o;m++)a!==void 0&&a[c]!==a[m]||this.rectsOverlap(e[c].rect,e[m].rect)&&l(c,m);let d=new Map;for(let c=0;c<o;c++){let m=s(c);d.has(m)||d.set(m,[]),d.get(m).push(e[c])}return[...d.values()]}rectsOverlap(e,i){return e.right>i.left&&e.left<i.right&&e.bottom>i.top&&e.top<i.bottom}pickGroupWinner(e,i){let o=e[0],r=o.label.node.attributes[i]??0;for(let a=1;a<e.length;a++){let s=e[a].label.node.attributes[i]??0;(s>r||s===r&&e[a].label.node.path<o.label.node.path)&&(r=s,o=e[a])}return o}resolveTooltipCollisions(e,i){if(!i)return;let o=12,r=i.left-o,a=i.right+o,s=i.top-o,l=i.bottom+o,d=this.labelCreationService.getSuppressedLabel();for(let c of e){if(c.hidden||c.label===d)continue;let m=c.rect.top+c.offset,p=c.rect.bottom+c.offset,u=c.rect.right>r&&c.rect.left<a,k=p>s&&m<l;if(u&&k){let E=l+4-m;E>0&&(c.offset+=E)}}}applyCollisionOffsets(e){let i=this.labelCreationService.getSuppressedLabel();for(let o of e){let r=o.label.labelElement,a=o.label===i;o.hidden||o.offset>100?(r.setOpacity("0"),r.setTransform(0),o.label.appliedOffset=0):(r.setOpacity(a?"0":"1"),r.setTransform(o.offset),o.label.appliedOffset=o.offset)}}static{this.\u0275fac=function(i){return new(i||t)(M(kt),M(Un),M(zs),M(Os),M($s))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var A0=(()=>{class t{constructor(e,i){this.store=e,this.ccStateSnapshot=i}setLabelMode(e){this.store.dispatch(Mn({value:e}))}setAmountOfTopLabels(e){this.store.dispatch(Ji({value:e}))}setLabelSize(e){this.store.dispatch(_n({value:e}))}setLabelsPerMap(e){this.store.dispatch(En({value:e}))}setShowMetricLabelNodeName(e){this.store.dispatch(Rn({value:e}))}setShowMetricLabelNameValue(e){this.store.dispatch(Dn({value:e}))}setColorLabels(e){this.store.dispatch(to({value:e}))}setGroupLabelCollisions(e){this.store.dispatch(wn({value:e}))}resetSettings(e){let i=bf(e,this.ccStateSnapshot.get());i.mapState?.amountOfTopLabels!==void 0&&(i.mapState.amountOfTopLabels=10),this.store.dispatch(Ei({value:i}))}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(Bt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function zw(t,n){if(t&1){let e=Me();y(0,"div",5)(1,"input",17),Y("change",function(){ce(e);let o=A();return de(o.setLabelsPerMap(!1))}),S(),y(2,"input",18),Y("change",function(){ce(e);let o=A();return de(o.setLabelsPerMap(!0))}),S()()}if(t&2){let e=A();h(),le("checked",!e.labelsPerMap()),h(),le("checked",e.labelsPerMap())}}function $w(t,n){if(t&1){let e=Me();y(0,"div",14)(1,"span",19),g(2,"By Color Metric"),S(),y(3,"label",12)(4,"input",20),Y("change",function(o){ce(e);let r=A();return de(r.setColorLabel(o,"positive"))}),S(),fe(5,"span",21),y(6,"span",22),g(7),S()(),y(8,"label",12)(9,"input",23),Y("change",function(o){ce(e);let r=A();return de(r.setColorLabel(o,"neutral"))}),S(),fe(10,"span",21),y(11,"span",22),g(12),S()(),y(13,"label",12)(14,"input",24),Y("change",function(o){ce(e);let r=A();return de(r.setColorLabel(o,"negative"))}),S(),fe(15,"span",21),y(16,"span",22),g(17),S()()()}if(t&2){let e=A();h(4),le("checked",e.colorLabels().positive)("disabled",e.colorCategoryCounts().positive===0),h(),Oe("background-color",e.mapColors().positive),h(2),ge("(",e.colorCategoryCounts().positive,")"),h(2),le("checked",e.colorLabels().neutral)("disabled",e.colorCategoryCounts().neutral===0),h(),Oe("background-color",e.mapColors().neutral),h(2),ge("(",e.colorCategoryCounts().neutral,")"),h(2),le("checked",e.colorLabels().negative)("disabled",e.colorCategoryCounts().negative===0),h(),Oe("background-color",e.mapColors().negative),h(2),ge("(",e.colorCategoryCounts().negative,")")}}var bd=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.fileStoreReadWindow=q(Te),this.labelSettingsWriteStore=q(A0),this.colorCategoryCountsStore=q(Xn),this.LabelMode=Di,this.MIN_LABEL_SIZE=.75,this.MAX_LABEL_SIZE=2.5,this.LABEL_SIZE_STEP=.25,this.resetSettingsKeys=["mapState.amountOfTopLabels","mapState.labelSize","mapState.showMetricLabelNodeName","mapState.showMetricLabelNameValue","mapState.colorLabels","mapState.labelMode","mapState.groupLabelCollisions","mapState.labelsPerMap"],this.amountOfTopLabels=D(this.mapStateReadWindow.amountOfTopLabels$,{requireSync:!0}),this.labelSize=D(this.mapStateReadWindow.labelSize$,{requireSync:!0}),this.showMetricLabelNodeName=D(this.mapStateReadWindow.showMetricLabelNodeName$,{requireSync:!0}),this.showMetricLabelNodeValue=D(this.mapStateReadWindow.showMetricLabelNameValue$,{requireSync:!0}),this.colorLabels=D(this.mapStateReadWindow.colorLabels$,{requireSync:!0}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{requireSync:!0}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{requireSync:!0}),this.labelMode=D(this.mapStateReadWindow.labelMode$,{requireSync:!0}),this.colorCategoryCounts=D(this.colorCategoryCountsStore.colorCategoryCounts$,{requireSync:!0}),this.groupLabelCollisions=D(this.mapStateReadWindow.groupLabelCollisions$,{requireSync:!0}),this.labelsPerMap=D(this.mapStateReadWindow.labelsPerMap$,{requireSync:!0}),this.areMultipleMapsVisible=D(this.fileStoreReadWindow.areMultipleMapsVisible$,{requireSync:!0}),this.showColorLabels=Z(()=>this.labelMode()===Di.Color&&!this.isDeltaState()),this.topLabelsTitle=Z(()=>{let e=`Display the labels of the ${this.amountOfTopLabels()} highest buildings`;return this.labelsPerMap()&&this.areMultipleMapsVisible()?`${e} per map`:e}),this.applyDebouncedTopLabels=Pi(e=>{this.labelSettingsWriteStore.setAmountOfTopLabels(e)},t.DEBOUNCE_TIME),this.applyDebouncedLabelSize=Pi(e=>{this.labelSettingsWriteStore.setLabelSize(e)},t.DEBOUNCE_TIME)}static{this.DEBOUNCE_TIME=400}handleTopLabelsInput(e){let i=vf(e,0,50,{round:!0});if(!Number.isNaN(i)){if(i===this.amountOfTopLabels()){this.applyDebouncedTopLabels.cancel();return}this.applyDebouncedTopLabels(i)}}handleLabelSizeInput(e){let i=Number.parseFloat(e.target.value);if(Number.isNaN(i))return;let o=Math.min(2.5,Math.max(.75,i)),r=Math.round(o/.25)*.25,a=Math.round(r*100)/100;if(a===this.labelSize()){this.applyDebouncedLabelSize.cancel();return}this.applyDebouncedLabelSize(a)}setShowMetricLabelNodeName(e){this.labelSettingsWriteStore.setShowMetricLabelNodeName(e.target.checked)}setShowMetricLabelNameValue(e){this.labelSettingsWriteStore.setShowMetricLabelNameValue(e.target.checked)}setColorLabel(e,i){this.labelSettingsWriteStore.setColorLabels({[i]:e.target.checked})}setLabelMode(e){this.labelSettingsWriteStore.setLabelMode(e)}setGroupLabelCollisions(e){this.labelSettingsWriteStore.setGroupLabelCollisions(e.target.checked)}setLabelsPerMap(e){this.labelSettingsWriteStore.setLabelsPerMap(e)}resetSettings(){this.labelSettingsWriteStore.resetSettings(this.resetSettingsKeys)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-label-settings-panel"]],hostAttrs:[1,"contents"],decls:33,vars:18,consts:[[3,"title"],[1,"text-sm"],[1,"flex","items-center","gap-2"],["type","range","min","0","max","50",1,"range","range-primary","range-sm","flex-1",3,"input","value"],["type","number","min","0","max","50",1,"input","input-sm","input-bordered","w-16","text-center",3,"input","value"],["aria-label","Top labels scope","title","Pick the top labels across all maps combined or separately for each map",1,"join","w-full"],["title","Scale floating label font size"],["type","range",1,"range","range-primary","range-sm","flex-1",3,"input","min","max","step","value"],["type","number",1,"input","input-sm","input-bordered","w-16","text-center",3,"input","min","max","step","value"],["aria-label","Label mode",1,"join","w-full"],["type","radio","name","labelMode","aria-label","Height",1,"join-item","btn","btn-sm","flex-1",3,"change","checked"],["type","radio","name","labelMode","aria-label","Color",1,"join-item","btn","btn-sm","flex-1",3,"change","checked"],[1,"flex","items-center","gap-2","cursor-pointer"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked"],[1,"flex","flex-col","gap-1"],["title","Reset label settings to their defaults",1,"btn","btn-outline","btn-error","gap-2",3,"click"],[1,"fa","fa-undo"],["type","radio","name","labelsPerMap","aria-label","All maps",1,"join-item","btn","btn-sm","flex-1",3,"change","checked"],["type","radio","name","labelsPerMap","aria-label","Per map",1,"join-item","btn","btn-sm","flex-1",3,"change","checked"],[1,"text-xs","opacity-60","mb-0.5"],["type","checkbox","aria-label","positive color label",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked","disabled"],[1,"inline-block","w-4","h-4","rounded-sm"],[1,"text-xs","opacity-60"],["type","checkbox","aria-label","neutral color label",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked","disabled"],["type","checkbox","aria-label","negative color label",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked","disabled"]],template:function(i,o){i&1&&(y(0,"div",0)(1,"span",1),g(2,"Top Labels"),S(),y(3,"div",2)(4,"input",3),Y("input",function(a){return o.handleTopLabelsInput(a)}),S(),y(5,"input",4),Y("input",function(a){return o.handleTopLabelsInput(a)}),S()()(),O(6,zw,3,2,"div",5),y(7,"div",6)(8,"span",1),g(9,"Label Size"),S(),y(10,"div",2)(11,"input",7),Y("input",function(a){return o.handleLabelSizeInput(a)}),S(),y(12,"input",8),Y("input",function(a){return o.handleLabelSizeInput(a)}),S()()(),y(13,"div",9)(14,"input",10),Y("change",function(){return o.setLabelMode(o.LabelMode.Height)}),S(),y(15,"input",11),Y("change",function(){return o.setLabelMode(o.LabelMode.Color)}),S()(),y(16,"label",12)(17,"input",13),Y("change",function(a){return o.setShowMetricLabelNodeName(a)}),S(),y(18,"span"),g(19,"Show node names"),S()(),y(20,"label",12)(21,"input",13),Y("change",function(a){return o.setShowMetricLabelNameValue(a)}),S(),y(22,"span"),g(23,"Show metric values"),S()(),y(24,"label",12)(25,"input",13),Y("change",function(a){return o.setGroupLabelCollisions(a)}),S(),y(26,"span"),g(27,"Group overlapping labels"),S()(),O(28,$w,18,15,"div",14),y(29,"button",15),Y("click",function(){return o.resetSettings()}),fe(30,"i",16),y(31,"span"),g(32,"Reset label settings"),S()()),i&2&&(le("title",o.topLabelsTitle()),h(4),le("value",o.amountOfTopLabels()),h(),le("value",o.amountOfTopLabels()),h(),z(o.areMultipleMapsVisible()?6:-1),h(5),le("min",o.MIN_LABEL_SIZE)("max",o.MAX_LABEL_SIZE)("step",o.LABEL_SIZE_STEP)("value",o.labelSize()),h(),le("min",o.MIN_LABEL_SIZE)("max",o.MAX_LABEL_SIZE)("step",o.LABEL_SIZE_STEP)("value",o.labelSize()),h(2),le("checked",o.labelMode()===o.LabelMode.Height),h(),le("checked",o.labelMode()===o.LabelMode.Color),h(2),le("checked",o.showMetricLabelNodeName()),h(4),le("checked",o.showMetricLabelNodeValue()),h(4),le("checked",o.groupLabelCollisions()),h(3),z(o.showColorLabels()?28:-1))},encapsulation:2,changeDetection:0})}}return t})();var js=(()=>{class t{constructor(e,i,o){this.labelCreationService=e,this.labelCollisionService=i,this.connectorDrawingService=o}addLeafLabel(e,i,o=!1){this.labelCreationService.addLeafLabel(e,i,o)}clearLabels(){this.labelCreationService.clearLabels(),this.connectorDrawingService.clearConnectors()}clearTemporaryLabel(e){this.labelCreationService.clearTemporaryLabel(e)}hasLabelForNode(e){return this.labelCreationService.hasLabelForNode(e)}suppressLabelForNode(e){this.labelCreationService.suppressLabelForNode(e)}restoreSuppressedLabel(){this.labelCreationService.restoreSuppressedLabel()}setSuppressLayout(e){this.labelCollisionService.setSuppressLayout(e)}destroy(){this.labelCollisionService.destroy(),this.connectorDrawingService.destroy()}static{this.\u0275fac=function(i){return new(i||t)(M(zs),M(R0),M($s))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var N0=(()=>{class t{constructor(e,i,o){this.codeMapStore=e,this.sharedViewReadWindow=i,this.threeSceneService=o,this.VERTICES_PER_LINE=5,this.arrows=new Array,this.HIGHLIGHT_BUILDING_DELAY=1,this.debounceCalculation=Pi(r=>this.resetEdgesOfBuildings(r),this.HIGHLIGHT_BUILDING_DELAY),this.hoveredNodeSubscription=this.sharedViewReadWindow.hoveredNodeId$.pipe(Fe(r=>{if(r!==null){let a=this.threeSceneService.getMapMesh()?.getMeshDescription().getBuildingByPath(r);this.onBuildingHovered(a)}else this.onBuildingUnhovered()})).subscribe(),this.resetEdgesOfBuildings=r=>{if(!this.codeMapStore.getMapState().isEdgeMetricVisible){this.scale();return}this.clearArrows(),this.showEdgesOfBuildings(this.isEdgeApplicableForBuilding(r)?r:void 0),this.scale()},this.onBuildingSelected=r=>{this.isEdgeApplicableForBuilding(r.building)&&(this.clearArrows(),this.showEdgesOfBuildings()),this.scale()},this.onBuildingDeselected=()=>{this.debounceCalculation.cancel(),this.clearArrows(),this.addEdgePreview()},this.threeSceneService.subscribe("onBuildingSelected",this.onBuildingSelected),this.threeSceneService.subscribe("onBuildingDeselected",this.onBuildingDeselected)}ngOnDestroy(){this.hoveredNodeSubscription.unsubscribe()}onBuildingHovered(e){this.debounceCalculation(e)}onBuildingUnhovered(){this.debounceCalculation.cancel();let{isEdgeMetricVisible:e}=this.codeMapStore.getMapState();e&&(this.clearArrows(),this.showEdgesOfBuildings()),this.scale()}clearArrows(){for(let e of this.arrows)e.traverse(i=>{i.geometry&&i.geometry.dispose(),i.material&&i.material.dispose()});this.arrows=[],this.threeSceneService.edgeArrows.children.length=0}addArrow(e,i,o){let r=this.codeMapStore.getMapState(),a=100*r.edgeHeight,s=this.createCurve(e,i,a),l=jc.getNumber(r.mapColors[o?"outgoingEdge":"incomingEdge"]);this.highlightBuilding(o?i:e),this.setCurveColor(s,l)}addEdgePreview(){let e=this.codeMapStore.getEdgeVisibility();for(let i of e){let o=this.map.get(i.fromNodeName),r=this.map.get(i.toNodeName);if(o&&r&&i.visible!==oi.none&&i.visible){let a=100*this.codeMapStore.getMapState().edgeHeight,s=this.createCurve(o,r,a);this.previewMode(s,i.visible)}}}addEdgeMapBasedOnNodes(e){this.map=this.getNodesAsMap(e)}scale(){let{scaling:e}=this.codeMapStore.getMapState();for(let i of this.arrows)i.scale.x=e.x,i.scale.y=e.y,i.scale.z=e.z}isEdgeApplicableForBuilding(e){return this.codeMapStore.getMapState().isEdgeMetricVisible&&e&&!e.node.flat}showEdgesOfBuildings(e){let i=new Map,o=this.threeSceneService.getSelectedBuilding();if(o){let{node:r}=o;i.set(r.path,r)}if(e){let{node:r}=e;i.set(r.path,r)}i.size>0?this.buildPairingEdges(i):this.addEdgePreview()}buildPairingEdges(e){let{showIncomingEdges:i,showOutgoingEdges:o,edgeMetric:r}=this.codeMapStore.getMapState();if(!i&&!o)return;let a=this.codeMapStore.getEdges();for(let s of a){if(s.attributes[r]===void 0)continue;let l=this.map.get(s.fromNodeName);if(l===void 0)continue;let d=this.map.get(s.toNodeName);d!==void 0&&(o&&e.has(l.path)?(this.addArrow(l,d,!0),this.threeSceneService.applyHighlights()):i&&e.has(d.path)&&(this.addArrow(l,d,!1),this.threeSceneService.applyHighlights()))}}createCurve(e,i,o){let r=e.outgoingEdgePoint.clone(),a=i.incomingEdgePoint.clone(),s=Math.max(r.y+i.height,a.y+1)+o;return r.setY(s),a.setY(s),new tu(e.outgoingEdgePoint,r,a,i.incomingEdgePoint)}highlightBuilding(e){let i=this.threeSceneService.getMapMesh().getMeshDescription().getBuildingByPath(e.path);this.threeSceneService.addBuildingsToHighlightingList(i)}setCurveColor(e,i,o=50){let r=e.getPoints(o),a=this.buildLine(r,i);a.add(this.buildArrow(r)),this.threeSceneService.edgeArrows.add(a),this.arrows.push(a)}previewMode(e,i){if(i===oi.both||i===oi.from){let o=this.makeArrowFromBezier(e,!1);this.threeSceneService.edgeArrows.add(o),this.arrows.push(o)}if(i===oi.both||i===oi.to){let o=this.makeArrowFromBezier(e,!0);this.threeSceneService.edgeArrows.add(o),this.arrows.push(o)}}getNodesAsMap(e){let i=new Map;for(let o of e)i.set(o.path,o);return i}makeArrowFromBezier(e,i,o=50){let r=e.getPoints(o),{incomingEdge:a,outgoingEdge:s}=this.codeMapStore.getMapState().mapColors,l=i?a:s,d=i?r.slice(o+1-this.VERTICES_PER_LINE):r.slice(0,r.length-(o+1-this.VERTICES_PER_LINE));return this.buildEdge(d,jc.getNumber(l))}buildEdge(e,i){let o=this.buildLine(e,i);return o.add(this.buildArrow(e)),o}buildLine(e,i=0){let o=new Qt;o.setFromPoints(e);let r=new os({color:i,linewidth:1});return new Jp(o,r)}buildArrow(e,i=0,o=10,r=10){let a=e.at(-1).clone().sub(e.at(-2).clone()).normalize(),s=e.at(-1).clone();return a.y<0&&(s.y+=o+1),new au(a,s,o+1,i,o,r)}static{this.\u0275fac=function(i){return new(i||t)(M(ar),M(Nt),M(ft))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var B0=(()=>{class t{constructor(){this.mapControls=q(Vt)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-toolbox-center-map-button"]],decls:2,vars:0,consts:[["type","button","title","Center map","aria-label","Center map",1,"join-item","btn","btn-sm","btn-square",3,"click"],[1,"fa","fa-compass"]],template:function(i,o){i&1&&(y(0,"button",0),Y("click",function(){return o.mapControls.autoFitTo()}),fe(1,"i",1),S())},encapsulation:2,changeDetection:0})}}return t})();var V0=(()=>{class t{constructor(e){this.store=e}setPresentationMode(e){this.store.dispatch(Ru({value:e}))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var W0=(()=>{class t{constructor(){this.preferencesReadWindow=q(Yn),this.viewCubeToolboxWriteStore=q(V0),this.isPresentationMode=D(this.preferencesReadWindow.isPresentationMode$,{requireSync:!0}),this.tooltip=Z(()=>this.isPresentationMode()?"Disable flashlight hover effect":"Enable flashlight hover effect")}handleToggle(){this.viewCubeToolboxWriteStore.setPresentationMode(!this.isPresentationMode())}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-toolbox-presentation-mode-button"]],decls:2,vars:3,consts:[["type","button","aria-label","Presentation mode",1,"join-item","btn","btn-sm","btn-square",3,"click","title"],[1,"fa","fa-lightbulb-o"]],template:function(i,o){i&1&&(y(0,"button",0),Y("click",function(){return o.handleToggle()}),fe(1,"i",1),S()),i&2&&(Le("btn-active",o.isPresentationMode()),le("title",o.tooltip()))},encapsulation:2,changeDetection:0})}}return t})();var vd=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-view-cube-toolbox"]],features:[Zi([{provide:Mf,useExisting:Ef}])],decls:4,vars:0,consts:[[1,"join","shadow-md","absolute","top-0","left-1/2","-translate-x-1/2","bg-base-100","rounded"],["view","metrics"]],template:function(i,o){i&1&&(v(0,"div",0),L(1,"cc-toolbox-center-map-button")(2,"cc-toolbox-screenshot-button",1)(3,"cc-toolbox-presentation-mode-button"),b())},dependencies:[B0,_f,W0],encapsulation:2,changeDetection:0})}}return t})();var uo=()=>new as({color:16580095}),No=()=>new as({color:16580095}),zr=()=>new as({color:16580095});var Hs=class t{static buildCube(n){let e=1/n,i=(1-e)/2,o=new ro(e,i,i),r=new ro(i,e+i,i),a=new ro(i,i,i),s=new ro(e,e,i),l=new ro(e,e+i,i);return t.newBuildCubeGroup(o,r,a,s,l)}static newBuildCubeGroup(n,e,i,o,r){let a=new Wn,{group:s,frontLeft:l,frontCenter:d,frontRight:c,middleLeft:m,middleCenter:p,middleRight:u,backLeft:k,backCenter:E,backRight:P}=t.buildCubeTopFace(n,i,o);a.add(s);let{group:$,frontLeftEdge:ee,frontCenterFace:B,frontRightEdge:j,middleLeftFace:G,middleRightFace:K,backLeftEdge:ie,backCenterFace:oe,backRightEdge:ne}=t.buildCubeSides(e,r);return a.add($),{group:a,top:{front:{left:l,center:d,right:c},middle:{left:m,center:p,right:u},back:{left:k,center:E,right:P}},sides:{front:{left:ee,center:B,right:j},middle:{left:G,right:K},back:{left:ie,center:oe,right:ne}}}}static buildCubeTopFace(n,e,i){let o=new st(e,zr()),r=new st(n,uo()),a=new st(e,zr()),s=new st(n,uo()),l=new st(i,No()),d=new st(n,No()),c=new st(e,zr()),m=new st(n,uo()),p=new st(e,zr()),u=i.parameters.height/2+e.parameters.height/2;o.position.x-=u,o.position.y-=u,r.position.y-=u,a.position.x+=u,a.position.y-=u,s.position.x-=u,s.rotation.z=Math.PI/2,d.position.x+=u,d.rotation.z=Math.PI/2,c.position.x-=u,c.position.y+=u,m.position.y+=u,p.position.x+=u,p.position.y+=u;let k=new Wn;return k.rotation.x=Math.PI/2,k.position.y+=u,k.add(o),k.add(r),k.add(a),k.add(s),k.add(l),k.add(d),k.add(c),k.add(m),k.add(p),{group:k,frontLeft:o,frontCenter:r,frontRight:a,middleLeft:s,middleCenter:l,middleRight:d,backLeft:c,backCenter:m,backRight:p}}static buildCubeSides(n,e){let i=new st(n,uo()),o=new st(e,No()),r=new st(n,uo()),a=new st(e,No()),s=new st(e,No()),l=new st(n,uo()),d=new st(e,No()),c=new st(n,uo()),m=e.parameters.width/2+n.parameters.width/2,p=n.parameters.width/2;i.position.x-=m,i.position.z+=m,o.position.z+=m,r.position.x+=m,r.position.z+=m,a.position.x-=m,a.rotation.y=Math.PI/2,s.position.x+=m,s.rotation.y=Math.PI/2,l.position.x-=m,l.position.z-=m,d.position.z-=m,c.position.x+=m,c.position.z-=m;let u=new Wn;return u.position.y-=p,u.add(i),u.add(o),u.add(r),u.add(a),u.add(s),u.add(l),u.add(d),u.add(c),{group:u,frontLeftEdge:i,frontCenterFace:o,frontRightEdge:r,middleLeftFace:a,middleRightFace:s,backLeftEdge:l,backCenterFace:d,backRightEdge:c}}};var O0=(()=>{class t{constructor(e,i){this.threeMapControlsService=e,this.cdr=i}ngOnInit(){this.maxZoom=this.threeMapControlsService.MAX_ZOOM,this.minZoom=this.threeMapControlsService.MIN_ZOOM,this.threeMapControlsService.zoomPercentage$.subscribe(e=>{this.zoomPercentage=e,this.cdr.detectChanges()})}onInput(e){let i=e.target,o=Number.parseFloat(i.value);this.threeMapControlsService.setZoomPercentage(o)}zoomIn(){this.threeMapControlsService.setZoomPercentage(Math.min(this.zoomPercentage+10,this.maxZoom))}zoomOut(){this.threeMapControlsService.setZoomPercentage(Math.max(this.zoomPercentage-10,this.minZoom))}static{this.\u0275fac=function(i){return new(i||t)(te(Vt),te(dn))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-zoom-slider"]],decls:8,vars:4,consts:[[1,"absolute","right-[5px]","top-[10px]","m-2.5","flex","h-[150px]","flex-col","items-center","gap-2.5"],["data-testid","zoomIn",1,"m-0","cursor-pointer","border-none","bg-transparent","p-0","text-base","text-neutral-500",3,"click"],["type","range","id","zoomRange","data-testid","zoomRange","aria-label","Zoom level",1,"h-[100px]","w-[3px]","appearance-none","bg-neutral-500","text-neutral-500","opacity-70","outline-none","transition-opacity","duration-200","[-webkit-appearance:none]","[direction:rtl]","[writing-mode:vertical-lr]","[&::-moz-range-thumb]:h-[3px]","[&::-moz-range-thumb]:w-[10px]","[&::-moz-range-thumb]:cursor-pointer","[&::-moz-range-thumb]:bg-neutral-500","[&::-webkit-slider-thumb]:h-[3px]","[&::-webkit-slider-thumb]:w-[10px]","[&::-webkit-slider-thumb]:cursor-pointer","[&::-webkit-slider-thumb]:appearance-none","[&::-webkit-slider-thumb]:bg-neutral-500","[&::-webkit-slider-thumb]:[-webkit-appearance:none]",3,"input","min","max","value"],["data-testid","zoomOut",1,"m-0","cursor-pointer","border-none","bg-transparent","p-0","text-base","text-neutral-500",3,"click"],["id","zoomValue",1,"w-[30px]","text-center","text-[10px]","text-neutral-500"]],template:function(i,o){i&1&&(y(0,"div",0)(1,"button",1),Y("click",function(){return o.zoomIn()}),g(2," + "),S(),y(3,"input",2),Y("input",function(a){return o.onInput(a)}),S(),y(4,"button",3),Y("click",function(){return o.zoomOut()}),g(5," - "),S(),y(6,"span",4),g(7),S()()),i&2&&(h(3),le("min",o.minZoom)("max",o.maxZoom)("value",o.zoomPercentage),h(4),ge("",o.zoomPercentage==null?null:o.zoomPercentage.toFixed(0),"%"))},encapsulation:2,changeDetection:0})}}return t})();var $r=(()=>{class t{constructor(e){this.threeMapControlsService=e,this.eventEmitter=new ku,this.currentlyHovered=null,this.isDragging=!1}init(e,i,o){this.cubeGroup=e,this.camera=i,this.renderer=o,this.initOrbitalControl(i,o),this.initRendererEventListeners(o)}resetIsDragging(){this.isDragging=!1}initOrbitalControl(e,i){this.controls=new gs(e,i.domElement),this.controls.maxPolarAngle=Math.PI/2,this.controls.enableZoom=!1,this.controls.enablePan=!1,this.controls.rotateSpeed=1}initRendererEventListeners(e){e.domElement.addEventListener("mousemove",i=>this.onDocumentMouseMove(i)),e.domElement.addEventListener("mouseup",i=>this.onDocumentMouseUp(i)),e.domElement.addEventListener("mousedown",i=>this.onDocumentMouseClick(i,"mousedown")),e.domElement.addEventListener("dblclick",i=>this.onDocumentMouseClick(i,"dblclick")),e.domElement.addEventListener("mouseleave",i=>this.onWindowMouseLeave(i)),e.domElement.addEventListener("mouseenter",()=>this.onDocumentMouseEnter())}onDocumentMouseClick(e,i){this.isDragging=!0,this.checkMouseIntersection(e,i)}onWindowMouseLeave(e){(e.relatedTarget==null||!(e.relatedTarget instanceof HTMLCanvasElement))&&this.enableRotation(!1)}onDocumentMouseEnter(){this.enableRotation(!0)}enableRotation(e){this.controls.enableRotate=e}checkMouseIntersection(e,i){this.getCubeIntersectedByMouse(e)||this.eventEmitter.emit("viewCubeEventPropagation",{type:i,event:e})}getCubeIntersectedByMouse(e){let i=this.transformIntoCanvasVector(e),o=new ss;o.setFromCamera(i,this.camera);let r=[];for(let s of mn(this.cubeGroup))Ki(s)&&r.push(s.data);let[a]=o.intersectObjects(r);return a?a.object:null}transformIntoCanvasVector(e){let{domElement:i}=this.renderer,o=this.renderer.getPixelRatio(),r=i.getBoundingClientRect(),a=(e.clientX-r.left)/i.width*o*2-1,s=-((e.clientY-r.top)/i.height*o)*2+1;return new Ge(a,s)}propagateMovement(){if(this.isDragging){let e=this.camera.position;this.threeMapControlsService.rotateCameraInVectorDirection(-e.x,-e.y,-e.z)}return this.isDragging}onDocumentMouseMove(e){if(this.propagateMovement())return;let i=this.getCubeIntersectedByMouse(e);i?this.currentlyHovered&&i.uuid!==this.currentlyHovered.uuid?this.triggerViewCubeUnhoverEvent():this.currentlyHovered||this.triggerViewCubeHoverEvent(i):(this.currentlyHovered&&this.triggerViewCubeUnhoverEvent(),this.eventEmitter.emit("viewCubeEventPropagation",{type:"mousemove",event:e}))}onDocumentMouseUp(e){this.isDragging=!1;let i=this.getCubeIntersectedByMouse(e);i?this.eventEmitter.emit("viewCubeClicked",{cube:i}):this.eventEmitter.emit("viewCubeEventPropagation",{type:"mouseup",event:e})}triggerViewCubeHoverEvent(e){this.currentlyHovered=e,_i(Mi.Pointer),this.eventEmitter.emit("viewCubeHoveredEvent",{cube:e})}triggerViewCubeUnhoverEvent(){this.currentlyHovered=null,_i(Mi.Default),this.eventEmitter.emit("viewCubeUnHoveredEvent")}subscribe(e,i){this.eventEmitter.on(e,o=>{i(o)})}static{this.\u0275fac=function(i){return new(i||t)(M(Vt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var xd=(()=>{class t{constructor(e,i,o){this.elementReference=e,this.threeMapControlsService=i,this.viewCubeMouseEvents=o,this.WIDTH=200,this.HEIGHT=200,this.LENGTH_VIEWCUBE=1,this.hoverInfo={cube:null,originalMaterial:null},this.cubeDefinition={top:null,sides:null},this.onCameraChanged=r=>{let a=this.calculateCameraPosition(r.camera);this.setCameraPosition(a),this.renderer.render(this.scene,this.camera)},this.onCubeHovered=r=>{this.hoverInfo={cube:r.cube,originalMaterial:r.cube.material},this.hoverInfo.cube.material.emissive=new Vn(16777215),this.renderer.render(this.scene,this.camera)},this.onCubeUnhovered=()=>{this.hoverInfo.cube.material.emissive=new Vn(0),this.hoverInfo.cube=null,this.renderer.render(this.scene,this.camera)},this.onCubeClicked=r=>{switch(r.cube){case this.cubeDefinition.top.front.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,-1,1);break;case this.cubeDefinition.top.front.center:this.threeMapControlsService.rotateCameraInVectorDirection(0,-1,1);break;case this.cubeDefinition.top.front.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,-1,1);break;case this.cubeDefinition.top.middle.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,-1,0);break;case this.cubeDefinition.top.middle.center:this.threeMapControlsService.rotateCameraInVectorDirection(0,-1,0);break;case this.cubeDefinition.top.middle.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,-1,0);break;case this.cubeDefinition.top.back.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,-1,-1);break;case this.cubeDefinition.top.back.center:this.threeMapControlsService.rotateCameraInVectorDirection(0,-1,-1);break;case this.cubeDefinition.top.back.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,-1,-1);break;case this.cubeDefinition.sides.front.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,0,-1);break;case this.cubeDefinition.sides.front.center:this.threeMapControlsService.rotateCameraInVectorDirection(0,0,0);break;case this.cubeDefinition.sides.front.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,0,-1);break;case this.cubeDefinition.sides.middle.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,0,0);break;case this.cubeDefinition.sides.middle.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,0,0);break;case this.cubeDefinition.sides.back.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,0,1);break;case this.cubeDefinition.sides.back.center:this.threeMapControlsService.rotateCameraInVectorDirection(0,0,1);break;case this.cubeDefinition.sides.back.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,0,1);break}}}ngOnInit(){this.initScene(),this.initLights(),this.initRenderer(this.elementReference.nativeElement),this.initCube(),this.initAxesHelper(),this.initCamera(),this.viewCubeMouseEvents.init(this.cubeGroup,this.camera,this.renderer),this.threeMapControlsService.subscribe("onCameraChanged",this.onCameraChanged),this.viewCubeMouseEvents.subscribe("viewCubeHoveredEvent",this.onCubeHovered),this.viewCubeMouseEvents.subscribe("viewCubeUnHoveredEvent",this.onCubeUnhovered),this.viewCubeMouseEvents.subscribe("viewCubeClicked",this.onCubeClicked)}initAxesHelper(){let e=new su(1.3),i=-(this.LENGTH_VIEWCUBE/2)+.01;e.position.x+=i,e.position.y+=i,e.position.z+=i,this.scene.add(e)}initCube(){let{group:e,top:i,sides:o}=Hs.buildCube(1.9);this.cubeGroup=e,this.cubeDefinition.top=i,this.cubeDefinition.sides=o;let r=new ru(this.cubeGroup,new Vn(0));this.scene.add(this.cubeGroup),this.scene.add(r)}setCameraPosition(e){this.camera.position.set(e.x,e.y,e.z),this.camera.lookAt(0,0,0),this.camera.updateProjectionMatrix()}calculateCameraPosition(e){let i=this.threeMapControlsService.controls.target.clone();return e.position.clone().sub(i).normalize().multiplyScalar(3)}initScene(){this.scene=new is}initRenderer(e){this.renderer=new ls({alpha:!0,antialias:!0}),this.renderer.setSize(this.WIDTH,this.HEIGHT),this.renderer.setPixelRatio(window.devicePixelRatio),e.appendChild(this.renderer.domElement)}initCamera(){this.camera=new ts(45,this.WIDTH/this.HEIGHT,.1,1e3),this.camera.position.z=4}initLights(){this.lights=new Wn;let e=new ou(7368816,2.8),i=new $c(14737632,1.8);i.position.set(50,10,8).normalize();let o=new $c(14737632,1.8);o.position.set(-50,10,-8).normalize(),this.lights.add(e),this.lights.add(i),this.lights.add(o),this.scene.add(this.lights)}static{this.\u0275fac=function(i){return new(i||t)(te(At),te(Vt),te($r))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-view-cube"]],hostAttrs:[1,"absolute","right-0","top-[10px]","z-[11]","[transition:right_0.3s_ease]","[&.sideBarVisible]:right-[var(--cc-inspector-width)]"],decls:2,vars:0,template:function(i,o){i&1&&L(0,"cc-view-cube-toolbox")(1,"cc-zoom-slider")},dependencies:[vd,O0],encapsulation:2,changeDetection:0})}}return t})();var Us=(function(t){return t[t.LeftClick=0]="LeftClick",t[t.RightClick=2]="RightClick",t})(Us||{}),Bo=(()=>{class t{constructor(e,i,o,r,a,s,l,d,c,m,p){this.threeCameraService=e,this.threeRendererService=i,this.threeSceneService=o,this.codeMapStore=r,this.fileStoreReadWindow=a,this.sharedViewReadWindow=s,this.labelSettingsFacade=l,this.tooltipService=d,this.viewCubeMouseEvents=c,this.threeViewerService=m,this.idToBuilding=p,this.THRESHOLD_FOR_MOUSE_MOVEMENT_TRACKING=3,this.mouse={x:0,y:0},this.oldMouse={x:0,y:0},this.mouseOnLastClick={x:0,y:0},this.isGrabbing=!1,this.isMoving=!1,this.raycaster=new ss,this.labelSelectedBuilding=null,this.subscriptions=[this.fileStoreReadWindow.visibleFileStates$.pipe(Fe(()=>this.onFilesSelectionChanged())).subscribe(),this.sharedViewReadWindow.blacklist$.pipe(Fe(u=>this.onBlacklistChanged(u))).subscribe(),this.sharedViewReadWindow.hoveredNodeId$.pipe(Fe(u=>{u!==null?this.hoverNode(u):this.unhoverNode(!1)})).subscribe()],this.onViewCubeEventPropagation=u=>{switch(u.type){case"mousemove":this.onDocumentMouseMove(u.event);break;case"mouseup":this.onDocumentMouseUp(u.event);break;case"mousedown":this.onDocumentMouseDown(u.event);break;case"dblclick":this.onDocumentDoubleClick();break}},this.onDocumentMouseMove=u=>{this.mouse.x=u.clientX,this.mouse.y=u.clientY,this.updateHovering(),this.viewCubeMouseEvents.propagateMovement()}}ngOnDestroy(){for(let e of this.subscriptions)e.unsubscribe()}start(){this.registerEventListeners(),this.viewCubeMouseEvents.subscribe("viewCubeEventPropagation",this.onViewCubeEventPropagation)}registerEventListeners(){let e=this.threeRendererService.renderer.domElement;e.addEventListener("mousemove",this.onDocumentMouseMove),e.addEventListener("mouseup",i=>this.onDocumentMouseUp(i)),e.addEventListener("mousedown",i=>this.onDocumentMouseDown(i)),e.addEventListener("dblclick",()=>this.onDocumentDoubleClick()),e.addEventListener("mouseleave",i=>this.onDocumentMouseLeave(i)),e.addEventListener("mouseenter",()=>this.onDocumentMouseEnter()),e.addEventListener("wheel",Pi(()=>this.threeRendererService.render()))}hoverNode(e){if(this.isGrabbingOrMoving())return;let{buildings:i}=this.threeSceneService.getMapMesh().getMeshDescription();for(let o of i)if(o.node.path===e){this.hoverBuilding(o,!1);break}this.threeRendererService.render()}unhoverNode(e=!0){this.unhoverBuilding(e),this.threeRendererService.render()}onFilesSelectionChanged(){this.threeSceneService.clearSelection(),this.threeSceneService.clearConstantHighlight(),this.tooltipService.hide()}onBlacklistChanged(e){let i=this.threeSceneService.getSelectedBuilding();this.tooltipService.hide(),i&&lp(i.node.path,e)&&this.threeSceneService.clearSelection(),this.unhoverBuilding()}updateHovering(){if(this.hasMouseMoved(this.oldMouse)){if(this.isGrabbingOrMoving()){this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),this.threeRendererService.render();return}this.oldMouse.x=this.mouse.x,this.oldMouse.y=this.mouse.y;let e=this.threeSceneService.getMapMesh();if(e){this.threeCameraService.camera.updateMatrixWorld(!1);let i=this.transformHTMLToSceneCoordinates(),o=this.threeCameraService.camera;o.isPerspectiveCamera&&this.raycaster.setFromCamera(i,o),this.intersectedBuilding=e.checkMouseRayMeshIntersection(i,o);let r=this.threeSceneService.getHighlightedBuilding(),a=this.intersectedBuilding;r?.id!==a?.id?(this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),r&&a&&!this.isGrabbingOrMoving()?(this.threeSceneService.prepareHighlightTransition(),this.showTooltipForBuilding(a),this.hoverBuilding(a)):(this.unhoverBuilding(),a&&!this.isGrabbingOrMoving()&&(this.showTooltipForBuilding(a),this.hoverBuilding(a)))):!a&&this.codeMapStore.getHoveredNodeId()!==null?(this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),this.unhoverBuilding()):a&&this.tooltipService.isVisible()&&this.tooltipService.updatePosition(this.mouse.x,this.mouse.y)}}}drawLabelSelectedBuilding(e){this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),this.labelSelectedBuilding!==null&&this.labelSettingsFacade.clearTemporaryLabel(this.labelSelectedBuilding),e?.node?.isLeaf&&(this.labelSettingsFacade.hasLabelForNode(e.node)||this.labelSettingsFacade.addLeafLabel(e.node,0,!0),this.labelSelectedBuilding=e.node)}showTooltipForBuilding(e){this.labelSettingsFacade.hasLabelForNode(e.node)&&this.labelSettingsFacade.suppressLabelForNode(e.node),this.tooltipService.show(e.node,this.mouse.x,this.mouse.y)}clearLabelSelectedBuilding(){this.labelSelectedBuilding!==null&&(this.labelSettingsFacade.clearTemporaryLabel(this.labelSelectedBuilding),this.labelSelectedBuilding=null)}enableOrbitalsRotation(e){this.threeViewerService.enableRotation(e),this.viewCubeMouseEvents.enableRotation(e)}onDocumentMouseEnter(){this.enableOrbitalsRotation(!0)}onDocumentMouseLeave(e){this.labelSettingsFacade.setSuppressLayout(!1),this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),this.unhoverBuilding(),e.relatedTarget instanceof HTMLCanvasElement||this.enableOrbitalsRotation(!1)}onDocumentDoubleClick(){let e=this.threeSceneService.getHighlightedBuilding(),i=this.threeSceneService.getSelectedBuilding(),o=e?.node.link;if(o&&!this.hasMouseMoved(this.mouseOnLastClick)&&window.open(o,"_blank"),i?.node.isLeaf){let r=i.node.link;if(r){window.open(r,"_blank");return}}}onDocumentMouseDown(e){e.button===Us.RightClick&&(this.isMoving=!0,_i(Mi.Moving)),e.button===Us.LeftClick&&(this.isGrabbing=!0,_i(Mi.Grabbing)),this.labelSettingsFacade.setSuppressLayout(!0),this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),this.mouseOnLastClick={x:e.clientX,y:e.clientY},document.activeElement.blur()}onDocumentMouseUp(e){this.labelSettingsFacade.setSuppressLayout(!1),this.viewCubeMouseEvents.resetIsDragging(),e.button===Us.LeftClick?this.onLeftClick():this.onRightClick(),this.intersectedBuilding!==void 0?_i(Mi.Pointer):_i(Mi.Default)}onRightClick(){this.isMoving=!1,this.intersectedBuilding&&!this.hasMouseMovedBeyondThreshold(this.mouseOnLastClick)&&this.codeMapStore.setRightClickedNodeData({nodeId:this.intersectedBuilding.node.path,xPositionOfRightClickEvent:this.mouse.x,yPositionOfRightClickEvent:this.mouse.y,origin:"codeMap"}),this.threeRendererService.render()}onLeftClick(){this.isGrabbing=!1,this.hasMouseMovedBeyondThreshold(this.mouseOnLastClick)||(this.intersectedBuilding?(this.threeSceneService.selectBuilding(this.intersectedBuilding),this.drawLabelSelectedBuilding(this.intersectedBuilding)):(this.threeSceneService.clearSelection(),this.clearLabelSelectedBuilding()),this.threeSceneService.clearConstantHighlight()),this.threeRendererService.render()}hasMouseMovedBeyondThreshold({x:e,y:i}){return Math.abs(this.mouse.x-e)>this.THRESHOLD_FOR_MOUSE_MOVEMENT_TRACKING||Math.abs(this.mouse.y-i)>this.THRESHOLD_FOR_MOUSE_MOVEMENT_TRACKING}hasMouseMoved({x:e,y:i}){return this.mouse.x!==e||this.mouse.y!==i}isGrabbingOrMoving(){return this.isGrabbing||this.isMoving}hoverBuilding(e,i=!0){_i(Mi.Pointer);let r=this.codeMapStore.getIdToNode().get(e.node.id);for(let{data:a}of mn(r)){let s=this.idToBuilding.get(a.id);s&&this.threeSceneService.addBuildingsToHighlightingList(s)}this.threeSceneService.applyHighlights(),i&&this.codeMapStore.setHoveredNodeId(e.node.path)}transformHTMLToSceneCoordinates(){let{renderer:e,renderer:{domElement:i}}=this.threeRendererService,o=e.getPixelRatio(),r=i.getBoundingClientRect(),a=this.mouse.x/i.width*o*2-1,s=-((this.mouse.y-r.top)/i.height*o)*2+1;return{x:a,y:s}}unhoverBuilding(e=!0){this.isGrabbingOrMoving()||_i(Mi.Default),this.threeSceneService.getConstantHighlight().size>0?this.threeSceneService.clearHoverHighlight():this.threeSceneService.clearHighlight(),e&&this.codeMapStore.setHoveredNodeId(null)}static{this.\u0275fac=function(i){return new(i||t)(M(Qn),M(kt),M(ft),M(ar),M(Te),M(Nt),M(js),M(Un),M($r),M(Zn),M(Gn))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Gw=2,jr=(()=>{class t{constructor(e,i,o,r,a,s,l,d){this.codeMapStore=e,this.fileStoreReadWindow=i,this.threeSceneService=o,this.labelSettingsFacade=r,this.codeMapArrowService=a,this.threeStatsService=s,this.codeMapMouseEventService=l,this.colorCategoryCountsStore=d,this.nodesByColor={positive:[],neutral:[],negative:[]},this.onIsLoadingFileChanged=c=>{c?this.threeSceneService?.dispose():this.threeStatsService?.resetPanels()},this.subscription=this.fileStoreReadWindow.isLoadingFile$.pipe(Fe(this.onIsLoadingFileChanged)).subscribe()}ngOnDestroy(){this.subscription.unsubscribe()}load(e){this.render(e),this.scaleMap()}render(e){let i=this.getNodes(e),o=this.sortVisibleNodesByHeightDescending(i);this.unflattenedNodes=o.filter(({flat:r})=>!r),this.setNewMapMesh(i,o),this.getNodesMatchingColorSelector(this.unflattenedNodes),this.setLabels(this.unflattenedNodes),this.setArrows(o)}setNewMapMesh(e,i){let o=this.codeMapStore.getState(),r=new Eu(i,o,Ri(o.files));this.threeSceneService.setMapMesh(e,r)}scaleMap(){this.codeMapMouseEventService.unhoverNode(),this.codeMapArrowService.scale(),this.threeSceneService.scaleHeight(),this.labelSettingsFacade.clearLabels(),this.setLabels(this.unflattenedNodes)}getNodes(e){let i=this.codeMapStore.getState(),o=ao(i),{mapState:{layoutAlgorithm:r},files:a}=i,s=Ri(a);switch(r){case Na.StreetMap:case Na.TreeMapStreet:return Cu.createStreetLayoutNodes(e,i,o,zp(i),s);case Na.SquarifiedTreeMap:return Mu(e,i,o,s);default:return[]}}sortVisibleNodesByHeightDescending(e){return this.codeMapStore.getState().preferences.experimentalFeaturesEnabled?(this.setMinBuildingLength(e),e.filter(o=>o.visible&&o.width>0).sort((o,r)=>r.height-o.height)):e.filter(o=>o.visible&&o.length>0&&o.width>0).sort((o,r)=>r.height-o.height)}setMinBuildingLength(e){for(let i of e)i.length<=0&&(i.length=Gw)}getNodesMatchingColorSelector(e){let i=this.codeMapStore.getState(),o=i.mapState.colorRange;this.nodesByColor={positive:[],negative:[],neutral:[]};for(let r of e)if(r.isLeaf){let a=r.attributes[i.mapState.colorMetric];i.mapState.colorMetric==="unary"?this.nodesByColor.positive.push(r):a!==null&&(a<o.from?this.nodesByColor.positive.push(r):a<o.to?this.nodesByColor.neutral.push(r):this.nodesByColor.negative.push(r))}this.colorCategoryCountsStore.setColorCategoryCounts({positive:this.nodesByColor.positive.length,neutral:this.nodesByColor.neutral.length,negative:this.nodesByColor.negative.length}),this.uncheckEmptyColorLabels()}uncheckEmptyColorLabels(){let e=this.codeMapStore.getState().mapState.colorLabels,i={};for(let o of Vc)e[o]&&this.nodesByColor[o].length===0&&(i[o]=!1);Object.keys(i).length>0&&this.codeMapStore.setColorLabels(i)}setBuildingLabel(e,i){for(let o of e)this.labelSettingsFacade.addLeafLabel(o,i)}setLabels(e){if(this.labelSettingsFacade.clearLabels(),e===void 0||e.length===0)return;let i=this.codeMapStore.getState(),{showMetricLabelNodeName:o,showMetricLabelNameValue:r,colorLabels:a,amountOfTopLabels:s,labelMode:l}=i.mapState;if(o||r){let d=e[0].height,c=this.getTopNodeSelector(i,s);if(l===Di.Color){let{colorMetric:m}=i.mapState,p=c(Vc.filter(u=>a[u]).flatMap(u=>this.nodesByColor[u]).filter(u=>Number.isFinite(u.attributes[m])),u=>u.attributes[m]);this.setBuildingLabel(p,d)}else{let m=c(e.filter(p=>p.isLeaf),p=>p.height??0);this.setBuildingLabel(m,d)}}}getTopNodeSelector(e,i){return fs(e)?(o,r)=>M0(o,a=>es(a.path),r,i):(o,r)=>md(o,r,i)}setArrows(e){this.codeMapArrowService.clearArrows(),this.codeMapArrowService.addEdgeMapBasedOnNodes(e),this.codeMapArrowService.addEdgePreview()}static{this.\u0275fac=function(i){return new(i||t)(M(ar),M(Te),M(ft),M(js),M(N0),M(Bu),M(Bo),M(Xn))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Yw=1e3/60,Gs=(()=>{class t{constructor(e,i,o,r,a,s,l,d){this.store=e,this.actions$=i,this.threeRendererService=o,this.codeMapRenderService=r,this.threeViewerService=a,this.activeViewStore=s,this.viewReadinessStore=l,this.errorHandler=d,this.actionsRequiringRender$=this.actions$.pipe(at(...S0)),this.mapDataChange$=It([this.store.select(Et),this.actionsRequiringRender$]).pipe(ke(([c])=>c)),this.dataChangedWhileMetricsViewIsShown$=this.mapDataChange$.pipe($t(this.activeViewStore.activeView$),Ie(([,c])=>c==="metrics"),ke(([c])=>c)),this.switchedToStaleMetricsView$=this.activeViewStore.activeView$.pipe(Ie(c=>c==="metrics"&&this.viewReadinessStore.isStale("metrics")),Ut(()=>this.threeViewerService.isMapCanvasMounted$.pipe(Ie(Boolean),ut(1))),$t(this.store.select(Et)),ke(([,c])=>c)),this.renderCodeMap$=Ae(()=>Ui(this.dataChangedWhileMetricsViewIsShown$,this.switchedToStaleMetricsView$).pipe(Ie(c=>!!c.unifiedMapNode),km(Yw,ym,{leading:!1,trailing:!0}),Fe(c=>this.renderMap(c)),Gi()),{dispatch:!1})}renderMap(e){try{this.codeMapRenderService.load(e.unifiedMapNode),this.threeRendererService.render()}catch(i){this.errorHandler.handleError(i)}finally{_s()}}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(ht),M(kt),M(jr),M(Zn),M(or),M(tr),M(qm))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var Kw=350,$0=(()=>{class t{constructor(e,i,o,r){this.store=e,this.actions$=i,this.renderCodeMapEffect=o,this.viewReadinessStore=r,this.hideLoadingFileOnCommit$=Ae(()=>this.actions$.pipe(at(ni),ke(()=>_p({value:!1})))),this.markViewsStaleOnDataChange$=Ae(()=>Ui(this.store.select(un).pipe(mi(1)),this.actions$.pipe(at(ni)),this.actions$.pipe(at(Xa,Si,Fn,Ln))).pipe(Fe(()=>{this.viewReadinessStore.markAllStale()})),{dispatch:!1}),this.markMetricsReadyOnRender$=Ae(()=>this.renderCodeMapEffect.renderCodeMap$.pipe(ti(Kw),Ie(()=>this.viewReadinessStore.isStale("metrics")),Fe(()=>{this.viewReadinessStore.markReady("metrics")})),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(ht),M(Gs),M(tr))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var j0=[Gs,y0,$0];var sr=t=>(t=t.trim(),t.startsWith("*")||t.endsWith("*")||t.startsWith("/")||t.startsWith("./")?t:!t.startsWith('"')&&!t.endsWith('"')?t.startsWith("!")?t:`*${t}*`:t);var Xs=(t,n)=>{let e=[],i=n.split(",");if(i[0].startsWith("!")){i[0]=i[0].slice(1);for(let o of i)o.length>0&&e.push({path:`!${sr(o)}`,type:t})}else for(let o of i)if(o.length>0){if(o.startsWith("!"))break;o=sr(o),e.push({path:o,type:t})}return e};var H0="BlacklistExtensionAction",wd=(t,...n)=>({type:H0,action:{type:t},extensions:n}),U0=(()=>{class t{constructor(e,i){this.actions$=e,this.store=i,this.searchPattern2BlacklistItems$=this.actions$.pipe(at(H0),ke(o=>({blackListType:o.action.type,extensionToBlacklist:Xs(o.action.type,o.extensions.join(","))})),Gi()),this.blackListExtensions$=Ae(()=>this.searchPattern2BlacklistItems$.pipe(Ie(o=>o.blackListType==="flatten"||o.blackListType==="exclude"),Fe(o=>{this.store.dispatch(Si({items:o.extensionToBlacklist}))})),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var G0=[U0];var X0=[];var Q0=(()=>{class t{constructor(e){this.store=e,this.updateAmountOfEdgePreviews$=Ae(()=>this.store.select(us).pipe($t(this.store.select(za)),mi(1),Ie(([i,o])=>o>i),ke(([i])=>eo({value:i}))))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var Jw=Re(Rp,qu,(t,n)=>({heightMetric:t,isLinked:n})),Y0=(()=>{class t{constructor(e){this.store=e,this.linkHeightAndColorMetric$=Ae(()=>this.store.select(Jw).pipe(Ie(({isLinked:i})=>i),ke(({heightMetric:i})=>Pt({value:i}))))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var lr=t=>{let n=t.maxValue-t.minValue,e=Math.round(n/3),i=e+t.minValue,o=e*2+t.minValue;return{from:i,to:o}};var Z0=(()=>{class t{constructor(e,i){this.actions$=e,this.store=i,this.resetColorRangeOnColorMetricChange$=Ae(()=>this.actions$.pipe(at(Pt),Ut(()=>this.store.select(so).pipe(ut(1))),ke(o=>xi({value:lr(o)}))))}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var K0=(()=>{class t{constructor(e){this.store=e,this.resetIsEdgeMetricVisible$=Ae(()=>this.store.select(fn).pipe($t(this.store.select(Fp)),Ie(([,i])=>!i),ke(()=>Cn())))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var J0=(()=>{class t{constructor(e,i,o){this.store=e,this.mapStateReadWindow=i,this.metricsLensSourceReadWindow=o,this.updateMapColors$=Ae(()=>this.store.select(kp).pipe(ke(r=>{let a=this.metricsLensSourceReadWindow.getAttributeDescriptors(),s=this.mapStateReadWindow.getMapColors();if(a[r]?.direction===1){let l=JSON.parse(af(s)),d=l.negative;return l.negative=l.positive,l.positive=d,Ai({value:l})}return Ai({value:s??Lt})})))}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(ve),M(hs))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var eg=[Z0,J0,Y0,K0,Q0];var cr=(()=>{class t{constructor(e){this.store=e}setStandard(e){this.store.dispatch(pp({files:e}))}removeFiles(e){this.store.dispatch(mp({fileNames:e}))}setDelta(e,i){this.store.dispatch(bp({referenceFile:e,comparisonFile:i}))}setDeltaReference(e){this.store.dispatch(gp({file:e}))}setDeltaComparison(e){this.store.dispatch(fp({file:e}))}switchReferenceAndComparison(){this.store.dispatch(up())}setFiles(e){this.store.dispatch(hp({value:e}))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Qs=(()=>{class t{constructor(e,i,o){this.fileStoreReadWindow=e,this.filesRepo=i,this.navBarWriteStore=o,this.lastSetFilesOfPreviousMode=[],this.subscription=this.fileStoreReadWindow.files$.pipe(_m(),Ie(([r,a])=>Ri(r)!==Ri(a)||a.length===0),Fe(([r,a])=>{this.lastSetFilesOfPreviousMode=a.length===0?a:r})).subscribe()}ngOnDestroy(){this.subscription.unsubscribe()}toggle(){let e=this.filesRepo.getFiles();if(!Ri(e)){this.lastSetFilesOfPreviousMode=this.filterNoneExisting(e,this.lastSetFilesOfPreviousMode);let o=this.lastSetFilesOfPreviousMode.find(a=>a.selectedAs===ii.Reference)??e.find(a=>a.selectedAs===ii.Partial);if(o===void 0)return;let r=this.lastSetFilesOfPreviousMode.find(a=>a.selectedAs===ii.Comparison);this.navBarWriteStore.setDelta(o.file,r?.file);return}if(this.lastSetFilesOfPreviousMode.length>0){this.navBarWriteStore.setFiles(this.lastSetFilesOfPreviousMode);return}let i=e.find(o=>o.selectedAs===ii.Reference)?.file;i!==void 0&&this.navBarWriteStore.setStandard([i])}filterNoneExisting(e,i){return i.filter(o=>e.find(r=>wp(r.file,o.file)))}static{this.\u0275fac=function(i){return new(i||t)(M(Te),M(yp),M(cr))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var i4="This file has no domain-language data \u2014 switched to the map view.",o4="Left compare mode \u2014 the domain view shows a single word cloud.",n4=0,tg=(()=>{class t{constructor(){this.store=q(he),this.router=q(hn),this.toastService=q(wf),this.fileSelectionModeService=q(Qs),this.unreachableReason$=It([this.store.select(qf),this.store.select(Oa)]).pipe(ke(([e,i])=>({reason:this.toUnreachableReason(e,i),wasOnDomainRoute:this.isOnDomainRoute()})),ti(n4),Ta({bufferSize:1,refCount:!0})),this.navigated$=this.router.events.pipe(Ie(e=>e instanceof Gm)),this.redirectAwayFromUnreachableDomainView$=Ae(()=>this.unreachableReason$.pipe(Ie(({reason:e,wasOnDomainRoute:i})=>e!==null&&i&&this.isOnDomainRoute()),Fe(({reason:e})=>this.redirectToMetricsView(e))),{dispatch:!1}),this.handleTheDomainViewBeingOpenedWhileUnreachable$=Ae(()=>this.navigated$.pipe(Ut(()=>this.unreachableReason$.pipe(ut(1))),Ie(({reason:e})=>e!==null&&this.isOnDomainRoute()),Fe(({reason:e})=>this.makeTheDomainViewReachable(e))),{dispatch:!1})}makeTheDomainViewReachable(e){if(e==="delta"){this.leaveCompareMode();return}this.redirectToMetricsView(e)}leaveCompareMode(){this.fileSelectionModeService.toggle(),this.toastService.show(o4)}toUnreachableReason(e,i){return e?"missing-domain-data":i?"delta":null}redirectToMetricsView(e){this.router.navigateByUrl(ki.metrics,{replaceUrl:!0}),e==="missing-domain-data"&&this.toastService.show(i4)}isOnDomainRoute(){return pf(this.router.url)==="domain"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var ig=[tg];var og=(()=>{class t{constructor(e,i){this.guard=e,this.errorDialogService=i,this.showErrorDialogIfBlacklistItemsResultInEmptyMap$=Ae(()=>this.guard.doBlacklistItemsResultInEmptyMap$.pipe(Ie(o=>o.resultsInEmptyMap),Fe(()=>{_s(),this.errorDialogService.open({title:"Blacklist Error",message:"Excluding all buildings is not possible."})})),{dispatch:!1}),this.addBlacklistItems$=Ae(()=>this.guard.doBlacklistItemsResultInEmptyMap$.pipe(Ie(o=>!o.resultsInEmptyMap),ke(o=>Si({items:o.items}))))}static{this.\u0275fac=function(i){return new(i||t)(M(qs),M(Wa))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var ng=[og];var rg=t=>t.some(n=>n.name==="rloc")?"rloc":"unary";var r4=["rloc","real_lines_of_code","loc","lines_of_code","lines","statements","functions"],ag=["complexity","mcc","cognitive_complexity","sonar_complexity","sonar_cognitive_complexity","max_nesting_level","indentation_level"];function sg(t){return t.some(n=>n.maxValue>0)}function lg(t,n){let e=[],i;for(let o of t)if(o.maxValue&&(e.push(o.name),i=o.name,--n===0))return e;if(!i)throw new Error("there are no metrics available");for(;n-- >0;)e.push(i);return e}function cg(t){let n=[],e={AreaMetric:r4,HeightMetric:ag,ColorMetric:ag},i=new Set(t.map(o=>o.name));for(let o in e)for(let r of e[o])if(i.has(r)){n.push(r);break}return n}function dg(t,n,e,i,o,r=!1){let a=new Set(e.map(k=>k.name)),s=new Set(i.map(k=>k.name)),l=k=>!!k&&a.has(k),d=k=>!!k&&s.has(k),c=o?t:Fr,m=r?{areaMetric:null,heightMetric:null,colorMetric:null,distributionMetric:null,edgeMetric:null}:n,p=a4(c,m,e,l);if(p===null)return null;let u=m.edgeMetric;return d(c.edgeMetric)?u=c.edgeMetric:d(u)||(u=i[0]?.name),nt(xe({},p),{edgeMetric:u})}function a4(t,n,e,i){let o=i(t.areaMetric)?t.areaMetric:n.areaMetric,r=i(t.heightMetric)?t.heightMetric:n.heightMetric,a=i(t.colorMetric)?t.colorMetric:n.colorMetric;if(i(o)&&i(r)&&i(a))return{areaMetric:o,heightMetric:r,colorMetric:a,distributionMetric:n.distributionMetric};if(!sg(e))return null;let[s,l,d]=s4(e);return{areaMetric:i(t.areaMetric)?t.areaMetric:s,heightMetric:i(t.heightMetric)?t.heightMetric:l,colorMetric:i(t.colorMetric)?t.colorMetric:d,distributionMetric:rg(e)}}function s4(t){let n=cg(t),[e,i,o]=n;return e&&i&&o?n:lg(t,3)}function hg(t){let n={};for(let e of t)for(let i of Object.keys(e))n[i]||(n[i]=e[i]);return n}function mg(t){let n={},e={};for(let i of t){for(let o of Object.keys(i.nodes))n[o]||(n[o]=i.nodes[o]);for(let o of Object.keys(i.edges))e[o]||(e[o]=i.edges[o])}return{nodes:n,edges:e}}function pg(t,n){let e=new Map;if(t.length===1)return t[0].settings.fileSettings.blacklist;for(let i of t)if(i.settings.fileSettings.blacklist)for(let o of i.settings.fileSettings.blacklist){let r={path:n?Ja(i.fileMeta.fileName,o.path):o.path,type:o.type};e.set(`${r.path}|${r.type}`,r)}return[...e.values()]}function yd(t,n){return xe({},n)}function ug(t,n){return nt(xe({},t),{frequency:t.frequency+n.frequency,tfidf:l4(t.tfidf,n.tfidf)})}function l4(t,n){return t===void 0?n:n===void 0?t:Math.max(t,n)}var Ys=class{constructor(){this.wordsByTextPerPath=new Map}add(n,e,i){let o=this.wordsByTextOf(n);for(let r of e){let a=o.get(r.text);o.set(r.text,a?i(a,r):xe({},r))}}toDomainLensData(){let n={};for(let[e,i]of this.wordsByTextPerPath)n[e]=[...i.values()];return n}wordsByTextOf(n){let e=this.wordsByTextPerPath.get(n);return e||(e=new Map,this.wordsByTextPerPath.set(n,e)),e}};function fg(t,n){if(t.length===1)return t[0].settings.fileSettings.domainWords;let e=new Ys;for(let i of t)for(let[o,r]of Object.entries(i.settings.fileSettings.domainWords)){if(!n){e.add(o,r,yd);continue}e.add(Gp(i.fileMeta.fileName,o),r,yd),o===Rr.rootPath&&e.add(Rr.rootPath,r,ug)}return e.toDomainLensData()}function gg(t,n){if(t.length===1)return t[0].settings.fileSettings.markedPackages;let e=new Map;for(let i of t)if(i.settings.fileSettings.markedPackages)for(let o of i.settings.fileSettings.markedPackages){let r={path:n?Ja(i.fileMeta.fileName,o.path):o.path,color:o.color};e.set(`${r.path}|${r.color}`,r)}return[...e.values()]}var bg=(()=>{class t{constructor(e,i,o,r,a,s,l){this.actions$=e,this.store=i,this.ccStateSnapshot=o,this.fileStoreReadWindow=r,this.mapStateReadWindow=a,this.queryParamsService=s,this.loadInitialFileStore=l,this.fileSetTriggers$=Ui(this.actions$.pipe(at(ni),ke(d=>({kind:"fileSet",provenance:d}))),this.store.select(un).pipe(mi(1),ke(()=>({kind:"fileSet",provenance:null})))).pipe(Gi()),this.fileSetChanged$=this.fileSetTriggers$.pipe(Cm(this.fileSetTriggers$.pipe(ti(0))),Ie(d=>d.length>0),ke(d=>({kind:"fileSet",provenance:d.find(c=>c.provenance)?.provenance??null}))),this.reconcileFileSet$=Ae(()=>this.fileSetChanged$.pipe(Fe(d=>{this.reconcile(d)})),{dispatch:!1}),this.reconcileMetricData$=Ae(()=>It([this.store.select(ao),this.store.select(ps)]).pipe(mi(1),ti(0),Fe(()=>{this.reconcile({kind:"metricData"})})),{dispatch:!1})}reconcile(e){e.kind==="fileSet"&&(this.mergeFileSettings(),this.updateFileRoot());let{nodeMetricData:i,edgeMetricData:o}=$n(this.ccStateSnapshot.get());if(!i)return;let r=this.currentSelection(),a=dg(e.kind==="fileSet"?e.provenance?.urlMetrics??Fr:Fr,r,i,o,this.queryParamsService.hasFile(),e.kind==="fileSet"&&!!e.provenance?.forceDefaultMetrics);if(!a)return;this.applySelection(a,r);let s=a.colorMetric!==r.colorMetric;if(e.kind==="fileSet"||s){let l=fu(i,a.colorMetric);this.store.dispatch(xi({value:lr(l)}))}e.kind==="fileSet"&&(this.store.dispatch(Pn()),this.updateVisibleTopLabels(),this.applyRestoredSettings(e.provenance?.restoredSettings??null))}applyRestoredSettings(e){e&&(this.loadInitialFileStore.applyMetricsLensSource(e.metricsLensSource),this.loadInitialFileStore.applyDependencyLensSource(e.dependencyLensSource),this.loadInitialFileStore.applyDomainLensSource(e.domainLensSource),this.loadInitialFileStore.applySharedView(e.sharedView))}mergeFileSettings(){let e=this.fileStoreReadWindow.getFiles(),i=pn(e),o=xp(e),r=this.fileStoreReadWindow.getVisibleFileStates(),a=r.map(({file:d})=>d.settings.fileSettings.attributeTypes),s=r.map(({file:d})=>d.settings.fileSettings.attributeDescriptors),l=mg(a);this.store.dispatch(Ei({value:{sharedView:{blacklist:pg(i,o),markedPackages:gg(i,o)},metricsLensSource:{attributeTypes:l.nodes,attributeDescriptors:hg(s)},dependencyLensSource:{attributeTypes:l.edges},domainLensSource:{words:fg(i,o)}}}))}updateFileRoot(){let e=this.fileStoreReadWindow.getReferenceFile();e&&Rr.updateRoot(e.map.name)}currentSelection(){let{areaMetric:e,heightMetric:i,colorMetric:o,edgeMetric:r,distributionMetric:a}=this.mapStateReadWindow.getMapState();return{areaMetric:e,heightMetric:i,colorMetric:o,edgeMetric:r,distributionMetric:a}}applySelection(e,i){this.dispatchIfChanged($a,e.distributionMetric,i.distributionMetric),this.dispatchIfChanged(vi,e.areaMetric,i.areaMetric),this.dispatchIfChanged(yi,e.heightMetric,i.heightMetric),this.dispatchIfChanged(Pt,e.colorMetric,i.colorMetric),this.dispatchIfChanged(wi,e.edgeMetric,i.edgeMetric)}dispatchIfChanged(e,i,o){i!==o&&this.store.dispatch(e({value:i}))}updateVisibleTopLabels(){let e=Li(this.ccStateSnapshot.get()),i=this.mapStateReadWindow.getAmountOfTopLabels();this.store.dispatch(Ji({value:Math.min(i,gf(e))}))}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(he),M(Bt),M(Te),M(ve),M(ws),M(sf))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var d4=[to,Rn,Dn,Ai,gn,bn,An,Tn,In,Vp,Cn,Ua,Sn,yn,Ha,qn,vn,eo,Ji,_n,Ga,xn,Mn,wn,En,io,wi,xi,kn,yi,$a,Pt,vi],h4=[Fi,Qa,Pn,Ya,Za,Hp,Xa,Si,Fn,Ln,Ka,Nn,Bn],m4=[pu,mu],p4=[cu],u4=[ju,Hu,Uu,Yu,Ku,Gu,Xu,$u,Ju,of,zu,Zu,ef,tf,Qu],vg=[[...m4],[...p4],[...u4],[...d4],[...h4],[...Vu],[...vp],Ei].flat();var xg=(()=>{class t{constructor(e,i){this.actions$=e,this.ccStateSnapshot=i,this.saveCcState$=Ae(()=>this.actions$.pipe(Ie(o=>o.type!==Do.type),at(...vg),ti(500),Fe(async()=>{let o=this.ccStateSnapshot.get();await lf(o)})),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(Bt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var wg=[wi,yi,Pt,vi,dp];var yg=(()=>{class t{constructor(e,i,o,r,a){this.actions$=e,this.mapStateReadWindow=i,this.fileStoreReadWindow=o,this.queryParamsService=r,this.store=a,this.saveMetricsInQueryParameters$=Ae(()=>this.actions$.pipe(at(...wg),$t(this.store.select(ps)),ke(([,s])=>s&&s.length>0),ti(100),Fe(s=>{this.updateMetricQueryParameters(s)})),{dispatch:!1})}updateMetricQueryParameters(e){let{edgeMetric:i,heightMetric:o,colorMetric:r,areaMetric:a}=this.mapStateReadWindow.getMapState();this.queryParamsService.write({areaMetric:a,heightMetric:o,colorMetric:r,edgeMetric:i,isEdgeMetricDefined:e,currentFilesAreSampleFiles:this.fileStoreReadWindow.getCurrentFilesAreSampleFiles()})}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(ve),M(Te),M(ws),M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var Sg=[bg,xg,yg];var Zs=class{constructor(){this.detachedHandles=new Map}routeKey(n){return n.routeConfig?.path??null}shouldDetach(n){return this.routeKey(n)!==null}store(n,e){let i=this.routeKey(n);i!==null&&(e?this.detachedHandles.set(i,e):this.detachedHandles.delete(i))}shouldAttach(n){let e=this.routeKey(n);return e!==null&&this.detachedHandles.has(e)}retrieve(n){let e=this.routeKey(n);return e===null?null:this.detachedHandles.get(e)??null}shouldReuseRoute(n,e){return n.routeConfig===e.routeConfig}};var Cg=(()=>{class t extends zm{constructor(){super(q(Bc),q(Om,{optional:!0})??void 0),this.platformLocation=q(Bc)}prepareExternalUrl(e){let i=new URL(this.platformLocation.href);return i.hash=super.prepareExternalUrl(e),i.toString()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var Mg={metricsLensSource:uu,dependencyLensSource:du,domainLensSource:Ou,domainState:nf,preferences:Pu,mapState:Wp,sharedView:Qp,files:Mp,isLoadingFile:Ep,currentFilesAreSampleFiles:Cp},_g=t=>(n,e)=>{let i=Wu(e)?rf(xe({},n),e.value):n;return t(i,e)};var Eg=(()=>{class t{constructor(){this.actions$=q(ht),this.domainSelectionStore=q(Tf),this.resetDomainSelectionAfterLoad$=Ae(()=>this.actions$.pipe(at(ni),Fe(()=>this.domainSelectionStore.clear())),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var kg=[Eg];var qg=t=>({type:"BlacklistSearchPatternAction",action:{type:t}}),Tg=(()=>{class t{constructor(e,i,o){this.actions$=e,this.store=i,this.blacklistExclusionGuard=o,this.searchPattern2BlacklistItems$=this.actions$.pipe(at("BlacklistSearchPatternAction"),$t(this.store.select(oo)),ke(([r,a])=>({type:r.action.type,blacklistItems:Xs(r.action.type,a)})),Gi()),this.flattenSearchPattern$=Ae(()=>this.searchPattern2BlacklistItems$.pipe(Ie(r=>r.type==="flatten"),Fe(r=>{this.store.dispatch(Si({items:r.blacklistItems})),this.store.dispatch(Fi({value:""}))})),{dispatch:!1}),this.excludeSearchPattern$=Ae(()=>this.searchPattern2BlacklistItems$.pipe(Ie(r=>r.type==="exclude"),Fe(()=>{this.blacklistExclusionGuard.doBlacklistItemsResultInEmptyMap$.pipe(ut(1),Ie(r=>!r.resultsInEmptyMap),Fe(()=>{this.store.dispatch(Fi({value:""}))})).subscribe()}),ke(r=>Up({items:r.blacklistItems}))))}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(he),M(qs))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var Ig=[Tg];var f4=(t,n,e,i,o)=>{let r=[],a=Sd("area",t.areaMetric,n,o);a&&r.push(a);let s=Sd("height",t.heightMetric,n,o);s&&r.push(s);let l=Sd("color",t.colorMetric,n,o);l&&!i&&r.push(nt(xe({},l),{inverted:e.isColorRangeInverted===!0}));let d=g4(t.edgeMetric,n,o);return d&&r.push(d),r},Sd=(t,n,e,i)=>{if(n)return{kind:t,metricName:n,value:i?.attributes?.[n],descriptor:e?.[n]}},g4=(t,n,e)=>{if(!t)return;let i=e?.edgeAttributes?.[t];if(i)return{kind:"edge",metricName:t,incoming:i.incoming??0,outgoing:i.outgoing??0,descriptor:n?.[t]}},Dg=Re(Hn,ds,ja,Oa,Yt,f4);var b4=.3333333333333333,v4=2/3,Cd=(t,n,e,i)=>{if(n===void 0||e===void 0||e===n)return{fraction:1,severity:"neutral"};let o=x4((t-n)/(e-n));return{fraction:o,severity:w4(i===1?1-o:o)}},x4=t=>Math.min(1,Math.max(0,t)),w4=t=>t<b4?"success":t<v4?"warning":"error";var Md=t=>t===void 0||t===0||Number.isNaN(t),_d=t=>Md(t.value)&&!t.delta,Rg={fraction:0,severity:"neutral"},y4="unary",S4=(t,n,e,i)=>t?.attributes?Object.keys(t.attributes).filter(o=>o!==y4).sort((o,r)=>o.localeCompare(r)).map(o=>C4(o,t,n,e,i)):[],C4=(t,n,e,i,o)=>{let r=o?.[t],a=n.attributes[t];return{name:t,value:a,delta:n.deltas?.[t],mapBar:M4(t,a,e,r),rangeBar:_4(t,a,i,r),descriptor:r}},M4=(t,n,e,i)=>{if(Md(n))return Rg;let o=e?.attributes?.[t];return Cd(n,0,o,i?.direction)},_4=(t,n,e,i)=>{if(Md(n))return Rg;let o=e.nodeMetricData.find(r=>r.name===t);return Cd(n,o?.minValue,o?.maxValue,i?.direction)},Ag=Re(Yt,Et,ao,ds,(t,n,e,i)=>S4(t,n.unifiedMapNode,{nodeMetricData:e},i));var fo=(()=>{class t{constructor(e){this.store=e,this.selectedNode$=this.store.select(Yt),this.mappingBlocks$=this.store.select(Dg),this.metricRows$=this.store.select(Ag)}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var si=(()=>{class t{constructor(){this.readStore=q(fo),this.threeSceneService=q(ft),this.threeRendererService=q(kt),this.selectedNode=D(this.readStore.selectedNode$,{initialValue:void 0}),this.isVisible=Z(()=>this.selectedNode()!=null)}close(){this.threeSceneService.clearSelection(),this.threeRendererService.render()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Fg=t=>{if(t)return{all:t.attributes?.unary??0,added:t.fileCount?.added??0,removed:t.fileCount?.removed??0,changed:t.fileCount?.changed??0}};function E4(t,n){if(t&1&&(y(0,"span",2)(1,"span",3),g(2),S(),y(3,"span",4),g(4),S(),y(5,"span",5),g(6),S()()),t&2){let e=A();h(2),ge("\u0394",e.added),h(2),ge("\u0394",e.removed>0?-e.removed:0),h(2),ge("\u0394",e.changed)}}function k4(t,n){if(t&1&&(y(0,"span",1),g(1),S(),O(2,E4,7,3,"span",2)),t&2){let e=n,i=A();h(),Yi(" ",e.all," ",e.all===1?"file":"files"," "),h(),z(i.isDeltaState()?2:-1)}}var Lg=(()=>{class t{constructor(){this.isFolder=H.required(),this.fileCount=H(),this.isDeltaState=H.required()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-node-badges"]],hostAttrs:["data-testid","inspector-node-badges",1,"mt-1","flex","flex-wrap","items-center","gap-1"],inputs:{isFolder:[1,"isFolder"],fileCount:[1,"fileCount"],isDeltaState:[1,"isDeltaState"]},decls:3,vars:2,consts:[["data-testid","inspector-node-type",1,"badge","badge-ghost","badge-sm"],["data-testid","inspector-file-count",1,"badge","badge-ghost","badge-sm"],[1,"text-xs","opacity-60"],["title","Number of added files",1,"text-success"],["title","Number of removed files",1,"text-error"],["title","Number of files with metric changes"]],template:function(i,o){if(i&1&&(y(0,"span",0),g(1),S(),O(2,k4,3,3)),i&2){let r;h(),qe(o.isFolder()?"folder":"file"),h(),z((r=o.isFolder()&&o.fileCount())?2:-1,r)}},encapsulation:2,changeDetection:0})}}return t})();function q4(t,n){if(t&1&&(y(0,"p",0),g(1),S()),t&2){let e=A();h(),qe(e.parentPath())}}function T4(t,n){if(t&1&&(y(0,"a",2),fe(1,"i",3),S()),t&2){let e=n;le("href",e,ln)("title",e)}}var Pg=(()=>{class t{constructor(){this.parentPath=H.required(),this.nodeName=H.required(),this.link=H()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-node-path"]],hostAttrs:[1,"block"],inputs:{parentPath:[1,"parentPath"],nodeName:[1,"nodeName"],link:[1,"link"]},decls:4,vars:3,consts:[["data-testid","inspector-parent-path",1,"break-all","text-sm","leading-snug","opacity-60"],["data-testid","inspector-node-name",1,"break-all","text-lg","font-semibold","leading-snug","text-primary"],["target","_blank","rel","noopener noreferrer","data-testid","inspector-node-link",1,"text-sm",3,"href","title"],[1,"fa","fa-external-link"]],template:function(i,o){if(i&1&&(O(0,q4,2,1,"p",0),y(1,"p",1),g(2),O(3,T4,2,2,"a",2),S()),i&2){let r;z(o.parentPath()?0:-1),h(2),ge(" ",o.nodeName()," "),h(),z((r=o.link())?3:-1,r)}},encapsulation:2,changeDetection:0})}}return t})();function I4(t,n){if(t&1){let e=Me();v(0,"div",4)(1,"div",5),L(2,"cc-inspector-node-path",6)(3,"cc-inspector-node-badges",7),b(),v(4,"button",8),W("click",function(){ce(e);let o=A();return de(o.copyPath())}),L(5,"i",9),b()()}if(t&2){let e=A();h(2),F("parentPath",e.parentPath())("nodeName",e.nodeName())("link",e.nodeLink()),h(),F("isFolder",e.isFolder())("fileCount",e.fileCount())("isDeltaState",e.isDeltaState()),h(),F("title",e.copied()?"Copied!":"Copy path"),h(),Le("fa-copy",!e.copied())("fa-check",e.copied())}}var Ng=(()=>{class t{static{this.COPY_FEEDBACK_MS=1500}constructor(){this.readStore=q(fo),this.fileStoreReadWindow=q(Te),this.visibilityService=q(si),this.selectedNode=D(this.readStore.selectedNode$,{requireSync:!0}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{requireSync:!0}),this.copied=be(!1),this.nodeName=Z(()=>this.selectedNode()?.name??""),this.nodeLink=Z(()=>this.selectedNode()?.link),this.parentPath=Z(()=>{let e=this.selectedNode();return e?.path?e.path.slice(0,e.path.length-e.name.length):""}),this.isFolder=Z(()=>this.selectedNode()?.type===Ft.FOLDER),this.fileCount=Z(()=>Fg(this.selectedNode())),q(sn).onDestroy(()=>clearTimeout(this.copyFeedbackTimeout))}close(){this.visibilityService.close()}async copyPath(){let e=this.selectedNode()?.path;e&&(await navigator.clipboard.writeText(e),this.copied.set(!0),clearTimeout(this.copyFeedbackTimeout),this.copyFeedbackTimeout=setTimeout(()=>this.copied.set(!1),t.COPY_FEEDBACK_MS))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-header"]],hostAttrs:[1,"block","shrink-0","px-3","py-2"],decls:6,vars:1,consts:[[1,"flex","items-center","justify-between"],[1,"text-xs","uppercase","tracking-widest","opacity-60"],["type","button","title","Close inspector","data-testid","inspector-close-button",1,"btn","btn-ghost","btn-xs","btn-square",3,"click"],[1,"fa","fa-times"],[1,"mt-1","flex","items-start","justify-between","gap-2"],[1,"min-w-0"],[3,"parentPath","nodeName","link"],[3,"isFolder","fileCount","isDeltaState"],["type","button","data-testid","inspector-copy-path-button",1,"btn","btn-ghost","btn-sm","btn-square","shrink-0",3,"click","title"],[1,"fa"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Inspector"),b(),v(3,"button",2),W("click",function(){return o.close()}),L(4,"i",3),b()(),O(5,I4,6,11,"div",4)),i&2&&(h(5),z(o.selectedNode()?5:-1))},dependencies:[Pg,Lg],encapsulation:2,changeDetection:0})}}return t})();var dr=new Map([["loc","Lines of Code"],["rloc","Real Lines of Code"],["comment_lines","Number of Code Lines with Comments"],["complexity","Cyclomatic Complexity"],["sonar_complexity","Cyclomatic Complexity"],["mcc","McCabe Complexity"],["avgCommits","Average Number of Commits from this file"],["functions","Number of Functions"],["pairingRate","Pairing Rate of selected building"],["unary","-"],["line_coverage","Number of Code Lines covered by tests"],["sonar_code_smells","Number of Smells Sonar has identified"],["avg_code_churn","Average Number of Lines added or removed from this file"],["number_of_authors","Number of Authors that have edited this file"],["statements","Number of Statements"]]);var go=(()=>{class t{transform(e,i){if(e==null)return dr.get(i)??"";let o=e.title?`${e.title} (${i})`:`${i}`,r=e.description?`
|
|
3424
|
+
`}};var Os=(()=>{class t{constructor(e){this.ccStateSnapshot=e}getValue(){return this.ccStateSnapshot.get()}isLabelsPerMapActive(){return fs(this.ccStateSnapshot.get())}static{this.\u0275fac=function(i){return new(i||t)(M(Bt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var zs=(()=>{class t{constructor(e,i){this.stateAccessStore=e,this.threeSceneService=i,this.labels=[],this.suppressedLabel=null}getLabels(){return this.labels}getSuppressedLabel(){return this.suppressedLabel}addLeafLabel(e,i,o=!1){let{mapState:r}=this.stateAccessStore.getValue(),{scaling:a,showMetricLabelNodeName:s,showMetricLabelNameValue:l,labelMode:d,labelSize:c}=r,{heightMetric:m,colorMetric:p}=r,u=new Ye(a.x,a.y,a.z),k="";if(s||o&&!l)k=e.name;else if(!l)return;let E="";if(l){let ie=d===Di.Color?p:m;E=`${e.attributes[ie]} ${ie}`}let P=new Ws(k,E,c),$=P.cssObject;$.userData={node:e};let ee=e.height+Math.abs(e.heightDelta??0),B=Math.max(ee,i),j=(e.x0-Hc+e.width/2)*u.x,G=(e.y0-Hc+e.length/2)*u.z;$.position.set(j,(e.z0+B)*u.y,G);let K=new Ye(j,(e.z0+ee)*u.y,G);this.threeSceneService.labels.add($),this.labels.push({labelElement:P,node:e,buildingTop:K,appliedOffset:0})}clearLabels(){this.threeSceneService.labels.clear(),this.labels=[],this.suppressedLabel=null}clearTemporaryLabel(e){let i=this.labels.findIndex(({node:o})=>o===e);if(i>-1){let o=this.labels[i];o===this.suppressedLabel&&(this.suppressedLabel=null),this.threeSceneService.labels.remove(o.labelElement.cssObject),this.labels.splice(i,1)}}hasLabelForNode(e){return this.labels.some(i=>i.node===e)}suppressLabelForNode(e){this.restoreSuppressedLabel();let i=this.labels.find(o=>o.node===e);i&&(this.suppressedLabel=i,i.labelElement.setTransition("opacity 0.2s ease-out"),i.labelElement.setOpacity("0"))}restoreSuppressedLabel(){this.suppressedLabel&&(this.suppressedLabel.labelElement.setOpacity("1"),this.suppressedLabel=null)}static{this.\u0275fac=function(i){return new(i||t)(M(Os),M(ft))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $s=(()=>{class t{constructor(e,i){this.threeRendererService=e,this.threeSceneService=i,this.connectorSegments=null,this.connectorPositions=null,this.connectorsDirty=!0,this.lastDrawnVertexCount=0,this.projectionVec=new Ye}drawConnectors(e,i){this.connectorSegments||this.initConnectors();let o=this.threeRendererService.camera;if(!o)return;let r=this.threeRendererService.labelRenderer?.domElement,a=r?r.clientHeight:window.innerHeight;if(a===0)return;let s=this.connectorPositions,l=0;for(let d of e){if(d.hidden||d.offset>100||d.label===i)continue;let c=d.label.buildingTop,m=d.label.labelElement.cssObject.position;if(m.y-c.y<.5)continue;if(l>=400)break;this.projectionVec.copy(m).project(o);let u=-20+d.offset;this.projectionVec.y-=u*2/a,this.projectionVec.unproject(o);let k=l*3;s[k]=c.x,s[k+1]=c.y,s[k+2]=c.z,l++;let E=l*3;s[E]=this.projectionVec.x,s[E+1]=this.projectionVec.y,s[E+2]=this.projectionVec.z,l++}this.connectorSegments.geometry.setDrawRange(0,l),this.connectorSegments.geometry.attributes.position.needsUpdate=!0,l!==this.lastDrawnVertexCount&&(this.connectorsDirty=!0),this.lastDrawnVertexCount=l}clearConnectors(){this.connectorSegments&&this.connectorSegments.geometry.setDrawRange(0,0),this.connectorsDirty=!0,this.lastDrawnVertexCount=0}isDirty(){return this.connectorsDirty}markClean(){this.connectorsDirty=!1}destroy(){this.connectorSegments&&(this.connectorSegments.geometry.dispose(),this.connectorSegments.material.dispose(),this.threeSceneService.scene.remove(this.connectorSegments),this.connectorSegments=null,this.connectorPositions=null)}initConnectors(){let e=400;this.connectorPositions=new Float32Array(e*3);let i=new Qt;i.setAttribute("position",new no(this.connectorPositions,3)),i.setDrawRange(0,0);let o=new os({color:11842740,transparent:!0,opacity:.9,depthTest:!0});this.connectorSegments=new eu(i,o),this.connectorSegments.frustumCulled=!1,this.threeSceneService.scene.add(this.connectorSegments)}static{this.\u0275fac=function(i){return new(i||t)(M(kt),M(ft))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var R0=(()=>{class t{constructor(e,i,o,r,a){this.threeRendererService=e,this.tooltipService=i,this.labelCreationService=o,this.stateAccessStore=r,this.connectorDrawingService=a,this._suppressLayout=!1,this.threeRendererService.afterRender$.subscribe(()=>this.updateLabelLayout())}setSuppressLayout(e){this._suppressLayout=e}updateLabelLayout(){let e=this.labelCreationService.getLabels();if(this._suppressLayout||e.length===0){this.connectorDrawingService.clearConnectors(),this.clearBadges(e);return}this.clearBadges(e);let i=this.collectLabelInfos(e),o=this.tooltipService.getRect();this.resolveCollisions(i),this.resolveTooltipCollisions(i,o),this.applyCollisionOffsets(i);let r=this.labelCreationService.getSuppressedLabel();this.connectorDrawingService.drawConnectors(i,r),this.connectorDrawingService.isDirty()&&(this.connectorDrawingService.markClean(),this.threeRendererService.render())}destroy(){this.clearBadges(this.labelCreationService.getLabels()),this.labelCreationService.clearLabels(),this.connectorDrawingService.destroy()}clearBadges(e){for(let i of e)i.labelElement.clearBadge()}collectLabelInfos(e){let i=[];for(let o of e){let r=o.labelElement.getContentRect(),a={top:r.top-o.appliedOffset,bottom:r.bottom-o.appliedOffset,left:r.left,right:r.right,width:r.width,height:r.height,x:r.x,y:r.y-o.appliedOffset};i.push({label:o,rect:a,offset:0,hidden:!1})}return i}resolveCollisions(e){let{mapState:i}=this.stateAccessStore.getValue();if(!i.groupLabelCollisions)return;let o=this.labelCreationService.getSuppressedLabel(),r=e.filter(l=>l.label!==o);if(r.length===0)return;let a=this.buildCollisionGroups(r,this.stateAccessStore.isLabelsPerMapActive()),s=i.labelMode===Di.Color?i.colorMetric:i.heightMetric;for(let l of a){if(l.length<=1)continue;let d=this.pickGroupWinner(l,s);for(let c of l)c!==d&&(c.hidden=!0);d.label.labelElement.setBadge(l.length-1)}}buildCollisionGroups(e,i){let o=e.length,r=Array.from({length:o},(c,m)=>m),a=i?e.map(c=>es(c.label.node.path)):void 0,s=c=>{for(;r[c]!==c;)r[c]=r[r[c]],c=r[c];return c},l=(c,m)=>{let p=s(c),u=s(m);p!==u&&(r[p]=u)};for(let c=0;c<o;c++)for(let m=c+1;m<o;m++)a!==void 0&&a[c]!==a[m]||this.rectsOverlap(e[c].rect,e[m].rect)&&l(c,m);let d=new Map;for(let c=0;c<o;c++){let m=s(c);d.has(m)||d.set(m,[]),d.get(m).push(e[c])}return[...d.values()]}rectsOverlap(e,i){return e.right>i.left&&e.left<i.right&&e.bottom>i.top&&e.top<i.bottom}pickGroupWinner(e,i){let o=e[0],r=o.label.node.attributes[i]??0;for(let a=1;a<e.length;a++){let s=e[a].label.node.attributes[i]??0;(s>r||s===r&&e[a].label.node.path<o.label.node.path)&&(r=s,o=e[a])}return o}resolveTooltipCollisions(e,i){if(!i)return;let o=12,r=i.left-o,a=i.right+o,s=i.top-o,l=i.bottom+o,d=this.labelCreationService.getSuppressedLabel();for(let c of e){if(c.hidden||c.label===d)continue;let m=c.rect.top+c.offset,p=c.rect.bottom+c.offset,u=c.rect.right>r&&c.rect.left<a,k=p>s&&m<l;if(u&&k){let E=l+4-m;E>0&&(c.offset+=E)}}}applyCollisionOffsets(e){let i=this.labelCreationService.getSuppressedLabel();for(let o of e){let r=o.label.labelElement,a=o.label===i;o.hidden||o.offset>100?(r.setOpacity("0"),r.setTransform(0),o.label.appliedOffset=0):(r.setOpacity(a?"0":"1"),r.setTransform(o.offset),o.label.appliedOffset=o.offset)}}static{this.\u0275fac=function(i){return new(i||t)(M(kt),M(Un),M(zs),M(Os),M($s))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var A0=(()=>{class t{constructor(e,i){this.store=e,this.ccStateSnapshot=i}setLabelMode(e){this.store.dispatch(Mn({value:e}))}setAmountOfTopLabels(e){this.store.dispatch(Ji({value:e}))}setLabelSize(e){this.store.dispatch(_n({value:e}))}setLabelsPerMap(e){this.store.dispatch(En({value:e}))}setShowMetricLabelNodeName(e){this.store.dispatch(Rn({value:e}))}setShowMetricLabelNameValue(e){this.store.dispatch(Dn({value:e}))}setColorLabels(e){this.store.dispatch(to({value:e}))}setGroupLabelCollisions(e){this.store.dispatch(wn({value:e}))}resetSettings(e){let i=bf(e,this.ccStateSnapshot.get());i.mapState?.amountOfTopLabels!==void 0&&(i.mapState.amountOfTopLabels=10),this.store.dispatch(Ei({value:i}))}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(Bt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function z4(t,n){if(t&1){let e=Me();S(0,"div",5)(1,"input",17),Y("change",function(){ce(e);let o=A();return de(o.setLabelsPerMap(!1))}),y(),S(2,"input",18),Y("change",function(){ce(e);let o=A();return de(o.setLabelsPerMap(!0))}),y()()}if(t&2){let e=A();h(),le("checked",!e.labelsPerMap()),h(),le("checked",e.labelsPerMap())}}function $4(t,n){if(t&1){let e=Me();S(0,"div",14)(1,"span",19),g(2,"By Color Metric"),y(),S(3,"label",12)(4,"input",20),Y("change",function(o){ce(e);let r=A();return de(r.setColorLabel(o,"positive"))}),y(),fe(5,"span",21),S(6,"span",22),g(7),y()(),S(8,"label",12)(9,"input",23),Y("change",function(o){ce(e);let r=A();return de(r.setColorLabel(o,"neutral"))}),y(),fe(10,"span",21),S(11,"span",22),g(12),y()(),S(13,"label",12)(14,"input",24),Y("change",function(o){ce(e);let r=A();return de(r.setColorLabel(o,"negative"))}),y(),fe(15,"span",21),S(16,"span",22),g(17),y()()()}if(t&2){let e=A();h(4),le("checked",e.colorLabels().positive)("disabled",e.colorCategoryCounts().positive===0),h(),Oe("background-color",e.mapColors().positive),h(2),ge("(",e.colorCategoryCounts().positive,")"),h(2),le("checked",e.colorLabels().neutral)("disabled",e.colorCategoryCounts().neutral===0),h(),Oe("background-color",e.mapColors().neutral),h(2),ge("(",e.colorCategoryCounts().neutral,")"),h(2),le("checked",e.colorLabels().negative)("disabled",e.colorCategoryCounts().negative===0),h(),Oe("background-color",e.mapColors().negative),h(2),ge("(",e.colorCategoryCounts().negative,")")}}var bd=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.fileStoreReadWindow=q(Te),this.labelSettingsWriteStore=q(A0),this.colorCategoryCountsStore=q(Xn),this.LabelMode=Di,this.MIN_LABEL_SIZE=.75,this.MAX_LABEL_SIZE=2.5,this.LABEL_SIZE_STEP=.25,this.resetSettingsKeys=["mapState.amountOfTopLabels","mapState.labelSize","mapState.showMetricLabelNodeName","mapState.showMetricLabelNameValue","mapState.colorLabels","mapState.labelMode","mapState.groupLabelCollisions","mapState.labelsPerMap"],this.amountOfTopLabels=D(this.mapStateReadWindow.amountOfTopLabels$,{requireSync:!0}),this.labelSize=D(this.mapStateReadWindow.labelSize$,{requireSync:!0}),this.showMetricLabelNodeName=D(this.mapStateReadWindow.showMetricLabelNodeName$,{requireSync:!0}),this.showMetricLabelNodeValue=D(this.mapStateReadWindow.showMetricLabelNameValue$,{requireSync:!0}),this.colorLabels=D(this.mapStateReadWindow.colorLabels$,{requireSync:!0}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{requireSync:!0}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{requireSync:!0}),this.labelMode=D(this.mapStateReadWindow.labelMode$,{requireSync:!0}),this.colorCategoryCounts=D(this.colorCategoryCountsStore.colorCategoryCounts$,{requireSync:!0}),this.groupLabelCollisions=D(this.mapStateReadWindow.groupLabelCollisions$,{requireSync:!0}),this.labelsPerMap=D(this.mapStateReadWindow.labelsPerMap$,{requireSync:!0}),this.areMultipleMapsVisible=D(this.fileStoreReadWindow.areMultipleMapsVisible$,{requireSync:!0}),this.showColorLabels=Z(()=>this.labelMode()===Di.Color&&!this.isDeltaState()),this.topLabelsTitle=Z(()=>{let e=`Display the labels of the ${this.amountOfTopLabels()} highest buildings`;return this.labelsPerMap()&&this.areMultipleMapsVisible()?`${e} per map`:e}),this.applyDebouncedTopLabels=Pi(e=>{this.labelSettingsWriteStore.setAmountOfTopLabels(e)},t.DEBOUNCE_TIME),this.applyDebouncedLabelSize=Pi(e=>{this.labelSettingsWriteStore.setLabelSize(e)},t.DEBOUNCE_TIME)}static{this.DEBOUNCE_TIME=400}handleTopLabelsInput(e){let i=vf(e,0,50,{round:!0});if(!Number.isNaN(i)){if(i===this.amountOfTopLabels()){this.applyDebouncedTopLabels.cancel();return}this.applyDebouncedTopLabels(i)}}handleLabelSizeInput(e){let i=Number.parseFloat(e.target.value);if(Number.isNaN(i))return;let o=Math.min(2.5,Math.max(.75,i)),r=Math.round(o/.25)*.25,a=Math.round(r*100)/100;if(a===this.labelSize()){this.applyDebouncedLabelSize.cancel();return}this.applyDebouncedLabelSize(a)}setShowMetricLabelNodeName(e){this.labelSettingsWriteStore.setShowMetricLabelNodeName(e.target.checked)}setShowMetricLabelNameValue(e){this.labelSettingsWriteStore.setShowMetricLabelNameValue(e.target.checked)}setColorLabel(e,i){this.labelSettingsWriteStore.setColorLabels({[i]:e.target.checked})}setLabelMode(e){this.labelSettingsWriteStore.setLabelMode(e)}setGroupLabelCollisions(e){this.labelSettingsWriteStore.setGroupLabelCollisions(e.target.checked)}setLabelsPerMap(e){this.labelSettingsWriteStore.setLabelsPerMap(e)}resetSettings(){this.labelSettingsWriteStore.resetSettings(this.resetSettingsKeys)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-label-settings-panel"]],hostAttrs:[1,"contents"],decls:33,vars:18,consts:[[3,"title"],[1,"text-sm"],[1,"flex","items-center","gap-2"],["type","range","min","0","max","50",1,"range","range-primary","range-sm","flex-1",3,"input","value"],["type","number","min","0","max","50",1,"input","input-sm","input-bordered","w-16","text-center",3,"input","value"],["aria-label","Top labels scope","title","Pick the top labels across all maps combined or separately for each map",1,"join","w-full"],["title","Scale floating label font size"],["type","range",1,"range","range-primary","range-sm","flex-1",3,"input","min","max","step","value"],["type","number",1,"input","input-sm","input-bordered","w-16","text-center",3,"input","min","max","step","value"],["aria-label","Label mode",1,"join","w-full"],["type","radio","name","labelMode","aria-label","Height",1,"join-item","btn","btn-sm","flex-1",3,"change","checked"],["type","radio","name","labelMode","aria-label","Color",1,"join-item","btn","btn-sm","flex-1",3,"change","checked"],[1,"flex","items-center","gap-2","cursor-pointer"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked"],[1,"flex","flex-col","gap-1"],["title","Reset label settings to their defaults",1,"btn","btn-outline","btn-error","gap-2",3,"click"],[1,"fa","fa-undo"],["type","radio","name","labelsPerMap","aria-label","All maps",1,"join-item","btn","btn-sm","flex-1",3,"change","checked"],["type","radio","name","labelsPerMap","aria-label","Per map",1,"join-item","btn","btn-sm","flex-1",3,"change","checked"],[1,"text-xs","opacity-60","mb-0.5"],["type","checkbox","aria-label","positive color label",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked","disabled"],[1,"inline-block","w-4","h-4","rounded-sm"],[1,"text-xs","opacity-60"],["type","checkbox","aria-label","neutral color label",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked","disabled"],["type","checkbox","aria-label","negative color label",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked","disabled"]],template:function(i,o){i&1&&(S(0,"div",0)(1,"span",1),g(2,"Top Labels"),y(),S(3,"div",2)(4,"input",3),Y("input",function(a){return o.handleTopLabelsInput(a)}),y(),S(5,"input",4),Y("input",function(a){return o.handleTopLabelsInput(a)}),y()()(),O(6,z4,3,2,"div",5),S(7,"div",6)(8,"span",1),g(9,"Label Size"),y(),S(10,"div",2)(11,"input",7),Y("input",function(a){return o.handleLabelSizeInput(a)}),y(),S(12,"input",8),Y("input",function(a){return o.handleLabelSizeInput(a)}),y()()(),S(13,"div",9)(14,"input",10),Y("change",function(){return o.setLabelMode(o.LabelMode.Height)}),y(),S(15,"input",11),Y("change",function(){return o.setLabelMode(o.LabelMode.Color)}),y()(),S(16,"label",12)(17,"input",13),Y("change",function(a){return o.setShowMetricLabelNodeName(a)}),y(),S(18,"span"),g(19,"Show node names"),y()(),S(20,"label",12)(21,"input",13),Y("change",function(a){return o.setShowMetricLabelNameValue(a)}),y(),S(22,"span"),g(23,"Show metric values"),y()(),S(24,"label",12)(25,"input",13),Y("change",function(a){return o.setGroupLabelCollisions(a)}),y(),S(26,"span"),g(27,"Group overlapping labels"),y()(),O(28,$4,18,15,"div",14),S(29,"button",15),Y("click",function(){return o.resetSettings()}),fe(30,"i",16),S(31,"span"),g(32,"Reset label settings"),y()()),i&2&&(le("title",o.topLabelsTitle()),h(4),le("value",o.amountOfTopLabels()),h(),le("value",o.amountOfTopLabels()),h(),z(o.areMultipleMapsVisible()?6:-1),h(5),le("min",o.MIN_LABEL_SIZE)("max",o.MAX_LABEL_SIZE)("step",o.LABEL_SIZE_STEP)("value",o.labelSize()),h(),le("min",o.MIN_LABEL_SIZE)("max",o.MAX_LABEL_SIZE)("step",o.LABEL_SIZE_STEP)("value",o.labelSize()),h(2),le("checked",o.labelMode()===o.LabelMode.Height),h(),le("checked",o.labelMode()===o.LabelMode.Color),h(2),le("checked",o.showMetricLabelNodeName()),h(4),le("checked",o.showMetricLabelNodeValue()),h(4),le("checked",o.groupLabelCollisions()),h(3),z(o.showColorLabels()?28:-1))},encapsulation:2,changeDetection:0})}}return t})();var js=(()=>{class t{constructor(e,i,o){this.labelCreationService=e,this.labelCollisionService=i,this.connectorDrawingService=o}addLeafLabel(e,i,o=!1){this.labelCreationService.addLeafLabel(e,i,o)}clearLabels(){this.labelCreationService.clearLabels(),this.connectorDrawingService.clearConnectors()}clearTemporaryLabel(e){this.labelCreationService.clearTemporaryLabel(e)}hasLabelForNode(e){return this.labelCreationService.hasLabelForNode(e)}suppressLabelForNode(e){this.labelCreationService.suppressLabelForNode(e)}restoreSuppressedLabel(){this.labelCreationService.restoreSuppressedLabel()}setSuppressLayout(e){this.labelCollisionService.setSuppressLayout(e)}destroy(){this.labelCollisionService.destroy(),this.connectorDrawingService.destroy()}static{this.\u0275fac=function(i){return new(i||t)(M(zs),M(R0),M($s))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var N0=(()=>{class t{constructor(e,i,o){this.codeMapStore=e,this.sharedViewReadWindow=i,this.threeSceneService=o,this.VERTICES_PER_LINE=5,this.arrows=new Array,this.HIGHLIGHT_BUILDING_DELAY=1,this.debounceCalculation=Pi(r=>this.resetEdgesOfBuildings(r),this.HIGHLIGHT_BUILDING_DELAY),this.hoveredNodeSubscription=this.sharedViewReadWindow.hoveredNodeId$.pipe(Fe(r=>{if(r!==null){let a=this.threeSceneService.getMapMesh()?.getMeshDescription().getBuildingByPath(r);this.onBuildingHovered(a)}else this.onBuildingUnhovered()})).subscribe(),this.resetEdgesOfBuildings=r=>{if(!this.codeMapStore.getMapState().isEdgeMetricVisible){this.scale();return}this.clearArrows(),this.showEdgesOfBuildings(this.isEdgeApplicableForBuilding(r)?r:void 0),this.scale()},this.onBuildingSelected=r=>{this.isEdgeApplicableForBuilding(r.building)&&(this.clearArrows(),this.showEdgesOfBuildings()),this.scale()},this.onBuildingDeselected=()=>{this.debounceCalculation.cancel(),this.clearArrows(),this.addEdgePreview()},this.threeSceneService.subscribe("onBuildingSelected",this.onBuildingSelected),this.threeSceneService.subscribe("onBuildingDeselected",this.onBuildingDeselected)}ngOnDestroy(){this.hoveredNodeSubscription.unsubscribe()}onBuildingHovered(e){this.debounceCalculation(e)}onBuildingUnhovered(){this.debounceCalculation.cancel();let{isEdgeMetricVisible:e}=this.codeMapStore.getMapState();e&&(this.clearArrows(),this.showEdgesOfBuildings()),this.scale()}clearArrows(){for(let e of this.arrows)e.traverse(i=>{i.geometry&&i.geometry.dispose(),i.material&&i.material.dispose()});this.arrows=[],this.threeSceneService.edgeArrows.children.length=0}addArrow(e,i,o){let r=this.codeMapStore.getMapState(),a=100*r.edgeHeight,s=this.createCurve(e,i,a),l=jc.getNumber(r.mapColors[o?"outgoingEdge":"incomingEdge"]);this.highlightBuilding(o?i:e),this.setCurveColor(s,l)}addEdgePreview(){let e=this.codeMapStore.getEdgeVisibility();for(let i of e){let o=this.map.get(i.fromNodeName),r=this.map.get(i.toNodeName);if(o&&r&&i.visible!==oi.none&&i.visible){let a=100*this.codeMapStore.getMapState().edgeHeight,s=this.createCurve(o,r,a);this.previewMode(s,i.visible)}}}addEdgeMapBasedOnNodes(e){this.map=this.getNodesAsMap(e)}scale(){let{scaling:e}=this.codeMapStore.getMapState();for(let i of this.arrows)i.scale.x=e.x,i.scale.y=e.y,i.scale.z=e.z}isEdgeApplicableForBuilding(e){return this.codeMapStore.getMapState().isEdgeMetricVisible&&e&&!e.node.flat}showEdgesOfBuildings(e){let i=new Map,o=this.threeSceneService.getSelectedBuilding();if(o){let{node:r}=o;i.set(r.path,r)}if(e){let{node:r}=e;i.set(r.path,r)}i.size>0?this.buildPairingEdges(i):this.addEdgePreview()}buildPairingEdges(e){let{showIncomingEdges:i,showOutgoingEdges:o,edgeMetric:r}=this.codeMapStore.getMapState();if(!i&&!o)return;let a=this.codeMapStore.getEdges();for(let s of a){if(s.attributes[r]===void 0)continue;let l=this.map.get(s.fromNodeName);if(l===void 0)continue;let d=this.map.get(s.toNodeName);d!==void 0&&(o&&e.has(l.path)?(this.addArrow(l,d,!0),this.threeSceneService.applyHighlights()):i&&e.has(d.path)&&(this.addArrow(l,d,!1),this.threeSceneService.applyHighlights()))}}createCurve(e,i,o){let r=e.outgoingEdgePoint.clone(),a=i.incomingEdgePoint.clone(),s=Math.max(r.y+i.height,a.y+1)+o;return r.setY(s),a.setY(s),new tu(e.outgoingEdgePoint,r,a,i.incomingEdgePoint)}highlightBuilding(e){let i=this.threeSceneService.getMapMesh().getMeshDescription().getBuildingByPath(e.path);this.threeSceneService.addBuildingsToHighlightingList(i)}setCurveColor(e,i,o=50){let r=e.getPoints(o),a=this.buildLine(r,i);a.add(this.buildArrow(r)),this.threeSceneService.edgeArrows.add(a),this.arrows.push(a)}previewMode(e,i){if(i===oi.both||i===oi.from){let o=this.makeArrowFromBezier(e,!1);this.threeSceneService.edgeArrows.add(o),this.arrows.push(o)}if(i===oi.both||i===oi.to){let o=this.makeArrowFromBezier(e,!0);this.threeSceneService.edgeArrows.add(o),this.arrows.push(o)}}getNodesAsMap(e){let i=new Map;for(let o of e)i.set(o.path,o);return i}makeArrowFromBezier(e,i,o=50){let r=e.getPoints(o),{incomingEdge:a,outgoingEdge:s}=this.codeMapStore.getMapState().mapColors,l=i?a:s,d=i?r.slice(o+1-this.VERTICES_PER_LINE):r.slice(0,r.length-(o+1-this.VERTICES_PER_LINE));return this.buildEdge(d,jc.getNumber(l))}buildEdge(e,i){let o=this.buildLine(e,i);return o.add(this.buildArrow(e)),o}buildLine(e,i=0){let o=new Qt;o.setFromPoints(e);let r=new os({color:i,linewidth:1});return new Jp(o,r)}buildArrow(e,i=0,o=10,r=10){let a=e.at(-1).clone().sub(e.at(-2).clone()).normalize(),s=e.at(-1).clone();return a.y<0&&(s.y+=o+1),new au(a,s,o+1,i,o,r)}static{this.\u0275fac=function(i){return new(i||t)(M(ar),M(Nt),M(ft))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var B0=(()=>{class t{constructor(){this.mapControls=q(Vt)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-toolbox-center-map-button"]],decls:2,vars:0,consts:[["type","button","title","Center map","aria-label","Center map",1,"join-item","btn","btn-sm","btn-square",3,"click"],[1,"fa","fa-compass"]],template:function(i,o){i&1&&(S(0,"button",0),Y("click",function(){return o.mapControls.autoFitTo()}),fe(1,"i",1),y())},encapsulation:2,changeDetection:0})}}return t})();var V0=(()=>{class t{constructor(e){this.store=e}setPresentationMode(e){this.store.dispatch(Ru({value:e}))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var W0=(()=>{class t{constructor(){this.preferencesReadWindow=q(Yn),this.viewCubeToolboxWriteStore=q(V0),this.isPresentationMode=D(this.preferencesReadWindow.isPresentationMode$,{requireSync:!0}),this.tooltip=Z(()=>this.isPresentationMode()?"Disable flashlight hover effect":"Enable flashlight hover effect")}handleToggle(){this.viewCubeToolboxWriteStore.setPresentationMode(!this.isPresentationMode())}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-toolbox-presentation-mode-button"]],decls:2,vars:3,consts:[["type","button","aria-label","Presentation mode",1,"join-item","btn","btn-sm","btn-square",3,"click","title"],[1,"fa","fa-lightbulb-o"]],template:function(i,o){i&1&&(S(0,"button",0),Y("click",function(){return o.handleToggle()}),fe(1,"i",1),y()),i&2&&(Le("btn-active",o.isPresentationMode()),le("title",o.tooltip()))},encapsulation:2,changeDetection:0})}}return t})();var vd=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-view-cube-toolbox"]],features:[Zi([{provide:Mf,useExisting:Ef}])],decls:4,vars:0,consts:[[1,"join","shadow-md","absolute","top-0","left-1/2","-translate-x-1/2","bg-base-100","rounded"],["view","metrics"]],template:function(i,o){i&1&&(v(0,"div",0),L(1,"cc-toolbox-center-map-button")(2,"cc-toolbox-screenshot-button",1)(3,"cc-toolbox-presentation-mode-button"),b())},dependencies:[B0,_f,W0],encapsulation:2,changeDetection:0})}}return t})();var uo=()=>new as({color:16580095}),No=()=>new as({color:16580095}),zr=()=>new as({color:16580095});var Hs=class t{static buildCube(n){let e=1/n,i=(1-e)/2,o=new ro(e,i,i),r=new ro(i,e+i,i),a=new ro(i,i,i),s=new ro(e,e,i),l=new ro(e,e+i,i);return t.newBuildCubeGroup(o,r,a,s,l)}static newBuildCubeGroup(n,e,i,o,r){let a=new Wn,{group:s,frontLeft:l,frontCenter:d,frontRight:c,middleLeft:m,middleCenter:p,middleRight:u,backLeft:k,backCenter:E,backRight:P}=t.buildCubeTopFace(n,i,o);a.add(s);let{group:$,frontLeftEdge:ee,frontCenterFace:B,frontRightEdge:j,middleLeftFace:G,middleRightFace:K,backLeftEdge:ie,backCenterFace:oe,backRightEdge:ne}=t.buildCubeSides(e,r);return a.add($),{group:a,top:{front:{left:l,center:d,right:c},middle:{left:m,center:p,right:u},back:{left:k,center:E,right:P}},sides:{front:{left:ee,center:B,right:j},middle:{left:G,right:K},back:{left:ie,center:oe,right:ne}}}}static buildCubeTopFace(n,e,i){let o=new st(e,zr()),r=new st(n,uo()),a=new st(e,zr()),s=new st(n,uo()),l=new st(i,No()),d=new st(n,No()),c=new st(e,zr()),m=new st(n,uo()),p=new st(e,zr()),u=i.parameters.height/2+e.parameters.height/2;o.position.x-=u,o.position.y-=u,r.position.y-=u,a.position.x+=u,a.position.y-=u,s.position.x-=u,s.rotation.z=Math.PI/2,d.position.x+=u,d.rotation.z=Math.PI/2,c.position.x-=u,c.position.y+=u,m.position.y+=u,p.position.x+=u,p.position.y+=u;let k=new Wn;return k.rotation.x=Math.PI/2,k.position.y+=u,k.add(o),k.add(r),k.add(a),k.add(s),k.add(l),k.add(d),k.add(c),k.add(m),k.add(p),{group:k,frontLeft:o,frontCenter:r,frontRight:a,middleLeft:s,middleCenter:l,middleRight:d,backLeft:c,backCenter:m,backRight:p}}static buildCubeSides(n,e){let i=new st(n,uo()),o=new st(e,No()),r=new st(n,uo()),a=new st(e,No()),s=new st(e,No()),l=new st(n,uo()),d=new st(e,No()),c=new st(n,uo()),m=e.parameters.width/2+n.parameters.width/2,p=n.parameters.width/2;i.position.x-=m,i.position.z+=m,o.position.z+=m,r.position.x+=m,r.position.z+=m,a.position.x-=m,a.rotation.y=Math.PI/2,s.position.x+=m,s.rotation.y=Math.PI/2,l.position.x-=m,l.position.z-=m,d.position.z-=m,c.position.x+=m,c.position.z-=m;let u=new Wn;return u.position.y-=p,u.add(i),u.add(o),u.add(r),u.add(a),u.add(s),u.add(l),u.add(d),u.add(c),{group:u,frontLeftEdge:i,frontCenterFace:o,frontRightEdge:r,middleLeftFace:a,middleRightFace:s,backLeftEdge:l,backCenterFace:d,backRightEdge:c}}};var O0=(()=>{class t{constructor(e,i){this.threeMapControlsService=e,this.cdr=i}ngOnInit(){this.maxZoom=this.threeMapControlsService.MAX_ZOOM,this.minZoom=this.threeMapControlsService.MIN_ZOOM,this.threeMapControlsService.zoomPercentage$.subscribe(e=>{this.zoomPercentage=e,this.cdr.detectChanges()})}onInput(e){let i=e.target,o=Number.parseFloat(i.value);this.threeMapControlsService.setZoomPercentage(o)}zoomIn(){this.threeMapControlsService.setZoomPercentage(Math.min(this.zoomPercentage+10,this.maxZoom))}zoomOut(){this.threeMapControlsService.setZoomPercentage(Math.max(this.zoomPercentage-10,this.minZoom))}static{this.\u0275fac=function(i){return new(i||t)(te(Vt),te(dn))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-zoom-slider"]],decls:8,vars:4,consts:[[1,"absolute","right-[5px]","top-[10px]","m-2.5","flex","h-[150px]","flex-col","items-center","gap-2.5"],["data-testid","zoomIn",1,"m-0","cursor-pointer","border-none","bg-transparent","p-0","text-base","text-neutral-500",3,"click"],["type","range","id","zoomRange","data-testid","zoomRange","aria-label","Zoom level",1,"h-[100px]","w-[3px]","appearance-none","bg-neutral-500","text-neutral-500","opacity-70","outline-none","transition-opacity","duration-200","[-webkit-appearance:none]","[direction:rtl]","[writing-mode:vertical-lr]","[&::-moz-range-thumb]:h-[3px]","[&::-moz-range-thumb]:w-[10px]","[&::-moz-range-thumb]:cursor-pointer","[&::-moz-range-thumb]:bg-neutral-500","[&::-webkit-slider-thumb]:h-[3px]","[&::-webkit-slider-thumb]:w-[10px]","[&::-webkit-slider-thumb]:cursor-pointer","[&::-webkit-slider-thumb]:appearance-none","[&::-webkit-slider-thumb]:bg-neutral-500","[&::-webkit-slider-thumb]:[-webkit-appearance:none]",3,"input","min","max","value"],["data-testid","zoomOut",1,"m-0","cursor-pointer","border-none","bg-transparent","p-0","text-base","text-neutral-500",3,"click"],["id","zoomValue",1,"w-[30px]","text-center","text-[10px]","text-neutral-500"]],template:function(i,o){i&1&&(S(0,"div",0)(1,"button",1),Y("click",function(){return o.zoomIn()}),g(2," + "),y(),S(3,"input",2),Y("input",function(a){return o.onInput(a)}),y(),S(4,"button",3),Y("click",function(){return o.zoomOut()}),g(5," - "),y(),S(6,"span",4),g(7),y()()),i&2&&(h(3),le("min",o.minZoom)("max",o.maxZoom)("value",o.zoomPercentage),h(4),ge("",o.zoomPercentage==null?null:o.zoomPercentage.toFixed(0),"%"))},encapsulation:2,changeDetection:0})}}return t})();var $r=(()=>{class t{constructor(e){this.threeMapControlsService=e,this.eventEmitter=new ku,this.currentlyHovered=null,this.isDragging=!1}init(e,i,o){this.cubeGroup=e,this.camera=i,this.renderer=o,this.initOrbitalControl(i,o),this.initRendererEventListeners(o)}resetIsDragging(){this.isDragging=!1}initOrbitalControl(e,i){this.controls=new gs(e,i.domElement),this.controls.maxPolarAngle=Math.PI/2,this.controls.enableZoom=!1,this.controls.enablePan=!1,this.controls.rotateSpeed=1}initRendererEventListeners(e){e.domElement.addEventListener("mousemove",i=>this.onDocumentMouseMove(i)),e.domElement.addEventListener("mouseup",i=>this.onDocumentMouseUp(i)),e.domElement.addEventListener("mousedown",i=>this.onDocumentMouseClick(i,"mousedown")),e.domElement.addEventListener("dblclick",i=>this.onDocumentMouseClick(i,"dblclick")),e.domElement.addEventListener("mouseleave",i=>this.onWindowMouseLeave(i)),e.domElement.addEventListener("mouseenter",()=>this.onDocumentMouseEnter())}onDocumentMouseClick(e,i){this.isDragging=!0,this.checkMouseIntersection(e,i)}onWindowMouseLeave(e){(e.relatedTarget==null||!(e.relatedTarget instanceof HTMLCanvasElement))&&this.enableRotation(!1)}onDocumentMouseEnter(){this.enableRotation(!0)}enableRotation(e){this.controls.enableRotate=e}checkMouseIntersection(e,i){this.getCubeIntersectedByMouse(e)||this.eventEmitter.emit("viewCubeEventPropagation",{type:i,event:e})}getCubeIntersectedByMouse(e){let i=this.transformIntoCanvasVector(e),o=new ss;o.setFromCamera(i,this.camera);let r=[];for(let s of mn(this.cubeGroup))Ki(s)&&r.push(s.data);let[a]=o.intersectObjects(r);return a?a.object:null}transformIntoCanvasVector(e){let{domElement:i}=this.renderer,o=this.renderer.getPixelRatio(),r=i.getBoundingClientRect(),a=(e.clientX-r.left)/i.width*o*2-1,s=-((e.clientY-r.top)/i.height*o)*2+1;return new Ge(a,s)}propagateMovement(){if(this.isDragging){let e=this.camera.position;this.threeMapControlsService.rotateCameraInVectorDirection(-e.x,-e.y,-e.z)}return this.isDragging}onDocumentMouseMove(e){if(this.propagateMovement())return;let i=this.getCubeIntersectedByMouse(e);i?this.currentlyHovered&&i.uuid!==this.currentlyHovered.uuid?this.triggerViewCubeUnhoverEvent():this.currentlyHovered||this.triggerViewCubeHoverEvent(i):(this.currentlyHovered&&this.triggerViewCubeUnhoverEvent(),this.eventEmitter.emit("viewCubeEventPropagation",{type:"mousemove",event:e}))}onDocumentMouseUp(e){this.isDragging=!1;let i=this.getCubeIntersectedByMouse(e);i?this.eventEmitter.emit("viewCubeClicked",{cube:i}):this.eventEmitter.emit("viewCubeEventPropagation",{type:"mouseup",event:e})}triggerViewCubeHoverEvent(e){this.currentlyHovered=e,_i(Mi.Pointer),this.eventEmitter.emit("viewCubeHoveredEvent",{cube:e})}triggerViewCubeUnhoverEvent(){this.currentlyHovered=null,_i(Mi.Default),this.eventEmitter.emit("viewCubeUnHoveredEvent")}subscribe(e,i){this.eventEmitter.on(e,o=>{i(o)})}static{this.\u0275fac=function(i){return new(i||t)(M(Vt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var xd=(()=>{class t{constructor(e,i,o){this.elementReference=e,this.threeMapControlsService=i,this.viewCubeMouseEvents=o,this.WIDTH=200,this.HEIGHT=200,this.LENGTH_VIEWCUBE=1,this.hoverInfo={cube:null,originalMaterial:null},this.cubeDefinition={top:null,sides:null},this.onCameraChanged=r=>{let a=this.calculateCameraPosition(r.camera);this.setCameraPosition(a),this.renderer.render(this.scene,this.camera)},this.onCubeHovered=r=>{this.hoverInfo={cube:r.cube,originalMaterial:r.cube.material},this.hoverInfo.cube.material.emissive=new Vn(16777215),this.renderer.render(this.scene,this.camera)},this.onCubeUnhovered=()=>{this.hoverInfo.cube.material.emissive=new Vn(0),this.hoverInfo.cube=null,this.renderer.render(this.scene,this.camera)},this.onCubeClicked=r=>{switch(r.cube){case this.cubeDefinition.top.front.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,-1,1);break;case this.cubeDefinition.top.front.center:this.threeMapControlsService.rotateCameraInVectorDirection(0,-1,1);break;case this.cubeDefinition.top.front.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,-1,1);break;case this.cubeDefinition.top.middle.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,-1,0);break;case this.cubeDefinition.top.middle.center:this.threeMapControlsService.rotateCameraInVectorDirection(0,-1,0);break;case this.cubeDefinition.top.middle.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,-1,0);break;case this.cubeDefinition.top.back.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,-1,-1);break;case this.cubeDefinition.top.back.center:this.threeMapControlsService.rotateCameraInVectorDirection(0,-1,-1);break;case this.cubeDefinition.top.back.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,-1,-1);break;case this.cubeDefinition.sides.front.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,0,-1);break;case this.cubeDefinition.sides.front.center:this.threeMapControlsService.rotateCameraInVectorDirection(0,0,0);break;case this.cubeDefinition.sides.front.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,0,-1);break;case this.cubeDefinition.sides.middle.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,0,0);break;case this.cubeDefinition.sides.middle.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,0,0);break;case this.cubeDefinition.sides.back.left:this.threeMapControlsService.rotateCameraInVectorDirection(1,0,1);break;case this.cubeDefinition.sides.back.center:this.threeMapControlsService.rotateCameraInVectorDirection(0,0,1);break;case this.cubeDefinition.sides.back.right:this.threeMapControlsService.rotateCameraInVectorDirection(-1,0,1);break}}}ngOnInit(){this.initScene(),this.initLights(),this.initRenderer(this.elementReference.nativeElement),this.initCube(),this.initAxesHelper(),this.initCamera(),this.viewCubeMouseEvents.init(this.cubeGroup,this.camera,this.renderer),this.threeMapControlsService.subscribe("onCameraChanged",this.onCameraChanged),this.viewCubeMouseEvents.subscribe("viewCubeHoveredEvent",this.onCubeHovered),this.viewCubeMouseEvents.subscribe("viewCubeUnHoveredEvent",this.onCubeUnhovered),this.viewCubeMouseEvents.subscribe("viewCubeClicked",this.onCubeClicked)}initAxesHelper(){let e=new su(1.3),i=-(this.LENGTH_VIEWCUBE/2)+.01;e.position.x+=i,e.position.y+=i,e.position.z+=i,this.scene.add(e)}initCube(){let{group:e,top:i,sides:o}=Hs.buildCube(1.9);this.cubeGroup=e,this.cubeDefinition.top=i,this.cubeDefinition.sides=o;let r=new ru(this.cubeGroup,new Vn(0));this.scene.add(this.cubeGroup),this.scene.add(r)}setCameraPosition(e){this.camera.position.set(e.x,e.y,e.z),this.camera.lookAt(0,0,0),this.camera.updateProjectionMatrix()}calculateCameraPosition(e){let i=this.threeMapControlsService.controls.target.clone();return e.position.clone().sub(i).normalize().multiplyScalar(3)}initScene(){this.scene=new is}initRenderer(e){this.renderer=new ls({alpha:!0,antialias:!0}),this.renderer.setSize(this.WIDTH,this.HEIGHT),this.renderer.setPixelRatio(window.devicePixelRatio),e.appendChild(this.renderer.domElement)}initCamera(){this.camera=new ts(45,this.WIDTH/this.HEIGHT,.1,1e3),this.camera.position.z=4}initLights(){this.lights=new Wn;let e=new ou(7368816,2.8),i=new $c(14737632,1.8);i.position.set(50,10,8).normalize();let o=new $c(14737632,1.8);o.position.set(-50,10,-8).normalize(),this.lights.add(e),this.lights.add(i),this.lights.add(o),this.scene.add(this.lights)}static{this.\u0275fac=function(i){return new(i||t)(te(At),te(Vt),te($r))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-view-cube"]],hostAttrs:[1,"absolute","right-0","top-[10px]","z-[11]","[transition:right_0.3s_ease]","[&.sideBarVisible]:right-[var(--cc-inspector-width)]"],decls:2,vars:0,template:function(i,o){i&1&&L(0,"cc-view-cube-toolbox")(1,"cc-zoom-slider")},dependencies:[vd,O0],encapsulation:2,changeDetection:0})}}return t})();var Us=(function(t){return t[t.LeftClick=0]="LeftClick",t[t.RightClick=2]="RightClick",t})(Us||{}),Bo=(()=>{class t{constructor(e,i,o,r,a,s,l,d,c,m,p){this.threeCameraService=e,this.threeRendererService=i,this.threeSceneService=o,this.codeMapStore=r,this.fileStoreReadWindow=a,this.sharedViewReadWindow=s,this.labelSettingsFacade=l,this.tooltipService=d,this.viewCubeMouseEvents=c,this.threeViewerService=m,this.idToBuilding=p,this.THRESHOLD_FOR_MOUSE_MOVEMENT_TRACKING=3,this.mouse={x:0,y:0},this.oldMouse={x:0,y:0},this.mouseOnLastClick={x:0,y:0},this.isGrabbing=!1,this.isMoving=!1,this.raycaster=new ss,this.labelSelectedBuilding=null,this.subscriptions=[this.fileStoreReadWindow.visibleFileStates$.pipe(Fe(()=>this.onFilesSelectionChanged())).subscribe(),this.sharedViewReadWindow.blacklist$.pipe(Fe(u=>this.onBlacklistChanged(u))).subscribe(),this.sharedViewReadWindow.hoveredNodeId$.pipe(Fe(u=>{u!==null?this.hoverNode(u):this.unhoverNode(!1)})).subscribe()],this.onViewCubeEventPropagation=u=>{switch(u.type){case"mousemove":this.onDocumentMouseMove(u.event);break;case"mouseup":this.onDocumentMouseUp(u.event);break;case"mousedown":this.onDocumentMouseDown(u.event);break;case"dblclick":this.onDocumentDoubleClick();break}},this.onDocumentMouseMove=u=>{this.mouse.x=u.clientX,this.mouse.y=u.clientY,this.updateHovering(),this.viewCubeMouseEvents.propagateMovement()}}ngOnDestroy(){for(let e of this.subscriptions)e.unsubscribe()}start(){this.registerEventListeners(),this.viewCubeMouseEvents.subscribe("viewCubeEventPropagation",this.onViewCubeEventPropagation)}registerEventListeners(){let e=this.threeRendererService.renderer.domElement;e.addEventListener("mousemove",this.onDocumentMouseMove),e.addEventListener("mouseup",i=>this.onDocumentMouseUp(i)),e.addEventListener("mousedown",i=>this.onDocumentMouseDown(i)),e.addEventListener("dblclick",()=>this.onDocumentDoubleClick()),e.addEventListener("mouseleave",i=>this.onDocumentMouseLeave(i)),e.addEventListener("mouseenter",()=>this.onDocumentMouseEnter()),e.addEventListener("wheel",Pi(()=>this.threeRendererService.render()))}hoverNode(e){if(this.isGrabbingOrMoving())return;let{buildings:i}=this.threeSceneService.getMapMesh().getMeshDescription();for(let o of i)if(o.node.path===e){this.hoverBuilding(o,!1);break}this.threeRendererService.render()}unhoverNode(e=!0){this.unhoverBuilding(e),this.threeRendererService.render()}onFilesSelectionChanged(){this.threeSceneService.clearSelection(),this.threeSceneService.clearConstantHighlight(),this.tooltipService.hide()}onBlacklistChanged(e){let i=this.threeSceneService.getSelectedBuilding();this.tooltipService.hide(),i&&lp(i.node.path,e)&&this.threeSceneService.clearSelection(),this.unhoverBuilding()}updateHovering(){if(this.hasMouseMoved(this.oldMouse)){if(this.isGrabbingOrMoving()){this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),this.threeRendererService.render();return}this.oldMouse.x=this.mouse.x,this.oldMouse.y=this.mouse.y;let e=this.threeSceneService.getMapMesh();if(e){this.threeCameraService.camera.updateMatrixWorld(!1);let i=this.transformHTMLToSceneCoordinates(),o=this.threeCameraService.camera;o.isPerspectiveCamera&&this.raycaster.setFromCamera(i,o),this.intersectedBuilding=e.checkMouseRayMeshIntersection(i,o);let r=this.threeSceneService.getHighlightedBuilding(),a=this.intersectedBuilding;r?.id!==a?.id?(this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),r&&a&&!this.isGrabbingOrMoving()?(this.threeSceneService.prepareHighlightTransition(),this.showTooltipForBuilding(a),this.hoverBuilding(a)):(this.unhoverBuilding(),a&&!this.isGrabbingOrMoving()&&(this.showTooltipForBuilding(a),this.hoverBuilding(a)))):!a&&this.codeMapStore.getHoveredNodeId()!==null?(this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),this.unhoverBuilding()):a&&this.tooltipService.isVisible()&&this.tooltipService.updatePosition(this.mouse.x,this.mouse.y)}}}drawLabelSelectedBuilding(e){this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),this.labelSelectedBuilding!==null&&this.labelSettingsFacade.clearTemporaryLabel(this.labelSelectedBuilding),e?.node?.isLeaf&&(this.labelSettingsFacade.hasLabelForNode(e.node)||this.labelSettingsFacade.addLeafLabel(e.node,0,!0),this.labelSelectedBuilding=e.node)}showTooltipForBuilding(e){this.labelSettingsFacade.hasLabelForNode(e.node)&&this.labelSettingsFacade.suppressLabelForNode(e.node),this.tooltipService.show(e.node,this.mouse.x,this.mouse.y)}clearLabelSelectedBuilding(){this.labelSelectedBuilding!==null&&(this.labelSettingsFacade.clearTemporaryLabel(this.labelSelectedBuilding),this.labelSelectedBuilding=null)}enableOrbitalsRotation(e){this.threeViewerService.enableRotation(e),this.viewCubeMouseEvents.enableRotation(e)}onDocumentMouseEnter(){this.enableOrbitalsRotation(!0)}onDocumentMouseLeave(e){this.labelSettingsFacade.setSuppressLayout(!1),this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),this.unhoverBuilding(),e.relatedTarget instanceof HTMLCanvasElement||this.enableOrbitalsRotation(!1)}onDocumentDoubleClick(){let e=this.threeSceneService.getHighlightedBuilding(),i=this.threeSceneService.getSelectedBuilding(),o=e?.node.link;if(o&&!this.hasMouseMoved(this.mouseOnLastClick)&&window.open(o,"_blank"),i?.node.isLeaf){let r=i.node.link;if(r){window.open(r,"_blank");return}}}onDocumentMouseDown(e){e.button===Us.RightClick&&(this.isMoving=!0,_i(Mi.Moving)),e.button===Us.LeftClick&&(this.isGrabbing=!0,_i(Mi.Grabbing)),this.labelSettingsFacade.setSuppressLayout(!0),this.tooltipService.hide(),this.labelSettingsFacade.restoreSuppressedLabel(),this.mouseOnLastClick={x:e.clientX,y:e.clientY},document.activeElement.blur()}onDocumentMouseUp(e){this.labelSettingsFacade.setSuppressLayout(!1),this.viewCubeMouseEvents.resetIsDragging(),e.button===Us.LeftClick?this.onLeftClick():this.onRightClick(),this.intersectedBuilding!==void 0?_i(Mi.Pointer):_i(Mi.Default)}onRightClick(){this.isMoving=!1,this.intersectedBuilding&&!this.hasMouseMovedBeyondThreshold(this.mouseOnLastClick)&&this.codeMapStore.setRightClickedNodeData({nodeId:this.intersectedBuilding.node.path,xPositionOfRightClickEvent:this.mouse.x,yPositionOfRightClickEvent:this.mouse.y,origin:"codeMap"}),this.threeRendererService.render()}onLeftClick(){this.isGrabbing=!1,this.hasMouseMovedBeyondThreshold(this.mouseOnLastClick)||(this.intersectedBuilding?(this.threeSceneService.selectBuilding(this.intersectedBuilding),this.drawLabelSelectedBuilding(this.intersectedBuilding)):(this.threeSceneService.clearSelection(),this.clearLabelSelectedBuilding()),this.threeSceneService.clearConstantHighlight()),this.threeRendererService.render()}hasMouseMovedBeyondThreshold({x:e,y:i}){return Math.abs(this.mouse.x-e)>this.THRESHOLD_FOR_MOUSE_MOVEMENT_TRACKING||Math.abs(this.mouse.y-i)>this.THRESHOLD_FOR_MOUSE_MOVEMENT_TRACKING}hasMouseMoved({x:e,y:i}){return this.mouse.x!==e||this.mouse.y!==i}isGrabbingOrMoving(){return this.isGrabbing||this.isMoving}hoverBuilding(e,i=!0){_i(Mi.Pointer);let r=this.codeMapStore.getIdToNode().get(e.node.id);for(let{data:a}of mn(r)){let s=this.idToBuilding.get(a.id);s&&this.threeSceneService.addBuildingsToHighlightingList(s)}this.threeSceneService.applyHighlights(),i&&this.codeMapStore.setHoveredNodeId(e.node.path)}transformHTMLToSceneCoordinates(){let{renderer:e,renderer:{domElement:i}}=this.threeRendererService,o=e.getPixelRatio(),r=i.getBoundingClientRect(),a=this.mouse.x/i.width*o*2-1,s=-((this.mouse.y-r.top)/i.height*o)*2+1;return{x:a,y:s}}unhoverBuilding(e=!0){this.isGrabbingOrMoving()||_i(Mi.Default),this.threeSceneService.getConstantHighlight().size>0?this.threeSceneService.clearHoverHighlight():this.threeSceneService.clearHighlight(),e&&this.codeMapStore.setHoveredNodeId(null)}static{this.\u0275fac=function(i){return new(i||t)(M(Qn),M(kt),M(ft),M(ar),M(Te),M(Nt),M(js),M(Un),M($r),M(Zn),M(Gn))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var G4=2,jr=(()=>{class t{constructor(e,i,o,r,a,s,l,d){this.codeMapStore=e,this.fileStoreReadWindow=i,this.threeSceneService=o,this.labelSettingsFacade=r,this.codeMapArrowService=a,this.threeStatsService=s,this.codeMapMouseEventService=l,this.colorCategoryCountsStore=d,this.nodesByColor={positive:[],neutral:[],negative:[]},this.onIsLoadingFileChanged=c=>{c?this.threeSceneService?.dispose():this.threeStatsService?.resetPanels()},this.subscription=this.fileStoreReadWindow.isLoadingFile$.pipe(Fe(this.onIsLoadingFileChanged)).subscribe()}ngOnDestroy(){this.subscription.unsubscribe()}load(e){this.render(e),this.scaleMap()}render(e){let i=this.getNodes(e),o=this.sortVisibleNodesByHeightDescending(i);this.unflattenedNodes=o.filter(({flat:r})=>!r),this.setNewMapMesh(i,o),this.getNodesMatchingColorSelector(this.unflattenedNodes),this.setLabels(this.unflattenedNodes),this.setArrows(o)}setNewMapMesh(e,i){let o=this.codeMapStore.getState(),r=new Eu(i,o,Ri(o.files));this.threeSceneService.setMapMesh(e,r)}scaleMap(){this.codeMapMouseEventService.unhoverNode(),this.codeMapArrowService.scale(),this.threeSceneService.scaleHeight(),this.labelSettingsFacade.clearLabels(),this.setLabels(this.unflattenedNodes)}getNodes(e){let i=this.codeMapStore.getState(),o=ao(i),{mapState:{layoutAlgorithm:r},files:a}=i,s=Ri(a);switch(r){case Na.StreetMap:case Na.TreeMapStreet:return Cu.createStreetLayoutNodes(e,i,o,zp(i),s);case Na.SquarifiedTreeMap:return Mu(e,i,o,s);default:return[]}}sortVisibleNodesByHeightDescending(e){return this.codeMapStore.getState().preferences.experimentalFeaturesEnabled?(this.setMinBuildingLength(e),e.filter(o=>o.visible&&o.width>0).sort((o,r)=>r.height-o.height)):e.filter(o=>o.visible&&o.length>0&&o.width>0).sort((o,r)=>r.height-o.height)}setMinBuildingLength(e){for(let i of e)i.length<=0&&(i.length=G4)}getNodesMatchingColorSelector(e){let i=this.codeMapStore.getState(),o=i.mapState.colorRange;this.nodesByColor={positive:[],negative:[],neutral:[]};for(let r of e)if(r.isLeaf){let a=r.attributes[i.mapState.colorMetric];i.mapState.colorMetric==="unary"?this.nodesByColor.positive.push(r):a!==null&&(a<o.from?this.nodesByColor.positive.push(r):a<o.to?this.nodesByColor.neutral.push(r):this.nodesByColor.negative.push(r))}this.colorCategoryCountsStore.setColorCategoryCounts({positive:this.nodesByColor.positive.length,neutral:this.nodesByColor.neutral.length,negative:this.nodesByColor.negative.length}),this.uncheckEmptyColorLabels()}uncheckEmptyColorLabels(){let e=this.codeMapStore.getState().mapState.colorLabels,i={};for(let o of Vc)e[o]&&this.nodesByColor[o].length===0&&(i[o]=!1);Object.keys(i).length>0&&this.codeMapStore.setColorLabels(i)}setBuildingLabel(e,i){for(let o of e)this.labelSettingsFacade.addLeafLabel(o,i)}setLabels(e){if(this.labelSettingsFacade.clearLabels(),e===void 0||e.length===0)return;let i=this.codeMapStore.getState(),{showMetricLabelNodeName:o,showMetricLabelNameValue:r,colorLabels:a,amountOfTopLabels:s,labelMode:l}=i.mapState;if(o||r){let d=e[0].height,c=this.getTopNodeSelector(i,s);if(l===Di.Color){let{colorMetric:m}=i.mapState,p=c(Vc.filter(u=>a[u]).flatMap(u=>this.nodesByColor[u]).filter(u=>Number.isFinite(u.attributes[m])),u=>u.attributes[m]);this.setBuildingLabel(p,d)}else{let m=c(e.filter(p=>p.isLeaf),p=>p.height??0);this.setBuildingLabel(m,d)}}}getTopNodeSelector(e,i){return fs(e)?(o,r)=>M0(o,a=>es(a.path),r,i):(o,r)=>md(o,r,i)}setArrows(e){this.codeMapArrowService.clearArrows(),this.codeMapArrowService.addEdgeMapBasedOnNodes(e),this.codeMapArrowService.addEdgePreview()}static{this.\u0275fac=function(i){return new(i||t)(M(ar),M(Te),M(ft),M(js),M(N0),M(Bu),M(Bo),M(Xn))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Y4=1e3/60,Gs=(()=>{class t{constructor(e,i,o,r,a,s,l,d){this.store=e,this.actions$=i,this.threeRendererService=o,this.codeMapRenderService=r,this.threeViewerService=a,this.activeViewStore=s,this.viewReadinessStore=l,this.errorHandler=d,this.actionsRequiringRender$=this.actions$.pipe(at(...y0)),this.mapDataChange$=It([this.store.select(Et),this.actionsRequiringRender$]).pipe(ke(([c])=>c)),this.dataChangedWhileMetricsViewIsShown$=this.mapDataChange$.pipe($t(this.activeViewStore.activeView$),Ie(([,c])=>c==="metrics"),ke(([c])=>c)),this.switchedToStaleMetricsView$=this.activeViewStore.activeView$.pipe(Ie(c=>c==="metrics"&&this.viewReadinessStore.isStale("metrics")),Ut(()=>this.threeViewerService.isMapCanvasMounted$.pipe(Ie(Boolean),ut(1))),$t(this.store.select(Et)),ke(([,c])=>c)),this.renderCodeMap$=Ae(()=>Ui(this.dataChangedWhileMetricsViewIsShown$,this.switchedToStaleMetricsView$).pipe(Ie(c=>!!c.unifiedMapNode),km(Y4,Sm,{leading:!1,trailing:!0}),Fe(c=>this.renderMap(c)),Gi()),{dispatch:!1})}renderMap(e){try{this.codeMapRenderService.load(e.unifiedMapNode),this.threeRendererService.render()}catch(i){this.errorHandler.handleError(i)}finally{_s()}}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(ht),M(kt),M(jr),M(Zn),M(or),M(tr),M(qm))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var K4=350,$0=(()=>{class t{constructor(e,i,o,r){this.store=e,this.actions$=i,this.renderCodeMapEffect=o,this.viewReadinessStore=r,this.hideLoadingFileOnCommit$=Ae(()=>this.actions$.pipe(at(ni),ke(()=>_p({value:!1})))),this.markViewsStaleOnDataChange$=Ae(()=>Ui(this.store.select(un).pipe(mi(1)),this.actions$.pipe(at(ni)),this.actions$.pipe(at(Xa,yi,Fn,Ln))).pipe(Fe(()=>{this.viewReadinessStore.markAllStale()})),{dispatch:!1}),this.markMetricsReadyOnRender$=Ae(()=>this.renderCodeMapEffect.renderCodeMap$.pipe(ti(K4),Ie(()=>this.viewReadinessStore.isStale("metrics")),Fe(()=>{this.viewReadinessStore.markReady("metrics")})),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(ht),M(Gs),M(tr))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var j0=[Gs,S0,$0];var sr=t=>(t=t.trim(),t.startsWith("*")||t.endsWith("*")||t.startsWith("/")||t.startsWith("./")?t:!t.startsWith('"')&&!t.endsWith('"')?t.startsWith("!")?t:`*${t}*`:t);var Xs=(t,n)=>{let e=[],i=n.split(",");if(i[0].startsWith("!")){i[0]=i[0].slice(1);for(let o of i)o.length>0&&e.push({path:`!${sr(o)}`,type:t})}else for(let o of i)if(o.length>0){if(o.startsWith("!"))break;o=sr(o),e.push({path:o,type:t})}return e};var H0="BlacklistExtensionAction",wd=(t,...n)=>({type:H0,action:{type:t},extensions:n}),U0=(()=>{class t{constructor(e,i){this.actions$=e,this.store=i,this.searchPattern2BlacklistItems$=this.actions$.pipe(at(H0),ke(o=>({blackListType:o.action.type,extensionToBlacklist:Xs(o.action.type,o.extensions.join(","))})),Gi()),this.blackListExtensions$=Ae(()=>this.searchPattern2BlacklistItems$.pipe(Ie(o=>o.blackListType==="flatten"||o.blackListType==="exclude"),Fe(o=>{this.store.dispatch(yi({items:o.extensionToBlacklist}))})),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var G0=[U0];var X0=[];var Q0=(()=>{class t{constructor(e){this.store=e,this.updateAmountOfEdgePreviews$=Ae(()=>this.store.select(us).pipe($t(this.store.select(za)),mi(1),Ie(([i,o])=>o>i),ke(([i])=>eo({value:i}))))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var J4=Re(Rp,qu,(t,n)=>({heightMetric:t,isLinked:n})),Y0=(()=>{class t{constructor(e){this.store=e,this.linkHeightAndColorMetric$=Ae(()=>this.store.select(J4).pipe(Ie(({isLinked:i})=>i),ke(({heightMetric:i})=>Pt({value:i}))))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var lr=t=>{let n=t.maxValue-t.minValue,e=Math.round(n/3),i=e+t.minValue,o=e*2+t.minValue;return{from:i,to:o}};var Z0=(()=>{class t{constructor(e,i){this.actions$=e,this.store=i,this.resetColorRangeOnColorMetricChange$=Ae(()=>this.actions$.pipe(at(Pt),Ut(()=>this.store.select(so).pipe(ut(1))),ke(o=>xi({value:lr(o)}))))}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var K0=(()=>{class t{constructor(e){this.store=e,this.resetIsEdgeMetricVisible$=Ae(()=>this.store.select(fn).pipe($t(this.store.select(Fp)),Ie(([,i])=>!i),ke(()=>Cn())))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var J0=(()=>{class t{constructor(e,i,o){this.store=e,this.mapStateReadWindow=i,this.metricsLensSourceReadWindow=o,this.updateMapColors$=Ae(()=>this.store.select(kp).pipe(ke(r=>{let a=this.metricsLensSourceReadWindow.getAttributeDescriptors(),s=this.mapStateReadWindow.getMapColors();if(a[r]?.direction===1){let l=JSON.parse(af(s)),d=l.negative;return l.negative=l.positive,l.positive=d,Ai({value:l})}return Ai({value:s??Lt})})))}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(ve),M(hs))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var eg=[Z0,J0,Y0,K0,Q0];var cr=(()=>{class t{constructor(e){this.store=e}setStandard(e){this.store.dispatch(pp({files:e}))}removeFiles(e){this.store.dispatch(mp({fileNames:e}))}setDelta(e,i){this.store.dispatch(bp({referenceFile:e,comparisonFile:i}))}setDeltaReference(e){this.store.dispatch(gp({file:e}))}setDeltaComparison(e){this.store.dispatch(fp({file:e}))}switchReferenceAndComparison(){this.store.dispatch(up())}setFiles(e){this.store.dispatch(hp({value:e}))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Qs=(()=>{class t{constructor(e,i,o){this.fileStoreReadWindow=e,this.filesRepo=i,this.navBarWriteStore=o,this.lastSetFilesOfPreviousMode=[],this.subscription=this.fileStoreReadWindow.files$.pipe(_m(),Ie(([r,a])=>Ri(r)!==Ri(a)||a.length===0),Fe(([r,a])=>{this.lastSetFilesOfPreviousMode=a.length===0?a:r})).subscribe()}ngOnDestroy(){this.subscription.unsubscribe()}toggle(){let e=this.filesRepo.getFiles();if(!Ri(e)){this.lastSetFilesOfPreviousMode=this.filterNoneExisting(e,this.lastSetFilesOfPreviousMode);let o=this.lastSetFilesOfPreviousMode.find(a=>a.selectedAs===ii.Reference)??e.find(a=>a.selectedAs===ii.Partial);if(o===void 0)return;let r=this.lastSetFilesOfPreviousMode.find(a=>a.selectedAs===ii.Comparison);this.navBarWriteStore.setDelta(o.file,r?.file);return}if(this.lastSetFilesOfPreviousMode.length>0){this.navBarWriteStore.setFiles(this.lastSetFilesOfPreviousMode);return}let i=e.find(o=>o.selectedAs===ii.Reference)?.file;i!==void 0&&this.navBarWriteStore.setStandard([i])}filterNoneExisting(e,i){return i.filter(o=>e.find(r=>wp(r.file,o.file)))}static{this.\u0275fac=function(i){return new(i||t)(M(Te),M(Sp),M(cr))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var iw="This file has no domain-language data \u2014 switched to the map view.",ow="Left compare mode \u2014 the domain view shows a single word cloud.",nw=0,tg=(()=>{class t{constructor(){this.store=q(he),this.router=q(hn),this.toastService=q(wf),this.fileSelectionModeService=q(Qs),this.unreachableReason$=It([this.store.select(qf),this.store.select(Oa)]).pipe(ke(([e,i])=>({reason:this.toUnreachableReason(e,i),wasOnDomainRoute:this.isOnDomainRoute()})),ti(nw),Ta({bufferSize:1,refCount:!0})),this.navigated$=this.router.events.pipe(Ie(e=>e instanceof Gm)),this.redirectAwayFromUnreachableDomainView$=Ae(()=>this.unreachableReason$.pipe(Ie(({reason:e,wasOnDomainRoute:i})=>e!==null&&i&&this.isOnDomainRoute()),Fe(({reason:e})=>this.redirectToMetricsView(e))),{dispatch:!1}),this.handleTheDomainViewBeingOpenedWhileUnreachable$=Ae(()=>this.navigated$.pipe(Ut(()=>this.unreachableReason$.pipe(ut(1))),Ie(({reason:e})=>e!==null&&this.isOnDomainRoute()),Fe(({reason:e})=>this.makeTheDomainViewReachable(e))),{dispatch:!1})}makeTheDomainViewReachable(e){if(e==="delta"){this.leaveCompareMode();return}this.redirectToMetricsView(e)}leaveCompareMode(){this.fileSelectionModeService.toggle(),this.toastService.show(ow)}toUnreachableReason(e,i){return e?"missing-domain-data":i?"delta":null}redirectToMetricsView(e){this.router.navigateByUrl(ki.metrics,{replaceUrl:!0}),e==="missing-domain-data"&&this.toastService.show(iw)}isOnDomainRoute(){return pf(this.router.url)==="domain"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var ig=[tg];var og=(()=>{class t{constructor(e,i){this.guard=e,this.errorDialogService=i,this.showErrorDialogIfBlacklistItemsResultInEmptyMap$=Ae(()=>this.guard.doBlacklistItemsResultInEmptyMap$.pipe(Ie(o=>o.resultsInEmptyMap),Fe(()=>{_s(),this.errorDialogService.open({title:"Blacklist Error",message:"Excluding all buildings is not possible."})})),{dispatch:!1}),this.addBlacklistItems$=Ae(()=>this.guard.doBlacklistItemsResultInEmptyMap$.pipe(Ie(o=>!o.resultsInEmptyMap),ke(o=>yi({items:o.items}))))}static{this.\u0275fac=function(i){return new(i||t)(M(qs),M(Wa))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var ng=[og];var rg=t=>t.some(n=>n.name==="rloc")?"rloc":"unary";var rw=["rloc","real_lines_of_code","loc","lines_of_code","lines","statements","functions"],ag=["complexity","mcc","cognitive_complexity","sonar_complexity","sonar_cognitive_complexity","max_nesting_level","indentation_level"];function sg(t){return t.some(n=>n.maxValue>0)}function lg(t,n){let e=[],i;for(let o of t)if(o.maxValue&&(e.push(o.name),i=o.name,--n===0))return e;if(!i)throw new Error("there are no metrics available");for(;n-- >0;)e.push(i);return e}function cg(t){let n=[],e={AreaMetric:rw,HeightMetric:ag,ColorMetric:ag},i=new Set(t.map(o=>o.name));for(let o in e)for(let r of e[o])if(i.has(r)){n.push(r);break}return n}function dg(t,n,e,i,o,r=!1){let a=new Set(e.map(k=>k.name)),s=new Set(i.map(k=>k.name)),l=k=>!!k&&a.has(k),d=k=>!!k&&s.has(k),c=o?t:Fr,m=r?{areaMetric:null,heightMetric:null,colorMetric:null,distributionMetric:null,edgeMetric:null}:n,p=aw(c,m,e,l);if(p===null)return null;let u=m.edgeMetric;return d(c.edgeMetric)?u=c.edgeMetric:d(u)||(u=i[0]?.name),nt(xe({},p),{edgeMetric:u})}function aw(t,n,e,i){let o=i(t.areaMetric)?t.areaMetric:n.areaMetric,r=i(t.heightMetric)?t.heightMetric:n.heightMetric,a=i(t.colorMetric)?t.colorMetric:n.colorMetric;if(i(o)&&i(r)&&i(a))return{areaMetric:o,heightMetric:r,colorMetric:a,distributionMetric:n.distributionMetric};if(!sg(e))return null;let[s,l,d]=sw(e);return{areaMetric:i(t.areaMetric)?t.areaMetric:s,heightMetric:i(t.heightMetric)?t.heightMetric:l,colorMetric:i(t.colorMetric)?t.colorMetric:d,distributionMetric:rg(e)}}function sw(t){let n=cg(t),[e,i,o]=n;return e&&i&&o?n:lg(t,3)}function hg(t){let n={};for(let e of t)for(let i of Object.keys(e))n[i]||(n[i]=e[i]);return n}function mg(t){let n={},e={};for(let i of t){for(let o of Object.keys(i.nodes))n[o]||(n[o]=i.nodes[o]);for(let o of Object.keys(i.edges))e[o]||(e[o]=i.edges[o])}return{nodes:n,edges:e}}function pg(t,n){let e=new Map;if(t.length===1)return t[0].settings.fileSettings.blacklist;for(let i of t)if(i.settings.fileSettings.blacklist)for(let o of i.settings.fileSettings.blacklist){let r={path:n?Ja(i.fileMeta.fileName,o.path):o.path,type:o.type};e.set(`${r.path}|${r.type}`,r)}return[...e.values()]}function Sd(t,n){return xe({},n)}function ug(t,n){return nt(xe({},t),{frequency:t.frequency+n.frequency,tfidf:lw(t.tfidf,n.tfidf)})}function lw(t,n){return t===void 0?n:n===void 0?t:Math.max(t,n)}var Ys=class{constructor(){this.wordsByTextPerPath=new Map}add(n,e,i){let o=this.wordsByTextOf(n);for(let r of e){let a=o.get(r.text);o.set(r.text,a?i(a,r):xe({},r))}}toDomainLensData(){let n={};for(let[e,i]of this.wordsByTextPerPath)n[e]=[...i.values()];return n}wordsByTextOf(n){let e=this.wordsByTextPerPath.get(n);return e||(e=new Map,this.wordsByTextPerPath.set(n,e)),e}};function fg(t,n){if(t.length===1)return t[0].settings.fileSettings.domainWords;let e=new Ys;for(let i of t)for(let[o,r]of Object.entries(i.settings.fileSettings.domainWords)){if(!n){e.add(o,r,Sd);continue}e.add(Gp(i.fileMeta.fileName,o),r,Sd),o===Rr.rootPath&&e.add(Rr.rootPath,r,ug)}return e.toDomainLensData()}function gg(t,n){if(t.length===1)return t[0].settings.fileSettings.markedPackages;let e=new Map;for(let i of t)if(i.settings.fileSettings.markedPackages)for(let o of i.settings.fileSettings.markedPackages){let r={path:n?Ja(i.fileMeta.fileName,o.path):o.path,color:o.color};e.set(`${r.path}|${r.color}`,r)}return[...e.values()]}var bg=(()=>{class t{constructor(e,i,o,r,a,s,l){this.actions$=e,this.store=i,this.ccStateSnapshot=o,this.fileStoreReadWindow=r,this.mapStateReadWindow=a,this.queryParamsService=s,this.loadInitialFileStore=l,this.fileSetTriggers$=Ui(this.actions$.pipe(at(ni),ke(d=>({kind:"fileSet",provenance:d}))),this.store.select(un).pipe(mi(1),ke(()=>({kind:"fileSet",provenance:null})))).pipe(Gi()),this.fileSetChanged$=this.fileSetTriggers$.pipe(Cm(this.fileSetTriggers$.pipe(ti(0))),Ie(d=>d.length>0),ke(d=>({kind:"fileSet",provenance:d.find(c=>c.provenance)?.provenance??null}))),this.reconcileFileSet$=Ae(()=>this.fileSetChanged$.pipe(Fe(d=>{this.reconcile(d)})),{dispatch:!1}),this.reconcileMetricData$=Ae(()=>It([this.store.select(ao),this.store.select(ps)]).pipe(mi(1),ti(0),Fe(()=>{this.reconcile({kind:"metricData"})})),{dispatch:!1})}reconcile(e){e.kind==="fileSet"&&(this.mergeFileSettings(),this.updateFileRoot());let{nodeMetricData:i,edgeMetricData:o}=$n(this.ccStateSnapshot.get());if(!i)return;let r=this.currentSelection(),a=dg(e.kind==="fileSet"?e.provenance?.urlMetrics??Fr:Fr,r,i,o,this.queryParamsService.hasFile(),e.kind==="fileSet"&&!!e.provenance?.forceDefaultMetrics);if(!a)return;this.applySelection(a,r);let s=a.colorMetric!==r.colorMetric;if(e.kind==="fileSet"||s){let l=fu(i,a.colorMetric);this.store.dispatch(xi({value:lr(l)}))}e.kind==="fileSet"&&(this.store.dispatch(Pn()),this.updateVisibleTopLabels(),this.applyRestoredSettings(e.provenance?.restoredSettings??null))}applyRestoredSettings(e){e&&(this.loadInitialFileStore.applyMetricsLensSource(e.metricsLensSource),this.loadInitialFileStore.applyDependencyLensSource(e.dependencyLensSource),this.loadInitialFileStore.applyDomainLensSource(e.domainLensSource),this.loadInitialFileStore.applySharedView(e.sharedView))}mergeFileSettings(){let e=this.fileStoreReadWindow.getFiles(),i=pn(e),o=xp(e),r=this.fileStoreReadWindow.getVisibleFileStates(),a=r.map(({file:d})=>d.settings.fileSettings.attributeTypes),s=r.map(({file:d})=>d.settings.fileSettings.attributeDescriptors),l=mg(a);this.store.dispatch(Ei({value:{sharedView:{blacklist:pg(i,o),markedPackages:gg(i,o)},metricsLensSource:{attributeTypes:l.nodes,attributeDescriptors:hg(s)},dependencyLensSource:{attributeTypes:l.edges},domainLensSource:{words:fg(i,o)}}}))}updateFileRoot(){let e=this.fileStoreReadWindow.getReferenceFile();e&&Rr.updateRoot(e.map.name)}currentSelection(){let{areaMetric:e,heightMetric:i,colorMetric:o,edgeMetric:r,distributionMetric:a}=this.mapStateReadWindow.getMapState();return{areaMetric:e,heightMetric:i,colorMetric:o,edgeMetric:r,distributionMetric:a}}applySelection(e,i){this.dispatchIfChanged($a,e.distributionMetric,i.distributionMetric),this.dispatchIfChanged(vi,e.areaMetric,i.areaMetric),this.dispatchIfChanged(Si,e.heightMetric,i.heightMetric),this.dispatchIfChanged(Pt,e.colorMetric,i.colorMetric),this.dispatchIfChanged(wi,e.edgeMetric,i.edgeMetric)}dispatchIfChanged(e,i,o){i!==o&&this.store.dispatch(e({value:i}))}updateVisibleTopLabels(){let e=Li(this.ccStateSnapshot.get()),i=this.mapStateReadWindow.getAmountOfTopLabels();this.store.dispatch(Ji({value:Math.min(i,gf(e))}))}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(he),M(Bt),M(Te),M(ve),M(ws),M(sf))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var dw=[to,Rn,Dn,Ai,gn,bn,An,Tn,In,Vp,Cn,Ua,yn,Sn,Ha,qn,vn,eo,Ji,_n,Ga,xn,Mn,wn,En,io,wi,xi,kn,Si,$a,Pt,vi],hw=[Fi,Qa,Pn,Ya,Za,Hp,Xa,yi,Fn,Ln,Ka,Nn,Bn],mw=[pu,mu],pw=[cu],uw=[ju,Hu,Uu,Yu,Ku,Gu,Xu,$u,Ju,of,zu,Zu,ef,tf,Qu],vg=[[...mw],[...pw],[...uw],[...dw],[...hw],[...Vu],[...vp],Ei].flat();var xg=(()=>{class t{constructor(e,i){this.actions$=e,this.ccStateSnapshot=i,this.saveCcState$=Ae(()=>this.actions$.pipe(Ie(o=>o.type!==Do.type),at(...vg),ti(500),Fe(async()=>{let o=this.ccStateSnapshot.get();await lf(o)})),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(Bt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var wg=[wi,Si,Pt,vi,dp];var Sg=(()=>{class t{constructor(e,i,o,r,a){this.actions$=e,this.mapStateReadWindow=i,this.fileStoreReadWindow=o,this.queryParamsService=r,this.store=a,this.saveMetricsInQueryParameters$=Ae(()=>this.actions$.pipe(at(...wg),$t(this.store.select(ps)),ke(([,s])=>s&&s.length>0),ti(100),Fe(s=>{this.updateMetricQueryParameters(s)})),{dispatch:!1})}updateMetricQueryParameters(e){let{edgeMetric:i,heightMetric:o,colorMetric:r,areaMetric:a}=this.mapStateReadWindow.getMapState();this.queryParamsService.write({areaMetric:a,heightMetric:o,colorMetric:r,edgeMetric:i,isEdgeMetricDefined:e,currentFilesAreSampleFiles:this.fileStoreReadWindow.getCurrentFilesAreSampleFiles()})}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(ve),M(Te),M(ws),M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var yg=[bg,xg,Sg];var Zs=class{constructor(){this.detachedHandles=new Map}routeKey(n){return n.routeConfig?.path??null}shouldDetach(n){return this.routeKey(n)!==null}store(n,e){let i=this.routeKey(n);i!==null&&(e?this.detachedHandles.set(i,e):this.detachedHandles.delete(i))}shouldAttach(n){let e=this.routeKey(n);return e!==null&&this.detachedHandles.has(e)}retrieve(n){let e=this.routeKey(n);return e===null?null:this.detachedHandles.get(e)??null}shouldReuseRoute(n,e){return n.routeConfig===e.routeConfig}};var Cg=(()=>{class t extends zm{constructor(){super(q(Bc),q(Om,{optional:!0})??void 0),this.platformLocation=q(Bc)}prepareExternalUrl(e){let i=new URL(this.platformLocation.href);return i.hash=super.prepareExternalUrl(e),i.toString()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var Mg={metricsLensSource:uu,dependencyLensSource:du,domainLensSource:Ou,domainState:nf,preferences:Pu,mapState:Wp,sharedView:Qp,files:Mp,isLoadingFile:Ep,currentFilesAreSampleFiles:Cp},_g=t=>(n,e)=>{let i=Wu(e)?rf(xe({},n),e.value):n;return t(i,e)};var Eg=(()=>{class t{constructor(){this.actions$=q(ht),this.domainSelectionStore=q(Tf),this.resetDomainSelectionAfterLoad$=Ae(()=>this.actions$.pipe(at(ni),Fe(()=>this.domainSelectionStore.clear())),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var kg=[Eg];var qg=t=>({type:"BlacklistSearchPatternAction",action:{type:t}}),Tg=(()=>{class t{constructor(e,i,o){this.actions$=e,this.store=i,this.blacklistExclusionGuard=o,this.searchPattern2BlacklistItems$=this.actions$.pipe(at("BlacklistSearchPatternAction"),$t(this.store.select(oo)),ke(([r,a])=>({type:r.action.type,blacklistItems:Xs(r.action.type,a)})),Gi()),this.flattenSearchPattern$=Ae(()=>this.searchPattern2BlacklistItems$.pipe(Ie(r=>r.type==="flatten"),Fe(r=>{this.store.dispatch(yi({items:r.blacklistItems})),this.store.dispatch(Fi({value:""}))})),{dispatch:!1}),this.excludeSearchPattern$=Ae(()=>this.searchPattern2BlacklistItems$.pipe(Ie(r=>r.type==="exclude"),Fe(()=>{this.blacklistExclusionGuard.doBlacklistItemsResultInEmptyMap$.pipe(ut(1),Ie(r=>!r.resultsInEmptyMap),Fe(()=>{this.store.dispatch(Fi({value:""}))})).subscribe()}),ke(r=>Up({items:r.blacklistItems}))))}static{this.\u0275fac=function(i){return new(i||t)(M(ht),M(he),M(qs))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var Ig=[Tg];var fw=(t,n,e,i,o)=>{let r=[],a=yd("area",t.areaMetric,n,o);a&&r.push(a);let s=yd("height",t.heightMetric,n,o);s&&r.push(s);let l=yd("color",t.colorMetric,n,o);l&&!i&&r.push(nt(xe({},l),{inverted:e.isColorRangeInverted===!0}));let d=gw(t.edgeMetric,n,o);return d&&r.push(d),r},yd=(t,n,e,i)=>{if(n)return{kind:t,metricName:n,value:i?.attributes?.[n],descriptor:e?.[n]}},gw=(t,n,e)=>{if(!t)return;let i=e?.edgeAttributes?.[t];if(i)return{kind:"edge",metricName:t,incoming:i.incoming??0,outgoing:i.outgoing??0,descriptor:n?.[t]}},Dg=Re(Hn,ds,ja,Oa,Yt,fw);var bw=.3333333333333333,vw=2/3,Cd=(t,n,e,i)=>{if(n===void 0||e===void 0||e===n)return{fraction:1,severity:"neutral"};let o=xw((t-n)/(e-n));return{fraction:o,severity:ww(i===1?1-o:o)}},xw=t=>Math.min(1,Math.max(0,t)),ww=t=>t<bw?"success":t<vw?"warning":"error";var Md=t=>t===void 0||t===0||Number.isNaN(t),_d=t=>Md(t.value)&&!t.delta,Rg={fraction:0,severity:"neutral"},Sw="unary",yw=(t,n,e,i)=>t?.attributes?Object.keys(t.attributes).filter(o=>o!==Sw).sort((o,r)=>o.localeCompare(r)).map(o=>Cw(o,t,n,e,i)):[],Cw=(t,n,e,i,o)=>{let r=o?.[t],a=n.attributes[t];return{name:t,value:a,delta:n.deltas?.[t],mapBar:Mw(t,a,e,r),rangeBar:_w(t,a,i,r),descriptor:r}},Mw=(t,n,e,i)=>{if(Md(n))return Rg;let o=e?.attributes?.[t];return Cd(n,0,o,i?.direction)},_w=(t,n,e,i)=>{if(Md(n))return Rg;let o=e.nodeMetricData.find(r=>r.name===t);return Cd(n,o?.minValue,o?.maxValue,i?.direction)},Ag=Re(Yt,Et,ao,ds,(t,n,e,i)=>yw(t,n.unifiedMapNode,{nodeMetricData:e},i));var fo=(()=>{class t{constructor(e){this.store=e,this.selectedNode$=this.store.select(Yt),this.mappingBlocks$=this.store.select(Dg),this.metricRows$=this.store.select(Ag)}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var si=(()=>{class t{constructor(){this.readStore=q(fo),this.threeSceneService=q(ft),this.threeRendererService=q(kt),this.selectedNode=D(this.readStore.selectedNode$,{initialValue:void 0}),this.isVisible=Z(()=>this.selectedNode()!=null)}close(){this.threeSceneService.clearSelection(),this.threeRendererService.render()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Fg=t=>{if(t)return{all:t.attributes?.unary??0,added:t.fileCount?.added??0,removed:t.fileCount?.removed??0,changed:t.fileCount?.changed??0}};function Ew(t,n){if(t&1&&(S(0,"span",2)(1,"span",3),g(2),y(),S(3,"span",4),g(4),y(),S(5,"span",5),g(6),y()()),t&2){let e=A();h(2),ge("\u0394",e.added),h(2),ge("\u0394",e.removed>0?-e.removed:0),h(2),ge("\u0394",e.changed)}}function kw(t,n){if(t&1&&(S(0,"span",1),g(1),y(),O(2,Ew,7,3,"span",2)),t&2){let e=n,i=A();h(),Yi(" ",e.all," ",e.all===1?"file":"files"," "),h(),z(i.isDeltaState()?2:-1)}}var Lg=(()=>{class t{constructor(){this.isFolder=H.required(),this.fileCount=H(),this.isDeltaState=H.required()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-node-badges"]],hostAttrs:["data-testid","inspector-node-badges",1,"mt-1","flex","flex-wrap","items-center","gap-1"],inputs:{isFolder:[1,"isFolder"],fileCount:[1,"fileCount"],isDeltaState:[1,"isDeltaState"]},decls:3,vars:2,consts:[["data-testid","inspector-node-type",1,"badge","badge-ghost","badge-sm"],["data-testid","inspector-file-count",1,"badge","badge-ghost","badge-sm"],[1,"text-xs","opacity-60"],["title","Number of added files",1,"text-success"],["title","Number of removed files",1,"text-error"],["title","Number of files with metric changes"]],template:function(i,o){if(i&1&&(S(0,"span",0),g(1),y(),O(2,kw,3,3)),i&2){let r;h(),qe(o.isFolder()?"folder":"file"),h(),z((r=o.isFolder()&&o.fileCount())?2:-1,r)}},encapsulation:2,changeDetection:0})}}return t})();function qw(t,n){if(t&1&&(S(0,"p",0),g(1),y()),t&2){let e=A();h(),qe(e.parentPath())}}function Tw(t,n){if(t&1&&(S(0,"a",2),fe(1,"i",3),y()),t&2){let e=n;le("href",e,ln)("title",e)}}var Pg=(()=>{class t{constructor(){this.parentPath=H.required(),this.nodeName=H.required(),this.link=H()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-node-path"]],hostAttrs:[1,"block"],inputs:{parentPath:[1,"parentPath"],nodeName:[1,"nodeName"],link:[1,"link"]},decls:4,vars:3,consts:[["data-testid","inspector-parent-path",1,"break-all","text-sm","leading-snug","opacity-60"],["data-testid","inspector-node-name",1,"break-all","text-lg","font-semibold","leading-snug","text-primary"],["target","_blank","rel","noopener noreferrer","data-testid","inspector-node-link",1,"text-sm",3,"href","title"],[1,"fa","fa-external-link"]],template:function(i,o){if(i&1&&(O(0,qw,2,1,"p",0),S(1,"p",1),g(2),O(3,Tw,2,2,"a",2),y()),i&2){let r;z(o.parentPath()?0:-1),h(2),ge(" ",o.nodeName()," "),h(),z((r=o.link())?3:-1,r)}},encapsulation:2,changeDetection:0})}}return t})();function Iw(t,n){if(t&1){let e=Me();v(0,"div",4)(1,"div",5),L(2,"cc-inspector-node-path",6)(3,"cc-inspector-node-badges",7),b(),v(4,"button",8),W("click",function(){ce(e);let o=A();return de(o.copyPath())}),L(5,"i",9),b()()}if(t&2){let e=A();h(2),F("parentPath",e.parentPath())("nodeName",e.nodeName())("link",e.nodeLink()),h(),F("isFolder",e.isFolder())("fileCount",e.fileCount())("isDeltaState",e.isDeltaState()),h(),F("title",e.copied()?"Copied!":"Copy path"),h(),Le("fa-copy",!e.copied())("fa-check",e.copied())}}var Ng=(()=>{class t{static{this.COPY_FEEDBACK_MS=1500}constructor(){this.readStore=q(fo),this.fileStoreReadWindow=q(Te),this.visibilityService=q(si),this.selectedNode=D(this.readStore.selectedNode$,{requireSync:!0}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{requireSync:!0}),this.copied=be(!1),this.nodeName=Z(()=>this.selectedNode()?.name??""),this.nodeLink=Z(()=>this.selectedNode()?.link),this.parentPath=Z(()=>{let e=this.selectedNode();return e?.path?e.path.slice(0,e.path.length-e.name.length):""}),this.isFolder=Z(()=>this.selectedNode()?.type===Ft.FOLDER),this.fileCount=Z(()=>Fg(this.selectedNode())),q(sn).onDestroy(()=>clearTimeout(this.copyFeedbackTimeout))}close(){this.visibilityService.close()}async copyPath(){let e=this.selectedNode()?.path;e&&(await navigator.clipboard.writeText(e),this.copied.set(!0),clearTimeout(this.copyFeedbackTimeout),this.copyFeedbackTimeout=setTimeout(()=>this.copied.set(!1),t.COPY_FEEDBACK_MS))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-header"]],hostAttrs:[1,"block","shrink-0","px-3","py-2"],decls:6,vars:1,consts:[[1,"flex","items-center","justify-between"],[1,"text-xs","uppercase","tracking-widest","opacity-60"],["type","button","title","Close inspector","data-testid","inspector-close-button",1,"btn","btn-ghost","btn-xs","btn-square",3,"click"],[1,"fa","fa-times"],[1,"mt-1","flex","items-start","justify-between","gap-2"],[1,"min-w-0"],[3,"parentPath","nodeName","link"],[3,"isFolder","fileCount","isDeltaState"],["type","button","data-testid","inspector-copy-path-button",1,"btn","btn-ghost","btn-sm","btn-square","shrink-0",3,"click","title"],[1,"fa"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Inspector"),b(),v(3,"button",2),W("click",function(){return o.close()}),L(4,"i",3),b()(),O(5,Iw,6,11,"div",4)),i&2&&(h(5),z(o.selectedNode()?5:-1))},dependencies:[Pg,Lg],encapsulation:2,changeDetection:0})}}return t})();var dr=new Map([["loc","Lines of Code"],["rloc","Real Lines of Code"],["comment_lines","Number of Code Lines with Comments"],["complexity","Cyclomatic Complexity"],["sonar_complexity","Cyclomatic Complexity"],["mcc","McCabe Complexity"],["avgCommits","Average Number of Commits from this file"],["functions","Number of Functions"],["pairingRate","Pairing Rate of selected building"],["unary","-"],["line_coverage","Number of Code Lines covered by tests"],["sonar_code_smells","Number of Smells Sonar has identified"],["avg_code_churn","Average Number of Lines added or removed from this file"],["number_of_authors","Number of Authors that have edited this file"],["statements","Number of Statements"]]);var go=(()=>{class t{transform(e,i){if(e==null)return dr.get(i)??"";let o=e.title?`${e.title} (${i})`:`${i}`,r=e.description?`
|
|
3412
3425
|
${e.description}`:"";return r+=e.hintHighValue?`
|
|
3413
3426
|
High Values: ${e.hintHighValue}`:"",r+=e.hintLowValue?`
|
|
3414
|
-
Low Values: ${e.hintLowValue}`:"",r.length>0?`${o}:${r}`:o}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=Xi({name:"attributeDescriptorTooltip",type:t,pure:!0})}}return t})();var Vo=t=>t===void 0||Number.isNaN(t)?"-":t.toLocaleString("en-US");function D4(t,n){if(t&1&&(y(0,"a",4),fe(1,"i",7),S()),t&2){let e=A();le("href",n,ln),dt("data-testid","mapping-block-link-"+e.block().kind)}}function R4(t,n){if(t&1&&(g(0),y(1,"span",8),g(2,"(in/out)"),S()),t&2){let e=A();ge(" ",e.edgeCountText()," ")}}function A4(t,n){if(t&1&&g(0),t&2){let e=A();ge(" ",e.formattedValue()," ")}}function F4(t,n){t&1&&(y(0,"span",6),g(1,"\xB7 inverted"),S())}var Bg=(()=>{class t{constructor(){this.block=H.required(),this.iconClasses=Z(()=>`${t.ICONS[this.block().kind]} text-xs text-primary`),this.formattedValue=Z(()=>Vo(this.block().value)),this.edgeCountText=Z(()=>`${Vo(this.block().incoming)}/${Vo(this.block().outgoing)}`)}static{this.ICONS={area:"fa fa-arrows-alt",height:"fa fa-arrows-v",color:"fa fa-paint-brush",edge:"fa fa-exchange"}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-mapping-block"]],hostAttrs:[1,"block","py-2"],inputs:{block:[1,"block"]},decls:12,vars:13,consts:[[1,"flex","items-center","gap-2"],[1,"text-xs","uppercase","tracking-widest","opacity-60"],["aria-hidden","true"],[1,"break-all","leading-snug",3,"title"],["target","_blank","rel","noopener noreferrer",1,"text-sm","opacity-70",3,"href"],[1,"text-base","font-semibold","tabular-nums","leading-snug"],["data-testid","mapping-block-inverted",1,"text-sm","font-normal","opacity-60"],[1,"fa","fa-external-link"],[1,"text-sm","font-normal","opacity-70"]],template:function(i,o){if(i&1&&(y(0,"div",0)(1,"span",1),g(2),S(),fe(3,"i",2),S(),y(4,"p",3),rt(5,"attributeDescriptorTooltip"),g(6),O(7,D4,2,2,"a",4),S(),y(8,"p",5),O(9,R4,3,1)(10,A4,1,1),O(11,F4,2,0,"span",6),S()),i&2){let r;h(2),qe(o.block().kind),h(),yt(o.iconClasses()),h(),le("title",gi(5,10,o.block().descriptor,o.block().metricName)),dt("data-testid","mapping-block-name-"+o.block().kind),h(2),ge(" ",o.block().metricName," "),h(),z((r=(r=o.block().descriptor)==null?null:r.link)?7:-1,r),h(),dt("data-testid","mapping-block-value-"+o.block().kind),h(),z(o.block().kind==="edge"?9:10),h(2),z(o.block().inverted?11:-1)}},dependencies:[go],encapsulation:2,changeDetection:0})}}return t})();var L4=(t,n)=>n.kind;function P4(t,n){if(t&1&&L(0,"cc-inspector-mapping-block",2),t&2){let e=n.$implicit;F("block",e)}}var Vg=(()=>{class t{constructor(){this.readStore=q(fo),this.mappingBlocks=D(this.readStore.mappingBlocks$,{requireSync:!0})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-metric-mapping"]],hostAttrs:[1,"block","shrink-0","border-t","border-base-300","px-3","py-2"],decls:5,vars:0,consts:[[1,"text-xs","uppercase","tracking-widest","opacity-60"],[1,"mt-1","divide-y","divide-base-200"],[3,"block"]],template:function(i,o){i&1&&(v(0,"span",0),g(1,"Metric Mapping"),b(),v(2,"div",1),Pe(3,P4,1,1,"cc-inspector-mapping-block",2,L4),b()),i&2&&(h(3),Ne(o.mappingBlocks()))},dependencies:[Bg],encapsulation:2,changeDetection:0})}}return t})();var Ks=(()=>{class t{constructor(){this.comparisonMode=be("map")}setComparisonMode(e){this.comparisonMode.set(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Wg=(()=>{class t{constructor(){this.comparisonModeService=q(Ks),this.comparisonMode=this.comparisonModeService.comparisonMode}setComparisonMode(e){this.comparisonModeService.setComparisonMode(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-comparison-toggle"]],hostAttrs:[1,"contents"],decls:5,vars:4,consts:[["data-testid","inspector-comparison-toggle",1,"join"],["type","button","title","Compare each value against the whole map","data-testid","inspector-comparison-map",1,"btn","btn-xs","join-item",3,"click"],["type","button","title","Compare each value against the min/max range of all files","data-testid","inspector-comparison-range",1,"btn","btn-xs","join-item",3,"click"]],template:function(i,o){i&1&&(y(0,"div",0)(1,"button",1),Y("click",function(){return o.setComparisonMode("map")}),g(2," map "),S(),y(3,"button",2),Y("click",function(){return o.setComparisonMode("range")}),g(4," range "),S()()),i&2&&(h(),Le("btn-active",o.comparisonMode()==="map"),h(2),Le("btn-active",o.comparisonMode()==="range"))},encapsulation:2,changeDetection:0})}}return t})();function N4(t,n){t&1&&(y(0,"a",2),fe(1,"i",7),S()),t&2&&le("href",n,ln)}function B4(t,n){if(t&1&&(y(0,"span",8),g(1),S()),t&2){let e=A();Oe("color",e.deltaColor()),h(),qe(e.formattedDelta())}}var Js=(()=>{class t{constructor(){this.row=H.required(),this.comparisonMode=H.required(),this.positiveDeltaColor=H.required(),this.negativeDeltaColor=H.required(),this.bar=Z(()=>this.comparisonMode()==="map"?this.row().mapBar:this.row().rangeBar),this.formattedValue=Z(()=>Vo(this.row().value)),this.hasDelta=Z(()=>!!this.row().delta),this.formattedDelta=Z(()=>`\u0394${Vo(this.row().delta)}`),this.deltaColor=Z(()=>(this.row().delta??0)>0?this.positiveDeltaColor():this.negativeDeltaColor()),this.barClasses=Z(()=>`h-full rounded ${t.SEVERITY_CLASSES[this.bar().severity]}`),this.barWidthPercentage=Z(()=>this.bar().fraction*100)}static{this.SEVERITY_CLASSES={success:"bg-success",warning:"bg-warning",error:"bg-error",neutral:"bg-base-content/30"}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-metric-row"]],hostAttrs:[1,"block"],inputs:{row:[1,"row"],comparisonMode:[1,"comparisonMode"],positiveDeltaColor:[1,"positiveDeltaColor"],negativeDeltaColor:[1,"negativeDeltaColor"]},decls:10,vars:12,consts:[[1,"flex","items-baseline","justify-between","gap-2"],[1,"min-w-0","truncate","text-sm",3,"title"],["target","_blank","rel","noopener noreferrer","data-testid","metric-row-link",1,"opacity-70",3,"href"],[1,"shrink-0","text-sm","tabular-nums"],["data-testid","metric-row-delta",1,"mr-1",3,"color"],[1,"mt-0.5","h-1","overflow-hidden","rounded","bg-base-300"],["data-testid","metric-row-bar"],[1,"fa","fa-external-link"],["data-testid","metric-row-delta",1,"mr-1"]],template:function(i,o){if(i&1&&(y(0,"div",0)(1,"span",1),rt(2,"attributeDescriptorTooltip"),g(3),O(4,N4,2,1,"a",2),S(),y(5,"span",3),O(6,B4,2,3,"span",4),g(7),S()(),y(8,"div",5),fe(9,"div",6),S()),i&2){let r;h(),le("title",gi(2,9,o.row().descriptor,o.row().name)),h(2),ge(" ",o.row().name," "),h(),z((r=(r=o.row().descriptor)==null?null:r.link)?4:-1,r),h(2),z(o.hasDelta()?6:-1),h(),ge(" ",o.formattedValue()," "),h(2),yt(o.barClasses()),Oe("width",o.barWidthPercentage(),"%")}},dependencies:[go],encapsulation:2,changeDetection:0})}}return t})();var V4=(t,n)=>n.name;function W4(t,n){if(t&1&&L(0,"cc-inspector-metric-row",3),t&2){let e=n.$implicit,i=A(3);F("row",e)("comparisonMode",i.comparisonMode())("positiveDeltaColor",i.positiveDeltaColor())("negativeDeltaColor",i.negativeDeltaColor())}}function O4(t,n){if(t&1&&(v(0,"div",2),Pe(1,W4,1,4,"cc-inspector-metric-row",3,V4),b()),t&2){let e=A(2);h(),Ne(e.rows())}}function z4(t,n){if(t&1){let e=Me();v(0,"button",0),W("click",function(){ce(e);let o=A();return de(o.toggleEmptyMetrics())}),L(1,"i",1),g(2),b(),O(3,O4,3,0,"div",2)}if(t&2){let e=A();h(),Le("fa-chevron-right",!e.showEmptyMetrics())("fa-chevron-down",e.showEmptyMetrics()),h(),ge(" Empty metrics (",e.rows().length,") "),h(),z(e.showEmptyMetrics()?3:-1)}}var Og=(()=>{class t{constructor(){this.rows=H.required(),this.comparisonMode=H.required(),this.positiveDeltaColor=H.required(),this.negativeDeltaColor=H.required(),this.showEmptyMetrics=be(!1)}toggleEmptyMetrics(){this.showEmptyMetrics.update(e=>!e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-empty-metrics"]],hostAttrs:[1,"block"],inputs:{rows:[1,"rows"],comparisonMode:[1,"comparisonMode"],positiveDeltaColor:[1,"positiveDeltaColor"],negativeDeltaColor:[1,"negativeDeltaColor"]},decls:1,vars:1,consts:[["type","button","data-testid","inspector-empty-metrics-toggle",1,"mt-3","flex","items-center","gap-1.5","text-xs","uppercase","tracking-widest","opacity-60",3,"click"],[1,"fa","text-[10px]"],["data-testid","inspector-empty-metrics",1,"mt-2","flex","flex-col","gap-2","opacity-60"],[3,"row","comparisonMode","positiveDeltaColor","negativeDeltaColor"]],template:function(i,o){i&1&&O(0,z4,4,6),i&2&&z(o.rows().length>0?0:-1)},dependencies:[Js],encapsulation:2,changeDetection:0})}}return t})();var $4=(t,n)=>n.name;function j4(t,n){t&1&&L(0,"cc-inspector-comparison-toggle")}function H4(t,n){t&1&&(v(0,"p",2),g(1,"No metrics available"),b())}function U4(t,n){if(t&1&&L(0,"cc-inspector-metric-row",4),t&2){let e=n.$implicit,i=A(2);F("row",e)("comparisonMode",i.comparisonMode())("positiveDeltaColor",i.mapColors().positiveDelta)("negativeDeltaColor",i.mapColors().negativeDelta)}}function G4(t,n){if(t&1&&(v(0,"div",3),Pe(1,U4,1,4,"cc-inspector-metric-row",4,$4),b(),L(3,"cc-inspector-empty-metrics",5)),t&2){let e=A();h(),Ne(e.metricRowsWithValues()),h(2),F("rows",e.emptyMetricRows())("comparisonMode",e.comparisonMode())("positiveDeltaColor",e.mapColors().positiveDelta)("negativeDeltaColor",e.mapColors().negativeDelta)}}var zg=(()=>{class t{constructor(){this.readStore=q(fo),this.mapStateReadWindow=q(ve),this.comparisonModeService=q(Ks),this.metricRows=D(this.readStore.metricRows$,{requireSync:!0}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{requireSync:!0}),this.comparisonMode=this.comparisonModeService.comparisonMode,this.metricRowsWithValues=Z(()=>this.metricRows().filter(e=>!_d(e))),this.emptyMetricRows=Z(()=>this.metricRows().filter(e=>_d(e)))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-metrics-list"]],hostAttrs:[1,"block","border-t","border-base-300","px-3","py-2"],decls:6,vars:2,consts:[[1,"flex","items-center","justify-between"],[1,"text-xs","uppercase","tracking-widest","opacity-60"],["data-testid","inspector-metrics-empty",1,"mt-2","text-sm","opacity-60"],[1,"mt-2","flex","flex-col","gap-2"],[3,"row","comparisonMode","positiveDeltaColor","negativeDeltaColor"],[3,"rows","comparisonMode","positiveDeltaColor","negativeDeltaColor"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Metrics"),b(),O(3,j4,1,0,"cc-inspector-comparison-toggle"),b(),O(4,H4,2,0,"p",2)(5,G4,4,4)),i&2&&(h(3),z(o.metricRows().length>0?3:-1),h(),z(o.metricRows().length===0?4:5))},dependencies:[Wg,Og,Js],encapsulation:2,changeDetection:0})}}return t})();var Ed=(()=>{class t{constructor(){this.visibilityService=q(si),this.isVisible=this.visibilityService.isVisible}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-sidebar-inspector"]],hostAttrs:[1,"fixed","right-0","z-[60]","w-[var(--cc-inspector-width)]","bg-base-100","overflow-hidden","flex","flex-col","shadow-[-2px_0_8px_-2px_rgba(0,0,0,0.15)]","transition-transform","duration-300"],hostVars:9,hostBindings:function(i,o){i&2&&(dt("aria-hidden",!o.isVisible()),Oe("top","var(--cc-bars-height, 49px)")("height","calc(100vh - var(--cc-bars-height, 49px) - var(--cc-file-extension-bar-height, 17px) - var(--cc-bottom-bar-height, 32px))"),Le("translate-x-full",!o.isVisible())("pointer-events-none",!o.isVisible()))},decls:4,vars:0,consts:[[1,"min-h-0","flex-1","overflow-y-auto"]],template:function(i,o){i&1&&(L(0,"cc-inspector-header")(1,"cc-inspector-metric-mapping"),v(2,"div",0),L(3,"cc-inspector-metrics-list"),b())},dependencies:[Ng,Vg,zg],encapsulation:2,changeDetection:0})}}return t})();function X4(t,n){t&1&&(v(0,"div",1)(1,"div",2)(2,"span"),g(3," The graphics card stopped rendering the map, usually because it ran out of memory. Reload the page, and try a smaller map or a smaller browser window. "),b()()())}var kd=(()=>{class t{constructor(e,i,o,r,a){this.inspectorVisibilityService=e,this.fileStoreReadWindow=i,this.threeViewerService=o,this.codeMapMouseEventService=r,this.elementReference=a,this.isLoadingFile$=this.fileStoreReadWindow.isLoadingFile$,this.isContextLost$=this.threeViewerService.isContextLost$}ngAfterViewInit(){this.threeViewerService.init(this.elementReference.nativeElement.querySelector("#codeMap")),this.codeMapMouseEventService.start()}ngOnDestroy(){this.threeViewerService.stopAnimate(),this.threeViewerService.destroy()}static{this.\u0275fac=function(i){return new(i||t)(te(si),te(Te),te(Zn),te(Bo),te(At))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-code-map"]],decls:5,vars:9,consts:[["id","codeMap",1,"fixed","left-0","top-[var(--cc-bars-height,49px)]","z-0","h-full","w-full"],[1,"pointer-events-none","fixed","inset-0","z-[1000]","flex","items-center","justify-center","p-4"],["role","alert",1,"alert","alert-error","pointer-events-auto","max-w-md"]],template:function(i,o){i&1&&(v(0,"div",0),rt(1,"async"),L(2,"cc-view-cube"),b(),O(3,X4,4,0,"div",1),rt(4,"async")),i&2&&(Le("hidden",fi(1,5,o.isLoadingFile$)),h(2),Le("sideBarVisible",o.inspectorVisibilityService.isVisible()),h(),z(fi(4,7,o.isContextLost$)?3:-1))},dependencies:[xd,Fa],encapsulation:2,changeDetection:0})}}return t})();var el=Re(Et,bi,(t,n)=>xs.getMetricDistribution(t.unifiedMapNode,n));var tl=Re(jn,Yt,bi,el,(t,n,e,i)=>{let o=t||n;return!o||o.type===Ft.FILE?i:xs.getMetricDistribution(o,e)});var il=(()=>{class t{constructor(e){this.store=e,this.hoveredNodeMetricDistribution$=this.store.select(tl),this.metricDistribution$=this.store.select(el)}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var jg=(()=>{class t{constructor(e){this.mapStateReadWindow=e,this.areaMetric$=this.mapStateReadWindow.areaMetric$,this.distributionMetric=Ip}static{this.\u0275fac=function(i){return new(i||t)(te(ve))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-distribution-metric"]],hostAttrs:[1,"mx-[5px]","flex","min-w-max","items-center","gap-1.5","text-xs"],decls:3,vars:3,consts:[[1,"fa","fa-pie-chart"]],template:function(i,o){i&1&&(fe(0,"i",0),g(1),rt(2,"async")),i&2&&(h(),ge(" ",fi(2,1,o.areaMetric$),`
|
|
3415
|
-
`))},dependencies:[Fa],encapsulation:2,changeDetection:0})}}return t})();var Hg=(()=>{class t{constructor(e){this.store=e,this.hoveredNodeMetricDistribution$=this.store.select(tl),this.hoveredNode$=this.store.select(jn),this.selectedNode$=this.store.select(Yt),this.flattenedItems$=this.store.select(Op("flatten"))}dispatchAfterPaint(e){Nr(this.store,e)}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function K4(t){return`*.${t}`}function J4(t,n){return t===bs?n.others.filter(e=>e.fileExtension!==vs).map(e=>e.fileExtension):[t]}function ol(t,n,e){return J4(t,n).map(o=>{let r=K4(o);return e?.type===Ft.FOLDER?`${e.path}/**/${r}`:r})}var Ug=(()=>{class t{constructor(e){this.blackListExtensionStore=e,this.operationContext$=It([this.blackListExtensionStore.hoveredNodeMetricDistribution$,this.blackListExtensionStore.hoveredNode$,this.blackListExtensionStore.selectedNode$,this.blackListExtensionStore.flattenedItems$]).pipe(ke(([i,o,r,a])=>({distribution:i,node:o||r,flattenedItems:a})))}show(e){this.operationContext$.pipe(ut(1)).subscribe(i=>{let o=ol(e,i.distribution,i.node),r=this.createFlattenedItemsMap(i.flattenedItems),a=o.map(s=>r.get(s));this.blackListExtensionStore.dispatchAfterPaint(Ln({items:a}))})}exclude(e){this.operationContext$.pipe(ut(1)).subscribe(i=>{let o=ol(e,i.distribution,i.node);this.blackListExtensionStore.dispatchAfterPaint(wd("exclude",...o))})}flatten(e){this.operationContext$.pipe(ut(1)).subscribe(i=>{let o=ol(e,i.distribution,i.node);this.blackListExtensionStore.dispatchAfterPaint(wd("flatten",...o))})}getIsFlattenedByFileExtension(e){return this.operationContext$.pipe(ke(i=>ol(e,i.distribution,i.node).every(r=>i.flattenedItems.some(a=>a.path===r))))}createFlattenedItemsMap(e){let i=new Map;for(let o of e)i.set(o.path,o);return i}static{this.\u0275fac=function(i){return new(i||t)(M(Hg))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Gg=(()=>{class t{constructor(e,i){this.threeSceneService=e,this.metricDistributionStore=i,this.metricDistribution$=this.metricDistributionStore.metricDistribution$,this.fileExtensionsOfOthers=new Set,this.fileExtensionsOfNone=new Set,this.metricDistribution$.pipe(Mm(),Ie(o=>!!o)).subscribe(o=>{this.fileExtensionsOfOthers.clear();for(let r of o.others)this.fileExtensionsOfOthers.add(r.fileExtension);this.fileExtensionsOfNone.clear();for(let r of o.none)this.fileExtensionsOfNone.add(r.fileExtension)})}highlightExtension(e){switch(e){case bs:this.threeSceneService.highlightBuildingsByExtension(this.fileExtensionsOfOthers);break;case vs:this.threeSceneService.highlightBuildingsWithoutExtensions();break;default:this.threeSceneService.highlightBuildingsByExtension(new Set([e]));break}}clearHighlightingOnFileExtensions(){this.threeSceneService.applyClearHighlights()}static{this.\u0275fac=function(i){return new(i||t)(M(ft),M(il))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var i5=["menu"];function o5(t,n){if(t&1){let e=Me();y(0,"button",10),Y("click",function(){ce(e);let o=A(2);return de(o.show(o.fileExtension()))}),fe(1,"i",11),y(2,"span",9),g(3,"Show"),S()()}}function n5(t,n){if(t&1){let e=Me();y(0,"button",12),Y("click",function(){ce(e);let o=A(2);return de(o.flatten(o.fileExtension()))}),fe(1,"i",13),y(2,"span",9),g(3,"Flatten"),S()()}}function r5(t,n){if(t&1){let e=Me();y(0,"div",4,0),Y("contextmenu",function(o){return o.preventDefault()}),O(2,o5,4,0,"button",5)(3,n5,4,0,"button",6),y(4,"button",7),Y("click",function(){ce(e);let o=A();return de(o.exclude(o.fileExtension()))}),fe(5,"i",8),y(6,"span",9),g(7,"Exclude"),S()()()}if(t&2){let e=n,i=A();Oe("left",e.left,"px")("bottom",e.bottom,"px"),h(2),z(i.isFlattened()?2:3)}}var a5=192,qd=4,Xg=(()=>{class t{constructor(e,i){this.blackListExtensionService=e,this.highlightBuildingsByFileExtensionService=i,this.item=H.required(),this.showAbsoluteValues=H.required(),this.toggleShowAbsoluteValues=Ce(),this.isFlattened=be(!1),this.menuPosition=be(null),this.menuRef=je("menu"),this.fileExtension=Z(()=>this.item().fileExtension),this.hasFileExtension=Z(()=>this.fileExtension()!=="None"),this.formattedTitle=Z(()=>this.formatTitle(this.showAbsoluteValues(),this.item(),this.fileExtension()))}ngOnInit(){this.flattenSubscription=this.blackListExtensionService.getIsFlattenedByFileExtension(this.fileExtension()).subscribe(e=>this.isFlattened.set(e))}ngOnDestroy(){this.flattenSubscription?.unsubscribe()}openContextMenu(e){if(e.preventDefault(),!this.hasFileExtension())return;let i=Math.max(qd,Math.min(e.clientX,window.innerWidth-a5-qd)),o=Math.max(qd,window.innerHeight-e.clientY);this.menuPosition.set({left:i,bottom:o})}closeContextMenu(){this.menuPosition.set(null)}onDocumentPointerDown(e){if(!this.menuPosition())return;let i=this.menuRef()?.nativeElement;i&&e.target instanceof Node&&i.contains(e.target)||this.closeContextMenu()}closeContextMenuOnViewportChange(){this.menuPosition()&&this.closeContextMenu()}flatten(e){this.blackListExtensionService.flatten(e),this.closeContextMenu()}exclude(e){this.blackListExtensionService.exclude(e),this.closeContextMenu()}show(e){this.blackListExtensionService.show(e),this.closeContextMenu()}onHoverFileExtensionBar(e){this.highlightBuildingsByFileExtensionService.highlightExtension(e)}onUnhoverFileExtensionBar(){this.highlightBuildingsByFileExtensionService.clearHighlightingOnFileExtensions()}formatTitle(e,i,o){return e&&i.absoluteMetricValue||!e&&i.relativeMetricValue?e?`${o} ${i.absoluteMetricValue.toLocaleString()}`:`${o} ${i.relativeMetricValue.toFixed(2)}%`:"No data available"}get backgroundColor(){return this.item().color}get flexGrow(){return this.item().relativeMetricValue}get flexBasis(){return"0"}static{this.\u0275fac=function(i){return new(i||t)(te(Ug),te(Gg))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-file-extension-bar-segment"]],viewQuery:function(i,o){i&1&&tt(o.menuRef,i5,5),i&2&&it()},hostAttrs:[1,"min-w-max","cursor-pointer","overflow-hidden","text-center","text-white"],hostVars:6,hostBindings:function(i,o){i&1&&W("pointerdown",function(a){return o.onDocumentPointerDown(a)},Io)("wheel",function(){return o.closeContextMenuOnViewportChange()},Io)("resize",function(){return o.closeContextMenuOnViewportChange()},Rm),i&2&&Oe("background-color",o.backgroundColor)("flex-grow",o.flexGrow)("flex-basis",o.flexBasis)},inputs:{item:[1,"item"],showAbsoluteValues:[1,"showAbsoluteValues"]},outputs:{toggleShowAbsoluteValues:"toggleShowAbsoluteValues"},decls:4,vars:3,consts:[["menu",""],[1,"cc-bar-section",3,"click","contextmenu"],["data-test-id","formattedTitle",1,"cc-bar-section-text","my-0.5","whitespace-nowrap","px-2.5","text-[10px]",3,"mouseover","mouseleave","title"],[1,"fixed","z-[100]","w-48","rounded-box","border","border-base-300","bg-base-100","py-1","text-base-content","shadow-lg",3,"left","bottom"],[1,"fixed","z-[100]","w-48","rounded-box","border","border-base-300","bg-base-100","py-1","text-base-content","shadow-lg",3,"contextmenu"],["type","button","data-test-id","showBuilding",1,"flex","w-full","items-center","gap-3","px-4","py-2.5","text-left","text-sm","font-medium","hover:bg-base-200"],["type","button","data-test-id","flattenBuilding",1,"flex","w-full","items-center","gap-3","px-4","py-2.5","text-left","text-sm","font-medium","hover:bg-base-200"],["type","button","data-test-id","excludeBuilding",1,"flex","w-full","items-center","gap-3","px-4","py-2.5","text-left","text-sm","font-medium","hover:bg-base-200",3,"click"],[1,"w-4","text-center","fa-solid","fa-ban"],[1,"truncate"],["type","button","data-test-id","showBuilding",1,"flex","w-full","items-center","gap-3","px-4","py-2.5","text-left","text-sm","font-medium","hover:bg-base-200",3,"click"],[1,"w-4","text-center","fa-solid","fa-eye"],["type","button","data-test-id","flattenBuilding",1,"flex","w-full","items-center","gap-3","px-4","py-2.5","text-left","text-sm","font-medium","hover:bg-base-200",3,"click"],[1,"w-4","text-center","fa-solid","fa-arrows-down-to-line"]],template:function(i,o){if(i&1&&(y(0,"span",1),Y("click",function(){return o.toggleShowAbsoluteValues.emit()})("contextmenu",function(a){return o.openContextMenu(a)}),y(1,"div",2),Y("mouseover",function(){return o.onHoverFileExtensionBar(o.fileExtension())})("mouseleave",function(){return o.onUnhoverFileExtensionBar()}),g(2),S()(),O(3,r5,8,5,"div",3)),i&2){let r;h(),le("title",o.formattedTitle()),h(),ge(" ",o.formattedTitle()," "),h(),z((r=o.menuPosition())?3:-1,r)}},encapsulation:2,changeDetection:0})}}return t})();var l5=(t,n)=>n.fileExtension;function c5(t,n){if(t&1){let e=Me();v(0,"cc-file-extension-bar-segment",4),W("toggleShowAbsoluteValues",function(){ce(e);let o=A();return de(o.toggleShowAbsoluteValues())}),b()}if(t&2){let e=n.$implicit,i=A();F("item",e)("showAbsoluteValues",i.showAbsoluteValues())}}var Td=(()=>{class t{constructor(){this.metricDistributionStore=q(il),this.showAbsoluteValues=be(!1),this.metricDistribution=D(this.metricDistributionStore.hoveredNodeMetricDistribution$,{requireSync:!0})}toggleShowAbsoluteValues(){this.showAbsoluteValues.update(e=>!e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-file-extension-bar"]],hostAttrs:[1,"fixed","left-0","right-0","z-[70]","block","bg-base-100"],hostVars:2,hostBindings:function(i,o){i&2&&Oe("bottom","var(--cc-bottom-bar-height, 32px)")},features:[Zi([{provide:Es,useValue:"--cc-file-extension-bar-height"}]),Qi([ks])],decls:5,vars:0,consts:[[1,"flex","h-[17px]","w-full"],["title","Distribution metric"],[1,"flex","w-full","gap-px"],[3,"item","showAbsoluteValues"],[3,"toggleShowAbsoluteValues","item","showAbsoluteValues"]],template:function(i,o){i&1&&(v(0,"div",0),L(1,"cc-distribution-metric",1),v(2,"div",2),Pe(3,c5,1,2,"cc-file-extension-bar-segment",3,l5),b()()),i&2&&(h(3),Ne(o.metricDistribution().visible))},dependencies:[jg,Xg],encapsulation:2,changeDetection:0})}}return t})();var nl="var(--cc-bottom-bar-height, 32px) + var(--cc-file-extension-bar-height, 17px)";var rl=(()=>{class t{static{this.NO_MATCHING="\u2013 (no matching buildings)"}transform(e,i,o,r){switch(e){case"positive":{let a=r==="unary",s=o.minValue===i.from,l=o.maxValue===i.from;return a?`${o.minValue} - ${o.maxValue}`:s?t.NO_MATCHING:l?`${o.minValue} to ${this.formatNumber(i.from)}`:`${o.minValue} to ${this.formatNumber(i.from-1)}`}case"neutral":{let a=i.from===i.to,s=i.to===o.maxValue;return a?t.NO_MATCHING:s?`${this.formatNumber(i.from)} to ${this.formatNumber(i.to)}`:`${this.formatNumber(i.from)} to ${this.formatNumber(i.to-1)}`}case"negative":return o.maxValue===i.to?t.NO_MATCHING:`${this.formatNumber(i.to)} to ${this.formatNumber(o.maxValue)}`;case"positiveDelta":return"+\u0394 positive delta";case"negativeDelta":return"\u2013\u0394 negative delta";case"selected":return"selected";case"outgoingEdge":return"Outgoing Edge";case"incomingEdge":return"Incoming Edge"}}formatNumber(e){return(e||0).toLocaleString()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=Xi({name:"mapColorLabel",type:t,pure:!0})}}return t})();var Qg=(()=>{class t{constructor(e){this.store=e,this.selectedColorMetricData$=this.store.select(so)}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var bo=(()=>{class t{constructor(e,i){this.mapStateReadWindow=e,this.legendMetricRangeStore=i,this.mapColorFor=H.required(),this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.colorRange=D(this.mapStateReadWindow.colorRange$,{initialValue:{from:0,to:0}}),this.nodeMetricRange=D(this.legendMetricRangeStore.selectedColorMetricData$,{initialValue:{values:[],minValue:0,maxValue:0}}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Lt}),this.color=Z(()=>this.mapColors()[this.mapColorFor()])}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(Qg))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-color-row"]],inputs:{mapColorFor:[1,"mapColorFor"]},decls:7,vars:8,consts:[[1,"flex","items-center","gap-2"],[1,"h-4","w-4","shrink-0","rounded-sm","border","border-base-300"],["width","100%","height","100%"],[1,"min-w-0","flex-1","truncate","text-sm"]],template:function(i,o){if(i&1&&(Nm(0),rt(1,"mapColorLabel"),y(2,"div",0),To(),y(3,"svg",1),fe(4,"rect",2),S(),Ir(),y(5,"span",3),g(6),S()()),i&2){let r=Aa(1,3,o.mapColorFor(),o.colorRange(),o.nodeMetricRange(),o.colorMetric());h(3),dt("aria-label","Color for "+r),h(),dt("fill",o.color()),h(2),qe(r)}},dependencies:[rl],encapsulation:2,changeDetection:0})}}return t})();var Yg=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-color-scale-section"]],hostAttrs:[1,"contents"],decls:6,vars:0,consts:[[1,"border-base-300","flex","flex-col","gap-1","border-t","pt-2"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],["mapColorFor","positive"],["mapColorFor","neutral"],["mapColorFor","negative"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Color scale"),b(),L(3,"cc-legend-color-row",2)(4,"cc-legend-color-row",3)(5,"cc-legend-color-row",4),b())},dependencies:[bo],encapsulation:2,changeDetection:0})}}return t})();var Zg=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-delta-colors-section"]],hostAttrs:[1,"contents"],decls:5,vars:0,consts:[[1,"flex","flex-col","gap-1"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],["mapColorFor","positiveDelta"],["mapColorFor","negativeDelta"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Delta colors"),b(),L(3,"cc-legend-color-row",2)(4,"cc-legend-color-row",3),b())},dependencies:[bo],encapsulation:2,changeDetection:0})}}return t})();function h5(t,n){t&1&&(v(0,"div",0),L(1,"cc-legend-color-row",1)(2,"cc-legend-color-row",2),b())}var Kg=(()=>{class t{constructor(e){this.mapStateReadWindow=e,this.edgeMetric=D(this.mapStateReadWindow.edgeMetric$,{initialValue:null})}static{this.\u0275fac=function(i){return new(i||t)(te(ve))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-edge-colors-section"]],hostAttrs:[1,"contents"],decls:1,vars:1,consts:[[1,"border-base-300","flex","flex-col","gap-1","border-t","pt-2"],["mapColorFor","outgoingEdge"],["mapColorFor","incomingEdge"]],template:function(i,o){i&1&&O(0,h5,3,0,"div",0),i&2&&z(o.edgeMetric()?0:-1)},dependencies:[bo],encapsulation:2,changeDetection:0})}}return t})();var Jg=(()=>{class t{constructor(e){this.metricsLensFacade=e,this.label=H.required(),this.metricName=H.required(),this.attributeDescriptors=D(this.metricsLensFacade.descriptors$,{initialValue:{}}),this.descriptor=Z(()=>this.attributeDescriptors()[this.metricName()]),this.title=Z(()=>this.descriptor()?.title||dr.get(this.metricName())||this.metricName())}static{this.\u0275fac=function(i){return new(i||t)(te(zn))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-metric-row"]],inputs:{label:[1,"label"],metricName:[1,"metricName"]},decls:6,vars:6,consts:[[1,"flex","items-baseline","gap-3",3,"title"],[1,"w-16","shrink-0","text-xs","uppercase","tracking-wider","opacity-60"],[1,"min-w-0","truncate","text-sm","font-semibold"]],template:function(i,o){i&1&&(y(0,"div",0),rt(1,"attributeDescriptorTooltip"),y(2,"span",1),g(3),S(),y(4,"span",2),g(5),S()()),i&2&&(le("title",gi(1,3,o.descriptor(),o.metricName())),h(3),qe(o.label()),h(2),qe(o.title()))},dependencies:[go],encapsulation:2,changeDetection:0})}}return t})();function p5(t,n){t&1&&L(0,"cc-legend-metric-row",4),t&2&&F("metricName",n)}var e1=(()=>{class t{constructor(e){this.mapStateReadWindow=e,this.areaMetric=D(this.mapStateReadWindow.areaMetric$,{initialValue:""}),this.heightMetric=D(this.mapStateReadWindow.heightMetric$,{initialValue:""}),this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.edgeMetric=D(this.mapStateReadWindow.edgeMetric$,{initialValue:null})}static{this.\u0275fac=function(i){return new(i||t)(te(ve))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-metrics-section"]],hostAttrs:[1,"contents"],decls:5,vars:4,consts:[[1,"flex","flex-col","gap-2"],["label","Area",3,"metricName"],["label","Height",3,"metricName"],["label","Color",3,"metricName"],["label","Edge",3,"metricName"]],template:function(i,o){if(i&1&&(v(0,"div",0),L(1,"cc-legend-metric-row",1)(2,"cc-legend-metric-row",2)(3,"cc-legend-metric-row",3),O(4,p5,1,1,"cc-legend-metric-row",4),b()),i&2){let r;h(),F("metricName",o.areaMetric()??""),h(),F("metricName",o.heightMetric()??""),h(),F("metricName",o.colorMetric()??""),h(),z((r=o.edgeMetric())?4:-1,r)}},dependencies:[Jg],encapsulation:2,changeDetection:0})}}return t})();var t1=(()=>{class t{constructor(e){this.inspectorVisibilityService=e,this.isOpen=H.required(),this.togglePanel=Ce(),this.buttonBottom=`calc(${nl} + 32px)`,this.buttonRight=Z(()=>this.inspectorVisibilityService.isVisible()?"calc(var(--cc-inspector-width) - 28px)":"-28px")}static{this.\u0275fac=function(i){return new(i||t)(te(si))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-toggle-button"]],hostAttrs:[1,"contents"],inputs:{isOpen:[1,"isOpen"]},outputs:{togglePanel:"togglePanel"},decls:2,vars:6,consts:[["id","legend-panel-button","data-testid","legend-panel-button","aria-controls","legend-panel",1,"btn","btn-primary","btn-sm","fixed","z-[60]","w-[88px]","rotate-90","rounded-t-none","transition-[right]","duration-300",3,"click","title"]],template:function(i,o){i&1&&(y(0,"button",0),Y("click",function(){return o.togglePanel.emit()}),g(1,` LEGEND
|
|
3416
|
-
`),
|
|
3417
|
-
`))},encapsulation:2,changeDetection:0})}}return t})();function w5(t,n){if(t&1&&(v(0,"span",4),g(1),b()),t&2){let e=n;yt(e.styleClass),h(),ge("\u0394",e.label)}}function y5(t,n){if(t&1&&(v(0,"span",2),L(1,"cc-metric-chooser-type",3),b(),v(2,"span",4),g(3),b(),O(4,w5,2,3,"span",5)),t&2){let e,i=n,o=A();h(),F("metricFor",o.metricFor()),h(2),qe(i.value),h(),z((e=i.delta)?4:-1,e)}}function S5(t,n){t&1&&(v(0,"span",1),g(1,"\xA0"),b())}var sl=(()=>{class t{constructor(){this.nodeSelectionService=q(mr),this.metricsBarReadStore=q(mt),this.metricFor=H.required(),this.node=D(this.nodeSelectionService.createNodeObservable()),this.primaryMetricNames=D(this.metricsBarReadStore.primaryMetricNames$),this.metricName=Z(()=>this.primaryMetricNames()?.[this.metricFor()]??null),this.display=Z(()=>C5(this.node(),this.metricName(),this.metricFor()))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-meta-value"]],inputs:{metricFor:[1,"metricFor"]},decls:3,vars:1,consts:[[1,"flex","items-center","justify-center","gap-1","text-xs","leading-tight","min-h-4"],["aria-hidden","true"],[1,"opacity-60"],[3,"metricFor"],[1,"font-medium"],[1,"font-medium",3,"class"]],template:function(i,o){if(i&1&&(v(0,"div",0),O(1,y5,5,3)(2,S5,2,0,"span",1),b()),i&2){let r;h(),z((r=o.display())?1:2,r)}},dependencies:[al],encapsulation:2,changeDetection:0})}}return t})();function C5(t,n,e){return!t||!n?null:{value:M5(t,n),delta:_5(t,n,e)}}function M5(t,n){let e=t.attributes?.[n];return typeof e=="number"?e.toLocaleString():"\u2014"}function _5(t,n,e){if(!("deltas"in t)||!t.deltas)return null;let i=t.deltas[n];return typeof i!="number"?null:{label:i.toLocaleString(),styleClass:E5(i,e)}}function E5(t,n){return n==="heightMetric"&&t>0?"text-success":t<0?"text-error":"text-base-content"}var k5=new Map([["complexity",["formerly mcc"]],["sonar_complexity",["formerly mcc"]]]),c1=(()=>{class t{transform(e,i){let o=this.normalizeString(i.trim()),r=this.splitIntoWords(o);return e.filter(a=>{let s=this.normalizeString(this.getDisplayName(a.name));return this.matchesSearch(s,r)})}normalizeString(e){return e.toLocaleLowerCase().replace(/[_\-\s]+/g," ")}splitIntoWords(e){return e.split(" ").filter(i=>i.length>0)}getDisplayName(e){let i=k5.get(e);return i?`${e} ${i.join(" ")}`:e}matchesSearch(e,i){return i.length===0?!0:i.every(o=>e.includes(o))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=Xi({name:"filterMetricDataBySearchTerm",type:t,pure:!0})}}return t})();function q5(t,n){t&1&&(y(0,"span",3),g(1,"(formerly mcc)"),S())}function T5(t,n){t&1&&(y(0,"span",4),g(1),S()),t&2&&(h(),qe(n))}var d1=(()=>{class t{constructor(){this.option=H.required(),this.isActive=H(!1),this.isSelected=H(!1),this.descriptor=H(null),this.selectOption=Ce(),this.hovered=Ce()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-select-option"]],hostAttrs:[1,"contents"],inputs:{option:[1,"option"],isActive:[1,"isActive"],isSelected:[1,"isSelected"],descriptor:[1,"descriptor"]},outputs:{selectOption:"selectOption",hovered:"hovered"},decls:9,vars:14,consts:[["type","button",1,"flex","items-center","justify-between","gap-2","w-full","px-2","py-1","rounded","border-0","text-left","cursor-pointer",3,"click","mouseenter","title"],[1,"flex","flex-col","items-start","gap-0.5","min-w-0","flex-1"],[1,"truncate","w-full"],[1,"text-xs","opacity-50"],[1,"text-xs","opacity-60","truncate","w-full"],[1,"text-xs","opacity-60","shrink-0"]],template:function(i,o){if(i&1&&(y(0,"button",0),rt(1,"attributeDescriptorTooltip"),Y("click",function(){return o.selectOption.emit(o.option().name)})("mouseenter",function(){return o.hovered.emit()}),y(2,"span",1)(3,"span",2),g(4),O(5,q5,2,0,"span",3),S(),O(6,T5,2,1,"span",4),S(),y(7,"span",5),g(8),S()()),i&2){let r;yt(o.isActive()?"bg-base-200":"bg-transparent hover:bg-base-200"),Le("font-semibold",o.isSelected()),le("title",gi(1,11,o.descriptor(),o.option().name)),dt("data-metric-name",o.option().name)("data-active",o.isActive()?"true":null),h(4),ge(" ",o.option().name," "),h(),z(o.option().name==="complexity"||o.option().name==="sonar_complexity"?5:-1),h(),z((r=(r=o.descriptor())==null?null:r.description)?6:-1,r),h(2),ge("(",o.option().maxValue,")")}},dependencies:[go],encapsulation:2,changeDetection:0})}}return t})();var I5=["searchInput"],D5=(t,n)=>n.name;function R5(t,n){if(t&1){let e=Me();v(0,"li",6)(1,"cc-metric-select-option",8),W("selectOption",function(o){ce(e);let r=A(2);return de(r.handleSelect(o))})("hovered",function(){let o=ce(e).$index,r=A(2);return de(r.activeIndex.set(o))}),b()()}if(t&2){let e=n.$implicit,i=n.$index,o=A(2);h(),F("option",e)("isActive",i===o.activeIndex())("isSelected",e.name===o.selected())("descriptor",o.attributeDescriptors()[e.name]??null)}}function A5(t,n){t&1&&(v(0,"li",7),g(1,"No metrics found"),b())}function F5(t,n){if(t&1&&(Pe(0,R5,2,4,"li",6,D5,!1,A5,2,0,"li",7),rt(3,"filterMetricDataBySearchTerm")),t&2){let e=A();Ne(gi(3,1,e.metricData(),e.searchTerm()))}}var pr=(()=>{class t{constructor(){this.metricsBarReadStore=q(mt),this.metricsLensFacade=q(zn),this.popoverId=H.required(),this.anchorName=H.required(),this.placeholder=H("Search metric"),this.kind=H("node"),this.selected=H(null),this.metricSelected=Ce(),this.shell=je.required(Wt),this.searchInput=je.required("searchInput"),this.searchTerm=be(""),this.activeIndex=be(0),this.isOpen=be(!1),this.metricDataState=D(this.metricsBarReadStore.metricData$,{initialValue:{nodeMetricData:[],edgeMetricData:[],nodeEdgeMetricsMap:new Map}}),this.attributeDescriptors=D(this.metricsLensFacade.descriptors$,{initialValue:{}}),this.metricData=Z(()=>{let e=this.metricDataState();return this.kind()==="edge"?e.edgeMetricData:e.nodeMetricData}),this.toggleListener=e=>{let i=e;this.isOpen.set(i.newState==="open"),i.newState==="open"&&(this.searchTerm.set(""),this.activeIndex.set(this.getSelectedMetricIndex()),queueMicrotask(()=>{this.searchInput().nativeElement.focus(),this.scrollActiveIntoView(this.popover().nativeElement)}))}}popover(){return this.shell().popover()}getSelectedMetricIndex(){let e=this.selected();if(!e)return 0;let i=this.metricData().findIndex(o=>o.name===e);return i===-1?0:i}ngAfterViewInit(){this.popover().nativeElement.addEventListener("toggle",this.toggleListener)}ngOnDestroy(){this.popover().nativeElement.removeEventListener("toggle",this.toggleListener)}handleSearchTermChange(e){this.searchTerm.set(e),this.activeIndex.set(0)}handleKeyDown(e){let i=this.popover().nativeElement,o=this.getFilteredItems(i);if(o.length!==0)switch(e.key){case"ArrowDown":e.preventDefault(),this.activeIndex.set(Math.min(o.length-1,this.activeIndex()+1)),this.scrollActiveIntoView(i);break;case"ArrowUp":e.preventDefault(),this.activeIndex.set(Math.max(0,this.activeIndex()-1)),this.scrollActiveIntoView(i);break;case"Enter":{e.preventDefault();let r=o[this.activeIndex()]?.dataset.metricName;r&&this.handleSelect(r);break}case"Escape":this.closePopover();break}}handleSelect(e){this.metricSelected.emit(e),this.closePopover()}closePopover(){let e=this.popover().nativeElement;e.matches(":popover-open")&&e.hidePopover()}getFilteredItems(e){return Array.from(e.querySelectorAll("[data-metric-name]"))}scrollActiveIntoView(e){this.getFilteredItems(e)[this.activeIndex()]?.scrollIntoView?.({block:"nearest"})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-select-popover"]],viewQuery:function(i,o){i&1&&tt(o.shell,Wt,5)(o.searchInput,I5,5),i&2&&it(2)},hostAttrs:[1,"contents"],inputs:{popoverId:[1,"popoverId"],anchorName:[1,"anchorName"],placeholder:[1,"placeholder"],kind:[1,"kind"],selected:[1,"selected"]},outputs:{metricSelected:"metricSelected"},decls:7,vars:6,consts:[["searchInput",""],["widthClass","w-80","contentClass","gap-2 p-2",3,"popoverId","anchorName","testId"],["aria-label","Search metrics",1,"input","input-sm","input-bordered","flex","items-center","gap-2"],[1,"fa","fa-search","opacity-60"],["type","text","autofocus","",1,"grow",3,"input","keydown","placeholder","value"],[1,"flex","flex-col","max-h-[440px]","overflow-y-auto","m-0","p-0","list-none"],[1,"flex"],[1,"px-2","py-3","text-xs","opacity-60"],[3,"selectOption","hovered","option","isActive","isSelected","descriptor"]],template:function(i,o){i&1&&(v(0,"cc-settings-popover-shell",1)(1,"label",2),L(2,"i",3),v(3,"input",4,0),W("input",function(a){return o.handleSearchTermChange(a.target.value)})("keydown",function(a){return o.handleKeyDown(a)}),b()(),v(5,"ul",5),O(6,F5,4,4),b()()),i&2&&(F("popoverId",o.popoverId())("anchorName",o.anchorName())("testId","metric-select-popover-"+o.anchorName()),h(3),F("placeholder",o.placeholder())("value",o.searchTerm()),h(3),z(o.isOpen()?6:-1))},dependencies:[co,Wt,d1,c1],encapsulation:2,changeDetection:0})}}return t})();var L5=["*"],ll=(()=>{class t{constructor(){this.label=H.required(),this.metricName=H(""),this.metricFor=H.required(),this.placeholder=H(""),this.searchPopoverId=H.required(),this.searchAnchorName=H.required(),this.settingsPopoverId=H.required(),this.settingsAnchorName=H.required(),this.testIdPrefix=H.required(),this.metricSelected=Ce()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-segment"]],hostAttrs:[1,"contents"],inputs:{label:[1,"label"],metricName:[1,"metricName"],metricFor:[1,"metricFor"],placeholder:[1,"placeholder"],searchPopoverId:[1,"searchPopoverId"],searchAnchorName:[1,"searchAnchorName"],settingsPopoverId:[1,"settingsPopoverId"],settingsAnchorName:[1,"settingsAnchorName"],testIdPrefix:[1,"testIdPrefix"]},outputs:{metricSelected:"metricSelected"},ngContentSelectors:L5,decls:5,vars:14,consts:[[3,"label","metricName","hasCog","cogPopoverId","cogAnchorName","searchPopoverId","searchAnchorName","testId","cogTestId"],["body","",1,"flex","flex-col","items-stretch","gap-1"],[3,"metricFor"],["kind","node",3,"metricSelected","popoverId","anchorName","placeholder","selected"]],template:function(i,o){i&1&&(Fm(),v(0,"cc-axis-card",0)(1,"div",1),L(2,"cc-metric-meta-value",2),b()(),v(3,"cc-metric-select-popover",3),W("metricSelected",function(a){return o.metricSelected.emit(a)}),b(),Lm(4)),i&2&&(F("label",o.label())("metricName",o.metricName())("hasCog",!0)("cogPopoverId",o.settingsPopoverId())("cogAnchorName",o.settingsAnchorName())("searchPopoverId",o.searchPopoverId())("searchAnchorName",o.searchAnchorName())("testId",o.testIdPrefix())("cogTestId",o.testIdPrefix()+"-cog"),h(2),F("metricFor",o.metricFor()),h(),F("popoverId",o.searchPopoverId())("anchorName",o.searchAnchorName())("placeholder",o.placeholder())("selected",o.metricName()))},dependencies:[lo,sl,pr],encapsulation:2,changeDetection:0})}}return t})();var h1=(()=>{class t{constructor(){this.searchPopoverId="metric-select-popover-area",this.searchAnchorName="metric-segment-area",this.settingsPopoverId="metric-settings-popover-area",this.settingsAnchorName="metric-segment-area-cog",this.mapStateReadWindow=q(ve),this.metricsBarWriteStore=q(Ze),this.areaMetric=D(this.mapStateReadWindow.areaMetric$,{initialValue:""})}handleMetricSelected(e){this.metricsBarWriteStore.setAreaMetric(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-area-segment"]],hostAttrs:[1,"contents"],decls:2,vars:7,consts:[["label","Area","metricFor","areaMetric","placeholder","Area Metric (highest value)","testIdPrefix","metric-segment-area",3,"metricSelected","metricName","searchPopoverId","searchAnchorName","settingsPopoverId","settingsAnchorName"],[3,"popoverId","anchorName"]],template:function(i,o){i&1&&(v(0,"cc-metric-segment",0),W("metricSelected",function(a){return o.handleMetricSelected(a)}),L(1,"cc-area-settings-popover",1),b()),i&2&&(F("metricName",o.areaMetric())("searchPopoverId",o.searchPopoverId)("searchAnchorName",o.searchAnchorName)("settingsPopoverId",o.settingsPopoverId)("settingsAnchorName",o.settingsAnchorName),h(),F("popoverId",o.settingsPopoverId)("anchorName",o.settingsAnchorName))},dependencies:[ll,l1],encapsulation:2,changeDetection:0})}}return t})();function P5(t,n){if(t&1&&(v(0,"span",3),g(1),b()),t&2){let e=A();h(),qe(e.count())}}var m1=(()=>{class t{constructor(e,i,o){this.mapStateReadWindow=e,this.metricsBarReadStore=i,this.metricsBarWriteStore=o,this.mapColorFor=H.required(),this.count=H(null),this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.colorRange=D(this.mapStateReadWindow.colorRange$,{initialValue:{from:0,to:0}}),this.nodeMetricRange=D(this.metricsBarReadStore.selectedColorMetricData$,{initialValue:{values:[],minValue:0,maxValue:0}}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Lt}),this.color=Z(()=>this.mapColors()[this.mapColorFor()])}handleColorChange(e){this.metricsBarWriteStore.setMapColors({[this.mapColorFor()]:e})}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(mt),te(Ze))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-color-band-row"]],inputs:{mapColorFor:[1,"mapColorFor"],count:[1,"count"]},decls:6,vars:9,consts:[[1,"flex","items-center","gap-2"],[3,"colorChange","hexColor","ariaLabel"],[1,"min-w-0","flex-1","truncate","text-sm"],[1,"text-xs","opacity-60","tabular-nums"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"cc-inline-color-picker",1),W("colorChange",function(a){return o.handleColorChange(a)}),b(),v(2,"span",2),g(3),rt(4,"mapColorLabel"),b(),O(5,P5,2,1,"span",3),b()),i&2&&(h(),F("hexColor",o.color())("ariaLabel","Recolor "+o.mapColorFor()),h(2),ge(" ",Aa(4,4,o.mapColorFor(),o.colorRange(),o.nodeMetricRange(),o.colorMetric())," "),h(2),z(o.count()!==null?5:-1))},dependencies:[ho,rl],encapsulation:2,changeDetection:0})}}return t})();function N5(t,n){if(t&1&&L(0,"cc-color-band-row",3)(1,"cc-color-band-row",4)(2,"cc-color-band-row",5),t&2){let e=A();F("count",e.colorCategoryCounts().positive),h(),F("count",e.colorCategoryCounts().neutral),h(),F("count",e.colorCategoryCounts().negative)}}function B5(t,n){t&1&&L(0,"cc-color-band-row",6)(1,"cc-color-band-row",7)}var p1=(()=>{class t{constructor(e,i){this.fileStoreReadWindow=e,this.colorCategoryCountsStore=i,this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.colorCategoryCounts=D(this.colorCategoryCountsStore.colorCategoryCounts$,{initialValue:{positive:0,neutral:0,negative:0}})}static{this.\u0275fac=function(i){return new(i||t)(te(Te),te(Xn))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-color-bands-section"]],hostAttrs:[1,"contents"],decls:6,vars:1,consts:[[1,"flex","flex-col","gap-1"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],["mapColorFor","selected"],["mapColorFor","positive",3,"count"],["mapColorFor","neutral",3,"count"],["mapColorFor","negative",3,"count"],["mapColorFor","positiveDelta"],["mapColorFor","negativeDelta"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Bands"),b(),O(3,N5,3,3)(4,B5,2,0),L(5,"cc-color-band-row",2),b()),i&2&&(h(3),z(o.isDeltaState()?4:3))},dependencies:[m1],encapsulation:2,changeDetection:0})}}return t})();function Oo(t,n){return t==null||n==null?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function Dd(t,n){return t==null||n==null?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function cl(t){let n,e,i;t.length!==2?(n=Oo,e=(s,l)=>Oo(t(s),l),i=(s,l)=>t(s)-l):(n=t===Oo||t===Dd?t:V5,e=t,i=t);function o(s,l,d=0,c=s.length){if(d<c){if(n(l,l)!==0)return c;do{let m=d+c>>>1;e(s[m],l)<0?d=m+1:c=m}while(d<c)}return d}function r(s,l,d=0,c=s.length){if(d<c){if(n(l,l)!==0)return c;do{let m=d+c>>>1;e(s[m],l)<=0?d=m+1:c=m}while(d<c)}return d}function a(s,l,d=0,c=s.length){let m=o(s,l,d,c-1);return m>d&&i(s[m-1],l)>-i(s[m],l)?m-1:m}return{left:o,center:a,right:r}}function V5(){return 0}function Rd(t){return t===null?NaN:+t}var u1=cl(Oo),f1=u1.right,W5=u1.left,O5=cl(Rd).center,Ad=f1;function dl(t,n){let e,i;if(n===void 0)for(let o of t)o!=null&&(e===void 0?o>=o&&(e=i=o):(e>o&&(e=o),i<o&&(i=o)));else{let o=-1;for(let r of t)(r=n(r,++o,t))!=null&&(e===void 0?r>=r&&(e=i=r):(e>r&&(e=r),i<r&&(i=r)))}return[e,i]}var z5=Math.sqrt(50),$5=Math.sqrt(10),j5=Math.sqrt(2);function hl(t,n,e){let i=(n-t)/Math.max(0,e),o=Math.floor(Math.log10(i)),r=i/Math.pow(10,o),a=r>=z5?10:r>=$5?5:r>=j5?2:1,s,l,d;return o<0?(d=Math.pow(10,-o)/a,s=Math.round(t*d),l=Math.round(n*d),s/d<t&&++s,l/d>n&&--l,d=-d):(d=Math.pow(10,o)*a,s=Math.round(t/d),l=Math.round(n/d),s*d<t&&++s,l*d>n&&--l),l<s&&.5<=e&&e<2?hl(t,n,e*2):[s,l,d]}function ml(t,n,e){if(n=+n,t=+t,e=+e,!(e>0))return[];if(t===n)return[t];let i=n<t,[o,r,a]=i?hl(n,t,e):hl(t,n,e);if(!(r>=o))return[];let s=r-o+1,l=new Array(s);if(i)if(a<0)for(let d=0;d<s;++d)l[d]=(r-d)/-a;else for(let d=0;d<s;++d)l[d]=(r-d)*a;else if(a<0)for(let d=0;d<s;++d)l[d]=(o+d)/-a;else for(let d=0;d<s;++d)l[d]=(o+d)*a;return l}function Hr(t,n,e){return n=+n,t=+t,e=+e,hl(t,n,e)[2]}function Fd(t,n,e){n=+n,t=+t,e=+e;let i=n<t,o=i?Hr(n,t,e):Hr(t,n,e);return(i?-1:1)*(o<0?1/-o:o)}function Ur(t,n){let e;if(n===void 0)for(let i of t)i!=null&&(e<i||e===void 0&&i>=i)&&(e=i);else{let i=-1;for(let o of t)(o=n(o,++i,t))!=null&&(e<o||e===void 0&&o>=o)&&(e=o)}return e}function g1(t){return t}var Ld=1,Pd=2,Nd=3,Gr=4,b1=1e-6;function H5(t){return"translate("+t+",0)"}function U5(t){return"translate(0,"+t+")"}function G5(t){return n=>+t(n)}function X5(t,n){return n=Math.max(0,t.bandwidth()-n*2)/2,t.round()&&(n=Math.round(n)),e=>+t(e)+n}function Q5(){return!this.__axis}function v1(t,n){var e=[],i=null,o=null,r=6,a=6,s=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,d=t===Ld||t===Gr?-1:1,c=t===Gr||t===Pd?"x":"y",m=t===Ld||t===Nd?H5:U5;function p(u){var k=i??(n.ticks?n.ticks.apply(n,e):n.domain()),E=o??(n.tickFormat?n.tickFormat.apply(n,e):g1),P=Math.max(r,0)+s,$=n.range(),ee=+$[0]+l,B=+$[$.length-1]+l,j=(n.bandwidth?X5:G5)(n.copy(),l),G=u.selection?u.selection():u,K=G.selectAll(".domain").data([null]),ie=G.selectAll(".tick").data(k,n).order(),oe=ie.exit(),ne=ie.enter().append("g").attr("class","tick"),_e=ie.select("line"),He=ie.select("text");K=K.merge(K.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),ie=ie.merge(ne),_e=_e.merge(ne.append("line").attr("stroke","currentColor").attr(c+"2",d*r)),He=He.merge(ne.append("text").attr("fill","currentColor").attr(c,d*P).attr("dy",t===Ld?"0em":t===Nd?"0.71em":"0.32em")),u!==G&&(K=K.transition(u),ie=ie.transition(u),_e=_e.transition(u),He=He.transition(u),oe=oe.transition(u).attr("opacity",b1).attr("transform",function(U){return isFinite(U=j(U))?m(U+l):this.getAttribute("transform")}),ne.attr("opacity",b1).attr("transform",function(U){var De=this.parentNode.__axis;return m((De&&isFinite(De=De(U))?De:j(U))+l)})),oe.remove(),K.attr("d",t===Gr||t===Pd?a?"M"+d*a+","+ee+"H"+l+"V"+B+"H"+d*a:"M"+l+","+ee+"V"+B:a?"M"+ee+","+d*a+"V"+l+"H"+B+"V"+d*a:"M"+ee+","+l+"H"+B),ie.attr("opacity",1).attr("transform",function(U){return m(j(U)+l)}),_e.attr(c+"2",d*r),He.attr(c,d*P).text(E),G.filter(Q5).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Pd?"start":t===Gr?"end":"middle"),G.each(function(){this.__axis=j})}return p.scale=function(u){return arguments.length?(n=u,p):n},p.ticks=function(){return e=Array.from(arguments),p},p.tickArguments=function(u){return arguments.length?(e=u==null?[]:Array.from(u),p):e.slice()},p.tickValues=function(u){return arguments.length?(i=u==null?null:Array.from(u),p):i&&i.slice()},p.tickFormat=function(u){return arguments.length?(o=u,p):o},p.tickSize=function(u){return arguments.length?(r=a=+u,p):r},p.tickSizeInner=function(u){return arguments.length?(r=+u,p):r},p.tickSizeOuter=function(u){return arguments.length?(a=+u,p):a},p.tickPadding=function(u){return arguments.length?(s=+u,p):s},p.offset=function(u){return arguments.length?(l=+u,p):l},p}function Bd(t){return v1(Nd,t)}function Vd(t){return v1(Gr,t)}var Y5={value:()=>{}};function w1(){for(var t=0,n=arguments.length,e={},i;t<n;++t){if(!(i=arguments[t]+"")||i in e||/[\s.]/.test(i))throw new Error("illegal type: "+i);e[i]=[]}return new pl(e)}function pl(t){this._=t}function Z5(t,n){return t.trim().split(/^|\s+/).map(function(e){var i="",o=e.indexOf(".");if(o>=0&&(i=e.slice(o+1),e=e.slice(0,o)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:i}})}pl.prototype=w1.prototype={constructor:pl,on:function(t,n){var e=this._,i=Z5(t+"",e),o,r=-1,a=i.length;if(arguments.length<2){for(;++r<a;)if((o=(t=i[r]).type)&&(o=K5(e[o],t.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++r<a;)if(o=(t=i[r]).type)e[o]=x1(e[o],t.name,n);else if(n==null)for(o in e)e[o]=x1(e[o],t.name,null);return this},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new pl(t)},call:function(t,n){if((o=arguments.length-2)>0)for(var e=new Array(o),i=0,o,r;i<o;++i)e[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],o=0,r=i.length;o<r;++o)i[o].value.apply(n,e)}};function K5(t,n){for(var e=0,i=t.length,o;e<i;++e)if((o=t[e]).name===n)return o.value}function x1(t,n,e){for(var i=0,o=t.length;i<o;++i)if(t[i].name===n){t[i]=Y5,t=t.slice(0,i).concat(t.slice(i+1));break}return e!=null&&t.push({name:n,value:e}),t}var Wd=w1;var ul="http://www.w3.org/1999/xhtml",Od={svg:"http://www.w3.org/2000/svg",xhtml:ul,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ni(t){var n=t+="",e=n.indexOf(":");return e>=0&&(n=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),Od.hasOwnProperty(n)?{space:Od[n],local:t}:t}function J5(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===ul&&n.documentElement.namespaceURI===ul?n.createElement(t):n.createElementNS(e,t)}}function e6(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function fl(t){var n=Ni(t);return(n.local?e6:J5)(n)}function t6(){}function zo(t){return t==null?t6:function(){return this.querySelector(t)}}function y1(t){typeof t!="function"&&(t=zo(t));for(var n=this._groups,e=n.length,i=new Array(e),o=0;o<e;++o)for(var r=n[o],a=r.length,s=i[o]=new Array(a),l,d,c=0;c<a;++c)(l=r[c])&&(d=t.call(l,l.__data__,c,r))&&("__data__"in l&&(d.__data__=l.__data__),s[c]=d);return new pt(i,this._parents)}function zd(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function i6(){return[]}function Xr(t){return t==null?i6:function(){return this.querySelectorAll(t)}}function o6(t){return function(){return zd(t.apply(this,arguments))}}function S1(t){typeof t=="function"?t=o6(t):t=Xr(t);for(var n=this._groups,e=n.length,i=[],o=[],r=0;r<e;++r)for(var a=n[r],s=a.length,l,d=0;d<s;++d)(l=a[d])&&(i.push(t.call(l,l.__data__,d,a)),o.push(l));return new pt(i,o)}function Qr(t){return function(){return this.matches(t)}}function gl(t){return function(n){return n.matches(t)}}var n6=Array.prototype.find;function r6(t){return function(){return n6.call(this.children,t)}}function a6(){return this.firstElementChild}function C1(t){return this.select(t==null?a6:r6(typeof t=="function"?t:gl(t)))}var s6=Array.prototype.filter;function l6(){return Array.from(this.children)}function c6(t){return function(){return s6.call(this.children,t)}}function M1(t){return this.selectAll(t==null?l6:c6(typeof t=="function"?t:gl(t)))}function _1(t){typeof t!="function"&&(t=Qr(t));for(var n=this._groups,e=n.length,i=new Array(e),o=0;o<e;++o)for(var r=n[o],a=r.length,s=i[o]=[],l,d=0;d<a;++d)(l=r[d])&&t.call(l,l.__data__,d,r)&&s.push(l);return new pt(i,this._parents)}function bl(t){return new Array(t.length)}function E1(){return new pt(this._enter||this._groups.map(bl),this._parents)}function Yr(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}Yr.prototype={constructor:Yr,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function k1(t){return function(){return t}}function d6(t,n,e,i,o,r){for(var a=0,s,l=n.length,d=r.length;a<d;++a)(s=n[a])?(s.__data__=r[a],i[a]=s):e[a]=new Yr(t,r[a]);for(;a<l;++a)(s=n[a])&&(o[a]=s)}function h6(t,n,e,i,o,r,a){var s,l,d=new Map,c=n.length,m=r.length,p=new Array(c),u;for(s=0;s<c;++s)(l=n[s])&&(p[s]=u=a.call(l,l.__data__,s,n)+"",d.has(u)?o[s]=l:d.set(u,l));for(s=0;s<m;++s)u=a.call(t,r[s],s,r)+"",(l=d.get(u))?(i[s]=l,l.__data__=r[s],d.delete(u)):e[s]=new Yr(t,r[s]);for(s=0;s<c;++s)(l=n[s])&&d.get(p[s])===l&&(o[s]=l)}function m6(t){return t.__data__}function q1(t,n){if(!arguments.length)return Array.from(this,m6);var e=n?h6:d6,i=this._parents,o=this._groups;typeof t!="function"&&(t=k1(t));for(var r=o.length,a=new Array(r),s=new Array(r),l=new Array(r),d=0;d<r;++d){var c=i[d],m=o[d],p=m.length,u=p6(t.call(c,c&&c.__data__,d,i)),k=u.length,E=s[d]=new Array(k),P=a[d]=new Array(k),$=l[d]=new Array(p);e(c,m,E,P,$,u,n);for(var ee=0,B=0,j,G;ee<k;++ee)if(j=E[ee]){for(ee>=B&&(B=ee+1);!(G=P[B])&&++B<k;);j._next=G||null}}return a=new pt(a,i),a._enter=s,a._exit=l,a}function p6(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function T1(){return new pt(this._exit||this._groups.map(bl),this._parents)}function I1(t,n,e){var i=this.enter(),o=this,r=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),n!=null&&(o=n(o),o&&(o=o.selection())),e==null?r.remove():e(r),i&&o?i.merge(o).order():o}function D1(t){for(var n=t.selection?t.selection():t,e=this._groups,i=n._groups,o=e.length,r=i.length,a=Math.min(o,r),s=new Array(o),l=0;l<a;++l)for(var d=e[l],c=i[l],m=d.length,p=s[l]=new Array(m),u,k=0;k<m;++k)(u=d[k]||c[k])&&(p[k]=u);for(;l<o;++l)s[l]=e[l];return new pt(s,this._parents)}function R1(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var i=t[n],o=i.length-1,r=i[o],a;--o>=0;)(a=i[o])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function A1(t){t||(t=u6);function n(m,p){return m&&p?t(m.__data__,p.__data__):!m-!p}for(var e=this._groups,i=e.length,o=new Array(i),r=0;r<i;++r){for(var a=e[r],s=a.length,l=o[r]=new Array(s),d,c=0;c<s;++c)(d=a[c])&&(l[c]=d);l.sort(n)}return new pt(o,this._parents).order()}function u6(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function F1(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function L1(){return Array.from(this)}function P1(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var i=t[n],o=0,r=i.length;o<r;++o){var a=i[o];if(a)return a}return null}function N1(){let t=0;for(let n of this)++t;return t}function B1(){return!this.node()}function V1(t){for(var n=this._groups,e=0,i=n.length;e<i;++e)for(var o=n[e],r=0,a=o.length,s;r<a;++r)(s=o[r])&&t.call(s,s.__data__,r,o);return this}function f6(t){return function(){this.removeAttribute(t)}}function g6(t){return function(){this.removeAttributeNS(t.space,t.local)}}function b6(t,n){return function(){this.setAttribute(t,n)}}function v6(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function x6(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}}function w6(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function W1(t,n){var e=Ni(t);if(arguments.length<2){var i=this.node();return e.local?i.getAttributeNS(e.space,e.local):i.getAttribute(e)}return this.each((n==null?e.local?g6:f6:typeof n=="function"?e.local?w6:x6:e.local?v6:b6)(e,n))}function vl(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function y6(t){return function(){this.style.removeProperty(t)}}function S6(t,n,e){return function(){this.style.setProperty(t,n,e)}}function C6(t,n,e){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,e)}}function O1(t,n,e){return arguments.length>1?this.each((n==null?y6:typeof n=="function"?C6:S6)(t,n,e??"")):vo(this.node(),t)}function vo(t,n){return t.style.getPropertyValue(n)||vl(t).getComputedStyle(t,null).getPropertyValue(n)}function M6(t){return function(){delete this[t]}}function _6(t,n){return function(){this[t]=n}}function E6(t,n){return function(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}}function z1(t,n){return arguments.length>1?this.each((n==null?M6:typeof n=="function"?E6:_6)(t,n)):this.node()[t]}function $1(t){return t.trim().split(/^|\s+/)}function $d(t){return t.classList||new j1(t)}function j1(t){this._node=t,this._names=$1(t.getAttribute("class")||"")}j1.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function H1(t,n){for(var e=$d(t),i=-1,o=n.length;++i<o;)e.add(n[i])}function U1(t,n){for(var e=$d(t),i=-1,o=n.length;++i<o;)e.remove(n[i])}function k6(t){return function(){H1(this,t)}}function q6(t){return function(){U1(this,t)}}function T6(t,n){return function(){(n.apply(this,arguments)?H1:U1)(this,t)}}function G1(t,n){var e=$1(t+"");if(arguments.length<2){for(var i=$d(this.node()),o=-1,r=e.length;++o<r;)if(!i.contains(e[o]))return!1;return!0}return this.each((typeof n=="function"?T6:n?k6:q6)(e,n))}function I6(){this.textContent=""}function D6(t){return function(){this.textContent=t}}function R6(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function X1(t){return arguments.length?this.each(t==null?I6:(typeof t=="function"?R6:D6)(t)):this.node().textContent}function A6(){this.innerHTML=""}function F6(t){return function(){this.innerHTML=t}}function L6(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function Q1(t){return arguments.length?this.each(t==null?A6:(typeof t=="function"?L6:F6)(t)):this.node().innerHTML}function P6(){this.nextSibling&&this.parentNode.appendChild(this)}function Y1(){return this.each(P6)}function N6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Z1(){return this.each(N6)}function K1(t){var n=typeof t=="function"?t:fl(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function B6(){return null}function J1(t,n){var e=typeof t=="function"?t:fl(t),i=n==null?B6:typeof n=="function"?n:zo(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),i.apply(this,arguments)||null)})}function V6(){var t=this.parentNode;t&&t.removeChild(this)}function e2(){return this.each(V6)}function W6(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function O6(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function t2(t){return this.select(t?O6:W6)}function i2(t){return arguments.length?this.property("__data__",t):this.node().__data__}function z6(t){return function(n){t.call(this,n,this.__data__)}}function $6(t){return t.trim().split(/^|\s+/).map(function(n){var e="",i=n.indexOf(".");return i>=0&&(e=n.slice(i+1),n=n.slice(0,i)),{type:n,name:e}})}function j6(t){return function(){var n=this.__on;if(n){for(var e=0,i=-1,o=n.length,r;e<o;++e)r=n[e],(!t.type||r.type===t.type)&&r.name===t.name?this.removeEventListener(r.type,r.listener,r.options):n[++i]=r;++i?n.length=i:delete this.__on}}}function H6(t,n,e){return function(){var i=this.__on,o,r=z6(n);if(i){for(var a=0,s=i.length;a<s;++a)if((o=i[a]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=r,o.options=e),o.value=n;return}}this.addEventListener(t.type,r,e),o={type:t.type,name:t.name,value:n,listener:r,options:e},i?i.push(o):this.__on=[o]}}function o2(t,n,e){var i=$6(t+""),o,r=i.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,d=s.length,c;l<d;++l)for(o=0,c=s[l];o<r;++o)if((a=i[o]).type===c.type&&a.name===c.name)return c.value}return}for(s=n?H6:j6,o=0;o<r;++o)this.each(s(i[o],n,e));return this}function n2(t,n,e){var i=vl(t),o=i.CustomEvent;typeof o=="function"?o=new o(n,e):(o=i.document.createEvent("Event"),e?(o.initEvent(n,e.bubbles,e.cancelable),o.detail=e.detail):o.initEvent(n,!1,!1)),t.dispatchEvent(o)}function U6(t,n){return function(){return n2(this,t,n)}}function G6(t,n){return function(){return n2(this,t,n.apply(this,arguments))}}function r2(t,n){return this.each((typeof n=="function"?G6:U6)(t,n))}function*a2(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var i=t[n],o=0,r=i.length,a;o<r;++o)(a=i[o])&&(yield a)}var jd=[null];function pt(t,n){this._groups=t,this._parents=n}function s2(){return new pt([[document.documentElement]],jd)}function X6(){return this}pt.prototype=s2.prototype={constructor:pt,select:y1,selectAll:S1,selectChild:C1,selectChildren:M1,filter:_1,data:q1,enter:E1,exit:T1,join:I1,merge:D1,selection:X6,order:R1,sort:A1,call:F1,nodes:L1,node:P1,size:N1,empty:B1,each:V1,attr:W1,style:O1,property:z1,classed:G1,text:X1,html:Q1,raise:Y1,lower:Z1,append:K1,insert:J1,remove:e2,clone:t2,datum:i2,on:o2,dispatch:r2,[Symbol.iterator]:a2};var Bi=s2;function Hd(t){return typeof t=="string"?new pt([[document.querySelector(t)]],[document.documentElement]):new pt([[t]],jd)}function l2(t){let n;for(;n=t.sourceEvent;)t=n;return t}function Ud(t,n){if(t=l2(t),n===void 0&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var i=e.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[t.clientX-o.left-n.clientLeft,t.clientY-o.top-n.clientTop]}}return[t.pageX,t.pageY]}function xl(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Gd(t,n){var e=Object.create(t.prototype);for(var i in n)e[i]=n[i];return e}function Jr(){}var Zr=.7,Sl=1/Zr,ur="\\s*([+-]?\\d+)\\s*",Kr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ti="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q6=/^#([0-9a-f]{3,8})$/,Y6=new RegExp(`^rgb\\(${ur},${ur},${ur}\\)$`),Z6=new RegExp(`^rgb\\(${Ti},${Ti},${Ti}\\)$`),K6=new RegExp(`^rgba\\(${ur},${ur},${ur},${Kr}\\)$`),J6=new RegExp(`^rgba\\(${Ti},${Ti},${Ti},${Kr}\\)$`),ey=new RegExp(`^hsl\\(${Kr},${Ti},${Ti}\\)$`),ty=new RegExp(`^hsla\\(${Kr},${Ti},${Ti},${Kr}\\)$`),c2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};xl(Jr,ci,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:d2,formatHex:d2,formatHex8:iy,formatHsl:oy,formatRgb:h2,toString:h2});function d2(){return this.rgb().formatHex()}function iy(){return this.rgb().formatHex8()}function oy(){return b2(this).formatHsl()}function h2(){return this.rgb().formatRgb()}function ci(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Q6.exec(t))?(e=n[1].length,n=parseInt(n[1],16),e===6?m2(n):e===3?new Ot(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):e===8?wl(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):e===4?wl(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Y6.exec(t))?new Ot(n[1],n[2],n[3],1):(n=Z6.exec(t))?new Ot(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=K6.exec(t))?wl(n[1],n[2],n[3],n[4]):(n=J6.exec(t))?wl(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=ey.exec(t))?f2(n[1],n[2]/100,n[3]/100,1):(n=ty.exec(t))?f2(n[1],n[2]/100,n[3]/100,n[4]):c2.hasOwnProperty(t)?m2(c2[t]):t==="transparent"?new Ot(NaN,NaN,NaN,0):null}function m2(t){return new Ot(t>>16&255,t>>8&255,t&255,1)}function wl(t,n,e,i){return i<=0&&(t=n=e=NaN),new Ot(t,n,e,i)}function ny(t){return t instanceof Jr||(t=ci(t)),t?(t=t.rgb(),new Ot(t.r,t.g,t.b,t.opacity)):new Ot}function fr(t,n,e,i){return arguments.length===1?ny(t):new Ot(t,n,e,i??1)}function Ot(t,n,e,i){this.r=+t,this.g=+n,this.b=+e,this.opacity=+i}xl(Ot,fr,Gd(Jr,{brighter(t){return t=t==null?Sl:Math.pow(Sl,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Zr:Math.pow(Zr,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ot(jo(this.r),jo(this.g),jo(this.b),Cl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:p2,formatHex:p2,formatHex8:ry,formatRgb:u2,toString:u2}));function p2(){return`#${$o(this.r)}${$o(this.g)}${$o(this.b)}`}function ry(){return`#${$o(this.r)}${$o(this.g)}${$o(this.b)}${$o((isNaN(this.opacity)?1:this.opacity)*255)}`}function u2(){let t=Cl(this.opacity);return`${t===1?"rgb(":"rgba("}${jo(this.r)}, ${jo(this.g)}, ${jo(this.b)}${t===1?")":`, ${t})`}`}function Cl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function jo(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function $o(t){return t=jo(t),(t<16?"0":"")+t.toString(16)}function f2(t,n,e,i){return i<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new li(t,n,e,i)}function b2(t){if(t instanceof li)return new li(t.h,t.s,t.l,t.opacity);if(t instanceof Jr||(t=ci(t)),!t)return new li;if(t instanceof li)return t;t=t.rgb();var n=t.r/255,e=t.g/255,i=t.b/255,o=Math.min(n,e,i),r=Math.max(n,e,i),a=NaN,s=r-o,l=(r+o)/2;return s?(n===r?a=(e-i)/s+(e<i)*6:e===r?a=(i-n)/s+2:a=(n-e)/s+4,s/=l<.5?r+o:2-r-o,a*=60):s=l>0&&l<1?0:a,new li(a,s,l,t.opacity)}function v2(t,n,e,i){return arguments.length===1?b2(t):new li(t,n,e,i??1)}function li(t,n,e,i){this.h=+t,this.s=+n,this.l=+e,this.opacity=+i}xl(li,v2,Gd(Jr,{brighter(t){return t=t==null?Sl:Math.pow(Sl,t),new li(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Zr:Math.pow(Zr,t),new li(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*n,o=2*e-i;return new Ot(Xd(t>=240?t-240:t+120,o,i),Xd(t,o,i),Xd(t<120?t+240:t-120,o,i),this.opacity)},clamp(){return new li(g2(this.h),yl(this.s),yl(this.l),Cl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Cl(this.opacity);return`${t===1?"hsl(":"hsla("}${g2(this.h)}, ${yl(this.s)*100}%, ${yl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function g2(t){return t=(t||0)%360,t<0?t+360:t}function yl(t){return Math.max(0,Math.min(1,t||0))}function Xd(t,n,e){return(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)*255}function Qd(t,n,e,i,o){var r=t*t,a=r*t;return((1-3*t+3*r-a)*n+(4-6*r+3*a)*e+(1+3*t+3*r-3*a)*i+a*o)/6}function x2(t){var n=t.length-1;return function(e){var i=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),o=t[i],r=t[i+1],a=i>0?t[i-1]:2*o-r,s=i<n-1?t[i+2]:2*r-o;return Qd((e-i/n)*n,a,o,r,s)}}function w2(t){var n=t.length;return function(e){var i=Math.floor(((e%=1)<0?++e:e)*n),o=t[(i+n-1)%n],r=t[i%n],a=t[(i+1)%n],s=t[(i+2)%n];return Qd((e-i/n)*n,o,r,a,s)}}var ea=t=>()=>t;function ay(t,n){return function(e){return t+e*n}}function sy(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(i){return Math.pow(t+i*n,e)}}function y2(t){return(t=+t)==1?Ml:function(n,e){return e-n?sy(n,e,t):ea(isNaN(n)?e:n)}}function Ml(t,n){var e=n-t;return e?ay(t,e):ea(isNaN(t)?n:t)}var Ho=(function t(n){var e=y2(n);function i(o,r){var a=e((o=fr(o)).r,(r=fr(r)).r),s=e(o.g,r.g),l=e(o.b,r.b),d=Ml(o.opacity,r.opacity);return function(c){return o.r=a(c),o.g=s(c),o.b=l(c),o.opacity=d(c),o+""}}return i.gamma=t,i})(1);function S2(t){return function(n){var e=n.length,i=new Array(e),o=new Array(e),r=new Array(e),a,s;for(a=0;a<e;++a)s=fr(n[a]),i[a]=s.r||0,o[a]=s.g||0,r[a]=s.b||0;return i=t(i),o=t(o),r=t(r),s.opacity=1,function(l){return s.r=i(l),s.g=o(l),s.b=r(l),s+""}}}var ly=S2(x2),cy=S2(w2);function C2(t,n){n||(n=[]);var e=t?Math.min(n.length,t.length):0,i=n.slice(),o;return function(r){for(o=0;o<e;++o)i[o]=t[o]*(1-r)+n[o]*r;return i}}function M2(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function _2(t,n){var e=n?n.length:0,i=t?Math.min(e,t.length):0,o=new Array(i),r=new Array(e),a;for(a=0;a<i;++a)o[a]=Uo(t[a],n[a]);for(;a<e;++a)r[a]=n[a];return function(s){for(a=0;a<i;++a)r[a]=o[a](s);return r}}function E2(t,n){var e=new Date;return t=+t,n=+n,function(i){return e.setTime(t*(1-i)+n*i),e}}function St(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function k2(t,n){var e={},i={},o;(t===null||typeof t!="object")&&(t={}),(n===null||typeof n!="object")&&(n={});for(o in n)o in t?e[o]=Uo(t[o],n[o]):i[o]=n[o];return function(r){for(o in e)i[o]=e[o](r);return i}}var Zd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yd=new RegExp(Zd.source,"g");function dy(t){return function(){return t}}function hy(t){return function(n){return t(n)+""}}function ta(t,n){var e=Zd.lastIndex=Yd.lastIndex=0,i,o,r,a=-1,s=[],l=[];for(t=t+"",n=n+"";(i=Zd.exec(t))&&(o=Yd.exec(n));)(r=o.index)>e&&(r=n.slice(e,r),s[a]?s[a]+=r:s[++a]=r),(i=i[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:St(i,o)})),e=Yd.lastIndex;return e<n.length&&(r=n.slice(e),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?hy(l[0].x):dy(n):(n=l.length,function(d){for(var c=0,m;c<n;++c)s[(m=l[c]).i]=m.x(d);return s.join("")})}function Uo(t,n){var e=typeof n,i;return n==null||e==="boolean"?ea(n):(e==="number"?St:e==="string"?(i=ci(n))?(n=i,Ho):ta:n instanceof ci?Ho:n instanceof Date?E2:M2(n)?C2:Array.isArray(n)?_2:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?k2:St)(t,n)}function Kd(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}var q2=180/Math.PI,_l={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Jd(t,n,e,i,o,r){var a,s,l;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(l=t*e+n*i)&&(e-=t*l,i-=n*l),(s=Math.sqrt(e*e+i*i))&&(e/=s,i/=s,l/=s),t*i<n*e&&(t=-t,n=-n,l=-l,a=-a),{translateX:o,translateY:r,rotate:Math.atan2(n,t)*q2,skewX:Math.atan(l)*q2,scaleX:a,scaleY:s}}var El;function T2(t){let n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?_l:Jd(n.a,n.b,n.c,n.d,n.e,n.f)}function I2(t){return t==null?_l:(El||(El=document.createElementNS("http://www.w3.org/2000/svg","g")),El.setAttribute("transform",t),(t=El.transform.baseVal.consolidate())?(t=t.matrix,Jd(t.a,t.b,t.c,t.d,t.e,t.f)):_l)}function D2(t,n,e,i){function o(d){return d.length?d.pop()+" ":""}function r(d,c,m,p,u,k){if(d!==m||c!==p){var E=u.push("translate(",null,n,null,e);k.push({i:E-4,x:St(d,m)},{i:E-2,x:St(c,p)})}else(m||p)&&u.push("translate("+m+n+p+e)}function a(d,c,m,p){d!==c?(d-c>180?c+=360:c-d>180&&(d+=360),p.push({i:m.push(o(m)+"rotate(",null,i)-2,x:St(d,c)})):c&&m.push(o(m)+"rotate("+c+i)}function s(d,c,m,p){d!==c?p.push({i:m.push(o(m)+"skewX(",null,i)-2,x:St(d,c)}):c&&m.push(o(m)+"skewX("+c+i)}function l(d,c,m,p,u,k){if(d!==m||c!==p){var E=u.push(o(u)+"scale(",null,",",null,")");k.push({i:E-4,x:St(d,m)},{i:E-2,x:St(c,p)})}else(m!==1||p!==1)&&u.push(o(u)+"scale("+m+","+p+")")}return function(d,c){var m=[],p=[];return d=t(d),c=t(c),r(d.translateX,d.translateY,c.translateX,c.translateY,m,p),a(d.rotate,c.rotate,m,p),s(d.skewX,c.skewX,m,p),l(d.scaleX,d.scaleY,c.scaleX,c.scaleY,m,p),d=c=null,function(u){for(var k=-1,E=p.length,P;++k<E;)m[(P=p[k]).i]=P.x(u);return m.join("")}}}var eh=D2(T2,"px, ","px)","deg)"),th=D2(I2,", ",")",")");var gr=0,oa=0,ia=0,A2=1e3,kl,na,ql=0,Go=0,Tl=0,ra=typeof performance=="object"&&performance.now?performance:Date,F2=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function sa(){return Go||(F2(my),Go=ra.now()+Tl)}function my(){Go=0}function aa(){this._call=this._time=this._next=null}aa.prototype=Il.prototype={constructor:aa,restart:function(t,n,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?sa():+e)+(n==null?0:+n),!this._next&&na!==this&&(na?na._next=this:kl=this,na=this),this._call=t,this._time=e,ih()},stop:function(){this._call&&(this._call=null,this._time=1/0,ih())}};function Il(t,n,e){var i=new aa;return i.restart(t,n,e),i}function L2(){sa(),++gr;for(var t=kl,n;t;)(n=Go-t._time)>=0&&t._call.call(void 0,n),t=t._next;--gr}function R2(){Go=(ql=ra.now())+Tl,gr=oa=0;try{L2()}finally{gr=0,uy(),Go=0}}function py(){var t=ra.now(),n=t-ql;n>A2&&(Tl-=n,ql=t)}function uy(){for(var t,n=kl,e,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:kl=e);na=t,ih(i)}function ih(t){if(!gr){oa&&(oa=clearTimeout(oa));var n=t-Go;n>24?(t<1/0&&(oa=setTimeout(R2,t-ra.now()-Tl)),ia&&(ia=clearInterval(ia))):(ia||(ql=ra.now(),ia=setInterval(py,A2)),gr=1,F2(R2))}}function Dl(t,n,e){var i=new aa;return n=n==null?0:+n,i.restart(o=>{i.stop(),t(o+n)},n,e),i}var fy=Wd("start","end","cancel","interrupt"),gy=[],B2=0,P2=1,Al=2,Rl=3,N2=4,Fl=5,la=6;function xo(t,n,e,i,o,r){var a=t.__transition;if(!a)t.__transition={};else if(e in a)return;by(t,e,{name:n,index:i,group:o,on:fy,tween:gy,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:B2})}function ca(t,n){var e=bt(t,n);if(e.state>B2)throw new Error("too late; already scheduled");return e}function Ct(t,n){var e=bt(t,n);if(e.state>Rl)throw new Error("too late; already running");return e}function bt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function by(t,n,e){var i=t.__transition,o;i[n]=e,e.timer=Il(r,0,e.time);function r(d){e.state=P2,e.timer.restart(a,e.delay,e.time),e.delay<=d&&a(d-e.delay)}function a(d){var c,m,p,u;if(e.state!==P2)return l();for(c in i)if(u=i[c],u.name===e.name){if(u.state===Rl)return Dl(a);u.state===N2?(u.state=la,u.timer.stop(),u.on.call("interrupt",t,t.__data__,u.index,u.group),delete i[c]):+c<n&&(u.state=la,u.timer.stop(),u.on.call("cancel",t,t.__data__,u.index,u.group),delete i[c])}if(Dl(function(){e.state===Rl&&(e.state=N2,e.timer.restart(s,e.delay,e.time),s(d))}),e.state=Al,e.on.call("start",t,t.__data__,e.index,e.group),e.state===Al){for(e.state=Rl,o=new Array(p=e.tween.length),c=0,m=-1;c<p;++c)(u=e.tween[c].value.call(t,t.__data__,e.index,e.group))&&(o[++m]=u);o.length=m+1}}function s(d){for(var c=d<e.duration?e.ease.call(null,d/e.duration):(e.timer.restart(l),e.state=Fl,1),m=-1,p=o.length;++m<p;)o[m].call(t,c);e.state===Fl&&(e.on.call("end",t,t.__data__,e.index,e.group),l())}function l(){e.state=la,e.timer.stop(),delete i[n];for(var d in i)return;delete t.__transition}}function Ll(t,n){var e=t.__transition,i,o,r=!0,a;if(e){n=n==null?null:n+"";for(a in e){if((i=e[a]).name!==n){r=!1;continue}o=i.state>Al&&i.state<Fl,i.state=la,i.timer.stop(),i.on.call(o?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete e[a]}r&&delete t.__transition}}function V2(t){return this.each(function(){Ll(this,t)})}function vy(t,n){var e,i;return function(){var o=Ct(this,t),r=o.tween;if(r!==e){i=e=r;for(var a=0,s=i.length;a<s;++a)if(i[a].name===n){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function xy(t,n,e){var i,o;if(typeof e!="function")throw new Error;return function(){var r=Ct(this,t),a=r.tween;if(a!==i){o=(i=a).slice();for(var s={name:n,value:e},l=0,d=o.length;l<d;++l)if(o[l].name===n){o[l]=s;break}l===d&&o.push(s)}r.tween=o}}function W2(t,n){var e=this._id;if(t+="",arguments.length<2){for(var i=bt(this.node(),e).tween,o=0,r=i.length,a;o<r;++o)if((a=i[o]).name===t)return a.value;return null}return this.each((n==null?vy:xy)(e,t,n))}function br(t,n,e){var i=t._id;return t.each(function(){var o=Ct(this,i);(o.value||(o.value={}))[n]=e.apply(this,arguments)}),function(o){return bt(o,i).value[n]}}function Pl(t,n){var e;return(typeof n=="number"?St:n instanceof ci?Ho:(e=ci(n))?(n=e,Ho):ta)(t,n)}function wy(t){return function(){this.removeAttribute(t)}}function yy(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Sy(t,n,e){var i,o=e+"",r;return function(){var a=this.getAttribute(t);return a===o?null:a===i?r:r=n(i=a,e)}}function Cy(t,n,e){var i,o=e+"",r;return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===i?r:r=n(i=a,e)}}function My(t,n,e){var i,o,r;return function(){var a,s=e(this),l;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),l=s+"",a===l?null:a===i&&l===o?r:(o=l,r=n(i=a,s)))}}function _y(t,n,e){var i,o,r;return function(){var a,s=e(this),l;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),l=s+"",a===l?null:a===i&&l===o?r:(o=l,r=n(i=a,s)))}}function O2(t,n){var e=Ni(t),i=e==="transform"?th:Pl;return this.attrTween(t,typeof n=="function"?(e.local?_y:My)(e,i,br(this,"attr."+t,n)):n==null?(e.local?yy:wy)(e):(e.local?Cy:Sy)(e,i,n))}function Ey(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function ky(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function qy(t,n){var e,i;function o(){var r=n.apply(this,arguments);return r!==i&&(e=(i=r)&&ky(t,r)),e}return o._value=n,o}function Ty(t,n){var e,i;function o(){var r=n.apply(this,arguments);return r!==i&&(e=(i=r)&&Ey(t,r)),e}return o._value=n,o}function z2(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;var i=Ni(t);return this.tween(e,(i.local?qy:Ty)(i,n))}function Iy(t,n){return function(){ca(this,t).delay=+n.apply(this,arguments)}}function Dy(t,n){return n=+n,function(){ca(this,t).delay=n}}function $2(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?Iy:Dy)(n,t)):bt(this.node(),n).delay}function Ry(t,n){return function(){Ct(this,t).duration=+n.apply(this,arguments)}}function Ay(t,n){return n=+n,function(){Ct(this,t).duration=n}}function j2(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?Ry:Ay)(n,t)):bt(this.node(),n).duration}function Fy(t,n){if(typeof n!="function")throw new Error;return function(){Ct(this,t).ease=n}}function H2(t){var n=this._id;return arguments.length?this.each(Fy(n,t)):bt(this.node(),n).ease}function Ly(t,n){return function(){var e=n.apply(this,arguments);if(typeof e!="function")throw new Error;Ct(this,t).ease=e}}function U2(t){if(typeof t!="function")throw new Error;return this.each(Ly(this._id,t))}function G2(t){typeof t!="function"&&(t=Qr(t));for(var n=this._groups,e=n.length,i=new Array(e),o=0;o<e;++o)for(var r=n[o],a=r.length,s=i[o]=[],l,d=0;d<a;++d)(l=r[d])&&t.call(l,l.__data__,d,r)&&s.push(l);return new Rt(i,this._parents,this._name,this._id)}function X2(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,i=n.length,o=e.length,r=Math.min(i,o),a=new Array(i),s=0;s<r;++s)for(var l=n[s],d=e[s],c=l.length,m=a[s]=new Array(c),p,u=0;u<c;++u)(p=l[u]||d[u])&&(m[u]=p);for(;s<i;++s)a[s]=n[s];return new Rt(a,this._parents,this._name,this._id)}function Py(t){return(t+"").trim().split(/^|\s+/).every(function(n){var e=n.indexOf(".");return e>=0&&(n=n.slice(0,e)),!n||n==="start"})}function Ny(t,n,e){var i,o,r=Py(n)?ca:Ct;return function(){var a=r(this,t),s=a.on;s!==i&&(o=(i=s).copy()).on(n,e),a.on=o}}function Q2(t,n){var e=this._id;return arguments.length<2?bt(this.node(),e).on.on(t):this.each(Ny(e,t,n))}function By(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function Y2(){return this.on("end.remove",By(this._id))}function Z2(t){var n=this._name,e=this._id;typeof t!="function"&&(t=zo(t));for(var i=this._groups,o=i.length,r=new Array(o),a=0;a<o;++a)for(var s=i[a],l=s.length,d=r[a]=new Array(l),c,m,p=0;p<l;++p)(c=s[p])&&(m=t.call(c,c.__data__,p,s))&&("__data__"in c&&(m.__data__=c.__data__),d[p]=m,xo(d[p],n,e,p,d,bt(c,e)));return new Rt(r,this._parents,n,e)}function K2(t){var n=this._name,e=this._id;typeof t!="function"&&(t=Xr(t));for(var i=this._groups,o=i.length,r=[],a=[],s=0;s<o;++s)for(var l=i[s],d=l.length,c,m=0;m<d;++m)if(c=l[m]){for(var p=t.call(c,c.__data__,m,l),u,k=bt(c,e),E=0,P=p.length;E<P;++E)(u=p[E])&&xo(u,n,e,E,p,k);r.push(p),a.push(c)}return new Rt(r,a,n,e)}var Vy=Bi.prototype.constructor;function J2(){return new Vy(this._groups,this._parents)}function Wy(t,n){var e,i,o;return function(){var r=vo(this,t),a=(this.style.removeProperty(t),vo(this,t));return r===a?null:r===e&&a===i?o:o=n(e=r,i=a)}}function eb(t){return function(){this.style.removeProperty(t)}}function Oy(t,n,e){var i,o=e+"",r;return function(){var a=vo(this,t);return a===o?null:a===i?r:r=n(i=a,e)}}function zy(t,n,e){var i,o,r;return function(){var a=vo(this,t),s=e(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(t),vo(this,t))),a===l?null:a===i&&l===o?r:(o=l,r=n(i=a,s))}}function $y(t,n){var e,i,o,r="style."+n,a="end."+r,s;return function(){var l=Ct(this,t),d=l.on,c=l.value[r]==null?s||(s=eb(n)):void 0;(d!==e||o!==c)&&(i=(e=d).copy()).on(a,o=c),l.on=i}}function tb(t,n,e){var i=(t+="")=="transform"?eh:Pl;return n==null?this.styleTween(t,Wy(t,i)).on("end.style."+t,eb(t)):typeof n=="function"?this.styleTween(t,zy(t,i,br(this,"style."+t,n))).each($y(this._id,t)):this.styleTween(t,Oy(t,i,n),e).on("end.style."+t,null)}function jy(t,n,e){return function(i){this.style.setProperty(t,n.call(this,i),e)}}function Hy(t,n,e){var i,o;function r(){var a=n.apply(this,arguments);return a!==o&&(i=(o=a)&&jy(t,a,e)),i}return r._value=n,r}function ib(t,n,e){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,Hy(t,n,e??""))}function Uy(t){return function(){this.textContent=t}}function Gy(t){return function(){var n=t(this);this.textContent=n??""}}function ob(t){return this.tween("text",typeof t=="function"?Gy(br(this,"text",t)):Uy(t==null?"":t+""))}function Xy(t){return function(n){this.textContent=t.call(this,n)}}function Qy(t){var n,e;function i(){var o=t.apply(this,arguments);return o!==e&&(n=(e=o)&&Xy(o)),n}return i._value=t,i}function nb(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,Qy(t))}function rb(){for(var t=this._name,n=this._id,e=Nl(),i=this._groups,o=i.length,r=0;r<o;++r)for(var a=i[r],s=a.length,l,d=0;d<s;++d)if(l=a[d]){var c=bt(l,n);xo(l,t,e,d,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Rt(i,this._parents,t,e)}function ab(){var t,n,e=this,i=e._id,o=e.size();return new Promise(function(r,a){var s={value:a},l={value:function(){--o===0&&r()}};e.each(function(){var d=Ct(this,i),c=d.on;c!==t&&(n=(t=c).copy(),n._.cancel.push(s),n._.interrupt.push(s),n._.end.push(l)),d.on=n}),o===0&&r()})}var Yy=0;function Rt(t,n,e,i){this._groups=t,this._parents=n,this._name=e,this._id=i}function sb(t){return Bi().transition(t)}function Nl(){return++Yy}var Vi=Bi.prototype;Rt.prototype=sb.prototype={constructor:Rt,select:Z2,selectAll:K2,selectChild:Vi.selectChild,selectChildren:Vi.selectChildren,filter:G2,merge:X2,selection:J2,transition:rb,call:Vi.call,nodes:Vi.nodes,node:Vi.node,size:Vi.size,empty:Vi.empty,each:Vi.each,on:Q2,attr:O2,attrTween:z2,style:tb,styleTween:ib,text:ob,textTween:nb,remove:Y2,tween:W2,delay:$2,duration:j2,ease:H2,easeVarying:U2,end:ab,[Symbol.iterator]:Vi[Symbol.iterator]};function Bl(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Zy={time:null,delay:0,duration:250,ease:Bl};function Ky(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}function lb(t){var n,e;t instanceof Rt?(n=t._id,t=t._name):(n=Nl(),(e=Zy).time=sa(),t=t==null?null:t+"");for(var i=this._groups,o=i.length,r=0;r<o;++r)for(var a=i[r],s=a.length,l,d=0;d<s;++d)(l=a[d])&&xo(l,t,n,d,a,e||Ky(l,n));return new Rt(i,this._parents,t,n)}Bi.prototype.interrupt=V2;Bi.prototype.transition=lb;var{abs:XW,max:QW,min:YW}=Math;function cb(t){return[+t[0],+t[1]]}function Jy(t){return[cb(t[0]),cb(t[1])]}var ZW={name:"x",handles:["w","e"].map(oh),input:function(t,n){return t==null?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},KW={name:"y",handles:["n","s"].map(oh),input:function(t,n){return t==null?null:[[n[0][0],+t[0]],[n[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},JW={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(oh),input:function(t){return t==null?null:Jy(t)},output:function(t){return t}};function oh(t){return{type:t}}var nh=Math.PI,rh=2*nh,Xo=1e-6,eS=rh-Xo;function db(t){this._+=t[0];for(let n=1,e=t.length;n<e;++n)this._+=arguments[n]+t[n]}function tS(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return db;let e=10**n;return function(i){this._+=i[0];for(let o=1,r=i.length;o<r;++o)this._+=Math.round(arguments[o]*e)/e+i[o]}}var Qo=class{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?db:tS(n)}moveTo(n,e){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,e){this._append`L${this._x1=+n},${this._y1=+e}`}quadraticCurveTo(n,e,i,o){this._append`Q${+n},${+e},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(n,e,i,o,r,a){this._append`C${+n},${+e},${+i},${+o},${this._x1=+r},${this._y1=+a}`}arcTo(n,e,i,o,r){if(n=+n,e=+e,i=+i,o=+o,r=+r,r<0)throw new Error(`negative radius: ${r}`);let a=this._x1,s=this._y1,l=i-n,d=o-e,c=a-n,m=s-e,p=c*c+m*m;if(this._x1===null)this._append`M${this._x1=n},${this._y1=e}`;else if(p>Xo)if(!(Math.abs(m*l-d*c)>Xo)||!r)this._append`L${this._x1=n},${this._y1=e}`;else{let u=i-a,k=o-s,E=l*l+d*d,P=u*u+k*k,$=Math.sqrt(E),ee=Math.sqrt(p),B=r*Math.tan((nh-Math.acos((E+p-P)/(2*$*ee)))/2),j=B/ee,G=B/$;Math.abs(j-1)>Xo&&this._append`L${n+j*c},${e+j*m}`,this._append`A${r},${r},0,0,${+(m*u>c*k)},${this._x1=n+G*l},${this._y1=e+G*d}`}}arc(n,e,i,o,r,a){if(n=+n,e=+e,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let s=i*Math.cos(o),l=i*Math.sin(o),d=n+s,c=e+l,m=1^a,p=a?o-r:r-o;this._x1===null?this._append`M${d},${c}`:(Math.abs(this._x1-d)>Xo||Math.abs(this._y1-c)>Xo)&&this._append`L${d},${c}`,i&&(p<0&&(p=p%rh+rh),p>eS?this._append`A${i},${i},0,1,${m},${n-s},${e-l}A${i},${i},0,1,${m},${this._x1=d},${this._y1=c}`:p>Xo&&this._append`A${i},${i},0,${+(p>=nh)},${m},${this._x1=n+i*Math.cos(r)},${this._y1=e+i*Math.sin(r)}`)}rect(n,e,i,o){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}};function hb(){return new Qo}hb.prototype=Qo.prototype;function mb(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Yo(t,n){if(!isFinite(t)||t===0)return null;var e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"),i=t.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+t.slice(e+1)]}function Ii(t){return t=Yo(Math.abs(t)),t?t[1]:NaN}function pb(t,n){return function(e,i){for(var o=e.length,r=[],a=0,s=t[0],l=0;o>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),r.push(e.substring(o-=s,o+s)),!((l+=s+1)>i));)s=t[a=(a+1)%t.length];return r.reverse().join(n)}}function ub(t){return function(n){return n.replace(/[0-9]/g,function(e){return t[+e]})}}var iS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wo(t){if(!(n=iS.exec(t)))throw new Error("invalid format: "+t);var n;return new Vl({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}wo.prototype=Vl.prototype;function Vl(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Vl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function fb(t){e:for(var n=t.length,e=1,i=-1,o;e<n;++e)switch(t[e]){case".":i=o=e;break;case"0":i===0&&(i=e),o=e;break;default:if(!+t[e])break e;i>0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(o+1):t}var da;function gb(t,n){var e=Yo(t,n);if(!e)return da=void 0,t.toPrecision(n);var i=e[0],o=e[1],r=o-(da=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,a=i.length;return r===a?i:r>a?i+new Array(r-a+1).join("0"):r>0?i.slice(0,r)+"."+i.slice(r):"0."+new Array(1-r).join("0")+Yo(t,Math.max(0,n+r-1))[0]}function ah(t,n){var e=Yo(t,n);if(!e)return t+"";var i=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}var sh={"%":(t,n)=>(t*100).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:mb,e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>ah(t*100,n),r:ah,s:gb,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function lh(t){return t}var bb=Array.prototype.map,vb=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function xb(t){var n=t.grouping===void 0||t.thousands===void 0?lh:pb(bb.call(t.grouping,Number),t.thousands+""),e=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",o=t.decimal===void 0?".":t.decimal+"",r=t.numerals===void 0?lh:ub(bb.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"\u2212":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function d(m,p){m=wo(m);var u=m.fill,k=m.align,E=m.sign,P=m.symbol,$=m.zero,ee=m.width,B=m.comma,j=m.precision,G=m.trim,K=m.type;K==="n"?(B=!0,K="g"):sh[K]||(j===void 0&&(j=12),G=!0,K="g"),($||u==="0"&&k==="=")&&($=!0,u="0",k="=");var ie=(p&&p.prefix!==void 0?p.prefix:"")+(P==="$"?e:P==="#"&&/[boxX]/.test(K)?"0"+K.toLowerCase():""),oe=(P==="$"?i:/[%p]/.test(K)?a:"")+(p&&p.suffix!==void 0?p.suffix:""),ne=sh[K],_e=/[defgprs%]/.test(K);j=j===void 0?6:/[gprs]/.test(K)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function He(U){var De=ie,Ee=oe,Ve,We,ue;if(K==="c")Ee=ne(U)+Ee,U="";else{U=+U;var J=U<0||1/U<0;if(U=isNaN(U)?l:ne(Math.abs(U),j),G&&(U=fb(U)),J&&+U==0&&E!=="+"&&(J=!1),De=(J?E==="("?E:s:E==="-"||E==="("?"":E)+De,Ee=(K==="s"&&!isNaN(U)&&da!==void 0?vb[8+da/3]:"")+Ee+(J&&E==="("?")":""),_e){for(Ve=-1,We=U.length;++Ve<We;)if(ue=U.charCodeAt(Ve),48>ue||ue>57){Ee=(ue===46?o+U.slice(Ve+1):U.slice(Ve))+Ee,U=U.slice(0,Ve);break}}}B&&!$&&(U=n(U,1/0));var Ue=De.length+U.length+Ee.length,Be=Ue<ee?new Array(ee-Ue+1).join(u):"";switch(B&&$&&(U=n(Be+U,Be.length?ee-Ee.length:1/0),Be=""),k){case"<":U=De+U+Ee+Be;break;case"=":U=De+Be+U+Ee;break;case"^":U=Be.slice(0,Ue=Be.length>>1)+De+U+Ee+Be.slice(Ue);break;default:U=Be+De+U+Ee;break}return r(U)}return He.toString=function(){return m+""},He}function c(m,p){var u=Math.max(-8,Math.min(8,Math.floor(Ii(p)/3)))*3,k=Math.pow(10,-u),E=d((m=wo(m),m.type="f",m),{suffix:vb[8+u/3]});return function(P){return E(k*P)}}return{format:d,formatPrefix:c}}var Wl,Zo,Ol;ch({thousands:",",grouping:[3],currency:["$",""]});function ch(t){return Wl=xb(t),Zo=Wl.format,Ol=Wl.formatPrefix,Wl}function dh(t){return Math.max(0,-Ii(Math.abs(t)))}function hh(t,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ii(n)/3)))*3-Ii(Math.abs(t)))}function mh(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,Ii(n)-Ii(t))+1}function wb(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t);break}return this}function ph(t){return function(){return t}}function uh(t){return+t}var yb=[0,1];function vr(t){return t}function fh(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:ph(isNaN(n)?NaN:.5)}function oS(t,n){var e;return t>n&&(e=t,t=n,n=e),function(i){return Math.max(t,Math.min(n,i))}}function nS(t,n,e){var i=t[0],o=t[1],r=n[0],a=n[1];return o<i?(i=fh(o,i),r=e(a,r)):(i=fh(i,o),r=e(r,a)),function(s){return r(i(s))}}function rS(t,n,e){var i=Math.min(t.length,n.length)-1,o=new Array(i),r=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<i;)o[a]=fh(t[a],t[a+1]),r[a]=e(n[a],n[a+1]);return function(s){var l=Ad(t,s,1,i)-1;return r[l](o[l](s))}}function Sb(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function aS(){var t=yb,n=yb,e=Uo,i,o,r,a=vr,s,l,d;function c(){var p=Math.min(t.length,n.length);return a!==vr&&(a=oS(t[0],t[p-1])),s=p>2?rS:nS,l=d=null,m}function m(p){return p==null||isNaN(p=+p)?r:(l||(l=s(t.map(i),n,e)))(i(a(p)))}return m.invert=function(p){return a(o((d||(d=s(n,t.map(i),St)))(p)))},m.domain=function(p){return arguments.length?(t=Array.from(p,uh),c()):t.slice()},m.range=function(p){return arguments.length?(n=Array.from(p),c()):n.slice()},m.rangeRound=function(p){return n=Array.from(p),e=Kd,c()},m.clamp=function(p){return arguments.length?(a=p?!0:vr,c()):a!==vr},m.interpolate=function(p){return arguments.length?(e=p,c()):e},m.unknown=function(p){return arguments.length?(r=p,m):r},function(p,u){return i=p,o=u,c()}}function gh(){return aS()(vr,vr)}function bh(t,n,e,i){var o=Fd(t,n,e),r;switch(i=wo(i??",f"),i.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(n));return i.precision==null&&!isNaN(r=hh(o,a))&&(i.precision=r),Ol(i,a)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(r=mh(o,Math.max(Math.abs(t),Math.abs(n))))&&(i.precision=r-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(r=dh(o))&&(i.precision=r-(i.type==="%")*2);break}}return Zo(i)}function sS(t){var n=t.domain;return t.ticks=function(e){var i=n();return ml(i[0],i[i.length-1],e??10)},t.tickFormat=function(e,i){var o=n();return bh(o[0],o[o.length-1],e??10,i)},t.nice=function(e){e==null&&(e=10);var i=n(),o=0,r=i.length-1,a=i[o],s=i[r],l,d,c=10;for(s<a&&(d=a,a=s,s=d,d=o,o=r,r=d);c-- >0;){if(d=Hr(a,s,e),d===l)return i[o]=a,i[r]=s,n(i);if(d>0)a=Math.floor(a/d)*d,s=Math.ceil(s/d)*d;else if(d<0)a=Math.ceil(a*d)/d,s=Math.floor(s*d)/d;else break;l=d}return t},t}function xr(){var t=gh();return t.copy=function(){return Sb(t,xr())},wb.apply(t,arguments),sS(t)}function Ko(t){return function(){return t}}function Cb(t){let n=3;return t.digits=function(e){if(!arguments.length)return n;if(e==null)n=null;else{let i=Math.floor(e);if(!(i>=0))throw new RangeError(`invalid digits: ${e}`);n=i}return t},()=>new Qo(n)}var bz=Array.prototype.slice;function Mb(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function _b(t){this._context=t}_b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n);break}}};function Eb(t){return new _b(t)}function kb(t){return t[0]}function qb(t){return t[1]}function vh(t,n){var e=Ko(!0),i=null,o=Eb,r=null,a=Cb(s);t=typeof t=="function"?t:t===void 0?kb:Ko(t),n=typeof n=="function"?n:n===void 0?qb:Ko(n);function s(l){var d,c=(l=Mb(l)).length,m,p=!1,u;for(i==null&&(r=o(u=a())),d=0;d<=c;++d)!(d<c&&e(m=l[d],d,l))===p&&((p=!p)?r.lineStart():r.lineEnd()),p&&r.point(+t(m,d,l),+n(m,d,l));if(u)return r=null,u+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:Ko(+l),s):t},s.y=function(l){return arguments.length?(n=typeof l=="function"?l:Ko(+l),s):n},s.defined=function(l){return arguments.length?(e=typeof l=="function"?l:Ko(!!l),s):e},s.curve=function(l){return arguments.length?(o=l,i!=null&&(r=o(i)),s):o},s.context=function(l){return arguments.length?(l==null?i=r=null:r=o(i=l),s):i},s}function Tb(t,n){this._context=t,this._t=n}Tb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}break}}this._x=t,this._y=n}};function xh(t){return new Tb(t,0)}function yo(t,n,e){this.k=t,this.x=n,this.y=e}yo.prototype={constructor:yo,scale:function(t){return t===1?this:new yo(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new yo(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var wh=new yo(1,0,0);yh.prototype=yo.prototype;function yh(t){for(;!t.__zoom;)if(!(t=t.parentNode))return wh;return t.__zoom}var Ib=(()=>{class t{constructor(){this.elementRef=q(At),this.diagramWidth=550,this.diagramHeight=250,this.showAxisLabels=!0,this.ranksAreStale=!0,this.pendingRender=null,this.popoverAncestor=null,this.popoverToggleListener=e=>{e.newState==="open"&&this.pendingRender!==null&&this.render(this.pendingRender==="full")}}ngOnChanges(e){if(this.values.length===0)return;let i=!!(e.values||e.isAttributeDirectionInverted||e.colorMetric||e.diagramWidth||e.diagramHeight||e.showAxisLabels);if(i&&(this.ranksAreStale=!0),this.isHiddenInClosedPopover()){this.pendingRender=this.pendingRender==="full"||i?"full":"areas";return}this.render(i)}ngAfterViewInit(){this.popoverAncestor=this.elementRef.nativeElement.closest("[popover]"),this.popoverAncestor?.addEventListener("toggle",this.popoverToggleListener)}ngOnDestroy(){this.popoverAncestor?.removeEventListener("toggle",this.popoverToggleListener)}render(e){this.ranksAreStale&&(this.percentileRanks=this.isAttributeDirectionInverted?this.calculateReversedPercentileRanks(this.values):this.calculatePercentileRanks(this.values),this.updatePercentileToMetricValueMap(),this.ranksAreStale=!1),(e||!this.hasRenderedDiagram()||!this.updateAreas())&&this.renderDiagram(),this.pendingRender=null}isHiddenInClosedPopover(){let e=this.popoverAncestor??this.elementRef.nativeElement.closest("[popover]");if(!e)return!1;try{return!e.matches(":popover-open")}catch{return!1}}hasRenderedDiagram(){return!this.rangeDiagramContainer().select("svg").empty()}updateAreas(){let e=this.rangeDiagramContainer().select("g");if(e.empty()||e.select(".left-area").empty())return!1;let i=this.createXScale(),o=i(this.isAttributeDirectionInverted?this.calculateReversedPercentileFromMetricValue(this.currentRightValue):this.calculatePercentileFromMetricValue(this.currentLeftValue)),r=i(this.isAttributeDirectionInverted?this.calculateReversedPercentileFromMetricValue(this.currentLeftValue):this.calculatePercentileFromMetricValue(this.currentRightValue));return e.select(".left-area").attr("width",o).style("fill",this.isAttributeDirectionInverted?this.rightColor:this.leftColor),e.select(".middle-area").attr("x",o+this.framePadding).attr("width",r-o).style("fill",this.middleColor),e.select(".right-area").attr("x",r+this.framePadding).attr("width",this.frameWidth-2*this.framePadding-r).style("fill",this.isAttributeDirectionInverted?this.leftColor:this.rightColor),!0}updatePercentileToMetricValueMap(){this.percentileToMetricValueMap=new Map;let e=0;for(let i=0;i<=100;i++){for(;i>this.percentileRanks[e].x&&e<this.percentileRanks.length-1;)e++;this.percentileToMetricValueMap.set(i,this.percentileRanks[e].y)}}renderDiagram(){this.initializeDiagramDimesions(),this.clearDiagramContainer();let e=this.createSvg(),i=this.createGroup(e),o=this.createXScale(),r=this.createYScale();this.drawAxes(i,o,r),this.drawFrame(i),this.showAxisLabels&&this.drawLabels(i),this.drawAreas(i,o),this.drawLine(i),this.addCrossHair(i,o,r)}initializeDiagramDimesions(){this.svgWidth=this.diagramWidth,this.svgHeight=this.diagramHeight,this.frameMarginTop=10,this.frameMarginBottom=this.showAxisLabels?50:30,this.frameMarginLeft=this.showAxisLabels?50:40,this.frameMarginRight=10,this.framePadding=5,this.frameHeight=this.svgHeight-this.frameMarginTop-this.frameMarginBottom,this.frameWidth=this.svgWidth-this.frameMarginLeft-this.frameMarginRight,this.yLabelXOffset=80,this.xLabelYOffset=20}rangeDiagramContainer(){return Hd(this.elementRef.nativeElement.querySelector("#cc-range-diagram-container"))}clearDiagramContainer(){this.rangeDiagramContainer().selectAll("*").remove()}createSvg(){return this.rangeDiagramContainer().append("svg").attr("width",this.svgWidth).attr("height",this.svgHeight)}createGroup(e){return e.append("g").attr("transform",`translate(${this.frameMarginLeft}, ${this.frameMarginTop})`).attr("display","flex").attr("justify-content","center")}drawFrame(e){e.append("path").attr("d",`M 0 0
|
|
3427
|
+
Low Values: ${e.hintLowValue}`:"",r.length>0?`${o}:${r}`:o}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=Xi({name:"attributeDescriptorTooltip",type:t,pure:!0})}}return t})();var Vo=t=>t===void 0||Number.isNaN(t)?"-":t.toLocaleString("en-US");function Dw(t,n){if(t&1&&(S(0,"a",4),fe(1,"i",7),y()),t&2){let e=A();le("href",n,ln),dt("data-testid","mapping-block-link-"+e.block().kind)}}function Rw(t,n){if(t&1&&(g(0),S(1,"span",8),g(2,"(in/out)"),y()),t&2){let e=A();ge(" ",e.edgeCountText()," ")}}function Aw(t,n){if(t&1&&g(0),t&2){let e=A();ge(" ",e.formattedValue()," ")}}function Fw(t,n){t&1&&(S(0,"span",6),g(1,"\xB7 inverted"),y())}var Bg=(()=>{class t{constructor(){this.block=H.required(),this.iconClasses=Z(()=>`${t.ICONS[this.block().kind]} text-xs text-primary`),this.formattedValue=Z(()=>Vo(this.block().value)),this.edgeCountText=Z(()=>`${Vo(this.block().incoming)}/${Vo(this.block().outgoing)}`)}static{this.ICONS={area:"fa fa-arrows-alt",height:"fa fa-arrows-v",color:"fa fa-paint-brush",edge:"fa fa-exchange"}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-mapping-block"]],hostAttrs:[1,"block","py-2"],inputs:{block:[1,"block"]},decls:12,vars:13,consts:[[1,"flex","items-center","gap-2"],[1,"text-xs","uppercase","tracking-widest","opacity-60"],["aria-hidden","true"],[1,"break-all","leading-snug",3,"title"],["target","_blank","rel","noopener noreferrer",1,"text-sm","opacity-70",3,"href"],[1,"text-base","font-semibold","tabular-nums","leading-snug"],["data-testid","mapping-block-inverted",1,"text-sm","font-normal","opacity-60"],[1,"fa","fa-external-link"],[1,"text-sm","font-normal","opacity-70"]],template:function(i,o){if(i&1&&(S(0,"div",0)(1,"span",1),g(2),y(),fe(3,"i",2),y(),S(4,"p",3),rt(5,"attributeDescriptorTooltip"),g(6),O(7,Dw,2,2,"a",4),y(),S(8,"p",5),O(9,Rw,3,1)(10,Aw,1,1),O(11,Fw,2,0,"span",6),y()),i&2){let r;h(2),qe(o.block().kind),h(),St(o.iconClasses()),h(),le("title",gi(5,10,o.block().descriptor,o.block().metricName)),dt("data-testid","mapping-block-name-"+o.block().kind),h(2),ge(" ",o.block().metricName," "),h(),z((r=(r=o.block().descriptor)==null?null:r.link)?7:-1,r),h(),dt("data-testid","mapping-block-value-"+o.block().kind),h(),z(o.block().kind==="edge"?9:10),h(2),z(o.block().inverted?11:-1)}},dependencies:[go],encapsulation:2,changeDetection:0})}}return t})();var Lw=(t,n)=>n.kind;function Pw(t,n){if(t&1&&L(0,"cc-inspector-mapping-block",2),t&2){let e=n.$implicit;F("block",e)}}var Vg=(()=>{class t{constructor(){this.readStore=q(fo),this.mappingBlocks=D(this.readStore.mappingBlocks$,{requireSync:!0})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-metric-mapping"]],hostAttrs:[1,"block","shrink-0","border-t","border-base-300","px-3","py-2"],decls:5,vars:0,consts:[[1,"text-xs","uppercase","tracking-widest","opacity-60"],[1,"mt-1","divide-y","divide-base-200"],[3,"block"]],template:function(i,o){i&1&&(v(0,"span",0),g(1,"Metric Mapping"),b(),v(2,"div",1),Pe(3,Pw,1,1,"cc-inspector-mapping-block",2,Lw),b()),i&2&&(h(3),Ne(o.mappingBlocks()))},dependencies:[Bg],encapsulation:2,changeDetection:0})}}return t})();var Ks=(()=>{class t{constructor(){this.comparisonMode=be("map")}setComparisonMode(e){this.comparisonMode.set(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Wg=(()=>{class t{constructor(){this.comparisonModeService=q(Ks),this.comparisonMode=this.comparisonModeService.comparisonMode}setComparisonMode(e){this.comparisonModeService.setComparisonMode(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-comparison-toggle"]],hostAttrs:[1,"contents"],decls:5,vars:4,consts:[["data-testid","inspector-comparison-toggle",1,"join"],["type","button","title","Compare each value against the whole map","data-testid","inspector-comparison-map",1,"btn","btn-xs","join-item",3,"click"],["type","button","title","Compare each value against the min/max range of all files","data-testid","inspector-comparison-range",1,"btn","btn-xs","join-item",3,"click"]],template:function(i,o){i&1&&(S(0,"div",0)(1,"button",1),Y("click",function(){return o.setComparisonMode("map")}),g(2," map "),y(),S(3,"button",2),Y("click",function(){return o.setComparisonMode("range")}),g(4," range "),y()()),i&2&&(h(),Le("btn-active",o.comparisonMode()==="map"),h(2),Le("btn-active",o.comparisonMode()==="range"))},encapsulation:2,changeDetection:0})}}return t})();function Nw(t,n){t&1&&(S(0,"a",2),fe(1,"i",7),y()),t&2&&le("href",n,ln)}function Bw(t,n){if(t&1&&(S(0,"span",8),g(1),y()),t&2){let e=A();Oe("color",e.deltaColor()),h(),qe(e.formattedDelta())}}var Js=(()=>{class t{constructor(){this.row=H.required(),this.comparisonMode=H.required(),this.positiveDeltaColor=H.required(),this.negativeDeltaColor=H.required(),this.bar=Z(()=>this.comparisonMode()==="map"?this.row().mapBar:this.row().rangeBar),this.formattedValue=Z(()=>Vo(this.row().value)),this.hasDelta=Z(()=>!!this.row().delta),this.formattedDelta=Z(()=>`\u0394${Vo(this.row().delta)}`),this.deltaColor=Z(()=>(this.row().delta??0)>0?this.positiveDeltaColor():this.negativeDeltaColor()),this.barClasses=Z(()=>`h-full rounded ${t.SEVERITY_CLASSES[this.bar().severity]}`),this.barWidthPercentage=Z(()=>this.bar().fraction*100)}static{this.SEVERITY_CLASSES={success:"bg-success",warning:"bg-warning",error:"bg-error",neutral:"bg-base-content/30"}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-metric-row"]],hostAttrs:[1,"block"],inputs:{row:[1,"row"],comparisonMode:[1,"comparisonMode"],positiveDeltaColor:[1,"positiveDeltaColor"],negativeDeltaColor:[1,"negativeDeltaColor"]},decls:10,vars:12,consts:[[1,"flex","items-baseline","justify-between","gap-2"],[1,"min-w-0","truncate","text-sm",3,"title"],["target","_blank","rel","noopener noreferrer","data-testid","metric-row-link",1,"opacity-70",3,"href"],[1,"shrink-0","text-sm","tabular-nums"],["data-testid","metric-row-delta",1,"mr-1",3,"color"],[1,"mt-0.5","h-1","overflow-hidden","rounded","bg-base-300"],["data-testid","metric-row-bar"],[1,"fa","fa-external-link"],["data-testid","metric-row-delta",1,"mr-1"]],template:function(i,o){if(i&1&&(S(0,"div",0)(1,"span",1),rt(2,"attributeDescriptorTooltip"),g(3),O(4,Nw,2,1,"a",2),y(),S(5,"span",3),O(6,Bw,2,3,"span",4),g(7),y()(),S(8,"div",5),fe(9,"div",6),y()),i&2){let r;h(),le("title",gi(2,9,o.row().descriptor,o.row().name)),h(2),ge(" ",o.row().name," "),h(),z((r=(r=o.row().descriptor)==null?null:r.link)?4:-1,r),h(2),z(o.hasDelta()?6:-1),h(),ge(" ",o.formattedValue()," "),h(2),St(o.barClasses()),Oe("width",o.barWidthPercentage(),"%")}},dependencies:[go],encapsulation:2,changeDetection:0})}}return t})();var Vw=(t,n)=>n.name;function Ww(t,n){if(t&1&&L(0,"cc-inspector-metric-row",3),t&2){let e=n.$implicit,i=A(3);F("row",e)("comparisonMode",i.comparisonMode())("positiveDeltaColor",i.positiveDeltaColor())("negativeDeltaColor",i.negativeDeltaColor())}}function Ow(t,n){if(t&1&&(v(0,"div",2),Pe(1,Ww,1,4,"cc-inspector-metric-row",3,Vw),b()),t&2){let e=A(2);h(),Ne(e.rows())}}function zw(t,n){if(t&1){let e=Me();v(0,"button",0),W("click",function(){ce(e);let o=A();return de(o.toggleEmptyMetrics())}),L(1,"i",1),g(2),b(),O(3,Ow,3,0,"div",2)}if(t&2){let e=A();h(),Le("fa-chevron-right",!e.showEmptyMetrics())("fa-chevron-down",e.showEmptyMetrics()),h(),ge(" Empty metrics (",e.rows().length,") "),h(),z(e.showEmptyMetrics()?3:-1)}}var Og=(()=>{class t{constructor(){this.rows=H.required(),this.comparisonMode=H.required(),this.positiveDeltaColor=H.required(),this.negativeDeltaColor=H.required(),this.showEmptyMetrics=be(!1)}toggleEmptyMetrics(){this.showEmptyMetrics.update(e=>!e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-empty-metrics"]],hostAttrs:[1,"block"],inputs:{rows:[1,"rows"],comparisonMode:[1,"comparisonMode"],positiveDeltaColor:[1,"positiveDeltaColor"],negativeDeltaColor:[1,"negativeDeltaColor"]},decls:1,vars:1,consts:[["type","button","data-testid","inspector-empty-metrics-toggle",1,"mt-3","flex","items-center","gap-1.5","text-xs","uppercase","tracking-widest","opacity-60",3,"click"],[1,"fa","text-[10px]"],["data-testid","inspector-empty-metrics",1,"mt-2","flex","flex-col","gap-2","opacity-60"],[3,"row","comparisonMode","positiveDeltaColor","negativeDeltaColor"]],template:function(i,o){i&1&&O(0,zw,4,6),i&2&&z(o.rows().length>0?0:-1)},dependencies:[Js],encapsulation:2,changeDetection:0})}}return t})();var $w=(t,n)=>n.name;function jw(t,n){t&1&&L(0,"cc-inspector-comparison-toggle")}function Hw(t,n){t&1&&(v(0,"p",2),g(1,"No metrics available"),b())}function Uw(t,n){if(t&1&&L(0,"cc-inspector-metric-row",4),t&2){let e=n.$implicit,i=A(2);F("row",e)("comparisonMode",i.comparisonMode())("positiveDeltaColor",i.mapColors().positiveDelta)("negativeDeltaColor",i.mapColors().negativeDelta)}}function Gw(t,n){if(t&1&&(v(0,"div",3),Pe(1,Uw,1,4,"cc-inspector-metric-row",4,$w),b(),L(3,"cc-inspector-empty-metrics",5)),t&2){let e=A();h(),Ne(e.metricRowsWithValues()),h(2),F("rows",e.emptyMetricRows())("comparisonMode",e.comparisonMode())("positiveDeltaColor",e.mapColors().positiveDelta)("negativeDeltaColor",e.mapColors().negativeDelta)}}var zg=(()=>{class t{constructor(){this.readStore=q(fo),this.mapStateReadWindow=q(ve),this.comparisonModeService=q(Ks),this.metricRows=D(this.readStore.metricRows$,{requireSync:!0}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{requireSync:!0}),this.comparisonMode=this.comparisonModeService.comparisonMode,this.metricRowsWithValues=Z(()=>this.metricRows().filter(e=>!_d(e))),this.emptyMetricRows=Z(()=>this.metricRows().filter(e=>_d(e)))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-inspector-metrics-list"]],hostAttrs:[1,"block","border-t","border-base-300","px-3","py-2"],decls:6,vars:2,consts:[[1,"flex","items-center","justify-between"],[1,"text-xs","uppercase","tracking-widest","opacity-60"],["data-testid","inspector-metrics-empty",1,"mt-2","text-sm","opacity-60"],[1,"mt-2","flex","flex-col","gap-2"],[3,"row","comparisonMode","positiveDeltaColor","negativeDeltaColor"],[3,"rows","comparisonMode","positiveDeltaColor","negativeDeltaColor"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Metrics"),b(),O(3,jw,1,0,"cc-inspector-comparison-toggle"),b(),O(4,Hw,2,0,"p",2)(5,Gw,4,4)),i&2&&(h(3),z(o.metricRows().length>0?3:-1),h(),z(o.metricRows().length===0?4:5))},dependencies:[Wg,Og,Js],encapsulation:2,changeDetection:0})}}return t})();var Ed=(()=>{class t{constructor(){this.visibilityService=q(si),this.isVisible=this.visibilityService.isVisible}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-sidebar-inspector"]],hostAttrs:[1,"fixed","right-0","z-[60]","w-[var(--cc-inspector-width)]","bg-base-100","overflow-hidden","flex","flex-col","shadow-[-2px_0_8px_-2px_rgba(0,0,0,0.15)]","transition-transform","duration-300"],hostVars:9,hostBindings:function(i,o){i&2&&(dt("aria-hidden",!o.isVisible()),Oe("top","var(--cc-bars-height, 49px)")("height","calc(100vh - var(--cc-bars-height, 49px) - var(--cc-file-extension-bar-height, 17px) - var(--cc-bottom-bar-height, 32px))"),Le("translate-x-full",!o.isVisible())("pointer-events-none",!o.isVisible()))},decls:4,vars:0,consts:[[1,"min-h-0","flex-1","overflow-y-auto"]],template:function(i,o){i&1&&(L(0,"cc-inspector-header")(1,"cc-inspector-metric-mapping"),v(2,"div",0),L(3,"cc-inspector-metrics-list"),b())},dependencies:[Ng,Vg,zg],encapsulation:2,changeDetection:0})}}return t})();function Xw(t,n){t&1&&(v(0,"div",1)(1,"div",2)(2,"span"),g(3," The graphics card stopped rendering the map, usually because it ran out of memory. Reload the page, and try a smaller map or a smaller browser window. "),b()()())}var kd=(()=>{class t{constructor(e,i,o,r,a){this.inspectorVisibilityService=e,this.fileStoreReadWindow=i,this.threeViewerService=o,this.codeMapMouseEventService=r,this.elementReference=a,this.isLoadingFile$=this.fileStoreReadWindow.isLoadingFile$,this.isContextLost$=this.threeViewerService.isContextLost$}ngAfterViewInit(){this.threeViewerService.init(this.elementReference.nativeElement.querySelector("#codeMap")),this.codeMapMouseEventService.start()}ngOnDestroy(){this.threeViewerService.stopAnimate(),this.threeViewerService.destroy()}static{this.\u0275fac=function(i){return new(i||t)(te(si),te(Te),te(Zn),te(Bo),te(At))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-code-map"]],decls:5,vars:9,consts:[["id","codeMap",1,"fixed","left-0","top-[var(--cc-bars-height,49px)]","z-0","h-full","w-full"],[1,"pointer-events-none","fixed","inset-0","z-[1000]","flex","items-center","justify-center","p-4"],["role","alert",1,"alert","alert-error","pointer-events-auto","max-w-md"]],template:function(i,o){i&1&&(v(0,"div",0),rt(1,"async"),L(2,"cc-view-cube"),b(),O(3,Xw,4,0,"div",1),rt(4,"async")),i&2&&(Le("hidden",fi(1,5,o.isLoadingFile$)),h(2),Le("sideBarVisible",o.inspectorVisibilityService.isVisible()),h(),z(fi(4,7,o.isContextLost$)?3:-1))},dependencies:[xd,Fa],encapsulation:2,changeDetection:0})}}return t})();var el=Re(Et,bi,(t,n)=>xs.getMetricDistribution(t.unifiedMapNode,n));var tl=Re(jn,Yt,bi,el,(t,n,e,i)=>{let o=t||n;return!o||o.type===Ft.FILE?i:xs.getMetricDistribution(o,e)});var il=(()=>{class t{constructor(e){this.store=e,this.hoveredNodeMetricDistribution$=this.store.select(tl),this.metricDistribution$=this.store.select(el)}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var jg=(()=>{class t{constructor(e){this.mapStateReadWindow=e,this.areaMetric$=this.mapStateReadWindow.areaMetric$,this.distributionMetric=Ip}static{this.\u0275fac=function(i){return new(i||t)(te(ve))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-distribution-metric"]],hostAttrs:[1,"mx-[5px]","flex","min-w-max","items-center","gap-1.5","text-xs"],decls:3,vars:3,consts:[[1,"fa","fa-pie-chart"]],template:function(i,o){i&1&&(fe(0,"i",0),g(1),rt(2,"async")),i&2&&(h(),ge(" ",fi(2,1,o.areaMetric$),`
|
|
3428
|
+
`))},dependencies:[Fa],encapsulation:2,changeDetection:0})}}return t})();var Hg=(()=>{class t{constructor(e){this.store=e,this.hoveredNodeMetricDistribution$=this.store.select(tl),this.hoveredNode$=this.store.select(jn),this.selectedNode$=this.store.select(Yt),this.flattenedItems$=this.store.select(Op("flatten"))}dispatchAfterPaint(e){Nr(this.store,e)}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Kw(t){return`*.${t}`}function Jw(t,n){return t===bs?n.others.filter(e=>e.fileExtension!==vs).map(e=>e.fileExtension):[t]}function ol(t,n,e){return Jw(t,n).map(o=>{let r=Kw(o);return e?.type===Ft.FOLDER?`${e.path}/**/${r}`:r})}var Ug=(()=>{class t{constructor(e){this.blackListExtensionStore=e,this.operationContext$=It([this.blackListExtensionStore.hoveredNodeMetricDistribution$,this.blackListExtensionStore.hoveredNode$,this.blackListExtensionStore.selectedNode$,this.blackListExtensionStore.flattenedItems$]).pipe(ke(([i,o,r,a])=>({distribution:i,node:o||r,flattenedItems:a})))}show(e){this.operationContext$.pipe(ut(1)).subscribe(i=>{let o=ol(e,i.distribution,i.node),r=this.createFlattenedItemsMap(i.flattenedItems),a=o.map(s=>r.get(s));this.blackListExtensionStore.dispatchAfterPaint(Ln({items:a}))})}exclude(e){this.operationContext$.pipe(ut(1)).subscribe(i=>{let o=ol(e,i.distribution,i.node);this.blackListExtensionStore.dispatchAfterPaint(wd("exclude",...o))})}flatten(e){this.operationContext$.pipe(ut(1)).subscribe(i=>{let o=ol(e,i.distribution,i.node);this.blackListExtensionStore.dispatchAfterPaint(wd("flatten",...o))})}getIsFlattenedByFileExtension(e){return this.operationContext$.pipe(ke(i=>ol(e,i.distribution,i.node).every(r=>i.flattenedItems.some(a=>a.path===r))))}createFlattenedItemsMap(e){let i=new Map;for(let o of e)i.set(o.path,o);return i}static{this.\u0275fac=function(i){return new(i||t)(M(Hg))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Gg=(()=>{class t{constructor(e,i){this.threeSceneService=e,this.metricDistributionStore=i,this.metricDistribution$=this.metricDistributionStore.metricDistribution$,this.fileExtensionsOfOthers=new Set,this.fileExtensionsOfNone=new Set,this.metricDistribution$.pipe(Mm(),Ie(o=>!!o)).subscribe(o=>{this.fileExtensionsOfOthers.clear();for(let r of o.others)this.fileExtensionsOfOthers.add(r.fileExtension);this.fileExtensionsOfNone.clear();for(let r of o.none)this.fileExtensionsOfNone.add(r.fileExtension)})}highlightExtension(e){switch(e){case bs:this.threeSceneService.highlightBuildingsByExtension(this.fileExtensionsOfOthers);break;case vs:this.threeSceneService.highlightBuildingsWithoutExtensions();break;default:this.threeSceneService.highlightBuildingsByExtension(new Set([e]));break}}clearHighlightingOnFileExtensions(){this.threeSceneService.applyClearHighlights()}static{this.\u0275fac=function(i){return new(i||t)(M(ft),M(il))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var i5=["menu"];function o5(t,n){if(t&1){let e=Me();S(0,"button",10),Y("click",function(){ce(e);let o=A(2);return de(o.show(o.fileExtension()))}),fe(1,"i",11),S(2,"span",9),g(3,"Show"),y()()}}function n5(t,n){if(t&1){let e=Me();S(0,"button",12),Y("click",function(){ce(e);let o=A(2);return de(o.flatten(o.fileExtension()))}),fe(1,"i",13),S(2,"span",9),g(3,"Flatten"),y()()}}function r5(t,n){if(t&1){let e=Me();S(0,"div",4,0),Y("contextmenu",function(o){return o.preventDefault()}),O(2,o5,4,0,"button",5)(3,n5,4,0,"button",6),S(4,"button",7),Y("click",function(){ce(e);let o=A();return de(o.exclude(o.fileExtension()))}),fe(5,"i",8),S(6,"span",9),g(7,"Exclude"),y()()()}if(t&2){let e=n,i=A();Oe("left",e.left,"px")("bottom",e.bottom,"px"),h(2),z(i.isFlattened()?2:3)}}var a5=192,qd=4,Xg=(()=>{class t{constructor(e,i){this.blackListExtensionService=e,this.highlightBuildingsByFileExtensionService=i,this.item=H.required(),this.showAbsoluteValues=H.required(),this.toggleShowAbsoluteValues=Ce(),this.isFlattened=be(!1),this.menuPosition=be(null),this.menuRef=je("menu"),this.fileExtension=Z(()=>this.item().fileExtension),this.hasFileExtension=Z(()=>this.fileExtension()!=="None"),this.formattedTitle=Z(()=>this.formatTitle(this.showAbsoluteValues(),this.item(),this.fileExtension()))}ngOnInit(){this.flattenSubscription=this.blackListExtensionService.getIsFlattenedByFileExtension(this.fileExtension()).subscribe(e=>this.isFlattened.set(e))}ngOnDestroy(){this.flattenSubscription?.unsubscribe()}openContextMenu(e){if(e.preventDefault(),!this.hasFileExtension())return;let i=Math.max(qd,Math.min(e.clientX,window.innerWidth-a5-qd)),o=Math.max(qd,window.innerHeight-e.clientY);this.menuPosition.set({left:i,bottom:o})}closeContextMenu(){this.menuPosition.set(null)}onDocumentPointerDown(e){if(!this.menuPosition())return;let i=this.menuRef()?.nativeElement;i&&e.target instanceof Node&&i.contains(e.target)||this.closeContextMenu()}closeContextMenuOnViewportChange(){this.menuPosition()&&this.closeContextMenu()}flatten(e){this.blackListExtensionService.flatten(e),this.closeContextMenu()}exclude(e){this.blackListExtensionService.exclude(e),this.closeContextMenu()}show(e){this.blackListExtensionService.show(e),this.closeContextMenu()}onHoverFileExtensionBar(e){this.highlightBuildingsByFileExtensionService.highlightExtension(e)}onUnhoverFileExtensionBar(){this.highlightBuildingsByFileExtensionService.clearHighlightingOnFileExtensions()}formatTitle(e,i,o){return e&&i.absoluteMetricValue||!e&&i.relativeMetricValue?e?`${o} ${i.absoluteMetricValue.toLocaleString()}`:`${o} ${i.relativeMetricValue.toFixed(2)}%`:"No data available"}get backgroundColor(){return this.item().color}get flexGrow(){return this.item().relativeMetricValue}get flexBasis(){return"0"}static{this.\u0275fac=function(i){return new(i||t)(te(Ug),te(Gg))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-file-extension-bar-segment"]],viewQuery:function(i,o){i&1&&tt(o.menuRef,i5,5),i&2&&it()},hostAttrs:[1,"min-w-max","cursor-pointer","overflow-hidden","text-center","text-white"],hostVars:6,hostBindings:function(i,o){i&1&&W("pointerdown",function(a){return o.onDocumentPointerDown(a)},Io)("wheel",function(){return o.closeContextMenuOnViewportChange()},Io)("resize",function(){return o.closeContextMenuOnViewportChange()},Rm),i&2&&Oe("background-color",o.backgroundColor)("flex-grow",o.flexGrow)("flex-basis",o.flexBasis)},inputs:{item:[1,"item"],showAbsoluteValues:[1,"showAbsoluteValues"]},outputs:{toggleShowAbsoluteValues:"toggleShowAbsoluteValues"},decls:4,vars:3,consts:[["menu",""],[1,"cc-bar-section",3,"click","contextmenu"],["data-test-id","formattedTitle",1,"cc-bar-section-text","my-0.5","whitespace-nowrap","px-2.5","text-[10px]",3,"mouseover","mouseleave","title"],[1,"fixed","z-[100]","w-48","rounded-box","border","border-base-300","bg-base-100","py-1","text-base-content","shadow-lg",3,"left","bottom"],[1,"fixed","z-[100]","w-48","rounded-box","border","border-base-300","bg-base-100","py-1","text-base-content","shadow-lg",3,"contextmenu"],["type","button","data-test-id","showBuilding",1,"flex","w-full","items-center","gap-3","px-4","py-2.5","text-left","text-sm","font-medium","hover:bg-base-200"],["type","button","data-test-id","flattenBuilding",1,"flex","w-full","items-center","gap-3","px-4","py-2.5","text-left","text-sm","font-medium","hover:bg-base-200"],["type","button","data-test-id","excludeBuilding",1,"flex","w-full","items-center","gap-3","px-4","py-2.5","text-left","text-sm","font-medium","hover:bg-base-200",3,"click"],[1,"w-4","text-center","fa-solid","fa-ban"],[1,"truncate"],["type","button","data-test-id","showBuilding",1,"flex","w-full","items-center","gap-3","px-4","py-2.5","text-left","text-sm","font-medium","hover:bg-base-200",3,"click"],[1,"w-4","text-center","fa-solid","fa-eye"],["type","button","data-test-id","flattenBuilding",1,"flex","w-full","items-center","gap-3","px-4","py-2.5","text-left","text-sm","font-medium","hover:bg-base-200",3,"click"],[1,"w-4","text-center","fa-solid","fa-arrows-down-to-line"]],template:function(i,o){if(i&1&&(S(0,"span",1),Y("click",function(){return o.toggleShowAbsoluteValues.emit()})("contextmenu",function(a){return o.openContextMenu(a)}),S(1,"div",2),Y("mouseover",function(){return o.onHoverFileExtensionBar(o.fileExtension())})("mouseleave",function(){return o.onUnhoverFileExtensionBar()}),g(2),y()(),O(3,r5,8,5,"div",3)),i&2){let r;h(),le("title",o.formattedTitle()),h(),ge(" ",o.formattedTitle()," "),h(),z((r=o.menuPosition())?3:-1,r)}},encapsulation:2,changeDetection:0})}}return t})();var l5=(t,n)=>n.fileExtension;function c5(t,n){if(t&1){let e=Me();v(0,"cc-file-extension-bar-segment",4),W("toggleShowAbsoluteValues",function(){ce(e);let o=A();return de(o.toggleShowAbsoluteValues())}),b()}if(t&2){let e=n.$implicit,i=A();F("item",e)("showAbsoluteValues",i.showAbsoluteValues())}}var Td=(()=>{class t{constructor(){this.metricDistributionStore=q(il),this.showAbsoluteValues=be(!1),this.metricDistribution=D(this.metricDistributionStore.hoveredNodeMetricDistribution$,{requireSync:!0})}toggleShowAbsoluteValues(){this.showAbsoluteValues.update(e=>!e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-file-extension-bar"]],hostAttrs:[1,"fixed","left-0","right-0","z-[70]","block","bg-base-100"],hostVars:2,hostBindings:function(i,o){i&2&&Oe("bottom","var(--cc-bottom-bar-height, 32px)")},features:[Zi([{provide:Es,useValue:"--cc-file-extension-bar-height"}]),Qi([ks])],decls:5,vars:0,consts:[[1,"flex","h-[17px]","w-full"],["title","Distribution metric"],[1,"flex","w-full","gap-px"],[3,"item","showAbsoluteValues"],[3,"toggleShowAbsoluteValues","item","showAbsoluteValues"]],template:function(i,o){i&1&&(v(0,"div",0),L(1,"cc-distribution-metric",1),v(2,"div",2),Pe(3,c5,1,2,"cc-file-extension-bar-segment",3,l5),b()()),i&2&&(h(3),Ne(o.metricDistribution().visible))},dependencies:[jg,Xg],encapsulation:2,changeDetection:0})}}return t})();var nl="var(--cc-bottom-bar-height, 32px) + var(--cc-file-extension-bar-height, 17px)";var rl=(()=>{class t{static{this.NO_MATCHING="\u2013 (no matching buildings)"}transform(e,i,o,r){switch(e){case"positive":{let a=r==="unary",s=o.minValue===i.from,l=o.maxValue===i.from;return a?`${o.minValue} - ${o.maxValue}`:s?t.NO_MATCHING:l?`${o.minValue} to ${this.formatNumber(i.from)}`:`${o.minValue} to ${this.formatNumber(i.from-1)}`}case"neutral":{let a=i.from===i.to,s=i.to===o.maxValue;return a?t.NO_MATCHING:s?`${this.formatNumber(i.from)} to ${this.formatNumber(i.to)}`:`${this.formatNumber(i.from)} to ${this.formatNumber(i.to-1)}`}case"negative":return o.maxValue===i.to?t.NO_MATCHING:`${this.formatNumber(i.to)} to ${this.formatNumber(o.maxValue)}`;case"positiveDelta":return"+\u0394 positive delta";case"negativeDelta":return"\u2013\u0394 negative delta";case"selected":return"selected";case"outgoingEdge":return"Outgoing Edge";case"incomingEdge":return"Incoming Edge"}}formatNumber(e){return(e||0).toLocaleString()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=Xi({name:"mapColorLabel",type:t,pure:!0})}}return t})();var Qg=(()=>{class t{constructor(e){this.store=e,this.selectedColorMetricData$=this.store.select(so)}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var bo=(()=>{class t{constructor(e,i){this.mapStateReadWindow=e,this.legendMetricRangeStore=i,this.mapColorFor=H.required(),this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.colorRange=D(this.mapStateReadWindow.colorRange$,{initialValue:{from:0,to:0}}),this.nodeMetricRange=D(this.legendMetricRangeStore.selectedColorMetricData$,{initialValue:{values:[],minValue:0,maxValue:0}}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Lt}),this.color=Z(()=>this.mapColors()[this.mapColorFor()])}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(Qg))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-color-row"]],inputs:{mapColorFor:[1,"mapColorFor"]},decls:7,vars:8,consts:[[1,"flex","items-center","gap-2"],[1,"h-4","w-4","shrink-0","rounded-sm","border","border-base-300"],["width","100%","height","100%"],[1,"min-w-0","flex-1","truncate","text-sm"]],template:function(i,o){if(i&1&&(Nm(0),rt(1,"mapColorLabel"),S(2,"div",0),To(),S(3,"svg",1),fe(4,"rect",2),y(),Ir(),S(5,"span",3),g(6),y()()),i&2){let r=Aa(1,3,o.mapColorFor(),o.colorRange(),o.nodeMetricRange(),o.colorMetric());h(3),dt("aria-label","Color for "+r),h(),dt("fill",o.color()),h(2),qe(r)}},dependencies:[rl],encapsulation:2,changeDetection:0})}}return t})();var Yg=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-color-scale-section"]],hostAttrs:[1,"contents"],decls:6,vars:0,consts:[[1,"border-base-300","flex","flex-col","gap-1","border-t","pt-2"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],["mapColorFor","positive"],["mapColorFor","neutral"],["mapColorFor","negative"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Color scale"),b(),L(3,"cc-legend-color-row",2)(4,"cc-legend-color-row",3)(5,"cc-legend-color-row",4),b())},dependencies:[bo],encapsulation:2,changeDetection:0})}}return t})();var Zg=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-delta-colors-section"]],hostAttrs:[1,"contents"],decls:5,vars:0,consts:[[1,"flex","flex-col","gap-1"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],["mapColorFor","positiveDelta"],["mapColorFor","negativeDelta"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Delta colors"),b(),L(3,"cc-legend-color-row",2)(4,"cc-legend-color-row",3),b())},dependencies:[bo],encapsulation:2,changeDetection:0})}}return t})();function h5(t,n){t&1&&(v(0,"div",0),L(1,"cc-legend-color-row",1)(2,"cc-legend-color-row",2),b())}var Kg=(()=>{class t{constructor(e){this.mapStateReadWindow=e,this.edgeMetric=D(this.mapStateReadWindow.edgeMetric$,{initialValue:null})}static{this.\u0275fac=function(i){return new(i||t)(te(ve))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-edge-colors-section"]],hostAttrs:[1,"contents"],decls:1,vars:1,consts:[[1,"border-base-300","flex","flex-col","gap-1","border-t","pt-2"],["mapColorFor","outgoingEdge"],["mapColorFor","incomingEdge"]],template:function(i,o){i&1&&O(0,h5,3,0,"div",0),i&2&&z(o.edgeMetric()?0:-1)},dependencies:[bo],encapsulation:2,changeDetection:0})}}return t})();var Jg=(()=>{class t{constructor(e){this.metricsLensFacade=e,this.label=H.required(),this.metricName=H.required(),this.attributeDescriptors=D(this.metricsLensFacade.descriptors$,{initialValue:{}}),this.descriptor=Z(()=>this.attributeDescriptors()[this.metricName()]),this.title=Z(()=>this.descriptor()?.title||dr.get(this.metricName())||this.metricName())}static{this.\u0275fac=function(i){return new(i||t)(te(zn))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-metric-row"]],inputs:{label:[1,"label"],metricName:[1,"metricName"]},decls:6,vars:6,consts:[[1,"flex","items-baseline","gap-3",3,"title"],[1,"w-16","shrink-0","text-xs","uppercase","tracking-wider","opacity-60"],[1,"min-w-0","truncate","text-sm","font-semibold"]],template:function(i,o){i&1&&(S(0,"div",0),rt(1,"attributeDescriptorTooltip"),S(2,"span",1),g(3),y(),S(4,"span",2),g(5),y()()),i&2&&(le("title",gi(1,3,o.descriptor(),o.metricName())),h(3),qe(o.label()),h(2),qe(o.title()))},dependencies:[go],encapsulation:2,changeDetection:0})}}return t})();function p5(t,n){t&1&&L(0,"cc-legend-metric-row",4),t&2&&F("metricName",n)}var e1=(()=>{class t{constructor(e){this.mapStateReadWindow=e,this.areaMetric=D(this.mapStateReadWindow.areaMetric$,{initialValue:""}),this.heightMetric=D(this.mapStateReadWindow.heightMetric$,{initialValue:""}),this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.edgeMetric=D(this.mapStateReadWindow.edgeMetric$,{initialValue:null})}static{this.\u0275fac=function(i){return new(i||t)(te(ve))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-metrics-section"]],hostAttrs:[1,"contents"],decls:5,vars:4,consts:[[1,"flex","flex-col","gap-2"],["label","Area",3,"metricName"],["label","Height",3,"metricName"],["label","Color",3,"metricName"],["label","Edge",3,"metricName"]],template:function(i,o){if(i&1&&(v(0,"div",0),L(1,"cc-legend-metric-row",1)(2,"cc-legend-metric-row",2)(3,"cc-legend-metric-row",3),O(4,p5,1,1,"cc-legend-metric-row",4),b()),i&2){let r;h(),F("metricName",o.areaMetric()??""),h(),F("metricName",o.heightMetric()??""),h(),F("metricName",o.colorMetric()??""),h(),z((r=o.edgeMetric())?4:-1,r)}},dependencies:[Jg],encapsulation:2,changeDetection:0})}}return t})();var t1=(()=>{class t{constructor(e){this.inspectorVisibilityService=e,this.isOpen=H.required(),this.togglePanel=Ce(),this.buttonBottom=`calc(${nl} + 32px)`,this.buttonRight=Z(()=>this.inspectorVisibilityService.isVisible()?"calc(var(--cc-inspector-width) - 28px)":"-28px")}static{this.\u0275fac=function(i){return new(i||t)(te(si))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-toggle-button"]],hostAttrs:[1,"contents"],inputs:{isOpen:[1,"isOpen"]},outputs:{togglePanel:"togglePanel"},decls:2,vars:6,consts:[["id","legend-panel-button","data-testid","legend-panel-button","aria-controls","legend-panel",1,"btn","btn-primary","btn-sm","fixed","z-[60]","w-[88px]","rotate-90","rounded-t-none","transition-[right]","duration-300",3,"click","title"]],template:function(i,o){i&1&&(S(0,"button",0),Y("click",function(){return o.togglePanel.emit()}),g(1,` LEGEND
|
|
3429
|
+
`),y()),i&2&&(Oe("right",o.buttonRight())("bottom",o.buttonBottom),le("title",o.isOpen()?"Hide panel":"Show panel"),dt("aria-expanded",o.isOpen()))},encapsulation:2,changeDetection:0})}}return t})();function u5(t,n){t&1&&L(0,"cc-legend-delta-colors-section")}function f5(t,n){t&1&&L(0,"cc-legend-metrics-section")(1,"cc-legend-color-scale-section")}function g5(t,n){if(t&1&&(v(0,"div",2)(1,"div",3),O(2,u5,1,0,"cc-legend-delta-colors-section")(3,f5,2,0),v(4,"div",4),L(5,"cc-legend-color-row",5),b(),L(6,"cc-legend-edge-colors-section"),b()()),t&2){let e=A();Oe("right",e.panelRight())("bottom",e.panelBottom),h(2),z(e.isDeltaState()?2:3)}}var Id=(()=>{class t{constructor(){this.elementReference=q(At),this.inspectorVisibilityService=q(si),this.fileStoreReadWindow=q(Te),this.isOpen=be(!1),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.panelBottom=`calc(${nl} + 12px)`,this.panelRight=Z(()=>this.inspectorVisibilityService.isVisible()?"calc(var(--cc-inspector-width) + 40px)":"40px"),this.mouseDownListener=e=>this.closeOnOutsideClick(e)}ngOnInit(){document.addEventListener("mousedown",this.mouseDownListener)}ngOnDestroy(){document.removeEventListener("mousedown",this.mouseDownListener)}toggleIsOpen(){this.isOpen.update(e=>!e)}closeOnOutsideClick(e){this.isOpen()&&e.target instanceof Node&&!this.elementReference.nativeElement.contains(e.target)&&this.isOpen.set(!1)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-legend-panel"]],decls:2,vars:2,consts:[["id","legend-panel","data-testid","legend-panel",1,"rounded-box","border-base-300","bg-base-100","fixed","z-[60]","flex","w-72","max-w-[30vw]","flex-col","border","shadow-lg","transition-[right]","duration-300",3,"right","bottom"],[3,"togglePanel","isOpen"],["id","legend-panel","data-testid","legend-panel",1,"rounded-box","border-base-300","bg-base-100","fixed","z-[60]","flex","w-72","max-w-[30vw]","flex-col","border","shadow-lg","transition-[right]","duration-300"],[1,"flex","flex-col","gap-3","p-3"],[1,"border-base-300","border-t","pt-2"],["mapColorFor","selected"]],template:function(i,o){i&1&&(O(0,g5,7,5,"div",0),v(1,"cc-legend-toggle-button",1),W("togglePanel",function(){return o.toggleIsOpen()}),b()),i&2&&(z(o.isOpen()?0:-1),h(),F("isOpen",o.isOpen()))},dependencies:[e1,Yg,Zg,Kg,bo,t1],encapsulation:2,changeDetection:0})}}return t})();var i1=Re(hu,lu,(t,n)=>({nodes:t,edges:n}));var o1=(t,n)=>Re(Hn,i1,(e,i)=>{let o=e[n];return i[t][o]==="relative"?"x\u0342":"\u03A3"});var b5=t=>{if(!t)return[];let n=[];for(let{data:e}of mn(t))e.type===Ft.FOLDER&&!e.isExcluded&&n.push(e.path);return n.sort((e,i)=>e.localeCompare(i))},n1=Re(Et,t=>b5(t.unifiedMapNode));var v5=(t,n)=>{let e=new Map(t.map(i=>[i.path,0]));for(let i of n){if(!Ki(i)||i.isExcluded)continue;let o=x5(e,i.path);o!==void 0&&e.set(o,e.get(o)+1)}return t.map(i=>nt(xe({},i),{fileCount:e.get(i.path)})).sort((i,o)=>i.path.localeCompare(o.path))};function x5(t,n){let e=n;for(;e;){if(t.has(e))return e;let i=e.lastIndexOf("/");e=i>0?e.slice(0,i):""}}var r1=Re(jp,Li,v5);var a1=Re(ja,t=>({leftColor:t.positive,middleColor:t.neutral,rightColor:t.negative}));var s1=Re(so,Tp,(t,n)=>({values:t.values,min:t.minValue,max:t.maxValue,from:n.from,to:n.to}));var mt=(()=>{class t{constructor(e){this.store=e,this.metricData$=this.store.select($n),this.primaryMetricNames$=this.store.select(Hn),this.amountOfBuildingsWithSelectedEdgeMetric$=this.store.select(us),this.selectedColorMetricData$=this.store.select(so),this.metricColorRangeColors$=this.store.select(a1),this.metricColorRangeValues$=this.store.select(s1),this.markedPackagesWithCounts$=this.store.select(r1),this.markableFolderPaths$=this.store.select(n1),this.hoveredNode$=this.store.select(jn),this.selectedNode$=this.store.select(Yt),this.accumulatedData$=this.store.select(Et)}attributeTypeLabel$(e,i){return this.store.select(o1(e,i))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ze=(()=>{class t{constructor(e){this.store=e}setAreaMetric(e){this.store.dispatch(vi({value:e}))}setHeightMetric(e){this.store.dispatch(Si({value:e}))}setColorMetric(e){this.store.dispatch(Pt({value:e}))}setEdgeMetric(e){this.store.dispatch(wi({value:e}))}setMargin(e){this.store.dispatch(kn({value:e}))}setInvertArea(e){this.store.dispatch(Sn({value:e}))}setEnableFloorLabels(e){this.store.dispatch(xn({value:e}))}setScaling(e){this.store.dispatch(qn({value:e}))}setInvertHeight(e){this.store.dispatch(yn({value:e}))}setColorRange(e){this.store.dispatch(xi({value:e}))}setColorMode(e){this.store.dispatch(io({value:e}))}setMapColors(e){this.store.dispatch(Ai({value:e}))}invertColorRange(){this.store.dispatch(gn())}invertDeltaColors(){this.store.dispatch(bn())}setEdgeHeight(e){this.store.dispatch(vn({value:e}))}setAmountOfEdgePreviews(e){this.store.dispatch(eo({value:e}))}toggleEdgeMetricVisible(){this.store.dispatch(Cn())}setShowIncomingEdges(e){this.store.dispatch(Tn({value:e}))}setShowOutgoingEdges(e){this.store.dispatch(In({value:e}))}setShowOnlyBuildingsWithEdges(e){this.store.dispatch(An({value:e}))}toggleIsHeightAndColorMetricLinked(){this.store.dispatch(Du())}markPackage(e){this.store.dispatch(Nn({packages:[e]}))}unmarkPackage(e){this.store.dispatch(Bn({path:e}))}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var l1=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.metricsBarWriteStore=q(Ze),this.popoverId=H.required(),this.anchorName=H.required(),this.margin=D(this.mapStateReadWindow.margin$,{initialValue:0}),this.enableFloorLabels=D(this.mapStateReadWindow.enableFloorLabels$,{initialValue:!1}),this.isInvertedArea=D(this.mapStateReadWindow.invertArea$,{initialValue:!1}),this.resetKeys=["mapState.margin","mapState.invertArea","mapState.enableFloorLabels"]}setMargin(e){this.metricsBarWriteStore.setMargin(e)}setEnableFloorLabel(e){let i=e.target.checked;this.metricsBarWriteStore.setEnableFloorLabels(i)}toggleInvertingArea(e){let i=e.target.checked;this.metricsBarWriteStore.setInvertArea(i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-area-settings-popover"]],hostAttrs:[1,"contents"],inputs:{popoverId:[1,"popoverId"],anchorName:[1,"anchorName"]},decls:14,vars:8,consts:[[3,"popoverId","anchorName"],["title","Amount of space between buildings in percent"],[1,"text-sm"],["ariaLabel","Margin",3,"valueChange","min","max","value"],[1,"flex","items-center","gap-2","cursor-pointer"],["type","checkbox",1,"checkbox","checkbox-sm","checkbox-primary",3,"change","checked"],["tooltip","Reset area metric settings to their defaults","label","Reset area metric settings",3,"settingsKeys"]],template:function(i,o){i&1&&(v(0,"cc-settings-popover-shell",0)(1,"div",1)(2,"span",2),g(3,"Margin"),b(),v(4,"cc-slider-number-input",3),W("valueChange",function(a){return o.setMargin(a)}),b()(),v(5,"label",4)(6,"input",5),W("change",function(a){return o.setEnableFloorLabel(a)}),b(),v(7,"span"),g(8,"Enable Floor Labels"),b()(),v(9,"label",4)(10,"input",5),W("change",function(a){return o.toggleInvertingArea(a)}),b(),v(11,"span"),g(12,"Invert Area"),b()(),L(13,"cc-reset-settings-button",6),b()),i&2&&(F("popoverId",o.popoverId())("anchorName",o.anchorName()),h(4),F("min",1)("max",100)("value",o.margin()),h(2),F("checked",o.enableFloorLabels()),h(4),F("checked",o.isInvertedArea()),h(3),F("settingsKeys",o.resetKeys))},dependencies:[mo,Wt,ir],encapsulation:2,changeDetection:0})}}return t})();var mr=(()=>{class t{constructor(e,i,o){this.metricsBarReadStore=e,this.mapStateReadWindow=i,this.codeMapRenderService=o;let r=this.metricsBarReadStore.hoveredNode$,a=this.metricsBarReadStore.selectedNode$,s=this.createTopLevelNodeObservable();this.node$=It([r,a,s]).pipe(ke(([l,d,c])=>l??d??c),Ta({bufferSize:1,refCount:!0}))}createNodeObservable(){return this.node$}createTopLevelNodeObservable(){return It([this.metricsBarReadStore.accumulatedData$,this.mapStateReadWindow.areaMetric$,this.mapStateReadWindow.heightMetric$]).pipe(Ie(([e])=>!!e.unifiedMapNode),ke(([e])=>this.findTopLevelNode(e)))}findTopLevelNode(e){let i=this.codeMapRenderService.getNodes(e.unifiedMapNode),o=this.codeMapRenderService.sortVisibleNodesByHeightDescending(i);if(o.length!==0)return o.reduce((r,a)=>r.attributes.unary>a.attributes.unary?r:a,o[0])}static{this.\u0275fac=function(i){return new(i||t)(M(mt),M(ve),M(jr))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var al=(()=>{class t{constructor(){this.nodeSelectionService=q(mr),this.metricsBarReadStore=q(mt),this.metricFor=H.required(),this.attributeType=H("nodes"),this.node=D(this.nodeSelectionService.createNodeObservable()),this.isNodeALeaf=Z(()=>{let e=this.node();return e?"isLeaf"in e?e.isLeaf:Ki(e):!1}),this.selectorInputs=Z(()=>({attributeType:this.attributeType(),metricFor:this.metricFor()})),this.attributeTypeLabel=D(Km(this.selectorInputs).pipe(Ut(({attributeType:e,metricFor:i})=>this.metricsBarReadStore.attributeTypeLabel$(e,i))))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-chooser-type"]],inputs:{metricFor:[1,"metricFor"],attributeType:[1,"attributeType"]},decls:2,vars:2,consts:[[3,"hidden"]],template:function(i,o){i&1&&(S(0,"span",0),g(1),y()),i&2&&(le("hidden",o.isNodeALeaf()),h(),ge(" ",o.attributeTypeLabel(),`
|
|
3430
|
+
`))},encapsulation:2,changeDetection:0})}}return t})();function w5(t,n){if(t&1&&(v(0,"span",4),g(1),b()),t&2){let e=n;St(e.styleClass),h(),ge("\u0394",e.label)}}function S5(t,n){if(t&1&&(v(0,"span",2),L(1,"cc-metric-chooser-type",3),b(),v(2,"span",4),g(3),b(),O(4,w5,2,3,"span",5)),t&2){let e,i=n,o=A();h(),F("metricFor",o.metricFor()),h(2),qe(i.value),h(),z((e=i.delta)?4:-1,e)}}function y5(t,n){t&1&&(v(0,"span",1),g(1,"\xA0"),b())}var sl=(()=>{class t{constructor(){this.nodeSelectionService=q(mr),this.metricsBarReadStore=q(mt),this.metricFor=H.required(),this.node=D(this.nodeSelectionService.createNodeObservable()),this.primaryMetricNames=D(this.metricsBarReadStore.primaryMetricNames$),this.metricName=Z(()=>this.primaryMetricNames()?.[this.metricFor()]??null),this.display=Z(()=>C5(this.node(),this.metricName(),this.metricFor()))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-meta-value"]],inputs:{metricFor:[1,"metricFor"]},decls:3,vars:1,consts:[[1,"flex","items-center","justify-center","gap-1","text-xs","leading-tight","min-h-4"],["aria-hidden","true"],[1,"opacity-60"],[3,"metricFor"],[1,"font-medium"],[1,"font-medium",3,"class"]],template:function(i,o){if(i&1&&(v(0,"div",0),O(1,S5,5,3)(2,y5,2,0,"span",1),b()),i&2){let r;h(),z((r=o.display())?1:2,r)}},dependencies:[al],encapsulation:2,changeDetection:0})}}return t})();function C5(t,n,e){return!t||!n?null:{value:M5(t,n),delta:_5(t,n,e)}}function M5(t,n){let e=t.attributes?.[n];return typeof e=="number"?e.toLocaleString():"\u2014"}function _5(t,n,e){if(!("deltas"in t)||!t.deltas)return null;let i=t.deltas[n];return typeof i!="number"?null:{label:i.toLocaleString(),styleClass:E5(i,e)}}function E5(t,n){return n==="heightMetric"&&t>0?"text-success":t<0?"text-error":"text-base-content"}var k5=new Map([["complexity",["formerly mcc"]],["sonar_complexity",["formerly mcc"]]]),c1=(()=>{class t{transform(e,i){let o=this.normalizeString(i.trim()),r=this.splitIntoWords(o);return e.filter(a=>{let s=this.normalizeString(this.getDisplayName(a.name));return this.matchesSearch(s,r)})}normalizeString(e){return e.toLocaleLowerCase().replace(/[_\-\s]+/g," ")}splitIntoWords(e){return e.split(" ").filter(i=>i.length>0)}getDisplayName(e){let i=k5.get(e);return i?`${e} ${i.join(" ")}`:e}matchesSearch(e,i){return i.length===0?!0:i.every(o=>e.includes(o))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=Xi({name:"filterMetricDataBySearchTerm",type:t,pure:!0})}}return t})();function q5(t,n){t&1&&(S(0,"span",3),g(1,"(formerly mcc)"),y())}function T5(t,n){t&1&&(S(0,"span",4),g(1),y()),t&2&&(h(),qe(n))}var d1=(()=>{class t{constructor(){this.option=H.required(),this.isActive=H(!1),this.isSelected=H(!1),this.descriptor=H(null),this.selectOption=Ce(),this.hovered=Ce()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-select-option"]],hostAttrs:[1,"contents"],inputs:{option:[1,"option"],isActive:[1,"isActive"],isSelected:[1,"isSelected"],descriptor:[1,"descriptor"]},outputs:{selectOption:"selectOption",hovered:"hovered"},decls:9,vars:14,consts:[["type","button",1,"flex","items-center","justify-between","gap-2","w-full","px-2","py-1","rounded","border-0","text-left","cursor-pointer",3,"click","mouseenter","title"],[1,"flex","flex-col","items-start","gap-0.5","min-w-0","flex-1"],[1,"truncate","w-full"],[1,"text-xs","opacity-50"],[1,"text-xs","opacity-60","truncate","w-full"],[1,"text-xs","opacity-60","shrink-0"]],template:function(i,o){if(i&1&&(S(0,"button",0),rt(1,"attributeDescriptorTooltip"),Y("click",function(){return o.selectOption.emit(o.option().name)})("mouseenter",function(){return o.hovered.emit()}),S(2,"span",1)(3,"span",2),g(4),O(5,q5,2,0,"span",3),y(),O(6,T5,2,1,"span",4),y(),S(7,"span",5),g(8),y()()),i&2){let r;St(o.isActive()?"bg-base-200":"bg-transparent hover:bg-base-200"),Le("font-semibold",o.isSelected()),le("title",gi(1,11,o.descriptor(),o.option().name)),dt("data-metric-name",o.option().name)("data-active",o.isActive()?"true":null),h(4),ge(" ",o.option().name," "),h(),z(o.option().name==="complexity"||o.option().name==="sonar_complexity"?5:-1),h(),z((r=(r=o.descriptor())==null?null:r.description)?6:-1,r),h(2),ge("(",o.option().maxValue,")")}},dependencies:[go],encapsulation:2,changeDetection:0})}}return t})();var I5=["searchInput"],D5=(t,n)=>n.name;function R5(t,n){if(t&1){let e=Me();v(0,"li",6)(1,"cc-metric-select-option",8),W("selectOption",function(o){ce(e);let r=A(2);return de(r.handleSelect(o))})("hovered",function(){let o=ce(e).$index,r=A(2);return de(r.activeIndex.set(o))}),b()()}if(t&2){let e=n.$implicit,i=n.$index,o=A(2);h(),F("option",e)("isActive",i===o.activeIndex())("isSelected",e.name===o.selected())("descriptor",o.attributeDescriptors()[e.name]??null)}}function A5(t,n){t&1&&(v(0,"li",7),g(1,"No metrics found"),b())}function F5(t,n){if(t&1&&(Pe(0,R5,2,4,"li",6,D5,!1,A5,2,0,"li",7),rt(3,"filterMetricDataBySearchTerm")),t&2){let e=A();Ne(gi(3,1,e.metricData(),e.searchTerm()))}}var pr=(()=>{class t{constructor(){this.metricsBarReadStore=q(mt),this.metricsLensFacade=q(zn),this.popoverId=H.required(),this.anchorName=H.required(),this.placeholder=H("Search metric"),this.kind=H("node"),this.selected=H(null),this.metricSelected=Ce(),this.shell=je.required(Wt),this.searchInput=je.required("searchInput"),this.searchTerm=be(""),this.activeIndex=be(0),this.isOpen=be(!1),this.metricDataState=D(this.metricsBarReadStore.metricData$,{initialValue:{nodeMetricData:[],edgeMetricData:[],nodeEdgeMetricsMap:new Map}}),this.attributeDescriptors=D(this.metricsLensFacade.descriptors$,{initialValue:{}}),this.metricData=Z(()=>{let e=this.metricDataState();return this.kind()==="edge"?e.edgeMetricData:e.nodeMetricData}),this.toggleListener=e=>{let i=e;this.isOpen.set(i.newState==="open"),i.newState==="open"&&(this.searchTerm.set(""),this.activeIndex.set(this.getSelectedMetricIndex()),queueMicrotask(()=>{this.searchInput().nativeElement.focus(),this.scrollActiveIntoView(this.popover().nativeElement)}))}}popover(){return this.shell().popover()}getSelectedMetricIndex(){let e=this.selected();if(!e)return 0;let i=this.metricData().findIndex(o=>o.name===e);return i===-1?0:i}ngAfterViewInit(){this.popover().nativeElement.addEventListener("toggle",this.toggleListener)}ngOnDestroy(){this.popover().nativeElement.removeEventListener("toggle",this.toggleListener)}handleSearchTermChange(e){this.searchTerm.set(e),this.activeIndex.set(0)}handleKeyDown(e){let i=this.popover().nativeElement,o=this.getFilteredItems(i);if(o.length!==0)switch(e.key){case"ArrowDown":e.preventDefault(),this.activeIndex.set(Math.min(o.length-1,this.activeIndex()+1)),this.scrollActiveIntoView(i);break;case"ArrowUp":e.preventDefault(),this.activeIndex.set(Math.max(0,this.activeIndex()-1)),this.scrollActiveIntoView(i);break;case"Enter":{e.preventDefault();let r=o[this.activeIndex()]?.dataset.metricName;r&&this.handleSelect(r);break}case"Escape":this.closePopover();break}}handleSelect(e){this.metricSelected.emit(e),this.closePopover()}closePopover(){let e=this.popover().nativeElement;e.matches(":popover-open")&&e.hidePopover()}getFilteredItems(e){return Array.from(e.querySelectorAll("[data-metric-name]"))}scrollActiveIntoView(e){this.getFilteredItems(e)[this.activeIndex()]?.scrollIntoView?.({block:"nearest"})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-select-popover"]],viewQuery:function(i,o){i&1&&tt(o.shell,Wt,5)(o.searchInput,I5,5),i&2&&it(2)},hostAttrs:[1,"contents"],inputs:{popoverId:[1,"popoverId"],anchorName:[1,"anchorName"],placeholder:[1,"placeholder"],kind:[1,"kind"],selected:[1,"selected"]},outputs:{metricSelected:"metricSelected"},decls:7,vars:6,consts:[["searchInput",""],["widthClass","w-80","contentClass","gap-2 p-2",3,"popoverId","anchorName","testId"],["aria-label","Search metrics",1,"input","input-sm","input-bordered","flex","items-center","gap-2"],[1,"fa","fa-search","opacity-60"],["type","text","autofocus","",1,"grow",3,"input","keydown","placeholder","value"],[1,"flex","flex-col","max-h-[440px]","overflow-y-auto","m-0","p-0","list-none"],[1,"flex"],[1,"px-2","py-3","text-xs","opacity-60"],[3,"selectOption","hovered","option","isActive","isSelected","descriptor"]],template:function(i,o){i&1&&(v(0,"cc-settings-popover-shell",1)(1,"label",2),L(2,"i",3),v(3,"input",4,0),W("input",function(a){return o.handleSearchTermChange(a.target.value)})("keydown",function(a){return o.handleKeyDown(a)}),b()(),v(5,"ul",5),O(6,F5,4,4),b()()),i&2&&(F("popoverId",o.popoverId())("anchorName",o.anchorName())("testId","metric-select-popover-"+o.anchorName()),h(3),F("placeholder",o.placeholder())("value",o.searchTerm()),h(3),z(o.isOpen()?6:-1))},dependencies:[co,Wt,d1,c1],encapsulation:2,changeDetection:0})}}return t})();var L5=["*"],ll=(()=>{class t{constructor(){this.label=H.required(),this.metricName=H(""),this.metricFor=H.required(),this.placeholder=H(""),this.searchPopoverId=H.required(),this.searchAnchorName=H.required(),this.settingsPopoverId=H.required(),this.settingsAnchorName=H.required(),this.testIdPrefix=H.required(),this.metricSelected=Ce()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-segment"]],hostAttrs:[1,"contents"],inputs:{label:[1,"label"],metricName:[1,"metricName"],metricFor:[1,"metricFor"],placeholder:[1,"placeholder"],searchPopoverId:[1,"searchPopoverId"],searchAnchorName:[1,"searchAnchorName"],settingsPopoverId:[1,"settingsPopoverId"],settingsAnchorName:[1,"settingsAnchorName"],testIdPrefix:[1,"testIdPrefix"]},outputs:{metricSelected:"metricSelected"},ngContentSelectors:L5,decls:5,vars:14,consts:[[3,"label","metricName","hasCog","cogPopoverId","cogAnchorName","searchPopoverId","searchAnchorName","testId","cogTestId"],["body","",1,"flex","flex-col","items-stretch","gap-1"],[3,"metricFor"],["kind","node",3,"metricSelected","popoverId","anchorName","placeholder","selected"]],template:function(i,o){i&1&&(Fm(),v(0,"cc-axis-card",0)(1,"div",1),L(2,"cc-metric-meta-value",2),b()(),v(3,"cc-metric-select-popover",3),W("metricSelected",function(a){return o.metricSelected.emit(a)}),b(),Lm(4)),i&2&&(F("label",o.label())("metricName",o.metricName())("hasCog",!0)("cogPopoverId",o.settingsPopoverId())("cogAnchorName",o.settingsAnchorName())("searchPopoverId",o.searchPopoverId())("searchAnchorName",o.searchAnchorName())("testId",o.testIdPrefix())("cogTestId",o.testIdPrefix()+"-cog"),h(2),F("metricFor",o.metricFor()),h(),F("popoverId",o.searchPopoverId())("anchorName",o.searchAnchorName())("placeholder",o.placeholder())("selected",o.metricName()))},dependencies:[lo,sl,pr],encapsulation:2,changeDetection:0})}}return t})();var h1=(()=>{class t{constructor(){this.searchPopoverId="metric-select-popover-area",this.searchAnchorName="metric-segment-area",this.settingsPopoverId="metric-settings-popover-area",this.settingsAnchorName="metric-segment-area-cog",this.mapStateReadWindow=q(ve),this.metricsBarWriteStore=q(Ze),this.areaMetric=D(this.mapStateReadWindow.areaMetric$,{initialValue:""})}handleMetricSelected(e){this.metricsBarWriteStore.setAreaMetric(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-area-segment"]],hostAttrs:[1,"contents"],decls:2,vars:7,consts:[["label","Area","metricFor","areaMetric","placeholder","Area Metric (highest value)","testIdPrefix","metric-segment-area",3,"metricSelected","metricName","searchPopoverId","searchAnchorName","settingsPopoverId","settingsAnchorName"],[3,"popoverId","anchorName"]],template:function(i,o){i&1&&(v(0,"cc-metric-segment",0),W("metricSelected",function(a){return o.handleMetricSelected(a)}),L(1,"cc-area-settings-popover",1),b()),i&2&&(F("metricName",o.areaMetric())("searchPopoverId",o.searchPopoverId)("searchAnchorName",o.searchAnchorName)("settingsPopoverId",o.settingsPopoverId)("settingsAnchorName",o.settingsAnchorName),h(),F("popoverId",o.settingsPopoverId)("anchorName",o.settingsAnchorName))},dependencies:[ll,l1],encapsulation:2,changeDetection:0})}}return t})();function P5(t,n){if(t&1&&(v(0,"span",3),g(1),b()),t&2){let e=A();h(),qe(e.count())}}var m1=(()=>{class t{constructor(e,i,o){this.mapStateReadWindow=e,this.metricsBarReadStore=i,this.metricsBarWriteStore=o,this.mapColorFor=H.required(),this.count=H(null),this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.colorRange=D(this.mapStateReadWindow.colorRange$,{initialValue:{from:0,to:0}}),this.nodeMetricRange=D(this.metricsBarReadStore.selectedColorMetricData$,{initialValue:{values:[],minValue:0,maxValue:0}}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Lt}),this.color=Z(()=>this.mapColors()[this.mapColorFor()])}handleColorChange(e){this.metricsBarWriteStore.setMapColors({[this.mapColorFor()]:e})}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(mt),te(Ze))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-color-band-row"]],inputs:{mapColorFor:[1,"mapColorFor"],count:[1,"count"]},decls:6,vars:9,consts:[[1,"flex","items-center","gap-2"],[3,"colorChange","hexColor","ariaLabel"],[1,"min-w-0","flex-1","truncate","text-sm"],[1,"text-xs","opacity-60","tabular-nums"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"cc-inline-color-picker",1),W("colorChange",function(a){return o.handleColorChange(a)}),b(),v(2,"span",2),g(3),rt(4,"mapColorLabel"),b(),O(5,P5,2,1,"span",3),b()),i&2&&(h(),F("hexColor",o.color())("ariaLabel","Recolor "+o.mapColorFor()),h(2),ge(" ",Aa(4,4,o.mapColorFor(),o.colorRange(),o.nodeMetricRange(),o.colorMetric())," "),h(2),z(o.count()!==null?5:-1))},dependencies:[ho,rl],encapsulation:2,changeDetection:0})}}return t})();function N5(t,n){if(t&1&&L(0,"cc-color-band-row",3)(1,"cc-color-band-row",4)(2,"cc-color-band-row",5),t&2){let e=A();F("count",e.colorCategoryCounts().positive),h(),F("count",e.colorCategoryCounts().neutral),h(),F("count",e.colorCategoryCounts().negative)}}function B5(t,n){t&1&&L(0,"cc-color-band-row",6)(1,"cc-color-band-row",7)}var p1=(()=>{class t{constructor(e,i){this.fileStoreReadWindow=e,this.colorCategoryCountsStore=i,this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.colorCategoryCounts=D(this.colorCategoryCountsStore.colorCategoryCounts$,{initialValue:{positive:0,neutral:0,negative:0}})}static{this.\u0275fac=function(i){return new(i||t)(te(Te),te(Xn))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-color-bands-section"]],hostAttrs:[1,"contents"],decls:6,vars:1,consts:[[1,"flex","flex-col","gap-1"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],["mapColorFor","selected"],["mapColorFor","positive",3,"count"],["mapColorFor","neutral",3,"count"],["mapColorFor","negative",3,"count"],["mapColorFor","positiveDelta"],["mapColorFor","negativeDelta"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Bands"),b(),O(3,N5,3,3)(4,B5,2,0),L(5,"cc-color-band-row",2),b()),i&2&&(h(3),z(o.isDeltaState()?4:3))},dependencies:[m1],encapsulation:2,changeDetection:0})}}return t})();function Oo(t,n){return t==null||n==null?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function Dd(t,n){return t==null||n==null?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function cl(t){let n,e,i;t.length!==2?(n=Oo,e=(s,l)=>Oo(t(s),l),i=(s,l)=>t(s)-l):(n=t===Oo||t===Dd?t:V5,e=t,i=t);function o(s,l,d=0,c=s.length){if(d<c){if(n(l,l)!==0)return c;do{let m=d+c>>>1;e(s[m],l)<0?d=m+1:c=m}while(d<c)}return d}function r(s,l,d=0,c=s.length){if(d<c){if(n(l,l)!==0)return c;do{let m=d+c>>>1;e(s[m],l)<=0?d=m+1:c=m}while(d<c)}return d}function a(s,l,d=0,c=s.length){let m=o(s,l,d,c-1);return m>d&&i(s[m-1],l)>-i(s[m],l)?m-1:m}return{left:o,center:a,right:r}}function V5(){return 0}function Rd(t){return t===null?NaN:+t}var u1=cl(Oo),f1=u1.right,W5=u1.left,O5=cl(Rd).center,Ad=f1;function dl(t,n){let e,i;if(n===void 0)for(let o of t)o!=null&&(e===void 0?o>=o&&(e=i=o):(e>o&&(e=o),i<o&&(i=o)));else{let o=-1;for(let r of t)(r=n(r,++o,t))!=null&&(e===void 0?r>=r&&(e=i=r):(e>r&&(e=r),i<r&&(i=r)))}return[e,i]}var z5=Math.sqrt(50),$5=Math.sqrt(10),j5=Math.sqrt(2);function hl(t,n,e){let i=(n-t)/Math.max(0,e),o=Math.floor(Math.log10(i)),r=i/Math.pow(10,o),a=r>=z5?10:r>=$5?5:r>=j5?2:1,s,l,d;return o<0?(d=Math.pow(10,-o)/a,s=Math.round(t*d),l=Math.round(n*d),s/d<t&&++s,l/d>n&&--l,d=-d):(d=Math.pow(10,o)*a,s=Math.round(t/d),l=Math.round(n/d),s*d<t&&++s,l*d>n&&--l),l<s&&.5<=e&&e<2?hl(t,n,e*2):[s,l,d]}function ml(t,n,e){if(n=+n,t=+t,e=+e,!(e>0))return[];if(t===n)return[t];let i=n<t,[o,r,a]=i?hl(n,t,e):hl(t,n,e);if(!(r>=o))return[];let s=r-o+1,l=new Array(s);if(i)if(a<0)for(let d=0;d<s;++d)l[d]=(r-d)/-a;else for(let d=0;d<s;++d)l[d]=(r-d)*a;else if(a<0)for(let d=0;d<s;++d)l[d]=(o+d)/-a;else for(let d=0;d<s;++d)l[d]=(o+d)*a;return l}function Hr(t,n,e){return n=+n,t=+t,e=+e,hl(t,n,e)[2]}function Fd(t,n,e){n=+n,t=+t,e=+e;let i=n<t,o=i?Hr(n,t,e):Hr(t,n,e);return(i?-1:1)*(o<0?1/-o:o)}function Ur(t,n){let e;if(n===void 0)for(let i of t)i!=null&&(e<i||e===void 0&&i>=i)&&(e=i);else{let i=-1;for(let o of t)(o=n(o,++i,t))!=null&&(e<o||e===void 0&&o>=o)&&(e=o)}return e}function g1(t){return t}var Ld=1,Pd=2,Nd=3,Gr=4,b1=1e-6;function H5(t){return"translate("+t+",0)"}function U5(t){return"translate(0,"+t+")"}function G5(t){return n=>+t(n)}function X5(t,n){return n=Math.max(0,t.bandwidth()-n*2)/2,t.round()&&(n=Math.round(n)),e=>+t(e)+n}function Q5(){return!this.__axis}function v1(t,n){var e=[],i=null,o=null,r=6,a=6,s=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,d=t===Ld||t===Gr?-1:1,c=t===Gr||t===Pd?"x":"y",m=t===Ld||t===Nd?H5:U5;function p(u){var k=i??(n.ticks?n.ticks.apply(n,e):n.domain()),E=o??(n.tickFormat?n.tickFormat.apply(n,e):g1),P=Math.max(r,0)+s,$=n.range(),ee=+$[0]+l,B=+$[$.length-1]+l,j=(n.bandwidth?X5:G5)(n.copy(),l),G=u.selection?u.selection():u,K=G.selectAll(".domain").data([null]),ie=G.selectAll(".tick").data(k,n).order(),oe=ie.exit(),ne=ie.enter().append("g").attr("class","tick"),_e=ie.select("line"),He=ie.select("text");K=K.merge(K.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),ie=ie.merge(ne),_e=_e.merge(ne.append("line").attr("stroke","currentColor").attr(c+"2",d*r)),He=He.merge(ne.append("text").attr("fill","currentColor").attr(c,d*P).attr("dy",t===Ld?"0em":t===Nd?"0.71em":"0.32em")),u!==G&&(K=K.transition(u),ie=ie.transition(u),_e=_e.transition(u),He=He.transition(u),oe=oe.transition(u).attr("opacity",b1).attr("transform",function(U){return isFinite(U=j(U))?m(U+l):this.getAttribute("transform")}),ne.attr("opacity",b1).attr("transform",function(U){var De=this.parentNode.__axis;return m((De&&isFinite(De=De(U))?De:j(U))+l)})),oe.remove(),K.attr("d",t===Gr||t===Pd?a?"M"+d*a+","+ee+"H"+l+"V"+B+"H"+d*a:"M"+l+","+ee+"V"+B:a?"M"+ee+","+d*a+"V"+l+"H"+B+"V"+d*a:"M"+ee+","+l+"H"+B),ie.attr("opacity",1).attr("transform",function(U){return m(j(U)+l)}),_e.attr(c+"2",d*r),He.attr(c,d*P).text(E),G.filter(Q5).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Pd?"start":t===Gr?"end":"middle"),G.each(function(){this.__axis=j})}return p.scale=function(u){return arguments.length?(n=u,p):n},p.ticks=function(){return e=Array.from(arguments),p},p.tickArguments=function(u){return arguments.length?(e=u==null?[]:Array.from(u),p):e.slice()},p.tickValues=function(u){return arguments.length?(i=u==null?null:Array.from(u),p):i&&i.slice()},p.tickFormat=function(u){return arguments.length?(o=u,p):o},p.tickSize=function(u){return arguments.length?(r=a=+u,p):r},p.tickSizeInner=function(u){return arguments.length?(r=+u,p):r},p.tickSizeOuter=function(u){return arguments.length?(a=+u,p):a},p.tickPadding=function(u){return arguments.length?(s=+u,p):s},p.offset=function(u){return arguments.length?(l=+u,p):l},p}function Bd(t){return v1(Nd,t)}function Vd(t){return v1(Gr,t)}var Y5={value:()=>{}};function w1(){for(var t=0,n=arguments.length,e={},i;t<n;++t){if(!(i=arguments[t]+"")||i in e||/[\s.]/.test(i))throw new Error("illegal type: "+i);e[i]=[]}return new pl(e)}function pl(t){this._=t}function Z5(t,n){return t.trim().split(/^|\s+/).map(function(e){var i="",o=e.indexOf(".");if(o>=0&&(i=e.slice(o+1),e=e.slice(0,o)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:i}})}pl.prototype=w1.prototype={constructor:pl,on:function(t,n){var e=this._,i=Z5(t+"",e),o,r=-1,a=i.length;if(arguments.length<2){for(;++r<a;)if((o=(t=i[r]).type)&&(o=K5(e[o],t.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++r<a;)if(o=(t=i[r]).type)e[o]=x1(e[o],t.name,n);else if(n==null)for(o in e)e[o]=x1(e[o],t.name,null);return this},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new pl(t)},call:function(t,n){if((o=arguments.length-2)>0)for(var e=new Array(o),i=0,o,r;i<o;++i)e[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],o=0,r=i.length;o<r;++o)i[o].value.apply(n,e)}};function K5(t,n){for(var e=0,i=t.length,o;e<i;++e)if((o=t[e]).name===n)return o.value}function x1(t,n,e){for(var i=0,o=t.length;i<o;++i)if(t[i].name===n){t[i]=Y5,t=t.slice(0,i).concat(t.slice(i+1));break}return e!=null&&t.push({name:n,value:e}),t}var Wd=w1;var ul="http://www.w3.org/1999/xhtml",Od={svg:"http://www.w3.org/2000/svg",xhtml:ul,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ni(t){var n=t+="",e=n.indexOf(":");return e>=0&&(n=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),Od.hasOwnProperty(n)?{space:Od[n],local:t}:t}function J5(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===ul&&n.documentElement.namespaceURI===ul?n.createElement(t):n.createElementNS(e,t)}}function e6(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function fl(t){var n=Ni(t);return(n.local?e6:J5)(n)}function t6(){}function zo(t){return t==null?t6:function(){return this.querySelector(t)}}function S1(t){typeof t!="function"&&(t=zo(t));for(var n=this._groups,e=n.length,i=new Array(e),o=0;o<e;++o)for(var r=n[o],a=r.length,s=i[o]=new Array(a),l,d,c=0;c<a;++c)(l=r[c])&&(d=t.call(l,l.__data__,c,r))&&("__data__"in l&&(d.__data__=l.__data__),s[c]=d);return new pt(i,this._parents)}function zd(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function i6(){return[]}function Xr(t){return t==null?i6:function(){return this.querySelectorAll(t)}}function o6(t){return function(){return zd(t.apply(this,arguments))}}function y1(t){typeof t=="function"?t=o6(t):t=Xr(t);for(var n=this._groups,e=n.length,i=[],o=[],r=0;r<e;++r)for(var a=n[r],s=a.length,l,d=0;d<s;++d)(l=a[d])&&(i.push(t.call(l,l.__data__,d,a)),o.push(l));return new pt(i,o)}function Qr(t){return function(){return this.matches(t)}}function gl(t){return function(n){return n.matches(t)}}var n6=Array.prototype.find;function r6(t){return function(){return n6.call(this.children,t)}}function a6(){return this.firstElementChild}function C1(t){return this.select(t==null?a6:r6(typeof t=="function"?t:gl(t)))}var s6=Array.prototype.filter;function l6(){return Array.from(this.children)}function c6(t){return function(){return s6.call(this.children,t)}}function M1(t){return this.selectAll(t==null?l6:c6(typeof t=="function"?t:gl(t)))}function _1(t){typeof t!="function"&&(t=Qr(t));for(var n=this._groups,e=n.length,i=new Array(e),o=0;o<e;++o)for(var r=n[o],a=r.length,s=i[o]=[],l,d=0;d<a;++d)(l=r[d])&&t.call(l,l.__data__,d,r)&&s.push(l);return new pt(i,this._parents)}function bl(t){return new Array(t.length)}function E1(){return new pt(this._enter||this._groups.map(bl),this._parents)}function Yr(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}Yr.prototype={constructor:Yr,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function k1(t){return function(){return t}}function d6(t,n,e,i,o,r){for(var a=0,s,l=n.length,d=r.length;a<d;++a)(s=n[a])?(s.__data__=r[a],i[a]=s):e[a]=new Yr(t,r[a]);for(;a<l;++a)(s=n[a])&&(o[a]=s)}function h6(t,n,e,i,o,r,a){var s,l,d=new Map,c=n.length,m=r.length,p=new Array(c),u;for(s=0;s<c;++s)(l=n[s])&&(p[s]=u=a.call(l,l.__data__,s,n)+"",d.has(u)?o[s]=l:d.set(u,l));for(s=0;s<m;++s)u=a.call(t,r[s],s,r)+"",(l=d.get(u))?(i[s]=l,l.__data__=r[s],d.delete(u)):e[s]=new Yr(t,r[s]);for(s=0;s<c;++s)(l=n[s])&&d.get(p[s])===l&&(o[s]=l)}function m6(t){return t.__data__}function q1(t,n){if(!arguments.length)return Array.from(this,m6);var e=n?h6:d6,i=this._parents,o=this._groups;typeof t!="function"&&(t=k1(t));for(var r=o.length,a=new Array(r),s=new Array(r),l=new Array(r),d=0;d<r;++d){var c=i[d],m=o[d],p=m.length,u=p6(t.call(c,c&&c.__data__,d,i)),k=u.length,E=s[d]=new Array(k),P=a[d]=new Array(k),$=l[d]=new Array(p);e(c,m,E,P,$,u,n);for(var ee=0,B=0,j,G;ee<k;++ee)if(j=E[ee]){for(ee>=B&&(B=ee+1);!(G=P[B])&&++B<k;);j._next=G||null}}return a=new pt(a,i),a._enter=s,a._exit=l,a}function p6(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function T1(){return new pt(this._exit||this._groups.map(bl),this._parents)}function I1(t,n,e){var i=this.enter(),o=this,r=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),n!=null&&(o=n(o),o&&(o=o.selection())),e==null?r.remove():e(r),i&&o?i.merge(o).order():o}function D1(t){for(var n=t.selection?t.selection():t,e=this._groups,i=n._groups,o=e.length,r=i.length,a=Math.min(o,r),s=new Array(o),l=0;l<a;++l)for(var d=e[l],c=i[l],m=d.length,p=s[l]=new Array(m),u,k=0;k<m;++k)(u=d[k]||c[k])&&(p[k]=u);for(;l<o;++l)s[l]=e[l];return new pt(s,this._parents)}function R1(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var i=t[n],o=i.length-1,r=i[o],a;--o>=0;)(a=i[o])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function A1(t){t||(t=u6);function n(m,p){return m&&p?t(m.__data__,p.__data__):!m-!p}for(var e=this._groups,i=e.length,o=new Array(i),r=0;r<i;++r){for(var a=e[r],s=a.length,l=o[r]=new Array(s),d,c=0;c<s;++c)(d=a[c])&&(l[c]=d);l.sort(n)}return new pt(o,this._parents).order()}function u6(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function F1(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function L1(){return Array.from(this)}function P1(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var i=t[n],o=0,r=i.length;o<r;++o){var a=i[o];if(a)return a}return null}function N1(){let t=0;for(let n of this)++t;return t}function B1(){return!this.node()}function V1(t){for(var n=this._groups,e=0,i=n.length;e<i;++e)for(var o=n[e],r=0,a=o.length,s;r<a;++r)(s=o[r])&&t.call(s,s.__data__,r,o);return this}function f6(t){return function(){this.removeAttribute(t)}}function g6(t){return function(){this.removeAttributeNS(t.space,t.local)}}function b6(t,n){return function(){this.setAttribute(t,n)}}function v6(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function x6(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}}function w6(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function W1(t,n){var e=Ni(t);if(arguments.length<2){var i=this.node();return e.local?i.getAttributeNS(e.space,e.local):i.getAttribute(e)}return this.each((n==null?e.local?g6:f6:typeof n=="function"?e.local?w6:x6:e.local?v6:b6)(e,n))}function vl(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function S6(t){return function(){this.style.removeProperty(t)}}function y6(t,n,e){return function(){this.style.setProperty(t,n,e)}}function C6(t,n,e){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,e)}}function O1(t,n,e){return arguments.length>1?this.each((n==null?S6:typeof n=="function"?C6:y6)(t,n,e??"")):vo(this.node(),t)}function vo(t,n){return t.style.getPropertyValue(n)||vl(t).getComputedStyle(t,null).getPropertyValue(n)}function M6(t){return function(){delete this[t]}}function _6(t,n){return function(){this[t]=n}}function E6(t,n){return function(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}}function z1(t,n){return arguments.length>1?this.each((n==null?M6:typeof n=="function"?E6:_6)(t,n)):this.node()[t]}function $1(t){return t.trim().split(/^|\s+/)}function $d(t){return t.classList||new j1(t)}function j1(t){this._node=t,this._names=$1(t.getAttribute("class")||"")}j1.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function H1(t,n){for(var e=$d(t),i=-1,o=n.length;++i<o;)e.add(n[i])}function U1(t,n){for(var e=$d(t),i=-1,o=n.length;++i<o;)e.remove(n[i])}function k6(t){return function(){H1(this,t)}}function q6(t){return function(){U1(this,t)}}function T6(t,n){return function(){(n.apply(this,arguments)?H1:U1)(this,t)}}function G1(t,n){var e=$1(t+"");if(arguments.length<2){for(var i=$d(this.node()),o=-1,r=e.length;++o<r;)if(!i.contains(e[o]))return!1;return!0}return this.each((typeof n=="function"?T6:n?k6:q6)(e,n))}function I6(){this.textContent=""}function D6(t){return function(){this.textContent=t}}function R6(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function X1(t){return arguments.length?this.each(t==null?I6:(typeof t=="function"?R6:D6)(t)):this.node().textContent}function A6(){this.innerHTML=""}function F6(t){return function(){this.innerHTML=t}}function L6(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function Q1(t){return arguments.length?this.each(t==null?A6:(typeof t=="function"?L6:F6)(t)):this.node().innerHTML}function P6(){this.nextSibling&&this.parentNode.appendChild(this)}function Y1(){return this.each(P6)}function N6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Z1(){return this.each(N6)}function K1(t){var n=typeof t=="function"?t:fl(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function B6(){return null}function J1(t,n){var e=typeof t=="function"?t:fl(t),i=n==null?B6:typeof n=="function"?n:zo(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),i.apply(this,arguments)||null)})}function V6(){var t=this.parentNode;t&&t.removeChild(this)}function e2(){return this.each(V6)}function W6(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function O6(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function t2(t){return this.select(t?O6:W6)}function i2(t){return arguments.length?this.property("__data__",t):this.node().__data__}function z6(t){return function(n){t.call(this,n,this.__data__)}}function $6(t){return t.trim().split(/^|\s+/).map(function(n){var e="",i=n.indexOf(".");return i>=0&&(e=n.slice(i+1),n=n.slice(0,i)),{type:n,name:e}})}function j6(t){return function(){var n=this.__on;if(n){for(var e=0,i=-1,o=n.length,r;e<o;++e)r=n[e],(!t.type||r.type===t.type)&&r.name===t.name?this.removeEventListener(r.type,r.listener,r.options):n[++i]=r;++i?n.length=i:delete this.__on}}}function H6(t,n,e){return function(){var i=this.__on,o,r=z6(n);if(i){for(var a=0,s=i.length;a<s;++a)if((o=i[a]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=r,o.options=e),o.value=n;return}}this.addEventListener(t.type,r,e),o={type:t.type,name:t.name,value:n,listener:r,options:e},i?i.push(o):this.__on=[o]}}function o2(t,n,e){var i=$6(t+""),o,r=i.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,d=s.length,c;l<d;++l)for(o=0,c=s[l];o<r;++o)if((a=i[o]).type===c.type&&a.name===c.name)return c.value}return}for(s=n?H6:j6,o=0;o<r;++o)this.each(s(i[o],n,e));return this}function n2(t,n,e){var i=vl(t),o=i.CustomEvent;typeof o=="function"?o=new o(n,e):(o=i.document.createEvent("Event"),e?(o.initEvent(n,e.bubbles,e.cancelable),o.detail=e.detail):o.initEvent(n,!1,!1)),t.dispatchEvent(o)}function U6(t,n){return function(){return n2(this,t,n)}}function G6(t,n){return function(){return n2(this,t,n.apply(this,arguments))}}function r2(t,n){return this.each((typeof n=="function"?G6:U6)(t,n))}function*a2(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var i=t[n],o=0,r=i.length,a;o<r;++o)(a=i[o])&&(yield a)}var jd=[null];function pt(t,n){this._groups=t,this._parents=n}function s2(){return new pt([[document.documentElement]],jd)}function X6(){return this}pt.prototype=s2.prototype={constructor:pt,select:S1,selectAll:y1,selectChild:C1,selectChildren:M1,filter:_1,data:q1,enter:E1,exit:T1,join:I1,merge:D1,selection:X6,order:R1,sort:A1,call:F1,nodes:L1,node:P1,size:N1,empty:B1,each:V1,attr:W1,style:O1,property:z1,classed:G1,text:X1,html:Q1,raise:Y1,lower:Z1,append:K1,insert:J1,remove:e2,clone:t2,datum:i2,on:o2,dispatch:r2,[Symbol.iterator]:a2};var Bi=s2;function Hd(t){return typeof t=="string"?new pt([[document.querySelector(t)]],[document.documentElement]):new pt([[t]],jd)}function l2(t){let n;for(;n=t.sourceEvent;)t=n;return t}function Ud(t,n){if(t=l2(t),n===void 0&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var i=e.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[t.clientX-o.left-n.clientLeft,t.clientY-o.top-n.clientTop]}}return[t.pageX,t.pageY]}function xl(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Gd(t,n){var e=Object.create(t.prototype);for(var i in n)e[i]=n[i];return e}function Jr(){}var Zr=.7,yl=1/Zr,ur="\\s*([+-]?\\d+)\\s*",Kr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ti="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q6=/^#([0-9a-f]{3,8})$/,Y6=new RegExp(`^rgb\\(${ur},${ur},${ur}\\)$`),Z6=new RegExp(`^rgb\\(${Ti},${Ti},${Ti}\\)$`),K6=new RegExp(`^rgba\\(${ur},${ur},${ur},${Kr}\\)$`),J6=new RegExp(`^rgba\\(${Ti},${Ti},${Ti},${Kr}\\)$`),eS=new RegExp(`^hsl\\(${Kr},${Ti},${Ti}\\)$`),tS=new RegExp(`^hsla\\(${Kr},${Ti},${Ti},${Kr}\\)$`),c2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};xl(Jr,ci,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:d2,formatHex:d2,formatHex8:iS,formatHsl:oS,formatRgb:h2,toString:h2});function d2(){return this.rgb().formatHex()}function iS(){return this.rgb().formatHex8()}function oS(){return b2(this).formatHsl()}function h2(){return this.rgb().formatRgb()}function ci(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Q6.exec(t))?(e=n[1].length,n=parseInt(n[1],16),e===6?m2(n):e===3?new Ot(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):e===8?wl(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):e===4?wl(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Y6.exec(t))?new Ot(n[1],n[2],n[3],1):(n=Z6.exec(t))?new Ot(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=K6.exec(t))?wl(n[1],n[2],n[3],n[4]):(n=J6.exec(t))?wl(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=eS.exec(t))?f2(n[1],n[2]/100,n[3]/100,1):(n=tS.exec(t))?f2(n[1],n[2]/100,n[3]/100,n[4]):c2.hasOwnProperty(t)?m2(c2[t]):t==="transparent"?new Ot(NaN,NaN,NaN,0):null}function m2(t){return new Ot(t>>16&255,t>>8&255,t&255,1)}function wl(t,n,e,i){return i<=0&&(t=n=e=NaN),new Ot(t,n,e,i)}function nS(t){return t instanceof Jr||(t=ci(t)),t?(t=t.rgb(),new Ot(t.r,t.g,t.b,t.opacity)):new Ot}function fr(t,n,e,i){return arguments.length===1?nS(t):new Ot(t,n,e,i??1)}function Ot(t,n,e,i){this.r=+t,this.g=+n,this.b=+e,this.opacity=+i}xl(Ot,fr,Gd(Jr,{brighter(t){return t=t==null?yl:Math.pow(yl,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Zr:Math.pow(Zr,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ot(jo(this.r),jo(this.g),jo(this.b),Cl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:p2,formatHex:p2,formatHex8:rS,formatRgb:u2,toString:u2}));function p2(){return`#${$o(this.r)}${$o(this.g)}${$o(this.b)}`}function rS(){return`#${$o(this.r)}${$o(this.g)}${$o(this.b)}${$o((isNaN(this.opacity)?1:this.opacity)*255)}`}function u2(){let t=Cl(this.opacity);return`${t===1?"rgb(":"rgba("}${jo(this.r)}, ${jo(this.g)}, ${jo(this.b)}${t===1?")":`, ${t})`}`}function Cl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function jo(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function $o(t){return t=jo(t),(t<16?"0":"")+t.toString(16)}function f2(t,n,e,i){return i<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new li(t,n,e,i)}function b2(t){if(t instanceof li)return new li(t.h,t.s,t.l,t.opacity);if(t instanceof Jr||(t=ci(t)),!t)return new li;if(t instanceof li)return t;t=t.rgb();var n=t.r/255,e=t.g/255,i=t.b/255,o=Math.min(n,e,i),r=Math.max(n,e,i),a=NaN,s=r-o,l=(r+o)/2;return s?(n===r?a=(e-i)/s+(e<i)*6:e===r?a=(i-n)/s+2:a=(n-e)/s+4,s/=l<.5?r+o:2-r-o,a*=60):s=l>0&&l<1?0:a,new li(a,s,l,t.opacity)}function v2(t,n,e,i){return arguments.length===1?b2(t):new li(t,n,e,i??1)}function li(t,n,e,i){this.h=+t,this.s=+n,this.l=+e,this.opacity=+i}xl(li,v2,Gd(Jr,{brighter(t){return t=t==null?yl:Math.pow(yl,t),new li(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Zr:Math.pow(Zr,t),new li(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*n,o=2*e-i;return new Ot(Xd(t>=240?t-240:t+120,o,i),Xd(t,o,i),Xd(t<120?t+240:t-120,o,i),this.opacity)},clamp(){return new li(g2(this.h),Sl(this.s),Sl(this.l),Cl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Cl(this.opacity);return`${t===1?"hsl(":"hsla("}${g2(this.h)}, ${Sl(this.s)*100}%, ${Sl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function g2(t){return t=(t||0)%360,t<0?t+360:t}function Sl(t){return Math.max(0,Math.min(1,t||0))}function Xd(t,n,e){return(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)*255}function Qd(t,n,e,i,o){var r=t*t,a=r*t;return((1-3*t+3*r-a)*n+(4-6*r+3*a)*e+(1+3*t+3*r-3*a)*i+a*o)/6}function x2(t){var n=t.length-1;return function(e){var i=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),o=t[i],r=t[i+1],a=i>0?t[i-1]:2*o-r,s=i<n-1?t[i+2]:2*r-o;return Qd((e-i/n)*n,a,o,r,s)}}function w2(t){var n=t.length;return function(e){var i=Math.floor(((e%=1)<0?++e:e)*n),o=t[(i+n-1)%n],r=t[i%n],a=t[(i+1)%n],s=t[(i+2)%n];return Qd((e-i/n)*n,o,r,a,s)}}var ea=t=>()=>t;function aS(t,n){return function(e){return t+e*n}}function sS(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(i){return Math.pow(t+i*n,e)}}function S2(t){return(t=+t)==1?Ml:function(n,e){return e-n?sS(n,e,t):ea(isNaN(n)?e:n)}}function Ml(t,n){var e=n-t;return e?aS(t,e):ea(isNaN(t)?n:t)}var Ho=(function t(n){var e=S2(n);function i(o,r){var a=e((o=fr(o)).r,(r=fr(r)).r),s=e(o.g,r.g),l=e(o.b,r.b),d=Ml(o.opacity,r.opacity);return function(c){return o.r=a(c),o.g=s(c),o.b=l(c),o.opacity=d(c),o+""}}return i.gamma=t,i})(1);function y2(t){return function(n){var e=n.length,i=new Array(e),o=new Array(e),r=new Array(e),a,s;for(a=0;a<e;++a)s=fr(n[a]),i[a]=s.r||0,o[a]=s.g||0,r[a]=s.b||0;return i=t(i),o=t(o),r=t(r),s.opacity=1,function(l){return s.r=i(l),s.g=o(l),s.b=r(l),s+""}}}var lS=y2(x2),cS=y2(w2);function C2(t,n){n||(n=[]);var e=t?Math.min(n.length,t.length):0,i=n.slice(),o;return function(r){for(o=0;o<e;++o)i[o]=t[o]*(1-r)+n[o]*r;return i}}function M2(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function _2(t,n){var e=n?n.length:0,i=t?Math.min(e,t.length):0,o=new Array(i),r=new Array(e),a;for(a=0;a<i;++a)o[a]=Uo(t[a],n[a]);for(;a<e;++a)r[a]=n[a];return function(s){for(a=0;a<i;++a)r[a]=o[a](s);return r}}function E2(t,n){var e=new Date;return t=+t,n=+n,function(i){return e.setTime(t*(1-i)+n*i),e}}function yt(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function k2(t,n){var e={},i={},o;(t===null||typeof t!="object")&&(t={}),(n===null||typeof n!="object")&&(n={});for(o in n)o in t?e[o]=Uo(t[o],n[o]):i[o]=n[o];return function(r){for(o in e)i[o]=e[o](r);return i}}var Zd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yd=new RegExp(Zd.source,"g");function dS(t){return function(){return t}}function hS(t){return function(n){return t(n)+""}}function ta(t,n){var e=Zd.lastIndex=Yd.lastIndex=0,i,o,r,a=-1,s=[],l=[];for(t=t+"",n=n+"";(i=Zd.exec(t))&&(o=Yd.exec(n));)(r=o.index)>e&&(r=n.slice(e,r),s[a]?s[a]+=r:s[++a]=r),(i=i[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:yt(i,o)})),e=Yd.lastIndex;return e<n.length&&(r=n.slice(e),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?hS(l[0].x):dS(n):(n=l.length,function(d){for(var c=0,m;c<n;++c)s[(m=l[c]).i]=m.x(d);return s.join("")})}function Uo(t,n){var e=typeof n,i;return n==null||e==="boolean"?ea(n):(e==="number"?yt:e==="string"?(i=ci(n))?(n=i,Ho):ta:n instanceof ci?Ho:n instanceof Date?E2:M2(n)?C2:Array.isArray(n)?_2:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?k2:yt)(t,n)}function Kd(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}var q2=180/Math.PI,_l={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Jd(t,n,e,i,o,r){var a,s,l;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(l=t*e+n*i)&&(e-=t*l,i-=n*l),(s=Math.sqrt(e*e+i*i))&&(e/=s,i/=s,l/=s),t*i<n*e&&(t=-t,n=-n,l=-l,a=-a),{translateX:o,translateY:r,rotate:Math.atan2(n,t)*q2,skewX:Math.atan(l)*q2,scaleX:a,scaleY:s}}var El;function T2(t){let n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?_l:Jd(n.a,n.b,n.c,n.d,n.e,n.f)}function I2(t){return t==null?_l:(El||(El=document.createElementNS("http://www.w3.org/2000/svg","g")),El.setAttribute("transform",t),(t=El.transform.baseVal.consolidate())?(t=t.matrix,Jd(t.a,t.b,t.c,t.d,t.e,t.f)):_l)}function D2(t,n,e,i){function o(d){return d.length?d.pop()+" ":""}function r(d,c,m,p,u,k){if(d!==m||c!==p){var E=u.push("translate(",null,n,null,e);k.push({i:E-4,x:yt(d,m)},{i:E-2,x:yt(c,p)})}else(m||p)&&u.push("translate("+m+n+p+e)}function a(d,c,m,p){d!==c?(d-c>180?c+=360:c-d>180&&(d+=360),p.push({i:m.push(o(m)+"rotate(",null,i)-2,x:yt(d,c)})):c&&m.push(o(m)+"rotate("+c+i)}function s(d,c,m,p){d!==c?p.push({i:m.push(o(m)+"skewX(",null,i)-2,x:yt(d,c)}):c&&m.push(o(m)+"skewX("+c+i)}function l(d,c,m,p,u,k){if(d!==m||c!==p){var E=u.push(o(u)+"scale(",null,",",null,")");k.push({i:E-4,x:yt(d,m)},{i:E-2,x:yt(c,p)})}else(m!==1||p!==1)&&u.push(o(u)+"scale("+m+","+p+")")}return function(d,c){var m=[],p=[];return d=t(d),c=t(c),r(d.translateX,d.translateY,c.translateX,c.translateY,m,p),a(d.rotate,c.rotate,m,p),s(d.skewX,c.skewX,m,p),l(d.scaleX,d.scaleY,c.scaleX,c.scaleY,m,p),d=c=null,function(u){for(var k=-1,E=p.length,P;++k<E;)m[(P=p[k]).i]=P.x(u);return m.join("")}}}var eh=D2(T2,"px, ","px)","deg)"),th=D2(I2,", ",")",")");var gr=0,oa=0,ia=0,A2=1e3,kl,na,ql=0,Go=0,Tl=0,ra=typeof performance=="object"&&performance.now?performance:Date,F2=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function sa(){return Go||(F2(mS),Go=ra.now()+Tl)}function mS(){Go=0}function aa(){this._call=this._time=this._next=null}aa.prototype=Il.prototype={constructor:aa,restart:function(t,n,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?sa():+e)+(n==null?0:+n),!this._next&&na!==this&&(na?na._next=this:kl=this,na=this),this._call=t,this._time=e,ih()},stop:function(){this._call&&(this._call=null,this._time=1/0,ih())}};function Il(t,n,e){var i=new aa;return i.restart(t,n,e),i}function L2(){sa(),++gr;for(var t=kl,n;t;)(n=Go-t._time)>=0&&t._call.call(void 0,n),t=t._next;--gr}function R2(){Go=(ql=ra.now())+Tl,gr=oa=0;try{L2()}finally{gr=0,uS(),Go=0}}function pS(){var t=ra.now(),n=t-ql;n>A2&&(Tl-=n,ql=t)}function uS(){for(var t,n=kl,e,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:kl=e);na=t,ih(i)}function ih(t){if(!gr){oa&&(oa=clearTimeout(oa));var n=t-Go;n>24?(t<1/0&&(oa=setTimeout(R2,t-ra.now()-Tl)),ia&&(ia=clearInterval(ia))):(ia||(ql=ra.now(),ia=setInterval(pS,A2)),gr=1,F2(R2))}}function Dl(t,n,e){var i=new aa;return n=n==null?0:+n,i.restart(o=>{i.stop(),t(o+n)},n,e),i}var fS=Wd("start","end","cancel","interrupt"),gS=[],B2=0,P2=1,Al=2,Rl=3,N2=4,Fl=5,la=6;function xo(t,n,e,i,o,r){var a=t.__transition;if(!a)t.__transition={};else if(e in a)return;bS(t,e,{name:n,index:i,group:o,on:fS,tween:gS,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:B2})}function ca(t,n){var e=bt(t,n);if(e.state>B2)throw new Error("too late; already scheduled");return e}function Ct(t,n){var e=bt(t,n);if(e.state>Rl)throw new Error("too late; already running");return e}function bt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function bS(t,n,e){var i=t.__transition,o;i[n]=e,e.timer=Il(r,0,e.time);function r(d){e.state=P2,e.timer.restart(a,e.delay,e.time),e.delay<=d&&a(d-e.delay)}function a(d){var c,m,p,u;if(e.state!==P2)return l();for(c in i)if(u=i[c],u.name===e.name){if(u.state===Rl)return Dl(a);u.state===N2?(u.state=la,u.timer.stop(),u.on.call("interrupt",t,t.__data__,u.index,u.group),delete i[c]):+c<n&&(u.state=la,u.timer.stop(),u.on.call("cancel",t,t.__data__,u.index,u.group),delete i[c])}if(Dl(function(){e.state===Rl&&(e.state=N2,e.timer.restart(s,e.delay,e.time),s(d))}),e.state=Al,e.on.call("start",t,t.__data__,e.index,e.group),e.state===Al){for(e.state=Rl,o=new Array(p=e.tween.length),c=0,m=-1;c<p;++c)(u=e.tween[c].value.call(t,t.__data__,e.index,e.group))&&(o[++m]=u);o.length=m+1}}function s(d){for(var c=d<e.duration?e.ease.call(null,d/e.duration):(e.timer.restart(l),e.state=Fl,1),m=-1,p=o.length;++m<p;)o[m].call(t,c);e.state===Fl&&(e.on.call("end",t,t.__data__,e.index,e.group),l())}function l(){e.state=la,e.timer.stop(),delete i[n];for(var d in i)return;delete t.__transition}}function Ll(t,n){var e=t.__transition,i,o,r=!0,a;if(e){n=n==null?null:n+"";for(a in e){if((i=e[a]).name!==n){r=!1;continue}o=i.state>Al&&i.state<Fl,i.state=la,i.timer.stop(),i.on.call(o?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete e[a]}r&&delete t.__transition}}function V2(t){return this.each(function(){Ll(this,t)})}function vS(t,n){var e,i;return function(){var o=Ct(this,t),r=o.tween;if(r!==e){i=e=r;for(var a=0,s=i.length;a<s;++a)if(i[a].name===n){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function xS(t,n,e){var i,o;if(typeof e!="function")throw new Error;return function(){var r=Ct(this,t),a=r.tween;if(a!==i){o=(i=a).slice();for(var s={name:n,value:e},l=0,d=o.length;l<d;++l)if(o[l].name===n){o[l]=s;break}l===d&&o.push(s)}r.tween=o}}function W2(t,n){var e=this._id;if(t+="",arguments.length<2){for(var i=bt(this.node(),e).tween,o=0,r=i.length,a;o<r;++o)if((a=i[o]).name===t)return a.value;return null}return this.each((n==null?vS:xS)(e,t,n))}function br(t,n,e){var i=t._id;return t.each(function(){var o=Ct(this,i);(o.value||(o.value={}))[n]=e.apply(this,arguments)}),function(o){return bt(o,i).value[n]}}function Pl(t,n){var e;return(typeof n=="number"?yt:n instanceof ci?Ho:(e=ci(n))?(n=e,Ho):ta)(t,n)}function wS(t){return function(){this.removeAttribute(t)}}function SS(t){return function(){this.removeAttributeNS(t.space,t.local)}}function yS(t,n,e){var i,o=e+"",r;return function(){var a=this.getAttribute(t);return a===o?null:a===i?r:r=n(i=a,e)}}function CS(t,n,e){var i,o=e+"",r;return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===i?r:r=n(i=a,e)}}function MS(t,n,e){var i,o,r;return function(){var a,s=e(this),l;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),l=s+"",a===l?null:a===i&&l===o?r:(o=l,r=n(i=a,s)))}}function _S(t,n,e){var i,o,r;return function(){var a,s=e(this),l;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),l=s+"",a===l?null:a===i&&l===o?r:(o=l,r=n(i=a,s)))}}function O2(t,n){var e=Ni(t),i=e==="transform"?th:Pl;return this.attrTween(t,typeof n=="function"?(e.local?_S:MS)(e,i,br(this,"attr."+t,n)):n==null?(e.local?SS:wS)(e):(e.local?CS:yS)(e,i,n))}function ES(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function kS(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function qS(t,n){var e,i;function o(){var r=n.apply(this,arguments);return r!==i&&(e=(i=r)&&kS(t,r)),e}return o._value=n,o}function TS(t,n){var e,i;function o(){var r=n.apply(this,arguments);return r!==i&&(e=(i=r)&&ES(t,r)),e}return o._value=n,o}function z2(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;var i=Ni(t);return this.tween(e,(i.local?qS:TS)(i,n))}function IS(t,n){return function(){ca(this,t).delay=+n.apply(this,arguments)}}function DS(t,n){return n=+n,function(){ca(this,t).delay=n}}function $2(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?IS:DS)(n,t)):bt(this.node(),n).delay}function RS(t,n){return function(){Ct(this,t).duration=+n.apply(this,arguments)}}function AS(t,n){return n=+n,function(){Ct(this,t).duration=n}}function j2(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?RS:AS)(n,t)):bt(this.node(),n).duration}function FS(t,n){if(typeof n!="function")throw new Error;return function(){Ct(this,t).ease=n}}function H2(t){var n=this._id;return arguments.length?this.each(FS(n,t)):bt(this.node(),n).ease}function LS(t,n){return function(){var e=n.apply(this,arguments);if(typeof e!="function")throw new Error;Ct(this,t).ease=e}}function U2(t){if(typeof t!="function")throw new Error;return this.each(LS(this._id,t))}function G2(t){typeof t!="function"&&(t=Qr(t));for(var n=this._groups,e=n.length,i=new Array(e),o=0;o<e;++o)for(var r=n[o],a=r.length,s=i[o]=[],l,d=0;d<a;++d)(l=r[d])&&t.call(l,l.__data__,d,r)&&s.push(l);return new Rt(i,this._parents,this._name,this._id)}function X2(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,i=n.length,o=e.length,r=Math.min(i,o),a=new Array(i),s=0;s<r;++s)for(var l=n[s],d=e[s],c=l.length,m=a[s]=new Array(c),p,u=0;u<c;++u)(p=l[u]||d[u])&&(m[u]=p);for(;s<i;++s)a[s]=n[s];return new Rt(a,this._parents,this._name,this._id)}function PS(t){return(t+"").trim().split(/^|\s+/).every(function(n){var e=n.indexOf(".");return e>=0&&(n=n.slice(0,e)),!n||n==="start"})}function NS(t,n,e){var i,o,r=PS(n)?ca:Ct;return function(){var a=r(this,t),s=a.on;s!==i&&(o=(i=s).copy()).on(n,e),a.on=o}}function Q2(t,n){var e=this._id;return arguments.length<2?bt(this.node(),e).on.on(t):this.each(NS(e,t,n))}function BS(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function Y2(){return this.on("end.remove",BS(this._id))}function Z2(t){var n=this._name,e=this._id;typeof t!="function"&&(t=zo(t));for(var i=this._groups,o=i.length,r=new Array(o),a=0;a<o;++a)for(var s=i[a],l=s.length,d=r[a]=new Array(l),c,m,p=0;p<l;++p)(c=s[p])&&(m=t.call(c,c.__data__,p,s))&&("__data__"in c&&(m.__data__=c.__data__),d[p]=m,xo(d[p],n,e,p,d,bt(c,e)));return new Rt(r,this._parents,n,e)}function K2(t){var n=this._name,e=this._id;typeof t!="function"&&(t=Xr(t));for(var i=this._groups,o=i.length,r=[],a=[],s=0;s<o;++s)for(var l=i[s],d=l.length,c,m=0;m<d;++m)if(c=l[m]){for(var p=t.call(c,c.__data__,m,l),u,k=bt(c,e),E=0,P=p.length;E<P;++E)(u=p[E])&&xo(u,n,e,E,p,k);r.push(p),a.push(c)}return new Rt(r,a,n,e)}var VS=Bi.prototype.constructor;function J2(){return new VS(this._groups,this._parents)}function WS(t,n){var e,i,o;return function(){var r=vo(this,t),a=(this.style.removeProperty(t),vo(this,t));return r===a?null:r===e&&a===i?o:o=n(e=r,i=a)}}function eb(t){return function(){this.style.removeProperty(t)}}function OS(t,n,e){var i,o=e+"",r;return function(){var a=vo(this,t);return a===o?null:a===i?r:r=n(i=a,e)}}function zS(t,n,e){var i,o,r;return function(){var a=vo(this,t),s=e(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(t),vo(this,t))),a===l?null:a===i&&l===o?r:(o=l,r=n(i=a,s))}}function $S(t,n){var e,i,o,r="style."+n,a="end."+r,s;return function(){var l=Ct(this,t),d=l.on,c=l.value[r]==null?s||(s=eb(n)):void 0;(d!==e||o!==c)&&(i=(e=d).copy()).on(a,o=c),l.on=i}}function tb(t,n,e){var i=(t+="")=="transform"?eh:Pl;return n==null?this.styleTween(t,WS(t,i)).on("end.style."+t,eb(t)):typeof n=="function"?this.styleTween(t,zS(t,i,br(this,"style."+t,n))).each($S(this._id,t)):this.styleTween(t,OS(t,i,n),e).on("end.style."+t,null)}function jS(t,n,e){return function(i){this.style.setProperty(t,n.call(this,i),e)}}function HS(t,n,e){var i,o;function r(){var a=n.apply(this,arguments);return a!==o&&(i=(o=a)&&jS(t,a,e)),i}return r._value=n,r}function ib(t,n,e){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,HS(t,n,e??""))}function US(t){return function(){this.textContent=t}}function GS(t){return function(){var n=t(this);this.textContent=n??""}}function ob(t){return this.tween("text",typeof t=="function"?GS(br(this,"text",t)):US(t==null?"":t+""))}function XS(t){return function(n){this.textContent=t.call(this,n)}}function QS(t){var n,e;function i(){var o=t.apply(this,arguments);return o!==e&&(n=(e=o)&&XS(o)),n}return i._value=t,i}function nb(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,QS(t))}function rb(){for(var t=this._name,n=this._id,e=Nl(),i=this._groups,o=i.length,r=0;r<o;++r)for(var a=i[r],s=a.length,l,d=0;d<s;++d)if(l=a[d]){var c=bt(l,n);xo(l,t,e,d,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Rt(i,this._parents,t,e)}function ab(){var t,n,e=this,i=e._id,o=e.size();return new Promise(function(r,a){var s={value:a},l={value:function(){--o===0&&r()}};e.each(function(){var d=Ct(this,i),c=d.on;c!==t&&(n=(t=c).copy(),n._.cancel.push(s),n._.interrupt.push(s),n._.end.push(l)),d.on=n}),o===0&&r()})}var YS=0;function Rt(t,n,e,i){this._groups=t,this._parents=n,this._name=e,this._id=i}function sb(t){return Bi().transition(t)}function Nl(){return++YS}var Vi=Bi.prototype;Rt.prototype=sb.prototype={constructor:Rt,select:Z2,selectAll:K2,selectChild:Vi.selectChild,selectChildren:Vi.selectChildren,filter:G2,merge:X2,selection:J2,transition:rb,call:Vi.call,nodes:Vi.nodes,node:Vi.node,size:Vi.size,empty:Vi.empty,each:Vi.each,on:Q2,attr:O2,attrTween:z2,style:tb,styleTween:ib,text:ob,textTween:nb,remove:Y2,tween:W2,delay:$2,duration:j2,ease:H2,easeVarying:U2,end:ab,[Symbol.iterator]:Vi[Symbol.iterator]};function Bl(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var ZS={time:null,delay:0,duration:250,ease:Bl};function KS(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}function lb(t){var n,e;t instanceof Rt?(n=t._id,t=t._name):(n=Nl(),(e=ZS).time=sa(),t=t==null?null:t+"");for(var i=this._groups,o=i.length,r=0;r<o;++r)for(var a=i[r],s=a.length,l,d=0;d<s;++d)(l=a[d])&&xo(l,t,n,d,a,e||KS(l,n));return new Rt(i,this._parents,t,n)}Bi.prototype.interrupt=V2;Bi.prototype.transition=lb;var{abs:XW,max:QW,min:YW}=Math;function cb(t){return[+t[0],+t[1]]}function JS(t){return[cb(t[0]),cb(t[1])]}var ZW={name:"x",handles:["w","e"].map(oh),input:function(t,n){return t==null?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},KW={name:"y",handles:["n","s"].map(oh),input:function(t,n){return t==null?null:[[n[0][0],+t[0]],[n[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},JW={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(oh),input:function(t){return t==null?null:JS(t)},output:function(t){return t}};function oh(t){return{type:t}}var nh=Math.PI,rh=2*nh,Xo=1e-6,ey=rh-Xo;function db(t){this._+=t[0];for(let n=1,e=t.length;n<e;++n)this._+=arguments[n]+t[n]}function ty(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return db;let e=10**n;return function(i){this._+=i[0];for(let o=1,r=i.length;o<r;++o)this._+=Math.round(arguments[o]*e)/e+i[o]}}var Qo=class{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?db:ty(n)}moveTo(n,e){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,e){this._append`L${this._x1=+n},${this._y1=+e}`}quadraticCurveTo(n,e,i,o){this._append`Q${+n},${+e},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(n,e,i,o,r,a){this._append`C${+n},${+e},${+i},${+o},${this._x1=+r},${this._y1=+a}`}arcTo(n,e,i,o,r){if(n=+n,e=+e,i=+i,o=+o,r=+r,r<0)throw new Error(`negative radius: ${r}`);let a=this._x1,s=this._y1,l=i-n,d=o-e,c=a-n,m=s-e,p=c*c+m*m;if(this._x1===null)this._append`M${this._x1=n},${this._y1=e}`;else if(p>Xo)if(!(Math.abs(m*l-d*c)>Xo)||!r)this._append`L${this._x1=n},${this._y1=e}`;else{let u=i-a,k=o-s,E=l*l+d*d,P=u*u+k*k,$=Math.sqrt(E),ee=Math.sqrt(p),B=r*Math.tan((nh-Math.acos((E+p-P)/(2*$*ee)))/2),j=B/ee,G=B/$;Math.abs(j-1)>Xo&&this._append`L${n+j*c},${e+j*m}`,this._append`A${r},${r},0,0,${+(m*u>c*k)},${this._x1=n+G*l},${this._y1=e+G*d}`}}arc(n,e,i,o,r,a){if(n=+n,e=+e,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let s=i*Math.cos(o),l=i*Math.sin(o),d=n+s,c=e+l,m=1^a,p=a?o-r:r-o;this._x1===null?this._append`M${d},${c}`:(Math.abs(this._x1-d)>Xo||Math.abs(this._y1-c)>Xo)&&this._append`L${d},${c}`,i&&(p<0&&(p=p%rh+rh),p>ey?this._append`A${i},${i},0,1,${m},${n-s},${e-l}A${i},${i},0,1,${m},${this._x1=d},${this._y1=c}`:p>Xo&&this._append`A${i},${i},0,${+(p>=nh)},${m},${this._x1=n+i*Math.cos(r)},${this._y1=e+i*Math.sin(r)}`)}rect(n,e,i,o){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}};function hb(){return new Qo}hb.prototype=Qo.prototype;function mb(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Yo(t,n){if(!isFinite(t)||t===0)return null;var e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"),i=t.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+t.slice(e+1)]}function Ii(t){return t=Yo(Math.abs(t)),t?t[1]:NaN}function pb(t,n){return function(e,i){for(var o=e.length,r=[],a=0,s=t[0],l=0;o>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),r.push(e.substring(o-=s,o+s)),!((l+=s+1)>i));)s=t[a=(a+1)%t.length];return r.reverse().join(n)}}function ub(t){return function(n){return n.replace(/[0-9]/g,function(e){return t[+e]})}}var iy=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wo(t){if(!(n=iy.exec(t)))throw new Error("invalid format: "+t);var n;return new Vl({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}wo.prototype=Vl.prototype;function Vl(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Vl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function fb(t){e:for(var n=t.length,e=1,i=-1,o;e<n;++e)switch(t[e]){case".":i=o=e;break;case"0":i===0&&(i=e),o=e;break;default:if(!+t[e])break e;i>0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(o+1):t}var da;function gb(t,n){var e=Yo(t,n);if(!e)return da=void 0,t.toPrecision(n);var i=e[0],o=e[1],r=o-(da=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,a=i.length;return r===a?i:r>a?i+new Array(r-a+1).join("0"):r>0?i.slice(0,r)+"."+i.slice(r):"0."+new Array(1-r).join("0")+Yo(t,Math.max(0,n+r-1))[0]}function ah(t,n){var e=Yo(t,n);if(!e)return t+"";var i=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}var sh={"%":(t,n)=>(t*100).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:mb,e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>ah(t*100,n),r:ah,s:gb,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function lh(t){return t}var bb=Array.prototype.map,vb=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function xb(t){var n=t.grouping===void 0||t.thousands===void 0?lh:pb(bb.call(t.grouping,Number),t.thousands+""),e=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",o=t.decimal===void 0?".":t.decimal+"",r=t.numerals===void 0?lh:ub(bb.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"\u2212":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function d(m,p){m=wo(m);var u=m.fill,k=m.align,E=m.sign,P=m.symbol,$=m.zero,ee=m.width,B=m.comma,j=m.precision,G=m.trim,K=m.type;K==="n"?(B=!0,K="g"):sh[K]||(j===void 0&&(j=12),G=!0,K="g"),($||u==="0"&&k==="=")&&($=!0,u="0",k="=");var ie=(p&&p.prefix!==void 0?p.prefix:"")+(P==="$"?e:P==="#"&&/[boxX]/.test(K)?"0"+K.toLowerCase():""),oe=(P==="$"?i:/[%p]/.test(K)?a:"")+(p&&p.suffix!==void 0?p.suffix:""),ne=sh[K],_e=/[defgprs%]/.test(K);j=j===void 0?6:/[gprs]/.test(K)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function He(U){var De=ie,Ee=oe,Ve,We,ue;if(K==="c")Ee=ne(U)+Ee,U="";else{U=+U;var J=U<0||1/U<0;if(U=isNaN(U)?l:ne(Math.abs(U),j),G&&(U=fb(U)),J&&+U==0&&E!=="+"&&(J=!1),De=(J?E==="("?E:s:E==="-"||E==="("?"":E)+De,Ee=(K==="s"&&!isNaN(U)&&da!==void 0?vb[8+da/3]:"")+Ee+(J&&E==="("?")":""),_e){for(Ve=-1,We=U.length;++Ve<We;)if(ue=U.charCodeAt(Ve),48>ue||ue>57){Ee=(ue===46?o+U.slice(Ve+1):U.slice(Ve))+Ee,U=U.slice(0,Ve);break}}}B&&!$&&(U=n(U,1/0));var Ue=De.length+U.length+Ee.length,Be=Ue<ee?new Array(ee-Ue+1).join(u):"";switch(B&&$&&(U=n(Be+U,Be.length?ee-Ee.length:1/0),Be=""),k){case"<":U=De+U+Ee+Be;break;case"=":U=De+Be+U+Ee;break;case"^":U=Be.slice(0,Ue=Be.length>>1)+De+U+Ee+Be.slice(Ue);break;default:U=Be+De+U+Ee;break}return r(U)}return He.toString=function(){return m+""},He}function c(m,p){var u=Math.max(-8,Math.min(8,Math.floor(Ii(p)/3)))*3,k=Math.pow(10,-u),E=d((m=wo(m),m.type="f",m),{suffix:vb[8+u/3]});return function(P){return E(k*P)}}return{format:d,formatPrefix:c}}var Wl,Zo,Ol;ch({thousands:",",grouping:[3],currency:["$",""]});function ch(t){return Wl=xb(t),Zo=Wl.format,Ol=Wl.formatPrefix,Wl}function dh(t){return Math.max(0,-Ii(Math.abs(t)))}function hh(t,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ii(n)/3)))*3-Ii(Math.abs(t)))}function mh(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,Ii(n)-Ii(t))+1}function wb(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t);break}return this}function ph(t){return function(){return t}}function uh(t){return+t}var Sb=[0,1];function vr(t){return t}function fh(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:ph(isNaN(n)?NaN:.5)}function oy(t,n){var e;return t>n&&(e=t,t=n,n=e),function(i){return Math.max(t,Math.min(n,i))}}function ny(t,n,e){var i=t[0],o=t[1],r=n[0],a=n[1];return o<i?(i=fh(o,i),r=e(a,r)):(i=fh(i,o),r=e(r,a)),function(s){return r(i(s))}}function ry(t,n,e){var i=Math.min(t.length,n.length)-1,o=new Array(i),r=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<i;)o[a]=fh(t[a],t[a+1]),r[a]=e(n[a],n[a+1]);return function(s){var l=Ad(t,s,1,i)-1;return r[l](o[l](s))}}function yb(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ay(){var t=Sb,n=Sb,e=Uo,i,o,r,a=vr,s,l,d;function c(){var p=Math.min(t.length,n.length);return a!==vr&&(a=oy(t[0],t[p-1])),s=p>2?ry:ny,l=d=null,m}function m(p){return p==null||isNaN(p=+p)?r:(l||(l=s(t.map(i),n,e)))(i(a(p)))}return m.invert=function(p){return a(o((d||(d=s(n,t.map(i),yt)))(p)))},m.domain=function(p){return arguments.length?(t=Array.from(p,uh),c()):t.slice()},m.range=function(p){return arguments.length?(n=Array.from(p),c()):n.slice()},m.rangeRound=function(p){return n=Array.from(p),e=Kd,c()},m.clamp=function(p){return arguments.length?(a=p?!0:vr,c()):a!==vr},m.interpolate=function(p){return arguments.length?(e=p,c()):e},m.unknown=function(p){return arguments.length?(r=p,m):r},function(p,u){return i=p,o=u,c()}}function gh(){return ay()(vr,vr)}function bh(t,n,e,i){var o=Fd(t,n,e),r;switch(i=wo(i??",f"),i.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(n));return i.precision==null&&!isNaN(r=hh(o,a))&&(i.precision=r),Ol(i,a)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(r=mh(o,Math.max(Math.abs(t),Math.abs(n))))&&(i.precision=r-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(r=dh(o))&&(i.precision=r-(i.type==="%")*2);break}}return Zo(i)}function sy(t){var n=t.domain;return t.ticks=function(e){var i=n();return ml(i[0],i[i.length-1],e??10)},t.tickFormat=function(e,i){var o=n();return bh(o[0],o[o.length-1],e??10,i)},t.nice=function(e){e==null&&(e=10);var i=n(),o=0,r=i.length-1,a=i[o],s=i[r],l,d,c=10;for(s<a&&(d=a,a=s,s=d,d=o,o=r,r=d);c-- >0;){if(d=Hr(a,s,e),d===l)return i[o]=a,i[r]=s,n(i);if(d>0)a=Math.floor(a/d)*d,s=Math.ceil(s/d)*d;else if(d<0)a=Math.ceil(a*d)/d,s=Math.floor(s*d)/d;else break;l=d}return t},t}function xr(){var t=gh();return t.copy=function(){return yb(t,xr())},wb.apply(t,arguments),sy(t)}function Ko(t){return function(){return t}}function Cb(t){let n=3;return t.digits=function(e){if(!arguments.length)return n;if(e==null)n=null;else{let i=Math.floor(e);if(!(i>=0))throw new RangeError(`invalid digits: ${e}`);n=i}return t},()=>new Qo(n)}var bz=Array.prototype.slice;function Mb(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function _b(t){this._context=t}_b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n);break}}};function Eb(t){return new _b(t)}function kb(t){return t[0]}function qb(t){return t[1]}function vh(t,n){var e=Ko(!0),i=null,o=Eb,r=null,a=Cb(s);t=typeof t=="function"?t:t===void 0?kb:Ko(t),n=typeof n=="function"?n:n===void 0?qb:Ko(n);function s(l){var d,c=(l=Mb(l)).length,m,p=!1,u;for(i==null&&(r=o(u=a())),d=0;d<=c;++d)!(d<c&&e(m=l[d],d,l))===p&&((p=!p)?r.lineStart():r.lineEnd()),p&&r.point(+t(m,d,l),+n(m,d,l));if(u)return r=null,u+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:Ko(+l),s):t},s.y=function(l){return arguments.length?(n=typeof l=="function"?l:Ko(+l),s):n},s.defined=function(l){return arguments.length?(e=typeof l=="function"?l:Ko(!!l),s):e},s.curve=function(l){return arguments.length?(o=l,i!=null&&(r=o(i)),s):o},s.context=function(l){return arguments.length?(l==null?i=r=null:r=o(i=l),s):i},s}function Tb(t,n){this._context=t,this._t=n}Tb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}break}}this._x=t,this._y=n}};function xh(t){return new Tb(t,0)}function So(t,n,e){this.k=t,this.x=n,this.y=e}So.prototype={constructor:So,scale:function(t){return t===1?this:new So(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new So(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var wh=new So(1,0,0);Sh.prototype=So.prototype;function Sh(t){for(;!t.__zoom;)if(!(t=t.parentNode))return wh;return t.__zoom}var Ib=(()=>{class t{constructor(){this.elementRef=q(At),this.diagramWidth=550,this.diagramHeight=250,this.showAxisLabels=!0,this.ranksAreStale=!0,this.pendingRender=null,this.popoverAncestor=null,this.popoverToggleListener=e=>{e.newState==="open"&&this.pendingRender!==null&&this.render(this.pendingRender==="full")}}ngOnChanges(e){if(this.values.length===0)return;let i=!!(e.values||e.isAttributeDirectionInverted||e.colorMetric||e.diagramWidth||e.diagramHeight||e.showAxisLabels);if(i&&(this.ranksAreStale=!0),this.isHiddenInClosedPopover()){this.pendingRender=this.pendingRender==="full"||i?"full":"areas";return}this.render(i)}ngAfterViewInit(){this.popoverAncestor=this.elementRef.nativeElement.closest("[popover]"),this.popoverAncestor?.addEventListener("toggle",this.popoverToggleListener)}ngOnDestroy(){this.popoverAncestor?.removeEventListener("toggle",this.popoverToggleListener)}render(e){this.ranksAreStale&&(this.percentileRanks=this.isAttributeDirectionInverted?this.calculateReversedPercentileRanks(this.values):this.calculatePercentileRanks(this.values),this.updatePercentileToMetricValueMap(),this.ranksAreStale=!1),(e||!this.hasRenderedDiagram()||!this.updateAreas())&&this.renderDiagram(),this.pendingRender=null}isHiddenInClosedPopover(){let e=this.popoverAncestor??this.elementRef.nativeElement.closest("[popover]");if(!e)return!1;try{return!e.matches(":popover-open")}catch{return!1}}hasRenderedDiagram(){return!this.rangeDiagramContainer().select("svg").empty()}updateAreas(){let e=this.rangeDiagramContainer().select("g");if(e.empty()||e.select(".left-area").empty())return!1;let i=this.createXScale(),o=i(this.isAttributeDirectionInverted?this.calculateReversedPercentileFromMetricValue(this.currentRightValue):this.calculatePercentileFromMetricValue(this.currentLeftValue)),r=i(this.isAttributeDirectionInverted?this.calculateReversedPercentileFromMetricValue(this.currentLeftValue):this.calculatePercentileFromMetricValue(this.currentRightValue));return e.select(".left-area").attr("width",o).style("fill",this.isAttributeDirectionInverted?this.rightColor:this.leftColor),e.select(".middle-area").attr("x",o+this.framePadding).attr("width",r-o).style("fill",this.middleColor),e.select(".right-area").attr("x",r+this.framePadding).attr("width",this.frameWidth-2*this.framePadding-r).style("fill",this.isAttributeDirectionInverted?this.leftColor:this.rightColor),!0}updatePercentileToMetricValueMap(){this.percentileToMetricValueMap=new Map;let e=0;for(let i=0;i<=100;i++){for(;i>this.percentileRanks[e].x&&e<this.percentileRanks.length-1;)e++;this.percentileToMetricValueMap.set(i,this.percentileRanks[e].y)}}renderDiagram(){this.initializeDiagramDimesions(),this.clearDiagramContainer();let e=this.createSvg(),i=this.createGroup(e),o=this.createXScale(),r=this.createYScale();this.drawAxes(i,o,r),this.drawFrame(i),this.showAxisLabels&&this.drawLabels(i),this.drawAreas(i,o),this.drawLine(i),this.addCrossHair(i,o,r)}initializeDiagramDimesions(){this.svgWidth=this.diagramWidth,this.svgHeight=this.diagramHeight,this.frameMarginTop=10,this.frameMarginBottom=this.showAxisLabels?50:30,this.frameMarginLeft=this.showAxisLabels?50:40,this.frameMarginRight=10,this.framePadding=5,this.frameHeight=this.svgHeight-this.frameMarginTop-this.frameMarginBottom,this.frameWidth=this.svgWidth-this.frameMarginLeft-this.frameMarginRight,this.yLabelXOffset=80,this.xLabelYOffset=20}rangeDiagramContainer(){return Hd(this.elementRef.nativeElement.querySelector("#cc-range-diagram-container"))}clearDiagramContainer(){this.rangeDiagramContainer().selectAll("*").remove()}createSvg(){return this.rangeDiagramContainer().append("svg").attr("width",this.svgWidth).attr("height",this.svgHeight)}createGroup(e){return e.append("g").attr("transform",`translate(${this.frameMarginLeft}, ${this.frameMarginTop})`).attr("display","flex").attr("justify-content","center")}drawFrame(e){e.append("path").attr("d",`M 0 0
|
|
3418
3431
|
h${this.frameWidth}
|
|
3419
3432
|
v${this.frameHeight}
|
|
3420
3433
|
h${-this.frameWidth}
|
|
3421
|
-
v${-this.frameHeight}`).attr("fill","none").attr("stroke","#888").attr("stroke-width","1px")}drawAxes(e,i,o){e.append("g").attr("id","axis-x").attr("transform",`translate(${this.framePadding},${this.frameHeight})`).call(Bd(i).ticks(5)).attr("font-size","13px").attr("color","#888"),e.append("g").attr("id","axis-y").attr("transform",`translate(0,${this.framePadding})`).call(Vd(o).ticks(5).tickFormat(function(r){return r>=1e4?`${Zo(".0f")(r/1e3)}k`:r>=1e3?`${Zo(".1f")(r/1e3)}k`:r.toString()})).attr("font-size","13px").attr("color","#888")}createXScale(){return xr().domain(dl(this.percentileRanks,e=>e.x)).range([0,this.frameWidth-2*this.framePadding])}createYScale(){let e=[0,Ur(this.percentileRanks,o=>o.y)],i=[Ur(this.percentileRanks,o=>o.y),0];return xr().domain(this.isAttributeDirectionInverted?i:e).range([this.frameHeight-2*this.framePadding,0])}drawLabels(e){e.append("text").attr("id","y-label").attr("class","y label").attr("text-anchor","middle").attr("transform","rotate(-90)").attr("x",-this.frameHeight/2-this.frameMarginTop).attr("y",this.frameMarginLeft-this.yLabelXOffset).attr("fill","#888").text(`${this.colorMetric}`),e.append("text").attr("id","x-label").attr("class","x label").attr("text-anchor","middle").attr("x",this.frameWidth/2).attr("y",this.frameHeight+this.frameMarginTop+this.xLabelYOffset).attr("fill","#888").text(`Quantiles (% of ${this.colorMetric})`)}drawAreas(e,i){let o=i(this.isAttributeDirectionInverted?this.calculateReversedPercentileFromMetricValue(this.currentRightValue):this.calculatePercentileFromMetricValue(this.currentLeftValue)),r=i(this.isAttributeDirectionInverted?this.calculateReversedPercentileFromMetricValue(this.currentLeftValue):this.calculatePercentileFromMetricValue(this.currentRightValue));e.append("rect").attr("class","left-area").attr("x",this.framePadding).attr("width",o).attr("height",this.frameHeight).style("fill",this.isAttributeDirectionInverted?this.rightColor:this.leftColor).style("fill-opacity","0.3"),e.append("rect").attr("class","middle-area").attr("x",o+this.framePadding).attr("width",r-o).attr("height",this.frameHeight).style("fill",this.middleColor).style("fill-opacity","0.3"),e.append("rect").attr("class","right-area").attr("x",r+this.framePadding).attr("width",this.frameWidth-2*this.framePadding-r).attr("height",this.frameHeight).style("fill",this.isAttributeDirectionInverted?this.leftColor:this.rightColor).style("fill-opacity","0.3")}drawLine(e){e.append("path").attr("id","diagram-path").datum(this.percentileRanks).attr("fill","none").attr("stroke","#888").attr("stroke-width",1).attr("d",vh().curve(xh).x(i=>this.createXScale()(i.x)).y(i=>this.createYScale()(i.y))).attr("transform",`translate(${this.framePadding}, ${this.framePadding})`)}calculatePercentileRanks(e){let i=[...e].sort((a,s)=>a-s),o=i.length,r=[{x:0,y:i[0]}];for(let a=0;a<o;a++)a+1<o&&i[a+1]===i[a]||r.push({x:(a+1)/o*100,y:i[a]});return r}calculateReversedPercentileRanks(e){let i=[...e].sort((a,s)=>s-a),o=i.length,r=[{x:0,y:i[0]}];for(let a=0;a<o;a++)a+1<o&&i[a+1]===i[a]||r.push({x:(a+1)/o*100,y:i[a]});return r.sort((a,s)=>a.x-s.x)}calculatePercentileFromMetricValue(e){if(e===this.minValue)return 0;if(e===this.maxValue)return 100;let i=null;for(let o of this.percentileRanks)if(o.y<e)i=o.x;else return i??0;return 100}calculateReversedPercentileFromMetricValue(e){if(e===this.maxValue)return 0;if(e===this.minValue)return 100;let i=null;for(let o of this.percentileRanks)if(o.y>e)i=o.x;else return i??0;return 100}addCrossHair(e,i,o){let r=e.append("text").attr("class","cross-tooltip").attr("fill","#000").attr("font-size","13px").style("display","none"),a=e.append("line").attr("class","dashed-vertical-line").attr("stroke","#000").attr("stroke-width","0.7px").attr("stroke-dasharray","4").style("display","none"),s=e.append("line").attr("class","straight-vertical-line").attr("stroke","#000").attr("stroke-width","0.7px").style("display","none"),l=e.append("line").attr("class","horizontal-line").attr("stroke","#000").attr("stroke-width","0.7px").style("display","none"),d=e.append("rect").attr("class","mouse-event-rect").attr("width",this.frameWidth).attr("height",this.frameHeight+this.frameMarginBottom/2).attr("fill","none").attr("pointer-events","all");this.addOnMouseMoveEvent(d,i,o,r,a,s,l),this.addOnMouseOutEvent(d,r,a,s,l)}addOnMouseMoveEvent(e,i,o,r,a,s,l){e.on("mousemove",d=>{let c=Ud(d)[0],m=Math.round(i.invert(c-this.framePadding));m=Math.max(0,Math.min(m,100));let p=this.percentileToMetricValueMap.get(m),u=o(p)+this.framePadding,k=c<this.frameWidth/2?c+10:c-80,E=u<this.frameHeight/2?u+20:u-20;r.style("display","block").attr("x",k).attr("y",E).text(`Quantile: ${m}`).append("tspan").attr("x",k).attr("dy","1.2em").text(`Value: ${p}`),a.attr("x1",c).attr("x2",c).attr("y2",this.frameHeight).style("display","block"),s.attr("x1",c).attr("x2",c).attr("y1",u).attr("y2",this.frameHeight).style("display","block"),l.attr("x2",c).attr("y1",u).attr("y2",u).style("display","block")})}addOnMouseOutEvent(e,i,o,r,a){e.on("mouseout",()=>{i.style("display","none"),o.style("display","none"),r.style("display","none"),a.style("display","none")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-color-range-diagram"]],hostAttrs:[1,"flex","justify-center"],inputs:{minValue:"minValue",maxValue:"maxValue",colorMetric:"colorMetric",values:"values",currentLeftValue:"currentLeftValue",currentRightValue:"currentRightValue",leftColor:"leftColor",middleColor:"middleColor",rightColor:"rightColor",isAttributeDirectionInverted:"isAttributeDirectionInverted",diagramWidth:"diagramWidth",diagramHeight:"diagramHeight",showAxisLabels:"showAxisLabels"},features:[Ia],decls:1,vars:0,consts:[["id","cc-range-diagram-container"]],template:function(i,o){i&1&&fe(0,"div",0)},encapsulation:2,changeDetection:0})}}return t})();var
|
|
3434
|
+
v${-this.frameHeight}`).attr("fill","none").attr("stroke","#888").attr("stroke-width","1px")}drawAxes(e,i,o){e.append("g").attr("id","axis-x").attr("transform",`translate(${this.framePadding},${this.frameHeight})`).call(Bd(i).ticks(5)).attr("font-size","13px").attr("color","#888"),e.append("g").attr("id","axis-y").attr("transform",`translate(0,${this.framePadding})`).call(Vd(o).ticks(5).tickFormat(function(r){return r>=1e4?`${Zo(".0f")(r/1e3)}k`:r>=1e3?`${Zo(".1f")(r/1e3)}k`:r.toString()})).attr("font-size","13px").attr("color","#888")}createXScale(){return xr().domain(dl(this.percentileRanks,e=>e.x)).range([0,this.frameWidth-2*this.framePadding])}createYScale(){let e=[0,Ur(this.percentileRanks,o=>o.y)],i=[Ur(this.percentileRanks,o=>o.y),0];return xr().domain(this.isAttributeDirectionInverted?i:e).range([this.frameHeight-2*this.framePadding,0])}drawLabels(e){e.append("text").attr("id","y-label").attr("class","y label").attr("text-anchor","middle").attr("transform","rotate(-90)").attr("x",-this.frameHeight/2-this.frameMarginTop).attr("y",this.frameMarginLeft-this.yLabelXOffset).attr("fill","#888").text(`${this.colorMetric}`),e.append("text").attr("id","x-label").attr("class","x label").attr("text-anchor","middle").attr("x",this.frameWidth/2).attr("y",this.frameHeight+this.frameMarginTop+this.xLabelYOffset).attr("fill","#888").text(`Quantiles (% of ${this.colorMetric})`)}drawAreas(e,i){let o=i(this.isAttributeDirectionInverted?this.calculateReversedPercentileFromMetricValue(this.currentRightValue):this.calculatePercentileFromMetricValue(this.currentLeftValue)),r=i(this.isAttributeDirectionInverted?this.calculateReversedPercentileFromMetricValue(this.currentLeftValue):this.calculatePercentileFromMetricValue(this.currentRightValue));e.append("rect").attr("class","left-area").attr("x",this.framePadding).attr("width",o).attr("height",this.frameHeight).style("fill",this.isAttributeDirectionInverted?this.rightColor:this.leftColor).style("fill-opacity","0.3"),e.append("rect").attr("class","middle-area").attr("x",o+this.framePadding).attr("width",r-o).attr("height",this.frameHeight).style("fill",this.middleColor).style("fill-opacity","0.3"),e.append("rect").attr("class","right-area").attr("x",r+this.framePadding).attr("width",this.frameWidth-2*this.framePadding-r).attr("height",this.frameHeight).style("fill",this.isAttributeDirectionInverted?this.leftColor:this.rightColor).style("fill-opacity","0.3")}drawLine(e){e.append("path").attr("id","diagram-path").datum(this.percentileRanks).attr("fill","none").attr("stroke","#888").attr("stroke-width",1).attr("d",vh().curve(xh).x(i=>this.createXScale()(i.x)).y(i=>this.createYScale()(i.y))).attr("transform",`translate(${this.framePadding}, ${this.framePadding})`)}calculatePercentileRanks(e){let i=[...e].sort((a,s)=>a-s),o=i.length,r=[{x:0,y:i[0]}];for(let a=0;a<o;a++)a+1<o&&i[a+1]===i[a]||r.push({x:(a+1)/o*100,y:i[a]});return r}calculateReversedPercentileRanks(e){let i=[...e].sort((a,s)=>s-a),o=i.length,r=[{x:0,y:i[0]}];for(let a=0;a<o;a++)a+1<o&&i[a+1]===i[a]||r.push({x:(a+1)/o*100,y:i[a]});return r.sort((a,s)=>a.x-s.x)}calculatePercentileFromMetricValue(e){if(e===this.minValue)return 0;if(e===this.maxValue)return 100;let i=null;for(let o of this.percentileRanks)if(o.y<e)i=o.x;else return i??0;return 100}calculateReversedPercentileFromMetricValue(e){if(e===this.maxValue)return 0;if(e===this.minValue)return 100;let i=null;for(let o of this.percentileRanks)if(o.y>e)i=o.x;else return i??0;return 100}addCrossHair(e,i,o){let r=e.append("text").attr("class","cross-tooltip").attr("fill","#000").attr("font-size","13px").style("display","none"),a=e.append("line").attr("class","dashed-vertical-line").attr("stroke","#000").attr("stroke-width","0.7px").attr("stroke-dasharray","4").style("display","none"),s=e.append("line").attr("class","straight-vertical-line").attr("stroke","#000").attr("stroke-width","0.7px").style("display","none"),l=e.append("line").attr("class","horizontal-line").attr("stroke","#000").attr("stroke-width","0.7px").style("display","none"),d=e.append("rect").attr("class","mouse-event-rect").attr("width",this.frameWidth).attr("height",this.frameHeight+this.frameMarginBottom/2).attr("fill","none").attr("pointer-events","all");this.addOnMouseMoveEvent(d,i,o,r,a,s,l),this.addOnMouseOutEvent(d,r,a,s,l)}addOnMouseMoveEvent(e,i,o,r,a,s,l){e.on("mousemove",d=>{let c=Ud(d)[0],m=Math.round(i.invert(c-this.framePadding));m=Math.max(0,Math.min(m,100));let p=this.percentileToMetricValueMap.get(m),u=o(p)+this.framePadding,k=c<this.frameWidth/2?c+10:c-80,E=u<this.frameHeight/2?u+20:u-20;r.style("display","block").attr("x",k).attr("y",E).text(`Quantile: ${m}`).append("tspan").attr("x",k).attr("dy","1.2em").text(`Value: ${p}`),a.attr("x1",c).attr("x2",c).attr("y2",this.frameHeight).style("display","block"),s.attr("x1",c).attr("x2",c).attr("y1",u).attr("y2",this.frameHeight).style("display","block"),l.attr("x2",c).attr("y1",u).attr("y2",u).style("display","block")})}addOnMouseOutEvent(e,i,o,r,a){e.on("mouseout",()=>{i.style("display","none"),o.style("display","none"),r.style("display","none"),a.style("display","none")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-color-range-diagram"]],hostAttrs:[1,"flex","justify-center"],inputs:{minValue:"minValue",maxValue:"maxValue",colorMetric:"colorMetric",values:"values",currentLeftValue:"currentLeftValue",currentRightValue:"currentRightValue",leftColor:"leftColor",middleColor:"middleColor",rightColor:"rightColor",isAttributeDirectionInverted:"isAttributeDirectionInverted",diagramWidth:"diagramWidth",diagramHeight:"diagramHeight",showAxisLabels:"showAxisLabels"},features:[Ia],decls:1,vars:0,consts:[["id","cc-range-diagram-container"]],template:function(i,o){i&1&&fe(0,"div",0)},encapsulation:2,changeDetection:0})}}return t})();var cy=["minLabel"],dy=["maxLabel"],hy=["currentLeftLabel"],my=["currentRightLabel"],py=["combinedCurrentLeftRightLabel"],yh=4,Db=(()=>{class t{constructor(e){this.changeDetector=e,this.hideMinLabel=!1,this.hideMaxLabel=!1,this.doLeftRightLabelOverlap=!1}ngAfterViewChecked(){this.updateLabelDisplays()}updateLabelDisplays(){let e=this.minLabel.nativeElement.getBoundingClientRect().width,i=this.currentLeftLabel.nativeElement.getBoundingClientRect().width;this.currentLeftLabelLeftPosition=this.sliderRangePosition.leftEnd-i/2;let o=this.currentRightLabel.nativeElement.getBoundingClientRect().width,r=this.sliderWidth-this.maxLabel.nativeElement.getBoundingClientRect().width;this.currentRightLabelLeftPosition=this.sliderRangePosition.rightStart-o/2,this.hideMinLabel=this.currentLeftLabelLeftPosition<=e+yh,this.hideMaxLabel=this.currentRightLabelLeftPosition+o+yh>=r;let a=this.currentLeftLabelLeftPosition+i;this.doLeftRightLabelOverlap=a+yh>=this.currentRightLabelLeftPosition;let s=(a+this.currentRightLabelLeftPosition)/2,l=this.combinedCurrentLeftRightLabel.nativeElement.getBoundingClientRect().width;this.combinedCurrentLeftRightLabelLeftPosition=s-l/2,this.changeDetector.detectChanges()}static{this.\u0275fac=function(i){return new(i||t)(te(dn))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-range-slider-labels"]],viewQuery:function(i,o){if(i&1&&Ra(cy,5)(dy,5)(hy,5)(my,5)(py,5),i&2){let r;pi(r=ui())&&(o.minLabel=r.first),pi(r=ui())&&(o.maxLabel=r.first),pi(r=ui())&&(o.currentLeftLabel=r.first),pi(r=ui())&&(o.currentRightLabel=r.first),pi(r=ui())&&(o.combinedCurrentLeftRightLabel=r.first)}},inputs:{minValue:"minValue",maxValue:"maxValue",leftValueLabel:"leftValueLabel",rightValueLabel:"rightValueLabel",sliderRangePosition:"sliderRangePosition",sliderWidth:"sliderWidth"},decls:15,vars:26,consts:[["minLabel",""],["currentLeftLabel",""],["currentRightLabel",""],["combinedCurrentLeftRightLabel",""],["maxLabel",""],[1,"absolute","-top-6","leading-6","text-sm","text-base-content/60"]],template:function(i,o){i&1&&(S(0,"div",5,0),g(2),y(),S(3,"div",5,1),g(5),y(),S(6,"div",5,2),g(8),y(),S(9,"div",5,3),g(11),y(),S(12,"div",5,4),g(14),y()),i&2&&(Oe("left",0,"px")("visibility",o.hideMinLabel?"hidden":"visible"),h(2),ge(" ",o.minValue,`
|
|
3422
3435
|
`),h(),Oe("left",o.currentLeftLabelLeftPosition,"px")("visibility",o.doLeftRightLabelOverlap?"hidden":"visible"),h(2),ge(" ",o.leftValueLabel,`
|
|
3423
3436
|
`),h(),Oe("left",o.currentRightLabelLeftPosition,"px")("visibility",o.doLeftRightLabelOverlap?"hidden":"visible"),h(2),ge(" ",o.rightValueLabel,`
|
|
3424
3437
|
`),h(),Oe("left",o.combinedCurrentLeftRightLabelLeftPosition,"px")("visibility",o.doLeftRightLabelOverlap?"visible":"hidden"),h(2),Yi(" ",o.leftValueLabel," - ",o.rightValueLabel,`
|
|
3425
3438
|
`),h(),Oe("right",0,"px")("visibility",o.hideMaxLabel?"hidden":"visible"),h(2),ge(" ",o.maxValue,`
|
|
3426
|
-
`))},encapsulation:2,changeDetection:0})}}return t})();var wr=(t,n,e)=>Math.min(Math.max(t,n),e),Rb=({minValue:t,maxValue:n,currentLeftValue:e,currentRightValue:i,sliderWidth:o})=>{let r=n-t;if(r<=0)return{leftEnd:o,rightStart:o};let a=(e-t)/r,s=(i-t)/r,l=wr(a*o,0,o),d=wr(s*o,l,o);return{leftEnd:l,rightStart:d}},uS=({thumbX:t,minValue:n,maxValue:e,sliderWidth:i})=>{let o=(e-n)/i,r=n+t*o;return Math.round(r)},Ab=t=>Lb(t,{lowerBound:0,upperBound:t.otherThumbX}),Fb=t=>Lb(t,{lowerBound:t.otherThumbX,upperBound:t.sliderWidth}),Lb=({deltaX:t,thumbScreenX:n,thumbRadius:e,sliderBoundingClientRectX:i,sliderWidth:o,minValue:r,maxValue:a},{lowerBound:s,upperBound:l})=>{let d=n+t-i+e,c=wr(d,s,l);return{updatedThumbX:c,upcomingValue:uS({thumbX:c,minValue:r,maxValue:a,sliderWidth:o})}};var fS=["rangeSliderContainer"],gS=["leftThumb"],bS=["rightThumb"],Pb=(()=>{class t{get segmentWidths(){let e=wr(this.sliderRangePosition.leftEnd,0,this.actualSliderWidth),i=wr(this.sliderRangePosition.rightStart,e,this.actualSliderWidth);return{left:e,middle:i-e,right:this.actualSliderWidth-i}}constructor(e){this.changeDetectorRef=e,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 o=Ab({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:o.updatedThumbX,rightStart:this.sliderRangePosition.rightStart},this.upcomingLeftValue=o.upcomingValue,this.changeDetectorRef.markForCheck(),this.handleValueChange({newLeftValue:o.upcomingValue})},this.handleRightThumbMoved=i=>{if(this.abortSlidingWhenHidden())return;let o=Fb({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:o.updatedThumbX},this.upcomingRightValue=o.upcomingValue,this.changeDetectorRef.markForCheck(),this.handleValueChange({newRightValue:o.upcomingValue})}}ngOnChanges(e){e.sliderWidth&&(this.actualSliderWidth=this.sliderWidth),this.currentlySliding||(e.currentLeftValue&&(this.upcomingLeftValue=this.currentLeftValue),e.currentRightValue&&(this.upcomingRightValue=this.currentRightValue),this.updateSliderRangePosition())}ngAfterViewInit(){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(e=>{let i=e.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(e){switch(this.stopSliding(),this.currentlySliding=e,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(e){let i=this.calculateValueFromKeyboard(e,this.upcomingLeftValue,this.minValue,this.upcomingRightValue);i===void 0||i===this.upcomingLeftValue||(e.preventDefault(),this.upcomingLeftValue=i,this.updateSliderRangePosition(),this.handleValueChange({newLeftValue:i}))}handleRightThumbKeydown(e){let i=this.calculateValueFromKeyboard(e,this.upcomingRightValue,this.upcomingLeftValue,this.maxValue);i===void 0||i===this.upcomingRightValue||(e.preventDefault(),this.upcomingRightValue=i,this.updateSliderRangePosition(),this.handleValueChange({newRightValue:i}))}calculateValueFromKeyboard(e,i,o,r){let a;switch(e.key){case"ArrowLeft":case"ArrowDown":a=i-1;break;case"ArrowRight":case"ArrowUp":a=i+1;break;case"Home":a=o;break;case"End":a=r;break;default:return}return Math.max(o,Math.min(r,a))}handleCurrentLeftInputChanged(e){let i=Xc(e,this.minValue,this.upcomingRightValue,this.upcomingLeftValue);i!==void 0&&(this.upcomingLeftValue=i,this.updateSliderRangePosition(),this.handleValueChange({newLeftValue:i}))}handleCurrentRightInputChanged(e){let i=Xc(e,this.upcomingLeftValue,this.maxValue,this.upcomingRightValue);i!==void 0&&(this.upcomingRightValue=i,this.updateSliderRangePosition(),this.handleValueChange({newRightValue:i}))}updateSliderRangePosition(){this.sliderRangePosition=Rb({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||t)(te(dn))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-color-range-slider"]],viewQuery:function(i,o){if(i&1&&Ra(fS,5)(gS,5)(bS,5),i&2){let r;pi(r=ui())&&(o.sliderContainer=r.first),pi(r=ui())&&(o.leftThumb=r.first),pi(r=ui())&&(o.rightThumb=r.first)}},inputs:{minValue:"minValue",maxValue:"maxValue",currentLeftValue:"currentLeftValue",currentRightValue:"currentRightValue",leftColor:"leftColor",middleColor:"middleColor",rightColor:"rightColor",handleValueChange:"handleValueChange",sliderWidth:"sliderWidth"},features:[Ia],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,o){i&1&&(v(0,"div",3)(1,"input",4),W("input",function(a){return o.handleCurrentLeftInputChanged(a)}),b(),v(2,"div",5,0),L(4,"span",6)(5,"span",6)(6,"span",6),v(7,"div",7,1),W("mousedown",function(){return o.setCurrentlySliding("leftThumb")}),b(),v(9,"div",7,2),W("mousedown",function(){return o.setCurrentlySliding("rightThumb")}),b(),v(11,"input",8),W("keydown",function(a){return o.handleLeftThumbKeydown(a)}),b(),v(12,"input",9),W("keydown",function(a){return o.handleRightThumbKeydown(a)}),b(),L(13,"cc-range-slider-labels",10),b(),v(14,"input",11),W("input",function(a){return o.handleCurrentRightInputChanged(a)}),b()()),i&2&&(h(),F("value",o.currentLeftValue)("min",o.minValue)("max",o.upcomingRightValue),h(3),Oe("width",o.segmentWidths.left,"px")("border-bottom-color",o.leftColor),h(),Oe("width",o.segmentWidths.middle,"px")("border-bottom-color",o.middleColor),h(),Oe("width",o.segmentWidths.right,"px")("border-bottom-color",o.rightColor),h(),Oe("left",o.sliderRangePosition.leftEnd-o.thumbRadius,"px"),h(2),Oe("left",o.sliderRangePosition.rightStart-o.thumbRadius,"px"),h(2),F("min",o.minValue)("max",o.currentRightValue)("value",o.currentLeftValue),h(),F("min",o.currentLeftValue)("max",o.maxValue)("value",o.currentRightValue),h(),F("minValue",o.minValue)("maxValue",o.maxValue)("leftValueLabel",o.upcomingLeftValue)("rightValueLabel",o.upcomingRightValue)("sliderRangePosition",o.sliderRangePosition)("sliderWidth",o.actualSliderWidth),h(),F("value",o.currentRightValue)("min",o.upcomingLeftValue)("max",o.maxValue))},dependencies:[Db],encapsulation:2,changeDetection:0})}}return t})();var Nb=(()=>{class t{constructor(e,i,o,r){this.mapStateReadWindow=e,this.metricsBarReadStore=i,this.metricsBarWriteStore=o,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(It([this.mapStateReadWindow.colorMetric$,this.metricsLensFacade.descriptors$]).pipe(ke(([a,s])=>s[a]?.direction===1)),{initialValue:!1}),this.pendingLeftValue=null,this.pendingRightValue=null,this.commitColorRange=Pi(()=>{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)},xf),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||t)(te(ve),te(mt),te(Ze),te(zn))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(L(0,"cc-metric-color-range-slider",0),v(1,"div",1)(2,"span",2),g(3,"Distribution"),b(),v(4,"span",3),g(5),b()(),L(6,"cc-metric-color-range-diagram",4)),i&2&&(F("minValue",o.sliderValues().min)("maxValue",o.sliderValues().max)("currentLeftValue",o.sliderValues().from)("currentRightValue",o.sliderValues().to)("leftColor",o.sliderColors().leftColor)("middleColor",o.sliderColors().middleColor)("rightColor",o.sliderColors().rightColor)("handleValueChange",o.handleValueChange)("sliderWidth",220),h(5),ge("",o.colorMetric()," \xD7 quantile %"),h(),F("minValue",o.sliderValues().min)("maxValue",o.sliderValues().max)("currentLeftValue",o.sliderValues().from)("currentRightValue",o.sliderValues().to)("leftColor",o.sliderColors().leftColor)("middleColor",o.sliderColors().middleColor)("rightColor",o.sliderColors().rightColor)("colorMetric",o.colorMetric())("values",o.sliderValues().values)("isAttributeDirectionInverted",o.isAttributeDirectionInversed())("diagramWidth",380)("diagramHeight",190)("showAxisLabels",!1))},dependencies:[Pb,Ib],encapsulation:2,changeDetection:0})}}return t})();function vS(t,n){if(t&1){let e=Me();y(0,"button",6),Y("click",function(){ce(e);let o=A();return de(o.resetThresholds())}),fe(1,"i",7),S()}}var Bb=(()=>{class t{constructor(e,i,o,r){this.mapStateReadWindow=e,this.fileStoreReadWindow=i,this.metricsBarReadStore=o,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:Lt}),this.selectedColorMetricData=D(this.metricsBarReadStore.selectedColorMetricData$,{initialValue:{values:[],minValue:0,maxValue:0}}),this.canResetThresholds=Z(()=>!this.isDeltaState()&&this.colorMetric()!=="unary"),this.swatchGradient=Z(()=>{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(lr(this.selectedColorMetricData()))}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(Te),te(mt),te(Ze))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(y(0,"div",0)(1,"div",1),fe(2,"span",2),y(3,"span",3),g(4,"Color by "),y(5,"span",4),g(6),S()()(),O(7,vS,2,0,"button",5),S()),i&2&&(h(2),Oe("background",o.swatchGradient()),h(4),qe(o.colorMetric()),h(),z(o.canResetThresholds()?7:-1))},encapsulation:2,changeDetection:0})}}return t})();var Vb=(()=>{class t{constructor(){this.override=H.required(),this.recolorOverride=Ce(),this.unpinOverride=Ce()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"div",0)(1,"cc-inline-color-picker",1),W("colorChange",function(a){return o.recolorOverride.emit(a)}),b(),v(2,"span",2),g(3),b(),v(4,"span",3),g(5),b(),v(6,"button",4),W("click",function(){return o.unpinOverride.emit()}),L(7,"i",5),b()()),i&2&&(F("title",o.override().path),h(),F("hexColor",o.override().color)("ariaLabel","Recolor "+o.override().path),h(2),qe(o.override().path),h(),F("title",o.override().fileCount+" files"),h(),qe(o.override().fileCount),h(),F("title","Unpin "+o.override().path))},dependencies:[ho],encapsulation:2,changeDetection:0})}}return t})();var xS=["pinInput"];function wS(t,n){if(t&1){let e=Me();y(0,"button",2),Y("click",function(){ce(e);let o=A();return de(o.startPinning())}),fe(1,"i",3),y(2,"span"),g(3,"Pin a folder color\u2026"),S()()}}function yS(t,n){if(t&1){let e=Me();y(0,"li",8)(1,"button",10),Y("mousedown",function(o){return o.preventDefault()})("click",function(){let o=ce(e).$implicit,r=A(2);return de(r.handlePin(o))}),y(2,"span",11),g(3),S()()()}if(t&2){let e=n.$implicit;h(),le("title",e),h(2),qe(e)}}function SS(t,n){t&1&&(y(0,"li",9),g(1,"No folders found"),S())}function CS(t,n){if(t&1){let e=Me();y(0,"div",4),fe(1,"i",5),y(2,"input",6,0),Y("input",function(o){ce(e);let r=A();return de(r.handleSearchTermChange(o.target.value))})("keydown.escape",function(o){ce(e);let r=A();return de(r.handleSearchEscape(o))})("blur",function(){ce(e);let o=A();return de(o.handleSearchBlur())}),S()(),y(4,"ul",7),Pe(5,yS,4,2,"li",8,Gt,!1,SS,2,0,"li",9),S()}if(t&2){let e=A();h(2),le("value",e.searchTerm()),h(3),Ne(e.folderSuggestions())}}var MS=8,Wb=(()=>{class t{constructor(e){this.metricsBarReadStore=e,this.pinFolder=Ce(),this.folderPaths=D(this.metricsBarReadStore.markableFolderPaths$,{initialValue:[]}),this.overrides=D(this.metricsBarReadStore.markedPackagesWithCounts$,{initialValue:[]}),this.isPinning=be(!1),this.searchTerm=be(""),this.pinInput=je("pinInput"),this.folderSuggestions=Z(()=>{let i=this.searchTerm().toLowerCase(),o=new Set(this.overrides().map(a=>a.path)),r=[];for(let a of this.folderPaths())if(!(o.has(a)||!a.toLowerCase().includes(i))&&(r.push(a),r.length>=MS))break;return r})}startPinning(){this.isPinning.set(!0),setTimeout(()=>this.pinInput()?.nativeElement.focus())}stopPinning(){this.isPinning.set(!1),this.searchTerm.set("")}handleSearchTermChange(e){this.searchTerm.set(e)}handleSearchBlur(){this.searchTerm().trim()===""&&this.stopPinning()}handleSearchEscape(e){e.preventDefault(),this.stopPinning()}handlePin(e){this.pinFolder.emit(e),this.stopPinning()}static{this.\u0275fac=function(i){return new(i||t)(te(mt))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-pin-folder-search"]],viewQuery:function(i,o){i&1&&tt(o.pinInput,xS,5),i&2&&it()},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,o){i&1&&O(0,wS,4,0,"button",1)(1,CS,8,2),i&2&&z(o.isPinning()?1:0)},encapsulation:2,changeDetection:0})}}return t})();var _S=(t,n)=>n.path;function ES(t,n){if(t&1&&(v(0,"span",2),g(1),b()),t&2){let e=A();h(),ge("",e.overrides().length," pinned")}}function kS(t,n){if(t&1){let e=Me();v(0,"cc-folder-override-row",7),W("recolorOverride",function(o){let r=ce(e).$implicit,a=A(2);return de(a.handleRecolor(r.path,o))})("unpinOverride",function(){let o=ce(e).$implicit,r=A(2);return de(r.handleUnpin(o.path))}),b()}if(t&2){let e=n.$implicit;F("override",e)}}function qS(t,n){if(t&1&&(v(0,"div",4),Pe(1,kS,1,1,"cc-folder-override-row",6,_S),b()),t&2){let e=A();h(),Ne(e.overrides())}}var Ob=(()=>{class t{constructor(e,i,o){this.mapStateReadWindow=e,this.metricsBarReadStore=i,this.metricsBarWriteStore=o,this.overrides=D(this.metricsBarReadStore.markedPackagesWithCounts$,{initialValue:[]}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Lt})}handlePin(e){this.metricsBarWriteStore.markPackage({path:e,color:this.nextMarkingColor(e)})}handleRecolor(e,i){this.metricsBarWriteStore.markPackage({path:e,color:i})}handleUnpin(e){this.metricsBarWriteStore.unmarkPackage(e)}nextMarkingColor(e){let i=this.mapColors().markingColors,o=this.findMarkedParentColor(e),r=i.filter(s=>s!==o);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(e){let i,o=0;for(let r of this.overrides())e.startsWith(`${r.path}/`)&&r.path.length>o&&(i=r.color,o=r.path.length);return i}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(mt),te(Ze))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Folder Overrides"),b(),O(3,ES,2,1,"span",2),b(),v(4,"p",3),g(5,"These folders\u2019 floors are tinted with the pinned color."),b(),O(6,qS,3,0,"div",4),v(7,"cc-pin-folder-search",5),W("pinFolder",function(a){return o.handlePin(a)}),b()),i&2&&(h(3),z(o.overrides().length>0?3:-1),h(3),z(o.overrides().length>0?6:-1))},dependencies:[Vb,Wb],encapsulation:2,changeDetection:0})}}return t})();var zb=(()=>{class t{constructor(e,i){this.mapStateReadWindow=e,this.metricsBarWriteStore=i,this.groupName=H.required(),this.colorMode=D(this.mapStateReadWindow.colorMode$,{initialValue:"absolute"})}handleColorModeChange(e){this.metricsBarWriteStore.setColorMode(e)}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(Ze))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(y(0,"div",0)(1,"span",1),g(2,"Gradient Mode"),S(),y(3,"div",2)(4,"input",3),Y("change",function(){return o.handleColorModeChange("absolute")}),S(),y(5,"input",4),Y("change",function(){return o.handleColorModeChange("focusedGradient")}),S(),y(6,"input",5),Y("change",function(){return o.handleColorModeChange("weightedGradient")}),S(),y(7,"input",6),Y("change",function(){return o.handleColorModeChange("trueGradient")}),S()()()),i&2&&(h(4),le("name",o.groupName())("checked",o.colorMode()==="absolute"),h(),le("name",o.groupName())("checked",o.colorMode()==="focusedGradient"),h(),le("name",o.groupName())("checked",o.colorMode()==="weightedGradient"),h(),le("name",o.groupName())("checked",o.colorMode()==="trueGradient"))},encapsulation:2,changeDetection:0})}}return t})();function TS(t,n){if(t&1){let e=Me();v(0,"label",1)(1,"input",3),W("change",function(){ce(e);let o=A();return de(o.handleIsColorRangeInvertedChange())}),b(),v(2,"span",4),g(3,"Invert colors"),b()()}if(t&2){let e=A();h(),F("checked",e.isColorRangeInverted())}}function IS(t,n){if(t&1){let e=Me();v(0,"label",1)(1,"input",3),W("change",function(){ce(e);let o=A();return de(o.handleAreDeltaColorsInvertedChange())}),b(),v(2,"span",4),g(3,"Invert colors"),b()()}if(t&2){let e=A();h(),F("checked",e.areDeltaColorsInverted())}}var $b=(()=>{class t{constructor(e,i,o){this.fileStoreReadWindow=e,this.mapStateReadWindow=i,this.metricsBarWriteStore=o,this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Lt}),this.isColorRangeInverted=Z(()=>this.mapColors().isColorRangeInverted??!1),this.areDeltaColorsInverted=Z(()=>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||t)(te(Te),te(ve),te(Ze))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"div",0),O(1,TS,4,1,"label",1)(2,IS,4,1,"label",1),L(3,"cc-reset-settings-button",2),b()),i&2&&(h(),z(o.isDeltaState()?2:1),h(2),F("settingsKeys",o.resetColorsKeys())("tooltip",o.isDeltaState()?"Reset color values to default":"Reset color values and gradient mode to default")("small",!0))},dependencies:[mo],encapsulation:2,changeDetection:0})}}return t})();function DS(t,n){if(t&1&&L(0,"cc-color-range-section")(1,"cc-gradient-mode-picker",1),t&2){let e=A();h(),F("groupName",e.popoverId()+"-gradient-mode")}}var zl=(()=>{class t{constructor(e,i){this.mapStateReadWindow=e,this.fileStoreReadWindow=i,this.popoverId=H.required(),this.anchorName=H.required(),this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.hasRangeSection=Z(()=>!this.isDeltaState()&&this.colorMetric()!=="unary")}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(Te))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"cc-settings-popover-shell",0),L(1,"cc-color-settings-header"),O(2,DS,2,1),L(3,"cc-color-bands-section")(4,"cc-invert-reset-row")(5,"cc-folder-overrides"),b()),i&2&&(F("popoverId",o.popoverId())("anchorName",o.anchorName())("widthClass","max-w-[95vw] "+(o.hasRangeSection()?"w-[420px]":"w-80")),h(2),z(o.hasRangeSection()?2:-1))},dependencies:[Wt,Bb,Nb,zb,p1,$b,Ob],encapsulation:2,changeDetection:0})}}return t})();var jb=(()=>{class t{constructor(e,i,o){this.mapStateReadWindow=e,this.preferencesReadWindow=i,this.metricsBarWriteStore=o,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(e){this.metricsBarWriteStore.setColorMetric(e)}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(Yn),te(Ze))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"cc-axis-card",0)(1,"div",1),L(2,"cc-metric-meta-value",2),b()(),v(3,"cc-metric-select-popover",3),W("metricSelected",function(a){return o.handleMetricSelected(a)}),b(),L(4,"cc-color-settings-popover",4)),i&2&&(F("metricName",o.colorMetric())("hasCog",!0)("cogPopoverId",o.settingsPopoverId)("cogAnchorName",o.settingsAnchorName)("searchPopoverId",o.searchPopoverId)("searchAnchorName",o.searchAnchorName)("disabled",o.isLinked())("testId","metric-segment-color")("cogTestId","metric-segment-color-cog"),h(3),F("popoverId",o.searchPopoverId)("anchorName",o.searchAnchorName)("selected",o.colorMetric()),h(),F("popoverId",o.settingsPopoverId)("anchorName",o.settingsAnchorName))},dependencies:[lo,pr,sl,zl],encapsulation:2,changeDetection:0})}}return t})();var Hb=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.metricsBarWriteStore=q(Ze),this.isEdgeMetricVisible=D(this.mapStateReadWindow.isEdgeMetricVisible$,{initialValue:!0})}toggle(){this.metricsBarWriteStore.toggleEdgeMetricVisible()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(y(0,"label",0)(1,"input",1),Y("change",function(){return o.toggle()}),S(),y(2,"span"),g(3,"Disable edge metric"),S()()),i&2&&(h(),le("checked",!o.isEdgeMetricVisible()))},encapsulation:2,changeDetection:0})}}return t})();var Ub=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.metricsBarReadStore=q(mt),this.metricsBarWriteStore=q(Ze),this.popoverId=H.required(),this.anchorName=H.required(),this.amountOfBuildingsWithSelectedEdgeMetric=D(this.metricsBarReadStore.amountOfBuildingsWithSelectedEdgeMetric$,{initialValue:0}),this.edgePreviewLabel=D(this.metricsBarReadStore.amountOfBuildingsWithSelectedEdgeMetric$.pipe(ke(e=>`Preview the edges of up to ${e} 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:Lt}),this.outgoingEdgeColor=Z(()=>this.mapColors().outgoingEdge),this.incomingEdgeColor=Z(()=>this.mapColors().incomingEdge),this.resetKeys=["mapState.amountOfEdgePreviews","mapState.edgeHeight","mapState.mapColors.outgoingEdge","mapState.showOutgoingEdges","mapState.mapColors.incomingEdge","mapState.showIncomingEdges","mapState.showOnlyBuildingsWithEdges","mapState.isEdgeMetricVisible"]}setAmountOfEdgePreviews(e){this.metricsBarWriteStore.setAmountOfEdgePreviews(e)}setEdgeHeight(e){this.metricsBarWriteStore.setEdgeHeight(e)}setShowOutgoingEdges(e){let i=e.target.checked;this.metricsBarWriteStore.setShowOutgoingEdges(i)}setShowIncomingEdges(e){let i=e.target.checked;this.metricsBarWriteStore.setShowIncomingEdges(i)}setShowOnlyBuildingsWithEdges(e){let i=e.target.checked;this.metricsBarWriteStore.setShowOnlyBuildingsWithEdges(i)}setMapColor(e,i){this.metricsBarWriteStore.setMapColors({[e]:i})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"cc-settings-popover-shell",0)(1,"div",1)(2,"span",2),g(3,"Preview"),b(),v(4,"cc-slider-number-input",3),W("valueChange",function(a){return o.setAmountOfEdgePreviews(a)}),b()(),v(5,"div",4)(6,"span",2),g(7,"Height"),b(),v(8,"cc-slider-number-input",5),W("valueChange",function(a){return o.setEdgeHeight(a)}),b()(),v(9,"div",6)(10,"div",7)(11,"cc-inline-color-picker",8),W("colorChange",function(a){return o.setMapColor("outgoingEdge",a)}),b(),v(12,"span",9),g(13,"Outgoing Edge"),b(),v(14,"label",10)(15,"input",11),W("change",function(a){return o.setShowOutgoingEdges(a)}),b(),v(16,"span"),g(17,"Show"),b()()(),v(18,"div",7)(19,"cc-inline-color-picker",12),W("colorChange",function(a){return o.setMapColor("incomingEdge",a)}),b(),v(20,"span",9),g(21,"Incoming Edge"),b(),v(22,"label",10)(23,"input",11),W("change",function(a){return o.setShowIncomingEdges(a)}),b(),v(24,"span"),g(25,"Show"),b()()()(),v(26,"label",10)(27,"input",13),W("change",function(a){return o.setShowOnlyBuildingsWithEdges(a)}),b(),v(28,"span"),g(29,"Only show nodes with edges"),b()(),L(30,"cc-edge-metric-toggle")(31,"cc-reset-settings-button",14),b()),i&2&&(F("popoverId",o.popoverId())("anchorName",o.anchorName()),h(),F("title",o.edgePreviewLabel()),h(3),F("min",0)("max",o.amountOfBuildingsWithSelectedEdgeMetric())("value",o.amountOfEdgePreviews())("disabled",o.amountOfBuildingsWithSelectedEdgeMetric()===0),h(4),F("min",1)("max",9)("value",o.edgeHeight())("disabled",o.amountOfBuildingsWithSelectedEdgeMetric()===0),h(3),F("hexColor",o.outgoingEdgeColor()),h(4),F("checked",o.showOutgoingEdges()),h(4),F("hexColor",o.incomingEdgeColor()),h(4),F("checked",o.showIncomingEdges()),h(4),F("checked",o.showOnlyBuildingsWithEdges())("disabled",o.amountOfBuildingsWithSelectedEdgeMetric()===0),h(4),F("settingsKeys",o.resetKeys))},dependencies:[ho,mo,Hb,Wt,ir],encapsulation:2,changeDetection:0})}}return t})();function RS(t,n){t&1&&(L(0,"cc-metric-chooser-type",5),v(1,"span"),g(2),b()),t&2&&(F("metricFor","edgeMetric"),h(2),qe(n))}function AS(t,n){t&1&&(v(0,"span",2),g(1,"\xA0"),b())}var Xb=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.metricsBarWriteStore=q(Ze),this.nodeSelectionService=q(mr),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=Z(()=>{let e=this.hoveredNode(),i=this.edgeMetric();if(!e||!i)return null;let o=e.edgeAttributes?.[i];return o?`${Gb(o.incoming)} / ${Gb(o.outgoing)}`:null})}handleMetricSelected(e){this.metricsBarWriteStore.setEdgeMetric(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){if(i&1&&(v(0,"cc-axis-card",0)(1,"div",1),O(2,RS,3,2)(3,AS,2,0,"span",2),b()(),v(4,"cc-metric-select-popover",3),W("metricSelected",function(a){return o.handleMetricSelected(a)}),b(),L(5,"cc-edge-settings-popover",4)),i&2){let r;F("metricName",o.edgeMetric())("hasCog",!0)("cogPopoverId",o.settingsPopoverId)("cogAnchorName",o.settingsAnchorName)("searchPopoverId",o.searchPopoverId)("searchAnchorName",o.searchAnchorName)("dimmed",!o.isEdgeMetricVisible())("testId","metric-segment-edges")("cogTestId","metric-segment-edges-cog"),h(2),z((r=o.hoveredEdgeValue())?2:3,r),h(2),F("popoverId",o.searchPopoverId)("anchorName",o.searchAnchorName)("selected",o.edgeMetric()),h(),F("popoverId",o.settingsPopoverId)("anchorName",o.settingsAnchorName)}},dependencies:[lo,al,pr,Ub],encapsulation:2,changeDetection:0})}}return t})();function Gb(t){return typeof t=="number"?t.toLocaleString():"-"}function FS(t,n){if(t&1){let e=Me();v(0,"label",4)(1,"input",6),W("change",function(o){ce(e);let r=A();return de(r.toggleInvertHeight(o))}),b(),v(2,"span"),g(3,"Invert Height"),b()()}if(t&2){let e=A();h(),F("checked",e.invertHeight())}}var Qb=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.fileStoreReadWindow=q(Te),this.metricsBarWriteStore=q(Ze),this.popoverId=H.required(),this.anchorName=H.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(e){this.metricsBarWriteStore.setScaling({y:e})}toggleInvertHeight(e){let i=e.target.checked;this.metricsBarWriteStore.setInvertHeight(i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"cc-settings-popover-shell",0)(1,"div",1)(2,"span",2),g(3,"Height"),b(),v(4,"cc-slider-number-input",3),W("valueChange",function(a){return o.setScalingY(a)}),b()(),O(5,FS,4,1,"label",4),L(6,"cc-reset-settings-button",5),b()),i&2&&(F("popoverId",o.popoverId())("anchorName",o.anchorName()),h(4),F("min",1)("max",25)("value",o.scalingY().y),h(),z(o.isDeltaState()?-1:5),h(),F("settingsKeys",o.resetKeys))},dependencies:[mo,Wt,ir],encapsulation:2,changeDetection:0})}}return t})();var Yb=(()=>{class t{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=q(ve),this.metricsBarWriteStore=q(Ze),this.heightMetric=D(this.mapStateReadWindow.heightMetric$,{initialValue:""})}handleMetricSelected(e){this.metricsBarWriteStore.setHeightMetric(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"cc-metric-segment",0),W("metricSelected",function(a){return o.handleMetricSelected(a)}),L(1,"cc-height-settings-popover",1),b()),i&2&&(F("metricName",o.heightMetric())("searchPopoverId",o.searchPopoverId)("searchAnchorName",o.searchAnchorName)("settingsPopoverId",o.settingsPopoverId)("settingsAnchorName",o.settingsAnchorName),h(),F("popoverId",o.settingsPopoverId)("anchorName",o.settingsAnchorName))},dependencies:[ll,Qb],encapsulation:2,changeDetection:0})}}return t})();function $l(t){return["metrics","colors","camera","filters","labelsAndFolders"].filter(e=>t.sections[e]!==void 0)}var jl={metrics:"Metrics",colors:"Colors",camera:"Camera",filters:"Filters",labelsAndFolders:"Labels & Folders"},Hl={metrics:"fa-bar-chart",colors:"fa-paint-brush",camera:"fa-video-camera",filters:"fa-filter",labelsAndFolders:"fa-tags"},Ul=".ccscenario";function Zb(t){return nt(xe(xe({schemaVersion:1,name:t.name},t.description?{description:t.description}:{}),t.mapFileNames?.length>0?{mapFileNames:t.mapFileNames}:{}),{sections:t.sections})}function Kb(t){return{id:crypto.randomUUID(),name:t.name,description:t.description,mapFileNames:t.mapFileNames,createdAt:Date.now(),sections:t.sections}}var Gl=(()=>{class t{constructor(e,i){this.store=e,this.ccStateSnapshot=i}getValue(){return this.ccStateSnapshot.get()}setStatePatch(e){this.store.dispatch(Ei({value:e}))}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(Bt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var LS=["areaMetric","heightMetric","colorMetric","distributionMetric"],Xl=(()=>{class t{constructor(e,i,o,r){this.scenariosStore=e,this.threeCameraService=i,this.threeMapControlsService=o,this.threeRendererService=r}getAvailableMetricNames(e){return{nodeMetrics:new Set(e.nodeMetricData.map(i=>i.name)),edgeMetrics:new Set(e.edgeMetricData.map(i=>i.name))}}getMissingMetrics(e,i){let o=this.getAvailableMetricNames(i),r=[e.areaMetric,e.heightMetric,e.colorMetric,e.distributionMetric].filter(l=>!!l),a=[...new Set(r.filter(l=>!o.nodeMetrics.has(l)))],s=e.edgeMetric&&!o.edgeMetrics.has(e.edgeMetric)?[e.edgeMetric]:[];return{nodeMetrics:a,edgeMetrics:s}}hasMissingMetrics(e){return e.nodeMetrics.length>0||e.edgeMetrics.length>0}buildOrderedStatePatches(e,i,o){return[i.has("metrics")&&e.metrics?this.buildMetricsPatch(e,o):void 0,i.has("colors")&&e.colors?this.buildColorsPatch(e.colors):void 0,this.buildFiltersAndLabelsPatch(e,i)].filter(r=>r!==void 0)}getCameraVectors(e){if(!e.camera)return;let{position:i,target:o}=e.camera;return{position:new Ye(i.x,i.y,i.z),target:new Ye(o.x,o.y,o.z)}}async applyScenario(e,i,o){Uc(!0);try{let r=i.has("camera")?this.getCameraVectors(e.sections):void 0,a=r!==void 0,s=this.buildOrderedStatePatches(e.sections,i,o),l=a&&s.length>0?this.scenariosStore.getValue().preferences.resetCameraIfNewFileIsLoaded:void 0;l&&s.length>0&&(s[0].preferences=nt(xe({},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{Uc(!1)}}buildMetricsPatch(e,i){if(!e.metrics)return{};let o=i?this.getAvailableMetricNames(i):void 0,r={};for(let d of LS){let c=e.metrics[d];c!==void 0&&(!o||o.nodeMetrics.has(c))&&(r[d]=c)}let a=e.metrics.edgeMetric;a!==void 0&&(!o||!a||o.edgeMetrics.has(a))&&(r.edgeMetric=a);let s=Object.keys(r).length>0;if(!s&&e.metrics.isColorMetricLinkedToHeightMetric===void 0)return{};let l={};return s&&(l.mapState=xe({},r),e.metrics.isColorMetricLinkedToHeightMetric!==void 0&&(l.preferences={isColorMetricLinkedToHeightMetric:e.metrics.isColorMetricLinkedToHeightMetric})),l}buildColorsPatch(e){let i={colorRange:e.colorRange};return e.colorMode!==void 0&&(i.colorMode=e.colorMode),e.mapColors!==void 0&&(i.mapColors=e.mapColors),{mapState:i}}buildFiltersPatch(e){return{sharedView:{blacklist:[...e.blacklist],focusedNodePath:[...e.focusedNodePath]}}}buildLabelsAndFoldersPatch(e){return{mapState:{amountOfTopLabels:e.amountOfTopLabels,labelSize:e.labelSize,showMetricLabelNameValue:e.showMetricLabelNameValue,showMetricLabelNodeName:e.showMetricLabelNodeName,enableFloorLabels:e.enableFloorLabels,colorLabels:e.colorLabels,labelMode:e.labelMode,groupLabelCollisions:e.groupLabelCollisions},sharedView:{markedPackages:[...e.markedPackages]}}}mergePatches(e,i){return xe(xe(xe(xe(xe({},e),i),e.preferences||i.preferences?{preferences:xe(xe({},e.preferences),i.preferences)}:{}),e.mapState||i.mapState?{mapState:xe(xe({},e.mapState),i.mapState)}:{}),e.sharedView||i.sharedView?{sharedView:xe(xe({},e.sharedView),i.sharedView)}:{})}buildFiltersAndLabelsPatch(e,i){let o=i.has("filters")&&e.filters?this.buildFiltersPatch(e.filters):void 0,r=i.has("labelsAndFolders")&&e.labelsAndFolders?this.buildLabelsAndFoldersPatch(e.labelsAndFolders):void 0;return o&&r?this.mergePatches(o,r):o??r}static{this.\u0275fac=function(i){return new(i||t)(M(Gl),M(Qn),M(Vt),M(kt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var PS=["dialog"];function NS(t,n){if(t&1&&(v(0,"div",4)(1,"span",12),L(2,"i",13),v(3,"span",14),g(4),b()()()),t&2){let e=A();h(),F("title",e.scenario().mapFileNames.join(", ")),h(3),qe(e.scenario().mapFileNames.join(", "))}}function BS(t,n){if(t&1){let e=Me();v(0,"label",6)(1,"input",15),W("change",function(o){let r=ce(e).$implicit,a=A();return de(a.toggleSection(r,o.target.checked))}),b(),L(2,"i"),v(3,"span"),g(4),b()()}if(t&2){let e=n.$implicit,i=A();h(),F("checked",i.selectedSections()[e]),h(),yt(cn("fa ",i.sectionIcons[e]," w-4 text-center")),h(2),qe(i.sectionLabels[e])}}function VS(t,n){if(t&1&&(v(0,"li"),g(1),b()),t&2){let e=n.$implicit;h(),ge("",e," (node metric)")}}function WS(t,n){if(t&1&&(v(0,"li"),g(1),b()),t&2){let e=n.$implicit;h(),ge("",e," (edge metric)")}}function OS(t,n){if(t&1&&(v(0,"div",7),L(1,"i",16),v(2,"div")(3,"strong"),g(4,"Some metrics are not available in the current map and will not be applied:"),b(),v(5,"ul",17),Pe(6,VS,2,1,"li",null,Gt),Pe(8,WS,2,1,"li",null,Gt),b()()()),t&2){let e=A();h(6),Ne(e.missingMetrics().nodeMetrics),h(2),Ne(e.missingMetrics().edgeMetrics)}}var Ch=(()=>{class t{constructor(e){this.scenarioApplier=e,this.scenario=H.required(),this.metricData=H.required(),this.closed=Ce(),this.dialogElement=je.required("dialog"),this.sectionLabels=jl,this.sectionIcons=Hl,this.availableSectionKeys=Z(()=>$l(this.scenario())),this.selectedSections=be({metrics:!0,colors:!0,camera:!0,filters:!0,labelsAndFolders:!0}),this.missingMetrics=Z(()=>{let i=this.scenario().sections.metrics;return i?this.scenarioApplier.getMissingMetrics(i,this.metricData()):{nodeMetrics:[],edgeMetrics:[]}}),this.hasMissing=Z(()=>this.scenarioApplier.hasMissingMetrics(this.missingMetrics())),this.hasAnySelected=Z(()=>this.availableSectionKeys().some(i=>this.selectedSections()[i])),this.destroyRef=q(sn)}ngAfterViewInit(){let e=this.dialogElement().nativeElement,i=()=>this.closed.emit();e.addEventListener("close",i),this.destroyRef.onDestroy(()=>e.removeEventListener("close",i)),e.showModal()}toggleSection(e,i){this.selectedSections.update(o=>nt(xe({},o),{[e]:i}))}async apply(){let e=new Set(this.availableSectionKeys().filter(i=>this.selectedSections()[i]));this.dialogElement().nativeElement.close(),await this.scenarioApplier.applyScenario(this.scenario(),e,this.metricData())}close(){this.dialogElement().nativeElement.close()}static{this.\u0275fac=function(i){return new(i||t)(te(Xl))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-apply-scenario-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,PS,5),i&2&&it()},inputs:{scenario:[1,"scenario"],metricData:[1,"metricData"]},outputs:{closed:"closed"},decls:19,vars:5,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"],[1,"flex","items-center","gap-2","py-1","cursor-pointer"],[1,"alert","alert-warning","mt-4","text-sm"],[1,"modal-action"],[1,"btn",3,"click"],[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"],["type","checkbox",1,"checkbox","checkbox-sm",3,"change","checked"],[1,"fa","fa-exclamation-triangle"],[1,"list-disc","pl-5","mt-1"]],template:function(i,o){if(i&1&&(v(0,"dialog",1,0)(2,"div",2)(3,"h2",3),g(4),b(),O(5,NS,5,2,"div",4),v(6,"p",5),g(7,"Select which sections to apply:"),b(),Pe(8,BS,5,5,"label",6,Gt),O(10,OS,10,0,"div",7),v(11,"div",8)(12,"button",9),W("click",function(){return o.close()}),g(13,"Cancel"),b(),v(14,"button",10),W("click",function(){return o.apply()}),g(15,"Apply"),b()()(),v(16,"form",11)(17,"button"),g(18,"close"),b()()()),i&2){let r;h(3),F("title","Apply: "+o.scenario().name),h(),ge("Apply: ",o.scenario().name),h(),z((r=o.scenario().mapFileNames)!=null&&r.length?5:-1),h(3),Ne(o.availableSectionKeys()),h(2),z(o.hasMissing()&&o.selectedSections().metrics?10:-1),h(4),F("disabled",!o.hasAnySelected())}},dependencies:[co,er,Kn,Jn],encapsulation:2,changeDetection:0})}}return t})();var Ql=(()=>{class t{async readAll(){return await(await Pr()).getAll(Lr)}async add(e){let o=(await Pr()).transaction(Lr,"readwrite");await Promise.all([o.store.add(e),o.done])}async update(e){let o=(await Pr()).transaction(Lr,"readwrite");await Promise.all([o.store.put(e),o.done])}async delete(e){let o=(await Pr()).transaction(Lr,"readwrite");await Promise.all([o.store.delete(e),o.done])}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Wi={positive:"#69AE40",neutral:"#ddcc00",negative:"#820E0E"},zS={positive:Wi.negative,neutral:Wi.neutral,negative:Wi.positive,isColorRangeInverted:!0},o3=[{id:"built-in-rloc",name:"Real Lines of Code",description:"Visualize code size using real lines of code",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"rloc",colorMetric:"rloc",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:250,to:500},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-complexity",name:"Complexity",description:"Visualize cyclomatic complexity",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"complexity",colorMetric:"complexity",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:50,to:100},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-comment-lines",name:"Comment Lines",description:"Visualize comment density",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"comment_lines",colorMetric:"comment_lines",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:50,to:100},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-code-smells",name:"Code Smells",description:"Visualize code smell density",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"sonar_code_smells",colorMetric:"sonar_code_smells",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:10,to:50},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-logic-complexity",name:"Logic Complexity",description:"Visualize cognitive/logic complexity",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"logic_complexity",colorMetric:"logic_complexity",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:40,to:80},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-max-complexity-per-function",name:"Max Complexity per Function",description:"Visualize maximum complexity per function",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"max_complexity_per_function",colorMetric:"max_complexity_per_function",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:10,to:20},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-authors",name:"Authors",description:"Visualize the number of authors per file",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"number_of_authors",colorMetric:"number_of_authors",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:2,to:3},colorMode:Xt.absolute,mapColors:zS}}}],Oi=(()=>{class t{constructor(e,i,o,r){this.scenariosStore=e,this.threeCameraService=i,this.threeMapControlsService=o,this.db=r,this.scenarios$=new wm([])}async loadScenarios(){try{let e=await this.db.readAll();e.sort((i,o)=>o.createdAt-i.createdAt),this.scenarios$.next([...e,...o3])}catch(e){console.error("Failed to load scenarios from IndexedDB:",e),this.scenarios$.next([...o3])}}async saveScenario(e,i,o){let r=this.threeCameraService.camera?.position,a=this.threeMapControlsService.controls?.target,s=this.buildScenario(e,this.scenariosStore.getValue(),r?{x:r.x,y:r.y,z:r.z}:{x:0,y:300,z:1e3},a?{x:a.x,y:a.y,z:a.z}:{x:0,y:0,z:0},i,o);try{await this.db.add(s),await this.loadScenarios()}catch(l){console.error("Failed to save scenario:",l)}return s}async removeScenario(e){try{await this.db.delete(e),await this.loadScenarios()}catch(i){console.error("Failed to remove scenario:",i)}}buildScenarioSections(e,i,o){return{metrics:{areaMetric:e.mapState.areaMetric,heightMetric:e.mapState.heightMetric,colorMetric:e.mapState.colorMetric,edgeMetric:e.mapState.edgeMetric,distributionMetric:e.mapState.distributionMetric,isColorMetricLinkedToHeightMetric:e.preferences.isColorMetricLinkedToHeightMetric},colors:{colorRange:xe({},e.mapState.colorRange),colorMode:e.mapState.colorMode,mapColors:xe({},e.mapState.mapColors)},camera:{position:xe({},i),target:xe({},o)},filters:{blacklist:[...e.sharedView.blacklist],focusedNodePath:[...e.sharedView.focusedNodePath]},labelsAndFolders:{amountOfTopLabels:e.mapState.amountOfTopLabels,labelSize:e.mapState.labelSize,showMetricLabelNameValue:e.mapState.showMetricLabelNameValue,showMetricLabelNodeName:e.mapState.showMetricLabelNodeName,enableFloorLabels:e.mapState.enableFloorLabels,colorLabels:xe({},e.mapState.colorLabels),labelMode:e.mapState.labelMode,groupLabelCollisions:e.mapState.groupLabelCollisions,markedPackages:[...e.sharedView.markedPackages]}}}buildScenario(e,i,o,r,a,s){return{id:crypto.randomUUID(),name:e,description:a,mapFileNames:s,createdAt:Date.now(),sections:this.buildScenarioSections(i,o,r)}}static{this.\u0275fac=function(i){return new(i||t)(M(Gl),M(Qn),M(Vt),M(Ql))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $S=["dialog"];function jS(t,n){t&1&&(v(0,"span",8),g(1,"A name is required."),b())}var _h=(()=>{class t{constructor(e,i){this.scenariosService=e,this.fileStoreReadWindow=i,this.dialogElement=je.required("dialog"),this.name=be(""),this.description=be(""),this.bindToMap=be(!1),this.nameValid=Z(()=>this.name().trim().length>0),this.visibleFileNames=D(this.fileStoreReadWindow.files$.pipe(ke(o=>pn(o).map(r=>r.fileMeta.fileName))),{initialValue:[]}),this.hasFiles=Z(()=>this.visibleFileNames().length>0)}open(){this.name.set(""),this.description.set(""),this.bindToMap.set(!1),this.dialogElement().nativeElement.showModal()}close(){this.dialogElement().nativeElement.close()}async save(){if(this.nameValid()){let e=this.bindToMap()&&this.hasFiles()?this.visibleFileNames():void 0;await this.scenariosService.saveScenario(this.name(),this.description()||void 0,e),this.close()}}static{this.\u0275fac=function(i){return new(i||t)(te(Oi),te(Te))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-save-scenario-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,$S,5),i&2&&it()},decls:29,vars:8,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,"modal-action"],[1,"btn",3,"click"],[1,"btn","btn-primary",3,"click","disabled"],["method","dialog",1,"modal-backdrop"],[3,"click"]],template:function(i,o){i&1&&(v(0,"dialog",1,0)(2,"div",2)(3,"h2",3),g(4,"Save Scenario"),b(),v(5,"div",4)(6,"label",5)(7,"span",6),g(8,"Scenario Name"),b()(),v(9,"input",7),W("ngModelChange",function(a){return o.name.set(a)}),b(),O(10,jS,2,0,"span",8),b(),v(11,"div",4)(12,"label",9)(13,"span",6),g(14,"Description (optional)"),b()(),v(15,"textarea",10),W("ngModelChange",function(a){return o.description.set(a)}),b()(),v(16,"div",4)(17,"label",11)(18,"input",12),W("ngModelChange",function(a){return o.bindToMap.set(a)}),b(),v(19,"span",6),g(20," Bind to current maps "),b()()(),v(21,"div",13)(22,"button",14),W("click",function(){return o.close()}),g(23,"Cancel"),b(),v(24,"button",15),W("click",function(){return o.save()}),g(25,"Save"),b()()(),v(26,"form",16)(27,"button",17),W("click",function(){return o.close()}),g(28,"close"),b()()()),i&2&&(h(9),F("ngModel",o.name()),h(),z(!o.nameValid()&&o.name().length>0?10:-1),h(5),F("ngModel",o.description()),h(2),Le("opacity-40",!o.hasFiles()),h(),F("ngModel",o.bindToMap())("disabled",!o.hasFiles()),h(6),F("disabled",!o.nameValid()))},dependencies:[co,er,Ss,mf,Cs,Kn,Ms,Jn],encapsulation:2,changeDetection:0})}}return t})();var HS=["dialog"],Yl=(()=>{class t{constructor(){this.scenarioName=H.required(),this.confirmed=Ce(),this.cancelled=Ce(),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||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-delete-confirm-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,HS,5),i&2&&it()},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,o){i&1&&(y(0,"dialog",1,0)(2,"div",2)(3,"h3",3),g(4,"Delete Scenario"),S(),y(5,"p"),g(6),S(),y(7,"div",4)(8,"button",5),Y("click",function(){return o.cancel()}),g(9,"Cancel"),S(),y(10,"button",6),Y("click",function(){return o.confirm()}),g(11,"Delete"),S()()(),y(12,"form",7)(13,"button",8),Y("click",function(){return o.cancel()}),g(14,"close"),S()()()),i&2&&(h(6),ge('Are you sure you want to delete "',o.scenarioName(),'"?'))},encapsulation:2,changeDetection:0})}}return t})();var US=["dialog"];function GS(t,n){if(t&1&&(y(0,"li"),g(1),S()),t&2){let e=n.$implicit;h(),qe(e)}}function XS(t,n){if(t&1&&(y(0,"div",5)(1,"div"),fe(2,"i",11),y(3,"strong"),g(4,"Already existing:"),S(),y(5,"ul",12),Pe(6,GS,2,1,"li",null,Gt),S()()()),t&2){let e=A();h(6),Ne(e.feedback().duplicates)}}function QS(t,n){if(t&1&&(y(0,"li"),g(1),S()),t&2){let e=n.$implicit;h(),qe(e)}}function YS(t,n){if(t&1&&(y(0,"div",6)(1,"div"),fe(2,"i",13),y(3,"strong"),g(4,"Invalid scenario files:"),S(),y(5,"ul",12),Pe(6,QS,2,1,"li",null,Gt),S()()()),t&2){let e=A();h(6),Ne(e.feedback().invalid)}}function ZS(t,n){if(t&1&&(y(0,"li"),g(1),S()),t&2){let e=n.$implicit;h(),qe(e)}}function KS(t,n){if(t&1&&(y(0,"div",6)(1,"div"),fe(2,"i",13),y(3,"strong"),g(4,"Could not read (bad format):"),S(),y(5,"ul",12),Pe(6,ZS,2,1,"li",null,Gt),S()()()),t&2){let e=A();h(6),Ne(e.feedback().parseErrors)}}var Zl=(()=>{class t{constructor(){this.closed=Ce(),this.dialogElement=je.required("dialog"),this.feedback=be({duplicates:[],invalid:[],parseErrors:[]})}open(e){let{duplicates:i,invalid:o,parseErrors:r}=e;(i.length>0||o.length>0||r.length>0)&&(this.feedback.set({duplicates:i,invalid:o,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||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-import-feedback-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,US,5),i&2&&it()},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,o){i&1&&(y(0,"dialog",1,0)(2,"div",2)(3,"h3",3),g(4,"Import Results"),S(),y(5,"div",4),O(6,XS,8,0,"div",5),O(7,YS,8,0,"div",6),O(8,KS,8,0,"div",6),S(),y(9,"div",7)(10,"button",8),Y("click",function(){return o.close()}),g(11,"OK"),S()()(),y(12,"form",9)(13,"button",10),Y("click",function(){return o.close()}),g(14,"close"),S()()()),i&2&&(h(6),z(o.feedback().duplicates.length?6:-1),h(),z(o.feedback().invalid.length?7:-1),h(),z(o.feedback().parseErrors.length?8:-1))},encapsulation:2,changeDetection:0})}}return t})();function JS(t,n){if(t&1){let e=Me();y(0,"button",0),Y("click",function(o){return ce(e),A().exportRequested.emit(),de(o.stopPropagation())}),fe(1,"i",1),S(),y(2,"button",2),Y("click",function(o){return ce(e),A().deleteRequested.emit(),de(o.stopPropagation())}),fe(3,"i",3),S()}}var n3=(()=>{class t{constructor(){this.isBuiltIn=H.required(),this.exportRequested=Ce(),this.deleteRequested=Ce()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&O(0,JS,4,0),i&2&&z(o.isBuiltIn()?-1:0)},encapsulation:2,changeDetection:0})}}return t})();function e8(t,n){t&1&&(y(0,"span",1),g(1,"Built-in"),S())}function t8(t,n){if(t&1&&(y(0,"span",2),g(1),S()),t&2){let e=A();h(),qe(e.view().formattedDate)}}function i8(t,n){if(t&1&&(y(0,"span",3),fe(1,"i",6),y(2,"span",7),g(3),S()()),t&2){let e=A();le("title","Bound to "+e.view().scenario.mapFileNames.join(", ")),h(3),qe(e.view().scenario.mapFileNames.join(", "))}}function o8(t,n){if(t&1&&fe(0,"i",8),t&2){let e=n.$implicit,i=A();yt(cn("fa ",i.sectionIcons[e])),le("title",i.sectionLabels[e])}}var r3=(()=>{class t{constructor(){this.view=H.required(),this.sectionLabels=jl,this.sectionIcons=Hl}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(y(0,"div",0),O(1,e8,2,0,"span",1)(2,t8,2,1,"span",2),O(3,i8,4,2,"span",3),y(4,"span",4),Pe(5,o8,1,4,"i",5,Gt),S()()),i&2&&(h(),z(o.view().scenario.isBuiltIn?1:2),h(2),z(o.view().mapBound?3:-1),h(2),Ne(o.view().sectionKeys))},encapsulation:2,changeDetection:0})}}return t})();function n8(t,n){t&1&&(v(0,"span",3),L(1,"i",7),b())}function r8(t,n){if(t&1&&(v(0,"div",4),g(1),b()),t&2){let e=A();h(),qe(e.view().scenario.description)}}var a3=(()=>{class t{constructor(){this.view=H.required(),this.applyRequested=Ce(),this.exportRequested=Ce(),this.deleteRequested=Ce()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"button",0),W("click",function(){return o.applyRequested.emit()}),v(1,"div",1)(2,"div",2),g(3),O(4,n8,2,0,"span",3),b(),O(5,r8,2,1,"div",4),L(6,"cc-scenario-item-badges",5),b(),v(7,"cc-scenario-item-actions",6),W("exportRequested",function(){return o.exportRequested.emit()})("deleteRequested",function(){return o.deleteRequested.emit()}),b()()),i&2&&(h(),Le("opacity-40",o.view().mapMismatch),h(),F("title",o.view().scenario.name),h(),ge(" ",o.view().scenario.name," "),h(),z(o.view().warning?4:-1),h(),z(o.view().scenario.description?5:-1),h(),F("view",o.view()),h(),F("isBuiltIn",!!o.view().scenario.isBuiltIn))},dependencies:[r3,n3],encapsulation:2,changeDetection:0})}}return t})();var yr=class{static downloadData(n,e){let i=new Blob([n],{type:"text/json"}),o=document.createEvent("MouseEvents"),r=document.createElement("a");r.download=e,r.href=window.URL.createObjectURL(i),r.dataset.downloadurl=["text/json",r.download,r.href].join(":"),o.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(o)}};var s3=(()=>{class t{constructor(e,i){this.scenariosService=e,this.db=i}exportScenario(e){let i=Zb(e),o=e.name.replaceAll(/[^\w-]/g,"_");yr.downloadData(JSON.stringify(i,null,2),o+Ul)}async importScenarioFiles(e){let i=this.scenariosService.scenarios$.getValue(),o={imported:0,duplicates:[],invalid:[],parseErrors:[]};for(let r of e){let a;try{let l=await r.text();a=JSON.parse(l)}catch{o.parseErrors.push(r.name);continue}if(a.schemaVersion!==1||!a.name||!a.sections){o.invalid.push(r.name);continue}if(this.isDuplicate(a,i)){o.duplicates.push(a.name);continue}let s=Kb(a);i.push(s),await this.db.add(s),o.imported++}return o.imported>0&&await this.scenariosService.loadScenarios(),o}isDuplicate(e,i){return i.some(o=>o.name===e.name&&JSON.stringify(o.sections)===JSON.stringify(e.sections))}static{this.\u0275fac=function(i){return new(i||t)(M(Oi),M(Ql))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var l3=(()=>{class t{constructor(e){this.store=e,this.metricData$=this.store.select($n)}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var l8=[{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"}],c3=(()=>{class t{constructor(e){this.scenarioApplier=e}groupScenarios(e,i){let o=new Map;for(let r of e){let a=this.getScenarioPriority(r,i),s=o.get(a);s?s.push(r):o.set(a,[r])}return l8.filter(r=>o.has(r.priority)).map(r=>({label:r.label,icon:r.icon,scenarios:o.get(r.priority)??[]}))}toScenarioView(e,i,o){let r=(e.mapFileNames?.length??0)>0,a=r&&!e.mapFileNames.some(l=>i.has(l)),s=e.sections.metrics?this.scenarioApplier.hasMissingMetrics(this.scenarioApplier.getMissingMetrics(e.sections.metrics,o)):!1;return{scenario:e,warning:s,mapMismatch:a,mapBound:r,sectionKeys:$l(e),formattedDate:new Date(e.createdAt).toLocaleDateString()}}getScenarioPriority(e,i){let o=(e.mapFileNames?.length??0)>0;return o&&e.mapFileNames?.some(r=>i.has(r))?0:!o&&!e.isBuiltIn?1:e.isBuiltIn?2:3}static{this.\u0275fac=function(i){return new(i||t)(M(Xl))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var d8=["dialog"],h8=["fileInput"],m8=(t,n)=>n.label,p8=(t,n)=>n.scenario.id;function u8(t,n){t&1&&(v(0,"p",13),g(1,"No scenarios found."),b())}function f8(t,n){if(t&1){let e=Me();v(0,"cc-scenario-item",25),W("applyRequested",function(){let o=ce(e).$implicit,r=A(2);return de(r.applyScenario(o.scenario))})("exportRequested",function(){let o=ce(e).$implicit,r=A(2);return de(r.exportScenario(o.scenario))})("deleteRequested",function(){let o=ce(e).$implicit,r=A(2);return de(r.requestDelete(o.scenario))}),b()}if(t&2){let e=n.$implicit;F("view",e)}}function g8(t,n){if(t&1&&(v(0,"div",19),L(1,"input",20),v(2,"div",21),L(3,"i"),g(4),v(5,"span",22),g(6),b()(),v(7,"div",23),Pe(8,f8,1,1,"cc-scenario-item",24,p8),b()()),t&2){let e=n.$implicit,i=n.$index;Le("mt-1",i!==0),h(),F("checked",i===0),h(2),yt(cn("fa ",e.icon," mr-2")),h(),ge(" ",e.label," "),h(2),qe(e.scenarios.length),h(2),Ne(e.scenarios)}}var Eh=(()=>{class t{constructor(e,i,o,r,a){this.scenariosService=e,this.importExportService=i,this.scenarioDialogStore=o,this.fileStoreReadWindow=r,this.helpers=a,this.dialogElement=je.required("dialog"),this.deleteConfirmDialogRef=je.required(Yl),this.importFeedbackDialogRef=je.required(Zl),this.fileInput=je.required("fileInput"),this.applyRequested=Ce(),this.deleteTarget=be(null),this.acceptExtensions=`${Ul},.json`,this.scenarios=D(this.scenariosService.scenarios$,{initialValue:[]}),this.metricData=D(this.scenarioDialogStore.metricData$,{requireSync:!0}),this.searchTerm=be(""),this.visibleFileNames=D(this.fileStoreReadWindow.files$.pipe(ke(s=>new Set(pn(s).map(l=>l.fileMeta.fileName)))),{initialValue:new Set}),this.filteredScenarios=Z(()=>{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,p)=>this.helpers.getScenarioPriority(m,d)-this.helpers.getScenarioPriority(p,d))}),this.groupedScenarios=Z(()=>{let s=this.visibleFileNames(),l=this.metricData();return this.helpers.groupScenarios(this.filteredScenarios(),s).map(c=>nt(xe({},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(e){this.close(),this.applyRequested.emit({scenario:e,metricData:this.metricData()})}exportScenario(e){this.importExportService.exportScenario(e)}openImportDialog(){this.fileInput().nativeElement.click()}async handleImportFiles(e){let i=e.target;if(!i.files||i.files.length===0)return;let o=await this.importExportService.importScenarioFiles(i.files);i.value="",this.importFeedbackDialogRef().open(o)}requestDelete(e){this.deleteTarget.set(e),this.deleteConfirmDialogRef().open()}cancelDelete(){this.deleteTarget.set(null)}async confirmDelete(){let e=this.deleteTarget();e&&(this.deleteTarget.set(null),await this.scenariosService.removeScenario(e.id))}static{this.\u0275fac=function(i){return new(i||t)(te(Oi),te(s3),te(l3),te(Te),te(c3))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-scenario-list-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,d8,5)(o.deleteConfirmDialogRef,Yl,5)(o.importFeedbackDialogRef,Zl,5)(o.fileInput,h8,5),i&2&&it(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","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,o){if(i&1&&(v(0,"dialog",2,0)(2,"div",3)(3,"div",4)(4,"h2",5),g(5,"Scenarios"),b(),v(6,"div",6)(7,"button",7),W("click",function(){return o.openImportDialog()}),L(8,"i",8),b(),v(9,"button",9),W("click",function(){return o.close()}),L(10,"i",10),b()()(),v(11,"input",11,1),W("change",function(a){return o.handleImportFiles(a)}),b(),v(13,"input",12),W("ngModelChange",function(a){return o.searchTerm.set(a)}),b(),O(14,u8,2,0,"p",13),v(15,"div",14),Pe(16,g8,10,8,"div",15,m8),b()(),v(18,"form",16)(19,"button",17),W("click",function(){return o.close()}),g(20,"close"),b()()(),v(21,"cc-delete-confirm-dialog",18),W("confirmed",function(){return o.confirmDelete()})("cancelled",function(){return o.cancelDelete()}),b(),L(22,"cc-import-feedback-dialog")),i&2){let r;h(11),F("accept",o.acceptExtensions),h(2),F("ngModel",o.searchTerm()),h(),z(o.filteredScenarios().length===0?14:-1),h(2),Ne(o.groupedScenarios()),h(5),F("scenarioName",((r=o.deleteTarget())==null?null:r.name)??"")}},dependencies:[co,er,Ss,Cs,Kn,Ms,Jn,Yl,Zl,a3],encapsulation:2,changeDetection:0})}}return t})();var b8=["listDialog"],v8=["saveDialog"];function x8(t,n){if(t&1){let e=Me();v(0,"cc-apply-scenario-dialog",16),W("closed",function(){ce(e);let o=A();return de(o.handleApplyClosed())}),b()}if(t&2){let e=n;F("scenario",e.scenario)("metricData",e.metricData)}}var d3=(()=>{class t{constructor(){this.scenariosService=q(Oi),this.listDialog=je.required("listDialog"),this.saveDialog=je.required("saveDialog"),this.applyTarget=be(null),this.scenarios=D(this.scenariosService.scenarios$,{initialValue:[]}),this.scenariosCountLabel=Z(()=>{let e=this.scenarios().length;return`${e} ${e===1?"scenario":"scenarios"} available`})}async ngOnInit(){await this.scenariosService.loadScenarios()}openScenarioList(){this.listDialog().open()}openSaveDialog(){this.saveDialog().open()}handleApplyRequested(e){this.applyTarget.set(e)}handleApplyClosed(){this.applyTarget.set(null)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-labels-scenarios-segment"]],viewQuery:function(i,o){i&1&&tt(o.listDialog,b8,5)(o.saveDialog,v8,5),i&2&&it(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,o){if(i&1&&(v(0,"div",2)(1,"div",3)(2,"div",4)(3,"span",5),g(4,"Labels"),b(),v(5,"button",6),L(6,"i",7),b()()(),L(7,"div",8),v(8,"div",9)(9,"div",4)(10,"span",5),g(11,"Scenarios"),b(),v(12,"button",10),W("click",function(){return o.openSaveDialog()}),L(13,"i",11),b()(),v(14,"button",12),W("click",function(){return o.openScenarioList()}),g(15),b()()(),v(16,"cc-settings-popover-shell",13),L(17,"cc-label-settings-panel"),b(),v(18,"cc-scenario-list-dialog",14,0),W("applyRequested",function(a){return o.handleApplyRequested(a)}),b(),L(20,"cc-save-scenario-dialog",null,1),O(22,x8,1,2,"cc-apply-scenario-dialog",15)),i&2){let r;h(15),ge(" ",o.scenariosCountLabel()," "),h(7),z((r=o.applyTarget())?22:-1,r)}},dependencies:[bd,Eh,_h,Ch,Wt],encapsulation:2,changeDetection:0})}}return t})();var h3=(()=>{class t{constructor(){this.preferencesReadWindow=q(Yn),this.metricsBarWriteStore=q(Ze),this.isLinked=D(this.preferencesReadWindow.isColorMetricLinkedToHeightMetric$,{initialValue:!1}),this.iconClass=Z(()=>this.isLinked()?"fa fa-link":"fa fa-unlink"),this.title=Z(()=>this.isLinked()?"Unlink Height and Color Metric":"Link Height and Color Metric"),this.buttonClass=Z(()=>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||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(y(0,"button",0),Y("click",function(){return o.toggle()}),fe(1,"i"),S()),i&2&&(yt(o.buttonClass()),le("title",o.title()),dt("aria-label",o.title())("data-testid","metric-link-button")("aria-pressed",o.isLinked()),h(),yt(o.iconClass()))},encapsulation:2,changeDetection:0})}}return t})();function w8(t,n){t&1&&L(0,"cc-link-color-height-button")(1,"cc-color-segment")}function y8(t,n){if(t&1&&L(0,"cc-axis-card",0)(1,"cc-color-settings-popover",1),t&2){let e=A();F("metricName","Settings")("hasCog",!0)("cogPopoverId",e.deltaColorSettingsPopoverId)("cogAnchorName",e.deltaColorSettingsAnchorName)("testId","metric-segment-color-settings")("cogTestId","metric-segment-color-settings-cog"),h(),F("popoverId",e.deltaColorSettingsPopoverId)("anchorName",e.deltaColorSettingsAnchorName)}}function S8(t,n){t&1&&L(0,"cc-edge-segment")}var kh=(()=>{class t{constructor(){this.barBottom=cf,this.fileStoreReadWindow=q(Te),this.metricsBarReadStore=q(mt),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.hasEdgeMetric=D(this.metricsBarReadStore.metricData$.pipe(ke(e=>e.edgeMetricData.length>0)),{initialValue:!1}),this.showColorMetricSegment=Z(()=>!this.isDeltaState()),this.deltaColorSettingsPopoverId="metric-settings-popover-color-delta",this.deltaColorSettingsAnchorName="metric-segment-color-settings"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metrics-bar"]],hostVars:2,hostBindings:function(i,o){i&2&&Oe("bottom",o.barBottom)},features:[Qi([df])],decls:6,vars:2,consts:[["label","Color",3,"metricName","hasCog","cogPopoverId","cogAnchorName","testId","cogTestId"],[3,"popoverId","anchorName"]],template:function(i,o){i&1&&(L(0,"cc-area-segment")(1,"cc-height-segment"),O(2,w8,2,0)(3,y8,2,8),O(4,S8,1,0,"cc-edge-segment"),L(5,"cc-labels-scenarios-segment")),i&2&&(h(2),z(o.showColorMetricSegment()?2:3),h(2),z(o.hasEdgeMetric()?4:-1))},dependencies:[h1,lo,jb,zl,Xb,Yb,d3,h3],encapsulation:2,changeDetection:0})}}return t})();var qh=(()=>{class t extends Gf{constructor(){super(...arguments),this.areaMetric=D(q(ve).areaMetric$,{requireSync:!0}),this.pathToNode=q(he).selectSignal(bu)}isEnabledFor(e){let i=this.pathToNode().get(e);return i!==void 0&&Va(i,this.areaMetric())}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=Im(t)))(o||t)}})()}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var C8=(t,n,e)=>{let i=t.length>0?t.filter(l=>Ki(l)):n,o=0,r=0,a=0,s=0;for(let l of i)l.isFlattened&&o++,l.isExcluded&&r++,!l.isFlattened&&!l.isExcluded&&(a++,Va(l,e)||s++);return{shown:a,flattened:o,hidden:r,noArea:s}},m3=Re(yu,Li,bi,C8);var Th=(()=>{class t{constructor(){this.store=q(he),this.counts$=this.store.select(m3)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var Ih=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.sharedViewReadWindow=q(Nt),this.store=q(he),this.idToBuildingService=q(Gn),this.areaMetric=D(this.mapStateReadWindow.areaMetric$,{requireSync:!0}),this.buildingIds=D(this.idToBuildingService.buildingIds$,{requireSync:!0}),this.rootUnary=D(this.store.select(vu),{requireSync:!0}),this.markedPackages=D(this.sharedViewReadWindow.markedPackages$,{requireSync:!0})}project(e){return Xf(e,{areaMetric:this.areaMetric(),buildingIds:this.buildingIds(),rootUnary:this.rootUnary(),showsFlattenedState:!0,hidesExcludedNodes:!0,markedPackages:this.markedPackages()})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var f3=qa(Fx());var p3=t=>/[*?]/.test(t);var g3=(t,n,e)=>{let i=t.filter(s=>s.type===e);if(i.length===0)return[];let o=n.map(s=>rp(s.path)),{rules:r,combinedPositivePrefilter:a}=M8(i);return _8(r,a,o),r.map(({item:s,affectedCount:l})=>({item:s,affectedCount:l,kind:p3(s.path)?"RULE":"MANUAL"})).sort((s,l)=>s.item.path.localeCompare(l.item.path))};function M8(t){let n=(0,f3.default)();return{rules:t.map(i=>{let{ignoredNodePaths:o,condition:r}=ap(i.path);return r&&sp(n,i.path),{item:i,ignoredNodePaths:o,condition:r,affectedCount:0}}),combinedPositivePrefilter:n}}function _8(t,n,e){let i=t.filter(r=>r.condition),o=t.filter(r=>!r.condition);for(let r of e)i.length>0&&n.ignores(r)&&u3(i,r,!0),u3(o,r,!1)}function u3(t,n,e){for(let i of t)i.ignoredNodePaths.ignores(n)===e&&i.affectedCount++}var b3=Re(Ar,Li,(t,n)=>g3(t,n,"flatten")),v3=Re(Ar,Li,(t,n)=>g3(t,n,"exclude"));var x3=(t,n,e)=>{let i=e.trim().split(",");if(e.trim().startsWith("!")){i[0]=i[0].slice(1);for(let o of i){let r=`!${sr(o)}`;if(t.some(a=>r===a.path&&n===a.type))return!0}return!1}for(let o of i)if(t.some(r=>sr(o)===r.path&&n===r.type))return!0;return!1};var Kl=Re(oo,Of);var w3=t=>Re(oo,Kl,Ar,(n,e,i)=>e||x3(i,t,n)),y3=w3("flatten"),S3=w3("exclude");var Dh=(()=>{class t{constructor(){this.store=q(he),this.flattenRules$=this.store.select(b3),this.excludeRules$=this.store.select(v3),this.isFlattenPatternDisabled$=this.store.select(y3),this.isExcludePatternDisabled$=this.store.select(S3)}removeRule(e){Nr(this.store,Fn({item:e}))}ruleFromSearchPattern(e){Nr(this.store,qg(e))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var C3={patternSelector:oo,setPattern:Fi,isPatternEmptySelector:Kl,searchedNodePathsSelector:Su};var Rh=(()=>{class t{constructor(){this.store=q(he),this.sharedViewReadWindow=q(Nt),this.threeSceneService=q(ft),this.idToBuildingService=q(Gn),this.threeRendererService=q(kt),this.codeMapMouseEventService=q(Bo),this.codeMapTooltipService=q(Un),this.selectedBuildingId=D(this.sharedViewReadWindow.selectedBuildingId$,{requireSync:!0}),this.hoveredNodeId=D(this.sharedViewReadWindow.hoveredNodeId$,{requireSync:!0})}isSelected(e){return this.selectedBuildingId()===e.path}isHovered(e){return this.hoveredNodeId()===e.path}select(e){this.store.dispatch(Wc({value:e.path}));let i=this.idToBuildingService.get(e.id);this.codeMapMouseEventService.drawLabelSelectedBuilding(i),this.threeSceneService.selectBuilding(i),this.threeSceneService.clearConstantHighlight(),this.threeRendererService.render()}deselect(){this.store.dispatch(Wc({value:null})),this.threeSceneService.clearSelection(),this.threeSceneService.clearConstantHighlight(),this.threeRendererService.render()}hover(e,i){this.store.dispatch(Do({value:e.path})),this.codeMapMouseEventService.hoverNode(e.path),this.codeMapTooltipService.show(e,i.right,i.top)}hoverEnd(){this.store.dispatch(Do({value:null})),this.codeMapMouseEventService.unhoverNode(),this.codeMapTooltipService.hide()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var M3={options:Object.values(Ba),optionSelector:Tu,ascendingSelector:Iu,setOption:Fu,toggleAscending:()=>Lu()};var _3=(t,n)=>t!==Ba.AREA_SIZE?Re(Et,e=>Qc(Yc(e.unifiedMapNode),t,n)):Re(Et,bi,(e,i)=>Qc(Yc(e.unifiedMapNode),t,n,i));var Ah=(()=>{class t{constructor(){this.store=q(he)}rootNodeFor(e,i){return this.store.select(_3(e,i))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var E8=2e3,E3=(()=>{class t{constructor(){this.actions$=q(ht),this.sharedViewReadWindow=q(Nt),this.revealService=q(Is),this.actions$.pipe(at(ni),Ut(()=>this.sharedViewReadWindow.selectedBuildingId$.pipe(Ie(Boolean),ut(1),Em(Sm(E8)))),Zm()).subscribe(e=>this.revealService.revealNode(e,{expand:!1}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=Da({type:t,selectors:[["","ccRevealsSelectedNodeAfterLoad",""]]})}}return t})();var k3=(()=>{class t{constructor(){this.store=q(he),this.selection=q(Ts),this.revealService=q(Is),Qf("metrics",e=>this.showNode(e))}showNode(e){this.store.select(wu(e)).pipe(ut(1)).subscribe(i=>{i&&(this.selection.select(i),this.revealService.revealNode(e))})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=Da({type:t,selectors:[["","ccShowsHandedOverNode",""]]})}}return t})();var q3=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metrics-view"]],features:[Zi([Ih,{provide:Nf,useExisting:Ih},Rh,{provide:Ts,useExisting:Rh},qh,{provide:Bf,useExisting:qh},Ah,{provide:Pf,useExisting:Ah},Th,{provide:Lf,useExisting:Th},Dh,{provide:Af,useExisting:Dh},$f(M3),zf(C3),{provide:Df,useValue:Rf},{provide:Hf,useValue:jf},Wf("metrics"),ff()]),Qi([E3,k3])],decls:10,vars:0,consts:[["view","metrics"],["collapsedContent","",1,"flex-1","min-w-0"]],template:function(i,o){i&1&&(L(0,"cc-loading-file-progress-spinner",0)(1,"cc-code-map"),v(2,"cc-sidebar-explorer"),L(3,"cc-explorer-search-bar",1),b(),L(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:[Td,kh,Uf,Vf,Ff,Ed,kd,Id,If,uf],encapsulation:2,changeDetection:0})}}return t})();var T8=[{path:Gc.metrics,component:q3},{path:Gc.domain,loadComponent:()=>import("./chunk-LBJ456D5.js").then(t=>t.DomainViewComponent)}],I8={provide:Wm,useClass:Cg},D8=[Ym(T8),I8],Fh={providers:[Hm(Um()),Jm(Mg,{metaReducers:[_g]}),...D8,{provide:Qm,useClass:Zs},ep([...j0,...eg,...X0,...G0,...ig,...ng,...Sg,...kg,...Ig]),{provide:Am,useFactory:t=>()=>t.synchronizeVersion(),deps:[x0],multi:!0}]};var Jl=class{parse(n,e={}){e=Object.assign({binary:!1},e);let i=e.binary,o=[],r=0;n.traverse(function($){if($.isMesh){let ee=$.geometry,B=ee.index,j=ee.getAttribute("position");r+=B!==null?B.count/3:j.count/3,o.push({object3d:$,geometry:ee})}});let a,s=80;if(i===!0){let $=r*2+r*3*4*4+80+4,ee=new ArrayBuffer($);a=new DataView(ee),a.setUint32(s,r,!0),s+=4}else a="",a+=`solid exported
|
|
3439
|
+
`))},encapsulation:2,changeDetection:0})}}return t})();var wr=(t,n,e)=>Math.min(Math.max(t,n),e),Rb=({minValue:t,maxValue:n,currentLeftValue:e,currentRightValue:i,sliderWidth:o})=>{let r=n-t;if(r<=0)return{leftEnd:o,rightStart:o};let a=(e-t)/r,s=(i-t)/r,l=wr(a*o,0,o),d=wr(s*o,l,o);return{leftEnd:l,rightStart:d}},uy=({thumbX:t,minValue:n,maxValue:e,sliderWidth:i})=>{let o=(e-n)/i,r=n+t*o;return Math.round(r)},Ab=t=>Lb(t,{lowerBound:0,upperBound:t.otherThumbX}),Fb=t=>Lb(t,{lowerBound:t.otherThumbX,upperBound:t.sliderWidth}),Lb=({deltaX:t,thumbScreenX:n,thumbRadius:e,sliderBoundingClientRectX:i,sliderWidth:o,minValue:r,maxValue:a},{lowerBound:s,upperBound:l})=>{let d=n+t-i+e,c=wr(d,s,l);return{updatedThumbX:c,upcomingValue:uy({thumbX:c,minValue:r,maxValue:a,sliderWidth:o})}};var fy=["rangeSliderContainer"],gy=["leftThumb"],by=["rightThumb"],Pb=(()=>{class t{get segmentWidths(){let e=wr(this.sliderRangePosition.leftEnd,0,this.actualSliderWidth),i=wr(this.sliderRangePosition.rightStart,e,this.actualSliderWidth);return{left:e,middle:i-e,right:this.actualSliderWidth-i}}constructor(e){this.changeDetectorRef=e,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 o=Ab({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:o.updatedThumbX,rightStart:this.sliderRangePosition.rightStart},this.upcomingLeftValue=o.upcomingValue,this.changeDetectorRef.markForCheck(),this.handleValueChange({newLeftValue:o.upcomingValue})},this.handleRightThumbMoved=i=>{if(this.abortSlidingWhenHidden())return;let o=Fb({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:o.updatedThumbX},this.upcomingRightValue=o.upcomingValue,this.changeDetectorRef.markForCheck(),this.handleValueChange({newRightValue:o.upcomingValue})}}ngOnChanges(e){e.sliderWidth&&(this.actualSliderWidth=this.sliderWidth),this.currentlySliding||(e.currentLeftValue&&(this.upcomingLeftValue=this.currentLeftValue),e.currentRightValue&&(this.upcomingRightValue=this.currentRightValue),this.updateSliderRangePosition())}ngAfterViewInit(){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(e=>{let i=e.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(e){switch(this.stopSliding(),this.currentlySliding=e,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(e){let i=this.calculateValueFromKeyboard(e,this.upcomingLeftValue,this.minValue,this.upcomingRightValue);i===void 0||i===this.upcomingLeftValue||(e.preventDefault(),this.upcomingLeftValue=i,this.updateSliderRangePosition(),this.handleValueChange({newLeftValue:i}))}handleRightThumbKeydown(e){let i=this.calculateValueFromKeyboard(e,this.upcomingRightValue,this.upcomingLeftValue,this.maxValue);i===void 0||i===this.upcomingRightValue||(e.preventDefault(),this.upcomingRightValue=i,this.updateSliderRangePosition(),this.handleValueChange({newRightValue:i}))}calculateValueFromKeyboard(e,i,o,r){let a;switch(e.key){case"ArrowLeft":case"ArrowDown":a=i-1;break;case"ArrowRight":case"ArrowUp":a=i+1;break;case"Home":a=o;break;case"End":a=r;break;default:return}return Math.max(o,Math.min(r,a))}handleCurrentLeftInputChanged(e){let i=Xc(e,this.minValue,this.upcomingRightValue,this.upcomingLeftValue);i!==void 0&&(this.upcomingLeftValue=i,this.updateSliderRangePosition(),this.handleValueChange({newLeftValue:i}))}handleCurrentRightInputChanged(e){let i=Xc(e,this.upcomingLeftValue,this.maxValue,this.upcomingRightValue);i!==void 0&&(this.upcomingRightValue=i,this.updateSliderRangePosition(),this.handleValueChange({newRightValue:i}))}updateSliderRangePosition(){this.sliderRangePosition=Rb({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||t)(te(dn))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metric-color-range-slider"]],viewQuery:function(i,o){if(i&1&&Ra(fy,5)(gy,5)(by,5),i&2){let r;pi(r=ui())&&(o.sliderContainer=r.first),pi(r=ui())&&(o.leftThumb=r.first),pi(r=ui())&&(o.rightThumb=r.first)}},inputs:{minValue:"minValue",maxValue:"maxValue",currentLeftValue:"currentLeftValue",currentRightValue:"currentRightValue",leftColor:"leftColor",middleColor:"middleColor",rightColor:"rightColor",handleValueChange:"handleValueChange",sliderWidth:"sliderWidth"},features:[Ia],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,o){i&1&&(v(0,"div",3)(1,"input",4),W("input",function(a){return o.handleCurrentLeftInputChanged(a)}),b(),v(2,"div",5,0),L(4,"span",6)(5,"span",6)(6,"span",6),v(7,"div",7,1),W("mousedown",function(){return o.setCurrentlySliding("leftThumb")}),b(),v(9,"div",7,2),W("mousedown",function(){return o.setCurrentlySliding("rightThumb")}),b(),v(11,"input",8),W("keydown",function(a){return o.handleLeftThumbKeydown(a)}),b(),v(12,"input",9),W("keydown",function(a){return o.handleRightThumbKeydown(a)}),b(),L(13,"cc-range-slider-labels",10),b(),v(14,"input",11),W("input",function(a){return o.handleCurrentRightInputChanged(a)}),b()()),i&2&&(h(),F("value",o.currentLeftValue)("min",o.minValue)("max",o.upcomingRightValue),h(3),Oe("width",o.segmentWidths.left,"px")("border-bottom-color",o.leftColor),h(),Oe("width",o.segmentWidths.middle,"px")("border-bottom-color",o.middleColor),h(),Oe("width",o.segmentWidths.right,"px")("border-bottom-color",o.rightColor),h(),Oe("left",o.sliderRangePosition.leftEnd-o.thumbRadius,"px"),h(2),Oe("left",o.sliderRangePosition.rightStart-o.thumbRadius,"px"),h(2),F("min",o.minValue)("max",o.currentRightValue)("value",o.currentLeftValue),h(),F("min",o.currentLeftValue)("max",o.maxValue)("value",o.currentRightValue),h(),F("minValue",o.minValue)("maxValue",o.maxValue)("leftValueLabel",o.upcomingLeftValue)("rightValueLabel",o.upcomingRightValue)("sliderRangePosition",o.sliderRangePosition)("sliderWidth",o.actualSliderWidth),h(),F("value",o.currentRightValue)("min",o.upcomingLeftValue)("max",o.maxValue))},dependencies:[Db],encapsulation:2,changeDetection:0})}}return t})();var Nb=(()=>{class t{constructor(e,i,o,r){this.mapStateReadWindow=e,this.metricsBarReadStore=i,this.metricsBarWriteStore=o,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(It([this.mapStateReadWindow.colorMetric$,this.metricsLensFacade.descriptors$]).pipe(ke(([a,s])=>s[a]?.direction===1)),{initialValue:!1}),this.pendingLeftValue=null,this.pendingRightValue=null,this.commitColorRange=Pi(()=>{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)},xf),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||t)(te(ve),te(mt),te(Ze),te(zn))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(L(0,"cc-metric-color-range-slider",0),v(1,"div",1)(2,"span",2),g(3,"Distribution"),b(),v(4,"span",3),g(5),b()(),L(6,"cc-metric-color-range-diagram",4)),i&2&&(F("minValue",o.sliderValues().min)("maxValue",o.sliderValues().max)("currentLeftValue",o.sliderValues().from)("currentRightValue",o.sliderValues().to)("leftColor",o.sliderColors().leftColor)("middleColor",o.sliderColors().middleColor)("rightColor",o.sliderColors().rightColor)("handleValueChange",o.handleValueChange)("sliderWidth",220),h(5),ge("",o.colorMetric()," \xD7 quantile %"),h(),F("minValue",o.sliderValues().min)("maxValue",o.sliderValues().max)("currentLeftValue",o.sliderValues().from)("currentRightValue",o.sliderValues().to)("leftColor",o.sliderColors().leftColor)("middleColor",o.sliderColors().middleColor)("rightColor",o.sliderColors().rightColor)("colorMetric",o.colorMetric())("values",o.sliderValues().values)("isAttributeDirectionInverted",o.isAttributeDirectionInversed())("diagramWidth",380)("diagramHeight",190)("showAxisLabels",!1))},dependencies:[Pb,Ib],encapsulation:2,changeDetection:0})}}return t})();function vy(t,n){if(t&1){let e=Me();S(0,"button",6),Y("click",function(){ce(e);let o=A();return de(o.resetThresholds())}),fe(1,"i",7),y()}}var Bb=(()=>{class t{constructor(e,i,o,r){this.mapStateReadWindow=e,this.fileStoreReadWindow=i,this.metricsBarReadStore=o,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:Lt}),this.selectedColorMetricData=D(this.metricsBarReadStore.selectedColorMetricData$,{initialValue:{values:[],minValue:0,maxValue:0}}),this.canResetThresholds=Z(()=>!this.isDeltaState()&&this.colorMetric()!=="unary"),this.swatchGradient=Z(()=>{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(lr(this.selectedColorMetricData()))}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(Te),te(mt),te(Ze))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(S(0,"div",0)(1,"div",1),fe(2,"span",2),S(3,"span",3),g(4,"Color by "),S(5,"span",4),g(6),y()()(),O(7,vy,2,0,"button",5),y()),i&2&&(h(2),Oe("background",o.swatchGradient()),h(4),qe(o.colorMetric()),h(),z(o.canResetThresholds()?7:-1))},encapsulation:2,changeDetection:0})}}return t})();var Vb=(()=>{class t{constructor(){this.override=H.required(),this.recolorOverride=Ce(),this.unpinOverride=Ce()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"div",0)(1,"cc-inline-color-picker",1),W("colorChange",function(a){return o.recolorOverride.emit(a)}),b(),v(2,"span",2),g(3),b(),v(4,"span",3),g(5),b(),v(6,"button",4),W("click",function(){return o.unpinOverride.emit()}),L(7,"i",5),b()()),i&2&&(F("title",o.override().path),h(),F("hexColor",o.override().color)("ariaLabel","Recolor "+o.override().path),h(2),qe(o.override().path),h(),F("title",o.override().fileCount+" files"),h(),qe(o.override().fileCount),h(),F("title","Unpin "+o.override().path))},dependencies:[ho],encapsulation:2,changeDetection:0})}}return t})();var xy=["pinInput"];function wy(t,n){if(t&1){let e=Me();S(0,"button",2),Y("click",function(){ce(e);let o=A();return de(o.startPinning())}),fe(1,"i",3),S(2,"span"),g(3,"Pin a folder color\u2026"),y()()}}function Sy(t,n){if(t&1){let e=Me();S(0,"li",8)(1,"button",10),Y("mousedown",function(o){return o.preventDefault()})("click",function(){let o=ce(e).$implicit,r=A(2);return de(r.handlePin(o))}),S(2,"span",11),g(3),y()()()}if(t&2){let e=n.$implicit;h(),le("title",e),h(2),qe(e)}}function yy(t,n){t&1&&(S(0,"li",9),g(1,"No folders found"),y())}function Cy(t,n){if(t&1){let e=Me();S(0,"div",4),fe(1,"i",5),S(2,"input",6,0),Y("input",function(o){ce(e);let r=A();return de(r.handleSearchTermChange(o.target.value))})("keydown.escape",function(o){ce(e);let r=A();return de(r.handleSearchEscape(o))})("blur",function(){ce(e);let o=A();return de(o.handleSearchBlur())}),y()(),S(4,"ul",7),Pe(5,Sy,4,2,"li",8,Gt,!1,yy,2,0,"li",9),y()}if(t&2){let e=A();h(2),le("value",e.searchTerm()),h(3),Ne(e.folderSuggestions())}}var My=8,Wb=(()=>{class t{constructor(e){this.metricsBarReadStore=e,this.pinFolder=Ce(),this.folderPaths=D(this.metricsBarReadStore.markableFolderPaths$,{initialValue:[]}),this.overrides=D(this.metricsBarReadStore.markedPackagesWithCounts$,{initialValue:[]}),this.isPinning=be(!1),this.searchTerm=be(""),this.pinInput=je("pinInput"),this.folderSuggestions=Z(()=>{let i=this.searchTerm().toLowerCase(),o=new Set(this.overrides().map(a=>a.path)),r=[];for(let a of this.folderPaths())if(!(o.has(a)||!a.toLowerCase().includes(i))&&(r.push(a),r.length>=My))break;return r})}startPinning(){this.isPinning.set(!0),setTimeout(()=>this.pinInput()?.nativeElement.focus())}stopPinning(){this.isPinning.set(!1),this.searchTerm.set("")}handleSearchTermChange(e){this.searchTerm.set(e)}handleSearchBlur(){this.searchTerm().trim()===""&&this.stopPinning()}handleSearchEscape(e){e.preventDefault(),this.stopPinning()}handlePin(e){this.pinFolder.emit(e),this.stopPinning()}static{this.\u0275fac=function(i){return new(i||t)(te(mt))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-pin-folder-search"]],viewQuery:function(i,o){i&1&&tt(o.pinInput,xy,5),i&2&&it()},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,o){i&1&&O(0,wy,4,0,"button",1)(1,Cy,8,2),i&2&&z(o.isPinning()?1:0)},encapsulation:2,changeDetection:0})}}return t})();var _y=(t,n)=>n.path;function Ey(t,n){if(t&1&&(v(0,"span",2),g(1),b()),t&2){let e=A();h(),ge("",e.overrides().length," pinned")}}function ky(t,n){if(t&1){let e=Me();v(0,"cc-folder-override-row",7),W("recolorOverride",function(o){let r=ce(e).$implicit,a=A(2);return de(a.handleRecolor(r.path,o))})("unpinOverride",function(){let o=ce(e).$implicit,r=A(2);return de(r.handleUnpin(o.path))}),b()}if(t&2){let e=n.$implicit;F("override",e)}}function qy(t,n){if(t&1&&(v(0,"div",4),Pe(1,ky,1,1,"cc-folder-override-row",6,_y),b()),t&2){let e=A();h(),Ne(e.overrides())}}var Ob=(()=>{class t{constructor(e,i,o){this.mapStateReadWindow=e,this.metricsBarReadStore=i,this.metricsBarWriteStore=o,this.overrides=D(this.metricsBarReadStore.markedPackagesWithCounts$,{initialValue:[]}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Lt})}handlePin(e){this.metricsBarWriteStore.markPackage({path:e,color:this.nextMarkingColor(e)})}handleRecolor(e,i){this.metricsBarWriteStore.markPackage({path:e,color:i})}handleUnpin(e){this.metricsBarWriteStore.unmarkPackage(e)}nextMarkingColor(e){let i=this.mapColors().markingColors,o=this.findMarkedParentColor(e),r=i.filter(s=>s!==o);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(e){let i,o=0;for(let r of this.overrides())e.startsWith(`${r.path}/`)&&r.path.length>o&&(i=r.color,o=r.path.length);return i}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(mt),te(Ze))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"div",0)(1,"span",1),g(2,"Folder Overrides"),b(),O(3,Ey,2,1,"span",2),b(),v(4,"p",3),g(5,"These folders\u2019 floors are tinted with the pinned color."),b(),O(6,qy,3,0,"div",4),v(7,"cc-pin-folder-search",5),W("pinFolder",function(a){return o.handlePin(a)}),b()),i&2&&(h(3),z(o.overrides().length>0?3:-1),h(3),z(o.overrides().length>0?6:-1))},dependencies:[Vb,Wb],encapsulation:2,changeDetection:0})}}return t})();var zb=(()=>{class t{constructor(e,i){this.mapStateReadWindow=e,this.metricsBarWriteStore=i,this.groupName=H.required(),this.colorMode=D(this.mapStateReadWindow.colorMode$,{initialValue:"absolute"})}handleColorModeChange(e){this.metricsBarWriteStore.setColorMode(e)}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(Ze))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(S(0,"div",0)(1,"span",1),g(2,"Gradient Mode"),y(),S(3,"div",2)(4,"input",3),Y("change",function(){return o.handleColorModeChange("absolute")}),y(),S(5,"input",4),Y("change",function(){return o.handleColorModeChange("focusedGradient")}),y(),S(6,"input",5),Y("change",function(){return o.handleColorModeChange("weightedGradient")}),y(),S(7,"input",6),Y("change",function(){return o.handleColorModeChange("trueGradient")}),y()()()),i&2&&(h(4),le("name",o.groupName())("checked",o.colorMode()==="absolute"),h(),le("name",o.groupName())("checked",o.colorMode()==="focusedGradient"),h(),le("name",o.groupName())("checked",o.colorMode()==="weightedGradient"),h(),le("name",o.groupName())("checked",o.colorMode()==="trueGradient"))},encapsulation:2,changeDetection:0})}}return t})();function Ty(t,n){if(t&1){let e=Me();v(0,"label",1)(1,"input",3),W("change",function(){ce(e);let o=A();return de(o.handleIsColorRangeInvertedChange())}),b(),v(2,"span",4),g(3,"Invert colors"),b()()}if(t&2){let e=A();h(),F("checked",e.isColorRangeInverted())}}function Iy(t,n){if(t&1){let e=Me();v(0,"label",1)(1,"input",3),W("change",function(){ce(e);let o=A();return de(o.handleAreDeltaColorsInvertedChange())}),b(),v(2,"span",4),g(3,"Invert colors"),b()()}if(t&2){let e=A();h(),F("checked",e.areDeltaColorsInverted())}}var $b=(()=>{class t{constructor(e,i,o){this.fileStoreReadWindow=e,this.mapStateReadWindow=i,this.metricsBarWriteStore=o,this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.mapColors=D(this.mapStateReadWindow.mapColors$,{initialValue:Lt}),this.isColorRangeInverted=Z(()=>this.mapColors().isColorRangeInverted??!1),this.areDeltaColorsInverted=Z(()=>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||t)(te(Te),te(ve),te(Ze))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"div",0),O(1,Ty,4,1,"label",1)(2,Iy,4,1,"label",1),L(3,"cc-reset-settings-button",2),b()),i&2&&(h(),z(o.isDeltaState()?2:1),h(2),F("settingsKeys",o.resetColorsKeys())("tooltip",o.isDeltaState()?"Reset color values to default":"Reset color values and gradient mode to default")("small",!0))},dependencies:[mo],encapsulation:2,changeDetection:0})}}return t})();function Dy(t,n){if(t&1&&L(0,"cc-color-range-section")(1,"cc-gradient-mode-picker",1),t&2){let e=A();h(),F("groupName",e.popoverId()+"-gradient-mode")}}var zl=(()=>{class t{constructor(e,i){this.mapStateReadWindow=e,this.fileStoreReadWindow=i,this.popoverId=H.required(),this.anchorName=H.required(),this.colorMetric=D(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.hasRangeSection=Z(()=>!this.isDeltaState()&&this.colorMetric()!=="unary")}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(Te))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"cc-settings-popover-shell",0),L(1,"cc-color-settings-header"),O(2,Dy,2,1),L(3,"cc-color-bands-section")(4,"cc-invert-reset-row")(5,"cc-folder-overrides"),b()),i&2&&(F("popoverId",o.popoverId())("anchorName",o.anchorName())("widthClass","max-w-[95vw] "+(o.hasRangeSection()?"w-[420px]":"w-80")),h(2),z(o.hasRangeSection()?2:-1))},dependencies:[Wt,Bb,Nb,zb,p1,$b,Ob],encapsulation:2,changeDetection:0})}}return t})();var jb=(()=>{class t{constructor(e,i,o){this.mapStateReadWindow=e,this.preferencesReadWindow=i,this.metricsBarWriteStore=o,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(e){this.metricsBarWriteStore.setColorMetric(e)}static{this.\u0275fac=function(i){return new(i||t)(te(ve),te(Yn),te(Ze))}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"cc-axis-card",0)(1,"div",1),L(2,"cc-metric-meta-value",2),b()(),v(3,"cc-metric-select-popover",3),W("metricSelected",function(a){return o.handleMetricSelected(a)}),b(),L(4,"cc-color-settings-popover",4)),i&2&&(F("metricName",o.colorMetric())("hasCog",!0)("cogPopoverId",o.settingsPopoverId)("cogAnchorName",o.settingsAnchorName)("searchPopoverId",o.searchPopoverId)("searchAnchorName",o.searchAnchorName)("disabled",o.isLinked())("testId","metric-segment-color")("cogTestId","metric-segment-color-cog"),h(3),F("popoverId",o.searchPopoverId)("anchorName",o.searchAnchorName)("selected",o.colorMetric()),h(),F("popoverId",o.settingsPopoverId)("anchorName",o.settingsAnchorName))},dependencies:[lo,pr,sl,zl],encapsulation:2,changeDetection:0})}}return t})();var Hb=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.metricsBarWriteStore=q(Ze),this.isEdgeMetricVisible=D(this.mapStateReadWindow.isEdgeMetricVisible$,{initialValue:!0})}toggle(){this.metricsBarWriteStore.toggleEdgeMetricVisible()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(S(0,"label",0)(1,"input",1),Y("change",function(){return o.toggle()}),y(),S(2,"span"),g(3,"Disable edge metric"),y()()),i&2&&(h(),le("checked",!o.isEdgeMetricVisible()))},encapsulation:2,changeDetection:0})}}return t})();var Ub=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.metricsBarReadStore=q(mt),this.metricsBarWriteStore=q(Ze),this.popoverId=H.required(),this.anchorName=H.required(),this.amountOfBuildingsWithSelectedEdgeMetric=D(this.metricsBarReadStore.amountOfBuildingsWithSelectedEdgeMetric$,{initialValue:0}),this.edgePreviewLabel=D(this.metricsBarReadStore.amountOfBuildingsWithSelectedEdgeMetric$.pipe(ke(e=>`Preview the edges of up to ${e} 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:Lt}),this.outgoingEdgeColor=Z(()=>this.mapColors().outgoingEdge),this.incomingEdgeColor=Z(()=>this.mapColors().incomingEdge),this.resetKeys=["mapState.amountOfEdgePreviews","mapState.edgeHeight","mapState.mapColors.outgoingEdge","mapState.showOutgoingEdges","mapState.mapColors.incomingEdge","mapState.showIncomingEdges","mapState.showOnlyBuildingsWithEdges","mapState.isEdgeMetricVisible"]}setAmountOfEdgePreviews(e){this.metricsBarWriteStore.setAmountOfEdgePreviews(e)}setEdgeHeight(e){this.metricsBarWriteStore.setEdgeHeight(e)}setShowOutgoingEdges(e){let i=e.target.checked;this.metricsBarWriteStore.setShowOutgoingEdges(i)}setShowIncomingEdges(e){let i=e.target.checked;this.metricsBarWriteStore.setShowIncomingEdges(i)}setShowOnlyBuildingsWithEdges(e){let i=e.target.checked;this.metricsBarWriteStore.setShowOnlyBuildingsWithEdges(i)}setMapColor(e,i){this.metricsBarWriteStore.setMapColors({[e]:i})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"cc-settings-popover-shell",0)(1,"div",1)(2,"span",2),g(3,"Preview"),b(),v(4,"cc-slider-number-input",3),W("valueChange",function(a){return o.setAmountOfEdgePreviews(a)}),b()(),v(5,"div",4)(6,"span",2),g(7,"Height"),b(),v(8,"cc-slider-number-input",5),W("valueChange",function(a){return o.setEdgeHeight(a)}),b()(),v(9,"div",6)(10,"div",7)(11,"cc-inline-color-picker",8),W("colorChange",function(a){return o.setMapColor("outgoingEdge",a)}),b(),v(12,"span",9),g(13,"Outgoing Edge"),b(),v(14,"label",10)(15,"input",11),W("change",function(a){return o.setShowOutgoingEdges(a)}),b(),v(16,"span"),g(17,"Show"),b()()(),v(18,"div",7)(19,"cc-inline-color-picker",12),W("colorChange",function(a){return o.setMapColor("incomingEdge",a)}),b(),v(20,"span",9),g(21,"Incoming Edge"),b(),v(22,"label",10)(23,"input",11),W("change",function(a){return o.setShowIncomingEdges(a)}),b(),v(24,"span"),g(25,"Show"),b()()()(),v(26,"label",10)(27,"input",13),W("change",function(a){return o.setShowOnlyBuildingsWithEdges(a)}),b(),v(28,"span"),g(29,"Only show nodes with edges"),b()(),L(30,"cc-edge-metric-toggle")(31,"cc-reset-settings-button",14),b()),i&2&&(F("popoverId",o.popoverId())("anchorName",o.anchorName()),h(),F("title",o.edgePreviewLabel()),h(3),F("min",0)("max",o.amountOfBuildingsWithSelectedEdgeMetric())("value",o.amountOfEdgePreviews())("disabled",o.amountOfBuildingsWithSelectedEdgeMetric()===0),h(4),F("min",1)("max",9)("value",o.edgeHeight())("disabled",o.amountOfBuildingsWithSelectedEdgeMetric()===0),h(3),F("hexColor",o.outgoingEdgeColor()),h(4),F("checked",o.showOutgoingEdges()),h(4),F("hexColor",o.incomingEdgeColor()),h(4),F("checked",o.showIncomingEdges()),h(4),F("checked",o.showOnlyBuildingsWithEdges())("disabled",o.amountOfBuildingsWithSelectedEdgeMetric()===0),h(4),F("settingsKeys",o.resetKeys))},dependencies:[ho,mo,Hb,Wt,ir],encapsulation:2,changeDetection:0})}}return t})();function Ry(t,n){t&1&&(L(0,"cc-metric-chooser-type",5),v(1,"span"),g(2),b()),t&2&&(F("metricFor","edgeMetric"),h(2),qe(n))}function Ay(t,n){t&1&&(v(0,"span",2),g(1,"\xA0"),b())}var Xb=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.metricsBarWriteStore=q(Ze),this.nodeSelectionService=q(mr),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=Z(()=>{let e=this.hoveredNode(),i=this.edgeMetric();if(!e||!i)return null;let o=e.edgeAttributes?.[i];return o?`${Gb(o.incoming)} / ${Gb(o.outgoing)}`:null})}handleMetricSelected(e){this.metricsBarWriteStore.setEdgeMetric(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){if(i&1&&(v(0,"cc-axis-card",0)(1,"div",1),O(2,Ry,3,2)(3,Ay,2,0,"span",2),b()(),v(4,"cc-metric-select-popover",3),W("metricSelected",function(a){return o.handleMetricSelected(a)}),b(),L(5,"cc-edge-settings-popover",4)),i&2){let r;F("metricName",o.edgeMetric())("hasCog",!0)("cogPopoverId",o.settingsPopoverId)("cogAnchorName",o.settingsAnchorName)("searchPopoverId",o.searchPopoverId)("searchAnchorName",o.searchAnchorName)("dimmed",!o.isEdgeMetricVisible())("testId","metric-segment-edges")("cogTestId","metric-segment-edges-cog"),h(2),z((r=o.hoveredEdgeValue())?2:3,r),h(2),F("popoverId",o.searchPopoverId)("anchorName",o.searchAnchorName)("selected",o.edgeMetric()),h(),F("popoverId",o.settingsPopoverId)("anchorName",o.settingsAnchorName)}},dependencies:[lo,al,pr,Ub],encapsulation:2,changeDetection:0})}}return t})();function Gb(t){return typeof t=="number"?t.toLocaleString():"-"}function Fy(t,n){if(t&1){let e=Me();v(0,"label",4)(1,"input",6),W("change",function(o){ce(e);let r=A();return de(r.toggleInvertHeight(o))}),b(),v(2,"span"),g(3,"Invert Height"),b()()}if(t&2){let e=A();h(),F("checked",e.invertHeight())}}var Qb=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.fileStoreReadWindow=q(Te),this.metricsBarWriteStore=q(Ze),this.popoverId=H.required(),this.anchorName=H.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(e){this.metricsBarWriteStore.setScaling({y:e})}toggleInvertHeight(e){let i=e.target.checked;this.metricsBarWriteStore.setInvertHeight(i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"cc-settings-popover-shell",0)(1,"div",1)(2,"span",2),g(3,"Height"),b(),v(4,"cc-slider-number-input",3),W("valueChange",function(a){return o.setScalingY(a)}),b()(),O(5,Fy,4,1,"label",4),L(6,"cc-reset-settings-button",5),b()),i&2&&(F("popoverId",o.popoverId())("anchorName",o.anchorName()),h(4),F("min",1)("max",25)("value",o.scalingY().y),h(),z(o.isDeltaState()?-1:5),h(),F("settingsKeys",o.resetKeys))},dependencies:[mo,Wt,ir],encapsulation:2,changeDetection:0})}}return t})();var Yb=(()=>{class t{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=q(ve),this.metricsBarWriteStore=q(Ze),this.heightMetric=D(this.mapStateReadWindow.heightMetric$,{initialValue:""})}handleMetricSelected(e){this.metricsBarWriteStore.setHeightMetric(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"cc-metric-segment",0),W("metricSelected",function(a){return o.handleMetricSelected(a)}),L(1,"cc-height-settings-popover",1),b()),i&2&&(F("metricName",o.heightMetric())("searchPopoverId",o.searchPopoverId)("searchAnchorName",o.searchAnchorName)("settingsPopoverId",o.settingsPopoverId)("settingsAnchorName",o.settingsAnchorName),h(),F("popoverId",o.settingsPopoverId)("anchorName",o.settingsAnchorName))},dependencies:[ll,Qb],encapsulation:2,changeDetection:0})}}return t})();function $l(t){return["metrics","colors","camera","filters","labelsAndFolders"].filter(e=>t.sections[e]!==void 0)}var jl={metrics:"Metrics",colors:"Colors",camera:"Camera",filters:"Filters",labelsAndFolders:"Labels & Folders"},Hl={metrics:"fa-bar-chart",colors:"fa-paint-brush",camera:"fa-video-camera",filters:"fa-filter",labelsAndFolders:"fa-tags"},Ul=".ccscenario";function Zb(t){return nt(xe(xe({schemaVersion:1,name:t.name},t.description?{description:t.description}:{}),t.mapFileNames?.length>0?{mapFileNames:t.mapFileNames}:{}),{sections:t.sections})}function Kb(t){return{id:crypto.randomUUID(),name:t.name,description:t.description,mapFileNames:t.mapFileNames,createdAt:Date.now(),sections:t.sections}}var Gl=(()=>{class t{constructor(e,i){this.store=e,this.ccStateSnapshot=i}getValue(){return this.ccStateSnapshot.get()}setStatePatch(e){this.store.dispatch(Ei({value:e}))}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(Bt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ly=["areaMetric","heightMetric","colorMetric","distributionMetric"],Xl=(()=>{class t{constructor(e,i,o,r){this.scenariosStore=e,this.threeCameraService=i,this.threeMapControlsService=o,this.threeRendererService=r}getAvailableMetricNames(e){return{nodeMetrics:new Set(e.nodeMetricData.map(i=>i.name)),edgeMetrics:new Set(e.edgeMetricData.map(i=>i.name))}}getMissingMetrics(e,i){let o=this.getAvailableMetricNames(i),r=[e.areaMetric,e.heightMetric,e.colorMetric,e.distributionMetric].filter(l=>!!l),a=[...new Set(r.filter(l=>!o.nodeMetrics.has(l)))],s=e.edgeMetric&&!o.edgeMetrics.has(e.edgeMetric)?[e.edgeMetric]:[];return{nodeMetrics:a,edgeMetrics:s}}hasMissingMetrics(e){return e.nodeMetrics.length>0||e.edgeMetrics.length>0}buildOrderedStatePatches(e,i,o){return[i.has("metrics")&&e.metrics?this.buildMetricsPatch(e,o):void 0,i.has("colors")&&e.colors?this.buildColorsPatch(e.colors):void 0,this.buildFiltersAndLabelsPatch(e,i)].filter(r=>r!==void 0)}getCameraVectors(e){if(!e.camera)return;let{position:i,target:o}=e.camera;return{position:new Ye(i.x,i.y,i.z),target:new Ye(o.x,o.y,o.z)}}async applyScenario(e,i,o){Uc(!0);try{let r=i.has("camera")?this.getCameraVectors(e.sections):void 0,a=r!==void 0,s=this.buildOrderedStatePatches(e.sections,i,o),l=a&&s.length>0?this.scenariosStore.getValue().preferences.resetCameraIfNewFileIsLoaded:void 0;l&&s.length>0&&(s[0].preferences=nt(xe({},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{Uc(!1)}}buildMetricsPatch(e,i){if(!e.metrics)return{};let o=i?this.getAvailableMetricNames(i):void 0,r={};for(let d of Ly){let c=e.metrics[d];c!==void 0&&(!o||o.nodeMetrics.has(c))&&(r[d]=c)}let a=e.metrics.edgeMetric;a!==void 0&&(!o||!a||o.edgeMetrics.has(a))&&(r.edgeMetric=a);let s=Object.keys(r).length>0;if(!s&&e.metrics.isColorMetricLinkedToHeightMetric===void 0)return{};let l={};return s&&(l.mapState=xe({},r),e.metrics.isColorMetricLinkedToHeightMetric!==void 0&&(l.preferences={isColorMetricLinkedToHeightMetric:e.metrics.isColorMetricLinkedToHeightMetric})),l}buildColorsPatch(e){let i={colorRange:e.colorRange};return e.colorMode!==void 0&&(i.colorMode=e.colorMode),e.mapColors!==void 0&&(i.mapColors=e.mapColors),{mapState:i}}buildFiltersPatch(e){return{sharedView:{blacklist:[...e.blacklist],focusedNodePath:[...e.focusedNodePath]}}}buildLabelsAndFoldersPatch(e){return{mapState:{amountOfTopLabels:e.amountOfTopLabels,labelSize:e.labelSize,showMetricLabelNameValue:e.showMetricLabelNameValue,showMetricLabelNodeName:e.showMetricLabelNodeName,enableFloorLabels:e.enableFloorLabels,colorLabels:e.colorLabels,labelMode:e.labelMode,groupLabelCollisions:e.groupLabelCollisions},sharedView:{markedPackages:[...e.markedPackages]}}}mergePatches(e,i){return xe(xe(xe(xe(xe({},e),i),e.preferences||i.preferences?{preferences:xe(xe({},e.preferences),i.preferences)}:{}),e.mapState||i.mapState?{mapState:xe(xe({},e.mapState),i.mapState)}:{}),e.sharedView||i.sharedView?{sharedView:xe(xe({},e.sharedView),i.sharedView)}:{})}buildFiltersAndLabelsPatch(e,i){let o=i.has("filters")&&e.filters?this.buildFiltersPatch(e.filters):void 0,r=i.has("labelsAndFolders")&&e.labelsAndFolders?this.buildLabelsAndFoldersPatch(e.labelsAndFolders):void 0;return o&&r?this.mergePatches(o,r):o??r}static{this.\u0275fac=function(i){return new(i||t)(M(Gl),M(Qn),M(Vt),M(kt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Py=["dialog"];function Ny(t,n){if(t&1&&(v(0,"div",4)(1,"span",12),L(2,"i",13),v(3,"span",14),g(4),b()()()),t&2){let e=A();h(),F("title",e.scenario().mapFileNames.join(", ")),h(3),qe(e.scenario().mapFileNames.join(", "))}}function By(t,n){if(t&1){let e=Me();v(0,"label",6)(1,"input",15),W("change",function(o){let r=ce(e).$implicit,a=A();return de(a.toggleSection(r,o.target.checked))}),b(),L(2,"i"),v(3,"span"),g(4),b()()}if(t&2){let e=n.$implicit,i=A();h(),F("checked",i.selectedSections()[e]),h(),St(cn("fa ",i.sectionIcons[e]," w-4 text-center")),h(2),qe(i.sectionLabels[e])}}function Vy(t,n){if(t&1&&(v(0,"li"),g(1),b()),t&2){let e=n.$implicit;h(),ge("",e," (node metric)")}}function Wy(t,n){if(t&1&&(v(0,"li"),g(1),b()),t&2){let e=n.$implicit;h(),ge("",e," (edge metric)")}}function Oy(t,n){if(t&1&&(v(0,"div",7),L(1,"i",16),v(2,"div")(3,"strong"),g(4,"Some metrics are not available in the current map and will not be applied:"),b(),v(5,"ul",17),Pe(6,Vy,2,1,"li",null,Gt),Pe(8,Wy,2,1,"li",null,Gt),b()()()),t&2){let e=A();h(6),Ne(e.missingMetrics().nodeMetrics),h(2),Ne(e.missingMetrics().edgeMetrics)}}var Ch=(()=>{class t{constructor(e){this.scenarioApplier=e,this.scenario=H.required(),this.metricData=H.required(),this.closed=Ce(),this.dialogElement=je.required("dialog"),this.sectionLabels=jl,this.sectionIcons=Hl,this.availableSectionKeys=Z(()=>$l(this.scenario())),this.selectedSections=be({metrics:!0,colors:!0,camera:!0,filters:!0,labelsAndFolders:!0}),this.missingMetrics=Z(()=>{let i=this.scenario().sections.metrics;return i?this.scenarioApplier.getMissingMetrics(i,this.metricData()):{nodeMetrics:[],edgeMetrics:[]}}),this.hasMissing=Z(()=>this.scenarioApplier.hasMissingMetrics(this.missingMetrics())),this.hasAnySelected=Z(()=>this.availableSectionKeys().some(i=>this.selectedSections()[i])),this.destroyRef=q(sn)}ngAfterViewInit(){let e=this.dialogElement().nativeElement,i=()=>this.closed.emit();e.addEventListener("close",i),this.destroyRef.onDestroy(()=>e.removeEventListener("close",i)),e.showModal()}toggleSection(e,i){this.selectedSections.update(o=>nt(xe({},o),{[e]:i}))}async apply(){let e=new Set(this.availableSectionKeys().filter(i=>this.selectedSections()[i]));this.dialogElement().nativeElement.close(),await this.scenarioApplier.applyScenario(this.scenario(),e,this.metricData())}close(){this.dialogElement().nativeElement.close()}static{this.\u0275fac=function(i){return new(i||t)(te(Xl))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-apply-scenario-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,Py,5),i&2&&it()},inputs:{scenario:[1,"scenario"],metricData:[1,"metricData"]},outputs:{closed:"closed"},decls:19,vars:5,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"],[1,"flex","items-center","gap-2","py-1","cursor-pointer"],[1,"alert","alert-warning","mt-4","text-sm"],[1,"modal-action"],[1,"btn",3,"click"],[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"],["type","checkbox",1,"checkbox","checkbox-sm",3,"change","checked"],[1,"fa","fa-exclamation-triangle"],[1,"list-disc","pl-5","mt-1"]],template:function(i,o){if(i&1&&(v(0,"dialog",1,0)(2,"div",2)(3,"h2",3),g(4),b(),O(5,Ny,5,2,"div",4),v(6,"p",5),g(7,"Select which sections to apply:"),b(),Pe(8,By,5,5,"label",6,Gt),O(10,Oy,10,0,"div",7),v(11,"div",8)(12,"button",9),W("click",function(){return o.close()}),g(13,"Cancel"),b(),v(14,"button",10),W("click",function(){return o.apply()}),g(15,"Apply"),b()()(),v(16,"form",11)(17,"button"),g(18,"close"),b()()()),i&2){let r;h(3),F("title","Apply: "+o.scenario().name),h(),ge("Apply: ",o.scenario().name),h(),z((r=o.scenario().mapFileNames)!=null&&r.length?5:-1),h(3),Ne(o.availableSectionKeys()),h(2),z(o.hasMissing()&&o.selectedSections().metrics?10:-1),h(4),F("disabled",!o.hasAnySelected())}},dependencies:[co,er,Kn,Jn],encapsulation:2,changeDetection:0})}}return t})();var Ql=(()=>{class t{async readAll(){return await(await Pr()).getAll(Lr)}async add(e){let o=(await Pr()).transaction(Lr,"readwrite");await Promise.all([o.store.add(e),o.done])}async update(e){let o=(await Pr()).transaction(Lr,"readwrite");await Promise.all([o.store.put(e),o.done])}async delete(e){let o=(await Pr()).transaction(Lr,"readwrite");await Promise.all([o.store.delete(e),o.done])}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Wi={positive:"#69AE40",neutral:"#ddcc00",negative:"#820E0E"},zy={positive:Wi.negative,neutral:Wi.neutral,negative:Wi.positive,isColorRangeInverted:!0},o3=[{id:"built-in-rloc",name:"Real Lines of Code",description:"Visualize code size using real lines of code",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"rloc",colorMetric:"rloc",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:250,to:500},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-complexity",name:"Complexity",description:"Visualize cyclomatic complexity",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"complexity",colorMetric:"complexity",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:50,to:100},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-comment-lines",name:"Comment Lines",description:"Visualize comment density",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"comment_lines",colorMetric:"comment_lines",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:50,to:100},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-code-smells",name:"Code Smells",description:"Visualize code smell density",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"sonar_code_smells",colorMetric:"sonar_code_smells",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:10,to:50},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-logic-complexity",name:"Logic Complexity",description:"Visualize cognitive/logic complexity",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"logic_complexity",colorMetric:"logic_complexity",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:40,to:80},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-max-complexity-per-function",name:"Max Complexity per Function",description:"Visualize maximum complexity per function",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"max_complexity_per_function",colorMetric:"max_complexity_per_function",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:10,to:20},colorMode:Xt.weightedGradient,mapColors:Wi}}},{id:"built-in-authors",name:"Authors",description:"Visualize the number of authors per file",createdAt:0,isBuiltIn:!0,sections:{metrics:{areaMetric:"rloc",heightMetric:"number_of_authors",colorMetric:"number_of_authors",isColorMetricLinkedToHeightMetric:!0},colors:{colorRange:{from:2,to:3},colorMode:Xt.absolute,mapColors:zy}}}],Oi=(()=>{class t{constructor(e,i,o,r){this.scenariosStore=e,this.threeCameraService=i,this.threeMapControlsService=o,this.db=r,this.scenarios$=new wm([])}async loadScenarios(){try{let e=await this.db.readAll();e.sort((i,o)=>o.createdAt-i.createdAt),this.scenarios$.next([...e,...o3])}catch(e){console.error("Failed to load scenarios from IndexedDB:",e),this.scenarios$.next([...o3])}}async saveScenario(e,i,o){let r=this.threeCameraService.camera?.position,a=this.threeMapControlsService.controls?.target,s=this.buildScenario(e,this.scenariosStore.getValue(),r?{x:r.x,y:r.y,z:r.z}:{x:0,y:300,z:1e3},a?{x:a.x,y:a.y,z:a.z}:{x:0,y:0,z:0},i,o);try{await this.db.add(s),await this.loadScenarios()}catch(l){console.error("Failed to save scenario:",l)}return s}async removeScenario(e){try{await this.db.delete(e),await this.loadScenarios()}catch(i){console.error("Failed to remove scenario:",i)}}buildScenarioSections(e,i,o){return{metrics:{areaMetric:e.mapState.areaMetric,heightMetric:e.mapState.heightMetric,colorMetric:e.mapState.colorMetric,edgeMetric:e.mapState.edgeMetric,distributionMetric:e.mapState.distributionMetric,isColorMetricLinkedToHeightMetric:e.preferences.isColorMetricLinkedToHeightMetric},colors:{colorRange:xe({},e.mapState.colorRange),colorMode:e.mapState.colorMode,mapColors:xe({},e.mapState.mapColors)},camera:{position:xe({},i),target:xe({},o)},filters:{blacklist:[...e.sharedView.blacklist],focusedNodePath:[...e.sharedView.focusedNodePath]},labelsAndFolders:{amountOfTopLabels:e.mapState.amountOfTopLabels,labelSize:e.mapState.labelSize,showMetricLabelNameValue:e.mapState.showMetricLabelNameValue,showMetricLabelNodeName:e.mapState.showMetricLabelNodeName,enableFloorLabels:e.mapState.enableFloorLabels,colorLabels:xe({},e.mapState.colorLabels),labelMode:e.mapState.labelMode,groupLabelCollisions:e.mapState.groupLabelCollisions,markedPackages:[...e.sharedView.markedPackages]}}}buildScenario(e,i,o,r,a,s){return{id:crypto.randomUUID(),name:e,description:a,mapFileNames:s,createdAt:Date.now(),sections:this.buildScenarioSections(i,o,r)}}static{this.\u0275fac=function(i){return new(i||t)(M(Gl),M(Qn),M(Vt),M(Ql))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $y=["dialog"];function jy(t,n){t&1&&(v(0,"span",8),g(1,"A name is required."),b())}var _h=(()=>{class t{constructor(e,i){this.scenariosService=e,this.fileStoreReadWindow=i,this.dialogElement=je.required("dialog"),this.name=be(""),this.description=be(""),this.bindToMap=be(!1),this.nameValid=Z(()=>this.name().trim().length>0),this.visibleFileNames=D(this.fileStoreReadWindow.files$.pipe(ke(o=>pn(o).map(r=>r.fileMeta.fileName))),{initialValue:[]}),this.hasFiles=Z(()=>this.visibleFileNames().length>0)}open(){this.name.set(""),this.description.set(""),this.bindToMap.set(!1),this.dialogElement().nativeElement.showModal()}close(){this.dialogElement().nativeElement.close()}async save(){if(this.nameValid()){let e=this.bindToMap()&&this.hasFiles()?this.visibleFileNames():void 0;await this.scenariosService.saveScenario(this.name(),this.description()||void 0,e),this.close()}}static{this.\u0275fac=function(i){return new(i||t)(te(Oi),te(Te))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-save-scenario-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,$y,5),i&2&&it()},decls:29,vars:8,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,"modal-action"],[1,"btn",3,"click"],[1,"btn","btn-primary",3,"click","disabled"],["method","dialog",1,"modal-backdrop"],[3,"click"]],template:function(i,o){i&1&&(v(0,"dialog",1,0)(2,"div",2)(3,"h2",3),g(4,"Save Scenario"),b(),v(5,"div",4)(6,"label",5)(7,"span",6),g(8,"Scenario Name"),b()(),v(9,"input",7),W("ngModelChange",function(a){return o.name.set(a)}),b(),O(10,jy,2,0,"span",8),b(),v(11,"div",4)(12,"label",9)(13,"span",6),g(14,"Description (optional)"),b()(),v(15,"textarea",10),W("ngModelChange",function(a){return o.description.set(a)}),b()(),v(16,"div",4)(17,"label",11)(18,"input",12),W("ngModelChange",function(a){return o.bindToMap.set(a)}),b(),v(19,"span",6),g(20," Bind to current maps "),b()()(),v(21,"div",13)(22,"button",14),W("click",function(){return o.close()}),g(23,"Cancel"),b(),v(24,"button",15),W("click",function(){return o.save()}),g(25,"Save"),b()()(),v(26,"form",16)(27,"button",17),W("click",function(){return o.close()}),g(28,"close"),b()()()),i&2&&(h(9),F("ngModel",o.name()),h(),z(!o.nameValid()&&o.name().length>0?10:-1),h(5),F("ngModel",o.description()),h(2),Le("opacity-40",!o.hasFiles()),h(),F("ngModel",o.bindToMap())("disabled",!o.hasFiles()),h(6),F("disabled",!o.nameValid()))},dependencies:[co,er,ys,mf,Cs,Kn,Ms,Jn],encapsulation:2,changeDetection:0})}}return t})();var Hy=["dialog"],Yl=(()=>{class t{constructor(){this.scenarioName=H.required(),this.confirmed=Ce(),this.cancelled=Ce(),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||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-delete-confirm-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,Hy,5),i&2&&it()},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,o){i&1&&(S(0,"dialog",1,0)(2,"div",2)(3,"h3",3),g(4,"Delete Scenario"),y(),S(5,"p"),g(6),y(),S(7,"div",4)(8,"button",5),Y("click",function(){return o.cancel()}),g(9,"Cancel"),y(),S(10,"button",6),Y("click",function(){return o.confirm()}),g(11,"Delete"),y()()(),S(12,"form",7)(13,"button",8),Y("click",function(){return o.cancel()}),g(14,"close"),y()()()),i&2&&(h(6),ge('Are you sure you want to delete "',o.scenarioName(),'"?'))},encapsulation:2,changeDetection:0})}}return t})();var Uy=["dialog"];function Gy(t,n){if(t&1&&(S(0,"li"),g(1),y()),t&2){let e=n.$implicit;h(),qe(e)}}function Xy(t,n){if(t&1&&(S(0,"div",5)(1,"div"),fe(2,"i",11),S(3,"strong"),g(4,"Already existing:"),y(),S(5,"ul",12),Pe(6,Gy,2,1,"li",null,Gt),y()()()),t&2){let e=A();h(6),Ne(e.feedback().duplicates)}}function Qy(t,n){if(t&1&&(S(0,"li"),g(1),y()),t&2){let e=n.$implicit;h(),qe(e)}}function Yy(t,n){if(t&1&&(S(0,"div",6)(1,"div"),fe(2,"i",13),S(3,"strong"),g(4,"Invalid scenario files:"),y(),S(5,"ul",12),Pe(6,Qy,2,1,"li",null,Gt),y()()()),t&2){let e=A();h(6),Ne(e.feedback().invalid)}}function Zy(t,n){if(t&1&&(S(0,"li"),g(1),y()),t&2){let e=n.$implicit;h(),qe(e)}}function Ky(t,n){if(t&1&&(S(0,"div",6)(1,"div"),fe(2,"i",13),S(3,"strong"),g(4,"Could not read (bad format):"),y(),S(5,"ul",12),Pe(6,Zy,2,1,"li",null,Gt),y()()()),t&2){let e=A();h(6),Ne(e.feedback().parseErrors)}}var Zl=(()=>{class t{constructor(){this.closed=Ce(),this.dialogElement=je.required("dialog"),this.feedback=be({duplicates:[],invalid:[],parseErrors:[]})}open(e){let{duplicates:i,invalid:o,parseErrors:r}=e;(i.length>0||o.length>0||r.length>0)&&(this.feedback.set({duplicates:i,invalid:o,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||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-import-feedback-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,Uy,5),i&2&&it()},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,o){i&1&&(S(0,"dialog",1,0)(2,"div",2)(3,"h3",3),g(4,"Import Results"),y(),S(5,"div",4),O(6,Xy,8,0,"div",5),O(7,Yy,8,0,"div",6),O(8,Ky,8,0,"div",6),y(),S(9,"div",7)(10,"button",8),Y("click",function(){return o.close()}),g(11,"OK"),y()()(),S(12,"form",9)(13,"button",10),Y("click",function(){return o.close()}),g(14,"close"),y()()()),i&2&&(h(6),z(o.feedback().duplicates.length?6:-1),h(),z(o.feedback().invalid.length?7:-1),h(),z(o.feedback().parseErrors.length?8:-1))},encapsulation:2,changeDetection:0})}}return t})();function Jy(t,n){if(t&1){let e=Me();S(0,"button",0),Y("click",function(o){return ce(e),A().exportRequested.emit(),de(o.stopPropagation())}),fe(1,"i",1),y(),S(2,"button",2),Y("click",function(o){return ce(e),A().deleteRequested.emit(),de(o.stopPropagation())}),fe(3,"i",3),y()}}var n3=(()=>{class t{constructor(){this.isBuiltIn=H.required(),this.exportRequested=Ce(),this.deleteRequested=Ce()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&O(0,Jy,4,0),i&2&&z(o.isBuiltIn()?-1:0)},encapsulation:2,changeDetection:0})}}return t})();function e8(t,n){t&1&&(S(0,"span",1),g(1,"Built-in"),y())}function t8(t,n){if(t&1&&(S(0,"span",2),g(1),y()),t&2){let e=A();h(),qe(e.view().formattedDate)}}function i8(t,n){if(t&1&&(S(0,"span",3),fe(1,"i",6),S(2,"span",7),g(3),y()()),t&2){let e=A();le("title","Bound to "+e.view().scenario.mapFileNames.join(", ")),h(3),qe(e.view().scenario.mapFileNames.join(", "))}}function o8(t,n){if(t&1&&fe(0,"i",8),t&2){let e=n.$implicit,i=A();St(cn("fa ",i.sectionIcons[e])),le("title",i.sectionLabels[e])}}var r3=(()=>{class t{constructor(){this.view=H.required(),this.sectionLabels=jl,this.sectionIcons=Hl}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(S(0,"div",0),O(1,e8,2,0,"span",1)(2,t8,2,1,"span",2),O(3,i8,4,2,"span",3),S(4,"span",4),Pe(5,o8,1,4,"i",5,Gt),y()()),i&2&&(h(),z(o.view().scenario.isBuiltIn?1:2),h(2),z(o.view().mapBound?3:-1),h(2),Ne(o.view().sectionKeys))},encapsulation:2,changeDetection:0})}}return t})();function n8(t,n){t&1&&(v(0,"span",3),L(1,"i",7),b())}function r8(t,n){if(t&1&&(v(0,"div",4),g(1),b()),t&2){let e=A();h(),qe(e.view().scenario.description)}}var a3=(()=>{class t{constructor(){this.view=H.required(),this.applyRequested=Ce(),this.exportRequested=Ce(),this.deleteRequested=Ce()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(v(0,"button",0),W("click",function(){return o.applyRequested.emit()}),v(1,"div",1)(2,"div",2),g(3),O(4,n8,2,0,"span",3),b(),O(5,r8,2,1,"div",4),L(6,"cc-scenario-item-badges",5),b(),v(7,"cc-scenario-item-actions",6),W("exportRequested",function(){return o.exportRequested.emit()})("deleteRequested",function(){return o.deleteRequested.emit()}),b()()),i&2&&(h(),Le("opacity-40",o.view().mapMismatch),h(),F("title",o.view().scenario.name),h(),ge(" ",o.view().scenario.name," "),h(),z(o.view().warning?4:-1),h(),z(o.view().scenario.description?5:-1),h(),F("view",o.view()),h(),F("isBuiltIn",!!o.view().scenario.isBuiltIn))},dependencies:[r3,n3],encapsulation:2,changeDetection:0})}}return t})();var Sr=class{static downloadData(n,e){let i=new Blob([n],{type:"text/json"}),o=document.createEvent("MouseEvents"),r=document.createElement("a");r.download=e,r.href=window.URL.createObjectURL(i),r.dataset.downloadurl=["text/json",r.download,r.href].join(":"),o.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(o)}};var s3=(()=>{class t{constructor(e,i){this.scenariosService=e,this.db=i}exportScenario(e){let i=Zb(e),o=e.name.replaceAll(/[^\w-]/g,"_");Sr.downloadData(JSON.stringify(i,null,2),o+Ul)}async importScenarioFiles(e){let i=this.scenariosService.scenarios$.getValue(),o={imported:0,duplicates:[],invalid:[],parseErrors:[]};for(let r of e){let a;try{let l=await r.text();a=JSON.parse(l)}catch{o.parseErrors.push(r.name);continue}if(a.schemaVersion!==1||!a.name||!a.sections){o.invalid.push(r.name);continue}if(this.isDuplicate(a,i)){o.duplicates.push(a.name);continue}let s=Kb(a);i.push(s),await this.db.add(s),o.imported++}return o.imported>0&&await this.scenariosService.loadScenarios(),o}isDuplicate(e,i){return i.some(o=>o.name===e.name&&JSON.stringify(o.sections)===JSON.stringify(e.sections))}static{this.\u0275fac=function(i){return new(i||t)(M(Oi),M(Ql))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var l3=(()=>{class t{constructor(e){this.store=e,this.metricData$=this.store.select($n)}static{this.\u0275fac=function(i){return new(i||t)(M(he))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var l8=[{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"}],c3=(()=>{class t{constructor(e){this.scenarioApplier=e}groupScenarios(e,i){let o=new Map;for(let r of e){let a=this.getScenarioPriority(r,i),s=o.get(a);s?s.push(r):o.set(a,[r])}return l8.filter(r=>o.has(r.priority)).map(r=>({label:r.label,icon:r.icon,scenarios:o.get(r.priority)??[]}))}toScenarioView(e,i,o){let r=(e.mapFileNames?.length??0)>0,a=r&&!e.mapFileNames.some(l=>i.has(l)),s=e.sections.metrics?this.scenarioApplier.hasMissingMetrics(this.scenarioApplier.getMissingMetrics(e.sections.metrics,o)):!1;return{scenario:e,warning:s,mapMismatch:a,mapBound:r,sectionKeys:$l(e),formattedDate:new Date(e.createdAt).toLocaleDateString()}}getScenarioPriority(e,i){let o=(e.mapFileNames?.length??0)>0;return o&&e.mapFileNames?.some(r=>i.has(r))?0:!o&&!e.isBuiltIn?1:e.isBuiltIn?2:3}static{this.\u0275fac=function(i){return new(i||t)(M(Xl))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var d8=["dialog"],h8=["fileInput"],m8=(t,n)=>n.label,p8=(t,n)=>n.scenario.id;function u8(t,n){t&1&&(v(0,"p",13),g(1,"No scenarios found."),b())}function f8(t,n){if(t&1){let e=Me();v(0,"cc-scenario-item",25),W("applyRequested",function(){let o=ce(e).$implicit,r=A(2);return de(r.applyScenario(o.scenario))})("exportRequested",function(){let o=ce(e).$implicit,r=A(2);return de(r.exportScenario(o.scenario))})("deleteRequested",function(){let o=ce(e).$implicit,r=A(2);return de(r.requestDelete(o.scenario))}),b()}if(t&2){let e=n.$implicit;F("view",e)}}function g8(t,n){if(t&1&&(v(0,"div",19),L(1,"input",20),v(2,"div",21),L(3,"i"),g(4),v(5,"span",22),g(6),b()(),v(7,"div",23),Pe(8,f8,1,1,"cc-scenario-item",24,p8),b()()),t&2){let e=n.$implicit,i=n.$index;Le("mt-1",i!==0),h(),F("checked",i===0),h(2),St(cn("fa ",e.icon," mr-2")),h(),ge(" ",e.label," "),h(2),qe(e.scenarios.length),h(2),Ne(e.scenarios)}}var Eh=(()=>{class t{constructor(e,i,o,r,a){this.scenariosService=e,this.importExportService=i,this.scenarioDialogStore=o,this.fileStoreReadWindow=r,this.helpers=a,this.dialogElement=je.required("dialog"),this.deleteConfirmDialogRef=je.required(Yl),this.importFeedbackDialogRef=je.required(Zl),this.fileInput=je.required("fileInput"),this.applyRequested=Ce(),this.deleteTarget=be(null),this.acceptExtensions=`${Ul},.json`,this.scenarios=D(this.scenariosService.scenarios$,{initialValue:[]}),this.metricData=D(this.scenarioDialogStore.metricData$,{requireSync:!0}),this.searchTerm=be(""),this.visibleFileNames=D(this.fileStoreReadWindow.files$.pipe(ke(s=>new Set(pn(s).map(l=>l.fileMeta.fileName)))),{initialValue:new Set}),this.filteredScenarios=Z(()=>{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,p)=>this.helpers.getScenarioPriority(m,d)-this.helpers.getScenarioPriority(p,d))}),this.groupedScenarios=Z(()=>{let s=this.visibleFileNames(),l=this.metricData();return this.helpers.groupScenarios(this.filteredScenarios(),s).map(c=>nt(xe({},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(e){this.close(),this.applyRequested.emit({scenario:e,metricData:this.metricData()})}exportScenario(e){this.importExportService.exportScenario(e)}openImportDialog(){this.fileInput().nativeElement.click()}async handleImportFiles(e){let i=e.target;if(!i.files||i.files.length===0)return;let o=await this.importExportService.importScenarioFiles(i.files);i.value="",this.importFeedbackDialogRef().open(o)}requestDelete(e){this.deleteTarget.set(e),this.deleteConfirmDialogRef().open()}cancelDelete(){this.deleteTarget.set(null)}async confirmDelete(){let e=this.deleteTarget();e&&(this.deleteTarget.set(null),await this.scenariosService.removeScenario(e.id))}static{this.\u0275fac=function(i){return new(i||t)(te(Oi),te(s3),te(l3),te(Te),te(c3))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-scenario-list-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialogElement,d8,5)(o.deleteConfirmDialogRef,Yl,5)(o.importFeedbackDialogRef,Zl,5)(o.fileInput,h8,5),i&2&&it(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","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,o){if(i&1&&(v(0,"dialog",2,0)(2,"div",3)(3,"div",4)(4,"h2",5),g(5,"Scenarios"),b(),v(6,"div",6)(7,"button",7),W("click",function(){return o.openImportDialog()}),L(8,"i",8),b(),v(9,"button",9),W("click",function(){return o.close()}),L(10,"i",10),b()()(),v(11,"input",11,1),W("change",function(a){return o.handleImportFiles(a)}),b(),v(13,"input",12),W("ngModelChange",function(a){return o.searchTerm.set(a)}),b(),O(14,u8,2,0,"p",13),v(15,"div",14),Pe(16,g8,10,8,"div",15,m8),b()(),v(18,"form",16)(19,"button",17),W("click",function(){return o.close()}),g(20,"close"),b()()(),v(21,"cc-delete-confirm-dialog",18),W("confirmed",function(){return o.confirmDelete()})("cancelled",function(){return o.cancelDelete()}),b(),L(22,"cc-import-feedback-dialog")),i&2){let r;h(11),F("accept",o.acceptExtensions),h(2),F("ngModel",o.searchTerm()),h(),z(o.filteredScenarios().length===0?14:-1),h(2),Ne(o.groupedScenarios()),h(5),F("scenarioName",((r=o.deleteTarget())==null?null:r.name)??"")}},dependencies:[co,er,ys,Cs,Kn,Ms,Jn,Yl,Zl,a3],encapsulation:2,changeDetection:0})}}return t})();var b8=["listDialog"],v8=["saveDialog"];function x8(t,n){if(t&1){let e=Me();v(0,"cc-apply-scenario-dialog",16),W("closed",function(){ce(e);let o=A();return de(o.handleApplyClosed())}),b()}if(t&2){let e=n;F("scenario",e.scenario)("metricData",e.metricData)}}var d3=(()=>{class t{constructor(){this.scenariosService=q(Oi),this.listDialog=je.required("listDialog"),this.saveDialog=je.required("saveDialog"),this.applyTarget=be(null),this.scenarios=D(this.scenariosService.scenarios$,{initialValue:[]}),this.scenariosCountLabel=Z(()=>{let e=this.scenarios().length;return`${e} ${e===1?"scenario":"scenarios"} available`})}async ngOnInit(){await this.scenariosService.loadScenarios()}openScenarioList(){this.listDialog().open()}openSaveDialog(){this.saveDialog().open()}handleApplyRequested(e){this.applyTarget.set(e)}handleApplyClosed(){this.applyTarget.set(null)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-labels-scenarios-segment"]],viewQuery:function(i,o){i&1&&tt(o.listDialog,b8,5)(o.saveDialog,v8,5),i&2&&it(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,o){if(i&1&&(v(0,"div",2)(1,"div",3)(2,"div",4)(3,"span",5),g(4,"Labels"),b(),v(5,"button",6),L(6,"i",7),b()()(),L(7,"div",8),v(8,"div",9)(9,"div",4)(10,"span",5),g(11,"Scenarios"),b(),v(12,"button",10),W("click",function(){return o.openSaveDialog()}),L(13,"i",11),b()(),v(14,"button",12),W("click",function(){return o.openScenarioList()}),g(15),b()()(),v(16,"cc-settings-popover-shell",13),L(17,"cc-label-settings-panel"),b(),v(18,"cc-scenario-list-dialog",14,0),W("applyRequested",function(a){return o.handleApplyRequested(a)}),b(),L(20,"cc-save-scenario-dialog",null,1),O(22,x8,1,2,"cc-apply-scenario-dialog",15)),i&2){let r;h(15),ge(" ",o.scenariosCountLabel()," "),h(7),z((r=o.applyTarget())?22:-1,r)}},dependencies:[bd,Eh,_h,Ch,Wt],encapsulation:2,changeDetection:0})}}return t})();var h3=(()=>{class t{constructor(){this.preferencesReadWindow=q(Yn),this.metricsBarWriteStore=q(Ze),this.isLinked=D(this.preferencesReadWindow.isColorMetricLinkedToHeightMetric$,{initialValue:!1}),this.iconClass=Z(()=>this.isLinked()?"fa fa-link":"fa fa-unlink"),this.title=Z(()=>this.isLinked()?"Unlink Height and Color Metric":"Link Height and Color Metric"),this.buttonClass=Z(()=>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||t)}}static{this.\u0275cmp=_({type:t,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,o){i&1&&(S(0,"button",0),Y("click",function(){return o.toggle()}),fe(1,"i"),y()),i&2&&(St(o.buttonClass()),le("title",o.title()),dt("aria-label",o.title())("data-testid","metric-link-button")("aria-pressed",o.isLinked()),h(),St(o.iconClass()))},encapsulation:2,changeDetection:0})}}return t})();function w8(t,n){t&1&&L(0,"cc-link-color-height-button")(1,"cc-color-segment")}function S8(t,n){if(t&1&&L(0,"cc-axis-card",0)(1,"cc-color-settings-popover",1),t&2){let e=A();F("metricName","Settings")("hasCog",!0)("cogPopoverId",e.deltaColorSettingsPopoverId)("cogAnchorName",e.deltaColorSettingsAnchorName)("testId","metric-segment-color-settings")("cogTestId","metric-segment-color-settings-cog"),h(),F("popoverId",e.deltaColorSettingsPopoverId)("anchorName",e.deltaColorSettingsAnchorName)}}function y8(t,n){t&1&&L(0,"cc-edge-segment")}var kh=(()=>{class t{constructor(){this.barBottom=cf,this.fileStoreReadWindow=q(Te),this.metricsBarReadStore=q(mt),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.hasEdgeMetric=D(this.metricsBarReadStore.metricData$.pipe(ke(e=>e.edgeMetricData.length>0)),{initialValue:!1}),this.showColorMetricSegment=Z(()=>!this.isDeltaState()),this.deltaColorSettingsPopoverId="metric-settings-popover-color-delta",this.deltaColorSettingsAnchorName="metric-segment-color-settings"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metrics-bar"]],hostVars:2,hostBindings:function(i,o){i&2&&Oe("bottom",o.barBottom)},features:[Qi([df])],decls:6,vars:2,consts:[["label","Color",3,"metricName","hasCog","cogPopoverId","cogAnchorName","testId","cogTestId"],[3,"popoverId","anchorName"]],template:function(i,o){i&1&&(L(0,"cc-area-segment")(1,"cc-height-segment"),O(2,w8,2,0)(3,S8,2,8),O(4,y8,1,0,"cc-edge-segment"),L(5,"cc-labels-scenarios-segment")),i&2&&(h(2),z(o.showColorMetricSegment()?2:3),h(2),z(o.hasEdgeMetric()?4:-1))},dependencies:[h1,lo,jb,zl,Xb,Yb,d3,h3],encapsulation:2,changeDetection:0})}}return t})();var qh=(()=>{class t extends Gf{constructor(){super(...arguments),this.areaMetric=D(q(ve).areaMetric$,{requireSync:!0}),this.pathToNode=q(he).selectSignal(bu)}isEnabledFor(e){let i=this.pathToNode().get(e);return i!==void 0&&Va(i,this.areaMetric())}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=Im(t)))(o||t)}})()}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var C8=(t,n,e)=>{let i=t.length>0?t.filter(l=>Ki(l)):n,o=0,r=0,a=0,s=0;for(let l of i)l.isFlattened&&o++,l.isExcluded&&r++,!l.isFlattened&&!l.isExcluded&&(a++,Va(l,e)||s++);return{shown:a,flattened:o,hidden:r,noArea:s}},m3=Re(Su,Li,bi,C8);var Th=(()=>{class t{constructor(){this.store=q(he),this.counts$=this.store.select(m3)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var Ih=(()=>{class t{constructor(){this.mapStateReadWindow=q(ve),this.sharedViewReadWindow=q(Nt),this.store=q(he),this.idToBuildingService=q(Gn),this.areaMetric=D(this.mapStateReadWindow.areaMetric$,{requireSync:!0}),this.buildingIds=D(this.idToBuildingService.buildingIds$,{requireSync:!0}),this.rootUnary=D(this.store.select(vu),{requireSync:!0}),this.markedPackages=D(this.sharedViewReadWindow.markedPackages$,{requireSync:!0})}project(e){return Xf(e,{areaMetric:this.areaMetric(),buildingIds:this.buildingIds(),rootUnary:this.rootUnary(),showsFlattenedState:!0,hidesExcludedNodes:!0,markedPackages:this.markedPackages()})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var f3=qa(Fx());var p3=t=>/[*?]/.test(t);var g3=(t,n,e)=>{let i=t.filter(s=>s.type===e);if(i.length===0)return[];let o=n.map(s=>rp(s.path)),{rules:r,combinedPositivePrefilter:a}=M8(i);return _8(r,a,o),r.map(({item:s,affectedCount:l})=>({item:s,affectedCount:l,kind:p3(s.path)?"RULE":"MANUAL"})).sort((s,l)=>s.item.path.localeCompare(l.item.path))};function M8(t){let n=(0,f3.default)();return{rules:t.map(i=>{let{ignoredNodePaths:o,condition:r}=ap(i.path);return r&&sp(n,i.path),{item:i,ignoredNodePaths:o,condition:r,affectedCount:0}}),combinedPositivePrefilter:n}}function _8(t,n,e){let i=t.filter(r=>r.condition),o=t.filter(r=>!r.condition);for(let r of e)i.length>0&&n.ignores(r)&&u3(i,r,!0),u3(o,r,!1)}function u3(t,n,e){for(let i of t)i.ignoredNodePaths.ignores(n)===e&&i.affectedCount++}var b3=Re(Ar,Li,(t,n)=>g3(t,n,"flatten")),v3=Re(Ar,Li,(t,n)=>g3(t,n,"exclude"));var x3=(t,n,e)=>{let i=e.trim().split(",");if(e.trim().startsWith("!")){i[0]=i[0].slice(1);for(let o of i){let r=`!${sr(o)}`;if(t.some(a=>r===a.path&&n===a.type))return!0}return!1}for(let o of i)if(t.some(r=>sr(o)===r.path&&n===r.type))return!0;return!1};var Kl=Re(oo,Of);var w3=t=>Re(oo,Kl,Ar,(n,e,i)=>e||x3(i,t,n)),S3=w3("flatten"),y3=w3("exclude");var Dh=(()=>{class t{constructor(){this.store=q(he),this.flattenRules$=this.store.select(b3),this.excludeRules$=this.store.select(v3),this.isFlattenPatternDisabled$=this.store.select(S3),this.isExcludePatternDisabled$=this.store.select(y3)}removeRule(e){Nr(this.store,Fn({item:e}))}ruleFromSearchPattern(e){Nr(this.store,qg(e))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var C3={patternSelector:oo,setPattern:Fi,isPatternEmptySelector:Kl,searchedNodePathsSelector:yu};var Rh=(()=>{class t{constructor(){this.store=q(he),this.sharedViewReadWindow=q(Nt),this.threeSceneService=q(ft),this.idToBuildingService=q(Gn),this.threeRendererService=q(kt),this.codeMapMouseEventService=q(Bo),this.codeMapTooltipService=q(Un),this.selectedBuildingId=D(this.sharedViewReadWindow.selectedBuildingId$,{requireSync:!0}),this.hoveredNodeId=D(this.sharedViewReadWindow.hoveredNodeId$,{requireSync:!0})}isSelected(e){return this.selectedBuildingId()===e.path}isHovered(e){return this.hoveredNodeId()===e.path}select(e){this.store.dispatch(Wc({value:e.path}));let i=this.idToBuildingService.get(e.id);this.codeMapMouseEventService.drawLabelSelectedBuilding(i),this.threeSceneService.selectBuilding(i),this.threeSceneService.clearConstantHighlight(),this.threeRendererService.render()}deselect(){this.store.dispatch(Wc({value:null})),this.threeSceneService.clearSelection(),this.threeSceneService.clearConstantHighlight(),this.threeRendererService.render()}hover(e,i){this.store.dispatch(Do({value:e.path})),this.codeMapMouseEventService.hoverNode(e.path),this.codeMapTooltipService.show(e,i.right,i.top)}hoverEnd(){this.store.dispatch(Do({value:null})),this.codeMapMouseEventService.unhoverNode(),this.codeMapTooltipService.hide()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var M3={options:Object.values(Ba),optionSelector:Tu,ascendingSelector:Iu,setOption:Fu,toggleAscending:()=>Lu()};var _3=(t,n)=>t!==Ba.AREA_SIZE?Re(Et,e=>Qc(Yc(e.unifiedMapNode),t,n)):Re(Et,bi,(e,i)=>Qc(Yc(e.unifiedMapNode),t,n,i));var Ah=(()=>{class t{constructor(){this.store=q(he)}rootNodeFor(e,i){return this.store.select(_3(e,i))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})();var E8=2e3,E3=(()=>{class t{constructor(){this.actions$=q(ht),this.sharedViewReadWindow=q(Nt),this.revealService=q(Is),this.actions$.pipe(at(ni),Ut(()=>this.sharedViewReadWindow.selectedBuildingId$.pipe(Ie(Boolean),ut(1),Em(ym(E8)))),Zm()).subscribe(e=>this.revealService.revealNode(e,{expand:!1}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=Da({type:t,selectors:[["","ccRevealsSelectedNodeAfterLoad",""]]})}}return t})();var k3=(()=>{class t{constructor(){this.store=q(he),this.selection=q(Ts),this.revealService=q(Is),Qf("metrics",e=>this.showNode(e))}showNode(e){this.store.select(wu(e)).pipe(ut(1)).subscribe(i=>{i&&(this.selection.select(i),this.revealService.revealNode(e))})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=Da({type:t,selectors:[["","ccShowsHandedOverNode",""]]})}}return t})();var q3=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-metrics-view"]],features:[Zi([Ih,{provide:Nf,useExisting:Ih},Rh,{provide:Ts,useExisting:Rh},qh,{provide:Bf,useExisting:qh},Ah,{provide:Pf,useExisting:Ah},Th,{provide:Lf,useExisting:Th},Dh,{provide:Af,useExisting:Dh},$f(M3),zf(C3),{provide:Df,useValue:Rf},{provide:Hf,useValue:jf},Wf("metrics"),ff()]),Qi([E3,k3])],decls:10,vars:0,consts:[["view","metrics"],["collapsedContent","",1,"flex-1","min-w-0"]],template:function(i,o){i&1&&(L(0,"cc-loading-file-progress-spinner",0)(1,"cc-code-map"),v(2,"cc-sidebar-explorer"),L(3,"cc-explorer-search-bar",1),b(),L(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:[Td,kh,Uf,Vf,Ff,Ed,kd,Id,If,uf],encapsulation:2,changeDetection:0})}}return t})();var T8=[{path:Gc.metrics,component:q3},{path:Gc.domain,loadComponent:()=>import("./chunk-W62KZUC2.js").then(t=>t.DomainViewComponent)}],I8={provide:Wm,useClass:Cg},D8=[Ym(T8),I8],Fh={providers:[Hm(Um()),Jm(Mg,{metaReducers:[_g]}),...D8,{provide:Qm,useClass:Zs},ep([...j0,...eg,...X0,...G0,...ig,...ng,...yg,...kg,...Ig]),{provide:Am,useFactory:t=>()=>t.synchronizeVersion(),deps:[x0],multi:!0}]};var Jl=class{parse(n,e={}){e=Object.assign({binary:!1},e);let i=e.binary,o=[],r=0;n.traverse(function($){if($.isMesh){let ee=$.geometry,B=ee.index,j=ee.getAttribute("position");r+=B!==null?B.count/3:j.count/3,o.push({object3d:$,geometry:ee})}});let a,s=80;if(i===!0){let $=r*2+r*3*4*4+80+4,ee=new ArrayBuffer($);a=new DataView(ee),a.setUint32(s,r,!0),s+=4}else a="",a+=`solid exported
|
|
3427
3440
|
`;let l=new Ye,d=new Ye,c=new Ye,m=new Ye,p=new Ye,u=new Ye;for(let $=0,ee=o.length;$<ee;$++){let B=o[$].object3d,j=o[$].geometry,G=j.index,K=j.getAttribute("position");if(G!==null)for(let ie=0;ie<G.count;ie+=3){let oe=G.getX(ie+0),ne=G.getX(ie+1),_e=G.getX(ie+2);k(oe,ne,_e,K,B)}else for(let ie=0;ie<K.count;ie+=3){let oe=ie+0,ne=ie+1,_e=ie+2;k(oe,ne,_e,K,B)}}return i===!1&&(a+=`endsolid exported
|
|
3428
3441
|
`),a;function k($,ee,B,j,G){l.fromBufferAttribute(j,$),d.fromBufferAttribute(j,ee),c.fromBufferAttribute(j,B),G.isSkinnedMesh===!0&&(G.applyBoneTransform($,l),G.applyBoneTransform(ee,d),G.applyBoneTransform(B,c)),l.applyMatrix4(G.matrixWorld),d.applyMatrix4(G.matrixWorld),c.applyMatrix4(G.matrixWorld),E(l,d,c),P(l),P(d),P(c),i===!0?(a.setUint16(s,0,!0),s+=2):(a+=` endloop
|
|
3429
3442
|
`,a+=` endfacet
|
|
@@ -3443,14 +3456,14 @@ This License becomes null and void to the extent applicable to Fonts or Font Sof
|
|
|
3443
3456
|
\r
|
|
3444
3457
|
The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r
|
|
3445
3458
|
\r
|
|
3446
|
-
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.`,manufacturer_name:"\u039Cagenta ltd",font_sub_family_name:"Regular"},descender:-334,familyName:"Helvetiker",lineHeight:1522,underlineThickness:50};var et=class{execute(n,e){if(n<=1)return!1;let i;return n<4?i=[1,1,1]:n===4?i=[1,1,0]:i=[1,1,1],e.material.color.setRGB(i[0],i[1],i[2]),!0}};var xt=class t extends st{constructor(n,e){super(),this.colorChangeStrategy=e,this.name=n,this.boundingBoxCalculated=!1,this.material=new Zp}updateColor(n){this.colorChangeStrategy.execute(n,this);for(let e of this.children)e instanceof t&&e.updateColor(n)}getWidth(){return this.updateBoundingBox(),this.geometry.boundingBox.max.x-this.geometry.boundingBox.min.x}getHeight(){return this.updateBoundingBox(),this.geometry.boundingBox.max.z-this.geometry.boundingBox.min.z}getDepth(){return this.updateBoundingBox(),this.geometry.boundingBox.max.y-this.geometry.boundingBox.min.y}isGeneralSizeChangeMesh(){return"changeSize"in this}updateBoundingBox(){this.boundingBoxCalculated||(this.geometry.computeBoundingBox(),this.boundingBoxCalculated=!0)}};var Tt=class extends xt{constructor(n,e,i=1,o=!0){super(n,e),this.minWidth=i,this.manualVisibility=o}setManualVisibility(n){this.manualVisibility=n,this.updateVisibility()}setCurrentWidth(n){this.currentWidth=n,this.updateVisibility()}updateVisibility(){let n=this.currentWidth?this.currentWidth>=this.minWidth:!0;this.visible=this.manualVisibility&&this.visibleBecauseOfColor&&n}updateColor(n){this.visibleBecauseOfColor=this.colorChangeStrategy.execute(n,this);for(let e of this.children)e instanceof xt&&e.updateColor(n);this.updateVisibility()}};var ma=class extends On{constructor(n,e={}){let i=e.font;if(i===void 0)super();else{let o=i.generateShapes(n,e.size,e.direction);e.depth===void 0&&(e.depth=50),e.bevelThickness===void 0&&(e.bevelThickness=10),e.bevelSize===void 0&&(e.bevelSize=8),e.bevelEnabled===void 0&&(e.bevelEnabled=!1),super(o,e)}this.type="TextGeometry"}};function
|
|
3459
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.`,manufacturer_name:"\u039Cagenta ltd",font_sub_family_name:"Regular"},descender:-334,familyName:"Helvetiker",lineHeight:1522,underlineThickness:50};var et=class{execute(n,e){if(n<=1)return!1;let i;return n<4?i=[1,1,1]:n===4?i=[1,1,0]:i=[1,1,1],e.material.color.setRGB(i[0],i[1],i[2]),!0}};var xt=class t extends st{constructor(n,e){super(),this.colorChangeStrategy=e,this.name=n,this.boundingBoxCalculated=!1,this.material=new Zp}updateColor(n){this.colorChangeStrategy.execute(n,this);for(let e of this.children)e instanceof t&&e.updateColor(n)}getWidth(){return this.updateBoundingBox(),this.geometry.boundingBox.max.x-this.geometry.boundingBox.min.x}getHeight(){return this.updateBoundingBox(),this.geometry.boundingBox.max.z-this.geometry.boundingBox.min.z}getDepth(){return this.updateBoundingBox(),this.geometry.boundingBox.max.y-this.geometry.boundingBox.min.y}isGeneralSizeChangeMesh(){return"changeSize"in this}updateBoundingBox(){this.boundingBoxCalculated||(this.geometry.computeBoundingBox(),this.boundingBoxCalculated=!0)}};var Tt=class extends xt{constructor(n,e,i=1,o=!0){super(n,e),this.minWidth=i,this.manualVisibility=o}setManualVisibility(n){this.manualVisibility=n,this.updateVisibility()}setCurrentWidth(n){this.currentWidth=n,this.updateVisibility()}updateVisibility(){let n=this.currentWidth?this.currentWidth>=this.minWidth:!0;this.visible=this.manualVisibility&&this.visibleBecauseOfColor&&n}updateColor(n){this.visibleBecauseOfColor=this.colorChangeStrategy.execute(n,this);for(let e of this.children)e instanceof xt&&e.updateColor(n);this.updateVisibility()}};var ma=class extends On{constructor(n,e={}){let i=e.font;if(i===void 0)super();else{let o=i.generateShapes(n,e.size,e.direction);e.depth===void 0&&(e.depth=50),e.bevelThickness===void 0&&(e.bevelThickness=10),e.bevelSize===void 0&&(e.bevelSize=8),e.bevelEnabled===void 0&&(e.bevelEnabled=!1),super(o,e)}this.type="TextGeometry"}};function yo(t,n=!1){let e=t[0].index!==null,i=new Set(Object.keys(t[0].attributes)),o=new Set(Object.keys(t[0].morphAttributes)),r={},a={},s=t[0].morphTargetsRelative,l=new Qt,d=0;for(let c=0;c<t.length;++c){let m=t[c],p=0;if(e!==(m.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let u in m.attributes){if(!i.has(u))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+'. All geometries must have compatible attributes; make sure "'+u+'" attribute exists among all geometries, or in none of them.'),null;r[u]===void 0&&(r[u]=[]),r[u].push(m.attributes[u]),p++}if(p!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". Make sure all geometries have the same number of attributes."),null;if(s!==m.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let u in m.morphAttributes){if(!o.has(u))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphAttributes must be consistent throughout all geometries."),null;a[u]===void 0&&(a[u]=[]),a[u].push(m.morphAttributes[u])}if(n){let u;if(e)u=m.index.count;else if(m.attributes.position!==void 0)u=m.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". The geometry must have either an index or a position attribute"),null;l.addGroup(d,u,c),d+=u}}if(e){let c=0,m=[];for(let p=0;p<t.length;++p){let u=t[p].index;for(let k=0;k<u.count;++k)m.push(u.getX(k)+c);c+=t[p].attributes.position.count}l.setIndex(m)}for(let c in r){let m=T3(r[c]);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+c+" attribute."),null;l.setAttribute(c,m)}for(let c in a){let m=a[c][0].length;if(m===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[c]=[];for(let p=0;p<m;++p){let u=[];for(let E=0;E<a[c].length;++E)u.push(a[c][E][p]);let k=T3(u);if(!k)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+c+" morphAttribute."),null;l.morphAttributes[c].push(k)}}return l}function T3(t){let n,e,i,o=-1,r=0;for(let d=0;d<t.length;++d){let c=t[d];if(n===void 0&&(n=c.array.constructor),n!==c.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(e===void 0&&(e=c.itemSize),e!==c.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(i===void 0&&(i=c.normalized),i!==c.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(o===-1&&(o=c.gpuType),o!==c.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;r+=c.count*e}let a=new n(r),s=new no(a,e,i),l=0;for(let d=0;d<t.length;++d){let c=t[d];if(c.isInterleavedBufferAttribute){let m=l/e;for(let p=0,u=c.count;p<u;p++)for(let k=0;k<e;k++){let E=c.getComponent(p,k);s.setComponent(p+m,k,E)}}else a.set(c.array,l);l+=c.count*e}return o!==void 0&&(s.gpuType=o),s}var yr=class{async create(n,e){let{font:i,side:o,text:r,xPosition:a,yPosition:s,align:l}=e;if(!r)return new Qt;let{textSize:d}=e;d||(d=.025);let c=l==="center"&&r.includes(`
|
|
3447
3460
|
`)?this.createMultilineCenteredTextGeometry(r,i,d,n.printHeight):new ma(r,{font:i,size:d,depth:n.printHeight});c.center(),o==="back"&&c.rotateY(Math.PI),c.computeBoundingBox();let m=c.boundingBox.max.x-c.boundingBox.min.x,p=l==="center"?0:m/2,u=o==="front"?1:-1;return c.translate(u*(p+a),s,o==="front"?n.printHeight/2:-n.baseplateHeight+n.printHeight/2),c}createMultilineCenteredTextGeometry(n,e,i,o){let r=n.split(`
|
|
3448
|
-
`),a=[];for(let[s,l]of r.entries()){let d=new ma(l,{font:e,size:i,depth:o});d.center(),d.translate(0,-s*i*1.5,0),a.push(d)}return
|
|
3449
|
-
maibornwolff.de/service/it-sanierung`,side:"back",xPosition:0,yPosition:.23,align:"center"};super(n,new et,200,!0,i)}};var L8=Yp,ic=class t extends Oc{constructor(n){super(n),this.defaultDPI=90,this.defaultUnit="px"}load(n,e,i,o){let r=this,a=new zc(r.manager);a.setPath(r.path),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(n,function(s){try{e(r.parse(s))}catch(l){o?o(l):console.error(l),r.manager.itemError(n)}},i,o)}parse(n){let e=this;function i(R,C){if(R.nodeType!==1)return;let x=j(R),f=!1,X=null;switch(R.nodeName){case"svg":C=k(R,C);break;case"style":r(R);break;case"g":C=k(R,C);break;case"path":C=k(R,C),R.hasAttribute("d")&&(X=o(R));break;case"rect":C=k(R,C),X=l(R);break;case"polygon":C=k(R,C),X=d(R);break;case"polyline":C=k(R,C),X=c(R);break;case"circle":C=k(R,C),X=m(R);break;case"ellipse":C=k(R,C),X=p(R);break;case"line":C=k(R,C),X=u(R);break;case"defs":f=!0;break;case"use":C=k(R,C);let ae=(R.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),me=R.viewportElement.getElementById(ae);me?i(me,C):console.warn("SVGLoader: 'use node' references non-existent node id: "+ae);break;default:}X&&(C.fill!==void 0&&C.fill!=="none"&&X.color.setStyle(C.fill,L8),K(X,ct),U.push(X),X.userData={node:R,style:C});let se=R.childNodes;for(let V=0;V<se.length;V++){let ae=se[V];f&&ae.nodeName!=="style"&&ae.nodeName!=="defs"||i(ae,C)}x&&(Ee.pop(),Ee.length>0?ct.copy(Ee[Ee.length-1]):ct.identity())}function o(R){let C=new Ci,x=new Ge,f=new Ge,X=new Ge,se=!0,V=!1,ae=R.getAttribute("d");if(ae===""||ae==="none")return null;let me=ae.match(/[a-df-z][^a-df-z]*/ig);for(let pe=0,Q=me.length;pe<Q;pe++){let re=me[pe],we=re.charAt(0),ye=re.slice(1).trim();se===!0&&(V=!0,se=!1);let I;switch(we){case"M":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=2)x.x=I[w+0],x.y=I[w+1],f.x=x.x,f.y=x.y,w===0?C.moveTo(x.x,x.y):C.lineTo(x.x,x.y),w===0&&X.copy(x);break;case"H":I=P(ye);for(let w=0,Se=I.length;w<Se;w++)x.x=I[w],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"V":I=P(ye);for(let w=0,Se=I.length;w<Se;w++)x.y=I[w],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"L":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=2)x.x=I[w+0],x.y=I[w+1],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"C":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=6)C.bezierCurveTo(I[w+0],I[w+1],I[w+2],I[w+3],I[w+4],I[w+5]),f.x=I[w+2],f.y=I[w+3],x.x=I[w+4],x.y=I[w+5],w===0&&V===!0&&X.copy(x);break;case"S":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=4)C.bezierCurveTo(E(x.x,f.x),E(x.y,f.y),I[w+0],I[w+1],I[w+2],I[w+3]),f.x=I[w+0],f.y=I[w+1],x.x=I[w+2],x.y=I[w+3],w===0&&V===!0&&X.copy(x);break;case"Q":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=4)C.quadraticCurveTo(I[w+0],I[w+1],I[w+2],I[w+3]),f.x=I[w+0],f.y=I[w+1],x.x=I[w+2],x.y=I[w+3],w===0&&V===!0&&X.copy(x);break;case"T":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=2){let $e=E(x.x,f.x),Ht=E(x.y,f.y);C.quadraticCurveTo($e,Ht,I[w+0],I[w+1]),f.x=$e,f.y=Ht,x.x=I[w+0],x.y=I[w+1],w===0&&V===!0&&X.copy(x)}break;case"A":I=P(ye,[3,4],7);for(let w=0,Se=I.length;w<Se;w+=7){if(I[w+5]==x.x&&I[w+6]==x.y)continue;let $e=x.clone();x.x=I[w+5],x.y=I[w+6],f.x=x.x,f.y=x.y,a(C,I[w],I[w+1],I[w+2],I[w+3],I[w+4],$e,x),w===0&&V===!0&&X.copy(x)}break;case"m":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=2)x.x+=I[w+0],x.y+=I[w+1],f.x=x.x,f.y=x.y,w===0?C.moveTo(x.x,x.y):C.lineTo(x.x,x.y),w===0&&X.copy(x);break;case"h":I=P(ye);for(let w=0,Se=I.length;w<Se;w++)x.x+=I[w],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"v":I=P(ye);for(let w=0,Se=I.length;w<Se;w++)x.y+=I[w],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"l":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=2)x.x+=I[w+0],x.y+=I[w+1],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"c":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=6)C.bezierCurveTo(x.x+I[w+0],x.y+I[w+1],x.x+I[w+2],x.y+I[w+3],x.x+I[w+4],x.y+I[w+5]),f.x=x.x+I[w+2],f.y=x.y+I[w+3],x.x+=I[w+4],x.y+=I[w+5],w===0&&V===!0&&X.copy(x);break;case"s":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=4)C.bezierCurveTo(E(x.x,f.x),E(x.y,f.y),x.x+I[w+0],x.y+I[w+1],x.x+I[w+2],x.y+I[w+3]),f.x=x.x+I[w+0],f.y=x.y+I[w+1],x.x+=I[w+2],x.y+=I[w+3],w===0&&V===!0&&X.copy(x);break;case"q":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=4)C.quadraticCurveTo(x.x+I[w+0],x.y+I[w+1],x.x+I[w+2],x.y+I[w+3]),f.x=x.x+I[w+0],f.y=x.y+I[w+1],x.x+=I[w+2],x.y+=I[w+3],w===0&&V===!0&&X.copy(x);break;case"t":I=P(ye);for(let w=0,Se=I.length;w<Se;w+=2){let $e=E(x.x,f.x),Ht=E(x.y,f.y);C.quadraticCurveTo($e,Ht,x.x+I[w+0],x.y+I[w+1]),f.x=$e,f.y=Ht,x.x=x.x+I[w+0],x.y=x.y+I[w+1],w===0&&V===!0&&X.copy(x)}break;case"a":I=P(ye,[3,4],7);for(let w=0,Se=I.length;w<Se;w+=7){if(I[w+5]==0&&I[w+6]==0)continue;let $e=x.clone();x.x+=I[w+5],x.y+=I[w+6],f.x=x.x,f.y=x.y,a(C,I[w],I[w+1],I[w+2],I[w+3],I[w+4],$e,x),w===0&&V===!0&&X.copy(x)}break;case"Z":case"z":C.currentPath.autoClose=!0,C.currentPath.curves.length>0&&(x.copy(X),C.currentPath.currentPoint.copy(x),se=!0);break;default:console.warn(re)}V=!1}return C}function r(R){if(!(!R.sheet||!R.sheet.cssRules||!R.sheet.cssRules.length))for(let C=0;C<R.sheet.cssRules.length;C++){let x=R.sheet.cssRules[C];if(x.type!==1)continue;let f=x.selectorText.split(/,/gm).filter(Boolean).map(X=>X.trim());for(let X=0;X<f.length;X++){let se=Object.fromEntries(Object.entries(x.style).filter(([,V])=>V!==""));De[f[X]]=Object.assign(De[f[X]]||{},se)}}}function a(R,C,x,f,X,se,V,ae){if(C==0||x==0){R.lineTo(ae.x,ae.y);return}f=f*Math.PI/180,C=Math.abs(C),x=Math.abs(x);let me=(V.x-ae.x)/2,pe=(V.y-ae.y)/2,Q=Math.cos(f)*me+Math.sin(f)*pe,re=-Math.sin(f)*me+Math.cos(f)*pe,we=C*C,ye=x*x,I=Q*Q,w=re*re,Se=I/we+w/ye;if(Se>1){let ka=Math.sqrt(Se);C=ka*C,x=ka*x,we=C*C,ye=x*x}let $e=we*w+ye*I,Ht=(we*ye-$e)/$e,hi=Math.sqrt(Math.max(0,Ht));X===se&&(hi=-hi);let wt=hi*C*re/x,Hi=-hi*x*Q/C,_a=Math.cos(f)*wt-Math.sin(f)*Hi+(V.x+ae.x)/2,bm=Math.sin(f)*wt+Math.cos(f)*Hi+(V.y+ae.y)/2,Ea=s(1,0,(Q-wt)/C,(re-Hi)/x),Nc=s((Q-wt)/C,(re-Hi)/x,(-Q-wt)/C,(-re-Hi)/x)%(Math.PI*2);R.currentPath.absellipse(_a,bm,C,x,Ea,Ea+Nc,se===0,f)}function s(R,C,x,f){let X=R*x+C*f,se=Math.sqrt(R*R+C*C)*Math.sqrt(x*x+f*f),V=Math.acos(Math.max(-1,Math.min(1,X/se)));return R*f-C*x<0&&(V=-V),V}function l(R){let C=B(R.getAttribute("x")||0),x=B(R.getAttribute("y")||0),f=B(R.getAttribute("rx")||R.getAttribute("ry")||0),X=B(R.getAttribute("ry")||R.getAttribute("rx")||0),se=B(R.getAttribute("width")),V=B(R.getAttribute("height")),ae=1-.551915024494,me=new Ci;return me.moveTo(C+f,x),me.lineTo(C+se-f,x),(f!==0||X!==0)&&me.bezierCurveTo(C+se-f*ae,x,C+se,x+X*ae,C+se,x+X),me.lineTo(C+se,x+V-X),(f!==0||X!==0)&&me.bezierCurveTo(C+se,x+V-X*ae,C+se-f*ae,x+V,C+se-f,x+V),me.lineTo(C+f,x+V),(f!==0||X!==0)&&me.bezierCurveTo(C+f*ae,x+V,C,x+V-X*ae,C,x+V-X),me.lineTo(C,x+X),(f!==0||X!==0)&&me.bezierCurveTo(C,x+X*ae,C+f*ae,x,C+f,x),me}function d(R){function C(se,V,ae){let me=B(V),pe=B(ae);X===0?f.moveTo(me,pe):f.lineTo(me,pe),X++}let x=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,f=new Ci,X=0;return R.getAttribute("points").replace(x,C),f.currentPath.autoClose=!0,f}function c(R){function C(se,V,ae){let me=B(V),pe=B(ae);X===0?f.moveTo(me,pe):f.lineTo(me,pe),X++}let x=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,f=new Ci,X=0;return R.getAttribute("points").replace(x,C),f.currentPath.autoClose=!1,f}function m(R){let C=B(R.getAttribute("cx")||0),x=B(R.getAttribute("cy")||0),f=B(R.getAttribute("r")||0),X=new ns;X.absarc(C,x,f,0,Math.PI*2);let se=new Ci;return se.subPaths.push(X),se}function p(R){let C=B(R.getAttribute("cx")||0),x=B(R.getAttribute("cy")||0),f=B(R.getAttribute("rx")||0),X=B(R.getAttribute("ry")||0),se=new ns;se.absellipse(C,x,f,X,0,Math.PI*2);let V=new Ci;return V.subPaths.push(se),V}function u(R){let C=B(R.getAttribute("x1")||0),x=B(R.getAttribute("y1")||0),f=B(R.getAttribute("x2")||0),X=B(R.getAttribute("y2")||0),se=new Ci;return se.moveTo(C,x),se.lineTo(f,X),se.currentPath.autoClose=!1,se}function k(R,C){C=Object.assign({},C);let x={};if(R.hasAttribute("class")){let V=R.getAttribute("class").split(/\s/).filter(Boolean).map(ae=>ae.trim());for(let ae=0;ae<V.length;ae++)x=Object.assign(x,De["."+V[ae]])}R.hasAttribute("id")&&(x=Object.assign(x,De["#"+R.getAttribute("id")]));function f(V,ae,me){me===void 0&&(me=function(Q){return Q.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),Q}),R.hasAttribute(V)&&(C[ae]=me(R.getAttribute(V))),x[ae]&&(C[ae]=me(x[ae])),R.style&&R.style[V]!==""&&(C[ae]=me(R.style[V]))}function X(V){return Math.max(0,Math.min(1,B(V)))}function se(V){return Math.max(0,B(V))}return f("fill","fill"),f("fill-opacity","fillOpacity",X),f("fill-rule","fillRule"),f("opacity","opacity",X),f("stroke","stroke"),f("stroke-opacity","strokeOpacity",X),f("stroke-width","strokeWidth",se),f("stroke-linejoin","strokeLineJoin"),f("stroke-linecap","strokeLineCap"),f("stroke-miterlimit","strokeMiterLimit",se),f("visibility","visibility"),C}function E(R,C){return R-(C-R)}function P(R,C,x){if(typeof R!="string")throw new TypeError("Invalid input: "+typeof R);let f={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/},X=0,se=1,V=2,ae=3,me=X,pe=!0,Q="",re="",we=[];function ye($e,Ht,hi){let wt=new SyntaxError('Unexpected character "'+$e+'" at index '+Ht+".");throw wt.partial=hi,wt}function I(){Q!==""&&(re===""?we.push(Number(Q)):we.push(Number(Q)*Math.pow(10,Number(re)))),Q="",re=""}let w,Se=R.length;for(let $e=0;$e<Se;$e++){if(w=R[$e],Array.isArray(C)&&C.includes(we.length%x)&&f.FLAGS.test(w)){me=se,Q=w,I();continue}if(me===X){if(f.WHITESPACE.test(w))continue;if(f.DIGIT.test(w)||f.SIGN.test(w)){me=se,Q=w;continue}if(f.POINT.test(w)){me=V,Q=w;continue}f.COMMA.test(w)&&(pe&&ye(w,$e,we),pe=!0)}if(me===se){if(f.DIGIT.test(w)){Q+=w;continue}if(f.POINT.test(w)){Q+=w,me=V;continue}if(f.EXP.test(w)){me=ae;continue}f.SIGN.test(w)&&Q.length===1&&f.SIGN.test(Q[0])&&ye(w,$e,we)}if(me===V){if(f.DIGIT.test(w)){Q+=w;continue}if(f.EXP.test(w)){me=ae;continue}f.POINT.test(w)&&Q[Q.length-1]==="."&&ye(w,$e,we)}if(me===ae){if(f.DIGIT.test(w)){re+=w;continue}if(f.SIGN.test(w)){if(re===""){re+=w;continue}re.length===1&&f.SIGN.test(re)&&ye(w,$e,we)}}f.WHITESPACE.test(w)?(I(),me=X,pe=!1):f.COMMA.test(w)?(I(),me=X,pe=!0):f.SIGN.test(w)?(I(),me=se,Q=w):f.POINT.test(w)?(I(),me=V,Q=w):ye(w,$e,we)}return I(),we}let $=["mm","cm","in","pt","pc","px"],ee={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function B(R){let C="px";if(typeof R=="string"||R instanceof String)for(let f=0,X=$.length;f<X;f++){let se=$[f];if(R.endsWith(se)){C=se,R=R.substring(0,R.length-se.length);break}}let x;return C==="px"&&e.defaultUnit!=="px"?x=ee.in[e.defaultUnit]/e.defaultDPI:(x=ee[C][e.defaultUnit],x<0&&(x=ee[C].in*e.defaultDPI)),x*parseFloat(R)}function j(R){if(!(R.hasAttribute("transform")||R.nodeName==="use"&&(R.hasAttribute("x")||R.hasAttribute("y"))))return null;let C=G(R);return Ee.length>0&&C.premultiply(Ee[Ee.length-1]),ct.copy(C),Ee.push(C),C}function G(R){let C=new Ro,x=Ve;if(R.nodeName==="use"&&(R.hasAttribute("x")||R.hasAttribute("y"))){let f=B(R.getAttribute("x")||0),X=B(R.getAttribute("y")||0);C.translate(f,X)}if(R.hasAttribute("transform")){let f=R.getAttribute("transform").split(")");for(let X=f.length-1;X>=0;X--){let se=f[X].trim();if(se==="")continue;let V=se.indexOf("("),ae=se.length;if(V>0&&V<ae){let me=se.slice(0,V),pe=P(se.slice(V+1));switch(x.identity(),me){case"translate":if(pe.length>=1){let Q=pe[0],re=0;pe.length>=2&&(re=pe[1]),x.translate(Q,re)}break;case"rotate":if(pe.length>=1){let Q=0,re=0,we=0;Q=pe[0]*Math.PI/180,pe.length>=3&&(re=pe[1],we=pe[2]),We.makeTranslation(-re,-we),ue.makeRotation(Q),J.multiplyMatrices(ue,We),We.makeTranslation(re,we),x.multiplyMatrices(We,J)}break;case"scale":if(pe.length>=1){let Q=pe[0],re=Q;pe.length>=2&&(re=pe[1]),x.scale(Q,re)}break;case"skewX":pe.length===1&&x.set(1,Math.tan(pe[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":pe.length===1&&x.set(1,0,0,Math.tan(pe[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":pe.length===6&&x.set(pe[0],pe[2],pe[4],pe[1],pe[3],pe[5],0,0,1);break}}C.premultiply(x)}}return C}function K(R,C){function x(V){Be.set(V.x,V.y,1).applyMatrix3(C),V.set(Be.x,Be.y)}function f(V){let ae=V.xRadius,me=V.yRadius,pe=Math.cos(V.aRotation),Q=Math.sin(V.aRotation),re=new Ye(ae*pe,ae*Q,0),we=new Ye(-me*Q,me*pe,0),ye=re.applyMatrix3(C),I=we.applyMatrix3(C),w=Ve.set(ye.x,I.x,0,ye.y,I.y,0,0,0,1),Se=We.copy(w).invert(),hi=ue.copy(Se).transpose().multiply(Se).elements,wt=He(hi[0],hi[1],hi[4]),Hi=Math.sqrt(wt.rt1),_a=Math.sqrt(wt.rt2);if(V.xRadius=1/Hi,V.yRadius=1/_a,V.aRotation=Math.atan2(wt.sn,wt.cs),!((V.aEndAngle-V.aStartAngle)%(2*Math.PI)<Number.EPSILON)){let Ea=We.set(Hi,0,0,0,_a,0,0,0,1),Nc=ue.set(wt.cs,wt.sn,0,-wt.sn,wt.cs,0,0,0,1),ka=Ea.multiply(Nc).multiply(w),vm=xm=>{let{x:Rx,y:Ax}=new Ye(Math.cos(xm),Math.sin(xm),0).applyMatrix3(ka);return Math.atan2(Ax,Rx)};V.aStartAngle=vm(V.aStartAngle),V.aEndAngle=vm(V.aEndAngle),ie(C)&&(V.aClockwise=!V.aClockwise)}}function X(V){let ae=ne(C),me=_e(C);V.xRadius*=ae,V.yRadius*=me;let pe=ae>Number.EPSILON?Math.atan2(C.elements[1],C.elements[0]):Math.atan2(-C.elements[3],C.elements[4]);V.aRotation+=pe,ie(C)&&(V.aStartAngle*=-1,V.aEndAngle*=-1,V.aClockwise=!V.aClockwise)}let se=R.subPaths;for(let V=0,ae=se.length;V<ae;V++){let pe=se[V].curves;for(let Q=0;Q<pe.length;Q++){let re=pe[Q];re.isLineCurve?(x(re.v1),x(re.v2)):re.isCubicBezierCurve?(x(re.v0),x(re.v1),x(re.v2),x(re.v3)):re.isQuadraticBezierCurve?(x(re.v0),x(re.v1),x(re.v2)):re.isEllipseCurve&&(Ue.set(re.aX,re.aY),x(Ue),re.aX=Ue.x,re.aY=Ue.y,oe(C)?f(re):X(re))}}}function ie(R){let C=R.elements;return C[0]*C[4]-C[1]*C[3]<0}function oe(R){let C=R.elements,x=C[0]*C[3]+C[1]*C[4];if(x===0)return!1;let f=ne(R),X=_e(R);return Math.abs(x/(f*X))>Number.EPSILON}function ne(R){let C=R.elements;return Math.sqrt(C[0]*C[0]+C[1]*C[1])}function _e(R){let C=R.elements;return Math.sqrt(C[3]*C[3]+C[4]*C[4])}function He(R,C,x){let f,X,se,V,ae,me=R+x,pe=R-x,Q=Math.sqrt(pe*pe+4*C*C);return me>0?(f=.5*(me+Q),ae=1/f,X=R*ae*x-C*ae*C):me<0?X=.5*(me-Q):(f=.5*Q,X=-.5*Q),pe>0?se=pe+Q:se=pe-Q,Math.abs(se)>2*Math.abs(C)?(ae=-2*C/se,V=1/Math.sqrt(1+ae*ae),se=ae*V):Math.abs(C)===0?(se=1,V=0):(ae=-.5*se/C,se=1/Math.sqrt(1+ae*ae),V=ae*se),pe>0&&(ae=se,se=-V,V=ae),{rt1:f,rt2:X,cs:se,sn:V}}let U=[],De={},Ee=[],Ve=new Ro,We=new Ro,ue=new Ro,J=new Ro,Ue=new Ge,Be=new Ye,ct=new Ro,zt=new DOMParser().parseFromString(n,"image/svg+xml");return i(zt.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:U,xml:zt.documentElement}}static createShapes(n){let i={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},o={loc:i.ORIGIN,t:0};function r(E,P,$,ee){let B=E.x,j=P.x,G=$.x,K=ee.x,ie=E.y,oe=P.y,ne=$.y,_e=ee.y,He=(K-G)*(ie-ne)-(_e-ne)*(B-G),U=(j-B)*(ie-ne)-(oe-ie)*(B-G),De=(_e-ne)*(j-B)-(K-G)*(oe-ie),Ee=He/De,Ve=U/De;if(De===0&&He!==0||Ee<=0||Ee>=1||Ve<0||Ve>1)return null;if(He===0&&De===0){for(let We=0;We<2;We++)if(a(We===0?$:ee,E,P),o.loc==i.ORIGIN){let ue=We===0?$:ee;return{x:ue.x,y:ue.y,t:o.t}}else if(o.loc==i.BETWEEN){let ue=+(B+o.t*(j-B)).toPrecision(10),J=+(ie+o.t*(oe-ie)).toPrecision(10);return{x:ue,y:J,t:o.t}}return null}else{for(let J=0;J<2;J++)if(a(J===0?$:ee,E,P),o.loc==i.ORIGIN){let Ue=J===0?$:ee;return{x:Ue.x,y:Ue.y,t:o.t}}let We=+(B+Ee*(j-B)).toPrecision(10),ue=+(ie+Ee*(oe-ie)).toPrecision(10);return{x:We,y:ue,t:Ee}}}function a(E,P,$){let ee=$.x-P.x,B=$.y-P.y,j=E.x-P.x,G=E.y-P.y,K=ee*G-j*B;if(E.x===P.x&&E.y===P.y){o.loc=i.ORIGIN,o.t=0;return}if(E.x===$.x&&E.y===$.y){o.loc=i.DESTINATION,o.t=1;return}if(K<-Number.EPSILON){o.loc=i.LEFT;return}if(K>Number.EPSILON){o.loc=i.RIGHT;return}if(ee*j<0||B*G<0){o.loc=i.BEHIND;return}if(Math.sqrt(ee*ee+B*B)<Math.sqrt(j*j+G*G)){o.loc=i.BEYOND;return}let ie;ee!==0?ie=j/ee:ie=G/B,o.loc=i.BETWEEN,o.t=ie}function s(E,P){let $=[],ee=[];for(let B=1;B<E.length;B++){let j=E[B-1],G=E[B];for(let K=1;K<P.length;K++){let ie=P[K-1],oe=P[K],ne=r(j,G,ie,oe);ne!==null&&$.find(_e=>_e.t<=ne.t+Number.EPSILON&&_e.t>=ne.t-Number.EPSILON)===void 0&&($.push(ne),ee.push(new Ge(ne.x,ne.y)))}}return ee}function l(E,P,$){let ee=new Ge;P.getCenter(ee);let B=[];return $.forEach(j=>{j.boundingBox.containsPoint(ee)&&s(E,j.points).forEach(K=>{B.push({identifier:j.identifier,isCW:j.isCW,point:K})})}),B.sort((j,G)=>j.point.x-G.point.x),B}function d(E,P,$,ee,B){(B==null||B==="")&&(B="nonzero");let j=new Ge;E.boundingBox.getCenter(j);let G=[new Ge($,j.y),new Ge(ee,j.y)],K=l(G,E.boundingBox,P);K.sort((U,De)=>U.point.x-De.point.x);let ie=[],oe=[];K.forEach(U=>{U.identifier===E.identifier?ie.push(U):oe.push(U)});let ne=ie[0].point.x,_e=[],He=0;for(;He<oe.length&&oe[He].point.x<ne;)_e.length>0&&_e[_e.length-1]===oe[He].identifier?_e.pop():_e.push(oe[He].identifier),He++;if(_e.push(E.identifier),B==="evenodd"){let U=_e.length%2===0,De=_e[_e.length-2];return{identifier:E.identifier,isHole:U,for:De}}else if(B==="nonzero"){let U=!0,De=null,Ee=null;for(let Ve=0;Ve<_e.length;Ve++){let We=_e[Ve];U?(Ee=P[We].isCW,U=!1,De=We):Ee!==P[We].isCW&&(Ee=P[We].isCW,U=!0)}return{identifier:E.identifier,isHole:U,for:De}}else console.warn('fill-rule: "'+B+'" is currently not implemented.')}let c=999999999,m=-999999999,p=n.subPaths.map(E=>{let P=E.getPoints(),$=-999999999,ee=999999999,B=-999999999,j=999999999;for(let G=0;G<P.length;G++){let K=P[G];K.y>$&&($=K.y),K.y<ee&&(ee=K.y),K.x>B&&(B=K.x),K.x<j&&(j=K.x)}return m<=B&&(m=B+1),c>=j&&(c=j-1),{curves:E.curves,points:P,isCW:iu.isClockWise(P),identifier:-1,boundingBox:new nu(new Ge(j,ee),new Ge(B,$))}});p=p.filter(E=>E.points.length>1);for(let E=0;E<p.length;E++)p[E].identifier=E;let u=p.map(E=>d(E,p,c,m,n.userData?n.userData.style.fillRule:void 0)),k=[];return p.forEach(E=>{if(!u[E.identifier].isHole){let $=new rs;$.curves=E.curves,u.filter(B=>B.isHole&&B.for===E.identifier).forEach(B=>{let j=p[B.identifier],G=new ns;G.curves=j.curves,$.holes.push(G)}),k.push($)}}),k}static getStrokeStyle(n,e,i,o,r){return n=n!==void 0?n:1,e=e!==void 0?e:"#000",i=i!==void 0?i:"miter",o=o!==void 0?o:"butt",r=r!==void 0?r:4,{strokeColor:e,strokeWidth:n,strokeLineJoin:i,strokeLineCap:o,strokeMiterLimit:r}}static pointsToStroke(n,e,i,o){let r=[],a=[],s=[];if(t.pointsToStrokeWithBuffers(n,e,i,o,r,a,s)===0)return null;let l=new Qt;return l.setAttribute("position",new Ao(r,3)),l.setAttribute("normal",new Ao(a,3)),l.setAttribute("uv",new Ao(s,2)),l}static pointsToStrokeWithBuffers(n,e,i,o,r,a,s,l){let d=new Ge,c=new Ge,m=new Ge,p=new Ge,u=new Ge,k=new Ge,E=new Ge,P=new Ge,$=new Ge,ee=new Ge,B=new Ge,j=new Ge,G=new Ge,K=new Ge,ie=new Ge,oe=new Ge,ne=new Ge;i=i!==void 0?i:12,o=o!==void 0?o:.001,l=l!==void 0?l:0,n=pe(n);let _e=n.length;if(_e<2)return 0;let He=n[0].equals(n[_e-1]),U,De=n[0],Ee,Ve=e.strokeWidth/2,We=1/(_e-1),ue=0,J,Ue,Be,ct,zt=!1,di=0,R=l*3,C=l*2;x(n[0],n[1],d).multiplyScalar(Ve),P.copy(n[0]).sub(d),$.copy(n[0]).add(d),ee.copy(P),B.copy($);for(let Q=1;Q<_e;Q++){U=n[Q],Q===_e-1?He?Ee=n[1]:Ee=void 0:Ee=n[Q+1];let re=d;if(x(De,U,re),m.copy(re).multiplyScalar(Ve),j.copy(U).sub(m),G.copy(U).add(m),J=ue+We,Ue=!1,Ee!==void 0){x(U,Ee,c),m.copy(c).multiplyScalar(Ve),K.copy(U).sub(m),ie.copy(U).add(m),Be=!0,m.subVectors(Ee,De),re.dot(m)<0&&(Be=!1),Q===1&&(zt=Be),m.subVectors(Ee,U),m.normalize();let we=Math.abs(re.dot(m));if(we>Number.EPSILON){let ye=Ve/we;m.multiplyScalar(-ye),p.subVectors(U,De),u.copy(p).setLength(ye).add(m),oe.copy(u).negate();let I=u.length(),w=p.length();p.divideScalar(w),k.subVectors(Ee,U);let Se=k.length();switch(k.divideScalar(Se),p.dot(oe)<w&&k.dot(oe)<Se&&(Ue=!0),ne.copy(u).add(U),oe.add(U),ct=!1,Ue?Be?(ie.copy(oe),G.copy(oe)):(K.copy(oe),j.copy(oe)):se(),e.strokeLineJoin){case"bevel":V(Be,Ue,J);break;case"round":ae(Be,Ue),Be?X(U,j,K,J,0):X(U,ie,G,J,1);break;default:let $e=Ve*e.strokeMiterLimit/I;if($e<1)if(e.strokeLineJoin!=="miter-clip"){V(Be,Ue,J);break}else ae(Be,Ue),Be?(k.subVectors(ne,j).multiplyScalar($e).add(j),E.subVectors(ne,K).multiplyScalar($e).add(K),f(j,J,0),f(k,J,0),f(U,J,.5),f(U,J,.5),f(k,J,0),f(E,J,0),f(U,J,.5),f(E,J,0),f(K,J,0)):(k.subVectors(ne,G).multiplyScalar($e).add(G),E.subVectors(ne,ie).multiplyScalar($e).add(ie),f(G,J,1),f(k,J,1),f(U,J,.5),f(U,J,.5),f(k,J,1),f(E,J,1),f(U,J,.5),f(E,J,1),f(ie,J,1));else Ue?(Be?(f($,ue,1),f(P,ue,0),f(ne,J,0),f($,ue,1),f(ne,J,0),f(oe,J,1)):(f($,ue,1),f(P,ue,0),f(ne,J,1),f(P,ue,0),f(oe,J,0),f(ne,J,1)),Be?K.copy(ne):ie.copy(ne)):Be?(f(j,J,0),f(ne,J,0),f(U,J,.5),f(U,J,.5),f(ne,J,0),f(K,J,0)):(f(G,J,1),f(ne,J,1),f(U,J,.5),f(U,J,.5),f(ne,J,1),f(ie,J,1)),ct=!0;break}}else se()}else se();!He&&Q===_e-1&&me(n[0],ee,B,Be,!0,ue),ue=J,De=U,P.copy(K),$.copy(ie)}if(!He)me(U,j,G,Be,!1,J);else if(Ue&&r){let Q=ne,re=oe;zt!==Be&&(Q=oe,re=ne),Be?(ct||zt)&&(re.toArray(r,0),re.toArray(r,9),ct&&Q.toArray(r,3)):(ct||!zt)&&(re.toArray(r,3),re.toArray(r,9),ct&&Q.toArray(r,0))}return di;function x(Q,re,we){return we.subVectors(re,Q),we.set(-we.y,we.x).normalize()}function f(Q,re,we){r&&(r[R]=Q.x,r[R+1]=Q.y,r[R+2]=0,a&&(a[R]=0,a[R+1]=0,a[R+2]=1),R+=3,s&&(s[C]=re,s[C+1]=we,C+=2)),di+=3}function X(Q,re,we,ye,I){d.copy(re).sub(Q).normalize(),c.copy(we).sub(Q).normalize();let w=Math.PI,Se=d.dot(c);Math.abs(Se)<1&&(w=Math.abs(Math.acos(Se))),w/=i,m.copy(re);for(let $e=0,Ht=i-1;$e<Ht;$e++)p.copy(m).rotateAround(Q,w),f(m,ye,I),f(p,ye,I),f(Q,ye,.5),m.copy(p);f(p,ye,I),f(we,ye,I),f(Q,ye,.5)}function se(){f($,ue,1),f(P,ue,0),f(j,J,0),f($,ue,1),f(j,J,0),f(G,J,1)}function V(Q,re,we){re?Q?(f($,ue,1),f(P,ue,0),f(j,J,0),f($,ue,1),f(j,J,0),f(oe,J,1),f(j,we,0),f(K,we,0),f(oe,we,.5)):(f($,ue,1),f(P,ue,0),f(G,J,1),f(P,ue,0),f(oe,J,0),f(G,J,1),f(G,we,1),f(oe,we,0),f(ie,we,1)):Q?(f(j,we,0),f(K,we,0),f(U,we,.5)):(f(G,we,1),f(ie,we,0),f(U,we,.5))}function ae(Q,re){re&&(Q?(f($,ue,1),f(P,ue,0),f(j,J,0),f($,ue,1),f(j,J,0),f(oe,J,1),f(j,ue,0),f(U,J,.5),f(oe,J,1),f(U,J,.5),f(K,ue,0),f(oe,J,1)):(f($,ue,1),f(P,ue,0),f(G,J,1),f(P,ue,0),f(oe,J,0),f(G,J,1),f(G,ue,1),f(oe,J,0),f(U,J,.5),f(U,J,.5),f(oe,J,0),f(ie,ue,1)))}function me(Q,re,we,ye,I,w){switch(e.strokeLineCap){case"round":I?X(Q,we,re,w,.5):X(Q,re,we,w,.5);break;case"square":if(I)d.subVectors(re,Q),c.set(d.y,-d.x),m.addVectors(d,c).add(Q),p.subVectors(c,d).add(Q),ye?(m.toArray(r,3),p.toArray(r,0),p.toArray(r,9)):(m.toArray(r,3),s[7]===1?p.toArray(r,9):m.toArray(r,9),p.toArray(r,0));else{d.subVectors(we,Q),c.set(d.y,-d.x),m.addVectors(d,c).add(Q),p.subVectors(c,d).add(Q);let Se=r.length;ye?(m.toArray(r,Se-3),p.toArray(r,Se-6),p.toArray(r,Se-12)):(p.toArray(r,Se-6),m.toArray(r,Se-3),p.toArray(r,Se-12))}break;default:break}}function pe(Q){let re=!1;for(let ye=1,I=Q.length-1;ye<I;ye++)if(Q[ye].distanceTo(Q[ye+1])<o){re=!0;break}if(!re)return Q;let we=[];we.push(Q[0]);for(let ye=1,I=Q.length-1;ye<I;ye++)Q[ye].distanceTo(Q[ye+1])>=o&&we.push(Q[ye]);return we.push(Q[Q.length-1]),we}}};var Jt=class{async create(n,e){let i=e.filePath,o=new ic;return new Promise((r,a)=>{o.load(i,function(s){let l=s.paths,d=[];for(let k of l){let E=k.toShapes(!0);for(let P of E){let $=new On(P,{depth:n.printHeight,bevelEnabled:!1});d.push($)}}let c=So(d);c.computeBoundingBox();let m=c.boundingBox.max.x-c.boundingBox.min.x,p=c.boundingBox.max.y-c.boundingBox.min.y,u=e.size/Math.max(m,p);c.scale(u,u,1),c.center(),e.side==="back"?c.rotateZ(Math.PI):(c.rotateZ(Math.PI),c.rotateY(Math.PI)),r(c)},void 0,function(s){console.error(`Error loading ${i}`),a(s)})})}};var oc=class extends Tt{constructor(n){super(n,new et,120,!0),this.name="BackMWLogo"}async init(n){let e=new Jt,i=.31;this.geometry=await e.create(n,{filePath:"./codeCharta/assets/mw_logo_text.svg",size:i,side:"back"});let o=0,r=.37,a=-n.baseplateHeight+n.printHeight/2;return this.position.set(o,r,a),this.updateColor(n.numberOfColors),this}};var nc=class extends Tt{constructor(n,e=new Jt){super(n,new et,180,!0),this.createSvgStrategy=e}async init(n){this.geometry=await this.createSvgStrategy.create(n,{filePath:"./codeCharta/assets/codecharta_logo.svg",size:.17,side:"back"});let i=0,o=.18-.17/2,r=-n.baseplateHeight+n.printHeight/2;return this.position.set(i,o,r),this.updateColor(n.numberOfColors),this}};var rc=class extends Kt{constructor(n,e){let i={font:e,text:"github.com/MaibornWolff/codecharta",side:"back",xPosition:0,yPosition:0,align:"center"};super(n,new et,200,!0,i)}};var ac=class{execute(n,e){if(n<4)return!1;let i=[1,0,0];return e.material.color.setRGB(i[0],i[1],i[2]),!0}};var sc=class{execute(n,e){if(n<4)return!1;let i=[1,1,0];return e.material.color.setRGB(i[0],i[1],i[2]),!0}};var lc=class{execute(n,e){if(n<4)return!1;let i=[0,1,0];return e.material.color.setRGB(i[0],i[1],i[2]),!0}};var Jo=class extends Tt{constructor(n,e,i){super(n.name,new et,200,!0),this.metricDescriptionBlockOptions=n,this.font=e,this.yOffset=i,this.createSvgGeometryStrategy=new Jt,this.createTextGeometryStrategy=new Sr}async init(n){let e=await this.createIconGeometry(this.createSvgGeometryStrategy,n),i=await this.createTextGeometry(this.createTextGeometryStrategy,this.getText(),n);return this.geometry=So([e,i]),this.position.y=-.15+this.yOffset,this.updateColor(n.numberOfColors),this}async createTextGeometry(n,e,i){return n.create(i,{font:this.font,text:e,side:"back",xPosition:.05,yPosition:0,align:"left"})}async createIconGeometry(n,e){let i=await n.create(e,{filePath:`./codeCharta/assets/${this.metricDescriptionBlockOptions.iconFilename}`,size:this.metricDescriptionBlockOptions.iconScale,side:"back"});return i.translate(0,0,-e.baseplateHeight+e.printHeight/2),i}getText(){return`${this.metricDescriptionBlockOptions.nodeMetricData.name}
|
|
3461
|
+
`),a=[];for(let[s,l]of r.entries()){let d=new ma(l,{font:e,size:i,depth:o});d.center(),d.translate(0,-s*i*1.5,0),a.push(d)}return yo(a)}};var Kt=class extends Tt{constructor(n,e=new et,i,o,r,a=new yr){super(n,e,i,o),this.createTextGeometryOptions=r,this.createTextGeometryStrategy=a}async init(n){return this.geometry=await this.createTextGeometryStrategy.create(n,this.createTextGeometryOptions),this.updateColor(n.numberOfColors),this}async updateText(n){this.geometry=await this.createTextGeometryStrategy.create(n,this.createTextGeometryOptions),this.boundingBoxCalculated=!1}updateTextGeometryOptions(n){this.createTextGeometryOptions.text=n}};var tc=class extends Kt{constructor(n,e){let i={font:e,text:`IT Stabilization & Modernization
|
|
3462
|
+
maibornwolff.de/service/it-sanierung`,side:"back",xPosition:0,yPosition:.23,align:"center"};super(n,new et,200,!0,i)}};var L8=Yp,ic=class t extends Oc{constructor(n){super(n),this.defaultDPI=90,this.defaultUnit="px"}load(n,e,i,o){let r=this,a=new zc(r.manager);a.setPath(r.path),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(n,function(s){try{e(r.parse(s))}catch(l){o?o(l):console.error(l),r.manager.itemError(n)}},i,o)}parse(n){let e=this;function i(R,C){if(R.nodeType!==1)return;let x=j(R),f=!1,X=null;switch(R.nodeName){case"svg":C=k(R,C);break;case"style":r(R);break;case"g":C=k(R,C);break;case"path":C=k(R,C),R.hasAttribute("d")&&(X=o(R));break;case"rect":C=k(R,C),X=l(R);break;case"polygon":C=k(R,C),X=d(R);break;case"polyline":C=k(R,C),X=c(R);break;case"circle":C=k(R,C),X=m(R);break;case"ellipse":C=k(R,C),X=p(R);break;case"line":C=k(R,C),X=u(R);break;case"defs":f=!0;break;case"use":C=k(R,C);let ae=(R.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),me=R.viewportElement.getElementById(ae);me?i(me,C):console.warn("SVGLoader: 'use node' references non-existent node id: "+ae);break;default:}X&&(C.fill!==void 0&&C.fill!=="none"&&X.color.setStyle(C.fill,L8),K(X,ct),U.push(X),X.userData={node:R,style:C});let se=R.childNodes;for(let V=0;V<se.length;V++){let ae=se[V];f&&ae.nodeName!=="style"&&ae.nodeName!=="defs"||i(ae,C)}x&&(Ee.pop(),Ee.length>0?ct.copy(Ee[Ee.length-1]):ct.identity())}function o(R){let C=new Ci,x=new Ge,f=new Ge,X=new Ge,se=!0,V=!1,ae=R.getAttribute("d");if(ae===""||ae==="none")return null;let me=ae.match(/[a-df-z][^a-df-z]*/ig);for(let pe=0,Q=me.length;pe<Q;pe++){let re=me[pe],we=re.charAt(0),Se=re.slice(1).trim();se===!0&&(V=!0,se=!1);let I;switch(we){case"M":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=2)x.x=I[w+0],x.y=I[w+1],f.x=x.x,f.y=x.y,w===0?C.moveTo(x.x,x.y):C.lineTo(x.x,x.y),w===0&&X.copy(x);break;case"H":I=P(Se);for(let w=0,ye=I.length;w<ye;w++)x.x=I[w],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"V":I=P(Se);for(let w=0,ye=I.length;w<ye;w++)x.y=I[w],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"L":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=2)x.x=I[w+0],x.y=I[w+1],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"C":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=6)C.bezierCurveTo(I[w+0],I[w+1],I[w+2],I[w+3],I[w+4],I[w+5]),f.x=I[w+2],f.y=I[w+3],x.x=I[w+4],x.y=I[w+5],w===0&&V===!0&&X.copy(x);break;case"S":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=4)C.bezierCurveTo(E(x.x,f.x),E(x.y,f.y),I[w+0],I[w+1],I[w+2],I[w+3]),f.x=I[w+0],f.y=I[w+1],x.x=I[w+2],x.y=I[w+3],w===0&&V===!0&&X.copy(x);break;case"Q":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=4)C.quadraticCurveTo(I[w+0],I[w+1],I[w+2],I[w+3]),f.x=I[w+0],f.y=I[w+1],x.x=I[w+2],x.y=I[w+3],w===0&&V===!0&&X.copy(x);break;case"T":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=2){let $e=E(x.x,f.x),Ht=E(x.y,f.y);C.quadraticCurveTo($e,Ht,I[w+0],I[w+1]),f.x=$e,f.y=Ht,x.x=I[w+0],x.y=I[w+1],w===0&&V===!0&&X.copy(x)}break;case"A":I=P(Se,[3,4],7);for(let w=0,ye=I.length;w<ye;w+=7){if(I[w+5]==x.x&&I[w+6]==x.y)continue;let $e=x.clone();x.x=I[w+5],x.y=I[w+6],f.x=x.x,f.y=x.y,a(C,I[w],I[w+1],I[w+2],I[w+3],I[w+4],$e,x),w===0&&V===!0&&X.copy(x)}break;case"m":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=2)x.x+=I[w+0],x.y+=I[w+1],f.x=x.x,f.y=x.y,w===0?C.moveTo(x.x,x.y):C.lineTo(x.x,x.y),w===0&&X.copy(x);break;case"h":I=P(Se);for(let w=0,ye=I.length;w<ye;w++)x.x+=I[w],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"v":I=P(Se);for(let w=0,ye=I.length;w<ye;w++)x.y+=I[w],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"l":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=2)x.x+=I[w+0],x.y+=I[w+1],f.x=x.x,f.y=x.y,C.lineTo(x.x,x.y),w===0&&V===!0&&X.copy(x);break;case"c":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=6)C.bezierCurveTo(x.x+I[w+0],x.y+I[w+1],x.x+I[w+2],x.y+I[w+3],x.x+I[w+4],x.y+I[w+5]),f.x=x.x+I[w+2],f.y=x.y+I[w+3],x.x+=I[w+4],x.y+=I[w+5],w===0&&V===!0&&X.copy(x);break;case"s":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=4)C.bezierCurveTo(E(x.x,f.x),E(x.y,f.y),x.x+I[w+0],x.y+I[w+1],x.x+I[w+2],x.y+I[w+3]),f.x=x.x+I[w+0],f.y=x.y+I[w+1],x.x+=I[w+2],x.y+=I[w+3],w===0&&V===!0&&X.copy(x);break;case"q":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=4)C.quadraticCurveTo(x.x+I[w+0],x.y+I[w+1],x.x+I[w+2],x.y+I[w+3]),f.x=x.x+I[w+0],f.y=x.y+I[w+1],x.x+=I[w+2],x.y+=I[w+3],w===0&&V===!0&&X.copy(x);break;case"t":I=P(Se);for(let w=0,ye=I.length;w<ye;w+=2){let $e=E(x.x,f.x),Ht=E(x.y,f.y);C.quadraticCurveTo($e,Ht,x.x+I[w+0],x.y+I[w+1]),f.x=$e,f.y=Ht,x.x=x.x+I[w+0],x.y=x.y+I[w+1],w===0&&V===!0&&X.copy(x)}break;case"a":I=P(Se,[3,4],7);for(let w=0,ye=I.length;w<ye;w+=7){if(I[w+5]==0&&I[w+6]==0)continue;let $e=x.clone();x.x+=I[w+5],x.y+=I[w+6],f.x=x.x,f.y=x.y,a(C,I[w],I[w+1],I[w+2],I[w+3],I[w+4],$e,x),w===0&&V===!0&&X.copy(x)}break;case"Z":case"z":C.currentPath.autoClose=!0,C.currentPath.curves.length>0&&(x.copy(X),C.currentPath.currentPoint.copy(x),se=!0);break;default:console.warn(re)}V=!1}return C}function r(R){if(!(!R.sheet||!R.sheet.cssRules||!R.sheet.cssRules.length))for(let C=0;C<R.sheet.cssRules.length;C++){let x=R.sheet.cssRules[C];if(x.type!==1)continue;let f=x.selectorText.split(/,/gm).filter(Boolean).map(X=>X.trim());for(let X=0;X<f.length;X++){let se=Object.fromEntries(Object.entries(x.style).filter(([,V])=>V!==""));De[f[X]]=Object.assign(De[f[X]]||{},se)}}}function a(R,C,x,f,X,se,V,ae){if(C==0||x==0){R.lineTo(ae.x,ae.y);return}f=f*Math.PI/180,C=Math.abs(C),x=Math.abs(x);let me=(V.x-ae.x)/2,pe=(V.y-ae.y)/2,Q=Math.cos(f)*me+Math.sin(f)*pe,re=-Math.sin(f)*me+Math.cos(f)*pe,we=C*C,Se=x*x,I=Q*Q,w=re*re,ye=I/we+w/Se;if(ye>1){let ka=Math.sqrt(ye);C=ka*C,x=ka*x,we=C*C,Se=x*x}let $e=we*w+Se*I,Ht=(we*Se-$e)/$e,hi=Math.sqrt(Math.max(0,Ht));X===se&&(hi=-hi);let wt=hi*C*re/x,Hi=-hi*x*Q/C,_a=Math.cos(f)*wt-Math.sin(f)*Hi+(V.x+ae.x)/2,bm=Math.sin(f)*wt+Math.cos(f)*Hi+(V.y+ae.y)/2,Ea=s(1,0,(Q-wt)/C,(re-Hi)/x),Nc=s((Q-wt)/C,(re-Hi)/x,(-Q-wt)/C,(-re-Hi)/x)%(Math.PI*2);R.currentPath.absellipse(_a,bm,C,x,Ea,Ea+Nc,se===0,f)}function s(R,C,x,f){let X=R*x+C*f,se=Math.sqrt(R*R+C*C)*Math.sqrt(x*x+f*f),V=Math.acos(Math.max(-1,Math.min(1,X/se)));return R*f-C*x<0&&(V=-V),V}function l(R){let C=B(R.getAttribute("x")||0),x=B(R.getAttribute("y")||0),f=B(R.getAttribute("rx")||R.getAttribute("ry")||0),X=B(R.getAttribute("ry")||R.getAttribute("rx")||0),se=B(R.getAttribute("width")),V=B(R.getAttribute("height")),ae=1-.551915024494,me=new Ci;return me.moveTo(C+f,x),me.lineTo(C+se-f,x),(f!==0||X!==0)&&me.bezierCurveTo(C+se-f*ae,x,C+se,x+X*ae,C+se,x+X),me.lineTo(C+se,x+V-X),(f!==0||X!==0)&&me.bezierCurveTo(C+se,x+V-X*ae,C+se-f*ae,x+V,C+se-f,x+V),me.lineTo(C+f,x+V),(f!==0||X!==0)&&me.bezierCurveTo(C+f*ae,x+V,C,x+V-X*ae,C,x+V-X),me.lineTo(C,x+X),(f!==0||X!==0)&&me.bezierCurveTo(C,x+X*ae,C+f*ae,x,C+f,x),me}function d(R){function C(se,V,ae){let me=B(V),pe=B(ae);X===0?f.moveTo(me,pe):f.lineTo(me,pe),X++}let x=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,f=new Ci,X=0;return R.getAttribute("points").replace(x,C),f.currentPath.autoClose=!0,f}function c(R){function C(se,V,ae){let me=B(V),pe=B(ae);X===0?f.moveTo(me,pe):f.lineTo(me,pe),X++}let x=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,f=new Ci,X=0;return R.getAttribute("points").replace(x,C),f.currentPath.autoClose=!1,f}function m(R){let C=B(R.getAttribute("cx")||0),x=B(R.getAttribute("cy")||0),f=B(R.getAttribute("r")||0),X=new ns;X.absarc(C,x,f,0,Math.PI*2);let se=new Ci;return se.subPaths.push(X),se}function p(R){let C=B(R.getAttribute("cx")||0),x=B(R.getAttribute("cy")||0),f=B(R.getAttribute("rx")||0),X=B(R.getAttribute("ry")||0),se=new ns;se.absellipse(C,x,f,X,0,Math.PI*2);let V=new Ci;return V.subPaths.push(se),V}function u(R){let C=B(R.getAttribute("x1")||0),x=B(R.getAttribute("y1")||0),f=B(R.getAttribute("x2")||0),X=B(R.getAttribute("y2")||0),se=new Ci;return se.moveTo(C,x),se.lineTo(f,X),se.currentPath.autoClose=!1,se}function k(R,C){C=Object.assign({},C);let x={};if(R.hasAttribute("class")){let V=R.getAttribute("class").split(/\s/).filter(Boolean).map(ae=>ae.trim());for(let ae=0;ae<V.length;ae++)x=Object.assign(x,De["."+V[ae]])}R.hasAttribute("id")&&(x=Object.assign(x,De["#"+R.getAttribute("id")]));function f(V,ae,me){me===void 0&&(me=function(Q){return Q.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),Q}),R.hasAttribute(V)&&(C[ae]=me(R.getAttribute(V))),x[ae]&&(C[ae]=me(x[ae])),R.style&&R.style[V]!==""&&(C[ae]=me(R.style[V]))}function X(V){return Math.max(0,Math.min(1,B(V)))}function se(V){return Math.max(0,B(V))}return f("fill","fill"),f("fill-opacity","fillOpacity",X),f("fill-rule","fillRule"),f("opacity","opacity",X),f("stroke","stroke"),f("stroke-opacity","strokeOpacity",X),f("stroke-width","strokeWidth",se),f("stroke-linejoin","strokeLineJoin"),f("stroke-linecap","strokeLineCap"),f("stroke-miterlimit","strokeMiterLimit",se),f("visibility","visibility"),C}function E(R,C){return R-(C-R)}function P(R,C,x){if(typeof R!="string")throw new TypeError("Invalid input: "+typeof R);let f={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/},X=0,se=1,V=2,ae=3,me=X,pe=!0,Q="",re="",we=[];function Se($e,Ht,hi){let wt=new SyntaxError('Unexpected character "'+$e+'" at index '+Ht+".");throw wt.partial=hi,wt}function I(){Q!==""&&(re===""?we.push(Number(Q)):we.push(Number(Q)*Math.pow(10,Number(re)))),Q="",re=""}let w,ye=R.length;for(let $e=0;$e<ye;$e++){if(w=R[$e],Array.isArray(C)&&C.includes(we.length%x)&&f.FLAGS.test(w)){me=se,Q=w,I();continue}if(me===X){if(f.WHITESPACE.test(w))continue;if(f.DIGIT.test(w)||f.SIGN.test(w)){me=se,Q=w;continue}if(f.POINT.test(w)){me=V,Q=w;continue}f.COMMA.test(w)&&(pe&&Se(w,$e,we),pe=!0)}if(me===se){if(f.DIGIT.test(w)){Q+=w;continue}if(f.POINT.test(w)){Q+=w,me=V;continue}if(f.EXP.test(w)){me=ae;continue}f.SIGN.test(w)&&Q.length===1&&f.SIGN.test(Q[0])&&Se(w,$e,we)}if(me===V){if(f.DIGIT.test(w)){Q+=w;continue}if(f.EXP.test(w)){me=ae;continue}f.POINT.test(w)&&Q[Q.length-1]==="."&&Se(w,$e,we)}if(me===ae){if(f.DIGIT.test(w)){re+=w;continue}if(f.SIGN.test(w)){if(re===""){re+=w;continue}re.length===1&&f.SIGN.test(re)&&Se(w,$e,we)}}f.WHITESPACE.test(w)?(I(),me=X,pe=!1):f.COMMA.test(w)?(I(),me=X,pe=!0):f.SIGN.test(w)?(I(),me=se,Q=w):f.POINT.test(w)?(I(),me=V,Q=w):Se(w,$e,we)}return I(),we}let $=["mm","cm","in","pt","pc","px"],ee={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function B(R){let C="px";if(typeof R=="string"||R instanceof String)for(let f=0,X=$.length;f<X;f++){let se=$[f];if(R.endsWith(se)){C=se,R=R.substring(0,R.length-se.length);break}}let x;return C==="px"&&e.defaultUnit!=="px"?x=ee.in[e.defaultUnit]/e.defaultDPI:(x=ee[C][e.defaultUnit],x<0&&(x=ee[C].in*e.defaultDPI)),x*parseFloat(R)}function j(R){if(!(R.hasAttribute("transform")||R.nodeName==="use"&&(R.hasAttribute("x")||R.hasAttribute("y"))))return null;let C=G(R);return Ee.length>0&&C.premultiply(Ee[Ee.length-1]),ct.copy(C),Ee.push(C),C}function G(R){let C=new Ro,x=Ve;if(R.nodeName==="use"&&(R.hasAttribute("x")||R.hasAttribute("y"))){let f=B(R.getAttribute("x")||0),X=B(R.getAttribute("y")||0);C.translate(f,X)}if(R.hasAttribute("transform")){let f=R.getAttribute("transform").split(")");for(let X=f.length-1;X>=0;X--){let se=f[X].trim();if(se==="")continue;let V=se.indexOf("("),ae=se.length;if(V>0&&V<ae){let me=se.slice(0,V),pe=P(se.slice(V+1));switch(x.identity(),me){case"translate":if(pe.length>=1){let Q=pe[0],re=0;pe.length>=2&&(re=pe[1]),x.translate(Q,re)}break;case"rotate":if(pe.length>=1){let Q=0,re=0,we=0;Q=pe[0]*Math.PI/180,pe.length>=3&&(re=pe[1],we=pe[2]),We.makeTranslation(-re,-we),ue.makeRotation(Q),J.multiplyMatrices(ue,We),We.makeTranslation(re,we),x.multiplyMatrices(We,J)}break;case"scale":if(pe.length>=1){let Q=pe[0],re=Q;pe.length>=2&&(re=pe[1]),x.scale(Q,re)}break;case"skewX":pe.length===1&&x.set(1,Math.tan(pe[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":pe.length===1&&x.set(1,0,0,Math.tan(pe[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":pe.length===6&&x.set(pe[0],pe[2],pe[4],pe[1],pe[3],pe[5],0,0,1);break}}C.premultiply(x)}}return C}function K(R,C){function x(V){Be.set(V.x,V.y,1).applyMatrix3(C),V.set(Be.x,Be.y)}function f(V){let ae=V.xRadius,me=V.yRadius,pe=Math.cos(V.aRotation),Q=Math.sin(V.aRotation),re=new Ye(ae*pe,ae*Q,0),we=new Ye(-me*Q,me*pe,0),Se=re.applyMatrix3(C),I=we.applyMatrix3(C),w=Ve.set(Se.x,I.x,0,Se.y,I.y,0,0,0,1),ye=We.copy(w).invert(),hi=ue.copy(ye).transpose().multiply(ye).elements,wt=He(hi[0],hi[1],hi[4]),Hi=Math.sqrt(wt.rt1),_a=Math.sqrt(wt.rt2);if(V.xRadius=1/Hi,V.yRadius=1/_a,V.aRotation=Math.atan2(wt.sn,wt.cs),!((V.aEndAngle-V.aStartAngle)%(2*Math.PI)<Number.EPSILON)){let Ea=We.set(Hi,0,0,0,_a,0,0,0,1),Nc=ue.set(wt.cs,wt.sn,0,-wt.sn,wt.cs,0,0,0,1),ka=Ea.multiply(Nc).multiply(w),vm=xm=>{let{x:Rx,y:Ax}=new Ye(Math.cos(xm),Math.sin(xm),0).applyMatrix3(ka);return Math.atan2(Ax,Rx)};V.aStartAngle=vm(V.aStartAngle),V.aEndAngle=vm(V.aEndAngle),ie(C)&&(V.aClockwise=!V.aClockwise)}}function X(V){let ae=ne(C),me=_e(C);V.xRadius*=ae,V.yRadius*=me;let pe=ae>Number.EPSILON?Math.atan2(C.elements[1],C.elements[0]):Math.atan2(-C.elements[3],C.elements[4]);V.aRotation+=pe,ie(C)&&(V.aStartAngle*=-1,V.aEndAngle*=-1,V.aClockwise=!V.aClockwise)}let se=R.subPaths;for(let V=0,ae=se.length;V<ae;V++){let pe=se[V].curves;for(let Q=0;Q<pe.length;Q++){let re=pe[Q];re.isLineCurve?(x(re.v1),x(re.v2)):re.isCubicBezierCurve?(x(re.v0),x(re.v1),x(re.v2),x(re.v3)):re.isQuadraticBezierCurve?(x(re.v0),x(re.v1),x(re.v2)):re.isEllipseCurve&&(Ue.set(re.aX,re.aY),x(Ue),re.aX=Ue.x,re.aY=Ue.y,oe(C)?f(re):X(re))}}}function ie(R){let C=R.elements;return C[0]*C[4]-C[1]*C[3]<0}function oe(R){let C=R.elements,x=C[0]*C[3]+C[1]*C[4];if(x===0)return!1;let f=ne(R),X=_e(R);return Math.abs(x/(f*X))>Number.EPSILON}function ne(R){let C=R.elements;return Math.sqrt(C[0]*C[0]+C[1]*C[1])}function _e(R){let C=R.elements;return Math.sqrt(C[3]*C[3]+C[4]*C[4])}function He(R,C,x){let f,X,se,V,ae,me=R+x,pe=R-x,Q=Math.sqrt(pe*pe+4*C*C);return me>0?(f=.5*(me+Q),ae=1/f,X=R*ae*x-C*ae*C):me<0?X=.5*(me-Q):(f=.5*Q,X=-.5*Q),pe>0?se=pe+Q:se=pe-Q,Math.abs(se)>2*Math.abs(C)?(ae=-2*C/se,V=1/Math.sqrt(1+ae*ae),se=ae*V):Math.abs(C)===0?(se=1,V=0):(ae=-.5*se/C,se=1/Math.sqrt(1+ae*ae),V=ae*se),pe>0&&(ae=se,se=-V,V=ae),{rt1:f,rt2:X,cs:se,sn:V}}let U=[],De={},Ee=[],Ve=new Ro,We=new Ro,ue=new Ro,J=new Ro,Ue=new Ge,Be=new Ye,ct=new Ro,zt=new DOMParser().parseFromString(n,"image/svg+xml");return i(zt.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:U,xml:zt.documentElement}}static createShapes(n){let i={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},o={loc:i.ORIGIN,t:0};function r(E,P,$,ee){let B=E.x,j=P.x,G=$.x,K=ee.x,ie=E.y,oe=P.y,ne=$.y,_e=ee.y,He=(K-G)*(ie-ne)-(_e-ne)*(B-G),U=(j-B)*(ie-ne)-(oe-ie)*(B-G),De=(_e-ne)*(j-B)-(K-G)*(oe-ie),Ee=He/De,Ve=U/De;if(De===0&&He!==0||Ee<=0||Ee>=1||Ve<0||Ve>1)return null;if(He===0&&De===0){for(let We=0;We<2;We++)if(a(We===0?$:ee,E,P),o.loc==i.ORIGIN){let ue=We===0?$:ee;return{x:ue.x,y:ue.y,t:o.t}}else if(o.loc==i.BETWEEN){let ue=+(B+o.t*(j-B)).toPrecision(10),J=+(ie+o.t*(oe-ie)).toPrecision(10);return{x:ue,y:J,t:o.t}}return null}else{for(let J=0;J<2;J++)if(a(J===0?$:ee,E,P),o.loc==i.ORIGIN){let Ue=J===0?$:ee;return{x:Ue.x,y:Ue.y,t:o.t}}let We=+(B+Ee*(j-B)).toPrecision(10),ue=+(ie+Ee*(oe-ie)).toPrecision(10);return{x:We,y:ue,t:Ee}}}function a(E,P,$){let ee=$.x-P.x,B=$.y-P.y,j=E.x-P.x,G=E.y-P.y,K=ee*G-j*B;if(E.x===P.x&&E.y===P.y){o.loc=i.ORIGIN,o.t=0;return}if(E.x===$.x&&E.y===$.y){o.loc=i.DESTINATION,o.t=1;return}if(K<-Number.EPSILON){o.loc=i.LEFT;return}if(K>Number.EPSILON){o.loc=i.RIGHT;return}if(ee*j<0||B*G<0){o.loc=i.BEHIND;return}if(Math.sqrt(ee*ee+B*B)<Math.sqrt(j*j+G*G)){o.loc=i.BEYOND;return}let ie;ee!==0?ie=j/ee:ie=G/B,o.loc=i.BETWEEN,o.t=ie}function s(E,P){let $=[],ee=[];for(let B=1;B<E.length;B++){let j=E[B-1],G=E[B];for(let K=1;K<P.length;K++){let ie=P[K-1],oe=P[K],ne=r(j,G,ie,oe);ne!==null&&$.find(_e=>_e.t<=ne.t+Number.EPSILON&&_e.t>=ne.t-Number.EPSILON)===void 0&&($.push(ne),ee.push(new Ge(ne.x,ne.y)))}}return ee}function l(E,P,$){let ee=new Ge;P.getCenter(ee);let B=[];return $.forEach(j=>{j.boundingBox.containsPoint(ee)&&s(E,j.points).forEach(K=>{B.push({identifier:j.identifier,isCW:j.isCW,point:K})})}),B.sort((j,G)=>j.point.x-G.point.x),B}function d(E,P,$,ee,B){(B==null||B==="")&&(B="nonzero");let j=new Ge;E.boundingBox.getCenter(j);let G=[new Ge($,j.y),new Ge(ee,j.y)],K=l(G,E.boundingBox,P);K.sort((U,De)=>U.point.x-De.point.x);let ie=[],oe=[];K.forEach(U=>{U.identifier===E.identifier?ie.push(U):oe.push(U)});let ne=ie[0].point.x,_e=[],He=0;for(;He<oe.length&&oe[He].point.x<ne;)_e.length>0&&_e[_e.length-1]===oe[He].identifier?_e.pop():_e.push(oe[He].identifier),He++;if(_e.push(E.identifier),B==="evenodd"){let U=_e.length%2===0,De=_e[_e.length-2];return{identifier:E.identifier,isHole:U,for:De}}else if(B==="nonzero"){let U=!0,De=null,Ee=null;for(let Ve=0;Ve<_e.length;Ve++){let We=_e[Ve];U?(Ee=P[We].isCW,U=!1,De=We):Ee!==P[We].isCW&&(Ee=P[We].isCW,U=!0)}return{identifier:E.identifier,isHole:U,for:De}}else console.warn('fill-rule: "'+B+'" is currently not implemented.')}let c=999999999,m=-999999999,p=n.subPaths.map(E=>{let P=E.getPoints(),$=-999999999,ee=999999999,B=-999999999,j=999999999;for(let G=0;G<P.length;G++){let K=P[G];K.y>$&&($=K.y),K.y<ee&&(ee=K.y),K.x>B&&(B=K.x),K.x<j&&(j=K.x)}return m<=B&&(m=B+1),c>=j&&(c=j-1),{curves:E.curves,points:P,isCW:iu.isClockWise(P),identifier:-1,boundingBox:new nu(new Ge(j,ee),new Ge(B,$))}});p=p.filter(E=>E.points.length>1);for(let E=0;E<p.length;E++)p[E].identifier=E;let u=p.map(E=>d(E,p,c,m,n.userData?n.userData.style.fillRule:void 0)),k=[];return p.forEach(E=>{if(!u[E.identifier].isHole){let $=new rs;$.curves=E.curves,u.filter(B=>B.isHole&&B.for===E.identifier).forEach(B=>{let j=p[B.identifier],G=new ns;G.curves=j.curves,$.holes.push(G)}),k.push($)}}),k}static getStrokeStyle(n,e,i,o,r){return n=n!==void 0?n:1,e=e!==void 0?e:"#000",i=i!==void 0?i:"miter",o=o!==void 0?o:"butt",r=r!==void 0?r:4,{strokeColor:e,strokeWidth:n,strokeLineJoin:i,strokeLineCap:o,strokeMiterLimit:r}}static pointsToStroke(n,e,i,o){let r=[],a=[],s=[];if(t.pointsToStrokeWithBuffers(n,e,i,o,r,a,s)===0)return null;let l=new Qt;return l.setAttribute("position",new Ao(r,3)),l.setAttribute("normal",new Ao(a,3)),l.setAttribute("uv",new Ao(s,2)),l}static pointsToStrokeWithBuffers(n,e,i,o,r,a,s,l){let d=new Ge,c=new Ge,m=new Ge,p=new Ge,u=new Ge,k=new Ge,E=new Ge,P=new Ge,$=new Ge,ee=new Ge,B=new Ge,j=new Ge,G=new Ge,K=new Ge,ie=new Ge,oe=new Ge,ne=new Ge;i=i!==void 0?i:12,o=o!==void 0?o:.001,l=l!==void 0?l:0,n=pe(n);let _e=n.length;if(_e<2)return 0;let He=n[0].equals(n[_e-1]),U,De=n[0],Ee,Ve=e.strokeWidth/2,We=1/(_e-1),ue=0,J,Ue,Be,ct,zt=!1,di=0,R=l*3,C=l*2;x(n[0],n[1],d).multiplyScalar(Ve),P.copy(n[0]).sub(d),$.copy(n[0]).add(d),ee.copy(P),B.copy($);for(let Q=1;Q<_e;Q++){U=n[Q],Q===_e-1?He?Ee=n[1]:Ee=void 0:Ee=n[Q+1];let re=d;if(x(De,U,re),m.copy(re).multiplyScalar(Ve),j.copy(U).sub(m),G.copy(U).add(m),J=ue+We,Ue=!1,Ee!==void 0){x(U,Ee,c),m.copy(c).multiplyScalar(Ve),K.copy(U).sub(m),ie.copy(U).add(m),Be=!0,m.subVectors(Ee,De),re.dot(m)<0&&(Be=!1),Q===1&&(zt=Be),m.subVectors(Ee,U),m.normalize();let we=Math.abs(re.dot(m));if(we>Number.EPSILON){let Se=Ve/we;m.multiplyScalar(-Se),p.subVectors(U,De),u.copy(p).setLength(Se).add(m),oe.copy(u).negate();let I=u.length(),w=p.length();p.divideScalar(w),k.subVectors(Ee,U);let ye=k.length();switch(k.divideScalar(ye),p.dot(oe)<w&&k.dot(oe)<ye&&(Ue=!0),ne.copy(u).add(U),oe.add(U),ct=!1,Ue?Be?(ie.copy(oe),G.copy(oe)):(K.copy(oe),j.copy(oe)):se(),e.strokeLineJoin){case"bevel":V(Be,Ue,J);break;case"round":ae(Be,Ue),Be?X(U,j,K,J,0):X(U,ie,G,J,1);break;default:let $e=Ve*e.strokeMiterLimit/I;if($e<1)if(e.strokeLineJoin!=="miter-clip"){V(Be,Ue,J);break}else ae(Be,Ue),Be?(k.subVectors(ne,j).multiplyScalar($e).add(j),E.subVectors(ne,K).multiplyScalar($e).add(K),f(j,J,0),f(k,J,0),f(U,J,.5),f(U,J,.5),f(k,J,0),f(E,J,0),f(U,J,.5),f(E,J,0),f(K,J,0)):(k.subVectors(ne,G).multiplyScalar($e).add(G),E.subVectors(ne,ie).multiplyScalar($e).add(ie),f(G,J,1),f(k,J,1),f(U,J,.5),f(U,J,.5),f(k,J,1),f(E,J,1),f(U,J,.5),f(E,J,1),f(ie,J,1));else Ue?(Be?(f($,ue,1),f(P,ue,0),f(ne,J,0),f($,ue,1),f(ne,J,0),f(oe,J,1)):(f($,ue,1),f(P,ue,0),f(ne,J,1),f(P,ue,0),f(oe,J,0),f(ne,J,1)),Be?K.copy(ne):ie.copy(ne)):Be?(f(j,J,0),f(ne,J,0),f(U,J,.5),f(U,J,.5),f(ne,J,0),f(K,J,0)):(f(G,J,1),f(ne,J,1),f(U,J,.5),f(U,J,.5),f(ne,J,1),f(ie,J,1)),ct=!0;break}}else se()}else se();!He&&Q===_e-1&&me(n[0],ee,B,Be,!0,ue),ue=J,De=U,P.copy(K),$.copy(ie)}if(!He)me(U,j,G,Be,!1,J);else if(Ue&&r){let Q=ne,re=oe;zt!==Be&&(Q=oe,re=ne),Be?(ct||zt)&&(re.toArray(r,0),re.toArray(r,9),ct&&Q.toArray(r,3)):(ct||!zt)&&(re.toArray(r,3),re.toArray(r,9),ct&&Q.toArray(r,0))}return di;function x(Q,re,we){return we.subVectors(re,Q),we.set(-we.y,we.x).normalize()}function f(Q,re,we){r&&(r[R]=Q.x,r[R+1]=Q.y,r[R+2]=0,a&&(a[R]=0,a[R+1]=0,a[R+2]=1),R+=3,s&&(s[C]=re,s[C+1]=we,C+=2)),di+=3}function X(Q,re,we,Se,I){d.copy(re).sub(Q).normalize(),c.copy(we).sub(Q).normalize();let w=Math.PI,ye=d.dot(c);Math.abs(ye)<1&&(w=Math.abs(Math.acos(ye))),w/=i,m.copy(re);for(let $e=0,Ht=i-1;$e<Ht;$e++)p.copy(m).rotateAround(Q,w),f(m,Se,I),f(p,Se,I),f(Q,Se,.5),m.copy(p);f(p,Se,I),f(we,Se,I),f(Q,Se,.5)}function se(){f($,ue,1),f(P,ue,0),f(j,J,0),f($,ue,1),f(j,J,0),f(G,J,1)}function V(Q,re,we){re?Q?(f($,ue,1),f(P,ue,0),f(j,J,0),f($,ue,1),f(j,J,0),f(oe,J,1),f(j,we,0),f(K,we,0),f(oe,we,.5)):(f($,ue,1),f(P,ue,0),f(G,J,1),f(P,ue,0),f(oe,J,0),f(G,J,1),f(G,we,1),f(oe,we,0),f(ie,we,1)):Q?(f(j,we,0),f(K,we,0),f(U,we,.5)):(f(G,we,1),f(ie,we,0),f(U,we,.5))}function ae(Q,re){re&&(Q?(f($,ue,1),f(P,ue,0),f(j,J,0),f($,ue,1),f(j,J,0),f(oe,J,1),f(j,ue,0),f(U,J,.5),f(oe,J,1),f(U,J,.5),f(K,ue,0),f(oe,J,1)):(f($,ue,1),f(P,ue,0),f(G,J,1),f(P,ue,0),f(oe,J,0),f(G,J,1),f(G,ue,1),f(oe,J,0),f(U,J,.5),f(U,J,.5),f(oe,J,0),f(ie,ue,1)))}function me(Q,re,we,Se,I,w){switch(e.strokeLineCap){case"round":I?X(Q,we,re,w,.5):X(Q,re,we,w,.5);break;case"square":if(I)d.subVectors(re,Q),c.set(d.y,-d.x),m.addVectors(d,c).add(Q),p.subVectors(c,d).add(Q),Se?(m.toArray(r,3),p.toArray(r,0),p.toArray(r,9)):(m.toArray(r,3),s[7]===1?p.toArray(r,9):m.toArray(r,9),p.toArray(r,0));else{d.subVectors(we,Q),c.set(d.y,-d.x),m.addVectors(d,c).add(Q),p.subVectors(c,d).add(Q);let ye=r.length;Se?(m.toArray(r,ye-3),p.toArray(r,ye-6),p.toArray(r,ye-12)):(p.toArray(r,ye-6),m.toArray(r,ye-3),p.toArray(r,ye-12))}break;default:break}}function pe(Q){let re=!1;for(let Se=1,I=Q.length-1;Se<I;Se++)if(Q[Se].distanceTo(Q[Se+1])<o){re=!0;break}if(!re)return Q;let we=[];we.push(Q[0]);for(let Se=1,I=Q.length-1;Se<I;Se++)Q[Se].distanceTo(Q[Se+1])>=o&&we.push(Q[Se]);return we.push(Q[Q.length-1]),we}}};var Jt=class{async create(n,e){let i=e.filePath,o=new ic;return new Promise((r,a)=>{o.load(i,function(s){let l=s.paths,d=[];for(let k of l){let E=k.toShapes(!0);for(let P of E){let $=new On(P,{depth:n.printHeight,bevelEnabled:!1});d.push($)}}let c=yo(d);c.computeBoundingBox();let m=c.boundingBox.max.x-c.boundingBox.min.x,p=c.boundingBox.max.y-c.boundingBox.min.y,u=e.size/Math.max(m,p);c.scale(u,u,1),c.center(),e.side==="back"?c.rotateZ(Math.PI):(c.rotateZ(Math.PI),c.rotateY(Math.PI)),r(c)},void 0,function(s){console.error(`Error loading ${i}`),a(s)})})}};var oc=class extends Tt{constructor(n){super(n,new et,120,!0),this.name="BackMWLogo"}async init(n){let e=new Jt,i=.31;this.geometry=await e.create(n,{filePath:"./codeCharta/assets/mw_logo_text.svg",size:i,side:"back"});let o=0,r=.37,a=-n.baseplateHeight+n.printHeight/2;return this.position.set(o,r,a),this.updateColor(n.numberOfColors),this}};var nc=class extends Tt{constructor(n,e=new Jt){super(n,new et,180,!0),this.createSvgStrategy=e}async init(n){this.geometry=await this.createSvgStrategy.create(n,{filePath:"./codeCharta/assets/codecharta_logo.svg",size:.17,side:"back"});let i=0,o=.18-.17/2,r=-n.baseplateHeight+n.printHeight/2;return this.position.set(i,o,r),this.updateColor(n.numberOfColors),this}};var rc=class extends Kt{constructor(n,e){let i={font:e,text:"github.com/MaibornWolff/codecharta",side:"back",xPosition:0,yPosition:0,align:"center"};super(n,new et,200,!0,i)}};var ac=class{execute(n,e){if(n<4)return!1;let i=[1,0,0];return e.material.color.setRGB(i[0],i[1],i[2]),!0}};var sc=class{execute(n,e){if(n<4)return!1;let i=[1,1,0];return e.material.color.setRGB(i[0],i[1],i[2]),!0}};var lc=class{execute(n,e){if(n<4)return!1;let i=[0,1,0];return e.material.color.setRGB(i[0],i[1],i[2]),!0}};var Jo=class extends Tt{constructor(n,e,i){super(n.name,new et,200,!0),this.metricDescriptionBlockOptions=n,this.font=e,this.yOffset=i,this.createSvgGeometryStrategy=new Jt,this.createTextGeometryStrategy=new yr}async init(n){let e=await this.createIconGeometry(this.createSvgGeometryStrategy,n),i=await this.createTextGeometry(this.createTextGeometryStrategy,this.getText(),n);return this.geometry=yo([e,i]),this.position.y=-.15+this.yOffset,this.updateColor(n.numberOfColors),this}async createTextGeometry(n,e,i){return n.create(i,{font:this.font,text:e,side:"back",xPosition:.05,yPosition:0,align:"left"})}async createIconGeometry(n,e){let i=await n.create(e,{filePath:`./codeCharta/assets/${this.metricDescriptionBlockOptions.iconFilename}`,size:this.metricDescriptionBlockOptions.iconScale,side:"back"});return i.translate(0,0,-e.baseplateHeight+e.printHeight/2),i}getText(){return`${this.metricDescriptionBlockOptions.nodeMetricData.name}
|
|
3450
3463
|
${this.metricDescriptionBlockOptions.title}
|
|
3451
3464
|
Value range: ${this.metricDescriptionBlockOptions.nodeMetricData.minValue} - ${this.metricDescriptionBlockOptions.nodeMetricData.maxValue}`}};var cc=class extends Jo{constructor(n,e,i){super(n,e,i)}async init(n){let e=await this.createColoredBackTextChildren(n);for(let i of e)this.add(i);return super.init(n),this}async createTextGeometry(n,e,i){return n.create(i,{font:this.font,text:e,side:"back",xPosition:.05,yPosition:.015,align:"left"})}getText(){return`${this.metricDescriptionBlockOptions.nodeMetricData.name}
|
|
3452
3465
|
${this.metricDescriptionBlockOptions.title}
|
|
3453
|
-
`}async createColoredBackTextChildren(n){let e=this.metricDescriptionBlockOptions,i=[],o=["Value ranges:",`${e.nodeMetricData.minValue} - ${e.colorRange.from-1}`,"/",`${e.colorRange.from} - ${e.colorRange.to-1}`,"/",`${e.colorRange.to} - ${e.nodeMetricData.maxValue}`],r=[new et,new lc,new et,new sc,new et,new ac],a=.05;for(let s=0;s<o.length;s+=1){let l=`ColorMetricLastLine${s}`,d={font:this.font,text:o[s],side:"back",xPosition:a,yPosition:-.045,align:"left"},c=await new Kt(l,r[s],200,!0,d).init(n);this.updateColor(n.numberOfColors),i.push(c),s!==o.length-1&&(a+=c.getWidth()+.03)}return i}};var dc=class extends xt{constructor(n,e){super(n,new et),this.font=e}async init(n){let{areaIcon:e,areaIconScale:i}=this.createAreaAttributes(),{heightIcon:o,heightIconScale:r}=this.createHeightAttributes(),{colorIcon:a,colorIconScale:s}=this.createColorAttributes(),l=await new Jo({name:"HeigthMetricBlock",title:n.heightMetricTitle,iconFilename:o,iconScale:r,nodeMetricData:n.heightMetricData},this.font,.05).init(n);this.add(l);let d=await new Jo({name:"AreaMetricBlock",title:n.areaMetricTitle,iconFilename:e,iconScale:i,nodeMetricData:n.areaMetricData},this.font,-.1).init(n);this.add(d);let c=await new cc({name:"ColorMetricBlock",title:n.colorMetricTitle,iconFilename:a,iconScale:s,nodeMetricData:n.colorMetricData,colorRange:n.colorRange},this.font,-.25).init(n);return this.add(c),this.centerMetricsMeshInXDirection(),this}centerMetricsMeshInXDirection(){let n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};this.traverse(e=>{if(e instanceof st&&e.visible){e.geometry.computeBoundingBox();let{min:i,max:o}=e.geometry.boundingBox;n.min=Math.min(n.min,i.x),n.max=Math.max(n.max,o.x)}}),this.position.x=(n.max-n.min)/2}createColorAttributes(){return{colorIcon:"color_icon_for_3D_print.svg",colorIconScale:.075}}createHeightAttributes(){return{heightIcon:"height_icon_for_3D_print.svg",heightIconScale:.09}}createAreaAttributes(){return{areaIcon:"area_icon_for_3D_print.svg",areaIconScale:.075}}};var Iv=qa(Tv());var Sc=class extends Tt{constructor(n){super(n,new et,0,!1)}async init(n){this.geometry=await this.create(n);let e=.45,i=.45,o=-n.baseplateHeight+n.printHeight/2;return this.position.set(e,i,o),this.updateColor(n.numberOfColors),this}async changeText(n){this.geometry=await this.create(n)}async create(n){if(!n.qrCodeText||n.qrCodeText.length===0)return new Qt;let e=document.createElement("canvas");await Iv.toCanvas(e,n.qrCodeText,{errorCorrectionLevel:"H"});let o=e.getContext("2d").getImageData(0,0,e.width,e.height),r=[],a=.6/o.width;for(let s=0;s<o.height;s+=4)for(let l=0;l<o.width;l+=4){let d=(s*o.width+l)*4;if(o.data[d]!==0){let c=new ro(a,a,n.printHeight);c.translate(-l/4*a,-s/4*a,0),r.push(c)}}return this.updateMinWidth(a),So(r)}updateMinWidth(n){this.minWidth=.6/n}};var Cc=class extends xt{constructor(n){let e=new et;super("BackPrintContainer",e),this.font=n}async init(n){return this.childrenMeshes=new Map,this.childrenMeshes.set("BackMWLogo",new oc("BackMWLogo")),this.childrenMeshes.set("BackBelowLogoText",new tc("BackBelowLogoText",this.font)),this.childrenMeshes.set("QrCode",new Sc("QrCode")),this.childrenMeshes.set("CodeChartaLogo",new nc("CodeChartaLogo")),this.childrenMeshes.set("CodeChartaText",new rc("CodeChartaText",this.font)),this.childrenMeshes.set("MetricDescriptionsContainer",new dc("MetricDescriptionsContainer",this.font)),await Promise.all([...this.childrenMeshes.values()].map(async e=>{await e.init(n),this.add(e)})),this.changeSize(n,1),this}changeSize(n,e){let i=n.width/e;this.scale.set(this.scale.x*i,this.scale.y*i,this.scale.z),this.traverse(o=>{o instanceof Tt&&o.setCurrentWidth(n.width)})}isQRCodeVisible(){return this.childrenMeshes.get("QrCode").visible}async updateQrCodeText(n,e){e.qrCodeText=n,await this.childrenMeshes.get("QrCode").changeText(e)}updateQrCodeVisibility(n){this.childrenMeshes.get("QrCode").setManualVisibility(n)}getChildrenMeshes(){return this.childrenMeshes}};var Mc=class{execute(n,e){let i=e.material;return i.defaultAttributeValues.color=n===1?[1,1,1]:[.5,.5,.5],!0}};var _c=class{async create(n){let{width:e,secondRowVisible:i,mapSideOffset:o,baseplateHeight:r,frontTextSize:a,secondRowTextSize:s}=n,l=5,d=Math.sqrt(2*Math.pow(o,2))/(Math.sqrt(2)-1)-1;d<l&&(l=d);let c=new rs,m=i?s*1.5:0,p=e+a+m;c.absarc(e-l,l,l,Math.PI*1.5,Math.PI*2,!1),c.absarc(e-l,p-l,l,0,Math.PI*.5,!1),c.absarc(l,p-l,l,Math.PI*.5,Math.PI,!1),c.absarc(l,l,l,Math.PI,Math.PI*1.5,!1);let u=new On(c,{depth:r,bevelEnabled:!1});return u.translate(-e/2,-e/2-a-m,-r),u}};var Ec=class extends xt{constructor(n=new _c){super("Baseplate",new Mc),this.createBaseplateGeometryStrategy=n}async init(n){this.createBaseplateGeometryStrategy.create(n).then(i=>{this.geometry=i});let e=new Kp;return e.copy(n.defaultMaterial),e.polygonOffset=!0,e.polygonOffsetUnits=1,e.polygonOffsetFactor=.1,this.material=e,this.updateColor(n.numberOfColors),new Promise(i=>{i(this)})}changeSize(n){this.boundingBoxCalculated=!1,this.createBaseplateGeometryStrategy.create(n).then(e=>{this.geometry=e})}};var ko=class{execute(n,e){let i;return n<4?i=[1,1,1]:n===4?i=[1,1,0]:i=[1,1,1],e.material.color.setRGB(i[0],i[1],i[2]),!0}};var qo=class extends xt{constructor(n,e){super(n,new ko),this.alignment=e}changeRelativeSize(n){let e=this.getWidth();this.boundingBoxCalculated=!1;let i=n.secondRowVisible,o=i?(n.frontTextSize+n.secondRowTextSize)/n.frontTextSize:1;this.scale.x=o,this.scale.y=o;let r=i?-1:1,a=this.alignment==="left"?-1:1;this.translateY(r*n.secondRowTextSize);let s=i?e/this.getWidth():this.getWidth()/e;this.translateX(2*s*a*r)}};var kc=class extends qo{constructor(n,e){super(n,"left"),this.filePath=e}async init(n){let e=new Jt,i=n.frontTextSize*n.width/200;this.geometry=await e.create(n,{filePath:this.filePath,size:i,side:"front"});let o=-n.width/2+i/2+n.mapSideOffset/2,r=i/2,a=n.printHeight/2;return this.position.set(o,r,a),n.secondRowVisible&&this.changeRelativeSize(n),this.updateColor(n.numberOfColors),this}setColor(n){this.material.color.set(n)}rotate(){this.geometry.rotateZ(Math.PI/2)}flip(){this.geometry.rotateY(Math.PI)}changeSize(n,e){this.position.x-=(n.width-e)/2}};var qc=class extends qo{constructor(n){super(n,"right")}async init(n,e=new Jt){let i=n.frontTextSize*n.width/250;this.geometry=await e.create(n,{filePath:"./codeCharta/assets/mw_logo.svg",size:i,side:"front"});let o=n.width/2-i/2-n.mapSideOffset/2,r=i/2,a=n.printHeight/2;return this.position.set(o,r,a),n.secondRowVisible&&this.changeRelativeSize(n),this.updateColor(n.numberOfColors),this}changeSize(n,e){this.position.x+=(n.width-e)/2}};var Tc=class extends Kt{constructor(n,e,i){let o=i.frontText;o||(o="FrontText");let r={font:e,side:"front",text:o,xPosition:0,yPosition:i.frontTextSize/2,textSize:i.frontTextSize,align:"center"};super(n,new ko,0,!0,r),this.name="Front Text"}};var Ic=class extends Kt{constructor(n,e,i){let o={font:e,text:i.secondRowText,side:"front",xPosition:0,yPosition:-i.secondRowTextSize,textSize:i.secondRowTextSize,align:"center"};super(n,new ko,0,!1,o)}};var Dc=class extends xt{constructor(n){let e=new et;super("FrontPrintContainer",e),this.font=n}async init(n){return this.childrenMeshes=new Map,this.childrenMeshes.set("FrontText",new Tc("FrontText",this.font,n)),this.childrenMeshes.set("SecondRowText",new Ic("SecondRowText",this.font,n)),this.childrenMeshes.set("FrontMWLogo",new qc("FrontMWLogo")),await Promise.all([...this.childrenMeshes.values()].map(async e=>{await e.init(n),this.add(e)})),this.position.y=-n.width/2-n.mapSideOffset/2,this}async addCustomLogo(n,e){this.childrenMeshes.has("CustomLogo")&&this.removeCustomLogo();let i=await new kc("CustomLogo",n).init(e);this.add(i),this.childrenMeshes.set(i.name,i)}rotateCustomLogo(){this.childrenMeshes.get("CustomLogo").rotate()}flipCustomLogo(){this.childrenMeshes.get("CustomLogo").flip()}removeCustomLogo(){this.remove(this.childrenMeshes.get("CustomLogo")),this.childrenMeshes.delete("CustomLogo")}updateCustomLogoColor(n){this.childrenMeshes.get("CustomLogo").setColor(n)}async updateFrontText(n,e){let i=this.childrenMeshes.get("FrontText");i.updateTextGeometryOptions(n),await i.updateText(e)}changeSize(n,e){this.position.y-=(n.width-e)/2;for(let i of this.childrenMeshes.values())i instanceof qo&&i.isGeneralSizeChangeMesh()&&i.changeSize(n,e)}async updateSecondRowText(n,e){let i=this.childrenMeshes.get("SecondRowText");i.updateTextGeometryOptions(n),await i.updateText(e)}updateSecondRowVisibility(n){let e=this.childrenMeshes.get("FrontMWLogo"),i=this.childrenMeshes.get("SecondRowText"),o=this.childrenMeshes.get("CustomLogo");i.setManualVisibility(n.secondRowVisible),e.changeRelativeSize(n),o?.changeRelativeSize(n)}getChildrenMeshes(){return this.childrenMeshes}};var Rc=class extends Tt{constructor(){super("Map",new et,1,!1)}async init(n){this.material=n.originalMapMesh.clone().material,this.originalColors=n.originalMapMesh.geometry.attributes.color;let e=n.originalMapMesh.geometry.clone();return this.addBottomFaces(e),e.computeBoundingBox(),e.rotateX(Math.PI/2),this.updateMapGeometry(n,e),e.computeBoundingBox(),e.rotateZ(-Math.PI/2),this.geometry=e,this}updateMapGeometry(n,e){let i=n.width-2*n.mapSideOffset,o=e.boundingBox.max.x,r=i/o;return e.scale(r,r,r),e.translate(-i/2,i/2,0),this.updateMapColors(this.originalColors,e,n.numberOfColors),e}updateMapColors(n,e,i){let o=[];for(let r=0;r<n.count;r++){let a=n.getX(r),s=n.getY(r),l=n.getZ(r),d;a===l&&a===s&&s===l?d=i===1?[1,1,1]:[.5,.5,.5]:a>.75&&s>.75?d=i<4?[1,1,1]:[1,1,0]:a>.45&&s<.1?d=i<4?[1,1,1]:[1,0,0]:a<5&&s>.6?d=i<4?[1,1,1]:[0,1,0]:(console.error("Unknown color"),d=[1,1,1]),o.push(...d)}e.setAttribute("color",new Ao(o,3))}addBottomFaces(n){let e=n.index;if(!e)return;let i=24,o=6,r=8,a=e.count/_u,s=new Uint32Array(e.count+a*o);s.set(new Uint32Array(e.array.buffer,e.array.byteOffset,e.count));let l=e.count;for(let d=0;d<a;d++){let c=d*i+r;s[l++]=c,s[l++]=c+2,s[l++]=c+1,s[l++]=c,s[l++]=c+3,s[l++]=c+2}n.setIndex(new no(s,1))}async changeSize(n,e){let i=(n.width-2*n.mapSideOffset)/(e-2*n.mapSideOffset);this.geometry.scale(i,i,i)}updateColor(n){this.updateMapColors(this.originalColors,this.geometry,n)}};var Ac=class{constructor(n,e=new Dc(new ha(Lh)),i=new Cc(new ha(Lh)),o=new Ec,r=new Rc){this.geometryOptions=n,this.frontPrintContainerMesh=e,this.backPrintContainerMesh=i,this.baseplateMesh=o,this.mapMesh=r,this.printMesh=new st,this.printMesh.name="PrintMesh"}async initialize(){this.baseplateMesh=await this.baseplateMesh.init(this.geometryOptions),this.printMesh.add(this.baseplateMesh),this.mapMesh=await this.mapMesh.init(this.geometryOptions),this.printMesh.add(this.mapMesh),this.frontPrintContainerMesh=await this.frontPrintContainerMesh.init(this.geometryOptions),this.printMesh.add(this.frontPrintContainerMesh),this.backPrintContainerMesh=await this.backPrintContainerMesh.init(this.geometryOptions),this.printMesh.add(this.backPrintContainerMesh),this.calculateCurrentSize()}getThreeMesh(){return this.printMesh}getMapMesh(){return this.mapMesh}getSize(){return this.currentSize}async updateSize(n){this.geometryOptions.width=n;let e=this.currentSize.x;return await Promise.all([...this.printMesh.children].map(async i=>{i instanceof xt&&i.isGeneralSizeChangeMesh()&&i.changeSize(this.geometryOptions,e)})),this.calculateCurrentSize(),this.backPrintContainerMesh.isQRCodeVisible()}updateNumberOfColors(n){this.geometryOptions.numberOfColors=n;for(let e of this.printMesh.children)e instanceof xt&&e.updateColor(n)}async addCustomLogo(n){this.frontPrintContainerMesh.addCustomLogo(n,this.geometryOptions)}rotateCustomLogo(){this.frontPrintContainerMesh.rotateCustomLogo()}flipCustomLogo(){this.frontPrintContainerMesh.flipCustomLogo()}removeCustomLogo(){this.frontPrintContainerMesh.removeCustomLogo()}updateCustomLogoColor(n){this.frontPrintContainerMesh.updateCustomLogoColor(n)}updateFrontText(n){this.frontPrintContainerMesh.updateFrontText(n,this.geometryOptions)}updateSecondRowVisibility(n){this.geometryOptions.secondRowVisible!==n&&(this.geometryOptions.secondRowVisible=n,this.frontPrintContainerMesh.updateSecondRowVisibility(this.geometryOptions),this.baseplateMesh.changeSize(this.geometryOptions))}async updateSecondRowText(n){await this.frontPrintContainerMesh.updateSecondRowText(n,this.geometryOptions)}calculateCurrentSize(){let n=this.baseplateMesh.getWidth(),e=this.baseplateMesh.getDepth(),i=this.baseplateMesh.getHeight()+this.mapMesh.getHeight();this.currentSize=new Ye(n,e,i)}async updateQrCodeText(n){await this.backPrintContainerMesh.updateQrCodeText(n,this.geometryOptions)}updateQrCodeVisibility(n){this.backPrintContainerMesh.updateQrCodeVisibility(n)}};function rm(t,n,e,i,o){let r=t.x,a=t.y,s=t.z,l=r,d=a-e;n.geometry.boundingBox||n.geometry.computeBoundingBox();let c=n.geometry.boundingBox.max.z-n.geometry.boundingBox.min.z,m=(s-i)*n.geometry.boundingBox.max.x/c+2*o;return Math.min(l,d,m)}var _t=Uint8Array,jt=Uint16Array,hm=Int32Array,mm=new _t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),pm=new _t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Dv=new _t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nv=function(t,n){for(var e=new jt(31),i=0;i<31;++i)e[i]=n+=1<<t[i-1];for(var o=new hm(e[30]),i=1;i<30;++i)for(var r=e[i];r<e[i+1];++r)o[r]=r-e[i]<<5|i;return{b:e,r:o}},Bv=Nv(mm,2),T7=Bv.b,sm=Bv.r;T7[28]=258,sm[258]=28;var Vv=Nv(pm,0),hJ=Vv.b,Rv=Vv.r,lm=new jt(32768);for(Qe=0;Qe<32768;++Qe)$i=(Qe&43690)>>1|(Qe&21845)<<1,$i=($i&52428)>>2|($i&13107)<<2,$i=($i&61680)>>4|($i&3855)<<4,lm[Qe]=(($i&65280)>>8|($i&255)<<8)>>1;var $i,Qe,Ca=function(t,n,e){for(var i=t.length,o=0,r=new jt(n);o<i;++o)t[o]&&++r[t[o]-1];var a=new jt(n);for(o=1;o<n;++o)a[o]=a[o-1]+r[o-1]<<1;var s;if(e){s=new jt(1<<n);var l=15-n;for(o=0;o<i;++o)if(t[o])for(var d=o<<4|t[o],c=n-t[o],m=a[t[o]-1]++<<c,p=m|(1<<c)-1;m<=p;++m)s[lm[m]>>l]=d}else for(s=new jt(i),o=0;o<i;++o)t[o]&&(s[o]=lm[a[t[o]-1]++]>>15-t[o]);return s},rn=new _t(288);for(Qe=0;Qe<144;++Qe)rn[Qe]=8;var Qe;for(Qe=144;Qe<256;++Qe)rn[Qe]=9;var Qe;for(Qe=256;Qe<280;++Qe)rn[Qe]=7;var Qe;for(Qe=280;Qe<288;++Qe)rn[Qe]=8;var Qe,Fc=new _t(32);for(Qe=0;Qe<32;++Qe)Fc[Qe]=5;var Qe,I7=Ca(rn,9,0);var D7=Ca(Fc,5,0);var Wv=function(t){return(t+7)/8|0},Ov=function(t,n,e){return(n==null||n<0)&&(n=0),(e==null||e>t.length)&&(e=t.length),new _t(t.subarray(n,e))};var R7=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Lc=function(t,n,e){var i=new Error(n||R7[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,Lc),!e)throw i;return i};var ji=function(t,n,e){e<<=n&7;var i=n/8|0;t[i]|=e,t[i+1]|=e>>8},ya=function(t,n,e){e<<=n&7;var i=n/8|0;t[i]|=e,t[i+1]|=e>>8,t[i+2]|=e>>16},am=function(t,n){for(var e=[],i=0;i<t.length;++i)t[i]&&e.push({s:i,f:t[i]});var o=e.length,r=e.slice();if(!o)return{t:$v,l:0};if(o==1){var a=new _t(e[0].s+1);return a[e[0].s]=1,{t:a,l:1}}e.sort(function(G,K){return G.f-K.f}),e.push({s:-1,f:25001});var s=e[0],l=e[1],d=0,c=1,m=2;for(e[0]={s:-1,f:s.f+l.f,l:s,r:l};c!=o-1;)s=e[e[d].f<e[m].f?d++:m++],l=e[d!=c&&e[d].f<e[m].f?d++:m++],e[c++]={s:-1,f:s.f+l.f,l:s,r:l};for(var p=r[0].s,i=1;i<o;++i)r[i].s>p&&(p=r[i].s);var u=new jt(p+1),k=cm(e[c-1],u,0);if(k>n){var i=0,E=0,P=k-n,$=1<<P;for(r.sort(function(K,ie){return u[ie.s]-u[K.s]||K.f-ie.f});i<o;++i){var ee=r[i].s;if(u[ee]>n)E+=$-(1<<k-u[ee]),u[ee]=n;else break}for(E>>=P;E>0;){var B=r[i].s;u[B]<n?E-=1<<n-u[B]++-1:++i}for(;i>=0&&E;--i){var j=r[i].s;u[j]==n&&(--u[j],++E)}k=n}return{t:new _t(u),l:k}},cm=function(t,n,e){return t.s==-1?Math.max(cm(t.l,n,e+1),cm(t.r,n,e+1)):n[t.s]=e},Av=function(t){for(var n=t.length;n&&!t[--n];);for(var e=new jt(++n),i=0,o=t[0],r=1,a=function(l){e[i++]=l},s=1;s<=n;++s)if(t[s]==o&&s!=n)++r;else{if(!o&&r>2){for(;r>138;r-=138)a(32754);r>2&&(a(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(a(o),--r;r>6;r-=6)a(8304);r>2&&(a(r-3<<5|8208),r=0)}for(;r--;)a(o);r=1,o=t[s]}return{c:e.subarray(0,i),n}},Sa=function(t,n){for(var e=0,i=0;i<n.length;++i)e+=t[i]*n[i];return e},zv=function(t,n,e){var i=e.length,o=Wv(n+2);t[o]=i&255,t[o+1]=i>>8,t[o+2]=t[o]^255,t[o+3]=t[o+1]^255;for(var r=0;r<i;++r)t[o+r+4]=e[r];return(o+4+i)*8},Fv=function(t,n,e,i,o,r,a,s,l,d,c){ji(n,c++,e),++o[256];for(var m=am(o,15),p=m.t,u=m.l,k=am(r,15),E=k.t,P=k.l,$=Av(p),ee=$.c,B=$.n,j=Av(E),G=j.c,K=j.n,ie=new jt(19),oe=0;oe<ee.length;++oe)++ie[ee[oe]&31];for(var oe=0;oe<G.length;++oe)++ie[G[oe]&31];for(var ne=am(ie,7),_e=ne.t,He=ne.l,U=19;U>4&&!_e[Dv[U-1]];--U);var De=d+5<<3,Ee=Sa(o,rn)+Sa(r,Fc)+a,Ve=Sa(o,p)+Sa(r,E)+a+14+3*U+Sa(ie,_e)+2*ie[16]+3*ie[17]+7*ie[18];if(l>=0&&De<=Ee&&De<=Ve)return zv(n,c,t.subarray(l,l+d));var We,ue,J,Ue;if(ji(n,c,1+(Ve<Ee)),c+=2,Ve<Ee){We=Ca(p,u,0),ue=p,J=Ca(E,P,0),Ue=E;var Be=Ca(_e,He,0);ji(n,c,B-257),ji(n,c+5,K-1),ji(n,c+10,U-4),c+=14;for(var oe=0;oe<U;++oe)ji(n,c+3*oe,_e[Dv[oe]]);c+=3*U;for(var ct=[ee,G],zt=0;zt<2;++zt)for(var di=ct[zt],oe=0;oe<di.length;++oe){var R=di[oe]&31;ji(n,c,Be[R]),c+=_e[R],R>15&&(ji(n,c,di[oe]>>5&127),c+=di[oe]>>12)}}else We=I7,ue=rn,J=D7,Ue=Fc;for(var oe=0;oe<s;++oe){var C=i[oe];if(C>255){var R=C>>18&31;ya(n,c,We[R+257]),c+=ue[R+257],R>7&&(ji(n,c,C>>23&31),c+=mm[R]);var x=C&31;ya(n,c,J[x]),c+=Ue[x],x>3&&(ya(n,c,C>>5&8191),c+=pm[x])}else ya(n,c,We[C]),c+=ue[C]}return ya(n,c,We[256]),c+ue[256]},A7=new hm([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$v=new _t(0),F7=function(t,n,e,i,o,r){var a=r.z||t.length,s=new _t(i+a+5*(1+Math.ceil(a/7e3))+o),l=s.subarray(i,s.length-o),d=r.l,c=(r.r||0)&7;if(n){c&&(l[0]=r.r>>3);for(var m=A7[n-1],p=m>>13,u=m&8191,k=(1<<e)-1,E=r.p||new jt(32768),P=r.h||new jt(k+1),$=Math.ceil(e/3),ee=2*$,B=function(Q){return(t[Q]^t[Q+1]<<$^t[Q+2]<<ee)&k},j=new hm(25e3),G=new jt(288),K=new jt(32),ie=0,oe=0,ne=r.i||0,_e=0,He=r.w||0,U=0;ne+2<a;++ne){var De=B(ne),Ee=ne&32767,Ve=P[De];if(E[Ee]=Ve,P[De]=Ee,He<=ne){var We=a-ne;if((ie>7e3||_e>24576)&&(We>423||!d)){c=Fv(t,l,0,j,G,K,oe,_e,U,ne-U,c),_e=ie=oe=0,U=ne;for(var ue=0;ue<286;++ue)G[ue]=0;for(var ue=0;ue<30;++ue)K[ue]=0}var J=2,Ue=0,Be=u,ct=Ee-Ve&32767;if(We>2&&De==B(ne-ct))for(var zt=Math.min(p,We)-1,di=Math.min(32767,ne),R=Math.min(258,We);ct<=di&&--Be&&Ee!=Ve;){if(t[ne+J]==t[ne+J-ct]){for(var C=0;C<R&&t[ne+C]==t[ne+C-ct];++C);if(C>J){if(J=C,Ue=ct,C>zt)break;for(var x=Math.min(ct,C-2),f=0,ue=0;ue<x;++ue){var X=ne-ct+ue&32767,se=E[X],V=X-se&32767;V>f&&(f=V,Ve=X)}}}Ee=Ve,Ve=E[Ee],ct+=Ee-Ve&32767}if(Ue){j[_e++]=268435456|sm[J]<<18|Rv[Ue];var ae=sm[J]&31,me=Rv[Ue]&31;oe+=mm[ae]+pm[me],++G[257+ae],++K[me],He=ne+J,++ie}else j[_e++]=t[ne],++G[t[ne]]}}for(ne=Math.max(ne,He);ne<a;++ne)j[_e++]=t[ne],++G[t[ne]];c=Fv(t,l,d,j,G,K,oe,_e,U,ne-U,c),d||(r.r=c&7|l[c/8|0]<<3,c-=7,r.h=P,r.p=E,r.i=ne,r.w=He)}else{for(var ne=r.w||0;ne<a+d;ne+=65535){var pe=ne+65535;pe>=a&&(l[c/8|0]=d,pe=a),c=zv(l,c+1,t.subarray(ne,pe))}r.i=a}return Ov(s,0,i+Wv(c)+o)},L7=(function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var e=n,i=9;--i;)e=(e&1&&-306674912)^e>>>1;t[n]=e}return t})(),P7=function(){var t=-1;return{p:function(n){for(var e=t,i=0;i<n.length;++i)e=L7[e&255^n[i]]^e>>>8;t=e},d:function(){return~t}}};var N7=function(t,n,e,i,o){if(!o&&(o={l:1},n.dictionary)){var r=n.dictionary.subarray(-32768),a=new _t(r.length+t.length);a.set(r),a.set(t,r.length),t=a,o.w=r.length}return F7(t,n.level==null?6:n.level,n.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+n.mem,e,i,o)},jv=function(t,n){var e={};for(var i in t)e[i]=t[i];for(var i in n)e[i]=n[i];return e};var Mt=function(t,n,e){for(;e;++n)t[n]=e,e>>>=8};function B7(t,n){return N7(t,n||{},0,0)}var Hv=function(t,n,e,i){for(var o in t){var r=t[o],a=n+o,s=i;Array.isArray(r)&&(s=jv(i,r[1]),r=r[0]),r instanceof _t?e[a]=[r,s]:(e[a+="/"]=[new _t(0),s],Hv(r,a,e,i))}},Lv=typeof TextEncoder<"u"&&new TextEncoder,V7=typeof TextDecoder<"u"&&new TextDecoder,W7=0;try{V7.decode($v,{stream:!0}),W7=1}catch{}function an(t,n){if(n){for(var e=new _t(t.length),i=0;i<t.length;++i)e[i]=t.charCodeAt(i);return e}if(Lv)return Lv.encode(t);for(var o=t.length,r=new _t(t.length+(t.length>>1)),a=0,s=function(c){r[a++]=c},i=0;i<o;++i){if(a+5>r.length){var l=new _t(a+8+(o-i<<1));l.set(r),r=l}var d=t.charCodeAt(i);d<128||n?s(d):d<2048?(s(192|d>>6),s(128|d&63)):d>55295&&d<57344?(d=65536+(d&1047552)|t.charCodeAt(++i)&1023,s(240|d>>18),s(128|d>>12&63),s(128|d>>6&63),s(128|d&63)):(s(224|d>>12),s(128|d>>6&63),s(128|d&63))}return Ov(r,0,a)}var dm=function(t){var n=0;if(t)for(var e in t){var i=t[e].length;i>65535&&Lc(9),n+=i+4}return n},Pv=function(t,n,e,i,o,r,a,s){var l=i.length,d=e.extra,c=s&&s.length,m=dm(d);Mt(t,n,a!=null?33639248:67324752),n+=4,a!=null&&(t[n++]=20,t[n++]=e.os),t[n]=20,n+=2,t[n++]=e.flag<<1|(r<0&&8),t[n++]=o&&8,t[n++]=e.compression&255,t[n++]=e.compression>>8;var p=new Date(e.mtime==null?Date.now():e.mtime),u=p.getFullYear()-1980;if((u<0||u>119)&&Lc(10),Mt(t,n,u<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),n+=4,r!=-1&&(Mt(t,n,e.crc),Mt(t,n+4,r<0?-r-2:r),Mt(t,n+8,e.size)),Mt(t,n+12,l),Mt(t,n+14,m),n+=16,a!=null&&(Mt(t,n,c),Mt(t,n+6,e.attrs),Mt(t,n+10,a),n+=14),t.set(i,n),n+=l,m)for(var k in d){var E=d[k],P=E.length;Mt(t,n,+k),Mt(t,n+2,P),t.set(E,n+4),n+=4+P}return c&&(t.set(s,n),n+=c),n},O7=function(t,n,e,i,o){Mt(t,n,101010256),Mt(t,n+8,e),Mt(t,n+10,e),Mt(t,n+12,i),Mt(t,n+16,o)};function Uv(t,n){n||(n={});var e={},i=[];Hv(t,"",e,n);var o=0,r=0;for(var a in e){var s=e[a],l=s[0],d=s[1],c=d.level==0?0:8,m=an(a),p=m.length,u=d.comment,k=u&&an(u),E=k&&k.length,P=dm(d.extra);p>65535&&Lc(11);var $=c?B7(l,d):l,ee=$.length,B=P7();B.p(l),i.push(jv(d,{size:l.length,crc:B.d(),c:$,f:m,m:k,u:p!=a.length||k&&u.length!=E,o,compression:c})),o+=30+p+P+ee,r+=76+2*(p+P)+(E||0)+ee}for(var j=new _t(r+22),G=o,K=r-o,ie=0;ie<i.length;++ie){var m=i[ie];Pv(j,m.o,m,m.f,m.u,m.c.length);var oe=30+m.f.length+dm(m.extra);j.set(m.c,m.o+oe),Pv(j,o,m,m.f,m.u,m.c.length,m.o,m.m),o+=16+oe+(m.m?m.m.length:0)}return O7(j,o,i.length,K,G),j}function Gv(t,n){let e=z7(),i=$7(t),o=j7(n),r=H7();return e+i+o+r}function z7(){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
3466
|
+
`}async createColoredBackTextChildren(n){let e=this.metricDescriptionBlockOptions,i=[],o=["Value ranges:",`${e.nodeMetricData.minValue} - ${e.colorRange.from-1}`,"/",`${e.colorRange.from} - ${e.colorRange.to-1}`,"/",`${e.colorRange.to} - ${e.nodeMetricData.maxValue}`],r=[new et,new lc,new et,new sc,new et,new ac],a=.05;for(let s=0;s<o.length;s+=1){let l=`ColorMetricLastLine${s}`,d={font:this.font,text:o[s],side:"back",xPosition:a,yPosition:-.045,align:"left"},c=await new Kt(l,r[s],200,!0,d).init(n);this.updateColor(n.numberOfColors),i.push(c),s!==o.length-1&&(a+=c.getWidth()+.03)}return i}};var dc=class extends xt{constructor(n,e){super(n,new et),this.font=e}async init(n){let{areaIcon:e,areaIconScale:i}=this.createAreaAttributes(),{heightIcon:o,heightIconScale:r}=this.createHeightAttributes(),{colorIcon:a,colorIconScale:s}=this.createColorAttributes(),l=await new Jo({name:"HeigthMetricBlock",title:n.heightMetricTitle,iconFilename:o,iconScale:r,nodeMetricData:n.heightMetricData},this.font,.05).init(n);this.add(l);let d=await new Jo({name:"AreaMetricBlock",title:n.areaMetricTitle,iconFilename:e,iconScale:i,nodeMetricData:n.areaMetricData},this.font,-.1).init(n);this.add(d);let c=await new cc({name:"ColorMetricBlock",title:n.colorMetricTitle,iconFilename:a,iconScale:s,nodeMetricData:n.colorMetricData,colorRange:n.colorRange},this.font,-.25).init(n);return this.add(c),this.centerMetricsMeshInXDirection(),this}centerMetricsMeshInXDirection(){let n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};this.traverse(e=>{if(e instanceof st&&e.visible){e.geometry.computeBoundingBox();let{min:i,max:o}=e.geometry.boundingBox;n.min=Math.min(n.min,i.x),n.max=Math.max(n.max,o.x)}}),this.position.x=(n.max-n.min)/2}createColorAttributes(){return{colorIcon:"color_icon_for_3D_print.svg",colorIconScale:.075}}createHeightAttributes(){return{heightIcon:"height_icon_for_3D_print.svg",heightIconScale:.09}}createAreaAttributes(){return{areaIcon:"area_icon_for_3D_print.svg",areaIconScale:.075}}};var Iv=qa(Tv());var yc=class extends Tt{constructor(n){super(n,new et,0,!1)}async init(n){this.geometry=await this.create(n);let e=.45,i=.45,o=-n.baseplateHeight+n.printHeight/2;return this.position.set(e,i,o),this.updateColor(n.numberOfColors),this}async changeText(n){this.geometry=await this.create(n)}async create(n){if(!n.qrCodeText||n.qrCodeText.length===0)return new Qt;let e=document.createElement("canvas");await Iv.toCanvas(e,n.qrCodeText,{errorCorrectionLevel:"H"});let o=e.getContext("2d").getImageData(0,0,e.width,e.height),r=[],a=.6/o.width;for(let s=0;s<o.height;s+=4)for(let l=0;l<o.width;l+=4){let d=(s*o.width+l)*4;if(o.data[d]!==0){let c=new ro(a,a,n.printHeight);c.translate(-l/4*a,-s/4*a,0),r.push(c)}}return this.updateMinWidth(a),yo(r)}updateMinWidth(n){this.minWidth=.6/n}};var Cc=class extends xt{constructor(n){let e=new et;super("BackPrintContainer",e),this.font=n}async init(n){return this.childrenMeshes=new Map,this.childrenMeshes.set("BackMWLogo",new oc("BackMWLogo")),this.childrenMeshes.set("BackBelowLogoText",new tc("BackBelowLogoText",this.font)),this.childrenMeshes.set("QrCode",new yc("QrCode")),this.childrenMeshes.set("CodeChartaLogo",new nc("CodeChartaLogo")),this.childrenMeshes.set("CodeChartaText",new rc("CodeChartaText",this.font)),this.childrenMeshes.set("MetricDescriptionsContainer",new dc("MetricDescriptionsContainer",this.font)),await Promise.all([...this.childrenMeshes.values()].map(async e=>{await e.init(n),this.add(e)})),this.changeSize(n,1),this}changeSize(n,e){let i=n.width/e;this.scale.set(this.scale.x*i,this.scale.y*i,this.scale.z),this.traverse(o=>{o instanceof Tt&&o.setCurrentWidth(n.width)})}isQRCodeVisible(){return this.childrenMeshes.get("QrCode").visible}async updateQrCodeText(n,e){e.qrCodeText=n,await this.childrenMeshes.get("QrCode").changeText(e)}updateQrCodeVisibility(n){this.childrenMeshes.get("QrCode").setManualVisibility(n)}getChildrenMeshes(){return this.childrenMeshes}};var Mc=class{execute(n,e){let i=e.material;return i.defaultAttributeValues.color=n===1?[1,1,1]:[.5,.5,.5],!0}};var _c=class{async create(n){let{width:e,secondRowVisible:i,mapSideOffset:o,baseplateHeight:r,frontTextSize:a,secondRowTextSize:s}=n,l=5,d=Math.sqrt(2*Math.pow(o,2))/(Math.sqrt(2)-1)-1;d<l&&(l=d);let c=new rs,m=i?s*1.5:0,p=e+a+m;c.absarc(e-l,l,l,Math.PI*1.5,Math.PI*2,!1),c.absarc(e-l,p-l,l,0,Math.PI*.5,!1),c.absarc(l,p-l,l,Math.PI*.5,Math.PI,!1),c.absarc(l,l,l,Math.PI,Math.PI*1.5,!1);let u=new On(c,{depth:r,bevelEnabled:!1});return u.translate(-e/2,-e/2-a-m,-r),u}};var Ec=class extends xt{constructor(n=new _c){super("Baseplate",new Mc),this.createBaseplateGeometryStrategy=n}async init(n){this.createBaseplateGeometryStrategy.create(n).then(i=>{this.geometry=i});let e=new Kp;return e.copy(n.defaultMaterial),e.polygonOffset=!0,e.polygonOffsetUnits=1,e.polygonOffsetFactor=.1,this.material=e,this.updateColor(n.numberOfColors),new Promise(i=>{i(this)})}changeSize(n){this.boundingBoxCalculated=!1,this.createBaseplateGeometryStrategy.create(n).then(e=>{this.geometry=e})}};var ko=class{execute(n,e){let i;return n<4?i=[1,1,1]:n===4?i=[1,1,0]:i=[1,1,1],e.material.color.setRGB(i[0],i[1],i[2]),!0}};var qo=class extends xt{constructor(n,e){super(n,new ko),this.alignment=e}changeRelativeSize(n){let e=this.getWidth();this.boundingBoxCalculated=!1;let i=n.secondRowVisible,o=i?(n.frontTextSize+n.secondRowTextSize)/n.frontTextSize:1;this.scale.x=o,this.scale.y=o;let r=i?-1:1,a=this.alignment==="left"?-1:1;this.translateY(r*n.secondRowTextSize);let s=i?e/this.getWidth():this.getWidth()/e;this.translateX(2*s*a*r)}};var kc=class extends qo{constructor(n,e){super(n,"left"),this.filePath=e}async init(n){let e=new Jt,i=n.frontTextSize*n.width/200;this.geometry=await e.create(n,{filePath:this.filePath,size:i,side:"front"});let o=-n.width/2+i/2+n.mapSideOffset/2,r=i/2,a=n.printHeight/2;return this.position.set(o,r,a),n.secondRowVisible&&this.changeRelativeSize(n),this.updateColor(n.numberOfColors),this}setColor(n){this.material.color.set(n)}rotate(){this.geometry.rotateZ(Math.PI/2)}flip(){this.geometry.rotateY(Math.PI)}changeSize(n,e){this.position.x-=(n.width-e)/2}};var qc=class extends qo{constructor(n){super(n,"right")}async init(n,e=new Jt){let i=n.frontTextSize*n.width/250;this.geometry=await e.create(n,{filePath:"./codeCharta/assets/mw_logo.svg",size:i,side:"front"});let o=n.width/2-i/2-n.mapSideOffset/2,r=i/2,a=n.printHeight/2;return this.position.set(o,r,a),n.secondRowVisible&&this.changeRelativeSize(n),this.updateColor(n.numberOfColors),this}changeSize(n,e){this.position.x+=(n.width-e)/2}};var Tc=class extends Kt{constructor(n,e,i){let o=i.frontText;o||(o="FrontText");let r={font:e,side:"front",text:o,xPosition:0,yPosition:i.frontTextSize/2,textSize:i.frontTextSize,align:"center"};super(n,new ko,0,!0,r),this.name="Front Text"}};var Ic=class extends Kt{constructor(n,e,i){let o={font:e,text:i.secondRowText,side:"front",xPosition:0,yPosition:-i.secondRowTextSize,textSize:i.secondRowTextSize,align:"center"};super(n,new ko,0,!1,o)}};var Dc=class extends xt{constructor(n){let e=new et;super("FrontPrintContainer",e),this.font=n}async init(n){return this.childrenMeshes=new Map,this.childrenMeshes.set("FrontText",new Tc("FrontText",this.font,n)),this.childrenMeshes.set("SecondRowText",new Ic("SecondRowText",this.font,n)),this.childrenMeshes.set("FrontMWLogo",new qc("FrontMWLogo")),await Promise.all([...this.childrenMeshes.values()].map(async e=>{await e.init(n),this.add(e)})),this.position.y=-n.width/2-n.mapSideOffset/2,this}async addCustomLogo(n,e){this.childrenMeshes.has("CustomLogo")&&this.removeCustomLogo();let i=await new kc("CustomLogo",n).init(e);this.add(i),this.childrenMeshes.set(i.name,i)}rotateCustomLogo(){this.childrenMeshes.get("CustomLogo").rotate()}flipCustomLogo(){this.childrenMeshes.get("CustomLogo").flip()}removeCustomLogo(){this.remove(this.childrenMeshes.get("CustomLogo")),this.childrenMeshes.delete("CustomLogo")}updateCustomLogoColor(n){this.childrenMeshes.get("CustomLogo").setColor(n)}async updateFrontText(n,e){let i=this.childrenMeshes.get("FrontText");i.updateTextGeometryOptions(n),await i.updateText(e)}changeSize(n,e){this.position.y-=(n.width-e)/2;for(let i of this.childrenMeshes.values())i instanceof qo&&i.isGeneralSizeChangeMesh()&&i.changeSize(n,e)}async updateSecondRowText(n,e){let i=this.childrenMeshes.get("SecondRowText");i.updateTextGeometryOptions(n),await i.updateText(e)}updateSecondRowVisibility(n){let e=this.childrenMeshes.get("FrontMWLogo"),i=this.childrenMeshes.get("SecondRowText"),o=this.childrenMeshes.get("CustomLogo");i.setManualVisibility(n.secondRowVisible),e.changeRelativeSize(n),o?.changeRelativeSize(n)}getChildrenMeshes(){return this.childrenMeshes}};var Rc=class extends Tt{constructor(){super("Map",new et,1,!1)}async init(n){this.material=n.originalMapMesh.clone().material,this.originalColors=n.originalMapMesh.geometry.attributes.color;let e=n.originalMapMesh.geometry.clone();return this.addBottomFaces(e),e.computeBoundingBox(),e.rotateX(Math.PI/2),this.updateMapGeometry(n,e),e.computeBoundingBox(),e.rotateZ(-Math.PI/2),this.geometry=e,this}updateMapGeometry(n,e){let i=n.width-2*n.mapSideOffset,o=e.boundingBox.max.x,r=i/o;return e.scale(r,r,r),e.translate(-i/2,i/2,0),this.updateMapColors(this.originalColors,e,n.numberOfColors),e}updateMapColors(n,e,i){let o=[];for(let r=0;r<n.count;r++){let a=n.getX(r),s=n.getY(r),l=n.getZ(r),d;a===l&&a===s&&s===l?d=i===1?[1,1,1]:[.5,.5,.5]:a>.75&&s>.75?d=i<4?[1,1,1]:[1,1,0]:a>.45&&s<.1?d=i<4?[1,1,1]:[1,0,0]:a<5&&s>.6?d=i<4?[1,1,1]:[0,1,0]:(console.error("Unknown color"),d=[1,1,1]),o.push(...d)}e.setAttribute("color",new Ao(o,3))}addBottomFaces(n){let e=n.index;if(!e)return;let i=24,o=6,r=8,a=e.count/_u,s=new Uint32Array(e.count+a*o);s.set(new Uint32Array(e.array.buffer,e.array.byteOffset,e.count));let l=e.count;for(let d=0;d<a;d++){let c=d*i+r;s[l++]=c,s[l++]=c+2,s[l++]=c+1,s[l++]=c,s[l++]=c+3,s[l++]=c+2}n.setIndex(new no(s,1))}async changeSize(n,e){let i=(n.width-2*n.mapSideOffset)/(e-2*n.mapSideOffset);this.geometry.scale(i,i,i)}updateColor(n){this.updateMapColors(this.originalColors,this.geometry,n)}};var Ac=class{constructor(n,e=new Dc(new ha(Lh)),i=new Cc(new ha(Lh)),o=new Ec,r=new Rc){this.geometryOptions=n,this.frontPrintContainerMesh=e,this.backPrintContainerMesh=i,this.baseplateMesh=o,this.mapMesh=r,this.printMesh=new st,this.printMesh.name="PrintMesh"}async initialize(){this.baseplateMesh=await this.baseplateMesh.init(this.geometryOptions),this.printMesh.add(this.baseplateMesh),this.mapMesh=await this.mapMesh.init(this.geometryOptions),this.printMesh.add(this.mapMesh),this.frontPrintContainerMesh=await this.frontPrintContainerMesh.init(this.geometryOptions),this.printMesh.add(this.frontPrintContainerMesh),this.backPrintContainerMesh=await this.backPrintContainerMesh.init(this.geometryOptions),this.printMesh.add(this.backPrintContainerMesh),this.calculateCurrentSize()}getThreeMesh(){return this.printMesh}getMapMesh(){return this.mapMesh}getSize(){return this.currentSize}async updateSize(n){this.geometryOptions.width=n;let e=this.currentSize.x;return await Promise.all([...this.printMesh.children].map(async i=>{i instanceof xt&&i.isGeneralSizeChangeMesh()&&i.changeSize(this.geometryOptions,e)})),this.calculateCurrentSize(),this.backPrintContainerMesh.isQRCodeVisible()}updateNumberOfColors(n){this.geometryOptions.numberOfColors=n;for(let e of this.printMesh.children)e instanceof xt&&e.updateColor(n)}async addCustomLogo(n){this.frontPrintContainerMesh.addCustomLogo(n,this.geometryOptions)}rotateCustomLogo(){this.frontPrintContainerMesh.rotateCustomLogo()}flipCustomLogo(){this.frontPrintContainerMesh.flipCustomLogo()}removeCustomLogo(){this.frontPrintContainerMesh.removeCustomLogo()}updateCustomLogoColor(n){this.frontPrintContainerMesh.updateCustomLogoColor(n)}updateFrontText(n){this.frontPrintContainerMesh.updateFrontText(n,this.geometryOptions)}updateSecondRowVisibility(n){this.geometryOptions.secondRowVisible!==n&&(this.geometryOptions.secondRowVisible=n,this.frontPrintContainerMesh.updateSecondRowVisibility(this.geometryOptions),this.baseplateMesh.changeSize(this.geometryOptions))}async updateSecondRowText(n){await this.frontPrintContainerMesh.updateSecondRowText(n,this.geometryOptions)}calculateCurrentSize(){let n=this.baseplateMesh.getWidth(),e=this.baseplateMesh.getDepth(),i=this.baseplateMesh.getHeight()+this.mapMesh.getHeight();this.currentSize=new Ye(n,e,i)}async updateQrCodeText(n){await this.backPrintContainerMesh.updateQrCodeText(n,this.geometryOptions)}updateQrCodeVisibility(n){this.backPrintContainerMesh.updateQrCodeVisibility(n)}};function rm(t,n,e,i,o){let r=t.x,a=t.y,s=t.z,l=r,d=a-e;n.geometry.boundingBox||n.geometry.computeBoundingBox();let c=n.geometry.boundingBox.max.z-n.geometry.boundingBox.min.z,m=(s-i)*n.geometry.boundingBox.max.x/c+2*o;return Math.min(l,d,m)}var _t=Uint8Array,jt=Uint16Array,hm=Int32Array,mm=new _t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),pm=new _t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Dv=new _t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nv=function(t,n){for(var e=new jt(31),i=0;i<31;++i)e[i]=n+=1<<t[i-1];for(var o=new hm(e[30]),i=1;i<30;++i)for(var r=e[i];r<e[i+1];++r)o[r]=r-e[i]<<5|i;return{b:e,r:o}},Bv=Nv(mm,2),T7=Bv.b,sm=Bv.r;T7[28]=258,sm[258]=28;var Vv=Nv(pm,0),hJ=Vv.b,Rv=Vv.r,lm=new jt(32768);for(Qe=0;Qe<32768;++Qe)$i=(Qe&43690)>>1|(Qe&21845)<<1,$i=($i&52428)>>2|($i&13107)<<2,$i=($i&61680)>>4|($i&3855)<<4,lm[Qe]=(($i&65280)>>8|($i&255)<<8)>>1;var $i,Qe,Ca=function(t,n,e){for(var i=t.length,o=0,r=new jt(n);o<i;++o)t[o]&&++r[t[o]-1];var a=new jt(n);for(o=1;o<n;++o)a[o]=a[o-1]+r[o-1]<<1;var s;if(e){s=new jt(1<<n);var l=15-n;for(o=0;o<i;++o)if(t[o])for(var d=o<<4|t[o],c=n-t[o],m=a[t[o]-1]++<<c,p=m|(1<<c)-1;m<=p;++m)s[lm[m]>>l]=d}else for(s=new jt(i),o=0;o<i;++o)t[o]&&(s[o]=lm[a[t[o]-1]++]>>15-t[o]);return s},rn=new _t(288);for(Qe=0;Qe<144;++Qe)rn[Qe]=8;var Qe;for(Qe=144;Qe<256;++Qe)rn[Qe]=9;var Qe;for(Qe=256;Qe<280;++Qe)rn[Qe]=7;var Qe;for(Qe=280;Qe<288;++Qe)rn[Qe]=8;var Qe,Fc=new _t(32);for(Qe=0;Qe<32;++Qe)Fc[Qe]=5;var Qe,I7=Ca(rn,9,0);var D7=Ca(Fc,5,0);var Wv=function(t){return(t+7)/8|0},Ov=function(t,n,e){return(n==null||n<0)&&(n=0),(e==null||e>t.length)&&(e=t.length),new _t(t.subarray(n,e))};var R7=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Lc=function(t,n,e){var i=new Error(n||R7[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,Lc),!e)throw i;return i};var ji=function(t,n,e){e<<=n&7;var i=n/8|0;t[i]|=e,t[i+1]|=e>>8},Sa=function(t,n,e){e<<=n&7;var i=n/8|0;t[i]|=e,t[i+1]|=e>>8,t[i+2]|=e>>16},am=function(t,n){for(var e=[],i=0;i<t.length;++i)t[i]&&e.push({s:i,f:t[i]});var o=e.length,r=e.slice();if(!o)return{t:$v,l:0};if(o==1){var a=new _t(e[0].s+1);return a[e[0].s]=1,{t:a,l:1}}e.sort(function(G,K){return G.f-K.f}),e.push({s:-1,f:25001});var s=e[0],l=e[1],d=0,c=1,m=2;for(e[0]={s:-1,f:s.f+l.f,l:s,r:l};c!=o-1;)s=e[e[d].f<e[m].f?d++:m++],l=e[d!=c&&e[d].f<e[m].f?d++:m++],e[c++]={s:-1,f:s.f+l.f,l:s,r:l};for(var p=r[0].s,i=1;i<o;++i)r[i].s>p&&(p=r[i].s);var u=new jt(p+1),k=cm(e[c-1],u,0);if(k>n){var i=0,E=0,P=k-n,$=1<<P;for(r.sort(function(K,ie){return u[ie.s]-u[K.s]||K.f-ie.f});i<o;++i){var ee=r[i].s;if(u[ee]>n)E+=$-(1<<k-u[ee]),u[ee]=n;else break}for(E>>=P;E>0;){var B=r[i].s;u[B]<n?E-=1<<n-u[B]++-1:++i}for(;i>=0&&E;--i){var j=r[i].s;u[j]==n&&(--u[j],++E)}k=n}return{t:new _t(u),l:k}},cm=function(t,n,e){return t.s==-1?Math.max(cm(t.l,n,e+1),cm(t.r,n,e+1)):n[t.s]=e},Av=function(t){for(var n=t.length;n&&!t[--n];);for(var e=new jt(++n),i=0,o=t[0],r=1,a=function(l){e[i++]=l},s=1;s<=n;++s)if(t[s]==o&&s!=n)++r;else{if(!o&&r>2){for(;r>138;r-=138)a(32754);r>2&&(a(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(a(o),--r;r>6;r-=6)a(8304);r>2&&(a(r-3<<5|8208),r=0)}for(;r--;)a(o);r=1,o=t[s]}return{c:e.subarray(0,i),n}},ya=function(t,n){for(var e=0,i=0;i<n.length;++i)e+=t[i]*n[i];return e},zv=function(t,n,e){var i=e.length,o=Wv(n+2);t[o]=i&255,t[o+1]=i>>8,t[o+2]=t[o]^255,t[o+3]=t[o+1]^255;for(var r=0;r<i;++r)t[o+r+4]=e[r];return(o+4+i)*8},Fv=function(t,n,e,i,o,r,a,s,l,d,c){ji(n,c++,e),++o[256];for(var m=am(o,15),p=m.t,u=m.l,k=am(r,15),E=k.t,P=k.l,$=Av(p),ee=$.c,B=$.n,j=Av(E),G=j.c,K=j.n,ie=new jt(19),oe=0;oe<ee.length;++oe)++ie[ee[oe]&31];for(var oe=0;oe<G.length;++oe)++ie[G[oe]&31];for(var ne=am(ie,7),_e=ne.t,He=ne.l,U=19;U>4&&!_e[Dv[U-1]];--U);var De=d+5<<3,Ee=ya(o,rn)+ya(r,Fc)+a,Ve=ya(o,p)+ya(r,E)+a+14+3*U+ya(ie,_e)+2*ie[16]+3*ie[17]+7*ie[18];if(l>=0&&De<=Ee&&De<=Ve)return zv(n,c,t.subarray(l,l+d));var We,ue,J,Ue;if(ji(n,c,1+(Ve<Ee)),c+=2,Ve<Ee){We=Ca(p,u,0),ue=p,J=Ca(E,P,0),Ue=E;var Be=Ca(_e,He,0);ji(n,c,B-257),ji(n,c+5,K-1),ji(n,c+10,U-4),c+=14;for(var oe=0;oe<U;++oe)ji(n,c+3*oe,_e[Dv[oe]]);c+=3*U;for(var ct=[ee,G],zt=0;zt<2;++zt)for(var di=ct[zt],oe=0;oe<di.length;++oe){var R=di[oe]&31;ji(n,c,Be[R]),c+=_e[R],R>15&&(ji(n,c,di[oe]>>5&127),c+=di[oe]>>12)}}else We=I7,ue=rn,J=D7,Ue=Fc;for(var oe=0;oe<s;++oe){var C=i[oe];if(C>255){var R=C>>18&31;Sa(n,c,We[R+257]),c+=ue[R+257],R>7&&(ji(n,c,C>>23&31),c+=mm[R]);var x=C&31;Sa(n,c,J[x]),c+=Ue[x],x>3&&(Sa(n,c,C>>5&8191),c+=pm[x])}else Sa(n,c,We[C]),c+=ue[C]}return Sa(n,c,We[256]),c+ue[256]},A7=new hm([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$v=new _t(0),F7=function(t,n,e,i,o,r){var a=r.z||t.length,s=new _t(i+a+5*(1+Math.ceil(a/7e3))+o),l=s.subarray(i,s.length-o),d=r.l,c=(r.r||0)&7;if(n){c&&(l[0]=r.r>>3);for(var m=A7[n-1],p=m>>13,u=m&8191,k=(1<<e)-1,E=r.p||new jt(32768),P=r.h||new jt(k+1),$=Math.ceil(e/3),ee=2*$,B=function(Q){return(t[Q]^t[Q+1]<<$^t[Q+2]<<ee)&k},j=new hm(25e3),G=new jt(288),K=new jt(32),ie=0,oe=0,ne=r.i||0,_e=0,He=r.w||0,U=0;ne+2<a;++ne){var De=B(ne),Ee=ne&32767,Ve=P[De];if(E[Ee]=Ve,P[De]=Ee,He<=ne){var We=a-ne;if((ie>7e3||_e>24576)&&(We>423||!d)){c=Fv(t,l,0,j,G,K,oe,_e,U,ne-U,c),_e=ie=oe=0,U=ne;for(var ue=0;ue<286;++ue)G[ue]=0;for(var ue=0;ue<30;++ue)K[ue]=0}var J=2,Ue=0,Be=u,ct=Ee-Ve&32767;if(We>2&&De==B(ne-ct))for(var zt=Math.min(p,We)-1,di=Math.min(32767,ne),R=Math.min(258,We);ct<=di&&--Be&&Ee!=Ve;){if(t[ne+J]==t[ne+J-ct]){for(var C=0;C<R&&t[ne+C]==t[ne+C-ct];++C);if(C>J){if(J=C,Ue=ct,C>zt)break;for(var x=Math.min(ct,C-2),f=0,ue=0;ue<x;++ue){var X=ne-ct+ue&32767,se=E[X],V=X-se&32767;V>f&&(f=V,Ve=X)}}}Ee=Ve,Ve=E[Ee],ct+=Ee-Ve&32767}if(Ue){j[_e++]=268435456|sm[J]<<18|Rv[Ue];var ae=sm[J]&31,me=Rv[Ue]&31;oe+=mm[ae]+pm[me],++G[257+ae],++K[me],He=ne+J,++ie}else j[_e++]=t[ne],++G[t[ne]]}}for(ne=Math.max(ne,He);ne<a;++ne)j[_e++]=t[ne],++G[t[ne]];c=Fv(t,l,d,j,G,K,oe,_e,U,ne-U,c),d||(r.r=c&7|l[c/8|0]<<3,c-=7,r.h=P,r.p=E,r.i=ne,r.w=He)}else{for(var ne=r.w||0;ne<a+d;ne+=65535){var pe=ne+65535;pe>=a&&(l[c/8|0]=d,pe=a),c=zv(l,c+1,t.subarray(ne,pe))}r.i=a}return Ov(s,0,i+Wv(c)+o)},L7=(function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var e=n,i=9;--i;)e=(e&1&&-306674912)^e>>>1;t[n]=e}return t})(),P7=function(){var t=-1;return{p:function(n){for(var e=t,i=0;i<n.length;++i)e=L7[e&255^n[i]]^e>>>8;t=e},d:function(){return~t}}};var N7=function(t,n,e,i,o){if(!o&&(o={l:1},n.dictionary)){var r=n.dictionary.subarray(-32768),a=new _t(r.length+t.length);a.set(r),a.set(t,r.length),t=a,o.w=r.length}return F7(t,n.level==null?6:n.level,n.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+n.mem,e,i,o)},jv=function(t,n){var e={};for(var i in t)e[i]=t[i];for(var i in n)e[i]=n[i];return e};var Mt=function(t,n,e){for(;e;++n)t[n]=e,e>>>=8};function B7(t,n){return N7(t,n||{},0,0)}var Hv=function(t,n,e,i){for(var o in t){var r=t[o],a=n+o,s=i;Array.isArray(r)&&(s=jv(i,r[1]),r=r[0]),r instanceof _t?e[a]=[r,s]:(e[a+="/"]=[new _t(0),s],Hv(r,a,e,i))}},Lv=typeof TextEncoder<"u"&&new TextEncoder,V7=typeof TextDecoder<"u"&&new TextDecoder,W7=0;try{V7.decode($v,{stream:!0}),W7=1}catch{}function an(t,n){if(n){for(var e=new _t(t.length),i=0;i<t.length;++i)e[i]=t.charCodeAt(i);return e}if(Lv)return Lv.encode(t);for(var o=t.length,r=new _t(t.length+(t.length>>1)),a=0,s=function(c){r[a++]=c},i=0;i<o;++i){if(a+5>r.length){var l=new _t(a+8+(o-i<<1));l.set(r),r=l}var d=t.charCodeAt(i);d<128||n?s(d):d<2048?(s(192|d>>6),s(128|d&63)):d>55295&&d<57344?(d=65536+(d&1047552)|t.charCodeAt(++i)&1023,s(240|d>>18),s(128|d>>12&63),s(128|d>>6&63),s(128|d&63)):(s(224|d>>12),s(128|d>>6&63),s(128|d&63))}return Ov(r,0,a)}var dm=function(t){var n=0;if(t)for(var e in t){var i=t[e].length;i>65535&&Lc(9),n+=i+4}return n},Pv=function(t,n,e,i,o,r,a,s){var l=i.length,d=e.extra,c=s&&s.length,m=dm(d);Mt(t,n,a!=null?33639248:67324752),n+=4,a!=null&&(t[n++]=20,t[n++]=e.os),t[n]=20,n+=2,t[n++]=e.flag<<1|(r<0&&8),t[n++]=o&&8,t[n++]=e.compression&255,t[n++]=e.compression>>8;var p=new Date(e.mtime==null?Date.now():e.mtime),u=p.getFullYear()-1980;if((u<0||u>119)&&Lc(10),Mt(t,n,u<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),n+=4,r!=-1&&(Mt(t,n,e.crc),Mt(t,n+4,r<0?-r-2:r),Mt(t,n+8,e.size)),Mt(t,n+12,l),Mt(t,n+14,m),n+=16,a!=null&&(Mt(t,n,c),Mt(t,n+6,e.attrs),Mt(t,n+10,a),n+=14),t.set(i,n),n+=l,m)for(var k in d){var E=d[k],P=E.length;Mt(t,n,+k),Mt(t,n+2,P),t.set(E,n+4),n+=4+P}return c&&(t.set(s,n),n+=c),n},O7=function(t,n,e,i,o){Mt(t,n,101010256),Mt(t,n+8,e),Mt(t,n+10,e),Mt(t,n+12,i),Mt(t,n+16,o)};function Uv(t,n){n||(n={});var e={},i=[];Hv(t,"",e,n);var o=0,r=0;for(var a in e){var s=e[a],l=s[0],d=s[1],c=d.level==0?0:8,m=an(a),p=m.length,u=d.comment,k=u&&an(u),E=k&&k.length,P=dm(d.extra);p>65535&&Lc(11);var $=c?B7(l,d):l,ee=$.length,B=P7();B.p(l),i.push(jv(d,{size:l.length,crc:B.d(),c:$,f:m,m:k,u:p!=a.length||k&&u.length!=E,o,compression:c})),o+=30+p+P+ee,r+=76+2*(p+P)+(E||0)+ee}for(var j=new _t(r+22),G=o,K=r-o,ie=0;ie<i.length;++ie){var m=i[ie];Pv(j,m.o,m,m.f,m.u,m.c.length);var oe=30+m.f.length+dm(m.extra);j.set(m.c,m.o+oe),Pv(j,o,m,m.f,m.u,m.c.length,m.o,m.m),o+=16+oe+(m.m?m.m.length:0)}return O7(j,o,i.length,K,G),j}function Gv(t,n){let e=z7(),i=$7(t),o=j7(n),r=H7();return e+i+o+r}function z7(){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
3454
3467
|
<model unit="millimeter" xml:lang="en-US" xmlns="http://schemas.microsoft.com/3dmanufacturing/core/2015/02" xmlns:slic3rpe="http://schemas.slic3r.org/3mf/2017/06">
|
|
3455
3468
|
<metadata name="Application">PrusaSlicer-2.7.2</metadata>
|
|
3456
3469
|
<resources>
|
|
@@ -3486,6 +3499,6 @@ ${this.metricDescriptionBlockOptions.title}
|
|
|
3486
3499
|
</Types>`}function Yv(){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
3487
3500
|
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
3488
3501
|
<Relationship Target="/3D/3dmodel.model" Id="rel-1" Type="http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel"/>
|
|
3489
|
-
</Relationships>`}async function Kv(t){let{vertices:n,triangles:e,volumes:i}=Q7(t),o=Gv(n,e),r=Xv(i),a=Qv(),s=Yv(),l=!0,d={"3D":{"3dmodel.model":an(o,l)},_rels:{".rels":an(s,l)},Metadata:{"Slic3r_PE_model.config":an(r,l)},"[Content_Types].xml":an(a,l)};return Uv(d,{comment:"created by CodeCharta"}).buffer}function Q7(t){let n=[],e=[],i=[],o=new Map,r=new Map,a=1;for(let s of t.children)Jv(s,n,e,o,a,r,i);return{vertices:n,triangles:e,volumes:i}}function Jv(t,n,e,i,o,r,a,s=void 0){if(!t.visible)return;for(let c of t.children){let m=t.matrix;s&&(m=s.clone().multiply(t.matrix)),Jv(c,n,e,i,o,r,a,m)}let l=Y7(t),d=new Map;for(let[c,m]of l.entries()){let p=e.length;Z7(n,i,d,m,t,s),K7(t.geometry,e,d,m),J7(t,c,p,e.length-1,a,o,r),o++}}function Y7(t){let n=new Map;if(t.geometry.attributes.color)for(let e=0;e<t.geometry.attributes.color.count;e++){let i=Zv(t.geometry.attributes.color,e);n.has(i)?n.get(i).push(e):n.set(i,[e])}else if(t.geometry.attributes.position){let e=t.material,i;if(e.color)i=e.color.getHexString();else if(e.isShaderMaterial){let r=e.defaultAttributeValues.color;i=Zv(r,0)}let o=Array.from({length:t.geometry.attributes.position.count},(r,a)=>a);n.set(i,o)}return n}function Z7(t,n,e,i,o,r){let a=o.geometry.attributes.position;for(let s of i){let l=new Ye(a.getX(s),a.getY(s),a.getZ(s));l.applyMatrix4(o.matrix),r&&l.applyMatrix4(r);let d=`<vertex x="${l.x}" y="${l.y}" z="${l.z}"/>`;n.has(d)?e.set(s,n.get(d)):(t.push(d),n.set(d,t.length-1),e.set(s,t.length-1))}}function K7(t,n,e,i){if(t.index){let o=t.index;for(let r=0;r<o.count;r+=3){let a=o.getX(r),s=o.getY(r),l=o.getZ(r);if(i.includes(a)&&i.includes(s)&&i.includes(l)){let d=`<triangle v1="${e.get(a)}" v2="${e.get(s)}" v3="${e.get(l)}" />`;n.push(d)}}}else for(let o=0;o<e.size;o+=3){let r=`<triangle v1="${e.get(o)}" v2="${e.get(o+1)}" v3="${e.get(o+2)}" />`;n.push(r)}}function J7(t,n,e,i,o,r,a){a.has(n)||a.set(n,a.size+1);let s=a.get(n),l=t.name==="Map"?`${t.name} 0x${n}`:t.name,d={id:r,name:l,color:n,extruder:s,firstTriangleId:e,lastTriangleId:i};o.push(d)}function Zv(t,n){return(t instanceof no?[t.getX(n),t.getY(n),t.getZ(n)]:[t[n],t[n+1],t[n+2]]).map(i=>Math.round(i*255).toString(16).padStart(2,"0")).join("")}var ex=(()=>{class t{constructor(){this.isPrintMeshLoaded=H.required(),this.download3MF=Ce(),this.downloadSTL=Ce()}handleDownload3MF(){this.download3MF.emit()}handleDownloadSTL(){this.downloadSTL.emit()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-export-actions"]],inputs:{isPrintMeshLoaded:[1,"isPrintMeshLoaded"]},outputs:{download3MF:"download3MF",downloadSTL:"downloadSTL"},decls:7,vars:2,consts:[[1,"flex","gap-2"],["title","Download 3MF Button",1,"btn","btn-primary",3,"click","disabled"],[1,"fa","fa-download"],["title","Download STL Button",1,"btn","btn-outline",3,"click","disabled"]],template:function(i,o){i&1&&(y(0,"div",0)(1,"button",1),Y("click",function(){return o.handleDownload3MF()}),fe(2,"i",2),g(3," Download 3MF "),S(),y(4,"button",3),Y("click",function(){return o.handleDownloadSTL()}),fe(5,"i",2),g(6," Download minimal STL "),S()()),i&2&&(h(),le("disabled",!o.isPrintMeshLoaded()),h(3),le("disabled",!o.isPrintMeshLoaded()))},encapsulation:2,changeDetection:0})}}return t})();var tx=(()=>{class t{constructor(){this.frontText=H(""),this.textChanged=Ce()}handleInput(e){let i=e.target;this.textChanged.emit(i.value)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-front-text-input"]],inputs:{frontText:[1,"frontText"]},outputs:{textChanged:"textChanged"},decls:5,vars:1,consts:[[1,"form-control","w-full"],[1,"label"],[1,"label-text","font-medium"],["type","text","placeholder","CodeCharta","data-testid","frontText",1,"input","input-bordered","w-full",3,"input","value"]],template:function(i,o){i&1&&(y(0,"label",0)(1,"div",1)(2,"span",2),g(3,"Bottom center label text"),S()(),y(4,"input",3),Y("input",function(a){return o.handleInput(a)}),S()()),i&2&&(h(4),le("value",o.frontText()))},encapsulation:2,changeDetection:0})}}return t})();var eC=["fileInput"];function tC(t,n){if(t&1){let e=Me();v(0,"div",5)(1,"button",6),W("click",function(){ce(e);let o=A();return de(o.handleRemoveLogo())}),L(2,"i",7),g(3," Remove "),b(),v(4,"button",8),W("click",function(){ce(e);let o=A();return de(o.handleRotateLogo())}),L(5,"i",9),g(6," Rotate "),b(),v(7,"button",10),W("click",function(){ce(e);let o=A();return de(o.handleFlipLogo())}),L(8,"i",11),g(9," Flip "),b()(),v(10,"div",12)(11,"cc-inline-color-picker",13),W("colorChange",function(o){ce(e);let r=A();return de(r.handleColorChange(o))}),b(),v(12,"span",14),g(13,"Color"),b()()}if(t&2){let e=A();h(11),F("hexColor",e.logoColor())}}var ix=(()=>{class t{constructor(){this.fileInput=je.required("fileInput"),this.isFileSelected=H.required(),this.logoColor=H("#ffffff"),this.fileSelected=Ce(),this.logoRemoved=Ce(),this.logoRotated=Ce(),this.logoFlipped=Ce(),this.colorChanged=Ce()}handleFileSelected(e){let o=e.target.files?.[0];o&&this.fileSelected.emit(o)}handleRemoveLogo(){this.fileInput().nativeElement.value="",this.logoRemoved.emit()}handleRotateLogo(){this.logoRotated.emit()}handleFlipLogo(){this.logoFlipped.emit()}handleColorChange(e){this.colorChanged.emit(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-logo-upload"]],viewQuery:function(i,o){i&1&&tt(o.fileInput,eC,5),i&2&&it()},inputs:{isFileSelected:[1,"isFileSelected"],logoColor:[1,"logoColor"]},outputs:{fileSelected:"fileSelected",logoRemoved:"logoRemoved",logoRotated:"logoRotated",logoFlipped:"logoFlipped",colorChanged:"colorChanged"},decls:7,vars:1,consts:[["fileInput",""],[1,"card","bg-base-200"],[1,"card-body","p-4"],[1,"card-title","text-sm"],["type","file","accept",".svg",1,"file-input","file-input-bordered","file-input-sm","w-full",3,"change"],[1,"flex","flex-wrap","gap-2","mt-2"],["title","Remove Logo",1,"btn","btn-sm","btn-ghost",3,"click"],[1,"fa","fa-times"],["title","Rotate Logo",1,"btn","btn-sm","btn-ghost",3,"click"],[1,"fa","fa-rotate-right"],["title","Flip Logo",1,"btn","btn-sm","btn-ghost",3,"click"],[1,"fa","fa-arrows-h"],[1,"flex","items-center","gap-2","mt-2"],["ariaLabel","Logo color",3,"colorChange","hexColor"],[1,"text-sm"]],template:function(i,o){i&1&&(v(0,"div",1)(1,"div",2)(2,"h3",3),g(3,"Bottom left logo (SVG)"),b(),v(4,"input",4,0),W("change",function(a){return o.handleFileSelected(a)}),b(),O(6,tC,14,1),b()()),i&2&&(h(6),z(o.isFileSelected()?6:-1))},dependencies:[ho],encapsulation:2,changeDetection:0})}}return t})();var iC=(t,n)=>n.name;function oC(t,n){if(t&1&&(y(0,"option",4),g(1),S()),t&2){let e=n.$implicit,i=A();le("selected",e.name===i.selectedPrinter().name),h(),Pm(" ",e.name," (",e.x/10,"\xD7",e.y/10,"\xD7",e.z/10,"cm, ",e.numberOfColors," colors) ")}}var um=[{name:"Prusa MK3S (single color)",x:245,y:205,z:205,numberOfColors:1},{name:"BambuLab A1 + AMS Lite",x:251,y:251,z:251,numberOfColors:4},{name:"Prusa XL (5 colors)",x:355,y:335,z:355,numberOfColors:5}],ox=(()=>{class t{constructor(){this.selectedPrinter=H.required(),this.printerChanged=Ce(),this.printers=um}handlePrinterChange(e){let i=e.target,o=this.printers[i.selectedIndex];this.printerChanged.emit(o)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-printer-preset-selection"]],inputs:{selectedPrinter:[1,"selectedPrinter"]},outputs:{printerChanged:"printerChanged"},decls:7,vars:0,consts:[[1,"form-control","w-full"],[1,"label"],[1,"label-text","font-medium"],["data-testid","selectPrinter",1,"select","select-bordered","w-full",3,"change"],["data-testid","selectedPrinter",3,"selected"]],template:function(i,o){i&1&&(y(0,"label",0)(1,"div",1)(2,"span",2),g(3,"Printer preset"),S()(),y(4,"select",3),Y("change",function(a){return o.handlePrinterChange(a)}),Pe(5,oC,2,6,"option",4,iC),S()()),i&2&&(h(5),Ne(o.printers))},encapsulation:2,changeDetection:0})}}return t})();function nC(t,n){if(t&1){let e=Me();y(0,"input",7),Y("input",function(o){ce(e);let r=A();return de(r.handleTextInput(o))}),S()}if(t&2){let e=A();le("value",e.currentText())}}var nx=(()=>{class t{constructor(){this.isVisible=H.required(),this.currentText=H(""),this.visibilityChanged=Ce(),this.textChanged=Ce()}handleToggleChange(e){let i=e.target;this.visibilityChanged.emit(i.checked)}handleTextInput(e){let i=e.target;this.textChanged.emit(i.value)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-qr-code-settings"]],inputs:{isVisible:[1,"isVisible"],currentText:[1,"currentText"]},outputs:{visibilityChanged:"visibilityChanged",textChanged:"textChanged"},decls:9,vars:2,consts:[[1,"card","bg-base-200"],[1,"card-body","p-4"],[1,"card-title","text-sm"],[1,"label","cursor-pointer","justify-start","gap-4"],["type","checkbox","data-testid","qrCodeToggle",1,"toggle","toggle-primary","toggle-sm",3,"change","checked"],[1,"label-text"],["type","text","placeholder","URL for QR code","data-testid","qrCodeText",1,"input","input-bordered","input-sm","w-full",3,"value"],["type","text","placeholder","URL for QR code","data-testid","qrCodeText",1,"input","input-bordered","input-sm","w-full",3,"input","value"]],template:function(i,o){i&1&&(y(0,"div",0)(1,"div",1)(2,"h3",2),g(3,"QR-Code"),S(),y(4,"label",3)(5,"input",4),Y("change",function(a){return o.handleToggleChange(a)}),S(),y(6,"span",5),g(7,"Show QR-Code"),S()(),O(8,nC,1,1,"input",6),S()()),i&2&&(h(5),le("checked",o.isVisible()),h(3),z(o.isVisible()?8:-1))},encapsulation:2,changeDetection:0})}}return t})();var rx=(()=>{class t{constructor(){this.currentSize=H.required(),this.wantedWidth=H.required(),this.maxWidth=H.required(),this.selectedPrinter=H.required(),this.widthChanged=Ce()}handleSliderChange(e){let i=e.target;this.widthChanged.emit(Number(i.value))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-scale-slider"]],inputs:{currentSize:[1,"currentSize"],wantedWidth:[1,"wantedWidth"],maxWidth:[1,"maxWidth"],selectedPrinter:[1,"selectedPrinter"]},outputs:{widthChanged:"widthChanged"},decls:12,vars:9,consts:[[1,"card","bg-base-200"],[1,"card-body","p-4"],[1,"card-title","text-sm"],["type","range","data-testid","onScaleChange",1,"range","range-primary","range-sm",3,"change","min","max","value"],["data-testid","printSizeOverview",1,"text-sm","mt-2"]],template:function(i,o){i&1&&(y(0,"div",0)(1,"div",1)(2,"h3",2),g(3,"Scale"),S(),y(4,"input",3),Y("change",function(a){return o.handleSliderChange(a)}),S(),y(5,"div",4)(6,"div"),g(7),S(),y(8,"div"),g(9),S(),y(10,"div"),g(11),S()()()()),i&2&&(h(4),le("min",100)("max",o.maxWidth())("value",o.wantedWidth()),h(3),Yi("Width: ",(o.currentSize().x/10).toFixed(1),"cm (max. ",(o.selectedPrinter().x/10).toFixed(1),")"),h(2),Yi("Depth: ",(o.currentSize().y/10).toFixed(1),"cm (max. ",(o.selectedPrinter().y/10).toFixed(1),")"),h(2),Yi("Height: ",(o.currentSize().z/10).toFixed(1),"cm (max. ",(o.selectedPrinter().z/10).toFixed(1),")"))},encapsulation:2,changeDetection:0})}}return t})();function rC(t,n){if(t&1){let e=Me();y(0,"input",7),Y("input",function(o){ce(e);let r=A();return de(r.handleTextInput(o))}),S()}if(t&2){let e=A();le("value",e.currentText())}}var ax=(()=>{class t{constructor(){this.isVisible=H.required(),this.currentText=H(""),this.visibilityChanged=Ce(),this.textChanged=Ce()}handleToggleChange(e){let i=e.target;this.visibilityChanged.emit(i.checked)}handleTextInput(e){let i=e.target;this.textChanged.emit(i.value)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-second-row-text-input"]],inputs:{isVisible:[1,"isVisible"],currentText:[1,"currentText"]},outputs:{visibilityChanged:"visibilityChanged",textChanged:"textChanged"},decls:9,vars:2,consts:[[1,"card","bg-base-200"],[1,"card-body","p-4"],[1,"card-title","text-sm"],[1,"label","cursor-pointer","justify-start","gap-4"],["type","checkbox","data-testid","secondRowToggle",1,"toggle","toggle-primary","toggle-sm",3,"change","checked"],[1,"label-text"],["type","text","data-testid","secondRowText",1,"input","input-bordered","input-sm","w-full",3,"value"],["type","text","data-testid","secondRowText",1,"input","input-bordered","input-sm","w-full",3,"input","value"]],template:function(i,o){i&1&&(y(0,"div",0)(1,"div",1)(2,"h3",2),g(3,"Second row center text"),S(),y(4,"label",3)(5,"input",4),Y("change",function(a){return o.handleToggleChange(a)}),S(),y(6,"span",5),g(7,"Show second row text"),S()(),O(8,rC,1,1,"input",6),S()()),i&2&&(h(5),le("checked",o.isVisible()),h(3),z(o.isVisible()?8:-1))},encapsulation:2,changeDetection:0})}}return t})();var sx=(()=>{class t{constructor(e,i,o,r,a){this.mapStateReadWindow=e,this.metricsLensSourceReadWindow=i,this.sharedViewReadWindow=o,this.fileStoreReadWindow=r,this.ccStateSnapshot=a}getAreaMetric(){return this.mapStateReadWindow.getAreaMetric()}getHeightMetric(){return this.mapStateReadWindow.getHeightMetric()}getColorMetric(){return this.mapStateReadWindow.getColorMetric()}getColorRange(){return this.mapStateReadWindow.getColorRange()}getAttributeDescriptors(){return this.metricsLensSourceReadWindow.getAttributeDescriptors()}getNodeMetricData(){return ao(this.ccStateSnapshot.get())}getBlacklist(){return this.sharedViewReadWindow.getBlacklist()}getFiles(){return this.fileStoreReadWindow.getFiles()}getAccumulatedFileName(){return Et(this.ccStateSnapshot.get()).unifiedFileMeta?.fileName}static{this.\u0275fac=function(i){return new(i||t)(M(ve),M(hs),M(Nt),M(Te),M(Bt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var sC=["dialog"],lC=["rendererContainer"],fm=(()=>{class t{constructor(e,i){this.stateAccessStore=e,this.threeSceneService=i,this.dialog=je.required("dialog"),this.rendererContainer=je.required("rendererContainer"),this.closed=Ce(),this.currentSize=be(new Ye),this.isPrintMeshLoaded=be(!1),this.frontText=be(""),this.logoColor=be("#ffffff"),this.isFileSelected=be(!1),this.secondRowVisible=be(!1),this.secondRowText=be(new Date().toLocaleDateString()),this.qrCodeVisible=be(!1),this.qrCodeText=be("maibornwolff.de/service/it-sanierung"),this.selectedPrinter=be(um[2]),this.maxWidth=be(0),this.wantedWidth=be(0),this.layerHeight=.2,this.frontTextSize=8,this.secondRowTextSize=6,this.frontPrintDepth=.6,this.mapSideOffset=10,this.baseplateHeight=1,this.logoSize=10,this.primaryShaderMaterialIndex=0,this.exportMesh=this.threeSceneService.getMapMesh().toExportMesh();let o=rm(new Ye(this.selectedPrinter().x,this.selectedPrinter().y,this.selectedPrinter().z),this.exportMesh,this.frontTextSize,this.baseplateHeight,this.mapSideOffset);this.maxWidth.set(o),this.wantedWidth.set(o),this.currentSize.update(a=>(a.x=o,a)),this.currentNumberOfColors=this.selectedPrinter().numberOfColors,this.areaMetric=this.stateAccessStore.getAreaMetric(),this.heightMetric=this.stateAccessStore.getHeightMetric(),this.colorMetric=this.stateAccessStore.getColorMetric();let r=this.stateAccessStore.getNodeMetricData();this.nodeMetricData=r.filter(a=>a.name===this.areaMetric||a.name===this.heightMetric||a.name===this.colorMetric)}async ngAfterViewInit(){let e=this.dialog().nativeElement;e.addEventListener("close",()=>this.closed.emit()),e.showModal(),await this.createScene(),this.isPrintMeshLoaded.set(!0)}close(){this.dialog().nativeElement.close()}handleScaleChange(e){this.wantedWidth.set(e),this.previewMesh.updateSize(e).then(i=>{this.qrCodeVisible.set(i)}),this.currentSize.set(this.previewMesh.getSize())}handleFrontTextChange(e){this.frontText.set(e),this.previewMesh.updateFrontText(e)}handleFileSelected(e){this.isFileSelected.set(!0);let i=new FileReader;i.readAsDataURL(e),i.onload=()=>{this.previewMesh.addCustomLogo(i.result)}}handleRotateLogo(){this.previewMesh.rotateCustomLogo()}handleFlipLogo(){this.previewMesh.flipCustomLogo()}handleRemoveLogo(){this.isFileSelected.set(!1),this.previewMesh.removeCustomLogo()}handlePrinterChange(e){this.selectedPrinter.set(e);let i=e.numberOfColors;this.currentNumberOfColors!==i&&(this.previewMesh.updateNumberOfColors(i),this.currentNumberOfColors=i),this.makeMapMaxSize(),this.updateCameraPosition(this.printPreviewScene.getObjectByName("camera"))}handleLogoColorChange(e){this.logoColor.set(e),this.previewMesh.updateCustomLogoColor(e)}handleQrCodeTextChange(e){this.qrCodeText.set(e),this.previewMesh.updateQrCodeText(e),this.previewMesh.updateQrCodeVisibility(this.qrCodeVisible())}handleQrCodeVisibilityChange(e){this.qrCodeVisible.set(e),this.previewMesh.updateQrCodeVisibility(e)}handleSecondRowTextChange(e){this.secondRowText.set(e),this.previewMesh.updateSecondRowText(e),this.previewMesh.updateSecondRowVisibility(this.secondRowVisible())}handleSecondRowVisibilityChange(e){this.secondRowVisible.set(e),this.previewMesh.updateSecondRowVisibility(e)}async createScene(){let e=new is;e.name="printPreviewScene",this.printPreviewScene=e,e.background=new Vn(15527388);let i=this.threeSceneService.scene.clone().children[3];i.name="lights",e.add(i);let o=new ts(45,1.15,50,2e5);o.name="camera",o.up=new Ye(0,0,1),e.add(o),this.initRenderer(e,o),this.previewMesh=new Ac(this.initGeometryOptions()),await this.previewMesh.initialize(),this.currentSize.set(this.previewMesh.getSize()),e.add(this.previewMesh.getThreeMesh()),this.updateCameraPosition(o)}initRenderer(e,i){let o=this.getGL(),r=this.rendererContainer().nativeElement,a=r.offsetWidth||600,s=r.offsetHeight||450;o.setSize(a,s,!0),r.appendChild(o.domElement);let l=new gs(i,o.domElement),d=function(){requestAnimationFrame(d),l.update(),o.render(e,i)};d()}getGL(){return new ls}updateCameraPosition(e){let i=this.currentSize();e.position.set(-i.x*.2,-i.y*1.2,i.z*3)}async handleDownload3MF(){let e=await Kv(this.printPreviewScene.getObjectByName("PrintMesh"));this.downloadFile(e,"3mf")}makeMapMaxSize(){let e=rm(new Ye(this.selectedPrinter().x,this.selectedPrinter().y,this.selectedPrinter().z),this.exportMesh,this.frontTextSize,this.baseplateHeight,this.mapSideOffset);this.wantedWidth.set(e),this.previewMesh.updateSize(e).then(i=>{this.qrCodeVisible.set(i)}),this.currentSize.set(this.previewMesh.getSize()),this.maxWidth.set(this.currentSize().x)}handleDownloadSTL(){let e=new Jl().parse(this.previewMesh.getMapMesh(),{binary:!0});this.downloadFile(e,"stl")}initGeometryOptions(){let e=this.stateAccessStore.getAttributeDescriptors(),i=dr,o=e[this.areaMetric]?.title||i.get(this.areaMetric),r=e[this.heightMetric]?.title||i.get(this.heightMetric),a=e[this.colorMetric]?.title||i.get(this.colorMetric);return{originalMapMesh:this.exportMesh,width:this.wantedWidth(),areaMetricTitle:o,areaMetricData:this.nodeMetricData.find(s=>s.name===this.areaMetric),heightMetricTitle:r,heightMetricData:this.nodeMetricData.find(s=>s.name===this.heightMetric),colorMetricTitle:a,colorMetricData:this.nodeMetricData.find(s=>s.name===this.colorMetric),colorRange:this.stateAccessStore.getColorRange(),frontText:this.frontText(),secondRowText:this.secondRowText(),secondRowVisible:this.secondRowVisible(),qrCodeText:this.qrCodeText(),defaultMaterial:this.exportMesh.material[this.primaryShaderMaterialIndex].clone(),numberOfColors:this.currentNumberOfColors,layerHeight:this.layerHeight,frontTextSize:this.frontTextSize,secondRowTextSize:this.secondRowTextSize,printHeight:this.frontPrintDepth,mapSideOffset:this.mapSideOffset,baseplateHeight:this.baseplateHeight,logoSize:this.logoSize}}downloadFile(e,i){let o=this.stateAccessStore.getFiles(),r=this.stateAccessStore.getAccumulatedFileName(),a=`${ms.getNewFileName(r,Ri(o))}.${i}`;yr.downloadData(e,a)}static{this.\u0275fac=function(i){return new(i||t)(te(sx),te(ft))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-export-3D-map-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialog,sC,5)(o.rendererContainer,lC,5),i&2&&it(2)},outputs:{closed:"closed"},decls:27,vars:13,consts:[["dialog",""],["rendererContainer",""],[1,"modal"],[1,"modal-box","max-w-6xl","w-11/12"],[1,"text-2xl","font-bold","mb-6"],[1,"flex","gap-6"],[1,"flex","flex-col","gap-4","w-1/3","min-w-72"],[3,"printerChanged","selectedPrinter"],[3,"widthChanged","currentSize","wantedWidth","maxWidth","selectedPrinter"],[3,"textChanged","frontText"],[3,"visibilityChanged","textChanged","isVisible","currentText"],[3,"fileSelected","logoRemoved","logoRotated","logoFlipped","colorChanged","isFileSelected","logoColor"],[1,"flex-1"],[1,"card","bg-base-200","h-full"],[1,"card-body","p-4"],[1,"card-title","text-sm"],[1,"w-full","min-h-96"],[1,"modal-action"],[3,"download3MF","downloadSTL","isPrintMeshLoaded"],[1,"btn",3,"click"],["method","dialog",1,"modal-backdrop"]],template:function(i,o){i&1&&(v(0,"dialog",2,0)(2,"div",3)(3,"h2",4),g(4,"3D Print CodeCharta Map"),b(),v(5,"div",5)(6,"div",6)(7,"cc-printer-preset-selection",7),W("printerChanged",function(a){return o.handlePrinterChange(a)}),b(),v(8,"cc-scale-slider",8),W("widthChanged",function(a){return o.handleScaleChange(a)}),b(),v(9,"cc-front-text-input",9),W("textChanged",function(a){return o.handleFrontTextChange(a)}),b(),v(10,"cc-second-row-text-input",10),W("visibilityChanged",function(a){return o.handleSecondRowVisibilityChange(a)})("textChanged",function(a){return o.handleSecondRowTextChange(a)}),b(),v(11,"cc-qr-code-settings",10),W("visibilityChanged",function(a){return o.handleQrCodeVisibilityChange(a)})("textChanged",function(a){return o.handleQrCodeTextChange(a)}),b(),v(12,"cc-logo-upload",11),W("fileSelected",function(a){return o.handleFileSelected(a)})("logoRemoved",function(){return o.handleRemoveLogo()})("logoRotated",function(){return o.handleRotateLogo()})("logoFlipped",function(){return o.handleFlipLogo()})("colorChanged",function(a){return o.handleLogoColorChange(a)}),b()(),v(13,"div",12)(14,"div",13)(15,"div",14)(16,"h3",15),g(17,"Preview"),b(),L(18,"div",16,1),b()()()(),v(20,"div",17)(21,"cc-export-actions",18),W("download3MF",function(){return o.handleDownload3MF()})("downloadSTL",function(){return o.handleDownloadSTL()}),b(),v(22,"button",19),W("click",function(){return o.close()}),g(23,"Close"),b()()(),v(24,"form",20)(25,"button"),g(26,"close"),b()()()),i&2&&(h(7),F("selectedPrinter",o.selectedPrinter()),h(),F("currentSize",o.currentSize())("wantedWidth",o.wantedWidth())("maxWidth",o.maxWidth())("selectedPrinter",o.selectedPrinter()),h(),F("frontText",o.frontText()),h(),F("isVisible",o.secondRowVisible())("currentText",o.secondRowText()),h(),F("isVisible",o.qrCodeVisible())("currentText",o.qrCodeText()),h(),F("isFileSelected",o.isFileSelected())("logoColor",o.logoColor()),h(9),F("isPrintMeshLoaded",o.isPrintMeshLoaded()))},dependencies:[ox,rx,tx,ax,nx,ix,ex],encapsulation:2,changeDetection:0})}}return t})();var lx=(()=>{class t{constructor(e,i){this.store=e,this.mapStateReadWindow=i,this.colorMode$=this.store.select(qp)}getColorMode(){return this.mapStateReadWindow.getColorMode()}setAbsoluteColorMode(){this.store.dispatch(io({value:Xt.absolute}))}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(ve))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ma=(()=>{class t{constructor(){this.colorModeStore=q(lx),this.errorDialogService=q(Wa),this.activeViewStore=q(or),this.viewReadinessStore=q(tr),this.threeRendererService=q(kt),this.router=q(hn),this.dialogOpen=be(!1),this.isDialogOpen=this.dialogOpen.asReadonly()}requestExport(){if(this.activeViewStore.currentView()!=="metrics"){this.errorDialogService.open(this.buildSwitchToMetricsViewDialog());return}if(this.colorModeStore.getColorMode()===Xt.absolute){this.dialogOpen.set(!0);return}this.errorDialogService.open(this.buildWrongColorModeDialog())}closeDialog(){this.dialogOpen.set(!1)}buildSwitchToMetricsViewDialog(){return{title:"3D export needs the Metric view",message:'<p>The 3D export builds on the rendered map, so it only works in the <strong>Metric view</strong>.<br><i class="fa fa-info-circle"></i> Use "Switch and continue" to open the Metric view and go straight to the export.<p>',resolveErrorData:{buttonText:"Switch and continue",onResolveErrorClick:()=>{this.switchToMetricsViewAndExport()}},dismissButtonText:"Stay here"}}async switchToMetricsViewAndExport(){await this.router.navigateByUrl(ki.metrics)&&this.viewReadinessStore.isStale$("metrics").pipe(Ie(i=>!i),ut(1)).subscribe(()=>this.requestExport())}buildWrongColorModeDialog(){return{title:"Map could not be exported",message:'<p>3D map can only be exported when <strong>color mode</strong> is set to <strong>absolute</strong>.<br><i class="fa fa-info-circle"></i> You can change this under Color Metric Options or use "Change and continue" to directly change the color mode and continue.<p>',resolveErrorData:{buttonText:"Change and continue",onResolveErrorClick:()=>this.recolorTheMapAndExportIt()}}}recolorTheMapAndExportIt(){this.threeRendererService.afterRender$.pipe(ut(1)).subscribe(()=>this.dialogOpen.set(!0)),this.colorModeStore.setAbsoluteColorMode()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var qr=(()=>{class t{transform(e){return ms.withoutCCExtension(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=Xi({name:"removeExtension",type:t,pure:!0})}}return t})();var cx=(t,n)=>n.fileMeta.fileName;function cC(t,n){if(t&1){let e=Me();y(0,"li",9)(1,"button",10),Y("click",function(){let o=ce(e).$implicit,r=A(2);return de(r.handleReferenceChange(o))}),y(2,"span",11),g(3),rt(4,"removeExtension"),S()()()}if(t&2){let e=n.$implicit,i=A(2);h(),Le("bg-base-200",i.isReferenceSelected(e))("font-bold",i.isReferenceSelected(e)),h(2),qe(fi(4,5,e.fileMeta.fileName))}}function dC(t,n){if(t&1&&(y(0,"div",5)(1,"ul",8),Pe(2,cC,5,7,"li",9,cx),S()()),t&2){let e=A();h(2),Ne(e.referenceOptions())}}function hC(t,n){if(t&1){let e=Me();y(0,"li",9)(1,"button",10),Y("click",function(){let o=ce(e).$implicit,r=A(2);return de(r.handleComparisonChange(o))}),y(2,"span",11),g(3),rt(4,"removeExtension"),S()()()}if(t&2){let e=n.$implicit,i=A(2);h(),Le("bg-base-200",i.isComparisonSelected(e))("font-bold",i.isComparisonSelected(e)),h(2),qe(fi(4,5,e.fileMeta.fileName))}}function mC(t,n){if(t&1&&(y(0,"div",5)(1,"ul",8),Pe(2,hC,5,7,"li",9,cx),S()()),t&2){let e=A();h(2),Ne(e.comparisonOptions())}}var dx=(()=>{class t{constructor(){this.fileStoreReadWindow=q(Te),this.navBarWriteStore=q(cr),this.elementRef=q(At),this.fileStates=D(this.fileStoreReadWindow.files$,{requireSync:!0}),this.referenceFile=D(this.fileStoreReadWindow.referenceFile$,{requireSync:!0}),this.openDropdown=be("none"),this.referenceLabel=Z(()=>{let e=this.referenceFile();return e?this.withoutExtension(e.fileMeta.fileName):"select reference file"}),this.comparisonFile=Z(()=>this.fileStates().find(e=>e.selectedAs===ii.Comparison)?.file),this.comparisonLabel=Z(()=>{let e=this.comparisonFile();return e?this.withoutExtension(e.fileMeta.fileName):"select comparison file"}),this.referenceOptions=Z(()=>this.fileStates().map(e=>e.file)),this.comparisonOptions=Z(()=>this.fileStates().filter(e=>e.selectedAs!==ii.Reference).map(e=>e.file)),this.swapDisabled=Z(()=>this.comparisonFile()===void 0)}handleDocumentClick(e){this.openDropdown()!=="none"&&e.target instanceof Node&&!this.elementRef.nativeElement.contains(e.target)&&this.openDropdown.set("none")}toggleDropdown(e){this.openDropdown.update(i=>i===e?"none":e)}handleReferenceChange(e){this.navBarWriteStore.setDeltaReference(e),this.openDropdown.set("none")}handleComparisonChange(e){this.navBarWriteStore.setDeltaComparison(e),this.openDropdown.set("none")}handleSwap(){this.swapDisabled()||this.navBarWriteStore.switchReferenceAndComparison()}isReferenceSelected(e){return this.referenceFile()?.fileMeta.fileName===e.fileMeta.fileName}isComparisonSelected(e){return this.comparisonFile()?.fileMeta.fileName===e.fileMeta.fileName}withoutExtension(e){return new qr().transform(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-delta-selector"]],hostBindings:function(i,o){i&1&&W("click",function(a){return o.handleDocumentClick(a)},Io)},decls:15,vars:9,consts:[[1,"flex","items-center","gap-1"],[1,"dropdown"],["type","button",1,"btn","btn-ghost","btn-sm","justify-between","min-w-[12rem]",3,"click"],[1,"truncate"],[1,"fa","fa-caret-down","ml-2"],[1,"dropdown-content","bg-base-100","rounded-box","border","border-base-300","shadow-md","mt-1","min-w-[12rem]","w-max","max-w-[24rem]","z-[70]","p-1"],["type","button","title","Switch reference and comparison file",1,"btn","btn-ghost","btn-sm","btn-square",3,"click","disabled"],[1,"fa","fa-arrows-h"],[1,"flex","flex-col","gap-0.5","p-0","m-0","list-none","max-h-72","overflow-y-auto"],[1,"w-full"],["type","button",1,"flex","items-center","gap-2","w-full","text-left","rounded-md","px-2","py-1","hover:bg-base-200",3,"click"],[1,"flex-1","whitespace-nowrap"]],template:function(i,o){i&1&&(y(0,"div",0)(1,"div",1)(2,"button",2),Y("click",function(){return o.toggleDropdown("reference")}),y(3,"span",3),g(4),S(),fe(5,"i",4),S(),O(6,dC,4,0,"div",5),S(),y(7,"button",6),Y("click",function(){return o.handleSwap()}),fe(8,"i",7),S(),y(9,"div",1)(10,"button",2),Y("click",function(){return o.toggleDropdown("comparison")}),y(11,"span",3),g(12),S(),fe(13,"i",4),S(),O(14,mC,4,0,"div",5),S()()),i&2&&(h(),Le("dropdown-open",o.openDropdown()==="reference"),h(3),qe(o.referenceLabel()),h(2),z(o.openDropdown()==="reference"?6:-1),h(),le("disabled",o.swapDisabled()),h(2),Le("dropdown-open",o.openDropdown()==="comparison"),h(3),qe(o.comparisonLabel()),h(2),z(o.openDropdown()==="comparison"?14:-1))},dependencies:[qr],encapsulation:2,changeDetection:0})}}return t})();var pC=(t,n)=>n.file.fileMeta.fileName;function uC(t,n){t&1&&fe(0,"i",16)}function fC(t,n){t&1&&fe(0,"i",17)}function gC(t,n){if(t&1){let e=Me();y(0,"li",8)(1,"label",12)(2,"input",13),Y("change",function(o){let r=ce(e).$implicit,a=A(2);return de(a.handleCheckboxChange(r.file,o.target.checked))}),S(),y(3,"span",14),g(4),rt(5,"removeExtension"),S(),y(6,"button",15),Y("click",function(o){let r=ce(e).$implicit,a=A(2);return de(a.handleRemoveFileToggle(r.file,o))}),O(7,uC,1,0,"i",16)(8,fC,1,0,"i",17),S()()()}if(t&2){let e=n.$implicit,i=A(2);h(2),le("checked",i.isFileSelected(e.file))("disabled",e.isRemoved),h(),Le("line-through",e.isRemoved),h(),ge(" ",fi(5,7,e.file.fileMeta.fileName)," "),h(2),le("title",e.isRemoved?"Undo remove map":"Remove map"),h(),z(e.isRemoved?7:8)}}function bC(t,n){if(t&1){let e=Me();y(0,"div",4)(1,"div",5)(2,"button",6),Y("click",function(){ce(e);let o=A();return de(o.handleSelectAll())}),g(3,"All"),S(),y(4,"button",6),Y("click",function(){ce(e);let o=A();return de(o.handleSelectNone())}),g(5,"None"),S(),y(6,"button",6),Y("click",function(){ce(e);let o=A();return de(o.handleSelectInvert())}),g(7,"Invert"),S()(),y(8,"ul",7),Pe(9,gC,9,9,"li",8,pC),S(),y(11,"div",9)(12,"span",10)(13,"button",11),Y("click",function(){ce(e);let o=A();return de(o.handleApply())}),g(14," Apply "),S()()()()}if(t&2){let e=A();h(9),Ne(e.filesInUI()),h(3),Le("tooltip-disabled",!e.applyButtonState().disabled),dt("data-tip",e.applyButtonState().tooltip||null),h(),le("disabled",e.applyButtonState().disabled)}}var hx=(()=>{class t{constructor(){this.fileStoreReadWindow=q(Te),this.navBarWriteStore=q(cr),this.elementRef=q(At),this.filesInStore=D(this.fileStoreReadWindow.files$,{requireSync:!0}),this.isOpen=be(!1),this.filesInUI=be([]),this.selectedFilesInUI=be([]),this.triggerLabel=Z(()=>{let e=this.selectedFilesInStore();return e.length===0?"Select map":e.length===1?this.withoutExtension(e[0].fileMeta.fileName):`${this.withoutExtension(e[0].fileMeta.fileName)} +${e.length-1}`}),this.applyButtonState=Z(()=>this.selectedFilesInUI().length===0?{disabled:!0,tooltip:"Select at least one map"}:this.uiSelectionDiffersFromStore()?{disabled:!1,tooltip:""}:{disabled:!0,tooltip:"No changes to apply"}),this.syncFromStore(this.filesInStore())}handleDocumentClick(e){if(!this.isOpen())return;let i=e.target;this.elementRef.nativeElement.contains(i)||this.closeWithoutApplying()}toggleOpen(){this.isOpen()?this.closeWithoutApplying():(this.syncFromStore(this.filesInStore()),this.isOpen.set(!0))}handleCheckboxChange(e,i){let o=this.selectedFilesInUI();i?(o.includes(e)||this.selectedFilesInUI.set([...o,e]),this.filesInUI.update(r=>r.map(a=>a.file===e?{file:a.file,isRemoved:!1}:a))):this.selectedFilesInUI.set(o.filter(r=>r!==e))}handleRemoveFileToggle(e,i){i.stopPropagation(),i.preventDefault(),this.filesInUI.update(o=>o.map(r=>r.file.fileMeta.fileName===e.fileMeta.fileName?{file:r.file,isRemoved:!r.isRemoved}:r)),this.selectedFilesInUI.update(o=>o.filter(r=>r.fileMeta.fileName!==e.fileMeta.fileName))}handleSelectAll(){this.selectedFilesInUI.set(this.filesInUI().filter(e=>!e.isRemoved).map(e=>e.file))}handleSelectNone(){this.selectedFilesInUI.set([])}handleSelectInvert(){let e=this.filesInUI().filter(o=>!o.isRemoved);if(e.length===0)return;let i=this.selectedFilesInUI();i.length===0?this.selectedFilesInUI.set(e.map(o=>o.file)):i.length===e.length?this.selectedFilesInUI.set([]):this.selectedFilesInUI.set(e.filter(o=>!i.includes(o.file)).map(o=>o.file))}handleApply(){let e=this.filesInUI().filter(i=>i.isRemoved).map(i=>i.file.fileMeta.fileName);this.navBarWriteStore.setStandard(this.selectedFilesInUI()),this.navBarWriteStore.removeFiles(e),this.isOpen.set(!1)}closeWithoutApplying(){this.syncFromStore(this.filesInStore()),this.isOpen.set(!1)}syncFromStore(e){this.filesInUI.set(e.map(i=>({file:i.file,isRemoved:!1}))),this.selectedFilesInUI.set(e.filter(i=>i.selectedAs===ii.Partial).map(i=>i.file))}selectedFilesInStore(){return this.filesInStore().filter(e=>e.selectedAs===ii.Partial).map(e=>e.file)}uiSelectionDiffersFromStore(){if(this.filesInUI().some(o=>o.isRemoved))return!0;let e=this.selectedFilesInStore(),i=this.selectedFilesInUI();return i.length!==e.length?!0:!i.every(o=>e.includes(o))}withoutExtension(e){return new qr().transform(e)}isFileSelected(e){return this.selectedFilesInUI().includes(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-map-selector"]],hostBindings:function(i,o){i&1&&W("click",function(a){return o.handleDocumentClick(a)},Io)},decls:6,vars:4,consts:[[1,"dropdown"],["type","button",1,"btn","btn-ghost","btn-sm","justify-between","min-w-[14rem]",3,"click"],[1,"truncate"],[1,"fa","fa-caret-down","ml-2"],[1,"dropdown-content","bg-base-100","rounded-box","border","border-base-300","shadow-md","mt-1","min-w-[14rem]","w-max","max-w-[32rem]","z-[70]","p-2"],[1,"flex","items-center","gap-1","px-1","pb-2","border-b","border-base-200"],["type","button",1,"btn","btn-ghost","btn-xs","flex-1",3,"click"],[1,"flex","flex-col","gap-0.5","p-0","m-0","list-none","max-h-72","overflow-y-auto"],[1,"w-full"],[1,"flex","justify-end","mt-2"],[1,"tooltip"],["type","button",1,"btn","btn-primary","btn-sm",3,"click","disabled"],[1,"flex","items-center","gap-2","w-full","cursor-pointer","rounded-md","px-2","py-1","hover:bg-base-200"],["type","checkbox",1,"checkbox","checkbox-xs","shrink-0",3,"change","checked","disabled"],[1,"flex-1","whitespace-nowrap"],["type","button",1,"btn","btn-ghost","btn-xs","btn-square","shrink-0",3,"click","title"],[1,"fa","fa-undo"],[1,"fa","fa-trash"]],template:function(i,o){i&1&&(y(0,"div",0)(1,"button",1),Y("click",function(){return o.toggleOpen()}),y(2,"span",2),g(3),S(),fe(4,"i",3),S(),O(5,bC,15,4,"div",4),S()),i&2&&(Le("dropdown-open",o.isOpen()),h(3),qe(o.triggerLabel()),h(2),z(o.isOpen()?5:-1))},dependencies:[qr],encapsulation:2,changeDetection:0})}}return t})();var mx=()=>{let t=document.createElement("INPUT");return t.setAttribute("type","file"),t.setAttribute("accept",".json,.gz"),t.setAttribute("multiple",""),t.style.display="none",document.body.appendChild(t),t};var fx=qa(Lx());var Tr="base";function gx(t){let{gameObjectPositions:n,cycles:e=[]}=JSON.parse(t),i={checksum:"",data:{projectName:"GameObjects",fileChecksum:"",apiVersion:"1.3",nodes:[]}},o=[{name:Tr,type:Ft.FOLDER,attributes:{},children:[]}];vC(n);let r=n.find(s=>s.name==="root"),a=_C(r.scale);n.push(a);for(let s of n){let l=s.name.split(".");l[0]!==Tr&&bx(l,o[0].children,Tr,s,n,r)}return i.data.nodes=o,i.data.edges=e.map(s=>CC(s)),i.data.attributeTypes=MC(),i.checksum=(0,fx.default)(JSON.stringify(i.data)),i}function vC(t){for(let n of t)n.name.startsWith("root")||(n.name=n.name.startsWith(".")?`root${n.name}`:`root.${n.name}`)}function bx(t,n,e,i,o,r){if(t.length===0)return;let[a]=t,s={name:a,type:px(t)?Ft.FILE:Ft.FOLDER,attributes:{}};px(t)?s=wC(a,s,i):s.children=[],xC(n,a)?s=n.find(c=>c.name===a):n.push(s);let l=o.find(c=>c.name===e);s.fixedPosition=yC(s,l,i,r.name);let d=e===Tr?s.name:`${e}.${s.name}`;bx(t.slice(1),s.children,d,i,o,r)}function px(t){return t.length===1}function xC(t,n){return t.some(e=>e.name===n)}function wC(t,n,e){let i=xe({},n);return i.attributes={height:e.scale.y},{name:t,type:Ft.FOLDER,attributes:{},children:[i]}}function yC(t,n,e,i){let o;if(t.type===Ft.FOLDER){let r=n.position.x-n.scale.x/2,a=n.position.z-n.scale.z/2,s=e.position.x-e.scale.x/2,l=e.position.z-e.scale.z/2,d=Pc((s-r)/n.scale.x*100,2),c=Pc((l-a)/n.scale.z*100,2),m=Pc(e.scale.z/n.scale.z*100,2),p=Pc(e.scale.x/n.scale.x*100,2);o={left:c,top:d,width:m,height:p}}return t.name===i&&(o=SC(o)),o}function Pc(t,n){let e=Math.pow(10,n);return Math.round(t*e)/e}function SC(t){let n=xe({},t);return n.top=Math.floor(50-n.height/2),n.left=Math.floor(50-n.width/2),n}function ux(t){let n=t.replaceAll(".","/"),i=t.split(".").slice(-1);return`/${Tr}/${n}/${i}`}function CC(t){return{fromNodeName:ux(t.from),toNodeName:ux(t.to),attributes:{coupling:100}}}function MC(){return{edges:{coupling:np.relative}}}function _C(t){let n=Math.max(t.x,t.z);return{name:Tr,position:{x:0,y:0,z:0},scale:{x:n,y:0,z:n}}}var xx=qa(Px());var vx={$id:"http://example.com/example.json",$schema:"http://json-schema.org/draft-07/schema",default:{},description:"This is the JSON Schema for the GameObjectsPositions structure",examples:[{gameObjectPositions:[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}},{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.TryCatchFinallyTest",position:{x:66,y:22.5,z:177.5},scale:{x:1,y:13,z:1}}],cycles:[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}]}],required:["gameObjectPositions"],title:"The root schema",type:"object",properties:{gameObjectPositions:{$id:"#/properties/gameObjectPositions",type:"array",title:"The gameObjectPositions schema",description:"Defines the position and scale of GameObjects",default:[],examples:[[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}},{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.SwitchCaseTest",position:{x:65,y:22,z:181},scale:{x:2,y:12,z:2}}]],additionalItems:!0,items:{$id:"#/properties/gameObjectPositions/items",anyOf:[{$id:"#/properties/gameObjectPositions/items/anyOf/0",type:"object",title:"The first anyOf schema",description:"Defines the properties of a GameObject",default:{},examples:[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}}],required:["name","position","scale"],properties:{name:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/name",type:"string",title:"The name schema",description:"An explanation about the purpose of this instance.",default:"",examples:["root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest"]},position:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position",type:"object",title:"The position schema",description:"The position in absolute values",default:{},examples:[{x:69,y:18.5,z:228.5}],required:["x","y","z"],properties:{x:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/x",type:"number",title:"The x schema",description:"x position",default:0,examples:[69]},y:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/y",type:"number",title:"The y schema",description:"y position",default:0,examples:[18.5]},z:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/z",type:"number",title:"The z schema",description:"z position",default:0,examples:[228.5]}},additionalProperties:!0},scale:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale",type:"object",title:"The scale schema",description:"The scale of GameObjects",default:{},examples:[{x:9,y:5,z:9}],required:["x","y","z"],properties:{x:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/x",type:"number",title:"The x schema",description:"x scale",default:0,examples:[9]},y:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/y",type:"number",title:"The y schema",description:"y scale",default:0,examples:[5]},z:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/z",type:"number",title:"The z schema",description:"z scale",default:0,examples:[9]}},additionalProperties:!0}},additionalProperties:!0}]}},cycles:{$id:"#/properties/cycles",type:"array",title:"The cycles schema",description:"Defines the cycles between GameObjects",default:[],examples:[[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}]],additionalItems:!0,items:{$id:"#/properties/cycles/items",anyOf:[{$id:"#/properties/cycles/items/anyOf/0",type:"object",title:"The first anyOf schema",description:"A cycle between two GameObjects",default:{},examples:[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}],required:["from","to"],properties:{from:{$id:"#/properties/cycles/items/anyOf/0/properties/from",type:"string",title:"The from schema",description:"from GameObject",default:"",examples:["root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser"]},to:{$id:"#/properties/cycles/items/anyOf/0/properties/to",type:"string",title:"The to schema",description:"to GameObject",default:"",examples:["root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"]}},additionalProperties:!0}]}}},additionalProperties:!0};function wx(t){return new xx.default({allErrors:!0,strict:!1}).validate(vx,JSON.parse(t))}var yx=t=>{let n=[];for(let e of t)n.push(kC(e));return n},kC=async t=>new Promise(n=>{let e=t.name.endsWith(".gz"),i=new FileReader;e?i.readAsArrayBuffer(t):i.readAsText(t,"utf8");let o;i.onload=r=>{let a=r.target.result.toString();o=e?Sp(r.target.result,{to:"string"}):a,a.includes("gameObjectPositions")&&wx(a)&&(o=JSON.stringify(gx(a)))},i.onloadend=()=>{n(o)}});var Sx=(()=>{class t{constructor(e){this.loadFilesUseCase=e}uploadFiles(){let e=mx();e.addEventListener("change",()=>{this.uploadFilesOnEvent(e),e.remove()}),e.addEventListener("cancel",()=>e.remove()),e.click()}async uploadFilesOnEvent(e){if(!e.files||e.files.length===0)return;let i=e.files;await this.loadFilesUseCase.loadFromUpload(()=>this.readNameDataPairs(i))}async readNameDataPairs(e){return(await Promise.all(yx(e))).map((o,r)=>({fileName:e[r].name,fileSize:e[r].size,content:cp(o)}))}static{this.\u0275fac=function(i){return new(i||t)(M(ys))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Cx=(()=>{class t{constructor(){this.uploadFilesService=q(Sx)}uploadFiles(){this.uploadFilesService.uploadFiles()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-nav-bar-folder-button"]],decls:2,vars:0,consts:[["type","button","title","Load cc.json files",1,"btn","btn-ghost","btn-square",3,"click"],[1,"fa","fa-folder-open","text-lg"]],template:function(i,o){i&1&&(y(0,"button",0),Y("click",function(){return o.uploadFiles()}),fe(1,"i",1),S())},encapsulation:2,changeDetection:0})}}return t})();var Mx=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-nav-bar-logo"]],decls:2,vars:0,consts:[["href","https://codecharta.com/","target","_blank","rel","noopener noreferrer","title","CodeCharta website",1,"flex","items-center","px-2"],["src","codeCharta/assets/codecharta_logo.svg","alt","CodeCharta",1,"h-8","w-auto"]],template:function(i,o){i&1&&(y(0,"a",0),fe(1,"img",1),S())},encapsulation:2,changeDetection:0})}}return t})();var TC=["configDialog"],_x=(()=>{class t{constructor(){this.dialog=je.required("configDialog")}showSettings(){this.dialog().open()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-settings-button"]],viewQuery:function(i,o){i&1&&tt(o.dialog,TC,5),i&2&&it()},decls:4,vars:0,consts:[["configDialog",""],["type","button","title","Global Configuration",1,"btn","btn-ghost","btn-sm",3,"click"]],template:function(i,o){i&1&&(v(0,"button",1),W("click",function(){return o.showSettings()}),g(1,` Settings
|
|
3490
|
-
`),b(),L(2,"cc-global-configuration-dialog",null,0))},dependencies:[
|
|
3491
|
-
`),
|
|
3502
|
+
</Relationships>`}async function Kv(t){let{vertices:n,triangles:e,volumes:i}=Q7(t),o=Gv(n,e),r=Xv(i),a=Qv(),s=Yv(),l=!0,d={"3D":{"3dmodel.model":an(o,l)},_rels:{".rels":an(s,l)},Metadata:{"Slic3r_PE_model.config":an(r,l)},"[Content_Types].xml":an(a,l)};return Uv(d,{comment:"created by CodeCharta"}).buffer}function Q7(t){let n=[],e=[],i=[],o=new Map,r=new Map,a=1;for(let s of t.children)Jv(s,n,e,o,a,r,i);return{vertices:n,triangles:e,volumes:i}}function Jv(t,n,e,i,o,r,a,s=void 0){if(!t.visible)return;for(let c of t.children){let m=t.matrix;s&&(m=s.clone().multiply(t.matrix)),Jv(c,n,e,i,o,r,a,m)}let l=Y7(t),d=new Map;for(let[c,m]of l.entries()){let p=e.length;Z7(n,i,d,m,t,s),K7(t.geometry,e,d,m),J7(t,c,p,e.length-1,a,o,r),o++}}function Y7(t){let n=new Map;if(t.geometry.attributes.color)for(let e=0;e<t.geometry.attributes.color.count;e++){let i=Zv(t.geometry.attributes.color,e);n.has(i)?n.get(i).push(e):n.set(i,[e])}else if(t.geometry.attributes.position){let e=t.material,i;if(e.color)i=e.color.getHexString();else if(e.isShaderMaterial){let r=e.defaultAttributeValues.color;i=Zv(r,0)}let o=Array.from({length:t.geometry.attributes.position.count},(r,a)=>a);n.set(i,o)}return n}function Z7(t,n,e,i,o,r){let a=o.geometry.attributes.position;for(let s of i){let l=new Ye(a.getX(s),a.getY(s),a.getZ(s));l.applyMatrix4(o.matrix),r&&l.applyMatrix4(r);let d=`<vertex x="${l.x}" y="${l.y}" z="${l.z}"/>`;n.has(d)?e.set(s,n.get(d)):(t.push(d),n.set(d,t.length-1),e.set(s,t.length-1))}}function K7(t,n,e,i){if(t.index){let o=t.index;for(let r=0;r<o.count;r+=3){let a=o.getX(r),s=o.getY(r),l=o.getZ(r);if(i.includes(a)&&i.includes(s)&&i.includes(l)){let d=`<triangle v1="${e.get(a)}" v2="${e.get(s)}" v3="${e.get(l)}" />`;n.push(d)}}}else for(let o=0;o<e.size;o+=3){let r=`<triangle v1="${e.get(o)}" v2="${e.get(o+1)}" v3="${e.get(o+2)}" />`;n.push(r)}}function J7(t,n,e,i,o,r,a){a.has(n)||a.set(n,a.size+1);let s=a.get(n),l=t.name==="Map"?`${t.name} 0x${n}`:t.name,d={id:r,name:l,color:n,extruder:s,firstTriangleId:e,lastTriangleId:i};o.push(d)}function Zv(t,n){return(t instanceof no?[t.getX(n),t.getY(n),t.getZ(n)]:[t[n],t[n+1],t[n+2]]).map(i=>Math.round(i*255).toString(16).padStart(2,"0")).join("")}var ex=(()=>{class t{constructor(){this.isPrintMeshLoaded=H.required(),this.download3MF=Ce(),this.downloadSTL=Ce()}handleDownload3MF(){this.download3MF.emit()}handleDownloadSTL(){this.downloadSTL.emit()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-export-actions"]],inputs:{isPrintMeshLoaded:[1,"isPrintMeshLoaded"]},outputs:{download3MF:"download3MF",downloadSTL:"downloadSTL"},decls:7,vars:2,consts:[[1,"flex","gap-2"],["title","Download 3MF Button",1,"btn","btn-primary",3,"click","disabled"],[1,"fa","fa-download"],["title","Download STL Button",1,"btn","btn-outline",3,"click","disabled"]],template:function(i,o){i&1&&(S(0,"div",0)(1,"button",1),Y("click",function(){return o.handleDownload3MF()}),fe(2,"i",2),g(3," Download 3MF "),y(),S(4,"button",3),Y("click",function(){return o.handleDownloadSTL()}),fe(5,"i",2),g(6," Download minimal STL "),y()()),i&2&&(h(),le("disabled",!o.isPrintMeshLoaded()),h(3),le("disabled",!o.isPrintMeshLoaded()))},encapsulation:2,changeDetection:0})}}return t})();var tx=(()=>{class t{constructor(){this.frontText=H(""),this.textChanged=Ce()}handleInput(e){let i=e.target;this.textChanged.emit(i.value)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-front-text-input"]],inputs:{frontText:[1,"frontText"]},outputs:{textChanged:"textChanged"},decls:5,vars:1,consts:[[1,"form-control","w-full"],[1,"label"],[1,"label-text","font-medium"],["type","text","placeholder","CodeCharta","data-testid","frontText",1,"input","input-bordered","w-full",3,"input","value"]],template:function(i,o){i&1&&(S(0,"label",0)(1,"div",1)(2,"span",2),g(3,"Bottom center label text"),y()(),S(4,"input",3),Y("input",function(a){return o.handleInput(a)}),y()()),i&2&&(h(4),le("value",o.frontText()))},encapsulation:2,changeDetection:0})}}return t})();var eC=["fileInput"];function tC(t,n){if(t&1){let e=Me();v(0,"div",5)(1,"button",6),W("click",function(){ce(e);let o=A();return de(o.handleRemoveLogo())}),L(2,"i",7),g(3," Remove "),b(),v(4,"button",8),W("click",function(){ce(e);let o=A();return de(o.handleRotateLogo())}),L(5,"i",9),g(6," Rotate "),b(),v(7,"button",10),W("click",function(){ce(e);let o=A();return de(o.handleFlipLogo())}),L(8,"i",11),g(9," Flip "),b()(),v(10,"div",12)(11,"cc-inline-color-picker",13),W("colorChange",function(o){ce(e);let r=A();return de(r.handleColorChange(o))}),b(),v(12,"span",14),g(13,"Color"),b()()}if(t&2){let e=A();h(11),F("hexColor",e.logoColor())}}var ix=(()=>{class t{constructor(){this.fileInput=je.required("fileInput"),this.isFileSelected=H.required(),this.logoColor=H("#ffffff"),this.fileSelected=Ce(),this.logoRemoved=Ce(),this.logoRotated=Ce(),this.logoFlipped=Ce(),this.colorChanged=Ce()}handleFileSelected(e){let o=e.target.files?.[0];o&&this.fileSelected.emit(o)}handleRemoveLogo(){this.fileInput().nativeElement.value="",this.logoRemoved.emit()}handleRotateLogo(){this.logoRotated.emit()}handleFlipLogo(){this.logoFlipped.emit()}handleColorChange(e){this.colorChanged.emit(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-logo-upload"]],viewQuery:function(i,o){i&1&&tt(o.fileInput,eC,5),i&2&&it()},inputs:{isFileSelected:[1,"isFileSelected"],logoColor:[1,"logoColor"]},outputs:{fileSelected:"fileSelected",logoRemoved:"logoRemoved",logoRotated:"logoRotated",logoFlipped:"logoFlipped",colorChanged:"colorChanged"},decls:7,vars:1,consts:[["fileInput",""],[1,"card","bg-base-200"],[1,"card-body","p-4"],[1,"card-title","text-sm"],["type","file","accept",".svg",1,"file-input","file-input-bordered","file-input-sm","w-full",3,"change"],[1,"flex","flex-wrap","gap-2","mt-2"],["title","Remove Logo",1,"btn","btn-sm","btn-ghost",3,"click"],[1,"fa","fa-times"],["title","Rotate Logo",1,"btn","btn-sm","btn-ghost",3,"click"],[1,"fa","fa-rotate-right"],["title","Flip Logo",1,"btn","btn-sm","btn-ghost",3,"click"],[1,"fa","fa-arrows-h"],[1,"flex","items-center","gap-2","mt-2"],["ariaLabel","Logo color",3,"colorChange","hexColor"],[1,"text-sm"]],template:function(i,o){i&1&&(v(0,"div",1)(1,"div",2)(2,"h3",3),g(3,"Bottom left logo (SVG)"),b(),v(4,"input",4,0),W("change",function(a){return o.handleFileSelected(a)}),b(),O(6,tC,14,1),b()()),i&2&&(h(6),z(o.isFileSelected()?6:-1))},dependencies:[ho],encapsulation:2,changeDetection:0})}}return t})();var iC=(t,n)=>n.name;function oC(t,n){if(t&1&&(S(0,"option",4),g(1),y()),t&2){let e=n.$implicit,i=A();le("selected",e.name===i.selectedPrinter().name),h(),Pm(" ",e.name," (",e.x/10,"\xD7",e.y/10,"\xD7",e.z/10,"cm, ",e.numberOfColors," colors) ")}}var um=[{name:"Prusa MK3S (single color)",x:245,y:205,z:205,numberOfColors:1},{name:"BambuLab A1 + AMS Lite",x:251,y:251,z:251,numberOfColors:4},{name:"Prusa XL (5 colors)",x:355,y:335,z:355,numberOfColors:5}],ox=(()=>{class t{constructor(){this.selectedPrinter=H.required(),this.printerChanged=Ce(),this.printers=um}handlePrinterChange(e){let i=e.target,o=this.printers[i.selectedIndex];this.printerChanged.emit(o)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-printer-preset-selection"]],inputs:{selectedPrinter:[1,"selectedPrinter"]},outputs:{printerChanged:"printerChanged"},decls:7,vars:0,consts:[[1,"form-control","w-full"],[1,"label"],[1,"label-text","font-medium"],["data-testid","selectPrinter",1,"select","select-bordered","w-full",3,"change"],["data-testid","selectedPrinter",3,"selected"]],template:function(i,o){i&1&&(S(0,"label",0)(1,"div",1)(2,"span",2),g(3,"Printer preset"),y()(),S(4,"select",3),Y("change",function(a){return o.handlePrinterChange(a)}),Pe(5,oC,2,6,"option",4,iC),y()()),i&2&&(h(5),Ne(o.printers))},encapsulation:2,changeDetection:0})}}return t})();function nC(t,n){if(t&1){let e=Me();S(0,"input",7),Y("input",function(o){ce(e);let r=A();return de(r.handleTextInput(o))}),y()}if(t&2){let e=A();le("value",e.currentText())}}var nx=(()=>{class t{constructor(){this.isVisible=H.required(),this.currentText=H(""),this.visibilityChanged=Ce(),this.textChanged=Ce()}handleToggleChange(e){let i=e.target;this.visibilityChanged.emit(i.checked)}handleTextInput(e){let i=e.target;this.textChanged.emit(i.value)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-qr-code-settings"]],inputs:{isVisible:[1,"isVisible"],currentText:[1,"currentText"]},outputs:{visibilityChanged:"visibilityChanged",textChanged:"textChanged"},decls:9,vars:2,consts:[[1,"card","bg-base-200"],[1,"card-body","p-4"],[1,"card-title","text-sm"],[1,"label","cursor-pointer","justify-start","gap-4"],["type","checkbox","data-testid","qrCodeToggle",1,"toggle","toggle-primary","toggle-sm",3,"change","checked"],[1,"label-text"],["type","text","placeholder","URL for QR code","data-testid","qrCodeText",1,"input","input-bordered","input-sm","w-full",3,"value"],["type","text","placeholder","URL for QR code","data-testid","qrCodeText",1,"input","input-bordered","input-sm","w-full",3,"input","value"]],template:function(i,o){i&1&&(S(0,"div",0)(1,"div",1)(2,"h3",2),g(3,"QR-Code"),y(),S(4,"label",3)(5,"input",4),Y("change",function(a){return o.handleToggleChange(a)}),y(),S(6,"span",5),g(7,"Show QR-Code"),y()(),O(8,nC,1,1,"input",6),y()()),i&2&&(h(5),le("checked",o.isVisible()),h(3),z(o.isVisible()?8:-1))},encapsulation:2,changeDetection:0})}}return t})();var rx=(()=>{class t{constructor(){this.currentSize=H.required(),this.wantedWidth=H.required(),this.maxWidth=H.required(),this.selectedPrinter=H.required(),this.widthChanged=Ce()}handleSliderChange(e){let i=e.target;this.widthChanged.emit(Number(i.value))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-scale-slider"]],inputs:{currentSize:[1,"currentSize"],wantedWidth:[1,"wantedWidth"],maxWidth:[1,"maxWidth"],selectedPrinter:[1,"selectedPrinter"]},outputs:{widthChanged:"widthChanged"},decls:12,vars:9,consts:[[1,"card","bg-base-200"],[1,"card-body","p-4"],[1,"card-title","text-sm"],["type","range","data-testid","onScaleChange",1,"range","range-primary","range-sm",3,"change","min","max","value"],["data-testid","printSizeOverview",1,"text-sm","mt-2"]],template:function(i,o){i&1&&(S(0,"div",0)(1,"div",1)(2,"h3",2),g(3,"Scale"),y(),S(4,"input",3),Y("change",function(a){return o.handleSliderChange(a)}),y(),S(5,"div",4)(6,"div"),g(7),y(),S(8,"div"),g(9),y(),S(10,"div"),g(11),y()()()()),i&2&&(h(4),le("min",100)("max",o.maxWidth())("value",o.wantedWidth()),h(3),Yi("Width: ",(o.currentSize().x/10).toFixed(1),"cm (max. ",(o.selectedPrinter().x/10).toFixed(1),")"),h(2),Yi("Depth: ",(o.currentSize().y/10).toFixed(1),"cm (max. ",(o.selectedPrinter().y/10).toFixed(1),")"),h(2),Yi("Height: ",(o.currentSize().z/10).toFixed(1),"cm (max. ",(o.selectedPrinter().z/10).toFixed(1),")"))},encapsulation:2,changeDetection:0})}}return t})();function rC(t,n){if(t&1){let e=Me();S(0,"input",7),Y("input",function(o){ce(e);let r=A();return de(r.handleTextInput(o))}),y()}if(t&2){let e=A();le("value",e.currentText())}}var ax=(()=>{class t{constructor(){this.isVisible=H.required(),this.currentText=H(""),this.visibilityChanged=Ce(),this.textChanged=Ce()}handleToggleChange(e){let i=e.target;this.visibilityChanged.emit(i.checked)}handleTextInput(e){let i=e.target;this.textChanged.emit(i.value)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-second-row-text-input"]],inputs:{isVisible:[1,"isVisible"],currentText:[1,"currentText"]},outputs:{visibilityChanged:"visibilityChanged",textChanged:"textChanged"},decls:9,vars:2,consts:[[1,"card","bg-base-200"],[1,"card-body","p-4"],[1,"card-title","text-sm"],[1,"label","cursor-pointer","justify-start","gap-4"],["type","checkbox","data-testid","secondRowToggle",1,"toggle","toggle-primary","toggle-sm",3,"change","checked"],[1,"label-text"],["type","text","data-testid","secondRowText",1,"input","input-bordered","input-sm","w-full",3,"value"],["type","text","data-testid","secondRowText",1,"input","input-bordered","input-sm","w-full",3,"input","value"]],template:function(i,o){i&1&&(S(0,"div",0)(1,"div",1)(2,"h3",2),g(3,"Second row center text"),y(),S(4,"label",3)(5,"input",4),Y("change",function(a){return o.handleToggleChange(a)}),y(),S(6,"span",5),g(7,"Show second row text"),y()(),O(8,rC,1,1,"input",6),y()()),i&2&&(h(5),le("checked",o.isVisible()),h(3),z(o.isVisible()?8:-1))},encapsulation:2,changeDetection:0})}}return t})();var sx=(()=>{class t{constructor(e,i,o,r,a){this.mapStateReadWindow=e,this.metricsLensSourceReadWindow=i,this.sharedViewReadWindow=o,this.fileStoreReadWindow=r,this.ccStateSnapshot=a}getAreaMetric(){return this.mapStateReadWindow.getAreaMetric()}getHeightMetric(){return this.mapStateReadWindow.getHeightMetric()}getColorMetric(){return this.mapStateReadWindow.getColorMetric()}getColorRange(){return this.mapStateReadWindow.getColorRange()}getAttributeDescriptors(){return this.metricsLensSourceReadWindow.getAttributeDescriptors()}getNodeMetricData(){return ao(this.ccStateSnapshot.get())}getBlacklist(){return this.sharedViewReadWindow.getBlacklist()}getFiles(){return this.fileStoreReadWindow.getFiles()}getAccumulatedFileName(){return Et(this.ccStateSnapshot.get()).unifiedFileMeta?.fileName}static{this.\u0275fac=function(i){return new(i||t)(M(ve),M(hs),M(Nt),M(Te),M(Bt))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var sC=["dialog"],lC=["rendererContainer"],fm=(()=>{class t{constructor(e,i){this.stateAccessStore=e,this.threeSceneService=i,this.dialog=je.required("dialog"),this.rendererContainer=je.required("rendererContainer"),this.closed=Ce(),this.currentSize=be(new Ye),this.isPrintMeshLoaded=be(!1),this.frontText=be(""),this.logoColor=be("#ffffff"),this.isFileSelected=be(!1),this.secondRowVisible=be(!1),this.secondRowText=be(new Date().toLocaleDateString()),this.qrCodeVisible=be(!1),this.qrCodeText=be("maibornwolff.de/service/it-sanierung"),this.selectedPrinter=be(um[2]),this.maxWidth=be(0),this.wantedWidth=be(0),this.layerHeight=.2,this.frontTextSize=8,this.secondRowTextSize=6,this.frontPrintDepth=.6,this.mapSideOffset=10,this.baseplateHeight=1,this.logoSize=10,this.primaryShaderMaterialIndex=0,this.exportMesh=this.threeSceneService.getMapMesh().toExportMesh();let o=rm(new Ye(this.selectedPrinter().x,this.selectedPrinter().y,this.selectedPrinter().z),this.exportMesh,this.frontTextSize,this.baseplateHeight,this.mapSideOffset);this.maxWidth.set(o),this.wantedWidth.set(o),this.currentSize.update(a=>(a.x=o,a)),this.currentNumberOfColors=this.selectedPrinter().numberOfColors,this.areaMetric=this.stateAccessStore.getAreaMetric(),this.heightMetric=this.stateAccessStore.getHeightMetric(),this.colorMetric=this.stateAccessStore.getColorMetric();let r=this.stateAccessStore.getNodeMetricData();this.nodeMetricData=r.filter(a=>a.name===this.areaMetric||a.name===this.heightMetric||a.name===this.colorMetric)}async ngAfterViewInit(){let e=this.dialog().nativeElement;e.addEventListener("close",()=>this.closed.emit()),e.showModal(),await this.createScene(),this.isPrintMeshLoaded.set(!0)}close(){this.dialog().nativeElement.close()}handleScaleChange(e){this.wantedWidth.set(e),this.previewMesh.updateSize(e).then(i=>{this.qrCodeVisible.set(i)}),this.currentSize.set(this.previewMesh.getSize())}handleFrontTextChange(e){this.frontText.set(e),this.previewMesh.updateFrontText(e)}handleFileSelected(e){this.isFileSelected.set(!0);let i=new FileReader;i.readAsDataURL(e),i.onload=()=>{this.previewMesh.addCustomLogo(i.result)}}handleRotateLogo(){this.previewMesh.rotateCustomLogo()}handleFlipLogo(){this.previewMesh.flipCustomLogo()}handleRemoveLogo(){this.isFileSelected.set(!1),this.previewMesh.removeCustomLogo()}handlePrinterChange(e){this.selectedPrinter.set(e);let i=e.numberOfColors;this.currentNumberOfColors!==i&&(this.previewMesh.updateNumberOfColors(i),this.currentNumberOfColors=i),this.makeMapMaxSize(),this.updateCameraPosition(this.printPreviewScene.getObjectByName("camera"))}handleLogoColorChange(e){this.logoColor.set(e),this.previewMesh.updateCustomLogoColor(e)}handleQrCodeTextChange(e){this.qrCodeText.set(e),this.previewMesh.updateQrCodeText(e),this.previewMesh.updateQrCodeVisibility(this.qrCodeVisible())}handleQrCodeVisibilityChange(e){this.qrCodeVisible.set(e),this.previewMesh.updateQrCodeVisibility(e)}handleSecondRowTextChange(e){this.secondRowText.set(e),this.previewMesh.updateSecondRowText(e),this.previewMesh.updateSecondRowVisibility(this.secondRowVisible())}handleSecondRowVisibilityChange(e){this.secondRowVisible.set(e),this.previewMesh.updateSecondRowVisibility(e)}async createScene(){let e=new is;e.name="printPreviewScene",this.printPreviewScene=e,e.background=new Vn(15527388);let i=this.threeSceneService.scene.clone().children[3];i.name="lights",e.add(i);let o=new ts(45,1.15,50,2e5);o.name="camera",o.up=new Ye(0,0,1),e.add(o),this.initRenderer(e,o),this.previewMesh=new Ac(this.initGeometryOptions()),await this.previewMesh.initialize(),this.currentSize.set(this.previewMesh.getSize()),e.add(this.previewMesh.getThreeMesh()),this.updateCameraPosition(o)}initRenderer(e,i){let o=this.getGL(),r=this.rendererContainer().nativeElement,a=r.offsetWidth||600,s=r.offsetHeight||450;o.setSize(a,s,!0),r.appendChild(o.domElement);let l=new gs(i,o.domElement),d=function(){requestAnimationFrame(d),l.update(),o.render(e,i)};d()}getGL(){return new ls}updateCameraPosition(e){let i=this.currentSize();e.position.set(-i.x*.2,-i.y*1.2,i.z*3)}async handleDownload3MF(){let e=await Kv(this.printPreviewScene.getObjectByName("PrintMesh"));this.downloadFile(e,"3mf")}makeMapMaxSize(){let e=rm(new Ye(this.selectedPrinter().x,this.selectedPrinter().y,this.selectedPrinter().z),this.exportMesh,this.frontTextSize,this.baseplateHeight,this.mapSideOffset);this.wantedWidth.set(e),this.previewMesh.updateSize(e).then(i=>{this.qrCodeVisible.set(i)}),this.currentSize.set(this.previewMesh.getSize()),this.maxWidth.set(this.currentSize().x)}handleDownloadSTL(){let e=new Jl().parse(this.previewMesh.getMapMesh(),{binary:!0});this.downloadFile(e,"stl")}initGeometryOptions(){let e=this.stateAccessStore.getAttributeDescriptors(),i=dr,o=e[this.areaMetric]?.title||i.get(this.areaMetric),r=e[this.heightMetric]?.title||i.get(this.heightMetric),a=e[this.colorMetric]?.title||i.get(this.colorMetric);return{originalMapMesh:this.exportMesh,width:this.wantedWidth(),areaMetricTitle:o,areaMetricData:this.nodeMetricData.find(s=>s.name===this.areaMetric),heightMetricTitle:r,heightMetricData:this.nodeMetricData.find(s=>s.name===this.heightMetric),colorMetricTitle:a,colorMetricData:this.nodeMetricData.find(s=>s.name===this.colorMetric),colorRange:this.stateAccessStore.getColorRange(),frontText:this.frontText(),secondRowText:this.secondRowText(),secondRowVisible:this.secondRowVisible(),qrCodeText:this.qrCodeText(),defaultMaterial:this.exportMesh.material[this.primaryShaderMaterialIndex].clone(),numberOfColors:this.currentNumberOfColors,layerHeight:this.layerHeight,frontTextSize:this.frontTextSize,secondRowTextSize:this.secondRowTextSize,printHeight:this.frontPrintDepth,mapSideOffset:this.mapSideOffset,baseplateHeight:this.baseplateHeight,logoSize:this.logoSize}}downloadFile(e,i){let o=this.stateAccessStore.getFiles(),r=this.stateAccessStore.getAccumulatedFileName(),a=`${ms.getNewFileName(r,Ri(o))}.${i}`;Sr.downloadData(e,a)}static{this.\u0275fac=function(i){return new(i||t)(te(sx),te(ft))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-export-3D-map-dialog"]],viewQuery:function(i,o){i&1&&tt(o.dialog,sC,5)(o.rendererContainer,lC,5),i&2&&it(2)},outputs:{closed:"closed"},decls:27,vars:13,consts:[["dialog",""],["rendererContainer",""],[1,"modal"],[1,"modal-box","max-w-6xl","w-11/12"],[1,"text-2xl","font-bold","mb-6"],[1,"flex","gap-6"],[1,"flex","flex-col","gap-4","w-1/3","min-w-72"],[3,"printerChanged","selectedPrinter"],[3,"widthChanged","currentSize","wantedWidth","maxWidth","selectedPrinter"],[3,"textChanged","frontText"],[3,"visibilityChanged","textChanged","isVisible","currentText"],[3,"fileSelected","logoRemoved","logoRotated","logoFlipped","colorChanged","isFileSelected","logoColor"],[1,"flex-1"],[1,"card","bg-base-200","h-full"],[1,"card-body","p-4"],[1,"card-title","text-sm"],[1,"w-full","min-h-96"],[1,"modal-action"],[3,"download3MF","downloadSTL","isPrintMeshLoaded"],[1,"btn",3,"click"],["method","dialog",1,"modal-backdrop"]],template:function(i,o){i&1&&(v(0,"dialog",2,0)(2,"div",3)(3,"h2",4),g(4,"3D Print CodeCharta Map"),b(),v(5,"div",5)(6,"div",6)(7,"cc-printer-preset-selection",7),W("printerChanged",function(a){return o.handlePrinterChange(a)}),b(),v(8,"cc-scale-slider",8),W("widthChanged",function(a){return o.handleScaleChange(a)}),b(),v(9,"cc-front-text-input",9),W("textChanged",function(a){return o.handleFrontTextChange(a)}),b(),v(10,"cc-second-row-text-input",10),W("visibilityChanged",function(a){return o.handleSecondRowVisibilityChange(a)})("textChanged",function(a){return o.handleSecondRowTextChange(a)}),b(),v(11,"cc-qr-code-settings",10),W("visibilityChanged",function(a){return o.handleQrCodeVisibilityChange(a)})("textChanged",function(a){return o.handleQrCodeTextChange(a)}),b(),v(12,"cc-logo-upload",11),W("fileSelected",function(a){return o.handleFileSelected(a)})("logoRemoved",function(){return o.handleRemoveLogo()})("logoRotated",function(){return o.handleRotateLogo()})("logoFlipped",function(){return o.handleFlipLogo()})("colorChanged",function(a){return o.handleLogoColorChange(a)}),b()(),v(13,"div",12)(14,"div",13)(15,"div",14)(16,"h3",15),g(17,"Preview"),b(),L(18,"div",16,1),b()()()(),v(20,"div",17)(21,"cc-export-actions",18),W("download3MF",function(){return o.handleDownload3MF()})("downloadSTL",function(){return o.handleDownloadSTL()}),b(),v(22,"button",19),W("click",function(){return o.close()}),g(23,"Close"),b()()(),v(24,"form",20)(25,"button"),g(26,"close"),b()()()),i&2&&(h(7),F("selectedPrinter",o.selectedPrinter()),h(),F("currentSize",o.currentSize())("wantedWidth",o.wantedWidth())("maxWidth",o.maxWidth())("selectedPrinter",o.selectedPrinter()),h(),F("frontText",o.frontText()),h(),F("isVisible",o.secondRowVisible())("currentText",o.secondRowText()),h(),F("isVisible",o.qrCodeVisible())("currentText",o.qrCodeText()),h(),F("isFileSelected",o.isFileSelected())("logoColor",o.logoColor()),h(9),F("isPrintMeshLoaded",o.isPrintMeshLoaded()))},dependencies:[ox,rx,tx,ax,nx,ix,ex],encapsulation:2,changeDetection:0})}}return t})();var lx=(()=>{class t{constructor(e,i){this.store=e,this.mapStateReadWindow=i,this.colorMode$=this.store.select(qp)}getColorMode(){return this.mapStateReadWindow.getColorMode()}setAbsoluteColorMode(){this.store.dispatch(io({value:Xt.absolute}))}static{this.\u0275fac=function(i){return new(i||t)(M(he),M(ve))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ma=(()=>{class t{constructor(){this.colorModeStore=q(lx),this.errorDialogService=q(Wa),this.activeViewStore=q(or),this.viewReadinessStore=q(tr),this.threeRendererService=q(kt),this.router=q(hn),this.dialogOpen=be(!1),this.isDialogOpen=this.dialogOpen.asReadonly()}requestExport(){if(this.activeViewStore.currentView()!=="metrics"){this.errorDialogService.open(this.buildSwitchToMetricsViewDialog());return}if(this.colorModeStore.getColorMode()===Xt.absolute){this.dialogOpen.set(!0);return}this.errorDialogService.open(this.buildWrongColorModeDialog())}closeDialog(){this.dialogOpen.set(!1)}buildSwitchToMetricsViewDialog(){return{title:"3D export needs the Metric view",message:'<p>The 3D export builds on the rendered map, so it only works in the <strong>Metric view</strong>.<br><i class="fa fa-info-circle"></i> Use "Switch and continue" to open the Metric view and go straight to the export.<p>',resolveErrorData:{buttonText:"Switch and continue",onResolveErrorClick:()=>{this.switchToMetricsViewAndExport()}},dismissButtonText:"Stay here"}}async switchToMetricsViewAndExport(){await this.router.navigateByUrl(ki.metrics)&&this.viewReadinessStore.isStale$("metrics").pipe(Ie(i=>!i),ut(1)).subscribe(()=>this.requestExport())}buildWrongColorModeDialog(){return{title:"Map could not be exported",message:'<p>3D map can only be exported when <strong>color mode</strong> is set to <strong>absolute</strong>.<br><i class="fa fa-info-circle"></i> You can change this under Color Metric Options or use "Change and continue" to directly change the color mode and continue.<p>',resolveErrorData:{buttonText:"Change and continue",onResolveErrorClick:()=>this.recolorTheMapAndExportIt()}}}recolorTheMapAndExportIt(){this.threeRendererService.afterRender$.pipe(ut(1)).subscribe(()=>this.dialogOpen.set(!0)),this.colorModeStore.setAbsoluteColorMode()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var qr=(()=>{class t{transform(e){return ms.withoutCCExtension(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=Xi({name:"removeExtension",type:t,pure:!0})}}return t})();var cx=(t,n)=>n.fileMeta.fileName;function cC(t,n){if(t&1){let e=Me();S(0,"li",9)(1,"button",10),Y("click",function(){let o=ce(e).$implicit,r=A(2);return de(r.handleReferenceChange(o))}),S(2,"span",11),g(3),rt(4,"removeExtension"),y()()()}if(t&2){let e=n.$implicit,i=A(2);h(),Le("bg-base-200",i.isReferenceSelected(e))("font-bold",i.isReferenceSelected(e)),h(2),qe(fi(4,5,e.fileMeta.fileName))}}function dC(t,n){if(t&1&&(S(0,"div",5)(1,"ul",8),Pe(2,cC,5,7,"li",9,cx),y()()),t&2){let e=A();h(2),Ne(e.referenceOptions())}}function hC(t,n){if(t&1){let e=Me();S(0,"li",9)(1,"button",10),Y("click",function(){let o=ce(e).$implicit,r=A(2);return de(r.handleComparisonChange(o))}),S(2,"span",11),g(3),rt(4,"removeExtension"),y()()()}if(t&2){let e=n.$implicit,i=A(2);h(),Le("bg-base-200",i.isComparisonSelected(e))("font-bold",i.isComparisonSelected(e)),h(2),qe(fi(4,5,e.fileMeta.fileName))}}function mC(t,n){if(t&1&&(S(0,"div",5)(1,"ul",8),Pe(2,hC,5,7,"li",9,cx),y()()),t&2){let e=A();h(2),Ne(e.comparisonOptions())}}var dx=(()=>{class t{constructor(){this.fileStoreReadWindow=q(Te),this.navBarWriteStore=q(cr),this.elementRef=q(At),this.fileStates=D(this.fileStoreReadWindow.files$,{requireSync:!0}),this.referenceFile=D(this.fileStoreReadWindow.referenceFile$,{requireSync:!0}),this.openDropdown=be("none"),this.referenceLabel=Z(()=>{let e=this.referenceFile();return e?this.withoutExtension(e.fileMeta.fileName):"select reference file"}),this.comparisonFile=Z(()=>this.fileStates().find(e=>e.selectedAs===ii.Comparison)?.file),this.comparisonLabel=Z(()=>{let e=this.comparisonFile();return e?this.withoutExtension(e.fileMeta.fileName):"select comparison file"}),this.referenceOptions=Z(()=>this.fileStates().map(e=>e.file)),this.comparisonOptions=Z(()=>this.fileStates().filter(e=>e.selectedAs!==ii.Reference).map(e=>e.file)),this.swapDisabled=Z(()=>this.comparisonFile()===void 0)}handleDocumentClick(e){this.openDropdown()!=="none"&&e.target instanceof Node&&!this.elementRef.nativeElement.contains(e.target)&&this.openDropdown.set("none")}toggleDropdown(e){this.openDropdown.update(i=>i===e?"none":e)}handleReferenceChange(e){this.navBarWriteStore.setDeltaReference(e),this.openDropdown.set("none")}handleComparisonChange(e){this.navBarWriteStore.setDeltaComparison(e),this.openDropdown.set("none")}handleSwap(){this.swapDisabled()||this.navBarWriteStore.switchReferenceAndComparison()}isReferenceSelected(e){return this.referenceFile()?.fileMeta.fileName===e.fileMeta.fileName}isComparisonSelected(e){return this.comparisonFile()?.fileMeta.fileName===e.fileMeta.fileName}withoutExtension(e){return new qr().transform(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-delta-selector"]],hostBindings:function(i,o){i&1&&W("click",function(a){return o.handleDocumentClick(a)},Io)},decls:15,vars:9,consts:[[1,"flex","items-center","gap-1"],[1,"dropdown"],["type","button",1,"btn","btn-ghost","btn-sm","justify-between","min-w-[12rem]",3,"click"],[1,"truncate"],[1,"fa","fa-caret-down","ml-2"],[1,"dropdown-content","bg-base-100","rounded-box","border","border-base-300","shadow-md","mt-1","min-w-[12rem]","w-max","max-w-[24rem]","z-[70]","p-1"],["type","button","title","Switch reference and comparison file",1,"btn","btn-ghost","btn-sm","btn-square",3,"click","disabled"],[1,"fa","fa-arrows-h"],[1,"flex","flex-col","gap-0.5","p-0","m-0","list-none","max-h-72","overflow-y-auto"],[1,"w-full"],["type","button",1,"flex","items-center","gap-2","w-full","text-left","rounded-md","px-2","py-1","hover:bg-base-200",3,"click"],[1,"flex-1","whitespace-nowrap"]],template:function(i,o){i&1&&(S(0,"div",0)(1,"div",1)(2,"button",2),Y("click",function(){return o.toggleDropdown("reference")}),S(3,"span",3),g(4),y(),fe(5,"i",4),y(),O(6,dC,4,0,"div",5),y(),S(7,"button",6),Y("click",function(){return o.handleSwap()}),fe(8,"i",7),y(),S(9,"div",1)(10,"button",2),Y("click",function(){return o.toggleDropdown("comparison")}),S(11,"span",3),g(12),y(),fe(13,"i",4),y(),O(14,mC,4,0,"div",5),y()()),i&2&&(h(),Le("dropdown-open",o.openDropdown()==="reference"),h(3),qe(o.referenceLabel()),h(2),z(o.openDropdown()==="reference"?6:-1),h(),le("disabled",o.swapDisabled()),h(2),Le("dropdown-open",o.openDropdown()==="comparison"),h(3),qe(o.comparisonLabel()),h(2),z(o.openDropdown()==="comparison"?14:-1))},dependencies:[qr],encapsulation:2,changeDetection:0})}}return t})();var pC=(t,n)=>n.file.fileMeta.fileName;function uC(t,n){t&1&&fe(0,"i",16)}function fC(t,n){t&1&&fe(0,"i",17)}function gC(t,n){if(t&1){let e=Me();S(0,"li",8)(1,"label",12)(2,"input",13),Y("change",function(o){let r=ce(e).$implicit,a=A(2);return de(a.handleCheckboxChange(r.file,o.target.checked))}),y(),S(3,"span",14),g(4),rt(5,"removeExtension"),y(),S(6,"button",15),Y("click",function(o){let r=ce(e).$implicit,a=A(2);return de(a.handleRemoveFileToggle(r.file,o))}),O(7,uC,1,0,"i",16)(8,fC,1,0,"i",17),y()()()}if(t&2){let e=n.$implicit,i=A(2);h(2),le("checked",i.isFileSelected(e.file))("disabled",e.isRemoved),h(),Le("line-through",e.isRemoved),h(),ge(" ",fi(5,7,e.file.fileMeta.fileName)," "),h(2),le("title",e.isRemoved?"Undo remove map":"Remove map"),h(),z(e.isRemoved?7:8)}}function bC(t,n){if(t&1){let e=Me();S(0,"div",4)(1,"div",5)(2,"button",6),Y("click",function(){ce(e);let o=A();return de(o.handleSelectAll())}),g(3,"All"),y(),S(4,"button",6),Y("click",function(){ce(e);let o=A();return de(o.handleSelectNone())}),g(5,"None"),y(),S(6,"button",6),Y("click",function(){ce(e);let o=A();return de(o.handleSelectInvert())}),g(7,"Invert"),y()(),S(8,"ul",7),Pe(9,gC,9,9,"li",8,pC),y(),S(11,"div",9)(12,"span",10)(13,"button",11),Y("click",function(){ce(e);let o=A();return de(o.handleApply())}),g(14," Apply "),y()()()()}if(t&2){let e=A();h(9),Ne(e.filesInUI()),h(3),Le("tooltip-disabled",!e.applyButtonState().disabled),dt("data-tip",e.applyButtonState().tooltip||null),h(),le("disabled",e.applyButtonState().disabled)}}var hx=(()=>{class t{constructor(){this.fileStoreReadWindow=q(Te),this.navBarWriteStore=q(cr),this.elementRef=q(At),this.filesInStore=D(this.fileStoreReadWindow.files$,{requireSync:!0}),this.isOpen=be(!1),this.filesInUI=be([]),this.selectedFilesInUI=be([]),this.triggerLabel=Z(()=>{let e=this.selectedFilesInStore();return e.length===0?"Select map":e.length===1?this.withoutExtension(e[0].fileMeta.fileName):`${this.withoutExtension(e[0].fileMeta.fileName)} +${e.length-1}`}),this.applyButtonState=Z(()=>this.selectedFilesInUI().length===0?{disabled:!0,tooltip:"Select at least one map"}:this.uiSelectionDiffersFromStore()?{disabled:!1,tooltip:""}:{disabled:!0,tooltip:"No changes to apply"}),this.syncFromStore(this.filesInStore())}handleDocumentClick(e){if(!this.isOpen())return;let i=e.target;this.elementRef.nativeElement.contains(i)||this.closeWithoutApplying()}toggleOpen(){this.isOpen()?this.closeWithoutApplying():(this.syncFromStore(this.filesInStore()),this.isOpen.set(!0))}handleCheckboxChange(e,i){let o=this.selectedFilesInUI();i?(o.includes(e)||this.selectedFilesInUI.set([...o,e]),this.filesInUI.update(r=>r.map(a=>a.file===e?{file:a.file,isRemoved:!1}:a))):this.selectedFilesInUI.set(o.filter(r=>r!==e))}handleRemoveFileToggle(e,i){i.stopPropagation(),i.preventDefault(),this.filesInUI.update(o=>o.map(r=>r.file.fileMeta.fileName===e.fileMeta.fileName?{file:r.file,isRemoved:!r.isRemoved}:r)),this.selectedFilesInUI.update(o=>o.filter(r=>r.fileMeta.fileName!==e.fileMeta.fileName))}handleSelectAll(){this.selectedFilesInUI.set(this.filesInUI().filter(e=>!e.isRemoved).map(e=>e.file))}handleSelectNone(){this.selectedFilesInUI.set([])}handleSelectInvert(){let e=this.filesInUI().filter(o=>!o.isRemoved);if(e.length===0)return;let i=this.selectedFilesInUI();i.length===0?this.selectedFilesInUI.set(e.map(o=>o.file)):i.length===e.length?this.selectedFilesInUI.set([]):this.selectedFilesInUI.set(e.filter(o=>!i.includes(o.file)).map(o=>o.file))}handleApply(){let e=this.filesInUI().filter(i=>i.isRemoved).map(i=>i.file.fileMeta.fileName);this.navBarWriteStore.setStandard(this.selectedFilesInUI()),this.navBarWriteStore.removeFiles(e),this.isOpen.set(!1)}closeWithoutApplying(){this.syncFromStore(this.filesInStore()),this.isOpen.set(!1)}syncFromStore(e){this.filesInUI.set(e.map(i=>({file:i.file,isRemoved:!1}))),this.selectedFilesInUI.set(e.filter(i=>i.selectedAs===ii.Partial).map(i=>i.file))}selectedFilesInStore(){return this.filesInStore().filter(e=>e.selectedAs===ii.Partial).map(e=>e.file)}uiSelectionDiffersFromStore(){if(this.filesInUI().some(o=>o.isRemoved))return!0;let e=this.selectedFilesInStore(),i=this.selectedFilesInUI();return i.length!==e.length?!0:!i.every(o=>e.includes(o))}withoutExtension(e){return new qr().transform(e)}isFileSelected(e){return this.selectedFilesInUI().includes(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-map-selector"]],hostBindings:function(i,o){i&1&&W("click",function(a){return o.handleDocumentClick(a)},Io)},decls:6,vars:4,consts:[[1,"dropdown"],["type","button",1,"btn","btn-ghost","btn-sm","justify-between","min-w-[14rem]",3,"click"],[1,"truncate"],[1,"fa","fa-caret-down","ml-2"],[1,"dropdown-content","bg-base-100","rounded-box","border","border-base-300","shadow-md","mt-1","min-w-[14rem]","w-max","max-w-[32rem]","z-[70]","p-2"],[1,"flex","items-center","gap-1","px-1","pb-2","border-b","border-base-200"],["type","button",1,"btn","btn-ghost","btn-xs","flex-1",3,"click"],[1,"flex","flex-col","gap-0.5","p-0","m-0","list-none","max-h-72","overflow-y-auto"],[1,"w-full"],[1,"flex","justify-end","mt-2"],[1,"tooltip"],["type","button",1,"btn","btn-primary","btn-sm",3,"click","disabled"],[1,"flex","items-center","gap-2","w-full","cursor-pointer","rounded-md","px-2","py-1","hover:bg-base-200"],["type","checkbox",1,"checkbox","checkbox-xs","shrink-0",3,"change","checked","disabled"],[1,"flex-1","whitespace-nowrap"],["type","button",1,"btn","btn-ghost","btn-xs","btn-square","shrink-0",3,"click","title"],[1,"fa","fa-undo"],[1,"fa","fa-trash"]],template:function(i,o){i&1&&(S(0,"div",0)(1,"button",1),Y("click",function(){return o.toggleOpen()}),S(2,"span",2),g(3),y(),fe(4,"i",3),y(),O(5,bC,15,4,"div",4),y()),i&2&&(Le("dropdown-open",o.isOpen()),h(3),qe(o.triggerLabel()),h(2),z(o.isOpen()?5:-1))},dependencies:[qr],encapsulation:2,changeDetection:0})}}return t})();var mx=()=>{let t=document.createElement("INPUT");return t.setAttribute("type","file"),t.setAttribute("accept",".json,.gz"),t.setAttribute("multiple",""),t.style.display="none",document.body.appendChild(t),t};var fx=qa(Lx());var Tr="base";function gx(t){let{gameObjectPositions:n,cycles:e=[]}=JSON.parse(t),i={checksum:"",data:{projectName:"GameObjects",fileChecksum:"",apiVersion:"1.3",nodes:[]}},o=[{name:Tr,type:Ft.FOLDER,attributes:{},children:[]}];vC(n);let r=n.find(s=>s.name==="root"),a=_C(r.scale);n.push(a);for(let s of n){let l=s.name.split(".");l[0]!==Tr&&bx(l,o[0].children,Tr,s,n,r)}return i.data.nodes=o,i.data.edges=e.map(s=>CC(s)),i.data.attributeTypes=MC(),i.checksum=(0,fx.default)(JSON.stringify(i.data)),i}function vC(t){for(let n of t)n.name.startsWith("root")||(n.name=n.name.startsWith(".")?`root${n.name}`:`root.${n.name}`)}function bx(t,n,e,i,o,r){if(t.length===0)return;let[a]=t,s={name:a,type:px(t)?Ft.FILE:Ft.FOLDER,attributes:{}};px(t)?s=wC(a,s,i):s.children=[],xC(n,a)?s=n.find(c=>c.name===a):n.push(s);let l=o.find(c=>c.name===e);s.fixedPosition=SC(s,l,i,r.name);let d=e===Tr?s.name:`${e}.${s.name}`;bx(t.slice(1),s.children,d,i,o,r)}function px(t){return t.length===1}function xC(t,n){return t.some(e=>e.name===n)}function wC(t,n,e){let i=xe({},n);return i.attributes={height:e.scale.y},{name:t,type:Ft.FOLDER,attributes:{},children:[i]}}function SC(t,n,e,i){let o;if(t.type===Ft.FOLDER){let r=n.position.x-n.scale.x/2,a=n.position.z-n.scale.z/2,s=e.position.x-e.scale.x/2,l=e.position.z-e.scale.z/2,d=Pc((s-r)/n.scale.x*100,2),c=Pc((l-a)/n.scale.z*100,2),m=Pc(e.scale.z/n.scale.z*100,2),p=Pc(e.scale.x/n.scale.x*100,2);o={left:c,top:d,width:m,height:p}}return t.name===i&&(o=yC(o)),o}function Pc(t,n){let e=Math.pow(10,n);return Math.round(t*e)/e}function yC(t){let n=xe({},t);return n.top=Math.floor(50-n.height/2),n.left=Math.floor(50-n.width/2),n}function ux(t){let n=t.replaceAll(".","/"),i=t.split(".").slice(-1);return`/${Tr}/${n}/${i}`}function CC(t){return{fromNodeName:ux(t.from),toNodeName:ux(t.to),attributes:{coupling:100}}}function MC(){return{edges:{coupling:np.relative}}}function _C(t){let n=Math.max(t.x,t.z);return{name:Tr,position:{x:0,y:0,z:0},scale:{x:n,y:0,z:n}}}var xx=qa(Px());var vx={$id:"http://example.com/example.json",$schema:"http://json-schema.org/draft-07/schema",default:{},description:"This is the JSON Schema for the GameObjectsPositions structure",examples:[{gameObjectPositions:[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}},{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.TryCatchFinallyTest",position:{x:66,y:22.5,z:177.5},scale:{x:1,y:13,z:1}}],cycles:[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}]}],required:["gameObjectPositions"],title:"The root schema",type:"object",properties:{gameObjectPositions:{$id:"#/properties/gameObjectPositions",type:"array",title:"The gameObjectPositions schema",description:"Defines the position and scale of GameObjects",default:[],examples:[[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}},{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.SwitchCaseTest",position:{x:65,y:22,z:181},scale:{x:2,y:12,z:2}}]],additionalItems:!0,items:{$id:"#/properties/gameObjectPositions/items",anyOf:[{$id:"#/properties/gameObjectPositions/items/anyOf/0",type:"object",title:"The first anyOf schema",description:"Defines the properties of a GameObject",default:{},examples:[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}}],required:["name","position","scale"],properties:{name:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/name",type:"string",title:"The name schema",description:"An explanation about the purpose of this instance.",default:"",examples:["root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest"]},position:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position",type:"object",title:"The position schema",description:"The position in absolute values",default:{},examples:[{x:69,y:18.5,z:228.5}],required:["x","y","z"],properties:{x:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/x",type:"number",title:"The x schema",description:"x position",default:0,examples:[69]},y:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/y",type:"number",title:"The y schema",description:"y position",default:0,examples:[18.5]},z:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/z",type:"number",title:"The z schema",description:"z position",default:0,examples:[228.5]}},additionalProperties:!0},scale:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale",type:"object",title:"The scale schema",description:"The scale of GameObjects",default:{},examples:[{x:9,y:5,z:9}],required:["x","y","z"],properties:{x:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/x",type:"number",title:"The x schema",description:"x scale",default:0,examples:[9]},y:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/y",type:"number",title:"The y schema",description:"y scale",default:0,examples:[5]},z:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/z",type:"number",title:"The z schema",description:"z scale",default:0,examples:[9]}},additionalProperties:!0}},additionalProperties:!0}]}},cycles:{$id:"#/properties/cycles",type:"array",title:"The cycles schema",description:"Defines the cycles between GameObjects",default:[],examples:[[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}]],additionalItems:!0,items:{$id:"#/properties/cycles/items",anyOf:[{$id:"#/properties/cycles/items/anyOf/0",type:"object",title:"The first anyOf schema",description:"A cycle between two GameObjects",default:{},examples:[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}],required:["from","to"],properties:{from:{$id:"#/properties/cycles/items/anyOf/0/properties/from",type:"string",title:"The from schema",description:"from GameObject",default:"",examples:["root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser"]},to:{$id:"#/properties/cycles/items/anyOf/0/properties/to",type:"string",title:"The to schema",description:"to GameObject",default:"",examples:["root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"]}},additionalProperties:!0}]}}},additionalProperties:!0};function wx(t){return new xx.default({allErrors:!0,strict:!1}).validate(vx,JSON.parse(t))}var Sx=t=>{let n=[];for(let e of t)n.push(kC(e));return n},kC=async t=>new Promise(n=>{let e=t.name.endsWith(".gz"),i=new FileReader;e?i.readAsArrayBuffer(t):i.readAsText(t,"utf8");let o;i.onload=r=>{let a=r.target.result.toString();o=e?yp(r.target.result,{to:"string"}):a,a.includes("gameObjectPositions")&&wx(a)&&(o=JSON.stringify(gx(a)))},i.onloadend=()=>{n(o)}});var yx=(()=>{class t{constructor(e){this.loadFilesUseCase=e}uploadFiles(){let e=mx();e.addEventListener("change",()=>{this.uploadFilesOnEvent(e),e.remove()}),e.addEventListener("cancel",()=>e.remove()),e.click()}async uploadFilesOnEvent(e){if(!e.files||e.files.length===0)return;let i=e.files;await this.loadFilesUseCase.loadFromUpload(()=>this.readNameDataPairs(i))}async readNameDataPairs(e){return(await Promise.all(Sx(e))).map((o,r)=>({fileName:e[r].name,fileSize:e[r].size,content:cp(o)}))}static{this.\u0275fac=function(i){return new(i||t)(M(Ss))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Cx=(()=>{class t{constructor(){this.uploadFilesService=q(yx)}uploadFiles(){this.uploadFilesService.uploadFiles()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-nav-bar-folder-button"]],decls:2,vars:0,consts:[["type","button","title","Load cc.json files",1,"btn","btn-ghost","btn-square",3,"click"],[1,"fa","fa-folder-open","text-lg"]],template:function(i,o){i&1&&(S(0,"button",0),Y("click",function(){return o.uploadFiles()}),fe(1,"i",1),y())},encapsulation:2,changeDetection:0})}}return t})();var Mx=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-nav-bar-logo"]],decls:2,vars:0,consts:[["href","https://codecharta.com/","target","_blank","rel","noopener noreferrer","title","CodeCharta website",1,"flex","items-center","px-2"],["src","codeCharta/assets/codecharta_logo.svg","alt","CodeCharta",1,"h-8","w-auto"]],template:function(i,o){i&1&&(S(0,"a",0),fe(1,"img",1),y())},encapsulation:2,changeDetection:0})}}return t})();var TC=["configDialog"],_x=(()=>{class t{constructor(){this.dialog=je.required("configDialog")}showSettings(){this.dialog().open()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-settings-button"]],viewQuery:function(i,o){i&1&&tt(o.dialog,TC,5),i&2&&it()},decls:4,vars:0,consts:[["configDialog",""],["type","button","title","Global Configuration",1,"btn","btn-ghost","btn-sm",3,"click"]],template:function(i,o){i&1&&(v(0,"button",1),W("click",function(){return o.showSettings()}),g(1,` Settings
|
|
3503
|
+
`),b(),L(2,"cc-global-configuration-dialog",null,0))},dependencies:[yf],encapsulation:2,changeDetection:0})}}return t})();var Ex=(()=>{class t{constructor(){this.store=q(he),this.isDomainViewAvailable=D(this.store.select(kf),{initialValue:!1})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function IC(t,n){t&1&&fe(0,"span",2)}function DC(t,n){t&1&&fe(0,"span",2)}var kx=(()=>{class t{constructor(){this.fileStoreReadWindow=q(Te),this.fileSelectionModeService=q(Qs),this.router=q(hn),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{requireSync:!0})}selectExplore(){this.showMetricsView(),this.isDeltaState()&&this.fileSelectionModeService.toggle()}selectCompare(){this.showMetricsView(),this.isDeltaState()||this.fileSelectionModeService.toggle()}showMetricsView(){this.router.navigateByUrl(ki.metrics)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-mode-toggle"]],decls:7,vars:8,consts:[["role","tablist",1,"flex","items-center","gap-1"],["type","button","role","tab",1,"btn","btn-ghost","btn-sm","relative",3,"click"],[1,"cc-current-underline"]],template:function(i,o){i&1&&(S(0,"div",0)(1,"button",1),Y("click",function(){return o.selectExplore()}),g(2," Explore "),O(3,IC,1,0,"span",2),y(),S(4,"button",1),Y("click",function(){return o.selectCompare()}),g(5," Compare "),O(6,DC,1,0,"span",2),y()()),i&2&&(h(),Le("font-bold",!o.isDeltaState()),dt("aria-selected",!o.isDeltaState()),h(2),z(o.isDeltaState()?-1:3),h(),Le("font-bold",o.isDeltaState()),dt("aria-selected",o.isDeltaState()),h(2),z(o.isDeltaState()?6:-1))},encapsulation:2,changeDetection:0})}}return t})();var qx=(()=>{class t{constructor(){this.export3DMapDialogStore=q(Ma)}export3DMap(){this.export3DMapDialogStore.requestExport()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-print-3d-button"]],decls:2,vars:0,consts:[["type","button","title","Download 3MF code file",1,"btn","btn-ghost","btn-sm",3,"click"]],template:function(i,o){i&1&&(S(0,"button",0),Y("click",function(){return o.export3DMap()}),g(1,` 3D Print
|
|
3504
|
+
`),y())},encapsulation:2,changeDetection:0})}}return t})();function RC(t,n){t&1&&L(0,"cc-mode-toggle")(1,"cc-print-3d-button")}function AC(t,n){t&1&&L(0,"span",3)}function FC(t,n){if(t&1&&(v(0,"a",2,0),g(2," Explore "),O(3,AC,1,0,"span",3),b()),t&2){let e=Dr(1),i=A();F("routerLink",i.routeLinks.domain),h(3),z(e.isActive?3:-1)}}var LC={metrics:"Metric modes",domain:"Domain modes"},Tx=(()=>{class t{constructor(){this.view=H.required(),this.routeLinks=ki,this.groupLabel=Z(()=>LC[this.view()])}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-view-mode-bar"]],hostAttrs:[1,"block"],inputs:{view:[1,"view"]},decls:3,vars:2,consts:[["domainExplore","routerLinkActive"],[1,"flex","items-center","justify-center","gap-1","py-0.5","border-0","m-0","px-0","min-w-0"],["routerLinkActive","font-bold","data-testid","view-mode-domain-explore",1,"btn","btn-ghost","btn-sm","relative",3,"routerLink"],[1,"cc-current-underline"]],template:function(i,o){i&1&&(v(0,"fieldset",1),O(1,RC,2,0)(2,FC,4,2,"a",2),b()),i&2&&(dt("aria-label",o.groupLabel()),h(),z(o.view()==="metrics"?1:2))},dependencies:[kx,qx,La,Pa],encapsulation:2,changeDetection:0})}}return t})();var PC=()=>({exact:!0});function NC(t,n){t&1&&L(0,"span",5)}function BC(t,n){t&1&&L(0,"span",5)}function VC(t,n){if(t&1){let e=Me();v(0,"a",9,1),W("mouseenter",function(){ce(e);let o=A();return de(o.openModeBar("domain"))})("focusin",function(){ce(e);let o=A();return de(o.openModeBar("domain"))}),g(2," Domain "),O(3,BC,1,0,"span",5),b()}if(t&2){let e=Dr(1),i=A();Le("font-bold",e.isActive),F("routerLink",i.routeLinks.domain),h(3),z(e.isActive?3:-1)}}function WC(t,n){if(t&1){let e=Me();v(0,"div",10),W("mouseenter",function(){ce(e);let o=A();return de(o.cancelPendingClose())})("mouseleave",function(){ce(e);let o=A();return de(o.scheduleClosingModeBar())}),L(1,"cc-view-mode-bar",11),b()}t&2&&(h(),F("view",n))}function OC(t,n){if(t&1){let e=Me();v(0,"span",12),W("mouseenter",function(){ce(e);let o=A();return de(o.openModeBar(o.activeView()))}),To(),v(1,"svg",13),L(2,"path",14),b()()}}var zC=200,Ix=(()=>{class t{constructor(){this.readStore=q(Ex),this.hostElement=q(At),this.isDomainViewAvailable=this.readStore.isDomainViewAvailable,this.activeView=D(q(or).activeView$,{requireSync:!0}),this.routeLinks=ki,this.previewedView=be(null),this.pendingClose=null,q(sn).onDestroy(()=>this.cancelPendingClose())}openModeBar(e){this.cancelPendingClose(),this.previewedView.set(e)}cancelPendingClose(){this.pendingClose!==null&&(clearTimeout(this.pendingClose),this.pendingClose=null)}scheduleClosingModeBar(){this.cancelPendingClose(),this.pendingClose=setTimeout(()=>this.closeModeBar(),zC)}closeModeBarWhenFocusLeaves(e){let i=e.relatedTarget;(!(i instanceof Node)||!this.hostElement.nativeElement.contains(i))&&this.closeModeBar()}closeModeBar(){this.cancelPendingClose(),this.previewedView.set(null)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-view-switcher"]],hostAttrs:[1,"contents"],decls:9,vars:8,consts:[["metricsTab","routerLinkActive"],["domainTab","routerLinkActive"],[1,"flex","items-center",3,"click","mouseleave","focusout"],["aria-label","View","data-testid","view-switcher",1,"flex","items-center","gap-1"],["routerLinkActive","","ariaCurrentWhenActive","page","title","Show the 3D metrics map","data-testid","view-switcher-metrics",1,"btn","btn-ghost","btn-sm","relative",3,"mouseenter","focusin","routerLink","routerLinkActiveOptions"],[1,"cc-current-underline"],["routerLinkActive","","ariaCurrentWhenActive","page","title","Show the domain-language word cloud","data-testid","view-switcher-domain",1,"btn","btn-ghost","btn-sm","relative",3,"font-bold","routerLink"],["data-testid","view-mode-bar-overlay",1,"absolute","inset-x-0","top-full","z-[70]","border-b","border-base-300","bg-base-100","shadow-md"],["aria-hidden","true","data-testid","view-mode-bar-handle",1,"absolute","left-1/2","top-full","z-[70]","mt-px","flex","-translate-x-1/2","cursor-pointer","items-center","rounded-b-md","border","border-t-0","border-base-300","bg-base-100","px-2.5","pb-1","pt-0.5","text-base-content/40","shadow-sm","hover:text-base-content/70"],["routerLinkActive","","ariaCurrentWhenActive","page","title","Show the domain-language word cloud","data-testid","view-switcher-domain",1,"btn","btn-ghost","btn-sm","relative",3,"mouseenter","focusin","routerLink"],["data-testid","view-mode-bar-overlay",1,"absolute","inset-x-0","top-full","z-[70]","border-b","border-base-300","bg-base-100","shadow-md",3,"mouseenter","mouseleave"],[3,"view"],["aria-hidden","true","data-testid","view-mode-bar-handle",1,"absolute","left-1/2","top-full","z-[70]","mt-px","flex","-translate-x-1/2","cursor-pointer","items-center","rounded-b-md","border","border-t-0","border-base-300","bg-base-100","px-2.5","pb-1","pt-0.5","text-base-content/40","shadow-sm","hover:text-base-content/70",3,"mouseenter"],["viewBox","0 0 10 6","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"block","h-1.5","w-2.5"],["d","M1 1 5 5 9 1"]],template:function(i,o){if(i&1&&(v(0,"div",2),W("click",function(){return o.closeModeBar()})("mouseleave",function(){return o.scheduleClosingModeBar()})("focusout",function(a){return o.closeModeBarWhenFocusLeaves(a)}),v(1,"nav",3)(2,"a",4,0),W("mouseenter",function(){return o.openModeBar("metrics")})("focusin",function(){return o.openModeBar("metrics")}),g(4," Metric "),O(5,NC,1,0,"span",5),b(),O(6,VC,4,4,"a",6),b(),O(7,WC,2,1,"div",7)(8,OC,3,0,"span",8),b()),i&2){let r,a=Dr(3);h(2),Le("font-bold",a.isActive),F("routerLink",o.routeLinks.metrics)("routerLinkActiveOptions",Bm(7,PC)),h(3),z(a.isActive?5:-1),h(),z(o.isDomainViewAvailable()?6:-1),h(),z((r=o.previewedView())?7:8,r)}},dependencies:[La,Pa,Tx],encapsulation:2,changeDetection:0})}}return t})();function $C(t,n){t&1&&L(0,"cc-delta-selector")}function jC(t,n){t&1&&L(0,"cc-map-selector")}function HC(t,n){if(t&1){let e=Me();v(0,"cc-export-3D-map-dialog",5),W("closed",function(){ce(e);let o=A();return de(o.closeExportDialog())}),b()}}var gm=(()=>{class t{constructor(){this.fileStoreReadWindow=q(Te),this.export3DMapDialogStore=q(Ma),this.isDeltaState=D(this.fileStoreReadWindow.isDeltaState$,{requireSync:!0}),this.isExportDialogOpen=this.export3DMapDialogStore.isDialogOpen}closeExportDialog(){this.export3DMapDialogStore.closeDialog()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["cc-nav-bar"]],features:[Zi([{provide:Es,useValue:"--cc-bars-height"}]),Qi([ks])],decls:12,vars:2,consts:[[1,"navbar","relative","bg-base-100","border-b","border-base-300","min-h-12","px-2"],[1,"navbar-start","gap-1"],[1,"divider","divider-horizontal","mx-0"],[1,"navbar-center","self-stretch"],[1,"navbar-end"],[3,"closed"]],template:function(i,o){i&1&&(v(0,"div",0)(1,"div",1),L(2,"cc-nav-bar-logo")(3,"div",2)(4,"cc-nav-bar-folder-button"),O(5,$C,1,0,"cc-delta-selector")(6,jC,1,0,"cc-map-selector"),b(),v(7,"div",3),L(8,"cc-view-switcher"),b(),v(9,"div",4),L(10,"cc-settings-button"),b()(),O(11,HC,1,0,"cc-export-3D-map-dialog")),i&2&&(h(5),z(o.isDeltaState()?5:6),h(6),z(o.isExportDialogOpen()?11:-1))},dependencies:[fm,Mx,Cx,hx,dx,_x,Ix],encapsulation:2,changeDetection:0})}}return t})();function UC(t,n){t&1&&(v(0,"div"),L(1,"cc-nav-bar")(2,"router-outlet")(3,"cc-changelog-dialog"),b())}var Dx=(()=>{class t{constructor(e){this.loadFilesUseCase=e,this.isInitialized=be(!1)}ngOnInit(){this.loadFilesUseCase.loadOnBoot().catch(()=>{}).finally(()=>{this.isInitialized.set(!0)})}static{this.\u0275fac=function(i){return new(i||t)(te(Ss))}}static{this.\u0275cmp=_({type:t,selectors:[["cc-code-charta"]],decls:3,vars:1,template:function(i,o){i&1&&(L(0,"cc-error-dialog")(1,"cc-toast"),O(2,UC,4,0,"div")),i&2&&(h(2),z(o.isInitialized()?2:-1))},dependencies:[gm,hd,hf,Sf,Xm],encapsulation:2,changeDetection:0})}}return t})();jm(Dx,nt(xe({},Fh),{providers:[Vm(),...Fh.providers]}));
|