f7cloud_client/apps/whiteboard/js/sankeyLinkHorizontal-CWiUWupv.chunk.mjs
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

4 lines
8.4 KiB
JavaScript

/*! third party licenses: js/vendor.LICENSE.txt */
function O(t,r){let e;if(r===void 0)for(const s of t)s!=null&&(e<s||e===void 0&&s>=s)&&(e=s);else{let s=-1;for(let f of t)(f=r(f,++s,t))!=null&&(e<f||e===void 0&&f>=f)&&(e=f)}return e}function B(t,r){let e;if(r===void 0)for(const s of t)s!=null&&(e>s||e===void 0&&s>=s)&&(e=s);else{let s=-1;for(let f of t)(f=r(f,++s,t))!=null&&(e>f||e===void 0&&f>=f)&&(e=f)}return e}function Z(t,r){let e=0;if(r===void 0)for(let s of t)(s=+s)&&(e+=s);else{let s=-1;for(let f of t)(f=+r(f,++s,t))&&(e+=f)}return e}function st(t){return t.target.depth}function mt(t){return t.depth}function wt(t,r){return r-1-t.height}function ut(t,r){return t.sourceLinks.length?t.depth:r-1}function Mt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?B(t.sourceLinks,st)-1:0}function C(t){return function(){return t}}function R(t,r){return I(t.source,r.source)||t.index-r.index}function U(t,r){return I(t.target,r.target)||t.index-r.index}function I(t,r){return t.y0-r.y0}function Q(t){return t.value}function ft(t){return t.index}function ct(t){return t.nodes}function lt(t){return t.links}function X(t,r){const e=t.get(r);if(!e)throw new Error("missing: "+r);return e}function Y({nodes:t}){for(const r of t){let e=r.y0,s=e;for(const f of r.sourceLinks)f.y0=e+f.width/2,e+=f.width;for(const f of r.targetLinks)f.y1=s+f.width/2,s+=f.width}}function bt(){let t=0,r=0,e=1,s=1,f=24,_=8,h,a=ft,d=ut,k,x,p=ct,L=lt,v=6;function g(){const n={nodes:p.apply(null,arguments),links:L.apply(null,arguments)};return P(n),A(n),E(n),j(n),tt(n),Y(n),n}g.update=function(n){return Y(n),n},g.nodeId=function(n){return arguments.length?(a=typeof n=="function"?n:C(n),g):a},g.nodeAlign=function(n){return arguments.length?(d=typeof n=="function"?n:C(n),g):d},g.nodeSort=function(n){return arguments.length?(k=n,g):k},g.nodeWidth=function(n){return arguments.length?(f=+n,g):f},g.nodePadding=function(n){return arguments.length?(_=h=+n,g):_},g.nodes=function(n){return arguments.length?(p=typeof n=="function"?n:C(n),g):p},g.links=function(n){return arguments.length?(L=typeof n=="function"?n:C(n),g):L},g.linkSort=function(n){return arguments.length?(x=n,g):x},g.size=function(n){return arguments.length?(t=r=0,e=+n[0],s=+n[1],g):[e-t,s-r]},g.extent=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],r=+n[0][1],s=+n[1][1],g):[[t,r],[e,s]]},g.iterations=function(n){return arguments.length?(v=+n,g):v};function P({nodes:n,links:c}){for(const[u,o]of n.entries())o.index=u,o.sourceLinks=[],o.targetLinks=[];const i=new Map(n.map((u,o)=>[a(u,o,n),u]));for(const[u,o]of c.entries()){o.index=u;let{source:l,target:y}=o;typeof l!="object"&&(l=o.source=X(i,l)),typeof y!="object"&&(y=o.target=X(i,y)),l.sourceLinks.push(o),y.targetLinks.push(o)}if(x!=null)for(const{sourceLinks:u,targetLinks:o}of n)u.sort(x),o.sort(x)}function A({nodes:n}){for(const c of n)c.value=c.fixedValue===void 0?Math.max(Z(c.sourceLinks,Q),Z(c.targetLinks,Q)):c.fixedValue}function E({nodes:n}){const c=n.length;let i=new Set(n),u=new Set,o=0;for(;i.size;){for(const l of i){l.depth=o;for(const{target:y}of l.sourceLinks)u.add(y)}if(++o>c)throw new Error("circular link");i=u,u=new Set}}function j({nodes:n}){const c=n.length;let i=new Set(n),u=new Set,o=0;for(;i.size;){for(const l of i){l.height=o;for(const{source:y}of l.targetLinks)u.add(y)}if(++o>c)throw new Error("circular link");i=u,u=new Set}}function M({nodes:n}){const c=O(n,o=>o.depth)+1,i=(e-t-f)/(c-1),u=new Array(c);for(const o of n){const l=Math.max(0,Math.min(c-1,Math.floor(d.call(null,o,c))));o.layer=l,o.x0=t+l*i,o.x1=o.x0+f,u[l]?u[l].push(o):u[l]=[o]}if(k)for(const o of u)o.sort(k);return u}function q(n){const c=B(n,i=>(s-r-(i.length-1)*h)/Z(i,Q));for(const i of n){let u=r;for(const o of i){o.y0=u,o.y1=u+o.value*c,u=o.y1+h;for(const l of o.sourceLinks)l.width=l.value*c}u=(s-u+h)/(i.length+1);for(let o=0;o<i.length;++o){const l=i[o];l.y0+=u*(o+1),l.y1+=u*(o+1)}rt(i)}}function tt(n){const c=M(n);h=Math.min(_,(s-r)/(O(c,i=>i.length)-1)),q(c);for(let i=0;i<v;++i){const u=Math.pow(.99,i),o=Math.max(1-u,(i+1)/v);ot(c,u,o),nt(c,u,o)}}function nt(n,c,i){for(let u=1,o=n.length;u<o;++u){const l=n[u];for(const y of l){let b=0,m=0;for(const{source:T,value:V}of y.targetLinks){let z=V*(y.layer-T.layer);b+=et(T,y)*z,m+=z}if(!(m>0))continue;let S=(b/m-y.y0)*c;y.y0+=S,y.y1+=S,K(y)}k===void 0&&l.sort(I),G(l,i)}}function ot(n,c,i){for(let u=n.length,o=u-2;o>=0;--o){const l=n[o];for(const y of l){let b=0,m=0;for(const{target:T,value:V}of y.sourceLinks){let z=V*(T.layer-y.layer);b+=it(y,T)*z,m+=z}if(!(m>0))continue;let S=(b/m-y.y0)*c;y.y0+=S,y.y1+=S,K(y)}k===void 0&&l.sort(I),G(l,i)}}function G(n,c){const i=n.length>>1,u=n[i];J(n,u.y0-h,i-1,c),H(n,u.y1+h,i+1,c),J(n,s,n.length-1,c),H(n,r,0,c)}function H(n,c,i,u){for(;i<n.length;++i){const o=n[i],l=(c-o.y0)*u;l>1e-6&&(o.y0+=l,o.y1+=l),c=o.y1+h}}function J(n,c,i,u){for(;i>=0;--i){const o=n[i],l=(o.y1-c)*u;l>1e-6&&(o.y0-=l,o.y1-=l),c=o.y0-h}}function K({sourceLinks:n,targetLinks:c}){if(x===void 0){for(const{source:{sourceLinks:i}}of c)i.sort(U);for(const{target:{targetLinks:i}}of n)i.sort(R)}}function rt(n){if(x===void 0)for(const{sourceLinks:c,targetLinks:i}of n)c.sort(U),i.sort(R)}function et(n,c){let i=n.y0-(n.sourceLinks.length-1)*h/2;for(const{target:u,width:o}of n.sourceLinks){if(u===c)break;i+=o+h}for(const{source:u,width:o}of c.targetLinks){if(u===n)break;i-=o}return i}function it(n,c){let i=c.y0-(c.targetLinks.length-1)*h/2;for(const{source:u,width:o}of c.targetLinks){if(u===n)break;i+=o+h}for(const{target:u,width:o}of n.sourceLinks){if(u===c)break;i-=o}return i}return g}var W=Math.PI,D=2*W,w=1e-6,ht=D-w;function F(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function N(){return new F}F.prototype=N.prototype={constructor:F,moveTo:function(t,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+r)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,r){this._+="L"+(this._x1=+t)+","+(this._y1=+r)},quadraticCurveTo:function(t,r,e,s){this._+="Q"+ +t+","+ +r+","+(this._x1=+e)+","+(this._y1=+s)},bezierCurveTo:function(t,r,e,s,f,_){this._+="C"+ +t+","+ +r+","+ +e+","+ +s+","+(this._x1=+f)+","+(this._y1=+_)},arcTo:function(t,r,e,s,f){t=+t,r=+r,e=+e,s=+s,f=+f;var _=this._x1,h=this._y1,a=e-t,d=s-r,k=_-t,x=h-r,p=k*k+x*x;if(f<0)throw new Error("negative radius: "+f);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=r);else if(p>w)if(!(Math.abs(x*a-d*k)>w)||!f)this._+="L"+(this._x1=t)+","+(this._y1=r);else{var L=e-_,v=s-h,g=a*a+d*d,P=L*L+v*v,A=Math.sqrt(g),E=Math.sqrt(p),j=f*Math.tan((W-Math.acos((g+p-P)/(2*A*E)))/2),M=j/E,q=j/A;Math.abs(M-1)>w&&(this._+="L"+(t+M*k)+","+(r+M*x)),this._+="A"+f+","+f+",0,0,"+ +(x*L>k*v)+","+(this._x1=t+q*a)+","+(this._y1=r+q*d)}},arc:function(t,r,e,s,f,_){t=+t,r=+r,e=+e,_=!!_;var h=e*Math.cos(s),a=e*Math.sin(s),d=t+h,k=r+a,x=1^_,p=_?s-f:f-s;if(e<0)throw new Error("negative radius: "+e);this._x1===null?this._+="M"+d+","+k:(Math.abs(this._x1-d)>w||Math.abs(this._y1-k)>w)&&(this._+="L"+d+","+k),e&&(p<0&&(p=p%D+D),p>ht?this._+="A"+e+","+e+",0,1,"+x+","+(t-h)+","+(r-a)+"A"+e+","+e+",0,1,"+x+","+(this._x1=d)+","+(this._y1=k):p>w&&(this._+="A"+e+","+e+",0,"+ +(p>=W)+","+x+","+(this._x1=t+e*Math.cos(f))+","+(this._y1=r+e*Math.sin(f))))},rect:function(t,r,e,s){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+r)+"h"+ +e+"v"+ +s+"h"+-e+"Z"},toString:function(){return this._}};function $(t){return function(){return t}}function at(t){return t[0]}function gt(t){return t[1]}var yt=Array.prototype.slice;function dt(t){return t.source}function _t(t){return t.target}function kt(t){var r=dt,e=_t,s=at,f=gt,_=null;function h(){var a,d=yt.call(arguments),k=r.apply(this,d),x=e.apply(this,d);if(_||(_=a=N()),t(_,+s.apply(this,(d[0]=k,d)),+f.apply(this,d),+s.apply(this,(d[0]=x,d)),+f.apply(this,d)),a)return _=null,a+""||null}return h.source=function(a){return arguments.length?(r=a,h):r},h.target=function(a){return arguments.length?(e=a,h):e},h.x=function(a){return arguments.length?(s=typeof a=="function"?a:$(+a),h):s},h.y=function(a){return arguments.length?(f=typeof a=="function"?a:$(+a),h):f},h.context=function(a){return arguments.length?(_=a??null,h):_},h}function xt(t,r,e,s,f){t.moveTo(r,e),t.bezierCurveTo(r=(r+s)/2,e,r,f,s,f)}function pt(){return kt(xt)}function vt(t){return[t.source.x1,t.y0]}function Lt(t){return[t.target.x0,t.y1]}function St(){return pt().source(vt).target(Lt)}export{bt as S,Mt as c,ut as j,mt as l,wt as r,St as s};
//# sourceMappingURL=sankeyLinkHorizontal-CWiUWupv.chunk.mjs.map