1/*! licenses: /vendor.LICENSE.txt */ 2var xs=Object.defineProperty;var vs=(e,n,t)=>n in e?xs(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var F=(e,n,t)=>vs(e,typeof n!="symbol"?n+"":n,t);import{f as rt,j as i,n as ks,S as js,h as Cs,z as Ms,d as ot,o as Bt,Q as me,p as At,b as at,bj as It,M as ie,K as Ss,I as lt,bf as Ts,J as Ns,P as Ls,ao as Rs,R as qt,O as bt,B as zs,ah as Ds}from"./echoes-Cle-ZDif.js";import{R as be,r as q}from"./vendor-XYdmNGm4.js";import{bH as Es,bI as Bs,ao as ve,bJ as As,bK as Is,bL as qs,a3 as r,af as $e,ah as Ot,aG as Pt,bM as Y,bN as Xe,bO as Os,bP as Ps,bQ as Vs,a7 as Vt,ai as he,bR as $s,a6 as ce,bS as Fs,bT as Ks,bU as Gs,bV as Ze,bW as $t,aL as Hs,aM as Ws,aN as Us,a5 as Je,a4 as Ft,ag as ue,bX as Qs,bY as He,bZ as K,b_ as Ys,aO as Fe,n as Kt,o as Xs,aI as ct,m as ee,b$ as Zs,c0 as Js,ad as Le,aQ as Ae,ae as Gt,C as Ht,Q as Wt,c1 as Ut,N as et,a as en,ap as tn,b as sn,a9 as nn,aa as rn,ac as ge,c2 as on,aK as an,c3 as ln,c4 as cn,c5 as un,ar as dn,c6 as mn,F as hn,L as Qt,c7 as pn,c8 as fn,c9 as gn,ca as yn,ay as ut,aD as dt,aP as Yt,cb as _n,cc as tt,aJ as xt,aF as Xt,au as mt,cd as wn,av as bn,a2 as xn,x as vn}from"./startReactApp-DAr4TrjS.js";import{S as kn}from"./Suggestions-L5-yS-jD.js";import{e as Zt}from"./Measure-Zb7ZYpkb.js";/* empty css */import{u as ht}from"./withMetricsContext-DaOVIV5R.js";import{bo as jn,bp as Cn,T as Jt,c as re,d as ze,y as Mn,n as Sn,o as st,t as de,bq as vt,br as Tn,bs as Nn,bt as pt,bu as We,bv as Ue,bw as Ce,l as te,bx as Ne,a as Ke,by as Ln,b as ft,bz as Rn,aL as le,Z as U,a2 as zn,bA as Dn,bB as En,bC as es,bD as Bn,bE as An,k as ye,bF as kt,al as In,ab as Re,bG as qn,bH as On,a4 as Pn,am as Vn}from"./main-CfyLyGEN.js";import{S as gt}from"./SubnavigationItem-DE2OL94N.js";import{S as $n}from"./SecurityDevEditionPromoteBanner-C5p4YR3j.js";import{M as yt}from"./Measure-D_OJzER-.js";import{g as xe}from"./component-w_jYWp44.js";import{f as Fn}from"./branch-like-pSzK1evV.js";import{u as ts}from"./useResizeObserver-B5gRNIKC.js";import{w as Kn}from"./withTheme-oZuuaaDN.js";import{w as Gn}from"./withLanguages-C9yF4jBF.js";import{g as Hn,a as Wn}from"./new-code-period-CD4MQ1fH.js";import{b as Un}from"./datefns-BK34w00I.js";import{u as Qn}from"./component-DtP9orBT.js";import"./lodash-DRzFS_TL.js";import"./highlightjs-CFvgWmRf.js";import"./LockIllustration-BAvj33dq.js";import"./rules-DstEbSZL.js";function jt(e,n){let t;if(n===void 0)for(const s of e)s!=null&&(t>s||t===void 0&&s>=s)&&(t=s);else{let s=-1;for(let o of e)(o=n(o,++s,e))!=null&&(t>o||t===void 0&&o>=o)&&(t=o)}return t}var Yn=1e-12;function Ct(e){return((e=Math.exp(e))+1/e)/2}function Xn(e){return((e=Math.exp(e))-1/e)/2}function Zn(e){return((e=Math.exp(2*e))-1)/(e+1)}const Jn=(function e(n,t,s){function o(a,l){var m=a[0],h=a[1],g=a[2],p=l[0],v=l[1],u=l[2],b=p-m,x=v-h,M=b*b+x*x,j,d;if(M<Yn)d=Math.log(u/g)/n,j=function(A){return[m+A*b,h+A*x,g*Math.exp(n*A*d)]};else{var B=Math.sqrt(M),N=(u*u-g*g+s*M)/(2*g*t*B),_=(u*u-g*g-s*M)/(2*u*t*B),D=Math.log(Math.sqrt(N*N+1)-N),E=Math.log(Math.sqrt(_*_+1)-_);d=(E-D)/n,j=function(A){var H=A*d,O=Ct(D),X=g/(t*B)*(O*Zn(n*H+D)-Xn(D));return[m+X*b,h+X*x,g*O/Ct(n*H+D)]}}return j.duration=d*1e3*n/Math.SQRT2,j}return o.rho=function(a){var l=Math.max(.001,+a),m=l*l,h=m*m;return e(l,m,h)},o})(Math.SQRT2,2,4);const ei=32;function ti(e){const{ariaLabel:n,breadcrumbLimit:t,className:s,children:o,expandButtonLabel:a,innerRef:l,actions:m,maxWidth:h=jn}=e,[g,p]=be.useState([]),v=rt(),u=be.useCallback((N,_)=>{p(D=>{if(D[_]===N.offsetWidth)return D;const E=[...D];return E[_]=N.offsetWidth,E})},[]);let b=0;const x=be.useMemo(()=>{const N=be.Children.toArray(o).reverse();return p(_=>N.length===_.length?_:_.slice(0,N.length)),be.Children.map(N,(_,D)=>{const E=D===0;return i.jsxs("li",{className:"sw-inline-flex sw-items-center",ref:A=>{A!==null&&u(A,D)},children:[_,!E&&i.jsx(Cn,{"data-testid":"chevron-right"})]})})},[o,u]),M=[];if(g.reduce((N,_)=>N+_,0)>Math.ceil(h)){let N=ei;g.forEach((_,D)=>{const E=t?D+1<=t:!0;N+=_;const A=D===0;A&&_>h?M.push(i.jsx(Jt,{content:x[D].props.children,children:x[D]},x[D].key)):A||N<=h&&E?M.push(x[D]):b+=1})}const d=b>0,B=d?M:x;return i.jsxs(si,{"aria-label":n!=null?n:v.formatMessage({id:"breadcrumbs"}),className:ze("js-breadcrumbs",s),ref:l,"data-component":"breadcrumbs",children:[d&&i.jsx(Mn,{allowResizing:!0,className:"sw-px-2",id:"breadcrumb-menu",overlay:be.Children.map(o,N=>i.jsx("li",{children:N})),placement:st.BottomLeft,zLevel:Sn.Global,children:i.jsx(ks,{Icon:Ms,ariaLabel:a!=null?a:v.formatMessage({id:"expand_breadcrumb"}),className:"sw-m-1 sw-mr-2",size:Cs.Medium,variety:js.DefaultGhost})}),i.jsx("ul",{className:"sw-truncate sw-leading-6 sw-flex",children:[...B].reverse()}),m&&i.jsx("div",{className:"sw-mx-2",children:m})]})}const si=re("nav",{target:"ez6fnnm0"})({display:"flex",alignItems:"center"}," ",{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}," ",{font:"var(--echoes-typography-text-default-regular)"}
vendor: 8,847 bytes, line 2
2," color:",ot("color-text-subtle"),";background-color:",de("breadcrumb"),";");function pe(e){return typeof e=="string"?new vt([[document.querySelector(e)]],[document.documentElement]):new vt([[e]],Tn)}function ni(e){let n;for(;n=e.sourceEvent;)e=n;return e}function we(e,n){if(e=ni(e),n===void 0&&(n=e.currentTarget),n){var t=n.ownerSVGElement||n;if(t.createSVGPoint){var s=t.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(n.getScreenCTM().inverse()),[s.x,s.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const nt={capture:!0,passive:!1};function it(e){e.preventDefault(),e.stopImmediatePropagation()}function ii(e){var n=e.document.documentElement,t=pe(e).on("dragstart.drag",it,nt);"onselectstart"in n?t.on("selectstart.drag",it,nt):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function ri(e,n){var t=e.document.documentElement,s=pe(e).on("dragstart.drag",null);n&&(s.on("click.drag",it,nt),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in t?s.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}const De=e=>()=>e;function oi(e,{sourceEvent:n,target:t,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function Qe(e){e.stopImmediatePropagation()}function Me(e){e.preventDefault(),e.stopImmediatePropagation()}function ai(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function li(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Mt(){return this.__zoom||pt}function ci(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ui(){return navigator.maxTouchPoints||"ontouchstart"in this}function di(e,n,t){var s=e.invertX(n[0][0])-t[0][0],o=e.invertX(n[1][0])-t[1][0],a=e.invertY(n[0][1])-t[0][1],l=e.invertY(n[1][1])-t[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),l>a?(a+l)/2:Math.min(0,a)||Math.max(0,l))}function mi(){var e=ai,n=li,t=di,s=ci,o=ui,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],m=250,h=Jn,g=Nn("start","zoom","end"),p,v,u,b=500,x=150,M=0,j=10;function d(c){c.property("__zoom",Mt).on("wheel.zoom",H,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",X).filter(o).on("touchstart.zoom",se).on("touchmove.zoom",Q).on("touchend.zoom touchcancel.zoom",Z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}d.transform=function(c,w,f,C){var L=c.selection?c.selection():c;L.property("__zoom",Mt),c!==L?D(c,w,f,C):L.interrupt().each(function(){E(this,arguments).event(C).start().zoom(null,typeof w=="function"?w.apply(this,arguments):w).end()})},d.scaleBy=function(c,w,f,C){d.scaleTo(c,function(){var L=this.__zoom.k,y=typeof w=="function"?w.apply(this,arguments):w;return L*y},f,C)},d.scaleTo=function(c,w,f,C){d.transform(c,function(){var L=n.apply(this,arguments),y=this.__zoom,k=f==null?_(L):typeof f=="function"?f.apply(this,arguments):f,S=y.invert(k),T=typeof w=="function"?w.apply(this,arguments):w;return t(N(B(y,T),k,S),L,l)},f,C)},d.translateBy=function(c,w,f,C){d.transform(c,function(){return t(this.__zoom.translate(typeof w=="function"?w.apply(this,arguments):w,typeof f=="function"?f.apply(this,arguments):f),n.apply(this,arguments),l)},null,C)},d.translateTo=function(c,w,f,C,L){d.transform(c,function(){var y=n.apply(this,arguments),k=this.__zoom,S=C==null?_(y):typeof C=="function"?C.apply(this,arguments):C;return t(pt.translate(S[0],S[1]).scale(k.k).translate(typeof w=="function"?-w.apply(this,arguments):-w,typeof f=="function"?-f.apply(this,arguments):-f),y,l)},C,L)};function B(c,w){return w=Math.max(a[0],Math.min(a[1],w)),w===c.k?c:new We(w,c.x,c.y)}function N(c,w,f){var C=w[0]-f[0]*c.k,L=w[1]-f[1]*c.k;return C===c.x&&L===c.y?c:new We(c.k,C,L)}function _(c){return[(+c[0][0]+ +c[1][0])/2,(+c[0][1]+ +c[1][1])/2]}function D(c,w,f,C){c.on("start.zoom",function(){E(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(C).end()}).tween("zoom",function(){var L=this,y=arguments,k=E(L,y).event(C),S=n.apply(L,y),T=f==null?_(S):typeof f=="function"?f.apply(L,y):f,R=Math.max(S[1][0]-S[0][0],S[1][1]-S[0][1]),z=L.__zoom,I=typeof w=="function"?w.apply(L,y):w,P=h(z.invert(T).concat(R/z.k),I.invert(T).concat(R/I.k));return function($){if($===1)$=I;else{var W=P($),ne=R/W[2];$=new We(ne,T[0]-W[0]*ne,T[1]-W[1]*ne)}k.zoom(null,$)}})}function E(c,w,f){return!f&&c.__zooming||new A(c,w)}function A(c,w){this.that=c,this.args=w,this.active=0,this.sourceEvent=null,this.extent=n.apply(c,w),this.taps=0}A.prototype={event:function(c){return c&&(this.sourceEvent=c),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(c,w){return this.mouse&&c!=="mouse"&&(this.mouse[1]=w.invert(this.mouse[0])),this.touch0&&c!=="touch"&&(this.touch0[1]=w.invert(this.touch0[0])),this.touch1&&c!=="touch"&&(this.touch1[1]=w.invert(this.touch1[0])),this.that.__zoom=w,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(c){var w=pe(this.that).datum();g.call(c,this.that,new oi(c,{sourceEvent:this.sourceEvent,target:d,transform:this.that.__zoom,dispatch:g}),w)}};function H(c,...w){if(!e.apply(this,arguments))return;var f=E(this,w).event(c),C=this.__zoom,L=Math.max(a[0],Math.min(a[1],C.k*Math.pow(2,s.apply(this,arguments)))),y=we(c);if(f.wheel)(f.mouse[0][0]!==y[0]||f.mouse[0][1]!==y[1])&&(f.mouse[1]=C.invert(f.mouse[0]=y)),clearTimeout(f.wheel);else{if(C.k===L)return;f.mouse=[y,C.invert(y)],Ue(this),f.start()}Me(c),f.wheel=setTimeout(k,x),f.zoom("mouse",t(N(B(C,L),f.mouse[0],f.mouse[1]),f.extent,l));function k(){f.wheel=null,f.end()}}function O(c,...w){if(u||!e.apply(this,arguments))return;var f=c.currentTarget,C=E(this,w,!0).event(c),L=pe(c.view).on("mousemove.zoom",T,!0).on("mouseup.zoom",R,!0),y=we(c,f),k=c.clientX,S=c.clientY;ii(c.view),Qe(c),C.mouse=[y,this.__zoom.invert(y)],Ue(this),C.start();function T(z){if(Me(z),!C.moved){var I=z.clientX-k,P=z.clientY-S;C.moved=I*I+P*P>M}C.event(z).zoom("mouse",t(N(C.that.__zoom,C.mouse[0]=we(z,f),C.mouse[1]),C.extent,l))}function R(z){L.on("mousemove.zoom mouseup.zoom",null),ri(z.view,C.moved),Me(z),C.event(z).end()}}function X(c,...w){if(e.apply(this,arguments)){var f=this.__zoom,C=we(c.changedTouches?c.changedTouches[0]:c,this),L=f.invert(C),y=f.k*(c.shiftKey?.5:2),k=t(N(B(f,y),C,L),n.apply(this,w),l);Me(c),m>0?pe(this).transition().duration(m).call(D,k,C,c):pe(this).call(d.transform,k,C,c)}}function se(c,...w){if(e.apply(this,arguments)){var f=c.touches,C=f.length,L=E(this,w,c.changedTouches.length===C).event(c),y,k,S,T;for(Qe(c),k=0;k<C;++k)S=f[k],T=we(S,this),T=[T,this.__zoom.invert(T),S.identifier],L.touch0?!L.touch1&&L.touch0[2]!==T[2]&&(L.touch1=T,L.taps=0):(L.touch0=T,y=!0,L.taps=1+!!p);p&&(p=clearTimeout(p)),y&&(L.taps<2&&(v=T[0],p=setTimeout(function(){p=null},b)),Ue(this),L.start())}}function Q(c,...w){if(this.__zooming){var f=E(this,w).event(c),C=c.changedTouches,L=C.length,y,k,S,T;for(Me(c),y=0;y<L;++y)k=C[y],S=we(k,this),f.touch0&&f.touch0[2]===k.identifier?f.touch0[0]=S:f.touch1&&f.touch1[2]===k.identifier&&(f.touch1[0]=S);if(k=f.that.__zoom,f.touch1){var R=f.touch0[0],z=f.touch0[1],I=f.touch1[0],P=f.touch1[1],$=($=I[0]-R[0])*$+($=I[1]-R[1])*$,W=(W=P[0]-z[0])*W+(W=P[1]-z[1])*W;k=B(k,Math.sqrt($/W)),S=[(R[0]+I[0])/2,(R[1]+I[1])/2],T=[(z[0]+P[0])/2,(z[1]+P[1])/2]}else if(f.touch0)S=f.touch0[0],T=f.touch0[1];else return;f.zoom("touch",t(N(k,S,T),f.extent,l))}}function Z(c,...w){if(this.__zooming){var f=E(this,w).event(c),C=c.changedTouches,L=C.length,y,k;for(Qe(c),u&&clearTimeout(u),u=setTimeout(function(){u=null},b),y=0;y<L;++y)k=C[y],f.touch0&&f.touch0[2]===k.identifier?delete f.touch0:f.touch1&&f.touch1[2]===k.identifier&&delete f.touch1;if(f.touch1&&!f.touch0&&(f.touch0=f.touch1,delete f.touch1),f.touch0)f.touch0[1]=this.__zoom.invert(f.touch0[0]);else if(f.end(),f.taps===2&&(k=we(k,this),Math.hypot(v[0]-k[0],v[1]-k[1])<j)){var S=pe(this).on("dblclick.zoom");S&&S.apply(this,arguments)}}}return d.wheelDelta=function(c){return arguments.length?(s=typeof c=="function"?c:De(+c),d):s},d.filter=function(c){return arguments.length?(e=typeof c=="function"?c:De(!!c),d):e},d.touchable=function(c){return arguments.length?(o=typeof c=="function"?c:De(!!c),d):o},d.extent=function(c){return arguments.length?(n=typeof c=="function"?c:De([[+c[0][0],+c[0][1]],[+c[1][0],
2+c[1][1]]]),d):n},d.scaleExtent=function(c){return arguments.length?(a[0]=+c[0],a[1]=+c[1],d):[a[0],a[1]]},d.translateExtent=function(c){return arguments.length?(l[0][0]=+c[0][0],l[1][0]=+c[1][0],l[0][1]=+c[0][1],l[1][1]=+c[1][1],d):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},d.constrain=function(c){return arguments.length?(t=c,d):t},d.duration=function(c){return arguments.length?(m=+c,d):m},d.interpolate=function(c){return arguments.length?(h=c,d):h},d.on=function(){var c=g.on.apply(g,arguments);return c===g?d:c},d.clickDistance=function(c){return arguments.length?(M=(c=+c)*c,d):Math.sqrt(M)},d.tapDistance=function(c){return arguments.length?(j=+c,d):j},d}const Ye=5,hi=[10,10,10,10],pi=[5,45];function fi(e){const{padding:n=hi,height:t,items:s,xDomain:o,yDomain:a,sizeDomain:l,sizeRange:m=pi,zoomResetLabel:h="Reset",zoomTooltipText:g,zoomLabel:p="Zoom",displayXTicks:v=!0,displayYTicks:u=!0,displayXGrid:b=!0,displayYGrid:x=!0,formatXTick:M=y=>String(y),formatYTick:j=y=>String(y)}=e,[d,B]=q.useState({x:0,y:0,k:1}),N=q.useRef(void 0),_=q.useRef(void 0),D=q.useRef(null),[E]=ts(D),A="".concat(Math.floor(d.k*100),"%");if(_.current&&N.current){const y=N.current.getBoundingClientRect();_.current.translateExtent([[0,0],[y.width,y.height]])}const H=q.useCallback(y=>{const{x:k,y:S,k:T}=y.transform;
2B({x:k+n[3]*(T-1),y:S+n[0]*(T-1),k:T})},[n]),O=q.useCallback(y=>{N.current=y,_.current=mi().scaleExtent([1,10]).on("zoom",H),pe(N.current).call(_.current)},[H]),X=q.useCallback(y=>{y.stopPropagation(),y.preventDefault(),_.current&&N.current&&pe(N.current).call(_.current.transform,pt)},[]),se=q.useCallback((y,k,S)=>{var W,ne;const[T,R]=y.range(),z=(W=jt(s,J=>y(J.x)-k(J.size)))!=null?W:0,I=(ne=Ce(s,J=>y(J.x)+k(J.size)))!=null?ne:0,P=z<0?T-z:T,$=I>R?I-R:0;return[P,S-$]},[s]),Q=q.useCallback((y,k,S)=>{var W,ne;const[T,R]=y.range(),z=(W=jt(s,J=>y(J.y)-k(J.size)))!=null?W:0,I=(ne=Ce(s,J=>y(J.y)+k(J.size)))!=null?ne:0,P=z<0?R-z:R,$=I>T?I-T:0;return[S-$,P]},[s]),Z=q.useCallback((y,k)=>{const S=Math.ceil(d.k),T=y.ticks(Ye*S).map(I=>k(I)),R=te.uniq(T).length,z=R<Ye*S?R-1:Ye*S;return y.ticks(z)},[d]),c=q.useCallback((y,k,S)=>{if(!b)return null;const T=y.map((R,z)=>{const I=k(R),[P,$]=S.range();return i.jsx(St,{x1:I*d.k+d.x,x2:I*d.k+d.x,y1:P*d.k,y2:d.k>1?0:$},z)});return i.jsx("g",{children:T})},[d,b]),w=q.useCallback((y,k,S)=>{if(!x)return null;const T=y.map((R,z)=>{const I=S(R),[P,$]=k.range();return i.jsx(St,{x1:d.k>1?0:P,x2:$*d.k,y1:I*d.k+d.y,y2:I*d.k+d.y},z)});return i.jsx("g",{children:T})},[x,d]),f=q.useCallback((y,k,S)=>{if(!v)return null;const T=y.map(R=>{const z=k(R)*d.k+d.x,I=S.range()[0],P=M(R);return z>0&&z<k.range()[1]?i.jsx(Tt,{dy:"1.5em",style:{"--align":"middle"},x:z,y:I,children:P},"x-tick-".concat(R)):null});return i.jsx("g",{children:T})},[v,M,d]),C=q.useCallback((y,k,S)=>{if(!u)return null;const T=y.map((R,z)=>{const I=k.range()[0],P=S(R)*d.k+d.y,$=j(R);return P>0&&P<S.range()[0]?i.jsx(Tt,{dx:"-0.5em",dy:"0.3em",style:{"--align":"end"},x:I,y:P,children:$},z):null});return i.jsx("g",{children:T})},[u,j,d]),L=y=>{var J,ke,V;const k=y-n[1]-n[3],S=t-n[0]-n[2],T=Ne().domain(o!=null?o:[0,(J=Ce(s,G=>G.x))!=null?J:0]).range([0,k]).nice(),R=Ne().domain(a!=null?a:[0,(ke=Ce(s,G=>G.y))!=null?ke:0]).range([S,0]).nice(),z=Ne().domain(l!=null?l:[0,(V=Ce(s,G=>G.size))!=null?V:0]).range(m!=null?m:[]),I=T.copy(),P=R.copy();T.range(se(T,z,k)),R.range(Q(R,z,S));const $=te.sortBy(s,G=>-G.size).map((G,_e)=>{var je;return i.jsx(gi,{backgroundColor:G.backgroundColor,borderColor:G.borderColor,data:G.data,onClick:e.onBubbleClick,r:z(G.size),scale:1/d.k,tooltip:G.tooltip,x:T(G.x),y:R(G.y)},(je=G.key)!=null?je:_e)}),W=Z(T,M),ne=Z(R,j);return i.jsxs("svg",{className:ze("bubble-chart"),"data-testid":e["data-testid"],height:t,ref:O,width:y,"data-component":"render-chart",children:[i.jsx("defs",{children:i.jsx("clipPath",{id:"graph-region",children:i.jsx("rect",{height:S+4,width:k+4,x:-2,y:-2})})}),i.jsxs("g",{transform:"translate(".concat(n[3],", ").concat(n[0],")"),children:[i.jsxs("g",{clipPath:"url(#graph-region)",children:[c(W,T,R),w(ne,T,R),i.jsx("g",{transform:"translate(".concat(d.x,", ").concat(d.y,") scale(").concat(d.k,")"),children:$})]}),f(W,T,P),C(ne,I,R)]})]})};return i.jsxs("div",{className:"sw-min-w-full sw-overflow-hidden sw-w-0",ref:D,"data-component":"bubble-chart",children:[i.jsxs("div",{className:"sw-flex sw-items-center sw-justify-end sw-h-control sw-mb-4",children:[i.jsx(Bt,{content:g,children:i.jsxs("span",{children:[i.jsx(me,{isHighlighted:!0,isSubtle:!0,children:p}),": ",A]})}),A!=="100%"&&i.jsx(At,{className:"sw-ml-2",isDisabled:A==="100%",onClick:X,children:h})]}),i.jsx("div",{className:"sw-overflow-hidden sw-w-full",children:E!==void 0&&L(E)})]})}function gi(e){const{backgroundColor:n,borderColor:t,data:s,onClick:o,r:a,scale:l,tooltip:m,x:h,y:g}=e,p=q.useCallback(u=>{u.stopPropagation(),u.preventDefault(),o==null||o(s)},[s,o]),v=i.jsx("a",{href:"#",onClick:p,children:i.jsx(yi,{r:a,style:{fill:n!=null?n:"",stroke:t!=null?t:""},transform:"translate(".concat(h,", ").concat(g,") scale(").concat(l,")")})});return i.jsx(Bt,{content:m,side:"bottom","data-component":"bubble",children:v})}const yi=re("circle",{target:"ey35g742"})({cursor:"pointer"}," transition:fill-opacity 0.2s ease;fill:",de("bubbleDefault"),";stroke:",Ke("bubbleDefault"),";&:hover{fill-opacity:0.8;}"),St=re("line",{target:"ey35g741"})("shape-rendering:crispedges;stroke:",de("bubbleChartLine"),";"),Tt=re("text",{target:"ey35g740"})({font:"var(--echoes-typography-text-default-regular)"}," ",{userSelect:"none"}," fill:",ot("color-text-subtle"),";text-anchor:var(--align);");function _i(e){const{className:n,colors:t}=e,s=at();return i.jsx(wi,{className:n,"data-component":"colors-legend",children:t.map((o,a)=>{var l,m;return i.jsx("li",{className:"sw-ml-4",children:i.jsx(Jt,{content:o.overlay,children:i.jsx("div",{children:i.jsx(Ln,{checked:o.selected,label:o.ariaLabel,onCheck:()=>{e.onColorClick(o)},children:i.jsx(bi,{style:o.selected?{backgroundColor:(l=o.backgroundColor)!=null?l:de("bubble.".concat(a+1))({theme:s}),borderColor:(m=o.borderColor)!=null?m:Ke("bubble.".concat(a+1))({theme:s})}:{},children:o.label})})})})},o.value)})})}const wi=re("ul",{target:"eexg0rb1"})({display:"flex"},";"),bi=re("div",{target:"eexg0rb0"})("width:20px;height:20px;line-height:20px;border-radius:50%;border:",ft(),";",{display:"flex",justifyContent:"center"}," ",{marginLeft:"0.25rem"},";");function xi(e){var n=0,t=e.children,s=t&&t.length;if(!s)n=1;else for(;--s>=0;)n+=t[s].value;e.value=n}function vi(){return this.eachAfter(xi)}function ki(e,n){let t=-1;for(const s of this)e.call(n,s,++t,this);return this}function ji(e,n){for(var t=this,s=[t],o,a,l=-1;t=s.pop();)if(e.call(n,t,++l,this),o=t.children)for(a=o.length-1;a>=0;--a)s.push(o[a]);return this}function Ci(e,n){for(var t=this,s=[t],o=[],a,l,m,h=-1;t=s.pop();)if(o.push(t),a=t.children)for(l=0,m=a.length;l<m;++l)s.push(a[l]);for(;t=o.pop();)e.call(n,t,++h,this);return this}function Mi(e,n){let t=-1;for(const s of this)if(e.call(n,s,++t,this))return s}function Si(e){return this.eachAfter(function(n){for(var t=+e(n.data)||0,s=n.children,o=s&&s.length;--o>=0;)t+=s[o].value;n.value=t})}function Ti(e){return this.eachBefore(function(n){n.children&&n.children.sort(e)})}function Ni(e){for(var n=this,t=Li(n,e),s=[n];n!==t;)n=n.parent,s.push(n);for(var o=s.length;e!==t;)s.splice(o,0,e),e=e.parent;return s}function Li(e,n){if(e===n)return e;var t=e.ancestors(),s=n.ancestors(),o=null;for(e=t.pop(),n=s.pop();e===n;)o=e,e=t.pop(),n=s.pop();return o}function Ri(){for(var e=this,n=[e];e=e.parent;)n.push(e);return n}function zi(){return Array.from(this)}function Di(){var e=[];return this.eachBefore(function(n){n.children||e.push(n)}),e}function Ei(){var e=this,n=[];return e.each(function(t){t!==e&&n.push({source:t.parent,target:t})}),n}function*Bi(){var e=this,n,t=[e],s,o,a;do for(n=t.reverse(),t=[];e=n.pop();)if(yield e,s=e.children)for(o=0,a=s.length;o<a;++o)t.push(s[o]);while(t.length)}function _t(e,n){e instanceof Map?(e=[void 0,e],n===void 0&&(n=qi)):n===void 0&&(n=Ii);for(var t=new Ie(e),s,o=[t],a,l,m,h;s=o.pop();)if((l=n(s.data))&&(h=(l=Array.from(l)).length))for(s.children=l,m=h-1;m>=0;--m)o.push(a=l[m]=new Ie(l[m])),a.parent=s,a.depth=s.depth+1;return t.eachBefore(Pi)}function Ai(){return _t(this).eachBefore(Oi)}function Ii(e){return e.children}function qi(e){return Array.isArray(e)?e[1]:null}function Oi(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Pi(e){var n=0;do e.height=n;while((e=e.parent)&&e.height<++n)}function Ie(e){this.data=e,this.depth=this.height=0,this.parent=null}Ie.prototype=_t.prototype={constructor:Ie,count:vi,each:ki,eachAfter:Ci,eachBefore:ji,find:Mi,sum:Si,sort:Ti,path:Ni,ancestors:Ri,descendants:zi,leaves:Di,links:Ei,copy:Ai,[Symbol.iterator]:Bi};function Vi(e){if(typeof e!="function")throw new Error;return e}function Se(){return 0}function Te(e){return function(){return e}}function $i(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Fi(e,n,t,s,o){for(var a=e.children,l,m=-1,h=a.length,g=e.value&&(s-n)/e.value;++m<h;)l=a[m],l.y0=t,l.y1=o,l.x0=n,l.x1=n+=l.value*g}function Ki(e,n,t,s,o){for(var a=e.children,l,m=-1,h=a.length,g=e.value&&(o-t)/e.value;++m<h;)l=a[m],l.x0=n,l.x1=s,l.y0=t,l.y1=t+=l.value*g}var Gi=(1+Math.sqrt(5))/2;function Hi(e,n,t,s,o,a){for(var l=[],m=n.children,h,g,p=0,v=0,u=m.length,b,x,M=n.value,
2j,d,B,N,_,D,E;p<u;){b=o-t,x=a-s;do j=m[v++].value;while(!j&&v<u);for(d=B=j,D=Math.max(x/b,b/x)/(M*e),E=j*j*D,_=Math.max(B/E,E/d);v<u;++v){if(j+=g=m[v].value,g<d&&(d=g),g>B&&(B=g),E=j*j*D,N=Math.max(B/E,E/d),N>_){j-=g;break}_=N}l.push(h={value:j,dice:b<x,children:m.slice(p,v)}),h.dice?Fi(h,t,s,o,M?s+=x*j/M:a):Ki(h,t,s,M?t+=b*j/M:o,a),M-=j,p=v}return l}const Wi=(function e(n){function t(s,o,a,l,m){Hi(n,s,o,a,l,m)}return t.ratio=function(s){return e((s=+s)>1?s:1)},t})(Gi);function Ui(){var e=Wi,n=!1,t=1,s=1,o=[0],a=Se,l=Se,m=Se,h=Se,g=Se;function p(u){return u.x0=u.y0=0,u.x1=t,u.y1=s,u.eachBefore(v),o=[0],n&&u.eachBefore($i),u}function v(u){var b=o[u.depth],x=u.x0+b,M=u.y0+b,j=u.x1-b,d=u.y1-b;j<x&&(x=j=(x+j)/2),d<M&&(M=d=(M+d)/2),u.x0=x,u.y0=M,u.x1=j,u.y1=d,u.children&&(b=o[u.depth+1]=a(u)/2,x+=g(u)-b,M+=l(u)-b,j-=m(u)-b,d-=h(u)-b,j<x&&(x=j=(x+j)/2),d<M&&(M=d=(M+d)/2),e(u,x,M,j,d))}return p.round=function(u){return arguments.length?(n=!!u,p):n},p.size=function(u){return arguments.length?(t=+u[0],s=+u[1],p):[t,s]},p.tile=function(u){return arguments.length?(e=Vi(u),p):e},p.padding=function(u){return arguments.length?p.paddingInner(u).paddingOuter(u):p.paddingInner()},p.paddingInner=function(u){return arguments.length?(a=typeof u=="function"?u:Te(+u),p):a},p.paddingOuter=function(u){return arguments.length?p.paddingTop(u).paddingRight(u).paddingBottom(u).paddingLeft(u):p.paddingTop()},p.paddingTop=function(u){return arguments.length?(l=typeof u=="function"?u:Te(+u),p):l},p.paddingRight=function(u){return arguments.length?(m=typeof u=="function"?u:Te(+u),p):m},p.paddingBottom=function(u){return arguments.length?(h=typeof u=="function"?u:Te(+u),p):h},p.paddingLeft=function(u){return arguments.length?(g=typeof u=="function"?u:Te(+u),p):g},p}function Qi(e){function n(v){const u=te.sortBy(v.slice(0)),b=u[0],x=b.length,M=u[u.length-1];let j=0;for(;j<x&&b.charAt(j)===M.charAt(j);)j++;const d=b.substring(0,j),B=d.split(/[\s\\/]/),N=B[B.length-1];return d.substring(0,d.length-N.length)}function t(v){e.onRectangleClick&&e.onRectangleClick(v)}const{items:s,height:o,width:a}=e,l=_t({children:s}).sum(v=>v.size).sort((v,u)=>{var b,x;return((b=u.value)!=null?b:0)-((x=v.value)!=null?x:0)}
2),h=Ui().round(!0).size([a,o])(l).leaves(),g=n(s.map(v=>v.label)),p=a/2;return i.jsx(Yi,{style:{width:a,height:o},"data-component":"tree-map",children:h.map(({data:v,y0:u,y1:b,x0:x,x1:M})=>i.jsx(Rn,{fill:v.color,gradient:v.gradient,height:b-u,icon:v.icon,itemKey:v.key,label:v.label,onClick:()=>{t(v)},placement:x===0||M<p?st.Right:st.Left,prefix:g,tooltip:v.tooltip,width:M-x,x,y:u},v.key))})}const Yi=re("ul",{target:"e1m9vb860"})({position:"relative"},";");const ss=Es(({componentKey:e,metricKeys:n,branchLike:t})=>{const s=Bs(),o=ve(t);return As({queryKey:["measures","component",e,"branchLike",{...o},n],queryFn:async()=>{const a=await qs(e,n,o);return n.forEach(l=>{var h,g;const m=(g=(h=a.component.measures)==null?void 0:h.find(p=>p.metric===l))!=null?g:null;s.setQueryData(["measures","details",e,"branchLike",{...o},l],m)}),a},staleTime:Is.LONG})});const Xi={Reliability:{x:r.ncloc,y:r.software_quality_reliability_remediation_effort,size:r.software_quality_reliability_issues,colors:[r.software_quality_reliability_rating]},Security:{x:r.ncloc,y:r.software_quality_security_remediation_effort,size:r.software_quality_security_issues,colors:[r.software_quality_security_rating]},Maintainability:{x:r.ncloc,y:r.software_quality_maintainability_remediation_effort,size:r.software_quality_maintainability_issues,colors:[r.software_quality_maintainability_rating]},Coverage:{x:r.complexity,y:r.coverage,size:r.uncovered_lines,yDomain:[100,0]},Duplications:{x:r.ncloc,y:r.duplicated_lines,size:r.duplicated_blocks},project_overview:{x:r.software_quality_maintainability_remediation_effort,y:r.coverage,size:r.ncloc,colors:[r.software_quality_reliability_rating,r.software_quality_security_rating],yDomain:[100,0]}},Zi={Reliability:{x:r.ncloc,y:r.reliability_remediation_effort,size:r.software_quality_reliability_issues,colors:[r.reliability_rating]},Security:{x:r.ncloc,y:r.security_remediation_effort,size:r.software_quality_security_issues,colors:[r.security_rating]},Maintainability:{x:r.ncloc,y:r.sqale_index,size:r.software_quality_maintainability_issues,colors:[r.sqale_rating]},Coverage:{x:r.complexity,y:r.coverage,size:r.uncovered_lines,yDomain:[100,0]},Duplications:{x:r.ncloc,y:r.duplicated_lines,size:r.duplicated_blocks},project_overview:{x:r.sqale_index,y:r.coverage,size:r.ncloc,colors:[r.reliability_rating,r.security_rating],yDomain:[100,0]}},Ji={Reliability:{x:r.ncloc,y:r.reliability_remediation_effort,size:r.bugs,colors:[r.reliability_rating]},Security:{x:r.ncloc,y:r.security_remediation_effort,size:r.vulnerabilities,colors:[r.security_rating]},Maintainability:{x:r.ncloc,y:r.sqale_index,size:r.code_smells,colors:[r.sqale_rating]},Coverage:{x:r.complexity,y:r.coverage,size:r.uncovered_lines,yDomain:[100,0]},Duplications:{x:r.ncloc,y:r.duplicated_lines,size:r.duplicated_blocks},project_overview:{x:r.sqale_index,y:r.coverage,size:r.ncloc,colors:[r.reliability_rating,r.security_rating],yDomain:[100,0]}};function ns(e){const{data:n}=$e();return n||!Ot(e)?Ji:Pt(e)?Xi:Zi}const oe="new_code_category",ae="overall_category",is={Reliability:{categories:[oe,ae],order:[oe,r.new_software_quality_reliability_issues,r.new_bugs,r.new_reliability_rating,Y[r.new_reliability_rating],r.new_reliability_remediation_effort,Y[r.new_reliability_remediation_effort],ae,r.software_quality_reliability_issues,r.bugs,r.reliability_rating,Y[r.reliability_rating],r.reliability_remediation_effort,Y[r.reliability_remediation_effort]]},Security:{categories:[oe,ae],order:[oe,r.new_software_quality_security_issues,r.new_vulnerabilities,r.new_security_rating,Y[r.new_security_rating],r.new_security_remediation_effort,Y[r.new_security_remediation_effort],ae,r.software_quality_security_issues,r.vulnerabilities,r.security_rating,Y[r.security_rating],r.security_remediation_effort,Y[r.security_remediation_effort]]},SecurityReview:{categories:[oe,ae],order:[oe,r.new_security_hotspots,r.new_security_review_rating,Y[r.new_security_review_rating],r.new_security_hotspots_reviewed,ae,r.security_hotspots,r.security_review_rating,Y[r.security_review_rating],r.security_hotspots_reviewed]},Maintainability:{categories:[oe,ae],order:[oe,r.new_software_quality_maintainability_issues,r.new_code_smells,r.new_technical_debt,Y[r.new_technical_debt],r.new_sqale_debt_ratio,Y[r.new_sqale_debt_ratio],r.new_maintainability_rating,Y[r.new_maintainability_rating],ae,r.software_quality_maintainability_issues,r.code_smells,r.sqale_index,Y[r.sqale_index],r.sqale_debt_ratio,Y[r.sqale_debt_ratio],r.sqale_rating,Y[r.sqale_rating],r.effort_to_reach_maintainability_rating_a,Y[r.effort_to_reach_maintainability_rating_a]]},Coverage:{categories:[oe,ae,"tests_category"],order:[oe,r.new_coverage,r.new_lines_to_cover,r.new_uncovered_lines,r.new_line_coverage,r.new_conditions_to_cover,r.new_uncovered_conditions,r.new_branch_coverage,ae,r.coverage,r.lines_to_cover,r.uncovered_lines,r.line_coverage,r.conditions_to_cover,r.uncovered_conditions,r.branch_coverage,"tests_category",r.tests,r.test_errors,r.test_failures,r.skipped_tests,r.test_success_density,r.test_execution_time]},Duplications:{categories:[oe,ae],order:[oe,r.new_duplicated_lines_density,r.new_duplicated_lines,r.new_duplicated_blocks,ae,r.duplicated_lines_density,r.duplicated_lines,r.duplicated_blocks,r.duplicated_files]},Size:{order:[r.new_lines,r.ncloc,r.lines,r.statements,r.functions,r.classes,r.files,r.directories]},Complexity:{order:[r.complexity]},Releasability:{order:[r.releasability_rating,r.releasability_effort,r.alert_status]},Issues:{categories:[oe,ae],order:[oe,r.new_violations,r.new_accepted_issues,ae,r.violations,r.confirmed_issues,r.accepted_issues,r.false_positive_issues]}};const rs=500,qe="project_overview",os=K.tree,as=qe,Nt=["Releasability","Security","Reliability","Maintainability","SecurityReview","Coverage","Duplications","Size","Complexity"],er=[r.high_impact_accepted_issues],tr=[...er,...Ks,r.blocker_violations,r.new_blocker_violations,r.critical_violations,r.new_critical_violations,r.major_violations,r.new_major_violations,r.info_violations,r.new_info_violations,r.minor_violations,r.new_minor_violations,r.software_quality_blocker_issues,r.new_software_quality_blocker_issues,r.software_quality_high_issues,r.new_software_quality_high_issues,r.software_quality_medium_issues,r.new_software_quality_medium_issues,r.software_quality_low_issues,r.new_software_quality_low_issues,r.software_quality_info_issues,r.new_software_quality_info_issues],sr=[r.accepted_issues,r.new_accepted_issues,r.confirmed_issues,r.false_positive_issues,r.violations,r.new_violations],nr=te.memoize((e,n=!1)=>{let t=e.filter(s=>!tr.includes(s.metric.key)).map(s=>{const o=he(s.metric.key),a=o?s.leak:s.value;return{...s,[o?"leak":"value"]:a}});return!n&&Gs(e)?t=t.filter(s=>!Ze.includes(s.metric.key)):t=t.filter(s=>!$t.includes(s.metric.key)),!n&&Pt(e)?t=t.filter(s=>!Hs.includes(s.metric.key)&&!Ws.includes(s.metric.key)):t=t.filter(s=>!Us.includes(s.metric.key)),!n&&Ot(e)?t=t.filter(s=>!Je.includes(s.metric.key)):t=t.filter(s=>!Ft.includes(s.metric.key)),ds(t)});
2function ls(e,n,t=!1,s=!1){return!s&&Je.includes(e.key)?U("component_measures.awaiting_analysis.name"):!s&&Ze.includes(e.key)?U("component_measures.leak_awaiting_analysis.name"):[...$t,...Ft,...sr,...Je,...Ze].includes(e.key)?U("component_measures.metric.".concat(e.key,".").concat(t?"detailed_name":"name")):n(e)}function ir(e){return e.filter(n=>!$s.includes(n.metric.key))}function cs(e,n){const s=(is[e]||{}).order||[];return te.sortBy(n,[o=>{if(typeof o=="string")return s.indexOf(o);const a=s.indexOf(o.metric.key);return a>=0?a:s.length},o=>typeof o=="string"?o:le(o.metric)])}function rr(e,n){var s;const t=(s=is[e])==null?void 0:s.categories;return t&&t.length>0?[...t,...n]:n}function us(e,n,t){if(!e.measures)return{...e,measures:[]};const s=e.measures.map(m=>Zt(m,t)),o=n&&s.find(m=>m.metric.key===n.key),a=o==null?void 0:o.value,l=o==null?void 0:o.leak;return{...e,value:a,leak:l,measures:s}}function or({measures:e=[],qualifier:n}){const t=[];return ce.Portfolio!==n&&ce.SubPortfolio!==n&&t.push(r.alert_status),n===ce.Application&&t.push(r.releasability_rating,r.releasability_effort),e.filter(s=>!t.includes(s.metric))}const ds=te.memoize(e=>{const n=te.toPairs(te.groupBy(e,t=>t.metric.domain)).map(t=>({name:t[0],measures:t[1]}));return te.sortBy(n,[t=>{const s=Nt.indexOf(t.name);return s>=0?s:Nt.length},"name"])});function ms(e){return![r.releasability_rating,r.releasability_effort].includes(e)}function Ge(e){return e!==r.alert_status}function hs(e,n){return[ue.Percent,ue.Rating,ue.Level].includes(n)&&Ge(e)}function ps(e,n){return e[n]!==void 0}function Oe(e){return!e||Fs(e)}function ar(e,n){const t=Vs(Object.values(e)).map(s=>s.key);return Vt(n)?t.filter(s=>he(s)):t}function fs(e,n,t){var o;const s=e[n];return{x:t[s.x],y:t[s.y],size:t[s.size],colors:(o=s.colors)==null?void 0:o.map(a=>t[a])}}function lr(e,n){return e[n].yDomain}function Pe(e){return e===qe}function cr(e,n){const t=Xe(n)||os;if(Ge(e)){if(t===K.list&&!ms(e))return K.tree}else return K.list;return t}const Ve=te.memoize(e=>{var s;const n=Xe(e.metric)||as,t=(s=Ps[n])!=null?s:n;return{metric:t,selected:Xe(e.selected),view:cr(t,e.view),asc:Os(e.asc)}}),ur=te.memoize(e=>Qs({metric:e.metric===as?void 0:He(e.metric),selected:He(e.selected),view:e.view===os?void 0:He(e.view)}));function dr({measure:e,componentKey:n}){const{component:t}=Ys(),s=he(e.metric.key),{data:o}=Fe(t),a=s?e.leak:e.value;return i.jsx(me,{className:"sw-flex sw-items-center sw-mr-1",id:"measure-".concat(e.metric.key,"-").concat(s?"leak":"value"),isSubtle:!0,"data-component":"subnavigation-measure-value",children:i.jsx(yt,{badgeSize:It.ExtraSmall,branchLike:o,componentKey:n,metricKey:e.metric.key,metricType:e.metric.type,small:!0,value:a})})}function mr({componentKey:e,measure:n,name:t,onChange:s,selected:o}){const{key:a}=n.metric;return i.jsxs(gt,{active:a===o,ariaCurrent:a===o,className:"sw-pl-2 sw-w-full sw-flex sw-justify-between",id:"measure-".concat(a,"-name"),onClick:s,value:a,"data-component":"domain-subnavigation-item",children:[t,i.jsx(dr,{componentKey:e,measure:n})]},a)}function hr(e){const{componentKey:n,domain:t,onChange:s,open:o,selected:a,showFullMeasures:l,measures:m}=e,{data:h=!1}=$e(),g="component_measures.domain_subnavigation.".concat(t.name,".help"),p=zn(g)?U(g):void 0,v=rr(t.name,t.measures),u=ns(m),x=v.some(d=>typeof d=="string")?Bn:le;let M=cs(t.name,v);const j=d=>l&&ps(u,d);return M=M.filter((d,B)=>typeof d=="object"||B<M.length-1&&typeof M[B+1]=="object"),i.jsxs(Dn,{header:i.jsxs("div",{className:"sw-flex sw-items-center sw-gap-3",children:[i.jsx("strong",{className:"sw-typo-semibold",children:es(t.name)}),p&&i.jsx(Kt,{overlay:p,children:i.jsx(Xs,{"aria-hidden":"false",description:p})})]}),id:"measure-".concat(t.name),initExpanded:o,"data-component":"domain-subnavigation",children:[t.name==="Security"&&i.jsx($n,{className:"sw-m-2"}),j(t.name)&&i.jsx(gt,{active:t.name===a,ariaCurrent:t.name===a,onClick:s,value:t.name,children:i.jsx(ie,{id:"component_measures.domain_overview"})}),M.map(d=>typeof d=="string"?l&&i.jsx(En,{children:U("component_measures.subnavigation_category",d)},d):i.jsx(mr,{componentKey:n,measure:d,name:ls(d.metric,x,!1,h),onChange:s,selected:a},d.metric.key))]})}function pr(e){const{showFullMeasures:n,updateQuery:t,componentKey:s,selectedMetric:o,measures:a}=e,{data:l}=$e(),m=nr(a,l),h=q.useCallback(p=>{t({metric:p})},[t]),g=()=>{h(qe)};return i.jsx(Ss.AsideLeft,{size:"medium","data-component":"sidebar",children:i.jsxs("section",{"aria-label":U("component_measures.navigation"),className:"sw-flex sw-flex-col sw-gap-4",children:[i.jsx(ct,{anchor:"measures_f
2ilters",label:U("component_measures.skip_to_navigation"),weight:10}),i.jsx(An,{children:i.jsx(gt,{active:Pe(o),ariaCurrent:Pe(o),onClick:g,children:U("component_measures.overview",qe,"subnavigation")})}),m.map(p=>i.jsx(hr,{componentKey:s,domain:p,measures:a,onChange:h,open:fr(o,p),selected:o,showFullMeasures:n},p.name))]})})}function fr(e,n){return e===n.name||n.measures.some(t=>t.metric.key===e)}function gs({className:e,current:n,total:t}){return i.jsxs(me,{className:ze("sw-whitespace-nowrap",e),isSubtle:!0,"data-component":"files-counter",children:[i.jsxs(gr,{className:"sw-typo-semibold",children:[ye(n)&&ee(n,ue.Integer)+"/",ee(t,ue.Integer)]})," ",U("component_measures.items")]})}gs.displayName="FilesCounter";const gr=re("strong",{target:"e1e7xnwd0"})("color:",de("pageContent"),";");const Be={coverage:[r.uncovered_lines,r.uncovered_conditions],line_coverage:[r.uncovered_lines],branch_coverage:[r.uncovered_conditions],uncovered_lines:[r.line_coverage],uncovered_conditions:[r.branch_coverage],new_coverage:[r.new_uncovered_lines,r.new_uncovered_conditions],new_line_coverage:[r.new_uncovered_lines],new_branch_coverage:[r.new_uncovered_conditions],new_uncovered_lines:[r.new_line_coverage],new_uncovered_conditions:[r.new_branch_coverage],duplicated_lines_density:[r.duplicated_lines],new_duplicated_lines_density:[r.new_duplicated_lines],duplicated_lines:[r.duplicated_lines_density],new_duplicated_lines:[r.new_duplicated_lines_density]};const yr=50;function _r(e){const{branchLike:n,component:t,metric:s,rootComponent:o,view:a}=e;let l="",m=t.name;a===K.list&&[ce.File,ce.TestFile,ce.Directory].includes(t.qualifier)&&t.path&&({head:l,tail:m}=Zs(t.path));let h;const g=t.refKey||o.key,p=t.refKey?"":t.key;return h=Js(g,p,s.key,t.branch?Fn(t.branch):n,a),s.key===r.projects&&Le(t.qualifier)&&(h=Ae(g,t.branch)),[r.releasability_rating,r.alert_status].includes(s.key)&&(Gt(t.qualifier)||Le(t.qualifier))&&(h=Ae(g,t.branch)),i.jsxs(Ht,{className:"sw-py-3","data-component":"component-cell",children:[i.jsx(kt,{"aria-hidden":!0,icon:i.jsx(Wt,{qualifier:t.qualifier}),tabIndex:-1,title:t.path,to:h}),i.jsxs(kt,{className:"sw-flex sw-flex-wrap",title:t.path,to:h,children:[l.length>0&&i.jsxs(me,{isSubtle:!0,children:[Ut(l,yr),"/"]}),i.jsx(me,{isHighlighted:!0,children:m})]})]})}function wt(){return i.jsx(me,{isSubtle:!0,"data-component":"empty-result",children:i.jsx(ie,{id:"no_results"})})}function Lt({componentKey:e,measure:n,metric:t,branchLike:s}){const a=((l={})=>he(t.key)?l.leak:l.value)(n);return i.jsx(et,{className:"sw-py-3","data-component":"measure-cell",children:i.jsx(yt,{branchLike:s,componentKey:e,metricKey:t.key,metricType:t.type,small:!0,value:a})})}function wr({components:e,metric:n,metrics:t,...s}){const{branchLike:o,rootComponent:a,selectedComponent:l}=s;if(!e.length)return i.jsx(wt,{});const m=(Be[n.key]||[]).map(h=>t[h]);return i.jsx(en,{columnCount:m.length+2,columnWidths:["auto",...te.times(m.length+1,()=>"1%")],header:m.length>0&&i.jsxs(sn,{children:[i.jsx(Ht,{}),i.jsx(et,{className:"sw-typo-default",children:le(n)}),m.map(h=>i.jsx(et,{className:"sw-typo-default",children:le(h)},h.key))]}),"data-component":"components-list",children:e.map(h=>i.jsxs(tn,{className:"it__measures-component-row",selected:h.key===(l==null?void 0:l.key),children:[i.jsx(_r,{branchLike:o,component:h,metric:n,rootComponent:a,view:s.view}),i.jsx(Lt,{branchLike:o,componentKey:h.key,measure:h,metric:n}),m.map(g=>i.jsx(Lt,{branchLike:o,componentKey:h.key,measure:h.measures.find(p=>p.metric.key===g.key),metric:g},g.key))]},h.key))})}class br extends q.PureComponent{constructor(t){super(t);F(this,"handleKeyDown",t=>{if(nn(t)||rn(t))return!0;t.key===ge.UpArrow?(t.preventDefault(),this.selectPrevious()):t.key===ge.DownArrow?(t.preventDefault(),this.selectNext()):t.key===ge.RightArrow&&(t.preventDefault(),this.openSelected())});F(this,"getVisibleComponents",()=>{const{components:t}=this.props;if(this.state.showBestMeasures)return t;const s=t.filter(o=>!this.hasBestValue(o));return s.length===0?t:s});F(this,"handleShowBestMeasures",()=>{this.setState({showBestMeasures:!0})});F(this,"hasBestValue",t=>{const{metric:s}=this.props,o=t.measures.find(a=>a.metric.key===s.key);return o&&he(s.key)?on(o):!!(o!=null&&o.bestValue)});F(this,"openSelected",()=>{this.props.selectedComponent!==void 0&&this.props.handleOpen(this.props.selectedComponent)});F(this,"selectPrevious",()=>{const{selectedIdx:t}=this.props,s=this.getVisibleComponents();t!==void 0&&t>0?this.props.handleSelect(s[t-1]):this.props.handleSelect(s[s.length-1])});F(this,"selectNext",()=>{const{selectedIdx:t}=this.props,s=this.getVisibleComponents();t!==void 0&&t<s.length-1?this.props.handleSelect(s[t+1]):this.props.handleSelect(s[0])});F(this,"scrollToElement",()=>{var t,s;(s=(t=this.listContainer)==null?void 0:t.getElementsByClassName("selected")[0])==null||s.scrollIntoView({block:"center",behavior:"smooth"})});this.state={showBestMeasures:t.defaultShowBestMeasures},this.selectNext=te.throttle(this.selectNext,100),this.selectPrevious=te.throttle(this.selectPrevious,100)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown),this.props.selectedComponent!==void 0&&this.scrollToElement()}componentDidUpdate(t){this.props.selectedComponent&&t.selectedComponent!==this.props.selectedComponent&&this.scrollToElement(),(t.metric.key!==this.props.metric.key||t.view!==this.props.view)&&this.setState({showBestMeasures:this.props.defaultShowBestMeasures})}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}render(){const{components:t}=this.props,s=this.getVisibleComponents(),o=s.length<t.length;return i.jsxs("div",{ref:a=>{this.listContainer=a},"data-component":"files-view",children:[i.jsx(wr,{branchLike:this.props.branchLike,components:s,metric:this.props.metric,metrics:this.props.metrics,rootComponent:this.props.rootComponent,selectedComponent:this.props.selectedComponent,view:this.props.view}),o&&this.props.paging&&i.jsxs(In,{className:"sw-mt-4",variant:"info",children:[Re("component_measures.hidden_best_score_metrics",ee(this.props.paging.total-s.length,ue.Integer),ee(this.props.metric.bestValue,this.props.metric.type)),i.jsx(At,{ariaLabel:U("component_measures.hidden_best_score_metrics_show_label"),className:"sw-ml-4",onClick:this.handleShowBestMeasures,children:i.jsx(ie,{id:"show_them"})})]}),!o&&this.props.paging&&this.props.components.length>0&&i.jsx(an,{count:this.props.components.length,loadMore:this.props.fetchMore,loading:this.props.loadingMore,total:this.props.paging.total})]})}}function xr({colorScale:e,colorNA:n,metricType:t}){const s=e.domain(),o=e.range();return i.jsxs("div",{className:"sw-flex sw-justify-center sw-gap-6","data-component":"color-box-legend",children:[s.map((a,l)=>i.jsxs("div",{children:[i.jsx(Rt,{style:{borderColor:o[l]},children:i.jsx("span",{style:{backgroundColor:o[l]}})}),ee(a,t)]},a)),n&&i.jsxs("div",{children:[i.jsx(Rt,{style:{borderColor:n},children:i.jsx("span",{style:{backgroundColor:n}})}),"N/A"]})]})}const Rt=re("span",{target:"ewdyju30"})({name:"1lmw7us",styles:"display:inline-block;margin-top:1px;margin-right:4px;border:1px solid;
2& span{display:block;width:8px;height:8px;}"});const fe=4,vr=[0,8,16,24];function kr({className:e,colorScale:n,padding:t=[12,24,0,0],height:s,showColorNA:o=!1,naColors:a=["rgb(36,36,36)","rgb(120,120,120)"],width:l}){const m=n.range(),h=n.domain(),g=m.length-1,p=h.length-1,v=l-t[1],u=s-t[0];return i.jsxs("svg",{className:e,height:s,width:l,"data-component":"color-gradient-legend",children:[i.jsxs("defs",{children:[i.jsx("linearGradient",{id:"gradient-legend",children:m.map((b,x)=>i.jsx("stop",{offset:x/g,stopColor:String(b)},x))}),i.jsx("pattern",{height:"30",id:"stripes",patternTransform:"rotate(45 0 0)",patternUnits:"userSpaceOnUse",width:"30",children:vr.map(b=>i.jsxs(q.Fragment,{children:[i.jsx("line",{style:{stroke:a[0],strokeWidth:fe},x1:b,x2:b,y1:"0",y2:"30"}),i.jsx("line",{style:{stroke:a[1],strokeWidth:fe},x1:b+fe,x2:b+fe,y1:"0",y2:"30"})]},b))})]}),i.jsxs("g",{transform:"translate(".concat(t[3],", ").concat(t[0],")"),children:[i.jsx("rect",{fill:"url(#gradient-legend)",height:u,width:v,x:0,y:0}),h.map((b,x)=>i.jsx(jr,{dy:"-2px",x:v*(x/p),y:0,children:b},x))]}),o&&i.jsxs("g",{transform:"translate(".concat(v,", ").concat(t[0],")"),children:[i.jsx("rect",{fill:"url(#stripes)",height:u,width:t[1]-fe,x:fe,y:0}),i.jsx(ys,{dy:"-2px",x:fe+(t[1]-fe)/2,y:0,children:"N/A"})]})]})}const ys=re("text",{target:"eccn53d1"})("text-anchor:middle;fill:",de("pageContent"),";font-size:10px;"),jr=re(ys,{target:"eccn53d0"})({name:"1jkkhri",styles:"&:first-of-type{text-anchor:start;}&:last-of-type{text-anchor:end;}"});const Cr=[0,25,50,75,100],Mr=[1,2,3,4,5],Sr=500,zt=["treeMap.NA1","treeMap.NA2"],Tr=["treeMap.A","treeMap.B","treeMap.C","treeMap.D","treeMap.E"];class Nr extends q.PureComponent{constructor(t){super(t);F(this,"getTreemapComponents",({components:t,metric:s})=>{const o=this.getColorScale(s);return t.map(a=>{var v;const l=a.measures.find(u=>u.metric.key===s.key),m=a.measures.find(u=>u.metric.key!==s.key);if(!m)return;const h=l&&(he(s.key)?l.leak:l.value),g=he(m.metric.key)?m.leak:m.value;if(g===void 0)return;const p=Number(g);if(!(p<1))return{key:(v=xe(a))!=null?v:"",color:ye(h)?o(h):void 0,gradient:ye(h)?void 0:this.getNAGradient(),icon:i.jsx(Wt,{fill:"pageContent",qualifier:a.qualifier}),label:[a.name,a.branch].filter(u=>!!u).join(" / "),size:p,measureValue:h,metric:s,tooltip:this.getTooltip({colorMetric:s,colorValue:h,component:a,sizeMetric:m.metric,sizeValue:p}),sourceData:a}}).filter(ye)});F(this,"getNAGradient",()=>{const{theme:t}=this.props,[s,o]=zt.map(a=>de(a)({theme:t}));return"linear-gradient(-45deg, ".concat(s," 25%, ").concat(o," 25%, ").concat(o," 50%, ").concat(s," 50%, ").concat(s," 75%, ").concat(o," 75%, ").concat(o," 100%)")});F(this,"getMappedThemeColors",()=>{const{theme:t}=this.props;return Tr.map(s=>de(s)({theme:t}))});F(this,"getLevelColorScale",()=>qn().domain(["ERROR","WARN","OK","NONE"]).range(this.getMappedThemeColors()));F(this,"getPercentColorScale",t=>{const s=Ne().domain(Cr);return s.range(t.higherValuesAreBetter?[...this.getMappedThemeColors()].reverse():this.getMappedThemeColors()),s});F(this,"getRatingColorScale",()=>Ne().domain(Mr).range(this.getMappedThemeColors()));F(this,"getColorScale",t=>t.type===ue.Level?this.getLevelColorScale():t.type===ue.Rating?this.getRatingColorScale():this.getPercentColorScale(t));F(this,"getTooltip",({colorMetric:t,colorValue:s,component:o,sizeMetric:a,sizeValue:l})=>{const m=t&&s!==void 0?ee(s,t.type):"â";return i.jsxs("div",{className:"sw-text-left",children:[[o.name,o.branch].filter(h=>!te.isEmpty(h)).join(" / "),i.jsx("br",{}),"".concat(le(a),": ").concat(ee(l,a.type)),i.jsx("br",{}),"".concat(le(t),": ").concat(m)]})});this.state={treemapItems:this.getTreemapComponents(t)}}componentDidUpdate(t){(t.components!==this.props.components||t.metric!==this.props.metric)&&this.setState({treemapItems:this.getTreemapComponents(this.props)})}handleSelect(t){t.sourceData&&this.props.handleSelect(t.sourceData)}renderLegend(){const{metric:t,theme:s}=this.props,o=this.getColorScale(t);return[ue.Level,ue.Rating].includes(t.type)?i.jsx(xr,{colorScale:o,metricType:t.type}):i.jsx(kr,{colorScale:o,height:30,naColors:zt.map(a=>de(a)({theme:s})),showColorNA:!0,width:200})}render(){const{treemapItems:t}=this.state;if(t.length<=0)return i.jsx(wt,{"data-component":"tree-map-view"});const{components:s,metric:o}=this.props,a=s.length>0?s[0].measures.find(l=>l.metric.key!==o.key):null;return i.jsxs("div",{"data-testid":"treemap","data-component":"tree-map-view",children:[i.jsxs(me,{as:"div",className:"sw-flex sw-items-start sw-mb-2",isSubtle:!0,children:[i.jsxs("span",{children:[i.jsx("strong",{className:"sw-mr-1",children:i.jsx(ie,{id:"component_measures.legend.color"})}
2),le(o)]}),i.jsxs("span",{className:"sw-ml-2 sw-flex-1",children:[i.jsx("strong",{className:"sw-mr-1",children:i.jsx(ie,{id:"component_measures.legend.size"})}),U("metric",a!=null&&a.metric?a.metric.key:r.ncloc,"name")]}),i.jsx("span",{children:this.renderLegend()})]}),i.jsx(Lr,{height:Sr,items:t,onRectangleClick:this.handleSelect.bind(this)})]})}}function Lr({height:e,items:n,onRectangleClick:t}){const s=q.useRef(null),[o]=ts(s);return i.jsx("div",{className:"sw-min-w-full sw-overflow-hidden sw-w-0",ref:s,"data-component":"tree-map-auto-sizer",children:i.jsx("div",{className:"sw-overflow-hidden sw-w-full",children:o!==void 0&&i.jsx(Qi,{height:e,items:n,onRectangleClick:t,width:o})})})}const Rr=Kn(Nr);function _s({left:e,right:n}){return i.jsxs(zr,{className:"sw-py-3 sw-px-6 sw-flex sw-justify-between sw-items-center","data-component":"measure-content-header",children:[i.jsx("div",{className:"sw-flex sw-items-center",children:e}),i.jsx("div",{children:n})]})}const zr=re("div",{target:"e1no1urw0"})("border-bottom:",ft("default","pageBlockBorder"),";");const Dr=1e3;function Er(e){const{distribution:n,languages:t}=e;let s=n.split(";").map(h=>{const g=h.split("=");return{language:g[0],lines:parseInt(g[1],10)}});s=te.sortBy(s,h=>-h.lines);const o=s.map(h=>h.lines),a=s.map(h=>Br(t,h.language)).map(Ar),l=s.map(h=>h.lines>Dr?ee(h.lines,ue.Integer):""),m=s.map(h=>ee(h.lines,ue.ShortInteger));return i.jsx(On,{bars:o,height:s.length*25,leftAlignTicks:!0,padding:[0,60,0,80],width:260,yTicks:a,yTooltips:l,yValues:m,"data-component":"language-distribution"})}function Br(e,n){if(n==="<null>")return U("unknown");const t=e[n];return t?t.name:n}function Ar(e){return e.length>10?"".concat(e.substr(0,7),"..."):e}const Ir=Gn(Er);class ws extends q.PureComponent{constructor(){super(...arguments);F(this,"intl",Pn());F(this,"formatDate",t=>this.intl.formatDate(t,ln));F(this,"formatDateTime",t=>this.intl.formatTime(t,cn))}render(){const{component:t,period:s}=this.props;if(t.qualifier===ce.Application)return i.jsx(Dt,{className:"sw-px-2 sw-py-1 sw-rounded-1","data-component":"leak-period-legend",children:U("issues.new_code_period")});const o=Hn(s,s.mode==="manual_baseline"?this.formatDateTime:this.formatDate),a=i.jsxs(Dt,{className:"sw-px-2 sw-py-1 sw-rounded-1",isSubtle:!0,children:[i.jsx(me,{isHighlighted:!0,isSubtle:!0,children:U("component_measures.leak_legend.new_code")})," ",o]});if(s.mode==="days"||s.mode===un.NumberOfDays)return a;const l=Wn(s),m=l&&i.jsxs("div",{children:[i.jsx(dn,{date:l}),", ",Un(new Date,l)<1?i.jsx(mn,{date:l}):i.jsx(hn,{date:l,long:!0})]});return i.jsx(Qt,{content:m,"data-component":"leak-period-legend",children:a})}}const Dt=re(me,{target:"ek0tzvt0"})("background-color:",de("newCodeLegend"),";border:",ft("default","newCodeLegendBorder"),";");function qr(e){const{branchLike:n,component:t,leakPeriod:s,measureValue:o,metric:a,secondaryMeasure:l}=e,m=he(a.key),h=[ce.Portfolio,ce.SubPortfolio,ce.Application,ce.Project].includes(t.qualifier)&&Oe(n),g=Oe(n),p=ls(a,le,m);return i.jsxs("div",{className:"sw-mb-4","data-component":"measure-header",children:[i.jsxs("div",{className:"sw-flex sw-items-center sw-justify-between sw-gap-4",children:[i.jsxs("div",{className:"it__measure-details-metric sw-flex sw-items-center sw-gap-1",children:[i.jsx("strong",{className:"sw-typo-lg-semibold",children:p}),i.jsx("div",{className:"sw-flex sw-items-center sw-ml-2",children:i.jsx(yt,{badgeSize:It.Small,branchLike:n,className:ze("it__measure-details-value sw-typo-lg"),componentKey:t.key,metricKey:a.key,metricType:a.type,value:o})}),!m&&h&&i.jsx(Qt,{content:U("component_measures.show_metric_history"),children:i.jsx("span",{className:"sw-ml-4",children:i.jsx(lt,{className:"it__show-history-link sw-font-semibold",to:pn(t.key,a.key,n),children:i.jsx(ie,{id:"component_measures.see_metric_history"})})})})]}),g&&s&&i.jsx(ws,{component:t,period:s})]}),l&&l.metric===r.ncloc_language_distribution&&l.value!==void 0&&i.jsx("div",{className:"sw-inline-block sw-mt-2",children:i.jsx(Ir,{distribution:l.value})})]})}function Or(e){const{metric:n,view:t,className:s,handleViewChange:o}=e,a=q.useMemo(()=>{const l=[];return Ge(n.key)&&l.push({label:U("component_measures.tab.tree"),value:K.tree}),ms(n.key)&&l.push({label:U("component_measures.tab.list"),value:K.list}),hs(n.key,n.type)&&l.push({label:U("component_measures.tab.treemap"),value:K.treemap}),l},[n]);return i.jsx(Ts,{ariaLabelledBy:"measures-view-selection-label",className:s,data:a,isNotClearable:!0,onChange:o,value:t,"data-component":"measure-view-select"})}class bs extends q.PureComponent{constructor(){super(...arguments);F(this,"mounted",!1);F(this,"state",{breadcrumbs:[]});F(this,"handleKeyDown",t=>{if(t.key===ge.LeftArrow){t.preventDefault();const{breadcrumbs:s}=this.state;if(s.length>1){const o=this.props.backToFirst?0:s.length-2;this.props.handleSelect(s[o])}}});F(this,"fetchBreadcrumbs",()=>{const{branchLike:t,component:s,rootComponent:o}=this.props;if(s.key===o.key){this.mounted&&this.setState({breadcrumbs:[s]});return}gn({component:s.key,...ve(t)}).then(l=>{this.mounted&&this.setState({breadcrumbs:l})},()=>{})})}componentDidMount(){this.mounted=!0,this.fetchBreadcrumbs(),document.addEventListener("keydown",this.handleKeyDown)}componentDidUpdate(t){(this.props.component!==t.component||!fn(t.branchLike,this.props.branchLike))&&this.fetchBreadcrumbs()}componentWillUnmount(){this.mounted=!1,document.removeEventListener("keydown",this.handleKeyDown)}render(){const{breadcrumbs:t}=this.state,s=t[t.length-1];return t.length<=0?null:i.jsx(ti,{actions:!Le(s.qualifier)&&s.path&&i.jsx(Vn,{copyValue:s.path}),ariaLabel:U("breadcrumbs"),className:ze(this.props.className),maxWidth:500,"data-component":"measures-breadcrumbs",children:t.map(o=>i.jsx(lt,{enableBlurAfterClick:!0,enablePreventDefault:!0,highlight:Ns.Subtle,onClick:()=>{this.props.handleSelect(o)},to:"#",children:o.qualifier===ce.Directory?yn(o.name,15):Ut(o.name)},o.key))})}}function Pr(e){var W,ne,J,ke;const{leakPeriod:n,requestedMetric:t,rootComponent:s,updateQuery:o}=e,a=ht(),{query:l}=ut(),{data:m}=Fe(s),{data:h}=$e(),g=dt(),p=Ve(l),{selected:v,asc:u,view:b}=p,x=rt(),M=q.useRef(null),{metricKeys:j,opts:d,strategy:B}=Vr(b,t,m,{...u!==void 0&&{asc:u}},h),N=v!==void 0&&v!==""?v:s.key,{data:_,isFetchingNextPage:D,fetchNextPage:E}=Yt({strategy:B,component:N,metrics:j,additionalData:d},{placeholderData:_n}),A=[t.key];t.key===r.ncloc&&A.push(r.ncloc_language_distribution);const H=Y[t.key];H&&A.push(H);const{data:O}=ss({componentKey:N,metricKeys:A,branchLike:m},{enabled:!!N}),[X,se]=q.useState(),Q=(W=_==null?void 0:_.pages[0])==null?void 0:W.metrics.find(V=>V.key===t.key);Q!==void 0&&(Q.direction=t.direction);const Z=_==null?void 0:_.pages[0].baseComponent;if(!Z||!Q)return null;const c=(ne=_==null?void 0:_.pages.flatMap(V=>V.components).map(V=>us(V,Q,a)))!=null?ne:[],w=(J=O==null?void 0:O.component.measures)!=null?J:[],f=w.find(V=>V.metric===t.key),C=w.find(V=>V.metric!==t.key),L=f&&(he(f.metric)?(ke=f.period)==null?void 0:ke.value:f.value),y=tt(Z.qualifier),k=_==null?void 0:_.pages[(_==null?void 0:_.pages.length)-1].paging,S=_==null?void 0:_.pages[0].paging.total,R=(()=>{const V=tt(Z==null?void 0:Z.qualifier)?xe(Z):xe(X),G=c.findIndex(_e=>xe(_e)===V);return G!==-1?G:void 0})(),z=V=>{o({selected:V!==s.key?V:void 0})},I=V=>{var G;if(mt(s.qualifier)){const _e=c.find(je=>je.refKey===V.key||xe(je)===xe(V));_e?g.push(Ae((G=_e.refKey)!=null?G:_e.key,V.branch)):z(V.key)}else z(V.key),M.current&&M.current.focus()},P=V=>{se(V)},$=()=>b===K.list||b===K.tree?i.jsx(br,{branchLike:m,components:c,defaultShowBestMeasures:u!==void 0&&b===K.list||b===K.tree,fetchMore:E,handleOpen:I,handleSelect:P,loadingMore:D,metric:Q,metrics:a,paging:k,rootComponent:s,selectedComponent:X,selectedIdx:R,view:b}):i.jsx(Rr,{components:c,handleSelect:I,metric:Q,"data-component":"render-measure"});return i.jsxs("div",{ref:M,"data-component":"measure-content",children:[i.jsx(ct,{anchor:"measures_main"}),i.jsx(_s,{left:i.jsx(bs,{backToFirst:b===K.list,branchLike:m,className:"sw-flex-1",component:Z,handleSelect:I,rootComponent:s}),right:i.jsx("div",{className:"sw-flex sw-items-center",children:!y&&Q&&i.jsxs(i.Fragment,{children:[!Gt(Z.qualifier)&&i.jsxs(i.Fragment,{children:[i.jsx(me,{className:"sw-whitespace-nowrap",id:"measures-view-selection-label",isHighlighted:!0,children:i.jsx(ie,{id:"component_measures.view_as"})}),i.jsx(Or,{className:"measure-view-select sw-ml-2 sw-mr-4",handleViewChange:V=>{o({view:V})},metric:Q,view:b})]}),b!==K.treemap&&i.jsxs(i.Fragment,{children:[i.jsx(xt,{className:"sw-mr-4 sw-ml-6",command:"".concat(ge.DownArrow," ").concat(ge.UpArrow),title:x.formatMessage({id:"component_measures.select_files"})}),i.jsx(xt,{command:"".concat(ge.LeftArrow," ").concat(ge.RightArrow),title:x.formatMessage({id:"component_measures.navigate"})})]}),ye(S)&&S>0&&i.jsx(gs,{className:"sw-min-w-[96px] sw-text-right",current:ye(R)&&b!==K.treemap?R+1:void 0,total:S})]})})}),i.jsxs("div",{className:"sw-p-6",children:[i.jsx(qr,{branchLike:m,component:Z,leakPeriod:n,measureValue:L,metric:Q,secondaryMeasure:C}),y?i.jsx("div",{children:i.jsx(Xt,{branchLike:m,component:Z.key,hideHeader:!0,metricKey:
2Q.key})}):$()]})]})}function Vr(e,n,t,s={},o=!1){const a=e===K.list?"leaves":"children",l=Y[n.key],m=!o&&l?l:n.key,h=[n.key];l&&h.push(l);const g={...ve(t),additionalFields:"metrics",ps:500},p=()=>{const u=he(m);g.s=u?"metricPeriod":"metric",g.metricSortFilter="withMeasuresOnly",u&&(g.metricPeriodSort=1)},v=he(n.key);if(e===K.tree)h.push(...Be[n.key]||[]),g.asc=!0,g.s="qualifier,name";else if(e===K.list)h.push(...Be[n.key]||[]),g.asc=n.direction===1,g.metricSort=m,p();else if(e===K.treemap){const u=v?r.new_lines:r.ncloc;h.push(...Be[n.key]||[]),h.push(u),g.asc=!1,g.metricSort=u,p()}return{metricKeys:h,opts:{...g,...s},strategy:a}}function $r(e){const{className:n,filters:t}=e,s=at(),a=[1,2,3,4,5].map(m=>{const h=ee(m,ue.Rating);return{overlay:Re("component_measures.legend.help_x",h),ariaLabel:Re("component_measures.legend.help_x",h),label:h,value:m,selected:!t[m],backgroundColor:de("bubble.".concat(m))({theme:s}),borderColor:Ke("bubble.".concat(m))({theme:s})}}),l=m=>{e.onRatingClick(m.value)};return i.jsx(_i,{className:n,colors:a,onColorClick:l,"data-component":"color-ratings-legend"})}const Fr=500;function Kr(e){const{metrics:n,domain:t,components:s,updateSelected:o,paging:a,component:l,branchLike:m,bubblesByDomain:h}=e,g=at(),p=fs(h,t,n),[v,u]=q.useState({}),b=j=>{u(d=>({...d,[j]:!d[j]}))},x=()=>{const j=s.map(_=>{var se;const D=Ee(_,p.x),E=Ee(_,p.y),A=Ee(_,p.size),H=(se=p.colors)==null?void 0:se.map(Q=>Ee(_,Q));if(D===void 0||E===void 0||A===void 0)return;const O=H&&Math.max(...H.filter(ye));if(O!==void 0&&v[O])return;const X="bubble.".concat(O!=null?O:1);return{x:D,y:E,size:A,backgroundColor:de(X)({theme:g}),borderColor:Ke(X)({theme:g}),data:_,tooltip:Hr(_,{x:D,y:E,size:A,colors:H},p)}}).filter(ye),d=_=>ee(_,p.x.type),B=_=>ee(_,p.y.type);let N;return j.reduce((_,D)=>_+D.x,0)===0&&(N=[0,100]),i.jsx(fi,{"data-testid":"bubble-chart",formatXTick:d,formatYTick:B,height:Fr,items:j,onBubbleClick:_=>{o(_)},padding:[0,4,50,100],xDomain:N,yDomain:lr(h,t),"data-component":"render-bubble-chart"})},M=()=>{const j=Pe(t)?U("component_measures.overview",t,"title"):Re("component_measures.domain_x_overview",es(t));return i.jsxs("div",{className:"sw-flex sw-justify-between sw-gap-3","data-component":"render-chart-header",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"sw-flex sw-items-center sw-whitespace-nowrap",children:[i.jsx(Ls,{as:"h3",className:"it__measure-overview-bubble-chart-title",children:j}),i.jsx(Kt,{className:"sw-ml-2",overlay:Gr(t),children:i.jsx(Rs,{})})]}),(a==null?void 0:a.total)&&(a==null?void 0:a.total)>rs&&i.jsxs("div",{className:"sw-mt-2",children:["(",i.jsx(ie,{id:"component_measures.legend.only_first_500_files"}),")"]}),(mt(l==null?void 0:l.qualifier)||Le(l==null?void 0:l.qualifier))&&i.jsx("div",{className:"sw-mt-2",children:i.jsx(lt,{to:wn({componentKey:l.key,branchLike:m,metric:Pe(t)?r.violations:p.size.key,listView:!0}),children:i.jsx(ie,{id:"component_measures.overview.see_data_as_list"})})})]}),i.jsxs("div",{className:"sw-flex sw-flex-col sw-items-end",children:[i.jsxs("div",{className:"sw-text-right",children:[p.colors&&i.jsxs("span",{className:"sw-mr-3",children:[i.jsx("strong",{className:"sw-typo-semibold",children:i.jsx(ie,{id:"component_measures.legend.color"})})," ",p.colors.length>1?Re("component_measures.legend.worse_of_x_y",...p.colors.map(d=>le(d))):le(p.colors[0])]}),i.jsx("strong",{className:"sw-typo-semibold",children:i.jsx(ie,{id:"component_measures.legend.size"})})," ",le(p.size)]}),p.colors&&i.jsx($r,{className:"sw-mt-2",filters:v,onRatingClick:b})]})]})};return s.length<=0?i.jsx(wt,{}):i.jsxs(Wr,{className:"sw-relative sw-typo-default","data-component":"bubble-chart-view",children:[M(),x(),i.jsx("div",{className:"sw-text-center",children:le(p.x)}),i.jsx(Ur,{className:"sw-absolute sw-top-1/2 sw-left-3",children:le(p.y)})]})}const Gr=e=>{const n="component_measures.overview.".concat(e,".description"),t=U(n);return n===t?null:t},Ee=(e,n)=>{const t=e.measures.find(s=>s.metric.key===n.key);if(t)return Number(he(n.key)?t.leak:t.value)},Hr=(e,n,t)=>{const s=[[e.name,Le(e.qualifier)?e.branch:void 0].filter(l=>!!l).join(" / "),"".concat(t.x.name,": ").concat(ee(n.x,t.x.type)),"".concat(t.y.name,": ").concat(ee(n.y,t.y.type)),"".concat(t.size.name,": ").concat(ee(n.size,t.size.type))].filter(l=>!!l),{colors:o}=n,{colors:a}=t;return o&&a&&a.forEach((l,m)=>{const h=o[m];(h||h===0)&&s.push("".concat(l.name,": ").concat(ee(h,l.type)))}),i.jsx("div",{className:"sw-text-left","data-component":"get-tooltip",children:s.map((l,m)=>i.jsxs(q.Fragment,{children:[l,m<s.length-1&&i.jsx("br",{})]},m))})},Wr=re("div",{target:"e1mj1nly1"})("color:",ot("color-text-subtle"),";"),Ur=re("div",{target:"e1mj1nly0"})({name:"1wd8apm",styles:"transform:rotate(-90deg) translateX(-50%);transform-origin:left"});function Qr(e){var Q,Z,c;const{leakPeriod:n,updateQuery:t,rootComponent:s,bubblesByDomain:o}=e,a=ht(),{data:l}=Fe(s),m=dt(),{query:h}=ut(),{selected:g,metric:p}=Ve(h),v=g||s.key,{data:u,isLoading:b}=Qn({...ve(l),component:v},{enabled:!!v}),x=u==null?void 0:u.component,{x:M,y:j,size:d,colors:B}=fs(o,p,a),N=[M.key,j.key,d.key];B&&N.push(...B.map(w=>w.key));const{data:_,isLoading:D}=Yt({strategy:"leaves",metrics:N,component:(Q=x==null?void 0:x.key)!=null?Q:"",additionalData:{...ve(l),s:"metric",metricSort:d.key,asc:!1,ps:rs}},{enabled:!!x}),E=q.useMemo(()=>{var f,C,L;let w=((L=(C=(f=_==null?void 0:_.pages)==null?void 0:f[0])==null?void 0:C.components)!=null?L:[]).map(y=>us(y,void 0,a));return o[p].x===r.sqale_index&&(w=w.map(y=>({...y,measures:y.measures.some(k=>k.metric.name===r.sqale_index)?y.measures:[...y.measures,{metric:a[r.sqale_index],value:"0",bestValue:!0}]}))),w},[_==null?void 0:_.pages,o,p,a]),A=(c=(Z=_==null?void 0:_.pages)==null?void 0:Z[0])==null?void 0:c.paging;if(!x)return null;const H=b||D,O=w=>{var f;x&&mt(x.qualifier)?m.push(Ae((f=w.refKey)!=null?f:w.key,w.branch)):t({selected:w.key!==s.key?w.
2key:void 0})},X=Oe(l),se=tt(x.qualifier);return i.jsxs("div",{"data-component":"measure-overview",children:[i.jsx(ct,{anchor:"measures_main"}),i.jsx(_s,{left:i.jsx(bs,{backToFirst:!0,branchLike:l,component:x,handleSelect:O,rootComponent:s}),right:n&&X&&i.jsx(ws,{component:x,period:n})}),i.jsx("div",{className:"sw-p-6",children:i.jsxs(qt,{isLoading:H,children:[se&&i.jsx("div",{className:"measure-details-viewer",children:i.jsx(Xt,{branchLike:l,component:x.key,hideHeader:!0})}),!se&&i.jsx(Kr,{branchLike:l,bubblesByDomain:o,component:x,components:E,domain:p,metrics:a,paging:A,updateSelected:O})]})})]})}function Et(){return i.jsx(me,{as:"div",className:"sw-my-3 sw-mx-6",isSubtle:!0,"data-component":"measures-empty",children:i.jsx(ie,{id:"component_measures.empty"})})}function xo(){var E;const{component:e}=q.useContext(bn),{data:n}=Fe(e),{query:t,pathname:s}=ut(),o=rt(),a=Ve(t),l=dt(),m=ht(),h=ar(m,n),g=a.selected!==void 0&&a.selected!==""?a.selected:(E=e==null?void 0:e.key)!=null?E:"",{data:{component:p,period:v}={},isLoading:u}=ss({componentKey:g,metricKeys:h,branchLike:n},{enabled:!!g}),b=(p?ir(or(p).map(A=>Zt(A,m))):[]).filter(A=>A.value!==void 0||A.leak!==void 0),x=ns(b),M=(p==null?void 0:p.qualifier)===ce.Project?v:void 0,j=ps(x,a.metric);if(!e)return null;const d=(A,H)=>{if(H)return;const O=m[A.metric];if(!O){const X=ds(b),se=X[0]&&cs(X[0].name,X[0].measures)[0];if(se&&typeof se!="string")return se.metric}return O},B=d(a,j),N=A=>{const H={...Ve(a),...A},O=d(H,!1);O&&(a.view===K.treemap&&!hs(O.key,O.type)?a.view=K.tree:a.view===K.tree&&!Ge(O.key)&&(a.view=K.list)),l.push({pathname:s,query:{...ur(H),...ve(n),id:e==null?void 0:e.key}})},_=Oe(n),D=()=>j?i.jsx(Qr,{bubblesByDomain:x,leakPeriod:M,rootComponent:e,updateQuery:N}):B?Vt(n)&&(B.key===r.coverage||B.key===r.duplicated_lines_density)?i.jsx(me,{as:"div",className:"sw-my-3 sw-mx-6",isSubtle:!0,children:i.jsx(ie,{id:"component_measures.details_are_not_available"})}):i.jsx(Pr,{leakPeriod:M,requestedMetric:B,rootComponent:e,updateQuery:N,"data-component":"render-content"}):i.jsx(Et,{});return i.jsxs(xn,{asideLeft:i.jsx(pr,{componentKey:g,measures:b,selectedMetric:B?B.key:a.metric,showFullMeasures:_,updateQuery:N}),title:o.formatMessage({id:"layout.measures"}),"data-component":"component-measures-app",children:[i.jsx(kn,{suggestionGroup:"component_measures"}),i.jsx(bt,{children:i.jsx(qt,{className:"sw-my-3 sw-mx-6",isLoading:u,children:i.jsx(bt.Body,{insetContent:!0,children:b.length>0?i.jsxs("div",{id:"component-measures",children:[!(e!=null&&e.canBrowseAllChildProjects)&&vn(e==null?void 0:e.qualifier)&&i.jsx(zs,{className:"sw-my-3 sw-mx-6 it__portfolio_warning",variety:"warning",children:i.jsxs("div",{className:"sw-flex sw-items-center",children:[i.jsx(ie,{id:"component_measures.not_all_measures_are_shown"}),i.jsx(Ds,{className:"sw-ml-2",description:i.jsx(ie,{id:"component_measures.not_all_measures_are_shown.help"})})]})}),D()]}):i.jsx(Et,{})})})})]})}export{xo as default}; 3//# sourceMappingURL=ComponentMeasuresApp-Db1iji2S.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.