vendor: 4,546 bytes, line 1
1import{r as b,j as d,f as bt,K as Be,u as Z,bF as De,a0 as Te,g as Fe,A as Rt,q as Ct,a2 as Mt,M as At,a6 as jt,s as $t,bG as wt,bH as Tt,bI as ze,p as Ge,B as St,e as je}from"./index-DeSf6SGG.js";import{I as ue}from"./inline-select-D_-8-G49.js";import{S as kt}from"./FormSelect-DM9jz3hl.js";import{H as Lt,R as Bt,M as ce}from"./MainLayout-qz0Knf8J.js";import{p as Ue,c as Q,s as X,a as W,h as He,e as I,t as Dt,b as ie,m as $e,d as Ve,f as P,g as Ft,i as Ye,j as Et,k as Ot,U as Pt,l as Se,M as xe,Y as Ee,n as Nt,D as Je,u as et,o as tt,q as qt,r as nt,v as It,w as Wt,x as zt,F as Gt,y as Ut,z as Ht,R as Vt,A as Yt,B as Kt,C as Xt,E as Zt,T as Qt,$ as Jt,G as oe,H as en,W as tn,I as nn,K as rn,J as on,L as an,N as sn,O as Ke,P as ln,Q as un,S as cn,V as dn,X as fn,Z as hn,_ as Xe,a0 as pn,a1 as gn,a2 as mn,a3 as vn}from"./loading-BKEpewRF.js";import{S as Ze}from"./helpers-D2Y1IAnA.js";import"./object-BTAsHKtB.js";import"./errors-translation-GdLMd7G8.js";import"./defineProperty-CegpTSss.js";import"./EmptyState-BSoK_Nds.js";import"./FormFooter-D0ZqYg8-.js";import"./CashFlowReceiptBadge-CtKsBGoK.js";import"./debounce-BkPnE1NT.js";import"./logo-CxLB8LeI.js";import"./rocket-C8Ckmhs1.js";const ke=Math.PI,Le=2*ke,J=1e-6,yn=Le-J;function rt(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function _n(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return rt;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class xn{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?rt:_n(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,l=r-t,c=i-n,u=s-t,p=a-n,f=u*u+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>J)if(!(Math.abs(p*l-c*u)>J)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-s,x=i-a,y=l*l+c*c,w=m*m+x*x,R=Math.sqrt(y),$=Math.sqrt(f),g=o*Math.tan((ke-Math.acos((y+f-w)/(2*R*$)))/2),v=g/$,C=g/R;Math.abs(v-1)>J&&this._append`L${t+v*u},${n+v*p}`,this._append`A${o},${o},0,0,${+(p*m>u*x)},${this._x1=t+C*l},${this._y1=n+C*c}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=t+a,u=n+l,p=1^s,f=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>J||Math.abs(this._y1-u)>J)&&this._append`L${c},${u}`,r&&(f<0&&(f=f%Le+Le),f>yn?this._append`A${r},${r},0,1,${p},${t-a},${n-l}A${r},${r},0,1,${p},${this._x1=c},${this._y1=u}`:f>J&&this._append`A${r},${r},0,${+(f>=ke)},${p},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function it(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new xn(t)}function bn(e){return e.innerRadius}function Rn(e){return e.outerRadius}function Cn(e){return e.startAngle}function Mn(e){return e.endAngle}function An(e){return e&&e.padAngle}function jn(e,t,n,r,i,o,s,a){var l=n-e,c=r-t,u=s-i,p=a-o,f=p*l-u*c;if(!(f*f<I))return f=(u*(t-o)-p*(e-i))/f,[e+f*l,t+f*c]}function me(e,t,n,r,i,o,s){var a=e-n,l=t-r,c=(s?o:-o)/ie(a*a+l*l),u=c*l,p=-c*a,f=e+u,m=t+p,x=n+u,y=r+p,w=(f+x)/2,R=(m+y)/2,$=x-f,g=y-m,v=$*$+g*g,C=i-o,L=f*y-x*m,F=(g<0?-1:1)*ie(Ft(0,C*C*v-L*L)),N=(L*g-$*F)/v,O=(-L*$-g*F)/v,E=(L*g+$*F)/v,B=(-L*$+g*F)/v,D=N-w,_=O-R,M=E-w,T=B-R;return D*D+_*_>M*M+T*T&&(N=E,O=B),{cx:N,cy:O,x01:-u,y01:-p,x11:N*(i/C-1),y11:O*(i/C-1)}}function $n(){var e=bn,t=Rn,n=W(0),r=null,i=Cn,o=Mn,s=An,a=null,l=it(c);function c(){var u,p,f=+e.apply(this,arguments),m=+t.apply(this,arguments),x=i.apply(this,arguments)-He,y=o.apply(this,arguments)-He,w=Ve(y-x),R=y>x;if(a||(a=u=l()),m<f&&(p=m,m=f,f=p),!(m>I))a.moveTo(0,0);else if(w>Dt-I)a.moveTo(m*Q(x),m*X(x)),a.arc(0,0,m,x,y,!R),f>I&&(a.moveTo(f*Q(y),f*X(y)),a.arc(0,0,f,y,x,R));else{var $=x,g=y,v=x,C=y,L=w,F=w,N=s.apply(this,arguments)/2,O=N>
1I&&(r?+r.apply(this,arguments):ie(f*f+m*m)),E=$e(Ve(m-f)/2,+n.apply(this,arguments)),B=E,D=E,_,M;if(O>I){var T=Ye(O/f*X(N)),z=Ye(O/m*X(N));(L-=T*2)>I?(T*=R?1:-1,v+=T,C-=T):(L=0,v=C=(x+y)/2),(F-=z*2)>I?(z*=R?1:-1,$+=z,g-=z):(F=0,$=g=(x+y)/2)}var U=m*Q($),q=m*X($),V=f*Q(C),Y=f*X(C);if(E>I){var h=m*Q(g),A=m*X(g),K=f*Q(v),ae=f*X(v),H;if(w<Ue)if(H=jn(U,q,K,ae,h,A,V,Y)){var se=U-H[0],ee=q-H[1],te=h-H[0],ne=A-H[1],de=1/X(Et((se*te+ee*ne)/(ie(se*se+ee*ee)*ie(te*te+ne*ne)))/2),fe=ie(H[0]*H[0]+H[1]*H[1]);B=$e(E,(f-fe)/(de-1)),D=$e(E,(m-fe)/(de+1))}else B=D=0}F>I?D>I?(_=me(K,ae,U,q,m,D,R),M=me(h,A,V,Y,m,D,R),a.moveTo(_.cx+_.x01,_.cy+_.y01),D<E?a.arc(_.cx,_.cy,D,P(_.y01,_.x01),P(M.y01,M.x01),!R):(a.arc(_.cx,_.cy,D,P(_.y01,_.x01),P(_.y11,_.x11),!R),a.arc(0,0,m,P(_.cy+_.y11,_.cx+_.x11),P(M.cy+M.y11,M.cx+M.x11),!R),a.arc(M.cx,M.cy,D,P(M.y11,M.x11),P(M.y01,M.x01),!R))):(a.moveTo(U,q),a.arc(0,0,m,$,g,!R)):a.moveTo(U,q),!(f>I)||!(L>I)?a.lineTo(V,Y):B>I?(_=me(V,Y,h,A,f,-B,R),M=me(U,q,K,ae,f,-B,R),a.lineTo(_.cx+_.x01,_.cy+_.y01),B<E?a.arc(_.cx,_.cy,B,P(_.y01,_.x01),P(M.y01,M.x01),!R):(a.arc(_.cx,_.cy,B,P(_.y01,_.x01),P(_.y11,_.x11),!R),a.arc(0,0,f,P(_.cy+_.y11,_.cx+_.x11),P(M.cy+M.y11,M.cx+M.x11),R),a.arc(M.cx,M.cy,B,P(M.y11,M.x11),P(M.y01,M.x01),!R))):a.arc(0,0,f,C,v,R)}if(a.closePath(),u)return a=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,p=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Ue/2;return[Q(p)*u,X(p)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:W(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:W(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:W(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:W(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:W(+u),c):i},c.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:W(+u),c):o},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:W(+u),c):s},c.context=function(u){return arguments.length?(a=u??null,c):a},c}function wn(e){return e[0]}function Tn(e){return e[1]}function Sn(e,t){var n=W(!0),r=null,i=Pt,o=null,s=it(a);e=typeof e=="function"?e:e===void 0?wn:W(e),t=typeof t=="function"?t:t===void 0?Tn:W(t);function a(l){var c,u=(l=Ot(l)).length,p,f=!1,m;for(r==null&&(o=i(m=s())),c=0;c<=u;++c)!(c<u&&n(p=l[c],c,l))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(p,c,l),+t(p,c,l));if(m)return o=null,m+""||null}return a.x=function(l){return arguments.length?(e=typeof l=="function"?l:W(+l),a):e},a.y=function(l){return arguments.length?(t=typeof l=="function"?l:W(+l),a):t},a.defined=function(l){return arguments.length?(n=typeof l=="function"?l:W(!!l),a):n},a.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),a):i},a.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),a):r},a}function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k.apply(null,arguments)}var kn={pointerEvents:"none"},Ln=function(e){var t=e.label,n=e.style,r=xe();return d.jsx(tt.g,{transform:n.transform,opacity:n.progress,style:kn,children:d.jsx(qt,{textAnchor:"middle",dominantBaseline:"central",style:k({},r.labels.text,{fill:n.textColor}),children:t})})},Bn={startAngle:{enter:function(e){return k({},e,{endAngle:e.startAngle})},update:function(e){return e},leave:function(e){return k({},e,{startAngle:e.endAngle})}},middleAngle:{enter:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return k({},e,{startAngle:t,endAngle:t})},update:function(e){return e},leave:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return k({},e,{startAngle:t,endAngle:t})}},endAngle:{enter:function(e){return k({},e,{startAngle:e.endAngle})},update:function(e){return e},leave:function(e){return k({},e,{endAngle:e.startAngle})}},innerRadius:{enter:function(e){return k({},e,{outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return k({},e,{innerRadius:e.outerRadius})}},centerRadius:{enter:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return k({},e,{innerRadius:t,outerRadius:t})},update:function(e){return e},leave:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return k({},e,{innerRadius:t,outerRadius:t})}},outerRadius:{enter:function(e){return k({},e,{innerRadius:e.outerRadius})},update:function(e){return e},leave:function(e){return k({},e,{outerRadius:e.innerRadius})}},pushIn:{enter:function(e){return k({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return k({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})}},pushOut:{enter:function(e){return k({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})},update:function(e){return e},leave:function(e){return k({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})}}},ot=function(e,t){return b.useMemo((function(){var n=Bn[e];return{enter:function(r){return k({progress:0},n.enter(r.arc),t?t.enter(r):{})},update:function(r){return k({progress:1},n.update(r.arc),t?t.update(r):{})},leave:function(r){return k({progress:0},n.leave(r.arc),t?t.leave(r):{})}}}),[e,t])},Dn=function(e,t){var n=Wt(e)-Math.PI/2,r=e.innerRadius+(e.outerRadius-e.innerRadius)*t;return It(n,r)},Fn=function(e){return function(t,n,r,i){return nt([t,n,r,i],(function(o,s,a,l){var c=Dn({startAngle:o,endAngle:s,innerRadius:a,outerRadius:l},e);return"translate("+c.x+","+c.y+")"}))}},En=function(e,t,n,r){t===void 0&&(t=.5),n===void 0&&(n="innerRadius");var i=Je(),o=i.animate,s=i.config,a=ot(n,r);return{transition:et(e,{keys:function(l){return l.id},initial:a.update,from:a.enter,enter:a.update,update:a.update,leave:a.leave,config:s,immediate:!o}),interpolate:Fn(t)}},On=function(e){var t=e.center,n=e.data,r=e.transitionMode,i=e.label,o=e.radiusOffset,s=e.ski
1pAngle,a=e.skipRadius,l=e.textColor,c=e.component,u=c===void 0?Ln:c,p=Se(i),f=xe(),m=Ee(l,f),x=b.useMemo((function(){return n.filter((function(g){var v=Math.abs(Nt(g.arc.endAngle-g.arc.startAngle)),C=Math.abs(g.arc.outerRadius-g.arc.innerRadius);return v>=s&&C>=a}))}),[n,s,a]),y=En(x,o,r),w=y.transition,R=y.interpolate,$=u;return d.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:w((function(g,v){return b.createElement($,{key:v.id,datum:v,label:p(v),style:{progress:g.progress,transform:R(g.startAngle,g.endAngle,g.innerRadius,g.outerRadius),textColor:m(v)}})}))})};Sn().x((function(e){return e.x})).y((function(e){return e.y}));var Pn=function(e){var t=e.datum,n=e.style,r=e.onClick,i=e.onMouseEnter,o=e.onMouseMove,s=e.onMouseLeave,a=b.useCallback((function(p){return r?.(t,p)}),[r,t]),l=b.useCallback((function(p){return i?.(t,p)}),[i,t]),c=b.useCallback((function(p){return o?.(t,p)}),[o,t]),u=b.useCallback((function(p){return s?.(t,p)}),[s,t]);return d.jsx(tt.path,{d:n.path,opacity:n.opacity,fill:t.fill||n.color,stroke:n.borderColor,strokeWidth:n.borderWidth,onClick:r?a:void 0,onMouseEnter:i?l:void 0,onMouseMove:o?c:void 0,onMouseLeave:s?u:void 0,"data-testid":"arc."+t.id})},Nn=function(e,t,n,r,i){return nt([e,t,n,r],(function(o,s,a,l){return i({startAngle:o,endAngle:s,innerRadius:Math.max(0,a),outerRadius:Math.max(0,l)})}))},qn=function(e,t,n){t===void 0&&(t="innerRadius");var r=Je(),i=r.animate,o=r.config,s=ot(t,n);return{transition:et(e,{keys:function(a){return a.id},initial:s.update,from:s.enter,enter:s.update,update:s.update,leave:s.leave,config:o,immediate:!i}),interpolate:Nn}},In=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,o=e.borderColor,s=e.onClick,a=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.transitionMode,p=e.component,f=p===void 0?Pn:p,m=xe(),x=Ee(o,m),y=qn(n,u,{enter:function(g){return{opacity:0,color:g.color,borderColor:x(g)}},update:function(g){return{opacity:1,color:g.color,borderColor:x(g)}},leave:function(g){return{opacity:0,color:g.color,borderColor:x(g)}}}),w=y.transition,R=y.interpolate,$=f;return d.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:w((function(g,v){return b.createElement($,{key:v.id,datum:v,style:k({},g,{borderWidth:i,path:R(g.startAngle,g.endAngle,g.innerRadius,g.outerRadius,r)}),onClick:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:c})}))})},Wn=function(e){var t=e===void 0?{}:e,n=t.cornerRadius,r=n===void 0?0:n,i=t.padAngle,o=i===void 0?0:i;return b.useMemo((function(){return $n().innerRadius((function(s){return s.innerRadius})).outerRadius((function(s){return s.outerRadius})).cornerRadius(r).padAngle(o)}),[r,o])};function zn(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function Gn(){return this.eachAfter(zn)}function Un(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function Hn(e,t){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function Vn(e,t){for(var n=this,r=[n],i=[],o,s,a,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)r.push(o[s]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function Yn(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Kn(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function Xn(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Zn(e){for(var t=this,n=Qn(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function Qn(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function Jn(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function er(){return Array.from(this)}function tr(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function nr(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*rr(){var e=this,t,n=[e],r,i,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function Oe(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=ar)):t===void 0&&(t=or);for(var n=new ye(e),r,i=[n],o,s,a,l;r=i.pop();)if((s=t(r.data))&&(l=(s=Array.from(s)).length))for(r.children=s,a=l-1;a>=0;--a)i.push(o=s[a]=new ye(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(lr)}function ir(){return Oe(this).eachBefore(sr)}function or(e){return e.children}function ar(e){return Array.isArray(e)?e[1]:null}function sr(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function lr(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function ye(e){this.data=e,this.depth=this.height=0,this.parent=null}ye.prototype=Oe.prototype={constructor:ye,count:Gn,each:Un,eachAfter:Vn,eachBefore:Hn,find:Yn,sum:Kn,sort:Xn,path:Zn,ancestors:Jn,descendants:er,leaves:tr,links:nr,copy:ir,[Symbol.iterator]:rr};function ur(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 cr(e,t,n,r,i){for(var o=e.children,s,a=-1,l=o.length,c=e.value&&(r-t)/e.value;++a<l;)s=o[a],s.y0=n,s.y1=i,s.x0=t,s.x1=t+=s.value*c}function dr(){var e=1,t=1,n=0,r=!1;function i(s){var a=s.height+1;return s.x0=s.y0=n,s.x1=e,s.y1=t/a,s.eachBefore(o(t,a)),r&&s.eachBefore(ur),s}function o(s,a){return function(l){l.children&&cr(l,l.x0,s*(l.depth+1)/a,l.x1,s*(l.depth+2)/a);var c=l.x0,u=l.y0,p=l.x1-n,f=l.y1-n;p<c&&(c=p=(c+p)/2),f<u&&(u=f=(u+f)/2),l.x0=c,l.y0=u,l.x1=p,l.y1=f}}return i.round=function(s){return arguments.length?(r=!!s,i):r},i.size=function(s){return arguments.length?(e=+s[0],t=+s[1],i):[e,t]},i.padding=function(s){return arguments.length?(n=+s,i):n},i}var we,Qe;function fr(){if(Qe)return we;Qe=1;var e=zt(),t=1,n=4;function r(i){return e(i,t|n)}return we=r,we}var hr=fr();const pr=bt(hr);function _e(){return _e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_e.apply(null,arguments)}function at(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var j={id:"id",value:"value",cornerRadius:0,layers:["arcs","arcLabels"],colors:{scheme:"nivo"},colorBy:"id",inheritColorFromParent:!0,childColor:{from:"color"},borderWidth:1,borderColor:"white",enableArcLabels:!1,arcLabel:"formattedValue",arcLabelsRadiusOffset:.5,arcLabelsSkipAngle:0,arcLabelsSkipRadius:0,arcLabelsTextColor:{theme:"labels.text.fill"},animate:!0,motionConfig:"gentle",transitionMode:"innerRadius",isInteractive:!0,defs:[],fill:[],tooltip:function(e){var t=e.id,n=e.formattedValue,r=e.color;return d.jsx(Qt,{id:t,value:n,enableChip:!0,color:r})},role:"img"},gr=function(e){var t=e.data,n=e.id,r=n===void 0?j.id:n,i=e.value,o=i===void 0?j.value:i,s=e.valueFormat,a=e.radius,l=e.cornerRadius,c=l===void 0?j.cornerRadius:l,u=e.colors,p=u===void 0?j.colors:u,f=e.colorBy,m=f===void 0?j.colorBy:f,x=e.inheritColorFromParent,y=x===void 0?j.inheritColorFromParent:x,w=e.childColor,R=w===void 0?j.childColor:w,$=xe(),g=Yt(p,m),v=Ee(R,$),C=Se(r),L=Se(o),F=Kt(s),N=b.useMemo((function(){var O,E=pr(t),B=Oe(E).sum(L),D=dr().size([2*Math.PI,a*a])(B).descendants().slice(1),_=(O=B.value)!=null?O:0;return Xt(D,"depth").reduce((function(M,T){var z,U=C(T.data),q=T.value,V=100*q/_,Y=T.ancestors().map((function(K){return C(K.data)})),h={startAngle:T.x0,endAngle:T.x1,innerRadius:Math.sqrt(T.y0),outerRadius:Math.sqrt(T.y1)};T.parent&&(z=M.find((function(K){return K.id===C(T.parent.data)})));var A={id:U,path:Y,value:q,percentage:V,formattedValue:s?F(q):V.toFixed(2)+"%",color:"",arc:h,data:T.data,depth:T.depth,height:T.height};return y&&z&&A.depth>1?A.color=v(z,A):A.color=g(A),[].concat(M,[A])}),[])}),[t,a,L,C,s,F,g,y,v]);return{arcGenerator:Wn({cornerRadius:c}),nodes:N}},mr=function(e){var t=e.nodes,n=e.arcGenerator,r=e.centerX,i=e.centerY,o=e.radius;return b.useMemo((function(){return{nodes:t,arcGenerator:n,centerX:r,centerY:i,radius:o}}),[t,n,r,i,o])},vr=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,o=e.borderColor,s=e.isInteractive,a=e.onClick,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,p=e.tooltip,f=e.transitionMode,m=Zt(),x=m.showTooltipFromEvent,y=m.hideTooltip,w=b.useMemo((function(){if(s)return function(v,C){a?.(v,C)}}),[s,a]),R=b.useMemo((function(){if(s)return function(v,C){x(b.createElement(p,v),C),l?.(v,C)}}),[s,x,p,l]),$=b.useMemo((function(){if(s)return function(v,C){x(b.createElement(p,v),C),c?.(v,C)}}),[s,x,p,c]),g=b.useMemo((function(){if(s)return function(v,C){y(),u?.(v,C)}}),[s,y,u]);return d.jsx(In,{center:t,data:n,arcGenerator:r,borderWidth:i,borderColor:o,transitionMode:f,onClick:w,onMouseEnter:R,onMouseMove:$,onMouseLeave:g})},yr=["isInteractive","animate","motionConfig","theme","renderWrapper"],_r=function(e){var t=e.data,n=e.id,r=n===void 0?j.id:n,i=e.value,o=i===void 0?j.value:i,s=e.valueFormat,a=e.cornerRadius,l=a===void 0?j.cornerRadius:a,c=e.layers,u=c===void 0?j.layers:c,p=e.colors,f=p===void 0?j.colors:p,m=e.colorBy,x=m===void 0?j.colorBy:m,y=e.inheritColorFromParent,w=y===void 0?j.inheritColorFromParent:y,R=e.childColor,$=R===void 0?j.childColor:R,g=e.borderWidth,v=g===void 0?j.borderWidth:g,C=e.borderColor,L=C===void 0?j.borderColor:C,F=e.margin,N=e.width,O=e.height,E=e.enableArcLabels,B=E===void 0?j.enableArcLabels:E,D=e.arcLabel,_=D===void 0?j.arcLabel:D,M=e.arcLabelsRadiusOffset,T=M===void 0?j.arcLabelsRadiusOffset:M,z=e.arcLabelsSkipAngle,U=z===void 0?j.arcLabelsSkipAngle:z,q=e.arcLabelsSkipRadius,V=q===void 0?j.arcLabelsSkipRadius:q,Y=e.arcLabelsTextColor,h=Y===void 0?j.arcLabelsTextColor:Y,A=e.arcLabelsComponent,K=e.defs,ae=K===void 0?j.defs:K,H=e.fill,se=H===void 0?j.fill:H,ee=e.transitionMode,te=ee===void 0?j.transitionMode:ee,ne=e.isInteractive,de=ne===void 0?j.isInteractive:ne,fe=e.onClick,ut=e.onMouseEnter,ct=e.onMouseLeave,dt=e.onMouseMove,Pe=e.tooltip,ft=Pe===void 0?j.tooltip:Pe,Ne=e.role,ht=Ne===void 0?j.role:Ne,pt=e.forwardedRef,le=Ut(N,O,F),be=le.innerHe
1ight,Re=le.innerWidth,gt=le.margin,mt=le.outerHeight,vt=le.outerWidth,Ce=b.useMemo((function(){return{radius:Math.min(Re,be)/2,centerX:Re/2,centerY:be/2}}),[be,Re]),Me=Ce.centerX,Ae=Ce.centerY,qe=Ce.radius,Ie=gr({data:t,id:r,value:o,valueFormat:s,radius:qe,cornerRadius:l,colors:f,colorBy:x,inheritColorFromParent:w,childColor:$}),We=Ie.arcGenerator,he=Ie.nodes,yt=Ht(ae,he,se,{colorKey:"color",targetKey:"fill"}),pe={arcs:null,arcLabels:null};u.includes("arcs")&&(pe.arcs=d.jsx(vr,{center:[Me,Ae],data:he,arcGenerator:We,borderWidth:v,borderColor:L,transitionMode:te,isInteractive:de,tooltip:ft,onClick:fe,onMouseEnter:ut,onMouseLeave:ct,onMouseMove:dt},"arcs")),B&&u.includes("arcLabels")&&(pe.arcLabels=d.jsx(On,{center:[Me,Ae],data:he,label:_,radiusOffset:T,skipAngle:U,skipRadius:V,textColor:h,transitionMode:te,component:A},"arcLabels"));var _t=mr({nodes:he,arcGenerator:We,centerX:Me,centerY:Ae,radius:qe});return d.jsx(Vt,{width:vt,height:mt,defs:yt,margin:gt,role:ht,ref:pt,children:u.map((function(ge,xt){return pe[ge]!==void 0?pe[ge]:typeof ge=="function"?d.jsx(b.Fragment,{children:b.createElement(ge,_t)},xt):null}))})},st=b.forwardRef((function(e,t){var n=e.isInteractive,r=n===void 0?j.isInteractive:n,i=e.animate,o=i===void 0?j.animate:i,s=e.motionConfig,a=s===void 0?j.motionConfig:s,l=e.theme,c=e.renderWrapper,u=at(e,yr);return d.jsx(Gt,{isInteractive:r,animate:o,motionConfig:a,theme:l,renderWrapper:c,children:d.jsx(_r,_e({},u,{isInteractive:r,forwardedRef:t}))})})),xr=["defaultWidth","defaultHeight","onResize","debounceResize"];b.forwardRef((function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,o=e.debounceResize,s=at(e,xr);return d.jsx(Jt,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:o,children:function(a){var l=a.width,c=a.height;return d.jsx(st,_e({},s,{width:l,height:c,ref:t}))}})}));const br=Fe("DistributionGraph"),Rr=Be(({valueType:e})=>{const t=Z(De),[n,r]=b.useState(null),{distributionReport:i}=t,o=b.useMemo(()=>{if(!i)return{id:"root",amount:0,children:[]};function p(x){return x.map(y=>{const{id:w,category:R,nodes:$}=y,g=$?p($):void 0,v=g?void 0:Math.round(oe(y.amount,e)),C=g?g.reduce((L,F)=>L+F.amount,0):v;return{id:w,category:R,amount:C,value:v,children:g}}).sort((y,w)=>w.amount-y.amount)}const{nodes:f,footer:m}=i;return{id:"root",amount:Math.round(oe(m.total,e)),children:f?p(f):void 0}},[i,e]);b.useEffect(()=>{r(o)},[o]);const[s,a]=b.useState({width:0,height:0}),l=b.useCallback(p=>{p&&a({width:p.offsetWidth,height:p.offsetHeight})},[]),c=(p,f)=>{f.stopPropagation();const m=o.children?lt(o.children).find(x=>x.id===p.id):void 0;m&&m.children&&r(m)},u=()=>{r(o)};return n?d.jsx("div",{style:{height:"calc(100% - 8px)"},ref:l,onClick:u,children:s.width&&d.jsx(st,{margin:{top:8,right:8,bottom:8,left:8},width:s.width,height:s.height,data:n,tooltip:Cr,onClick:c,childColor:{from:"color",modifiers:[["brighter",.2]]},borderWidth:1,enableArcLabels:!0,arcLabelsSkipAngle:10})}):null}),Cr=({id:e,value:t,data:{category:n}})=>d.jsxs("div",{style:{padding:12,color:"#181826",background:"#ffffff",border:"1px solid #dcdce4"},children:[d.jsx("span",{children:n?.name||br("Others")}),d.jsx("br",{}),d.jsx("strong",{children:Te(t,{precision:2,unit:""})})]});function lt(e){return e.reduce((t,n)=>n.children?[...t,n,...lt(n.children)]:[...t,n],[])}const Mr="_tableContainer_1wfqr_1",Ar="_cell__textAlignRight_1wfqr_10",jr="_iconRight_1wfqr_14",$r="_iconDown_1wfqr_19",re={tableContainer:Mr,cell__textAlignRight:Ar,iconRight:jr,iconDown:$r},ve=Fe("DistributionTable"),wr=Be(({valueType:e})=>{const t=Z(De),{distributionReport:n,distributionReportFilter:r}=t,i=en([{Table:` 2 --data-table-library_grid-template-columns: 32rem 1fr; 3 `,HeaderRow:` 4 border-radius: 1rem 1rem 0 0; 5 background-color: #fbfcfe; 6 `,FooterRow:` 7 background-color: #fbfcfe; 8 `,BaseCell:` 9 height: 3.2rem; 10 padding: 0.4rem 0.8rem; 11 12 &:not(:last-of-type) { 13 border-right: 1px solid #eceef1; 14 } 15 16 &:nth-of-type(1) { 17 position: sticky; 18 left: 0px; 19 } 20 font-size: 15px; 21 22 .narrow > div { 23 display: flex; 24 } 25 `,FooterCell:` 26 &:nth-of-type(1) { 27 z-index: 2; 28 } 29 `}]),o=tn(n||{nodes:[]},{},{clickType:nn.ButtonClick,treeIcon:{margin:"0.4rem",iconRight:d.jsx(Ze,{className:re.iconRight}),iconDown:d.jsx(Ze,{className:re.iconDown}),noIconMargin:"2.4rem",size:"2.4rem"}}),s=rn(n||{},{state:{sortKey:"CATEGORY",reverse:!1}},{sortIcon:{size:"1.6rem",iconDefault:d.jsx(mn,{}),iconUp:d.jsx(gn,{}),iconDown:d.jsx(pn,{})},sortFns:{CATEGORY:a=>a.sort((l,c)=>l.category?.name.localeCompare(c.category?.name)),TOTAL:a=>a.sort((l,c)=>oe(l.amount,e)-oe(c.amount,e))}});return n?d.jsx("div",{className:re.tableContainer,children:d.jsx(on,{data:n,tree:o,theme:i,sort:s,layout:{custom:!0,horizontalScroll:!0,fixedHeader:!0},children:a=>d.jsxs(d.Fragment,{children:[d.jsx(an,{children:d.jsxs(sn,{children:[d.jsx(Ke,{pinLeft:!0,sortKey:"CATEGORY",children:ve("Category")}),d.jsx(Ke,{sortKey:"TOTAL",className:re.cell__textAlignRight,children:ve("Total")})]})}
29),d.jsx(ln,{children:a.map(l=>{const c=oe(l.amount,e);return d.jsxs(un,{item:l,children:[d.jsx(cn,{item:l,children:l.category?.name||ve("Others")}),d.jsx(dn,{className:re.cell__textAlignRight,children:c&&Te(c,{precision:2,unit:""})})]},l.id)})}),d.jsx(fn,{children:d.jsxs(hn,{children:[d.jsx(Xe,{children:ve("Total")}),d.jsx(Xe,{className:re.cell__textAlignRight,children:Te(oe(n.footer.total,e),{precision:2,unit:""})})]})})]})})}):null}),Tr="_page_1vadq_1",Sr="_pageBody_1vadq_7",kr="_pageBody__panel_1vadq_14",Lr="_pageBody__content_1vadq_17",Br="_pageBody__wrapper_1vadq_22",Dr="_pageBody__emptyState_1vadq_27",Fr="_panel_1vadq_32",Er="_panel_withFilter_1vadq_38",Or="_panel__toolbar_1vadq_41",Pr="_panel__filter_1vadq_49",Nr="_filter_1vadq_54",qr="_filter__multiSelect_1vadq_59",Ir="_toolbar_1vadq_63",Wr="_toolbar__buttons_1vadq_69",zr="_filter_item_1vadq_93",S={page:Tr,pageBody:Sr,pageBody__panel:kr,pageBody__content:Lr,pageBody__wrapper:Br,pageBody__emptyState:Dr,panel:Fr,panel_withFilter:Er,panel__toolbar:Or,panel__filter:Pr,filter:Nr,filter__multiSelect:qr,toolbar:Ir,toolbar__buttons:Wr,filter_item:zr},G=Fe("DistributionReport"),oi=Be(()=>{const e=Z(Rt),t=Z(Ct),n=Z(Mt),r=Z(At),i=Z(jt),o=Z(De),s=Z($t),a=b.useMemo(()=>[{value:"1",label:G("Income")},{value:"2",label:G("Expenses")},{value:"3",label:G("Net expenses (Expenses - Income)")}],[]),[l,c]=b.useState(a[2]),[u,p]=b.useState("graph"),[f,m]=b.useState(!0),{distributionReportLoadState:x,distributionReportFilter:y}=o,w=h=>{h&&c(h)},R=h=>{h!==null&&p(h)},$=()=>{m(!f)},g=b.useMemo(()=>r.moneys.map(h=>({value:h.id,label:h.symbol})),[r.moneys]),v=b.useMemo(()=>[{value:"1",label:G("Only")},{value:"2",label:G("Except")}],[]),C=b.useMemo(()=>n.contractors.map(({id:h,name:A})=>({value:h,label:A})),[n.contractors]),L=b.useMemo(()=>e.accounts.map(({id:h,name:A})=>({value:h,label:A})),[e.accounts]),F=b.useMemo(()=>t.categories.map(h=>{const A=h.fullPath(!0);return{value:h.id,label:A}}),[t]),N=b.useMemo(()=>s.tags.map(({id:h,name:A})=>({value:h,label:A})),[s.tags]),O=b.useMemo(()=>[{value:"isUseReportPeriod",label:G("Use report period")}],[]),E=b.useCallback(h=>{o.setDistributionReportFilter({range:h})},[o]),B=({value:h})=>{const A=r.get(h);A&&o.setDistributionReportFilter({money:A})},D=({value:h})=>{o.setDistributionReportFilter({contractorsUsingType:h})},_=h=>{o.setDistributionReportFilter({contractors:h.map(({value:A})=>A)})},M=({value:h})=>{o.setDistributionReportFilter({accountsUsingType:h})},T=h=>{o.setDistributionReportFilter({accounts:h.map(({value:A})=>A)})},z=({value:h})=>{o.setDistributionReportFilter({categoriesUsingType:h})},U=h=>{o.setDistributionReportFilter({categories:h.map(({value:A})=>A)})},q=({value:h})=>{o.setDistributionReportFilter({tagsUsingType:h})},V=h=>{o.setDistributionReportFilter({tags:h.map(({value:A})=>A)})},Y=h=>{o.setDistributionReportFilter({more:h.map(({value:A})=>A)})};return b.useEffect(()=>{r.moneys.find(h=>y.money===h)||o.setDistributionReportFilter({money:r.moneys[0],categoriesUsingType:wt.Exclude,categories:[t.debtCategory,t.getCategoryByPrototype("10"),t.getCategoryByPrototype("20")].filter(h=>h!==void 0).map(({id:h})=>h)})},[t,y.money,r.moneys,i.currentProject,o]),d.jsxs("div",{className:S.page,children:[d.jsx(Lt,{title:G("Reports â Distribution")}),d.jsxs("main",{className:S.pageBody,children:[d.jsxs("div",{className:je(S.pageBody__panel,S.panel,f&&S.panel_withFilter),children:[d.jsx("div",{className:je(S.panel__toolbar,S.toolbar),children:d.jsxs("div",{className:S.toolbar__buttons,children:[d.jsx(kt,{value:l,isClearable:!1,options:a,onChange:w,className:S.valueTypeSelect}),d.jsxs(Tt,{type:"single",value:u,onValueChange:R,children:[d.jsx(ze,{value:"table",children:d.jsx(Ge,{name:"table",size:24,className:"text-fg-secondary hover:text-fg-secondary-hover"})}),d.jsx(ze,{value:"graph",children:d.jsx(Ge,{name:"chart-pie",size:24,className:"text-fg-secondary hover:text-fg-secondary-hover"})})]}),d.jsx(St,{variant:"secondaryGray",onClick:$,children:G("Parameters")})]})}),f&&d.jsxs("div",{className:je(S.panel__filter,S.filter),children:[d.jsx(Bt,{values:y.range,isStrict:!0,onChange:E}),d.jsx(ue,{label:y.money?.symbol??"<NA>",options:g,onChange:B}),d.jsxs("div",{className:S.filter_item,children:[d.jsx(ue,{label:v.find(h=>h.value===y.accountsUsingType).label,options:v,onChange:M}),d.jsx(ce,{label:G("Accounts"),options:L,values:L.filter(({value:h})=>y.accounts.includes(h)),onChange:T,className:S.filter__multiSelect})]}),d.jsxs("div",{className:S.filter_item,children:[d.jsx(ue,{label:v.find(h=>h.value===y.contractorsUsingType).label,options:v,onChange:D}),d.jsx(ce,{label:G("Counterparties"),options:C,values:C.filter(({value:h})=>y.contractors.includes(h)),onChange:_,className:S.filter__multiSelect})]}),d.jsxs("div",{className:S.filter_item,children:[d.jsx(ue,{label:v.find(h=>h.value===y.categoriesUsingType).label,options:v,onChange:z}),d.jsx(ce,{label:G("Categories"),options:F,values:F.filter(({value:h})=>y.categories.includes(h)),onChange:U,className:S.filter__multiSelect})]}),d.jsxs("div",{className:S.filter_item,children:[d.jsx(ue,{label:v.find(h=>h.value===y.tagsUsingType).label,options:v,onChange:q}),d.jsx(ce,{label:G("Tags"),options:N,values:N.filter(({value:h})=>y.tags.includes(h)),onChange:V,className:S.filter__multiSelect})]}),d.jsx(ce,{label:G("More"),smallInputMessage:"",options:O,values:O.filter(({value:h})=>y.more.includes(h)),onChange:Y,className:S.filter__multiSelect})]})]}),d.jsxs("div",{className:S.pageBody__content,children:[x.isPending()&&d.jsx("div",{className:S.pageBody__wrapper,children:d.jsx("div",{className:S.pageBody__emptyState,children:d.jsx("img",{src:vn,alt:"Loading"})})}),x.isDone()&&(u==="table"?d.jsx(wr,{valueType:l.value}):d.jsx(Rr,{valueType:l.value}))]})]})]})});export{oi as DistributionReport,oi as default};
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.