@skill-map/cli 0.40.0 → 0.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +35 -35
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/kernel/index.js.map +1 -1
- package/dist/ui/chunk-4HTOYDCM.js +809 -0
- package/dist/ui/chunk-4X4GYACU.js +123 -0
- package/dist/ui/chunk-7Q3IO77R.js +317 -0
- package/dist/ui/chunk-FL6RV2IG.js +2 -0
- package/dist/ui/chunk-HGNE4UVQ.js +1 -0
- package/dist/ui/chunk-IS5ULQSF.js +1 -0
- package/dist/ui/chunk-KVWYVO6I.js +1 -0
- package/dist/ui/chunk-N4XX4WPE.js +2190 -0
- package/dist/ui/chunk-P7TXZKUX.js +2 -0
- package/dist/ui/chunk-UVVXMEZT.js +1025 -0
- package/dist/ui/{chunk-GSTYLDCL.js → chunk-W2JMLJCF.js} +1 -1
- package/dist/ui/{chunk-3FPS5OIY.js → chunk-YWWD62BR.js} +1 -1
- package/dist/ui/{chunk-ASCTZSBZ.js → chunk-Z3C2OSRL.js} +1 -1
- package/dist/ui/{chunk-WQ42JTZB.js → chunk-ZAEGBMF7.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/ui/main-F7N5RV4Y.js +3 -0
- package/dist/ui/{styles-2WO3KNOY.css → styles-6H4GSOHY.css} +1 -1
- package/package.json +1 -1
- package/dist/ui/chunk-2W6BCESO.js +0 -2589
- package/dist/ui/chunk-4KQGLZV2.js +0 -123
- package/dist/ui/chunk-MHEKCBIR.js +0 -317
- package/dist/ui/chunk-PFA2CVPN.js +0 -61
- package/dist/ui/chunk-PURF7B6R.js +0 -411
- package/dist/ui/chunk-UFCOGNZX.js +0 -1
- package/dist/ui/chunk-XEWWXGNE.js +0 -1
- package/dist/ui/chunk-YXFKPYK3.js +0 -965
- package/dist/ui/main-WLCA4YLM.js +0 -3
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import{c as ca,d as da,e as i0}from"./chunk-YWWD62BR.js";import{a as W_,b as fa,c as $_,d as K_,e as Y_,f as X_,g as Z_,h as Q_,i as J_,j as e0,k as t0,n as yn,p as c0,q as d0,r as l0,s as u0,t as p0}from"./chunk-IS5ULQSF.js";import{a as ha,b as Yn,c as ma,d as ki,e as ga,f as _a,g as o0,h as r0,i as a0,j as s0}from"./chunk-Z3C2OSRL.js";import{c as A_,d as F_,f as _n,g as vn}from"./chunk-W2JMLJCF.js";import{b as x_,e as ta,f as w_,j as z_,k as ua,l as pa,m as q_,n as V_,o as G_,p as H_,q as j_,r as Wf,s as xo,u as U_,v as fn,w as Mi,y as n0}from"./chunk-KVWYVO6I.js";import{$ as Un,$a as Ii,$c as ln,Aa as be,Db as ut,Dc as k_,Eb as Ke,Ec as D_,Fb as ee,Fc as O_,Gb as _e,Gc as Pi,Hb as Ot,Hc as dn,I as y,Ib as yt,J as Ci,Ja as q,Jc as ia,L as ue,M as bi,Ma as I,Mc as oa,N as l,Na as T,Nc as ra,Oa as qf,Pa as xe,Pb as Nt,Q as m_,Qa as Y,R as sn,Ra as X,Rb as Rt,Rc as R_,S as L,Sa as E,Sb as S,T as B,Ta as f,Tc as At,U as $e,Ua as h,Uc as aa,V as Gr,Va as O,Vb as Le,W as Ze,Wa as W,Wb as N,X as Hr,Xa as $,Xb as Re,Y as ot,Ya as Si,Yb as Jr,Za as Wn,Zb as Hf,_ as dt,_a as $n,_b as Kn,ab as Yr,ad as un,bb as Xr,bc as me,ca as U,cb as re,cc as Ye,da as ie,db as Vf,dd as sa,ea as xi,eb as V,ed as Be,fa as J,fd as De,g as x,gb as m,gd as la,ha as Oe,hb as Yt,hd as L_,ia as jr,ib as ke,id as pn,ja as g_,jb as Zr,jd as Uf,ka as Co,kc as C_,lb as _t,lc as b_,ma as Ur,mb as vt,mc as ea,md as B_,n as f_,na as d,nb as Gf,nc as Ti,nd as Ft,oa as Wr,ob as Tt,oc as cn,pa as __,pb as lt,qa as v_,qb as Xt,ra as zf,rb as rt,rd as hn,sa as $r,sb as de,sd as mn,t as h_,tb as Qr,td as gn,ub as Ne,va as K,vb as v,wa as wi,wb as C,xa as Ee,xb as Fe,ya as Kr,yb as bo,za as he,zb as y_,zc as Ei}from"./chunk-UVVXMEZT.js";import{C as jf,Da as N_,I as E_,K as P_,W as M_,b as S_,k as I_,p as na,u as T_}from"./chunk-3SI3TVER.js";import{a as se,b as Kt,c as yi,e as _,g as nk}from"./chunk-VB56BUGO.js";var Wv=_((zee,Uv)=>{"use strict";function pF(){this.__data__=[],this.size=0}Uv.exports=pF});var li=_((qee,$v)=>{"use strict";function fF(t,n){return t===n||t!==t&&n!==n}$v.exports=fF});var pr=_((Vee,Kv)=>{"use strict";var hF=li();function mF(t,n){for(var e=t.length;e--;)if(hF(t[e][0],n))return e;return-1}Kv.exports=mF});var Xv=_((Gee,Yv)=>{"use strict";var gF=pr(),_F=Array.prototype,vF=_F.splice;function yF(t){var n=this.__data__,e=gF(n,t);if(e<0)return!1;var i=n.length-1;return e==i?n.pop():vF.call(n,e,1),--this.size,!0}Yv.exports=yF});var Qv=_((Hee,Zv)=>{"use strict";var CF=pr();function bF(t){var n=this.__data__,e=CF(n,t);return e<0?void 0:n[e][1]}Zv.exports=bF});var ey=_((jee,Jv)=>{"use strict";var xF=pr();function wF(t){return xF(this.__data__,t)>-1}Jv.exports=wF});var ny=_((Uee,ty)=>{"use strict";var SF=pr();function IF(t,n){var e=this.__data__,i=SF(e,t);return i<0?(++this.size,e.push([t,n])):e[i][1]=n,this}ty.exports=IF});var fr=_((Wee,iy)=>{"use strict";var TF=Wv(),EF=Xv(),PF=Qv(),MF=ey(),kF=ny();function Ji(t){var n=-1,e=t==null?0:t.length;for(this.clear();++n<e;){var i=t[n];this.set(i[0],i[1])}}Ji.prototype.clear=TF;Ji.prototype.delete=EF;Ji.prototype.get=PF;Ji.prototype.has=MF;Ji.prototype.set=kF;iy.exports=Ji});var ry=_(($ee,oy)=>{"use strict";var DF=fr();function OF(){this.__data__=new DF,this.size=0}oy.exports=OF});var sy=_((Kee,ay)=>{"use strict";function NF(t){var n=this.__data__,e=n.delete(t);return this.size=n.size,e}ay.exports=NF});var dy=_((Yee,cy)=>{"use strict";function RF(t){return this.__data__.get(t)}cy.exports=RF});var uy=_((Xee,ly)=>{"use strict";function AF(t){return this.__data__.has(t)}ly.exports=AF});var Sm=_((Zee,py)=>{"use strict";var FF=typeof global=="object"&&global&&global.Object===Object&&global;py.exports=FF});var xt=_((Qee,fy)=>{"use strict";var LF=Sm(),BF=typeof self=="object"&&self&&self.Object===Object&&self,zF=LF||BF||Function("return this")();fy.exports=zF});var ui=_((Jee,hy)=>{"use strict";var qF=xt(),VF=qF.Symbol;hy.exports=VF});var vy=_((ete,_y)=>{"use strict";var my=ui(),gy=Object.prototype,GF=gy.hasOwnProperty,HF=gy.toString,hr=my?my.toStringTag:void 0;function jF(t){var n=GF.call(t,hr),e=t[hr];try{t[hr]=void 0;var i=!0}catch{}var o=HF.call(t);return i&&(n?t[hr]=e:delete t[hr]),o}_y.exports=jF});var Cy=_((tte,yy)=>{"use strict";var UF=Object.prototype,WF=UF.toString;function $F(t){return WF.call(t)}yy.exports=$F});var Nn=_((nte,wy)=>{"use strict";var by=ui(),KF=vy(),YF=Cy(),XF="[object Null]",ZF="[object Undefined]",xy=by?by.toStringTag:void 0;function QF(t){return t==null?t===void 0?ZF:XF:xy&&xy in Object(t)?KF(t):YF(t)}wy.exports=QF});var ft=_((ite,Sy)=>{"use strict";function JF(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}Sy.exports=JF});var eo=_((ote,Iy)=>{"use strict";var eL=Nn(),tL=ft(),nL="[object AsyncFunction]",iL="[object Function]",oL="[object GeneratorFunction]",rL="[object Proxy]";function aL(t){if(!tL(t))return!1;var n=eL(t);return n==iL||n==oL||n==nL||n==rL}Iy.exports=aL});var Ey=_((rte,Ty)=>{"use strict";var sL=xt(),cL=sL["__core-js_shared__"];Ty.exports=cL});var ky=_((ate,My)=>{"use strict";var Im=Ey(),Py=(function(){var t=/[^.]+$/.exec(Im&&Im.keys&&Im.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function dL(t){return!!Py&&Py in t}My.exports=dL});var Tm=_((ste,Dy)=>{"use strict";var lL=Function.prototype,uL=lL.toString;function pL(t){if(t!=null){try{return uL.call(t)}catch{}try{return t+""}catch{}}return""}Dy.exports=pL});var Ny=_((cte,Oy)=>{"use strict";var fL=eo(),hL=ky(),mL=ft(),gL=Tm(),_L=/[\\^$.*+?()[\]{}|]/g,vL=/^\[object .+?Constructor\]$/,yL=Function.prototype,CL=Object.prototype,bL=yL.toString,xL=CL.hasOwnProperty,wL=RegExp("^"+bL.call(xL).replace(_L,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function SL(t){if(!mL(t)||hL(t))return!1;var n=fL(t)?wL:vL;return n.test(gL(t))}Oy.exports=SL});var Ay=_((dte,Ry)=>{"use strict";function IL(t,n){return t?.[n]}Ry.exports=IL});var Rn=_((lte,Fy)=>{"use strict";var TL=Ny(),EL=Ay();function PL(t,n){var e=EL(t,n);return TL(e)?e:void 0}Fy.exports=PL});var Pp=_((ute,Ly)=>{"use strict";var ML=Rn(),kL=xt(),DL=ML(kL,"Map");Ly.exports=DL});var mr=_((pte,By)=>{"use strict";var OL=Rn(),NL=OL(Object,"create");By.exports=NL});var Vy=_((fte,qy)=>{"use strict";var zy=mr();function RL(){this.__data__=zy?zy(null):{},this.size=0}qy.exports=RL});var Hy=_((hte,Gy)=>{"use strict";function AL(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}Gy.exports=AL});var Uy=_((mte,jy)=>{"use strict";var FL=mr(),LL="__lodash_hash_undefined__",BL=Object.prototype,zL=BL.hasOwnProperty;function qL(t){var n=this.__data__;if(FL){var e=n[t];return e===LL?void 0:e}return zL.call(n,t)?n[t]:void 0}jy.exports=qL});var $y=_((gte,Wy)=>{"use strict";var VL=mr(),GL=Object.prototype,HL=GL.hasOwnProperty;function jL(t){var n=this.__data__;return VL?n[t]!==void 0:HL.call(n,t)}Wy.exports=jL});var Yy=_((_te,Ky)=>{"use strict";var UL=mr(),WL="__lodash_hash_undefined__";function $L(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=UL&&n===void 0?WL:n,this}Ky.exports=$L});var Zy=_((vte,Xy)=>{"use strict";var KL=Vy(),YL=Hy(),XL=Uy(),ZL=$y(),QL=Yy();function to(t){var n=-1,e=t==null?0:t.length;for(this.clear();++n<e;){var i=t[n];this.set(i[0],i[1])}}to.prototype.clear=KL;to.prototype.delete=YL;to.prototype.get=XL;to.prototype.has=ZL;to.prototype.set=QL;Xy.exports=to});var eC=_((yte,Jy)=>{"use strict";var Qy=Zy(),JL=fr(),e3=Pp();function t3(){this.size=0,this.__data__={hash:new Qy,map:new(e3||JL),string:new Qy}}Jy.exports=t3});var nC=_((Cte,tC)=>{"use strict";function n3(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}tC.exports=n3});var gr=_((bte,iC)=>{"use strict";var i3=nC();function o3(t,n){var e=t.__data__;return i3(n)?e[typeof n=="string"?"string":"hash"]:e.map}iC.exports=o3});var rC=_((xte,oC)=>{"use strict";var r3=gr();function a3(t){var n=r3(this,t).delete(t);return this.size-=n?1:0,n}oC.exports=a3});var sC=_((wte,aC)=>{"use strict";var s3=gr();function c3(t){return s3(this,t).get(t)}aC.exports=c3});var dC=_((Ste,cC)=>{"use strict";var d3=gr();function l3(t){return d3(this,t).has(t)}cC.exports=l3});var uC=_((Ite,lC)=>{"use strict";var u3=gr();function p3(t,n){var e=u3(this,t),i=e.size;return e.set(t,n),this.size+=e.size==i?0:1,this}lC.exports=p3});var Mp=_((Tte,pC)=>{"use strict";var f3=eC(),h3=rC(),m3=sC(),g3=dC(),_3=uC();function no(t){var n=-1,e=t==null?0:t.length;for(this.clear();++n<e;){var i=t[n];this.set(i[0],i[1])}}no.prototype.clear=f3;no.prototype.delete=h3;no.prototype.get=m3;no.prototype.has=g3;no.prototype.set=_3;pC.exports=no});var hC=_((Ete,fC)=>{"use strict";var v3=fr(),y3=Pp(),C3=Mp(),b3=200;function x3(t,n){var e=this.__data__;if(e instanceof v3){var i=e.__data__;if(!y3||i.length<b3-1)return i.push([t,n]),this.size=++e.size,this;e=this.__data__=new C3(i)}return e.set(t,n),this.size=e.size,this}fC.exports=x3});var _r=_((Pte,mC)=>{"use strict";var w3=fr(),S3=ry(),I3=sy(),T3=dy(),E3=uy(),P3=hC();function io(t){var n=this.__data__=new w3(t);this.size=n.size}io.prototype.clear=S3;io.prototype.delete=I3;io.prototype.get=T3;io.prototype.has=E3;io.prototype.set=P3;mC.exports=io});var kp=_((Mte,gC)=>{"use strict";function M3(t,n){for(var e=-1,i=t==null?0:t.length;++e<i&&n(t[e],e,t)!==!1;);return t}gC.exports=M3});var Em=_((kte,_C)=>{"use strict";var k3=Rn(),D3=(function(){try{var t=k3(Object,"defineProperty");return t({},"",{}),t}catch{}})();_C.exports=D3});var vr=_((Dte,yC)=>{"use strict";var vC=Em();function O3(t,n,e){n=="__proto__"&&vC?vC(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}yC.exports=O3});var yr=_((Ote,CC)=>{"use strict";var N3=vr(),R3=li(),A3=Object.prototype,F3=A3.hasOwnProperty;function L3(t,n,e){var i=t[n];(!(F3.call(t,n)&&R3(i,e))||e===void 0&&!(n in t))&&N3(t,n,e)}CC.exports=L3});var oo=_((Nte,bC)=>{"use strict";var B3=yr(),z3=vr();function q3(t,n,e,i){var o=!e;e||(e={});for(var r=-1,a=n.length;++r<a;){var s=n[r],c=i?i(e[s],t[s],s,e,t):void 0;c===void 0&&(c=t[s]),o?z3(e,s,c):B3(e,s,c)}return e}bC.exports=q3});var wC=_((Rte,xC)=>{"use strict";function V3(t,n){for(var e=-1,i=Array(t);++e<t;)i[e]=n(e);return i}xC.exports=V3});var kt=_((Ate,SC)=>{"use strict";function G3(t){return t!=null&&typeof t=="object"}SC.exports=G3});var TC=_((Fte,IC)=>{"use strict";var H3=Nn(),j3=kt(),U3="[object Arguments]";function W3(t){return j3(t)&&H3(t)==U3}IC.exports=W3});var ro=_((Lte,MC)=>{"use strict";var EC=TC(),$3=kt(),PC=Object.prototype,K3=PC.hasOwnProperty,Y3=PC.propertyIsEnumerable,X3=EC((function(){return arguments})())?EC:function(t){return $3(t)&&K3.call(t,"callee")&&!Y3.call(t,"callee")};MC.exports=X3});var Ge=_((Bte,kC)=>{"use strict";var Z3=Array.isArray;kC.exports=Z3});var OC=_((zte,DC)=>{"use strict";function Q3(){return!1}DC.exports=Q3});var pi=_((Cr,ao)=>{"use strict";var J3=xt(),eB=OC(),AC=typeof Cr=="object"&&Cr&&!Cr.nodeType&&Cr,NC=AC&&typeof ao=="object"&&ao&&!ao.nodeType&&ao,tB=NC&&NC.exports===AC,RC=tB?J3.Buffer:void 0,nB=RC?RC.isBuffer:void 0,iB=nB||eB;ao.exports=iB});var br=_((qte,FC)=>{"use strict";var oB=9007199254740991,rB=/^(?:0|[1-9]\d*)$/;function aB(t,n){var e=typeof t;return n=n??oB,!!n&&(e=="number"||e!="symbol"&&rB.test(t))&&t>-1&&t%1==0&&t<n}FC.exports=aB});var Dp=_((Vte,LC)=>{"use strict";var sB=9007199254740991;function cB(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=sB}LC.exports=cB});var zC=_((Gte,BC)=>{"use strict";var dB=Nn(),lB=Dp(),uB=kt(),pB="[object Arguments]",fB="[object Array]",hB="[object Boolean]",mB="[object Date]",gB="[object Error]",_B="[object Function]",vB="[object Map]",yB="[object Number]",CB="[object Object]",bB="[object RegExp]",xB="[object Set]",wB="[object String]",SB="[object WeakMap]",IB="[object ArrayBuffer]",TB="[object DataView]",EB="[object Float32Array]",PB="[object Float64Array]",MB="[object Int8Array]",kB="[object Int16Array]",DB="[object Int32Array]",OB="[object Uint8Array]",NB="[object Uint8ClampedArray]",RB="[object Uint16Array]",AB="[object Uint32Array]",Pe={};Pe[EB]=Pe[PB]=Pe[MB]=Pe[kB]=Pe[DB]=Pe[OB]=Pe[NB]=Pe[RB]=Pe[AB]=!0;Pe[pB]=Pe[fB]=Pe[IB]=Pe[hB]=Pe[TB]=Pe[mB]=Pe[gB]=Pe[_B]=Pe[vB]=Pe[yB]=Pe[CB]=Pe[bB]=Pe[xB]=Pe[wB]=Pe[SB]=!1;function FB(t){return uB(t)&&lB(t.length)&&!!Pe[dB(t)]}BC.exports=FB});var xr=_((Hte,qC)=>{"use strict";function LB(t){return function(n){return t(n)}}qC.exports=LB});var Op=_((wr,so)=>{"use strict";var BB=Sm(),VC=typeof wr=="object"&&wr&&!wr.nodeType&&wr,Sr=VC&&typeof so=="object"&&so&&!so.nodeType&&so,zB=Sr&&Sr.exports===VC,Pm=zB&&BB.process,qB=(function(){try{var t=Sr&&Sr.require&&Sr.require("util").types;return t||Pm&&Pm.binding&&Pm.binding("util")}catch{}})();so.exports=qB});var co=_((jte,jC)=>{"use strict";var VB=zC(),GB=xr(),GC=Op(),HC=GC&&GC.isTypedArray,HB=HC?GB(HC):VB;jC.exports=HB});var Mm=_((Ute,UC)=>{"use strict";var jB=wC(),UB=ro(),WB=Ge(),$B=pi(),KB=br(),YB=co(),XB=Object.prototype,ZB=XB.hasOwnProperty;function QB(t,n){var e=WB(t),i=!e&&UB(t),o=!e&&!i&&$B(t),r=!e&&!i&&!o&&YB(t),a=e||i||o||r,s=a?jB(t.length,String):[],c=s.length;for(var u in t)(n||ZB.call(t,u))&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||r&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||KB(u,c)))&&s.push(u);return s}UC.exports=QB});var Ir=_((Wte,WC)=>{"use strict";var JB=Object.prototype;function ez(t){var n=t&&t.constructor,e=typeof n=="function"&&n.prototype||JB;return t===e}WC.exports=ez});var km=_(($te,$C)=>{"use strict";function tz(t,n){return function(e){return t(n(e))}}$C.exports=tz});var YC=_((Kte,KC)=>{"use strict";var nz=km(),iz=nz(Object.keys,Object);KC.exports=iz});var Np=_((Yte,XC)=>{"use strict";var oz=Ir(),rz=YC(),az=Object.prototype,sz=az.hasOwnProperty;function cz(t){if(!oz(t))return rz(t);var n=[];for(var e in Object(t))sz.call(t,e)&&e!="constructor"&&n.push(e);return n}XC.exports=cz});var Vt=_((Xte,ZC)=>{"use strict";var dz=eo(),lz=Dp();function uz(t){return t!=null&&lz(t.length)&&!dz(t)}ZC.exports=uz});var Jt=_((Zte,QC)=>{"use strict";var pz=Mm(),fz=Np(),hz=Vt();function mz(t){return hz(t)?pz(t):fz(t)}QC.exports=mz});var eb=_((Qte,JC)=>{"use strict";var gz=oo(),_z=Jt();function vz(t,n){return t&&gz(n,_z(n),t)}JC.exports=vz});var nb=_((Jte,tb)=>{"use strict";function yz(t){var n=[];if(t!=null)for(var e in Object(t))n.push(e);return n}tb.exports=yz});var ob=_((ene,ib)=>{"use strict";var Cz=ft(),bz=Ir(),xz=nb(),wz=Object.prototype,Sz=wz.hasOwnProperty;function Iz(t){if(!Cz(t))return xz(t);var n=bz(t),e=[];for(var i in t)i=="constructor"&&(n||!Sz.call(t,i))||e.push(i);return e}ib.exports=Iz});var An=_((tne,rb)=>{"use strict";var Tz=Mm(),Ez=ob(),Pz=Vt();function Mz(t){return Pz(t)?Tz(t,!0):Ez(t)}rb.exports=Mz});var sb=_((nne,ab)=>{"use strict";var kz=oo(),Dz=An();function Oz(t,n){return t&&kz(n,Dz(n),t)}ab.exports=Oz});var Dm=_((Tr,lo)=>{"use strict";var Nz=xt(),ub=typeof Tr=="object"&&Tr&&!Tr.nodeType&&Tr,cb=ub&&typeof lo=="object"&&lo&&!lo.nodeType&&lo,Rz=cb&&cb.exports===ub,db=Rz?Nz.Buffer:void 0,lb=db?db.allocUnsafe:void 0;function Az(t,n){if(n)return t.slice();var e=t.length,i=lb?lb(e):new t.constructor(e);return t.copy(i),i}lo.exports=Az});var Om=_((ine,pb)=>{"use strict";function Fz(t,n){var e=-1,i=t.length;for(n||(n=Array(i));++e<i;)n[e]=t[e];return n}pb.exports=Fz});var Nm=_((one,fb)=>{"use strict";function Lz(t,n){for(var e=-1,i=t==null?0:t.length,o=0,r=[];++e<i;){var a=t[e];n(a,e,t)&&(r[o++]=a)}return r}fb.exports=Lz});var Rm=_((rne,hb)=>{"use strict";function Bz(){return[]}hb.exports=Bz});var Rp=_((ane,gb)=>{"use strict";var zz=Nm(),qz=Rm(),Vz=Object.prototype,Gz=Vz.propertyIsEnumerable,mb=Object.getOwnPropertySymbols,Hz=mb?function(t){return t==null?[]:(t=Object(t),zz(mb(t),function(n){return Gz.call(t,n)}))}:qz;gb.exports=Hz});var vb=_((sne,_b)=>{"use strict";var jz=oo(),Uz=Rp();function Wz(t,n){return jz(t,Uz(t),n)}_b.exports=Wz});var Ap=_((cne,yb)=>{"use strict";function $z(t,n){for(var e=-1,i=n.length,o=t.length;++e<i;)t[o+e]=n[e];return t}yb.exports=$z});var Er=_((dne,Cb)=>{"use strict";var Kz=km(),Yz=Kz(Object.getPrototypeOf,Object);Cb.exports=Yz});var Am=_((lne,bb)=>{"use strict";var Xz=Ap(),Zz=Er(),Qz=Rp(),Jz=Rm(),eq=Object.getOwnPropertySymbols,tq=eq?function(t){for(var n=[];t;)Xz(n,Qz(t)),t=Zz(t);return n}:Jz;bb.exports=tq});var wb=_((une,xb)=>{"use strict";var nq=oo(),iq=Am();function oq(t,n){return nq(t,iq(t),n)}xb.exports=oq});var Fm=_((pne,Sb)=>{"use strict";var rq=Ap(),aq=Ge();function sq(t,n,e){var i=n(t);return aq(t)?i:rq(i,e(t))}Sb.exports=sq});var Lm=_((fne,Ib)=>{"use strict";var cq=Fm(),dq=Rp(),lq=Jt();function uq(t){return cq(t,lq,dq)}Ib.exports=uq});var Eb=_((hne,Tb)=>{"use strict";var pq=Fm(),fq=Am(),hq=An();function mq(t){return pq(t,hq,fq)}Tb.exports=mq});var Mb=_((mne,Pb)=>{"use strict";var gq=Rn(),_q=xt(),vq=gq(_q,"DataView");Pb.exports=vq});var Db=_((gne,kb)=>{"use strict";var yq=Rn(),Cq=xt(),bq=yq(Cq,"Promise");kb.exports=bq});var Bm=_((_ne,Ob)=>{"use strict";var xq=Rn(),wq=xt(),Sq=xq(wq,"Set");Ob.exports=Sq});var Rb=_((vne,Nb)=>{"use strict";var Iq=Rn(),Tq=xt(),Eq=Iq(Tq,"WeakMap");Nb.exports=Eq});var hi=_((yne,Vb)=>{"use strict";var zm=Mb(),qm=Pp(),Vm=Db(),Gm=Bm(),Hm=Rb(),qb=Nn(),uo=Tm(),Ab="[object Map]",Pq="[object Object]",Fb="[object Promise]",Lb="[object Set]",Bb="[object WeakMap]",zb="[object DataView]",Mq=uo(zm),kq=uo(qm),Dq=uo(Vm),Oq=uo(Gm),Nq=uo(Hm),fi=qb;(zm&&fi(new zm(new ArrayBuffer(1)))!=zb||qm&&fi(new qm)!=Ab||Vm&&fi(Vm.resolve())!=Fb||Gm&&fi(new Gm)!=Lb||Hm&&fi(new Hm)!=Bb)&&(fi=function(t){var n=qb(t),e=n==Pq?t.constructor:void 0,i=e?uo(e):"";if(i)switch(i){case Mq:return zb;case kq:return Ab;case Dq:return Fb;case Oq:return Lb;case Nq:return Bb}return n});Vb.exports=fi});var Hb=_((Cne,Gb)=>{"use strict";var Rq=Object.prototype,Aq=Rq.hasOwnProperty;function Fq(t){var n=t.length,e=new t.constructor(n);return n&&typeof t[0]=="string"&&Aq.call(t,"index")&&(e.index=t.index,e.input=t.input),e}Gb.exports=Fq});var jm=_((bne,jb)=>{"use strict";var Lq=xt(),Bq=Lq.Uint8Array;jb.exports=Bq});var Fp=_((xne,Wb)=>{"use strict";var Ub=jm();function zq(t){var n=new t.constructor(t.byteLength);return new Ub(n).set(new Ub(t)),n}Wb.exports=zq});var Kb=_((wne,$b)=>{"use strict";var qq=Fp();function Vq(t,n){var e=n?qq(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}$b.exports=Vq});var Xb=_((Sne,Yb)=>{"use strict";var Gq=/\w*$/;function Hq(t){var n=new t.constructor(t.source,Gq.exec(t));return n.lastIndex=t.lastIndex,n}Yb.exports=Hq});var tx=_((Ine,ex)=>{"use strict";var Zb=ui(),Qb=Zb?Zb.prototype:void 0,Jb=Qb?Qb.valueOf:void 0;function jq(t){return Jb?Object(Jb.call(t)):{}}ex.exports=jq});var Um=_((Tne,nx)=>{"use strict";var Uq=Fp();function Wq(t,n){var e=n?Uq(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}nx.exports=Wq});var ox=_((Ene,ix)=>{"use strict";var $q=Fp(),Kq=Kb(),Yq=Xb(),Xq=tx(),Zq=Um(),Qq="[object Boolean]",Jq="[object Date]",eV="[object Map]",tV="[object Number]",nV="[object RegExp]",iV="[object Set]",oV="[object String]",rV="[object Symbol]",aV="[object ArrayBuffer]",sV="[object DataView]",cV="[object Float32Array]",dV="[object Float64Array]",lV="[object Int8Array]",uV="[object Int16Array]",pV="[object Int32Array]",fV="[object Uint8Array]",hV="[object Uint8ClampedArray]",mV="[object Uint16Array]",gV="[object Uint32Array]";function _V(t,n,e){var i=t.constructor;switch(n){case aV:return $q(t);case Qq:case Jq:return new i(+t);case sV:return Kq(t,e);case cV:case dV:case lV:case uV:case pV:case fV:case hV:case mV:case gV:return Zq(t,e);case eV:return new i;case tV:case oV:return new i(t);case nV:return Yq(t);case iV:return new i;case rV:return Xq(t)}}ix.exports=_V});var Wm=_((Pne,ax)=>{"use strict";var vV=ft(),rx=Object.create,yV=(function(){function t(){}return function(n){if(!vV(n))return{};if(rx)return rx(n);t.prototype=n;var e=new t;return t.prototype=void 0,e}})();ax.exports=yV});var $m=_((Mne,sx)=>{"use strict";var CV=Wm(),bV=Er(),xV=Ir();function wV(t){return typeof t.constructor=="function"&&!xV(t)?CV(bV(t)):{}}sx.exports=wV});var dx=_((kne,cx)=>{"use strict";var SV=hi(),IV=kt(),TV="[object Map]";function EV(t){return IV(t)&&SV(t)==TV}cx.exports=EV});var fx=_((Dne,px)=>{"use strict";var PV=dx(),MV=xr(),lx=Op(),ux=lx&&lx.isMap,kV=ux?MV(ux):PV;px.exports=kV});var mx=_((One,hx)=>{"use strict";var DV=hi(),OV=kt(),NV="[object Set]";function RV(t){return OV(t)&&DV(t)==NV}hx.exports=RV});var yx=_((Nne,vx)=>{"use strict";var AV=mx(),FV=xr(),gx=Op(),_x=gx&&gx.isSet,LV=_x?FV(_x):AV;vx.exports=LV});var Km=_((Rne,wx)=>{"use strict";var BV=_r(),zV=kp(),qV=yr(),VV=eb(),GV=sb(),HV=Dm(),jV=Om(),UV=vb(),WV=wb(),$V=Lm(),KV=Eb(),YV=hi(),XV=Hb(),ZV=ox(),QV=$m(),JV=Ge(),e5=pi(),t5=fx(),n5=ft(),i5=yx(),o5=Jt(),r5=An(),a5=1,s5=2,c5=4,Cx="[object Arguments]",d5="[object Array]",l5="[object Boolean]",u5="[object Date]",p5="[object Error]",bx="[object Function]",f5="[object GeneratorFunction]",h5="[object Map]",m5="[object Number]",xx="[object Object]",g5="[object RegExp]",_5="[object Set]",v5="[object String]",y5="[object Symbol]",C5="[object WeakMap]",b5="[object ArrayBuffer]",x5="[object DataView]",w5="[object Float32Array]",S5="[object Float64Array]",I5="[object Int8Array]",T5="[object Int16Array]",E5="[object Int32Array]",P5="[object Uint8Array]",M5="[object Uint8ClampedArray]",k5="[object Uint16Array]",D5="[object Uint32Array]",Te={};Te[Cx]=Te[d5]=Te[b5]=Te[x5]=Te[l5]=Te[u5]=Te[w5]=Te[S5]=Te[I5]=Te[T5]=Te[E5]=Te[h5]=Te[m5]=Te[xx]=Te[g5]=Te[_5]=Te[v5]=Te[y5]=Te[P5]=Te[M5]=Te[k5]=Te[D5]=!0;Te[p5]=Te[bx]=Te[C5]=!1;function Lp(t,n,e,i,o,r){var a,s=n&a5,c=n&s5,u=n&c5;if(e&&(a=o?e(t,i,o,r):e(t)),a!==void 0)return a;if(!n5(t))return t;var p=JV(t);if(p){if(a=XV(t),!s)return jV(t,a)}else{var g=YV(t),b=g==bx||g==f5;if(e5(t))return HV(t,s);if(g==xx||g==Cx||b&&!o){if(a=c||b?{}:QV(t),!s)return c?WV(t,GV(a,t)):UV(t,VV(a,t))}else{if(!Te[g])return o?t:{};a=ZV(t,g,s)}}r||(r=new BV);var M=r.get(t);if(M)return M;r.set(t,a),i5(t)?t.forEach(function(H){a.add(Lp(H,n,e,H,t,r))}):t5(t)&&t.forEach(function(H,z){a.set(z,Lp(H,n,e,z,t,r))});var P=u?c?KV:$V:c?r5:o5,R=p?void 0:P(t);return zV(R||t,function(H,z){R&&(z=H,H=t[z]),qV(a,z,Lp(H,n,e,z,t,r))}),a}wx.exports=Lp});var Ix=_((Ane,Sx)=>{"use strict";var O5=Km(),N5=4;function R5(t){return O5(t,N5)}Sx.exports=R5});var Bp=_((Fne,Tx)=>{"use strict";function A5(t){return function(){return t}}Tx.exports=A5});var Px=_((Lne,Ex)=>{"use strict";function F5(t){return function(n,e,i){for(var o=-1,r=Object(n),a=i(n),s=a.length;s--;){var c=a[t?s:++o];if(e(r[c],c,r)===!1)break}return n}}Ex.exports=F5});var zp=_((Bne,Mx)=>{"use strict";var L5=Px(),B5=L5();Mx.exports=B5});var qp=_((zne,kx)=>{"use strict";var z5=zp(),q5=Jt();function V5(t,n){return t&&z5(t,n,q5)}kx.exports=V5});var Ox=_((qne,Dx)=>{"use strict";var G5=Vt();function H5(t,n){return function(e,i){if(e==null)return e;if(!G5(e))return t(e,i);for(var o=e.length,r=n?o:-1,a=Object(e);(n?r--:++r<o)&&i(a[r],r,a)!==!1;);return e}}Dx.exports=H5});var Pr=_((Vne,Nx)=>{"use strict";var j5=qp(),U5=Ox(),W5=U5(j5);Nx.exports=W5});var Fn=_((Gne,Rx)=>{"use strict";function $5(t){return t}Rx.exports=$5});var Ym=_((Hne,Ax)=>{"use strict";var K5=Fn();function Y5(t){return typeof t=="function"?t:K5}Ax.exports=Y5});var Xm=_((jne,Fx)=>{"use strict";var X5=kp(),Z5=Pr(),Q5=Ym(),J5=Ge();function eG(t,n){var e=J5(t)?X5:Z5;return e(t,Q5(n))}Fx.exports=eG});var Zm=_((Une,Lx)=>{"use strict";Lx.exports=Xm()});var zx=_((Wne,Bx)=>{"use strict";var tG=Pr();function nG(t,n){var e=[];return tG(t,function(i,o,r){n(i,o,r)&&e.push(i)}),e}Bx.exports=nG});var Vx=_(($ne,qx)=>{"use strict";var iG="__lodash_hash_undefined__";function oG(t){return this.__data__.set(t,iG),this}qx.exports=oG});var Hx=_((Kne,Gx)=>{"use strict";function rG(t){return this.__data__.has(t)}Gx.exports=rG});var Qm=_((Yne,jx)=>{"use strict";var aG=Mp(),sG=Vx(),cG=Hx();function Vp(t){var n=-1,e=t==null?0:t.length;for(this.__data__=new aG;++n<e;)this.add(t[n])}Vp.prototype.add=Vp.prototype.push=sG;Vp.prototype.has=cG;jx.exports=Vp});var Wx=_((Xne,Ux)=>{"use strict";function dG(t,n){for(var e=-1,i=t==null?0:t.length;++e<i;)if(n(t[e],e,t))return!0;return!1}Ux.exports=dG});var Jm=_((Zne,$x)=>{"use strict";function lG(t,n){return t.has(n)}$x.exports=lG});var eg=_((Qne,Kx)=>{"use strict";var uG=Qm(),pG=Wx(),fG=Jm(),hG=1,mG=2;function gG(t,n,e,i,o,r){var a=e&hG,s=t.length,c=n.length;if(s!=c&&!(a&&c>s))return!1;var u=r.get(t),p=r.get(n);if(u&&p)return u==n&&p==t;var g=-1,b=!0,M=e&mG?new uG:void 0;for(r.set(t,n),r.set(n,t);++g<s;){var P=t[g],R=n[g];if(i)var H=a?i(R,P,g,n,t,r):i(P,R,g,t,n,r);if(H!==void 0){if(H)continue;b=!1;break}if(M){if(!pG(n,function(z,j){if(!fG(M,j)&&(P===z||o(P,z,e,i,r)))return M.push(j)})){b=!1;break}}else if(!(P===R||o(P,R,e,i,r))){b=!1;break}}return r.delete(t),r.delete(n),b}Kx.exports=gG});var Xx=_((Jne,Yx)=>{"use strict";function _G(t){var n=-1,e=Array(t.size);return t.forEach(function(i,o){e[++n]=[o,i]}),e}Yx.exports=_G});var Gp=_((eie,Zx)=>{"use strict";function vG(t){var n=-1,e=Array(t.size);return t.forEach(function(i){e[++n]=i}),e}Zx.exports=vG});var nw=_((tie,tw)=>{"use strict";var Qx=ui(),Jx=jm(),yG=li(),CG=eg(),bG=Xx(),xG=Gp(),wG=1,SG=2,IG="[object Boolean]",TG="[object Date]",EG="[object Error]",PG="[object Map]",MG="[object Number]",kG="[object RegExp]",DG="[object Set]",OG="[object String]",NG="[object Symbol]",RG="[object ArrayBuffer]",AG="[object DataView]",ew=Qx?Qx.prototype:void 0,tg=ew?ew.valueOf:void 0;function FG(t,n,e,i,o,r,a){switch(e){case AG:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case RG:return!(t.byteLength!=n.byteLength||!r(new Jx(t),new Jx(n)));case IG:case TG:case MG:return yG(+t,+n);case EG:return t.name==n.name&&t.message==n.message;case kG:case OG:return t==n+"";case PG:var s=bG;case DG:var c=i&wG;if(s||(s=xG),t.size!=n.size&&!c)return!1;var u=a.get(t);if(u)return u==n;i|=SG,a.set(t,n);var p=CG(s(t),s(n),i,o,r,a);return a.delete(t),p;case NG:if(tg)return tg.call(t)==tg.call(n)}return!1}tw.exports=FG});var rw=_((nie,ow)=>{"use strict";var iw=Lm(),LG=1,BG=Object.prototype,zG=BG.hasOwnProperty;function qG(t,n,e,i,o,r){var a=e&LG,s=iw(t),c=s.length,u=iw(n),p=u.length;if(c!=p&&!a)return!1;for(var g=c;g--;){var b=s[g];if(!(a?b in n:zG.call(n,b)))return!1}var M=r.get(t),P=r.get(n);if(M&&P)return M==n&&P==t;var R=!0;r.set(t,n),r.set(n,t);for(var H=a;++g<c;){b=s[g];var z=t[b],j=n[b];if(i)var oe=a?i(j,z,b,n,t,r):i(z,j,b,t,n,r);if(!(oe===void 0?z===j||o(z,j,e,i,r):oe)){R=!1;break}H||(H=b=="constructor")}if(R&&!H){var Ce=t.constructor,le=n.constructor;Ce!=le&&"constructor"in t&&"constructor"in n&&!(typeof Ce=="function"&&Ce instanceof Ce&&typeof le=="function"&&le instanceof le)&&(R=!1)}return r.delete(t),r.delete(n),R}ow.exports=qG});var fw=_((iie,pw)=>{"use strict";var ng=_r(),VG=eg(),GG=nw(),HG=rw(),aw=hi(),sw=Ge(),cw=pi(),jG=co(),UG=1,dw="[object Arguments]",lw="[object Array]",Hp="[object Object]",WG=Object.prototype,uw=WG.hasOwnProperty;function $G(t,n,e,i,o,r){var a=sw(t),s=sw(n),c=a?lw:aw(t),u=s?lw:aw(n);c=c==dw?Hp:c,u=u==dw?Hp:u;var p=c==Hp,g=u==Hp,b=c==u;if(b&&cw(t)){if(!cw(n))return!1;a=!0,p=!1}if(b&&!p)return r||(r=new ng),a||jG(t)?VG(t,n,e,i,o,r):GG(t,n,c,e,i,o,r);if(!(e&UG)){var M=p&&uw.call(t,"__wrapped__"),P=g&&uw.call(n,"__wrapped__");if(M||P){var R=M?t.value():t,H=P?n.value():n;return r||(r=new ng),o(R,H,e,i,r)}}return b?(r||(r=new ng),HG(t,n,e,i,o,r)):!1}pw.exports=$G});var ig=_((oie,gw)=>{"use strict";var KG=fw(),hw=kt();function mw(t,n,e,i,o){return t===n?!0:t==null||n==null||!hw(t)&&!hw(n)?t!==t&&n!==n:KG(t,n,e,i,mw,o)}gw.exports=mw});var vw=_((rie,_w)=>{"use strict";var YG=_r(),XG=ig(),ZG=1,QG=2;function JG(t,n,e,i){var o=e.length,r=o,a=!i;if(t==null)return!r;for(t=Object(t);o--;){var s=e[o];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<r;){s=e[o];var c=s[0],u=t[c],p=s[1];if(a&&s[2]){if(u===void 0&&!(c in t))return!1}else{var g=new YG;if(i)var b=i(u,p,c,t,n,g);if(!(b===void 0?XG(p,u,ZG|QG,i,g):b))return!1}}return!0}_w.exports=JG});var og=_((aie,yw)=>{"use strict";var eH=ft();function tH(t){return t===t&&!eH(t)}yw.exports=tH});var bw=_((sie,Cw)=>{"use strict";var nH=og(),iH=Jt();function oH(t){for(var n=iH(t),e=n.length;e--;){var i=n[e],o=t[i];n[e]=[i,o,nH(o)]}return n}Cw.exports=oH});var rg=_((cie,xw)=>{"use strict";function rH(t,n){return function(e){return e==null?!1:e[t]===n&&(n!==void 0||t in Object(e))}}xw.exports=rH});var Sw=_((die,ww)=>{"use strict";var aH=vw(),sH=bw(),cH=rg();function dH(t){var n=sH(t);return n.length==1&&n[0][2]?cH(n[0][0],n[0][1]):function(e){return e===t||aH(e,t,n)}}ww.exports=dH});var mi=_((lie,Iw)=>{"use strict";var lH=Nn(),uH=kt(),pH="[object Symbol]";function fH(t){return typeof t=="symbol"||uH(t)&&lH(t)==pH}Iw.exports=fH});var jp=_((uie,Tw)=>{"use strict";var hH=Ge(),mH=mi(),gH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_H=/^\w*$/;function vH(t,n){if(hH(t))return!1;var e=typeof t;return e=="number"||e=="symbol"||e=="boolean"||t==null||mH(t)?!0:_H.test(t)||!gH.test(t)||n!=null&&t in Object(n)}Tw.exports=vH});var Mw=_((pie,Pw)=>{"use strict";var Ew=Mp(),yH="Expected a function";function ag(t,n){if(typeof t!="function"||n!=null&&typeof n!="function")throw new TypeError(yH);var e=function(){var i=arguments,o=n?n.apply(this,i):i[0],r=e.cache;if(r.has(o))return r.get(o);var a=t.apply(this,i);return e.cache=r.set(o,a)||r,a};return e.cache=new(ag.Cache||Ew),e}ag.Cache=Ew;Pw.exports=ag});var Dw=_((fie,kw)=>{"use strict";var CH=Mw(),bH=500;function xH(t){var n=CH(t,function(i){return e.size===bH&&e.clear(),i}),e=n.cache;return n}kw.exports=xH});var Nw=_((hie,Ow)=>{"use strict";var wH=Dw(),SH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,IH=/\\(\\)?/g,TH=wH(function(t){var n=[];return t.charCodeAt(0)===46&&n.push(""),t.replace(SH,function(e,i,o,r){n.push(o?r.replace(IH,"$1"):i||e)}),n});Ow.exports=TH});var Mr=_((mie,Rw)=>{"use strict";function EH(t,n){for(var e=-1,i=t==null?0:t.length,o=Array(i);++e<i;)o[e]=n(t[e],e,t);return o}Rw.exports=EH});var qw=_((gie,zw)=>{"use strict";var Aw=ui(),PH=Mr(),MH=Ge(),kH=mi(),DH=1/0,Fw=Aw?Aw.prototype:void 0,Lw=Fw?Fw.toString:void 0;function Bw(t){if(typeof t=="string")return t;if(MH(t))return PH(t,Bw)+"";if(kH(t))return Lw?Lw.call(t):"";var n=t+"";return n=="0"&&1/t==-DH?"-0":n}zw.exports=Bw});var sg=_((_ie,Vw)=>{"use strict";var OH=qw();function NH(t){return t==null?"":OH(t)}Vw.exports=NH});var kr=_((vie,Gw)=>{"use strict";var RH=Ge(),AH=jp(),FH=Nw(),LH=sg();function BH(t,n){return RH(t)?t:AH(t,n)?[t]:FH(LH(t))}Gw.exports=BH});var po=_((yie,Hw)=>{"use strict";var zH=mi(),qH=1/0;function VH(t){if(typeof t=="string"||zH(t))return t;var n=t+"";return n=="0"&&1/t==-qH?"-0":n}Hw.exports=VH});var Dr=_((Cie,jw)=>{"use strict";var GH=kr(),HH=po();function jH(t,n){n=GH(n,t);for(var e=0,i=n.length;t!=null&&e<i;)t=t[HH(n[e++])];return e&&e==i?t:void 0}jw.exports=jH});var Ww=_((bie,Uw)=>{"use strict";var UH=Dr();function WH(t,n,e){var i=t==null?void 0:UH(t,n);return i===void 0?e:i}Uw.exports=WH});var Kw=_((xie,$w)=>{"use strict";function $H(t,n){return t!=null&&n in Object(t)}$w.exports=$H});var cg=_((wie,Yw)=>{"use strict";var KH=kr(),YH=ro(),XH=Ge(),ZH=br(),QH=Dp(),JH=po();function e4(t,n,e){n=KH(n,t);for(var i=-1,o=n.length,r=!1;++i<o;){var a=JH(n[i]);if(!(r=t!=null&&e(t,a)))break;t=t[a]}return r||++i!=o?r:(o=t==null?0:t.length,!!o&&QH(o)&&ZH(a,o)&&(XH(t)||YH(t)))}Yw.exports=e4});var dg=_((Sie,Xw)=>{"use strict";var t4=Kw(),n4=cg();function i4(t,n){return t!=null&&n4(t,n,t4)}Xw.exports=i4});var Qw=_((Iie,Zw)=>{"use strict";var o4=ig(),r4=Ww(),a4=dg(),s4=jp(),c4=og(),d4=rg(),l4=po(),u4=1,p4=2;function f4(t,n){return s4(t)&&c4(n)?d4(l4(t),n):function(e){var i=r4(e,t);return i===void 0&&i===n?a4(e,t):o4(n,i,u4|p4)}}Zw.exports=f4});var lg=_((Tie,Jw)=>{"use strict";function h4(t){return function(n){return n?.[t]}}Jw.exports=h4});var tS=_((Eie,eS)=>{"use strict";var m4=Dr();function g4(t){return function(n){return m4(n,t)}}eS.exports=g4});var iS=_((Pie,nS)=>{"use strict";var _4=lg(),v4=tS(),y4=jp(),C4=po();function b4(t){return y4(t)?_4(C4(t)):v4(t)}nS.exports=b4});var Gt=_((Mie,oS)=>{"use strict";var x4=Sw(),w4=Qw(),S4=Fn(),I4=Ge(),T4=iS();function E4(t){return typeof t=="function"?t:t==null?S4:typeof t=="object"?I4(t)?w4(t[0],t[1]):x4(t):T4(t)}oS.exports=E4});var ug=_((kie,rS)=>{"use strict";var P4=Nm(),M4=zx(),k4=Gt(),D4=Ge();function O4(t,n){var e=D4(t)?P4:M4;return e(t,k4(n,3))}rS.exports=O4});var sS=_((Die,aS)=>{"use strict";var N4=Object.prototype,R4=N4.hasOwnProperty;function A4(t,n){return t!=null&&R4.call(t,n)}aS.exports=A4});var pg=_((Oie,cS)=>{"use strict";var F4=sS(),L4=cg();function B4(t,n){return t!=null&&L4(t,n,F4)}cS.exports=B4});var lS=_((Nie,dS)=>{"use strict";var z4=Np(),q4=hi(),V4=ro(),G4=Ge(),H4=Vt(),j4=pi(),U4=Ir(),W4=co(),$4="[object Map]",K4="[object Set]",Y4=Object.prototype,X4=Y4.hasOwnProperty;function Z4(t){if(t==null)return!0;if(H4(t)&&(G4(t)||typeof t=="string"||typeof t.splice=="function"||j4(t)||W4(t)||V4(t)))return!t.length;var n=q4(t);if(n==$4||n==K4)return!t.size;if(U4(t))return!z4(t).length;for(var e in t)if(X4.call(t,e))return!1;return!0}dS.exports=Z4});var fg=_((Rie,uS)=>{"use strict";function Q4(t){return t===void 0}uS.exports=Q4});var hg=_((Aie,pS)=>{"use strict";var J4=Pr(),ej=Vt();function tj(t,n){var e=-1,i=ej(t)?Array(t.length):[];return J4(t,function(o,r,a){i[++e]=n(o,r,a)}),i}pS.exports=tj});var mg=_((Fie,fS)=>{"use strict";var nj=Mr(),ij=Gt(),oj=hg(),rj=Ge();function aj(t,n){var e=rj(t)?nj:oj;return e(t,ij(n,3))}fS.exports=aj});var mS=_((Lie,hS)=>{"use strict";function sj(t,n,e,i){var o=-1,r=t==null?0:t.length;for(i&&r&&(e=t[++o]);++o<r;)e=n(e,t[o],o,t);return e}hS.exports=sj});var _S=_((Bie,gS)=>{"use strict";function cj(t,n,e,i,o){return o(t,function(r,a,s){e=i?(i=!1,r):n(e,r,a,s)}),e}gS.exports=cj});var gg=_((zie,vS)=>{"use strict";var dj=mS(),lj=Pr(),uj=Gt(),pj=_S(),fj=Ge();function hj(t,n,e){var i=fj(t)?dj:pj,o=arguments.length<3;return i(t,uj(n,4),e,o,lj)}vS.exports=hj});var CS=_((qie,yS)=>{"use strict";var mj=Nn(),gj=Ge(),_j=kt(),vj="[object String]";function yj(t){return typeof t=="string"||!gj(t)&&_j(t)&&mj(t)==vj}yS.exports=yj});var xS=_((Vie,bS)=>{"use strict";var Cj=lg(),bj=Cj("length");bS.exports=bj});var SS=_((Gie,wS)=>{"use strict";var xj="\\ud800-\\udfff",wj="\\u0300-\\u036f",Sj="\\ufe20-\\ufe2f",Ij="\\u20d0-\\u20ff",Tj=wj+Sj+Ij,Ej="\\ufe0e\\ufe0f",Pj="\\u200d",Mj=RegExp("["+Pj+xj+Tj+Ej+"]");function kj(t){return Mj.test(t)}wS.exports=kj});var NS=_((Hie,OS)=>{"use strict";var TS="\\ud800-\\udfff",Dj="\\u0300-\\u036f",Oj="\\ufe20-\\ufe2f",Nj="\\u20d0-\\u20ff",Rj=Dj+Oj+Nj,Aj="\\ufe0e\\ufe0f",Fj="["+TS+"]",_g="["+Rj+"]",vg="\\ud83c[\\udffb-\\udfff]",Lj="(?:"+_g+"|"+vg+")",ES="[^"+TS+"]",PS="(?:\\ud83c[\\udde6-\\uddff]){2}",MS="[\\ud800-\\udbff][\\udc00-\\udfff]",Bj="\\u200d",kS=Lj+"?",DS="["+Aj+"]?",zj="(?:"+Bj+"(?:"+[ES,PS,MS].join("|")+")"+DS+kS+")*",qj=DS+kS+zj,Vj="(?:"+[ES+_g+"?",_g,PS,MS,Fj].join("|")+")",IS=RegExp(vg+"(?="+vg+")|"+Vj+qj,"g");function Gj(t){for(var n=IS.lastIndex=0;IS.test(t);)++n;return n}OS.exports=Gj});var AS=_((jie,RS)=>{"use strict";var Hj=xS(),jj=SS(),Uj=NS();function Wj(t){return jj(t)?Uj(t):Hj(t)}RS.exports=Wj});var LS=_((Uie,FS)=>{"use strict";var $j=Np(),Kj=hi(),Yj=Vt(),Xj=CS(),Zj=AS(),Qj="[object Map]",Jj="[object Set]";function eU(t){if(t==null)return 0;if(Yj(t))return Xj(t)?Zj(t):t.length;var n=Kj(t);return n==Qj||n==Jj?t.size:$j(t).length}FS.exports=eU});var zS=_((Wie,BS)=>{"use strict";var tU=kp(),nU=Wm(),iU=qp(),oU=Gt(),rU=Er(),aU=Ge(),sU=pi(),cU=eo(),dU=ft(),lU=co();function uU(t,n,e){var i=aU(t),o=i||sU(t)||lU(t);if(n=oU(n,4),e==null){var r=t&&t.constructor;o?e=i?new r:[]:dU(t)?e=cU(r)?nU(rU(t)):{}:e={}}return(o?tU:iU)(t,function(a,s,c){return n(e,a,s,c)}),e}BS.exports=uU});var HS=_(($ie,GS)=>{"use strict";var qS=ui(),pU=ro(),fU=Ge(),VS=qS?qS.isConcatSpreadable:void 0;function hU(t){return fU(t)||pU(t)||!!(VS&&t&&t[VS])}GS.exports=hU});var Up=_((Kie,US)=>{"use strict";var mU=Ap(),gU=HS();function jS(t,n,e,i,o){var r=-1,a=t.length;for(e||(e=gU),o||(o=[]);++r<a;){var s=t[r];n>0&&e(s)?n>1?jS(s,n-1,e,i,o):mU(o,s):i||(o[o.length]=s)}return o}US.exports=jS});var $S=_((Yie,WS)=>{"use strict";function _U(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}WS.exports=_U});var yg=_((Xie,YS)=>{"use strict";var vU=$S(),KS=Math.max;function yU(t,n,e){return n=KS(n===void 0?t.length-1:n,0),function(){for(var i=arguments,o=-1,r=KS(i.length-n,0),a=Array(r);++o<r;)a[o]=i[n+o];o=-1;for(var s=Array(n+1);++o<n;)s[o]=i[o];return s[n]=e(a),vU(t,this,s)}}YS.exports=yU});var QS=_((Zie,ZS)=>{"use strict";var CU=Bp(),XS=Em(),bU=Fn(),xU=XS?function(t,n){return XS(t,"toString",{configurable:!0,enumerable:!1,value:CU(n),writable:!0})}:bU;ZS.exports=xU});var eI=_((Qie,JS)=>{"use strict";var wU=800,SU=16,IU=Date.now;function TU(t){var n=0,e=0;return function(){var i=IU(),o=SU-(i-e);if(e=i,o>0){if(++n>=wU)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}JS.exports=TU});var Cg=_((Jie,tI)=>{"use strict";var EU=QS(),PU=eI(),MU=PU(EU);tI.exports=MU});var Or=_((eoe,nI)=>{"use strict";var kU=Fn(),DU=yg(),OU=Cg();function NU(t,n){return OU(DU(t,n,kU),t+"")}nI.exports=NU});var bg=_((toe,iI)=>{"use strict";function RU(t,n,e,i){for(var o=t.length,r=e+(i?1:-1);i?r--:++r<o;)if(n(t[r],r,t))return r;return-1}iI.exports=RU});var rI=_((noe,oI)=>{"use strict";function AU(t){return t!==t}oI.exports=AU});var sI=_((ioe,aI)=>{"use strict";function FU(t,n,e){for(var i=e-1,o=t.length;++i<o;)if(t[i]===n)return i;return-1}aI.exports=FU});var dI=_((ooe,cI)=>{"use strict";var LU=bg(),BU=rI(),zU=sI();function qU(t,n,e){return n===n?zU(t,n,e):LU(t,BU,e)}cI.exports=qU});var uI=_((roe,lI)=>{"use strict";var VU=dI();function GU(t,n){var e=t==null?0:t.length;return!!e&&VU(t,n,0)>-1}lI.exports=GU});var fI=_((aoe,pI)=>{"use strict";function HU(t,n,e){for(var i=-1,o=t==null?0:t.length;++i<o;)if(e(n,t[i]))return!0;return!1}pI.exports=HU});var mI=_((soe,hI)=>{"use strict";function jU(){}hI.exports=jU});var _I=_((coe,gI)=>{"use strict";var xg=Bm(),UU=mI(),WU=Gp(),$U=1/0,KU=xg&&1/WU(new xg([,-0]))[1]==$U?function(t){return new xg(t)}:UU;gI.exports=KU});var yI=_((doe,vI)=>{"use strict";var YU=Qm(),XU=uI(),ZU=fI(),QU=Jm(),JU=_I(),e6=Gp(),t6=200;function n6(t,n,e){var i=-1,o=XU,r=t.length,a=!0,s=[],c=s;if(e)a=!1,o=ZU;else if(r>=t6){var u=n?null:JU(t);if(u)return e6(u);a=!1,o=QU,c=new YU}else c=n?[]:s;e:for(;++i<r;){var p=t[i],g=n?n(p):p;if(p=e||p!==0?p:0,a&&g===g){for(var b=c.length;b--;)if(c[b]===g)continue e;n&&c.push(g),s.push(p)}else o(c,g,e)||(c!==s&&c.push(g),s.push(p))}return s}vI.exports=n6});var wg=_((loe,CI)=>{"use strict";var i6=Vt(),o6=kt();function r6(t){return o6(t)&&i6(t)}CI.exports=r6});var xI=_((uoe,bI)=>{"use strict";var a6=Up(),s6=Or(),c6=yI(),d6=wg(),l6=s6(function(t){return c6(a6(t,1,d6,!0))});bI.exports=l6});var SI=_((poe,wI)=>{"use strict";var u6=Mr();function p6(t,n){return u6(n,function(e){return t[e]})}wI.exports=p6});var Sg=_((foe,II)=>{"use strict";var f6=SI(),h6=Jt();function m6(t){return t==null?[]:f6(t,h6(t))}II.exports=m6});var ht=_((hoe,TI)=>{"use strict";var Wp;if(typeof yi=="function")try{Wp={clone:Ix(),constant:Bp(),each:Zm(),filter:ug(),has:pg(),isArray:Ge(),isEmpty:lS(),isFunction:eo(),isUndefined:fg(),keys:Jt(),map:mg(),reduce:gg(),size:LS(),transform:zS(),union:xI(),values:Sg()}}catch{}Wp||(Wp=window._);TI.exports=Wp});var $p=_((goe,kI)=>{"use strict";var te=ht();kI.exports=ce;var g6="\0",gi="\0",EI="";function ce(t){this._isDirected=te.has(t,"directed")?t.directed:!0,this._isMultigraph=te.has(t,"multigraph")?t.multigraph:!1,this._isCompound=te.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=te.constant(void 0),this._defaultEdgeLabelFn=te.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[gi]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}ce.prototype._nodeCount=0;ce.prototype._edgeCount=0;ce.prototype.isDirected=function(){return this._isDirected};ce.prototype.isMultigraph=function(){return this._isMultigraph};ce.prototype.isCompound=function(){return this._isCompound};ce.prototype.setGraph=function(t){return this._label=t,this};ce.prototype.graph=function(){return this._label};ce.prototype.setDefaultNodeLabel=function(t){return te.isFunction(t)||(t=te.constant(t)),this._defaultNodeLabelFn=t,this};ce.prototype.nodeCount=function(){return this._nodeCount};ce.prototype.nodes=function(){return te.keys(this._nodes)};ce.prototype.sources=function(){var t=this;return te.filter(this.nodes(),function(n){return te.isEmpty(t._in[n])})};ce.prototype.sinks=function(){var t=this;return te.filter(this.nodes(),function(n){return te.isEmpty(t._out[n])})};ce.prototype.setNodes=function(t,n){var e=arguments,i=this;return te.each(t,function(o){e.length>1?i.setNode(o,n):i.setNode(o)}),this};ce.prototype.setNode=function(t,n){return te.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=n),this):(this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=gi,this._children[t]={},this._children[gi][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};ce.prototype.node=function(t){return this._nodes[t]};ce.prototype.hasNode=function(t){return te.has(this._nodes,t)};ce.prototype.removeNode=function(t){var n=this;if(te.has(this._nodes,t)){var e=function(i){n.removeEdge(n._edgeObjs[i])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],te.each(this.children(t),function(i){n.setParent(i)}),delete this._children[t]),te.each(te.keys(this._in[t]),e),delete this._in[t],delete this._preds[t],te.each(te.keys(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};ce.prototype.setParent=function(t,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(te.isUndefined(n))n=gi;else{n+="";for(var e=n;!te.isUndefined(e);e=this.parent(e))if(e===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=n,this._children[n][t]=!0,this};ce.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};ce.prototype.parent=function(t){if(this._isCompound){var n=this._parent[t];if(n!==gi)return n}};ce.prototype.children=function(t){if(te.isUndefined(t)&&(t=gi),this._isCompound){var n=this._children[t];if(n)return te.keys(n)}else{if(t===gi)return this.nodes();if(this.hasNode(t))return[]}};ce.prototype.predecessors=function(t){var n=this._preds[t];if(n)return te.keys(n)};ce.prototype.successors=function(t){var n=this._sucs[t];if(n)return te.keys(n)};ce.prototype.neighbors=function(t){var n=this.predecessors(t);if(n)return te.union(n,this.successors(t))};ce.prototype.isLeaf=function(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0};ce.prototype.filterNodes=function(t){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var e=this;te.each(this._nodes,function(r,a){t(a)&&n.setNode(a,r)}),te.each(this._edgeObjs,function(r){n.hasNode(r.v)&&n.hasNode(r.w)&&n.setEdge(r,e.edge(r))});var i={};function o(r){var a=e.parent(r);return a===void 0||n.hasNode(a)?(i[r]=a,a):a in i?i[a]:o(a)}return this._isCompound&&te.each(n.nodes(),function(r){n.setParent(r,o(r))}),n};ce.prototype.setDefaultEdgeLabel=function(t){return te.isFunction(t)||(t=te.constant(t)),this._defaultEdgeLabelFn=t,this};ce.prototype.edgeCount=function(){return this._edgeCount};ce.prototype.edges=function(){return te.values(this._edgeObjs)};ce.prototype.setPath=function(t,n){var e=this,i=arguments;return te.reduce(t,function(o,r){return i.length>1?e.setEdge(o,r,n):e.setEdge(o,r),r}),this};ce.prototype.setEdge=function(){var t,n,e,i,o=!1,r=arguments[0];typeof r=="object"&&r!==null&&"v"in r?(t=r.v,n=r.w,e=r.name,arguments.length===2&&(i=arguments[1],o=!0)):(t=r,n=arguments[1],e=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,n=""+n,te.isUndefined(e)||(e=""+e);var a=Nr(this._isDirected,t,n,e);if(te.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=i),this;if(!te.isUndefined(e)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),this._edgeLabels[a]=o?i:this._defaultEdgeLabelFn(t,n,e);var s=_6(this._isDirected,t,n,e);return t=s.v,n=s.w,Object.freeze(s),this._edgeObjs[a]=s,PI(this._preds[n],t),PI(this._sucs[t],n),this._in[n][a]=s,this._out[t][a]=s,this._edgeCount++,this};ce.prototype.edge=function(t,n,e){var i=arguments.length===1?Ig(this._isDirected,arguments[0]):Nr(this._isDirected,t,n,e);return this._edgeLabels[i]};ce.prototype.hasEdge=function(t,n,e){var i=arguments.length===1?Ig(this._isDirected,arguments[0]):Nr(this._isDirected,t,n,e);return te.has(this._edgeLabels,i)};ce.prototype.removeEdge=function(t,n,e){var i=arguments.length===1?Ig(this._isDirected,arguments[0]):Nr(this._isDirected,t,n,e),o=this._edgeObjs[i];return o&&(t=o.v,n=o.w,delete this._edgeLabels[i],delete this._edgeObjs[i],MI(this._preds[n],t),MI(this._sucs[t],n),delete this._in[n][i],delete this._out[t][i],this._edgeCount--),this};ce.prototype.inEdges=function(t,n){var e=this._in[t];if(e){var i=te.values(e);return n?te.filter(i,function(o){return o.v===n}):i}};ce.prototype.outEdges=function(t,n){var e=this._out[t];if(e){var i=te.values(e);return n?te.filter(i,function(o){return o.w===n}):i}};ce.prototype.nodeEdges=function(t,n){var e=this.inEdges(t,n);if(e)return e.concat(this.outEdges(t,n))};function PI(t,n){t[n]?t[n]++:t[n]=1}function MI(t,n){--t[n]||delete t[n]}function Nr(t,n,e,i){var o=""+n,r=""+e;if(!t&&o>r){var a=o;o=r,r=a}return o+EI+r+EI+(te.isUndefined(i)?g6:i)}function _6(t,n,e,i){var o=""+n,r=""+e;if(!t&&o>r){var a=o;o=r,r=a}var s={v:o,w:r};return i&&(s.name=i),s}function Ig(t,n){return Nr(t,n.v,n.w,n.name)}});var OI=_((_oe,DI)=>{"use strict";DI.exports="2.1.8"});var RI=_((voe,NI)=>{"use strict";NI.exports={Graph:$p(),version:OI()}});var FI=_((yoe,AI)=>{"use strict";var Ht=ht(),v6=$p();AI.exports={write:y6,read:x6};function y6(t){var n={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:C6(t),edges:b6(t)};return Ht.isUndefined(t.graph())||(n.value=Ht.clone(t.graph())),n}function C6(t){return Ht.map(t.nodes(),function(n){var e=t.node(n),i=t.parent(n),o={v:n};return Ht.isUndefined(e)||(o.value=e),Ht.isUndefined(i)||(o.parent=i),o})}function b6(t){return Ht.map(t.edges(),function(n){var e=t.edge(n),i={v:n.v,w:n.w};return Ht.isUndefined(n.name)||(i.name=n.name),Ht.isUndefined(e)||(i.value=e),i})}function x6(t){var n=new v6(t.options).setGraph(t.value);return Ht.each(t.nodes,function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)}),Ht.each(t.edges,function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),n}});var BI=_((Coe,LI)=>{"use strict";var Kp=ht();LI.exports=w6;function w6(t){var n={},e=[],i;function o(r){Kp.has(n,r)||(n[r]=!0,i.push(r),Kp.each(t.successors(r),o),Kp.each(t.predecessors(r),o))}return Kp.each(t.nodes(),function(r){i=[],o(r),i.length&&e.push(i)}),e}});var Tg=_((boe,qI)=>{"use strict";var zI=ht();qI.exports=wt;function wt(){this._arr=[],this._keyIndices={}}wt.prototype.size=function(){return this._arr.length};wt.prototype.keys=function(){return this._arr.map(function(t){return t.key})};wt.prototype.has=function(t){return zI.has(this._keyIndices,t)};wt.prototype.priority=function(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority};wt.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};wt.prototype.add=function(t,n){var e=this._keyIndices;if(t=String(t),!zI.has(e,t)){var i=this._arr,o=i.length;return e[t]=o,i.push({key:t,priority:n}),this._decrease(o),!0}return!1};wt.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key};wt.prototype.decrease=function(t,n){var e=this._keyIndices[t];if(n>this._arr[e].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[e].priority+" New: "+n);this._arr[e].priority=n,this._decrease(e)};wt.prototype._heapify=function(t){var n=this._arr,e=2*t,i=e+1,o=t;e<n.length&&(o=n[e].priority<n[o].priority?e:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(this._swap(t,o),this._heapify(o)))};wt.prototype._decrease=function(t){for(var n=this._arr,e=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<e));)this._swap(t,i),t=i};wt.prototype._swap=function(t,n){var e=this._arr,i=this._keyIndices,o=e[t],r=e[n];e[t]=r,e[n]=o,i[r.key]=t,i[o.key]=n}});var Eg=_((xoe,VI)=>{"use strict";var S6=ht(),I6=Tg();VI.exports=E6;var T6=S6.constant(1);function E6(t,n,e,i){return P6(t,String(n),e||T6,i||function(o){return t.outEdges(o)})}function P6(t,n,e,i){var o={},r=new I6,a,s,c=function(u){var p=u.v!==a?u.v:u.w,g=o[p],b=e(u),M=s.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+b);M<g.distance&&(g.distance=M,g.predecessor=a,r.decrease(p,M))};for(t.nodes().forEach(function(u){var p=u===n?0:Number.POSITIVE_INFINITY;o[u]={distance:p},r.add(u,p)});r.size()>0&&(a=r.removeMin(),s=o[a],s.distance!==Number.POSITIVE_INFINITY);)i(a).forEach(c);return o}});var HI=_((woe,GI)=>{"use strict";var M6=Eg(),k6=ht();GI.exports=D6;function D6(t,n,e){return k6.transform(t.nodes(),function(i,o){i[o]=M6(t,o,n,e)},{})}});var Pg=_((Soe,UI)=>{"use strict";var jI=ht();UI.exports=O6;function O6(t){var n=0,e=[],i={},o=[];function r(a){var s=i[a]={onStack:!0,lowlink:n,index:n++};if(e.push(a),t.successors(a).forEach(function(p){jI.has(i,p)?i[p].onStack&&(s.lowlink=Math.min(s.lowlink,i[p].index)):(r(p),s.lowlink=Math.min(s.lowlink,i[p].lowlink))}),s.lowlink===s.index){var c=[],u;do u=e.pop(),i[u].onStack=!1,c.push(u);while(a!==u);o.push(c)}}return t.nodes().forEach(function(a){jI.has(i,a)||r(a)}),o}});var $I=_((Ioe,WI)=>{"use strict";var N6=ht(),R6=Pg();WI.exports=A6;function A6(t){return N6.filter(R6(t),function(n){return n.length>1||n.length===1&&t.hasEdge(n[0],n[0])})}});var YI=_((Toe,KI)=>{"use strict";var F6=ht();KI.exports=B6;var L6=F6.constant(1);function B6(t,n,e){return z6(t,n||L6,e||function(i){return t.outEdges(i)})}function z6(t,n,e){var i={},o=t.nodes();return o.forEach(function(r){i[r]={},i[r][r]={distance:0},o.forEach(function(a){r!==a&&(i[r][a]={distance:Number.POSITIVE_INFINITY})}),e(r).forEach(function(a){var s=a.v===r?a.w:a.v,c=n(a);i[r][s]={distance:c,predecessor:r}})}),o.forEach(function(r){var a=i[r];o.forEach(function(s){var c=i[s];o.forEach(function(u){var p=c[r],g=a[u],b=c[u],M=p.distance+g.distance;M<b.distance&&(b.distance=M,b.predecessor=g.predecessor)})})}),i}});var Mg=_((Eoe,ZI)=>{"use strict";var Rr=ht();ZI.exports=XI;XI.CycleException=Yp;function XI(t){var n={},e={},i=[];function o(r){if(Rr.has(e,r))throw new Yp;Rr.has(n,r)||(e[r]=!0,n[r]=!0,Rr.each(t.predecessors(r),o),delete e[r],i.push(r))}if(Rr.each(t.sinks(),o),Rr.size(n)!==t.nodeCount())throw new Yp;return i}function Yp(){}Yp.prototype=new Error});var eT=_((Poe,JI)=>{"use strict";var QI=Mg();JI.exports=q6;function q6(t){try{QI(t)}catch(n){if(n instanceof QI.CycleException)return!1;throw n}return!0}});var kg=_((Moe,nT)=>{"use strict";var Xp=ht();nT.exports=V6;function V6(t,n,e){Xp.isArray(n)||(n=[n]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],r={};return Xp.each(n,function(a){if(!t.hasNode(a))throw new Error("Graph does not have node: "+a);tT(t,a,e==="post",r,i,o)}),o}function tT(t,n,e,i,o,r){Xp.has(i,n)||(i[n]=!0,e||r.push(n),Xp.each(o(n),function(a){tT(t,a,e,i,o,r)}),e&&r.push(n))}});var oT=_((koe,iT)=>{"use strict";var G6=kg();iT.exports=H6;function H6(t,n){return G6(t,n,"post")}});var aT=_((Doe,rT)=>{"use strict";var j6=kg();rT.exports=U6;function U6(t,n){return j6(t,n,"pre")}});var dT=_((Ooe,cT)=>{"use strict";var sT=ht(),W6=$p(),$6=Tg();cT.exports=K6;function K6(t,n){var e=new W6,i={},o=new $6,r;function a(c){var u=c.v===r?c.w:c.v,p=o.priority(u);if(p!==void 0){var g=n(c);g<p&&(i[u]=r,o.decrease(u,g))}}if(t.nodeCount()===0)return e;sT.each(t.nodes(),function(c){o.add(c,Number.POSITIVE_INFINITY),e.setNode(c)}),o.decrease(t.nodes()[0],0);for(var s=!1;o.size()>0;){if(r=o.removeMin(),sT.has(i,r))e.setEdge(r,i[r]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(r).forEach(a)}return e}});var uT=_((Noe,lT)=>{"use strict";lT.exports={components:BI(),dijkstra:Eg(),dijkstraAll:HI(),findCycles:$I(),floydWarshall:YI(),isAcyclic:eT(),postorder:oT(),preorder:aT(),prim:dT(),tarjan:Pg(),topsort:Mg()}});var hT=_((Roe,fT)=>{"use strict";var pT=RI();fT.exports={Graph:pT.Graph,json:FI(),alg:uT(),version:pT.version}});var St=_((Aoe,mT)=>{"use strict";var Zp;if(typeof yi=="function")try{Zp=hT()}catch{}Zp||(Zp=window.graphlib);mT.exports=Zp});var _T=_((Loe,gT)=>{"use strict";var Y6=Km(),X6=1,Z6=4;function Q6(t){return Y6(t,X6|Z6)}gT.exports=Q6});var Ar=_((Boe,vT)=>{"use strict";var J6=li(),eW=Vt(),tW=br(),nW=ft();function iW(t,n,e){if(!nW(e))return!1;var i=typeof n;return(i=="number"?eW(e)&&tW(n,e.length):i=="string"&&n in e)?J6(e[n],t):!1}vT.exports=iW});var bT=_((zoe,CT)=>{"use strict";var oW=Or(),rW=li(),aW=Ar(),sW=An(),yT=Object.prototype,cW=yT.hasOwnProperty,dW=oW(function(t,n){t=Object(t);var e=-1,i=n.length,o=i>2?n[2]:void 0;for(o&&aW(n[0],n[1],o)&&(i=1);++e<i;)for(var r=n[e],a=sW(r),s=-1,c=a.length;++s<c;){var u=a[s],p=t[u];(p===void 0||rW(p,yT[u])&&!cW.call(t,u))&&(t[u]=r[u])}return t});CT.exports=dW});var wT=_((qoe,xT)=>{"use strict";var lW=Gt(),uW=Vt(),pW=Jt();function fW(t){return function(n,e,i){var o=Object(n);if(!uW(n)){var r=lW(e,3);n=pW(n),e=function(s){return r(o[s],s,o)}}var a=t(n,e,i);return a>-1?o[r?n[a]:a]:void 0}}xT.exports=fW});var IT=_((Voe,ST)=>{"use strict";var hW=/\s/;function mW(t){for(var n=t.length;n--&&hW.test(t.charAt(n)););return n}ST.exports=mW});var ET=_((Goe,TT)=>{"use strict";var gW=IT(),_W=/^\s+/;function vW(t){return t&&t.slice(0,gW(t)+1).replace(_W,"")}TT.exports=vW});var DT=_((Hoe,kT)=>{"use strict";var yW=ET(),PT=ft(),CW=mi(),MT=NaN,bW=/^[-+]0x[0-9a-f]+$/i,xW=/^0b[01]+$/i,wW=/^0o[0-7]+$/i,SW=parseInt;function IW(t){if(typeof t=="number")return t;if(CW(t))return MT;if(PT(t)){var n=typeof t.valueOf=="function"?t.valueOf():t;t=PT(n)?n+"":n}if(typeof t!="string")return t===0?t:+t;t=yW(t);var e=xW.test(t);return e||wW.test(t)?SW(t.slice(2),e?2:8):bW.test(t)?MT:+t}kT.exports=IW});var Dg=_((joe,NT)=>{"use strict";var TW=DT(),OT=1/0,EW=17976931348623157e292;function PW(t){if(!t)return t===0?t:0;if(t=TW(t),t===OT||t===-OT){var n=t<0?-1:1;return n*EW}return t===t?t:0}NT.exports=PW});var AT=_((Uoe,RT)=>{"use strict";var MW=Dg();function kW(t){var n=MW(t),e=n%1;return n===n?e?n-e:n:0}RT.exports=kW});var LT=_((Woe,FT)=>{"use strict";var DW=bg(),OW=Gt(),NW=AT(),RW=Math.max;function AW(t,n,e){var i=t==null?0:t.length;if(!i)return-1;var o=e==null?0:NW(e);return o<0&&(o=RW(i+o,0)),DW(t,OW(n,3),o)}FT.exports=AW});var zT=_(($oe,BT)=>{"use strict";var FW=wT(),LW=LT(),BW=FW(LW);BT.exports=BW});var Og=_((Koe,qT)=>{"use strict";var zW=Up();function qW(t){var n=t==null?0:t.length;return n?zW(t,1):[]}qT.exports=qW});var GT=_((Yoe,VT)=>{"use strict";var VW=zp(),GW=Ym(),HW=An();function jW(t,n){return t==null?t:VW(t,GW(n),HW)}VT.exports=jW});var jT=_((Xoe,HT)=>{"use strict";function UW(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}HT.exports=UW});var WT=_((Zoe,UT)=>{"use strict";var WW=vr(),$W=qp(),KW=Gt();function YW(t,n){var e={};return n=KW(n,3),$W(t,function(i,o,r){WW(e,o,n(i,o,r))}),e}UT.exports=YW});var Qp=_((Qoe,$T)=>{"use strict";var XW=mi();function ZW(t,n,e){for(var i=-1,o=t.length;++i<o;){var r=t[i],a=n(r);if(a!=null&&(s===void 0?a===a&&!XW(a):e(a,s)))var s=a,c=r}return c}$T.exports=ZW});var YT=_((Joe,KT)=>{"use strict";function QW(t,n){return t>n}KT.exports=QW});var ZT=_((ere,XT)=>{"use strict";var JW=Qp(),e$=YT(),t$=Fn();function n$(t){return t&&t.length?JW(t,t$,e$):void 0}XT.exports=n$});var Ng=_((tre,QT)=>{"use strict";var i$=vr(),o$=li();function r$(t,n,e){(e!==void 0&&!o$(t[n],e)||e===void 0&&!(n in t))&&i$(t,n,e)}QT.exports=r$});var t1=_((nre,e1)=>{"use strict";var a$=Nn(),s$=Er(),c$=kt(),d$="[object Object]",l$=Function.prototype,u$=Object.prototype,JT=l$.toString,p$=u$.hasOwnProperty,f$=JT.call(Object);function h$(t){if(!c$(t)||a$(t)!=d$)return!1;var n=s$(t);if(n===null)return!0;var e=p$.call(n,"constructor")&&n.constructor;return typeof e=="function"&&e instanceof e&&JT.call(e)==f$}e1.exports=h$});var Rg=_((ire,n1)=>{"use strict";function m$(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}n1.exports=m$});var o1=_((ore,i1)=>{"use strict";var g$=oo(),_$=An();function v$(t){return g$(t,_$(t))}i1.exports=v$});var l1=_((rre,d1)=>{"use strict";var r1=Ng(),y$=Dm(),C$=Um(),b$=Om(),x$=$m(),a1=ro(),s1=Ge(),w$=wg(),S$=pi(),I$=eo(),T$=ft(),E$=t1(),P$=co(),c1=Rg(),M$=o1();function k$(t,n,e,i,o,r,a){var s=c1(t,e),c=c1(n,e),u=a.get(c);if(u){r1(t,e,u);return}var p=r?r(s,c,e+"",t,n,a):void 0,g=p===void 0;if(g){var b=s1(c),M=!b&&S$(c),P=!b&&!M&&P$(c);p=c,b||M||P?s1(s)?p=s:w$(s)?p=b$(s):M?(g=!1,p=y$(c,!0)):P?(g=!1,p=C$(c,!0)):p=[]:E$(c)||a1(c)?(p=s,a1(s)?p=M$(s):(!T$(s)||I$(s))&&(p=x$(c))):g=!1}g&&(a.set(c,p),o(p,c,i,r,a),a.delete(c)),r1(t,e,p)}d1.exports=k$});var f1=_((are,p1)=>{"use strict";var D$=_r(),O$=Ng(),N$=zp(),R$=l1(),A$=ft(),F$=An(),L$=Rg();function u1(t,n,e,i,o){t!==n&&N$(n,function(r,a){if(o||(o=new D$),A$(r))R$(t,n,a,e,u1,i,o);else{var s=i?i(L$(t,a),r,a+"",t,n,o):void 0;s===void 0&&(s=r),O$(t,a,s)}},F$)}p1.exports=u1});var m1=_((sre,h1)=>{"use strict";var B$=Or(),z$=Ar();function q$(t){return B$(function(n,e){var i=-1,o=e.length,r=o>1?e[o-1]:void 0,a=o>2?e[2]:void 0;for(r=t.length>3&&typeof r=="function"?(o--,r):void 0,a&&z$(e[0],e[1],a)&&(r=o<3?void 0:r,o=1),n=Object(n);++i<o;){var s=e[i];s&&t(n,s,i,r)}return n})}h1.exports=q$});var _1=_((cre,g1)=>{"use strict";var V$=f1(),G$=m1(),H$=G$(function(t,n,e){V$(t,n,e)});g1.exports=H$});var Ag=_((dre,v1)=>{"use strict";function j$(t,n){return t<n}v1.exports=j$});var C1=_((lre,y1)=>{"use strict";var U$=Qp(),W$=Ag(),$$=Fn();function K$(t){return t&&t.length?U$(t,$$,W$):void 0}y1.exports=K$});var x1=_((ure,b1)=>{"use strict";var Y$=Qp(),X$=Gt(),Z$=Ag();function Q$(t,n){return t&&t.length?Y$(t,X$(n,2),Z$):void 0}b1.exports=Q$});var S1=_((pre,w1)=>{"use strict";var J$=xt(),e8=function(){return J$.Date.now()};w1.exports=e8});var E1=_((fre,T1)=>{"use strict";var t8=yr(),n8=kr(),i8=br(),I1=ft(),o8=po();function r8(t,n,e,i){if(!I1(t))return t;n=n8(n,t);for(var o=-1,r=n.length,a=r-1,s=t;s!=null&&++o<r;){var c=o8(n[o]),u=e;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=a){var p=s[c];u=i?i(p,c,s):void 0,u===void 0&&(u=I1(p)?p:i8(n[o+1])?[]:{})}t8(s,c,u),s=s[c]}return t}T1.exports=r8});var M1=_((hre,P1)=>{"use strict";var a8=Dr(),s8=E1(),c8=kr();function d8(t,n,e){for(var i=-1,o=n.length,r={};++i<o;){var a=n[i],s=a8(t,a);e(s,a)&&s8(r,c8(a,t),s)}return r}P1.exports=d8});var D1=_((mre,k1)=>{"use strict";var l8=M1(),u8=dg();function p8(t,n){return l8(t,n,function(e,i){return u8(t,i)})}k1.exports=p8});var N1=_((gre,O1)=>{"use strict";var f8=Og(),h8=yg(),m8=Cg();function g8(t){return m8(h8(t,void 0,f8),t+"")}O1.exports=g8});var A1=_((_re,R1)=>{"use strict";var _8=D1(),v8=N1(),y8=v8(function(t,n){return t==null?{}:_8(t,n)});R1.exports=y8});var L1=_((vre,F1)=>{"use strict";var C8=Math.ceil,b8=Math.max;function x8(t,n,e,i){for(var o=-1,r=b8(C8((n-t)/(e||1)),0),a=Array(r);r--;)a[i?r:++o]=t,t+=e;return a}F1.exports=x8});var z1=_((yre,B1)=>{"use strict";var w8=L1(),S8=Ar(),Fg=Dg();function I8(t){return function(n,e,i){return i&&typeof i!="number"&&S8(n,e,i)&&(e=i=void 0),n=Fg(n),e===void 0?(e=n,n=0):e=Fg(e),i=i===void 0?n<e?1:-1:Fg(i),w8(n,e,i,t)}}B1.exports=I8});var V1=_((Cre,q1)=>{"use strict";var T8=z1(),E8=T8();q1.exports=E8});var H1=_((bre,G1)=>{"use strict";function P8(t,n){var e=t.length;for(t.sort(n);e--;)t[e]=t[e].value;return t}G1.exports=P8});var W1=_((xre,U1)=>{"use strict";var j1=mi();function M8(t,n){if(t!==n){var e=t!==void 0,i=t===null,o=t===t,r=j1(t),a=n!==void 0,s=n===null,c=n===n,u=j1(n);if(!s&&!u&&!r&&t>n||r&&a&&c&&!s&&!u||i&&a&&c||!e&&c||!o)return 1;if(!i&&!r&&!u&&t<n||u&&e&&o&&!i&&!r||s&&e&&o||!a&&o||!c)return-1}return 0}U1.exports=M8});var K1=_((wre,$1)=>{"use strict";var k8=W1();function D8(t,n,e){for(var i=-1,o=t.criteria,r=n.criteria,a=o.length,s=e.length;++i<a;){var c=k8(o[i],r[i]);if(c){if(i>=s)return c;var u=e[i];return c*(u=="desc"?-1:1)}}return t.index-n.index}$1.exports=D8});var X1=_((Sre,Y1)=>{"use strict";var Lg=Mr(),O8=Dr(),N8=Gt(),R8=hg(),A8=H1(),F8=xr(),L8=K1(),B8=Fn(),z8=Ge();function q8(t,n,e){n.length?n=Lg(n,function(r){return z8(r)?function(a){return O8(a,r.length===1?r[0]:r)}:r}):n=[B8];var i=-1;n=Lg(n,F8(N8));var o=R8(t,function(r,a,s){var c=Lg(n,function(u){return u(r)});return{criteria:c,index:++i,value:r}});return A8(o,function(r,a){return L8(r,a,e)})}Y1.exports=q8});var J1=_((Ire,Q1)=>{"use strict";var V8=Up(),G8=X1(),H8=Or(),Z1=Ar(),j8=H8(function(t,n){if(t==null)return[];var e=n.length;return e>1&&Z1(t,n[0],n[1])?n=[]:e>2&&Z1(n[0],n[1],n[2])&&(n=[n[0]]),G8(t,V8(n,1),[])});Q1.exports=j8});var tE=_((Tre,eE)=>{"use strict";var U8=sg(),W8=0;function $8(t){var n=++W8;return U8(t)+n}eE.exports=$8});var iE=_((Ere,nE)=>{"use strict";function K8(t,n,e){for(var i=-1,o=t.length,r=n.length,a={};++i<o;){var s=i<r?n[i]:void 0;e(a,t[i],s)}return a}nE.exports=K8});var rE=_((Pre,oE)=>{"use strict";var Y8=yr(),X8=iE();function Z8(t,n){return X8(t||[],n||[],Y8)}oE.exports=Z8});var Me=_((Mre,aE)=>{"use strict";var Jp;if(typeof yi=="function")try{Jp={cloneDeep:_T(),constant:Bp(),defaults:bT(),each:Zm(),filter:ug(),find:zT(),flatten:Og(),forEach:Xm(),forIn:GT(),has:pg(),isUndefined:fg(),last:jT(),map:mg(),mapValues:WT(),max:ZT(),merge:_1(),min:C1(),minBy:x1(),now:S1(),pick:A1(),range:V1(),reduce:gg(),sortBy:J1(),uniqueId:tE(),values:Sg(),zipObject:rE()}}catch{}Jp||(Jp=window._);aE.exports=Jp});var dE=_((Dre,cE)=>{"use strict";cE.exports=ef;function ef(){var t={};t._next=t._prev=t,this._sentinel=t}ef.prototype.dequeue=function(){var t=this._sentinel,n=t._prev;if(n!==t)return sE(n),n};ef.prototype.enqueue=function(t){var n=this._sentinel;t._prev&&t._next&&sE(t),t._next=n._next,n._next._prev=t,n._next=t,t._prev=n};ef.prototype.toString=function(){for(var t=[],n=this._sentinel,e=n._prev;e!==n;)t.push(JSON.stringify(e,Q8)),e=e._prev;return"["+t.join(", ")+"]"};function sE(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Q8(t,n){if(t!=="_next"&&t!=="_prev")return n}});var uE=_((Ore,lE)=>{"use strict";var en=Me(),J8=St().Graph,e7=dE();lE.exports=n7;var t7=en.constant(1);function n7(t,n){if(t.nodeCount()<=1)return[];var e=o7(t,n||t7),i=i7(e.graph,e.buckets,e.zeroIdx);return en.flatten(en.map(i,function(o){return t.outEdges(o.v,o.w)}),!0)}function i7(t,n,e){for(var i=[],o=n[n.length-1],r=n[0],a;t.nodeCount();){for(;a=r.dequeue();)Bg(t,n,e,a);for(;a=o.dequeue();)Bg(t,n,e,a);if(t.nodeCount()){for(var s=n.length-2;s>0;--s)if(a=n[s].dequeue(),a){i=i.concat(Bg(t,n,e,a,!0));break}}}return i}function Bg(t,n,e,i,o){var r=o?[]:void 0;return en.forEach(t.inEdges(i.v),function(a){var s=t.edge(a),c=t.node(a.v);o&&r.push({v:a.v,w:a.w}),c.out-=s,zg(n,e,c)}),en.forEach(t.outEdges(i.v),function(a){var s=t.edge(a),c=a.w,u=t.node(c);u.in-=s,zg(n,e,u)}),t.removeNode(i.v),r}function o7(t,n){var e=new J8,i=0,o=0;en.forEach(t.nodes(),function(s){e.setNode(s,{v:s,in:0,out:0})}),en.forEach(t.edges(),function(s){var c=e.edge(s.v,s.w)||0,u=n(s),p=c+u;e.setEdge(s.v,s.w,p),o=Math.max(o,e.node(s.v).out+=u),i=Math.max(i,e.node(s.w).in+=u)});var r=en.range(o+i+3).map(function(){return new e7}),a=i+1;return en.forEach(e.nodes(),function(s){zg(r,a,e.node(s))}),{graph:e,buckets:r,zeroIdx:a}}function zg(t,n,e){e.out?e.in?t[e.out-e.in+n].enqueue(e):t[t.length-1].enqueue(e):t[0].enqueue(e)}});var fE=_((Nre,pE)=>{"use strict";var _i=Me(),r7=uE();pE.exports={run:a7,undo:c7};function a7(t){var n=t.graph().acyclicer==="greedy"?r7(t,e(t)):s7(t);_i.forEach(n,function(i){var o=t.edge(i);t.removeEdge(i),o.forwardName=i.name,o.reversed=!0,t.setEdge(i.w,i.v,o,_i.uniqueId("rev"))});function e(i){return function(o){return i.edge(o).weight}}}function s7(t){var n=[],e={},i={};function o(r){_i.has(i,r)||(i[r]=!0,e[r]=!0,_i.forEach(t.outEdges(r),function(a){_i.has(e,a.w)?n.push(a):o(a.w)}),delete e[r])}return _i.forEach(t.nodes(),o),n}function c7(t){_i.forEach(t.edges(),function(n){var e=t.edge(n);if(e.reversed){t.removeEdge(n);var i=e.forwardName;delete e.reversed,delete e.forwardName,t.setEdge(n.w,n.v,e,i)}})}});var it=_((Rre,_E)=>{"use strict";var fe=Me(),hE=St().Graph;_E.exports={addDummyNode:mE,simplify:d7,asNonCompoundGraph:l7,successorWeights:u7,predecessorWeights:p7,intersectRect:f7,buildLayerMatrix:h7,normalizeRanks:m7,removeEmptyRanks:g7,addBorderNode:_7,maxRank:gE,partition:v7,time:y7,notime:C7};function mE(t,n,e,i){var o;do o=fe.uniqueId(i);while(t.hasNode(o));return e.dummy=n,t.setNode(o,e),o}function d7(t){var n=new hE().setGraph(t.graph());return fe.forEach(t.nodes(),function(e){n.setNode(e,t.node(e))}),fe.forEach(t.edges(),function(e){var i=n.edge(e.v,e.w)||{weight:0,minlen:1},o=t.edge(e);n.setEdge(e.v,e.w,{weight:i.weight+o.weight,minlen:Math.max(i.minlen,o.minlen)})}),n}function l7(t){var n=new hE({multigraph:t.isMultigraph()}).setGraph(t.graph());return fe.forEach(t.nodes(),function(e){t.children(e).length||n.setNode(e,t.node(e))}),fe.forEach(t.edges(),function(e){n.setEdge(e,t.edge(e))}),n}function u7(t){var n=fe.map(t.nodes(),function(e){var i={};return fe.forEach(t.outEdges(e),function(o){i[o.w]=(i[o.w]||0)+t.edge(o).weight}),i});return fe.zipObject(t.nodes(),n)}function p7(t){var n=fe.map(t.nodes(),function(e){var i={};return fe.forEach(t.inEdges(e),function(o){i[o.v]=(i[o.v]||0)+t.edge(o).weight}),i});return fe.zipObject(t.nodes(),n)}function f7(t,n){var e=t.x,i=t.y,o=n.x-e,r=n.y-i,a=t.width/2,s=t.height/2;if(!o&&!r)throw new Error("Not possible to find intersection inside of the rectangle");var c,u;return Math.abs(r)*a>Math.abs(o)*s?(r<0&&(s=-s),c=s*o/r,u=s):(o<0&&(a=-a),c=a,u=a*r/o),{x:e+c,y:i+u}}function h7(t){var n=fe.map(fe.range(gE(t)+1),function(){return[]});return fe.forEach(t.nodes(),function(e){var i=t.node(e),o=i.rank;fe.isUndefined(o)||(n[o][i.order]=e)}),n}function m7(t){var n=fe.min(fe.map(t.nodes(),function(e){return t.node(e).rank}));fe.forEach(t.nodes(),function(e){var i=t.node(e);fe.has(i,"rank")&&(i.rank-=n)})}function g7(t){var n=fe.min(fe.map(t.nodes(),function(r){return t.node(r).rank})),e=[];fe.forEach(t.nodes(),function(r){var a=t.node(r).rank-n;e[a]||(e[a]=[]),e[a].push(r)});var i=0,o=t.graph().nodeRankFactor;fe.forEach(e,function(r,a){fe.isUndefined(r)&&a%o!==0?--i:i&&fe.forEach(r,function(s){t.node(s).rank+=i})})}function _7(t,n,e,i){var o={width:0,height:0};return arguments.length>=4&&(o.rank=e,o.order=i),mE(t,"border",o,n)}function gE(t){return fe.max(fe.map(t.nodes(),function(n){var e=t.node(n).rank;if(!fe.isUndefined(e))return e}))}function v7(t,n){var e={lhs:[],rhs:[]};return fe.forEach(t,function(i){n(i)?e.lhs.push(i):e.rhs.push(i)}),e}function y7(t,n){var e=fe.now();try{return n()}finally{console.log(t+" time: "+(fe.now()-e)+"ms")}}function C7(t,n){return n()}});var CE=_((Are,yE)=>{"use strict";var vE=Me(),b7=it();yE.exports={run:x7,undo:S7};function x7(t){t.graph().dummyChains=[],vE.forEach(t.edges(),function(n){w7(t,n)})}function w7(t,n){var e=n.v,i=t.node(e).rank,o=n.w,r=t.node(o).rank,a=n.name,s=t.edge(n),c=s.labelRank;if(r!==i+1){t.removeEdge(n);var u,p,g;for(g=0,++i;i<r;++g,++i)s.points=[],p={width:0,height:0,edgeLabel:s,edgeObj:n,rank:i},u=b7.addDummyNode(t,"edge",p,"_d"),i===c&&(p.width=s.width,p.height=s.height,p.dummy="edge-label",p.labelpos=s.labelpos),t.setEdge(e,u,{weight:s.weight},a),g===0&&t.graph().dummyChains.push(u),e=u;t.setEdge(e,o,{weight:s.weight},a)}}function S7(t){vE.forEach(t.graph().dummyChains,function(n){var e=t.node(n),i=e.edgeLabel,o;for(t.setEdge(e.edgeObj,i);e.dummy;)o=t.successors(n)[0],t.removeNode(n),i.points.push({x:e.x,y:e.y}),e.dummy==="edge-label"&&(i.x=e.x,i.y=e.y,i.width=e.width,i.height=e.height),n=o,e=t.node(n)})}});var Fr=_((Fre,bE)=>{"use strict";var tf=Me();bE.exports={longestPath:I7,slack:T7};function I7(t){var n={};function e(i){var o=t.node(i);if(tf.has(n,i))return o.rank;n[i]=!0;var r=tf.min(tf.map(t.outEdges(i),function(a){return e(a.w)-t.edge(a).minlen}));return(r===Number.POSITIVE_INFINITY||r===void 0||r===null)&&(r=0),o.rank=r}tf.forEach(t.sources(),e)}function T7(t,n){return t.node(n.w).rank-t.node(n.v).rank-t.edge(n).minlen}});var qg=_((Lre,xE)=>{"use strict";var nf=Me(),E7=St().Graph,of=Fr().slack;xE.exports=P7;function P7(t){var n=new E7({directed:!1}),e=t.nodes()[0],i=t.nodeCount();n.setNode(e,{});for(var o,r;M7(n,t)<i;)o=k7(n,t),r=n.hasNode(o.v)?of(t,o):-of(t,o),D7(n,t,r);return n}function M7(t,n){function e(i){nf.forEach(n.nodeEdges(i),function(o){var r=o.v,a=i===r?o.w:r;!t.hasNode(a)&&!of(n,o)&&(t.setNode(a,{}),t.setEdge(i,a,{}),e(a))})}return nf.forEach(t.nodes(),e),t.nodeCount()}function k7(t,n){return nf.minBy(n.edges(),function(e){if(t.hasNode(e.v)!==t.hasNode(e.w))return of(n,e)})}function D7(t,n,e){nf.forEach(t.nodes(),function(i){n.node(i).rank+=e})}});var kE=_((Bre,ME)=>{"use strict";var tn=Me(),O7=qg(),N7=Fr().slack,R7=Fr().longestPath,A7=St().alg.preorder,F7=St().alg.postorder,L7=it().simplify;ME.exports=vi;vi.initLowLimValues=Gg;vi.initCutValues=Vg;vi.calcCutValue=SE;vi.leaveEdge=TE;vi.enterEdge=EE;vi.exchangeEdges=PE;function vi(t){t=L7(t),R7(t);var n=O7(t);Gg(n),Vg(n,t);for(var e,i;e=TE(n);)i=EE(n,t,e),PE(n,t,e,i)}function Vg(t,n){var e=F7(t,t.nodes());e=e.slice(0,e.length-1),tn.forEach(e,function(i){B7(t,n,i)})}function B7(t,n,e){var i=t.node(e),o=i.parent;t.edge(e,o).cutvalue=SE(t,n,e)}function SE(t,n,e){var i=t.node(e),o=i.parent,r=!0,a=n.edge(e,o),s=0;return a||(r=!1,a=n.edge(o,e)),s=a.weight,tn.forEach(n.nodeEdges(e),function(c){var u=c.v===e,p=u?c.w:c.v;if(p!==o){var g=u===r,b=n.edge(c).weight;if(s+=g?b:-b,q7(t,e,p)){var M=t.edge(e,p).cutvalue;s+=g?-M:M}}}),s}function Gg(t,n){arguments.length<2&&(n=t.nodes()[0]),IE(t,{},1,n)}function IE(t,n,e,i,o){var r=e,a=t.node(i);return n[i]=!0,tn.forEach(t.neighbors(i),function(s){tn.has(n,s)||(e=IE(t,n,e,s,i))}),a.low=r,a.lim=e++,o?a.parent=o:delete a.parent,e}function TE(t){return tn.find(t.edges(),function(n){return t.edge(n).cutvalue<0})}function EE(t,n,e){var i=e.v,o=e.w;n.hasEdge(i,o)||(i=e.w,o=e.v);var r=t.node(i),a=t.node(o),s=r,c=!1;r.lim>a.lim&&(s=a,c=!0);var u=tn.filter(n.edges(),function(p){return c===wE(t,t.node(p.v),s)&&c!==wE(t,t.node(p.w),s)});return tn.minBy(u,function(p){return N7(n,p)})}function PE(t,n,e,i){var o=e.v,r=e.w;t.removeEdge(o,r),t.setEdge(i.v,i.w,{}),Gg(t),Vg(t,n),z7(t,n)}function z7(t,n){var e=tn.find(t.nodes(),function(o){return!n.node(o).parent}),i=A7(t,e);i=i.slice(1),tn.forEach(i,function(o){var r=t.node(o).parent,a=n.edge(o,r),s=!1;a||(a=n.edge(r,o),s=!0),n.node(o).rank=n.node(r).rank+(s?a.minlen:-a.minlen)})}function q7(t,n,e){return t.hasEdge(n,e)}function wE(t,n,e){return e.low<=n.lim&&n.lim<=e.lim}});var RE=_((zre,NE)=>{"use strict";var V7=Fr(),OE=V7.longestPath,G7=qg(),H7=kE();NE.exports=j7;function j7(t){switch(t.graph().ranker){case"network-simplex":DE(t);break;case"tight-tree":W7(t);break;case"longest-path":U7(t);break;default:DE(t)}}var U7=OE;function W7(t){OE(t),G7(t)}function DE(t){H7(t)}});var FE=_((qre,AE)=>{"use strict";var Hg=Me();AE.exports=$7;function $7(t){var n=Y7(t);Hg.forEach(t.graph().dummyChains,function(e){for(var i=t.node(e),o=i.edgeObj,r=K7(t,n,o.v,o.w),a=r.path,s=r.lca,c=0,u=a[c],p=!0;e!==o.w;){if(i=t.node(e),p){for(;(u=a[c])!==s&&t.node(u).maxRank<i.rank;)c++;u===s&&(p=!1)}if(!p){for(;c<a.length-1&&t.node(u=a[c+1]).minRank<=i.rank;)c++;u=a[c]}t.setParent(e,u),e=t.successors(e)[0]}})}function K7(t,n,e,i){var o=[],r=[],a=Math.min(n[e].low,n[i].low),s=Math.max(n[e].lim,n[i].lim),c,u;c=e;do c=t.parent(c),o.push(c);while(c&&(n[c].low>a||s>n[c].lim));for(u=c,c=i;(c=t.parent(c))!==u;)r.push(c);return{path:o.concat(r.reverse()),lca:u}}function Y7(t){var n={},e=0;function i(o){var r=e;Hg.forEach(t.children(o),i),n[o]={low:r,lim:e++}}return Hg.forEach(t.children(),i),n}});var zE=_((Vre,BE)=>{"use strict";var nn=Me(),jg=it();BE.exports={run:X7,cleanup:J7};function X7(t){var n=jg.addDummyNode(t,"root",{},"_root"),e=Z7(t),i=nn.max(nn.values(e))-1,o=2*i+1;t.graph().nestingRoot=n,nn.forEach(t.edges(),function(a){t.edge(a).minlen*=o});var r=Q7(t)+1;nn.forEach(t.children(),function(a){LE(t,n,o,r,i,e,a)}),t.graph().nodeRankFactor=o}function LE(t,n,e,i,o,r,a){var s=t.children(a);if(!s.length){a!==n&&t.setEdge(n,a,{weight:0,minlen:e});return}var c=jg.addBorderNode(t,"_bt"),u=jg.addBorderNode(t,"_bb"),p=t.node(a);t.setParent(c,a),p.borderTop=c,t.setParent(u,a),p.borderBottom=u,nn.forEach(s,function(g){LE(t,n,e,i,o,r,g);var b=t.node(g),M=b.borderTop?b.borderTop:g,P=b.borderBottom?b.borderBottom:g,R=b.borderTop?i:2*i,H=M!==P?1:o-r[a]+1;t.setEdge(c,M,{weight:R,minlen:H,nestingEdge:!0}),t.setEdge(P,u,{weight:R,minlen:H,nestingEdge:!0})}),t.parent(a)||t.setEdge(n,c,{weight:0,minlen:o+r[a]})}function Z7(t){var n={};function e(i,o){var r=t.children(i);r&&r.length&&nn.forEach(r,function(a){e(a,o+1)}),n[i]=o}return nn.forEach(t.children(),function(i){e(i,1)}),n}function Q7(t){return nn.reduce(t.edges(),function(n,e){return n+t.edge(e).weight},0)}function J7(t){var n=t.graph();t.removeNode(n.nestingRoot),delete n.nestingRoot,nn.forEach(t.edges(),function(e){var i=t.edge(e);i.nestingEdge&&t.removeEdge(e)})}});var GE=_((Gre,VE)=>{"use strict";var Ug=Me(),eK=it();VE.exports=tK;function tK(t){function n(e){var i=t.children(e),o=t.node(e);if(i.length&&Ug.forEach(i,n),Ug.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var r=o.minRank,a=o.maxRank+1;r<a;++r)qE(t,"borderLeft","_bl",e,o,r),qE(t,"borderRight","_br",e,o,r)}}Ug.forEach(t.children(),n)}function qE(t,n,e,i,o,r){var a={width:0,height:0,rank:r,borderType:n},s=o[n][r-1],c=eK.addDummyNode(t,"border",a,e);o[n][r]=c,t.setParent(c,i),s&&t.setEdge(s,c,{weight:1})}});var WE=_((Hre,UE)=>{"use strict";var jt=Me();UE.exports={adjust:nK,undo:iK};function nK(t){var n=t.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&jE(t)}function iK(t){var n=t.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&oK(t),(n==="lr"||n==="rl")&&(rK(t),jE(t))}function jE(t){jt.forEach(t.nodes(),function(n){HE(t.node(n))}),jt.forEach(t.edges(),function(n){HE(t.edge(n))})}function HE(t){var n=t.width;t.width=t.height,t.height=n}function oK(t){jt.forEach(t.nodes(),function(n){Wg(t.node(n))}),jt.forEach(t.edges(),function(n){var e=t.edge(n);jt.forEach(e.points,Wg),jt.has(e,"y")&&Wg(e)})}function Wg(t){t.y=-t.y}function rK(t){jt.forEach(t.nodes(),function(n){$g(t.node(n))}),jt.forEach(t.edges(),function(n){var e=t.edge(n);jt.forEach(e.points,$g),jt.has(e,"x")&&$g(e)})}function $g(t){var n=t.x;t.x=t.y,t.y=n}});var KE=_((jre,$E)=>{"use strict";var on=Me();$E.exports=aK;function aK(t){var n={},e=on.filter(t.nodes(),function(s){return!t.children(s).length}),i=on.max(on.map(e,function(s){return t.node(s).rank})),o=on.map(on.range(i+1),function(){return[]});function r(s){if(!on.has(n,s)){n[s]=!0;var c=t.node(s);o[c.rank].push(s),on.forEach(t.successors(s),r)}}var a=on.sortBy(e,function(s){return t.node(s).rank});return on.forEach(a,r),o}});var XE=_((Ure,YE)=>{"use strict";var Ln=Me();YE.exports=sK;function sK(t,n){for(var e=0,i=1;i<n.length;++i)e+=cK(t,n[i-1],n[i]);return e}function cK(t,n,e){for(var i=Ln.zipObject(e,Ln.map(e,function(u,p){return p})),o=Ln.flatten(Ln.map(n,function(u){return Ln.sortBy(Ln.map(t.outEdges(u),function(p){return{pos:i[p.w],weight:t.edge(p).weight}}),"pos")}),!0),r=1;r<e.length;)r<<=1;var a=2*r-1;r-=1;var s=Ln.map(new Array(a),function(){return 0}),c=0;return Ln.forEach(o.forEach(function(u){var p=u.pos+r;s[p]+=u.weight;for(var g=0;p>0;)p%2&&(g+=s[p+1]),p=p-1>>1,s[p]+=u.weight;c+=u.weight*g})),c}});var JE=_((Wre,QE)=>{"use strict";var ZE=Me();QE.exports=dK;function dK(t,n){return ZE.map(n,function(e){var i=t.inEdges(e);if(i.length){var o=ZE.reduce(i,function(r,a){var s=t.edge(a),c=t.node(a.v);return{sum:r.sum+s.weight*c.order,weight:r.weight+s.weight}},{sum:0,weight:0});return{v:e,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:e}})}});var tP=_(($re,eP)=>{"use strict";var mt=Me();eP.exports=lK;function lK(t,n){var e={};mt.forEach(t,function(o,r){var a=e[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:r};mt.isUndefined(o.barycenter)||(a.barycenter=o.barycenter,a.weight=o.weight)}),mt.forEach(n.edges(),function(o){var r=e[o.v],a=e[o.w];!mt.isUndefined(r)&&!mt.isUndefined(a)&&(a.indegree++,r.out.push(e[o.w]))});var i=mt.filter(e,function(o){return!o.indegree});return uK(i)}function uK(t){var n=[];function e(r){return function(a){a.merged||(mt.isUndefined(a.barycenter)||mt.isUndefined(r.barycenter)||a.barycenter>=r.barycenter)&&pK(r,a)}}function i(r){return function(a){a.in.push(r),--a.indegree===0&&t.push(a)}}for(;t.length;){var o=t.pop();n.push(o),mt.forEach(o.in.reverse(),e(o)),mt.forEach(o.out,i(o))}return mt.map(mt.filter(n,function(r){return!r.merged}),function(r){return mt.pick(r,["vs","i","barycenter","weight"])})}function pK(t,n){var e=0,i=0;t.weight&&(e+=t.barycenter*t.weight,i+=t.weight),n.weight&&(e+=n.barycenter*n.weight,i+=n.weight),t.vs=n.vs.concat(t.vs),t.barycenter=e/i,t.weight=i,t.i=Math.min(n.i,t.i),n.merged=!0}});var oP=_((Kre,iP)=>{"use strict";var Lr=Me(),fK=it();iP.exports=hK;function hK(t,n){var e=fK.partition(t,function(p){return Lr.has(p,"barycenter")}),i=e.lhs,o=Lr.sortBy(e.rhs,function(p){return-p.i}),r=[],a=0,s=0,c=0;i.sort(mK(!!n)),c=nP(r,o,c),Lr.forEach(i,function(p){c+=p.vs.length,r.push(p.vs),a+=p.barycenter*p.weight,s+=p.weight,c=nP(r,o,c)});var u={vs:Lr.flatten(r,!0)};return s&&(u.barycenter=a/s,u.weight=s),u}function nP(t,n,e){for(var i;n.length&&(i=Lr.last(n)).i<=e;)n.pop(),t.push(i.vs),e++;return e}function mK(t){return function(n,e){return n.barycenter<e.barycenter?-1:n.barycenter>e.barycenter?1:t?e.i-n.i:n.i-e.i}}});var sP=_((Yre,aP)=>{"use strict";var Bn=Me(),gK=JE(),_K=tP(),vK=oP();aP.exports=rP;function rP(t,n,e,i){var o=t.children(n),r=t.node(n),a=r?r.borderLeft:void 0,s=r?r.borderRight:void 0,c={};a&&(o=Bn.filter(o,function(P){return P!==a&&P!==s}));var u=gK(t,o);Bn.forEach(u,function(P){if(t.children(P.v).length){var R=rP(t,P.v,e,i);c[P.v]=R,Bn.has(R,"barycenter")&&CK(P,R)}});var p=_K(u,e);yK(p,c);var g=vK(p,i);if(a&&(g.vs=Bn.flatten([a,g.vs,s],!0),t.predecessors(a).length)){var b=t.node(t.predecessors(a)[0]),M=t.node(t.predecessors(s)[0]);Bn.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+b.order+M.order)/(g.weight+2),g.weight+=2}return g}function yK(t,n){Bn.forEach(t,function(e){e.vs=Bn.flatten(e.vs.map(function(i){return n[i]?n[i].vs:i}),!0)})}function CK(t,n){Bn.isUndefined(t.barycenter)?(t.barycenter=n.barycenter,t.weight=n.weight):(t.barycenter=(t.barycenter*t.weight+n.barycenter*n.weight)/(t.weight+n.weight),t.weight+=n.weight)}});var dP=_((Xre,cP)=>{"use strict";var Br=Me(),bK=St().Graph;cP.exports=xK;function xK(t,n,e){var i=wK(t),o=new bK({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(function(r){return t.node(r)});return Br.forEach(t.nodes(),function(r){var a=t.node(r),s=t.parent(r);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(o.setNode(r),o.setParent(r,s||i),Br.forEach(t[e](r),function(c){var u=c.v===r?c.w:c.v,p=o.edge(u,r),g=Br.isUndefined(p)?0:p.weight;o.setEdge(u,r,{weight:t.edge(c).weight+g})}),Br.has(a,"minRank")&&o.setNode(r,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),o}function wK(t){for(var n;t.hasNode(n=Br.uniqueId("_root")););return n}});var uP=_((Zre,lP)=>{"use strict";var SK=Me();lP.exports=IK;function IK(t,n,e){var i={},o;SK.forEach(e,function(r){for(var a=t.parent(r),s,c;a;){if(s=t.parent(a),s?(c=i[s],i[s]=a):(c=o,o=a),c&&c!==a){n.setEdge(c,a);return}a=s}})}});var gP=_((Qre,mP)=>{"use strict";var zn=Me(),TK=KE(),EK=XE(),PK=sP(),MK=dP(),kK=uP(),DK=St().Graph,pP=it();mP.exports=OK;function OK(t){var n=pP.maxRank(t),e=fP(t,zn.range(1,n+1),"inEdges"),i=fP(t,zn.range(n-1,-1,-1),"outEdges"),o=TK(t);hP(t,o);for(var r=Number.POSITIVE_INFINITY,a,s=0,c=0;c<4;++s,++c){NK(s%2?e:i,s%4>=2),o=pP.buildLayerMatrix(t);var u=EK(t,o);u<r&&(c=0,a=zn.cloneDeep(o),r=u)}hP(t,a)}function fP(t,n,e){return zn.map(n,function(i){return MK(t,i,e)})}function NK(t,n){var e=new DK;zn.forEach(t,function(i){var o=i.graph().root,r=PK(i,o,e,n);zn.forEach(r.vs,function(a,s){i.node(a).order=s}),kK(i,e,r.vs)})}function hP(t,n){zn.forEach(n,function(e){zn.forEach(e,function(i,o){t.node(i).order=o})})}});var TP=_((Jre,IP)=>{"use strict";var ne=Me(),RK=St().Graph,AK=it();IP.exports={positionX:BK,findType1Conflicts:_P,findType2Conflicts:vP,addConflict:Kg,hasConflict:yP,verticalAlignment:CP,horizontalCompaction:bP,alignCoordinates:wP,findSmallestWidthAlignment:xP,balance:SP};function _P(t,n){var e={};function i(o,r){var a=0,s=0,c=o.length,u=ne.last(r);return ne.forEach(r,function(p,g){var b=FK(t,p),M=b?t.node(b).order:c;(b||p===u)&&(ne.forEach(r.slice(s,g+1),function(P){ne.forEach(t.predecessors(P),function(R){var H=t.node(R),z=H.order;(z<a||M<z)&&!(H.dummy&&t.node(P).dummy)&&Kg(e,R,P)})}),s=g+1,a=M)}),r}return ne.reduce(n,i),e}function vP(t,n){var e={};function i(r,a,s,c,u){var p;ne.forEach(ne.range(a,s),function(g){p=r[g],t.node(p).dummy&&ne.forEach(t.predecessors(p),function(b){var M=t.node(b);M.dummy&&(M.order<c||M.order>u)&&Kg(e,b,p)})})}function o(r,a){var s=-1,c,u=0;return ne.forEach(a,function(p,g){if(t.node(p).dummy==="border"){var b=t.predecessors(p);b.length&&(c=t.node(b[0]).order,i(a,u,g,s,c),u=g,s=c)}i(a,u,a.length,c,r.length)}),a}return ne.reduce(n,o),e}function FK(t,n){if(t.node(n).dummy)return ne.find(t.predecessors(n),function(e){return t.node(e).dummy})}function Kg(t,n,e){if(n>e){var i=n;n=e,e=i}var o=t[n];o||(t[n]=o={}),o[e]=!0}function yP(t,n,e){if(n>e){var i=n;n=e,e=i}return ne.has(t[n],e)}function CP(t,n,e,i){var o={},r={},a={};return ne.forEach(n,function(s){ne.forEach(s,function(c,u){o[c]=c,r[c]=c,a[c]=u})}),ne.forEach(n,function(s){var c=-1;ne.forEach(s,function(u){var p=i(u);if(p.length){p=ne.sortBy(p,function(R){return a[R]});for(var g=(p.length-1)/2,b=Math.floor(g),M=Math.ceil(g);b<=M;++b){var P=p[b];r[u]===u&&c<a[P]&&!yP(e,u,P)&&(r[P]=u,r[u]=o[u]=o[P],c=a[P])}}})}),{root:o,align:r}}function bP(t,n,e,i,o){var r={},a=LK(t,n,e,o),s=o?"borderLeft":"borderRight";function c(g,b){for(var M=a.nodes(),P=M.pop(),R={};P;)R[P]?g(P):(R[P]=!0,M.push(P),M=M.concat(b(P))),P=M.pop()}function u(g){r[g]=a.inEdges(g).reduce(function(b,M){return Math.max(b,r[M.v]+a.edge(M))},0)}function p(g){var b=a.outEdges(g).reduce(function(P,R){return Math.min(P,r[R.w]-a.edge(R))},Number.POSITIVE_INFINITY),M=t.node(g);b!==Number.POSITIVE_INFINITY&&M.borderType!==s&&(r[g]=Math.max(r[g],b))}return c(u,a.predecessors.bind(a)),c(p,a.successors.bind(a)),ne.forEach(i,function(g){r[g]=r[e[g]]}),r}function LK(t,n,e,i){var o=new RK,r=t.graph(),a=zK(r.nodesep,r.edgesep,i);return ne.forEach(n,function(s){var c;ne.forEach(s,function(u){var p=e[u];if(o.setNode(p),c){var g=e[c],b=o.edge(g,p);o.setEdge(g,p,Math.max(a(t,u,c),b||0))}c=u})}),o}function xP(t,n){return ne.minBy(ne.values(n),function(e){var i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return ne.forIn(e,function(r,a){var s=qK(t,a)/2;i=Math.max(r+s,i),o=Math.min(r-s,o)}),i-o})}function wP(t,n){var e=ne.values(n),i=ne.min(e),o=ne.max(e);ne.forEach(["u","d"],function(r){ne.forEach(["l","r"],function(a){var s=r+a,c=t[s],u;if(c!==n){var p=ne.values(c);u=a==="l"?i-ne.min(p):o-ne.max(p),u&&(t[s]=ne.mapValues(c,function(g){return g+u}))}})})}function SP(t,n){return ne.mapValues(t.ul,function(e,i){if(n)return t[n.toLowerCase()][i];var o=ne.sortBy(ne.map(t,i));return(o[1]+o[2])/2})}function BK(t){var n=AK.buildLayerMatrix(t),e=ne.merge(_P(t,n),vP(t,n)),i={},o;ne.forEach(["u","d"],function(a){o=a==="u"?n:ne.values(n).reverse(),ne.forEach(["l","r"],function(s){s==="r"&&(o=ne.map(o,function(g){return ne.values(g).reverse()}));var c=(a==="u"?t.predecessors:t.successors).bind(t),u=CP(t,o,e,c),p=bP(t,o,u.root,u.align,s==="r");s==="r"&&(p=ne.mapValues(p,function(g){return-g})),i[a+s]=p})});var r=xP(t,i);return wP(i,r),SP(i,t.graph().align)}function zK(t,n,e){return function(i,o,r){var a=i.node(o),s=i.node(r),c=0,u;if(c+=a.width/2,ne.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2;break}if(u&&(c+=e?u:-u),u=0,c+=(a.dummy?n:t)/2,c+=(s.dummy?n:t)/2,c+=s.width/2,ne.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(c+=e?u:-u),u=0,c}}function qK(t,n){return t.node(n).width}});var MP=_((eae,PP)=>{"use strict";var zr=Me(),EP=it(),VK=TP().positionX;PP.exports=GK;function GK(t){t=EP.asNonCompoundGraph(t),HK(t),zr.forEach(VK(t),function(n,e){t.node(e).x=n})}function HK(t){var n=EP.buildLayerMatrix(t),e=t.graph().ranksep,i=0;zr.forEach(n,function(o){var r=zr.max(zr.map(o,function(a){return t.node(a).height}));zr.forEach(o,function(a){t.node(a).y=i+r/2}),i+=r+e})}});var AP=_((tae,RP)=>{"use strict";var ae=Me(),kP=fE(),DP=CE(),jK=RE(),UK=it().normalizeRanks,WK=FE(),$K=it().removeEmptyRanks,OP=zE(),KK=GE(),NP=WE(),YK=gP(),XK=MP(),qn=it(),ZK=St().Graph;RP.exports=QK;function QK(t,n){var e=n&&n.debugTiming?qn.time:qn.notime;e("layout",function(){var i=e(" buildLayoutGraph",function(){return d9(t)});e(" runLayout",function(){JK(i,e)}),e(" updateInputGraph",function(){e9(t,i)})})}function JK(t,n){n(" makeSpaceForEdgeLabels",function(){l9(t)}),n(" removeSelfEdges",function(){y9(t)}),n(" acyclic",function(){kP.run(t)}),n(" nestingGraph.run",function(){OP.run(t)}),n(" rank",function(){jK(qn.asNonCompoundGraph(t))}),n(" injectEdgeLabelProxies",function(){u9(t)}),n(" removeEmptyRanks",function(){$K(t)}),n(" nestingGraph.cleanup",function(){OP.cleanup(t)}),n(" normalizeRanks",function(){UK(t)}),n(" assignRankMinMax",function(){p9(t)}),n(" removeEdgeLabelProxies",function(){f9(t)}),n(" normalize.run",function(){DP.run(t)}),n(" parentDummyChains",function(){WK(t)}),n(" addBorderSegments",function(){KK(t)}),n(" order",function(){YK(t)}),n(" insertSelfEdges",function(){C9(t)}),n(" adjustCoordinateSystem",function(){NP.adjust(t)}),n(" position",function(){XK(t)}),n(" positionSelfEdges",function(){b9(t)}),n(" removeBorderNodes",function(){v9(t)}),n(" normalize.undo",function(){DP.undo(t)}),n(" fixupEdgeLabelCoords",function(){g9(t)}),n(" undoCoordinateSystem",function(){NP.undo(t)}),n(" translateGraph",function(){h9(t)}),n(" assignNodeIntersects",function(){m9(t)}),n(" reversePoints",function(){_9(t)}),n(" acyclic.undo",function(){kP.undo(t)})}function e9(t,n){ae.forEach(t.nodes(),function(e){var i=t.node(e),o=n.node(e);i&&(i.x=o.x,i.y=o.y,n.children(e).length&&(i.width=o.width,i.height=o.height))}),ae.forEach(t.edges(),function(e){var i=t.edge(e),o=n.edge(e);i.points=o.points,ae.has(o,"x")&&(i.x=o.x,i.y=o.y)}),t.graph().width=n.graph().width,t.graph().height=n.graph().height}var t9=["nodesep","edgesep","ranksep","marginx","marginy"],n9={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},i9=["acyclicer","ranker","rankdir","align"],o9=["width","height"],r9={width:0,height:0},a9=["minlen","weight","width","height","labeloffset"],s9={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},c9=["labelpos"];function d9(t){var n=new ZK({multigraph:!0,compound:!0}),e=Xg(t.graph());return n.setGraph(ae.merge({},n9,Yg(e,t9),ae.pick(e,i9))),ae.forEach(t.nodes(),function(i){var o=Xg(t.node(i));n.setNode(i,ae.defaults(Yg(o,o9),r9)),n.setParent(i,t.parent(i))}),ae.forEach(t.edges(),function(i){var o=Xg(t.edge(i));n.setEdge(i,ae.merge({},s9,Yg(o,a9),ae.pick(o,c9)))}),n}function l9(t){var n=t.graph();n.ranksep/=2,ae.forEach(t.edges(),function(e){var i=t.edge(e);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function u9(t){ae.forEach(t.edges(),function(n){var e=t.edge(n);if(e.width&&e.height){var i=t.node(n.v),o=t.node(n.w),r={rank:(o.rank-i.rank)/2+i.rank,e:n};qn.addDummyNode(t,"edge-proxy",r,"_ep")}})}function p9(t){var n=0;ae.forEach(t.nodes(),function(e){var i=t.node(e);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,n=ae.max(n,i.maxRank))}),t.graph().maxRank=n}function f9(t){ae.forEach(t.nodes(),function(n){var e=t.node(n);e.dummy==="edge-proxy"&&(t.edge(e.e).labelRank=e.rank,t.removeNode(n))})}function h9(t){var n=Number.POSITIVE_INFINITY,e=0,i=Number.POSITIVE_INFINITY,o=0,r=t.graph(),a=r.marginx||0,s=r.marginy||0;function c(u){var p=u.x,g=u.y,b=u.width,M=u.height;n=Math.min(n,p-b/2),e=Math.max(e,p+b/2),i=Math.min(i,g-M/2),o=Math.max(o,g+M/2)}ae.forEach(t.nodes(),function(u){c(t.node(u))}),ae.forEach(t.edges(),function(u){var p=t.edge(u);ae.has(p,"x")&&c(p)}),n-=a,i-=s,ae.forEach(t.nodes(),function(u){var p=t.node(u);p.x-=n,p.y-=i}),ae.forEach(t.edges(),function(u){var p=t.edge(u);ae.forEach(p.points,function(g){g.x-=n,g.y-=i}),ae.has(p,"x")&&(p.x-=n),ae.has(p,"y")&&(p.y-=i)}),r.width=e-n+a,r.height=o-i+s}function m9(t){ae.forEach(t.edges(),function(n){var e=t.edge(n),i=t.node(n.v),o=t.node(n.w),r,a;e.points?(r=e.points[0],a=e.points[e.points.length-1]):(e.points=[],r=o,a=i),e.points.unshift(qn.intersectRect(i,r)),e.points.push(qn.intersectRect(o,a))})}function g9(t){ae.forEach(t.edges(),function(n){var e=t.edge(n);if(ae.has(e,"x"))switch((e.labelpos==="l"||e.labelpos==="r")&&(e.width-=e.labeloffset),e.labelpos){case"l":e.x-=e.width/2+e.labeloffset;break;case"r":e.x+=e.width/2+e.labeloffset;break}})}function _9(t){ae.forEach(t.edges(),function(n){var e=t.edge(n);e.reversed&&e.points.reverse()})}function v9(t){ae.forEach(t.nodes(),function(n){if(t.children(n).length){var e=t.node(n),i=t.node(e.borderTop),o=t.node(e.borderBottom),r=t.node(ae.last(e.borderLeft)),a=t.node(ae.last(e.borderRight));e.width=Math.abs(a.x-r.x),e.height=Math.abs(o.y-i.y),e.x=r.x+e.width/2,e.y=i.y+e.height/2}}),ae.forEach(t.nodes(),function(n){t.node(n).dummy==="border"&&t.removeNode(n)})}function y9(t){ae.forEach(t.edges(),function(n){if(n.v===n.w){var e=t.node(n.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:n,label:t.edge(n)}),t.removeEdge(n)}})}function C9(t){var n=qn.buildLayerMatrix(t);ae.forEach(n,function(e){var i=0;ae.forEach(e,function(o,r){var a=t.node(o);a.order=r+i,ae.forEach(a.selfEdges,function(s){qn.addDummyNode(t,"selfedge",{width:s.label.width,height:s.label.height,rank:a.rank,order:r+ ++i,e:s.e,label:s.label},"_se")}),delete a.selfEdges})})}function b9(t){ae.forEach(t.nodes(),function(n){var e=t.node(n);if(e.dummy==="selfedge"){var i=t.node(e.e.v),o=i.x+i.width/2,r=i.y,a=e.x-o,s=i.height/2;t.setEdge(e.e,e.label),t.removeNode(n),e.label.points=[{x:o+2*a/3,y:r-s},{x:o+5*a/6,y:r-s},{x:o+a,y:r},{x:o+5*a/6,y:r+s},{x:o+2*a/3,y:r+s}],e.label.x=e.x,e.label.y=e.y}})}function Yg(t,n){return ae.mapValues(ae.pick(t,n),Number)}function Xg(t){var n={};return ae.forEach(t,function(e,i){n[i.toLowerCase()]=e}),n}});var LP=_((nae,FP)=>{"use strict";var rf=Me(),x9=it(),w9=St().Graph;FP.exports={debugOrdering:S9};function S9(t){var n=x9.buildLayerMatrix(t),e=new w9({compound:!0,multigraph:!0}).setGraph({});return rf.forEach(t.nodes(),function(i){e.setNode(i,{label:i}),e.setParent(i,"layer"+t.node(i).rank)}),rf.forEach(t.edges(),function(i){e.setEdge(i.v,i.w,{},i.name)}),rf.forEach(n,function(i,o){var r="layer"+o;e.setNode(r,{rank:"same"}),rf.reduce(i,function(a,s){return e.setEdge(a,s,{style:"invis"}),s})}),e}});var zP=_((iae,BP)=>{"use strict";BP.exports="0.8.5"});var VP=_((oae,qP)=>{"use strict";qP.exports={graphlib:St(),layout:AP(),debug:LP(),util:{time:it().time,notime:it().notime},version:zP()}});var Xn=class{constructor(n,e,i,o,r){this.center=n,this.radiusX=e,this.radiusY=i,this.startAngle=o,this.endAngle=r}},A=class t{static castToPoint(n){return n||t.initialize()}static initialize(n=0,e=0){return{x:n,y:e}}static copy(n){return t.initialize(n.x,n.y)}static isEqual(n,e){return n.x===e.x&&n.y===e.y}static sum(n,e){return{x:n.x+e.x,y:n.y+e.y}}static sub(n,e){return{x:n.x-e.x,y:n.y-e.y}}static div(n,e){return{x:n.x/e,y:n.y/e}}static mult(n,e){return{x:n.x*e,y:n.y*e}}static interpolatePoints(n,e,i){let o=1-i;return t.initialize(n.x*o+e.x*i,n.y*o+e.y*i)}static roundTo(n,e){let i=Math.trunc(n.x/e),o=Math.trunc(n.y/e);return{x:i*e,y:o*e}}static hypotenuse(n,e){let i=e.x-n.x,o=e.y-n.y;return Math.abs(Math.sqrt(i*i+o*o))}static distance(n,e){let i=n.x-e.x,o=n.y-e.y;return Math.sqrt(i*i+o*o)}static getMinimum(n,e){return t.initialize(Math.min(n.x,e.x),Math.min(n.y,e.y))}static getMaximum(n,e){return t.initialize(Math.max(n.x,e.x),Math.max(n.y,e.y))}static matrixTransform(n,e){let i=t.initialize(n.x,n.y),o=e.getScreenCTM();if(o){let r=e.createSVGPoint();r.x=n.x,r.y=n.y,i=r.matrixTransform(o.inverse())}return i}static elementTransform(n,e){let i=t.initialize(n.x,n.y),o=e.getBoundingClientRect();return i=t.sub(i,t.initialize(o.left,o.top)),i}},Z=class t{constructor(n=0,e=0){this.x=n,this.y=e}static fromPoint(n){return new t(n.x,n.y)}add(n){let e=A.sum(this,n);return t.fromPoint(e)}sub(n){let e=A.sub(this,n);return t.fromPoint(e)}subNumber(n){let e=A.sub(this,new t(n,n));return t.fromPoint(e)}div(n){let e=A.div(this,n);return t.fromPoint(e)}mult(n){let e=A.mult(this,n);return t.fromPoint(e)}matrixTransform(n){let e=A.matrixTransform(this,n);return t.fromPoint(e)}elementTransform(n){let e=A.elementTransform(this,n);return t.fromPoint(e)}},wo=class{static initialize(n=A.initialize(),e=A.initialize()){return{point1:n,point2:e}}static copy(n){return{point1:n.point1,point2:n.point2}}static hypotenuse(n){return Math.sqrt(Math.pow(n.point1.x-n.point2.x,2)+Math.pow(n.point1.y-n.point2.y,2))}},Zn=class{constructor(n,e){this.point1=n,this.point2=e}},G=class t{static initialize(n=0,e=0,i=0,o=0){i<0&&(n=n+i,i=-i),o<0&&(e=e+o,o=-o);let r=A.initialize(n+i/2,e+o/2);return{x:n,y:e,width:i,height:o,gravityCenter:r}}static copy(n){return t.initialize(n.x,n.y,n.width,n.height)}static fromElement(n){let{x:e,y:i,width:o,height:r}=n.getBoundingClientRect();return t.initialize(e,i,o,r)}static isIncludePoint(n,e){return e.x>=t.left(n)&&e.x<=t.right(n)&&e.y>=t.top(n)&&e.y<=t.bottom(n)}static intersectionWithRect(n,e){return!(n.x+n.width<e.x||e.x+e.width<n.x||n.y+n.height<e.y||e.y+e.height<n.y)}static left(n){return n.x}static top(n){return n.y}static right(n){return n.x+n.width}static bottom(n){return n.y+n.height}static addPoint(n,e){let i=t.copy(n);return i.x+=e.x,i.y+=e.y,this.initialize(i.x,i.y,i.width,i.height)}static mult(n,e){let i=t.copy(n);return i.x*=e,i.y*=e,i.width*=e,i.height*=e,this.initialize(i.x,i.y,i.width,i.height)}static div(n,e){let i=t.copy(n);return i.x/=e,i.y/=e,i.width/=e,i.height/=e,this.initialize(i.x,i.y,i.width,i.height)}static addPointToSize(n,e){let i=t.copy(n);return i.width+=e.x,i.height+=e.y,this.initialize(i.x,i.y,i.width,i.height)}static union(n){return!n||n.length===0?null:n.reduce((e,i)=>{let o=Math.min(e.x,i.x),r=Math.min(e.y,i.y),a=Math.max(e.x+e.width,i.x+i.width),s=Math.max(e.y+e.height,i.y+i.height);return t.initialize(o,r,a-o,s-r)},n[0])}static elementTransform(n,e){let i=e.getBoundingClientRect(),o=A.sub(n,A.initialize(i.left,i.top));return t.initialize(o.x,o.y,n.width,n.height)}static updateIsNotFinite(n){return!Number.isFinite(n.width)||!Number.isFinite(n.height)||!Number.isFinite(n.x)||!Number.isFinite(n.y)?t.initialize(0,0,0,0):n}};function f0(t,n){let e=Math.max(t.width,n),i=Math.max(t.height,n),o=(e-t.width)/2,r=(i-t.height)/2;return G.initialize(t.x-o,t.y-r,e,i)}function Kf(t,n){t=G.updateIsNotFinite(t),n.setAttribute("x",t.x.toString()),n.setAttribute("y",t.y.toString()),n.setAttribute("width",t.width.toString()),n.setAttribute("height",t.height.toString())}function h0(t,n){t=G.updateIsNotFinite(t),n.setAttribute("viewBox",`${t.x} ${t.y} ${t.width} ${t.height}`)}var ze=class t{constructor(n=0,e=0,i=0,o=0,r=0,a=0,s=0,c=0){this.x=n,this.y=e,this.width=i,this.height=o,this.radius1=r,this.radius2=a,this.radius3=s,this.radius4=c,this.gravityCenter=A.initialize(),this.gravityCenter=this.calculateGravityCenter(this)}calculateGravityCenter(n){return new Z(n.x+n.width/2,n.y+n.height/2)}static fromRect(n){return new t(n.x,n.y,n.width,n.height)}static fromRoundedRect(n){return new t(n.x,n.y,n.width,n.height,n.radius1,n.radius2,n.radius3,n.radius4)}static fromCenter(n,e,i){return new t(n.gravityCenter.x-e/2,n.gravityCenter.y-i/2,e,i,n.radius1,n.radius2,n.radius3,n.radius4)}static fromPoint(n){return new t(n.x,n.y)}addPoint(n){let e=t.fromRoundedRect(this);return e.x+=n.x,e.y+=n.y,e.gravityCenter=this.calculateGravityCenter(e),e}},tt=class t{static initialize(n=0,e=0){return{width:n,height:e}}static isEqual(n,e){return n.width===e.width&&n.height===e.height}static offsetFromElement(n){if(n instanceof SVGGraphicsElement){let e=n.getBBox();return t.initialize(e.width,e.height)}else if(n instanceof HTMLElement)return t.initialize(n.offsetWidth,n.offsetHeight)}};function ik(){return{position:A.initialize(),scaledPosition:A.initialize(),scale:1,rotate:0}}function ok(t){let n;if(t){t=t.replace("matrix(",""),t=t.replace(")","");let e=t.split(" ");n={position:{x:Number(e[4]),y:Number(e[5])},scaledPosition:A.initialize(),scale:Number(e[0]),rotate:0}}return n}var Cn=class{static toString(n){let e=A.sum(n.position,n.scaledPosition);return`matrix(${n.scale}, 0, 0, ${n.scale}, ${e.x}, ${e.y})`}static fromString(n){return ok(n)}static default(){return ik()}},at=class t{static initialize(n=0,e=0){return A.initialize(n,e)}static fromPoints(n,e){return t.initialize(e.x-n.x,e.y-n.y)}static vectorLength(n){return Math.sqrt(t.magnitudeSquared(n))}static magnitudeSquared(n){return n.x*n.x+n.y*n.y}static dotProduct(n,e){return n.x*e.x+n.y*e.y}static crossProduct(n,e){return n.x*e.y-n.y*e.x}static subtract(n,e){return t.initialize(n.x-e.x,n.y-e.y)}static add(n,e){return t.initialize(n.x+e.x,n.y+e.y)}static scale(n,e){return t.initialize(n.x*e,n.y*e)}static angle(n,e){let i=Math.acos(Math.max(-1,Math.min(t.dotProduct(n,e)/(t.vectorLength(n)*t.vectorLength(e)),1)));return t.crossProduct(n,e)<0?-i:i}},$f=class{static parseRoundedRect(n){let e=Math.PI*.5,i=n.x,o=n.y,r=n.x+n.width,a=n.y+n.height,s=n.x+n.radius1,c=n.y+n.radius1,u=n.x+n.width-n.radius2,p=n.y+n.radius2,g=n.x+n.width-n.radius3,b=n.y+n.height-n.radius3,M=n.x+n.radius4,P=n.y+n.height-n.radius4;return[new Xn({x:s,y:c},n.radius1,n.radius1,2*e,3*e),new Zn({x:s,y:o},{x:u,y:o}),new Xn({x:u,y:p},n.radius2,n.radius2,3*e,4*e),new Zn({x:r,y:p},{x:r,y:b}),new Xn({x:g,y:b},n.radius3,n.radius3,0,e),new Zn({x:g,y:a},{x:M,y:a}),new Xn({x:M,y:P},n.radius4,n.radius4,e,2*e),new Zn({x:i,y:P},{x:i,y:c})]}},Di=class{static getRoundedRectIntersections(n,e,i){let o=$f.parseRoundedRect(i);for(let r of o)if(r instanceof Xn){let a=this.intersectArcWithLine(r,n,e);if(a.length>0)return a}else if(r instanceof Zn){let a=this.intersectLineSegments(n,e,r.point1,r.point2);if(a)return[a]}return[]}static getRoundedRectIntersectionsWithSVGPath(n,e){let i=n.getTotalLength(),o=[];for(let r=0;r<=i;r+=1){let a=n.getPointAtLength(r);o.push({x:a.x,y:a.y})}for(let r=1;r<o.length;r++){let a=this.getRoundedRectIntersections(o[r-1],o[r],e);if(a.length>0)return a}return[]}static intersectArcWithLine(n,e,i){return this.filterPointsWithinArc(this.findEllipseLineIntersections(n.center,n.radiusX,n.radiusY,e,i),n)}static intersectLineSegments(n,e,i,o){let r=e.x-n.x,a=e.y-n.y,s=o.x-i.x,c=o.y-i.y,u=(-a*(n.x-i.x)+r*(n.y-i.y))/(-s*a+r*c),p=(s*(n.y-i.y)-c*(n.x-i.x))/(-s*a+r*c);return u>=0&&u<=1&&p>=0&&p<=1?{x:n.x+p*r,y:n.y+p*a}:null}static filterPointsWithinArc(n,e){let{center:i,startAngle:o,endAngle:r}=e;if(n.length===0)return n;r<o&&([o,r]=[r,o]),(o<0||r<0)&&(o+=2*Math.PI,r+=2*Math.PI);let a=[];for(let s of n){let c=this.normalizeAngle(at.angle(at.initialize(1,0),at.initialize(s.x-i.x,s.y-i.y)));c<o&&(c+=2*Math.PI),o<=c&&c<=r&&a.push(s)}return a}static normalizeAngle(n){let e=n%(2*Math.PI);return e<0?e+2*Math.PI:e}static findEllipseLineIntersections(n,e,i,o,r){let a=at.initialize(o.x,o.y),s=at.fromPoints(o,r),c=at.initialize(n.x,n.y),u=at.subtract(a,c),p=at.initialize(s.x/(e*e),s.y/(i*i)),g=at.initialize(u.x/(e*e),u.y/(i*i)),b=at.dotProduct(s,p),M=at.dotProduct(s,g),P=at.dotProduct(u,g)-1,R=M*M-b*P;return R<0?[]:this.calculateIntersectionPoints(R,b,M,o,r)}static calculateIntersectionPoints(n,e,i,o,r){let a=[];if(n>0){let s=Math.sqrt(n),c=(-i-s)/e,u=(-i+s)/e;c>=0&&c<=1&&a.push(A.interpolatePoints(o,r,c)),u>=0&&u<=1&&a.push(A.interpolatePoints(o,r,u))}else{let s=-i/e;s>=0&&s<=1&&a.push(A.interpolatePoints(o,r,s))}return a}};var Yf=class{handle(n,e){let i=!0;if(this.validator&&(i=e.get(this.validator).handle(n)),!!i)return e.get(this.execution).handle(n)}execute(n,e){return e.get(this.execution).handle(n)}setValidator(n){this.validator=n}setExecution(n){this.execution=n}},D=class t{constructor(){this._injector=l(Ze)}static registerPipeline(n,e,i){if(!n||!n.fToken)throw new Error("Type must have a fToken static property.");let o=this.pipelines.get(n.fToken)||new Yf;i?o.setValidator(e):o.setExecution(e),this.pipelines.set(n.fToken,o)}send(n){let e=t.pipelines.get(n.constructor.fToken);if(e)return e.handle(n,this._injector);throw new Error("Handler not registered for request type.")}execute(n){return t.pipelines.get(n.constructor.fToken).execute(n,this._injector)}};D.pipelines=new Map;D.\u0275fac=function(n){return new(n||D)};D.\u0275prov=y({token:D,factory:D.\u0275fac});function w(t){return function(n){D.registerPipeline(t,n,!1)}}var rk=(()=>{class t{setItem(e,i){localStorage.setItem(e,i)}getItem(e){return localStorage.getItem(e)}removeItem(e){localStorage.removeItem(e)}clear(){localStorage.clear()}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),ak=(()=>{class t{storage={};setItem(e,i){this.storage[e]=i}getItem(e){return this.storage[e]||null}removeItem(e){delete this.storage[e]}clear(){this.storage={}}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),sk=new ue("F_LOCAL_STORAGE",{providedIn:"root",factory:()=>cn(l(jr))?l(rk):l(ak)}),ck=(()=>{class t{getComputedStyle(e){return window.getComputedStyle(e)}get innerWidth(){return window.innerWidth}get innerHeight(){return window.innerHeight}get pageXOffset(){return window.pageXOffset}get pageYOffset(){return window.pageYOffset}isMediaQuery(e){return window.matchMedia(e).matches}requestAnimationFrame(e){return window.requestAnimationFrame(e)}get location(){return window.location}open(e,i,o){window.open(e,i,o)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),dk=(()=>{class t{getComputedStyle(e){return new Proxy({getPropertyValue:i=>"0"},{get:(i,o)=>o==="getPropertyValue"?i.getPropertyValue:"0"})}get innerWidth(){return 0}get innerHeight(){return 0}get pageXOffset(){return 0}get pageYOffset(){return 0}isMediaQuery(e){return!1}requestAnimationFrame(e){return setTimeout(e,0)}get location(){return{href:"",pathname:"",search:"",hash:"",origin:""}}open(e,i,o){}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),lk=new ue("F_WINDOW",{providedIn:"root",factory:()=>cn(l(jr))?l(ck):l(dk)}),bn=(function(t){return t.MAC_OS="macos",t.IOS="ios",t.WINDOWS="windows",t.ANDROID="android",t.LINUX="linux",t})(bn||{}),Xf;try{Xf=typeof Intl<"u"&&Intl.v8BreakIterator}catch{Xf=!1}var Zf=(()=>{class t{_platformId;isBrowser=!1;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!!(window.chrome||Xf)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(e){this._platformId=e,this.isBrowser=this._platformId?cn(this._platformId):typeof document=="object"&&!!document}getOS(){let e=navigator.userAgent.toLowerCase(),i=/(macintosh|macintel|macppc|mac68k|macos)/i,o=/(win32|win64|windows|wince)/i,r;return i.test(e)?r=bn.MAC_OS:this.IOS?r=bn.IOS:o.test(e)?r=bn.WINDOWS:this.ANDROID?r=bn.ANDROID:!r&&/linux/.test(e)&&(r=bn.LINUX),r}static \u0275fac=function(i){return new(i||t)(bi(jr))};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),qe=(()=>{class t{injectedDocument;windowService;localStorageService;platformService;constructor(e,i,o,r){this.injectedDocument=e,this.windowService=i,this.localStorageService=o,this.platformService=r}isBrowser(){return this.platformService.isBrowser}get window(){return this.windowService}get localStorage(){return this.localStorageService}get document(){return this.injectedDocument}toPixels(e,i,o,r){if(e.endsWith("px"))return parseFloat(e);if(e.endsWith("%")){let a=parseFloat(e)/100;return Math.max(i,o)*a}else{if(e.endsWith("em"))return parseFloat(e)*parseFloat(r);if(e.endsWith("rem"))return parseFloat(e)*parseFloat(getComputedStyle(this.document.documentElement).fontSize);if(e.endsWith("vh")){let a=this.window.innerHeight/100;return parseFloat(e)*a}else if(e.endsWith("vw")){let a=this.window.innerWidth/100;return parseFloat(e)*a}}return parseFloat(e)||0}static \u0275fac=function(i){return new(i||t)(bi(Hr),bi(lk),bi(sk),bi(Zf))};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Qf(t,n){return t.reduce((e,i)=>[...e,...n(i)],[])}function Jf(t){let n=t.cloneNode(!0),e=n.querySelectorAll("[id]"),i=t.nodeName.toLowerCase();n.removeAttribute("id");for(let o=0;o<e.length;o++)e[o].removeAttribute("id");return i==="canvas"?_0(t,n):(i==="input"||i==="select"||i==="textarea")&&g0(t,n),m0("canvas",t,n,_0),m0("input, textarea, select",t,n,g0),n}function m0(t,n,e,i){let o=n.querySelectorAll(t);if(o.length){let r=e.querySelectorAll(t);for(let a=0;a<o.length;a++)i(o[a],r[a])}}var uk=0;function g0(t,n){n.type!=="file"&&(n.value=t.value),n.type==="radio"&&n.name&&(n.name=`mat-clone-${n.name}-${uk++}`)}function _0(t,n){let e=n.getContext("2d");if(e)try{e.drawImage(t,0,0)}catch{}}function eh(t,n,e){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];o?t.setProperty(i,o,e?.has(i)?"important":""):t.removeProperty(i)}return t}function v0(t){eh(t.style,{"touch-action":"none","-webkit-user-drag":"none","-webkit-tap-highlight-color":"transparent","user-select":"none","-ms-user-select":"none","-webkit-user-select":"none","-moz-user-select":"none"})}function y0(t,n,e){return pk(t,e).dataset[n]}function pk(t,n){return t.closest(n)}function th(t,n){let e=t.rootNodes;if(e.length===1&&e[0].nodeType===n.ELEMENT_NODE)return e[0];let i=n.createElement("div");return e.forEach(o=>i.appendChild(o)),i}function So(t,n){let e=fk(t,n);return!!e&&!e.classList.contains(n+"-disabled")}function fk(t,n){return t.closest(n)}function Zt(t){return t.match(/^[a-zA-Z_]/)||(t="_"+t),t.replace(/[^a-zA-Z0-9_\-:.]/g,"_")}function Oi(t,n,e){let i=e[t.toUpperCase()]||hk(e,t.toLowerCase());if(i===void 0)throw new Error(`Unknown ${n}: ${t}. Accepted values: ${Object.keys(e).join(", ")}`);return i}function hk(t,n){return Object.keys(t).find(e=>t[e]===n)}var mk=["markerElement"],gk=["fConnectionGradientRenderer",""],_k=["f-connection-path",""],vk=["fConnectionSelection",""],yk=["f-connection-drag-handle-start",""],Ck=["f-connection-drag-handle-end",""],bk=["defs"],xk=["*"],wk=["fGroupsContainer"],Sk=["fNodesContainer"],Ik=["fConnectionsContainer"],Tk=[[["","fGroup",""],["","fGroups",""]],[["f-snap-connection"]],[["f-connection"],["","fConnections",""]],[["f-connection-for-create"]],[["","fNode",""],["","fNodes",""]]],Ek=["[fGroup], [fGroups]","f-snap-connection","f-connection, [fConnections]","f-connection-for-create","[fNode], [fNodes]"],Pk=[[["svg","fMarker",""]],[["f-connection-marker-circle"],["f-connection-marker-arrow"]],[["f-connection-gradient"]],[["f-connection-waypoints"]],[["","fConnectionContent",""]]],Mk=["svg[fMarker]","f-connection-marker-circle, f-connection-marker-arrow","f-connection-gradient","f-connection-waypoints","[fConnectionContent]"];function kk(t,n){t&1&&($e(),O(0,"linearGradient",3)),t&2&&E("fConnectionGradientRendererFor",n)}function Dk(t,n){t&1&&($e(),O(0,"circle",6))}function Ok(t,n){t&1&&ke(0,4)}var Nk="[_nghost-%COMP%]{display:block;position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;pointer-events:none;-webkit-user-select:none;user-select:none}",Rk=[[["","fDefinitions",""]],[["f-background"]],[["f-line-alignment"]],[["f-canvas"]],[["f-selection-area"]],"*"],Ak=["[fDefinitions]","f-background","f-line-alignment","f-canvas","f-selection-area","*"],ah=new ue("F_BACKGROUND_PATTERN"),Hd=class{fPattern;static fToken=Symbol("AddPatternToBackgroundRequest");constructor(n){this.fPattern=n}},Li=class{_items=[];_byId=new Map;get(n){return this._byId.get(n)}require(n){let e=this._byId.get(n);if(!e)throw new Error(`${this.kind} not found: ${n}`);return e}has(n){return this._byId.has(n)}getAll(){return this._items}size(){return this._items.length}add(n){let e=n.fId();if(this._byId.has(e))throw new Error(`${this.kind} already exists: ${e}`);this._items.push(n),this._byId.set(e,n)}addMany(n){for(let e of n)this.add(e)}remove(n){let e=n.fId(),i=this._byId.get(e);if(!i)return!1;this._byId.delete(e);let o=this._items.indexOf(i);return o>=0&&this._items.splice(o,1),!0}removeById(n){let e=this._byId.get(n);if(!e)return;this._byId.delete(n);let i=this._items.indexOf(e);return i>=0&&this._items.splice(i,1),e}clear(){this._items.length=0,this._byId.clear()}};function Qn(t){return{name:t}}var sh=class{_instances=new Map;get(n){return this._instances.get(n.name)}require(n){let e=this.get(n);if(!e)throw new Error(`Instance not found: ${n.name}`);return e}has(n){return this._instances.has(n.name)}add(n,e){if(this._instances.has(n.name))throw new Error(`${n.name} already exists`);this._instances.set(n.name,e)}remove(n){if(!this._instances.has(n.name))throw new Error(`${n.name} does not exist`);return this._instances.delete(n.name),!0}clear(){this._instances.clear()}},To=class extends Li{kind;constructor(n){super(),this.kind=n}},ch=class extends Li{kind="Connection Marker"},dh=class extends Li{kind="Connection";_instancesForCreate;_instancesForSnap;getForSnap(){return this._instancesForSnap}getForCreate(){return this._instancesForCreate}addForCreate(n){this._instancesForCreate=n}addForSnap(n){this._instancesForSnap=n}removeInstanceForCreate(){this._instancesForCreate=void 0}removeInstanceForSnap(){this._instancesForSnap=void 0}},lh=class extends Li{kind="Node"},Ri=class{notifyOnSubscribe;static fToken=Symbol("ListenConnectionsChangesRequest");constructor(n=!0){this.notifyOnSubscribe=n}};function Fk(){return t=>{let n=null,e=null,i=()=>{n!==null&&cancelAnimationFrame(n),e!==null&&cancelAnimationFrame(e),n=e=null};return{callback:()=>{i(),n=requestAnimationFrame(()=>{n=null,e=requestAnimationFrame(()=>{e=null,t()})})},cleanup:i}}}function Lk(){return t=>{let n=null;return{callback:()=>{n!==null&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{n=null,t()})},cleanup:()=>{n!==null&&cancelAnimationFrame(n),n=null}}}}function jd(t){return n=>{let e=null;return{callback:()=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{e=null,n()},t)},cleanup:()=>{e!==null&&clearTimeout(e),e=null}}}}var Ct=class{_listeners=new Set;notify(){this._listeners.forEach(n=>n())}listen(n){return this._listeners.add(n),()=>this.stop(n)}stop(n){this._listeners.delete(n)}},uh=class extends Ct{_htmlElement;_observer=new ResizeObserver(()=>this.notify());_isObserving=!1;constructor(n){super(),this._htmlElement=n}listen(n){return this._isObserving||(this._observer.observe(this._htmlElement),this._isObserving=!0),super.listen(n)}stop(n){super.stop(n),this._listeners.size===0&&this._disconnect()}_disconnect(){this._observer.unobserve(this._htmlElement),this._observer.disconnect(),this._isObserving=!1}},Bt=class t{_channels=[];_operators=[];constructor(...n){this._channels=[...n]}pipe(...n){let e=new t(...this._channels);return e._operators=[...this._operators,...n],e}listen(n,e){let i=e,o=[],r=[],a=[];for(let g of[...this._operators].reverse()){let b=g(i);i=b.callback,b.cleanup&&o.push(b.cleanup),b.onSubscribe&&r.push(b.onSubscribe),b.setTeardown&&a.push(b.setTeardown)}let s=this._channels.map(g=>g.listen(()=>i())),c=null,u=!1,p=()=>{u||(u=!0,c?.(),c=null,s.forEach(g=>g()),o.forEach(g=>g()))};a.slice().reverse().forEach(g=>g(p)),r.slice().reverse().forEach(g=>g(i)),c=n.onDestroy(p)}};function Cp(){return t=>{let n=!0;return{callback:t,onSubscribe:e=>{queueMicrotask(()=>{n&&e()})},cleanup:()=>{n=!1}}}}function C0(){return t=>{let n=!1,e=null;return{setTeardown:i=>e=i,callback:()=>{if(!n){n=!0;try{t()}finally{e?.()}}}}}}var Bk=(()=>{let t=class Ca{_store=l(k);handle({notifyOnSubscribe:e}){return e?new Bt(this._store.connectionsChanges$).pipe(Cp(),jd(1)):new Bt(this._store.connectionsChanges$).pipe(jd(1))}static \u0275fac=function(i){return new(i||Ca)};static \u0275prov=y({token:Ca,factory:Ca.\u0275fac})};return t=x([w(Ri)],t),t})(),ph=class{static fToken=Symbol("ListenNodesChangesRequest")},zk=(()=>{let t=class ba{_store=l(k);handle(e){return new Bt(this._store.nodesChanges$)}static \u0275fac=function(i){return new(i||ba)};static \u0275prov=y({token:ba,factory:ba.\u0275fac})};return t=x([w(ph)],t),t})(),Ud=class{static fToken=Symbol("ListenTransformChangesRequest")},qk=(()=>{let t=class xa{_store=l(k);handle(e){return new Bt(this._store.transformChanges$,this._store.connectionsChanges$,this._store.nodesChanges$)}static \u0275fac=function(i){return new(i||xa)};static \u0275prov=y({token:xa,factory:xa.\u0275fac})};return t=x([w(Ud)],t),t})(),Jn=class{static fToken=Symbol("EmitConnectionsChangesRequest")},Vk=(()=>{let t=class wa{_store=l(k);handle(e){this._store.emitConnectionChanges()}static \u0275fac=function(i){return new(i||wa)};static \u0275prov=y({token:wa,factory:wa.\u0275fac})};return t=x([w(Jn)],t),t})(),In=class{static fToken=Symbol("NotifyTransformChangedRequest")},k=(()=>{class t{transformChanges$=new Ct;viewportAnimationChanges$=new Ct;connectionsChanges$=new Ct;_connectionsRevision=0;connectionsRenderedChanges$=new Ct;_connectionsRenderedRevision=0;_connectionsRenderedNodesRevision=0;_viewportAnimationCount=0;nodesChanges$=new Ct;_nodesRevision=0;progressiveRenderChanges$=new Ct;_pendingProgressiveRenderCount=0;get connectionsRevision(){return this._connectionsRevision}get connectionsRenderedRevision(){return this._connectionsRenderedRevision}get connectionsRenderedNodesRevision(){return this._connectionsRenderedNodesRevision}get nodesRevision(){return this._nodesRevision}get hasPendingProgressiveRender(){return this._pendingProgressiveRenderCount>0}get isViewportAnimating(){return this._viewportAnimationCount>0}get flowHost(){return this.fFlow?.hostElement}fFlow;fCanvas;get transform(){return this.fCanvas?.transform}nodes=new lh;connections=new dh;connectionMarkers=new ch;outputs=new To("Output");inputs=new To("Input");outlets=new To("Outlet");instances=new sh;fDraggable;emitNodeChanges(){this._nodesRevision++,this.nodesChanges$.notify()}emitConnectionChanges(){this._connectionsRevision++,this.connectionsChanges$.notify()}completeConnectionsRender(e,i){e<this._connectionsRenderedRevision||e===this._connectionsRenderedRevision&&i<=this._connectionsRenderedNodesRevision||(this._connectionsRenderedRevision=Math.min(e,this._connectionsRevision),this._connectionsRenderedNodesRevision=i,this.connectionsRenderedChanges$.notify())}beginProgressiveRender(){this._pendingProgressiveRenderCount++,this.progressiveRenderChanges$.notify()}endProgressiveRender(){this._pendingProgressiveRenderCount&&(this._pendingProgressiveRenderCount--,this.progressiveRenderChanges$.notify())}transformChanged(){this.transformChanges$.notify()}beginViewportAnimation(){this._viewportAnimationCount++,this.viewportAnimationChanges$.notify()}endViewportAnimation(){this._viewportAnimationCount&&(this._viewportAnimationCount--,this.viewportAnimationChanges$.notify())}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Ie={MAGNETIC_LINES:Qn("magnetic-lines"),MAGNETIC_RECTS:Qn("magnetic-rects"),ZOOM:Qn("zoom-controls"),BACKGROUND:Qn("background"),SELECTION_AREA:Qn("selection-area"),MINIMAP:Qn("minimap"),AUTO_PAN:Qn("auto-pan")},Gk=(()=>{let t=class Sa{_store=l(k);handle(e){this._store.transformChanged()}static \u0275fac=function(i){return new(i||Sa)};static \u0275prov=y({token:Sa,factory:Sa.\u0275fac})};return t=x([w(In)],t),t})(),Tn=class{key;instance;static fToken=Symbol("RegisterPluginInstanceRequest");constructor(n,e){this.key=n,this.instance=e}},Hk=(()=>{let t=class Ia{_store=l(k);handle({key:e,instance:i}){this._store.instances.add(e,i)}static \u0275fac=function(i){return new(i||Ia)};static \u0275prov=y({token:Ia,factory:Ia.\u0275fac})};return t=x([w(Tn)],t),t})(),En=class{key;static fToken=Symbol("RemovePluginInstanceRequest");constructor(n){this.key=n}},jk=(()=>{let t=class Ta{_store=l(k);handle({key:e}){this._store.instances.remove(e)}static \u0275fac=function(i){return new(i||Ta)};static \u0275prov=y({token:Ta,factory:Ta.\u0275fac})};return t=x([w(En)],t),t})(),Uk=[k,zk,Bk,qk,Vk,Gk,Hk,jk],Wk=0,$k=(()=>{let t=class Ea{_store=l(k);_browser=l(qe);get _backgroundElement(){return this._store.instances.get(Ie.BACKGROUND)?.hostElement}handle(e){let i=this._getPatterns(e.fPattern?.hostElement);if(!i?.length)return;let o=Fi("defs",this._browser);if(e.fPattern?.hostElement.remove(),i.forEach(r=>{o.append(r)}),i.length){this._backgroundElement?.firstChild?.appendChild(o),i[i.length-1].id="f-background-pattern-"+Wk++;let r=i[i.length-1].id,a=Fi("rect",this._browser);a.setAttribute("fill","url(#"+r+")"),a.setAttribute("width","100%"),a.setAttribute("height","100%"),this._backgroundElement?.firstChild?.appendChild(a);let s=this._store.fCanvas?.transform||Cn.default();e.fPattern?.setTransform(s)}}_getPatterns(e){return Array.from(e?.getElementsByTagName("pattern")||[])}static \u0275fac=function(i){return new(i||Ea)};static \u0275prov=y({token:Ea,factory:Ea.\u0275fac})};return t=x([w(Hd)],t),t})(),Eo=class{fTransform;static fToken=Symbol("SetBackgroundTransformRequest");constructor(n){this.fTransform=n}},Kk=(()=>{let t=class Pa{_store=l(k);handle(e){this._store.instances.get(Ie.BACKGROUND)?.setTransform(e.fTransform)}static \u0275fac=function(i){return new(i||Pa)};static \u0275prov=y({token:Pa,factory:Pa.\u0275fac})};return t=x([w(Eo)],t),t})(),Yk=[$k,Kk],Wd=class{instance;static fToken=Symbol("AddCanvasToStoreRequest");constructor(n){this.instance=n}},Xk=(()=>{let t=class Ma{_store=l(k);handle({instance:e}){this._store.fCanvas=e}static \u0275fac=function(i){return new(i||Ma)};static \u0275prov=y({token:Ma,factory:Ma.\u0275fac})};return t=x([w(Wd)],t),t})(),$d=class{id;animated;static fToken=Symbol("CenterGroupOrNodeRequest");constructor(n,e){this.id=n,this.animated=e}},Zk=(()=>{let t=class ka{_store=l(k);_mediator=l(D);get _transform(){return this._store.transform}handle({id:e,animated:i}){let o=this._store.nodes.get(e);o&&(this._toCenter(this._getNodeRect(o),this._getFlowRect(),o._position),this._mediator.execute(new Bi(i,ei.VIEWPORT_ONLY)))}_toCenter(e,i,o){this._transform.scaledPosition=A.initialize(),this._transform.position=A.initialize((i.width-e.width)/2-o.x*this._transform.scale,(i.height-e.height)/2-o.y*this._transform.scale)}_getNodeRect(e){return G.fromElement(e.hostElement)}_getFlowRect(){return G.fromElement(this._store.flowHost)}static \u0275fac=function(i){return new(i||ka)};static \u0275prov=y({token:ka,factory:ka.\u0275fac})};return t=x([w($d)],t),t})(),Kd=class{toCenter;animated;static fToken=Symbol("FitToFlowRequest");constructor(n,e){this.toCenter=n,this.animated=e}},Qk=(()=>{let t=class Da{_store=l(k);get _transform(){return this._store.transform}_mediator=l(D);handle({toCenter:e,animated:i}){let o=this._mediator.execute(new Ui)||G.initialize();o.width===0||o.height===0||(this.fitToParent(o,G.fromElement(this._store.flowHost),this._store.nodes.getAll().map(r=>r._position),e),this._mediator.execute(new Bi(i,ei.VIEWPORT_ONLY)))}fitToParent(e,i,o,r){this._transform.scaledPosition=A.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let a=e.width/this._transform.scale+r.x,s=e.height/this._transform.scale+r.y;(a>i.width||s>i.height||a<i.width&&s<i.height)&&(this._transform.scale=Math.min(i.width/a,i.height/s));let c=(i.width-a*this._transform.scale)/2-this._transform.position.x*this._transform.scale,u=(i.height-s*this._transform.scale)/2-this._transform.position.y*this._transform.scale;this._transform.position=A.initialize(c+r.x/2*this._transform.scale,u+r.y/2*this._transform.scale)}_getZeroPositionWithoutScale(e){let i=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return A.initialize(i,o)}static \u0275fac=function(i){return new(i||Da)};static \u0275prov=y({token:Da,factory:Da.\u0275fac})};return t=x([w(Kd)],t),t})(),Yd=class{transform;position;static fToken=Symbol("InputCanvasPositionRequest");constructor(n,e){this.transform=n,this.position=e}},Jk=(()=>{let t=class Oa{_store=l(k);handle({transform:e,position:i}){i&&(A.isEqual(this._calculateTransformPosition(e),i)||(e.position=i,e.scaledPosition=A.initialize(),this._store.fCanvas?.redraw()))}_calculateTransformPosition(e){return A.sum(e.position,e.scaledPosition)}static \u0275fac=function(i){return new(i||Oa)};static \u0275prov=y({token:Oa,factory:Oa.\u0275fac})};return t=x([w(Yd)],t),t})(),Xd=class{transform;scale;static fToken=Symbol("InputCanvasScaleRequest");constructor(n,e){this.transform=n,this.scale=e}},eD=(()=>{let t=class Na{_store=l(k);handle(e){!e.scale&&e.scale!==0||(e.transform.scale=e.scale,this._store.fCanvas?.redraw())}static \u0275fac=function(i){return new(i||Na)};static \u0275prov=y({token:Na,factory:Na.\u0275fac})};return t=x([w(Xd)],t),t})(),ei=(function(t){return t.VIEWPORT_ONLY="VIEWPORT_ONLY",t.WITH_CONNECTION_CHANGES="WITH_CONNECTION_CHANGES",t})(ei||{}),Bi=class{animated;context;static fToken=Symbol("RedrawCanvasWithAnimationRequest");constructor(n,e=ei.WITH_CONNECTION_CHANGES){this.animated=n,this.context=e}};function $0(t,n){let e=i=>{i.propertyName==="transform"&&(t.removeEventListener("transitionend",e),n(i))};t.addEventListener("transitionend",e)}var tD=(()=>{let t=class Ra{_store=l(k);get _canvas(){return this._store.fCanvas}handle(e){e.animated?this._redrawWithAnimation(e.context):this._redraw(e.context),this._canvas?.emitCanvasChangeEvent()}_redrawWithAnimation(e){this._store.beginViewportAnimation(),this._canvas?.redrawWithAnimation(),$0(this._canvas.hostElement,()=>{this._store.endViewportAnimation(),e===ei.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()})}_redraw(e){this._canvas?.redraw(),e===ei.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()}static \u0275fac=function(i){return new(i||Ra)};static \u0275prov=y({token:Ra,factory:Ra.\u0275fac})};return t=x([w(Bi)],t),t})(),Zd=class{static fToken=Symbol("RemoveCanvasFromStoreRequest")},nD=(()=>{let t=class Aa{_store=l(k);handle(e){this._store.fCanvas=void 0}static \u0275fac=function(i){return new(i||Aa)};static \u0275prov=y({token:Aa,factory:Aa.\u0275fac})};return t=x([w(Zd)],t),t})(),Qd=class{static fToken=Symbol("ResetScaleRequest")},iD=(()=>{let t=class Fa{_store=l(k);get _transform(){return this._store.transform}handle(e){this._transform.scale=1,this._transform.scaledPosition=A.initialize()}static \u0275fac=function(i){return new(i||Fa)};static \u0275prov=y({token:Fa,factory:Fa.\u0275fac})};return t=x([w(Qd)],t),t})(),Jd=class{animated;static fToken=Symbol("ResetScaleAndCenterRequest");constructor(n){this.animated=n}},oD=(()=>{let t=class La{_mediator=l(D);_store=l(k);get _transform(){return this._store.transform}handle({animated:e}){let i=this._mediator.execute(new Ui)||G.initialize();i.width===0||i.height===0||(this._oneToOneCentering(i,G.fromElement(this._store.flowHost),this._store.nodes.getAll().map(o=>o._position)),this._mediator.execute(new Bi(e,ei.VIEWPORT_ONLY)))}_oneToOneCentering(e,i,o){this._transform.scaledPosition=A.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let r=(i.width-e.width/this._transform.scale)/2-this._transform.position.x,a=(i.height-e.height/this._transform.scale)/2-this._transform.position.y;this._transform.scale=1,this._transform.position=A.initialize(r,a)}_getZeroPositionWithoutScale(e){let i=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return A.initialize(i,o)}static \u0275fac=function(i){return new(i||La)};static \u0275prov=y({token:La,factory:La.\u0275fac})};return t=x([w(Jd)],t),t})(),el=class{scale;toPosition;static fToken=Symbol("UpdateScaleRequest");constructor(n,e){this.scale=n,this.toPosition=e}},rD=(()=>{let t=class Ba{_store=l(k);get _transform(){return this._store.transform}handle({scale:e,toPosition:i}){if(e===this._transform.scale)return;let o=A.sum(this._transform.scaledPosition,this._transform.position),r=i.x-(i.x-o.x)*e/this._transform.scale,a=i.y-(i.y-o.y)*e/this._transform.scale;this._transform.scale=e,this._transform.scaledPosition=A.sub(A.initialize(r,a),this._transform.position)}static \u0275fac=function(i){return new(i||Ba)};static \u0275prov=y({token:Ba,factory:Ba.\u0275fac})};return t=x([w(el)],t),t})(),aD=[Xk,Zk,Qk,Jk,eD,tD,nD,iD,oD,rD],fh=class{connection;static fToken=Symbol("AddConnectionForCreateToStoreRequest");constructor(n){this.connection=n}},sD=(()=>{let t=class za{_store=l(k);handle({connection:e}){this._store.connections.addForCreate(e)}static \u0275fac=function(i){return new(i||za)};static \u0275prov=y({token:za,factory:za.\u0275fac})};return t=x([w(fh)],t),t})(),tl=class{instance;static fToken=Symbol("AddConnectionMarkerToStoreRequest");constructor(n){this.instance=n}},cD=(()=>{let t=class qa{_store=l(k);handle({instance:e}){this._store.connectionMarkers.add(e),this._store.emitNodeChanges()}static \u0275fac=function(i){return new(i||qa)};static \u0275prov=y({token:qa,factory:qa.\u0275fac})};return t=x([w(tl)],t),t})(),nl=class{connection;static fToken=Symbol("AddConnectionToStoreRequest");constructor(n){this.connection=n}},dD=(()=>{let t=class Va{_store=l(k);handle({connection:e}){this._store.connections.add(e),this._store.emitConnectionChanges()}static \u0275fac=function(i){return new(i||Va)};static \u0275prov=y({token:Va,factory:Va.\u0275fac})};return t=x([w(nl)],t),t})(),hh=class{connection;static fToken=Symbol("AddSnapConnectionToStoreRequest");constructor(n){this.connection=n}},lD=(()=>{let t=class Ga{_store=l(k);handle({connection:e}){this._store.connections.addForSnap(e)}static \u0275fac=function(i){return new(i||Ga)};static \u0275prov=y({token:Ga,factory:Ga.\u0275fac})};return t=x([w(hh)],t),t})(),zi=class{connection;static fToken=Symbol("CreateConnectionMarkersRequest");constructor(n){this.connection=n}},b0=new ue("F_CONNECTION_CONTENT");var il=class t{points;cumulativeLengths;segmentTangents;totalLength;constructor(n){let e=t._removeConsecutiveDuplicates(n);if(e.length<2){this.points=[{x:0,y:0},{x:1,y:0}],this.cumulativeLengths=[0,1],this.segmentTangents=[{x:1,y:0}],this.totalLength=1;return}this.points=e;let i=this.points.length,o=i-1,r=new Array(i).fill(0),a=new Array(o),s=0;for(let c=0;c<o;c++){let u=this.points[c+1].x-this.points[c].x,p=this.points[c+1].y-this.points[c].y,g=Math.hypot(u,p),b=g?u/g:1,M=g?p/g:0;a[c]={x:b,y:M},s+=g,r[c+1]=s}this.cumulativeLengths=r,this.segmentTangents=a,this.totalLength=s||1}static from(n){return new t(n.map(e=>({x:e.x,y:e.y})))}static _removeConsecutiveDuplicates(n){let e=[];for(let i of n){let o=e[e.length-1];(!o||o.x!==i.x||o.y!==i.y)&&e.push({x:i.x,y:i.y})}return e}},mh=class t{_polyline;constructor(n=[]){this._polyline=new il(n)}updatePoints(n){return this._polyline=new il(n),this._polyline.totalLength}calculateTotalLength(n){return this.updatePoints(n)}get totalLength(){return this._polyline.totalLength}getPointAtProgress(n){let{points:e,cumulativeLengths:i,segmentTangents:o,totalLength:r}=this._polyline,s=t._clamp(n,0,1)*r,c=.5;if(s<=c)return{point:e[0],tangent:o[0]??{x:1,y:0},atEdge:!0};if(r-s<=c){let j=e.length-1;return{point:e[j],tangent:o[j-1]??{x:1,y:0},atEdge:!0}}let u=t._findRightIndex(i,s),p=Math.max(1,u),g=i[p-1],b=i[p],M=t._safeRatio(s-g,b-g),P=e[p-1],R=e[p],H={x:t._lerp(P.x,R.x,M),y:t._lerp(P.y,R.y,M)},z=o[p-1]??{x:1,y:0};return{point:H,tangent:z,atEdge:!1}}getPointAtLength(n){return this.getPointAtProgress(n)}getPointAtDistance(n){let e=this._polyline.totalLength?n/this._polyline.totalLength:0;return this.getPointAtProgress(e)}static _findRightIndex(n,e){let i=0,o=n.length-1;for(;i<o;){let r=i+o>>1;n[r]<e?i=r+1:o=r}return i}static _lerp(n,e,i){return n+(e-n)*i}static _clamp(n,e,i){return n<e?e:n>i?i:n}static _safeRatio(n,e){let i=Math.abs(e)<1e-6?1e-6:e;return n/i}},K0=(function(t){return t.NONE="none",t.ALONG="along",t})(K0||{}),gh=class{compute(n,e){let i=this._clamp01(e.position()),{point:o,tangent:r}=n.getPointAtLength(i),a={x:-r.y,y:r.x},s=e.offset()??0,c=o.x+a.x*s,u=o.y+a.y*s,g=this._sizeAlongDirection(e.hostElement,r)*.5,b=i*n.totalLength,M=n.totalLength-b,P=this._applyEdgeGuard(c,u,r,b,M,g),R=this._calculateContentRotation(e.align(),r);return{position:P,rotationDeg:R}}_clamp01(n){return n<=0?0:n>=1?1:n}_applyEdgeGuard(n,e,i,o,r,a){if(o<=a){let s=a-o;return{x:n+i.x*s,y:e+i.y*s}}if(r<=a){let s=a-r;return{x:n-i.x*s,y:e-i.y*s}}return{x:n,y:e}}_sizeAlongDirection(n,e){let i=G.fromElement(n);return Math.abs(e.x)*i.width+Math.abs(e.y)*i.height}_normalize180(n){let e=(n+180)%360;return e<0&&(e+=360),e-180}_keepUpright(n){let e=this._normalize180(n);return e>90?e-=180:e<-90&&(e+=180),e}_calculateContentRotation(n,e){let i=0;return n===K0.ALONG&&(i=Math.atan2(e.y,e.x)*180/Math.PI,i=this._keepUpright(i)),i}},_h=class{_placement;constructor(n=new gh){this._placement=n}layout(n,e){let i=new mh(n),o=i.totalLength;for(let r of e){let{position:a,rotationDeg:s}=this._placement.compute(i,r);r.hostElement.style.transform=this._createTransformString(a,s)}return o}_createTransformString(n,e){return`translate3d(${n.x}px, ${n.y}px, 0) translate(-50%, -50%) rotate(${e}deg)`}};var x0=new ue("F_CONNECTION_WAYPOINTS");function Y0(t,n,e){return(t.x-n.x)**2+(t.y-n.y)**2<=e**2}function uD(t,n){let e=t.fWaypoints(),i=e?.radius()||8;return e?.candidates().find(o=>Y0(n,o,i))}function pD(t,n){let e=t.fWaypoints(),i=e?.radius()||8;return e?.waypoints().find(o=>Y0(n,o,i))}function fD(t,n){for(let e of t){let i=pD(e,n);if(i&&e.fWaypoints()?.visibility())return{connection:e,waypoint:i};let o=uD(e,n);if(o&&e.fWaypoints()?.visibility())return{connection:e,candidate:o}}}var bp=new ue("F_CONNECTION_COMPONENTS_PARENT");var ge=(function(t){return t.START="f-connection-marker-start",t.END="f-connection-marker-end",t.SELECTED_START="f-connection-selected-marker-start",t.SELECTED_END="f-connection-selected-marker-end",t.START_ALL_STATES="f-connection-marker-start-all-states",t.END_ALL_STATES="f-connection-marker-end-all-states",t})(ge||{}),ol=new ue("F_CONNECTION_MARKER"),hD=0,rl=class{fId=U(`f-marker-${hD++}`);hostElement=l(Oe).nativeElement};function X0(t,n=ge.START){if(typeof t!="string")return n;let e=t.trim().toLowerCase();return e?mD(e)??n:n}function mD(t){switch(t){case"start":case"f-connection-marker-start":return ge.START;case"end":case"f-connection-marker-end":return ge.END;case"selected-start":case"f-connection-selected-marker-start":return ge.SELECTED_START;case"selected-end":case"f-connection-selected-marker-end":return ge.SELECTED_END;case"start-all-states":case"f-connection-marker-start-all-states":case"start-all":case"all-start":return ge.START_ALL_STATES;case"end-all-states":case"f-connection-marker-end-all-states":case"end-all":case"all-end":return ge.END_ALL_STATES;default:return null}}var Z0=(()=>{class t extends rl{_markerElement=Re.required("markerElement");_type=N(ge.END_ALL_STATES,{alias:"type",transform:e=>X0(e,ge.END_ALL_STATES)});get markerElement(){return this._markerElement().nativeElement}width=6;height=7;refX=5.5;refY=3.5;get type(){return this._type()}orient="auto";markerUnits="strokeWidth";static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-connection-marker-arrow"]],viewQuery:function(i,o){i&1&&Tt(o._markerElement,mk,5),i&2&<()},hostAttrs:[1,"f-component",2,"display","none"],inputs:{_type:[1,"type","_type"]},features:[_e([{provide:ol,useExisting:t}]),he],decls:3,vars:0,consts:[["markerElement",""],["viewBox","0 0 6 6",1,"f-marker"],["d","M0,0 L6,3 0,6Z"]],template:function(i,o){i&1&&($e(),W(0,"svg",1,0),Si(2,"path",2),$())},encapsulation:2})}return t})();var Q0=(()=>{class t extends rl{_mediator=l(D);markerElement=this.hostElement;width=0;height=0;refX=0;refY=0;type=ge.START;orient="auto";markerUnits="strokeWidth";ngOnInit(){this.hostElement.style.display="none",this._mediator.execute(new tl(this))}ngOnDestroy(){this._mediator.execute(new Pl(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275dir=Ee({type:t,selectors:[["svg","fMarker",""]],hostAttrs:[1,"f-component","f-marker"],inputs:{width:"width",height:"height",refX:"refX",refY:"refY",type:[2,"type","type",e=>X0(e,ge.START)],orient:"orient",markerUnits:"markerUnits"},standalone:!1,features:[_e([{provide:ol,useExisting:t}]),he]})}return t})(),wn=(function(t){return t.FIXED="fixed",t.FIXED_CENTER="fixed_center",t.FLOATING="floating",t})(wn||{}),Se=(function(t){return t.DEFAULT="default",t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right",t.CALCULATE="calculate",t.CALCULATE_HORIZONTAL="calculate_horizontal",t.CALCULATE_VERTICAL="calculate_vertical",t})(Se||{});function gD({sourceRect:t,targetRect:n}){return{point1:t.gravityCenter,point2:n.gravityCenter}}var F=(function(t){return t.LEFT="left",t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.CALCULATE="calculate",t.CALCULATE_HORIZONTAL="calculate_horizontal",t.CALCULATE_VERTICAL="calculate_vertical",t.AUTO="auto",t})(F||{}),Ni=(function(t){return t.SEGMENT="segment",t.STRAIGHT="straight",t.BEZIER="bezier",t.ADAPTIVE_CURVE="adaptive-curve",t})(Ni||{});function _D({sourceRect:t,sourceConnectableSide:n,targetRect:e,targetConnectableSide:i}){return{point1:w0(t,n===F.AUTO?F.BOTTOM:n),point2:w0(e,i===F.AUTO?F.TOP:i)}}function w0(t,n){switch(n){case F.TOP:return{x:t.x+t.width/2,y:t.y};case F.BOTTOM:return{x:t.x+t.width/2,y:t.y+t.height};case F.LEFT:return{x:t.x,y:t.y+t.height/2};case F.RIGHT:return{x:t.x+t.width,y:t.y+t.height/2};default:throw new Error(`Unknown side: ${n}`)}}function J0(t,n,e,i){if(!i||!i.rotationDeg)return Di.getRoundedRectIntersections(t,n,e)[0];let o=Ha(t,-i.rotationDeg,i.pivot),r=Ha(n,-i.rotationDeg,i.pivot),a=vD(e,-i.rotationDeg,i.pivot),s=Di.getRoundedRectIntersections(o,r,a)[0];return s?Ha(s,i.rotationDeg,i.pivot):void 0}function vD(t,n,e){let i=Ha(yD(t),n,e);return new ze(i.x-t.width/2,i.y-t.height/2,t.width,t.height,t.radius1,t.radius2,t.radius3,t.radius4)}function yD(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Ha(t,n,e){let i=t.x-e.x,o=t.y-e.y,r=n*Math.PI/180,a=Math.cos(r),s=Math.sin(r);return{x:i*a-o*s+e.x,y:i*s+o*a+e.y}}function CD({sourceRect:t,targetRect:n,sourceRotationContext:e,targetRotationContext:i}){return wD(bD(t,n,e),xD(t,n,i),t,n)}function bD(t,n,e){return J0(t.gravityCenter,n.gravityCenter,t,e)}function xD(t,n,e){return J0(n.gravityCenter,t.gravityCenter,n,e)}function wD(t,n,e,i){return{point1:t||e.gravityCenter,point2:n||i.gravityCenter}}var va=.5,SD={[wn.FLOATING]:CD,[wn.FIXED_CENTER]:gD,[wn.FIXED]:_D},Zi=(()=>{class t{handle(e){let i=this._calculateDirectionalVectors(e.sourceRect.gravityCenter.x,e.sourceRect.gravityCenter.y,e.targetRect.gravityCenter.x,e.targetRect.gravityCenter.y),o=this._determineSourceSide(e,i),r=this._determineTargetSide(e,i);return e.connection._applyResolvedSidesToConnection(o,r),this._getBehaviorHandler(e.connection.fBehavior)({sourceRect:e.sourceRect,targetRect:e.targetRect,sourceConnectableSide:o,targetConnectableSide:r,sourceRotationContext:e.sourceRotationContext,targetRotationContext:e.targetRotationContext})}_calculateDirectionalVectors(e,i,o,r){let a=o-e,s=r-i;return{sourceToTargetX:a,sourceToTargetY:s,targetToSourceX:-a,targetToSourceY:-s}}_determineSourceSide(e,i){return this._resolveConnectableSide(e.connection.fOutputSide(),i.sourceToTargetX,i.sourceToTargetY,e.sourceConnectableSide)}_determineTargetSide(e,i){return this._resolveConnectableSide(e.connection.fInputSide(),i.targetToSourceX,i.targetToSourceY,e.targetConnectableSide)}_resolveConnectableSide(e,i,o,r){if(e===Se.DEFAULT)return r;let a=Math.abs(i),s=Math.abs(o);if(a<va&&s<va)return r;let u=a>=s;switch(e){case Se.CALCULATE:return u?i>=0?F.RIGHT:F.LEFT:o>=0?F.BOTTOM:F.TOP;case Se.CALCULATE_HORIZONTAL:return a<va?r:i>=0?F.RIGHT:F.LEFT;case Se.CALCULATE_VERTICAL:return s<va?r:o>=0?F.BOTTOM:F.TOP;case Se.TOP:return F.TOP;case Se.BOTTOM:return F.BOTTOM;case Se.LEFT:return F.LEFT;case Se.RIGHT:return F.RIGHT;default:return r}}_getBehaviorHandler(e){let i=SD[e];if(!i)throw new Error(`[Behavior] No handler for behavior: ${e}`);return i}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Mt=class{sourceRect;targetRect;connection;sourceConnectableSide;targetConnectableSide;sourceRotationContext;targetRotationContext;constructor(n,e,i,o,r,a,s){this.sourceRect=n,this.targetRect=e,this.connection=i,this.sourceConnectableSide=o,this.targetConnectableSide=r,this.sourceRotationContext=a,this.targetRotationContext=s}};function xp(t,n,e){return[t,...e??[],n]}function ID(t,n){let e=Math.abs(n.x-t.x)/2,i=n.x<t.x?n.x+e:n.x-e,o=Math.abs(n.y-t.y)/2,r=n.y<t.y?n.y+o:n.y-o;return{x:i,y:r}}function TD(t,n=32){let e=new Array(n+1);e[0]=se({},t[0]);for(let i=1;i<=n;i++)e[i]=ev(t[0],t[1],t[2],t[3],i/n);return e}function ev(t,n,e,i,o){let r=1-o,a=o*o,s=r*r,c=s*r,u=a*o;return{x:c*t.x+3*s*o*n.x+3*r*a*e.x+u*i.x,y:c*t.y+3*s*o*n.y+3*r*a*e.y+u*i.y}}function tv(t){return t.map(n=>ev(n.p0,n.c1,n.c2,n.p3,.5))}function ED(t){if(t.length<2)throw new Error("Polylines must be at least two points");let n=PD(t);return n<=0?[se({},t[0])]:[MD(t,n/2)]}function PD(t){let n=0;for(let e=0;e<t.length-1;e++)n+=nv(t[e],t[e+1]);return n}function MD(t,n){let e=0;for(let o=0;o<t.length-1;o++){let r=t[o],a=t[o+1],s=nv(r,a);if(!(s<=0)){if(e+s>=n){let c=(n-e)/s;return{x:r.x+(a.x-r.x)*c,y:r.y+(a.y-r.y)*c}}e+=s}}let i=t[t.length-1];return{x:i.x,y:i.y}}function nv(t,n){return Math.hypot(n.x-t.x,n.y-t.y)}function kD(t){let n=[];for(let e of t)for(let i of e){let o=n[n.length-1];(!o||o.x!==i.x||o.y!==i.y)&&n.push(i)}return n}function iv(t){if(!t.length)return"";let n=`M ${t[0].p0.x} ${t[0].p0.y}`;for(let e=0;e<t.length;e++){let i=t[e],o=e===t.length-1,r=o?i.p3.x+2e-4:i.p3.x,a=o?i.p3.y+2e-4:i.p3.y;n+=` C ${i.c1.x} ${i.c1.y}, ${i.c2.x} ${i.c2.y}, ${r} ${a}`}return n}function ov(t,n=16){if(!t.length)return[];let e=[];for(let i=0;i<t.length;i++){let o=t[i],r=TD([o.p0,o.c1,o.c2,o.p3],n);i>0&&r.shift(),e.push(...r)}return e}function DD(t,n=1e-6){let e=t.length;if(e<=2)return t;let i=[];i.push(t[0]);for(let r=1;r<e;r++){let a=t[r],s=i[i.length-1];(Math.abs(a.x-s.x)>n||Math.abs(a.y-s.y)>n)&&i.push(a)}if(i.length<=2)return i;let o=[];o.push(i[0]);for(let r=1;r<i.length-1;r++){let a=o[o.length-1],s=i[r],c=i[r+1],u=Math.abs(a.x-s.x)<=n&&Math.abs(s.x-c.x)<=n,p=Math.abs(a.y-s.y)<=n&&Math.abs(s.y-c.y)<=n;!u&&!p&&o.push(s)}return o.push(i[i.length-1]),o}var vh=class t{static _dir(n){switch(n){case F.LEFT:return{x:-1,y:0};case F.RIGHT:return{x:1,y:0};case F.TOP:return{x:0,y:-1};case F.BOTTOM:return{x:0,y:1};case F.AUTO:return{x:0,y:0}}return{x:0,y:0}}static _isHorizontal(n){return n===F.LEFT||n===F.RIGHT}static _handleLength(n,e,i,o){let r=Math.abs(e.x-n.x),a=Math.abs(e.y-n.y),s=Math.hypot(r,a),c=i===F.AUTO?Math.max(r,a):this._isHorizontal(i)?r:a,u=Math.max(8,o),p=o+.5*s,g=o*1.05+c*.3;return Math.min(p,Math.max(u,g))}static _softControl(n,e,i,o){let r=this._dir(n),a=i.x-e.x,s=i.y-e.y,c=Math.hypot(a,s)||1,u=a/c,p=s/c;if(n===F.AUTO)return{x:e.x+u*o,y:e.y+p*o};let g=r.x*u+r.y*p,b=.12,M=Math.max(0,-g)*.08,P=Math.min(.2,b+M),R=r.x*(1-P)+u*P,H=r.y*(1-P)+p*P,z=Math.hypot(R,H)||1;return{x:e.x+R/z*o,y:e.y+H/z*o}}handle({source:n,sourceSide:e,target:i,targetSide:o,offset:r,waypoints:a}){let s=Math.max(0,r??0),c=xp(n,i,a),u=[];for(let g=0;g<c.length-1;g++){let b=c[g],M=c[g+1],P=t._handleLength(b,M,e,s),R=t._handleLength(M,b,o,s),H=t._softControl(e,b,M,P),z=t._softControl(o,M,b,R);u.push({p0:b,c1:H,c2:z,p3:M,chainIndex:g})}let p=ov(u,12);return{path:iv(u),secondPoint:u[0]?.c1??n,penultimatePoint:u[u.length-1]?.c2??i,points:p,candidates:tv(u)}}},yh=class{handle({source:n,sourceSide:e,target:i,targetSide:o,offset:r,waypoints:a}){let s=xp(n,i,a),c=[];for(let p=0;p<s.length-1;p++){let g=s[p],b=s[p+1],M=S0(e,g,b,r??0),P=S0(o,b,g,r??0);c.push({p0:g,c1:M,c2:P,p3:b,chainIndex:p})}let u=ov(c,12);return{path:iv(c),secondPoint:c[0]?.c1??n,penultimatePoint:c[c.length-1]?.c2??i,points:u,candidates:tv(c)}}};function S0(t,n,e,i){let o={x:n.x,y:n.y};switch(t){case F.LEFT:o.x-=ya(n.x-e.x,i);break;case F.RIGHT:o.x+=ya(e.x-n.x,i);break;case F.TOP:o.y-=ya(n.y-e.y,i);break;case F.BOTTOM:o.y+=ya(e.y-n.y,i);break;case F.AUTO:break}return o}function ya(t,n){return t>=n?t:n*Math.sqrt(n-t)}function OD(t){let{axis:n,source:e,target:i,sourceSide:o,targetSide:r,sourceGap:a,targetGap:s,sourceDir:c,targetDir:u,currentDir:p,offset:g,sourceGapOffset:b,targetGapOffset:M}=t,P=ND(a,s),R=RD(n,c,p,P);return o===r?AD(n,e,i,g,c,p,a,s,b,M):R=FD(n,c,u,a,s,P,R),R}function ND(t,n){return{sourceTarget:[{x:t.x,y:n.y}],targetSource:[{x:n.x,y:t.y}]}}function RD(t,n,e,i){return t==="x"?n.x===e?i.targetSource:i.sourceTarget:n.y===e?i.sourceTarget:i.targetSource}function AD(t,n,e,i,o,r,a,s,c,u){let p=Math.abs(n[t]-e[t]);if(p>i)return;let g=Math.min(i-1,i-p);g<=0||(o[t]===r?c[t]=(a[t]>n[t]?-1:1)*g:u[t]=(s[t]>e[t]?-1:1)*g)}function FD(t,n,e,i,o,r,a){let s=t==="x"?"y":"x",c=n[t]===e[s],u=i[s]>o[s],p=i[s]<o[s];return n[t]===1&&(!c&&u||c&&p)||n[t]!==1&&(!c&&p||c&&u)?t==="x"?r.sourceTarget:r.targetSource:a}var Io=1e-6,I0=2e-4,LD=.75;function BD(t,n){let e=t.length,i=[];i.push(`M ${t[0].x} ${t[0].y}`);for(let r=1;r<e-1;r++)i.push(zD(t[r-1],t[r],t[r+1],n));let o=t[e-1];return i.push(`L ${o.x+I0} ${o.y+I0}`),i.join(" ")}function zD(t,n,e,i){let o=n.x,r=n.y;if(i<=0)return`L ${o} ${r}`;let a=Math.abs(t.x-o)<=Io&&Math.abs(o-e.x)<=Io,s=Math.abs(t.y-r)<=Io&&Math.abs(r-e.y)<=Io;if(a||s)return`L ${o} ${r}`;let c=Math.hypot(o-t.x,r-t.y),u=Math.hypot(e.x-o,e.y-r),p=Math.min(c*.5,u*.5,i);if(p<LD)return`L ${o} ${r}`;if(Math.abs(t.y-r)<=Io){let H=t.x<e.x?-1:1,z=t.y<e.y?1:-1,j=o+p*H,oe=r+p*z;return`L ${j} ${r} Q ${o} ${r} ${o} ${oe}`}let b=t.x<e.x?1:-1,M=t.y<e.y?-1:1,P=r+p*M,R=o+p*b;return`L ${o} ${P} Q ${o} ${r} ${R} ${r}`}var T0={[F.LEFT]:A.initialize(-1,0),[F.RIGHT]:A.initialize(1,0),[F.TOP]:A.initialize(0,-1),[F.BOTTOM]:A.initialize(0,1),[F.AUTO]:A.initialize(0,0)},Ch=class{handle({source:n,sourceSide:e,target:i,targetSide:o,waypoints:r,offset:a,radius:s}){let c=xp(n,i,r),u=[],p=[];for(let P=0;P<c.length-1;P++){let R=c[P],H=c[P+1],z=this._getPathPoints(R,e,H,o,a??0);u.push(z),p.push(...ED(z))}let g=DD(kD(u)),b=g.length>1?g[g.length-2]:n,M=g.length>1?g[1]:i;return{path:BD(g,s??0),penultimatePoint:b,secondPoint:M,points:g,candidates:p}}_getPathPoints(n,e,i,o,r){let a=T0[e],s=T0[o],c={x:n.x+a.x*r,y:n.y+a.y*r},u={x:i.x+s.x*r,y:i.y+s.y*r},p=this._getDirection(c,e,u),g=p.x!==0?"x":"y",b=p[g],M=[],P=A.initialize(),R=A.initialize(),H=ID(n,i);if(a[g]*s[g]===-1){let z=[{x:H.x,y:c.y},{x:H.x,y:u.y}],j=[{x:c.x,y:H.y},{x:u.x,y:H.y}];a[g]===b?M=g==="x"?z:j:M=g==="x"?j:z}else M=OD({axis:g,source:n,target:i,sourceSide:e,targetSide:o,sourceGap:c,targetGap:u,sourceDir:a,targetDir:s,currentDir:b,offset:r,sourceGapOffset:P,targetGapOffset:R});return[n,{x:c.x+P.x,y:c.y+P.y},...M,{x:u.x+R.x,y:u.y+R.y},i]}_getDirection(n,e,i){return e===F.LEFT||e===F.RIGHT?n.x<i.x?A.initialize(1,0):A.initialize(-1,0):n.y<i.y?A.initialize(0,1):A.initialize(0,-1)}},E0=2e-4,bh=class{handle(n){let e=xp(n.source,n.target,n.waypoints),i=e.length,o=e[0],r=`M ${o.x} ${o.y}`,a=new Array(i-1);for(let s=0;s<i-1;s++){let c=e[s],u=e[s+1],p=s===i-2,g=p?u.x+E0:u.x,b=p?u.y+E0:u.y;r+=` L ${g} ${b}`,a[s]={x:(c.x+u.x)*.5,y:(c.y+u.y)*.5}}return{path:r,candidates:a,points:e,secondPoint:e[1]??n.target,penultimatePoint:e[i-2]??n.source}}},qD=new ue("F_CONNECTION_BUILDERS"),rv=(()=>{class t{_builtinBuilders={[Ni.STRAIGHT]:new bh,[Ni.BEZIER]:new yh,[Ni.ADAPTIVE_CURVE]:new vh,[Ni.SEGMENT]:new Ch};_providedBuilders;_builders;constructor(){this._providedBuilders=l(qD,{optional:!0})||{},this._builders=se(se({},this._builtinBuilders),this._providedBuilders)}handle({type:e,payload:i}){let o=this._builders[e];if(!o)throw this._createBuilderNotFoundError(e);return o.handle(i)}_createBuilderNotFoundError(e){let i=Object.keys(this._builtinBuilders).sort(),o=Object.keys(this._providedBuilders).sort(),r=Object.keys(this._builders).sort(),a=i.filter(c=>c in this._providedBuilders).sort(),s=[`Connection Builder Error: builder type "${e}" not found.`,`Registered types: ${r.length?r.join(", "):"(none)"}`,`Built-in types: ${i.length?i.join(", "):"(none)"}`,`Provided (F_CONNECTION_BUILDERS) types: ${o.length?o.join(", "):"(none)"}`,a.length?`Overridden built-ins: ${a.join(", ")}`:null,"Tip: ensure you pass a valid Connection Type or provide a builder via F_CONNECTION_BUILDERS."].filter(Boolean);return new Error(s.join(`
|
|
2
|
+
`))}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();function VD(t,n,e){return Zt("connection_"+t+n+e)}function GD(t,n,e){return Zt("connection_for_selection_"+t+n+e)}function av(t){return Zt("connection_gradient_"+t)}function HD(t){return`url(#${av(t)})`}var jD=(()=>{class t{_connection=l(bp);_hostElement=l(Oe).nativeElement;_injector=l(Ze);_hostAttributes=new Map;_startColor;_endColor;gradientId=S(()=>av(this._connection.fId()));ngOnInit(){this._listenColorChanges()}_listenColorChanges(){ie(()=>{this.gradient().fStartColor(),this.gradient().fEndColor(),Rt(()=>{this._updateGradient()})},{injector:this._injector})}get stop1Element(){return this._hostElement.children.item(0)}get stop2Element(){return this._hostElement.children.item(1)}redraw(e){let i=e.point2.x-e.point1.x,o=e.point2.y-e.point1.y,r=Math.sqrt(i*i+o*o)||.01,a=new Z(.5-.5*i/r,.5-.5*o/r);this._setHostAttribute("x1",a.x.toString()),this._setHostAttribute("y1",a.y.toString());let s=new Z(.5+.5*i/r,.5+.5*o/r);this._setHostAttribute("x2",s.x.toString()),this._setHostAttribute("y2",s.y.toString()),this._updateGradient()}_updateGradient(){let e=this.gradient();this._setFromColor(e.fStartColor()),this._setToColor(e.fEndColor())}_setFromColor(e){let i=e||"transparent";this._startColor!==i&&(this._startColor=i,this.stop1Element.setAttribute("stop-color",i),this.stop1Element.style.setProperty("stop-color",i))}_setToColor(e){let i=e||"transparent";this._endColor!==i&&(this._endColor=i,this.stop2Element.setAttribute("stop-color",i),this.stop2Element.style.setProperty("stop-color",i))}_setHostAttribute(e,i){this._hostAttributes.get(e)!==i&&(this._hostAttributes.set(e,i),this._hostElement.setAttribute(e,i))}static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})(),xh=(()=>{class t extends jD{gradient=N.required({alias:"fConnectionGradientRendererFor"});static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["linearGradient","fConnectionGradientRenderer",""]],hostVars:1,hostBindings:function(i,o){i&2&&q("id",o.gradientId())},inputs:{gradient:[1,"fConnectionGradientRendererFor","gradient"]},features:[he],attrs:gk,decls:3,vars:0,consts:[[0,"xmlns","svg","http://www.w3.org/2000/svg"],["offset","0%"],["offset","100%"]],template:function(i,o){i&1&&(Yr(0,0),$e(),Si(1,"stop",1)(2,"stop",2),Xr())},encapsulation:2,changeDetection:0})}return t})(),P0=new ue("F_CONNECTION_GRADIENT");var wh=new ue("F_CONNECTION_PATH"),Sh=class{hostElement=l(Oe).nativeElement},UD=(()=>{class t extends Sh{_connection=l(bp);useGradient=N(!1);linkToGradient=S(()=>this.useGradient()?HD(this._connection.fId()):null);get fPathId(){return this._connection.fId()}get attrConnectionId(){return VD(this._connection.fId(),this._connection.fOutputId(),this._connection.fInputId())}initialize(){this.deselect()}setPath(e){this.hostElement.setAttribute("d",`${e}`)}select(){this.hostElement.setAttribute("marker-start",`url(#${KD(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${YD(this._connection.fId())})`)}deselect(){this.hostElement.setAttribute("marker-start",`url(#${WD(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${$D(this._connection.fId())})`)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["path","f-connection-path",""]],hostAttrs:[1,"f-component","f-connection-path"],hostVars:4,hostBindings:function(i,o){i&2&&(q("id",o.attrConnectionId)("data-f-path-id",o.fPathId),rt("stroke",o.linkToGradient()))},inputs:{useGradient:[1,"useGradient"]},standalone:!1,features:[_e([{provide:wh,useExisting:t}]),he],attrs:_k,decls:0,vars:0,template:function(i,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})();function WD(t){return Zt(`f-connection-marker-start-${t}`)}function $D(t){return Zt(`f-connection-marker-end-${t}`)}function KD(t){return Zt(`f-connection-selected-marker-start-${t}`)}function YD(t){return Zt(`f-connection-selected-marker-end-${t}`)}var Ih=new ue("F_CONNECTION_SELECTION"),Th=class{hostElement=l(Oe).nativeElement},XD=(()=>{class t extends Th{_connection=l(bp);get connectionForSelectionId(){return GD(this._connection.fId(),this._connection.fOutputId(),this._connection.fInputId())}setPath(e){this.hostElement.setAttribute("d",`${e}`)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["path","fConnectionSelection",""]],hostAttrs:[1,"f-component","f-connection-selection"],hostVars:1,hostBindings:function(i,o){i&2&&q("id",o.connectionForSelectionId)},standalone:!1,features:[_e([{provide:Ih,useExisting:t}]),he],attrs:vk,decls:0,vars:0,template:function(i,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})(),Eh=new ue("F_CONNECTION_DRAG_HANDLE_END"),Ph=new ue("F_CONNECTION_DRAG_HANDLE_START"),al=class{hostElement=l(Oe).nativeElement;point=A.initialize();class="f-connection-drag-handle";calculateCircleCenter(n,e,i){let o={x:e.x-n.x,y:e.y-n.y},r=Math.sqrt(o.x*o.x+o.y*o.y)||1,a={x:o.x/r,y:o.y/r},s={x:a.x*i,y:a.y*i};return{x:e.x-s.x,y:e.y-s.y}}},ZD=(()=>{class t extends al{redraw(e,i){this.point=this.calculateCircleCenter(e,i,8),this.hostElement.setAttribute("cx",this.point.x.toString()),this.hostElement.setAttribute("cy",this.point.y.toString())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["circle","f-connection-drag-handle-start",""]],hostVars:2,hostBindings:function(i,o){i&2&&Ne(o.class)},standalone:!1,features:[_e([{provide:Ph,useExisting:t}]),he],attrs:yk,decls:0,vars:0,template:function(i,o){},encapsulation:2,changeDetection:0})}return t})(),QD=(()=>{class t extends al{redraw(e,i){this.point=this.calculateCircleCenter(e,i,8),this.hostElement.setAttribute("cx",this.point.x.toString()),this.hostElement.setAttribute("cy",this.point.y.toString())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["circle","f-connection-drag-handle-end",""]],hostVars:2,hostBindings:function(i,o){i&2&&Ne(o.class)},standalone:!1,features:[_e([{provide:Eh,useExisting:t}]),he],attrs:Ck,decls:0,vars:0,template:function(i,o){},encapsulation:2,changeDetection:0})}return t})(),nh="f-selected";function sv(t){return class extends t{fId=U("");fSelectionDisabled=U(!1);unmarkAsSelected(){this.unmarkChildrenAsSelected?.(),this.hostElement.classList.remove(nh)}markAsSelected(){this.markChildrenAsSelected?.(),this.isSelected()||this.hostElement.classList.add(nh)}isSelected(){return this.hostElement.classList.contains(nh)}markChildrenAsSelected(){}unmarkChildrenAsSelected(){}constructor(...n){super(...n)}}}function JD(t){return class extends t{show(){this.hostElement.style.display="unset"}hide(){this.hostElement.style.display="none"}constructor(...n){super(...n)}}}var eO=sv(JD(class{hostElement;constructor(t){this.hostElement=t}})),tO=(()=>{class t extends eO{_fConnectionBuilder=l(rv);path="";line=wo.initialize();fReassignableStart=U(!1);fDraggingDisabled=U(!1);fSelectionDisabled=U(!1);fDefs=Re.required("defs");fPath=Re.required(wh);fDragHandleStart=Re(Ph);fDragHandleEnd=Re.required(Eh);fSelection=Re.required(Ih);fContents=Hf(b0,{descendants:!0});fMarkers=Hf(ol,{descendants:!0});fGradient=Jr(P0);_fGradientRenderer=Re(xh);fWaypoints=Jr(x0);fInputSide=U(Se.DEFAULT);_contentLayoutEngine=new _h;_sourceSide=F.AUTO;fOutputSide=U(Se.DEFAULT);_targetSide=F.AUTO;_penultimatePoint=A.initialize();_secondPoint=A.initialize();constructor(){super(l(Oe).nativeElement)}initialize(){this.redraw(),this.isSelected()?this.markChildrenAsSelected():this.unmarkChildrenAsSelected()}isContains(e){return(this.hostElement.firstChild?.lastChild).contains(e)||Array.from(this.fContents()?.values()??[]).some(i=>i.hostElement?.contains(e))||this.fWaypoints()?.hostElement?.contains(e)}setLine({point1:e,point2:i}){this.line=wo.initialize(e,i);let{path:o,points:r,penultimatePoint:a,secondPoint:s,candidates:c}=this._getPathResult(e,i);this.path=o,this._penultimatePoint=a||e,this._secondPoint=s||i,this.fWaypoints()?.candidates.set(c||[]),this._contentLayoutEngine.layout(r||[],this._contents())}_contents(){return Array.from(this.fContents()?.values()??[])}_getPathResult(e,i){return this._fConnectionBuilder.handle({type:this.fType,payload:{source:e,sourceSide:this._sourceSide,target:i,targetSide:this._targetSide,radius:this.fRadius,offset:this.fOffset,waypoints:this.fWaypoints()?.waypoints()||[]}})}markChildrenAsSelected(){this.fPath().select()}unmarkChildrenAsSelected(){this.fPath().deselect()}redraw(){this.fPath().setPath(this.path),this.fSelection().setPath(this.path),this.fDragHandleEnd().redraw(this._penultimatePoint,this.line.point2),this.fDragHandleStart()?.redraw(this._secondPoint,this.line.point1),this._fGradientRenderer()?.redraw(this.line)}getResolvedSides(){return{sourceSide:this._sourceSide,targetSide:this._targetSide}}_applyResolvedSidesToConnection(e,i){this._sourceSide=e,this._targetSide=i}static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,contentQueries:function(i,o,r){i&1&&Gf(r,o.fContents,b0,5)(r,o.fMarkers,ol,5)(r,o.fGradient,P0,5)(r,o.fWaypoints,x0,5),i&2&<(4)},viewQuery:function(i,o){i&1&&Tt(o.fDefs,bk,5)(o.fPath,wh,5)(o.fDragHandleStart,Ph,5)(o.fDragHandleEnd,Eh,5)(o.fSelection,Ih,5)(o._fGradientRenderer,xh,5),i&2&<(6)},standalone:!1,features:[he]})}return t})(),nO=(()=>{let t=class ja{_browser=l(qe);_markerCache=new WeakMap;handle({connection:e}){let i=this._findConnectionMarkers(e),o=e.fDefs();if(!o)return!1;let r=iO(i),a=this._markerCache.get(e);if(a?.signature===r&&a.defsElement===o.nativeElement)return!1;let s=dv("defs",this._browser);return i.forEach(c=>{cv(c.type).forEach(u=>{let p=oO(u,c,e.fId(),this._browser),g=c.markerElement.cloneNode(!0);g.setAttribute("height",`${c.height}`),g.setAttribute("width",`${c.width}`),g.removeAttribute("markerUnits"),g.style.display="unset",p.append(g),s.append(p)})}),o.nativeElement.innerHTML=s.innerHTML,this._markerCache.set(e,{signature:r,defsElement:o.nativeElement}),this._makeSafariCompatible(e),!0}_findConnectionMarkers(e){return Array.from(e.fMarkers()??[])}_makeSafariCompatible(e){e.fPath().hostElement.replaceWith(e.fPath().hostElement)}static \u0275fac=function(i){return new(i||ja)};static \u0275prov=y({token:ja,factory:ja.\u0275fac})};return t=x([w(zi)],t),t})();function iO(t){return t.map(n=>[...cv(n.type),n.width,n.height,n.refX,n.refY,n.orient,n.markerUnits,n.markerElement.outerHTML].join("|")).join("||")}function oO(t,n,e,i){let o=dv("marker",i);return o.setAttribute("id",Zt(t+"-"+e)),o.setAttribute("markerHeight",`${n.height}`),o.setAttribute("markerWidth",`${n.width}`),o.setAttribute("orient",`${n.orient}`),o.setAttribute("refX",`${n.refX}`),o.setAttribute("refY",`${n.refY}`),o.setAttribute("markerUnits",`${n.markerUnits}`),o}function cv(t){switch(t){case ge.START:return[ge.START];case ge.END:return[ge.END];case ge.SELECTED_START:return[ge.SELECTED_START];case ge.SELECTED_END:return[ge.SELECTED_END];case ge.START_ALL_STATES:return[ge.START,ge.SELECTED_START];case ge.END_ALL_STATES:return[ge.END,ge.SELECTED_END];default:return[]}}function dv(t,n){return n.document.createElementNS("http://www.w3.org/2000/svg",t)}var wp=(()=>{class t{renderTicket=0;_connectedInPreviousRender=new Set;beginRender(){return++this.renderTicket}resetConnectedConnectors(){for(let e of this._connectedInPreviousRender)e.resetConnected();this._connectedInPreviousRender.clear()}trackConnectedConnectors(e,i){this._connectedInPreviousRender.add(e),this._connectedInPreviousRender.add(i)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),rO=String.raw`
|
|
3
|
+
const EPSILON = 0.5;
|
|
4
|
+
|
|
5
|
+
addEventListener('message', (event) => {
|
|
6
|
+
const data = event?.data;
|
|
7
|
+
const requestId = data?.requestId;
|
|
8
|
+
const items = Array.isArray(data?.items) ? data.items : [];
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
const results = items.map((item) => calculateItem(item));
|
|
12
|
+
postMessage({ requestId, results });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
const message = error instanceof Error ? error.message : 'Connection worker failed.';
|
|
15
|
+
postMessage({ requestId, error: message });
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function calculateItem(item) {
|
|
20
|
+
const sourceCenterX = item.sourceRect.x + item.sourceRect.width / 2;
|
|
21
|
+
const sourceCenterY = item.sourceRect.y + item.sourceRect.height / 2;
|
|
22
|
+
const targetCenterX = item.targetRect.x + item.targetRect.width / 2;
|
|
23
|
+
const targetCenterY = item.targetRect.y + item.targetRect.height / 2;
|
|
24
|
+
|
|
25
|
+
const sourceSide = resolveConnectableSide(
|
|
26
|
+
item.outputSide,
|
|
27
|
+
targetCenterX - sourceCenterX,
|
|
28
|
+
targetCenterY - sourceCenterY,
|
|
29
|
+
item.sourceConnectableSide,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const targetSide = resolveConnectableSide(
|
|
33
|
+
item.inputSide,
|
|
34
|
+
sourceCenterX - targetCenterX,
|
|
35
|
+
sourceCenterY - targetCenterY,
|
|
36
|
+
item.targetConnectableSide,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
if (item.behavior === 'fixed_center') {
|
|
40
|
+
return {
|
|
41
|
+
originalIndex: item.originalIndex,
|
|
42
|
+
supported: true,
|
|
43
|
+
sourceSide,
|
|
44
|
+
targetSide,
|
|
45
|
+
line: {
|
|
46
|
+
point1: { x: sourceCenterX, y: sourceCenterY },
|
|
47
|
+
point2: { x: targetCenterX, y: targetCenterY },
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (item.sourceRotation || item.targetRotation) {
|
|
53
|
+
return { originalIndex: item.originalIndex, supported: false };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (item.behavior !== 'fixed') {
|
|
57
|
+
if (item.behavior !== 'floating') {
|
|
58
|
+
return { originalIndex: item.originalIndex, supported: false };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (hasRoundedCorners(item.sourceRect) || hasRoundedCorners(item.targetRect)) {
|
|
62
|
+
return { originalIndex: item.originalIndex, supported: false };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
originalIndex: item.originalIndex,
|
|
67
|
+
supported: true,
|
|
68
|
+
sourceSide,
|
|
69
|
+
targetSide,
|
|
70
|
+
line: buildFloatingLine(item.sourceRect, item.targetRect),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const line = buildFixedLine(item.sourceRect, item.targetRect, sourceSide, targetSide);
|
|
75
|
+
if (!line) {
|
|
76
|
+
return { originalIndex: item.originalIndex, supported: false };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
originalIndex: item.originalIndex,
|
|
81
|
+
supported: true,
|
|
82
|
+
sourceSide,
|
|
83
|
+
targetSide,
|
|
84
|
+
line,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function resolveConnectableSide(requestedSide, deltaX, deltaY, fallbackSide) {
|
|
89
|
+
if (requestedSide === 'default') {
|
|
90
|
+
return fallbackSide;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const absX = Math.abs(deltaX);
|
|
94
|
+
const absY = Math.abs(deltaY);
|
|
95
|
+
const nearZero = absX < EPSILON && absY < EPSILON;
|
|
96
|
+
|
|
97
|
+
if (nearZero) {
|
|
98
|
+
return fallbackSide;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const horizontalDominant = absX >= absY;
|
|
102
|
+
|
|
103
|
+
switch (requestedSide) {
|
|
104
|
+
case 'calculate':
|
|
105
|
+
return horizontalDominant ? (deltaX >= 0 ? 'right' : 'left') : deltaY >= 0 ? 'bottom' : 'top';
|
|
106
|
+
|
|
107
|
+
case 'calculate_horizontal':
|
|
108
|
+
if (absX < EPSILON) {
|
|
109
|
+
return fallbackSide;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return deltaX >= 0 ? 'right' : 'left';
|
|
113
|
+
|
|
114
|
+
case 'calculate_vertical':
|
|
115
|
+
if (absY < EPSILON) {
|
|
116
|
+
return fallbackSide;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return deltaY >= 0 ? 'bottom' : 'top';
|
|
120
|
+
|
|
121
|
+
case 'top':
|
|
122
|
+
case 'bottom':
|
|
123
|
+
case 'left':
|
|
124
|
+
case 'right':
|
|
125
|
+
return requestedSide;
|
|
126
|
+
|
|
127
|
+
default:
|
|
128
|
+
return fallbackSide;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function buildFixedLine(sourceRect, targetRect, sourceSide, targetSide) {
|
|
133
|
+
const sourceAnchor = sourceSide === 'auto' ? 'bottom' : sourceSide;
|
|
134
|
+
const targetAnchor = targetSide === 'auto' ? 'top' : targetSide;
|
|
135
|
+
|
|
136
|
+
const point1 = getSidePoint(sourceRect, sourceAnchor);
|
|
137
|
+
const point2 = getSidePoint(targetRect, targetAnchor);
|
|
138
|
+
|
|
139
|
+
if (!point1 || !point2) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return { point1, point2 };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function buildFloatingLine(sourceRect, targetRect) {
|
|
147
|
+
const sourceCenter = getRectCenter(sourceRect);
|
|
148
|
+
const targetCenter = getRectCenter(targetRect);
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
point1: getRectBorderIntersection(sourceRect, sourceCenter, targetCenter),
|
|
152
|
+
point2: getRectBorderIntersection(targetRect, targetCenter, sourceCenter),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function hasRoundedCorners(rect) {
|
|
157
|
+
return !!(rect.radius1 || rect.radius2 || rect.radius3 || rect.radius4);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function getRectCenter(rect) {
|
|
161
|
+
return {
|
|
162
|
+
x: rect.x + rect.width / 2,
|
|
163
|
+
y: rect.y + rect.height / 2,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function getRectBorderIntersection(rect, from, to) {
|
|
168
|
+
const halfWidth = rect.width / 2;
|
|
169
|
+
const halfHeight = rect.height / 2;
|
|
170
|
+
const center = getRectCenter(rect);
|
|
171
|
+
|
|
172
|
+
const dx = to.x - from.x;
|
|
173
|
+
const dy = to.y - from.y;
|
|
174
|
+
|
|
175
|
+
if (Math.abs(dx) < EPSILON && Math.abs(dy) < EPSILON) {
|
|
176
|
+
return center;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const scaleX = Math.abs(dx) < EPSILON ? Number.POSITIVE_INFINITY : halfWidth / Math.abs(dx);
|
|
180
|
+
const scaleY = Math.abs(dy) < EPSILON ? Number.POSITIVE_INFINITY : halfHeight / Math.abs(dy);
|
|
181
|
+
const scale = Math.min(scaleX, scaleY);
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
x: center.x + dx * scale,
|
|
185
|
+
y: center.y + dy * scale,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function getSidePoint(rect, side) {
|
|
190
|
+
const centerX = rect.x + rect.width / 2;
|
|
191
|
+
const centerY = rect.y + rect.height / 2;
|
|
192
|
+
|
|
193
|
+
switch (side) {
|
|
194
|
+
case 'top':
|
|
195
|
+
return { x: centerX, y: rect.y };
|
|
196
|
+
|
|
197
|
+
case 'right':
|
|
198
|
+
return { x: rect.x + rect.width, y: centerY };
|
|
199
|
+
|
|
200
|
+
case 'bottom':
|
|
201
|
+
return { x: centerX, y: rect.y + rect.height };
|
|
202
|
+
|
|
203
|
+
case 'left':
|
|
204
|
+
return { x: rect.x, y: centerY };
|
|
205
|
+
|
|
206
|
+
default:
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
`.trim();function lv(t){return!!uv(t)}function uv(t){let n=t,e=n?.Blob,i=n?.Worker,o=n?.URL;return!e||!i||typeof o?.createObjectURL!="function"||typeof o.revokeObjectURL!="function"?null:{blobCtor:e,workerCtor:i,urlApi:o}}function aO(t){let n=new t.blobCtor([rO],{type:"text/javascript"});return t.urlApi.createObjectURL(n)}function pv(t,n){if(!t)return;let e=n??(typeof URL>"u"?null:URL);typeof e?.revokeObjectURL=="function"&&e.revokeObjectURL(t)}var ci=(()=>{class t{worker=null;workerUrl=null;nextRequestId=0;isDisabled=!1;pending=new Map;resetRuntime(e){this.pending.forEach(i=>i.reject(e)),this.pending.clear(),this.worker?.terminate(),this.worker=null,pv(this.workerUrl),this.workerUrl=null}dispose(){this.resetRuntime(new Error("Connection worker was destroyed."))}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),sl=class{connection;line;static fToken=Symbol("ApplyConnectionRenderRequest");constructor(n,e){this.connection=n,this.line=e}},sO=(()=>{let t=class Ua{_mediator=l(D);_renderCache=new WeakMap;handle({connection:e,line:i}){!this._mediator.execute(new zi(e))&&!this._shouldRender(e,i)||(e.setLine(i),e.initialize())}_shouldRender(e,i){let o=e.fPath().hostElement,r=this._createConnectionRenderSignature(e,i),a=this._renderCache.get(e);return a?.signature===r&&a.pathElement===o?!1:(this._renderCache.set(e,{signature:r,pathElement:o}),!0)}_createConnectionRenderSignature(e,i){let{sourceSide:o,targetSide:r}=e.getResolvedSides();return[e.fBehavior,e.fType,e.fRadius,e.fOffset,e.fReassignableStart(),this._serializeContents([...e.fContents()||[]]),o,r,this._serializePoint(i.point1),this._serializePoint(i.point2),this._serializeWaypoints(e.fWaypoints()?.waypoints()||[])].join("|")}_serializePoint(e){return`${e.x}:${e.y}`}_serializeWaypoints(e){return e.map(this._serializePoint).join(";")}_serializeContents(e){return e.map(i=>[i.position(),i.offset(),i.align()].join(":")).join(";")}static \u0275fac=function(i){return new(i||Ua)};static \u0275prov=y({token:Ua,factory:Ua.\u0275fac})};return t=x([w(sl)],t),t})(),cl=class{source;target;static fToken=Symbol("MarkConnectionConnectorsAsConnectedRequest");constructor(n,e){this.source=n,this.target=e}},cO=(()=>{let t=class Wa{_state=l(wp);handle({source:e,target:i}){e.setConnected(i),i.setConnected(e),this._state.trackConnectedConnectors(e,i)}static \u0275fac=function(i){return new(i||Wa)};static \u0275prov=y({token:Wa,factory:Wa.\u0275fac})};return t=x([w(cl)],t),t})(),Pn=class{element;cache;static fToken=Symbol("GetNormalizedConnectorRectRequest");constructor(n,e=!0){this.element=n,this.cache=e}},dO={enabled:!1},zt=new ue("F_CACHE_OPTIONS",{providedIn:"root",factory:()=>se({},dO)});var dl=class{id;nodeId;kind;element;static fToken=Symbol("RegisterFCacheConnectorRequest");constructor(n,e,i,o){this.id=n,this.nodeId=e,this.kind=i,this.element=o}},qt=(()=>{class t{nodeEntries=new Map;nodeIdByElement=new WeakMap;connectorEntries=new Map;connectorKeysByNodeId=new Map;connectorKeyByElement=new WeakMap;static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Mh=class{key;id;kind;nodeId;element;rect;constructor(n,e,i,o,r,a){this.key=n,this.id=e,this.kind=i,this.nodeId=o,this.element=r,this.rect=a}},Po=class{static build(n,e){return`${n}:${e}`}},kh=class{id;element;reference;rect;constructor(n,e,i,o){this.id=n,this.element=e,this.reference=i,this.rect=o}},qi=class{nodeId;reason;static fToken=Symbol("InvalidateFCacheNodeRequest");constructor(n,e="manual"){this.nodeId=n,this.reason=e}},lO=(()=>{let t=class $a{_store=l(qt);_options=l(zt);handle({nodeId:e,reason:i}){if(!this._options.enabled)return;let o=this._store.nodeEntries.get(e);if(!o)return;o.rect=void 0;let r=this._store.connectorKeysByNodeId.get(e);if(r?.size)for(let a of r){let s=this._store.connectorEntries.get(a);s&&(s.rect=void 0)}}static \u0275fac=function(i){return new(i||$a)};static \u0275prov=y({token:$a,factory:$a.\u0275fac})};return t=x([w(qi)],t),t})(),ll=class{id;element;reference;static fToken=Symbol("RegisterFCacheNodeRequest");constructor(n,e,i){this.id=n,this.element=e,this.reference=i}},uO=(()=>{let t=class Ka{_store=l(qt);_options=l(zt);handle({id:e,element:i,reference:o}){if(!this._options.enabled)return;let r=new kh(e,i,o);this._store.nodeEntries.set(e,r),this._store.nodeIdByElement.set(i,e),this._store.connectorKeysByNodeId.set(e,this._store.connectorKeysByNodeId.get(e)??new Set)}static \u0275fac=function(i){return new(i||Ka)};static \u0275prov=y({token:Ka,factory:Ka.\u0275fac})};return t=x([w(ll)],t),t})(),ul=class{id;static fToken=Symbol("UnregisterFCacheNodeRequest");constructor(n){this.id=n}},pO=(()=>{let t=class Ya{_store=l(qt);_mediator=l(D);_options=l(zt);handle({id:e}){if(!this._options.enabled)return;let i=this._store.nodeEntries.get(e);if(!i)return;this._store.nodeEntries.delete(e),this._store.nodeIdByElement.delete(i.element);let o=Array.from(this._store.connectorKeysByNodeId.get(e)??[]);for(let r of o){let a=this._store.connectorEntries.get(r);a&&this._mediator.execute(new Mo(a.id,a.kind))}this._store.connectorKeysByNodeId.delete(e)}static \u0275fac=function(i){return new(i||Ya)};static \u0275prov=y({token:Ya,factory:Ya.\u0275fac})};return t=x([w(ul)],t),t})(),fO=(()=>{let t=class Xa{_store=l(qt);_mediator=l(D);_options=l(zt);handle({id:e,nodeId:i,kind:o,element:r}){if(!this._options.enabled)return;let a=Po.build(e,o),s=this._store.connectorEntries.get(a);s&&(this._detachConnectorFromNode(s.key,s.nodeId),this._store.connectorKeyByElement.delete(s.element));let c=new Mh(a,e,o,i,r);this._store.connectorEntries.set(a,c),this._store.connectorKeyByElement.set(r,a);let u=this._store.connectorKeysByNodeId.get(i)??new Set;u.add(a),this._store.connectorKeysByNodeId.set(i,u),this._mediator.execute(new qi(i,"connector-registered"))}_detachConnectorFromNode(e,i){let o=this._store.connectorKeysByNodeId.get(i);o&&(o.delete(e),o.size||this._store.connectorKeysByNodeId.delete(i))}static \u0275fac=function(i){return new(i||Xa)};static \u0275prov=y({token:Xa,factory:Xa.\u0275fac})};return t=x([w(dl)],t),t})(),Mo=class{connectorId;kind;static fToken=Symbol("UnregisterFCacheConnectorRequest");constructor(n,e){this.connectorId=n,this.kind=e}},hO=(()=>{let t=class Za{_store=l(qt);_mediator=l(D);_options=l(zt);handle({connectorId:e,kind:i}){if(!this._options.enabled)return;let o=Po.build(e,i),r=this._store.connectorEntries.get(o);r&&(this._store.connectorEntries.delete(o),this._store.connectorKeyByElement.delete(r.element),this._detachConnectorFromNode(o,r.nodeId),this._store.nodeEntries.has(r.nodeId)&&this._mediator.execute(new qi(r.nodeId,"connector-unregistered")))}_detachConnectorFromNode(e,i){let o=this._store.connectorKeysByNodeId.get(i);o&&(o.delete(e),o.size||this._store.connectorKeysByNodeId.delete(i))}static \u0275fac=function(i){return new(i||Za)};static \u0275prov=y({token:Za,factory:Za.\u0275fac})};return t=x([w(Mo)],t),t})(),Vi=class{element;static fToken=Symbol("GetCachedFCacheRectRequest");constructor(n){this.element=n}},mO=(()=>{let t=class Qa{_store=l(qt);_options=l(zt);handle({element:e}){if(!this._options.enabled)return;let i=this._store.nodeIdByElement.get(e);if(i){let r=this._store.nodeEntries.get(i)?.rect;if(r)return r}let o=this._store.connectorKeyByElement.get(e);if(o)return this._store.connectorEntries.get(o)?.rect??void 0}static \u0275fac=function(i){return new(i||Qa)};static \u0275prov=y({token:Qa,factory:Qa.\u0275fac})};return t=x([w(Vi)],t),t})(),ti=class{connectorId;kind;rect;static fToken=Symbol("SetFCacheConnectorRectRequest");constructor(n,e,i){this.connectorId=n,this.kind=e,this.rect=i}},gO=(()=>{let t=class Ja{_store=l(qt);_options=l(zt);handle({connectorId:e,kind:i,rect:o}){if(!this._options.enabled)return;let r=Po.build(e,i),a=this._store.connectorEntries.get(r);a&&(a.rect=ze.fromRoundedRect(o))}static \u0275fac=function(i){return new(i||Ja)};static \u0275prov=y({token:Ja,factory:Ja.\u0275fac})};return t=x([w(ti)],t),t})(),ni=class{nodeId;rect;static fToken=Symbol("SetFCacheNodeRectRequest");constructor(n,e){this.nodeId=n,this.rect=e}},_O=(()=>{let t=class es{_store=l(qt);_options=l(zt);handle({nodeId:e,rect:i}){if(!this._options.enabled)return;let o=this._store.nodeEntries.get(e);if(!o)return;let r=o.rect;o.rect=G.initialize(i.x,i.y,i.width,i.height),r&&this._updateConnectorRectsByNodeRect(e,r,o.rect)}_updateConnectorRectsByNodeRect(e,i,o){let r=this._store.connectorKeysByNodeId.get(e);if(!r?.size)return;let a=o.x-i.x,s=o.y-i.y,c=i.width!==0,u=i.height!==0,p=c?o.width/i.width:1,g=u?o.height/i.height:1;for(let b of r){let M=this._store.connectorEntries.get(b);if(!M?.rect)continue;let P=M.rect,R=P.gravityCenter,H=c?o.x+(R.x-i.x)*p:R.x+a,z=u?o.y+(R.y-i.y)*g:R.y+s;M.rect=new ze(H-P.width/2,z-P.height/2,P.width,P.height,P.radius1,P.radius2,P.radius3,P.radius4)}}static \u0275fac=function(i){return new(i||es)};static \u0275prov=y({token:es,factory:es.\u0275fac})};return t=x([w(ni)],t),t})(),ko=class{element;rect;static fToken=Symbol("UpdateFCacheRectByElementRequest");constructor(n,e){this.element=n,this.rect=e}},vO=(()=>{let t=class ts{_store=l(qt);_options=l(zt);handle({element:e,rect:i}){if(!this._options.enabled)return;let o=this._store.nodeIdByElement.get(e);if(o){let s=this._store.nodeEntries.get(o);s&&(s.rect=i);return}let r=this._store.connectorKeyByElement.get(e);if(!r)return;let a=this._store.connectorEntries.get(r);a&&(a.rect=i)}static \u0275fac=function(i){return new(i||ts)};static \u0275prov=y({token:ts,factory:ts.\u0275fac})};return t=x([w(ko)],t),t})(),yO=[qt,uO,pO,lO,fO,hO,mO,_O,gO,vO];function Qi(t,n,e){return n?Z.fromPoint(t).elementTransform(n).sub(e.scaledPosition).sub(e.position).div(e.scale):Z.fromPoint(t)}function fv(){return{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}}function Gi(t){return t?`${t}`:void 0}var CO=(()=>{let t=class ns{_store=l(k);_mediator=l(D);_browser=l(qe);get _transform(){return this._store.transform}handle({element:e,cache:i}){let o=this._mediator.execute(new Vi(e));if(o&&i)return o;let r=this._getElementRoundedRect(e),a=this._normalizePosition(r),s=this._unscaleSize(r),c=this._getUnscaledRect(a,s,r),u=this._getOffsetSize(e,s),p=ze.fromCenter(c,u.width,u.height);return this._mediator.execute(new ko(e,p)),p}_getElementRoundedRect(e){return this._getRoundedRect(G.fromElement(e),e,this._getComputedStyle(e))}_getRoundedRect(e,i,o){let[r,a,s,c]=this._normalizeCircularBorderRadii(e.width,e.height,[this._getSystemRadius(o.borderTopLeftRadius,i,o.fontSize),this._getSystemRadius(o.borderTopRightRadius,i,o.fontSize),this._getSystemRadius(o.borderBottomRightRadius,i,o.fontSize),this._getSystemRadius(o.borderBottomLeftRadius,i,o.fontSize)]);return new ze(e.x,e.y,e.width,e.height,r,a,s,c)}_getComputedStyle(e){return this._browser.window.getComputedStyle(e)}_toPixels(e,i,o){return this._browser.toPixels(e,i.clientWidth,i.clientHeight,o)||0}_getSystemRadius(e,i,o){return this._toPixels(e,i,o)*this._transform.scale}_normalizeCircularBorderRadii(e,i,o){let[r,a,s,c]=o.map(p=>Math.max(0,p)),u=Math.min(1,this._getRadiusScaleFactor(e,r+a),this._getRadiusScaleFactor(i,a+s),this._getRadiusScaleFactor(e,s+c),this._getRadiusScaleFactor(i,c+r));return[r*u,a*u,s*u,c*u]}_getRadiusScaleFactor(e,i){return i<=0?1:e<=0?0:e/i}_normalizePosition(e){return Qi(e,this._store.flowHost,this._transform)}_unscaleSize(e){return tt.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,i,o){return new ze(e.x,e.y,i.width,i.height,this._unscaleRadius(o.radius1),this._unscaleRadius(o.radius2),this._unscaleRadius(o.radius3),this._unscaleRadius(o.radius4))}_unscaleRadius(e){return e/this._transform.scale}_getOffsetSize(e,i){return tt.offsetFromElement(e)||i}static \u0275fac=function(i){return new(i||ns)};static \u0275prov=y({token:ns,factory:ns.\u0275fac})};return t=x([w(Pn)],t),t})(),pl=class{connector;cache;static fToken=Symbol("ResolveConnectionEndpointRectRequest");constructor(n,e){this.connector=n,this.cache=e}},bO=(()=>{let t=class is{_mediator=l(D);handle({connector:e,cache:i}){let o=this._buildCacheKey(e),r=i.get(o)??this._calculateRect(e);return i.set(o,r),r}_buildCacheKey(e){return`${e.kind}::${e.fId()}`}_calculateRect(e){return this._mediator.execute(new Pn(e.hostElement))}static \u0275fac=function(i){return new(i||is)};static \u0275prov=y({token:is,factory:is.\u0275fac})};return t=x([w(pl)],t),t})(),fl=class{connection;static fToken=Symbol("ResolveConnectionEndpointsRequest");constructor(n){this.connection=n}},xO=(()=>{let t=class os{_store=l(k);handle({connection:e}){let i=this._store.outputs.get(e.fOutputId()),o=this._store.inputs.get(e.fInputId());return!i||!o?null:{source:i,target:o}}static \u0275fac=function(i){return new(i||os)};static \u0275prov=y({token:os,factory:os.\u0275fac})};return t=x([w(fl)],t),t})(),Do=class{connection;cache;static fToken=Symbol("ResolveConnectionGeometryRequest");constructor(n,e){this.connection=n,this.cache=e}},wO=(()=>{let t=class rs{_mediator=l(D);handle({connection:e,cache:i}){let o=this._resolveConnectionEndpoints(e);return o?Kt(se({},o),{sourceRect:this._resolveEndpointRect(o.source,i),targetRect:this._resolveEndpointRect(o.target,i)}):null}_resolveConnectionEndpoints(e){return this._mediator.execute(new fl(e))}_resolveEndpointRect(e,i){return this._mediator.execute(new pl(e,i))}static \u0275fac=function(i){return new(i||rs)};static \u0275prov=y({token:rs,factory:rs.\u0275fac})};return t=x([w(Do)],t),t})(),Ae=class{element;static fToken=Symbol("GetNormalizedElementRectRequest");constructor(n){this.element=n}},SO=(()=>{let t=class as{_store=l(k);_mediator=l(D);get _transform(){return this._store.transform}handle({element:e}){let i=this._mediator.execute(new Vi(e));if(i)return i;let o=G.fromElement(e),r=this._normalizePosition(o),a=this._unscaleSize(o),s=this._getUnscaledRect(r,a),c=this._getOffsetSize(e,a),u=this._fromCenter(s,c.width,c.height);return this._mediator.execute(new ko(e,u)),u}_fromCenter(e,i,o){return G.initialize(e.gravityCenter.x-i/2,e.gravityCenter.y-o/2,i,o)}_normalizePosition(e){return Qi(e,this._store.flowHost,this._transform)}_unscaleSize(e){return tt.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,i){return new ze(e.x,e.y,i.width,i.height)}_getOffsetSize(e,i){return tt.offsetFromElement(e)||i}static \u0275fac=function(i){return new(i||as)};static \u0275prov=y({token:as,factory:as.\u0275fac})};return t=x([w(Ae)],t),t})(),Qt=class{connector;static fToken=Symbol("ResolveConnectionEndpointRotationContextRequest");constructor(n){this.connector=n}},IO=(()=>{let t=class ss{_store=l(k);_mediator=l(D);handle({connector:e}){if(!e)return;let i=this._store.nodes.get(e.fNodeId);if(!i||!i._rotate)return;let o=this._mediator.execute(new Ae(i.hostElement));return{rotationDeg:i._rotate,pivot:o.gravityCenter}}static \u0275fac=function(i){return new(i||ss)};static \u0275prov=y({token:ss,factory:ss.\u0275fac})};return t=x([w(Qt)],t),t})(),hl=class{connection;geometry;static fToken=Symbol("BuildConnectionLineRequest");constructor(n,e){this.connection=n,this.geometry=e}},TO=(()=>{let t=class cs{_mediator=l(D);_connectionBehaviour=l(Zi);handle({connection:e,geometry:i}){return this._connectionBehaviour.handle(new Mt(i.sourceRect,i.targetRect,e,i.source.fConnectableSide,i.target.fConnectableSide,this._resolveRotationContext(i.source),this._resolveRotationContext(i.target)))}_resolveRotationContext(e){return this._mediator.execute(new Qt(e))}static \u0275fac=function(i){return new(i||cs)};static \u0275prov=y({token:cs,factory:cs.\u0275fac})};return t=x([w(hl)],t),t})(),Oo=class{connection;source;target;line;static fToken=Symbol("RenderConnectionWithLineRequest");constructor(n,e,i,o){this.connection=n,this.source=e,this.target=i,this.line=o}},EO=(()=>{let t=class ds{_mediator=l(D);handle({connection:e,source:i,target:o,line:r}){this._mediator.execute(new cl(i,o)),this._mediator.execute(new sl(e,r))}static \u0275fac=function(i){return new(i||ds)};static \u0275prov=y({token:ds,factory:ds.\u0275fac})};return t=x([w(Oo)],t),t})(),No=class{connection;geometry;static fToken=Symbol("RenderConnectionFromGeometryRequest");constructor(n,e){this.connection=n,this.geometry=e}},PO=(()=>{let t=class ls{_mediator=l(D);handle({connection:e,geometry:i}){let o=this._mediator.execute(new hl(e,i));this._mediator.execute(new Oo(e,i.source,i.target,o))}static \u0275fac=function(i){return new(i||ls)};static \u0275prov=y({token:ls,factory:ls.\u0275fac})};return t=x([w(No)],t),t})(),ml=class{connection;cache;static fToken=Symbol("RenderConnectionRequest");constructor(n,e){this.connection=n,this.cache=e}},MO=(()=>{let t=class us{_mediator=l(D);handle({connection:e,cache:i}){let o=this._mediator.execute(new Do(e,i));o&&this._mediator.execute(new No(e,o))}static \u0275fac=function(i){return new(i||us)};static \u0275prov=y({token:us,factory:us.\u0275fac})};return t=x([w(ml)],t),t})(),ii=class{session;static fToken=Symbol("IsConnectionRedrawCurrentRequest");constructor(n){this.session=n}},kO=(()=>{let t=class ps{_store=l(k);_state=l(wp);handle({session:e}){return e.renderTicket===this._state.renderTicket&&e.nodesRevision===this._store.nodesRevision}static \u0275fac=function(i){return new(i||ps)};static \u0275prov=y({token:ps,factory:ps.\u0275fac})};return t=x([w(ii)],t),t})(),Ro=class{session;static fToken=Symbol("CompleteConnectionRedrawRequest");constructor(n){this.session=n}},DO=(()=>{let t=class fs{_mediator=l(D);_store=l(k);handle({session:e}){this._mediator.execute(new ii(e))&&this._store.completeConnectionsRender(e.connectionsRevision,e.nodesRevision)}static \u0275fac=function(i){return new(i||fs)};static \u0275prov=y({token:fs,factory:fs.\u0275fac})};return t=x([w(Ro)],t),t})(),gl=class{batchItem;result;static fToken=Symbol("ApplyConnectionWorkerResultRequest");constructor(n,e){this.batchItem=n,this.result=e}},OO=(()=>{let t=class hs{_mediator=l(D);handle({batchItem:e,result:i}){if(e){if(!this._isSupportedWorkerResult(i)){this._fallbackToMainThread(e);return}try{e.connection._applyResolvedSidesToConnection(i.sourceSide,i.targetSide),this._mediator.execute(new Oo(e.connection,e.geometry.source,e.geometry.target,i.line))}catch{this._fallbackToMainThread(e)}}}_fallbackToMainThread(e){this._mediator.execute(new No(e.connection,e.geometry))}_isSupportedWorkerResult(e){return!!(e?.supported&&e.sourceSide&&e.targetSide&&e.line)}static \u0275fac=function(i){return new(i||hs)};static \u0275prov=y({token:hs,factory:hs.\u0275fac})};return t=x([w(gl)],t),t})(),Sn=class{connections;cache;startIndex;session;batchItems;workerResults;static fToken=Symbol("RunConnectionRedrawSliceRequest");constructor(n,e,i,o,r,a){this.connections=n,this.cache=e,this.startIndex=i,this.session=o,this.batchItems=r,this.workerResults=a}},NO=500,RO=6,AO=(()=>{let t=class ms{_mediator=l(D);_browser=l(qe);handle({connections:e,cache:i,startIndex:o,session:r,batchItems:a,workerResults:s}){if(!this._isCurrent(r))return;let c=this._now(),u=o,p=0;for(;u<e.length&&p<NO&&this._isWithinSliceBudget(c);){let g=e[u];if(a?this._mediator.execute(new gl(a[u]??null,s?.[u])):this._mediator.execute(new ml(g,i)),u++,p++,!this._isCurrent(r))return}if(u>=e.length){this._mediator.execute(new Ro(r));return}this._requestAnimationFrame(()=>this._mediator.execute(new Sn(e,i,u,r,a,s)))}_isCurrent(e){return this._mediator.execute(new ii(e))}_requestAnimationFrame(e){let i=this._browser.document.defaultView;if(!i){e();return}i.requestAnimationFrame(e)}_now(){let e=this._browser.document.defaultView?.performance;return e?e.now():Date.now()}_isWithinSliceBudget(e){return this._browser.isBrowser()?this._now()-e<RO:!0}static \u0275fac=function(i){return new(i||ms)};static \u0275prov=y({token:ms,factory:ms.\u0275fac})};return t=x([w(Sn)],t),t})(),_l=class{static fToken=Symbol("StartConnectionRedrawRequest")},FO=(()=>{let t=class gs{_store=l(k);_state=l(wp);handle(e){return this._state.resetConnectedConnectors(),{renderTicket:this._state.beginRender(),connectionsRevision:this._store.connectionsRevision,nodesRevision:this._store.nodesRevision}}static \u0275fac=function(i){return new(i||gs)};static \u0275prov=y({token:gs,factory:gs.\u0275fac})};return t=x([w(_l)],t),t})(),Ao=class{static fToken=Symbol("RedrawConnectionsRequest")},vl=class{connectionCount;static fToken=Symbol("ShouldUseConnectionWorkerRequest");constructor(n){this.connectionCount=n}},Fo=class{static fToken=Symbol("IsConnectionWorkerEnabledRequest")},LO=(()=>{let t=class _s{_browser=l(qe);_state=l(ci);handle(e){if(this._state.isDisabled||!this._isWorkerAvailable())return!1;let i=this._browser.document.defaultView;return lv(i)}_isWorkerAvailable(){return this._browser.isBrowser()}static \u0275fac=function(i){return new(i||_s)};static \u0275prov=y({token:_s,factory:_s.\u0275fac})};return t=x([w(Fo)],t),t})(),BO=(()=>{let t=class vs{_mediator=l(D);handle({connectionCount:e}){return e>0&&this._mediator.execute(new Fo)}static \u0275fac=function(i){return new(i||vs)};static \u0275prov=y({token:vs,factory:vs.\u0275fac})};return t=x([w(vl)],t),t})(),yl=class{connection;geometry;originalIndex;static fToken=Symbol("BuildConnectionWorkerPayloadItemRequest");constructor(n,e,i){this.connection=n,this.geometry=e,this.originalIndex=i}},zO=(()=>{let t=class ys{_store=l(k);handle({connection:e,geometry:i,originalIndex:o}){let{source:r,target:a,sourceRect:s,targetRect:c}=i;return{originalIndex:o,behavior:e.fBehavior,outputSide:e.fOutputSide(),inputSide:e.fInputSide(),sourceConnectableSide:r.fConnectableSide,targetConnectableSide:a.fConnectableSide,sourceRotation:this._store.nodes.get(r.fNodeId)?._rotate||0,targetRotation:this._store.nodes.get(a.fNodeId)?._rotate||0,sourceRect:{x:s.x,y:s.y,width:s.width,height:s.height,radius1:s.radius1,radius2:s.radius2,radius3:s.radius3,radius4:s.radius4},targetRect:{x:c.x,y:c.y,width:c.width,height:c.height,radius1:c.radius1,radius2:c.radius2,radius3:c.radius3,radius4:c.radius4}}}static \u0275fac=function(i){return new(i||ys)};static \u0275prov=y({token:ys,factory:ys.\u0275fac})};return t=x([w(yl)],t),t})(),Cl=class{connections;cache;static fToken=Symbol("BuildConnectionWorkerBatchRequest");constructor(n,e){this.connections=n,this.cache=e}},qO=(()=>{let t=class Cs{_mediator=l(D);handle({connections:e,cache:i}){let o=new Array(e.length),r=[];for(let a=0;a<e.length;a++){let s=this._buildBatchItem(e[a],i,a);o[a]=s,s&&r.push(s.payload)}return{items:o,payload:r}}_buildBatchItem(e,i,o){let r=this._mediator.execute(new Do(e,i));return r?{connection:e,geometry:r,payload:this._mediator.execute(new yl(e,r,o))}:null}static \u0275fac=function(i){return new(i||Cs)};static \u0275prov=y({token:Cs,factory:Cs.\u0275fac})};return t=x([w(Cl)],t),t})(),bl=class{error;static fToken=Symbol("DisableConnectionWorkerRequest");constructor(n){this.error=n}},Lo=class{error;static fToken=Symbol("ResetConnectionWorkerRuntimeRequest");constructor(n){this.error=n}},VO=(()=>{let t=class bs{_state=l(ci);handle({error:e}){this._state.resetRuntime(e)}static \u0275fac=function(i){return new(i||bs)};static \u0275prov=y({token:bs,factory:bs.\u0275fac})};return t=x([w(Lo)],t),t})(),GO=(()=>{let t=class xs{_state=l(ci);_mediator=l(D);handle({error:e}){this._state.isDisabled=!0,this._mediator.execute(new Lo(e))}static \u0275fac=function(i){return new(i||xs)};static \u0275prov=y({token:xs,factory:xs.\u0275fac})};return t=x([w(bl)],t),t})(),xl=class{message;static fToken=Symbol("HandleConnectionWorkerMessageRequest");constructor(n){this.message=n}},HO=(()=>{let t=class ws{_state=l(ci);handle({message:e}){if(!e||typeof e.requestId!="number")return;let i=this._state.pending.get(e.requestId);if(i){if(this._state.pending.delete(e.requestId),e.error){i.reject(new Error(e.error));return}i.resolve(e.results??[])}}static \u0275fac=function(i){return new(i||ws)};static \u0275prov=y({token:ws,factory:ws.\u0275fac})};return t=x([w(xl)],t),t})(),wl=class{static fToken=Symbol("EnsureConnectionWorkerRequest")},jO=(()=>{let t=class Ss{_browser=l(qe);_state=l(ci);_mediator=l(D);handle(e){if(this._state.worker)return this._state.worker;let i=this._browser.document.defaultView;if(!lv(i))return null;let o=uv(i);if(!o)return null;let r=aO(o);try{let a=new o.workerCtor(r,{name:"f-flow-connection-worker"});return a.onmessage=s=>{this._mediator.execute(new xl(s.data))},a.onerror=()=>{this._resetWorkerAfterRuntimeError(new Error("Connection worker runtime error."))},a.onmessageerror=()=>{this._resetWorkerAfterRuntimeError(new Error("Connection worker message deserialization error."))},this._state.workerUrl=r,this._state.worker=a,a}catch(a){return pv(r,o.urlApi),this._disableWorker(a instanceof Error?a:new Error("Connection worker initialization failed.")),null}}_disableWorker(e){this._mediator.execute(new bl(e))}_resetWorkerAfterRuntimeError(e){this._mediator.execute(new Lo(e))}static \u0275fac=function(i){return new(i||Ss)};static \u0275prov=y({token:Ss,factory:Ss.\u0275fac})};return t=x([w(wl)],t),t})(),Sl=class{payload;static fToken=Symbol("RunConnectionWorkerRequest");constructor(n){this.payload=n}},UO=(()=>{let t=class Is{_state=l(ci);_mediator=l(D);handle({payload:e}){if(!e.length)return Promise.resolve([]);if(!this._mediator.execute(new Fo))return Promise.reject(new Error("Connection worker is disabled."));this._interruptPendingRequests();let i=this._mediator.execute(new wl);if(!i)return Promise.reject(new Error("Unable to initialize connection worker."));let o=++this._state.nextRequestId;return new Promise((r,a)=>{this._state.pending.set(o,{resolve:r,reject:a});try{i.postMessage({requestId:o,items:e})}catch(s){this._state.pending.delete(o),a(s instanceof Error?s:new Error("Unknown error while posting message to connection worker."))}})}_interruptPendingRequests(){if(!this._state.pending.size)return;let e=new Error("Connection worker request was superseded by a newer redraw.");this._state.pending.forEach(i=>i.reject(e)),this._state.pending.clear()}static \u0275fac=function(i){return new(i||Is)};static \u0275prov=y({token:Is,factory:Is.\u0275fac})};return t=x([w(Sl)],t),t})(),Il=class{batch;static fToken=Symbol("RunConnectionWorkerBatchRequest");constructor(n){this.batch=n}},WO=(()=>{let t=class Ts{_mediator=l(D);handle({batch:e}){return e.payload.length?this._mediator.execute(new Sl(e.payload)):Promise.resolve([])}static \u0275fac=function(i){return new(i||Ts)};static \u0275prov=y({token:Ts,factory:Ts.\u0275fac})};return t=x([w(Il)],t),t})(),Tl=class{connections;cache;session;static fToken=Symbol("StartConnectionWorkerRedrawRequest");constructor(n,e,i){this.connections=n,this.cache=e,this.session=i}},$O=(()=>{let t=class Es{_mediator=l(D);handle({connections:e,cache:i,session:o}){let r=this._mediator.execute(new Cl(e,i));if(!r.payload.length){this._mediator.execute(new Sn(e,i,0,o,r.items));return}this._mediator.execute(new Il(r)).then(a=>{this._mediator.execute(new ii(o))&&this._mediator.execute(new Sn(e,i,0,o,r.items,this._alignWorkerResults(a,e.length)))}).catch(()=>{this._mediator.execute(new ii(o))&&this._mediator.execute(new Sn(e,i,0,o,r.items))})}_alignWorkerResults(e,i){let o=new Array(i);for(let r of e){let a=r.originalIndex;a<0||a>=i||(o[a]=r)}return o}static \u0275fac=function(i){return new(i||Es)};static \u0275prov=y({token:Es,factory:Es.\u0275fac})};return t=x([w(Tl)],t),t})(),KO=(()=>{let t=class Ps{_mediator=l(D);_store=l(k);handle(e){let i=this._mediator.execute(new _l);this._createMarkersForCreate(),this._createMarkersForSnap();let o=[...this._store.connections.getAll()],r=new Map;if(!o.length){this._mediator.execute(new Ro(i));return}this._shouldUseConnectionWorker(o.length)?this._redrawUsingWorker(o,r,i):this._redrawWithoutWorker(o,r,i)}_createMarkersForCreate(){let e=this._store.connections.getForCreate();e&&this._mediator.execute(new zi(e))}_createMarkersForSnap(){let e=this._store.connections.getForSnap();e&&this._mediator.execute(new zi(e))}_shouldUseConnectionWorker(e){return this._mediator.execute(new vl(e))}_redrawUsingWorker(e,i,o){this._mediator.execute(new Tl(e,i,o))}_redrawWithoutWorker(e,i,o){this._mediator.execute(new Sn(e,i,0,o))}static \u0275fac=function(i){return new(i||Ps)};static \u0275prov=y({token:Ps,factory:Ps.\u0275fac})};return t=x([w(Ao)],t),t})(),Dh=class{static fToken=Symbol("RemoveConnectionForCreateFromStoreRequest")},YO=(()=>{let t=class Ms{_store=l(k);handle(e){this._store.connections.removeInstanceForCreate()}static \u0275fac=function(i){return new(i||Ms)};static \u0275prov=y({token:Ms,factory:Ms.\u0275fac})};return t=x([w(Dh)],t),t})(),El=class{connection;static fToken=Symbol("RemoveConnectionFromStoreRequest");constructor(n){this.connection=n}},XO=(()=>{let t=class ks{_store=l(k);handle({connection:e}){this._store.connections.remove(e),this._store.emitConnectionChanges()}static \u0275fac=function(i){return new(i||ks)};static \u0275prov=y({token:ks,factory:ks.\u0275fac})};return t=x([w(El)],t),t})(),Pl=class{instance;static fToken=Symbol("RemoveConnectionMarkerFromStoreRequest");constructor(n){this.instance=n}},ZO=(()=>{let t=class Ds{_store=l(k);handle({instance:e}){this._store.connectionMarkers.remove(e),this._store.emitNodeChanges()}static \u0275fac=function(i){return new(i||Ds)};static \u0275prov=y({token:Ds,factory:Ds.\u0275fac})};return t=x([w(Pl)],t),t})(),Oh=class{waypointIndex;connectionId;static fToken=Symbol("RemoveConnectionWaypointRequest");constructor(n,e){this.waypointIndex=n,this.connectionId=e}},Ml=class{static fToken=Symbol("EmitEndDragSequenceEventRequest")},QO=(()=>{let t=class Os{_store=l(k);_dragSession=l(Q);handle(e){this._store.flowHost.classList.remove(je.DRAG_AND_DROP.DRAGGING),this._dragSession.reset(),this._emitEvent()}_emitEvent(){this._store.fDraggable?.fDragEnded?.emit()}static \u0275fac=function(i){return new(i||Os)};static \u0275prov=y({token:Os,factory:Os.\u0275fac})};return t=x([w(Ml)],t),t})(),kl=class{static fToken=Symbol("EmitStartDragSequenceEventRequest")},JO=(()=>{let t=class Ns{_mediator=l(D);_store=l(k);_dragContext=l(Q);handle(e){this._dragContext.draggableItems.length>0&&(this._store.flowHost.classList.add(je.DRAG_AND_DROP.DRAGGING),this._mediator.execute(new Bo),this._emitDragStarted())}_emitDragStarted(){let e=this._dragContext.draggableItems[0].getEvent();this._store.fDraggable?.fDragStarted?.emit(new Fl(e.kind,e.data?se({},e.data):void 0,e.fEventType))}static \u0275fac=function(i){return new(i||Ns)};static \u0275prov=y({token:Ns,factory:Ns.\u0275fac})};return t=x([w(kl)],t),t})(),Bo=class{static fToken=Symbol("EmitSelectionChangeEventRequest")},oi=class{_event;_target;get originalEvent(){return this._event}get targetElement(){return this._target||this.originalEvent.target}get touchEvent(){return this._event}get touches(){return this.touchEvent.touches}constructor(n,e){this._event=n,this._target=e}setTarget(n){this._target=n}preventDefault(){this.originalEvent.preventDefault()}get isEventInLockedContext(){return this.targetElement.closest("[fLockedContext]")!==null}},Dl=class extends oi{constructor(n,e){super(n,e)}isMouseLeftButton(){return this.originalEvent.button===0}isMouseRightButton(){return this.originalEvent.buttons===2}getPosition(){return{x:this.originalEvent.clientX,y:this.originalEvent.clientY}}},Nh=class extends oi{constructor(n,e){super(n,e)}isMouseLeftButton(){let n=this.originalEvent;return n.pointerType==="mouse"&&n.button===0||n.pointerType==="touch"}isMouseRightButton(){let n=this.originalEvent;return n.pointerType==="mouse"&&n.button===2||n.pointerType==="touch"}getPosition(){let n=this.originalEvent;return{x:n.clientX,y:n.clientY}}getPointerType(){return this.originalEvent.pointerType}getPointerId(){return this.originalEvent.pointerId}},Rh=class extends oi{constructor(n){super(n)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let n=this.originalEvent.touches;return{x:n[0].clientX,y:n[0].clientY}}},Ah=class extends oi{constructor(n,e){super(n,e)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let n=this.originalEvent.targetTouches[0];return{x:n.clientX,y:n.clientY}}},ve=(()=>{class t{static _isSupported;static _isPassiveEventListenerSupported(){if(t._isSupported==null&&typeof window<"u")try{window.addEventListener("test",t.emptyListener,{passive:!0}),t._isSupported=!0}catch{t._isSupported=!1}return t._isSupported}static _passiveEventListener(e){return t._isPassiveEventListenerSupported()?e:!!e.capture}static activeListener(){return t._passiveEventListener({passive:!1})}static passiveListener(){return t._passiveEventListener({passive:!0})}static activeCaptureListener(){return t._passiveEventListener({passive:!1,capture:!0})}static emptyListener(){return()=>{}}}return t})(),eN=800,Fh=class{_document=l(Hr);_ngZone=l(Un,{optional:!0});_mouseListeners=ve.emptyListener();_touchListeners=ve.emptyListener();_startListeners=ve.emptyListener();isSyntheticEvent(n){return!!this._lastTouchEventTime&&this._lastTouchEventTime+eN>Date.now()}_lastTouchEventTime=0;isDragStarted=!1;_dragStartThreshold=3;_dragStartDelay=0;_dragStartTime=0;_dragStartPosition={x:0,y:0};_moveHandler=this._checkDragSequenceToStart;_pointerDownElement=null;_onMouseDown=n=>{let e=this.isSyntheticEvent(n),i=nN(n),o=new Dl(n);if(e||i||this.disabled||this.isDragStarted)return;this._pointerDownElement=o.targetElement,this.onPointerDown(o)&&(this._dragStartTime=Date.now(),this._dragStartPosition=o.getPosition(),this._ngZone?.runOutsideAngular(()=>{this._listen("selectstart",this._onSelectStart,ve.activeListener()),this._listen("mousemove",this._onMouseMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,ve.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,ve.activeCaptureListener())}),this._mouseListeners=()=>{this._unlisten("selectstart",this._onSelectStart,ve.activeListener()),this._unlisten("mousemove",this._onMouseMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,ve.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,ve.activeCaptureListener())})};_onTouchDown=n=>{let e=iN(n),i=new Rh(n);if(e||this.disabled||this.isDragStarted)return;this._pointerDownElement=i.targetElement,this.onPointerDown(i)&&(this._dragStartTime=Date.now(),this._dragStartPosition=i.getPosition(),this._ngZone?.runOutsideAngular(()=>{this._listen("selectstart",this._onSelectStart,ve.activeListener()),this._listen("touchmove",this._onTouchMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,ve.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,ve.activeCaptureListener())}),this._touchListeners=()=>{this._unlisten("selectstart",this._onSelectStart,ve.activeListener()),this._unlisten("touchmove",this._onTouchMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,ve.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,ve.activeCaptureListener())})};_onSelectStart=n=>{this.onSelect(n)};_onMouseMove=n=>{this._moveHandler(new Dl(n))};_onTouchMove=n=>{this._moveHandler(new Ah(n))};_checkDragSequenceToStart(n){let e=n.getPosition();if(!this.isDragStarted&&this._pointerDownElement){n.setTarget(this._pointerDownElement);let i=Math.abs(e.x-this._dragStartPosition.x),o=Math.abs(e.y-this._dragStartPosition.y);if(i+o>=this._dragStartThreshold){if(!(Date.now()>=this._dragStartTime+this._dragStartDelay)){this._endDragSequence();return}n.preventDefault(),this.prepareDragSequence(n),this.isDragStarted=!0,this._moveHandler=this.onPointerMove,tN(n.originalEvent)&&(this._lastTouchEventTime=Date.now())}}}_onPointerUpEvent=n=>{this.isDragStarted&&this.onPointerUp(new Nh(n)),this._endDragSequence()};_endDragSequence(){this.isDragStarted=!1,this._pointerDownElement=null,this._moveHandler=this._checkDragSequenceToStart,this._mouseListeners(),this._mouseListeners=ve.emptyListener(),this._touchListeners(),this._touchListeners=ve.emptyListener(),this.finalizeDragSequence()}subscribe(){this.unsubscribe(),this._ngZone?.runOutsideAngular(()=>{this._listen("mousedown",this._onMouseDown,ve.activeListener()),this._listen("touchstart",this._onTouchDown,ve.passiveListener())}),this._startListeners=()=>{this._unlisten("mousedown",this._onMouseDown,ve.activeListener()),this._unlisten("touchstart",this._onTouchDown,ve.passiveListener())}}unsubscribe(){this._startListeners(),this._startListeners=ve.emptyListener(),this._touchListeners(),this._touchListeners=ve.emptyListener(),this._mouseListeners(),this._mouseListeners=ve.emptyListener()}_listen(n,e,i){this._document.addEventListener(n,e,i)}_unlisten(n,e,i){this._document.removeEventListener(n,e,i)}_preventDuringDrag=n=>{this.isDragStarted&&n.preventDefault()}};function tN(t){return t.type[0]==="t"}function nN(t){return t.buttons===0||t.offsetX===0&&t.offsetY===0}function iN(t){let n=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!!n&&n.identifier===-1&&(n.radiusX==null||n.radiusX===1)&&(n.radiusY==null||n.radiusY===1)}var Lh=class extends oi{_position;_isMouseLeftButton;_isMouseRightButton;constructor(n){super(n.originalEvent,n.targetElement),this._position=n.getPosition(),this._isMouseLeftButton=n.isMouseLeftButton(),this._isMouseRightButton=n.isMouseRightButton()}isMouseLeftButton(){return this._isMouseLeftButton}isMouseRightButton(){return this._isMouseRightButton}getPosition(){return se({},this._position)}};function oN(t){return new Lh(t)}var Q=(()=>{class t{selectedItems=[];isSelectedChanged=!1;onPointerDownScale=1;onPointerDownPosition=new Z(0,0);draggableItems=[];autoPanFrameId=null;lastPointerEvent=null;lastPointerPosition=null;isAutoPanCanvasMoved=!1;reset(){for(let e of this.draggableItems)try{e.destroy?.()}catch{console.error(`Error while destroying drag handler of type ${e.type}`)}this.draggableItems=[],this.onPointerDownScale=1,this.onPointerDownPosition=new Z(0,0),this.autoPanFrameId=null,this.lastPointerEvent=null,this.lastPointerPosition=null,this.isAutoPanCanvasMoved=!1}markSelectionAsChanged(){this.isSelectedChanged=!0}rememberPointerEvent(e){this.lastPointerEvent=oN(e),this.lastPointerPosition=this.lastPointerEvent.getPosition()}isEmpty(){return!this.draggableItems.length}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Bh=class{nodeIds;groupIds;connectionIds;get fNodeIds(){return this.nodeIds}get fGroupIds(){return this.groupIds}get fConnectionIds(){return this.connectionIds}constructor(n,e,i){this.nodeIds=n,this.groupIds=e,this.connectionIds=i}},rN=(()=>{let t=class Rs{_mediator=l(D);_store=l(k);_dragSession=l(Q);handle(e){this._dragSession.isSelectedChanged&&(this._emitSelectionChange(this._getSelection()),this._dragSession.isSelectedChanged=!1,this._mediator.execute(new In))}_getSelection(){return this._mediator.execute(new sr)}_emitSelectionChange(e){this._store.fDraggable?.fSelectionChange.emit(new Bh(e.fNodeIds,e.fGroupIds,e.fConnectionIds))}static \u0275fac=function(i){return new(i||Rs)};static \u0275prov=y({token:Rs,factory:Rs.\u0275fac})};return t=x([w(Bo)],t),t})(),zh=class{nodeOrGroup;static fToken=Symbol("GetNormalizedParentNodeRectRequest");constructor(n){this.nodeOrGroup=n}},aN=(()=>{let t=class As{_store=l(k);_mediator=l(D);handle({nodeOrGroup:e}){let i=G.initialize(-1/0,-1/0,1/0,1/0),o=this._getNode(e.fParentId());return o&&(i=this._getParentRect(o)),i}_getNode(e){return this._store.nodes.get(e)}_getParentRect(e){let i=this._getNodeRect(e),o=this._getNodePadding(e,i);return G.initialize(i.x+o[0],i.y+o[1],i.width-o[0]-o[2],i.height-o[1]-o[3])}_getNodeRect(e){return this._mediator.execute(new Ae(e.hostElement))}_getNodePadding(e,i){return this._mediator.execute(new ai(e,i))}static \u0275fac=function(i){return new(i||As)};static \u0275prov=y({token:As,factory:As.\u0275fac})};return t=x([w(zh)],t),t})(),qh=class{fParentNodes;fDraggedNodes;static fToken=Symbol("IsArrayHasParentNodeRequest");constructor(n,e){this.fParentNodes=n,this.fDraggedNodes=e}},sN=(()=>{let t=class Fs{handle(e){return this._isParentNodeInArray(this._getParentNodeIds(e.fParentNodes),e.fDraggedNodes)}_getParentNodeIds(e){return e.map(i=>i.fId())}_isParentNodeInArray(e,i){return i.some(o=>e.includes(o.fId()))}static \u0275fac=function(i){return new(i||Fs)};static \u0275prov=y({token:Fs,factory:Fs.\u0275fac})};return t=x([w(qh)],t),t})(),Vh=class{fNodeId;fConnectionIds;constructor(n,e){this.fNodeId=n,this.fConnectionIds=e}},Ol=class extends Vh{nodeId;connectionIds;constructor(n,e){super(n,e),this.nodeId=n,this.connectionIds=e}},Nl=class{nodeOrGroup;static fToken=Symbol("DetectConnectionsUnderDragNodeRequest");constructor(n){this.nodeOrGroup=n}},cN=(()=>{let t=class Ls{_mediator=l(D);_store=l(k);handle({nodeOrGroup:e}){let i=this._collectConnectableConnectorIds(e,"source"),o=this._collectConnectableConnectorIds(e,"target");if(!i.size||!o.size)return;let r=this._collectAttachedConnectionIds(i,o),a=this._collectConnectionsUnderNode(e),s=[];for(let c of a){let u=c.fId();r.has(u)||s.push(u)}s.length&&(this._store.fDraggable?.fNodeIntersectedWithConnections.emit(new Ol(e.fId(),s)),this._store.fDraggable?.fNodeConnectionsIntersection.emit(new Ol(e.fId(),s)))}_collectConnectableConnectorIds(e,i){let o=i==="source"?this._store.outputs.getAll():this._store.inputs.getAll(),r=new Set;for(let a of o)a.canBeConnected&&e.isContains(a.hostElement)&&r.add(a.fId());return r}_collectAttachedConnectionIds(e,i){let o=new Set;for(let r of this._store.connections.getAll())(e.has(r.fOutputId())||i.has(r.fInputId()))&&o.add(r.fId());return o}_collectConnectionsUnderNode(e){let i=this._mediator.execute(new Pn(e.hostElement,!1)),o=[];for(let r of this._store.connections.getAll())this._hasIntersection(r,i)&&o.push(r);return o}_hasIntersection(e,i){return Di.getRoundedRectIntersectionsWithSVGPath(e.fPath().hostElement,i).length>0}static \u0275fac=function(i){return new(i||Ls)};static \u0275prov=y({token:Ls,factory:Ls.\u0275fac})};return t=x([w(Nl)],t),t})(),dN=[JO,QO,rN,aN,sN,cN],lN=new Set(["create-connection","reassign-connection","drag-node"]),uN=new Set(["selection-area"]),pN=new Set(["assign-to-container"]);function hv(t){let n=null;for(let e of t){if(pN.has(e))continue;let i=lN.has(e)?"rebase":uN.has(e)?"direct":null;if(!i)return null;if(!n){n=i;continue}if(n!==i)return null}return n}function mv(t,n,e,i,o){return A.initialize(M0(t.x,n.left,n.right,e,i,o),M0(t.y,n.top,n.bottom,e,i,o))}function M0(t,n,e,i,o,r){let a=Math.max(0,i),s=Math.max(0,o);if(!a||!s)return 0;if(t<=n+a){let c=D0((n+a-t)/a,0,1);return k0(c,s,r)}if(t>=e-a){let c=D0((t-(e-a))/a,0,1);return-k0(c,s,r)}return 0}function fN(t,n,e){let i=e||1;return Z.fromPoint(t).add(Z.fromPoint(n).div(i))}function k0(t,n,e){return e?n*t:n}function D0(t,n,e){return Math.max(n,Math.min(e,t))}var Rl=class{static fToken=Symbol("RunAutoPanFrameRequest")},Mn=class{static fToken=Symbol("StopAutoPanRequest")},hN=(()=>{let t=class Bs{_store=l(k);_dragContext=l(Q);handle(e){this._dragContext.autoPanFrameId!==null&&(cancelAnimationFrame(this._dragContext.autoPanFrameId),this._dragContext.autoPanFrameId=null),this._dragContext.isAutoPanCanvasMoved&&(this._store.fCanvas?.emitCanvasChangeEvent(),this._dragContext.isAutoPanCanvasMoved=!1)}static \u0275fac=function(i){return new(i||Bs)};static \u0275prov=y({token:Bs,factory:Bs.\u0275fac})};return t=x([w(Mn)],t),t})(),zo=class{static fToken=Symbol("SyncAutoPanRequest")},mN=(()=>{let t=class zs{_mediator=l(D);_store=l(k);_dragContext=l(Q);handle(e){if(!this._canAutoPan()||!this._hasAutoPanDelta()){this._mediator.execute(new Mn);return}this._dragContext.autoPanFrameId===null&&(this._dragContext.autoPanFrameId=requestAnimationFrame(()=>{this._dragContext.autoPanFrameId=null,this._mediator.execute(new Rl)}))}_canAutoPan(){return!!this._store.fFlow&&!!this._store.fCanvas&&!!this._store.fDraggable?.isDragStarted&&!!this._autoPan()&&!!this._getAutoPanMode()&&this._edgeThreshold()>0&&this._speed()>0}_hasAutoPanDelta(){let e=this._getAutoPanDelta();return!!e.x||!!e.y}_getAutoPanDelta(){let e=this._dragContext.lastPointerPosition,i=this._store.fFlow?.hostElement;return!e||!i?A.initialize():mv(e,i.getBoundingClientRect(),this._edgeThreshold(),this._speed(),this._acceleration())}_getAutoPanMode(){return hv(this._dragContext.draggableItems.map(e=>e.getEvent().kind))}_edgeThreshold(){return Math.max(0,this._autoPan()?.fEdgeThreshold()??0)}_speed(){return Math.max(0,this._autoPan()?.fSpeed()??0)}_acceleration(){return!!this._autoPan()?.fAcceleration()}_autoPan(){return this._store.instances.get(Ie.AUTO_PAN)}static \u0275fac=function(i){return new(i||zs)};static \u0275prov=y({token:zs,factory:zs.\u0275fac})};return t=x([w(zo)],t),t})(),gN=(()=>{let t=class qs{_mediator=l(D);_store=l(k);_dragContext=l(Q);handle(e){let i=this._getAutoPanMode();if(!this._canAutoPan(i)){this._mediator.execute(new Mn);return}let o=this._getAutoPanDelta();if(!o.x&&!o.y){this._mediator.execute(new Mn);return}this._applyCanvasDelta(o,i),this._replayLastPointerMove(),this._mediator.execute(new zo)}_applyCanvasDelta(e,i){let o=this._store.transform;i==="rebase"&&(this._dragContext.onPointerDownPosition=fN(this._dragContext.onPointerDownPosition,e,this._dragContext.onPointerDownScale||o.scale||1)),o.position=Z.fromPoint(o.position).add(e),this._store.fCanvas?.redraw(),this._dragContext.isAutoPanCanvasMoved=!0}_replayLastPointerMove(){let e=this._dragContext.lastPointerEvent;if(!e)return;let i=this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition);this._dragContext.draggableItems.forEach(o=>{o.onPointerMove(se({},i),e)})}_getPointerPositionInCanvas(e){return Z.fromPoint(e.getPosition()).elementTransform(this._store.flowHost)}_canAutoPan(e){return!!this._store.fFlow&&!!this._store.fCanvas&&!!this._store.fDraggable?.isDragStarted&&!!this._autoPan()&&!!e&&this._edgeThreshold()>0&&this._speed()>0}_getAutoPanMode(){return hv(this._dragContext.draggableItems.map(e=>e.getEvent().kind))}_getAutoPanDelta(){let e=this._dragContext.lastPointerPosition,i=this._store.fFlow?.hostElement;return!e||!i?A.initialize():mv(e,i.getBoundingClientRect(),this._edgeThreshold(),this._speed(),this._acceleration())}_edgeThreshold(){return Math.max(0,this._autoPan()?.fEdgeThreshold()??0)}_speed(){return Math.max(0,this._autoPan()?.fSpeed()??0)}_acceleration(){return!!this._autoPan()?.fAcceleration()}_autoPan(){return this._store.instances.get(Ie.AUTO_PAN)}static \u0275fac=function(i){return new(i||qs)};static \u0275prov=y({token:qs,factory:qs.\u0275fac})};return t=x([w(Rl)],t),t})(),_N=[mN,gN,hN],Al=class{event;static fToken=Symbol("DragCanvasFinalizeRequest");constructor(n){this.event=n}},Fl=class{kind;data;fEventType;get fData(){return this.data}constructor(n,e,i){this.kind=n,this.data=e,this.fEventType=i??n}},nt=class{data(){}_features=[];getEvent(){return new Fl(this.kind,this.data(),this.type)}attachFeature(n){this._features.push(n)}featuresPrepare(n){for(let e of this._features)e.onPrepare?.(n)}featuresMove(n,e){for(let i of this._features)i.onMove?.(n,e)}featuresFinalize(n,e){for(let i of this._features)i.onFinalize?.(n,e)}featuresEnd(n){for(let e of this._features)e.onEnd?.(n)}},Ll=class{_isConnected=!1;get isConnected(){return this._isConnected}toConnector=[];isSelfConnectable=!0;fConnectableSide=F.AUTO;userFConnectableSide=F.AUTO;isContains(n){return this.hostElement.contains(n)}setConnected(n){this._isConnected=!0,this.toConnector.push(n)}resetConnected(){this._isConnected=!1,this.toConnector=[]}},vN=new ue("F_NODE_INPUT"),yN=(()=>{class t extends Ll{kind="input";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275dir=Ee({type:t,standalone:!1,features:[he]})}return t})(),Lt=(function(t){return t.LEFT="left",t.LEFT_TOP="left-top",t.TOP="top",t.RIGHT_TOP="right-top",t.RIGHT="right",t.RIGHT_BOTTOM="right-bottom",t.BOTTOM="bottom",t.LEFT_BOTTOM="left-bottom",t})(Lt||{});function CN(t){return So(t,".f-rotate-handle")}var gv=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,selectors:[["","fDragHandle",""]],hostAttrs:[1,"f-drag-handle","f-component"],standalone:!1})}return t})(),Sp=new ue("F_NODE"),bN=sv(class{hostElement;constructor(t){this.hostElement=t}}),Bl=class extends bN{_injector=l(Ze);renderer=l(v_);browser=l(qe);stateChanges=new Ct;_position=A.initialize();_rotate=0;_size;connectors=[];positionChanges(){ie(()=>{let n=this.position();Rt(()=>{A.isEqual(this._position,n)||(this._position=n,this.redraw(),this.refresh())})},{injector:this._injector})}sizeChanges(){ie(()=>{let n=this.size();Rt(()=>{this._isSizeEqual(n)||(this._size=n,this.redraw(),this.refresh())})},{injector:this._injector})}rotateChanges(){ie(()=>{let n=this.rotate();Rt(()=>{this._rotate!==n&&(this._rotate=n,this.redraw(),this.refresh())})},{injector:this._injector})}parentChanges(){ie(()=>{this.fParentId(),this.fIncludePadding(),this.fAutoSizeToFitChildren(),Rt(()=>this.refresh())},{injector:this._injector})}_isSizeEqual(n){return this._size?.width===n?.width&&this._size?.height===n?.height}isContains(n){return this.hostElement.contains(n)}redraw(){this._size&&(this.setStyle("width",""+this._size.width+"px"),this.setStyle("height",""+this._size.height+"px")),this.setStyle("transform",`translate(${this._position.x}px,${this._position.y}px) rotate(${this._rotate}deg)`)}resetSize(){this.removeStyle("width"),this.removeStyle("height")}updatePosition(n){this._position=n}updateRotate(n){this._rotate=n}updateSize(n){this._size=n}setClass(n){this.hostElement.classList.add(n)}removeClass(n){this.hostElement.classList.remove(n)}addConnector(n){this.connectors.push(n),this.refresh()}removeConnector(n){let e=this.connectors.indexOf(n);e!==-1&&this.connectors.splice(e,1),this.refresh()}},xN=0,wN=3,Gh=(()=>{class t extends Bl{_debounceTimer=null;_destroyRef=l(ot);_mediator=l(D);fId=N(`f-group-${xN++}`,{alias:"fGroupId"});fParentId=N(null,{alias:"fGroupParentId"});position=Kn(A.initialize(),{alias:"fGroupPosition"});size=N(void 0,{alias:"fGroupSize"});sizeChange=Le({alias:"fGroupSizeChange"});rotate=Kn(0,{alias:"fGroupRotate"});fConnectOnNode=N(!0,{transform:me});fMinimapClass=N([]);fDraggingDisabled=N(!1,{alias:"fGroupDraggingDisabled",transform:me});fSelectionDisabled=N(!1,{alias:"fGroupSelectionDisabled",transform:me});fIncludePadding=N(!0,{transform:me});fAutoExpandOnChildHit=N(!1,{transform:me});fAutoSizeToFitChildren=N(!1,{transform:me});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new er(this))}setStyle(e,i){this.renderer.setStyle(this.hostElement,e,i)}removeStyle(e){this.renderer.removeStyle(this.hostElement,e)}redraw(){super.redraw(),this._mediator.execute(new In),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),wN))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new ji(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new nr(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new ir(this))}static \u0275fac=function(i){return new(i||t)(zf(Oe))};static \u0275dir=Ee({type:t,selectors:[["","fGroup",""]],hostAttrs:[1,"f-group","f-component"],hostVars:5,hostBindings:function(i,o){i&2&&(q("data-f-group-id",o.fId()),de("f-group-dragging-disabled",o.fDraggingDisabled())("f-group-selection-disabled",o.fSelectionDisabled()))},inputs:{fId:[1,"fGroupId","fId"],fParentId:[1,"fGroupParentId","fParentId"],position:[1,"fGroupPosition","position"],size:[1,"fGroupSize","size"],rotate:[1,"fGroupRotate","rotate"],fConnectOnNode:[1,"fConnectOnNode"],fMinimapClass:[1,"fMinimapClass"],fDraggingDisabled:[1,"fGroupDraggingDisabled","fDraggingDisabled"],fSelectionDisabled:[1,"fGroupSelectionDisabled","fSelectionDisabled"],fIncludePadding:[1,"fIncludePadding"],fAutoExpandOnChildHit:[1,"fAutoExpandOnChildHit"],fAutoSizeToFitChildren:[1,"fAutoSizeToFitChildren"]},outputs:{position:"fGroupPositionChange",sizeChange:"fGroupSizeChange",rotate:"fGroupRotateChange"},exportAs:["fComponent"],standalone:!1,features:[_e([{provide:Sp,useExisting:t}]),he]})}return t})(),O0=0,SN=3,Ip=(()=>{class t extends Bl{_debounceTimer=null;_destroyRef=l(ot);_mediator=l(D);fId=N(`f-node-${O0++}`,{alias:"fNodeId",transform:e=>Gi(e)||`f-node-${O0++}`});fParentId=N(null,{alias:"fNodeParentId"});position=Kn(A.initialize(),{alias:"fNodePosition"});size=N(void 0,{alias:"fNodeSize"});sizeChange=Le({alias:"fNodeSizeChange"});rotate=Kn(0,{alias:"fNodeRotate"});fConnectOnNode=N(!0,{transform:me});fMinimapClass=N([]);fDraggingDisabled=N(!1,{alias:"fNodeDraggingDisabled",transform:me});fSelectionDisabled=N(!1,{alias:"fNodeSelectionDisabled",transform:me});fIncludePadding=N(!0,{transform:me});fAutoExpandOnChildHit=N(!1,{transform:me});fAutoSizeToFitChildren=N(!1,{transform:me});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new er(this))}setStyle(e,i){this.renderer.setStyle(this.hostElement,e,i)}removeStyle(e){this.renderer.removeStyle(this.hostElement,e)}redraw(){super.redraw(),this._mediator.execute(new In),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),SN))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new ji(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new nr(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new ir(this))}static \u0275fac=function(i){return new(i||t)(zf(Oe))};static \u0275dir=Ee({type:t,selectors:[["","fNode",""]],hostAttrs:[1,"f-node","f-component"],hostVars:5,hostBindings:function(i,o){i&2&&(q("data-f-node-id",o.fId()),de("f-node-dragging-disabled",o.fDraggingDisabled())("f-node-selection-disabled",o.fSelectionDisabled()))},inputs:{fId:[1,"fNodeId","fId"],fParentId:[1,"fNodeParentId","fParentId"],position:[1,"fNodePosition","position"],size:[1,"fNodeSize","size"],rotate:[1,"fNodeRotate","rotate"],fConnectOnNode:[1,"fConnectOnNode"],fMinimapClass:[1,"fMinimapClass"],fDraggingDisabled:[1,"fNodeDraggingDisabled","fDraggingDisabled"],fSelectionDisabled:[1,"fNodeSelectionDisabled","fSelectionDisabled"],fIncludePadding:[1,"fIncludePadding"],fAutoExpandOnChildHit:[1,"fAutoExpandOnChildHit"],fAutoSizeToFitChildren:[1,"fAutoSizeToFitChildren"]},outputs:{position:"fNodePositionChange",sizeChange:"fNodeSizeChange",rotate:"fNodeRotateChange"},exportAs:["fComponent"],standalone:!1,features:[_e([{provide:Sp,useExisting:t}]),he]})}return t})();function IN(t){return!!t.closest("[fNode]")}var N0=0,_v=(()=>{class t extends yN{hostElement=l(Oe).nativeElement;_mediator=l(D);_node=l(Sp);fId=N(`f-node-input-${N0++}`,{alias:"fInputId",transform:e=>Gi(e)||`f-node-input-${N0++}`});category=N(void 0,{alias:"fInputCategory",transform:Gi});multiple=N(!0,{alias:"fInputMultiple",transform:me});disabled=N(!1,{alias:"fInputDisabled",transform:me});userFConnectableSide=F.AUTO;get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new Zo(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(je.CONNECTOR.INPUT_CONNECTED,!0),this.hostElement.classList.toggle(je.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(je.CONNECTOR.INPUT_CONNECTED,!1),this.hostElement.classList.toggle(je.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new or(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275dir=Ee({type:t,selectors:[["","fNodeInput",""]],hostAttrs:[1,"f-component","f-node-input"],hostVars:5,hostBindings:function(i,o){i&2&&(q("data-f-input-id",o.fId()),de("f-node-input-multiple",o.multiple)("f-node-input-disabled",o.disabled()))},inputs:{fId:[1,"fInputId","fId"],category:[1,"fInputCategory","category"],multiple:[1,"fInputMultiple","multiple"],disabled:[1,"fInputDisabled","disabled"],userFConnectableSide:[2,"fInputConnectableSide","userFConnectableSide",e=>Oi(e,"fInputConnectableSide",F)]},exportAs:["fNodeInput"],standalone:!1,features:[_e([{provide:vN,useExisting:t}]),he,xi]})}return t})(),TN=(()=>{class t extends Ll{get hasConnectionLimits(){return!!this.canBeConnectedInputs&&this.canBeConnectedInputs.length>0}canConnectTo(e){return[e.fId(),e.category()].some(o=>o&&this.canBeConnectedInputs?.includes(o))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275dir=Ee({type:t,standalone:!1,features:[he]})}return t})();function vv(t){return!!t.closest("[fNodeOutlet]")}var EN=new ue("F_NODE_OUTPUT"),PN=(()=>{class t extends TN{kind="output";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275dir=Ee({type:t,standalone:!1,features:[he]})}return t})();function yv(t){return!!t.closest("[fNodeOutput]")}var R0=0,Cv=(()=>{class t extends PN{hostElement=l(Oe).nativeElement;_mediator=l(D);_node=l(Sp);fId=N(`f-node-output-${R0++}`,{alias:"fOutputId",transform:e=>Gi(e)||`f-node-output-${R0++}`});multiple=N(!1,{alias:"fOutputMultiple",transform:me});disabled=N(!1,{alias:"fOutputDisabled",transform:me});userFConnectableSide=F.AUTO;isSelfConnectable=!0;canBeConnectedInputs=[];get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new Zo(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(je.CONNECTOR.OUTPUT_CONNECTED,!0),this.hostElement.classList.toggle(je.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(je.CONNECTOR.OUTPUT_CONNECTED,!1),this.hostElement.classList.toggle(je.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new or(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275dir=Ee({type:t,selectors:[["","fNodeOutput",""]],hostAttrs:[1,"f-component","f-node-output"],hostVars:7,hostBindings:function(i,o){i&2&&(q("data-f-output-id",o.fId()),de("f-node-output-multiple",o.multiple)("f-node-output-disabled",o.disabled())("f-node-output-self-connectable",o.isSelfConnectable))},inputs:{fId:[1,"fOutputId","fId"],multiple:[1,"fOutputMultiple","multiple"],disabled:[1,"fOutputDisabled","disabled"],userFConnectableSide:[2,"fOutputConnectableSide","userFConnectableSide",e=>Oi(e,"fOutputConnectableSide",F)],isSelfConnectable:"isSelfConnectable",canBeConnectedInputs:[0,"fCanBeConnectedInputs","canBeConnectedInputs"]},exportAs:["fNodeOutput"],standalone:!1,features:[_e([{provide:EN,useExisting:t}]),he,xi]})}return t})();var zl=class{event;static fToken=Symbol("CreateConnectionFinalizeRequest");constructor(n){this.event=n}},qo=class{outlet;static fToken=Symbol("ResolveConnectableOutputForOutletRequest");constructor(n){this.outlet=n}},MN=(()=>{let t=class Vs{_store=l(k);handle({outlet:e}){let i=this._findOwnerNode(e);if(!i)throw new Error("The fOutlet must belong to an fNode");let o=this._findFirstConnectableOutputInNode(i);if(!o)throw new Error("Outlet requires at least one connectable output in the same node.");return o}_findOwnerNode(e){let i=e.hostElement;return this._store.nodes.getAll().find(o=>o.isContains(i))}_findFirstConnectableOutputInNode(e){return this._store.outputs.getAll().find(i=>e.isContains(i.hostElement)&&i.canBeConnected)}static \u0275fac=function(i){return new(i||Vs)};static \u0275prov=y({token:Vs,factory:Vs.\u0275fac})};return t=x([w(qo)],t),t})(),Hh=class{sourceId;targetId;dropPosition;fOutputId;fInputId;fDropPosition;constructor(n,e,i){this.sourceId=n,this.targetId=e,this.dropPosition=i,this.fOutputId=n,this.fInputId=e,this.fDropPosition=i}},ql=(()=>{class t extends nt{type="create-connection";kind="create-connection";data(){return{fOutputOrOutletId:this._sourceRef.connector.fId()}}_result=l(Dn);_mediator=l(D);_connectionBehaviour=l(Zi);_store=l(k);get _connection(){return this._store.connections.getForCreate()}get _snapConnection(){return this._store.connections.getForSnap()}_targets=[];_sourceRef;_pointerDown=new ze;initialize(e,i){this._sourceRef=this._mediator.execute(new pt(e)),this._pointerDown=ze.fromRect(G.initialize(i.x,i.y))}prepareDragSequence(){this._collectAndMarkTargets(),this._initSnapConnection(),this._initCreateConnection(),this._connection.show(),this.onPointerMove(A.initialize()),this._result.setData({toConnectorRect:this._pointerDown,canBeConnectedInputs:this._targets,fOutputId:this._sourceRef.connector.fId()})}_collectAndMarkTargets(){this._targets=this._mediator.execute(new Jo(this._sourceRef.connector,this._sourceRef.rect.gravityCenter)),this._mediator.execute(new $i(this._targets.map(e=>e.connector)))}_initSnapConnection(){this._snapConnection&&(this._snapConnection.fOutputId.set(this._sourceRef.connector.fId()),this._snapConnection.initialize())}_initCreateConnection(){this._connection.fOutputId.set(this._sourceRef.connector.fId()),this._connection.initialize()}onPointerMove(e){let i=this._pointerDown.addPoint(e),o=this._findClosestTarget(i),r=o?.connector.fConnectableSide||F.TOP;this._drawCreateConnection(i,r);let a=this._snapConnection;if(!a)return;let s=o&&o.distance<a.fSnapThreshold?o:void 0;this._drawSnapConnection(s)}_findClosestTarget(e){return this._mediator.execute(new ri(e,this._targets))}_drawCreateConnection(e,i){let o=this._connectionBehaviour.handle(new Mt(this._sourceRef.rect,e,this._connection,this._sourceRef.connector.fConnectableSide,i,this._resolveRotationContext(this._sourceRef.connector)));this._connection.setLine(o),this._connection.redraw()}_drawSnapConnection(e){let i=this._snapConnection;if(!i)return;if(!e){i.hide();return}let o=this._connectionBehaviour.handle(new Mt(this._sourceRef.rect,e.rect,i,this._sourceRef.connector.fConnectableSide,e.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(e.connector)));i.show(),i.setLine(o),i.redraw()}onPointerUp(){this._connection.redraw(),this._connection.hide(),this._snapConnection?.hide(),this._mediator.execute(new Ki(this._targets.map(e=>e.connector)))}_resolveRotationContext(e){return this._mediator.execute(new Qt(e))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),kN=(()=>{let t=class Gs{_result=l(Dn);_mediator=l(D);_store=l(k);_dragContext=l(Q);get _dragHandler(){return this._dragContext.draggableItems[0]}handle(e){this._isValid()&&(this._emitEvent(e.event),this._dragHandler.onPointerUp())}_isValid(){return this._dragContext.draggableItems.some(e=>e instanceof ql)}_getTargetOutput(e){if(!e)throw new Error(`Output with fOutputId ${this._result.getData().fOutputId} not found. Make sure there is no f-connection to a non-existent fOutput.`);return vv(e.hostElement)?this._mediator.execute(new qo(e)):e}_getOutput(){return this._store.outputs.get(this._result.getData().fOutputId)}_getOutlet(){return this._store.outlets.get(this._result.getData().fOutputId)}_emitEvent(e){this._store.fDraggable?.fCreateConnection.emit(new Hh(this._getTargetOutput(this._getOutput()||this._getOutlet()).fId(),this._getInputUnderPointer(e)?.fId(),e.getPosition()))}_getInputUnderPointer(e){return this._mediator.execute(new Qo(e.getPosition(),this._result.getData().canBeConnectedInputs))}static \u0275fac=function(i){return new(i||Gs)};static \u0275prov=y({token:Gs,factory:Gs.\u0275fac})};return t=x([w(zl)],t),t})(),Vo=class{eventPosition;source;static fToken=Symbol("CreateConnectionCreateDragHandlerRequest");constructor(n,e){this.eventPosition=n,this.source=e}},DN=(()=>{let t=class Hs{_store=l(k);_dragContext=l(Q);_dragInjector=l(Xe);get _transform(){return this._store.transform}handle({source:e,eventPosition:i}){this._dragContext.onPointerDownScale=this._transform.scale;let o=this._toFlowSpace(i);this._dragContext.onPointerDownPosition=o;let r=this._toCanvasSpace(o),a=this._dragInjector.get(ql);a.initialize(e,r),this._dragContext.draggableItems=[a]}_toFlowSpace(e){return Z.fromPoint(e).elementTransform(this._store.flowHost).div(this._transform.scale)}_toCanvasSpace(e){return Z.fromPoint(e).mult(this._transform.scale).sub(this._transform.position).sub(this._transform.scaledPosition).div(this._transform.scale)}static \u0275fac=function(i){return new(i||Hs)};static \u0275prov=y({token:Hs,factory:Hs.\u0275fac})};return t=x([w(Vo)],t),t})(),Vl=class{event;node;static fToken=Symbol("CreateConnectionFromOutletPreparationRequest");constructor(n,e){this.event=n,this.node=e}},ON=(()=>{let t=class js{_mediator=l(D);_store=l(k);handle({event:e,node:i}){let o=this._findOutlet(i);if(!o||(o.setOutputs(this._getOutputs(i)),!o.canBeConnected))return;let r=o.isConnectionFromOutlet?o:this._resolveOutput(o);!r||!r.canBeConnected||this._startDrag(e.getPosition(),r)}_findOutlet(e){return this._store.outlets.getAll().find(i=>e.isContains(i.hostElement))}_getOutputs(e){return this._store.outputs.getAll().filter(i=>e.isContains(i.hostElement))}_resolveOutput(e){return this._mediator.execute(new qo(e))}_startDrag(e,i){this._mediator.execute(new Vo(e,i))}static \u0275fac=function(i){return new(i||js)};static \u0275prov=y({token:js,factory:js.\u0275fac})};return t=x([w(Vl)],t),t})(),Gl=class{event;node;static fToken=Symbol("CreateConnectionFromOutputPreparationRequest");constructor(n,e){this.event=n,this.node=e}},NN=(()=>{let t=class Us{_mediator=l(D);_store=l(k);handle({event:e,node:i}){if(!yv(e.targetElement)||this._hasOutlet(i))return;let o=this._findOutput(e.targetElement);!o||!o.canBeConnected||this._startDrag(e.getPosition(),o)}_hasOutlet(e){return this._store.outlets.getAll().some(i=>e.isContains(i.hostElement))}_findOutput(e){return this._store.outputs.getAll().find(i=>i.hostElement.contains(e))}_startDrag(e,i){this._mediator.execute(new Vo(e,i))}static \u0275fac=function(i){return new(i||Us)};static \u0275prov=y({token:Us,factory:Us.\u0275fac})};return t=x([w(Gl)],t),t})(),Hl=class{event;fTrigger;static fToken=Symbol("CreateConnectionPreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}},RN=(()=>{let t=class Ws{_mediator=l(D);_store=l(k);_dragContext=l(Q);handle({event:e,fTrigger:i}){if(!this._isValidConditions()||!this._isValidTrigger(e,i))return;let o=vv(e.targetElement),r=!o&&yv(e.targetElement);if(!o&&!r)return;let a=this._findOwnerNode(e.targetElement);a&&(o?this._mediator.execute(new Vl(e,a)):this._mediator.execute(new Gl(e,a)))}_findOwnerNode(e){return this._store.nodes.getAll().find(i=>i.isContains(e))}_isValidConditions(){return this._dragContext.isEmpty()&&!!this._store.connections.getForCreate()}_isValidTrigger(e,i){return bt(e.originalEvent,i)}static \u0275fac=function(i){return new(i||Ws)};static \u0275prov=y({token:Ws,factory:Ws.\u0275fac})};return t=x([w(Hl)],t),t})(),jl=class{event;static fToken=Symbol("ReassignConnectionFinalizeRequest");constructor(n){this.event=n}},jh=class{connectionId;endpoint;previousSourceId;nextSourceId;previousTargetId;nextTargetId;dropPosition;isSourceReassign;isTargetReassign;oldSourceId;newSourceId;oldTargetId;newTargetId;dropPoint;constructor(n,e,i,o,r,a,s){this.connectionId=n,this.endpoint=e,this.previousSourceId=i,this.nextSourceId=o,this.previousTargetId=r,this.nextTargetId=a,this.dropPosition=s,this.isSourceReassign=e==="source",this.isTargetReassign=e==="target",this.oldSourceId=i,this.newSourceId=o,this.oldTargetId=r,this.newTargetId=a,this.dropPoint=s}},AN=(()=>{let t=class $s{_dragResult=l(Dn);_mediator=l(D);_store=l(k);_dragContext=l(Q);get _dragDirective(){return this._store.fDraggable}handle({event:e}){let i=this._findReassignHandler();i&&(this._emitIfChanged(e),i.onPointerUp())}_findReassignHandler(){return this._dragContext.draggableItems.find(i=>i.getEvent().fEventType==="reassign-connection")}_emitIfChanged(e){let i=this._dragResult.getData(),o=this._findConnectableConnector(e,i.candidates);o&&!this._isReassignedToDifferentConnector(i,o)||this._dragDirective.fReassignConnection.emit(this._buildEvent(i,e,o))}_findConnectableConnector(e,i){return this._mediator.execute(new Qo(e.getPosition(),i))}_isReassignedToDifferentConnector(e,i){let o=e.connection;return e.draggedEnd==="target"?o.fInputId()!==i.fId():o.fOutputId()!==i.fId()}_buildEvent(e,i,o){let r=e.connection;return new jh(r.fId(),e.draggedEnd,r.fOutputId(),e.draggedEnd==="source"?o?.fId():void 0,r.fInputId(),e.draggedEnd==="target"?o?.fId():void 0,i.getPosition())}static \u0275fac=function(i){return new(i||$s)};static \u0275prov=y({token:$s,factory:$s.\u0275fac})};return t=x([w(jl)],t),t})(),Ul=class{event;fTrigger;static fToken=Symbol("ReassignConnectionPreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}};function FN(t,n){return bv(t,n)||LN(t,n)}function bv(t,n){return t.fDragHandleEnd()?.point&&xv(n,t.fDragHandleEnd().point)&&!t.fDraggingDisabled()}function LN(t,n){return!!t.fDragHandleStart()?.point&&xv(n,t.fDragHandleStart().point)&&!t.fDraggingDisabled()&&t.fReassignableStart()}function xv(t,n){return(t.x-n.x)**2+(t.y-n.y)**2<=8**2}function wv(t,n){return t&&t.distance<n.fSnapThreshold?t:void 0}function Wl(t){return ze.fromRect(G.initialize(t.x,t.y))}var Uh=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(n,e,i,o,r){this._mediator=n,this._behaviour=e,this._connection=i,this._sourceRef=o,this._targetRef=r,this._anchorRect=Wl(this._connection.line.point1)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new Yu(this._target,this._targetRef.rect.gravityCenter)),this._candidates.some(n=>n.connector.fId()===this._source.fId())||this._candidates.push(this._sourceRef),this._mediator.execute(new $i(this._candidates.map(n=>n.connector)))}setSnapConnection(n){this._snap=n,n&&(n.fInputId.set(this._connection.fInputId()),n.initialize())}onPointerMove(n){let e=this._anchorRect.addPoint(n),i=this._findClosest(e.gravityCenter),o=i?.connector.fConnectableSide??this._source.fConnectableSide;this._draw(e,o);let r=this._snap;r&&this._drawSnap(wv(i,r))}_findClosest(n){return this._mediator.execute(new ri(n,this._candidates))}_draw(n,e){let i=this._behaviour.handle(new Mt(n,this._targetRef.rect,this._connection,e,this._targetRef.connector.fConnectableSide,void 0,this._resolveRotationContext(this._targetRef.connector)));this._connection.setLine(i),this._connection.redraw()}_drawSnap(n){let e=this._snap;if(!e)return;if(!n){e.hide();return}let i=this._behaviour.handle(new Mt(n.rect,this._targetRef.rect,e,n.connector.fConnectableSide,this._target.fConnectableSide,this._resolveRotationContext(n.connector),this._resolveRotationContext(this._targetRef.connector)));e.show(),e.setLine(i),e.redraw()}onPointerUp(){this._draw(this._anchorRect,this._sourceRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new Ki(this._candidates.map(n=>n.connector)))}_resolveRotationContext(n){return this._mediator.execute(new Qt(n))}},Wh=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(n,e,i,o,r){this._mediator=n,this._behaviour=e,this._connection=i,this._sourceRef=o,this._targetRef=r,this._anchorRect=Wl(this._connection.line.point2)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new Jo(this._source,this._sourceRef.rect.gravityCenter));let n=this._connection.fInputId();n&&!this._candidates.some(e=>e.connector.fId()===n)&&this._candidates.push(this._targetRef),this._mediator.execute(new $i(this._candidates.map(e=>e.connector)))}setSnapConnection(n){this._snap=n,n&&(n.fOutputId.set(this._connection.fOutputId()),n.initialize())}onPointerMove(n){let e=this._anchorRect.addPoint(n),i=this._findClosest(e.gravityCenter),o=i?.connector.fConnectableSide??this._target.fConnectableSide;this._draw(e,o);let r=this._snap;r&&this._drawSnap(wv(i,r))}onPointerUp(){this._draw(this._anchorRect,this._targetRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new Ki(this._candidates.map(n=>n.connector)))}_findClosest(n){return this._mediator.execute(new ri(n,this._candidates))}_draw(n,e){let i=this._behaviour.handle(new Mt(this._sourceRef.rect,n,this._connection,this._source.fConnectableSide,e,this._resolveRotationContext(this._sourceRef.connector),void 0));this._connection.setLine(i),this._connection.redraw()}_drawSnap(n){let e=this._snap;if(!e)return;if(!n){e.hide();return}let i=this._behaviour.handle(new Mt(this._sourceRef.rect,n.rect,e,this._source.fConnectableSide,n.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(n.connector)));e.show(),e.setLine(i),e.redraw()}_resolveRotationContext(n){return this._mediator.execute(new Qt(n))}},$h=(()=>{class t extends nt{type="reassign-connection";kind="reassign-connection";data(){return{fConnectionId:this._connection.fId()}}_result=l(Dn);_mediator=l(D);_connectionBehaviour=l(Zi);_store=l(k);get _snapConnection(){return this._store.connections.getForSnap()}_connection;_draggedEnd;_sourceRef;_targetRef;_reassignHandler;initialize(e,i){this._connection=e,this._draggedEnd=i?"target":"source",this._sourceRef=this._mediator.execute(new pt(this._store.outputs.require(this._connection.fOutputId()))),this._targetRef=this._mediator.execute(new pt(this._store.inputs.require(this._connection.fInputId()))),this._reassignHandler=this._draggedEnd==="target"?this._createTargetHandler():this._createSourceHandler()}_createSourceHandler(){return new Uh(this._mediator,this._connectionBehaviour,this._connection,this._sourceRef,this._targetRef)}_createTargetHandler(){return new Wh(this._mediator,this._connectionBehaviour,this._connection,this._sourceRef,this._targetRef)}prepareDragSequence(){this._reassignHandler.collectAndMarkCandidates(),this._reassignHandler.setSnapConnection(this._snapConnection),this._result.setData({draggedEnd:this._draggedEnd,sourceAnchorRect:Wl(this._connection.line.point1),targetAnchorRect:Wl(this._connection.line.point2),candidates:this._reassignHandler.candidates(),connection:this._connection})}onPointerMove(e){this._reassignHandler.onPointerMove(e)}onPointerUp(){this._reassignHandler.onPointerUp()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),BN=(()=>{let t=class Ks{_mediator=l(D);_store=l(k);_dragContext=l(Q);_dragInjector=l(Xe);get _canvas(){return this._store.fCanvas}get _transform(){return this._store.transform}get _connections(){return this._store.connections.getAll()}handle(e){if(!this._dragContext.isEmpty()||!this._isValidTrigger(e))return;let i=Qi(e.event.getPosition(),this._store.flowHost,this._transform),o=this._findConnectionAt(i);o&&(this._capturePointerDown(e),this._startDrag(o,i),queueMicrotask(()=>this._bringToFront(o)))}_findConnectionAt(e){return this._connections.find(i=>FN(i,e))}_capturePointerDown(e){this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=Z.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(this._transform.scale)}_startDrag(e,i){let o=this._dragInjector.get($h);o.initialize(e,bv(e,i)),this._dragContext.draggableItems=[o]}_isValidTrigger(e){return bt(e.event.originalEvent,e.fTrigger)}_bringToFront(e){this._mediator.execute(new si(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(i){return new(i||Ks)};static \u0275prov=y({token:Ks,factory:Ks.\u0275fac})};return t=x([w(Ul)],t),t})(),$l=class{event;static fToken=Symbol("DragConnectionWaypointFinalizeRequest");constructor(n){this.event=n}},Kl=class{connectionId;waypoints;constructor(n,e){this.connectionId=n,this.waypoints=e}},Yl=(()=>{class t extends nt{type="move-connection-waypoint";kind="drag-connection-waypoint";_store=l(k);_point;_pick;get _waypointsComponent(){return this._pick?.connection.fWaypoints()}get _connection(){return this._pick?.connection}setPick(e){this._pick=e}prepareDragSequence(){this._pick?.candidate?(this._point=se({},this._pick.candidate),this._waypointsComponent.insert(this._pick.candidate)):this._pick?.waypoint&&(this._point=se({},this._pick.waypoint),this._waypointsComponent.select(this._pick.waypoint)),this._redrawConnection()}onPointerMove(e){this._waypointsComponent.move(A.sum(this._point,e)),this._redrawConnection()}onPointerUp(){this._waypointsComponent.update(),this._store.fDraggable?.fConnectionWaypointsChanged.emit(this._eventFromPick())}_redrawConnection(){this._connection.setLine(this._connection.line),this._connection.redraw()}_eventFromPick(){return new Kl(this._connection.fId(),this._connection.fWaypoints()?.waypoints()||[])}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),zN=(()=>{let t=class Ys{_dragContext=l(Q);get _fDragHandler(){return this._dragContext.draggableItems[0]}handle(e){this._isDroppedConnectionReassignEvent()&&this._fDragHandler.onPointerUp()}_isDroppedConnectionReassignEvent(){return this._dragContext.draggableItems.some(e=>e instanceof Yl)}static \u0275fac=function(i){return new(i||Ys)};static \u0275prov=y({token:Ys,factory:Ys.\u0275fac})};return t=x([w($l)],t),t})(),Xl=class{event;fTrigger;static fToken=Symbol("DragConnectionWaypointPreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}},qN=(()=>{let t=class Xs{_mediator=l(D);_store=l(k);_dragContext=l(Q);_dragInjector=l(Xe);get _canvas(){return this._store.fCanvas}get _transform(){return this._canvas.transform}get _flowHost(){return this._store.flowHost}get _connections(){return this._store.connections.getAll()}handle(e){let i=Qi(e.event.getPosition(),this._flowHost,this._transform),o=this._pickControlPoint(i);if(!o||!this._isValidTrigger(e))return;let r=this._dragInjector.get(Yl);r.setPick(o),this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=Z.fromPoint(e.event.getPosition()).elementTransform(this._flowHost).div(this._transform.scale),this._dragContext.draggableItems=[r],queueMicrotask(()=>this._updateConnectionLayer(o.connection))}_pickControlPoint(e){if(this._dragContext.isEmpty())return fD(this._connections,e)}_isValidTrigger(e){return bt(e.event.originalEvent,e.fTrigger)}_updateConnectionLayer(e){this._mediator.execute(new si(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(i){return new(i||Xs)};static \u0275prov=y({token:Xs,factory:Xs.\u0275fac})};return t=x([w(Xl)],t),t})(),VN=[kN,DN,ON,MN,NN,RN,AN,BN,qN,zN],Zl=class{event;static fToken=Symbol("DropToGroupFinalizeRequest");constructor(n){this.event=n}},GN=1,Go=(()=>{class t extends nt{type="move-node-to-parent";kind="assign-to-container";_store=l(k);_dragSession=l(Q);get _transform(){return this._store.transform}_candidateGroups=[];_debounceTimer=null;_activeTarget=null;get activeTarget(){return this._activeTarget}initialize(e){this._candidateGroups=e}prepareDragSequence(){for(let{node:e}of this._candidateGroups)e.hostElement.classList.add(je.GROUPING.DROP_ACTIVE)}onPointerMove(e){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._updateActiveTarget(e),GN)}onPointerUp(){this._clearActiveTarget();for(let{node:e}of this._candidateGroups)e.hostElement.classList.remove(je.GROUPING.DROP_ACTIVE);this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}_updateActiveTarget(e){let i=this._getPointerInFlow(e),o=this._findTargetUnderPointer(i);o?this._setActiveTarget(o):this._clearActiveTarget()}_getPointerInFlow(e){let i=Z.fromPoint(this._dragSession.onPointerDownPosition).add(e),o=Z.fromPoint(this._transform.position).add(this._transform.scaledPosition).div(this._transform.scale);return i.sub(o)}_findTargetUnderPointer(e){return this._candidateGroups.find(i=>G.isIncludePoint(i.rect,e))}_setActiveTarget(e){this._activeTarget?.node!==e.node&&(this._clearActiveTarget(),this._activeTarget=e,e.node.setClass(je.GROUPING.OVER_BOUNDARY))}_clearActiveTarget(){this._activeTarget?.node.removeClass(je.GROUPING.OVER_BOUNDARY),this._activeTarget=null}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Ql=class{nodesAndGroups;static fToken=Symbol("CreateDragNodeHierarchyRequest");constructor(n){this.nodesAndGroups=n}},Kh=class{rootHandlers;participants;constructor(n,e){this.rootHandlers=n,this.participants=e}},Yh=class{fNodeIds;constructor(n){this.fNodeIds=n}},bm="move-node",xm="drag-node";function HN(t){return t.getEvent().kind===xm||t.getEvent().fEventType===bm}var kn=(()=>{class t extends nt{type=bm;kind=xm;data(){return new Yh(this.items.map(e=>e.nodeOrGroup.fId()))}_magneticLines=null;_magneticRects=null;items;roots;initialize(e,i){this.items=e,this.roots=i}setMagneticLines(e){this._magneticLines=e}setMagneticRects(e){this._magneticRects=e}calculateMagneticLinesGuides(e){return this.calculateMagneticSnaps(e).lines}calculateMagneticSnaps(e){this._previewRoots(e);let i=this._rootsUnionRect();return{lines:this._magneticLines?._computeGuides(i),rects:this._magneticRects?._computeRects(i)}}prepareDragSequence(){for(let e of this.roots)e.prepareDragSequence()}onPointerMove(e){this._previewRoots(e);let i=this._rootsUnionRect();this._magneticLines?.scheduleRender(i),this._magneticRects?.scheduleRender(i)}onPointerUp(){for(let e of this.roots)e.onPointerUp();this._magneticLines?.clearGuides(),this._magneticRects?.clearGuides(),requestAnimationFrame(()=>this._refreshDraggedNodes())}_previewRoots(e){for(let i of this.roots)i.onPointerMove(e)}_rootsUnionRect(){let e=null;for(let i of this.roots){let o=i.getLastRect();e=e?G.union([e,o]):o}return e??G.initialize()}_refreshDraggedNodes(){for(let{nodeOrGroup:e}of this.roots)e.refresh()}destroy(){for(let e of this.roots??[])e.destroy?.()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Jl=class{_limits;_quantizeStep;constructor(n,e=.5){this._limits=n,this._quantizeStep=e}applyInto(n,e){let{min:i,max:o}=this._limits,r=this._clamp(n.x,i.x,o.x),a=this._clamp(n.y,i.y,o.y),s=n.x-r,c=n.y-a,u=this._quantizeSigned(s,this._quantizeStep),p=this._quantizeSigned(c,this._quantizeStep);e.value.x=r,e.value.y=a,e.edges.left=u<0,e.edges.right=u>0,e.edges.top=p<0,e.edges.bottom=p>0,e.overflow.x=Math.abs(u),e.overflow.y=Math.abs(p)}_quantizeSigned(n,e){if(e<=0||n===0)return 0;let i=n/e;return(n>0?Math.ceil(i):Math.floor(i))*e}_clamp(n,e,i){return Math.min(Math.max(n,e),i)}},Xh=class{_pointerDown;_vCellSize;_hCellSize;_snapWhileDragging;constructor(n,e){this._pointerDown=e,this._vCellSize=n.vCellSize(),this._hCellSize=n.hCellSize(),this._snapWhileDragging=n.fCellSizeWhileDragging()}snap(n,e){let i=e||this._snapWhileDragging;return this._strategies[+i](n)}_strategies={0:this._noSnap.bind(this),1:this._snapWithCellSize.bind(this)};_snapWithCellSize(n){return{x:this._snapToGrid(this._pointerDown.x+n.x,this._hCellSize)-this._pointerDown.x,y:this._snapToGrid(this._pointerDown.y+n.y,this._vCellSize)-this._pointerDown.y}}_noSnap(n){return n}_snapToGrid(n,e){return Math.round(n/e)*e}};function A0(){return{value:{x:0,y:0},overflow:{x:0,y:0},edges:{left:!1,right:!1,top:!1,bottom:!1}}}var Zh=class{_snapper;_hardClamp;_hardResult=A0();_softClamps=[];_softResults=[];constructor(n,e,i){let o=n.get(k).fDraggable;this._snapper=new Xh(o,e),this._hardClamp=new Jl(i.hard,.5);for(let r of i.soft)this._softClamps.push(new Jl(r.limits,.5)),this._softResults.push(A0())}apply(n,e=!1){let i=this._snapper.snap(n,e);this._hardClamp.applyInto(i,this._hardResult);let o={x:this._hardResult.value.x,y:this._hardResult.value.y};for(let r=0;r<this._softClamps.length;r++)this._softClamps[r].applyInto(o,this._softResults[r]);return{hardDelta:o,soft:this._softResults}}finalize(n){return this.apply(n,!0)}};function F0(t,n,e){let{x:i,y:o,width:r,height:a}=t;return e.right&&n.x>0&&(r+=n.x),e.left&&n.x>0&&(i-=n.x,r+=n.x),e.bottom&&n.y>0&&(a+=n.y),e.top&&n.y>0&&(o-=n.y,a+=n.y),G.initialize(i,o,r,a)}var Qh=class extends nt{_injector;nodeOrGroup;children;sourceConnectionHandlers;targetConnectionHandlers;type=bm;kind=xm;_startPosition=A.initialize();_startRect=G.initialize();_applyConstraints=n=>n;_lastSoftResults=[];_deltaConstraints;_constraints;_lastPosition=A.initialize();_softParentConnectionHandlers=[];_mediator;constructor(n,e,i=[],o=[],r=[]){super(),this._injector=n,this.nodeOrGroup=e,this.children=i,this.sourceConnectionHandlers=o,this.targetConnectionHandlers=r,this._mediator=n.get(D),this._startRect=this._mediator.execute(new Ae(e.hostElement)),this._startPosition=se({},e._position)}setConstraints(n){this._constraints=n,this._deltaConstraints=new Zh(this._injector,this._startPosition,n),this._applyConstraints=e=>{let i=this._deltaConstraints.apply(e);return this._applySoftExpansions(i.soft),i.hardDelta}}setSoftParentConnectionHandlers(n){this._softParentConnectionHandlers=n}finalizeConstraints(){this._applyConstraints=n=>{let e=this._deltaConstraints.finalize(n);return this._applySoftExpansions(e.soft),e.hardDelta}}getLastRect(){return G.initialize(this._lastPosition.x,this._lastPosition.y,this._startRect.width,this._startRect.height)}prepareDragSequence(){for(let n of this.children)n.prepareDragSequence();this.nodeOrGroup.hostElement.classList.add(je.DRAG_AND_DROP.DRAGGING)}onPointerMove(n){let e=this._applyConstraints(n);for(let i of this.children)i.onPointerMove(e);this._redraw(this._startPlus(e));for(let i of this.sourceConnectionHandlers)i.setSourceDelta(e);for(let i of this.targetConnectionHandlers)i.setTargetDelta(e)}onPointerUp(){for(let n of this.children)n.onPointerUp();this.nodeOrGroup.position.set(this.nodeOrGroup._position),this.nodeOrGroup.hostElement.classList.remove(je.DRAG_AND_DROP.DRAGGING),this._emitExpandedEvent()}_startPlus(n){return A.sum(this._startPosition,n)}_redraw(n){this._lastPosition=n,this.nodeOrGroup.updatePosition(n),this._mediator.execute(new ni(this.nodeOrGroup.fId(),G.initialize(n.x,n.y,this._startRect.width,this._startRect.height))),this.nodeOrGroup.redraw()}_applySoftExpansions(n){this._lastSoftResults=n;for(let e=0;e<n.length;e++){let i=n[e],o=this._constraints.soft[e],r=F0(o.boundingRect,i.overflow,i.edges);this._commitParentRect(o.nodeOrGroup,r)&&this._updateParentConnectionHandlers(e)}}_commitParentRect(n,e){let i=n._position.x!==e.x||n._position.y!==e.y||n._size?.width!==e.width||n._size?.height!==e.height;return n.updateSize({width:e.width,height:e.height}),n.updatePosition({x:e.x,y:e.y}),this._mediator.execute(new ni(n.fId(),e)),n.redraw(),i}_updateParentConnectionHandlers(n){let e=this._softParentConnectionHandlers[n];if(!e)return;let i=new Map;for(let o of e.source){let r=this._readConnectorRect(o.connector,i);o.handler.setSourceDelta(this._buildDelta(o.baselineRect,r))}for(let o of e.target){let r=this._readConnectorRect(o.connector,i);o.handler.setTargetDelta(this._buildDelta(o.baselineRect,r))}}_readConnectorRect(n,e){let i=`${n.kind}::${n.fId()}`,o=e.get(i);if(o)return o;let r=this._mediator.execute(new pt(n)).rect;return e.set(i,r),r}_buildDelta(n,e){return A.initialize(e.x-n.x,e.y-n.y)}_emitExpandedEvent(){for(let n=0;n<this._lastSoftResults.length;n++){let e=this._lastSoftResults[n];if(!e.overflow.x&&!e.overflow.y)continue;let i=this._constraints.soft[n],o=F0(i.boundingRect,e.overflow,e.edges);i.nodeOrGroup.sizeChange.emit(o)}}destroy(){for(let n of this.children)n.destroy?.();this.children=[],this.sourceConnectionHandlers=[],this.targetConnectionHandlers=[],this._lastSoftResults=[],this._applyConstraints=n=>n,this._softParentConnectionHandlers=[]}},jN=(()=>{let t=class Zs{_injector=l(Ze);handle({nodesAndGroups:e}){let i=this._createHandlerByNodeId(e),o=this._linkParentsAndCollectRoots(e,i);return new Kh(o,Array.from(i.values()))}_createHandlerByNodeId(e){let i=new Map;for(let o of e)i.set(o.fId(),new Qh(this._injector,o));return i}_linkParentsAndCollectRoots(e,i){let o=[];for(let r of e){let a=i.get(r.fId());if(!a)continue;let s=r.fParentId(),c=s?i.get(s):void 0;c?c.children.push(a):o.push(a)}return o}static \u0275fac=function(i){return new(i||Zs)};static \u0275prov=y({token:Zs,factory:Zs.\u0275fac})};return t=x([w(Ql)],t),t})(),eu=class{nodeOrGroup;static fToken=Symbol("BuildDragNodeConstraintsRequest");constructor(n){this.nodeOrGroup=n}},Ho=class{nodeOrGroup;childrenPaddings;static fToken=Symbol("ReadNodeBoundsWithPaddingsRequest");constructor(n,e){this.nodeOrGroup=n,this.childrenPaddings=e}},Jh=class{nodeOrGroup;boundingRect;innerRect;paddings;constructor(n,e,i,o){this.nodeOrGroup=n,this.boundingRect=e,this.innerRect=i,this.paddings=o}},UN=(()=>{let t=class Qs{_mediator=l(D);handle({nodeOrGroup:e,childrenPaddings:i}){let o=this._readBoundingRect(e),r=this._readOwnPaddings(e,o),a=[r[0]+i[0],r[1]+i[1],r[2]+i[2],r[3]+i[3]],s=G.initialize(o.x+a[0],o.y+a[1],o.width-a[0]-a[2],o.height-a[1]-a[3]);return new Jh(e,o,s,a)}_readBoundingRect(e){return this._mediator.execute(new Ae(e.hostElement))}_readOwnPaddings(e,i){return this._mediator.execute(new ai(e,i))}static \u0275fac=function(i){return new(i||Qs)};static \u0275prov=y({token:Qs,factory:Qs.\u0275fac})};return t=x([w(Ho)],t),t})(),WN=(()=>{let t=class Js{_mediator=l(D);handle({nodeOrGroup:e}){let i=this._readCurrentRect(e),o=this._readParentsChain(e);return this._buildConstraints(o,i)}_readCurrentRect(e){return this._mediator.execute(new Ae(e.hostElement))}_readParentsChain(e){return this._mediator.execute(new Wi(e))??[]}_buildConstraints(e,i){let o=[],r=fv(),a=[0,0,0,0];for(let s of e){let c=this._readParentBounds(s,a);a=c.paddings;let u=this._calculateDifference(c.innerRect,i);if(this._isAutoExpand(s))o.push(this._makeSoftLimit(s,c.boundingRect,u));else{r=u;break}}return{soft:o,hard:r}}_readParentBounds(e,i){return this._mediator.execute(new Ho(e,i))}_calculateDifference(e,i){return{min:this._calculateMinimumDifference(e,i),max:this._calculateMaximumDifference(e,i)}}_calculateMinimumDifference(e,i){return A.initialize(e.x-i.x,e.y-i.y)}_calculateMaximumDifference(e,i){return A.initialize(e.x+e.width-(i.x+i.width),e.y+e.height-(i.y+i.height))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeSoftLimit(e,i,o){return{nodeOrGroup:e,boundingRect:i,initialSize:e._size,limits:o}}static \u0275fac=function(i){return new(i||Js)};static \u0275prov=y({token:Js,factory:Js.\u0275fac})};return t=x([w(eu)],t),t})(),tu=class{rootHandlers;participants;static fToken=Symbol("CreateDragNodeHandlerRequest");constructor(n,e){this.rootHandlers=n,this.participants=e}},nu=class{dragHandler;constraints;handlerPool;static fToken=Symbol("AttachSoftParentConnectionDragHandlersToNodeRequest");constructor(n,e,i){this.dragHandler=n,this.constraints=e,this.handlerPool=i}},jo=class{_mediator=l(D);_store=l(k);_behaviour=l(Zi);_source;_target;_sourceRef;_targetRef;_sourceDelta=A.initialize();_targetDelta=A.initialize();connection;initialize(n){this.connection=n,this._source=this._store.outputs.require(this.connection.fOutputId()),this._target=this._store.inputs.require(this.connection.fInputId()),this._sourceRef=this._readRectRef(this._source),this._targetRef=this._readRectRef(this._target)}setSourceDelta(n){this._sourceDelta=n,this._mediator.execute(new ti(this._source.fId(),this._source.kind,this._withDelta(this._sourceRef.rect,n)))}setTargetDelta(n){this._targetDelta=n,this._mediator.execute(new ti(this._target.fId(),this._target.kind,this._withDelta(this._targetRef.rect,n)))}redraw(){let n=this._buildLine();this.connection.setLine(n),this.connection.redraw()}_buildLine(){let n=ze.fromRoundedRect(this._sourceRef.rect).addPoint(this._sourceDelta),e=ze.fromRoundedRect(this._targetRef.rect).addPoint(this._targetDelta);return this._behaviour.handle(new Mt(n,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(n){return this._mediator.execute(new pt(n))}_withDelta(n,e){return ze.fromRoundedRect(n).addPoint(e)}_resolveRotationContext(n){return this._mediator.execute(new Qt(n))}},Uo=(()=>{class t extends jo{setSourceDelta(e){super.setSourceDelta(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Wo=(()=>{class t extends jo{_sourceUpdated=!1;_targetUpdated=!1;setSourceDelta(e){super.setSourceDelta(e),this._sourceUpdated=!0,this._redrawIfReady()}setTargetDelta(e){super.setTargetDelta(e),this._targetUpdated=!0,this._redrawIfReady()}_redrawIfReady(){!this._sourceUpdated||!this._targetUpdated||(this._sourceUpdated=!1,this._targetUpdated=!1,this.redraw())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),$o=(()=>{class t extends jo{setTargetDelta(e){super.setTargetDelta(e),this.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),$N=(()=>{let t=class ec{_store=l(k);_mediator=l(D);_dragInjector=l(Xe);handle({dragHandler:e,constraints:i,handlerPool:o}){let r=i.soft.map(a=>this._buildParentConnectionHandlers(a.nodeOrGroup,o));e.setSoftParentConnectionHandlers(r)}_buildParentConnectionHandlers(e,i){let o=this._store.outputs.getAll().filter(p=>p.fNodeId===e.fId()),r=this._store.inputs.getAll().filter(p=>p.fNodeId===e.fId());if(!o.length&&!r.length)return{source:[],target:[]};let a=new Set(o.map(p=>p.fId())),s=new Set(r.map(p=>p.fId())),c=new Map,u={source:[],target:[]};for(let p of this._store.connections.getAll()){let g=a.has(p.fOutputId()),b=s.has(p.fInputId());if(!g&&!b)continue;let M=this._getExistingConnectionHandler(i,p);if(M||(M=this._createConnectionHandler(p,g,b),i.push(M)),g){let P=this._store.outputs.require(p.fOutputId());u.source.push({handler:M,connector:P,baselineRect:this._readConnectorRect(P,c)})}if(b){let P=this._store.inputs.require(p.fInputId());u.target.push({handler:M,connector:P,baselineRect:this._readConnectorRect(P,c)})}}return u}_getExistingConnectionHandler(e,i){return e.find(o=>o.connection.fId()===i.fId())}_createConnectionHandler(e,i,o){let r;return i&&o?r=this._dragInjector.createInstance(Wo):i?r=this._dragInjector.createInstance(Uo):r=this._dragInjector.createInstance($o),r.initialize(e),r}_readConnectorRect(e,i){let o=`${e.kind}::${e.fId()}`,r=i.get(o);if(r)return r;let a=this._mediator.execute(new pt(e)).rect;return i.set(o,a),a}static \u0275fac=function(i){return new(i||ec)};static \u0275prov=y({token:ec,factory:ec.\u0275fac})};return t=x([w(nu)],t),t})(),KN=(()=>{let t=class tc{_dragInjector=l(Xe);_mediator=l(D);handle({rootHandlers:e,participants:i}){let o=this._collectConnectionHandlers(i);this._applyConstraintsToRoots(e,o);let r=this._dragInjector.createInstance(kn);return r.initialize(i,e),r}_applyConstraintsToRoots(e,i){for(let o of e){let r=this._calculateConstraints(o.nodeOrGroup);o.setConstraints(r),this._attachSoftParentConnectionHandlers(o,r,i)}}_collectConnectionHandlers(e){let i=new Map;for(let o of e){for(let r of o.sourceConnectionHandlers)i.set(r.connection.fId(),r);for(let r of o.targetConnectionHandlers)i.set(r.connection.fId(),r)}return Array.from(i.values())}_attachSoftParentConnectionHandlers(e,i,o){this._mediator.execute(new nu(e,i,o))}_calculateConstraints(e){return this._mediator.execute(new eu(e))}static \u0275fac=function(i){return new(i||tc)};static \u0275prov=y({token:tc,factory:tc.\u0275fac})};return t=x([w(tu)],t),t})(),iu=class{dragHandler;sourceIds;handlerPool;static fToken=Symbol("AttachTargetConnectionDragHandlersToNodeRequest");constructor(n,e,i){this.dragHandler=n,this.sourceIds=e,this.handlerPool=i}},YN=(()=>{let t=class nc{_store=l(k);_dragInjector=l(Xe);get _connections(){return this._store.connections.getAll()}handle(e){this._getInputConnections(e.dragHandler.nodeOrGroup).forEach(i=>{this._createAndSetConnectionToNodeHandler(i,e)})}_getInputConnections(e){let i=new Set(this._getNodeInputIds(e));return this._connections.filter(o=>i.has(o.fInputId()))}_getNodeInputIds(e){return this._store.inputs.getAll().filter(i=>e.isContains(i.hostElement)).map(i=>i.fId())}_createAndSetConnectionToNodeHandler(e,i){let o=this._getExistingConnectionHandler(i.handlerPool,e);o||(o=this._createConnectionHandler(i.sourceIds,e),i.handlerPool.push(o)),i.dragHandler.targetConnectionHandlers.push(o)}_getExistingConnectionHandler(e,i){return e.find(o=>o.connection.fId()===i.fId())}_createConnectionHandler(e,i){let o;return e.includes(i.fOutputId())?o=this._dragInjector.createInstance(Wo):o=this._dragInjector.createInstance($o),o.initialize(i),o}static \u0275fac=function(i){return new(i||nc)};static \u0275prov=y({token:nc,factory:nc.\u0275fac})};return t=x([w(iu)],t),t})(),ou=class{dragHandler;targetIds;handlerPool;static fToken=Symbol("AttachSourceConnectionDragHandlersToNodeRequest");constructor(n,e,i){this.dragHandler=n,this.targetIds=e,this.handlerPool=i}},XN=(()=>{let t=class ic{_store=l(k);_dragInjector=l(Xe);get _connections(){return this._store.connections.getAll()}handle(e){this._getOutputConnections(e.dragHandler.nodeOrGroup).forEach(i=>{this._createAndSetConnectionToNodeHandler(i,e)})}_getOutputConnections(e){let i=new Set(this._getNodeOutputIds(e));return this._connections.filter(o=>i.has(o.fOutputId()))}_getNodeOutputIds(e){return this._store.outputs.getAll().filter(i=>e.isContains(i.hostElement)).map(i=>i.fId())}_createAndSetConnectionToNodeHandler(e,i){let o=this._getExistingConnectionHandler(i.handlerPool,e);o||(o=this._createConnectionHandler(i.targetIds,e),i.handlerPool.push(o)),i.dragHandler.sourceConnectionHandlers.push(o)}_getExistingConnectionHandler(e,i){return e.find(o=>o.connection.fId()===i.fId())}_createConnectionHandler(e,i){let o;return e.includes(i.fInputId())?o=this._dragInjector.createInstance(Wo):o=this._dragInjector.createInstance(Uo),o.initialize(i),o}static \u0275fac=function(i){return new(i||ic)};static \u0275prov=y({token:ic,factory:ic.\u0275fac})};return t=x([w(ou)],t),t})(),ru=class{nodeOrGroup;static fToken=Symbol("AttachDragNodeHandlerFromSelectionRequest");constructor(n){this.nodeOrGroup=n}},ZN=(()=>{let t=class oc{_mediator=l(D);_store=l(k);_dragSession=l(Q);handle({nodeOrGroup:e}){let i=this._collectSelected(e),o=this._withDeepChildren(i),r=this._mediator.execute(new Ql(o)),a=this._collectSourceConnectorIds(o),s=this._collectTargetConnectorIds(o);return this._attachConnectionHandlers(r.participants,a,s),this._mediator.execute(new tu(r.rootHandlers,r.participants))}_collectSelected(e){let i=[];for(let o of this._dragSession.selectedItems){let r=this._findNodeByHost(o.hostElement);r&&i.push(r)}return e&&!i.includes(e)&&i.push(e),i}_findNodeByHost(e){return this._store.nodes.getAll().find(i=>i.isContains(e))}_withDeepChildren(e){let i=[];for(let o of e){i.push(o);let r=this._mediator.execute(new Xi(o.fId()));i.push(...r)}return i}_collectSourceConnectorIds(e){return Qf(e,i=>this._store.outputs.getAll().filter(o=>o.fNodeId===i.fId()).map(o=>o.fId()))}_collectTargetConnectorIds(e){return Qf(e,i=>this._store.inputs.getAll().filter(o=>o.fNodeId===i.fId()).map(o=>o.fId()))}_attachConnectionHandlers(e,i,o){let r=[];for(let a of e)this._mediator.execute(new ou(a,o,r)),this._mediator.execute(new iu(a,i,r))}static \u0275fac=function(i){return new(i||oc)};static \u0275prov=y({token:oc,factory:oc.\u0275fac})};return t=x([w(ru)],t),t})(),QN=[jN,WN,KN,YN,XN,$N,UN,ZN];function JN(t,n,e=10){let i=n.x,o=n.y,r=i+n.width,a=o+n.height,s=n.gravityCenter.x,c=n.gravityCenter.y,u,p,g=1/0,b,M,P=1/0,R=(z,j)=>{let oe=j<0?-j:j;oe<=e&&oe<g&&(g=oe,u=z,p=j)},H=(z,j)=>{let oe=j<0?-j:j;oe<=e&&oe<P&&(P=oe,b=z,M=j)};for(let z=0;z<t.length;z++){let j=t[z],oe=j.x,Ce=j.y,le=oe+j.width,He=Ce+j.height,an=j.gravityCenter.x,Dt=j.gravityCenter.y;R(oe,i-oe),R(le,i-le),R(an,s-an),R(oe,r-oe),R(le,r-le),H(Ce,o-Ce),H(He,o-He),H(Dt,c-Dt),H(Ce,a-Ce),H(He,a-He)}return{x:{guide:u,delta:p},y:{guide:b,delta:M}}}var L0=["left","top","width","height"],au=class{_element;constructor(n,e,i="f-line"){this._element=n.document.createElement("div"),this._element.classList.add(i),this._element.style.position="absolute",this._element.style.display="none",e.appendChild(this._element)}show(){this._element.style.display="block"}hide(){this._element.style.display="none"}render(n){for(let e of L0){let i=n[e];i!=null&&(this._element.style[e]=`${i}px`)}}clearRect(){for(let n of L0)this._element.style.removeProperty(n)}destroy(){this._element.remove()}},em=class{_horizontal;_vertical;constructor(n,e){this._horizontal=new au(n,e),this._vertical=new au(n,e),this._horizontal.hide(),this._vertical.hide()}drawVerticalLine(n,e,i){this._vertical.show(),this._vertical.render({left:n*i.scale+i.position.x+i.scaledPosition.x,top:0,width:1,height:e.height})}drawHorizontalLine(n,e,i){this._horizontal.show(),this._horizontal.render({left:0,top:n*i.scale+i.position.y+i.scaledPosition.y,width:e.width,height:1})}hideVertical(){this._vertical.hide()}hideHorizontal(){this._horizontal.hide()}hideAll(){this._vertical.hide(),this._horizontal.hide()}destroy(){this._vertical.destroy(),this._horizontal.destroy()}},su=class{static fToken=Symbol("MagneticLinesPreparationRequest")},eR=(()=>{let t=class rc{_mediator=l(D);_store=l(k);_browser=l(qe);_injector=l(Ze);_dragSession=l(Q);_renderer;handle(e){let i=this._store.instances.get(Ie.MAGNETIC_LINES);if(!i)return;let o=this._dragSession.draggableItems.find(r=>r instanceof kn);o&&o.setMagneticLines(new tm(this._injector,this._renderer??this._createRenderer(i),this._flowHostSize(),this._notDraggedRects(this._draggedNodes(o.items))))}_draggedNodes(e){return e.map(i=>i.nodeOrGroup)}_flowHostSize(){return this._store.flowHost.getBoundingClientRect()}_createRenderer({hostElement:e}){return this._renderer=new em(this._browser,e),this._renderer}_notDraggedRects(e){let i=new Set(e);return this._store.nodes.getAll().filter(r=>!i.has(r)).map(r=>this._mediator.execute(new Ae(r.hostElement)))}static \u0275fac=function(i){return new(i||rc)};static \u0275prov=y({token:rc,factory:rc.\u0275fac})};return t=x([w(su)],t),t})(),tm=class{_renderer;_size;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;constructor(n,e,i,o){this._renderer=e,this._size=i,this._rects=o;let r=n.get(k);this._alignThreshold=r.instances.require(Ie.MAGNETIC_LINES).threshold(),this._canvasTransform=r.transform}scheduleRender(n){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderGuides(this._computeGuides(n)),15)}_renderGuides(n){this._renderVertical(n),this._renderHorizontal(n)}_renderVertical(n){n.x.guide!==void 0?this._renderer.drawVerticalLine(n.x.guide,this._size,this._canvasTransform):this._renderer.hideVertical()}_renderHorizontal(n){n.y.guide!==void 0?this._renderer.drawHorizontalLine(n.y.guide,this._size,this._canvasTransform):this._renderer.hideHorizontal()}_computeGuides(n){return JN(this._rects,n,this._alignThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},B0=["top","center","bottom"],z0=["left","center","right"];function tR(t,n,e=10,i=10){let o=n.x,r=n.y,a=o+n.width,s=r+n.height,c=n.gravityCenter.x,u=n.gravityCenter.y,p=nR(t,n,o,r,a,s,c,u,e,i),g=iR(t,n,o,r,a,s,c,u,e,i);return p&&(!g||p.absDelta<=g.absDelta)?{axis:"x",delta:p.delta,gap:p.gap,rects:p.rects,alignMode:p.alignMode,crossDelta:p.crossDelta}:g?{axis:"y",delta:g.delta,gap:g.gap,rects:g.rects,alignMode:g.alignMode,crossDelta:g.crossDelta}:{rects:[]}}function nR(t,n,e,i,o,r,a,s,c,u){let p=1/0,g,b=0,M,P=[],R=0,H=[],z=[],j=[];for(let oe=0;oe<B0.length;oe++){let Ce=oe===0?i:oe===1?s:r;H.length=0,z.length=0,j.length=0;let le=1/0,He=-1/0,an=0,Dt=1/0,mo=1/0;for(let ye=0;ye<t.length;ye++){let pe=t[ye],_o=oe===0?pe.y:oe===1?pe.gravityCenter.y:pe.y+pe.height,Bf=Ce-_o,$t=Ai(Bf);if($t>c)continue;H.push(ye),z.push(pe.x),j.push(pe.x+pe.width);let vo=pe.y,yo=pe.y+pe.height;vo<le&&(le=vo),yo>He&&(He=yo),($t<Dt||$t===Dt&&ye<mo)&&(Dt=$t,an=_o,mo=ye)}let We=H.length;if(We<2)continue;Sv(H,z,j);let Ve=0;for(;Ve<We&&z[Ve]<=a;)Ve++;let Hn=Ve>0&&Ve<We,et,st;Hn?(et=Ve-1,st=Ve):Ve<=0?(et=0,st=1):(et=We-2,st=We-1);let ct=z[st]-j[et];if(ct<0)continue;let Ue;if(Hn){Ue=j[et]+ct;let ye=Ue+n.width,pe=z[st]-ye;if(Ai(pe-ct)>u)continue}else Ve<=0?Ue=z[0]-ct-n.width:Ue=j[We-1]+ct;let go=e-Ue,jn=Ai(go);if(jn>u||jn>=p)continue;let It=oR(H,z,j,le,He);if(Hn){let ye=Ue,pe=Ue+n.width;It.push({left:j[et],top:le,width:ye-j[et],height:He-le}),It.push({left:pe,top:le,width:z[st]-pe,height:He-le})}else if(Ve<=0){let ye=Ue+n.width;It.push({left:ye,top:le,width:z[0]-ye,height:He-le})}else It.push({left:j[We-1],top:le,width:Ue-j[We-1],height:He-le});let Lf=Ce-an;p=jn,g=go,b=ct,M=B0[oe],P=It,R=Lf}if(!(g===void 0||M===void 0))return{delta:g,absDelta:p,gap:b,rects:P,alignMode:M,crossDelta:R}}function iR(t,n,e,i,o,r,a,s,c,u){let p=1/0,g,b=0,M,P=[],R=0,H=[],z=[],j=[];for(let oe=0;oe<z0.length;oe++){let Ce=oe===0?e:oe===1?a:o;H.length=0,z.length=0,j.length=0;let le=1/0,He=-1/0,an=0,Dt=1/0,mo=1/0;for(let ye=0;ye<t.length;ye++){let pe=t[ye],_o=oe===0?pe.x:oe===1?pe.gravityCenter.x:pe.x+pe.width,Bf=Ce-_o,$t=Ai(Bf);if($t>c)continue;H.push(ye),z.push(pe.y),j.push(pe.y+pe.height);let vo=pe.x,yo=pe.x+pe.width;vo<le&&(le=vo),yo>He&&(He=yo),($t<Dt||$t===Dt&&ye<mo)&&(Dt=$t,an=_o,mo=ye)}let We=H.length;if(We<2)continue;Sv(H,z,j);let Ve=0;for(;Ve<We&&z[Ve]<=s;)Ve++;let Hn=Ve>0&&Ve<We,et,st;Hn?(et=Ve-1,st=Ve):Ve<=0?(et=0,st=1):(et=We-2,st=We-1);let ct=z[st]-j[et];if(ct<0)continue;let Ue;if(Hn){Ue=j[et]+ct;let ye=Ue+n.height,pe=z[st]-ye;if(Ai(pe-ct)>u)continue}else Ve<=0?Ue=z[0]-ct-n.height:Ue=j[We-1]+ct;let go=i-Ue,jn=Ai(go);if(jn>u||jn>=p)continue;let It=rR(H,z,j,le,He);if(Hn){let ye=Ue,pe=Ue+n.height;It.push({left:le,top:j[et],width:He-le,height:ye-j[et]}),It.push({left:le,top:pe,width:He-le,height:z[st]-pe})}else if(Ve<=0){let ye=Ue+n.height;It.push({left:le,top:ye,width:He-le,height:z[0]-ye})}else It.push({left:le,top:j[We-1],width:He-le,height:Ue-j[We-1]});let Lf=Ce-an;p=jn,g=go,b=ct,M=z0[oe],P=It,R=Lf}if(!(g===void 0||M===void 0))return{delta:g,absDelta:p,gap:b,rects:P,alignMode:M,crossDelta:R}}function oR(t,n,e,i,o){let r=[],a=o-i;for(let s=0;s<t.length-1;s++){let c=n[s+1]-e[s];c<0||r.push({left:e[s],top:i,width:c,height:a})}return r}function rR(t,n,e,i,o){let r=[],a=o-i;for(let s=0;s<t.length-1;s++){let c=n[s+1]-e[s];c<0||r.push({left:i,top:e[s],width:a,height:c})}return r}function Sv(t,n,e){for(let i=1;i<n.length;i++){let o=n[i],r=e[i],a=t[i],s=i-1;for(;s>=0;){let c=n[s],u=t[s];if(c<o||c===o&&u<a)break;n[s+1]=c,e[s+1]=e[s],t[s+1]=u,s--}n[s+1]=o,e[s+1]=r,t[s+1]=a}}function Ai(t){return t<0?-t:t}var nm=class{_element;_isVisible=!1;_left=Number.NaN;_top=Number.NaN;_width=Number.NaN;_height=Number.NaN;constructor(n,e,i="f-rect"){this._element=n.document.createElement("div"),this._element.classList.add(i);let o=this._element.style;o.position="absolute",o.display="none",o.boxSizing="border-box",o.pointerEvents="none",e.appendChild(this._element)}show(){this._isVisible||(this._isVisible=!0,this._element.style.display="block")}hide(){this._isVisible&&(this._isVisible=!1,this._element.style.display="none")}render(n,e,i,o){let r=this._element.style;n!==this._left&&(this._left=n,r.left=n+"px"),e!==this._top&&(this._top=e,r.top=e+"px"),i!==this._width&&(this._width=i,r.width=i+"px"),o!==this._height&&(this._height=o,r.height=o+"px")}clearRect(){this._left=Number.NaN,this._top=Number.NaN,this._width=Number.NaN,this._height=Number.NaN;let n=this._element.style;n.removeProperty("left"),n.removeProperty("top"),n.removeProperty("width"),n.removeProperty("height")}destroy(){this._element.remove()}},im=class{_browser;_hostElement;_className;_pool=[];_activeCount=0;constructor(n,e,i="f-rect"){this._browser=n,this._hostElement=e,this._className=i}draw(n,e){let i=e.scale,o=e.position.x+e.scaledPosition.x,r=e.position.y+e.scaledPosition.y;for(let a=0;a<n.length;a++){let s=this._getOrCreate(a),c=n[a];s.show(),s.render(c.left*i+o,c.top*i+r,c.width*i,c.height*i)}for(let a=n.length;a<this._activeCount;a++)this._pool[a].hide();this._activeCount=n.length}hideAll(){for(let n=0;n<this._activeCount;n++)this._pool[n].hide();this._activeCount=0}destroy(){for(let n of this._pool)n.destroy();this._pool.length=0,this._activeCount=0}_getOrCreate(n){if(n<this._pool.length)return this._pool[n];let e=new nm(this._browser,this._hostElement,this._className);return this._pool.push(e),e}},cu=class{static fToken=Symbol("MagneticRectsPreparationRequest")},aR=(()=>{let t=class ac{_mediator=l(D);_store=l(k);_browser=l(qe);_injector=l(Ze);_dragSession=l(Q);_renderer;handle(e){let i=this._store.instances.get(Ie.MAGNETIC_RECTS);if(!i)return;let o=this._dragSession.draggableItems.find(r=>r instanceof kn);o&&o.setMagneticRects(new om(this._injector,this._getRenderer(i),this._notDraggedRects(this._draggedNodes(o.items))))}_draggedNodes(e){return e.map(i=>i.nodeOrGroup)}_getRenderer(e){return this._renderer||(this._renderer=new im(this._browser,e.hostElement)),this._renderer?.destroy(),this._renderer}_notDraggedRects(e){let i=new Set(e);return this._store.nodes.getAll().filter(r=>!i.has(r)).map(r=>this._mediator.execute(new Ae(r.hostElement)))}static \u0275fac=function(i){return new(i||ac)};static \u0275prov=y({token:ac,factory:ac.\u0275fac})};return t=x([w(cu)],t),t})(),om=class{_renderer;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;_spacingThreshold=10;constructor(n,e,i){this._renderer=e,this._rects=i;let o=n.get(k),r=o.instances.require(Ie.MAGNETIC_RECTS);this._alignThreshold=r.alignThreshold(),this._spacingThreshold=r.spacingThreshold(),this._canvasTransform=o.transform}scheduleRender(n){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderRects(this._computeRects(n)),15)}_renderRects(n){if(n.axis!==void 0&&n.delta!==void 0&&n.rects.length>0){this._renderer.draw(n.rects,this._canvasTransform);return}this._renderer.hideAll()}_computeRects(n){return tR(this._rects,n,this._alignThreshold,this._spacingThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},du=class{event;static fToken=Symbol("DragNodeFinalizeRequest");constructor(n){this.event=n}},rm=class{nodes;fNodes;constructor(n){this.nodes=n,this.fNodes=n}},sR=(()=>{let t=class sc{_mediator=l(D);_store=l(k);_dragSession=l(Q);_dragHandler;handle({event:e}){if(this._dragHandler=this._getDragHandler(),!this._dragHandler)return;let i=this._buildDragDelta(e.getPosition()),o=this._dragHandler.calculateMagneticSnaps(i),r=this._applySnapToDelta(i,o.lines,o.rects);this._finalizeMove(this._dragHandler,r),this._emitNodeIntersectIfNeeded(this._dragHandler)}_getDragHandler(){return this._dragSession.draggableItems.find(HN)}_buildDragDelta(e){return Z.fromPoint(e).elementTransform(this._store.flowHost).div(this._dragSession.onPointerDownScale).sub(this._dragSession.onPointerDownPosition)}_applySnapToDelta(e,i,o){let r=e.x,a=e.y;return i&&(r=this._hasLineSnapValue(i.x)?e.x-(i.x.delta||0):r,a=this._hasLineSnapValue(i.y)?e.y-(i.y.delta||0):a),this._hasRectSnapValue(o)&&(o.axis==="x"?(r=e.x-o.delta,a=e.y-(o.crossDelta??0)):(a=e.y-o.delta,r=e.x-(o.crossDelta??0))),{x:r,y:a}}_hasLineSnapValue(e){return e.guide!==void 0&&e.guide!==null}_hasRectSnapValue(e){return!!e&&e.axis!==void 0&&e.delta!==void 0}_finalizeMove(e,i){for(let o of e.roots)o.finalizeConstraints();e.onPointerMove(i),e.onPointerUp?.(),this._store.fDraggable?.fMoveNodes.emit(this._buildMoveNodesEvent(e))}_buildMoveNodesEvent(e){let i=e.getEvent(),a=((i.data??i.fData)?.fNodeIds??[]).map(s=>({id:s,position:this._store.nodes.get(s)?._position}));return new rm(a)}_emitNodeIntersectIfNeeded(e){if(!this._isDraggedJustOneNode(e)||!this._store.fDraggable?.fEmitOnNodeIntersect)return;let i=e.roots[0].nodeOrGroup;queueMicrotask(()=>this._mediator.execute(new Nl(i)))}_isDraggedJustOneNode(e){return e.roots.length===1}static \u0275fac=function(i){return new(i||sc)};static \u0275prov=y({token:sc,factory:sc.\u0275fac})};return t=x([w(du)],t),t})(),lu=class{event;trigger;static fToken=Symbol("DragNodePreparationRequest");constructor(n,e){this.event=n,this.trigger=e}},cR=(()=>{let t=class cc{_mediator=l(D);_store=l(k);_dragSession=l(Q);handle({event:e,trigger:i}){if(!this._canStartDrag(e,i))return;let o=this._findDraggableNode(e.targetElement);o&&(this._storePointerDownContext(e),this._dragSession.draggableItems=[this._buildDragNodeHandler(o)],this._mediator.execute(new su),this._mediator.execute(new cu))}_canStartDrag(e,i){return this._dragSession.isEmpty()&&this._isDragHandle(e.targetElement)&&bt(e.originalEvent,i)}_isDragHandle(e){return So(e,".f-drag-handle")}_findDraggableNode(e){let i=this._store.nodes.getAll();for(let o of i)if(!o.fDraggingDisabled()&&o.isContains(e))return o}_storePointerDownContext(e){this._dragSession.onPointerDownScale=this._store.transform.scale,this._dragSession.onPointerDownPosition=Z.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(this._store.transform.scale)}_buildDragNodeHandler(e){return(e.fSelectionDisabled()||!e.isSelected())&&queueMicrotask(()=>{this._mediator.execute(new Yi(e))}),this._mediator.execute(new ru(e))}static \u0275fac=function(i){return new(i||cc)};static \u0275prov=y({token:cc,factory:cc.\u0275fac})};return t=x([w(lu)],t),t})(),dR=[...QN,eR,aR,sR,cR],am=class{targetGroupId;nodeIds;dropPosition;fTargetNode;fNodes;fDropPosition;constructor(n,e,i){this.targetGroupId=n,this.nodeIds=e,this.dropPosition=i,this.fTargetNode=n,this.fNodes=e,this.fDropPosition=i}},lR=(()=>{let t=class dc{_dragSession=l(Q);_store=l(k);handle({event:e}){let i=this._findDropHandler();if(!i)return;let o=i.activeTarget?.node;o&&this._emitDropToGroupEvent(o.fId(),e),i.onPointerUp?.()}_findDropHandler(){return this._dragSession.draggableItems.find(e=>e instanceof Go)}_emitDropToGroupEvent(e,i){this._store.fDraggable?.fDropToGroup.emit(new am(e,this._getTopLevelDraggedIds(),i.getPosition()))}_getTopLevelDraggedIds(){let i=this._getMoveSummaryHandler().items.map(a=>a.nodeOrGroup),o=new Set(i.map(a=>a.fId())),r=[];for(let a of i){let s=a.fParentId();(!s||!o.has(s))&&r.push(a.fId())}return r}_getMoveSummaryHandler(){let e=this._dragSession.draggableItems.find(i=>i instanceof kn);if(!e)throw new Error("DropToGroup requires DragNodeHandler.");return e}static \u0275fac=function(i){return new(i||dc)};static \u0275prov=y({token:dc,factory:dc.\u0275fac})};return t=x([w(Zl)],t),t})(),uu=class{event;static fToken=Symbol("DropToGroupPreparationRequest");constructor(n){this.event=n}},pu=class{candidates;static fToken=Symbol("SortDropCandidatesByLayerRequest");constructor(n){this.candidates=n}},uR=(()=>{let t=class lc{handle({candidates:e}){let i=e.map((o,r)=>({candidate:o,index:r}));return i.sort((o,r)=>{let a=this._compareDomOrder(o.candidate.node.hostElement,r.candidate.node.hostElement);return a!==0?-a:o.index-r.index}),i.map(o=>o.candidate)}_compareDomOrder(e,i){if(e===i)return 0;let o=e.compareDocumentPosition(i);if((o&Node.DOCUMENT_POSITION_FOLLOWING)!==0)return-1;if((o&Node.DOCUMENT_POSITION_PRECEDING)!==0)return 1;if(o&Node.DOCUMENT_POSITION_DISCONNECTED){let r=e.getBoundingClientRect?.()??{top:0,left:0},a=i.getBoundingClientRect?.()??{top:0,left:0};return r.top!==a.top?r.top<a.top?-1:1:r.left!==a.left?r.left<a.left?-1:1:0}return 0}static \u0275fac=function(i){return new(i||lc)};static \u0275prov=y({token:lc,factory:lc.\u0275fac})};return t=x([w(pu)],t),t})(),sm=class{_onPointerDown;_limit;_vCellSize;_hCellSize;_adjustCellSize;constructor(n,e,i){this._onPointerDown=e,this._limit=i;let o=n.get(k);this._vCellSize=o.fDraggable.vCellSize(),this._hCellSize=o.fDraggable.hCellSize(),this._adjustCellSize=o.fDraggable.fCellSizeWhileDragging()}limit(n){let{min:e,max:i}=this._limit,{x:o,y:r}=this._cellSizeStrategies[+this._adjustCellSize](n);return{x:this._clamp(o,e.x,i.x),y:this._clamp(r,e.y,i.y)}}_cellSizeStrategies={0:this._skipCellSize.bind(this),1:this._applyCellSize.bind(this)};_applyCellSize(n){return{x:this._snapToGrid(this._onPointerDown.x+n.x,this._hCellSize)-this._onPointerDown.x,y:this._snapToGrid(this._onPointerDown.y+n.y,this._vCellSize)-this._onPointerDown.y}}_skipCellSize(n){return n}_clamp(n,e,i){return Math.min(Math.max(n,e),i)}_snapToGrid(n,e){return Math.round(n/e)*e}},fu=class{externalItem;static fToken=Symbol("DragExternalItemCreatePlaceholderRequest");constructor(n){this.externalItem=n}},pR=(()=>{let t=class uc{_browser=l(qe);_containerRef=l($r);handle({externalItem:e}){let{hostElement:i,placeholder:o}=e,r=o(),a=r?this._fromTemplate(r):this._fromHost(i);return a.classList.add("f-external-item-placeholder"),a.style.pointerEvents="none",a}_fromTemplate(e){return th(this._createViewRef(e),this._browser.document)}_fromHost(e){return Jf(e)}_createViewRef(e){let i=this._containerRef.createEmbeddedView(e);return i.detectChanges(),i}static \u0275fac=function(i){return new(i||uc)};static \u0275prov=y({token:uc,factory:uc.\u0275fac})};return t=x([w(fu)],t),t})(),hu=class{externalItem;static fToken=Symbol("DragExternalItemCreatePreviewRequest");constructor(n){this.externalItem=n}},fR=(()=>{let t=class pc{_browser=l(qe);_containerRef=l($r);handle({externalItem:e}){let{hostElement:i,preview:o}=e,r=o(),a=r?this._fromTemplate(r):this._fromHost(i);return this._setPreviewStyles(a),v0(a),a.classList.add("f-external-item-preview"),a}_fromTemplate(e){return th(this._createViewRef(e),this._browser.document)}_fromHost(e){return Jf(e)}_createViewRef(e){let i=this._containerRef.createEmbeddedView(e);return i.detectChanges(),i}_setPreviewStyles(e){eh(e.style,{"pointer-events":"none",margin:"showPopover"in e?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":"1000"},new Set(["position"]))}static \u0275fac=function(i){return new(i||pc)};static \u0275prov=y({token:pc,factory:pc.\u0275fac})};return t=x([w(hu)],t),t})(),mu=class{event;static fToken=Symbol("DragExternalItemFinalizeRequest");constructor(n){this.event=n}},cm=class{externalItemRect;data;targetContainerId;dropPosition;rect;fTargetNode;fDropPosition;constructor(n,e,i,o){this.externalItemRect=n,this.data=e,this.targetContainerId=i,this.dropPosition=o,this.rect=n,this.fTargetNode=i,this.fDropPosition=o}},hR="external-item",mR="drag-external-item";function gR(t){return t.getEvent().kind===mR||t.getEvent().fEventType===hR}var _R=(()=>{let t=class fc{_result=l(Dn);_mediator=l(D);_store=l(k);_dragSession=l(Q);_browser=l(qe);get _createNodeEmitter(){return this._store.fDraggable?.fCreateNode}handle(e){let i=this._findExternalItemHandler();if(!i)return;let o=this._getDestinationNodeOrGroupId();this._emitEvent(this._getElementsFromPoint(e.event.getPosition()),o,e.event.getPosition()),i.onPointerUp(),this._dragSession.draggableItems=[]}_findExternalItemHandler(){return this._dragSession.draggableItems.find(e=>gR(e))}_getDestinationNodeOrGroupId(){let e=this._getDropToGroupHandler(),i=e.activeTarget?.node.fId();return e.onPointerUp?.(),i}_getDropToGroupHandler(){let e=this._dragSession.draggableItems.find(i=>i instanceof Go);if(!e)throw new Error("NodeDragToParentDragHandler not found");return e}_getElementsFromPoint(e){return this._browser.document.elementsFromPoint(e.x,e.y).filter(i=>!i.closest(".f-external-item")&&!i.closest(".f-external-item-preview"))}_emitEvent(e,i,o){this._isPointerInCanvasRect(e)&&this._createNodeEmitter?.emit(new cm(this._getPreviewRect(),this._result.getData().externalItem.data(),i,i?o:void 0))}_isPointerInCanvasRect(e){return e.length?this._store.flowHost.contains(e[0]):!1}_getPreviewRect(){return this._mediator.execute(new Ae(this._result.getData().preview))}static \u0275fac=function(i){return new(i||fc)};static \u0275prov=y({token:fc,factory:fc.\u0275fac})};return t=x([w(mu)],t),t})(),dm=class{data;constructor(n){this.data=n}},gu=class extends nt{_externalItem;_pointerDownClientPosition;type="external-item";kind="drag-external-item";data(){return new dm(this._externalItem.data())}_result;_mediator;_browser;_store;_previewEl;_placeholderEl;_startRect=G.initialize();_pointerDownRect=G.initialize();_absoluteOffsetFromFlow=A.initialize();_grabOffsetFromPointer=A.initialize();_originalParent;_originalNextSibling;_originalDisplay;_applyConstraints=n=>n;constructor(n,e,i){super(),this._externalItem=e,this._pointerDownClientPosition=i,this._store=n.get(k),this._result=n.get(Dn),this._mediator=n.get(D),this._browser=n.get(qe),this._originalDisplay=this._host.style.display,this._initConstraints(n)}get _host(){return this._externalItem.hostElement}get _overlayRoot(){return this._browser.document.fullscreenElement??this._browser.document.body}get _transform(){return this._store.transform}_initConstraints(n){this._startRect=this._getStartRect();let e=new sm(n,this._startRect,fv());this._applyConstraints=i=>e.limit(i)}_getStartRect(){return this._mediator.execute(new Ae(this._externalItem.hostElement))}prepareDragSequence(){this._pointerDownRect=this._readAbsoluteRect(this._host),this._absoluteOffsetFromFlow=Z.fromPoint(this._pointerDownRect).sub(this._toAbsolutePoint(this._startRect)),this._grabOffsetFromPointer=this._clientToAbsolute(this._pointerDownClientPosition).sub(this._pointerDownRect),this._rememberOriginalPlacement(),this._previewEl=this._createPreview(),this._placeholderEl=this._createPlaceholder(),this._placePreviewIntoOverlay(),this._swapOriginalWithPlaceholderAndMoveOriginalIntoOverlay(),this._result.setData({preview:this._previewEl,externalItem:this._externalItem})}_rememberOriginalPlacement(){let n=this._host.parentNode;if(!n){this._originalParent=void 0,this._originalNextSibling=null;return}this._originalParent=n,this._originalNextSibling=this._host.nextSibling}_createPreview(){let n=this._mediator.execute(new hu(this._externalItem));return this._externalItem.previewMatchSize()&&this._matchSize(n,this._pointerDownRect),n.style.transform=q0(this._pointerDownRect),n}_createPlaceholder(){return this._mediator.execute(new fu(this._externalItem))}_placePreviewIntoOverlay(){this._overlayRoot.appendChild(this._previewEl)}_swapOriginalWithPlaceholderAndMoveOriginalIntoOverlay(){let n=this._originalParent,e=this._placeholderEl;if(!n||!e)return;let i=n.replaceChild(e,this._host);this._overlayRoot.appendChild(i),this._host.style.display="none"}onPointerMove(n,e){if(!this._previewEl)return;let i=this._resolveDeltaFromPointer(n,e),o=this._applyConstraints(i),r=Z.fromPoint(this._startRect).add(o),a=this._toAbsolutePoint(r).add(this._absoluteOffsetFromFlow);this._previewEl.style.transform=q0(a)}onPointerUp(){this._previewEl&&this._previewEl.parentNode&&this._previewEl.parentNode.removeChild(this._previewEl),this._restoreOriginalInParent(),this._host.style.display=this._originalDisplay||"block",this._previewEl=void 0,this._placeholderEl=void 0,this._originalParent=void 0,this._originalNextSibling=null}_restoreOriginalInParent(){let n=this._originalParent,e=this._placeholderEl;if(!(!n||!e)){if(e.parentNode===n){n.replaceChild(this._host,e);return}this._originalNextSibling&&this._originalNextSibling.parentNode===n?n.insertBefore(this._host,this._originalNextSibling):n.appendChild(this._host)}}_matchSize(n,e){n.style.width=`${e.width}px`,n.style.height=`${e.height}px`}_readAbsoluteRect(n){let e=n.getBoundingClientRect(),i=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,o=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return G.initialize(e.left+o,e.top+i,e.width,e.height)}_toAbsolutePoint(n){let e=Z.fromPoint(this._transform.position).add(this._transform.scaledPosition);return Z.fromPoint(n).mult(this._transform.scale).add(e).add(this._getFlowHostAbsolutePosition())}_resolveDeltaFromPointer(n,e){let i=e?.getPosition();if(!i)return n;let o=this._clientToAbsolute(i).sub(this._grabOffsetFromPointer),r=this._toFlowPoint(o);return Z.fromPoint(r).sub(this._startRect)}_toFlowPoint(n){let e=this._getFlowHostAbsolutePosition(),i=Z.fromPoint(this._transform.position).add(this._transform.scaledPosition);return Z.fromPoint(n).sub(e).sub(i).div(this._transform.scale)}_getFlowHostAbsolutePosition(){let n=this._store.flowHost.getBoundingClientRect(),e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,i=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return A.initialize(n.left+i,n.top+e)}_clientToAbsolute(n){let e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,i=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return Z.fromPoint(n).add(A.initialize(i,e))}};function q0({x:t,y:n}){return`translate3d(${Math.round(t)}px, ${Math.round(n)}px, 0)`}var _u=class{event;fTrigger;static fToken=Symbol("DragExternalItemPreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}};function vR(t){return!!t.closest?.("[fExternalItem]")}function yR(t){return t.closest("[fExternalItem]")}var CR=(()=>{class t{_byHost=new Map;_items=U([]);items=S(()=>this._items());getByElement(e){let i=yR(e);return i?this._byHost.get(i):void 0}getByHost(e){return this._byHost.get(e)}register(e){let i=e.hostElement,o=this._byHost.get(i);o!==e&&(o&&o!==e&&this._byHost.delete(i),this._byHost.set(i,e),this._sync())}remove(e){let i=e.hostElement;this._byHost.get(i)===e&&(this._byHost.delete(i),this._sync())}_sync(){this._items.set([...this._byHost.values()])}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var bR=(()=>{let t=class hc{_apiService=l(CR);_dragSession=l(Q);_store=l(k);_injector=l(Ze);get _flowHost(){return this._store.flowHost}get _transform(){return this._store.transform}handle({event:e,fTrigger:i}){if(!this._dragSession.isEmpty()||!bt(e.originalEvent,i))return;let o=this._resolveExternalItem(e.targetElement);if(!o||o.disabled())return;let r=this._transform.scale??1;this._dragSession.onPointerDownScale=r,this._dragSession.onPointerDownPosition=Z.fromPoint(e.getPosition()).elementTransform(this._flowHost).div(r),this._dragSession.draggableItems=[new gu(this._injector,o,e.getPosition())]}_resolveExternalItem(e){return this._apiService.getByElement(e)}static \u0275fac=function(i){return new(i||hc)};static \u0275prov=y({token:hc,factory:hc.\u0275fac})};return t=x([w(_u)],t),t})(),vu=class{event;static fToken=Symbol("PreventDefaultIsExternalItemRequest");constructor(n){this.event=n}},xR=(()=>{let t=class mc{handle(e){this._isTargetItemExternal(e.event)&&e.event.preventDefault()}_isTargetItemExternal(e){let i=this._isExternalItem(e.target),o=this._isExternalItem(e.target.parentNode);return i||o}_isExternalItem(e){let i=!1;try{i=vR(e)}catch{}return i}static \u0275fac=function(i){return new(i||mc)};static \u0275prov=y({token:mc,factory:mc.\u0275fac})};return t=x([w(vu)],t),t})(),wR=[pR,fR,_R,bR,xR],SR=(()=>{let t=class gc{_mediator=l(D);_dragContext=l(Q);_store=l(k);_dragInjector=l(Xe);get _allNodes(){return this._store.nodes.getAll()}handle({event:e}){if(!this._canPrepare())return;let i=this._allNodes.find(a=>a.isContains(e.targetElement));if(!i&&!this._hasExternalDrag())throw new Error("Drag target node not found");let o=this._sortedTargetsForDrop();if(i){let a=i.fParentId(),s=this._mediator.execute(new Ku(a));s.length&&(o=o.filter(c=>s.includes(c.node.fId())))}let r=this._dragInjector.get(Go);r.initialize(o),this._dragContext.draggableItems.push(r)}_canPrepare(){return this._hasMoveDrag()||this._hasExternalDrag()}_hasMoveDrag(){return this._dragContext.draggableItems.some(e=>e instanceof kn)}_hasExternalDrag(){return this._dragContext.draggableItems.some(e=>e instanceof gu)}_sortedTargetsForDrop(){let e=this._getDraggedNodes(),i=e.some(s=>s instanceof Gh),o=this._withParents(e),a=this._eligibleTargets(o,i).map(s=>{let c=this._mediator.execute(new Ae(s.hostElement));return{node:s,rect:c}});return this._mediator.execute(new pu(a))}_getDraggedNodes(){let e=this._dragContext.draggableItems.find(i=>i instanceof kn);return e?e.items.map(i=>i.nodeOrGroup):[]}_withParents(e){return e.reduce((i,o)=>{i.push(o);let r=this._mediator.execute(new Wi(o));return i.push(...r),i},[])}_eligibleTargets(e,i){let o=this._allNodes.filter(r=>!e.includes(r));return i?o.filter(r=>r instanceof Gh):o}static \u0275fac=function(i){return new(i||gc)};static \u0275prov=y({token:gc,factory:gc.\u0275fac})};return t=x([w(uu)],t),t})(),IR=[uR,SR,lR],yu=class{event;static fToken=Symbol("PinchToZoomFinalizeRequest");constructor(n){this.event=n}},TR=.5,Cu=(()=>{class t extends nt{type="pinch-to-zoom";kind="pinch-to-zoom";_store=l(k);get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.require(Ie.ZOOM)}_startDistance=null;_startScale=null;_touches;initialize(e){this._touches=e}prepareDragSequence(){let e=V0(this._touches);e!=null&&(this._startDistance=e,this._startScale=this._canvas.transform.scale)}onPointerMove(e,i){if(i.touches.length!==2||this._startDistance==null||this._startScale==null)return;let o=V0(i.touches),r=ER(i.touches);if(o==null||r==null){this._reset();return}if(Math.abs(o-this._startDistance)<TR)return;i.preventDefault();let a=o/this._startDistance,s=this._clamp(this._startScale*a);this._canvas.setScale(s,this._castPositionToFlow(r)),this._canvas.redraw()}_clamp(e){return Math.max(this._zoomComponent.minimum,Math.min(e,this._zoomComponent.maximum))}_castPositionToFlow(e){return Z.fromPoint(e).elementTransform(this._flowHost)}_reset(){this._startScale=null,this._startDistance=null}onPointerUp(){this._reset(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();function ER(t){if(t.length!==2)return null;let n=t[0],e=t[1];return A.initialize((n.clientX+e.clientX)/2,(n.clientY+e.clientY)/2)}function V0(t){if(t.length!==2)return null;let n=t[0],e=t[1];return Math.hypot(e.clientX-n.clientX,e.clientY-n.clientY)}var PR=(()=>{let t=class _c{_dragSession=l(Q);handle(e){if(this._hasPinchZoomHandler())for(let i of this._dragSession.draggableItems)i.onPointerUp?.()}_hasPinchZoomHandler(){return this._dragSession.draggableItems.some(e=>e instanceof Cu)}static \u0275fac=function(i){return new(i||_c)};static \u0275prov=y({token:_c,factory:_c.\u0275fac})};return t=x([w(yu)],t),t})(),bu=class{event;static fToken=Symbol("PinchToZoomPreparationRequest");constructor(n){this.event=n}},MR=(()=>{let t=class vc{_dragInjector=l(Xe);_store=l(k);_dragSession=l(Q);handle({event:e}){this._canStart(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=new Z,this._dragSession.draggableItems=[this._getHandler(e)])}_canStart(e){return this._dragSession.isEmpty()&&e.touches?.length===2&&!e.isEventInLockedContext&&this._hasZoomComponent()}_hasZoomComponent(){return this._store.instances.has(Ie.ZOOM)}_getHandler(e){let i=this._dragInjector.get(Cu);return i.initialize(e.touches),i}static \u0275fac=function(i){return new(i||vc)};static \u0275prov=y({token:vc,factory:vc.\u0275fac})};return t=x([w(bu)],t),t})(),kR=[MR,PR],xu=class{event;static fToken=Symbol("SelectionAreaFinalizeRequest");constructor(n){this.event=n}},DR=(()=>{let t=class yc{_dragSession=l(Q);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(i=>{i.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>e.getEvent().kind==="selection-area")}static \u0275fac=function(i){return new(i||yc)};static \u0275prov=y({token:yc,factory:yc.\u0275fac})};return t=x([w(xu)],t),t})(),lm=(()=>{class t extends nt{type="selection-area";kind="selection-area";_store=l(k);_dragSession=l(Q);_mediator=l(D);_canBeSelected=[];_selectedByMove=[];get _transform(){return this._store.transform}get _canvasPosition(){return Z.fromPoint(this._transform.position).add(this._transform.scaledPosition)}get _instance(){return this._store.instances.require(Ie.SELECTION_AREA)}prepareDragSequence(){this._canBeSelected=this._mediator.execute(new sp),this._show(),this._draw(G.initialize(this._dragSession.onPointerDownPosition.x,this._dragSession.onPointerDownPosition.y))}onPointerMove(e){let i=Z.fromPoint(e).add(this._dragSession.onPointerDownPosition),o=this._getMinimumPoint(this._dragSession.onPointerDownPosition,i),r=Math.abs(e.x),a=Math.abs(e.y),s=G.initialize(o.x,o.y,r,a);this._draw(s),this._selectedByMove=[],this._canBeSelected.forEach(c=>{c.element.unmarkAsSelected();let u=G.addPoint(G.mult(c.fRect,this._transform.scale),this._canvasPosition);G.intersectionWithRect(u,s)&&(c.element.markAsSelected(),this._selectedByMove.push(c.element))}),this._mediator.execute(new In)}_getMinimumPoint(e,i){return A.initialize(Math.min(e.x,i.x),Math.min(e.y,i.y))}onPointerUp(){this._hide(),this._dragSession.selectedItems.push(...this._selectedByMove),this._selectedByMove.length>0&&(this._dragSession.isSelectedChanged=!0)}_draw(e){let i=this._instance.hostElement.style;i.left=e.x+"px",i.top=e.y+"px",i.width=e.width+"px",i.height=e.height+"px"}_show(){this._instance.hostElement.style.display="block"}_hide(){this._instance.hostElement.style.display="none"}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),wu=class{event;static fToken=Symbol("SelectionAreaPreparationRequest");constructor(n){this.event=n}},OR=(()=>{let t=class Cc{_store=l(k);_dragSession=l(Q);_dragInjector=l(Xe);get _instance(){return this._store.instances.get(Ie.SELECTION_AREA)}handle(e){this._isValid(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=Z.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost),this._dragSession.draggableItems=[this._dragInjector.createInstance(lm)])}_isValid(e){return!!this._instance&&this._dragSession.isEmpty()&&bt(e.event.originalEvent,this._instance.fTrigger)}static \u0275fac=function(i){return new(i||Cc)};static \u0275prov=y({token:Cc,factory:Cc.\u0275fac})};return t=x([w(wu)],t),t})(),NR=[OR,DR],Su=class{rect;childrenBounds;static fToken=Symbol("ApplyChildResizeConstraintsRequest");constructor(n,e){this.rect=n,this.childrenBounds=e}},RR=(()=>{let t=class bc{handle({rect:e,childrenBounds:i}){i&&this._apply(e,i)}_apply(e,i){this._restrictLeft(e,i),this._restrictTop(e,i),this._restrictRight(e,i),this._restrictBottom(e,i),e.width=Math.max(0,e.width),e.height=Math.max(0,e.height)}_restrictLeft(e,i){let o=e.x-i.x;o>0&&(e.x-=o,e.width+=o)}_restrictTop(e,i){let o=e.y-i.y;o>0&&(e.y-=o,e.height+=o)}_restrictRight(e,i){let o=i.x+i.width;e.x+e.width<=o&&(e.width=o-e.x)}_restrictBottom(e,i){let o=i.y+i.height;e.y+e.height<=o&&(e.height=o-e.y)}static \u0275fac=function(i){return new(i||bc)};static \u0275prov=y({token:bc,factory:bc.\u0275fac})};return t=x([w(Su)],t),t})(),Iu=class{rect;limits;static fToken=Symbol("ApplyParentResizeConstraintsRequest");constructor(n,e){this.rect=n,this.limits=e}},AR=(()=>{let t=class xc{_mediator=l(D);handle({rect:e,limits:i}){this._applyResizeConstraints(e,i)}_applyResizeConstraints(e,i){if(!i)return;let o=this._clampedCopyForCalculation(e,i);this._applySoftParentExpansions(o,i.softLimits),i.hardLimit&&this._clampRectToInner(e,i.hardLimit.innerRect)}_clampedCopyForCalculation(e,i){let o=se({},e);return i.hardLimit&&this._clampRectToInner(o,i.hardLimit.innerRect),o}_clampRectToInner(e,i){if(e.x<i.x){let a=i.x-e.x;e.x+=a,e.width-=a}if(e.y<i.y){let a=i.y-e.y;e.y+=a,e.height-=a}let o=i.x+i.width;e.x+e.width>o&&(e.width=o-e.x);let r=i.y+i.height;e.y+e.height>r&&(e.height=r-e.y),e.width=Math.max(0,e.width),e.height=Math.max(0,e.height)}_applySoftParentExpansions(e,i){if(i?.length)for(let o of i)this._expandParentFromOriginalIfOverflow(e,o)}_expandParentFromOriginalIfOverflow(e,i){let o=i.innerRect,r=i.boundingRect,a=this._computeOverflow(o,e);if(!this._hasOverflow(a)){this._applyParentRect(i,r);return}let s=this._buildExpandedParentRect(r,a);this._applyParentRect(i,s)}_hasOverflow(e){return!!(e.left||e.top||e.right||e.bottom)}_computeOverflow(e,i){let o=Math.max(0,e.x-i.x),r=Math.max(0,e.y-i.y),a=Math.max(0,i.x+i.width-(e.x+e.width)),s=Math.max(0,i.y+i.height-(e.y+e.height));return{left:o,top:r,right:a,bottom:s}}_buildExpandedParentRect(e,i){let o=se({},e);return i.left&&(o.x=e.x-i.left,o.width=e.width+i.left),i.top&&(o.y=e.y-i.top,o.height=e.height+i.top),i.right&&(o.width=(o.width??e.width)+i.right),i.bottom&&(o.height=(o.height??e.height)+i.bottom),o}_applyParentRect(e,i){e.nodeOrGroup.updatePosition(i),e.nodeOrGroup.updateSize(i),this._mediator.execute(new ni(e.nodeOrGroup.fId(),i)),e.nodeOrGroup.redraw()}static \u0275fac=function(i){return new(i||xc)};static \u0275prov=y({token:xc,factory:xc.\u0275fac})};return t=x([w(Iu)],t),t})(),Tu=class{originalRect;difference;handleType;minimumSize;static fToken=Symbol("CalculateChangedRectFromDifferenceRequest");constructor(n,e,i,o){this.originalRect=n,this.difference=e,this.handleType=i,this.minimumSize=o}},G0={[Lt.LEFT]:{x:-1,y:0},[Lt.LEFT_TOP]:{x:-1,y:-1},[Lt.TOP]:{x:0,y:-1},[Lt.RIGHT_TOP]:{x:1,y:-1},[Lt.RIGHT]:{x:1,y:0},[Lt.RIGHT_BOTTOM]:{x:1,y:1},[Lt.BOTTOM]:{x:0,y:1},[Lt.LEFT_BOTTOM]:{x:-1,y:1}},FR=(()=>{let t=class wc{handle({originalRect:e,difference:i,handleType:o,minimumSize:r}){let a=this._changeSizeInRect(e,i,G0[o],r);return this._changePosition(e,i,G0[o],a)}_changeSizeInRect(e,i,o,r){let a=e.width+o.x*i.x,s=e.height+o.y*i.y,c=0,u=0;return a<0&&(c=a,a=Math.abs(a)),a<r.width&&(o.x===-1&&(c+=a-r.width),a=r.width),s<0&&(u=s,s=Math.abs(s)),s<r.height&&(o.y===-1&&(u+=s-r.height),s=r.height),G.initialize(c,u,a,s)}_changePosition(e,i,o,r){let a=e.x+(o.x===-1?i.x:0)+r.x,s=e.y+(o.y===-1?i.y:0)+r.y;return G.initialize(a,s,r.width,r.height)}static \u0275fac=function(i){return new(i||wc)};static \u0275prov=y({token:wc,factory:wc.\u0275fac})};return t=x([w(Tu)],t),t})(),Eu=class{nodeOrGroup;paddings;static fToken=Symbol("CalculateDirectChildrenUnionRectRequest");constructor(n,e){this.nodeOrGroup=n,this.paddings=e}},LR=(()=>{let t=class Sc{_mediator=l(D);_store=l(k);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle({nodeOrGroup:e,paddings:i}){let o=G.union(this._calculateDirectChildren(e.fId()).map(r=>this._normalizeRect(r)));return o?this._concatRectWithParentPadding(o,i):null}_calculateDirectChildren(e){return this._allNodesAndGroups.filter(i=>i.fParentId()===e)}_normalizeRect(e){return this._mediator.execute(new Ae(e.hostElement))}_concatRectWithParentPadding(e,i){return G.initialize(e.x-i[0],e.y-i[1],e.width+i[0]+i[2],e.height+i[1]+i[3])}static \u0275fac=function(i){return new(i||Sc)};static \u0275prov=y({token:Sc,factory:Sc.\u0275fac})};return t=x([w(Eu)],t),t})(),Ko=class{nodeOrGroup;rect;static fToken=Symbol("CalculateResizeLimitsRequest");constructor(n,e){this.nodeOrGroup=n,this.rect=e}},BR=(()=>{let t=class Ic{_mediator=l(D);handle({nodeOrGroup:e,rect:i}){let o=this._getParentsChain(e),r=this._calculateNodePaddings(e,i);return{limits:this._buildSoftHardLimits(o),childrenBounds:this._getNormalizedChildrenBounds(e,r),minimumSize:tt.initialize(r[0]+r[2],r[1]+r[3])}}_calculateNodePaddings(e,i){return this._mediator.execute(new ai(e,i))}_getNormalizedChildrenBounds(e,i){return this._mediator.execute(new Eu(e,i))}_getParentsChain(e){return this._mediator.execute(new Wi(e))??[]}_buildSoftHardLimits(e){let i=[],o,r=[0,0,0,0];for(let a of e){let s=this._getParentInfo(a,r);if(r=s.paddings,this._isAutoExpand(a))i.push(this._makeLimit(a,s));else{o=this._makeLimit(a,s);break}}return{softLimits:i,hardLimit:o}}_getParentInfo(e,i){return this._mediator.execute(new Ho(e,i))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeLimit(e,{boundingRect:i,innerRect:o}){return{nodeOrGroup:e,boundingRect:i,innerRect:o}}static \u0275fac=function(i){return new(i||Ic)};static \u0275prov=y({token:Ic,factory:Ic.\u0275fac})};return t=x([w(Ko)],t),t})(),Pu=class{event;static fToken=Symbol("ResizeNodeFinalizeRequest");constructor(n){this.event=n}},Iv="node-resize",Tv="resize-node";function zR(t){return t.getEvent().kind===Tv||t.getEvent().fEventType===Iv}var qR=(()=>{let t=class Tc{_dragSession=l(Q);handle(e){this._isNodeResizeHandler()&&this._dragSession.draggableItems.forEach(i=>i.onPointerUp?.())}_isNodeResizeHandler(){return this._dragSession.draggableItems.some(e=>zR(e))}static \u0275fac=function(i){return new(i||Tc)};static \u0275prov=y({token:Tc,factory:Tc.\u0275fac})};return t=x([w(Pu)],t),t})(),um=class{fNodeId;constructor(n){this.fNodeId=n}},pm=(()=>{class t extends nt{type=Iv;kind=Tv;data(){return new um(this._nodeOrGroup.fId())}_mediator=l(D);_baselineRect;_constraints;_lastRect=null;_nodeOrGroup;_handleType;_nodeConnections={source:[],target:[]};_softParentConnections=[];initialize(e,i){this._nodeOrGroup=e,this._handleType=i}setNodeConnectionHandlers(e){this._nodeConnections=e}setSoftParentConnectionHandlers(e){this._softParentConnections=e}prepareDragSequence(){this._baselineRect=this._readBaselineRect(),this._constraints=this._buildConstraints(this._baselineRect),this._lastRect=this._baselineRect}onPointerMove(e){let i=this._calcNextRect(e);this._applyConstraints(i),this._commitRect(i),this._applyConnectionHandlers(this._nodeConnections);for(let o of this._softParentConnections)this._applyConnectionHandlers(o);this._lastRect=i}onPointerUp(){let e=this._lastRect??this._fallbackRectFromModel();this._nodeOrGroup.sizeChange.emit(e),requestAnimationFrame(()=>this._nodeOrGroup.refresh())}_readBaselineRect(){return this._mediator.execute(new Ae(this._nodeOrGroup.hostElement))}_buildConstraints(e){return this._mediator.execute(new Ko(this._nodeOrGroup,e))}_calcNextRect(e){return this._mediator.execute(new Tu(this._baselineRect,e,this._handleType,this._constraints.minimumSize))}_applyConstraints(e){this._mediator.execute(new Su(e,this._constraints.childrenBounds)),this._mediator.execute(new Iu(e,this._constraints.limits))}_commitRect(e){this._nodeOrGroup.updatePosition({x:e.x,y:e.y}),this._nodeOrGroup.updateSize({width:e.width,height:e.height}),this._mediator.execute(new ni(this._nodeOrGroup.fId(),e)),this._nodeOrGroup.redraw()}_fallbackRectFromModel(){return G.initialize(this._nodeOrGroup._position.x,this._nodeOrGroup._position.y,this._nodeOrGroup._size?.width,this._nodeOrGroup._size?.height)}_applyConnectionHandlers(e){if(!e.source.length&&!e.target.length)return;let i=new Map;for(let o of e.source){let r=this._readConnectorRect(o.connector,i);o.handler.setSourceRect(r)}for(let o of e.target){let r=this._readConnectorRect(o.connector,i);o.handler.setTargetRect(r)}}_readConnectorRect(e,i){let o=`${e.kind}::${e.fId()}`,r=i.get(o);if(r)return r;let a=this._mediator.execute(new Pn(e.hostElement,!1));return i.set(o,a),a}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Yo=class{_mediator=l(D);_store=l(k);_behaviour=l(Zi);_source;_target;_sourceRef;_targetRef;_sourceRect;_targetRect;connection;initialize(n){this.connection=n,this._source=this._store.outputs.require(this.connection.fOutputId()),this._target=this._store.inputs.require(this.connection.fInputId()),this._sourceRef=this._readRectRef(this._source),this._targetRef=this._readRectRef(this._target),this._sourceRect=ze.fromRoundedRect(this._sourceRef.rect),this._targetRect=ze.fromRoundedRect(this._targetRef.rect)}setSourceRect(n){this._sourceRect=ze.fromRoundedRect(n),this._mediator.execute(new ti(this._source.fId(),this._source.kind,this._sourceRect))}setTargetRect(n){this._targetRect=ze.fromRoundedRect(n),this._mediator.execute(new ti(this._target.fId(),this._target.kind,this._targetRect))}redraw(){let n=this._buildLine();this.connection.setLine(n),this.connection.redraw()}_buildLine(){let n=ze.fromRoundedRect(this._sourceRect),e=ze.fromRoundedRect(this._targetRect);return this._behaviour.handle(new Mt(n,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(n){return{connector:n,rect:this._mediator.execute(new Pn(n.hostElement,!1))}}_resolveRotationContext(n){return this._mediator.execute(new Qt(n))}},VR=(()=>{class t extends Yo{_sourceUpdated=!1;_targetUpdated=!1;setSourceRect(e){super.setSourceRect(e),this._sourceUpdated=!0,this._redrawIfReady()}setTargetRect(e){super.setTargetRect(e),this._targetUpdated=!0,this._redrawIfReady()}_redrawIfReady(){!this._sourceUpdated||!this._targetUpdated||(this._sourceUpdated=!1,this._targetUpdated=!1,super.redraw())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),GR=(()=>{class t extends Yo{setSourceRect(e){super.setSourceRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),HR=(()=>{class t extends Yo{setTargetRect(e){super.setTargetRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Mu=class{event;fTrigger;static fToken=Symbol("ResizeNodePreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}},ku=class{handler;nodeOrGroup;static fToken=Symbol("AttachResizeConnectionDragHandlersToNodeRequest");constructor(n,e){this.handler=n,this.nodeOrGroup=e}},jR=(()=>{let t=class Ec{_store=l(k);_mediator=l(D);_dragInjector=l(Xe);handle({handler:e,nodeOrGroup:i}){let o=this._readSoftParents(i),r=[i,...o],a=this._collectSourceConnectorIds(r),s=this._collectTargetConnectorIds(r),c=new Map;e.setNodeConnectionHandlers(this._buildConnectionHandlersForNode(i,a,s,c)),e.setSoftParentConnectionHandlers(o.map(u=>this._buildConnectionHandlersForNode(u,a,s,c)))}_readSoftParents(e){let i=this._mediator.execute(new Ae(e.hostElement));return this._mediator.execute(new Ko(e,i)).limits.softLimits.map(r=>r.nodeOrGroup)}_collectSourceConnectorIds(e){let i=new Set(e.map(o=>o.fId()));return new Set(this._store.outputs.getAll().filter(o=>i.has(o.fNodeId)).map(o=>o.fId()))}_collectTargetConnectorIds(e){let i=new Set(e.map(o=>o.fId()));return new Set(this._store.inputs.getAll().filter(o=>i.has(o.fNodeId)).map(o=>o.fId()))}_buildConnectionHandlersForNode(e,i,o,r){let a=this._store.outputs.getAll().filter(g=>g.fNodeId===e.fId()),s=this._store.inputs.getAll().filter(g=>g.fNodeId===e.fId());if(!a.length&&!s.length)return{source:[],target:[]};let c=new Set(a.map(g=>g.fId())),u=new Set(s.map(g=>g.fId())),p={source:[],target:[]};for(let g of this._store.connections.getAll()){let b=c.has(g.fOutputId()),M=u.has(g.fInputId());if(!b&&!M)continue;let P=r.get(g.fId())??this._createConnectionHandler(g,i,o);if(r.set(g.fId(),P),b){let R=this._store.outputs.require(g.fOutputId());p.source.push({handler:P,connector:R})}if(M){let R=this._store.inputs.require(g.fInputId());p.target.push({handler:P,connector:R})}}return p}_createConnectionHandler(e,i,o){let r=i.has(e.fOutputId()),a=o.has(e.fInputId()),s=r&&a?this._dragInjector.createInstance(VR):r?this._dragInjector.createInstance(GR):this._dragInjector.createInstance(HR);return s.initialize(e),s}static \u0275fac=function(i){return new(i||Ec)};static \u0275prov=y({token:Ec,factory:Ec.\u0275fac})};return t=x([w(ku)],t),t})(),UR=(()=>{let t=class Pc{_mediator=l(D);_store=l(k);_dragSession=l(Q);_dragInjector=l(Xe);get _transform(){return this._store.transform}handle({event:e,fTrigger:i}){if(!this._dragSession.isEmpty()||!this._isResizeHandle(e.targetElement)||!bt(e.originalEvent,i))return;let o=this._findResizableNode(e.targetElement);if(!o)return;this._selectBeforeResize(o);let r=this._transform.scale??1;this._dragSession.onPointerDownScale=r,this._dragSession.onPointerDownPosition=Z.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(r);let a=this._dragInjector.createInstance(pm);a.initialize(o,this._readResizeHandleType(e.targetElement)),this._mediator.execute(new ku(a,o)),this._dragSession.draggableItems=[a]}_isResizeHandle(e){return So(e,".f-resize-handle")}_findResizableNode(e){let i=this._store.nodes.getAll().find(o=>o.isContains(e));if(i)return i.fDraggingDisabled()?void 0:i}_selectBeforeResize(e){queueMicrotask(()=>{this._mediator.execute(new Yi(e))})}_readResizeHandleType(e){let i=y0(e,"fResizeHandleType",".f-resize-handle");return Lt[i]}static \u0275fac=function(i){return new(i||Pc)};static \u0275prov=y({token:Pc,factory:Pc.\u0275fac})};return t=x([w(Mu)],t),t})(),WR=[RR,AR,FR,LR,BR,jR,qR,UR],Du=class{event;static fToken=Symbol("RotateNodeFinalizeRequest");constructor(n){this.event=n}},Ev="node-rotate",Pv="rotate-node";function $R(t){return t.getEvent().kind===Pv||t.getEvent().fEventType===Ev}var KR=(()=>{let t=class Mc{_dragSession=l(Q);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(i=>{i.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>$R(e))}static \u0275fac=function(i){return new(i||Mc)};static \u0275prov=y({token:Mc,factory:Mc.\u0275fac})};return t=x([w(Du)],t),t})(),Ou=class{event;fTrigger;static fToken=Symbol("RotateNodePreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}},fm=class{fNodeId;constructor(n){this.fNodeId=n}};function YR(t,n,e){let{x:i,y:o}=XR(t,n,e),r=i-t.x,a=o-t.y;return{x:r,y:a}}function XR(t,n,e){let i=t.x-e.x,o=t.y-e.y,r=n*Math.PI/180,a=Math.cos(r),s=Math.sin(r),c=i*a-o*s,u=i*s+o*a,p=c+e.x,g=u+e.y;return{x:p,y:g}}var hm=(()=>{class t extends nt{type=Ev;kind=Pv;data(){return new fm(this._nodeOrGroup.fId())}_store=l(k);_mediator=l(D);_dragSession=l(Q);_nodeOrGroup;_sourceConnections;_targetConnections;_startRotation=0;_nodeRect;_nodeCenter;_pointerDownInFlow;_rotationOffsetDeg=0;get _transform(){return this._store.transform}initialize(e,i,o){this._nodeOrGroup=e,this._sourceConnections=i,this._targetConnections=o,this._startRotation=this._nodeOrGroup._rotate}prepareDragSequence(){this._nodeRect=this._readNodeRect(),this._nodeCenter=this._nodeRect.gravityCenter,this._pointerDownInFlow=this._calculatePointerDownInFlow();let e=this._angleDeg(this._pointerDownInFlow);this._rotationOffsetDeg=e-this._startRotation}onPointerMove(e){let i=A.sum(this._pointerDownInFlow,e),r=this._angleDeg(i)-this._rotationOffsetDeg;this._applyRotation(r);let a=r-this._startRotation;for(let s of this._sourceConnections)s.connection.setSourceDelta(this._deltaAfterRotation(s.connector,a));for(let s of this._targetConnections)s.connection.setTargetDelta(this._deltaAfterRotation(s.connector,a))}onPointerUp(){this._nodeOrGroup.rotate.set(this._nodeOrGroup._rotate),this._nodeOrGroup.refresh()}_readNodeRect(){return this._mediator.execute(new Ae(this._nodeOrGroup.hostElement))}_calculatePointerDownInFlow(){return A.sub(this._dragSession.onPointerDownPosition,A.sum(this._transform.position,this._transform.scaledPosition))}_angleDeg(e){return Math.atan2(e.y-this._nodeCenter.y,e.x-this._nodeCenter.x)*(180/Math.PI)}_applyRotation(e){this._nodeOrGroup.updateRotate(e),this._nodeOrGroup.redraw()}_deltaAfterRotation(e,i){return YR(e,i,this._nodeCenter)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),ZR=(()=>{let t=class kc{_mediator=l(D);_store=l(k);_dragContext=l(Q);_dragInjector=l(Xe);get _transform(){return this._store.transform}handle(e){if(!this._isPreparationAllowed(e))return;let i=this._findRotatableNode(e.event.targetElement);if(!i)return;this._selectBeforeRotate(i);let o=this._transform.scale;this._dragContext.onPointerDownScale=o,this._dragContext.onPointerDownPosition=Z.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(o);let r=this._dragInjector.createInstance(hm);r.initialize(i,this._buildOutputConnectionHandlers(i),this._buildInputConnectionHandlers(i)),this._dragContext.draggableItems=[r]}_isPreparationAllowed({event:e,fTrigger:i}){return this._dragContext.isEmpty()&&CN(e.targetElement)&&bt(e.originalEvent,i)}_findRotatableNode(e){for(let i of this._store.nodes.getAll())if(!i.fDraggingDisabled()&&i.isContains(e))return i}_selectBeforeRotate(e){queueMicrotask(()=>{this._mediator.execute(new Yi(e))})}_buildInputConnectionHandlers(e){return this._mediator.execute(new Bu(e)).map(i=>{let o=this._store.inputs.require(i.fInputId()),r=this._mediator.execute(new pt(o)),a=this._dragInjector.get($o);return a.initialize(i),{connection:a,connector:r.rect.gravityCenter}})}_buildOutputConnectionHandlers(e){return this._mediator.execute(new $u(e)).map(i=>{let o=this._store.outputs.require(i.fOutputId()),r=this._mediator.execute(new pt(o)),a=this._dragInjector.get(Uo);return a.initialize(i),{connection:a,connector:r.rect.gravityCenter}})}static \u0275fac=function(i){return new(i||kc)};static \u0275prov=y({token:kc,factory:kc.\u0275fac})};return t=x([w(Ou)],t),t})(),QR=[KR,ZR],Xo=class{flowRect;canvasPosition;eventPoint;minimap;static fToken=Symbol("CalculateFlowPointFromMinimapPointRequest");constructor(n,e,i,o){this.flowRect=n,this.canvasPosition=e,this.eventPoint=i,this.minimap=o}},JR=(()=>{let t=class Dc{_store=l(k);get _canvasScale(){return this._store.transform.scale||1}handle(e){return A.sub(e.canvasPosition,A.sub(this._getPositionInViewBox(e.eventPoint,e.minimap),this._getNormalizedFlowCenter(e.flowRect)))}_getNormalizedFlowCenter(e){return Z.fromPoint(e.gravityCenter).sub(e)}_getPositionInViewBox(e,i){let o=this.normalizeEventPoint(e,i);return A.sum(o,G.mult(i.viewBox,this._canvasScale))}normalizeEventPoint(e,i){return this._getEventPointInMinimap(e,i).mult(i.scale).mult(this._canvasScale)}_getEventPointInMinimap(e,i){return Z.fromPoint(e).elementTransform(i.element)}static \u0275fac=function(i){return new(i||Dc)};static \u0275prov=y({token:Dc,factory:Dc.\u0275fac})};return t=x([w(Xo)],t),t})(),Nu=class{event;static fToken=Symbol("DragMinimapFinalizeRequest");constructor(n){this.event=n}},e2=(()=>{let t=class Oc{_dragSession=l(Q);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(i=>{i.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(t2)}static \u0275fac=function(i){return new(i||Oc)};static \u0275prov=y({token:Oc,factory:Oc.\u0275fac})};return t=x([w(Nu)],t),t})(),Mv="minimap",kv="minimap";function t2(t){return t.getEvent().kind===kv||t.getEvent().fEventType===Mv}var mm=(()=>{class t extends nt{type=Mv;kind=kv;_store=l(k);_mediator=l(D);_lastDelta=null;_flowRect;_startCanvasPosition;_eventPoint;_minimap;initialize(e,i,o,r){this._flowRect=e,this._startCanvasPosition=i,this._eventPoint=o,this._minimap=r}prepareDragSequence(){this._store.fCanvas?.hostElement.classList.add("f-scaled-animate")}onPointerMove(e){this._lastDelta&&this._isSamePoint(e,this._lastDelta)||(this._lastDelta=e,this._store.fCanvas?.setPosition(this._getNewPosition(Z.fromPoint(this._eventPoint).add(e))),this._store.fCanvas?.redraw())}_isSamePoint(e,i){return e.x===i.x&&e.y===i.y}_getNewPosition(e){return this._mediator.execute(new Xo(this._flowRect,this._startCanvasPosition,e,this._minimap))}onPointerUp(){this._store.fCanvas?.hostElement.classList.remove("f-scaled-animate"),this._store.fCanvas?.emitCanvasChangeEvent()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Ru=class{event;static fToken=Symbol("DragMinimapPreparationRequest");constructor(n){this.event=n}},n2=(()=>{let t=class Nc{_store=l(k);_mediator=l(D);_dragSession=l(Q);_dragInjector=l(Xe);get _canvas(){return this._store.fCanvas}get _flowHost(){return this._store.flowHost}handle({event:e}){if(!this._isValid(e))return;let i=this._store.instances.require(Ie.MINIMAP).state,o=e.getPosition(),r=Z.fromPoint(this._store.transform.position),a=G.fromElement(this._flowHost);this._canvas.setPosition(this._calculateCanvasPosition(a,o,i)),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent(),this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=Z.fromPoint(o).elementTransform(this._flowHost);let s=this._dragInjector.createInstance(mm);s.initialize(a,r,o,i),this._dragSession.draggableItems=[s]}_isValid(e){return!(!this._dragSession.isEmpty()||!this._flowHost.contains(e.targetElement)||!e.targetElement.closest(".f-minimap")||!this._store.instances.get(Ie.MINIMAP))}_calculateCanvasPosition(e,i,o){return this._mediator.execute(new Xo(e,Z.fromPoint(this._canvas.transform.position),i,o))}static \u0275fac=function(i){return new(i||Nc)};static \u0275prov=y({token:Nc,factory:Nc.\u0275fac})};return t=x([w(Ru)],t),t})(),i2=[JR,e2,n2];function o2(t){return!!t&&typeof t.destroy=="function"}var Xe=(()=>{class t{_injector=l(Ze);_dragInjector=null;_created=[];create(){this._dragInjector=Ze.create({providers:[{provide:Au,useClass:Au},{provide:Yl,useClass:Yl},{provide:ql,useClass:ql},{provide:$h,useClass:$h},{provide:Go,useClass:Go},{provide:Uo,useClass:Uo},{provide:$o,useClass:$o},{provide:Wo,useClass:Wo},{provide:kn,useClass:kn},{provide:Cu,useClass:Cu},{provide:lm,useClass:lm},{provide:pm,useClass:pm},{provide:hm,useClass:hm},{provide:mm,useClass:mm}],parent:this._injector}),this._created=[]}get(e){if(!this._dragInjector)throw new Error("DragHandlerInjector has not been created. Call create() before using get().");return this._dragInjector.get(e)}createInstance(e){if(!this._dragInjector)throw new Error("DragHandlerInjector is not created");let i=m_(this._dragInjector,()=>new e);return this._created.push(i),i}destroy(){for(let e of this._created)o2(e)&&e.destroy();this._created=[],this._dragInjector?.destroy?.(),this._dragInjector=null}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Dn=(()=>{class t{_data;setData(e){this._data=se(se({},this._data),e)}getData(){return this._data}clear(){this._data=void 0}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),H0="f-canvas-dragging",j0="canvas-dragging",Au=(()=>{class t extends nt{type="canvas-move";kind="drag-canvas";_store=l(k);_onPointerDownPosition=A.initialize();constructor(){super(),this._store.fCanvas?.hostElement.classList.add(H0,j0)}prepareDragSequence(){this._onPointerDownPosition=this._store.transform.position}onPointerMove(e){this._store.fCanvas?.setPosition(Z.fromPoint(this._onPointerDownPosition).add(e)),this._store.fCanvas?.redraw()}onPointerUp(){this._store.fCanvas?.emitCanvasChangeEvent(),this._store.fCanvas?.hostElement.classList.remove(H0,j0)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),r2=(()=>{let t=class Rc{_dragContext=l(Q);handle(e){this._isValid()&&this._dragContext.draggableItems.forEach(i=>i.onPointerUp?.())}_isValid(){return this._dragContext.draggableItems.some(e=>e instanceof Au)}static \u0275fac=function(i){return new(i||Rc)};static \u0275prov=y({token:Rc,factory:Rc.\u0275fac})};return t=x([w(Al)],t),t})(),Fu=class{event;fTrigger;static fToken=Symbol("DragCanvasPreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}},a2=(()=>{let t=class Ac{_store=l(k);_dragContext=l(Q);_dragInjector=l(Xe);handle({event:e,fTrigger:i}){!this._isValid(e)||!this._isValidTrigger(e,i)||(this._dragContext.onPointerDownScale=1,this._dragContext.onPointerDownPosition=Z.fromPoint(e.getPosition()).elementTransform(this._store.flowHost),this._dragContext.draggableItems=[this._dragInjector.get(Au)])}_isValid(e){return this._dragContext.isEmpty()&&(this._isBackgroundElement(e.targetElement)||this._isDragOnHost(e.targetElement))}_isBackgroundElement(e){return this._store.instances.get(Ie.BACKGROUND)?.hostElement.contains(e)}_isDragOnHost(e){return this._store.flowHost.contains(e)&&!this._getNode(e)}_getNode(e){let i=this._store.nodes.getAll().find(o=>o.isContains(e));return i&&i.fDraggingDisabled()&&(i=void 0),i}_isValidTrigger(e,i){return bt(e.originalEvent,i)}static \u0275fac=function(i){return new(i||Ac)};static \u0275prov=y({token:Ac,factory:Ac.\u0275fac})};return t=x([w(Fu)],t),t})(),s2=[r2,a2],Lu=class{event;trigger;static fToken=Symbol("SelectByPointerRequest");constructor(n,e){this.event=n,this.trigger=e}},c2=(()=>{let t=class Fc{_mediator=l(D);_store=l(k);_dragSession=l(Q);handle({event:e,trigger:i}){if(!this._isSelectionAllowed(e))return;let o=this._resolveSelectable(e.targetElement);this._deferRaiseLayerFor(o),bt(e.originalEvent,i)?this._applyToggleSelect(o):this._applySingleSelect(o)}_isSelectionAllowed(e){return this._store.flowHost.contains(e.targetElement)&&this._dragSession.isEmpty()}_resolveSelectable(e){return this._findNodeOrGroupAt(e)??this._findConnectionAt(e)}_findNodeOrGroupAt(e){return this._store.nodes.getAll().find(i=>i.isContains(e))}_findConnectionAt(e){return this._store.connections.getAll().find(i=>i.isContains(e))}_deferRaiseLayerFor(e){e&&queueMicrotask(()=>{this._mediator.execute(new si(e,e.hostElement.parentElement))})}_applySingleSelect(e){if(!e||e.fSelectionDisabled()){this._clearSelection();return}e.isSelected()||(this._clearSelection(),this._select(e))}_applyToggleSelect(e){!e||e.fSelectionDisabled()||(e.isSelected()?this._deselect(e):this._select(e))}_clearSelection(){if(this._dragSession.selectedItems.length){for(let e of this._dragSession.selectedItems)e.unmarkAsSelected();this._dragSession.markSelectionAsChanged(),this._dragSession.selectedItems=[]}}_select(e){this._dragSession.selectedItems.push(e),e.markAsSelected(),this._dragSession.markSelectionAsChanged()}_deselect(e){let i=this._dragSession.selectedItems.indexOf(e);i>=0&&this._dragSession.selectedItems.splice(i,1),e.unmarkAsSelected(),this._dragSession.markSelectionAsChanged()}static \u0275fac=function(i){return new(i||Fc)};static \u0275prov=y({token:Fc,factory:Fc.\u0275fac})};return t=x([w(Lu)],t),t})(),d2=[c2];var gm=class extends Fh{hostElement=l(Oe).nativeElement};function l2(t){return So(t,".f-drag-blocker")}var Dv=(()=>{class t extends gm{_result=l(Dn);_mediator=l(D);_platform=l(Zf);disabled=!1;fMultiSelectTrigger=e=>this._platform.getOS()===bn.MAC_OS?e.metaKey:e.ctrlKey;fReassignConnectionTrigger=Et;fCreateConnectionTrigger=Et;fConnectionWaypointsTrigger=N(Et);fMoveControlPointTrigger=Et;fNodeResizeTrigger=Et;fNodeRotateTrigger=Et;fNodeMoveTrigger=Et;fCanvasMoveTrigger=Et;fExternalItemTrigger=Et;fSelectionChange=new dt;fNodeIntersectedWithConnections=new dt;fNodeConnectionsIntersection=Le();fEmitOnNodeIntersect=!1;fCreateNode=new dt;fMoveNodes=new dt;fReassignConnection=new dt;fCreateConnection=new dt;fConnectionWaypointsChanged=Le();fDropToGroup=new dt;vCellSize=N(1,{transform:e=>Ye(e,1)});hCellSize=N(1,{transform:e=>Ye(e,1)});fCellSizeWhileDragging=N(!1,{transform:e=>me(e)});fDragStarted=new dt;fDragEnded=new dt;_dragHandlerInjector=l(Xe);ngOnInit(){this._mediator.execute(new Vu(this))}ngAfterViewInit(){super.subscribe()}onPointerDown(e){if(l2(e.targetElement))return!1;this._dragHandlerInjector.create(),this._result.clear(),this._mediator.execute(new Hu),this._mediator.execute(new wu(e)),this._mediator.execute(new Ru(e)),this._mediator.execute(new bu(e)),this._mediator.execute(new Lu(e,this.fMultiSelectTrigger)),this._mediator.execute(new Ul(e,this.fReassignConnectionTrigger)),this._mediator.execute(new Hl(e,this.fCreateConnectionTrigger)),this._mediator.execute(new Xl(e,this.fConnectionWaypointsTrigger()));let i=e.isMouseLeftButton();return i||this.finalizeDragSequence(),i}prepareDragSequence(e){this._mediator.execute(new Mu(e,this.fNodeResizeTrigger)),this._mediator.execute(new Ou(e,this.fNodeRotateTrigger)),this._mediator.execute(new lu(e,this.fNodeMoveTrigger)),this._mediator.execute(new _u(e,this.fExternalItemTrigger)),this._mediator.execute(new uu(e)),this._mediator.execute(new Fu(e,this.fCanvasMoveTrigger)),this._mediator.execute(new ju)}onSelect(e){this._mediator.execute(new vu(e))}onPointerMove(e){this._mediator.execute(new Gu(e))}onPointerUp(e){this._mediator.execute(new Nu(e)),this._mediator.execute(new xu(e)),this._mediator.execute(new jl(e)),this._mediator.execute(new zl(e)),this._mediator.execute(new Pu(e)),this._mediator.execute(new Du(e)),this._mediator.execute(new du(e)),this._mediator.execute(new mu(e)),this._mediator.execute(new Zl(e)),this._mediator.execute(new Al(e)),this._mediator.execute(new yu(e)),this._mediator.execute(new $l(e)),this._mediator.execute(new Ml)}finalizeDragSequence(){this._mediator.execute(new Mn),this._mediator.execute(new Bo),this._result.clear(),this._dragHandlerInjector.destroy()}ngOnDestroy(){this._mediator.execute(new Mn),this._mediator.execute(new Uu),super.unsubscribe()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275dir=Ee({type:t,selectors:[["f-flow","fDraggable",""]],inputs:{disabled:[2,"fDraggableDisabled","disabled",me],fMultiSelectTrigger:"fMultiSelectTrigger",fReassignConnectionTrigger:"fReassignConnectionTrigger",fCreateConnectionTrigger:"fCreateConnectionTrigger",fConnectionWaypointsTrigger:[1,"fConnectionWaypointsTrigger"],fMoveControlPointTrigger:"fMoveControlPointTrigger",fNodeResizeTrigger:"fNodeResizeTrigger",fNodeRotateTrigger:"fNodeRotateTrigger",fNodeMoveTrigger:"fNodeMoveTrigger",fCanvasMoveTrigger:"fCanvasMoveTrigger",fExternalItemTrigger:"fExternalItemTrigger",fEmitOnNodeIntersect:[2,"fEmitOnNodeIntersect","fEmitOnNodeIntersect",me],vCellSize:[1,"vCellSize"],hCellSize:[1,"hCellSize"],fCellSizeWhileDragging:[1,"fCellSizeWhileDragging"]},outputs:{fSelectionChange:"fSelectionChange",fNodeIntersectedWithConnections:"fNodeIntersectedWithConnections",fNodeConnectionsIntersection:"fNodeConnectionsIntersection",fCreateNode:"fCreateNode",fMoveNodes:"fMoveNodes",fReassignConnection:"fReassignConnection",fCreateConnection:"fCreateConnection",fConnectionWaypointsChanged:"fConnectionWaypointsChanged",fDropToGroup:"fDropToGroup",fDragStarted:"fDragStarted",fDragEnded:"fDragEnded"},exportAs:["fDraggable"],standalone:!1,features:[_e([Dn,Xe]),he]})}return t})(),u2=[...s2,...VN,...dN,...d2,...wR,..._N,...i2,...dR,...IR,...WR,...QR,...NR,...kR],p2=(()=>{let t=class Lc{_store=l(k);handle({waypointIndex:e,connectionId:i}){let o=this._store.connections.require(i),r=o.fWaypoints()?.waypoints().slice();if(!r)throw new Error("Connection waypoints not found");r.splice(e,1),o.fWaypoints()?.waypoints.set(r),this._store.fDraggable?.fConnectionWaypointsChanged.emit(this._changeEvent(o))}_changeEvent(e){return new Kl(e.fId(),e.fWaypoints()?.waypoints()||[])}static \u0275fac=function(i){return new(i||Lc)};static \u0275prov=y({token:Lc,factory:Lc.\u0275fac})};return t=x([w(Oh)],t),t})(),_m=class{static fToken=Symbol("RemoveSnapConnectionFromStoreRequest")},f2=(()=>{let t=class Bc{_store=l(k);handle(e){this._store.connections.removeInstanceForSnap()}static \u0275fac=function(i){return new(i||Bc)};static \u0275prov=y({token:Bc,factory:Bc.\u0275fac})};return t=x([w(_m)],t),t})(),h2=[wp,ci,sD,cD,dD,lD,nO,OO,sO,TO,qO,zO,DO,GO,jO,HO,kO,LO,cO,KO,MO,PO,EO,bO,IO,xO,wO,VO,AO,UO,WO,BO,FO,$O,YO,XO,ZO,f2,p2],Zo=class{instance;static fToken=Symbol("AddConnectorToStoreRequest");constructor(n){this.instance=n}},m2=(()=>{let t=class zc{_store=l(k);_mediator=l(D);handle({instance:e}){switch(e.kind){case"input":this._addInput(e);break;case"output":this._addOutput(e);break;case"outlet":this._addOutlet(e);break;default:throw new Error(`Unknown connector kind: ${e.kind}`)}}_addInput(e){this._store.inputs.add(e),this._store.emitNodeChanges(),this._geometryRegister(e)}_addOutput(e){this._store.outputs.add(e),this._store.emitNodeChanges(),this._geometryRegister(e)}_addOutlet(e){this._store.outlets.add(e),this._store.emitNodeChanges(),this._geometryRegister(e)}_geometryRegister(e){this._mediator.execute(new dl(e.fId(),e.fNodeId,e.kind,e.hostElement))}static \u0275fac=function(i){return new(i||zc)};static \u0275prov=y({token:zc,factory:zc.\u0275fac})};return t=x([w(Zo)],t),t})(),ri=class{position;connectorRefs;static fToken=Symbol("CalculateClosestConnectorRequest");constructor(n,e){this.position=n,this.connectorRefs=e}},g2=(()=>{let t=class qc{handle({position:e,connectorRefs:i}){let o,r=1/0;for(let a of i){let s=this._distanceToRect(e,a.rect);s<r&&(r=s,o=a)}return o?Kt(se({},o),{distance:r}):void 0}_distanceToRect(e,{x:i,y:o,width:r,height:a}){let s=this._clamp(e.x,i,i+r),c=this._clamp(e.y,o,o+a),u=e.x-s,p=e.y-c;return Math.sqrt(u*u+p*p)}_clamp(e,i,o){return Math.max(i,Math.min(o,e))}static \u0275fac=function(i){return new(i||qc)};static \u0275prov=y({token:qc,factory:qc.\u0275fac})};return t=x([w(ri)],t),t})(),Qo=class{pointerPosition;connectableConnectors;static fToken=Symbol("FindConnectableConnectorUsingPriorityAndPositionRequest");constructor(n,e){this.pointerPosition=n,this.connectableConnectors=e}},_2=(()=>{let t=class Vc{_mediator=l(D);_store=l(k);_browser=l(qe);get _transform(){return this._store.transform}get _flowHost(){return this._store.flowHost}get _fNodes(){return this._store.nodes.getAll()}get _snapConnection(){return this._store.connections.getForSnap()}handle(e){let i=this._findConnectorAtPosition(e);return i.length>0?i[0]:void 0}_findConnectorAtPosition(e){let i=[];i.push(...this._filterConnectorsThatLocatedAtPosition(e));let o=this._isSnapConnectionEnabledAndHasClosestConnector(e);o&&i.unshift(o.connector);let r=this._getFirstConnectableConnectorOfNodeAtPosition(e);return r&&i.push(r),i}_filterConnectorsThatLocatedAtPosition(e){return e.connectableConnectors.filter(i=>G.isIncludePoint(i.rect,this._calculatePointerInFlow(e.pointerPosition))).map(i=>i.connector)}_calculatePointerInFlow(e){return Qi(e,this._flowHost,this._transform)}_isSnapConnectionEnabledAndHasClosestConnector(e){if(!this._snapConnection)return;let i=this._mediator.execute(new ri(this._calculatePointerInFlow(e.pointerPosition),e.connectableConnectors));return this._isValidClosestInput(i)?i:void 0}_isValidClosestInput(e){return!!e&&e.distance<this._snapConnection.fSnapThreshold}_getFirstConnectableConnectorOfNodeAtPosition(e){return this._getElementsFromPoint(e.pointerPosition).map(i=>this._findConnectableNode(i)).filter(i=>!!i).map(i=>this._findFirstConnectableConnectorOfNode(e.connectableConnectors,i)).find(i=>!!i)}_getElementsFromPoint(e){return this._browser.document.elementsFromPoint(e.x,e.y)}_findConnectableNode(e){return this._fNodes.find(i=>i.isContains(e)&&i.fConnectOnNode())}_findFirstConnectableConnectorOfNode(e,i){return e.find(o=>o.connector.fNodeId===i.fId())?.connector}static \u0275fac=function(i){return new(i||Vc)};static \u0275prov=y({token:Vc,factory:Vc.\u0275fac})};return t=x([w(Qo)],t),t})(),Jo=class{source;pointer;static fToken=Symbol("CalculateTargetConnectorsToConnectRequest");constructor(n,e){this.source=n,this.pointer=e}},pt=class{connector;static fToken=Symbol("GetConnectorRectReferenceRequest");constructor(n){this.connector=n}},v2=(()=>{let t=class Gc{_mediator=l(D);handle({connector:e}){return{connector:e,rect:this._getRect(e)}}_getRect(e){return this._mediator.execute(new Pn(e.hostElement))}static \u0275fac=function(i){return new(i||Gc)};static \u0275prov=y({token:Gc,factory:Gc.\u0275fac})};return t=x([w(pt)],t),t})(),er=class{nodeOrGroup;static fToken=Symbol("AddNodeToStoreRequest");constructor(n){this.nodeOrGroup=n}},y2=(()=>{let t=class Hc{_store=l(k);_mediator=l(D);handle({nodeOrGroup:e}){this._store.nodes.add(e),this._mediator.execute(new ll(e.fId(),e.hostElement,e)),this._store.emitNodeChanges()}static \u0275fac=function(i){return new(i||Hc)};static \u0275prov=y({token:Hc,factory:Hc.\u0275fac})};return t=x([w(er)],t),t})(),Bu=class{nodeOrGroup;static fToken=Symbol("CalculateInputConnectionsRequest");constructor(n){this.nodeOrGroup=n}},C2=(()=>{let t=class jc{_store=l(k);handle({nodeOrGroup:e}){let i=this._collectInputIds(e);return this._collectConnections(i)}_collectInputIds(e){let i=new Set,o=this._store.inputs.getAll();for(let r of o)e.isContains(r.hostElement)&&i.add(r.fId());return i}_collectConnections(e){let i=[],o=this._store.connections.getAll();for(let r of o)e.has(r.fInputId())&&i.push(r);return i}static \u0275fac=function(i){return new(i||jc)};static \u0275prov=y({token:jc,factory:jc.\u0275fac})};return t=x([w(Bu)],t),t})(),Hi=class{connector;pointerPosition;static fToken=Symbol("CalculateConnectableSideByConnectedPositionsRequest");constructor(n,e){this.connector=n,this.pointerPosition=e}},U0=2,Qe=(function(t){return t[t.NONE=0]="NONE",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.TOP=4]="TOP",t[t.BOTTOM=8]="BOTTOM",t[t.ALL=15]="ALL",t})(Qe||{});function b2(t,n,e,i,o){let r=x2(o),a=e-t,s=i-n,c=w2(a,s);return S2(c,r)?c:I2(a,s,r,c)}function x2(t){if(!t||t.length===0)return Qe.ALL;let n=Qe.NONE;for(let e=0;e<t.length;e++)switch(t[e]){case F.LEFT:n|=Qe.LEFT;break;case F.RIGHT:n|=Qe.RIGHT;break;case F.TOP:n|=Qe.TOP;break;case F.BOTTOM:n|=Qe.BOTTOM;break}return n||Qe.ALL}function w2(t,n){let e=t<0?-t:t,i=n<0?-n:n;return e-i>U0?t<0?F.LEFT:F.RIGHT:(i-e>U0,n<0?F.TOP:F.BOTTOM)}function S2(t,n){switch(t){case F.LEFT:return(n&Qe.LEFT)!==0;case F.RIGHT:return(n&Qe.RIGHT)!==0;case F.TOP:return(n&Qe.TOP)!==0;case F.BOTTOM:return(n&Qe.BOTTOM)!==0;default:return!0}}function I2(t,n,e,i){let o=i,r=-1/0;if(e&Qe.RIGHT){let a=t;a>r&&(r=a,o=F.RIGHT)}if(e&Qe.LEFT){let a=-t;a>r&&(r=a,o=F.LEFT)}if(e&Qe.BOTTOM){let a=n;a>r&&(r=a,o=F.BOTTOM)}if(e&Qe.TOP){let a=-n;a>r&&(r=a,o=F.TOP)}return o}function zu(t){return t===F.CALCULATE||t===F.CALCULATE_HORIZONTAL||t===F.CALCULATE_VERTICAL}var T2={[F.CALCULATE]:[F.TOP,F.BOTTOM,F.LEFT,F.RIGHT],[F.CALCULATE_HORIZONTAL]:[F.LEFT,F.RIGHT],[F.CALCULATE_VERTICAL]:[F.TOP,F.BOTTOM]},E2=(()=>{let t=class Uc{_mediator=l(D);handle({connector:e,pointerPosition:i}){let o=e.userFConnectableSide,r=this._getConnectorRect(e.hostElement).gravityCenter,a=this._accumulateConnectedCenters(e.hostElement,e.toConnector,i),s=a.sumX/a.count,c=a.sumY/a.count;return b2(r.x,r.y,s,c,T2[o])}_accumulateConnectedCenters(e,i,o){let r=o?.x||0,a=o?.y||0,s=o?1:0;if(i&&i.length)for(let c=0;c<i.length;c++){let u=i[c].hostElement;if(u===e)continue;let p=this._getConnectorRect(u).gravityCenter;r+=p.x,a+=p.y,s++}return{sumX:r,sumY:a,count:s}}_getConnectorRect(e){return this._mediator.execute(new Ae(e))}static \u0275fac=function(i){return new(i||Uc)};static \u0275prov=y({token:Uc,factory:Uc.\u0275fac})};return t=x([w(Hi)],t),t})(),qu=class{connector;static fToken=Symbol("CalculateConnectableSideByInternalPositionRequest");constructor(n){this.connector=n}},Vu=class{fComponent;static fToken=Symbol("AddDndToStoreRequest");constructor(n){this.fComponent=n}},P2=(()=>{let t=class Wc{_store=l(k);handle(e){this._store.fDraggable=e.fComponent}static \u0275fac=function(i){return new(i||Wc)};static \u0275prov=y({token:Wc,factory:Wc.\u0275fac})};return t=x([w(Vu)],t),t})(),Gu=class{event;static fToken=Symbol("OnPointerMoveRequest");constructor(n){this.event=n}},M2=(()=>{let t=class $c{_mediator=l(D);_store=l(k);get _hostElement(){return this._store.fDraggable?.hostElement}_dragContext=l(Q);handle({event:e}){this._dragContext.rememberPointerEvent(e),this._setDifferenceToDraggableItems(this._getDifferenceBetweenPointerAndPointerDown(e),e),this._mediator.execute(new zo)}_setDifferenceToDraggableItems(e,i){this._dragContext.draggableItems.forEach(o=>{o.onPointerMove(se({},e),i)})}_getDifferenceBetweenPointerAndPointerDown(e){return this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition)}_getPointerPositionInCanvas(e){return Z.fromPoint(e.getPosition()).elementTransform(this._hostElement)}static \u0275fac=function(i){return new(i||$c)};static \u0275prov=y({token:$c,factory:$c.\u0275fac})};return t=x([w(Gu)],t),t})(),Hu=class{static fToken=Symbol("InitializeDragSequenceRequest")},k2=(()=>{let t=class Kc{_dragContext=l(Q);handle(e){this._dragContext.reset()}static \u0275fac=function(i){return new(i||Kc)};static \u0275prov=y({token:Kc,factory:Kc.\u0275fac})};return t=x([w(Hu)],t),t})(),On=class{static fToken=Symbol("IsDragStartedRequest")},D2=(()=>{let t=class Yc{_store=l(k);handle(e){return!!this._store.fDraggable?.isDragStarted}static \u0275fac=function(i){return new(i||Yc)};static \u0275prov=y({token:Yc,factory:Yc.\u0275fac})};return t=x([w(On)],t),t})(),ju=class{static fToken=Symbol("PrepareDragSequenceRequest")},O2=(()=>{let t=class Xc{_mediator=l(D);_dragContext=l(Q);handle(e){this._callPrepareDragSequence(),this._mediator.execute(new kl)}_callPrepareDragSequence(){this._dragContext.draggableItems.forEach(e=>e.prepareDragSequence?.())}static \u0275fac=function(i){return new(i||Xc)};static \u0275prov=y({token:Xc,factory:Xc.\u0275fac})};return t=x([w(ju)],t),t})(),Uu=class{static fToken=Symbol("RemoveDndFromStoreRequest")},N2=(()=>{let t=class Zc{_store=l(k);handle(e){this._store.fDraggable=void 0}static \u0275fac=function(i){return new(i||Zc)};static \u0275prov=y({token:Zc,factory:Zc.\u0275fac})};return t=x([w(Uu)],t),t})(),R2=[P2,M2,k2,O2,D2,N2],A2=new ue("CONNECTABLE_SIDE_EPSILON"),F2=(()=>{let t=class Qc{_mediator=l(D);_lastSide=new WeakMap;_epsilon=Math.max(0,l(A2,{optional:!0})??2);handle({connector:e}){if(this._isDragging()){let o=this._lastSide.get(e);if(o!==void 0)return o;let r=this._getSideByDelta(e.hostElement,e.fNodeHost,e);return this._lastSide.set(e,r),r}let i=this._getSideByDelta(e.hostElement,e.fNodeHost,e);return this._lastSide.set(e,i),i}_getSideByDelta(e,i,o){let r=G.fromElement(e),a=i.getBoundingClientRect(),s=r.gravityCenter.x,c=r.gravityCenter.y,u=s-a.left,p=a.right-s,g=c-a.top,b=a.bottom-c,M=0,P=u,R=[u,p,g,b];for(let j=1;j<4;j++){let oe=R[j];oe<P&&(P=oe,M=j)}let H=M===0?F.LEFT:M===1?F.RIGHT:M===2?F.TOP:F.BOTTOM,z=this._lastSide.get(o);if(z!==void 0&&z!==H){let j=z===F.LEFT?0:z===F.RIGHT?1:z===F.TOP?2:3;(j===0?u:j===1?p:j===2?g:b)-P<=this._epsilon&&(H=z)}return H}_isDragging(){return this._mediator.execute(new On)}static \u0275fac=function(i){return new(i||Qc)};static \u0275prov=y({token:Qc,factory:Qc.\u0275fac})};return t=x([w(qu)],t),t})(),ji=class{nodeOrGroup;static fToken=Symbol("CalculateConnectorsConnectableSidesRequest");constructor(n){this.nodeOrGroup=n}},L2=(()=>{let t=class Jc{_mediator=l(D);handle({nodeOrGroup:e}){let i=e.connectors,o=i.length;for(let a=0;a<o;a++){let s=i[a];s.fConnectableSide=this._resolveSideForConnectorFast(s)}let r=new Set;for(let a=0;a<o;a++){let c=i[a].toConnector;if(c&&c.length)for(let u=0,p=c.length;u<p;u++){let g=c[u],b=g.userFConnectableSide;zu(b)&&r.add(g)}}r.size>0&&r.forEach(a=>{a.fConnectableSide=this._calculateByConnectedPositions(a)})}_resolveSideForConnectorFast(e){let i=e.userFConnectableSide;return i===F.AUTO?this._mediator.execute(new qu(e)):zu(i)?this._calculateByConnectedPositions(e):i}_calculateByConnectedPositions(e){return this._mediator.execute(new Hi(e))}static \u0275fac=function(i){return new(i||Jc)};static \u0275prov=y({token:Jc,factory:Jc.\u0275fac})};return t=x([w(ji)],t),t})(),Ui=class{static fToken=Symbol("CalculateNodesBoundingBoxRequest")},B2=(()=>{let t=class ed{_store=l(k);handle(e){return G.union(this._nodesRects())}_nodesRects(){return this._store.nodes.getAll().map(e=>G.fromElement(e.hostElement))}static \u0275fac=function(i){return new(i||ed)};static \u0275prov=y({token:ed,factory:ed.\u0275fac})};return t=x([w(Ui)],t),t})(),Wu=class{fNodes;static fToken=Symbol("CalculateNodesBoundingBoxNormalizedPositionRequest");constructor(n){this.fNodes=n}},z2=(()=>{let t=class td{_store=l(k);_mediator=l(D);handle(e){return G.union(this._getNodesRects(e.fNodes||this._store.nodes.getAll()))}_getNodesRects(e){return e.map(i=>this._getNodeRect(i))}_getNodeRect(e){let i=this._mediator.execute(new Vi(e.hostElement));if(i)return this._getElementRect(e,i);let o=this._mediator.execute(new Ae(e.hostElement));return this._getElementRect(e,o)}_getElementRect(e,i){return G.initialize(e._position.x,e._position.y,i.width,i.height)}static \u0275fac=function(i){return new(i||td)};static \u0275prov=y({token:td,factory:td.\u0275fac})};return t=x([w(Wu)],t),t})(),$u=class{nodeOrGroup;static fToken=Symbol("CalculateOutputConnectionsRequest");constructor(n){this.nodeOrGroup=n}},q2=(()=>{let t=class nd{_store=l(k);handle({nodeOrGroup:e}){let i=this._collectOutputIds(e);return this._collectConnections(i)}_collectOutputIds(e){let i=new Set,o=this._store.outputs.getAll();for(let r of o)e.isContains(r.hostElement)&&i.add(r.fId());return i}_collectConnections(e){let i=[],o=this._store.connections.getAll();for(let r of o)e.has(r.fOutputId())&&i.push(r);return i}static \u0275fac=function(i){return new(i||nd)};static \u0275prov=y({token:nd,factory:nd.\u0275fac})};return t=x([w($u)],t),t})(),tr=class{nodeOrGroup;static fToken=Symbol("FitToChildNodesAndGroupsRequest");constructor(n){this.nodeOrGroup=n}},ai=class{fNode;rect;static fToken=Symbol("GetNodePaddingRequest");constructor(n,e){this.fNode=n,this.rect=e}},V2=(()=>{let t=class id{_browser=l(qe);handle(e){return e.fNode.fIncludePadding()?this._getPaddingData(e.fNode,e.rect):[0,0,0,0]}_getPaddingData(e,i){let o=this._browser.window.getComputedStyle(e.hostElement);return[this._browser.toPixels(o.paddingLeft,i.width,i.height,o.fontSize),this._browser.toPixels(o.paddingTop,i.width,i.height,o.fontSize),this._browser.toPixels(o.paddingRight,i.width,i.height,o.fontSize),this._browser.toPixels(o.paddingBottom,i.width,i.height,o.fontSize)]}static \u0275fac=function(i){return new(i||id)};static \u0275prov=y({token:id,factory:id.\u0275fac})};return t=x([w(ai)],t),t})(),G2=(()=>{let t=class od{_mediator=l(D);_store=l(k);get _nodes(){return this._store.nodes.getAll()}handle({nodeOrGroup:e}){if(e.fAutoSizeToFitChildren()){let r=this._calculateDirectChildren(e);if(r.length){let a=this._boundingRect(e),s=this._calculateChildrenBounding(r,this._paddings(e,a));e.updatePosition(s),e.updateSize(s),e.redraw()}}let i=e.fParentId();if(!i)return;let o=this._nodes.find(r=>r.fId()===i);o&&this._mediator.execute(new tr(o))}_calculateDirectChildren(e){return this._nodes.filter(i=>i.fParentId()===e.fId())}_unionRect(e){return G.union(e.map(i=>this._boundingRect(i)))||G.initialize()}_boundingRect(e){return this._mediator.execute(new Ae(e.hostElement))}_paddings(e,i){return this._mediator.execute(new ai(e,i))}_calculateChildrenBounding(e,[i,o,r,a]){let s=this._unionRect(e);return s=G.initialize(s.x-i,s.y-o,s.width+i+r,s.height+o+a),s}static \u0275fac=function(i){return new(i||od)};static \u0275prov=y({token:od,factory:od.\u0275fac})};return t=x([w(tr)],t),t})(),Ku=class{id;static fToken=Symbol("GetChildNodeIdsRequest");constructor(n){this.id=n}},H2=(()=>{let t=class rd{_store=l(k);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle(e){if(!e.id)return[];let i=new Set,o=[];return this._collectDescendants(e.id,o,i),o}_collectDescendants(e,i,o){if(o.has(e))throw new Error(`Circular reference detected in the node hierarchy. Node id: ${e}`);o.add(e);let r=this._allNodesAndGroups.filter(a=>a.fParentId()===e).map(a=>a.fId());i.push(...r);for(let a of r)this._collectDescendants(a,i,o)}static \u0275fac=function(i){return new(i||rd)};static \u0275prov=y({token:rd,factory:rd.\u0275fac})};return t=x([w(Ku)],t),t})(),Wi=class{nodeOrGroup;static fToken=Symbol("GetParentNodesRequest");constructor(n){this.nodeOrGroup=n}},j2=(()=>{let t=class ad{_store=l(k);handle({nodeOrGroup:e}){return this._getParentNodes(e,new Set,[])}_getParentNodes(e,i,o){if(i.has(e.fId()))throw new Error("Circular reference detected in the node hierarchy. Node id: "+e.fId());i.add(e.fId());let r=this._store.nodes.get(e.fParentId());return r?(o.push(r),this._getParentNodes(r,i,o)):o}static \u0275fac=function(i){return new(i||ad)};static \u0275prov=y({token:ad,factory:ad.\u0275fac})};return t=x([w(Wi)],t),t})(),nr=class{nodeOrGroup;destroyRef;static fToken=Symbol("UpdateNodeWhenStateOrSizeChangedRequest");constructor(n,e){this.nodeOrGroup=n,this.destroyRef=e}},U2=(()=>{let t=class sd{_mediator=l(D);handle({nodeOrGroup:e,destroyRef:i}){let{hostElement:o,stateChanges:r}=e;new Bt(new uh(o),r).listen(i,()=>{this._mediator.execute(new Jn),this._isDragging()||(this._mediator.execute(new qi(e.fId(),"UpdateNodeWhenStateOrSizeChanged")),this._mediator.execute(new ji(e)),this._mediator.execute(new tr(e)))})}_isDragging(){return this._mediator.execute(new On)}static \u0275fac=function(i){return new(i||sd)};static \u0275prov=y({token:sd,factory:sd.\u0275fac})};return t=x([w(nr)],t),t})(),ir=class{instance;static fToken=Symbol("RemoveNodeFromStoreRequest");constructor(n){this.instance=n}},W2=(()=>{let t=class cd{_store=l(k);_mediator=l(D);handle({instance:e}){this._store.nodes.remove(e),this._mediator.execute(new ul(e.fId())),this._store.emitNodeChanges()}static \u0275fac=function(i){return new(i||cd)};static \u0275prov=y({token:cd,factory:cd.\u0275fac})};return t=x([w(ir)],t),t})(),$2=[y2,E2,F2,C2,L2,B2,z2,q2,G2,H2,V2,j2,U2,W2],K2=(()=>{let t=class dd{_mediator=l(D);_store=l(k);get _targets(){return this._store.inputs.getAll()}handle({source:e,pointer:i}){let o=this._getConnectableTargets(e),r=[];for(let a of o)r.push(this._mediator.execute(new pt(a)));return this._scheduleApplyCalculatedSides(r,i),r}_getConnectableTargets(e){if(e.hasConnectionLimits)return this._targets.filter(o=>e.canConnectTo(o));let i=this._targets.filter(o=>o.canBeConnected);return e.isSelfConnectable||(i=i.filter(o=>o.fNodeId!==e.fNodeId)),i}_scheduleApplyCalculatedSides(e,i){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,i))}_applyCalculatedConnectableSides(e,i){for(let{connector:o}of e)zu(o.userFConnectableSide)&&(o.fConnectableSide=this._calculateByConnectedPositions(o,i))}_calculateByConnectedPositions(e,i){return this._mediator.execute(new Hi(e,i))}static \u0275fac=function(i){return new(i||dd)};static \u0275prov=y({token:dd,factory:dd.\u0275fac})};return t=x([w(Jo)],t),t})(),Yu=class{target;pointer;static fToken=Symbol("CalculateSourceConnectorsToConnectRequest");constructor(n,e){this.target=n,this.pointer=e}},Y2=(()=>{let t=class ld{_mediator=l(D);_store=l(k);get _sources(){return this._store.outputs.getAll()}handle({target:e,pointer:i}){let o=this._getConnectableSources(e),r=[];for(let a of o)r.push(this._mediator.execute(new pt(a)));return this._scheduleApplyCalculatedSides(r,i),r}_getConnectableSources(e){return this._sources.filter(i=>{let o=i.canBeConnected;return o&&i.hasConnectionLimits&&(o=i.canConnectTo(e)),o})}_scheduleApplyCalculatedSides(e,i){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,i))}_applyCalculatedConnectableSides(e,i){for(let{connector:o}of e)zu(o.userFConnectableSide)&&(o.fConnectableSide=this._calculateByConnectedPositions(o,i))}_calculateByConnectedPositions(e,i){return this._mediator.execute(new Hi(e,i))}static \u0275fac=function(i){return new(i||ld)};static \u0275prov=y({token:ld,factory:ld.\u0275fac})};return t=x([w(Yu)],t),t})(),$i=class{connectors;static fToken=Symbol("MarkConnectableConnectorsRequest");constructor(n){this.connectors=n}},je={DRAG_AND_DROP:{DRAGGING:"f-dragging",CONNECTIONS_DRAGGING:"f-connections-dragging"},GROUPING:{OVER_BOUNDARY:"f-grouping-over-boundary",DROP_ACTIVE:"f-grouping-drop-active"},CONNECTOR:{OUTPUT_CONNECTED:"f-node-output-connected",OUTPUT_NOT_CONNECTABLE:"f-node-output-not-connectable",INPUT_CONNECTED:"f-node-input-connected",INPUT_NOT_CONNECTABLE:"f-node-input-not-connectable",CONNECTABLE:"f-connector-connectable"}},X2=(()=>{let t=class ud{_store=l(k);handle({connectors:e}){this._store.flowHost.classList.add(je.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(i=>this._markConnector(i))}_markConnector({hostElement:e}){e.classList.add(je.CONNECTOR.CONNECTABLE)}static \u0275fac=function(i){return new(i||ud)};static \u0275prov=y({token:ud,factory:ud.\u0275fac})};return t=x([w($i)],t),t})(),or=class{instance;static fToken=Symbol("RemoveConnectorFromStoreRequest");constructor(n){this.instance=n}},Z2=(()=>{let t=class pd{_store=l(k);_mediator=l(D);handle({instance:e}){switch(e.kind){case"input":this._removeInput(e);break;case"output":this._removeOutput(e);break;case"outlet":this._removeOutlet(e);break;default:throw new Error(`Unknown connector kind: ${e.kind}`)}}_removeInput(e){this._store.inputs.removeById(e.fId()),this._store.emitNodeChanges(),this._geometryUnregister(e)}_removeOutput(e){this._store.outputs.removeById(e.fId()),this._store.emitNodeChanges(),this._geometryUnregister(e)}_removeOutlet(e){this._store.outlets.removeById(e.fId()),this._store.emitNodeChanges(),this._geometryUnregister(e)}_geometryUnregister(e){this._mediator.execute(new Mo(e.fId(),e.kind))}static \u0275fac=function(i){return new(i||pd)};static \u0275prov=y({token:pd,factory:pd.\u0275fac})};return t=x([w(or)],t),t})(),Ki=class{connectors;static fToken=Symbol("UnmarkConnectableConnectorsRequest");constructor(n){this.connectors=n}},Q2=(()=>{let t=class fd{_store=l(k);handle({connectors:e}){this._store.flowHost.classList.remove(je.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(i=>this._unmarkConnector(i))}_unmarkConnector({hostElement:e}){e.classList.remove(je.CONNECTOR.CONNECTABLE)}static \u0275fac=function(i){return new(i||fd)};static \u0275prov=y({token:fd,factory:fd.\u0275fac})};return t=x([w(Ki)],t),t})(),J2=[m2,Z2,g2,_2,Y2,K2,v2,X2,Q2],Xu=class{instance;static fToken=Symbol("AddFlowToStoreRequest");constructor(n){this.instance=n}},di=(function(t){return t.TOP_BOTTOM="TOP_BOTTOM",t.BOTTOM_TOP="BOTTOM_TOP",t.LEFT_RIGHT="LEFT_RIGHT",t.RIGHT_LEFT="RIGHT_LEFT",t})(di||{}),xn=(function(t){return t.MANUAL="manual",t.AUTO="auto",t})(xn||{});function eA(t){let n=[...t.nodes.map(W0),...t.groups.map(W0)],e=new Set(t.nodes.map(s=>s.id)),i=new Set(t.groups.map(s=>s.id)),o=new Map,r=new Map;for(let s of[...t.nodes,...t.groups]){for(let c of s.fOutputs)o.set(c.id,s.id);for(let c of s.fInputs)r.set(c.id,s.id)}let a=t.connections.reduce((s,c)=>{let u=o.get(c.fOutputId),p=r.get(c.fInputId);return!u||!p||s.push({source:u,target:p}),s},[]);return{nodes:n,connections:a,nodeIds:e,groupIds:i}}function W0(t){return{id:t.id,size:t.measuredSize?se({},t.measuredSize):t.size?se({},t.size):void 0}}var tA=1,Tp=(()=>{class t{_destroyRef=l(ot);_flows=new Map;_engine;constructor(){this._destroyRef.onDestroy(()=>{Array.from(this._flows.keys()).forEach(e=>this.unregisterFlow(e)),this._engine=void 0})}attachEngine(e){this._engine=e}registerFlow(e,i){let o=e.fId();this.unregisterFlow(o);let r={flow:e,store:i,nodeSignature:this._buildNodeSignature(i),connectionSignature:this._buildConnectionSignature(i),timeoutId:null,raf1:null,raf2:null,unsubs:[],runId:0,isApplying:!1};r.unsubs.push(i.nodesChanges$.listen(()=>this._handleNodesChanges(o)),i.connectionsChanges$.listen(()=>this._handleConnectionsChanges(o))),this._flows.set(o,r),this._engine?.getMode()===xn.AUTO&&this._scheduleRelayout(o)}unregisterFlow(e){let i=this._flows.get(e);i&&(i.unsubs.forEach(o=>o()),this._clearScheduledWork(i),this._flows.delete(e))}handleModeChanged(e){if(e===xn.AUTO)for(let i of this._flows.keys())this._scheduleRelayout(i)}async relayout(e){if(this._engine){if(e){let i=this._flows.get(e);i&&await this._relayoutRegisteredFlow(e,i);return}for(let[i,o]of this._flows.entries())await this._relayoutRegisteredFlow(i,o)}}_handleNodesChanges(e){let i=this._flows.get(e);if(!i||i.isApplying)return;let o=this._buildNodeSignature(i.store);o!==i.nodeSignature&&(i.nodeSignature=o,this._scheduleRelayout(e))}_handleConnectionsChanges(e){let i=this._flows.get(e);if(!i||i.isApplying)return;let o=this._buildConnectionSignature(i.store);o!==i.connectionSignature&&(i.connectionSignature=o,this._scheduleRelayout(e))}_scheduleRelayout(e){let i=this._flows.get(e);!i||!this._engine||this._engine.getMode()!==xn.AUTO||(i.timeoutId!==null&&clearTimeout(i.timeoutId),this._cancelAnimationFrames(i),i.timeoutId=setTimeout(()=>{i.timeoutId=null,this._runAfterNextPaint(i,()=>{this._relayoutFlowIfReady(e)})},tA))}async _relayoutFlowIfReady(e){let i=this._flows.get(e);if(!(!i||!this._engine||this._engine.getMode()!==xn.AUTO)){if(i.store.hasPendingProgressiveRender){this._scheduleRelayout(e);return}await this._relayoutRegisteredFlow(e,i)}}async _relayoutRegisteredFlow(e,i){if(!this._engine)return;let o=eA(i.flow.getState({measuredSize:!0})),r=++i.runId,a=await this._engine.calculate(o.nodes,o.connections,{flowId:e,mode:this._engine.getMode()}),s=this._flows.get(e);if(!(!s||s.runId!==r||!this._applyPositions(s.store,a.nodes).length)){s.isApplying=!0;try{s.flow.redraw(),this._emitWriteback(e,a.nodes,o.nodeIds,o.groupIds)}finally{queueMicrotask(()=>{let u=this._flows.get(e);u&&(u.isApplying=!1)})}}}_emitWriteback(e,i,o,r){let a=this._engine?.getWriteback();a&&a({flowId:e,nodes:i.filter(s=>o.has(s.id)),groups:i.filter(s=>r.has(s.id))})}_applyPositions(e,i){return i.filter(o=>{let r=e.nodes.get(o.id);return!r||A.isEqual(r._position,o.position)?!1:(r.position.set(se({},o.position)),!0)})}_buildNodeSignature(e){return e.nodes.getAll().map(i=>i.fId()).sort().join("|")}_buildConnectionSignature(e){return e.connections.getAll().map(i=>`${i.fId()}:${i.fOutputId()}:${i.fInputId()}`).sort().join("|")}_runAfterNextPaint(e,i){if(this._cancelAnimationFrames(e),typeof requestAnimationFrame!="function"){i();return}e.raf1=requestAnimationFrame(()=>{e.raf1=null,e.raf2=requestAnimationFrame(()=>{e.raf2=null,i()})})}_clearScheduledWork(e){e.timeoutId!==null&&(clearTimeout(e.timeoutId),e.timeoutId=null),this._cancelAnimationFrames(e)}_cancelAnimationFrames(e){e.raf1!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(e.raf1),e.raf1=null),e.raf2!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(e.raf2),e.raf2=null)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Ov=new ue("F_LAYOUT_OPTIONS");function Nv(t,n){return t.reduce((e,i)=>{let o=n.get(i.id);return o&&e.push({id:i.id,position:o}),e},[])}var nA=new ue("F_LAYOUT"),Zu=class{_controller=l(Tp);_config=l(Ov,{optional:!0})??{};_interactiveOptions;_mode;_writeback;_defaultOptions;interactiveOptions;constructor(n){this._mode=this._config.mode??xn.MANUAL,this._writeback=this._config.writeback??null,this._defaultOptions=this.mergeOptions(n,this._config.options),this._interactiveOptions=U(this.mergeOptions(this._defaultOptions,{})),this.interactiveOptions=S(()=>this.mergeOptions(this._interactiveOptions(),{})),this._controller.attachEngine(this)}setMode(n){this._mode=n,this._controller.handleModeChanged(n)}getMode(){return this._mode}setWriteback(n){this._writeback=n}getWriteback(){return this._writeback}setInteractiveOptions(n){this._interactiveOptions.set(this.mergeOptions(this._interactiveOptions(),n))}relayout(n){return this._controller.relayout(n)}getProviderConfig(){return se({},this._config)}resolveLayoutOptions(n){let e=se({},n??{});return delete e.flowId,delete e.mode,this.mergeOptions(this._interactiveOptions(),e)}};function Rv(t,n){return[Tp,t,{provide:nA,useExisting:t},{provide:Ov,useValue:n??{}}]}var iA=(()=>{let t=class hd{_store=l(k);_layoutController=l(Tp,{optional:!0});handle({instance:e}){this._store.fFlow=e,this._layoutController?.registerFlow(e,this._store)}static \u0275fac=function(i){return new(i||hd)};static \u0275prov=y({token:hd,factory:hd.\u0275fac})};return t=x([w(Xu)],t),t})(),Qu=class{static fToken=Symbol("GetFlowRequest")},oA=(()=>{let t=class md{_store=l(k);handle(e){let i=this._store.fFlow;if(!i)throw new Error("Flow not found in store");return i}static \u0275fac=function(i){return new(i||md)};static \u0275prov=y({token:md,factory:md.\u0275fac})};return t=x([w(Qu)],t),t})(),Ju=class{static fToken=Symbol("CalculateConnectionsStateRequest")},rA=(()=>{let t=class gd{_store=l(k);handle(e){return this._store.connections.getAll().map(this._mapToConnectionState)}_mapToConnectionState(e){return{id:e.fId(),fOutputId:e.fOutputId(),fInputId:e.fInputId(),fType:e.fType,fBehavior:e.fBehavior,isSelected:e.isSelected(),waypoints:e.fWaypoints()?.waypoints()||[],fInputSide:e.fInputSide(),fOutputSide:e.fOutputSide()}}static \u0275fac=function(i){return new(i||gd)};static \u0275prov=y({token:gd,factory:gd.\u0275fac})};return t=x([w(Ju)],t),t})(),rr=class{component;measuredSize;static fToken=Symbol("CalculateNodesStateRequest");constructor(n,e=!1){this.component=n,this.measuredSize=e}},aA=(()=>{let t=class _d{_store=l(k);_mediator=l(D);handle({component:e,measuredSize:i}){return this._store.nodes.getAll().filter(o=>o instanceof e).map(o=>{let r=i?this._mediator.execute(new Ae(o.hostElement)):null;return{id:o.fId(),parentId:o.fParentId()??void 0,position:se({},o._position),size:o._size?se({},o._size):void 0,measuredSize:r?{width:r.width,height:r.height}:void 0,rotate:o._rotate,fOutputs:this._getOutputs(o.hostElement),fInputs:this._getInputs(o.hostElement),isSelected:o.isSelected()}})}_getOutputs(e){return this._store.outputs.getAll().filter(i=>e.contains(i.hostElement)).map(i=>({id:i.fId(),fConnectableSide:i.fConnectableSide}))}_getInputs(e){return this._store.inputs.getAll().filter(i=>e.contains(i.hostElement)).map(i=>({id:i.fId(),fConnectableSide:i.fConnectableSide}))}static \u0275fac=function(i){return new(i||_d)};static \u0275prov=y({token:_d,factory:_d.\u0275fac})};return t=x([w(rr)],t),t})(),ep=class{measuredSize;static fToken=Symbol("CalculateFlowStateRequest");constructor(n=!1){this.measuredSize=n}},sA=(()=>{let t=class vd{_mediator=l(D);_store=l(k);get _canvas(){return this._store.fCanvas}get _transform(){return this._canvas.transform}get _canvasPosition(){return A.sum(this._transform.position,this._transform.scaledPosition)}handle({measuredSize:e}){return{position:this._canvasPosition,scale:this._canvas.transform.scale,nodes:this._mediator.execute(new rr(Ip,e)),groups:this._mediator.execute(new rr(Gh,e)),connections:this._mediator.execute(new Ju)}}static \u0275fac=function(i){return new(i||vd)};static \u0275prov=y({token:vd,factory:vd.\u0275fac})};return t=x([w(ep)],t),t})(),cA=[sA,aA,rA],tp=class{instance;static fToken=Symbol("RemoveFlowFromStoreRequest");constructor(n){this.instance=n}},dA=(()=>{let t=class yd{_store=l(k);_layoutController=l(Tp,{optional:!0});handle({instance:e}){this._layoutController?.unregisterFlow(e.fId()),this._store.fFlow=void 0}static \u0275fac=function(i){return new(i||yd)};static \u0275prov=y({token:yd,factory:yd.\u0275fac})};return t=x([w(tp)],t),t})(),Ep=(()=>{class t{isNodesRendered=!1;isFullRendered=!1;static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),np=class{static fToken=Symbol("NotifyNodesRenderedRequest")},wm=new ue("F_FLOW"),vm=class{},lA=(()=>{let t=class Cd{_state=l(Ep);_fFlow=l(wm);handle(e){this._state.isNodesRendered||(this._state.isNodesRendered=!0,this._fFlow.fNodesRendered.emit(this._fFlow.fId()))}static \u0275fac=function(i){return new(i||Cd)};static \u0275prov=y({token:Cd,factory:Cd.\u0275fac})};return t=x([w(np)],t),t})(),ip=class{static fToken=Symbol("NotifyFullRenderedRequest")},uA=(()=>{let t=class bd{_state=l(Ep);_fFlow=l(wm);handle(e){this._state.isFullRendered||(this._state.isFullRendered=!0,this._fFlow.fFullRendered.emit(this._fFlow.fId()),this._fFlow.fLoaded.emit(this._fFlow.fId()))}static \u0275fac=function(i){return new(i||bd)};static \u0275prov=y({token:bd,factory:bd.\u0275fac})};return t=x([w(ip)],t),t})(),ar=class{targetConnectionsRevision;targetNodesRevision;callback;destroyRef;static fToken=Symbol("WaitForConnectionsRenderedRequest");constructor(n,e,i,o){this.targetConnectionsRevision=n,this.targetNodesRevision=e,this.callback=i,this.destroyRef=o}},pA=(()=>{let t=class xd{_store=l(k);handle({targetConnectionsRevision:e,targetNodesRevision:i,callback:o,destroyRef:r}){if(this._store.connectionsRenderedRevision>=e&&this._store.connectionsRenderedNodesRevision>=i){o();return}let a=this._store.connectionsRenderedChanges$.listen(()=>{this._store.connectionsRenderedRevision<e||this._store.connectionsRenderedNodesRevision<i||(a(),o())});r.onDestroy(a)}static \u0275fac=function(i){return new(i||xd)};static \u0275prov=y({token:xd,factory:xd.\u0275fac})};return t=x([w(ar)],t),t})(),op=class{static fToken=Symbol("ResetRenderLifecycleRequest")},fA=(()=>{let t=class wd{_state=l(Ep);handle(e){this._state.isNodesRendered=!1,this._state.isFullRendered=!1}static \u0275fac=function(i){return new(i||wd)};static \u0275prov=y({token:wd,factory:wd.\u0275fac})};return t=x([w(op)],t),t})(),rp=class{destroyRef;static fToken=Symbol("QueueConnectionRedrawRequest");constructor(n){this.destroyRef=n}},Av=(()=>{class t{isWaitingForViewportAnimation=!1;pendingRedraw=!1;static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),hA=(()=>{let t=class Sd{_state=l(Av);_store=l(k);_mediator=l(D);handle(e){if(this._state.pendingRedraw=!0,this._state.isWaitingForViewportAnimation)return;this._state.isWaitingForViewportAnimation=!0;let i=this._store.viewportAnimationChanges$.listen(()=>{if(this._store.isViewportAnimating)return;let o=this._state.pendingRedraw;i(),this._state.isWaitingForViewportAnimation=!1,this._state.pendingRedraw=!1,o&&this._mediator.execute(new Ao)});e.destroyRef.onDestroy(i)}static \u0275fac=function(i){return new(i||Sd)};static \u0275prov=y({token:Sd,factory:Sd.\u0275fac})};return t=x([w(rp)],t),t})(),mA=[iA,oA,...cA,dA,Ep,lA,uA,pA,fA,Av,hA],ap=class{static fToken=Symbol("ClearSelectionRequest")},gA=(()=>{let t=class Id{_dragContext=l(Q);handle(e){this._dragContext.selectedItems.forEach(i=>i.unmarkAsSelected()),this._dragContext.selectedItems=[],this._dragContext.isSelectedChanged=!0}static \u0275fac=function(i){return new(i||Id)};static \u0275prov=y({token:Id,factory:Id.\u0275fac})};return t=x([w(ap)],t),t})(),sp=class{static fToken=Symbol("CalculateSelectableItemsRequest")},_A=(()=>{let t=class Td{_mediator=l(D);_store=l(k);_dragContext=l(Q);get _nodes(){return this._store.nodes.getAll()}get _connections(){return this._store.connections.getAll()}handle(){return[...this._nodeRects(),...this._connectionRects()].filter(e=>!this._dragContext.selectedItems.includes(e.element))}_nodeRects(){return this._nodes.filter(e=>!e.fSelectionDisabled()).map(e=>({element:e,fRect:this._mediator.execute(new Ae(e.hostElement))}))}_connectionRects(){return this._connections.filter(e=>!e.fSelectionDisabled()).map(e=>({element:e,fRect:this._mediator.execute(new Ae(e.boundingElement))}))}static \u0275fac=function(i){return new(i||Td)};static \u0275prov=y({token:Td,factory:Td.\u0275fac})};return t=x([w(sp)],t),t})(),sr=class{static fToken=Symbol("GetCurrentSelectionRequest")},vA=(()=>{let t=class Ed{_dragContext=l(Q);handle(){return{fNodeIds:this._getSelectedNodes(),fGroupIds:this._getSelectedGroups(),fConnectionIds:this._getSelectedConnections()}}_getSelectedNodes(){return this._dragContext.selectedItems.filter(e=>e.hostElement.classList.contains("f-node")).map(e=>e.hostElement.dataset.fNodeId)}_getSelectedGroups(){return this._dragContext.selectedItems.filter(e=>e.hostElement.classList.contains("f-group")).map(e=>e.hostElement.dataset.fGroupId)}_getSelectedConnections(){return this._dragContext.selectedItems.filter(e=>!e.hostElement.classList.contains("f-node")&&!e.hostElement.classList.contains("f-group")).map(e=>e.hostElement.id)}static \u0275fac=function(i){return new(i||Ed)};static \u0275prov=y({token:Ed,factory:Ed.\u0275fac})};return t=x([w(sr)],t),t})(),cp=class{nodes;connections;isSelectedChanged;static fToken=Symbol("SelectRequest");constructor(n,e,i=!0){this.nodes=n,this.connections=e,this.isSelectedChanged=i}},yA=(()=>{let t=class Pd{_dragContext=l(Q);_store=l(k);handle(e){this._dragContext.selectedItems.forEach(i=>{i.unmarkAsSelected()}),this._dragContext.selectedItems=[],e.nodes.forEach(i=>{let o=this._store.nodes.get(i);o&&(o.markAsSelected(),this._dragContext.selectedItems.push(o))}),e.connections.forEach(i=>{let o=this._store.connections.get(i);o&&(o.markAsSelected(),this._dragContext.selectedItems.push(o))}),this._dragContext.isSelectedChanged=e.isSelectedChanged}static \u0275fac=function(i){return new(i||Pd)};static \u0275prov=y({token:Pd,factory:Pd.\u0275fac})};return t=x([w(cp)],t),t})(),dp=class{static fToken=Symbol("SelectAllRequest")},CA=(()=>{let t=class Md{_dragSession=l(Q);_store=l(k);handle(e){this._dragSession.selectedItems.forEach(i=>{i.unmarkAsSelected()}),this._dragSession.selectedItems=[],this._store.nodes.getAll().forEach(i=>{i.markAsSelected(),this._dragSession.selectedItems.push(i)}),this._store.connections.getAll().forEach(i=>{i.markAsSelected(),this._dragSession.selectedItems.push(i)}),this._dragSession.isSelectedChanged=!0}static \u0275fac=function(i){return new(i||Md)};static \u0275prov=y({token:Md,factory:Md.\u0275fac})};return t=x([w(dp)],t),t})(),Yi=class{nodeOrGroup;static fToken=Symbol("SelectAndUpdateNodeLayerRequest");constructor(n){this.nodeOrGroup=n}},lp=class{fItemsContainer;allElements;elementsThatShouldBeInFront;targetIndex;static fToken=Symbol("MoveFrontElementsBeforeTargetElementRequest");constructor(n,e,i,o){this.fItemsContainer=n,this.allElements=e,this.elementsThatShouldBeInFront=i,this.targetIndex=o}},bA=(()=>{let t=class kd{handle(e){let i=[];for(let o=e.targetIndex+1;o<e.allElements.length;o++){let r=e.allElements[o];e.elementsThatShouldBeInFront.includes(r)||i.push(r)}i.forEach(o=>{e.fItemsContainer.removeChild(o),e.fItemsContainer.insertBefore(o,e.allElements[e.targetIndex])})}static \u0275fac=function(i){return new(i||kd)};static \u0275prov=y({token:kd,factory:kd.\u0275fac})};return t=x([w(lp)],t),t})(),si=class{item;itemContainer;static fToken=Symbol("UpdateItemAndChildrenLayersRequest");constructor(n,e){this.item=n,this.itemContainer=e}},Xi=class{nodeOrGroupId;static fToken=Symbol("GetDeepChildrenNodesAndGroupsRequest");constructor(n){this.nodeOrGroupId=n}},xA=(()=>{let t=class Dd{_store=l(k);handle({nodeOrGroupId:e}){return this._getChildrenNodes(e)}_getChildrenNodes(e,i=new Set){if(i.has(e))throw new Error("Circular reference detected in the node hierarchy. Node id: "+e);i.add(e);let o=this._store.nodes.getAll().filter(r=>r.fParentId()===e);return o.reduce((r,a)=>r.concat(this._getChildrenNodes(a.fId(),i)),o)}static \u0275fac=function(i){return new(i||Dd)};static \u0275prov=y({token:Dd,factory:Dd.\u0275fac})};return t=x([w(Xi)],t),t})(),wA=(()=>{let t=class Od{_store=l(k);_mediator=l(D);get _canvas(){return this._store.fCanvas}get _groupsContainer(){return this._canvas.fGroupsContainer().nativeElement}get _nodesContainer(){return this._canvas.fNodesContainer().nativeElement}get _connectionsContainer(){return this._canvas.fConnectionsContainer().nativeElement}handle(e){switch(e.itemContainer){case this._groupsContainer:this._handleGroup(e);break;case this._nodesContainer:this._handleNode(e);break;case this._connectionsContainer:this._handleConnection(e);break;default:throw new Error("Unknown container")}}_handleGroup(e){let i=this._getChildrenNodesAndGroups(e.item.fId()),o=this._getChildrenGroups(i);this._updateLayers(this._groupsContainer,e.item.hostElement,o);let r=this._getChildrenNodes(i);r.length&&this._updateLayers(this._nodesContainer,r[0],r)}_handleNode(e){let i=this._getChildrenNodesAndGroups(e.item.fId()),o=this._getChildrenNodes(i);this._updateLayers(e.itemContainer,e.item.hostElement,o)}_handleConnection(e){this._updateLayers(e.itemContainer,e.item.hostElement,[])}_updateLayers(e,i,o){let r=Array.from(e.children),a=r.findIndex(s=>s===i);this._isAnythingNeedToBeMoved(r,a,o)&&this._mediator.execute(new lp(e,r,o,a))}_isAnythingNeedToBeMoved(e,i,o){for(let r=i+1;r<e.length;r++)if(!o.includes(e[r]))return!0;return!1}_getChildrenGroups(e){let i=Array.from(this._groupsContainer.children);return e.filter(o=>this._groupsContainer.contains(o)).sort((o,r)=>i.indexOf(o)-i.indexOf(r))}_getChildrenNodes(e){let i=Array.from(this._nodesContainer.children);return e.filter(o=>this._nodesContainer.contains(o)).sort((o,r)=>i.indexOf(o)-i.indexOf(r))}_getChildrenNodesAndGroups(e){return this._mediator.execute(new Xi(e)).map(i=>i.hostElement)}static \u0275fac=function(i){return new(i||Od)};static \u0275prov=y({token:Od,factory:Od.\u0275fac})};return t=x([w(si)],t),t})(),SA=(()=>{let t=class Nd{_dragSession=l(Q);_mediator=l(D);handle({nodeOrGroup:e}){this._selectNodeIfNotSelected(e),this._mediator.execute(new si(e,e.hostElement.parentElement))}_selectNodeIfNotSelected(e){e.fSelectionDisabled()||this._dragSession.selectedItems.includes(e)||(this._dragSession.selectedItems.push(e),e.markAsSelected(),this._dragSession.isSelectedChanged=!0)}static \u0275fac=function(i){return new(i||Nd)};static \u0275prov=y({token:Nd,factory:Nd.\u0275fac})};return t=x([w(Yi)],t),t})(),IA=[gA,_A,vA,yA,CA,SA],up=class{static fToken=Symbol("ResetZoomRequest")},TA=(()=>{let t=class Rd{_store=l(k);get _canvas(){return this._store.fCanvas}handle(e){this._canvas.resetScale(),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=function(i){return new(i||Rd)};static \u0275prov=y({token:Rd,factory:Rd.\u0275fac})};return t=x([w(up)],t),t})(),pp=class{position;step;direction;animate;static fToken=Symbol("SetZoomRequest");constructor(n,e,i,o=!1){this.position=n,this.step=e,this.direction=i,this.animate=o}},EA=new Set(["drag-node","drag-external-item","resize-node","rotate-node","create-connection","reassign-connection","drag-connection-waypoint","assign-to-container"]),PA=new Set(["drag-canvas","selection-area"]),MA=(()=>{let t=class Ad{_mediator=l(D);_store=l(k);_dragContext=l(Q,{optional:!0});get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.get(Ie.ZOOM)}get _isDragStarted(){return this._mediator.execute(new On)}handle(e){if(!this._zoomComponent)return;let i=this._canvas.transform.scale,o=this._clamp(i+e.step*e.direction);if(o===i)return;let r=this._castPositionToFlow(e.position);if(this._isDragStarted){let a=this._getDragZoomMode();if(a==="blocked")return;a==="rebase"&&this._rebaseDragContext(r,o)}this._canvas.setScale(o,r),e.animate?this._canvas.redrawWithAnimation():this._canvas.redraw(),this._canvas.emitCanvasChangeEvent()}_clamp(e){return Math.max(this._zoomComponent?.minimum||1,Math.min(e,this._zoomComponent?.maximum||1))}_castPositionToFlow(e){return Z.fromPoint(e).elementTransform(this._flowHost)}_getDragZoomMode(){if(this._dragContext?.isEmpty())return"blocked";let e=!1;for(let i of this._dragContext?.draggableItems??[]){let o=i.getEvent().kind;if(EA.has(o)){e=!0;continue}if(!PA.has(o))return"blocked"}return e?"rebase":"direct"}_rebaseDragContext(e,i){if(!this._dragContext)return;let o=this._dragContext.onPointerDownScale;if(!o||o===i){this._dragContext.onPointerDownScale=i;return}let r=1/i-1/o;this._dragContext.onPointerDownPosition=Z.fromPoint(this._dragContext.onPointerDownPosition).add(Z.fromPoint(e).mult(r)),this._dragContext.onPointerDownScale=i}static \u0275fac=function(i){return new(i||Ad)};static \u0275prov=y({token:Ad,factory:Ad.\u0275fac})};return t=x([w(pp)],t),t})(),kA=[TA,MA],fp=class{static fToken=Symbol("MinimapDrawNodesRequest")},DA=(()=>{let t=class Fd{_browser=l(qe);_store=l(k);handle(e){let i=this._store.fFlow,o=this._store.fCanvas;return!i||!o?[]:this._store.nodes.getAll().map(a=>this._renderNode(a,i,o))}_renderNode(e,i,o){let r=Fi("rect",this._browser);Kf(this._nodeRect(e,i,o),r);let a=e instanceof Ip;return r.classList.add("f-component",a?"f-minimap-node":"f-minimap-group"),r.classList.add(...this._minimapClasses(e)),e.isSelected()&&r.classList.add("f-selected"),r}_nodeRect(e,i,o){let r=G.elementTransform(G.fromElement(e.hostElement),i.hostElement);return G.div(r,o.transform.scale)}_minimapClasses(e){let i=e.fMinimapClass();return Array.isArray(i)?i:[i]}static \u0275fac=function(i){return new(i||Fd)};static \u0275prov=y({token:Fd,factory:Fd.\u0275fac})};return t=x([w(fp)],t),t})(),hp=class{svg;minSize;static fToken=Symbol("MinimapCalculateViewportRequest");constructor(n,e){this.svg=n,this.minSize=e}},OA=(()=>{let t=class Ld{_mediator=l(D);_store=l(k);handle({svg:e,minSize:i}){let o=this._store.fFlow,r=this._store.fCanvas;if(!o||!r)return{scale:1,viewBox:G.initialize(0,0,0,0)};let a=this._contentRectInMinimapSpace(o,r,i),s=this._minimapRectInFlowSpace(e,o),c=this._viewportScale(a,s),u=this._viewportViewBox(a,s,c);return{scale:c,viewBox:u}}_contentRectInMinimapSpace(e,i,o){let r=this._nodesBoundingBox(),a=G.elementTransform(r,e.hostElement),s=G.div(a,i.transform.scale);return f0(s,o)}_nodesBoundingBox(){return this._mediator.execute(new Ui)??G.initialize(0,0,0,0)}_minimapRectInFlowSpace(e,i){return G.elementTransform(G.fromElement(e),i.hostElement)}_viewportScale(e,i){let o=i.width||1,r=i.height||1;return Math.max(e.width/o,e.height/r)}_viewportViewBox(e,i,o){let r=this._viewportSize(i,o),a=e.x-(r.width-e.width)/2,s=e.y-(r.height-e.height)/2;return G.initialize(a,s,r.width,r.height)}_viewportSize(e,i){return tt.initialize(e.width*i||0,e.height*i||0)}static \u0275fac=function(i){return new(i||Ld)};static \u0275prov=y({token:Ld,factory:Ld.\u0275fac})};return t=x([w(hp)],t),t})(),mp=class{static fToken=Symbol("MinimapCalculateViewRectRequest")},NA=(()=>{let t=class Bd{_store=l(k);handle(e){let i=this._store.fFlow,o=this._store.fCanvas;if(!i||!o)return G.initialize();let r=G.div(G.fromElement(i.hostElement),o.transform.scale);return r.x=0,r.y=0,r}static \u0275fac=function(i){return new(i||Bd)};static \u0275prov=y({token:Bd,factory:Bd.\u0275fac})};return t=x([w(mp)],t),t})(),gp=class{element;scale;viewBox;constructor(n,e=1,i=G.initialize(0,0,0,0)){this.element=n,this.scale=e,this.viewBox=i}},RA=[DA,OA,NA],_p=class{position;static fToken=Symbol("GetNormalizedPointRequest");constructor(n){this.position=n}},AA=(()=>{let t=class zd{_store=l(k);handle({position:e}){return Qi(e,this._store.flowHost,this._store.transform)}static \u0275fac=function(i){return new(i||zd)};static \u0275prov=y({token:zd,factory:zd.\u0275fac})};return t=x([w(_p)],t),t})(),vp=class{static fToken=Symbol("SortNodeLayersRequest")},FA=(()=>{let t=class qd{_store=l(k);_mediator=l(D);_browser=l(qe);get _canvas(){return this._store.fCanvas}get _groupsContainer(){return this._canvas.fGroupsContainer().nativeElement}get _nodesContainer(){return this._canvas.fNodesContainer().nativeElement}get _fNodeElements(){return Array.from(this._nodesContainer.children)}handle(e){this._getGroups().forEach(i=>{this._moveChildrenNodes(this._getSortedChildrenNodes(i))})}_getGroups(){return this._store.nodes.getAll().filter(e=>this._groupsContainer.contains(e.hostElement))}_getSortedChildrenNodes(e){let i=this._fNodeElements;return this._getChildrenNodes(e.fId()).sort((o,r)=>i.indexOf(o)-i.indexOf(r))}_getChildrenNodes(e){return this._mediator.execute(new Xi(e)).filter(i=>this._nodesContainer.contains(i.hostElement)).map(i=>i.hostElement)}_moveChildrenNodes(e){let i=this._browser.document.createDocumentFragment();e.forEach(o=>{i.appendChild(o)}),this._nodesContainer.appendChild(i)}static \u0275fac=function(i){return new(i||qd)};static \u0275prov=y({token:qd,factory:qd.\u0275fac})};return t=x([w(vp)],t),t})(),cr=class{itemsContainer;static fToken=Symbol("SortItemsByParentRequest");constructor(n){this.itemsContainer=n}},LA=(()=>{let t=class Vd{_store=l(k);_browser=l(qe);handle({itemsContainer:e}){let i=Array.from(e.children);if(i.length<2)return;let o=this._buildPositions(i),r=this._store.nodes.getAll().filter(c=>e.contains(c.hostElement));if(r.length<2||!r.some(c=>!!c.fParentId()))return;let a=this._buildChildrenByParentId(r),s=new Map;for(let c of r){let u=this._getSortedChildrenBeforeParent(e,o,c,a,s);u.length&&this._moveBeforeNextSibling(e,u,c.hostElement.nextElementSibling)}}_buildPositions(e){let i=new Map;for(let o=0;o<e.length;o++)i.set(e[o],o);return i}_getSortedChildrenBeforeParent(e,i,o,r,a){let s=i.get(o.hostElement);if(s===void 0)return[];let c=this._getDeepChildren(o.fId(),r,a);if(!c.length)return[];let u=[];for(let p of c){let g=p.hostElement;if(!e.contains(g))continue;let b=i.get(g);b===void 0||b>=s||u.push(g)}return u.sort((p,g)=>(i.get(p)??0)-(i.get(g)??0)),u}_buildChildrenByParentId(e){let i=new Map;for(let o of e){let r=o.fParentId();if(!r)continue;let a=i.get(r)??[];a.push(o),i.set(r,a)}return i}_getDeepChildren(e,i,o){let r=o.get(e);if(r)return r;let a=[],s=[...i.get(e)??[]],c=new Set([e]);for(;s.length;){let u=s.pop();if(!u)continue;let p=u.fId();if(c.has(p))continue;c.add(p),a.push(u);let g=i.get(p);g?.length&&s.push(...g)}return o.set(e,a),a}_moveBeforeNextSibling(e,i,o){let r=this._browser.document.createDocumentFragment();for(let a of i)r.appendChild(a);e.insertBefore(r,o)}static \u0275fac=function(i){return new(i||Vd)};static \u0275prov=y({token:Vd,factory:Vd.\u0275fac})};return t=x([w(cr)],t),t})(),yp=class{static fToken=Symbol("SortItemLayersRequest")},BA=(()=>{let t=class Gd{_store=l(k);_mediator=l(D);get _canvas(){return this._store.fCanvas}handle(e){if(!this._canvas)return;let i=this._store.nodes.getAll();i.length<2||!i.some(o=>!!o.fParentId())||(this._mediator.execute(new cr(this._canvas.fGroupsContainer().nativeElement)),this._mediator.execute(new vp),this._mediator.execute(new cr(this._canvas.fNodesContainer().nativeElement)))}static \u0275fac=function(i){return new(i||Gd)};static \u0275prov=y({token:Gd,factory:Gd.\u0275fac})};return t=x([w(yp)],t),t})();function Fi(t,n){return n.document.createElementNS("http://www.w3.org/2000/svg",t)}function bt(t,n){return n(t)}function Et(t){return!0}function zA(){return/android|iPad|iPhone|iPod/i.test(navigator.userAgent||navigator.vendor||window.opera)}var qA=[...aD,...h2,...Yk,...J2,...R2,...mA,...$2,...IA,...kA,...RA,...yO,xA,CO,SO,AA,BA,LA,FA,wA,bA],VA=0,Fv=(()=>{class t{_destroyRef=l(ot);_elementReference=l(Oe);_fBrowser=l(qe);_stateChanges=new Ct;get hostElement(){return this._elementReference.nativeElement}id=N(`f-pattern-${VA++}`);vColor=N("rgba(0,0,0,0.1)");hColor=N("rgba(0,0,0,0.1)");vSize=N(20,{transform:Ye});hSize=N(20,{transform:Ye});_transform=Cn.default();_position=A.initialize();_size=tt.initialize(this.hSize(),this.vSize());_pattern;_vLine;_hLine;constructor(){this._createPattern()}_createPattern(){this._pattern=Fi("pattern",this._fBrowser),this._pattern.setAttribute("patternUnits","userSpaceOnUse"),this.hostElement.appendChild(this._pattern),this._vLine=Fi("line",this._fBrowser),this._pattern.appendChild(this._vLine),this._hLine=Fi("line",this._fBrowser),this._pattern.appendChild(this._hLine)}ngOnInit(){this._listenStateChanges()}_listenStateChanges(){new Bt(this._stateChanges).pipe(Cp()).listen(this._destroyRef,()=>this._redraw())}ngOnChanges(e){(e.vSize||e.hSize||e.vColor||e.hColor)&&this._refresh()}_redraw(){this._calculatePattern(),this._redrawPattern(),this._redrawLine(this._vLine,this.vColor(),this._size.width,0,this._size.width,this._size.height),this._redrawLine(this._hLine,this.hColor(),0,this._size.height,this._size.width,this._size.height)}_calculatePattern(){this._position.x=this._transform.position.x+this._transform.scaledPosition.x,this._position.y=this._transform.position.y+this._transform.scaledPosition.y,this._size=tt.initialize(this.hSize()*this._transform.scale,this.vSize()*this._transform.scale)}_redrawPattern(){this._pattern.setAttribute("x",`${this._position.x}`),this._pattern.setAttribute("y",`${this._position.y}`),this._pattern.setAttribute("width",`${this._size.width}`),this._pattern.setAttribute("height",`${this._size.height}`)}_redrawLine(e,i,o,r,a,s){e.setAttribute("stroke",`${i}`),e.setAttribute("x1",`${o}`),e.setAttribute("x2",`${a}`),e.setAttribute("y1",`${r}`),e.setAttribute("y2",`${s}`)}setTransform(e){this._transform=e,this._refresh()}_refresh(){this._stateChanges.notify()}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=K({type:t,selectors:[["f-rect-pattern"]],hostVars:1,hostBindings:function(i,o){i&2&&q("id",o.id)},inputs:{id:[1,"id"],vColor:[1,"vColor"],hColor:[1,"hColor"],vSize:[1,"vSize"],hSize:[1,"hSize"]},features:[_e([{provide:ah,useExisting:t}]),xi],decls:0,vars:0,template:function(i,o){},encapsulation:2,changeDetection:0})}return t})();var GA=new ue("F_BACKGROUND"),HA=(()=>{class t{hostElement=l(Oe).nativeElement;static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})(),Lv=(()=>{class t extends HA{_mediator=l(D);fBackgroundPattern=Jr(ah);ngOnInit(){this._mediator.execute(new Tn(Ie.BACKGROUND,this))}ngAfterContentInit(){this._mediator.execute(new Hd(this.fBackgroundPattern()))}setTransform(e){this.fBackgroundPattern()?.setTransform(e)}ngOnDestroy(){this._mediator.execute(new En(Ie.BACKGROUND))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-background"]],contentQueries:function(i,o,r){i&1&&Gf(r,o.fBackgroundPattern,ah,5),i&2&<()},hostAttrs:[1,"f-component","f-background"],features:[_e([{provide:GA,useExisting:t}]),he],ngContentSelectors:xk,decls:2,vars:0,template:function(i,o){i&1&&(Yt(),$e(),W(0,"svg"),ke(1),$())},styles:["[_nghost-%COMP%]{position:absolute;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:0})}return t})();var ym=class{position;scale;constructor(n,e){this.position=n,this.scale=e}},jA=new ue("F_CANVAS"),UA=(()=>{class t{transform=Cn.default();_fCanvasChange=new Ct;destroyRef=l(ot);getPosition(){return this.transform.position}setPosition(e){this.transform.position=e}emitCanvasChangeEvent(){this._fCanvasChange.notify()}subscribeOnCanvasChange(){new Bt(this._fCanvasChange).pipe(jd(this.debounce())).listen(this.destroyRef,()=>{this.fCanvasChange.emit(new ym(A.sum(this.transform.position,this.transform.scaledPosition),this.transform.scale))})}static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})(),dr=(()=>{class t extends UA{_mediator=l(D);_componentsStore=l(k);_elementReference=l(Oe);_injector=l(Ze);_flowId;fCanvasChange=Le();position=N(A.initialize(),{transform:A.castToPoint});scale=N(1,{transform:Ye});debounceTime=N(0,{transform:Ye});debounce=S(()=>this.debounceTime()<0?0:this.debounceTime());get hostElement(){return this._elementReference.nativeElement}fGroupsContainer=Re.required("fGroupsContainer");fNodesContainer=Re.required("fNodesContainer");fConnectionsContainer=Re.required("fConnectionsContainer");get flowId(){return this._flowId||""}ngOnInit(){this._flowId=this._mediator.execute(new Qu).fId(),this._mediator.execute(new Wd(this)),this._positionChange(),this._scaleChange(),super.subscribeOnCanvasChange()}_positionChange(){ie(()=>{this._mediator.execute(new Yd(this.transform,this.position()))},{injector:this._injector})}_scaleChange(){ie(()=>{this._mediator.execute(new Xd(this.transform,this.scale()))},{injector:this._injector})}redraw(){this._mediator.execute(new Eo(this.transform)),this.hostElement.style.removeProperty("transition"),this.hostElement.style.transform=Cn.toString(this.transform),this._mediator.execute(new In)}redrawWithAnimation(){this._mediator.execute(new Eo(this.transform)),this.hostElement.style.transition=`transform ${zA()?80:150}ms ease-in-out`,this.hostElement.style.transform=Cn.toString(this.transform),$0(this.hostElement,()=>this.redraw())}centerGroupOrNode(e,i=!0){this._afterRedraw(()=>{this._mediator.execute(new $d(e,i))})}fitToScreen(e=A.initialize(),i=!0){this._afterRedraw(()=>{this._mediator.execute(new Kd(e,i))})}resetScaleAndCenter(e=!0){this._afterRedraw(()=>{this._mediator.execute(new Jd(e))})}getScale(){return this.transform.scale||1}setScale(e,i=A.initialize()){this._mediator.execute(new el(e,i))}resetScale(){this._mediator.execute(new Qd)}ngOnDestroy(){this._mediator.execute(new Zd)}_afterRedraw(e){this._mediator.execute(new ar(this._componentsStore.connectionsRevision,this._componentsStore.nodesRevision,()=>Wr(e,{injector:this._injector}),this.destroyRef))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-canvas"]],viewQuery:function(i,o){i&1&&Tt(o.fGroupsContainer,wk,5)(o.fNodesContainer,Sk,5)(o.fConnectionsContainer,Ik,5),i&2&<(3)},hostAttrs:[1,"f-component","f-canvas"],inputs:{position:[1,"position"],scale:[1,"scale"],debounceTime:[1,"debounceTime"]},outputs:{fCanvasChange:"fCanvasChange"},features:[_e([{provide:jA,useExisting:t}]),he],ngContentSelectors:Ek,decls:12,vars:0,consts:[["fGroupsContainer",""],["fConnectionsContainer",""],["fNodesContainer",""],[1,"f-connections-container"]],template:function(i,o){i&1&&(Yt(Tk),Yr(0),W(1,"div",null,0),ke(3),$(),W(4,"div",3,1),ke(6,1),ke(7,2),ke(8,3),$(),W(9,"div",null,2),ke(11,4),$(),Xr())},styles:["[_nghost-%COMP%]{position:absolute;overflow:visible;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}.f-canvas-dragging[_nghost-%COMP%], .canvas-dragging[_nghost-%COMP%]{transform:translateZ(0)}.f-connections-container[_ngcontent-%COMP%]{position:absolute;z-index:2}"],changeDetection:0})}return t})();var WA=0,Bv=(()=>{class t extends tO{fId=N(`f-connection-${WA++}`,{alias:"fConnectionId"});fOutputId=N("",{transform:e=>Gi(e)||""});fInputId=N("",{transform:e=>Gi(e)||""});fRadius=8;fOffset=12;fBehavior=wn.FIXED;fType=Ni.STRAIGHT;fSelectionDisabled=N(!1,{transform:me});fReassignableStart=N(!1,{transform:me});fDraggingDisabled=N(!1,{alias:"fReassignDisabled",transform:me});fInputSide=N(Se.DEFAULT,{transform:e=>Oi(e,"fInputSide",Se)});fOutputSide=N(Se.DEFAULT,{transform:e=>Oi(e,"fOutputSide",Se)});get boundingElement(){return this.fPath().hostElement}_mediator=l(D);ngOnInit(){this._mediator.execute(new nl(this))}ngOnChanges(){this._mediator.execute(new Jn)}ngOnDestroy(){this._mediator.execute(new El(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-connection"]],hostAttrs:[1,"f-component","f-connection"],hostVars:5,hostBindings:function(i,o){i&2&&(q("id",o.fId()),de("f-connection-selection-disabled",o.fSelectionDisabled())("f-connection-reassign-disabled",o.fDraggingDisabled()))},inputs:{fId:[1,"fConnectionId","fId"],fOutputId:[1,"fOutputId"],fInputId:[1,"fInputId"],fRadius:[2,"fRadius","fRadius",Ye],fOffset:[2,"fOffset","fOffset",Ye],fBehavior:[2,"fBehavior","fBehavior",e=>Oi(e,"fBehavior",wn)],fType:"fType",fSelectionDisabled:[1,"fSelectionDisabled"],fReassignableStart:[1,"fReassignableStart"],fDraggingDisabled:[1,"fReassignDisabled","fDraggingDisabled"],fInputSide:[1,"fInputSide"],fOutputSide:[1,"fOutputSide"]},exportAs:["fComponent"],standalone:!1,features:[_e([{provide:bp,useExisting:t}]),he,xi],ngContentSelectors:Mk,decls:15,vars:6,consts:[["defs",""],["xmlns","http://www.w3.org/2000/svg"],[1,"f-connection-group"],["fConnectionGradientRenderer","",3,"fConnectionGradientRendererFor"],["fConnectionSelection",""],["f-connection-path","",3,"useGradient"],["f-connection-drag-handle-start","","r","8"],["f-connection-drag-handle-end","","r","8"]],template:function(i,o){if(i&1&&(Yt(Pk),$e(),f(0,"svg",1),O(1,"defs",null,0),ke(3),f(4,"g",2),I(5,kk,1,1,":svg:linearGradient",3),O(6,"path",4),f(7,"g"),O(8,"path",5),I(9,Dk,1,0,":svg:circle",6),O(10,"circle",7),h()()(),ke(11,1),ke(12,2),ke(13,3),I(14,Ok,1,0)),i&2){let r;d(5),T((r=o.fGradient())?5:-1,r),d(),q("d",o.path),d(2),E("useGradient",!!o.fGradient()),q("d",o.path),d(),T(o.fReassignableStart()?9:-1),d(5),T(o.fContents().length?14:-1)}},dependencies:[xh,ZD,QD,UD,XD],styles:["[_nghost-%COMP%]{pointer-events:none}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{display:block;vertical-align:middle;overflow:visible!important;position:absolute}[_nghost-%COMP%] svg[_ngcontent-%COMP%] .f-connection-group[_ngcontent-%COMP%]{pointer-events:all}[_nghost-%COMP%] .f-connection-content[_ngcontent-%COMP%]{pointer-events:all}"],changeDetection:0})}return t})();var $A=new ue("F_MAGNETIC_LINES"),KA=(()=>{class t{hostElement=l(Oe).nativeElement;static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})();var zv=(()=>{class t extends KA{threshold=N(10,{transform:Ye,alias:"fAlignThreshold"});_mediator=l(D);ngOnInit(){this._mediator.execute(new Tn(Ie.MAGNETIC_LINES,this))}ngOnDestroy(){this._mediator.execute(new En(Ie.MAGNETIC_LINES))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-line-alignment"]],hostAttrs:[1,"f-line-alignment","f-component"],inputs:{threshold:[1,"fAlignThreshold","threshold"]},exportAs:["fComponent"],standalone:!1,features:[_e([{provide:$A,useExisting:t}]),he],decls:0,vars:0,template:function(i,o){},styles:[Nk]})}return t})();var ih=(()=>{class t{fMinSize=N(1e3);_mediator=l(D);hostElement=l(Oe).nativeElement;model=new gp(this.hostElement);redraw(){let{scale:e,viewBox:i}=this._mediator.execute(new hp(this.hostElement,this.fMinSize()));this.model=new gp(this.hostElement,e,i),h0(i,this.hostElement)}static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,selectors:[["svg","fMinimapFlow",""]],inputs:{fMinSize:[1,"fMinSize"]}})}return t})(),oh=(()=>{class t{_mediator=l(D);_elementRef=l(Oe);hostElement=this._elementRef.nativeElement;redraw(){this.clear();let e=this._elementRef.nativeElement.ownerDocument.createDocumentFragment();this._mediator.execute(new fp).forEach(i=>{e.appendChild(i)}),this.hostElement.appendChild(e)}clear(){this.hostElement.replaceChildren()}static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,selectors:[["g","fMinimapCanvas",""]]})}return t})(),rh=(()=>{class t{_mediator=l(D);hostElement=l(Oe).nativeElement;redraw(){Kf(this._mediator.execute(new mp),this.hostElement)}static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,selectors:[["rect","fMinimapView",""]],hostAttrs:[1,"f-component","f-minimap-view"]})}return t})(),YA=new ue("F_MINIMAP_BASE"),XA=(()=>{class t{hostElement=l(Oe).nativeElement;static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})(),qv=(()=>{class t extends XA{_destroyRef=l(ot);_mediator=l(D);_browser=l(qe);_store=l(k);_canvas=Re.required(oh);_flow=Re.required(ih);_minimapView=Re.required(rh);fMinSize=N(1e3);fNodeRenderLimit=N(1500,{transform:Ye});get state(){return this._flow().model}ngOnInit(){this._mediator.execute(new Tn(Ie.MINIMAP,this))}ngAfterViewInit(){this._listenTransformChanges()}_listenTransformChanges(){this._mediator.execute(new Ud).pipe(Cp(),Lk()).listen(this._destroyRef,()=>{this._redraw()})}_redraw(){if(this._browser.isBrowser()){if(this._isOverNodeRenderLimit()){this._canvas().clear();return}this._flow().redraw(),this._minimapView().redraw(),this._canvas().redraw()}}_isOverNodeRenderLimit(){let e=this.fNodeRenderLimit();return e>0&&this._store.nodes.size()>e}ngOnDestroy(){this._mediator.execute(new En(Ie.MINIMAP))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-minimap"]],viewQuery:function(i,o){i&1&&Tt(o._canvas,oh,5)(o._flow,ih,5)(o._minimapView,rh,5),i&2&<(3)},hostAttrs:[1,"f-component","f-minimap"],inputs:{fMinSize:[1,"fMinSize"],fNodeRenderLimit:[1,"fNodeRenderLimit"]},exportAs:["fComponent"],features:[_e([{provide:YA,useExisting:t}]),he],decls:3,vars:1,consts:[["fMinimapFlow","","width","100%","height","100%","fLockedContext","",3,"fMinSize"],["fMinimapCanvas",""],["fMinimapView","","x","0","y","0","width","100%","height","100%","stroke","none"]],template:function(i,o){i&1&&($e(),f(0,"svg",0),O(1,"g",1)(2,"rect",2),h()),i&2&&E("fMinSize",o.fMinSize())},dependencies:[ih,oh,rh],styles:["[_nghost-%COMP%]{display:block;position:absolute}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{overflow:hidden}"],changeDetection:0})}return t})();var ZA=(()=>{class t{hostElement=l(Oe).nativeElement;initialize(){this.hostElement.style.display="none"}static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})(),Vv=(()=>{class t extends ZA{_mediator=l(D);fTrigger=e=>e.shiftKey;ngOnInit(){this._mediator.execute(new Tn(Ie.SELECTION_AREA,this)),super.initialize()}ngOnDestroy(){this._mediator.execute(new En(Ie.SELECTION_AREA))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-selection-area"]],hostAttrs:[1,"f-selection-area","f-component"],inputs:{fTrigger:"fTrigger"},features:[he],decls:0,vars:0,template:function(i,o){},styles:["[_nghost-%COMP%]{position:absolute}"]})}return t})();var QA=0,JA=120,lr=(()=>{class t extends vm{_destroyRef=l(ot);_mediator=l(D);_browser=l(qe);_componentsStore=l(k);_cache=l(zt);_injector=l(Ze);fId=N(`f-flow-${QA++}`,{alias:"fFlowId"});fCache=N(!1,{transform:me});hostElement=l(Oe).nativeElement;fNodesRendered=Le();fFullRendered=Le();fLoaded=Le();ngOnInit(){this._mediator.execute(new Xu(this)),this._listenCacheChanges()}ngAfterContentInit(){this._browser.isBrowser()&&(this._listenNodesChanges(),this._listenConnectionsChanges())}_listenCacheChanges(){ie(()=>{this._cache.enabled=this.fCache()},{injector:this._injector})}_listenNodesChanges(){new Bt(this._componentsStore.nodesChanges$,this._componentsStore.progressiveRenderChanges$).pipe(Cp(),jd(JA),Fk()).listen(this._destroyRef,()=>{this._mediator.execute(new On)||this._componentsStore.hasPendingProgressiveRender||(this._mediator.execute(new yp),this._mediator.execute(new np),this._mediator.execute(new ar(this._componentsStore.connectionsRevision+1,this._componentsStore.nodesRevision,()=>this._mediator.execute(new ip),this._destroyRef)),this._mediator.execute(new Jn))})}_listenConnectionsChanges(){this._mediator.execute(new Ri).listen(this._destroyRef,()=>{if(!this._mediator.execute(new On)){if(this._componentsStore.isViewportAnimating){this._mediator.execute(new rp(this._destroyRef));return}this._mediator.execute(new Ao)}})}redraw(){this._mediator.execute(new Jn)}reset(){this._mediator.execute(new op)}getNodesBoundingBox(){return this._mediator.execute(new Wu)}getSelection(){return this._mediator.execute(new sr)}getPositionInFlow(e){return this._mediator.execute(new _p(e))}getState(e){return this._mediator.execute(new ep(e?.measuredSize??!1))}selectAll(){this._mediator.execute(new Ri).pipe(C0()).listen(this._destroyRef,()=>{this._mediator.execute(new dp)})}select(e,i,o=!0){this._mediator.execute(new Ri).pipe(C0()).listen(this._destroyRef,()=>{this._mediator.execute(new cp(e,i,o))})}clearSelection(){this._mediator.execute(new ap)}ngOnDestroy(){this._mediator.execute(new tp(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-flow"]],hostAttrs:[1,"f-component","f-flow"],hostVars:1,hostBindings:function(i,o){i&2&&q("id",o.fId())},inputs:{fId:[1,"fFlowId","fId"],fCache:[1,"fCache"]},outputs:{fNodesRendered:"fNodesRendered",fFullRendered:"fFullRendered",fLoaded:"fLoaded"},features:[_e([D,...Uk,rv,Zi,...qA,Q,...u2,{provide:wm,useExisting:t}]),he],ngContentSelectors:Ak,decls:7,vars:0,template:function(i,o){i&1&&(Yt(Rk),Yr(0),ke(1),ke(2,1),ke(3,2),ke(4,3),ke(5,4),ke(6,5),Xr())},styles:["[_nghost-%COMP%]{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none} .f-connection-content{position:absolute;left:0;top:0;inline-size:max-content;pointer-events:all;transform-origin:50% 50%} .f-node, .f-group{position:absolute!important;transform-origin:center;-webkit-user-select:none;user-select:none;pointer-events:all;left:0!important;top:0!important;box-sizing:border-box} .f-group{z-index:1} .f-connection-content{z-index:3} .f-node{z-index:4}.hidden[_ngcontent-%COMP%]{opacity:0}"],changeDetection:0})}return t})();var Gv=(()=>{class t{fVirtualForOf=[];fVirtualForTrackBy;_vc=l($r);_tpl=l(__);_zone=l(Un);_componentsStore=l(k,{optional:!0});_views=[];_rafId=null;_isProgressiveRenderActive=!1;ngOnChanges(e){e.fVirtualForOf&&(this._reset(),this._renderProgressively())}ngOnDestroy(){this._reset()}_reset(){this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._finishProgressiveRender(),this._vc.clear(),this._views.length=0}_renderProgressively(){let i=0;this._startProgressiveRender(),this._zone.runOutsideAngular(()=>{let o=()=>{let r=performance.now();for(;i<this.fVirtualForOf.length&&performance.now()-r<10;){let a=this.fVirtualForOf[i],s=this._vc.createEmbeddedView(this._tpl,{$implicit:a,index:i});this._views.push(s),i++}if(i<this.fVirtualForOf.length){this._rafId=requestAnimationFrame(o);return}this._rafId=null,this._finishProgressiveRender()};this._rafId=requestAnimationFrame(o)})}_startProgressiveRender(){this._isProgressiveRenderActive||(this._isProgressiveRenderActive=!0,this._componentsStore?.beginProgressiveRender())}_finishProgressiveRender(){this._isProgressiveRenderActive&&(this._isProgressiveRenderActive=!1,this._componentsStore?.endProgressiveRender())}static \u0275fac=function(i){return new(i||t)};static \u0275dir=Ee({type:t,selectors:[["","fVirtualFor","","fVirtualForOf",""]],inputs:{fVirtualForOf:"fVirtualForOf",fVirtualForTrackBy:"fVirtualForTrackBy"},features:[xi]})}return t})();var Pt=(function(t){return t[t.ZOOM_IN=1]="ZOOM_IN",t[t.ZOOM_OUT=-1]="ZOOM_OUT",t})(Pt||{}),eF=new ue("F_ZOOM"),Cm=class{},tF=.1,nF=1,iF=.5,oF=60,rF=.5;function aF(t){return Math.abs(t.deltaY)>=Math.abs(t.deltaX)?t.deltaY:t.deltaX}function sF(t,n,e){return cF(t)?lF(n,e):dF(n,e)}function cF(t){return(t.ctrlKey||t.metaKey)&&t.deltaMode===WheelEvent.DOM_DELTA_PIXEL}function dF(t,n){let e=Math.abs(t)/100,i=Hv(e,tF,nF);return n*i}function lF(t,n){if(Math.abs(t)<iF)return 0;let e=Math.abs(t)/oF,i=Hv(e,0,rF);return n*i}function Hv(t,n,e){return Math.max(n,Math.min(e,t))}var ur=(()=>{class t extends Cm{_mediator=l(D);_injector=l(Ze);_store=l(k);_triggersListener=ve.emptyListener();isEnabled=N(!1,{alias:"fZoom",transform:me});fWheelTrigger=Et;fDblClickTrigger=Et;minimum=.1;maximum=4;step=.1;dblClickStep=.5;get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}ngOnInit(){this._mediator.execute(new Tn(Ie.ZOOM,this))}ngAfterViewInit(){this._listenZoomEnabledChanges()}_listenZoomEnabledChanges(){ie(()=>{this.isEnabled(),Rt(()=>this._listenTriggers())},{injector:this._injector})}_listenTriggers(){this._flowHost&&(this._disposeListeners(),this.isEnabled()&&(this._listen("wheel",this._onWheel,ve.activeListener()),this._listen("dblclick",this._onDoubleClick),this._triggersListener=()=>{this._unlisten("wheel",this._onWheel,ve.activeListener()),this._unlisten("dblclick",this._onDoubleClick)}))}_onWheel=e=>{if(!bt(e,this.fWheelTrigger)||(e.preventDefault(),e.target?.closest("[fLockedContext]")))return;let o=aF(e);if(o===0)return;let r=this._normalizeWheelStep(e,o);r!==0&&this.setZoom(A.initialize(e.clientX,e.clientY),r,this._calculateDirection(o),!1)};_normalizeWheelStep(e,i){return sF(e,i,this.step)}_calculateDirection(e){return e>0?Pt.ZOOM_OUT:Pt.ZOOM_IN}_onDoubleClick=e=>{if(!bt(e,this.fDblClickTrigger))return;e.preventDefault();let i=e.target;IN(i)||i?.closest("[fLockedContext]")||this.setZoom(A.initialize(e.clientX,e.clientY),this.dblClickStep,Pt.ZOOM_IN,!0)};_getToCenterPosition(e,i){return A.initialize(e?.x||i.gravityCenter.x,e?.y||i.gravityCenter.y)}zoomIn(e){this._onZoomToCenter(Pt.ZOOM_IN,e)}zoomOut(e){this._onZoomToCenter(Pt.ZOOM_OUT,e)}_onZoomToCenter(e,i){this.setZoom(this._getToCenterPosition(i,G.fromElement(this._flowHost)),this.step,e,!1)}setZoom(e,i,o,r){this._mediator.execute(new pp(e,i,o,r))}getZoomValue(){return this._canvas.transform.scale||1}reset(){this._mediator.execute(new up)}_disposeListeners(){this._triggersListener(),this._triggersListener=ve.emptyListener()}ngOnDestroy(){this._disposeListeners(),this._mediator.execute(new En(Ie.ZOOM))}_listen(e,i,o){this._flowHost.addEventListener(e,i,o)}_unlisten(e,i,o){this._flowHost.removeEventListener(e,i,o)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275dir=Ee({type:t,selectors:[["f-canvas","fZoom",""]],hostAttrs:[1,"f-zoom","f-component"],inputs:{isEnabled:[1,"fZoom","isEnabled"],fWheelTrigger:"fWheelTrigger",fDblClickTrigger:"fDblClickTrigger",minimum:[2,"fZoomMinimum","minimum",Ye],maximum:[2,"fZoomMaximum","maximum",Ye],step:[2,"fZoomStep","step",Ye],dblClickStep:[2,"fZoomDblClickStep","dblClickStep",Ye]},features:[_e([{provide:eF,useExisting:t}]),he]})}return t})();var jv=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=wi({type:t});static \u0275inj=Ci({imports:[Ti]})}return t})();var af=nk(VP(),1);var qr=(function(t){return t.NETWORK_SIMPLEX="network-simplex",t.TIGHT_TREE="tight-tree",t.LONGEST_PATH="longest-path",t})(qr||{}),I9={direction:di.TOP_BOTTOM,nodeGap:48,layerGap:64,algorithm:qr.NETWORK_SIMPLEX,defaultNodeSize:tt.initialize(120,72)},Zg=(()=>{class t extends Zu{constructor(){super(I9)}mergeOptions(e,i={}){return Kt(se(se({},e),i),{defaultNodeSize:i.defaultNodeSize?tt.initialize(i.defaultNodeSize.width,i.defaultNodeSize.height):tt.initialize(e.defaultNodeSize.width,e.defaultNodeSize.height)})}async calculate(e,i,o){let r=this.resolveLayoutOptions(o),a=this._buildGraph(e,i,r),s=new Map;return af.layout(a),a.nodes().forEach(c=>{let u=a.node(c),p=e.find(b=>b.id===c);if(!u||!p)return;let g=p.size??r.defaultNodeSize;s.set(c,A.initialize(u.x-g.width/2,u.y-g.height/2))}),{nodes:Nv(e,s)}}_buildGraph(e,i,o){let r=new af.graphlib.Graph;return r.setDefaultEdgeLabel(()=>({})),r.setGraph({rankdir:this._mapDirection(o.direction),nodesep:o.nodeGap,ranksep:o.layerGap,ranker:this._mapAlgorithm(o.algorithm)}),e.forEach(a=>{let s=a.size??o.defaultNodeSize;r.setNode(a.id,{width:s.width,height:s.height})}),i.forEach(a=>{!r.hasNode(a.source)||!r.hasNode(a.target)||r.setEdge(a.source,a.target,{})}),r}_mapAlgorithm(e){switch(e){case qr.TIGHT_TREE:return"tight-tree";case qr.LONGEST_PATH:return"longest-path";case qr.NETWORK_SIMPLEX:default:return"network-simplex"}}_mapDirection(e){switch(e){case di.BOTTOM_TOP:return"BT";case di.LEFT_RIGHT:return"LR";case di.RIGHT_LEFT:return"RL";case di.TOP_BOTTOM:default:return"TB"}}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();var rn={loading:"Loading collection",errorTitle:"Failed to load",emptyTitle:"No nodes match the current filters.",resetFilters:"Reset filters",a11y:{toolbar:"Graph controls",panel:"Selected node details"},toolbar:{zoomIn:"Zoom in",zoomOut:"Zoom out",fitToScreen:"Fit to screen",resetLayoutLabel:"Reset layout",resetLayoutTooltip:"Reset layout (re-run auto layout, clear saved positions)",layoutAlgorithmLabel:"Layout algorithm",layoutAlgorithmTooltip:"Layout algorithm (balanced, stretched or organic)",layoutDirectionLabel:"Layout direction",layoutDirectionTooltip:"Layout direction (TB, BT, LR, RL)",layoutDirectionUnavailableTooltip:"Direction does not apply to the Organic layout. Switch to Balanced or Stretched to set it.",layoutSpacingLabel:"Layout spacing",layoutSpacingTooltip:"Layout spacing (compact, normal, spacious)",layoutSpacingUnavailableTooltip:"Spacing does not apply to the Organic layout. Switch to Balanced or Stretched to set it.",connectionTypeLabel:"Edge style",connectionTypeTooltip:"Edge style (orthogonal, straight, bezier or adaptive curve)"},layout:{algorithm:{options:{"network-simplex":{label:"Balanced"},"longest-path":{label:"Stretched"},force:{label:"Organic"}}},direction:{options:{TOP_BOTTOM:{label:"Top to bottom"},BOTTOM_TOP:{label:"Bottom to top"},LEFT_RIGHT:{label:"Left to right"},RIGHT_LEFT:{label:"Right to left"}}},spacing:{options:{compact:{label:"Compact"},normal:{label:"Normal"},spacious:{label:"Spacious"}}},connection:{options:{segment:{label:"Orthogonal"},straight:{label:"Straight"},bezier:{label:"Bezier"},"adaptive-curve":{label:"Adaptive curve"}}}},panel:{resizeLabel:"Resize panel"},resetLayoutConfirm:{header:"Reset layout?",message:"Reset all node positions to the automatic layout. This cannot be undone.",accept:"Reset",reject:"Cancel"}};var fo={graph:{perf:{cache:!0,virtualization:!1},perfHud:!0},inspector:{actionMocks:!1}};var T9="adaptive-curve",Qg=["segment","straight","bezier","adaptive-curve"],GP="sm.graph.connection-type",HP="sm.graph.layout-algorithm",jP="sm.graph.layout-direction",UP="sm.graph.layout-spacing",ho=class t{_connectionType=U(sf(GP,E9,T9));_layoutAlgorithm=U(sf(HP,J_,X_));_layoutDirection=U(sf(jP,e0,Z_));_layoutSpacing=U(sf(UP,t0,Q_));connectionType=this._connectionType.asReadonly();layoutAlgorithm=this._layoutAlgorithm.asReadonly();layoutDirection=this._layoutDirection.asReadonly();layoutSpacing=this._layoutSpacing.asReadonly();setConnectionType(n){this._connectionType()!==n&&(this._connectionType.set(n),cf(GP,n))}setLayoutAlgorithm(n){this._layoutAlgorithm()!==n&&(this._layoutAlgorithm.set(n),cf(HP,n))}setLayoutDirection(n){this._layoutDirection()!==n&&(this._layoutDirection.set(n),cf(jP,n))}setLayoutSpacing(n){this._layoutSpacing()!==n&&(this._layoutSpacing.set(n),cf(UP,n))}static toFoblexEnum(n){return n}static \u0275fac=function(e){return new(e||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})};function sf(t,n,e){let i=null;try{i=localStorage.getItem(t)}catch{return e}return i&&n(i)?i:e}function cf(t,n){try{localStorage.setItem(t,n)}catch{}}function E9(t){return typeof t=="string"&&Qg.includes(t)}var P9={TOP_BOTTOM:{output:Se.BOTTOM,input:Se.TOP},BOTTOM_TOP:{output:Se.TOP,input:Se.BOTTOM},LEFT_RIGHT:{output:Se.RIGHT,input:Se.LEFT},RIGHT_LEFT:{output:Se.LEFT,input:Se.RIGHT}};function WP(t,n){return fa(t)?P9[n]:{input:Se.CALCULATE,output:Se.CALCULATE}}var $P=`
|
|
211
|
+
.p-popover {
|
|
212
|
+
margin-block-start: dt('popover.gutter');
|
|
213
|
+
background: dt('popover.background');
|
|
214
|
+
color: dt('popover.color');
|
|
215
|
+
border: 1px solid dt('popover.border.color');
|
|
216
|
+
border-radius: dt('popover.border.radius');
|
|
217
|
+
box-shadow: dt('popover.shadow');
|
|
218
|
+
will-change: transform;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.p-popover-content {
|
|
222
|
+
padding: dt('popover.content.padding');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.p-popover-flipped {
|
|
226
|
+
margin-block-start: calc(dt('popover.gutter') * -1);
|
|
227
|
+
margin-block-end: dt('popover.gutter');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.p-popover:after,
|
|
231
|
+
.p-popover:before {
|
|
232
|
+
bottom: 100%;
|
|
233
|
+
left: calc(dt('popover.arrow.offset') + dt('popover.arrow.left'));
|
|
234
|
+
content: ' ';
|
|
235
|
+
height: 0;
|
|
236
|
+
width: 0;
|
|
237
|
+
position: absolute;
|
|
238
|
+
pointer-events: none;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.p-popover:after {
|
|
242
|
+
border-width: calc(dt('popover.gutter') - 2px);
|
|
243
|
+
margin-left: calc(-1 * (dt('popover.gutter') - 2px));
|
|
244
|
+
border-style: solid;
|
|
245
|
+
border-color: transparent;
|
|
246
|
+
border-bottom-color: dt('popover.background');
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.p-popover:before {
|
|
250
|
+
border-width: dt('popover.gutter');
|
|
251
|
+
margin-left: calc(-1 * dt('popover.gutter'));
|
|
252
|
+
border-style: solid;
|
|
253
|
+
border-color: transparent;
|
|
254
|
+
border-bottom-color: dt('popover.border.color');
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.p-popover-flipped:after,
|
|
258
|
+
.p-popover-flipped:before {
|
|
259
|
+
bottom: auto;
|
|
260
|
+
top: 100%;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.p-popover.p-popover-flipped:after {
|
|
264
|
+
border-bottom-color: transparent;
|
|
265
|
+
border-top-color: dt('popover.background');
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.p-popover.p-popover-flipped:before {
|
|
269
|
+
border-bottom-color: transparent;
|
|
270
|
+
border-top-color: dt('popover.border.color');
|
|
271
|
+
}
|
|
272
|
+
`;var D9=["content"],O9=["*"],N9=t=>({closeCallback:t});function R9(t,n){}function A9(t,n){t&1&&be(0,R9,0,0,"ng-template")}function F9(t,n){if(t&1){let e=re();f(0,"div",1),V("click",function(o){L(e);let r=m();return B(r.onOverlayClick(o))})("pMotionOnEnter",function(o){L(e);let r=m();return B(r.onAnimationStart(o))})("pMotionOnAfterLeave",function(){L(e);let o=m();return B(o.onAnimationEnd())}),f(1,"div",2),V("click",function(o){L(e);let r=m();return B(r.onContentClick(o))})("mousedown",function(o){L(e);let r=m();return B(r.onContentClick(o))}),ke(2),be(3,A9,1,0,null,3),h()()}if(t&2){let e=m();Qr(e.sx("root")),Ne(e.cn(e.cx("root"),e.styleClass)),E("pBind",e.ptm("root"))("ngStyle",e.style)("pMotion",e.overlayVisible)("pMotionAppear",!0)("pMotionOptions",e.computedMotionOptions()),q("aria-modal",e.overlayVisible)("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy),d(),Ne(e.cx("content")),E("pBind",e.ptm("content")),d(2),E("ngTemplateOutlet",e.contentTemplate||e._contentTemplate)("ngTemplateOutletContext",yt(17,N9,e.onCloseClick.bind(e)))}}var L9={root:()=>({position:"absolute"})},B9={root:"p-popover p-component",content:"p-popover-content"},KP=(()=>{class t extends ia{name="popover";style=$P;classes=B9;inlineStyles=L9;static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),YP=new ue("POPOVER_INSTANCE"),Jg=(()=>{class t extends ra{componentName="Popover";$pcPopover=l(YP,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=l(At,{self:!0});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptm("host"))}ariaLabel;ariaLabelledBy;dismissable=!0;style;styleClass;appendTo=N("body");autoZIndex=!0;ariaCloseLabel;baseZIndex=0;focusOnShow=!0;showTransitionOptions=".12s cubic-bezier(0, 0, 0.2, 1)";hideTransitionOptions=".1s linear";motionOptions=N(void 0);computedMotionOptions=S(()=>se(se({},this.ptm("motion")),this.motionOptions()));onShow=new dt;onHide=new dt;$appendTo=S(()=>this.appendTo()||this.config.overlayAppendTo());container;overlayVisible=!1;render=!1;selfClick=!1;documentClickListener;target;willHide;scrollHandler;documentResizeListener;contentTemplate;templates;_contentTemplate;destroyCallback;overlayEventListener;overlaySubscription;_componentStyle=l(KP);zone=l(Un);overlayService=l(k_);onAfterContentInit(){this.templates.forEach(e=>{e.getType()==="content"&&(this._contentTemplate=e.template)})}bindDocumentClickListener(){if(cn(this.platformId)&&!this.documentClickListener){let e=E_()?"touchstart":"click",i=this.el?this.el.nativeElement.ownerDocument:this.document;this.documentClickListener=this.renderer.listen(i,e,o=>{this.dismissable&&(!this.container?.contains(o.target)&&this.target!==o.target&&!this.target.contains(o.target)&&!this.selfClick&&this.hide(),this.selfClick=!1,this.cd.markForCheck())})}}unbindDocumentClickListener(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null,this.selfClick=!1)}toggle(e,i){this.overlayVisible?(this.hasTargetChanged(e,i)&&(this.destroyCallback=()=>{this.show(null,i||e.currentTarget||e.target)}),this.hide()):this.show(e,i)}show(e,i){i&&e&&e.stopPropagation(),this.container&&!this.overlayVisible&&(this.container=null),this.target=i||e.currentTarget||e.target,this.overlayVisible=!0,this.render=!0,this.cd.markForCheck()}onOverlayClick(e){this.overlayService.add({originalEvent:e,target:this.el.nativeElement}),this.selfClick=!0}onContentClick(e){let i=e.target;this.selfClick=e.offsetX<i.clientWidth&&e.offsetY<i.clientHeight}hasTargetChanged(e,i){return this.target!=null&&this.target!==(i||e.currentTarget||e.target)}appendOverlay(){this.$appendTo()&&this.$appendTo()!=="self"&&(this.$appendTo()==="body"?na(this.document.body,this.container):na(this.$appendTo(),this.container))}restoreAppend(){this.container&&this.$appendTo()&&this.$appendTo()!=="self"&&na(this.el.nativeElement,this.container)}setZIndex(){this.autoZIndex&&sa.set("overlay",this.container,this.baseZIndex+this.config.zIndex.overlay)}align(){if(this.target&&this.container){I_(this.container,this.target,!1);let e=jf(this.container),i=jf(this.target),o=this.document.defaultView?.getComputedStyle(this.container).getPropertyValue("border-radius"),r=0;e.left<i.left&&(r=i.left-e.left-parseFloat(o)*2),this.container.style.setProperty(N_("popover.arrow.left").name,`${r}px`),e.top<i.top&&(this.container.setAttribute("data-p-popover-flipped","true"),!this.$unstyled()&&S_(this.container,"p-popover-flipped"))}}onAnimationStart(e){this.container=e.element,this.container?.setAttribute(this.$attrSelector,""),this.appendOverlay(),this.align(),this.setZIndex(),this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener(),this.focusOnShow&&this.focus(),this.overlayEventListener=i=>{this.container&&this.container.contains(i.target)&&(this.selfClick=!0)},this.overlaySubscription=this.overlayService.clickObservable.subscribe(this.overlayEventListener),this.onShow.emit(null)}onAnimationEnd(){this.overlayVisible||(this.destroyCallback&&(this.destroyCallback(),this.destroyCallback=null),this.overlaySubscription&&this.overlaySubscription.unsubscribe(),this.autoZIndex&&sa.clear(this.container),this.onContainerDestroy(),this.onHide.emit({}),this.render=!1,this.container=null)}focus(){let e=T_(this.container,"[autofocus]");e&&this.zone.runOutsideAngular(()=>{setTimeout(()=>e.focus(),5)})}hide(){this.overlayVisible=!1,this.cd.markForCheck()}onCloseClick(e){this.hide(),e.preventDefault()}onEscapeKeydown(e){this.hide()}onWindowResize(){this.overlayVisible&&!P_()&&this.hide()}bindDocumentResizeListener(){if(cn(this.platformId)&&!this.documentResizeListener){let e=this.document.defaultView;this.documentResizeListener=this.renderer.listen(e,"resize",this.onWindowResize.bind(this))}}unbindDocumentResizeListener(){this.documentResizeListener&&(this.documentResizeListener(),this.documentResizeListener=null)}bindScrollListener(){cn(this.platformId)&&(this.scrollHandler||(this.scrollHandler=new R_(this.target,()=>{this.overlayVisible&&this.hide()})),this.scrollHandler.bindScrollListener())}unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}onContainerDestroy(){this.cd.destroyed||(this.target=null),this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}onDestroy(){this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.container&&this.autoZIndex&&sa.clear(this.container),this.cd.destroyed||(this.target=null),this.destroyCallback=null,this.container&&(this.restoreAppend(),this.onContainerDestroy()),this.overlaySubscription&&this.overlaySubscription.unsubscribe()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["p-popover"]],contentQueries:function(i,o,r){if(i&1&&Zr(r,D9,4)(r,Pi,4),i&2){let a;_t(a=vt())&&(o.contentTemplate=a.first),_t(a=vt())&&(o.templates=a)}},hostBindings:function(i,o){i&1&&V("keydown.escape",function(a){return o.onEscapeKeydown(a)},Ur)},inputs:{ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",dismissable:[2,"dismissable","dismissable",me],style:"style",styleClass:"styleClass",appendTo:[1,"appendTo"],autoZIndex:[2,"autoZIndex","autoZIndex",me],ariaCloseLabel:"ariaCloseLabel",baseZIndex:[2,"baseZIndex","baseZIndex",Ye],focusOnShow:[2,"focusOnShow","focusOnShow",me],showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",motionOptions:[1,"motionOptions"]},outputs:{onShow:"onShow",onHide:"onHide"},features:[_e([KP,{provide:YP,useExisting:t},{provide:oa,useExisting:t}]),Kr([At]),he],ngContentSelectors:O9,decls:1,vars:1,consts:[["role","dialog","pMotionName","p-anchored-overlay",3,"pBind","class","style","ngStyle","pMotion","pMotionAppear","pMotionOptions"],["role","dialog","pMotionName","p-anchored-overlay",3,"click","pMotionOnEnter","pMotionOnAfterLeave","pBind","ngStyle","pMotion","pMotionAppear","pMotionOptions"],[3,"click","mousedown","pBind"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(i,o){i&1&&(Yt(),I(0,F9,4,19,"div",0)),i&2&&T(o.render?0:-1)},dependencies:[Ti,ea,b_,dn,At,F_,A_],encapsulation:2,changeDetection:0})}return t})(),XP=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=wi({type:t});static \u0275inj=Ci({imports:[Jg,dn,dn]})}return t})();function q9(t,n){if(t&1){let e=re();f(0,"li",12)(1,"button",17),V("click",function(){let o=L(e).$implicit,r=m(),a=Xt(7);return r.setLayoutAlgorithm(o),B(a.hide())}),v(2),h()()}if(t&2){let e=n.$implicit,i=m();d(),de("is-active",i.layoutAlgorithm()===e),q("aria-checked",i.layoutAlgorithm()===e)("data-testid","graph-layout-algorithm-option-"+e),d(),Fe(" ",i.layoutAlgorithmLabel(e)," ")}}function V9(t,n){if(t&1){let e=re();f(0,"button",18),V("click",function(){let o=L(e).$implicit,r=m(),a=Xt(12);return r.setLayoutDirection(o),B(a.hide())}),O(1,"i",19),h()}if(t&2){let e=n.$implicit,i=m();de("is-active",i.layoutDirection()===e),E("pTooltip",i.layoutDirectionLabel(e)),q("aria-checked",i.layoutDirection()===e)("aria-label",i.layoutDirectionLabel(e))("data-testid","graph-layout-direction-option-"+e),d(),Ne(i.directionItemIcon(e))}}function G9(t,n){if(t&1){let e=re();f(0,"button",18),V("click",function(){let o=L(e).$implicit,r=m(),a=Xt(17);return r.setLayoutSpacing(o),B(a.hide())}),O(1,"i",19),h()}if(t&2){let e=n.$implicit,i=m();de("is-active",i.layoutSpacing()===e),E("pTooltip",i.layoutSpacingLabel(e)),q("aria-checked",i.layoutSpacing()===e)("aria-label",i.layoutSpacingLabel(e))("data-testid","graph-layout-spacing-option-"+e),d(),Ne(i.spacingItemIcon(e))}}function H9(t,n){if(t&1){let e=re();f(0,"button",18),V("click",function(){let o=L(e).$implicit,r=m(),a=Xt(22);return r.setConnectionType(o),B(a.hide())}),$e(),f(1,"svg",20),O(2,"path",9),h()()}if(t&2){let e=n.$implicit,i=m();de("is-active",i.connectionType()===e),E("pTooltip",i.connectionTypeLabel(e)),q("aria-checked",i.connectionType()===e)("aria-label",i.connectionTypeLabel(e))("data-testid","graph-connection-type-option-"+e),d(2),q("d",i.connectionTypeItemPath(e))}}var ZP={TOP_BOTTOM:"pi pi-arrow-down",BOTTOM_TOP:"pi pi-arrow-up",LEFT_RIGHT:"pi pi-arrow-right",RIGHT_LEFT:"pi pi-arrow-left"},QP={compact:"pi pi-window-minimize",normal:"pi pi-bars",spacious:"pi pi-window-maximize"},j9={segment:"M 2 14 L 8 14 L 8 2 L 14 2",straight:"M 2 14 L 14 2",bezier:"M 2 14 C 6 14, 10 2, 14 2","adaptive-curve":"M 2 14 C 8 14, 8 2, 14 2"},df=class t{graphPreferences=l(ho);texts=rn;layoutAlgorithms=W_;layoutDirections=K_;layoutSpacings=Y_;connectionTypes=Qg;layoutAlgorithm=this.graphPreferences.layoutAlgorithm;layoutDirection=this.graphPreferences.layoutDirection;layoutSpacing=this.graphPreferences.layoutSpacing;connectionType=this.graphPreferences.connectionType;directionIcon=S(()=>ZP[this.layoutDirection()]);spacingIcon=S(()=>QP[this.layoutSpacing()]);directionAvailable=S(()=>fa(this.layoutAlgorithm()));spacingAvailable=S(()=>$_(this.layoutAlgorithm()));layoutAlgorithmLabel(n){return rn.layout.algorithm.options[n].label}layoutDirectionLabel(n){return rn.layout.direction.options[n].label}layoutSpacingLabel(n){return rn.layout.spacing.options[n].label}connectionTypeLabel(n){return rn.layout.connection.options[n].label}setLayoutAlgorithm(n){this.graphPreferences.setLayoutAlgorithm(n)}setLayoutDirection(n){this.graphPreferences.setLayoutDirection(n)}setLayoutSpacing(n){this.graphPreferences.setLayoutSpacing(n)}setConnectionType(n){this.graphPreferences.setConnectionType(n)}directionItemIcon(n){return ZP[n]}spacingItemIcon(n){return QP[n]}connectionTypeItemPath(n){return j9[n]}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-graph-layout-toolbar"]],decls:26,vars:21,consts:[["algorithmPopover",""],["directionPopover",""],["spacingPopover",""],["connectionTypePopover",""],["icon","pi pi-sitemap","severity","secondary","size","small","data-testid","graph-layout-algorithm-toggle",3,"onClick","ariaLabel","pTooltip","text","rounded"],["severity","secondary","size","small","data-testid","graph-layout-direction-toggle",3,"onClick","icon","ariaLabel","pTooltip","text","rounded","disabled"],["severity","secondary","size","small","data-testid","graph-layout-spacing-toggle",3,"onClick","icon","ariaLabel","pTooltip","text","rounded","disabled"],["severity","secondary","size","small","data-testid","graph-connection-type-toggle",3,"onClick","ariaLabel","pTooltip","text","rounded"],["viewBox","0 0 16 16","aria-hidden","true",1,"graph__connection-svg","graph__connection-svg--toggle"],["fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["appendTo","body","styleClass","graph__layout-popover"],["role","menu","data-testid","graph-layout-algorithm-menu",1,"graph__layout-menu"],["role","none"],["role","menu","data-testid","graph-layout-direction-menu",1,"graph__layout-icon-row"],["type","button","role","menuitemradio",1,"graph__layout-icon-item",3,"is-active","pTooltip"],["role","menu","data-testid","graph-layout-spacing-menu",1,"graph__layout-icon-row"],["role","menu","data-testid","graph-connection-type-menu",1,"graph__layout-icon-row"],["type","button","role","menuitemradio",1,"graph__layout-menu-item",3,"click"],["type","button","role","menuitemradio",1,"graph__layout-icon-item",3,"click","pTooltip"],["aria-hidden","true"],["viewBox","0 0 16 16","aria-hidden","true",1,"graph__connection-svg"]],template:function(e,i){if(e&1){let o=re();f(0,"p-button",4),V("onClick",function(a){L(o);let s=Xt(7);return B(s.toggle(a))}),h(),f(1,"p-button",5),V("onClick",function(a){L(o);let s=Xt(12);return B(s.toggle(a))}),h(),f(2,"p-button",6),V("onClick",function(a){L(o);let s=Xt(17);return B(s.toggle(a))}),h(),f(3,"p-button",7),V("onClick",function(a){L(o);let s=Xt(22);return B(s.toggle(a))}),$e(),f(4,"svg",8),O(5,"path",9),h()(),Gr(),f(6,"p-popover",10,0)(8,"ul",11),Y(9,q9,3,5,"li",12,xe),h()(),f(11,"p-popover",10,1)(13,"div",13),Y(14,V9,2,8,"button",14,xe),h()(),f(16,"p-popover",10,2)(18,"div",15),Y(19,G9,2,8,"button",14,xe),h()(),f(21,"p-popover",10,3)(23,"div",16),Y(24,H9,3,7,"button",14,xe),h()()}e&2&&(E("ariaLabel",i.texts.toolbar.layoutAlgorithmLabel)("pTooltip",i.texts.toolbar.layoutAlgorithmTooltip)("text",!0)("rounded",!0),d(),E("icon",i.directionIcon())("ariaLabel",i.texts.toolbar.layoutDirectionLabel)("pTooltip",i.directionAvailable()?i.texts.toolbar.layoutDirectionTooltip:i.texts.toolbar.layoutDirectionUnavailableTooltip)("text",!0)("rounded",!0)("disabled",!i.directionAvailable()),d(),E("icon",i.spacingIcon())("ariaLabel",i.texts.toolbar.layoutSpacingLabel)("pTooltip",i.spacingAvailable()?i.texts.toolbar.layoutSpacingTooltip:i.texts.toolbar.layoutSpacingUnavailableTooltip)("text",!0)("rounded",!0)("disabled",!i.spacingAvailable()),d(),E("ariaLabel",i.texts.toolbar.connectionTypeLabel)("pTooltip",i.texts.toolbar.connectionTypeTooltip)("text",!0)("rounded",!0),d(2),q("d",i.connectionTypeItemPath(i.connectionType())),d(4),X(i.layoutAlgorithms),d(5),X(i.layoutDirections),d(5),X(i.layoutSpacings),d(5),X(i.connectionTypes))},dependencies:[un,ln,XP,Jg,De,Be],styles:['[_nghost-%COMP%] .graph__layout-popover .p-popover-content{padding:4px}.graph__layout-menu[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;min-width:160px}.graph__layout-menu-item[_ngcontent-%COMP%]{appearance:none;border:0;background:transparent;color:var(--sm-text);font:inherit;text-align:left;padding:6px 10px;border-radius:var(--sm-radius-sm);cursor:pointer;display:flex;align-items:center;gap:8px;transition:background .12s ease,color .12s ease}.graph__layout-menu-item[_ngcontent-%COMP%]:hover, .graph__layout-menu-item[_ngcontent-%COMP%]:focus-visible{background:color-mix(in srgb,var(--p-primary-color) 12%,transparent);outline:none}.graph__layout-menu-item.is-active[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--p-primary-color) 18%,transparent);color:var(--p-primary-color);font-weight:600}.graph__layout-menu-item[_ngcontent-%COMP%]:before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:transparent;flex-shrink:0}.graph__layout-menu-item.is-active[_ngcontent-%COMP%]:before{background:var(--p-primary-color)}.graph__layout-icon-row[_ngcontent-%COMP%]{display:inline-flex;flex-direction:row;gap:2px;padding:2px}.graph__layout-icon-item[_ngcontent-%COMP%]{appearance:none;border:0;background:transparent;color:var(--sm-text);cursor:pointer;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--sm-radius-sm);transition:background .12s ease,color .12s ease}.graph__layout-icon-item[_ngcontent-%COMP%] > i[_ngcontent-%COMP%]{font-size:1rem}.graph__connection-svg[_ngcontent-%COMP%]{width:20px;height:20px;overflow:visible}.graph__connection-svg--toggle[_ngcontent-%COMP%]{width:16px;height:16px}.graph__layout-icon-item[_ngcontent-%COMP%]:hover, .graph__layout-icon-item[_ngcontent-%COMP%]:focus-visible{background:color-mix(in srgb,var(--p-primary-color) 12%,transparent);outline:none}.graph__layout-icon-item.is-active[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--p-primary-color) 18%,transparent);color:var(--p-primary-color)}'],changeDetection:0})};var JP={a11y:{toolbarLabel:"Toggle node kinds"},favorites:{label:"Favorites"}};function U9(t,n){if(t&1&&Si(0,"i",4),t&2){let e=m();Ne(e.piClass()),rt("font-size",e.size(),"px")}}function W9(t,n){if(t&1&&($e(),W(0,"svg",1),Si(1,"path"),$()),t&2){let e=m();q("width",e.size())("height",e.size()),d(),q("d",e.svgPath())}}function $9(t,n){if(t&1&&(W(0,"span",4),v(1),$()),t&2){let e=m();rt("font-size",e.size(),"px")("line-height",e.size(),"px"),d(),C(e.emoji())}}function K9(t,n){if(t&1&&(W(0,"span",5),v(1),$()),t&2){let e=m();rt("font-size",e.size(),"px")("line-height",e.size(),"px"),d(),C(e.letter())}}var Vn=class t{kindRegistry=l(Mi);kind=N.required();size=N(18);provider=N(null);resolvedUi=S(()=>this.kindRegistry.lookup(this.kind()));variant=S(()=>{let n=this.resolvedUi();return n?.icon?.kind==="pi"?"pi":n?.icon?.kind==="svg"?"svg":n?.emoji?"emoji":"letter"});piClass=S(()=>{let n=this.resolvedUi()?.icon;return n?.kind==="pi"?`pi ${n.id}`:""});svgPath=S(()=>{let n=this.resolvedUi()?.icon;return n?.kind==="svg"?n.path:""});emoji=S(()=>this.resolvedUi()?.emoji??"");letter=S(()=>this.kindRegistry.labelOf(this.kind()).charAt(0).toUpperCase());static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-kind-icon"]],inputs:{kind:[1,"kind"],size:[1,"size"],provider:[1,"provider"]},decls:4,vars:1,consts:[["aria-hidden","true",3,"class","font-size"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2.2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true"],["aria-hidden","true",3,"font-size","line-height"],["aria-hidden","true",1,"kind-icon__letter",3,"font-size","line-height"],["aria-hidden","true"],["aria-hidden","true",1,"kind-icon__letter"]],template:function(e,i){if(e&1&&I(0,U9,1,4,"i",0)(1,W9,2,3,":svg:svg",1)(2,$9,2,5,"span",2)(3,K9,2,5,"span",3),e&2){let o;T((o=i.variant())==="pi"?0:o==="svg"?1:o==="emoji"?2:o==="letter"?3:-1)}},styles:["[_nghost-%COMP%]{display:inline-flex;align-items:center;justify-content:center;line-height:1}"],changeDetection:0})};var eM=()=>({class:"kind-palette__content"}),tM=t=>({content:t}),Y9=(t,n)=>n.kind;function X9(t,n){if(t&1&&(O(0,"sm-kind-icon",5),f(1,"span"),v(2),h()),t&2){let e=m().$implicit;E("kind",e.kind)("size",16),d(2),C(e.count)}}function Z9(t,n){if(t&1){let e=re();f(0,"p-togglebutton",4),V("ngModelChange",function(){let o=L(e).$implicit,r=m();return B(r.toggle(o.kind))}),be(1,X9,3,3,"ng-template",null,0,Nt),h()}if(t&2){let e=n.$implicit,i=m();E("ngModel",i.isActive(e.kind))("pTooltip",e.label)("ariaLabel",e.label)("styleClass","kind-palette__btn kind-palette__btn--"+e.kind)("pt",yt(7,tM,Ot(6,eM))),q("data-testid","kind-palette-"+e.kind)}}function Q9(t,n){if(t&1&&(O(0,"i",7),f(1,"span"),v(2),h()),t&2){let e=m(2);de("pi-star-fill",e.favoritesActive())("pi-star",!e.favoritesActive()),d(2),C(e.favoritesCount())}}function J9(t,n){if(t&1){let e=re();f(0,"p-togglebutton",6),V("ngModelChange",function(){L(e);let o=m();return B(o.toggleFavoritesOnly())}),be(1,Q9,3,5,"ng-template",null,0,Nt),h()}if(t&2){let e=m();E("ngModel",e.favoritesActive())("pTooltip",e.texts.favorites.label)("ariaLabel",e.texts.favorites.label)("pt",yt(5,tM,Ot(4,eM)))}}var lf=class t{loader=l(Ft);filters=l(fn);kindRegistry=l(Mi);texts=JP;entries=S(()=>{let n=new Map;for(let e of this.loader.nodes())n.set(e.kind,(n.get(e.kind)??0)+1);return this.kindRegistry.kinds().map(e=>({kind:e.name,label:e.label,count:n.get(e.name)??0})).filter(e=>e.count>0)});favoritesCount=S(()=>this.loader.nodes().filter(n=>n.isFavorite===!0).length);showFavorites=S(()=>this.loader.hasAnyFavorites()||this.filters.favoritesOnly());favoritesActive=S(()=>this.filters.favoritesOnly());isActive(n){return this.filters.isKindActive(n)}toggle(n){let e=this.entries().map(i=>i.kind);this.filters.toggleKind(n,e)}toggleFavoritesOnly(){this.filters.setFavoritesOnly(!this.filters.favoritesOnly())}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-kind-palette"]],decls:4,vars:2,consts:[["content",""],["role","toolbar","data-testid","kind-palette",1,"kind-palette"],[3,"ngModel","pTooltip","ariaLabel","styleClass","pt"],["styleClass","kind-palette__btn kind-palette__btn--favorites","data-testid","kind-palette-favorites",3,"ngModel","pTooltip","ariaLabel","pt"],[3,"ngModelChange","ngModel","pTooltip","ariaLabel","styleClass","pt"],[3,"kind","size"],["styleClass","kind-palette__btn kind-palette__btn--favorites","data-testid","kind-palette-favorites",3,"ngModelChange","ngModel","pTooltip","ariaLabel","pt"],["aria-hidden","true",1,"pi"]],template:function(e,i){e&1&&(f(0,"div",1),Y(1,Z9,3,9,"p-togglebutton",2,Y9),I(3,J9,3,7,"p-togglebutton",3),h()),e&2&&(q("aria-label",i.texts.a11y.toolbarLabel),d(),X(i.entries()),d(2),T(i.showFavorites()?3:-1))},dependencies:[gn,hn,mn,vn,_n,De,Be,Vn],styles:["[_nghost-%COMP%]{display:block;pointer-events:auto}.kind-palette[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;padding:4px;background:color-mix(in srgb,var(--sm-bg-content) 80%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid var(--sm-border);border-radius:.65rem;box-shadow:var(--sm-shadow-floating)}.kind-palette__btn[_ngcontent-%COMP%]{--p-togglebutton-padding: 0;--p-togglebutton-content-padding: 0 .55rem;--p-togglebutton-border-radius: var(--sm-radius-pill);--p-togglebutton-content-border-radius: var(--sm-radius-pill);--p-togglebutton-gap: .4rem;--p-togglebutton-background: transparent;--p-togglebutton-checked-background: transparent;--p-togglebutton-hover-background: transparent;--p-togglebutton-border-color: transparent;--p-togglebutton-checked-border-color: transparent;--p-togglebutton-content-checked-background: var(--sm-bg-hover);--p-togglebutton-color: var(--p-text-muted-color);--p-togglebutton-hover-color: var(--p-text-color);--p-togglebutton-checked-color: var(--p-text-color);--p-togglebutton-icon-color: var(--p-text-muted-color);--p-togglebutton-icon-hover-color: var(--p-text-color);--p-togglebutton-icon-checked-color: var(--p-text-color);width:56px;height:30px;font-size:.72rem;font-weight:600;font-variant-numeric:tabular-nums}[_nghost-%COMP%] .kind-palette__content{width:100%;height:100%;justify-content:flex-start;display:flex;align-items:center;gap:.4rem}[_nghost-%COMP%] .kind-palette__content>span{flex:1;text-align:right}[_nghost-%COMP%] .kind-palette__btn sm-kind-icon{display:inline-flex;align-items:center;color:var(--p-text-muted-color)}[_nghost-%COMP%] .kind-palette__btn[aria-pressed=true] sm-kind-icon{color:var(--p-text-color)}[_nghost-%COMP%] .kind-palette__btn--skill[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-skill)}[_nghost-%COMP%] .kind-palette__btn--agent[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-agent)}[_nghost-%COMP%] .kind-palette__btn--command[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-command)}[_nghost-%COMP%] .kind-palette__btn--markdown[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-markdown)}[_nghost-%COMP%] .kind-palette__btn--favorites .pi{font-size:.95rem;line-height:1;color:var(--p-text-muted-color)}[_nghost-%COMP%] .kind-palette__btn--favorites:hover .pi{color:var(--p-text-color)}[_nghost-%COMP%] .kind-palette__btn--favorites[aria-pressed=true] .pi{color:var(--p-primary-color)}"],changeDetection:0})};var Wt={a11y:{toolbarLabel:"Link kind filters"},kinds:{invokes:"Invokes",references:"References",mentions:"Mentions",supersedes:"Supersedes"},tooltips:{invokes:`Invokes:
|
|
273
|
+
"/skill-command"`,references:`References:
|
|
274
|
+
"[link](./link.md)"`,mentions:`Mention:
|
|
275
|
+
"@agent.md"`,supersedes:`Supersedes:
|
|
276
|
+
.sm annotation`}};var eY=()=>({class:"link-kind-palette__content"}),tY=t=>({content:t}),nY=(t,n)=>n.kind;function iY(t,n){if(t&1&&v(0),t&2){let e=m(2).$implicit;Fe(" ",e.text," ")}}function oY(t,n){if(t&1&&O(0,"i"),t&2){let e=m(2).$implicit;Ne(e.icon)}}function rY(t,n){if(t&1&&(f(0,"span",4),I(1,iY,1,1)(2,oY,1,2,"i",5),h()),t&2){let e=m().$implicit;d(),T(e.text?1:e.icon?2:-1)}}function aY(t,n){if(t&1){let e=re();f(0,"p-togglebutton",3),V("ngModelChange",function(){let o=L(e).$implicit,r=m(2);return B(r.toggle(o.kind))}),be(1,rY,3,1,"ng-template",null,0,Nt),h()}if(t&2){let e=n.$implicit,i=m(2);E("ngModel",i.isActive(e.kind))("pTooltip",e.tooltip)("ariaLabel",e.label)("styleClass","link-kind-palette__btn link-kind-palette__btn--"+e.kind)("pt",yt(7,tY,Ot(6,eY))),q("data-testid","link-kind-palette-"+e.kind)}}function sY(t,n){if(t&1&&(f(0,"div",1),Y(1,aY,3,9,"p-togglebutton",2,nY),h()),t&2){let e=m();q("aria-label",e.texts.a11y.toolbarLabel),d(),X(e.entries())}}var nM=[{kind:"invokes",label:Wt.kinds.invokes,tooltip:Wt.tooltips.invokes,text:"/"},{kind:"references",label:Wt.kinds.references,tooltip:Wt.tooltips.references,icon:"pi pi-link"},{kind:"mentions",label:Wt.kinds.mentions,tooltip:Wt.tooltips.mentions,text:"@"},{kind:"supersedes",label:Wt.kinds.supersedes,tooltip:Wt.tooltips.supersedes,icon:"pi pi-angle-double-right"}];for(let t of nM)if(!U_.includes(t.kind))throw new Error(`link-kind-palette: unknown link kind "${t.kind}"`);var uf=class t{loader=l(Ft);filters=l(fn);texts=Wt;counts=S(()=>{let n=this.loader.scan(),e=new Map;if(!n)return e;for(let i of n.links)e.set(i.kind,(e.get(i.kind)??0)+1);return e});entries=S(()=>{let n=this.counts(),e=this.filters.selectedLinkKinds(),i=new Set(e);return nM.filter(o=>(n.get(o.kind)??0)>0||i.has(o.kind))});constructor(){ie(()=>{let n=this.counts(),e=this.filters.selectedLinkKinds(),i=e.filter(o=>(n.get(o)??0)>0);i.length!==e.length&&this.filters.setLinkKinds(i)})}isActive(n){return this.filters.isLinkKindActive(n)}toggle(n){this.filters.toggleLinkKind(n)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-link-kind-palette"]],decls:1,vars:1,consts:[["content",""],["role","toolbar","data-testid","link-kind-palette",1,"link-kind-palette"],["tooltipStyleClass","link-kind-palette__tooltip",3,"ngModel","pTooltip","ariaLabel","styleClass","pt"],["tooltipStyleClass","link-kind-palette__tooltip",3,"ngModelChange","ngModel","pTooltip","ariaLabel","styleClass","pt"],["aria-hidden","true",1,"link-kind-palette__glyph"],[3,"class"]],template:function(e,i){e&1&&I(0,sY,3,1,"div",1),e&2&&T(i.entries().length>0?0:-1)},dependencies:[gn,hn,mn,vn,_n,De,Be],styles:["[_nghost-%COMP%]{display:block;width:100%;pointer-events:auto}.link-kind-palette[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:2px;padding:4px;background:color-mix(in srgb,var(--sm-bg-content) 80%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid var(--sm-border);border-radius:.65rem;box-shadow:var(--sm-shadow-floating)}.link-kind-palette__btn[_ngcontent-%COMP%]{--p-togglebutton-padding: 0;--p-togglebutton-content-padding: 0;--p-togglebutton-border-radius: var(--sm-radius-pill);--p-togglebutton-content-border-radius: var(--sm-radius-pill);--p-togglebutton-background: transparent;--p-togglebutton-checked-background: transparent;--p-togglebutton-hover-background: transparent;--p-togglebutton-border-color: transparent;--p-togglebutton-checked-border-color: transparent;--p-togglebutton-content-checked-background: var(--sm-bg-hover);--p-togglebutton-color: var(--p-text-muted-color);--p-togglebutton-hover-color: var(--p-text-color);--p-togglebutton-checked-color: var(--p-text-color);width:100%;height:30px}[_nghost-%COMP%] .link-kind-palette__content{width:100%;height:100%;display:flex;align-items:center;justify-content:center}[_nghost-%COMP%] .link-kind-palette__glyph{font-size:.95rem;line-height:1;font-weight:600;display:inline-flex;align-items:center;justify-content:center}[_nghost-%COMP%] .link-kind-palette__btn--invokes .link-kind-palette__glyph{color:var(--sm-edge-invokes)}[_nghost-%COMP%] .link-kind-palette__btn--invokes[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-invokes-active)}[_nghost-%COMP%] .link-kind-palette__btn--references .link-kind-palette__glyph{color:var(--sm-edge-references)}[_nghost-%COMP%] .link-kind-palette__btn--references[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-references-active)}[_nghost-%COMP%] .link-kind-palette__btn--mentions .link-kind-palette__glyph{color:var(--sm-edge-mentions)}[_nghost-%COMP%] .link-kind-palette__btn--mentions[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-mentions-active)}[_nghost-%COMP%] .link-kind-palette__btn--supersedes .link-kind-palette__glyph{color:var(--sm-edge-supersedes)}[_nghost-%COMP%] .link-kind-palette__btn--supersedes[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-supersedes-active)}[_nghost-%COMP%] .link-kind-palette__tooltip .p-tooltip-text{white-space:pre-line;text-align:center;line-height:1.35}"],changeDetection:0})};var iM={a11y:{toolbarLabel:"Toggle severity filters"},error:{label:"Errors",tooltip:"Only nodes with errors"},warn:{label:"Warnings",tooltip:"Only nodes with warnings"}};var rM=()=>({class:"severity-palette__content"}),aM=t=>({content:t});function cY(t,n){if(t&1&&(f(0,"span",5),O(1,"i",6),h(),f(2,"span",7),v(3),h()),t&2){let e=m(3);d(3),C(e.errorCount())}}function dY(t,n){if(t&1){let e=re();f(0,"p-togglebutton",4),V("ngModelChange",function(){L(e);let o=m(2);return B(o.toggle("error"))}),be(1,cY,4,1,"ng-template",null,0,Nt),h()}if(t&2){let e=m(2);E("ngModel",e.isActive("error"))("pTooltip",e.texts.error.tooltip)("ariaLabel",e.texts.error.label)("pt",yt(5,aM,Ot(4,rM)))}}function lY(t,n){if(t&1&&(f(0,"span",5),O(1,"i",9),h(),f(2,"span",7),v(3),h()),t&2){let e=m(3);d(3),C(e.warnCount())}}function uY(t,n){if(t&1){let e=re();f(0,"p-togglebutton",8),V("ngModelChange",function(){L(e);let o=m(2);return B(o.toggle("warn"))}),be(1,lY,4,1,"ng-template",null,0,Nt),h()}if(t&2){let e=m(2);E("ngModel",e.isActive("warn"))("pTooltip",e.texts.warn.tooltip)("ariaLabel",e.texts.warn.label)("pt",yt(5,aM,Ot(4,rM)))}}function pY(t,n){if(t&1&&(f(0,"div",1),I(1,dY,3,7,"p-togglebutton",2),I(2,uY,3,7,"p-togglebutton",3),h()),t&2){let e=m();q("aria-label",e.texts.a11y.toolbarLabel),d(),T(e.showError()?1:-1),d(),T(e.showWarn()?2:-1)}}var pf=class t{loader=l(Ft);filters=l(fn);issuePaths=l(ha);texts=iM;visibleSet=S(()=>{let n=this.filters.apply(this.loader.nodes(),this.issuePaths.bySeverity()),e=new Set;for(let i of n)e.add(i.path);return e});rawErrorCount=S(()=>this.issuePaths.bySeverity().errors.size);rawWarnCount=S(()=>this.issuePaths.bySeverity().warns.size);errorCount=S(()=>oM(this.issuePaths.bySeverity().errors,this.visibleSet()));warnCount=S(()=>oM(this.issuePaths.bySeverity().warns,this.visibleSet()));showError=S(()=>this.rawErrorCount()>0||this.filters.severityErrorActive());showWarn=S(()=>this.rawWarnCount()>0||this.filters.severityWarnActive());hasAny=S(()=>this.showError()||this.showWarn());constructor(){ie(()=>{this.rawErrorCount()===0&&this.filters.severityErrorActive()&&this.filters.toggleSeverity("error"),this.rawWarnCount()===0&&this.filters.severityWarnActive()&&this.filters.toggleSeverity("warn")})}isActive(n){return this.filters.isSeverityActive(n)}toggle(n){this.filters.toggleSeverity(n)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-severity-palette"]],decls:1,vars:1,consts:[["content",""],["role","toolbar","data-testid","severity-palette",1,"severity-palette"],["styleClass","severity-palette__btn severity-palette__btn--error","data-testid","severity-palette-error",3,"ngModel","pTooltip","ariaLabel","pt"],["styleClass","severity-palette__btn severity-palette__btn--warn","data-testid","severity-palette-warn",3,"ngModel","pTooltip","ariaLabel","pt"],["styleClass","severity-palette__btn severity-palette__btn--error","data-testid","severity-palette-error",3,"ngModelChange","ngModel","pTooltip","ariaLabel","pt"],["aria-hidden","true",1,"severity-palette__glyph"],[1,"pi","pi-times-circle"],[1,"severity-palette__count"],["styleClass","severity-palette__btn severity-palette__btn--warn","data-testid","severity-palette-warn",3,"ngModelChange","ngModel","pTooltip","ariaLabel","pt"],[1,"pi","pi-exclamation-triangle"]],template:function(e,i){e&1&&I(0,pY,3,3,"div",1),e&2&&T(i.hasAny()?0:-1)},dependencies:[gn,hn,mn,vn,_n,De,Be],styles:["[_nghost-%COMP%]{display:block;width:100%;pointer-events:auto}.severity-palette[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;padding:4px;background:color-mix(in srgb,var(--sm-bg-content) 80%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid var(--sm-border);border-radius:.65rem;box-shadow:var(--sm-shadow-floating)}.severity-palette__btn[_ngcontent-%COMP%]{--p-togglebutton-padding: 0;--p-togglebutton-content-padding: 0 .55rem;--p-togglebutton-border-radius: var(--sm-radius-pill);--p-togglebutton-content-border-radius: var(--sm-radius-pill);--p-togglebutton-gap: .4rem;--p-togglebutton-background: transparent;--p-togglebutton-checked-background: transparent;--p-togglebutton-hover-background: transparent;--p-togglebutton-border-color: transparent;--p-togglebutton-checked-border-color: transparent;--p-togglebutton-color: var(--p-text-muted-color);--p-togglebutton-hover-color: var(--p-text-color);--p-togglebutton-checked-color: var(--p-text-color);--p-togglebutton-icon-color: var(--p-text-muted-color);--p-togglebutton-icon-hover-color: var(--p-text-color);--p-togglebutton-icon-checked-color: var(--p-text-color);width:56px;height:30px;font-size:.72rem;font-weight:600;font-variant-numeric:tabular-nums}.severity-palette__btn--error[_ngcontent-%COMP%]{--p-togglebutton-content-checked-background: color-mix(in srgb, var(--sm-severity-error-bg) 55%, var(--sm-bg-content))}.severity-palette__btn--warn[_ngcontent-%COMP%]{--p-togglebutton-content-checked-background: color-mix(in srgb, var(--sm-severity-warn-bg) 55%, var(--sm-bg-content))}[_nghost-%COMP%] .severity-palette__content{width:100%;height:100%;justify-content:flex-start;display:flex;align-items:center;gap:.4rem}[_nghost-%COMP%] .severity-palette__count{flex:1;text-align:right}[_nghost-%COMP%] .severity-palette__glyph{display:inline-flex;align-items:center;justify-content:center;font-size:.95rem;line-height:1}[_nghost-%COMP%] .severity-palette__btn--error .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--error .severity-palette__count{color:color-mix(in srgb,var(--sm-severity-error) 55%,var(--p-text-muted-color))}[_nghost-%COMP%] .severity-palette__btn--warn .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--warn .severity-palette__count{color:color-mix(in srgb,var(--sm-severity-warn) 55%,var(--p-text-muted-color))}[_nghost-%COMP%] .severity-palette__btn--error:hover .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--error:hover .severity-palette__count{color:color-mix(in srgb,var(--sm-severity-error) 80%,var(--p-text-color))}[_nghost-%COMP%] .severity-palette__btn--warn:hover .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--warn:hover .severity-palette__count{color:color-mix(in srgb,var(--sm-severity-warn) 80%,var(--p-text-color))}[_nghost-%COMP%] .severity-palette__btn--error[aria-pressed=true] .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--error[aria-pressed=true] .severity-palette__count{color:var(--sm-severity-error)}[_nghost-%COMP%] .severity-palette__btn--warn[aria-pressed=true] .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--warn[aria-pressed=true] .severity-palette__count{color:var(--sm-severity-warn)}"],changeDetection:0})};function oM(t,n){let[e,i]=t.size<=n.size?[t,n]:[n,t],o=0;for(let r of e)i.has(r)&&o++;return o}var fY={claude:{label:"Claude",color:"#cc785c",colorDark:"#e89270"},gemini:{label:"Gemini",color:"#4285f4",colorDark:"#669df6"},"agent-skills":{label:"Open Skills",color:"#64748b",colorDark:"#94a3b8"}},hY=new Set(["markdown"]),mY={label:"",color:"#9ca3af",colorDark:"#6b7280"};function sM(t){if(!t||hY.has(t))return null;let n=fY[t];return n||Kt(se({},mY),{label:t})}var gY=(t,n)=>n.source+":"+n.tag,_Y=(t,n)=>n.step;function vY(t,n){t&1&&(f(0,"span",8),v(1),h()),t&2&&(d(),C(n))}function yY(t,n){if(t&1&&(f(0,"span",12)(1,"span",29),v(2,"T"),h(),v(3),h()),t&2){let e=m(),i=ee(1);E("pTooltip",e.texts.stats.tokens(i.tokensTotal)),d(3),C(e.tokensShort())}}function CY(t,n){if(t&1&&(f(0,"span",13)(1,"span",29),v(2,"B"),h(),v(3),h()),t&2){let e=m(),i=ee(1);E("pTooltip",e.texts.stats.bytes(i.bytesTotal)),d(3),C(e.bytesShort())}}function bY(t,n){if(t&1&&(f(0,"span",30),v(1),h()),t&2){let e=n;m();let i=ee(0);rt("--provider-color",e.color)("--provider-color-dark",e.colorDark??e.color),E("pTooltip",i.provider),d(),C(e.label)}}function xY(t,n){if(t&1&&(f(0,"span",33),v(1),h()),t&2){let e=n.$implicit;de("sm-gnode__tag-chip--author",e.source==="author")("sm-gnode__tag-chip--user",e.source==="user"),q("data-tag-source",e.source),d(),C(e.tag)}}function wY(t,n){if(t&1&&(f(0,"span",32),v(1),h()),t&2){let e=m(2),i=ee(3);d(),C(e.texts.tagOverflow(i))}}function SY(t,n){if(t&1&&(f(0,"div",18),Y(1,xY,2,6,"span",31,gY),I(3,wY,2,1,"span",32),h()),t&2){m();let e=ee(2),i=ee(3);d(),X(e),d(2),T(i>0?3:-1)}}function IY(t,n){if(t&1&&(f(0,"span",37),v(1),h()),t&2){let e=n.$implicit;d(),C(e)}}function TY(t,n){if(t&1&&(f(0,"div",34)(1,"span",35),v(2),h(),f(3,"div",36),Y(4,IY,2,1,"span",37,xe),h()()),t&2){let e=m(),i=m(2);d(),E("pTooltip",i.texts.llm.topics.tooltip),d(),C(i.texts.llm.topics.label),d(2),X(e.topics)}}function EY(t,n){if(t&1&&(f(0,"span",37),v(1),h()),t&2){let e=n.$implicit;d(),C(e)}}function PY(t,n){if(t&1&&(f(0,"div",34)(1,"span",35),v(2),h(),f(3,"div",36),Y(4,EY,2,1,"span",37,xe),h()()),t&2){let e=m(),i=m(2);d(),E("pTooltip",i.texts.llm.facts.tooltip),d(),C(i.texts.llm.facts.label),d(2),X(e.keyFacts)}}function MY(t,n){if(t&1&&(I(0,TY,6,2,"div",34),I(1,PY,6,2,"div",34)),t&2){let e=n;T(e.topics!=null&&e.topics.length?0:-1),d(),T(e.keyFacts!=null&&e.keyFacts.length?1:-1)}}function kY(t,n){if(t&1&&(f(0,"div",34)(1,"span",35),v(2),h(),f(3,"span"),v(4),h()()),t&2){let e=m(),i=m(2);d(),E("pTooltip",i.texts.llm.when.tooltip),d(),C(i.texts.llm.when.label),d(2),C(e.whenToUse)}}function DY(t,n){if(t&1&&(f(0,"div",34)(1,"span",35),v(2),h(),f(3,"span"),v(4),h()()),t&2){let e=m(),i=m(2);d(),E("pTooltip",i.texts.llm.style.tooltip),d(),C(i.texts.llm.style.label),d(2),C(e.interactionStyle)}}function OY(t,n){if(t&1&&(f(0,"span",37),v(1),h()),t&2){let e=n.$implicit;d(),C(e)}}function NY(t,n){if(t&1&&(f(0,"div",34)(1,"span",35),v(2),h(),f(3,"div",36),Y(4,OY,2,1,"span",37,xe),h()()),t&2){let e=m(),i=m(2);d(),E("pTooltip",i.texts.llm.does.tooltip),d(),C(i.texts.llm.does.label),d(2),X(e.capabilities)}}function RY(t,n){if(t&1&&(I(0,kY,5,3,"div",34),I(1,DY,5,3,"div",34),I(2,NY,6,2,"div",34)),t&2){let e=n;T(e.whenToUse?0:-1),d(),T(e.interactionStyle?1:-1),d(),T(e.capabilities!=null&&e.capabilities.length?2:-1)}}function AY(t,n){if(t&1&&v(0),t&2){let e=n.$implicit,i=n.$index,o=n.$count;y_("",e.step,". ",e.description,"",i===o-1?"":" \xB7 ")}}function FY(t,n){if(t&1&&(f(0,"div",34)(1,"span",35),v(2),h(),f(3,"span"),Y(4,AY,1,3,null,null,_Y),h()()),t&2){let e=m(),i=m(2);d(),E("pTooltip",i.texts.llm.steps.tooltip),d(),C(i.texts.llm.steps.label),d(2),X(e.recipe)}}function LY(t,n){if(t&1&&(f(0,"span",37),v(1),h()),t&2){let e=n.$implicit;d(),C(e)}}function BY(t,n){if(t&1&&(f(0,"div",34)(1,"span",35),v(2),h(),f(3,"div",36),Y(4,LY,2,1,"span",37,xe),h()()),t&2){let e=m(),i=m(2);d(),E("pTooltip",i.texts.llm.pre.tooltip),d(),C(i.texts.llm.pre.label),d(2),X(e.preconditions)}}function zY(t,n){if(t&1&&(f(0,"span",37),v(1),h()),t&2){let e=n.$implicit;d(),C(e)}}function qY(t,n){if(t&1&&(f(0,"div",34)(1,"span",35),v(2),h(),f(3,"div",36),Y(4,zY,2,1,"span",37,xe),h()()),t&2){let e=m(),i=m(2);d(),E("pTooltip",i.texts.llm.out.tooltip),d(),C(i.texts.llm.out.label),d(2),X(e.outputs)}}function VY(t,n){if(t&1&&(f(0,"span",37),v(1),h()),t&2){let e=n.$implicit;d(),C(e)}}function GY(t,n){if(t&1&&(f(0,"div",34)(1,"span",35),v(2),h(),f(3,"div",36),Y(4,VY,2,1,"span",37,xe),h()()),t&2){let e=m(),i=m(2);d(),E("pTooltip",i.texts.llm.fx.tooltip),d(),C(i.texts.llm.fx.label),d(2),X(e.sideEffects)}}function HY(t,n){if(t&1&&(I(0,FY,6,2,"div",34),I(1,BY,6,2,"div",34),I(2,qY,6,2,"div",34),I(3,GY,6,2,"div",34)),t&2){let e=n;T(e.recipe!=null&&e.recipe.length?0:-1),d(),T(e.preconditions!=null&&e.preconditions.length?1:-1),d(),T(e.outputs!=null&&e.outputs.length?2:-1),d(),T(e.sideEffects!=null&&e.sideEffects.length?3:-1)}}function jY(t,n){if(t&1&&(f(0,"div",34)(1,"span",35),v(2),h(),f(3,"code",38),v(4),h()()),t&2){let e=m(),i=m(2);d(),E("pTooltip",i.texts.llm.eg.tooltip),d(),C(i.texts.llm.eg.label),d(2),C(e.invocationExample)}}function UY(t,n){if(t&1&&(f(0,"span",37),v(1),h()),t&2){let e=n.$implicit;d(),C(e)}}function WY(t,n){if(t&1&&(f(0,"div",34)(1,"span",35),v(2),h(),f(3,"div",36),Y(4,UY,2,1,"span",37,xe),h()()),t&2){let e=m(),i=m(2);d(),E("pTooltip",i.texts.llm.fx.tooltip),d(),C(i.texts.llm.fx.label),d(2),X(e.sideEffects)}}function $Y(t,n){if(t&1&&(I(0,jY,5,3,"div",34),I(1,WY,6,2,"div",34)),t&2){let e=n;T(e.invocationExample?0:-1),d(),T(e.sideEffects!=null&&e.sideEffects.length?1:-1)}}function KY(t,n){if(t&1&&(f(0,"div",23),I(1,MY,2,2),I(2,RY,3,3),I(3,HY,4,4),I(4,$Y,2,2),h()),t&2){let e,i,o,r,a=m();d(),T((e=a.summaryMarkdown())?1:-1,e),d(),T((i=a.summaryAgent())?2:-1,i),d(),T((o=a.summarySkill())?3:-1,o),d(),T((r=a.summaryCommand())?4:-1,r)}}function YY(t,n){if(t&1&&(f(0,"div",24),v(1),h()),t&2){let e=m();d(),C(e.description())}}function XY(t,n){if(t&1&&(f(0,"div",39)(1,"div",40)(2,"span",41),v(3),h(),f(4,"span",42),v(5),h()()()),t&2){let e=m(),i=m();d(3),C(i.texts.meta.model),d(2),C(e.model)}}function ZY(t,n){t&1&&I(0,XY,6,2,"div",39),t&2&&T(n.model?0:-1)}var QY={selected:!1,highlighted:!1,dimmed:!1},ff=class t{node=N.required();stats=N({linksIn:0,linksOut:0});summary=N(null);selection=N(QY);isFavorite=N(!1);favoriteToggle=Le();texts=Yn;expanded=Kn(!1);fmAgent=S(()=>{let n=this.node();return n.kind==="agent"?n.frontmatter:null});summaryAgent=S(()=>{let n=this.summary();return n?.kind==="agent"?n:null});summarySkill=S(()=>{let n=this.summary();return n?.kind==="skill"?n:null});summaryCommand=S(()=>{let n=this.summary();return n?.kind==="command"?n:null});summaryMarkdown=S(()=>{let n=this.summary();return n?.kind==="markdown"?n:null});hasLlmCluster=S(()=>{let n=this.summary();return n!==null&&this.hasLlmContent(n)});hasLlmContent(n){switch(n.kind){case"markdown":return(n.topics?.length??0)>0||(n.keyFacts?.length??0)>0;case"agent":return!!n.whenToUse||!!n.interactionStyle||(n.capabilities?.length??0)>0;case"skill":return(n.recipe?.length??0)>0||(n.preconditions?.length??0)>0||(n.outputs?.length??0)>0||(n.sideEffects?.length??0)>0;case"command":return!!n.invocationExample||(n.sideEffects?.length??0)>0;default:return!1}}nodeColor=S(()=>this.agentVendorColor());kindRegistry=l(Mi);providerAccent=S(()=>null);providerChip=S(()=>sM(this.node().provider));bytesShort=S(()=>{let n=this.stats().bytesTotal;return n===void 0?null:Wf(n)});tokensShort=S(()=>{let n=this.stats().tokensTotal;return n===void 0?null:Wf(n)});version=S(()=>ua(this.node()));stability=S(()=>pa(this.node()));tagChips=S(()=>{let n=this.node(),e=[],o=n.frontmatter.tags;if(Array.isArray(o))for(let r of o)typeof r=="string"&&r.length>0&&e.push({tag:r,source:"author"});for(let r of H_(n))e.push({tag:r,source:"user"});return e});visibleTagChips=S(()=>this.tagChips().slice(0,3));moreTagsCount=S(()=>Math.max(0,this.tagChips().length-3));agentVendorColor=S(()=>{let n=this.node();if(n.kind!=="agent")return null;let i=n.frontmatter.color;return typeof i=="string"&&i.length>0?i:null});displayName=S(()=>{let n=this.node().frontmatter;return n.name?n.name:n0(this.node().path)});description=S(()=>this.node().frontmatter.description??"");toggleExpanded(n){n.stopPropagation(),this.expanded.update(e=>!e)}toggleFavorite(n){n.stopPropagation();let e=!this.isFavorite();this.favoriteToggle.emit({path:this.node().path,value:e})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-node-card"]],hostAttrs:[1,"sm-gnode"],hostVars:17,hostBindings:function(e,i){e&2&&(q("data-kind",i.node().kind),rt("--node-color",i.nodeColor())("--accent",i.providerAccent()),de("sm-gnode--with-color",!!i.nodeColor())("sm-gnode--deprecated",i.stability()==="deprecated")("sm-gnode--expanded",i.expanded())("sm-gnode--selected",i.selection().selected)("sm-gnode--highlighted",i.selection().highlighted)("sm-gnode--dimmed",i.selection().dimmed))},inputs:{node:[1,"node"],stats:[1,"stats"],summary:[1,"summary"],selection:[1,"selection"],isFavorite:[1,"isFavorite"],expanded:[1,"expanded"]},outputs:{favoriteToggle:"favoriteToggle",expanded:"expandedChange"},decls:36,vars:32,consts:[[1,"sm-gnode__main"],["aria-hidden","true",1,"sm-gnode__icon-box"],[3,"kind","provider","size"],[1,"sm-gnode__content"],[1,"sm-gnode__name-row"],[1,"sm-gnode__name",3,"pTooltip"],["slot","card.title.right",3,"node"],[1,"sm-gnode__actions"],["data-testid","node-card-version",1,"sm-gnode__name-version"],["type","button",1,"sm-gnode__chevron",3,"click"],["aria-hidden","true",1,"pi","pi-chevron-down"],[1,"sm-gnode__sub"],[1,"sm-gnode__sub-stat","sm-gnode__sub-stat--tokens",3,"pTooltip"],[1,"sm-gnode__sub-stat","sm-gnode__sub-stat--bytes",3,"pTooltip"],["data-testid","node-card-provider",1,"sm-gnode__provider",3,"--provider-color","--provider-color-dark","pTooltip"],["type","button","data-testid","node-card-favorite",1,"sm-gnode__favorite",3,"click","pTooltip"],["aria-hidden","true",1,"pi"],["slot","card.subtitle.left",3,"node"],["data-testid","node-card-tags",1,"sm-gnode__tagrow"],[1,"sm-gnode__panel"],["data-testid","node-card-path",1,"sm-gnode__path",3,"pTooltip"],["aria-hidden","true",1,"fa-regular","fa-folder-open","sm-gnode__path-icon"],[1,"sm-gnode__path-value"],[1,"sm-gnode__llm"],[1,"sm-gnode__desc"],[1,"sm-gnode__footer"],["slot","card.footer.left",3,"node"],[1,"sm-gnode__footer-right-cluster"],["slot","card.footer.right",3,"node"],[1,"sm-gnode__sub-key"],["data-testid","node-card-provider",1,"sm-gnode__provider",3,"pTooltip"],[1,"sm-gnode__tag-chip",3,"sm-gnode__tag-chip--author","sm-gnode__tag-chip--user"],["data-testid","node-card-tags-more",1,"sm-gnode__tag-more"],[1,"sm-gnode__tag-chip"],[1,"sm-gnode__llm-line"],[1,"sm-gnode__llm-label",3,"pTooltip"],[1,"sm-gnode__chips"],[1,"sm-gnode__chip","sm-gnode__chip--llm"],[1,"sm-gnode__llm-code"],[1,"sm-gnode__meta"],[1,"sm-gnode__meta-row"],[1,"sm-gnode__meta-label"],[1,"sm-gnode__meta-value","sm-gnode__meta-value--mono"]],template:function(e,i){if(e&1&&(ut(0)(1)(2)(3),f(4,"div",0)(5,"div",1),O(6,"sm-kind-icon",2),h(),f(7,"div",3)(8,"div",4)(9,"span",5),v(10),h(),O(11,"sm-view-contributions-host",6),h()(),f(12,"div",7),I(13,vY,2,1,"span",8),f(14,"button",9),V("click",function(r){return i.toggleExpanded(r)}),O(15,"i",10),h()(),f(16,"div",11),I(17,yY,4,2,"span",12),I(18,CY,4,2,"span",13),I(19,bY,2,6,"span",14),f(20,"button",15),V("click",function(r){return i.toggleFavorite(r)}),O(21,"i",16),h(),O(22,"sm-view-contributions-host",17),h()(),I(23,SY,4,1,"div",18),f(24,"div",19)(25,"div",20),O(26,"i",21),f(27,"span",22),v(28),h()(),I(29,KY,5,4,"div",23),I(30,YY,2,1,"div",24),I(31,ZY,1,1),h(),f(32,"div",25),O(33,"sm-view-contributions-host",26),f(34,"div",27),O(35,"sm-view-contributions-host",28),h()()),e&2){let o,r,a,s=Ke(i.node());d(),Ke(i.stats()),d();let c=Ke(i.visibleTagChips());d(),Ke(i.moreTagsCount()),d(3),E("kind",s.kind)("provider",s.provider)("size",18),d(3),E("pTooltip",i.displayName()),d(),C(i.displayName()),d(),E("node",i.node()),d(2),T((o=i.version())?13:-1,o),d(),q("aria-label",i.texts.ariaExpand),d(3),T(i.tokensShort()!==null?17:-1),d(),T(i.bytesShort()!==null?18:-1),d(),T((r=i.providerChip())?19:-1,r),d(),de("sm-gnode__favorite--on",i.isFavorite()),E("pTooltip",i.isFavorite()?i.texts.favoriteRemoveTooltip:i.texts.favoriteAddTooltip),q("aria-label",i.isFavorite()?i.texts.ariaFavoriteRemove:i.texts.ariaFavoriteAdd),d(),de("pi-star-fill",i.isFavorite())("pi-star",!i.isFavorite()),d(),E("node",i.node()),d(),T(c.length?23:-1),d(2),E("pTooltip",s.path),d(3),C(s.path),d(),T(i.hasLlmCluster()?29:-1),d(),T(i.description()?30:-1),d(),T((a=i.fmAgent())?31:-1,a),d(2),E("node",i.node()),d(2),E("node",i.node())}},dependencies:[Vn,De,Be,yn],styles:['[_nghost-%COMP%]{--accent: var(--sm-kind-markdown);position:relative;display:inline-block;width:260px;background:var(--sm-bg-content);border:1px solid var(--sm-border);border-radius:8px;box-shadow:var(--sm-shadow-card);overflow:hidden;transition:box-shadow .12s ease,border-color .12s ease,transform .12s ease;-webkit-user-select:none;user-select:none;text-align:start}[_nghost-%COMP%]:hover{box-shadow:var(--sm-shadow-card-hover)}[_nghost-%COMP%]:before{content:"";position:absolute;top:0;left:0;right:0;height:3px;background:var(--accent)}[data-kind="skill"][_nghost-%COMP%]{--accent: var(--sm-kind-skill)}[data-kind="agent"][_nghost-%COMP%]{--accent: var(--sm-kind-agent)}[data-kind="command"][_nghost-%COMP%]{--accent: var(--sm-kind-command)}[data-kind="markdown"][_nghost-%COMP%]{--accent: var(--sm-kind-markdown)}.sm-gnode--deprecated[_nghost-%COMP%]{opacity:.55}.sm-gnode--selected[_nghost-%COMP%]{border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color),0 4px 16px color-mix(in srgb,var(--p-primary-color) 25%,transparent)}.sm-gnode--highlighted[_nghost-%COMP%]{border-color:var(--p-primary-color);box-shadow:var(--sm-shadow-card-hover)}.sm-gnode--dimmed[_nghost-%COMP%]{opacity:.25}.sm-gnode__main[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:.6rem;row-gap:.3rem;align-items:start;padding:.6rem .65rem}.sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-markdown-bg);--kind-fg: var(--sm-kind-markdown-fg);width:38px;height:38px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:var(--kind-bg);color:var(--kind-fg);flex:none;font-size:1.05rem;grid-row:1 / span 2;align-self:center}[data-kind="skill"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-skill-bg);--kind-fg: var(--sm-kind-skill-fg)}[data-kind="agent"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-agent-bg);--kind-fg: var(--sm-kind-agent-fg)}[data-kind="command"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-command-bg);--kind-fg: var(--sm-kind-command-fg)}[data-kind="markdown"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-markdown-bg);--kind-fg: var(--sm-kind-markdown-fg)}.sm-gnode__content[_ngcontent-%COMP%]{min-width:0;width:100%;justify-self:stretch;display:flex;flex-direction:column;gap:.15rem}.sm-gnode__name-row[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.35rem;min-width:0}.sm-gnode__name-row[_ngcontent-%COMP%] > sm-view-contributions-host[_ngcontent-%COMP%]{margin-left:auto;align-self:center}.sm-gnode__name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:600;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--p-text-color);flex:0 1 auto;min-width:0}.sm-gnode__name-version[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.65rem;color:var(--sm-text-muted);background:color-mix(in srgb,var(--accent) 10%,transparent);padding:.05rem .35rem;border-radius:var(--sm-radius-sm);line-height:1.2;flex:none;align-self:center}.sm-gnode--with-color[_nghost-%COMP%] .sm-gnode__name[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--node-color) 7%,transparent);padding:.05rem .4rem;border-radius:var(--sm-radius-sm)}.sm-gnode__actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.2rem}.sm-gnode__confidence[_ngcontent-%COMP%]{display:flex;align-items:flex-start;font-size:.65rem;font-weight:600;font-variant-numeric:tabular-nums;line-height:1;flex:none;cursor:help;padding-top:.35rem}.sm-gnode__llm-marker--high[_ngcontent-%COMP%]{color:var(--sm-severity-success)}.sm-gnode__llm-marker--med[_ngcontent-%COMP%]{color:var(--sm-severity-warn)}.sm-gnode__llm-marker--low[_ngcontent-%COMP%]{color:var(--sm-severity-error)}.sm-gnode__chevron[_ngcontent-%COMP%]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;color:var(--sm-text-muted);border-radius:var(--sm-radius-md);transition:transform .16s ease,background .12s ease,color .12s ease}.sm-gnode__chevron[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.7rem;line-height:1}.sm-gnode__chevron[_ngcontent-%COMP%]:hover{background:var(--sm-bg-hover);color:var(--p-text-color)}.sm-gnode--expanded[_nghost-%COMP%] .sm-gnode__chevron[_ngcontent-%COMP%]{transform:rotate(180deg)}.sm-gnode__favorite[_ngcontent-%COMP%]{position:absolute;top:-3px;right:0;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;color:var(--sm-text-muted);border-radius:var(--sm-radius-md);flex:none;transition:background .12s ease,color .12s ease}.sm-gnode__favorite[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.8rem;line-height:1}.sm-gnode__favorite[_ngcontent-%COMP%]:hover{background:var(--sm-bg-hover);color:var(--p-text-color)}.sm-gnode__favorite--on[_ngcontent-%COMP%], .sm-gnode__favorite--on[_ngcontent-%COMP%]:hover{color:var(--p-primary-color)}.sm-gnode__sub[_ngcontent-%COMP%]{position:relative;grid-column:2 / -1;grid-row:2;display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-family:var(--sm-font-mono);font-size:.6rem;color:var(--sm-text-muted);line-height:1.2;margin-top:.1rem;min-width:0;width:100%;padding-right:28px}.sm-gnode__sub-stat[_ngcontent-%COMP%]{padding:.08rem .35rem;border-radius:var(--sm-radius-sm);background:var(--sm-bg-hover);font-family:var(--sm-font-mono);font-size:.6rem;color:var(--sm-text-muted);font-weight:400;flex:none}.sm-gnode__sub-stat[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.15rem}.sm-gnode__sub-stat[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.65rem}.sm-gnode__sub-key[_ngcontent-%COMP%]{font-weight:700}.sm-gnode__sub-stat--tokens[_ngcontent-%COMP%]{background:var(--sm-stat-tokens-bg)}.sm-gnode__sub-stat--bytes[_ngcontent-%COMP%]{background:var(--sm-stat-bytes-bg)}.sm-gnode__provider[_ngcontent-%COMP%]{padding:.08rem .4rem;border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.6rem;font-weight:600;letter-spacing:.02em;color:var(--provider-color);background:color-mix(in srgb,var(--provider-color) 14%,transparent);flex:none;display:inline-flex;align-items:center}.app-dark[_nghost-%COMP%] .sm-gnode__provider[_ngcontent-%COMP%], .app-dark [_nghost-%COMP%] .sm-gnode__provider[_ngcontent-%COMP%]{color:var(--provider-color-dark);background:color-mix(in srgb,var(--provider-color-dark) 24%,transparent)}.sm-gnode__panel[_ngcontent-%COMP%]{display:none;border-top:1px solid var(--sm-border)}.sm-gnode--expanded[_nghost-%COMP%] .sm-gnode__panel[_ngcontent-%COMP%]{display:block}.sm-gnode__llm[_ngcontent-%COMP%]{padding:.5rem .7rem;display:flex;flex-direction:column;gap:.25rem;font-size:.75rem;line-height:1.4}.sm-gnode__llm-line[_ngcontent-%COMP%]{display:flex;gap:.4rem;align-items:baseline;color:var(--p-text-color);font-style:italic;min-width:0}.sm-gnode__llm-label[_ngcontent-%COMP%]{flex:none;font-style:normal;color:var(--sm-text-muted);font-size:.6rem;letter-spacing:.04em;text-transform:uppercase;font-weight:600;min-width:2.2rem;padding-top:.2rem;cursor:help}.sm-gnode__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.25rem;flex:1;min-width:0}.sm-gnode__chip[_ngcontent-%COMP%]{font-size:.65rem;padding:.1rem .4rem;border-radius:var(--sm-radius-sm);border:1px solid var(--sm-border);background:var(--sm-bg-hover);color:var(--p-text-color);line-height:1.3}.sm-gnode__chip--mono[_ngcontent-%COMP%]{font-family:var(--sm-font-mono)}.sm-gnode__chip--allowed[_ngcontent-%COMP%]{border-style:dashed;background:transparent;color:var(--sm-text-muted)}.sm-gnode__chip--llm[_ngcontent-%COMP%]{font-style:italic}.sm-gnode__chip-required[_ngcontent-%COMP%]{color:var(--sm-severity-error);margin-left:2px}.sm-gnode__llm-code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);background:var(--sm-bg-hover);padding:.1rem .4rem;border-radius:var(--sm-radius-sm);font-size:.7rem;font-style:normal;color:var(--p-text-color)}.sm-gnode__path[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.35rem;padding:.4rem .7rem;font-family:var(--sm-font-mono);font-size:.68rem;color:var(--sm-text-muted);background:var(--sm-bg-hover);border-top:1px solid var(--sm-border);min-width:0}.sm-gnode__path-icon[_ngcontent-%COMP%]{flex:none;font-size:.7rem;color:var(--sm-text-muted)}.sm-gnode__path-value[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;unicode-bidi:plaintext;text-align:left}.sm-gnode__desc[_ngcontent-%COMP%]{padding:.55rem .7rem;font-size:.78rem;line-height:1.45;color:var(--p-text-color);max-height:140px;overflow-y:auto;overscroll-behavior:contain;border-top:1px solid var(--sm-border);scrollbar-width:thin;scrollbar-color:var(--sm-border) transparent}.sm-gnode__desc[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.sm-gnode__desc[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.sm-gnode__desc[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--sm-border);border-radius:var(--sm-radius-sm)}.sm-gnode__meta[_ngcontent-%COMP%]{padding:.5rem .7rem;border-top:1px solid var(--sm-border);display:flex;flex-direction:column;gap:.35rem}.sm-gnode__meta-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;font-size:.7rem;min-width:0}.sm-gnode__meta-label[_ngcontent-%COMP%]{color:var(--sm-text-muted);text-transform:uppercase;letter-spacing:.04em;font-weight:600;font-size:.6rem;flex:none;min-width:60px;padding-top:.15rem}.sm-gnode__meta-value[_ngcontent-%COMP%]{color:var(--p-text-color);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sm-gnode__meta-value--mono[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);background:var(--sm-bg-hover);padding:.08rem .4rem;border-radius:var(--sm-radius-sm);font-size:.68rem}.sm-gnode__footer[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.7rem;min-height:1.4rem;padding:.4rem .7rem;border-top:1px solid var(--sm-border);background:var(--sm-bg-hover);font-size:.7rem;color:var(--sm-text-muted)}.sm-gnode__footer-right-cluster[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.7rem;margin-left:auto}.sm-gnode__stat[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;line-height:1}.sm-gnode__stat[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.6rem;line-height:1;display:block}.sm-gnode__stat[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{transform:translateY(1px)}.sm-gnode__stat-num[_ngcontent-%COMP%]{font-weight:600;color:var(--p-text-color);line-height:1;display:block}.sm-gnode__stat--error[_ngcontent-%COMP%]{background:var(--sm-severity-error-bg);color:var(--sm-severity-error);padding:.1rem .4rem;border-radius:var(--sm-radius-sm)}.sm-gnode__stat--error[_ngcontent-%COMP%] .sm-gnode__stat-num[_ngcontent-%COMP%]{color:var(--sm-severity-error)}.sm-gnode__stat--warn[_ngcontent-%COMP%]{background:var(--sm-severity-warn-bg);color:var(--sm-severity-warn);padding:.1rem .4rem;border-radius:var(--sm-radius-sm)}.sm-gnode__stat--warn[_ngcontent-%COMP%] .sm-gnode__stat-num[_ngcontent-%COMP%], .sm-gnode__stat--stale[_ngcontent-%COMP%]{color:var(--sm-severity-warn)}.sm-gnode__tagrow[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;padding:0 .65rem .35rem}.sm-gnode__tag-chip[_ngcontent-%COMP%]{font-size:.6rem;font-family:var(--sm-font-mono);padding:.05rem .35rem;border-radius:var(--sm-radius-sm);background:var(--sm-bg-hover);color:var(--sm-text-muted);border:1px solid var(--sm-border);line-height:1.4}.sm-gnode__tag-chip--author[_ngcontent-%COMP%]{background:transparent;border-color:var(--accent);color:var(--accent)}.sm-gnode__tag-more[_ngcontent-%COMP%]{font-size:.6rem;color:var(--sm-text-muted);font-style:italic}'],changeDetection:0})};var cM={a11y:{expand:"Expand performance HUD",collapse:"Collapse performance HUD"},units:{fps:t=>`${t} fps`,ms:t=>`${t}ms`,mb:t=>`${t} MB`,longTasks:t=>`${t} long`,domNodes:t=>`${t} dom`,nodes:(t,n)=>`${t}/${n} nodes`,links:t=>`${t} links`}};var JY=["sparkline"],eX=()=>({class:"perf-hud__content"}),tX=t=>({content:t});function nX(t,n){if(t&1&&(f(0,"span",9),v(1),h()),t&2){let e=m(2);d(),C(e.texts.units.mb(e.heapMb()))}}function iX(t,n){if(t&1&&(f(0,"div",3)(1,"span",4),v(2),h()(),f(3,"div",5)(4,"div",6)(5,"div",7),O(6,"canvas",8,1),f(8,"span",9),v(9),h()(),f(10,"div",10)(11,"div",11),I(12,nX,2,1,"span",9),f(13,"span",9),v(14),h(),f(15,"span",9),v(16),h()()(),f(17,"div",10)(18,"div",11)(19,"span",9),v(20),h(),f(21,"span",9),v(22),h()()()()()),t&2){let e=m();d(2),C(e.texts.units.fps(e.fps())),d(),q("aria-hidden",!e.expanded()),d(6),C(e.texts.units.ms(e.frameTimeMs())),d(3),T(e.hasHeap()?12:-1),d(2),C(e.texts.units.domNodes(e.domNodes())),d(2),C(e.texts.units.longTasks(e.longTasks())),d(4),C(e.texts.units.nodes(e.visible(),e.total())),d(2),C(e.texts.units.links(e.edges()))}}var oX=30,i_=60,hf=14,mf=class t{visible=N(0);total=N(0);edges=N(0);texts=cM;destroyRef=l(ot);zone=l(Un);fps=U(0);frameTimeMs=U(0);fpsSamples=U([]);sparklineCanvas=Re("sparkline");heapMb=U(null);longTasks=U(0);domNodes=U(0);expanded=U(rX());hasHeap=S(()=>this.heapMb()!==null);constructor(){let n=0,e=0,i=performance.now(),o=i,r=0,a=c=>{let u=c-i;if(i=c,n+=1,e+=u,c-o>=1e3){let p=(c-o)/1e3,g=Math.round(n/p);this.fps.set(g),this.frameTimeMs.set(Math.round(e/Math.max(n,1))),this.heapMb.set(sX()),this.domNodes.set(document.querySelectorAll("*").length),this.fpsSamples.update(b=>{let M=b.length>=oX?b.slice(1):b.slice();return M.push(g),M}),n=0,e=0,o=c}r=requestAnimationFrame(a)};this.zone.runOutsideAngular(()=>{r=requestAnimationFrame(a)});let s=null;if(typeof PerformanceObserver<"u")try{s=new PerformanceObserver(c=>{this.longTasks.update(u=>u+c.getEntries().length)}),s.observe({type:"longtask",buffered:!0})}catch{}this.destroyRef.onDestroy(()=>{cancelAnimationFrame(r),s?.disconnect()}),ie(()=>{let c=this.sparklineCanvas(),u=this.fpsSamples();c&&cX(c.nativeElement,u)})}setExpanded(n){this.expanded.set(n),aX(n)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-perf-hud"]],viewQuery:function(e,i){e&1&&Tt(i.sparklineCanvas,JY,5),e&2&<()},inputs:{visible:[1,"visible"],total:[1,"total"],edges:[1,"edges"]},decls:3,vars:7,consts:[["content",""],["sparkline",""],["data-testid","perf-hud",3,"ngModelChange","ngModel","ariaLabel","styleClass","pt"],[1,"perf-hud__header"],[1,"perf-hud__cell","perf-hud__cell--fps"],[1,"perf-hud__expandable"],[1,"perf-hud__expandable-inner"],[1,"perf-hud__row","perf-hud__row--sparkline"],["aria-hidden","true",1,"perf-hud__sparkline"],[1,"perf-hud__cell"],[1,"perf-hud__section"],[1,"perf-hud__row"]],template:function(e,i){e&1&&(f(0,"p-togglebutton",2),V("ngModelChange",function(r){return i.setExpanded(r)}),be(1,iX,23,8,"ng-template",null,0,Nt),h()),e&2&&E("ngModel",i.expanded())("ariaLabel",i.expanded()?i.texts.a11y.collapse:i.texts.a11y.expand)("styleClass",i.expanded()?"perf-hud perf-hud--expanded":"perf-hud")("pt",yt(5,tX,Ot(4,eX)))},dependencies:[gn,hn,mn,vn,_n],styles:["[_nghost-%COMP%]{position:absolute;bottom:16px;left:16px;z-index:2;pointer-events:none}.perf-hud[_ngcontent-%COMP%]{pointer-events:auto;--p-togglebutton-padding: 0;--p-togglebutton-content-padding: .25rem .7rem;--p-togglebutton-border-radius: var(--sm-radius-pill);--p-togglebutton-content-border-radius: var(--sm-radius-pill);--p-togglebutton-gap: .4rem;--p-togglebutton-background: var(--sm-bg-content);--p-togglebutton-checked-background: var(--sm-bg-content);--p-togglebutton-hover-background: var(--sm-bg-content);--p-togglebutton-border-color: var(--sm-border);--p-togglebutton-checked-border-color: var(--sm-border);--p-togglebutton-content-checked-background: transparent;--p-togglebutton-color: var(--p-text-muted-color);--p-togglebutton-hover-color: var(--p-text-color);--p-togglebutton-checked-color: var(--p-text-muted-color);box-shadow:var(--sm-shadow-floating);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.7rem;font-weight:500;line-height:14px;opacity:.75;transition:opacity .15s ease,color .15s ease}.perf-hud[_ngcontent-%COMP%]:hover{opacity:1}.perf-hud--expanded[_ngcontent-%COMP%]{--p-togglebutton-border-radius: var(--sm-radius-md);--p-togglebutton-content-border-radius: var(--sm-radius-md);--p-togglebutton-content-padding: .45rem .7rem;line-height:1.35;opacity:.95}[_nghost-%COMP%] .perf-hud__content{display:flex;flex-direction:column;align-items:stretch;gap:0}.perf-hud__cell[_ngcontent-%COMP%]{white-space:nowrap;font-variant-numeric:tabular-nums}.perf-hud--expanded[_ngcontent-%COMP%] .perf-hud__cell--fps[_ngcontent-%COMP%]{font-weight:600;color:var(--p-text-color)}.perf-hud__sparkline[_ngcontent-%COMP%]{width:60px;height:14px;opacity:.6}.perf-hud__header[_ngcontent-%COMP%]{display:flex;align-items:center}.perf-hud__expandable[_ngcontent-%COMP%]{display:grid;grid-template-rows:0fr;grid-template-columns:0fr;overflow:hidden;transition:grid-template-rows .22s ease,grid-template-columns .22s ease}.perf-hud--expanded[_ngcontent-%COMP%] .perf-hud__expandable[_ngcontent-%COMP%]{grid-template-rows:1fr;grid-template-columns:1fr}.perf-hud__expandable-inner[_ngcontent-%COMP%]{min-height:0;min-width:0;overflow:hidden;display:flex;flex-direction:column;gap:.3rem;padding-top:0;transition:padding-top .22s ease}.perf-hud--expanded[_ngcontent-%COMP%] .perf-hud__expandable-inner[_ngcontent-%COMP%]{padding-top:.3rem}.perf-hud__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.15rem;padding-top:.3rem;border-top:1px solid var(--sm-border)}.perf-hud__section[_ngcontent-%COMP%]:first-child{padding-top:0;border-top:0}.perf-hud__row[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.6rem;white-space:nowrap}.perf-hud__row--sparkline[_ngcontent-%COMP%]{justify-content:space-between;gap:.6rem}"],changeDetection:0})},dM="sm.perf-hud.expanded";function rX(){try{return localStorage.getItem(dM)==="1"}catch{return!1}}function aX(t){try{localStorage.setItem(dM,t?"1":"0")}catch{}}function sX(){let t=performance.memory;return t?Math.round(t.usedJSHeapSize/1024/1024):null}function cX(t,n){let e=window.devicePixelRatio||1,i=i_*e,o=hf*e;(t.width!==i||t.height!==o)&&(t.width=i,t.height=o);let r=t.getContext("2d");if(!r||(r.setTransform(e,0,0,e,0,0),r.clearRect(0,0,i_,hf),n.length<2))return;let a=Math.max(60,...n),s=i_/(n.length-1);r.beginPath();for(let c=0;c<n.length;c+=1){let u=c*s,p=hf-n[c]/a*hf;c===0?r.moveTo(u,p):r.lineTo(u,p)}r.strokeStyle=getComputedStyle(t).color,r.lineWidth=1,r.stroke()}var dX="debug-perf",gf=class t{visible=U(this.resolveInitial());resolveInitial(){let e=new URLSearchParams(window.location.search).get(dX);return e==="1"||e==="true"?!0:e==="0"||e==="false"?!1:fo.graph.perfHud}static \u0275fac=function(e){return new(e||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})};var Gn={emptyNoSelection:{title:"No node selected",descPrefix:"Pick a node from the ",listLink:"list",descMiddle:" or ",graphLink:"graph",descSuffix:"."},emptyNotFound:{title:"Node not found",descSuffix:" does not exist in the collection. ",backLink:"Back to list",descAfterLink:"."},backToList:"\u2190 back to list",sections:{annotations:"Annotations",connections:"Connections",findings:"Findings",audit:"Audit",plugins:"Plugin contributions",viewContributions:"View contributions",debug:"Debug",body:"Body"},body:{loading:"Loading body\u2026",empty:"This file has no body content (only frontmatter).",unavailable:"Body content unavailable. The source file may have moved or been deleted since the last scan.",renderError:"Failed to render markdown body.",refreshLabel:"Refresh body"},bump:{label:"Bump version",tooltipEnabled:"Increment the sidecar version and refresh hashes.",tooltipDisabledFresh:"No drift detected (bump is only available when the body or frontmatter has changed since the last bump).",errorPrefix:"Bump failed:",errorFresh:"This node is fresh; nothing to bump.",errorNotFound:"Node not found on the server.",errorGeneric:"Could not bump the sidecar.",consentHeader:"Save extra info alongside your files?",consentMessage:`Skill-map can keep a small companion file (*.sm) next to each of your markdown files. It tracks version, history and tags so you can see how each one evolves over time.
|
|
277
|
+
|
|
278
|
+
We use a separate \`.sm\` file so your markdown stays clean, no metadata gets mixed into the content you wrote.
|
|
279
|
+
|
|
280
|
+
Your preference stays on your computer, it does not travel with the project, and we won't ask again.`,consentAccept:"Yes, allow",consentReject:"Not now",consentDialogAriaLabel:"Sidecar consent"},stats:{bytes:"bytes",tokens:"tokens",out:"out",in:"in",ext:"external"},findingHintLabel:"Hint:",bumpErrorDismissAriaLabel:"Dismiss",audit:{headerSummary:(t,n)=>`last bumped ${t} by ${n}`,headerEmpty:"never bumped",fields:{lastBumpedAt:"Last bumped",lastBumpedBy:"by",createdAt:"Created",createdBy:"by"}},supersededByBanner:t=>`Superseded by ${t}`,debugToggleAriaLabel:"Toggle debug panel",debugToggleTooltip:"Show diagnostic fields (hash diffs, resolved provider/kind, sidecar status enum).",actionMocks:{label:"Actions",summary:"Generate summary",audit:"Run audit",validate:"Validate"},close:{label:"Close",tooltip:"Close inspector"}};var _f=class t{dataSource=l(pn);async bump(n,e={}){return this.dataSource.bumpSidecar(n,e)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})};var lM={cardHeader:"Annotations",emptyOverlay:"No sidecar (.sm) file present for this node.",emptyAnnotations:"Sidecar present but no annotations are declared yet.",sections:{lifecycle:"Lifecycle",supersession:"Supersession",provenance:"Provenance",taxonomy:"Taxonomy",docs:"Docs"},fields:{version:"Version",stability:"Stability",supersedes:"Supersedes",supersededBy:"Superseded by",authors:"Authors",license:"License",source:"Source",sourceVersion:"Source version",tags:"Tags",docsUrl:"Docs URL"},brokenRefTooltip:"This path does not resolve to a node in the current scan scope."};function Vr(t){if(typeof t!="string"||t.length===0)return null;try{let n=new URL(t);return n.protocol==="http:"||n.protocol==="https:"?t:null}catch{return null}}var pX=(t,n)=>"a:"+n,fX=(t,n)=>"u:"+n;function hX(t,n){if(t&1&&(f(0,"p",1),v(1),h()),t&2){let e=m(2);d(),C(e.texts.emptyOverlay)}}function mX(t,n){if(t&1&&(f(0,"p",2),v(1),h()),t&2){let e=m(2);d(),C(e.texts.emptyAnnotations)}}function gX(t,n){if(t&1&&I(0,hX,2,1,"p",1)(1,mX,2,1,"p",2),t&2){let e,i=m();T((e=i.overlay())!=null&&e.present?1:0)}}function _X(t,n){if(t&1&&(f(0,"code",4),v(1),h()),t&2){m();let e=ee(0);d(),Fe("v",e.version)}}function vX(t,n){if(t&1&&O(0,"p-tag",5),t&2){m();let e=ee(0),i=m(2);E("value",e.stability)("severity",i.stabilitySeverity(e.stability))("rounded",!0)}}function yX(t,n){if(t&1&&(ut(0),f(1,"dt"),v(2),h(),f(3,"dd",3),I(4,_X,2,1,"code",4),I(5,vX,1,3,"p-tag",5),h()),t&2){let e=m(2),i=Ke(e.lifecycle());d(2),C(e.texts.sections.lifecycle),d(2),T(i.version!==null?4:-1),d(),T(i.stability!==null?5:-1)}}function CX(t,n){if(t&1){let e=re();f(0,"span",7),O(1,"i",8),f(2,"span"),v(3),h()(),f(4,"p-chip",9),V("click",function(){L(e),m();let o=ee(0),r=m(2);return B(r.onOpenPath(o.supersededBy))}),h()}if(t&2){m();let e=ee(0),i=m(2);d(3),C(i.texts.fields.supersededBy),d(),E("label",e.supersededBy)("styleClass",i.isBroken(e.supersededBy)?"chip--broken":"chip--link")("pTooltip",i.isBroken(e.supersededBy)?i.texts.brokenRefTooltip:"")}}function bX(t,n){if(t&1){let e=re();f(0,"p-chip",9),V("click",function(){let o=L(e).$implicit,r=m(4);return B(r.onOpenPath(o))}),h()}if(t&2){let e=n.$implicit,i=m(4);E("label",e)("styleClass",i.isBroken(e)?"chip--broken":"chip--link")("pTooltip",i.isBroken(e)?i.texts.brokenRefTooltip:"")}}function xX(t,n){if(t&1&&(f(0,"span",7),O(1,"i",10),f(2,"span"),v(3),h()(),Y(4,bX,1,3,"p-chip",11,xe)),t&2){m();let e=ee(0),i=m(2);d(3),C(i.texts.fields.supersedes),d(),X(e.supersedes)}}function wX(t,n){if(t&1&&(ut(0),f(1,"dt"),v(2),h(),f(3,"dd",6),I(4,CX,5,4),I(5,xX,6,1),h()),t&2){let e=m(2),i=Ke(e.supersession());d(2),C(e.texts.sections.supersession),d(2),T(i.supersededBy!==null?4:-1),d(),T(i.supersedes.length?5:-1)}}function SX(t,n){if(t&1&&(f(0,"span",7),O(1,"i",13),f(2,"span"),v(3),h()()),t&2){let e=n.$implicit;d(3),C(e)}}function IX(t,n){if(t&1&&Y(0,SX,4,1,"span",7,xe),t&2){m();let e=ee(0);X(e.authors)}}function TX(t,n){if(t&1&&(f(0,"span",7),O(1,"i",14),f(2,"span"),v(3),h()()),t&2){m();let e=ee(0);d(3),C(e.license)}}function EX(t,n){if(t&1&&(f(0,"span",7),O(1,"i",15),f(2,"a",16),v(3),h()()),t&2){m();let e=ee(0);d(2),E("href",e.source,Co),d(),C(e.source)}}function PX(t,n){if(t&1&&(f(0,"span",7),O(1,"i",17),f(2,"code"),v(3),h()()),t&2){m();let e=ee(0);d(3),C(e.sourceVersion)}}function MX(t,n){if(t&1&&(ut(0),f(1,"dt"),v(2),h(),f(3,"dd",12),I(4,IX,2,0),I(5,TX,4,1,"span",7),I(6,EX,4,2,"span",7),I(7,PX,4,1,"span",7),h()),t&2){let e=m(2),i=Ke(e.provenance());d(2),C(e.texts.sections.provenance),d(2),T(i.authors.length?4:-1),d(),T(i.license!==null?5:-1),d(),T(i.source!==null?6:-1),d(),T(i.sourceVersion!==null?7:-1)}}function kX(t,n){if(t&1){let e=re();f(0,"p-chip",22),V("click",function(){let o=L(e).$implicit,r=m(3);return B(r.tagClick.emit(o))})("keydown.enter",function(){let o=L(e).$implicit,r=m(3);return B(r.tagClick.emit(o))})("keydown.space",function(o){let r=L(e).$implicit;return m(3).tagClick.emit(r),B(o.preventDefault())}),h()}if(t&2){let e=n.$implicit,i=m(3);E("label",e)("styleClass","ann-panel__chip ann-panel__chip--author"+(i.isActiveTag(e)?" ann-panel__chip--active":""))}}function DX(t,n){if(t&1){let e=re();f(0,"p-chip",23),V("click",function(){let o=L(e).$implicit,r=m(3);return B(r.tagClick.emit(o))})("keydown.enter",function(){let o=L(e).$implicit,r=m(3);return B(r.tagClick.emit(o))})("keydown.space",function(o){let r=L(e).$implicit;return m(3).tagClick.emit(r),B(o.preventDefault())}),h()}if(t&2){let e=n.$implicit,i=m(3);E("label",e)("styleClass","ann-panel__chip ann-panel__chip--user"+(i.isActiveTag(e)?" ann-panel__chip--active":""))}}function OX(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",18)(3,"div",19),Y(4,kX,1,2,"p-chip",20,pX),Y(6,DX,1,2,"p-chip",21,fX),h()()),t&2){let e=m(2),i=e.taxonomy();d(),C(e.texts.fields.tags),d(3),X(i.authorTags),d(2),X(i.userTags)}}function NX(t,n){if(t&1&&(f(0,"span",7),O(1,"i",25),f(2,"a",16),v(3),h()()),t&2){m();let e=ee(0);d(2),E("href",e.docsUrl,Co),d(),C(e.docsUrl)}}function RX(t,n){if(t&1&&(ut(0),f(1,"dt"),v(2),h(),f(3,"dd",24),I(4,NX,4,2,"span",7),h()),t&2){let e=m(2),i=Ke(e.docs());d(2),C(e.texts.sections.docs),d(2),T(i.docsUrl!==null?4:-1)}}function AX(t,n){if(t&1&&(f(0,"dl",0),I(1,yX,6,4),I(2,wX,6,4),I(3,MX,8,6),I(4,OX,8,1),I(5,RX,5,3),h()),t&2){let e=m();d(),T(e.hasLifecycle()?1:-1),d(),T(e.hasSupersession()?2:-1),d(),T(e.hasProvenance()?3:-1),d(),T(e.hasTaxonomy()?4:-1),d(),T(e.hasDocs()?5:-1)}}var yf=class t{overlay=N(void 0);authorTags=N([]);knownPaths=N(null);openPath=Le();tagClick=Le();activeTag=N(null);isActiveTag(n){return this.activeTag()===n}texts=lM;annotations=S(()=>{let n=this.overlay();return!n||!n.present?null:n.annotations??null});hasAnnotations=S(()=>{let n=this.annotations();return n!==null&&Object.keys(n).length>0});hasAnyContent=S(()=>this.hasLifecycle()||this.hasSupersession()||this.hasProvenance()||this.hasTaxonomy()||this.hasDocs());lifecycle=S(()=>{let n=this.annotations()??{};return{version:FX(n.version),stability:LX(n.stability)}});hasLifecycle=S(()=>vf(this.lifecycle()));supersession=S(()=>{let n=this.annotations()??{};return{supersedes:r_(n.supersedes),supersededBy:o_(n.supersededBy)}});hasSupersession=S(()=>vf(this.supersession()));provenance=S(()=>{let n=this.annotations()??{};return{authors:r_(n.authors),license:o_(n.license),source:Vr(n.source),sourceVersion:o_(n.sourceVersion)}});hasProvenance=S(()=>vf(this.provenance()));taxonomy=S(()=>{let n=this.annotations()??{};return{authorTags:this.authorTags(),userTags:r_(n.tags)}});hasTaxonomy=S(()=>{let n=this.taxonomy();return n.authorTags.length>0||n.userTags.length>0});docs=S(()=>{let n=this.annotations()??{};return{docsUrl:Vr(n.docsUrl)}});hasDocs=S(()=>vf(this.docs()));stabilitySeverity(n){return o0[n]}isBroken(n){let e=this.knownPaths();return e?!e.has(n):!1}onOpenPath(n){this.isBroken(n)||this.openPath.emit(n)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-annotations-panel"]],inputs:{overlay:[1,"overlay"],authorTags:[1,"authorTags"],knownPaths:[1,"knownPaths"],activeTag:[1,"activeTag"]},outputs:{openPath:"openPath",tagClick:"tagClick"},decls:2,vars:1,consts:[[1,"ann-panel__rows","sm-section__kv"],["data-testid","annotations-panel-empty-overlay",1,"ann-panel__empty"],["data-testid","annotations-panel-empty-annotations",1,"ann-panel__empty"],["data-testid","annotations-section-lifecycle",1,"ann-panel__inline"],["data-testid","annotations-version"],["data-testid","annotations-stability",3,"value","severity","rounded"],["data-testid","annotations-section-supersession",1,"ann-panel__inline"],[1,"ann-panel__meta"],["aria-hidden","true",1,"pi","pi-arrow-down"],[3,"click","label","styleClass","pTooltip"],["aria-hidden","true",1,"pi","pi-arrow-up"],[3,"label","styleClass","pTooltip"],["data-testid","annotations-section-provenance",1,"ann-panel__inline"],["aria-hidden","true",1,"pi","pi-user"],["aria-hidden","true",1,"pi","pi-shield"],["aria-hidden","true",1,"pi","pi-link"],["target","_blank","rel","noopener noreferrer",3,"href"],["aria-hidden","true",1,"pi","pi-tag"],["data-testid","annotations-section-taxonomy",1,"ann-panel__chips"],["data-testid","annotations-tags",1,"ann-panel__chips-row"],["data-tag-source","author","role","button","tabindex","0",3,"label","styleClass"],["data-tag-source","user","role","button","tabindex","0",3,"label","styleClass"],["data-tag-source","author","role","button","tabindex","0",3,"click","keydown.enter","keydown.space","label","styleClass"],["data-tag-source","user","role","button","tabindex","0",3,"click","keydown.enter","keydown.space","label","styleClass"],["data-testid","annotations-section-docs",1,"ann-panel__inline"],["aria-hidden","true",1,"pi","pi-external-link"]],template:function(e,i){e&1&&I(0,gX,2,1)(1,AX,6,5,"dl",0),e&2&&T(i.hasAnyContent()?1:0)},dependencies:[ki,ma,_a,ga,De,Be],styles:["[_nghost-%COMP%]{display:block}.ann-panel__empty[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-style:italic;font-size:.85rem;margin:0}.ann-panel__rows[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{display:flex;align-items:center}.ann-panel__inline[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem .65rem;row-gap:.35rem}.ann-panel__meta[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;font-size:.83rem;color:var(--p-text-color)}.ann-panel__meta[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{color:var(--p-text-muted-color);font-size:.85rem}.ann-panel__meta[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--p-primary-color);word-break:break-all}.ann-panel__meta[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-bg-hover);padding:.05rem .35rem;border-radius:var(--sm-radius-sm);font-size:.78rem}.ann-panel__chips[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap}.ann-panel__chips-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.3rem}[_nghost-%COMP%] .chip--broken{background:var(--sm-bg-hover);color:var(--sm-text-muted);text-decoration:line-through;cursor:not-allowed}[_nghost-%COMP%] .chip--link{cursor:pointer;background:var(--p-primary-50);color:var(--p-primary-color);transition:background .15s ease}[_nghost-%COMP%] .chip--link:hover{background:var(--p-primary-100)}[_nghost-%COMP%] .ann-panel__chip--author{background:transparent;border:1px solid var(--p-primary-color);color:var(--p-primary-color)}[_nghost-%COMP%] .ann-panel__chip--user{background:var(--p-chip-background);color:var(--p-chip-color)}[_nghost-%COMP%] .ann-panel__chip--author, [_nghost-%COMP%] .ann-panel__chip--user{cursor:pointer;transition:filter .1s ease,box-shadow .1s ease}[_nghost-%COMP%] .ann-panel__chip--author:hover, [_nghost-%COMP%] .ann-panel__chip--user:hover{filter:brightness(1.05)}[_nghost-%COMP%] .ann-panel__chip--author:focus-visible, [_nghost-%COMP%] .ann-panel__chip--user:focus-visible{outline:2px solid var(--p-primary-color);outline-offset:1px}[_nghost-%COMP%] .ann-panel__chip--active{background:var(--p-primary-color);color:var(--p-primary-color-text);border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color-200)}"],changeDetection:0})};function FX(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function o_(t){return typeof t=="string"&&t.length>0?t:null}function LX(t){return t==="stable"||t==="experimental"||t==="deprecated"?t:null}function r_(t){return Array.isArray(t)?t.filter(n=>typeof n=="string"&&n.length>0):[]}function vf(t){for(let n of Object.values(t))if(n!=null){if(Array.isArray(n)){if(n.length>0)return!0;continue}if(typeof n=="string"){if(n.length>0)return!0;continue}return!0}return!1}var uM=`
|
|
281
|
+
.p-card {
|
|
282
|
+
background: dt('card.background');
|
|
283
|
+
color: dt('card.color');
|
|
284
|
+
box-shadow: dt('card.shadow');
|
|
285
|
+
border-radius: dt('card.border.radius');
|
|
286
|
+
display: flex;
|
|
287
|
+
flex-direction: column;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.p-card-caption {
|
|
291
|
+
display: flex;
|
|
292
|
+
flex-direction: column;
|
|
293
|
+
gap: dt('card.caption.gap');
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.p-card-body {
|
|
297
|
+
padding: dt('card.body.padding');
|
|
298
|
+
display: flex;
|
|
299
|
+
flex-direction: column;
|
|
300
|
+
gap: dt('card.body.gap');
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.p-card-title {
|
|
304
|
+
font-size: dt('card.title.font.size');
|
|
305
|
+
font-weight: dt('card.title.font.weight');
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.p-card-subtitle {
|
|
309
|
+
color: dt('card.subtitle.color');
|
|
310
|
+
}
|
|
311
|
+
`;var BX=["header"],zX=["title"],qX=["subtitle"],VX=["content"],GX=["footer"],HX=["*",[["p-header"]],[["p-footer"]]],jX=["*","p-header","p-footer"];function UX(t,n){t&1&&Ii(0)}function WX(t,n){if(t&1&&(f(0,"div",1),ke(1,1),be(2,UX,1,0,"ng-container",2),h()),t&2){let e=m();Ne(e.cx("header")),E("pBind",e.ptm("header")),d(2),E("ngTemplateOutlet",e.headerTemplate||e._headerTemplate)}}function $X(t,n){if(t&1&&(Wn(0),v(1),$n()),t&2){let e=m(2);d(),C(e.header)}}function KX(t,n){t&1&&Ii(0)}function YX(t,n){if(t&1&&(f(0,"div",1),be(1,$X,2,1,"ng-container",3)(2,KX,1,0,"ng-container",2),h()),t&2){let e=m();Ne(e.cx("title")),E("pBind",e.ptm("title")),d(),E("ngIf",e.header&&!e._titleTemplate&&!e.titleTemplate),d(),E("ngTemplateOutlet",e.titleTemplate||e._titleTemplate)}}function XX(t,n){if(t&1&&(Wn(0),v(1),$n()),t&2){let e=m(2);d(),C(e.subheader)}}function ZX(t,n){t&1&&Ii(0)}function QX(t,n){if(t&1&&(f(0,"div",1),be(1,XX,2,1,"ng-container",3)(2,ZX,1,0,"ng-container",2),h()),t&2){let e=m();Ne(e.cx("subtitle")),E("pBind",e.ptm("subtitle")),d(),E("ngIf",e.subheader&&!e._subtitleTemplate&&!e.subtitleTemplate),d(),E("ngTemplateOutlet",e.subtitleTemplate||e._subtitleTemplate)}}function JX(t,n){t&1&&Ii(0)}function eZ(t,n){t&1&&Ii(0)}function tZ(t,n){if(t&1&&(f(0,"div",1),ke(1,2),be(2,eZ,1,0,"ng-container",2),h()),t&2){let e=m();Ne(e.cx("footer")),E("pBind",e.ptm("footer")),d(2),E("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}var nZ=`
|
|
312
|
+
${uM}
|
|
313
|
+
|
|
314
|
+
.p-card {
|
|
315
|
+
display: block;
|
|
316
|
+
}
|
|
317
|
+
`,iZ={root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"},pM=(()=>{class t extends ia{name="card";style=nZ;classes=iZ;static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();var fM=new ue("CARD_INSTANCE"),a_=(()=>{class t extends ra{componentName="Card";$pcCard=l(fM,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=l(At,{self:!0});_componentStyle=l(pM);onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}header;subheader;set style(e){M_(this._style(),e)||(this._style.set(e),this.el?.nativeElement&&e&&Object.keys(e).forEach(i=>{this.el.nativeElement.style[i]=e[i]}))}get style(){return this._style()}styleClass;headerFacet;footerFacet;headerTemplate;titleTemplate;subtitleTemplate;contentTemplate;footerTemplate;_headerTemplate;_titleTemplate;_subtitleTemplate;_contentTemplate;_footerTemplate;_style=U(null);getBlockableElement(){return this.el.nativeElement}templates;onAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"header":this._headerTemplate=e.template;break;case"title":this._titleTemplate=e.template;break;case"subtitle":this._subtitleTemplate=e.template;break;case"content":this._contentTemplate=e.template;break;case"footer":this._footerTemplate=e.template;break;default:this._contentTemplate=e.template;break}})}static \u0275fac=(()=>{let e;return function(o){return(e||(e=J(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["p-card"]],contentQueries:function(i,o,r){if(i&1&&Zr(r,D_,5)(r,O_,5)(r,BX,4)(r,zX,4)(r,qX,4)(r,VX,4)(r,GX,4)(r,Pi,4),i&2){let a;_t(a=vt())&&(o.headerFacet=a.first),_t(a=vt())&&(o.footerFacet=a.first),_t(a=vt())&&(o.headerTemplate=a.first),_t(a=vt())&&(o.titleTemplate=a.first),_t(a=vt())&&(o.subtitleTemplate=a.first),_t(a=vt())&&(o.contentTemplate=a.first),_t(a=vt())&&(o.footerTemplate=a.first),_t(a=vt())&&(o.templates=a)}},hostVars:4,hostBindings:function(i,o){i&2&&(Qr(o._style()),Ne(o.cn(o.cx("root"),o.styleClass)))},inputs:{header:"header",subheader:"subheader",style:"style",styleClass:"styleClass"},features:[_e([pM,{provide:fM,useExisting:t},{provide:oa,useExisting:t}]),Kr([At]),he],ngContentSelectors:jX,decls:8,vars:11,consts:[[3,"pBind","class",4,"ngIf"],[3,"pBind"],[4,"ngTemplateOutlet"],[4,"ngIf"]],template:function(i,o){i&1&&(Yt(HX),be(0,WX,3,4,"div",0),f(1,"div",1),be(2,YX,3,5,"div",0)(3,QX,3,5,"div",0),f(4,"div",1),ke(5),be(6,JX,1,0,"ng-container",2),h(),be(7,tZ,3,4,"div",0),h()),i&2&&(E("ngIf",o.headerFacet||o.headerTemplate||o._headerTemplate),d(),Ne(o.cx("body")),E("pBind",o.ptm("body")),d(),E("ngIf",o.header||o.titleTemplate||o._titleTemplate),d(),E("ngIf",o.subheader||o.subtitleTemplate||o._subtitleTemplate),d(),Ne(o.cx("content")),E("pBind",o.ptm("content")),d(2),E("ngTemplateOutlet",o.contentTemplate||o._contentTemplate),d(),E("ngIf",o.footerFacet||o.footerTemplate||o._footerTemplate))},dependencies:[Ti,C_,ea,dn,aa,At],encapsulation:2,changeDetection:0})}return t})(),hM=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=wi({type:t});static \u0275inj=Ci({imports:[a_,dn,aa,dn,aa]})}return t})();var mM={cardHeader:"Linked nodes",refreshLabel:"Refresh links",outgoingHeader:"Outgoing",incomingHeader:"Incoming",findingsHeader:"Findings",emptyFindings:"No findings on this node.",loading:"Loading links\u2026",error:"Failed to load links.",emptyOutgoing:"No outgoing links from this node.",emptyIncoming:"No incoming links to this node.",confidence:{high:"high",medium:"medium",low:"low"},sourcesPrefix:"detected by ",sourcesSeparator:", ",issueOnTargetTooltip:"Target has an issue: ",issueOnSourceTooltip:"Source has an issue: ",occurrencesHeader:"Occurs at:",occurrencesItem:"line {{line}} \xB7 `{{trigger}}` ({{extractor}})",occurrencesItemUnknownLine:"`{{trigger}}` ({{extractor}})",externalRefsHeader:"External references",emptyExternalRefs:"No external URLs in this node's body.",externalRefsItemLine:"line {{line}}",externalRefsItemUnknownLine:"unknown line"};var rZ=(t,n)=>n.url+"|"+(n.line??-1),aZ=(t,n)=>n.analyzerId+"|"+((n.data==null?null:n.data.target)??"")+"|"+n.message,_M=(t,n)=>n.source+"|"+n.target+"|"+n.kind+"|"+((n.trigger==null?null:n.trigger.normalizedTrigger)??""),vM=(t,n)=>n.extractor+"|"+n.originalTrigger+"|"+((n.location==null?null:n.location.line)??-1);function sZ(t,n){if(t&1){let e=re();f(0,"div",4)(1,"h3",5),v(2),h(),f(3,"p-button",6),V("onClick",function(){L(e);let o=m(2);return B(o.refresh())}),h()()}if(t&2){let e=m(2);d(2),C(e.texts.cardHeader),d(),E("rounded",!0)("text",!0)("ariaLabel",e.texts.refreshLabel)("pTooltip",e.texts.refreshLabel)("disabled",e.state()==="loading")}}function cZ(t,n){if(t&1&&(f(0,"p",2),v(1),h()),t&2){let e=m(2);d(),C(e.texts.loading)}}function dZ(t,n){if(t&1&&(f(0,"p",3),v(1),h()),t&2){let e=m(2);d(),C(e.texts.error)}}function lZ(t,n){if(t&1&&v(0),t&2){let e=m().$implicit,i=m(4);Fe(" ",i.texts.externalRefsItemLine.replace("{{line}}",e.line.toString())," ")}}function uZ(t,n){if(t&1&&v(0),t&2){let e=m(5);Fe(" ",e.texts.externalRefsItemUnknownLine," ")}}function pZ(t,n){if(t&1&&(f(0,"li",16)(1,"span",17),I(2,lZ,1,1)(3,uZ,1,1),h(),f(4,"a",18),v(5),h()()),t&2){let e=n.$implicit;q("data-testid","linked-nodes-external-ref-"+e.url),d(2),T(e.line?2:3),d(2),E("href",e.url,Co),d(),C(e.url)}}function fZ(t,n){if(t&1&&(f(0,"section",7)(1,"h4",9),v(2),h(),f(3,"ul",11),Y(4,pZ,6,4,"li",16,rZ),h()()),t&2){let e=m(3);d(2),C(e.texts.externalRefsHeader),d(2),X(e.externalRefs())}}function hZ(t,n){if(t&1&&(f(0,"p",10),v(1),h()),t&2){let e=m(3);d(),C(e.texts.emptyFindings)}}function mZ(t,n){if(t&1&&(f(0,"li",19),O(1,"p-tag",20),f(2,"span",21),v(3),h()()),t&2){let e=n.$implicit,i=m(4);q("data-testid","linked-nodes-finding-"+e.analyzerId),d(),E("value",e.analyzerId)("severity",i.issueSeverity(e.severity))("rounded",!0),d(2),C(e.message)}}function gZ(t,n){if(t&1&&(f(0,"ul",11),Y(1,mZ,4,5,"li",19,aZ),h()),t&2){let e=m(3);d(),X(e.findings())}}function _Z(t,n){if(t&1&&(f(0,"p",13),v(1),h()),t&2){let e=m(3);d(),C(e.texts.emptyOutgoing)}}function vZ(t,n){if(t&1&&O(0,"p-tag",25),t&2){let e=n,i=m().$implicit,o=m(4);E("value",e.analyzerId)("severity",o.issueSeverity(e.severity))("rounded",!0)("pTooltip",e.message),q("data-testid","linked-nodes-outgoing-issue-"+i.target)}}function yZ(t,n){if(t&1&&(f(0,"span",26),v(1),h()),t&2){let e=m().$implicit,i=m(4);d(),bo(" ",i.texts.sourcesPrefix,"",e.sources.join(i.texts.sourcesSeparator)," ")}}function CZ(t,n){if(t&1&&(f(0,"li",29),v(1),h()),t&2){let e=n.$implicit,i=m(6);d(),C(i.occurrenceLabel(e))}}function bZ(t,n){if(t&1&&(f(0,"ul",27)(1,"li",28),v(2),h(),Y(3,CZ,2,1,"li",29,vM),h()),t&2){let e=m().$implicit,i=m(4);q("data-testid","linked-nodes-occurrences-"+e.target),d(2),C(i.texts.occurrencesHeader),d(),X(e.occurrences)}}function xZ(t,n){if(t&1){let e=re();f(0,"li",22),O(1,"p-tag",23),f(2,"p-button",24),V("onClick",function(){let o=L(e).$implicit,r=m(4);return B(r.onOpen(o.target))}),h(),O(3,"p-tag",25),I(4,vZ,1,5,"p-tag",25),I(5,yZ,2,2,"span",26),I(6,bZ,5,2,"ul",27),h()}if(t&2){let e,i=n.$implicit,o=m(4);q("data-testid","linked-nodes-outgoing-row-"+i.target),d(),E("value",i.kind)("severity",o.kindSeverity(i.kind)),d(),E("link",!0)("label",i.target),q("data-testid","linked-nodes-outgoing-link-"+i.target),d(),E("value",o.confidenceValue(i.confidence))("severity",o.confidenceSeverity(i.confidence))("rounded",!0)("pTooltip",o.confidenceLabel(i.confidence)),d(),T((e=o.issueForOutgoing(i))?4:-1,e),d(),T(i.sources.length?5:-1),d(),T(i.occurrences&&i.occurrences.length>0?6:-1)}}function wZ(t,n){if(t&1&&(f(0,"ul",11),Y(1,xZ,7,13,"li",22,_M),h()),t&2){let e=m(3);d(),X(e.outgoing())}}function SZ(t,n){if(t&1&&(f(0,"p",15),v(1),h()),t&2){let e=m(3);d(),C(e.texts.emptyIncoming)}}function IZ(t,n){if(t&1&&O(0,"p-tag",25),t&2){let e=n,i=m().$implicit,o=m(4);E("value",e.analyzerId)("severity",o.issueSeverity(e.severity))("rounded",!0)("pTooltip",e.message),q("data-testid","linked-nodes-incoming-issue-"+i.source)}}function TZ(t,n){if(t&1&&(f(0,"span",26),v(1),h()),t&2){let e=m().$implicit,i=m(4);d(),bo(" ",i.texts.sourcesPrefix,"",e.sources.join(i.texts.sourcesSeparator)," ")}}function EZ(t,n){if(t&1&&(f(0,"li",29),v(1),h()),t&2){let e=n.$implicit,i=m(6);d(),C(i.occurrenceLabel(e))}}function PZ(t,n){if(t&1&&(f(0,"ul",27)(1,"li",28),v(2),h(),Y(3,EZ,2,1,"li",29,vM),h()),t&2){let e=m().$implicit,i=m(4);q("data-testid","linked-nodes-occurrences-"+e.target),d(2),C(i.texts.occurrencesHeader),d(),X(e.occurrences)}}function MZ(t,n){if(t&1){let e=re();f(0,"li",22),O(1,"p-tag",23),f(2,"p-button",24),V("onClick",function(){let o=L(e).$implicit,r=m(4);return B(r.onOpen(o.source))}),h(),O(3,"p-tag",25),I(4,IZ,1,5,"p-tag",25),I(5,TZ,2,2,"span",26),I(6,PZ,5,2,"ul",27),h()}if(t&2){let e,i=n.$implicit,o=m(4);q("data-testid","linked-nodes-incoming-row-"+i.source),d(),E("value",i.kind)("severity",o.kindSeverity(i.kind)),d(),E("link",!0)("label",i.source),q("data-testid","linked-nodes-incoming-link-"+i.source),d(),E("value",o.confidenceValue(i.confidence))("severity",o.confidenceSeverity(i.confidence))("rounded",!0)("pTooltip",o.confidenceLabel(i.confidence)),d(),T((e=o.issueForIncoming(i))?4:-1,e),d(),T(i.sources.length?5:-1),d(),T(i.occurrences&&i.occurrences.length>0?6:-1)}}function kZ(t,n){if(t&1&&(f(0,"ul",11),Y(1,MZ,7,13,"li",22,_M),h()),t&2){let e=m(3);d(),X(e.incoming())}}function DZ(t,n){if(t&1&&(I(0,fZ,6,1,"section",7),f(1,"section",8)(2,"h4",9),v(3),h(),I(4,hZ,2,1,"p",10)(5,gZ,3,0,"ul",11),h(),f(6,"section",12)(7,"h4",9),v(8),h(),I(9,_Z,2,1,"p",13)(10,wZ,3,0,"ul",11),h(),f(11,"section",14)(12,"h4",9),v(13),h(),I(14,SZ,2,1,"p",15)(15,kZ,3,0,"ul",11),h()),t&2){let e=m(2);T(e.externalRefs().length>0?0:-1),d(3),C(e.texts.findingsHeader),d(),T(e.findings().length===0?4:5),d(4),C(e.texts.outgoingHeader),d(),T(e.outgoing().length===0?9:10),d(4),C(e.texts.incomingHeader),d(),T(e.incoming().length===0?14:15)}}function OZ(t,n){if(t&1&&(f(0,"p-card",0),be(1,sZ,4,6,"ng-template",1),I(2,cZ,2,1,"p",2)(3,dZ,2,1,"p",3)(4,DZ,16,7),h()),t&2){let e,i=m();d(2),T((e=i.state())==="loading"?2:e==="error"?3:e==="ready"?4:-1)}}var Cf=class t{dataSource=l(pn);wsEvents=l(B_);destroyRef=l(ot);texts=mM;path=N(null);openPath=Le();state=U("idle");outgoingRaw=U([]);incomingRaw=U([]);outgoing=S(()=>this.outgoingRaw().filter(n=>!gM(n)));incoming=S(()=>this.incomingRaw().filter(n=>!gM(n)));issues=U([]);externalRefsRaw=U([]);externalRefs=S(()=>this.externalRefsRaw().filter(n=>Vr(n.url)!==null));fetchToken=0;hasResults=S(()=>this.state()==="ready"&&(this.outgoing().length>0||this.incoming().length>0));findings=S(()=>{let n=this.path();return n?this.issues().filter(e=>e.nodeIds.includes(n)):[]});constructor(){this.wsEvents.scanCompleted$.pipe(la(this.destroyRef)).subscribe(()=>{let n=this.path();n&&this.fetch(n)}),ie(()=>{let n=this.path();if(!n){this.fetchToken++,this.state.set("idle"),this.outgoingRaw.set([]),this.incomingRaw.set([]);return}this.fetch(n)})}refresh(){let n=this.path();n&&this.fetch(n)}onOpen(n){this.openPath.emit(n)}kindSeverity(n){return r0[n]??"secondary"}confidenceSeverity(n){return s0(n)}confidenceLabel(n){return this.texts.confidence[a0(n)]}confidenceValue(n){return n.toFixed(2)}issueSeverity(n){return n==="error"?"danger":n==="warn"?"warn":"info"}issueForOutgoing(n){let e=this.path();if(!e)return null;let i=[n.target,n.resolvedTarget].filter(s=>typeof s=="string"),o=this.issues().find(s=>{if(!s.nodeIds.includes(e))return!1;let c=s.data?.target;return typeof c!="string"?!1:i.includes(c)});if(o)return o;let r=n.resolvedTarget??n.target;return this.issues().find(s=>{if(!s.nodeIds.includes(r))return!1;let c=s.data?.target;return typeof c!="string"||c===r})??null}occurrenceLabel(n){let e=n.location?.line;return typeof e!="number"?this.texts.occurrencesItemUnknownLine.replace("{{trigger}}",n.originalTrigger).replace("{{extractor}}",n.extractor):this.texts.occurrencesItem.replace("{{line}}",String(e)).replace("{{trigger}}",n.originalTrigger).replace("{{extractor}}",n.extractor)}issueForIncoming(n){let e=this.path();if(!e)return null;let i=[n.target,n.resolvedTarget,e].filter(r=>typeof r=="string");return this.issues().find(r=>{if(!r.nodeIds.includes(n.source))return!1;let a=r.data?.target;return typeof a!="string"?!1:i.includes(a)})??null}async fetch(n){let e=++this.fetchToken;this.state.set("loading");try{let[i,o,r]=await Promise.allSettled([this.dataSource.listLinks({from:n}),this.dataSource.listLinks({to:n}),this.dataSource.getNode(n)]);if(e!==this.fetchToken)return;if(i.status!=="fulfilled"||o.status!=="fulfilled"){this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error");return}let a=i.value.items,s=o.value.items,c=NZ(n,a,s),u;try{let p=await this.dataSource.listIssues({nodes:c});if(e!==this.fetchToken)return;u=p.items}catch{if(e!==this.fetchToken)return;this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error");return}this.outgoingRaw.set(a),this.incomingRaw.set(s),this.issues.set(u),this.externalRefsRaw.set(r.status==="fulfilled"?r.value?.item?.externalRefs??[]:[]),this.state.set("ready")}catch{if(e!==this.fetchToken)return;this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error")}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-linked-nodes-panel"]],inputs:{path:[1,"path"]},outputs:{openPath:"openPath"},decls:1,vars:1,consts:[["styleClass","linked-nodes-panel","data-testid","linked-nodes-panel"],["pTemplate","header"],["data-testid","linked-nodes-loading",1,"linked-nodes-panel__status"],["data-testid","linked-nodes-error",1,"linked-nodes-panel__status","linked-nodes-panel__status--warn"],[1,"linked-nodes-panel__header"],[1,"linked-nodes-panel__title"],["icon","pi pi-refresh","severity","secondary","data-testid","linked-nodes-refresh",3,"onClick","rounded","text","ariaLabel","pTooltip","disabled"],["data-testid","linked-nodes-external-refs",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-findings",1,"linked-nodes-panel__section"],[1,"linked-nodes-panel__section-title"],["data-testid","linked-nodes-findings-empty",1,"linked-nodes-panel__status"],[1,"linked-nodes-panel__rows"],["data-testid","linked-nodes-outgoing",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-outgoing-empty",1,"linked-nodes-panel__status"],["data-testid","linked-nodes-incoming",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-incoming-empty",1,"linked-nodes-panel__status"],[1,"linked-nodes-panel__row","linked-nodes-panel__row--external-ref"],[1,"linked-nodes-panel__external-ref-line"],["target","_blank","rel","noopener noreferrer",1,"linked-nodes-panel__external-ref-url",3,"href"],[1,"linked-nodes-panel__row","linked-nodes-panel__row--finding"],[3,"value","severity","rounded"],[1,"linked-nodes-panel__finding-message"],[1,"linked-nodes-panel__row"],[3,"value","severity"],["severity","primary","styleClass","linked-nodes-panel__path",3,"onClick","link","label"],[3,"value","severity","rounded","pTooltip"],[1,"linked-nodes-panel__sources"],[1,"linked-nodes-panel__occurrences"],[1,"linked-nodes-panel__occurrences-header"],[1,"linked-nodes-panel__occurrences-item"]],template:function(e,i){e&1&&I(0,OZ,5,1,"p-card",0),e&2&&T(i.path()?0:-1)},dependencies:[hM,a_,Pi,_a,ga,ki,un,ln,De,Be],styles:["[_nghost-%COMP%]{display:block}.linked-nodes-panel__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.75rem 1rem 0}.linked-nodes-panel__title[_ngcontent-%COMP%]{margin:0;font-size:.95rem;font-weight:600}.linked-nodes-panel__status[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--p-text-muted-color);font-style:italic}.linked-nodes-panel__status--warn[_ngcontent-%COMP%]{color:var(--sm-severity-warn);font-style:normal}.linked-nodes-panel__section[_ngcontent-%COMP%] + .linked-nodes-panel__section[_ngcontent-%COMP%]{margin-top:1rem}.linked-nodes-panel__section-title[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--p-text-muted-color)}.linked-nodes-panel__rows[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.linked-nodes-panel__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.4rem .5rem;border-radius:var(--sm-radius-md);background:var(--p-content-background);border:1px solid var(--p-content-border-color)}.linked-nodes-panel__path[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.85rem;padding:0;text-underline-offset:2px}.linked-nodes-panel__sources[_ngcontent-%COMP%]{font-size:.75rem;color:var(--p-text-muted-color);margin-left:auto}.linked-nodes-panel__occurrences[_ngcontent-%COMP%]{flex-basis:100%;list-style:none;margin:.25rem 0 0;padding:.25rem 0 0;border-top:1px dashed var(--p-content-border-color);display:flex;flex-direction:column;gap:.15rem}.linked-nodes-panel__occurrences-header[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--p-text-muted-color)}.linked-nodes-panel__occurrences-item[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;color:var(--p-text-muted-color)}.linked-nodes-panel__row--finding[_ngcontent-%COMP%]{align-items:flex-start}.linked-nodes-panel__finding-message[_ngcontent-%COMP%]{font-size:.8rem;line-height:1.4;color:var(--p-text-color)}.linked-nodes-panel__row--external-ref[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.85rem}.linked-nodes-panel__external-ref-line[_ngcontent-%COMP%]{font-size:.75rem;color:var(--p-text-muted-color);min-width:4.5rem}.linked-nodes-panel__external-ref-url[_ngcontent-%COMP%]{flex:1;word-break:break-all;color:var(--p-primary-color);text-decoration:none}.linked-nodes-panel__external-ref-url[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};function NZ(t,n,e){let i=new Set([t]);for(let o of n)o.resolvedTarget&&i.add(o.resolvedTarget),o.target&&i.add(o.target);for(let o of e)o.source&&i.add(o.source);return[...i]}function gM(t){return!!(t.source===t.target||t.resolvedTarget&&t.source===t.resolvedTarget)}var yM={sections:{behavior:"Behavior",capabilities:"Capabilities",initialPrompt:"Initial prompt"},fields:{tools:"Tools",model:"Model",skills:"Skills",disallowedTools:"Disallowed",permissionMode:"Permission",maxTurns:"Max turns",memory:"Memory",background:"Background",effort:"Effort",isolation:"Isolation",mcpServers:"MCP servers",hooks:"Hooks"},skillBaseFields:{whenToUse:"When to use",argumentHint:"Argument hint",arguments:"Arguments",allowedTools:"Allowed tools",model:"Model",effort:"Effort",context:"Context",agent:"Agent",shell:"Shell",paths:"Paths",disableModelInvocation:"Model invocation",userInvocable:"User invocable"}};var RZ=(t,n)=>n.name,AZ=(t,n)=>n.event;function FZ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){let e=m(3);d(),C(e.texts.fields.model),d(3),C(n)}}function LZ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",9),O(3,"span",10),f(4,"code"),v(5),h()()),t&2){let e=n,i=m(3);d(),C(i.texts.fields.effort),d(2),q("data-level",e),d(2),C(e)}}function BZ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){let e=m(3);d(),C(e.texts.fields.permissionMode),d(3),C(n)}}function zZ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd"),v(3),h()),t&2){let e=m(3);d(),C(e.texts.fields.maxTurns),d(2),C(e.maxTurns())}}function qZ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){let e=m(3);d(),C(e.texts.fields.memory),d(3),C(n)}}function VZ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4,"true"),h()()),t&2){let e=m(3);d(),C(e.texts.fields.background)}}function GZ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){let e=m(3);d(),C(e.texts.fields.isolation),d(3),C(n)}}function HZ(t,n){if(t&1&&(f(0,"section",1)(1,"header",4),O(2,"i",5),f(3,"span",6),v(4),h(),O(5,"span",7),h(),f(6,"dl",8),I(7,FZ,5,2),I(8,LZ,6,3),I(9,BZ,5,2),I(10,zZ,4,2),I(11,qZ,5,2),I(12,VZ,5,1),I(13,GZ,5,2),h()()),t&2){let e,i,o,r,a,s=m(2);d(4),C(s.texts.sections.behavior),d(3),T((e=s.model())?7:-1,e),d(),T((i=s.effort())?8:-1,i),d(),T((o=s.permissionMode())?9:-1,o),d(),T(s.maxTurns()!==null?10:-1),d(),T((r=s.memory())?11:-1,r),d(),T(s.background()?12:-1),d(),T((a=s.isolation())?13:-1,a)}}function jZ(t,n){if(t&1&&O(0,"p-chip",15),t&2){let e=n.$implicit;E("label",e)}}function UZ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",14),Y(3,jZ,1,1,"p-chip",15,xe),h()),t&2){let e=m(4);d(),C(e.texts.fields.tools),d(2),X(e.tools())}}function WZ(t,n){if(t&1&&O(0,"p-chip",16),t&2){let e=n.$implicit;E("label",e)}}function $Z(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",14),Y(3,WZ,1,1,"p-chip",16,xe),h()),t&2){let e=m(4);d(),C(e.texts.fields.disallowedTools),d(2),X(e.disallowedTools())}}function KZ(t,n){if(t&1){let e=re();f(0,"p-chip",18),V("click",function(){let o=L(e).$implicit,r=m(5);return B(r.onSkillChipClick(o))}),h()}if(t&2){let e=n.$implicit,i=m(5);E("label",e)("styleClass",i.isSkillKnown(e)?"chip--link":"")}}function YZ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",14),Y(3,KZ,1,2,"p-chip",17,xe),h()),t&2){let e=m(4);d(),C(e.texts.fields.skills),d(2),X(e.skills())}}function XZ(t,n){if(t&1&&(f(0,"code",24),v(1),h()),t&2){let e=m().$implicit;d(),C(e.command)}}function ZZ(t,n){if(t&1&&(f(0,"span",25),v(1),h()),t&2){let e=m().$implicit;d(),bo("\xB7 ",e.argsCount," arg",e.argsCount===1?"":"s")}}function QZ(t,n){t&1&&(f(0,"span",25),v(1,"\xB7 no args"),h())}function JZ(t,n){if(t&1&&(f(0,"li",21)(1,"span",22),v(2,"\u25CF"),h(),f(3,"code",23),v(4),h(),I(5,XZ,2,1,"code",24),I(6,ZZ,2,2,"span",25)(7,QZ,2,0,"span",25),h()),t&2){let e=n.$implicit;d(4),C(e.name),d(),T(e.command!==null?5:-1),d(),T(e.argsCount>0?6:7)}}function eQ(t,n){if(t&1&&(f(0,"div",13)(1,"span",19),v(2),h(),f(3,"ul",20),Y(4,JZ,8,3,"li",21,RZ),h()()),t&2){let e=m(4);d(2),C(e.texts.fields.mcpServers),d(2),X(e.mcpServers())}}function tQ(t,n){if(t&1&&(f(0,"code"),v(1),h(),v(2)),t&2){let e=n.$implicit,i=n.$index,o=n.$count;d(),C(e),d(),Fe("",i===o-1?"":", "," ")}}function nQ(t,n){if(t&1&&(f(0,"span",26),v(1,"\u2192"),h(),f(2,"span",27),Y(3,tQ,3,2,null,null,xe),h()),t&2){let e=m().$implicit;d(3),X(e.keys)}}function iQ(t,n){if(t&1&&(f(0,"li",21)(1,"code",23),v(2),h(),I(3,nQ,5,0),h()),t&2){let e=n.$implicit;d(2),C(e.event),d(),T(e.keys.length?3:-1)}}function oQ(t,n){if(t&1&&(f(0,"div",13)(1,"span",19),v(2),h(),f(3,"ul",20),Y(4,iQ,4,2,"li",21,AZ),h()()),t&2){let e=m(4);d(2),C(e.texts.fields.hooks),d(2),X(e.hooks())}}function rQ(t,n){if(t&1&&(f(0,"dl",8),I(1,UZ,5,1),I(2,$Z,5,1),I(3,YZ,5,1),h(),I(4,eQ,6,1,"div",13),I(5,oQ,6,1,"div",13)),t&2){let e=m(3);d(),T(e.tools().length?1:-1),d(),T(e.disallowedTools().length?2:-1),d(),T(e.skills().length?3:-1),d(),T(e.mcpServers().length?4:-1),d(),T(e.hooks().length?5:-1)}}function aQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd"),v(3),h()),t&2){m();let e=ee(0),i=m(3);d(),C(i.texts.skillBaseFields.whenToUse),d(2),C(e.when_to_use)}}function sQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=ee(0),i=m(3);d(),C(i.texts.skillBaseFields.argumentHint),d(3),C(e.argumentHint)}}function cQ(t,n){if(t&1&&O(0,"p-chip",15),t&2){let e=n.$implicit;E("label",e)}}function dQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",14),Y(3,cQ,1,1,"p-chip",15,xe),h()),t&2){m();let e=ee(0),i=m(3);d(),C(i.texts.skillBaseFields.arguments),d(2),X(e.arguments)}}function lQ(t,n){if(t&1&&O(0,"p-chip",15),t&2){let e=n.$implicit;E("label",e)}}function uQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",14),Y(3,lQ,1,1,"p-chip",15,xe),h()),t&2){m();let e=ee(0),i=m(3);d(),C(i.texts.skillBaseFields.allowedTools),d(2),X(e.allowedTools)}}function pQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=ee(0),i=m(3);d(),C(i.texts.skillBaseFields.model),d(3),C(e.model)}}function fQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=ee(0),i=m(3);d(),C(i.texts.skillBaseFields.effort),d(3),C(e.effort)}}function hQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=ee(0),i=m(3);d(),C(i.texts.skillBaseFields.context),d(3),C(e.context)}}function mQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=ee(0),i=m(3);d(),C(i.texts.skillBaseFields.agent),d(3),C(e.agent)}}function gQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=ee(0),i=m(3);d(),C(i.texts.skillBaseFields.shell),d(3),C(e.shell)}}function _Q(t,n){if(t&1&&O(0,"p-chip",15),t&2){let e=n.$implicit;E("label",e)}}function vQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",14),Y(3,_Q,1,1,"p-chip",15,xe),h()),t&2){m();let e=ee(0),i=m(3);d(),C(i.texts.skillBaseFields.paths),d(2),X(e.paths)}}function yQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4,"disabled"),h()()),t&2){let e=m(4);d(),C(e.texts.skillBaseFields.disableModelInvocation)}}function CQ(t,n){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=ee(0),i=m(3);d(),C(i.texts.skillBaseFields.userInvocable),d(3),C(e.userInvocable)}}function bQ(t,n){if(t&1&&(ut(0),f(1,"dl",12),I(2,aQ,4,2),I(3,sQ,5,2),I(4,dQ,5,1),I(5,uQ,5,1),I(6,pQ,5,2),I(7,fQ,5,2),I(8,hQ,5,2),I(9,mQ,5,2),I(10,gQ,5,2),I(11,vQ,5,1),I(12,yQ,5,1),I(13,CQ,5,2),h()),t&2){let e=Ke(m(3).skillBase());d(2),T(e.when_to_use!==null?2:-1),d(),T(e.argumentHint!==null?3:-1),d(),T(e.arguments.length?4:-1),d(),T(e.allowedTools.length?5:-1),d(),T(e.model!==null?6:-1),d(),T(e.effort!==null?7:-1),d(),T(e.context!==null?8:-1),d(),T(e.agent!==null?9:-1),d(),T(e.shell!==null?10:-1),d(),T(e.paths.length?11:-1),d(),T(e.disableModelInvocation?12:-1),d(),T(e.userInvocable!==null?13:-1)}}function xQ(t,n){if(t&1&&(f(0,"section",2)(1,"header",4),O(2,"i",11),f(3,"span",6),v(4),h(),O(5,"span",7),h(),I(6,rQ,6,5)(7,bQ,14,13,"dl",12),h()),t&2){let e=m(2);d(4),C(e.texts.sections.capabilities),d(2),T(e.isAgent()?6:e.isSkillOrCommand()?7:-1)}}function wQ(t,n){if(t&1&&(f(0,"section",3)(1,"header",4),O(2,"i",28),f(3,"span",6),v(4),h(),O(5,"span",7),h(),f(6,"blockquote",29),v(7),h()()),t&2){let e=m(2);d(4),C(e.texts.sections.initialPrompt),d(3),C(e.initialPrompt())}}function SQ(t,n){if(t&1&&(f(0,"div",0),I(1,HZ,14,8,"section",1),I(2,xQ,8,2,"section",2),I(3,wQ,8,2,"section",3),h()),t&2){let e=m();d(),T(e.hasBehavior()?1:-1),d(),T(e.hasCapabilities()?2:-1),d(),T(e.hasInitialPrompt()?3:-1)}}var xf=class t{frontmatter=N.required();kind=N.required();provider=N(void 0);knownPaths=N(null);onSkillClick=N(null);texts=yM;hasVendorSurface=S(()=>{let n=this.kind();return n==="agent"||n==="skill"||n==="command"});isAgent=S(()=>this.kind()==="agent");isSkillOrCommand=S(()=>{let n=this.kind();return n==="skill"||n==="command"});tools=S(()=>bf(this.fm().tools));model=S(()=>gt(this.fm().model));skills=S(()=>bf(this.fm().skills));disallowedTools=S(()=>bf(this.fm().disallowedTools));initialPrompt=S(()=>gt(this.fm().initialPrompt));permissionMode=S(()=>gt(this.fm().permissionMode));maxTurns=S(()=>IQ(this.fm().maxTurns));memory=S(()=>gt(this.fm().memory));background=S(()=>this.fm().background===!0);effort=S(()=>gt(this.fm().effort));isolation=S(()=>gt(this.fm().isolation));mcpServers=S(()=>{let n=this.fm().mcpServers;return Array.isArray(n)?n.filter(e=>typeof e=="object"&&e!==null).map((e,i)=>{let o=e.args,r=Array.isArray(o)?o.length:0;return{name:typeof e.name=="string"&&e.name.length>0?e.name:`mcpServer[${i}]`,command:typeof e.command=="string"?e.command:null,argsCount:r}}):[]});hooks=S(()=>{let n=this.fm().hooks;if(typeof n!="object"||n===null)return[];let e=[];for(let[i,o]of Object.entries(n)){let r=typeof o=="object"&&o!==null?Object.keys(o):[];e.push({event:i,keys:r})}return e});skillBase=S(()=>{let n=this.fm();return{when_to_use:gt(n.when_to_use),argumentHint:gt(n["argument-hint"]),arguments:s_(n.arguments),disableModelInvocation:n["disable-model-invocation"]===!0,userInvocable:typeof n["user-invocable"]=="boolean"?n["user-invocable"]:null,allowedTools:s_(n["allowed-tools"]),model:gt(n.model),effort:gt(n.effort),context:gt(n.context),agent:gt(n.agent),paths:s_(n.paths),shell:gt(n.shell)}});hasBehavior=S(()=>this.isAgent()?this.model()!==null||this.permissionMode()!==null||this.maxTurns()!==null||this.memory()!==null||this.background()||this.effort()!==null||this.isolation()!==null:!1);hasCapabilities=S(()=>{if(this.isAgent())return this.tools().length>0||this.disallowedTools().length>0||this.skills().length>0||this.mcpServers().length>0||this.hooks().length>0;if(this.isSkillOrCommand()){let n=this.skillBase();return n.when_to_use!==null||n.argumentHint!==null||n.arguments.length>0||n.allowedTools.length>0||n.model!==null||n.effort!==null||n.context!==null||n.agent!==null||n.shell!==null||n.paths.length>0||n.disableModelInvocation||n.userInvocable!==null}return!1});hasInitialPrompt=S(()=>this.isAgent()&&this.initialPrompt()!==null);hasAnyContent=S(()=>this.hasVendorSurface()&&(this.hasBehavior()||this.hasCapabilities()||this.hasInitialPrompt()));onSkillChipClick(n){let e=this.onSkillClick();e&&e(n)}isSkillKnown(n){let e=this.knownPaths();return e?e.has(n):!1}fm(){return this.frontmatter()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-vendor-frontmatter"]],inputs:{frontmatter:[1,"frontmatter"],kind:[1,"kind"],provider:[1,"provider"],knownPaths:[1,"knownPaths"],onSkillClick:[1,"onSkillClick"]},decls:1,vars:1,consts:[["data-testid","vendor-frontmatter",1,"vfm"],["data-testid","vendor-frontmatter-behavior",1,"sm-section"],["data-testid","vendor-frontmatter-capabilities",1,"sm-section"],["data-testid","vendor-frontmatter-initial-prompt",1,"sm-section"],[1,"sm-section__head"],["aria-hidden","true",1,"pi","pi-cog","sm-section__icon"],[1,"sm-section__title"],["aria-hidden","true",1,"sm-section__rule"],[1,"sm-section__kv"],[1,"vfm__effort"],["aria-hidden","true",1,"vfm__effort-bar"],["aria-hidden","true",1,"pi","pi-bolt","sm-section__icon"],["data-testid","vendor-frontmatter-skill-base",1,"sm-section__kv"],[1,"vfm__row"],[1,"vfm__chips"],[3,"label"],["icon","pi pi-ban","styleClass","chip--danger",3,"label"],["icon","pi pi-arrow-up-right",3,"label","styleClass"],["icon","pi pi-arrow-up-right",3,"click","label","styleClass"],[1,"vfm__row-label"],[1,"vfm__list"],[1,"vfm__list-row"],["aria-hidden","true",1,"vfm__list-bullet"],[1,"vfm__list-key"],[1,"vfm__list-cmd"],[1,"vfm__list-meta"],["aria-hidden","true",1,"vfm__list-sep"],[1,"vfm__list-keys"],["aria-hidden","true",1,"pi","pi-comment","sm-section__icon"],["data-testid","vendor-frontmatter-initial-prompt-quote",1,"vfm__quote"]],template:function(e,i){e&1&&I(0,SQ,4,3,"div",0),e&2&&T(i.hasAnyContent()?0:-1)},dependencies:[ki,ma,De],styles:['[_nghost-%COMP%]{display:block}.vfm[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.1rem}.vfm__row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.3rem;margin-top:.4rem}.vfm__row-label[_ngcontent-%COMP%]{font-size:.7rem;text-transform:uppercase;letter-spacing:.06em;color:var(--sm-text-muted);font-weight:600}.vfm__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.3rem}.vfm__quote[_ngcontent-%COMP%]{margin:0;padding:.7rem .95rem;border-left:3px solid var(--p-primary-color);background:var(--p-primary-50);color:var(--p-text-color);font-style:italic;font-size:.9rem;line-height:1.55;border-radius:0 var(--sm-radius-md) var(--sm-radius-md) 0;white-space:pre-wrap}.vfm__list[_ngcontent-%COMP%]{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:.25rem}.vfm__list-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:.45rem;font-size:.83rem}.vfm__list-bullet[_ngcontent-%COMP%]{color:var(--p-primary-color);font-size:.75rem}.vfm__list-key[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-weight:600;background:var(--sm-bg-hover);padding:.05rem .4rem;border-radius:var(--sm-radius-sm);font-size:.78rem}.vfm__list-cmd[_ngcontent-%COMP%], .vfm__list-keys[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;color:var(--sm-text-muted)}.vfm__list-sep[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-size:.85rem}.vfm__list-meta[_ngcontent-%COMP%]{font-size:.75rem;color:var(--p-text-muted-color);font-style:italic}.vfm__effort[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem}.vfm__effort-bar[_ngcontent-%COMP%]{display:inline-flex;gap:2px;align-items:center}.vfm__effort-bar[_ngcontent-%COMP%]:before, .vfm__effort-bar[_ngcontent-%COMP%]:after, .vfm__effort-bar[_ngcontent-%COMP%]{--pip-on: var(--p-primary-color);--pip-off: color-mix(in srgb, var(--p-primary-color) 25%, transparent)}.vfm__effort-bar[_ngcontent-%COMP%]{position:relative;width:28px;height:8px}.vfm__effort-bar[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:0;background:linear-gradient(to right,var(--pip-off) 0 33%,transparent 33% 36%,var(--pip-off) 36% 66%,transparent 66% 69%,var(--pip-off) 69% 100%);border-radius:1px}.vfm__effort-bar[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:0;background:linear-gradient(to right,var(--pip-on) 0 33%,transparent 33% 100%);border-radius:1px}.vfm__effort-bar[data-level=medium][_ngcontent-%COMP%]:after{background:linear-gradient(to right,var(--pip-on) 0 33%,transparent 33% 36%,var(--pip-on) 36% 66%,transparent 66% 100%)}.vfm__effort-bar[data-level=high][_ngcontent-%COMP%]:after, .vfm__effort-bar[data-level=max][_ngcontent-%COMP%]:after{background:linear-gradient(to right,var(--pip-on) 0 33%,transparent 33% 36%,var(--pip-on) 36% 66%,transparent 66% 69%,var(--pip-on) 69% 100%)}[_nghost-%COMP%] .chip--danger{background:var(--sm-severity-error-bg);color:var(--sm-severity-error)}[_nghost-%COMP%] .chip--danger .p-chip-icon{color:var(--sm-severity-error)}[_nghost-%COMP%] .chip--link{cursor:pointer;background:var(--p-primary-50);color:var(--p-primary-color);transition:background .15s ease}[_nghost-%COMP%] .chip--link:hover{background:var(--p-primary-100)}'],changeDetection:0})};function gt(t){return typeof t=="string"&&t.length>0?t:null}function IQ(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function bf(t){return Array.isArray(t)?t.filter(n=>typeof n=="string"&&n.length>0):[]}function s_(t){return typeof t=="string"?t.length>0?[t]:[]:Array.isArray(t)?bf(t):[]}var CM={header:"Plugin contributions",count:t=>`${t} namespace${t===1?"":"s"}`,unregisteredBadge:"unregistered",rootContribBadge:t=>`from plugin: ${t}`,empty:"No plugin contributions on this sidecar."};var wM=(t,n)=>n.key,TQ=(t,n)=>n.pluginId;function EQ(t,n){if(t&1&&(f(0,"p",0),v(1),h()),t&2){let e=m();d(),C(e.texts.empty)}}function PQ(t,n){if(t&1&&(f(0,"span",5),v(1),h()),t&2){let e=m().$implicit,i=m(3);d(),C(i.texts.rootContribBadge(e.pluginId))}}function MQ(t,n){if(t&1&&(f(0,"div",3)(1,"code",4),v(2),h(),I(3,PQ,2,1,"span",5),f(4,"pre",6),v(5),h()()),t&2){let e=n.$implicit;d(2),C(e.key),d(),T(e.pluginId!==null?3:-1),d(2),C(e.value)}}function kQ(t,n){if(t&1&&(f(0,"div",1),Y(1,MQ,6,3,"div",3,wM),h()),t&2){let e=m(2);d(),X(e.rootContributions())}}function DQ(t,n){if(t&1&&(f(0,"span",10),v(1),h()),t&2){let e=m(4);d(),C(e.texts.unregisteredBadge)}}function OQ(t,n){if(t&1&&(f(0,"dt",12),v(1),h(),f(2,"dd")(3,"pre"),v(4),h()()),t&2){let e=n.$implicit;E("pTooltip",e.description??""),d(),C(e.key),d(3),C(e.value)}}function NQ(t,n){if(t&1&&(f(0,"section",7)(1,"h5",8)(2,"span",9),v(3),h(),I(4,DQ,2,1,"span",10),h(),f(5,"dl",11),Y(6,OQ,5,3,null,null,wM),h()()),t&2){let e=n.$implicit;q("data-testid","plugin-contributions-ns-"+e.pluginId),d(3),C(e.pluginId),d(),T(e.registered?-1:4),d(2),X(e.rows)}}function RQ(t,n){if(t&1&&(f(0,"div",2),Y(1,NQ,8,3,"section",7,TQ),h()),t&2){let e=m(2);d(),X(e.namespaces())}}function AQ(t,n){if(t&1&&(I(0,kQ,3,0,"div",1),I(1,RQ,3,0,"div",2)),t&2){let e=m();T(e.rootContributions().length?0:-1),d(),T(e.namespaces().length?1:-1)}}var bM=new Set(["identity","annotations","settings","audit"]),wf=class t{dataSource=l(pn);sidecarRoot=N(void 0);texts=CM;catalog=U(null);constructor(){this.fetchCatalog()}namespaces=S(()=>{let n=this.sidecarRoot();if(!n)return[];let e=this.catalog(),i=new Map;if(e)for(let r of e){if(r.location!=="namespaced")continue;let a=i.get(r.pluginId);a?a.push(r):i.set(r.pluginId,[r])}let o=[];for(let[r,a]of Object.entries(n)){if(bM.has(r)||this.isRegisteredRootKey(r))continue;let c=typeof a=="object"&&a!==null&&!Array.isArray(a)?a:{value:a},u=i.has(r),p=i.get(r)??[],g=Object.entries(c).map(([b,M])=>({key:b,value:xM(M),description:u?FQ(p,b):null}));o.push({pluginId:r,registered:u,rows:g})}return o});rootContributions=S(()=>{let n=this.sidecarRoot();if(!n)return[];let e=this.catalog();if(!e)return[];let i=new Map;for(let r of e)r.location==="root"&&i.set(r.key,r);let o=[];for(let[r,a]of Object.entries(n)){if(bM.has(r))continue;let s=i.get(r);s&&o.push({key:r,pluginId:s.pluginId,value:xM(a)})}return o});count=S(()=>this.namespaces().length+this.rootContributions().length);isEmpty=S(()=>this.count()===0);isRegisteredRootKey(n){let e=this.catalog();return e?e.some(i=>i.location==="root"&&i.key===n):!1}async fetchCatalog(){try{let n=await this.dataSource.getRegisteredAnnotations();this.catalog.set(n)}catch{this.catalog.set([])}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-plugin-contributions"]],inputs:{sidecarRoot:[1,"sidecarRoot"]},decls:2,vars:1,consts:[["data-testid","plugin-contributions-empty",1,"pcp__empty"],["data-testid","plugin-contributions-roots",1,"pcp__roots"],[1,"pcp__namespaces"],[1,"pcp__root-row"],[1,"pcp__root-key"],[1,"pcp__root-badge"],[1,"pcp__root-value"],[1,"pcp__ns"],[1,"pcp__ns-header"],[1,"pcp__ns-name"],["data-testid","plugin-contributions-unregistered-badge",1,"pcp__ns-badge"],[1,"pcp__kv"],[3,"pTooltip"]],template:function(e,i){e&1&&I(0,EQ,2,1,"p",0)(1,AQ,2,2),e&2&&T(i.isEmpty()?0:1)},dependencies:[De,Be],styles:["[_nghost-%COMP%]{display:block}.pcp__empty[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--sm-text-muted);font-style:italic}.pcp__roots[_ngcontent-%COMP%], .pcp__namespaces[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.pcp__root-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;font-size:.85rem}.pcp__root-key[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);background:var(--sm-bg-hover);padding:.1rem .4rem;border-radius:var(--sm-radius-sm);font-weight:600}.pcp__root-badge[_ngcontent-%COMP%]{font-size:.7rem;color:var(--sm-text-muted);font-style:italic;background:var(--sm-bg-hover);padding:.05rem .35rem;border-radius:var(--sm-radius-sm)}.pcp__root-value[_ngcontent-%COMP%]{flex:1 1 100%;margin:.2rem 0 0;padding:.45rem .6rem;background:var(--sm-bg-hover);border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.8rem;white-space:pre-wrap;word-break:break-word}.pcp__ns[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.pcp__ns[_ngcontent-%COMP%] + .pcp__ns[_ngcontent-%COMP%]{border-top:1px solid var(--sm-border);padding-top:.5rem}.pcp__ns-header[_ngcontent-%COMP%]{margin:0;display:inline-flex;align-items:center;gap:.5rem;font-size:.85rem;font-weight:600}.pcp__ns-name[_ngcontent-%COMP%]{font-family:var(--sm-font-mono)}.pcp__ns-badge[_ngcontent-%COMP%]{font-size:.65rem;font-weight:500;text-transform:uppercase;letter-spacing:.04em;color:var(--sm-text-muted);background:var(--sm-bg-hover);padding:.05rem .4rem;border-radius:var(--sm-radius-sm)}.pcp__kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;column-gap:.6rem;row-gap:.2rem;margin:0;font-size:.85rem}.pcp__kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-weight:500;font-family:var(--sm-font-mono);cursor:help}.pcp__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;word-break:break-word}.pcp__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:0;font-family:var(--sm-font-mono);font-size:.8rem;white-space:pre-wrap;word-break:break-word}"],changeDetection:0})};function xM(t){if(t===null)return"null";if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);try{return JSON.stringify(t,null,2)}catch{return String(t)}}function FQ(t,n){for(let e of t)if(e.key===n){let i=e.schema.description;return typeof i=="string"&&i.length>0?i:null}return null}var Sf=class t{node=N(null);static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-inspector-slots-panel"]],inputs:{node:[1,"node"]},decls:6,vars:6,consts:[["slot","inspector.body.panel.breakdown",3,"node"],["slot","inspector.body.panel.records",3,"node"],["slot","inspector.body.panel.tree",3,"node"],["slot","inspector.body.panel.key-values",3,"node"],["slot","inspector.body.panel.link-list",3,"node"],["slot","inspector.body.panel.markdown",3,"node"]],template:function(e,i){e&1&&O(0,"sm-view-contributions-host",0)(1,"sm-view-contributions-host",1)(2,"sm-view-contributions-host",2)(3,"sm-view-contributions-host",3)(4,"sm-view-contributions-host",4)(5,"sm-view-contributions-host",5),e&2&&(E("node",i.node()),d(),E("node",i.node()),d(),E("node",i.node()),d(),E("node",i.node()),d(),E("node",i.node()),d(),E("node",i.node()))},dependencies:[yn],encapsulation:2,changeDetection:0})};var SM={header:"Debug",toggleAriaLabel:"Toggle debug panel",fields:{forPath:"for.path",bodyHashStored:"for.bodyHash (stored)",bodyHashLive:"node.bodyHash (live)",frontmatterHashStored:"for.frontmatterHash (stored)",frontmatterHashLive:"node.frontmatterHash (live)",resolvedProvider:"for.resolvedAs.provider",resolvedKind:"for.resolvedAs.kind",sidecarStatus:"sidecar.status",sidecarPresent:"sidecar.present"},diffMarker:"!=",absentMarker:"(absent)",notSetMarker:"(not set)"};function LQ(t,n){t&1&&(W(0,"code"),v(1),$()),t&2&&(d(),C(n))}function BQ(t,n){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}function zQ(t,n){if(t&1&&(W(0,"code"),v(1),$()),t&2){let e=m();de("dbg__diff",e.bodyHashDrift()),d(),C(n)}}function qQ(t,n){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}function VQ(t,n){if(t&1&&(W(0,"code"),v(1),$()),t&2){let e=m();de("dbg__diff",e.bodyHashDrift()),d(),C(n)}}function GQ(t,n){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}function HQ(t,n){if(t&1&&(W(0,"code"),v(1),$()),t&2){let e=m();de("dbg__diff",e.frontmatterHashDrift()),d(),C(n)}}function jQ(t,n){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}function UQ(t,n){if(t&1&&(W(0,"code"),v(1),$()),t&2){let e=m();de("dbg__diff",e.frontmatterHashDrift()),d(),C(n)}}function WQ(t,n){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}function $Q(t,n){t&1&&(W(0,"code"),v(1),$()),t&2&&(d(),C(n))}function KQ(t,n){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.notSetMarker)}}function YQ(t,n){t&1&&(W(0,"code"),v(1),$()),t&2&&(d(),C(n))}function XQ(t,n){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.notSetMarker)}}function ZQ(t,n){t&1&&(W(0,"code"),v(1),$()),t&2&&(d(),C(n))}function QQ(t,n){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}var If=class t{node=N.required();sidecarRoot=N(null);overlay=N(void 0);texts=SM;identityBlock=S(()=>{let n=this.sidecarRoot(),e={path:null,bodyHash:null,frontmatterHash:null,resolvedProvider:null,resolvedKind:null};if(!n)return e;let i=n.identity;if(typeof i!="object"||i===null)return e;let o=i,r=typeof o.resolvedAs=="object"&&o.resolvedAs!==null?o.resolvedAs:null;return{path:typeof o.path=="string"?o.path:null,bodyHash:typeof o.bodyHash=="string"?o.bodyHash:null,frontmatterHash:typeof o.frontmatterHash=="string"?o.frontmatterHash:null,resolvedProvider:r&&typeof r.provider=="string"?r.provider:null,resolvedKind:r&&typeof r.kind=="string"?r.kind:null}});bodyHashLive=S(()=>this.node().bodyHash??null);frontmatterHashLive=S(()=>this.node().frontmatterHash??null);bodyHashDrift=S(()=>{let n=this.identityBlock().bodyHash,e=this.bodyHashLive();return n!==null&&e!==null&&n!==e});frontmatterHashDrift=S(()=>{let n=this.identityBlock().frontmatterHash,e=this.frontmatterHashLive();return n!==null&&e!==null&&n!==e});sidecarStatusLiteral=S(()=>{let n=this.overlay();if(!n)return null;let e=n.status??null;return e===null?null:String(e)});sidecarPresent=S(()=>this.overlay()?.present===!0);static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-inspector-debug-panel"]],inputs:{node:[1,"node"],sidecarRoot:[1,"sidecarRoot"],overlay:[1,"overlay"]},decls:46,vars:18,consts:[["data-testid","inspector-debug-panel",1,"dbg__kv"],["data-testid","dbg-for-path"],[1,"dbg__absent"],["data-testid","dbg-body-hash-stored"],[3,"dbg__diff"],["data-testid","dbg-body-hash-live"],["data-testid","dbg-fm-hash-stored"],["data-testid","dbg-fm-hash-live"],["data-testid","dbg-resolved-provider"],["data-testid","dbg-resolved-kind"],["data-testid","dbg-sidecar-status"],["data-testid","dbg-sidecar-present"]],template:function(e,i){if(e&1&&(W(0,"dl",0)(1,"dt"),v(2),$(),W(3,"dd",1),I(4,LQ,2,1,"code")(5,BQ,2,1,"span",2),$(),W(6,"dt"),v(7),$(),W(8,"dd",3),I(9,zQ,2,3,"code",4)(10,qQ,2,1,"span",2),$(),W(11,"dt"),v(12),$(),W(13,"dd",5),I(14,VQ,2,3,"code",4)(15,GQ,2,1,"span",2),$(),W(16,"dt"),v(17),$(),W(18,"dd",6),I(19,HQ,2,3,"code",4)(20,jQ,2,1,"span",2),$(),W(21,"dt"),v(22),$(),W(23,"dd",7),I(24,UQ,2,3,"code",4)(25,WQ,2,1,"span",2),$(),W(26,"dt"),v(27),$(),W(28,"dd",8),I(29,$Q,2,1,"code")(30,KQ,2,1,"span",2),$(),W(31,"dt"),v(32),$(),W(33,"dd",9),I(34,YQ,2,1,"code")(35,XQ,2,1,"span",2),$(),W(36,"dt"),v(37),$(),W(38,"dd",10),I(39,ZQ,2,1,"code")(40,QQ,2,1,"span",2),$(),W(41,"dt"),v(42),$(),W(43,"dd",11)(44,"code"),v(45),$()()()),e&2){let o,r,a,s,c,u,p,g;d(2),C(i.texts.fields.forPath),d(2),T((o=i.identityBlock().path)?4:5,o),d(3),C(i.texts.fields.bodyHashStored),d(2),T((r=i.identityBlock().bodyHash)?9:10,r),d(3),C(i.texts.fields.bodyHashLive),d(2),T((a=i.bodyHashLive())?14:15,a),d(3),C(i.texts.fields.frontmatterHashStored),d(2),T((s=i.identityBlock().frontmatterHash)?19:20,s),d(3),C(i.texts.fields.frontmatterHashLive),d(2),T((c=i.frontmatterHashLive())?24:25,c),d(3),C(i.texts.fields.resolvedProvider),d(2),T((u=i.identityBlock().resolvedProvider)?29:30,u),d(3),C(i.texts.fields.resolvedKind),d(2),T((p=i.identityBlock().resolvedKind)?34:35,p),d(3),C(i.texts.fields.sidecarStatus),d(2),T((g=i.sidecarStatusLiteral())?39:40,g),d(3),C(i.texts.fields.sidecarPresent),d(3),C(i.sidecarPresent())}},styles:["[_nghost-%COMP%]{display:block}.dbg__kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;column-gap:.6rem;row-gap:.2rem;margin:0;font-size:.8rem}.dbg__kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-family:var(--sm-font-mono);font-weight:500}.dbg__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0}.dbg__kv[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;background:var(--sm-bg-hover);padding:.05rem .3rem;border-radius:var(--sm-radius-sm);word-break:break-all}.dbg__diff[_ngcontent-%COMP%]{background:var(--sm-severity-error-bg);color:var(--sm-severity-error)}.dbg__absent[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;color:var(--sm-text-muted);font-style:italic}"],changeDetection:0})};function JQ(t,n){if(t&1&&(W(0,"span",3),v(1),W(2,"code"),v(3),$()()),t&2){m(2);let e=ee(0),i=m();d(),Fe(" ",i.texts.fields.lastBumpedBy," "),d(2),C(e.lastBumpedBy)}}function eJ(t,n){if(t&1&&(W(0,"dt"),v(1),$(),W(2,"dd")(3,"span",2),v(4),$(),I(5,JQ,4,2,"span",3),$()),t&2){m();let e=ee(0),i=m();d(),C(i.texts.fields.lastBumpedAt),d(2),Vf("title",e.lastBumpedAt),d(),C(i.lastBumpedRel()),d(),T(e.lastBumpedBy!==null?5:-1)}}function tJ(t,n){if(t&1&&(W(0,"span",3),v(1),W(2,"code"),v(3),$()()),t&2){m(2);let e=ee(0),i=m();d(),Fe(" ",i.texts.fields.createdBy," "),d(2),C(e.createdBy)}}function nJ(t,n){if(t&1&&(W(0,"dt"),v(1),$(),W(2,"dd")(3,"span",2),v(4),$(),I(5,tJ,4,2,"span",3),$()),t&2){m();let e=ee(0),i=m();d(),C(i.texts.fields.createdAt),d(2),Vf("title",e.createdAt),d(),C(i.createdRel()),d(),T(e.createdBy!==null?5:-1)}}function iJ(t,n){if(t&1&&(ut(0),W(1,"dl",0),I(2,eJ,6,4),I(3,nJ,6,4),$()),t&2){let e=Ke(m().audit());d(2),T(e.lastBumpedAt!==null?2:-1),d(),T(e.createdAt!==null?3:-1)}}function oJ(t,n){if(t&1&&(W(0,"p",1),v(1),$()),t&2){let e=m();d(),C(e.texts.headerEmpty)}}var Ef=class t{sidecarRoot=N(null);texts=Gn.audit;audit=S(()=>{let n=this.sidecarRoot(),e={lastBumpedAt:null,lastBumpedBy:null,createdAt:null,createdBy:null};if(!n)return e;let i=n.audit;if(typeof i!="object"||i===null)return e;let o=i;return{lastBumpedAt:Tf(o.lastBumpedAt),lastBumpedBy:Tf(o.lastBumpedBy),createdAt:Tf(o.createdAt),createdBy:Tf(o.createdBy)}});hasContent=S(()=>{let n=this.audit();return n.lastBumpedAt!==null||n.lastBumpedBy!==null||n.createdAt!==null||n.createdBy!==null});lastBumpedRel=S(()=>{let n=this.audit().lastBumpedAt;return n===null?null:xo(n)});createdRel=S(()=>{let n=this.audit().createdAt;return n===null?null:xo(n)});static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-inspector-audit-panel"]],inputs:{sidecarRoot:[1,"sidecarRoot"]},decls:2,vars:1,consts:[["data-testid","inspector-audit-panel",1,"audit__kv"],["data-testid","inspector-audit-panel-empty",1,"audit__empty"],[3,"title"],[1,"audit__by"]],template:function(e,i){e&1&&I(0,iJ,4,3,"dl",0)(1,oJ,2,1,"p",1),e&2&&T(i.hasContent()?0:1)},styles:["[_nghost-%COMP%]{display:block}.audit__kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;column-gap:.6rem;row-gap:.2rem;margin:0;font-size:.85rem}.audit__kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-weight:500}.audit__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0}.audit__by[_ngcontent-%COMP%]{color:var(--sm-text-muted)}.audit__by[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem}.audit__empty[_ngcontent-%COMP%]{margin:0;font-style:italic;color:var(--sm-text-muted);font-size:.85rem}"],changeDetection:0})};function Tf(t){return typeof t=="string"&&t.length>0?t:null}var rJ=["closeBtn"];function aJ(t,n){if(t&1&&(f(0,"span",11),O(1,"i",19),h()),t&2){let e=m();E("pTooltip",e.headerStaleTooltip())}}function sJ(t,n){if(t&1&&(f(0,"span",12),$e(),f(1,"svg",20),O(2,"path",21)(3,"path",22)(4,"path",23),h()()),t&2){let e=m();E("pTooltip",e.cardTexts.stability.experimental)}}function cJ(t,n){if(t&1&&(f(0,"span",12),O(1,"i",24),h()),t&2){let e=m();E("pTooltip",e.cardTexts.stability.deprecated)}}function dJ(t,n){t&1&&(f(0,"span",13),v(1),h()),t&2&&(d(),C(n))}function lJ(t,n){if(t&1){let e=re();f(0,"button",25,0),V("click",function(o){L(e);let r=m();return B(r.onCloseClick(o))}),O(2,"i",26),h()}if(t&2){let e=m();E("pTooltip",e.texts.close.tooltip),q("aria-label",e.texts.close.label)}}function uJ(t,n){if(t&1&&(f(0,"div",17)(1,"span",27),v(2),h(),f(3,"button",28),O(4,"i",29),f(5,"span"),v(6),h()(),f(7,"button",30),O(8,"i",31),f(9,"span"),v(10),h()(),f(11,"button",32),O(12,"i",33),f(13,"span"),v(14),h()()()),t&2){let e=m();d(2),C(e.texts.actionMocks.label),d(4),C(e.texts.actionMocks.summary),d(4),C(e.texts.actionMocks.audit),d(4),C(e.texts.actionMocks.validate)}}function pJ(t,n){if(t&1&&(f(0,"span",34),v(1),h()),t&2){let e=n.$implicit;d(),C(e)}}function fJ(t,n){if(t&1&&(f(0,"div",18),Y(1,pJ,2,1,"span",34,xe),h()),t&2){let e=m();d(),X(e.headerTools())}}var hJ=new Set(["red","orange","yellow","green","cyan","blue","purple","pink"]),Pf=class t{node=N.required();mode=N("standalone");showActionMocks=N(!1);close=Le();favoriteToggle=Le();texts=Gn;cardTexts=Yn;closeBtn=Re("closeBtn");constructor(){ie(()=>{this.mode()==="embedded"&&(this.node(),queueMicrotask(()=>this.closeBtn()?.nativeElement.focus({preventScroll:!0})))})}headerVersion=S(()=>ua(this.node()));headerStability=S(()=>pa(this.node()));headerTitleColor=S(()=>{let n=this.node(),i=n.frontmatter.color;return typeof i=="string"&&hJ.has(i)?i:`var(--sm-kind-${n.kind})`});headerTools=S(()=>q_(this.node()));headerIsStale=S(()=>V_(this.node()));headerStaleTooltip=S(()=>j_(this.node(),Yn.sidecar));onCloseClick(n){n.stopPropagation(),this.close.emit()}onFavoriteClick(n){n.stopPropagation(),this.favoriteToggle.emit(this.node().path)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-inspector-header"]],viewQuery:function(e,i){e&1&&Tt(i.closeBtn,rJ,5),e&2&<()},inputs:{node:[1,"node"],mode:[1,"mode"],showActionMocks:[1,"showActionMocks"]},outputs:{close:"close",favoriteToggle:"favoriteToggle"},decls:21,vars:32,consts:[["closeBtn",""],["data-testid","inspector-title",1,"inspector__header"],["aria-hidden","true",1,"inspector__icon-box"],[3,"kind","provider","size"],[1,"inspector__content"],[1,"inspector__name-row"],["data-testid","inspector-title-text",1,"inspector__name"],["data-testid","inspector-path",1,"inspector__path-code"],[1,"inspector__actions-cluster"],["type","button","data-testid","inspector-favorite",1,"inspector__favorite",3,"click","pTooltip"],["aria-hidden","true",1,"pi"],["data-testid","inspector-stale-badge",1,"inspector__stale-icon",3,"pTooltip"],["data-testid","inspector-stability-tag",1,"inspector__stability-icon",3,"pTooltip"],["data-testid","inspector-version",1,"inspector__name-version"],["slot","inspector.header.badge.counter",3,"node"],["slot","inspector.header.badge.tag",3,"node"],["type","button","data-testid","inspector-close",1,"inspector__close",3,"pTooltip"],["data-testid","inspector-plugin-actions",1,"inspector__plugin-actions"],["data-testid","inspector-header-tools",1,"inspector__tools"],["aria-hidden","true",1,"pi","pi-clock"],["width","14","height","14","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true"],["d","M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2"],["d","M6.453 15h11.094"],["d","M8.5 2h7"],["aria-hidden","true",1,"pi","pi-ban"],["type","button","data-testid","inspector-close",1,"inspector__close",3,"click","pTooltip"],["aria-hidden","true",1,"pi","pi-times"],[1,"inspector__plugin-actions-label"],["type","button","data-testid","inspector-plugin-btn-summary",1,"inspector__plugin-btn"],["aria-hidden","true",1,"pi","pi-sparkles"],["type","button","data-testid","inspector-plugin-btn-audit",1,"inspector__plugin-btn"],["aria-hidden","true",1,"pi","pi-search"],["type","button","data-testid","inspector-plugin-btn-validate",1,"inspector__plugin-btn"],["aria-hidden","true",1,"pi","pi-check-circle"],[1,"inspector__tool-tag"]],template:function(e,i){if(e&1&&(f(0,"header",1)(1,"div",2),O(2,"sm-kind-icon",3),h(),f(3,"div",4)(4,"div",5)(5,"h2",6),v(6),h()(),f(7,"code",7),v(8),h()(),f(9,"div",8)(10,"button",9),V("click",function(r){return i.onFavoriteClick(r)}),O(11,"i",10),h(),I(12,aJ,2,1,"span",11),I(13,sJ,5,1,"span",12),I(14,cJ,2,1,"span",12),I(15,dJ,2,1,"span",13),O(16,"sm-view-contributions-host",14)(17,"sm-view-contributions-host",15),I(18,lJ,3,2,"button",16),h(),I(19,uJ,15,4,"div",17),I(20,fJ,3,0,"div",18),h()),e&2){let o,r=i.node();rt("--node-color",i.headerTitleColor()),de("inspector__header--skill",r.kind==="skill")("inspector__header--agent",r.kind==="agent")("inspector__header--command",r.kind==="command")("inspector__header--markdown",r.kind==="markdown"),d(2),E("kind",r.kind)("provider",r.provider)("size",18),d(4),C(r.frontmatter.name),d(2),C(r.path),d(2),de("inspector__favorite--on",r.isFavorite===!0),E("pTooltip",r.isFavorite===!0?i.cardTexts.favoriteRemoveTooltip:i.cardTexts.favoriteAddTooltip),q("aria-label",r.isFavorite===!0?i.cardTexts.ariaFavoriteRemove:i.cardTexts.ariaFavoriteAdd),d(),de("pi-star-fill",r.isFavorite===!0)("pi-star",r.isFavorite!==!0),d(),T(i.headerIsStale()?12:-1),d(),T(i.headerStability()==="experimental"?13:-1),d(),T(i.headerStability()==="deprecated"?14:-1),d(),T((o=i.headerVersion())?15:-1,o),d(),E("node",r),d(),E("node",r),d(),T(i.mode()==="embedded"?18:-1),d(),T(i.showActionMocks()?19:-1),d(),T(i.headerTools().length>0?20:-1)}},dependencies:[De,Be,Vn,yn],styles:["[_nghost-%COMP%]{--hero-fg: #fff;--hero-fg-bold: rgba(255, 255, 255, .95);--hero-fg-soft: rgba(255, 255, 255, .85);--hero-fg-muted: rgba(255, 255, 255, .7);--hero-fg-faint: rgba(255, 255, 255, .5);--hero-divider: rgba(255, 255, 255, .18);--hero-divider-strong: rgba(255, 255, 255, .32);--hero-divider-stronger: rgba(255, 255, 255, .45);--hero-overlay: rgba(255, 255, 255, .08);--hero-overlay-soft: rgba(255, 255, 255, .16);--hero-overlay-strong: rgba(255, 255, 255, .2);--hero-overlay-hover: rgba(255, 255, 255, .26);--hero-warn-fg: #fde68a;--hero-slate-fg: #475569}.inspector__header[_ngcontent-%COMP%]{--accent: var(--sm-kind-markdown);position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:.75rem;row-gap:.3rem;align-items:start;padding:.85rem 1rem;background:linear-gradient(to bottom,transparent 0%,transparent 75%,var(--sm-bg-content) 100%),color-mix(in srgb,var(--accent) 75%,var(--hero-slate-fg));color:var(--hero-fg);overflow:hidden}.inspector__header--skill[_ngcontent-%COMP%]{--accent: var(--sm-kind-skill)}.inspector__header--agent[_ngcontent-%COMP%]{--accent: var(--sm-kind-agent)}.inspector__header--command[_ngcontent-%COMP%]{--accent: var(--sm-kind-command)}.inspector__header--markdown[_ngcontent-%COMP%]{--accent: var(--sm-kind-markdown)}.inspector-view--embedded[_nghost-%COMP%] .inspector__header[_ngcontent-%COMP%], .inspector-view--embedded [_nghost-%COMP%] .inspector__header[_ngcontent-%COMP%]{margin:-1rem -1.1rem 0}.inspector__icon-box[_ngcontent-%COMP%]{width:42px;height:42px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:var(--hero-overlay-strong);color:var(--hero-fg);flex:none;font-size:1.1rem;grid-row:1 / span 3;align-self:center}.inspector__content[_ngcontent-%COMP%]{min-width:0;width:100%;display:flex;flex-direction:column;gap:.25rem}.inspector__name-row[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.35rem;min-width:0}.inspector__name[_ngcontent-%COMP%]{margin:0;font-size:1.05rem;font-weight:600;line-height:1.25;letter-spacing:-.01em;word-break:break-word;color:var(--hero-fg);flex:0 1 auto;min-width:0}.inspector__path-code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.7rem;color:var(--hero-fg-soft);background:var(--hero-overlay-soft);padding:.1rem .4rem;border-radius:var(--sm-radius-sm);word-break:break-all;align-self:flex-start;max-width:100%}.inspector__actions-cluster[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.3rem;align-self:center}.inspector__favorite[_ngcontent-%COMP%]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;background:transparent;border:0;padding:0;cursor:pointer;color:var(--hero-fg-soft);border-radius:var(--sm-radius-md);flex:none;transition:background .12s ease,color .12s ease}.inspector__favorite[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.85rem;line-height:1}.inspector__favorite[_ngcontent-%COMP%]:hover{background:var(--hero-divider);color:var(--hero-fg)}.inspector__favorite[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--hero-fg-muted);outline-offset:1px}.inspector__favorite--on[_ngcontent-%COMP%]{color:var(--hero-fg)}.inspector__stability-icon[_ngcontent-%COMP%], .inspector__stale-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;color:var(--hero-fg-soft);cursor:help}.inspector__stale-icon[_ngcontent-%COMP%]{color:var(--hero-warn-fg)}.inspector__stability-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .inspector__stability-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .inspector__stale-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .inspector__stale-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{font-size:.7rem;width:1em;height:1em;line-height:1}.inspector__close[_ngcontent-%COMP%]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;background:var(--hero-overlay-soft);border:1px solid var(--hero-divider-strong);border-radius:var(--sm-radius-md);padding:0;margin-left:.25rem;color:var(--hero-fg);cursor:pointer;flex:none;transition:background .12s ease,border-color .12s ease}.inspector__close[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.75rem;line-height:1}.inspector__close[_ngcontent-%COMP%]:hover{background:var(--hero-overlay-hover);border-color:var(--hero-divider-stronger)}.inspector__close[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--hero-fg-muted);outline-offset:1px}.inspector__name-version[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.66rem;color:var(--hero-fg-bold);background:var(--hero-overlay-strong);padding:.06rem .4rem;border-radius:var(--sm-radius-sm);line-height:1.2;flex:none}.inspector__plugin-actions[_ngcontent-%COMP%]{grid-column:1 / -1;display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;margin-top:.55rem}.inspector__plugin-actions-label[_ngcontent-%COMP%]{font-size:.6rem;text-transform:uppercase;letter-spacing:.06em;font-weight:600;color:var(--hero-fg-muted);margin-right:.15rem}.inspector__plugin-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;padding:.4rem .75rem;border:1px solid var(--hero-divider-strong);border-radius:var(--sm-radius-pill);background:var(--hero-overlay-soft);color:var(--hero-fg);font-size:.78rem;font-weight:500;cursor:pointer;transition:background .12s ease,border-color .12s ease,transform .12s ease;font-family:inherit}.inspector__plugin-btn[_ngcontent-%COMP%]:hover{background:var(--hero-overlay-hover);border-color:var(--hero-divider-stronger)}.inspector__plugin-btn[_ngcontent-%COMP%]:active{transform:translateY(1px)}.inspector__plugin-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.85rem}.inspector__tools[_ngcontent-%COMP%]{grid-column:1 / -1;display:flex;flex-wrap:wrap;align-items:center;gap:.3rem;padding:.45rem 1rem .55rem;margin:.6rem -1rem -.85rem}.inspector__tool-tag[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.12rem .5rem;border-radius:var(--sm-radius-sm);background:var(--sm-bg-hover);color:var(--p-text-color);font-family:var(--sm-font-mono);font-size:.66rem;font-weight:500;line-height:1.3;flex:none}"],changeDetection:0})};function c_(t){sn(c_);let{path:n,dataSource:e,markdown:i}=t,o=U("idle"),r=U(null),a=0,s=async(u,p)=>{try{let g=await e.getNode(u,{includeBody:!0});if(p!==a)return;if(g===null){o.set("unavailable");return}let b=g.item.body;if(b===null){o.set("unavailable");return}if(b===void 0||b.trim().length===0){o.set("empty");return}let M=await i.render(b);if(p!==a)return;r.set(M),o.set("ready")}catch{if(p!==a)return;o.set("error")}};ie(()=>{let u=n(),p=++a;if(r.set(null),!u){o.set("idle");return}o.set("loading"),s(u,p)});let c=()=>{let u=n();if(!u||o()==="loading")return;let p=++a;r.set(null),o.set("loading"),s(u,p)};return{bodyState:o.asReadonly(),bodyHtml:r.asReadonly(),refresh:c}}function d_(t){sn(d_);let{node:n,sidecarService:e,confirmation:i}=t,o=Gn,r=S(()=>{let P=n();if(!P)return!1;let R=P.sidecar;return!R||R.present===!1?!0:R.status==="fresh"?!1:z_(R)}),a=U(!1),s=U(null),c=S(()=>r()?o.bump.tooltipEnabled:o.bump.tooltipDisabledFresh),u=P=>{if(P instanceof Uf)switch(P.code){case"sidecar-fresh":return`${o.bump.errorPrefix} ${o.bump.errorFresh}`;case"not-found":return`${o.bump.errorPrefix} ${o.bump.errorNotFound}`;default:return`${o.bump.errorPrefix} ${P.message||o.bump.errorGeneric}`}let R=P instanceof Error?P.message:String(P);return`${o.bump.errorPrefix} ${R||o.bump.errorGeneric}`},p=async P=>{if(!a()){a.set(!0),s.set(null);try{await e.bump(P,{confirm:!0})}catch(R){s.set(u(R))}finally{a.set(!1)}}},g=P=>{i.confirm({header:o.bump.consentHeader,message:o.bump.consentMessage,acceptLabel:o.bump.consentAccept,rejectLabel:o.bump.consentReject,acceptButtonProps:{severity:"primary"},rejectButtonProps:{severity:"secondary"},accept:()=>{p(P)}})},b=async()=>{let P=n();if(P&&r()&&!a()){a.set(!0),s.set(null);try{await e.bump(P.path)}catch(R){if(R instanceof Uf&&R.code==="confirm-required"&&mJ(R.details)){g(P.path);return}s.set(u(R))}finally{a.set(!1)}}},M=()=>{s.set(null)};return{canBump:r,bumpInFlight:a.asReadonly(),bumpError:s.asReadonly(),bumpTooltip:c,onBumpClick:b,dismissBumpError:M}}function mJ(t){return typeof t!="object"||t===null?!1:t.key==="allowEditSmFiles"}function l_(t){sn(l_);let{path:n,pathSet:e,dataSource:i}=t,o=U(new Set),r=U(new Set),a=U(new Set);return ie(()=>{n(),o.set(new Set),r.set(new Set),a.set(new Set)}),{linkStatus:p=>e().has(p)||o().has(p)?"live":r().has(p)?"dead-confirmed":"dead-heuristic",isVerifying:p=>a().has(p),verifyDeadLink:async p=>{if(!(o().has(p)||r().has(p))&&!a().has(p)){a.update(g=>new Set(g).add(p));try{await i.getNode(p)===null?r.update(b=>new Set(b).add(p)):o.update(b=>new Set(b).add(p))}catch{}finally{a.update(g=>{let b=new Set(g);return b.delete(p),b})}}}}}function u_(t){sn(u_);let n=U(!1),e=U(!1),i=U(!1);return ie(()=>{t.path(),n.set(!1),e.set(!1),i.set(!1)}),{auditExpanded:n.asReadonly(),pluginsExpanded:e.asReadonly(),debugVisible:i.asReadonly(),toggleAudit:()=>n.update(o=>!o),togglePlugins:()=>e.update(o=>!o),toggleDebug:()=>i.update(o=>!o)}}var gJ=new Set(["inspector.body.panel.breakdown","inspector.body.panel.records","inspector.body.panel.tree","inspector.body.panel.key-values","inspector.body.panel.link-list","inspector.body.panel.markdown"]),_J=new Set(["identity","annotations","settings","audit"]),vJ=new Set(["agent","skill","command"]);function IM(t){let{node:n,texts:e}=t,i=S(()=>{let c=n()?.sidecar;if(!c||!c.present)return null;if(c.root)return c.root;let u={};return c.annotations&&(u.annotations=c.annotations),u}),o=S(()=>{let c=n()?.kind;return c!==void 0&&vJ.has(c)}),r=S(()=>{let c=i();if(!c)return!1;for(let u of Object.keys(c))if(!_J.has(u))return!0;return!1}),a=S(()=>{let c=n()?.contributions??[];for(let u of c)if(gJ.has(u.slot))return!0;return!1}),s=S(()=>{let c=i();if(!c)return e.audit.headerEmpty;let u=c.audit;if(typeof u!="object"||u===null)return e.audit.headerEmpty;let p=u,g=typeof p.lastBumpedAt=="string"?p.lastBumpedAt:null,b=typeof p.lastBumpedBy=="string"?p.lastBumpedBy:null;return g===null?e.audit.headerEmpty:e.audit.headerSummary(xo(g),b??"?")});return{sidecarRoot:i,hasVendorFrontmatter:o,hasPluginContributions:r,hasViewContributions:a,auditSummary:s}}function CJ(t,n){if(t&1&&(f(0,"section",0)(1,"div",1),O(2,"span",2),f(3,"p",3),v(4),h(),f(5,"p",4)(6,"span"),v(7),h(),f(8,"a",5),v(9),h(),f(10,"span"),v(11),h(),f(12,"a",6),v(13),h(),f(14,"span"),v(15),h()()()()),t&2){let e=m();d(4),C(e.texts.emptyNoSelection.title),d(3),C(e.texts.emptyNoSelection.descPrefix),d(2),C(e.texts.emptyNoSelection.listLink),d(2),C(e.texts.emptyNoSelection.descMiddle),d(2),C(e.texts.emptyNoSelection.graphLink),d(2),C(e.texts.emptyNoSelection.descSuffix)}}function bJ(t,n){if(t&1&&(f(0,"section",0)(1,"div",7),O(2,"span",8),f(3,"p",3),v(4),h(),f(5,"p",4)(6,"code"),v(7),h(),f(8,"span"),v(9),h(),f(10,"a",5),v(11),h(),f(12,"span"),v(13),h()()()()),t&2){let e=m();d(4),C(e.texts.emptyNotFound.title),d(3),C(e.path()),d(2),C(e.texts.emptyNotFound.descSuffix),d(2),C(e.texts.emptyNotFound.backLink),d(2),C(e.texts.emptyNotFound.descAfterLink)}}function xJ(t,n){if(t&1&&(f(0,"div",10)(1,"p",51),v(2),h()()),t&2){m();let e=ee(1);d(2),C(e.description)}}function wJ(t,n){if(t&1&&(f(0,"div",11),O(1,"i",47),f(2,"span"),v(3),h()()),t&2){let e=m(2);d(3),C(e.texts.supersededByBanner(n))}}function SJ(t,n){if(t&1){let e=re();f(0,"div",12)(1,"span"),v(2),h(),f(3,"button",52),V("click",function(){L(e);let o=m(2);return B(o.dismissBumpError())}),O(4,"i",53),h()()}if(t&2){let e=m(2);d(2),C(n),d(),q("aria-label",e.texts.bumpErrorDismissAriaLabel)}}function IJ(t,n){if(t&1&&(f(0,"a",15),v(1),h()),t&2){let e=m(2);d(),C(e.texts.backToList)}}function TJ(t,n){if(t&1&&(f(0,"div",16),O(1,"sm-vendor-frontmatter",54),h()),t&2){m();let e=ee(0),i=ee(1),o=m();d(),E("frontmatter",i)("kind",e.kind)("provider",e.provider)("knownPaths",o.pathSet())("onSkillClick",o.onSkillChip)}}function EJ(t,n){if(t&1){let e=re();f(0,"section",17)(1,"header",19),O(2,"i",55),f(3,"span",21),v(4),h(),O(5,"span",22),h(),f(6,"sm-annotations-panel",56),V("openPath",function(o){L(e);let r=m(2);return B(r.openPath(o))})("tagClick",function(o){L(e);let r=m(2);return B(r.tagSelect.emit(o))}),h()()}if(t&2){m();let e=ee(0),i=m();d(4),C(i.texts.sections.annotations),d(2),E("overlay",e.sidecar)("authorTags",i.authorTags())("knownPaths",i.pathSet())("activeTag",i.activeTag())}}function PJ(t,n){if(t&1&&(f(0,"p",65)(1,"strong"),v(2),h(),v(3),h()),t&2){let e=m(4);d(2),C(e.texts.findingHintLabel),d(),Fe(" ",n," ")}}function MJ(t,n){if(t&1&&(f(0,"li",60)(1,"div",61)(2,"span",62),v(3),h(),f(4,"code",63),v(5),h()(),f(6,"p",64),v(7),h(),I(8,PJ,4,2,"p",65),h()),t&2){let e,i=n.$implicit;q("data-severity",i.severity),d(2),q("data-severity",i.severity),d(),C(i.severity),d(2),C(i.analyzerId),d(2),C(i.message),d(),T((e=i.fix==null?null:i.fix.summary)?8:-1,e)}}function kJ(t,n){if(t&1&&(f(0,"section",24)(1,"header",19),O(2,"i",57),f(3,"span",21),v(4),h(),f(5,"span",58),v(6),h(),O(7,"span",22),h(),f(8,"ul",59),Y(9,MJ,9,6,"li",60,qf),h()()),t&2){let e=m(2);d(4),C(e.texts.sections.findings),d(2),C(e.issues().length),d(3),X(e.issues())}}function DJ(t,n){if(t&1&&O(0,"sm-inspector-audit-panel",30),t&2){let e=m(2);E("sidecarRoot",e.sidecarRoot())}}function OJ(t,n){if(t&1&&O(0,"sm-plugin-contributions",30),t&2){let e=m(3);E("sidecarRoot",e.sidecarRoot())}}function NJ(t,n){if(t&1){let e=re();f(0,"section",31)(1,"button",66),V("click",function(){L(e);let o=m(2);return B(o.togglePlugins())}),O(2,"i",67),f(3,"span",21),v(4),h(),O(5,"span",22)(6,"i",29),h(),I(7,OJ,1,1,"sm-plugin-contributions",30),h()}if(t&2){let e=m(2);d(),q("aria-expanded",e.pluginsExpanded()),d(3),C(e.texts.sections.plugins),d(2),de("pi-chevron-right",!e.pluginsExpanded())("pi-chevron-down",e.pluginsExpanded()),d(),T(e.pluginsExpanded()?7:-1)}}function RJ(t,n){if(t&1&&(f(0,"section",32)(1,"header",19),O(2,"i",68),f(3,"span",21),v(4),h(),O(5,"span",22),h(),O(6,"sm-inspector-slots-panel",69),h()),t&2){let e=m(2);d(4),C(e.texts.sections.viewContributions),d(2),E("node",e.node())}}function AJ(t,n){if(t&1&&(f(0,"div",36),O(1,"sm-inspector-debug-panel",70),h()),t&2){m();let e=ee(0),i=m();d(),E("node",e)("sidecarRoot",i.sidecarRoot())("overlay",e.sidecar)}}function FJ(t,n){if(t&1&&(f(0,"p",40),v(1),h()),t&2){let e=m(2);d(),C(e.texts.body.loading)}}function LJ(t,n){if(t&1&&(f(0,"p",41),v(1),h()),t&2){let e=m(2);d(),C(e.texts.body.empty)}}function BJ(t,n){if(t&1&&(f(0,"p",42),v(1),h()),t&2){let e=m(2);d(),C(e.texts.body.unavailable)}}function zJ(t,n){if(t&1&&(f(0,"p",43),v(1),h()),t&2){let e=m(2);d(),C(e.texts.body.renderError)}}function qJ(t,n){if(t&1&&O(0,"div",44),t&2){let e=m(2);E("innerHTML",e.bodyHtml(),g_)}}function VJ(t,n){if(t&1&&(f(0,"span")(1,"code"),v(2),h(),v(3),h(),f(4,"span",48),v(5,"\xB7"),h()),t&2){m();let e=ee(0),i=m();d(2),C(e.bytesTotal),d(),Fe(" ",i.texts.stats.bytes)}}function GJ(t,n){if(t&1&&(f(0,"span")(1,"code"),v(2),h(),v(3),h(),f(4,"span",48),v(5,"\xB7"),h()),t&2){m();let e=ee(0),i=m();d(2),C(e.tokensTotal),d(),Fe(" ",i.texts.stats.tokens)}}function HJ(t,n){if(t&1&&(f(0,"span",48),v(1,"\xB7"),h(),f(2,"code"),v(3),h(),O(4,"i",71),v(5)),t&2){m();let e=ee(0),i=m();d(3),C(e.externalRefsCount),d(2),Fe(" ",i.texts.stats.ext," ")}}function jJ(t,n){if(t&1){let e=re();ut(0)(1),f(2,"section",0)(3,"sm-inspector-header",9),V("close",function(){L(e);let o=m();return B(o.onHeaderClose())})("favoriteToggle",function(o){L(e);let r=m();return B(r.onHeaderFavoriteToggle(o))}),h(),I(4,xJ,3,1,"div",10),I(5,wJ,4,1,"div",11),I(6,SJ,5,2,"div",12),f(7,"div",13)(8,"p-button",14),V("onClick",function(){L(e);let o=m();return B(o.onBumpClick())}),h(),I(9,IJ,2,1,"a",15),h(),I(10,TJ,2,5,"div",16),I(11,EJ,7,5,"section",17),f(12,"section",18)(13,"header",19),O(14,"i",20),f(15,"span",21),v(16),h(),O(17,"span",22),h(),f(18,"sm-linked-nodes-panel",23),V("openPath",function(o){L(e);let r=m();return B(r.openPath(o))}),h()(),I(19,kJ,11,2,"section",24),f(20,"section",25)(21,"button",26),V("click",function(){L(e);let o=m();return B(o.toggleAudit())}),O(22,"i",27),f(23,"span",21),v(24),h(),f(25,"span",28),v(26),h(),O(27,"span",22)(28,"i",29),h(),I(29,DJ,1,1,"sm-inspector-audit-panel",30),h(),I(30,NJ,8,7,"section",31),I(31,RJ,7,2,"section",32),f(32,"section",33)(33,"button",34),V("click",function(){L(e);let o=m();return B(o.toggleDebug())}),O(34,"i",35),f(35,"span",21),v(36),h(),O(37,"span",22)(38,"i",29),h(),I(39,AJ,2,3,"div",36),h(),f(40,"section",37)(41,"header",19),O(42,"i",38),f(43,"span",21),v(44),h(),O(45,"span",22),f(46,"p-button",39),V("onClick",function(){L(e);let o=m();return B(o.refreshBody())}),h()(),I(47,FJ,2,1,"p",40)(48,LJ,2,1,"p",41)(49,BJ,2,1,"p",42)(50,zJ,2,1,"p",43)(51,qJ,1,1,"div",44),h(),f(52,"footer",45),I(53,VJ,6,2),I(54,GJ,6,2),f(55,"span",46)(56,"code"),v(57),h(),O(58,"i",47),v(59),f(60,"span",48),v(61,"\xB7"),h(),f(62,"code"),v(63),h(),O(64,"i",49),v(65),I(66,HJ,6,2),h()(),O(67,"p-confirmdialog",50),h()}if(t&2){let e,i,o,r=m(),a=Ke(r.node());d();let s=Ke(a.frontmatter);d(2),E("node",a)("mode",r.mode())("showActionMocks",r.showActionMocks),d(),T(s.description?4:-1),d(),T((e=r.headerSupersededBy())?5:-1,e),d(),T((i=r.bumpError())?6:-1,i),d(2),E("label",r.texts.bump.label)("disabled",!r.canBump()||r.bumpInFlight())("loading",r.bumpInFlight())("pTooltip",r.bumpTooltip()),d(),T(r.mode()==="standalone"?9:-1),d(),T(r.hasVendorFrontmatter()?10:-1),d(),T(a.sidecar!=null&&a.sidecar.present||r.authorTags().length>0?11:-1),d(5),C(r.texts.sections.connections),d(2),E("path",a.path),d(),T(r.issues().length>0?19:-1),d(2),q("aria-expanded",r.auditExpanded()),d(3),C(r.texts.sections.audit),d(2),Fe("\xB7 ",r.auditSummary()),d(2),de("pi-chevron-right",!r.auditExpanded())("pi-chevron-down",r.auditExpanded()),d(),T(r.auditExpanded()?29:-1),d(),T(r.hasPluginContributions()?30:-1),d(),T(r.hasViewContributions()?31:-1),d(2),E("pTooltip",r.texts.debugToggleTooltip),q("aria-expanded",r.debugVisible())("aria-label",r.texts.debugToggleAriaLabel),d(3),C(r.texts.sections.debug),d(2),de("pi-chevron-right",!r.debugVisible())("pi-chevron-down",r.debugVisible()),d(),T(r.debugVisible()?39:-1),d(5),C(r.texts.sections.body),d(2),E("rounded",!0)("text",!0)("ariaLabel",r.texts.body.refreshLabel)("pTooltip",r.texts.body.refreshLabel)("disabled",r.bodyState()==="loading"||!r.path())("loading",r.bodyState()==="loading"),d(),T((o=r.bodyState())==="loading"?47:o==="empty"?48:o==="unavailable"?49:o==="error"?50:o==="ready"?51:-1),d(6),T(a.bytesTotal!==void 0?53:-1),d(),T(a.tokensTotal!==void 0?54:-1),d(3),C(a.linksOutCount??0),d(2),Fe(" ",r.texts.stats.out," "),d(4),C(a.linksInCount??0),d(2),Fe(" ",r.texts.stats.in," "),d(),T(a.externalRefsCount!==void 0&&a.externalRefsCount>0?66:-1),d(),E("ariaLabel",r.texts.bump.consentDialogAriaLabel)}}var Mf=class t{loader=l(Ft);router=l(ta);dataSource=l(pn);markdown=l(i0);sidecarService=l(_f);confirmation=l(Ei);texts=Gn;cardTexts=Yn;showActionMocks=fo.inspector.actionMocks;path=N(void 0);mode=N("standalone");activeTag=N(null);close=Le();tagSelect=Le();node=S(()=>{let n=this.path();return n?this.loader.nodes().find(e=>e.path===n)??null:null});pathSet=S(()=>{let n=new Set;for(let e of this.loader.nodes())n.add(e.path);return n});authorTags=S(()=>{let e=(this.node()?.frontmatter??{}).tags;if(!Array.isArray(e))return[];let i=e.filter(o=>typeof o=="string"&&o.length>0);return[...new Set(i)].sort()});headerSupersededBy=S(()=>G_(this.node()));bodyHandle=c_({path:this.path,dataSource:this.dataSource,markdown:this.markdown});bodyState=this.bodyHandle.bodyState;bodyHtml=this.bodyHandle.bodyHtml;deadLink=l_({path:this.path,pathSet:this.pathSet,dataSource:this.dataSource});sectionCollapse=u_({path:this.path});auditExpanded=this.sectionCollapse.auditExpanded;pluginsExpanded=this.sectionCollapse.pluginsExpanded;debugVisible=this.sectionCollapse.debugVisible;derivations=IM({node:this.node,texts:this.texts});sidecarRoot=this.derivations.sidecarRoot;hasVendorFrontmatter=this.derivations.hasVendorFrontmatter;hasPluginContributions=this.derivations.hasPluginContributions;hasViewContributions=this.derivations.hasViewContributions;auditSummary=this.derivations.auditSummary;issues=U([]);issuesLoaderEffect=ie(n=>{let e=this.path();if(this.issues.set([]),!e)return;let i=!1;n(()=>{i=!0}),this.dataSource.listIssues({node:e}).then(o=>{i||this.issues.set(o.items)}).catch(()=>{i||this.issues.set([])})});ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}openPath(n){this.router.navigate(["/graph"],{queryParams:{path:n}})}onSkillChip=n=>{this.openPath(n)};pathExists(n){return this.pathSet().has(n)}linkStatus(n){return this.deadLink.linkStatus(n)}isVerifying(n){return this.deadLink.isVerifying(n)}verifyDeadLink(n){return this.deadLink.verifyDeadLink(n)}refreshBody(){this.bodyHandle.refresh()}onHeaderFavoriteToggle(n){let e=this.node();!e||e.path!==n||this.loader.toggleFavorite(n,!e.isFavorite)}onHeaderClose(){this.close.emit()}toggleAudit(){this.sectionCollapse.toggleAudit()}togglePlugins(){this.sectionCollapse.togglePlugins()}toggleDebug(){this.sectionCollapse.toggleDebug()}bumpHandle=d_({node:this.node,sidecarService:this.sidecarService,confirmation:this.confirmation});canBump=this.bumpHandle.canBump;bumpInFlight=this.bumpHandle.bumpInFlight;bumpError=this.bumpHandle.bumpError;bumpTooltip=this.bumpHandle.bumpTooltip;onBumpClick(){return this.bumpHandle.onBumpClick()}dismissBumpError(){this.bumpHandle.dismissBumpError()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-inspector-view"]],hostVars:2,hostBindings:function(e,i){e&2&&de("inspector-view--embedded",i.mode()==="embedded")},inputs:{path:[1,"path"],mode:[1,"mode"],activeTag:[1,"activeTag"]},outputs:{close:"close",tagSelect:"tagSelect"},features:[_e([Ei])],decls:3,vars:1,consts:[["data-testid","inspector-view",1,"inspector"],["data-testid","inspector-empty-no-selection",1,"empty-state"],[1,"empty-state__icon","pi","pi-eye"],[1,"empty-state__title"],[1,"empty-state__desc"],["routerLink","/list",1,"inspector__back"],["routerLink","/graph",1,"inspector__back"],["data-testid","inspector-empty-not-found",1,"empty-state"],[1,"empty-state__icon","empty-state__icon--warn","pi","pi-question-circle"],[3,"close","favoriteToggle","node","mode","showActionMocks"],["data-testid","inspector-hero",1,"inspector__hero"],["data-testid","inspector-superseded-banner",1,"inspector__superseded"],["data-testid","inspector-bump-error",1,"inspector__bump-error"],[1,"inspector__toolbar"],["icon","pi pi-arrow-up-right","severity","secondary","size","small","data-testid","inspector-bump",3,"onClick","label","disabled","loading","pTooltip"],["routerLink","/list","data-testid","inspector-back",1,"inspector__back"],["data-testid","inspector-card-vendor-frontmatter",1,"inspector__vendor"],["data-testid","inspector-card-annotations",1,"sm-section"],["data-testid","inspector-card-linked-nodes",1,"sm-section"],[1,"sm-section__head"],["aria-hidden","true",1,"pi","pi-share-alt","sm-section__icon"],[1,"sm-section__title"],["aria-hidden","true",1,"sm-section__rule"],[3,"openPath","path"],["data-testid","inspector-findings",1,"sm-section"],["data-testid","inspector-card-audit",1,"sm-section","sm-section--collapsible"],["type","button","data-testid","inspector-audit-toggle",1,"sm-section__head","sm-section__head--toggle",3,"click"],["aria-hidden","true",1,"pi","pi-history","sm-section__icon"],["data-testid","inspector-audit-summary",1,"sm-section__summary"],["aria-hidden","true",1,"pi","sm-section__chevron"],[3,"sidecarRoot"],["data-testid","inspector-card-plugins",1,"sm-section","sm-section--collapsible"],["data-testid","inspector-card-view-contributions",1,"sm-section"],["data-testid","inspector-card-debug",1,"sm-section","sm-section--collapsible"],["type","button","data-testid","inspector-debug-toggle",1,"sm-section__head","sm-section__head--toggle",3,"click","pTooltip"],["aria-hidden","true",1,"pi","pi-info-circle","sm-section__icon"],["data-testid","inspector-debug-section",1,"inspector__debug"],["data-testid","inspector-card-body",1,"sm-section","inspector__body-section"],["aria-hidden","true",1,"pi","pi-file","sm-section__icon"],["icon","pi pi-refresh","severity","secondary","size","small","data-testid","inspector-body-refresh",3,"onClick","rounded","text","ariaLabel","pTooltip","disabled","loading"],["data-testid","inspector-body-loading",1,"inspector__body-status"],["data-testid","inspector-body-empty",1,"inspector__body-status"],["data-testid","inspector-body-unavailable",1,"inspector__body-status","inspector__body-status--warn"],["data-testid","inspector-body-error",1,"inspector__body-status","inspector__body-status--warn"],["data-testid","inspector-body-rendered",1,"inspector__body-rendered",3,"innerHTML"],["data-testid","inspector-stats-footer",1,"inspector__stats-footer"],[1,"inspector__stats-links"],["aria-hidden","true",1,"pi","pi-arrow-up-right"],["aria-hidden","true",1,"inspector__stats-sep"],["aria-hidden","true",1,"pi","pi-arrow-down-left"],["data-testid","inspector-bump-consent","styleClass","sm-consent-dialog",3,"ariaLabel"],["data-testid","inspector-description",1,"inspector__desc"],["type","button",1,"inspector__bump-error-dismiss",3,"click"],["aria-hidden","true",1,"pi","pi-times"],[3,"frontmatter","kind","provider","knownPaths","onSkillClick"],["aria-hidden","true",1,"pi","pi-bookmark","sm-section__icon"],[3,"openPath","tagClick","overlay","authorTags","knownPaths","activeTag"],["aria-hidden","true",1,"pi","pi-search","sm-section__icon"],[1,"sm-section__count"],[1,"inspector__findings-list"],["data-testid","inspector-finding",1,"inspector__finding"],[1,"inspector__finding-head"],[1,"inspector__finding-severity"],[1,"inspector__finding-analyzer"],[1,"inspector__finding-message"],["data-testid","inspector-finding-hint",1,"inspector__finding-hint"],["type","button","data-testid","inspector-plugins-toggle",1,"sm-section__head","sm-section__head--toggle",3,"click"],["aria-hidden","true",1,"pi","pi-bolt","sm-section__icon"],["aria-hidden","true",1,"pi","pi-th-large","sm-section__icon"],[3,"node"],[3,"node","sidecarRoot","overlay"],["aria-hidden","true",1,"pi","pi-external-link"]],template:function(e,i){e&1&&I(0,CJ,16,6,"section",0)(1,bJ,14,5,"section",0)(2,jJ,68,53,"section",0),e&2&&T(i.path()?i.node()?2:1:0)},dependencies:[w_,un,ln,De,Be,da,ca,Cf,yf,xf,wf,Sf,If,Ef,Pf],styles:["[_nghost-%COMP%]{display:block}.inspector[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.1rem}.inspector--empty[_ngcontent-%COMP%]{padding:2rem;color:var(--p-text-muted-color)}.inspector--empty[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-bg-hover);padding:.1rem .35rem;border-radius:var(--sm-radius-md);font-size:.85rem}.inspector__hero[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.inspector__desc[_ngcontent-%COMP%]{margin:0;color:var(--p-text-color);font-size:.95rem;line-height:1.55;max-width:70ch}.inspector__toolbar[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;flex-wrap:wrap}.inspector__back[_ngcontent-%COMP%]{font-size:.9rem;color:var(--p-primary-color)}[_nghost-%COMP%] .sm-section{display:flex;flex-direction:column;gap:.55rem}[_nghost-%COMP%] .sm-section__head{display:flex;align-items:center;gap:.55rem;width:100%;padding:0;margin:0;background:transparent;border:none;text-align:left;font:inherit;color:var(--p-text-color)}[_nghost-%COMP%] .sm-section__head--toggle{cursor:pointer}[_nghost-%COMP%] .sm-section__head--toggle:hover .sm-section__title{color:var(--p-primary-color)}[_nghost-%COMP%] .sm-section__icon{color:var(--p-primary-color);font-size:.95rem}[_nghost-%COMP%] .sm-section__title{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--p-text-color)}[_nghost-%COMP%] .sm-section__count{font-size:.72rem;font-weight:600;letter-spacing:.04em;padding:.05rem .45rem;border-radius:var(--sm-radius-pill);background:var(--p-primary-50);color:var(--p-primary-color)}[_nghost-%COMP%] .sm-section__summary{font-size:.78rem;color:var(--sm-text-muted);font-style:italic;font-weight:400;text-transform:none;letter-spacing:0}[_nghost-%COMP%] .sm-section__rule{flex:1 1 auto;height:1px;background:var(--sm-border);margin-left:.15rem}[_nghost-%COMP%] .sm-section__chevron{color:var(--sm-text-muted);font-size:.78rem}[_nghost-%COMP%] .sm-section__kv{display:grid;grid-template-columns:max-content 1fr;column-gap:.85rem;row-gap:.35rem;margin:0;font-size:.85rem;align-items:center}[_nghost-%COMP%] .sm-section__kv dt{color:var(--sm-text-muted);font-weight:500;font-size:.82rem}[_nghost-%COMP%] .sm-section__kv dd{margin:0;word-break:break-word;color:var(--p-text-color)}[_nghost-%COMP%] .sm-section__kv code{background:var(--sm-bg-hover);padding:.05rem .4rem;border-radius:var(--sm-radius-sm);font-size:.78rem;font-family:var(--sm-font-mono)}.inspector__vendor[_ngcontent-%COMP%]{display:contents}.inspector__body-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.55rem}.inspector__body-status[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--p-text-muted-color);font-style:italic}.inspector__body-status--warn[_ngcontent-%COMP%]{color:var(--sm-severity-warn);font-style:normal}.inspector__body-rendered[_ngcontent-%COMP%]{font-size:.9rem;line-height:1.6;max-height:600px;overflow:auto;padding:.25rem 0 0}.inspector__body-rendered[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:0}.inspector__body-rendered[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:0}.inspector__body-rendered[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{background:var(--p-content-background);border:1px solid var(--p-content-border-color);border-radius:var(--sm-radius-md);padding:.75rem;margin:.75rem 0;white-space:pre-wrap;word-wrap:break-word;font-family:var(--sm-font-mono);font-size:.85rem;line-height:1.5;overflow-x:auto}.inspector__body-rendered[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--p-content-background);padding:.1rem .3rem;border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.85em}.inspector__body-rendered[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:transparent;padding:0;border-radius:0}.inspector__stats-footer[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem;padding-top:.6rem;border-top:1px solid var(--sm-border);font-size:.78rem;color:var(--sm-text-muted)}.inspector__stats-footer[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-bg-hover);padding:.05rem .35rem;border-radius:var(--sm-radius-sm);font-size:.78rem;color:var(--p-text-color)}.inspector__stats-footer[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.72rem}.inspector__stats-sep[_ngcontent-%COMP%]{color:var(--sm-border);margin:0 .15rem}.inspector__stats-links[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;flex-wrap:wrap}.inspector__superseded[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.55rem .85rem;background:var(--sm-severity-warn-bg);color:var(--sm-severity-warn);border-radius:var(--sm-radius-md);font-size:.85rem;font-family:var(--sm-font-mono)}.inspector__bump-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem;padding:.5rem .75rem;background:var(--sm-severity-error-bg);color:var(--sm-severity-error);border-radius:var(--sm-radius-md);font-size:.85rem}.inspector__bump-error-dismiss[_ngcontent-%COMP%]{margin-left:auto;background:transparent;border:none;cursor:pointer;color:inherit;display:inline-flex;align-items:center;justify-content:center}.inspector__debug[_ngcontent-%COMP%]{padding:.7rem .9rem;border:1px solid var(--sm-border);border-radius:var(--sm-radius-md);background:var(--sm-bg-hover)}.inspector__findings-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.inspector__finding[_ngcontent-%COMP%]{padding:.6rem .75rem;border-left:3px solid var(--p-content-border-color);background:var(--p-content-background);border-radius:var(--sm-radius-md)}.inspector__finding[data-severity=error][_ngcontent-%COMP%]{border-left-color:var(--sm-severity-error);background:var(--sm-severity-error-bg)}.inspector__finding[data-severity=warn][_ngcontent-%COMP%]{border-left-color:var(--sm-severity-warn);background:var(--sm-severity-warn-bg)}.inspector__finding[data-severity=info][_ngcontent-%COMP%]{border-left-color:var(--sm-severity-info);background:var(--sm-severity-info-bg)}.inspector__finding-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.25rem}.inspector__finding-severity[_ngcontent-%COMP%]{text-transform:uppercase;font-size:.7rem;font-weight:700;letter-spacing:.04em;padding:.1rem .4rem;border-radius:var(--sm-radius-sm);color:var(--p-content-background);background:var(--p-text-color)}.inspector__finding-severity[data-severity=error][_ngcontent-%COMP%]{background:var(--sm-severity-error)}.inspector__finding-severity[data-severity=warn][_ngcontent-%COMP%]{background:var(--sm-severity-warn)}.inspector__finding-severity[data-severity=info][_ngcontent-%COMP%]{background:var(--sm-severity-info)}.inspector__finding-analyzer[_ngcontent-%COMP%]{font-size:.8rem;color:var(--p-text-muted-color)}.inspector__finding-message[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--p-text-color)}.inspector__finding-hint[_ngcontent-%COMP%]{margin:.4rem 0 0;font-size:.85rem;color:var(--p-text-color);background:var(--p-content-background);padding:.4rem .5rem;border-radius:var(--sm-radius-sm)}.inspector-view--embedded[_nghost-%COMP%] .inspector[_ngcontent-%COMP%]{padding:1rem 1.1rem 1.25rem;gap:.95rem}.inspector-view--embedded[_nghost-%COMP%] .inspector__desc[_ngcontent-%COMP%]{font-size:.9rem;line-height:1.5;max-width:none}.inspector-view--embedded[_nghost-%COMP%] .inspector__body-rendered[_ngcontent-%COMP%]{max-height:480px}[_nghost-%COMP%] .ann-panel__chip--author, [_nghost-%COMP%] .ann-panel__chip--user{padding:.1rem .55rem}"],changeDetection:0})};var kf=class t{smMiddleMousePan=N.required();origin=null;rafId=null;pendingPosition=null;onMouseDown(n){if(n.button!==1)return;let e=this.smMiddleMousePan();if(!e)return;n.preventDefault();let i=e.getPosition()??{x:0,y:0};this.origin={mouseX:n.clientX,mouseY:n.clientY,canvasX:i.x,canvasY:i.y},document.addEventListener("mousemove",this.onMove),document.addEventListener("mouseup",this.onEnd)}ngOnDestroy(){this.onEnd()}onMove=n=>{this.origin&&(this.pendingPosition={x:this.origin.canvasX+(n.clientX-this.origin.mouseX),y:this.origin.canvasY+(n.clientY-this.origin.mouseY)},this.rafId===null&&(this.rafId=requestAnimationFrame(()=>{this.rafId=null;let e=this.smMiddleMousePan();!e||!this.pendingPosition||(e.setPosition(this.pendingPosition),e.redraw())})))};onEnd=()=>{this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.pendingPosition=null,this.origin=null,document.removeEventListener("mousemove",this.onMove),document.removeEventListener("mouseup",this.onEnd),this.smMiddleMousePan()?.emitCanvasChangeEvent()};static \u0275fac=function(e){return new(e||t)};static \u0275dir=Ee({type:t,selectors:[["","smMiddleMousePan",""]],hostBindings:function(e,i){e&1&&V("mousedown",function(r){return i.onMouseDown(r)})},inputs:{smMiddleMousePan:[1,"smMiddleMousePan"]}})};function TM(t,n){if(t.size===0)return{next:t,dirty:!1};let e=!1,i=new Set;for(let o of t)n.has(o)?i.add(o):e=!0;return{next:e?i:t,dirty:e}}function EM(t){let{nodes:n,current:e,layout:i}=t,o=new Set(n.map(c=>c.path)),r=!1,a=new Map(e);for(let c of a.keys())o.has(c)||(a.delete(c),r=!0);let s=!1;for(let c of o)if(!a.has(c)){s=!0;break}for(let c of o){let u=i.positions.get(c);if(!u)continue;let p=a.get(c);if(!p){a.set(c,{x:u.x,y:u.y}),r=!0;continue}p.manual!==!0&&s&&(p.x===u.x&&p.y===u.y||(a.set(c,{x:u.x,y:u.y}),r=!0))}return{next:a,dirty:r}}function PM(t){let{selectedPath:n,setSelectedNodeId:e,readSelectedNodeId:i,graphNodes:o,router:r,route:a}=t,s=L_(a.queryParamMap.pipe(f_(c=>c.get("path"))),{initialValue:a.snapshot.queryParamMap.get("path")});ie(()=>{let c=s(),u=o();if(u.length===0||!c)return;let p=Rt(()=>i());if(p!==null&&u.find(M=>M.id===p)?.view.path===c)return;let g=u.find(b=>b.view.path===c);g&&e(g.id)}),ie(()=>{let c=n(),u=Rt(()=>s());(c??null)!==(u??null)&&r.navigate([],{relativeTo:a,queryParams:{path:c??null},queryParamsHandling:"merge",replaceUrl:!0})})}function MM(t,n){let i=t.frontmatter.tags;if(Array.isArray(i)&&i.includes(n))return!0;let r=t.sidecar?.annotations?.tags;return!!(Array.isArray(r)&&r.includes(n))}function kM(t){if(typeof t!="object"||t===null)return!1;let n=t;return typeof n.x=="number"&&typeof n.y=="number"&&Number.isFinite(n.x)&&Number.isFinite(n.y)}function DM(t){if(typeof t!="object"||t===null)return!1;let n=t;return typeof n.x=="number"&&typeof n.y=="number"&&typeof n.scale=="number"&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.scale)&&n.scale>0}function OM(t){return t.querySelector(".p-overlay-mask, .p-dialog, .p-overlay")!==null}var NM="sm.graph.viewport",RM="sm.graph.node-positions",AM="sm.graph.node-expanded",FM="sm.graph.panel-width";function LM(){let t=null;try{t=localStorage.getItem(NM)}catch{return null}if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return DM(n)?n:null}function BM(t){try{localStorage.setItem(NM,JSON.stringify(t))}catch{}}function zM(){let t=new Map,n=null;try{n=localStorage.getItem(RM)}catch{return t}if(!n)return t;let e;try{e=JSON.parse(n)}catch{return t}if(typeof e!="object"||e===null)return t;for(let[i,o]of Object.entries(e)){if(!kM(o))continue;let r=o,s=r.manual===!0?{x:r.x,y:r.y,manual:!0}:{x:r.x,y:r.y};t.set(i,s)}return t}function Df(t){try{let n={};for(let[e,i]of t)n[e]=i.manual?{x:i.x,y:i.y,manual:!0}:{x:i.x,y:i.y};localStorage.setItem(RM,JSON.stringify(n))}catch{}}function qM(){let t=null;try{t=localStorage.getItem(AM)}catch{return new Set}if(!t)return new Set;let n;try{n=JSON.parse(t)}catch{return new Set}if(!Array.isArray(n))return new Set;let e=new Set;for(let i of n)typeof i=="string"&&i.length>0&&e.add(i);return e}function Of(t){try{localStorage.setItem(AM,JSON.stringify([...t]))}catch{}}function VM(){let t=null;try{t=localStorage.getItem(FM)}catch{return null}if(!t)return null;let n=Number(t);return!Number.isFinite(n)||n<=0?null:n}function GM(t){try{localStorage.setItem(FM,String(Math.round(t)))}catch{}}var HM=400,Nf=400,jM=80;function UM(t){let n=U(t.initialWidth),e=U(typeof window>"u"?1920:window.innerWidth);typeof window<"u"&&h_(window,"resize").pipe(la(t.destroyRef)).subscribe(()=>e.set(window.innerWidth));let i=S(()=>{let g=Math.max(Nf,e()-jM),b=n();return b>g||b<Nf?Math.min(HM,g):b}),o=null,r=null,a=null,s=()=>{a=null,r!==null&&(n.set(r),r=null)},c=g=>{if(!o)return;let b=g.clientX-o.mouseX,M=o.widthAtStart-b,P=Math.max(Nf,e()-jM);r=Math.min(P,Math.max(Nf,M)),a===null&&typeof window<"u"&&(a=window.requestAnimationFrame(s))},u=()=>{o&&(o=null,document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u),a!==null&&typeof window<"u"&&(window.cancelAnimationFrame(a),a=null),r!==null&&(n.set(r),r=null),t.onCommit(n()))};return{clampedPanelWidth:i,onPanelResizeStart:g=>{g.button===0&&(g.preventDefault(),g.stopPropagation(),o={mouseX:g.clientX,widthAtStart:i()},document.addEventListener("mousemove",c),document.addEventListener("mouseup",u))}}}function Rf(t){let{points:n,wrap:e,panelW:i,zoomMin:o}=t;if(n.length===0)return null;let r=1/0,a=1/0,s=-1/0,c=-1/0;for(let Ce of n)Ce.x<r&&(r=Ce.x),Ce.y<a&&(a=Ce.y),Ce.x+260>s&&(s=Ce.x+260),Ce.y+120>c&&(c=Ce.y+120);let u=Math.max(1,e.width-i),p=Math.max(1,s-r),g=Math.max(1,c-a),b=Math.max(1,u-160),M=Math.max(1,e.height-160),P=Math.min(b/p,M/g),R=Math.min(2,Math.max(o,P)),H=(r+s)/2,z=(a+c)/2,j=u/2-H*R,oe=e.height/2-z*R;return{position:{x:j,y:oe},scale:R}}function Af(t,n,e){if(typeof requestAnimationFrame>"u"||e<=0){t.writePosition(n.position),t.writeScale(n.scale);return}let i=t.readPosition(),o=t.readScale(),r=performance.now(),a=s=>{if(t.isStaleToken())return;let c=Math.min(1,(s-r)/e),u=UJ(c);t.writePosition({x:i.x+(n.position.x-i.x)*u,y:i.y+(n.position.y-i.y)*u}),t.writeScale(o+(n.scale-o)*u),c<1&&requestAnimationFrame(a)};requestAnimationFrame(a)}function UJ(t){return 1-Math.pow(1-t,3)}var WM=320;function $M(t){let n=U(null),e=null,i=0,o=(c,u)=>{let p=++i;Af({readPosition:()=>t.viewportPosition(),readScale:()=>t.viewportScale(),writePosition:g=>t.viewportPosition.set(g),writeScale:g=>t.viewportScale.set(g),isStaleToken:()=>p!==i},c,u)},r=c=>{let u=t.canvasWrap();if(!u||c.length===0)return;let p=t.fullLayout(),g=[];for(let M of c){let P=p.positions.get(M);P&&g.push(P)}if(g.length===0)return;let b=Rf({points:g,wrap:u,panelW:t.selectedNodeId()!==null?t.clampedPanelWidth():0,zoomMin:t.zoomMin});b&&o(b,WM)},a=()=>{let c=e;c&&(e=null,o({position:c.position,scale:c.scale},WM))};return{activeTagSelection:n,onTagSelect:c=>{let u=t.flow();if(!u)return;if(n()===c){u.clearSelection(),n.set(null),a();return}let p=t.nodes().filter(g=>MM(g,c)).map(g=>g.path);if(p.length===0){u.clearSelection(),n.set(null),a();return}e===null&&(e={position:se({},t.viewportPosition()),scale:t.viewportScale()}),u.select(p,[]),n.set(c),r(p)}}}var Ff=.25,p_=2;function KM(t){let n=U(t.savedViewport?{x:t.savedViewport.x,y:t.savedViewport.y}:{x:0,y:0}),e=U(t.savedViewport?.scale??1),i=S(()=>e()<p_-1e-6),o=S(()=>e()>Ff+1e-6);return{viewportPosition:n,viewportScale:e,canZoomIn:i,canZoomOut:o,onCanvasChange:a=>{let s=n();(s.x!==a.position.x||s.y!==a.position.y)&&n.set({x:a.position.x,y:a.position.y}),e()!==a.scale&&e.set(a.scale),t.hasCompletedInitialLayout()&&BM({x:a.position.x,y:a.position.y,scale:a.scale})}}}function YM(t){let n=S(()=>{let c=new Map;for(let u of t.graph().edges)c.has(u.from)||c.set(u.from,new Set),c.has(u.to)||c.set(u.to,new Set),c.get(u.from).add(u.to),c.get(u.to).add(u.from);return c}),e=c=>t.selectedNodeId()===c,i=c=>{let u=t.selectedNodeId();return u===null||u===c?!1:n().get(u)?.has(c)??!1},o=c=>{if(t.activeTagSelection()!==null)return!1;let u=t.selectedNodeId();return u===null||u===c?!1:!(n().get(u)?.has(c)??!1)},r=c=>{let u=t.selectedNodeId();return u!==null&&(c.from===u||c.to===u)},a=c=>{if(t.activeTagSelection()!==null)return!1;let u=t.selectedNodeId();return u===null?!1:c.from!==u&&c.to!==u},s=S(()=>{let c=t.selectedNodeId(),u=t.activeTagSelection()!==null,p=c!==null?n().get(c)??null:null,g=new Map;for(let b of t.graph().nodes){let M=b.id,P=c===M,R=!P&&c!==null&&(p?.has(M)??!1),H=!u&&c!==null&&!P&&!(p?.has(M)??!1);g.set(M,{selected:P,highlighted:R,dimmed:H})}return g});return{isSelected:e,isHighlighted:i,isDimmed:o,isEdgeHighlighted:r,isEdgeDimmed:a,selectionView:s}}function XM(t){let n=t.onCommit??Df,e=null,i=!1,o=null,r=()=>{queueMicrotask(()=>{if(!i){o=null;return}i=!1,o&&(t.nodePositions.set(o),o=null),n(t.nodePositions())})},a=(u,p)=>{o||(o=new Map(t.nodePositions())),o.set(u,{x:p.x,y:p.y,manual:!0}),i=!0},s=u=>{e={x:u.clientX,y:u.clientY},document.addEventListener("mouseup",r,{once:!0})},c=u=>{let p=e;if(e=null,!p)return!0;let g=u.clientX-p.x,b=u.clientY-p.y;return Math.hypot(g,b)<=4};return t.destroyRef.onDestroy(()=>{document.removeEventListener("mouseup",r)}),{onNodePositionChange:a,onNodePointerDown:s,isClickWithoutDrag:c}}function ZM(t){let n=U(qM());return ie(()=>{let r=new Set(t.nodes().map(s=>s.path));if(r.size===0)return;let a=TM(n(),r);a.dirty&&(n.set(a.next),Of(a.next))}),{isExpanded:r=>n().has(r),setExpanded:(r,a)=>{let s=n();if(s.has(r)===a)return;let c=new Set(s);a?c.add(r):c.delete(r),n.set(c),Of(c)},resetAll:()=>{n.set(new Set),Of(new Set)},expandedNodeIds:n}}function QM(t){let n=!1,e=null;return ie(()=>{let i=t.visibleNodes();n||i.length!==0&&queueMicrotask(()=>{n=!0,t.savedViewport||t.fit()})}),ie(()=>{let i=t.pathsFingerprint();if(!n){e=i;return}e!==i&&(e=i,(t.animatedFit??t.fit)())}),{hasCompletedInitialLayout:()=>n}}var WJ=["canvasWrap"],tk=(t,n)=>n.id;function $J(t,n){if(t&1&&(f(0,"div",2),O(1,"span",7),f(2,"p",8),v(3),h()()),t&2){let e=m();d(3),C(e.texts.loading)}}function KJ(t,n){if(t&1&&(f(0,"div",3),O(1,"span",9),f(2,"p",8),v(3),h(),f(4,"p",10),v(5),h()()),t&2){let e=m();d(3),C(e.texts.errorTitle),d(2),C(e.error())}}function YJ(t,n){if(t&1){let e=re();f(0,"div",4),O(1,"i",11),f(2,"p",12),v(3),h(),f(4,"p-button",13),V("onClick",function(){L(e);let o=m();return B(o.resetFilters())}),h()()}if(t&2){let e=m();d(3),C(e.texts.emptyTitle),d(),E("label",e.texts.resetFilters)("text",!0)}}function XJ(t,n){if(t&1&&(f(0,"f-connection",33),$e(),f(1,"svg",34),O(2,"circle",35),h(),Gr(),O(3,"f-connection-marker-arrow",36),h()),t&2){let e=n.$implicit,i=m(2);Ne("f-conn--"+e.kind),rt("opacity",i.edgeOpacity(e)),de("f-conn--highlighted",i.isEdgeHighlighted(e))("f-conn--dimmed",i.isEdgeDimmed(e)),E("fOutputId",e.from+"-out")("fInputId",e.to+"-in")("fOutputSide",i.outputSide())("fInputSide",i.inputSide())("fType",i.connectionType())("fBehavior",i.connectionBehavior)("fReassignDisabled",!0),d(),E("type",i.markerStart)("width",9)("height",9)("refX",4.5)("refY",4.5),d(2),E("type",i.markerEnd)}}function ZJ(t,n){if(t&1){let e=re();Wn(0,20),f(1,"div",38),V("fNodePositionChange",function(o){let r=L(e).$implicit,a=m(3);return B(a.onNodePositionChange(r.id,o))})("pointerdown",function(o){L(e);let r=m(3);return B(r.onNodePointerDown(o))})("click",function(o){let r=L(e).$implicit,a=m(3);return B(a.selectNode(r,o))})("dblclick",function(){let o=L(e).$implicit,r=m(3);return B(r.openNode(o))}),f(2,"sm-node-card",39),V("expandedChange",function(o){let r=L(e).$implicit,a=m(3);return B(a.setExpanded(r.id,o))})("favoriteToggle",function(o){L(e);let r=m(3);return B(r.onFavoriteToggle(o))}),h(),f(3,"div",40),O(4,"sm-view-contributions-host",41),h()(),$n()}if(t&2){let e=n.$implicit,i=m(3);d(),E("fNodeId",e.id)("fNodePosition",e.position)("fInputId",e.id+"-in")("fInputConnectableSide",i.inputSide())("fOutputId",e.id+"-out")("fOutputConnectableSide",i.outputSide()),q("data-testid","graph-node-"+e.id),d(),E("node",e.view)("stats",e.stats)("summary",e.summary)("selection",i.selectionFor(e.id))("expanded",i.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),d(2),E("node",e.view)}}function QJ(t,n){if(t&1&&be(0,ZJ,5,14,"ng-container",37),t&2){let e=m(2);E("fVirtualForOf",e.graph().nodes)}}function JJ(t,n){if(t&1){let e=re();f(0,"div",43),V("fNodePositionChange",function(o){let r=L(e).$implicit,a=m(3);return B(a.onNodePositionChange(r.id,o))})("pointerdown",function(o){L(e);let r=m(3);return B(r.onNodePointerDown(o))})("click",function(o){let r=L(e).$implicit,a=m(3);return B(a.selectNode(r,o))})("dblclick",function(){let o=L(e).$implicit,r=m(3);return B(r.openNode(o))}),f(1,"sm-node-card",39),V("expandedChange",function(o){let r=L(e).$implicit,a=m(3);return B(a.setExpanded(r.id,o))})("favoriteToggle",function(o){L(e);let r=m(3);return B(r.onFavoriteToggle(o))}),h(),f(2,"div",40),O(3,"sm-view-contributions-host",41),h()()}if(t&2){let e=n.$implicit,i=m(3);E("fNodeId",e.id)("fNodePosition",e.position)("fInputId",e.id+"-in")("fOutputId",e.id+"-out"),q("data-testid","graph-node-"+e.id),d(),E("node",e.view)("stats",e.stats)("summary",e.summary)("selection",i.selectionFor(e.id))("expanded",i.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),d(2),E("node",e.view)}}function eee(t,n){if(t&1&&(Wn(0,20),Y(1,JJ,4,12,"div",42,tk),$n()),t&2){let e=m(2);d(),X(e.graph().nodes)}}function tee(t,n){if(t&1&&O(0,"sm-perf-hud",26),t&2){let e=m(2);E("visible",e.visibleCount())("total",e.totalCount())("edges",e.edgeCount())}}function nee(t,n){if(t&1){let e=re();f(0,"div",14,0),V("click",function(o){L(e);let r=m();return B(r.onCanvasClick(o))}),f(2,"f-flow",15),V("fLoaded",function(){L(e);let o=m();return B(o.onLoaded())}),O(3,"f-selection-area"),f(4,"f-background"),O(5,"f-rect-pattern"),h(),O(6,"f-line-alignment",16),f(7,"f-canvas",17),V("fCanvasChange",function(o){L(e);let r=m();return B(r.onCanvasChange(o))}),Wn(8,18),Y(9,XJ,4,21,"f-connection",19,tk),$n(),I(11,QJ,1,1,"ng-container",20)(12,eee,3,0,"ng-container",20),h(),O(13,"f-minimap"),h(),f(14,"div",21),O(15,"sm-kind-palette")(16,"sm-severity-palette")(17,"sm-link-kind-palette"),h(),f(18,"aside",22)(19,"div",23),V("mousedown",function(o){L(e);let r=m();return B(r.onPanelResizeStart(o))}),h(),f(20,"div",24)(21,"sm-inspector-view",25),V("close",function(){L(e);let o=m();return B(o.closePanel())})("tagSelect",function(o){L(e);let r=m();return B(r.onTagSelect(o))}),h()()(),I(22,tee,1,3,"sm-perf-hud",26),f(23,"div",27)(24,"p-button",28),V("onClick",function(){L(e);let o=m();return B(o.zoomIn())}),h(),f(25,"p-button",29),V("onClick",function(){L(e);let o=m();return B(o.zoomOut())}),h(),f(26,"p-button",30),V("onClick",function(){L(e);let o=m();return B(o.fitToScreen())}),h(),O(27,"span",31)(28,"sm-graph-layout-toolbar")(29,"span",31),f(30,"p-button",32),V("onClick",function(){L(e);let o=m();return B(o.resetLayout())}),h()()()}if(t&2){let e=m();E("smMiddleMousePan",e.canvas()),d(2),E("fCache",e.perf.cache),d(4),E("fAlignThreshold",20),d(),E("position",e.viewportPosition())("scale",e.viewportScale())("fZoomStep",.06)("fZoomDblClickStep",.35)("fZoomMinimum",e.zoomMin)("fZoomMaximum",e.zoomMax)("debounceTime",150),d(2),X(e.graph().edges),d(2),T(e.perf.virtualization?11:12),d(7),rt("width",e.clampedPanelWidth(),"px"),de("is-open",e.selectedNodeId()!==null),q("aria-label",e.texts.a11y.panel),d(),q("aria-label",e.texts.panel.resizeLabel),d(2),E("path",e.selectedPath())("activeTag",e.activeTagSelection()),d(),T(e.perfHud()?22:-1),d(),q("aria-label",e.texts.a11y.toolbar),d(),E("ariaLabel",e.texts.toolbar.zoomIn)("pTooltip",e.texts.toolbar.zoomIn)("text",!0)("rounded",!0)("disabled",!e.canZoomIn()),d(),E("ariaLabel",e.texts.toolbar.zoomOut)("pTooltip",e.texts.toolbar.zoomOut)("text",!0)("rounded",!0)("disabled",!e.canZoomOut()),d(),E("ariaLabel",e.texts.toolbar.fitToScreen)("pTooltip",e.texts.toolbar.fitToScreen)("text",!0)("rounded",!0),d(4),E("ariaLabel",e.texts.toolbar.resetLayoutLabel)("pTooltip",e.texts.toolbar.resetLayoutTooltip)("text",!0)("rounded",!0)}}var JM=.2,iee=420,oee=.15,ree=.25,aee=.75,see=.6,cee={selected:!1,highlighted:!1,dimmed:!1},ek=class t{loader=l(Ft);filters=l(fn);issuePaths=l(ha);graphPreferences=l(ho);router=l(ta);route=l(x_);confirmationService=l(Ei);destroyRef=l(ot);dagreLayout=l(Zg);injector=l(Ze);flow=Re(lr);canvas=Re(dr);zoom=Re(ur);canvasWrap=Re("canvasWrap");connectionType=this.graphPreferences.connectionType;connectionBehavior=wn.FIXED;markerStart=ge.START_ALL_STATES;markerEnd=ge.END_ALL_STATES;perf=fo.graph.perf;perfHud=l(gf).visible;savedViewport=LM();viewportStore=KM({savedViewport:this.savedViewport,hasCompletedInitialLayout:()=>this.layoutFit.hasCompletedInitialLayout()});viewportPosition=this.viewportStore.viewportPosition;viewportScale=this.viewportStore.viewportScale;canZoomIn=this.viewportStore.canZoomIn;canZoomOut=this.viewportStore.canZoomOut;zoomMin=Ff;zoomMax=p_;texts=rn;nodePositions=U(zM());nodeDrag=XM({destroyRef:this.destroyRef,nodePositions:this.nodePositions});expansion=ZM({nodes:this.loader.nodes});panelResize=UM({destroyRef:this.destroyRef,initialWidth:VM()??400,onCommit:n=>GM(n)});clampedPanelWidth=this.panelResize.clampedPanelWidth;loading=this.loader.loading;error=this.loader.error;visibleNodes=S(()=>this.filters.apply(this.loader.nodes(),this.issuePaths.bySeverity()));topology=S(()=>d0(this.loader.nodes(),this.loader.scan()));layoutPositions=U(new Map);layoutComputedAtSignal=U(0);fullLayout=S(()=>Kt(se({},this.topology()),{positions:this.layoutPositions(),computedAt:this.layoutComputedAtSignal()}));graph=S(()=>{let n=new Set(this.visibleNodes().map(o=>o.path)),e=this.filters.selectedLinkKinds(),i=e.length>0?new Set(e):null;return p0(this.fullLayout(),n,this.nodePositions(),i)});hasData=S(()=>this.graph().nodes.length>0);showEmptyState=S(()=>!this.hasData()&&!this.filters.kindToggleExplicitEmpty());visibleCount=S(()=>this.graph().nodes.length);totalCount=S(()=>this.loader.nodes().length);edgeCount=S(()=>this.graph().edges.length);layoutComputedAt=S(()=>this.layoutComputedAtSignal());connectionSides=S(()=>WP(this.graphPreferences.layoutAlgorithm(),this.graphPreferences.layoutDirection()));inputSide=S(()=>this.connectionSides().input);outputSide=S(()=>this.connectionSides().output);selectedNodeId=U(null);selectedPath=S(()=>{let n=this.selectedNodeId();return n?this.graph().nodes.find(i=>i.id===n)?.view.path:void 0});selectionGuard=ie(()=>{let n=this.selectedNodeId();if(n===null)return;this.graph().nodes.some(i=>i.id===n)||this.selectedNodeId.set(null)});pathsFingerprint=S(()=>this.loader.nodes().map(n=>n.path).sort().join("|"));layoutFit=QM({visibleNodes:this.visibleNodes,pathsFingerprint:this.pathsFingerprint,savedViewport:this.savedViewport,fit:()=>this.fitToScreenClamped(),animatedFit:()=>this.animatedFitToScreen()});constructor(){let n=S(()=>this.loader.nodes().map(o=>({id:o.path,view:{path:o.path}})),{equal:(o,r)=>{if(o.length!==r.length)return!1;for(let a=0;a<o.length;a++)if(o[a]?.id!==r[a]?.id)return!1;return!0}});PM({selectedPath:this.selectedPath,setSelectedNodeId:o=>this.selectedNodeId.set(o),readSelectedNodeId:()=>this.selectedNodeId(),graphNodes:n,router:this.router,route:this.route}),ie(()=>{let o=this.loader.nodes();if(o.length===0)return;let r=this.fullLayout();if(r.positions.size===0)return;let a=EM({nodes:o,current:this.nodePositions(),layout:r});a.dirty&&(this.nodePositions.set(a.next),Df(a.next))}),ie(()=>{this.layoutComputedAt(),this.autoFitPending&&(this.autoFitPending=!1,this.runAnimatedFit())});let e="",i="";ie(()=>{let o=this.loader.nodes(),r=this.topology(),a={algorithm:this.graphPreferences.layoutAlgorithm(),direction:this.graphPreferences.layoutDirection(),spacing:this.graphPreferences.layoutSpacing()};if(o.length===0)return;let s=c0(o,r.edges),c=`${a.algorithm}|${a.direction}|${a.spacing}`,u=`${s}|${c}`;if(u===e)return;let p=i!==""&&i!==c;e=u,i=c,(a.algorithm==="force"?Promise.resolve(u0(o,r.edges)):Promise.resolve().then(()=>l0(this.dagreLayout,o,r.edges,a))).then(b=>{this.layoutPositions.set(b),this.layoutComputedAtSignal.set(performance.now()),p&&(this.nodePositions.set(new Map),this.fitToScreenClamped())}).catch(b=>{console.error("[graph-view] layout failed:",b)})})}ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}onLoaded(){}onCanvasChange=this.viewportStore.onCanvasChange;fitToScreenClamped(){let n=this.canvas(),e=this.zoom();n&&(n.fitToScreen({x:40,y:40},!1),Wr(()=>{let i=n.transform.scale;if(i<=this.zoomMax&&i>=this.zoomMin)return;let o=Math.max(this.zoomMin,Math.min(i,this.zoomMax)),r=Math.abs(i-o),a=i>o?Pt.ZOOM_OUT:Pt.ZOOM_IN;e?.setZoom(this.getViewportCenter(),r,a,!1)},{injector:this.injector}))}autoFitAnimToken=0;autoFitPending=!1;animatedFitToScreen(){this.autoFitPending=!0}runAnimatedFit(){let n=this.canvasWrap()?.nativeElement;if(!n)return;let e={width:n.clientWidth,height:n.clientHeight},i=this.fullLayout().positions;if(i.size===0)return;let o=this.nodePositions(),r=this.visibleNodes().map(u=>u.path),a=[];for(let u of r){let p=o.get(u)??i.get(u);p&&a.push({x:p.x,y:p.y})}if(a.length===0)return;let s=Rf({points:a,wrap:e,panelW:this.selectedNodeId()!==null?this.clampedPanelWidth():0,zoomMin:this.zoomMin});if(!s)return;let c=++this.autoFitAnimToken;Af({readPosition:()=>this.viewportPosition(),readScale:()=>this.viewportScale(),writePosition:u=>this.viewportPosition.set(u),writeScale:u=>this.viewportScale.set(u),isStaleToken:()=>c!==this.autoFitAnimToken},s,iee)}onNodePositionChange(n,e){this.nodeDrag.onNodePositionChange(n,e)}zoomIn(){this.zoom()?.setZoom(this.getViewportCenter(),JM,Pt.ZOOM_IN,!0)}zoomOut(){this.zoom()?.setZoom(this.getViewportCenter(),JM,Pt.ZOOM_OUT,!0)}fitToScreen(){this.fitToScreenClamped()}resetLayout(){let n=rn.resetLayoutConfirm;this.confirmationService.confirm({header:n.header,message:n.message,icon:"pi pi-exclamation-triangle",acceptButtonProps:{label:n.accept,severity:"danger"},rejectButtonProps:{label:n.reject,severity:"secondary",outlined:!0},accept:()=>{this.nodePositions.set(new Map),this.expansion.resetAll(),this.fitToScreenClamped()}})}getViewportCenter(){let n=this.canvasWrap()?.nativeElement;if(!n)return{x:0,y:0};let e=n.getBoundingClientRect();return{x:e.width/2,y:e.height/2}}onNodePointerDown(n){this.nodeDrag.onNodePointerDown(n)}selectNode(n,e){this.nodeDrag.isClickWithoutDrag(e)&&this.selectedNodeId.set(n.id)}tagSelection=$M({flow:this.flow,nodes:this.loader.nodes,fullLayout:S(()=>this.fullLayout()),canvasWrap:()=>{let n=this.canvasWrap()?.nativeElement;return n?{width:n.clientWidth,height:n.clientHeight}:null},selectedNodeId:this.selectedNodeId,clampedPanelWidth:this.clampedPanelWidth,zoomMin:Ff,viewportPosition:this.viewportPosition,viewportScale:this.viewportScale});activeTagSelection=this.tagSelection.activeTagSelection;selectionState=YM({graph:this.graph,selectedNodeId:this.selectedNodeId,activeTagSelection:this.activeTagSelection});onTagSelect(n){this.tagSelection.onTagSelect(n)}closePanel(){this.selectedNodeId.set(null)}onEscape(){this.selectedNodeId()!==null&&(typeof document<"u"&&OM(document)||this.closePanel())}resetFilters(){this.filters.reset()}onPanelResizeStart(n){this.panelResize.onPanelResizeStart(n)}openNode(n){this.selectedNodeId.set(n.id)}onCanvasClick(n){let e=n.target;e?.closest(".sm-gnode")||e?.closest(".graph__toolbar")||e?.closest(".perf-hud")||e?.closest(".kind-palette")||e?.closest(".graph__panel")||this.selectedNodeId.set(null)}isSelected(n){return this.selectionState.isSelected(n)}isHighlighted(n){return this.selectionState.isHighlighted(n)}isDimmed(n){return this.selectionState.isDimmed(n)}selectionFor(n){return this.selectionState.selectionView().get(n)??cee}isExpanded(n){return this.expansion.isExpanded(n)}setExpanded(n,e){this.expansion.setExpanded(n,e)}onFavoriteToggle(n){this.loader.toggleFavorite(n.path,n.value)}isEdgeHighlighted(n){return this.selectionState.isEdgeHighlighted(n)}isEdgeDimmed(n){return this.selectionState.isEdgeDimmed(n)}edgeOpacity(n){if(this.isEdgeDimmed(n))return oee;let e=typeof n.confidence=="number"?n.confidence:see;return ree+aee*e}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-graph-view"]],viewQuery:function(e,i){e&1&&Tt(i.flow,lr,5)(i.canvas,dr,5)(i.zoom,ur,5)(i.canvasWrap,WJ,5),e&2&<(4)},hostBindings:function(e,i){e&1&&V("keydown.escape",function(){return i.onEscape()},Ur)},features:[_e([Ei,Rv(Zg,{mode:xn.MANUAL})])],decls:6,vars:2,consts:[["canvasWrap",""],["data-testid","graph-view",1,"graph"],["data-testid","graph-loading",1,"empty-state"],["data-testid","graph-error",1,"empty-state"],["data-testid","graph-empty",1,"empty-state"],["data-testid","graph-canvas-wrap",1,"graph__canvas-wrap",3,"smMiddleMousePan"],["styleClass","graph__confirm","maskStyleClass","graph__confirm-mask","data-testid","graph-reset-layout-confirm",3,"ariaLabel"],[1,"empty-state__icon","fa-solid","fa-spinner","fa-spin"],[1,"empty-state__title"],[1,"empty-state__icon","empty-state__icon--error","fa-solid","fa-circle-exclamation"],[1,"empty-state__desc"],["aria-hidden","true",1,"pi","pi-filter-slash","empty-state__icon"],["data-testid","graph-empty-filtered",1,"empty-state__title"],["size","small","data-testid","graph-reset-filters",3,"onClick","label","text"],["data-testid","graph-canvas-wrap",1,"graph__canvas-wrap",3,"click","smMiddleMousePan"],["fDraggable","",3,"fLoaded","fCache"],[3,"fAlignThreshold"],["fZoom","",3,"fCanvasChange","position","scale","fZoomStep","fZoomDblClickStep","fZoomMinimum","fZoomMaximum","debounceTime"],["ngProjectAs","[fConnections]",5,["","fConnections",""]],[3,"fOutputId","fInputId","fOutputSide","fInputSide","fType","fBehavior","fReassignDisabled","class","f-conn--highlighted","f-conn--dimmed","opacity"],["ngProjectAs","[fNodes]",5,["","fNodes",""]],[1,"graph__filter-stack"],["role","complementary","data-testid","graph-panel",1,"graph__panel"],["role","separator","aria-orientation","vertical","data-testid","graph-panel-resize",1,"graph__panel-resize",3,"mousedown"],[1,"graph__panel-scroll"],["mode","embedded",3,"close","tagSelect","path","activeTag"],[3,"visible","total","edges"],["role","toolbar","data-testid","graph-toolbar",1,"graph__toolbar"],["icon","pi pi-search-plus","severity","secondary","size","small","data-testid","graph-zoom-in",3,"onClick","ariaLabel","pTooltip","text","rounded","disabled"],["icon","pi pi-search-minus","severity","secondary","size","small","data-testid","graph-zoom-out",3,"onClick","ariaLabel","pTooltip","text","rounded","disabled"],["icon","pi pi-stop","severity","secondary","size","small","data-testid","graph-fit-to-screen",3,"onClick","ariaLabel","pTooltip","text","rounded"],["aria-hidden","true",1,"graph__toolbar-sep"],["icon","pi pi-history","severity","secondary","size","small","data-testid","graph-reset-layout",3,"onClick","ariaLabel","pTooltip","text","rounded"],[3,"fOutputId","fInputId","fOutputSide","fInputSide","fType","fBehavior","fReassignDisabled"],["fMarker","","viewBox","0 0 9 9","markerUnits","userSpaceOnUse",1,"sm-edge-dot",3,"type","width","height","refX","refY"],["cx","4.5","cy","4.5","r","3.5"],[3,"type"],["ngProjectAs","[fNodes]",5,["","fNodes",""],4,"fVirtualFor","fVirtualForOf"],["fNode","","fDragHandle","","fNodeInput","","fNodeOutput","",1,"sm-gnode-host",3,"fNodePositionChange","pointerdown","click","dblclick","fNodeId","fNodePosition","fInputId","fInputConnectableSide","fOutputId","fOutputConnectableSide"],[3,"expandedChange","favoriteToggle","node","stats","summary","selection","expanded","isFavorite"],[1,"sm-gnode__marker-anchor"],["slot","graph.node.alert",3,"node"],["fNode","","fDragHandle","","fNodeInput","","fNodeOutput","","fInputConnectableSide","top","fOutputConnectableSide","bottom",1,"sm-gnode-host",3,"fNodeId","fNodePosition","fInputId","fOutputId"],["fNode","","fDragHandle","","fNodeInput","","fNodeOutput","","fInputConnectableSide","top","fOutputConnectableSide","bottom",1,"sm-gnode-host",3,"fNodePositionChange","pointerdown","click","dblclick","fNodeId","fNodePosition","fInputId","fOutputId"]],template:function(e,i){e&1&&(f(0,"section",1),I(1,$J,4,1,"div",2)(2,KJ,6,2,"div",3)(3,YJ,5,3,"div",4)(4,nee,31,39,"div",5),O(5,"p-confirmdialog",6),h()),e&2&&(d(),T(i.loading()&&!i.hasData()?1:i.error()&&!i.hasData()?2:i.showEmptyState()?3:4),d(4),E("ariaLabel",i.texts.resetLayoutConfirm.header))},dependencies:[jv,lr,dr,Lv,Fv,ur,Vv,Z0,Q0,Bv,_v,Cv,zv,qv,Ip,gv,Gv,Dv,df,lf,uf,pf,ff,mf,Mf,un,ln,da,ca,De,Be,yn,kf],styles:["[_nghost-%COMP%]{display:block;height:100%}.graph[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.graph__canvas-wrap[_ngcontent-%COMP%]{position:relative;flex:1;min-height:0;background:var(--sm-bg-content);overflow:hidden;--ff-connection-drag-handle-stroke: transparent;--ff-connection-drag-handle-fill: transparent;--ff-canvas-background-color: transparent}.graph__filter-stack[_ngcontent-%COMP%]{position:absolute;top:16px;left:16px;z-index:2;display:flex;flex-direction:column;gap:8px;pointer-events:none}.graph__filter-stack[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{pointer-events:auto}.graph__canvas-wrap[_ngcontent-%COMP%] f-flow[_ngcontent-%COMP%]{width:100%;height:100%}.graph__canvas-wrap[_ngcontent-%COMP%] .f-connection-drag-handle{fill:transparent;stroke:transparent}.graph__panel[_ngcontent-%COMP%]{position:absolute;top:0;right:0;bottom:0;background:var(--sm-bg-content);border-left:1px solid var(--sm-border);box-shadow:0 4px 24px #0000002e;transform:translate(100%);transition:transform .22s ease;z-index:20;pointer-events:none;display:flex;overflow:hidden}.graph__panel.is-open[_ngcontent-%COMP%]{transform:translate(0);pointer-events:auto}.graph__panel-scroll[_ngcontent-%COMP%]{flex:1;min-height:0;min-width:0;overflow-y:auto}.graph__panel-resize[_ngcontent-%COMP%]{position:absolute;top:0;left:0;bottom:0;width:6px;cursor:ew-resize;z-index:2;background:transparent;transition:background .12s ease}.graph__panel-resize[_ngcontent-%COMP%]:hover, .graph__panel-resize[_ngcontent-%COMP%]:active{background:color-mix(in srgb,var(--p-primary-color) 30%,transparent)}.graph__toolbar[_ngcontent-%COMP%]{position:absolute;bottom:16px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:2px;padding:4px;background:var(--sm-bg-content);border:1px solid var(--sm-border);border-radius:var(--sm-radius-pill);box-shadow:var(--sm-shadow-floating);z-index:2;pointer-events:auto;transition:box-shadow .22s ease}.graph__toolbar-sep[_ngcontent-%COMP%]{width:1px;height:18px;margin:0 2px;background:var(--sm-border);flex-shrink:0}.sm-gnode-host[_ngcontent-%COMP%]{position:relative;display:inline-block;cursor:pointer;--ff-node-width: auto;--ff-node-min-height: 0;--ff-node-padding: 0;--ff-node-background-color: transparent;--ff-node-border-color: transparent;--ff-node-border-color-selected: transparent;--ff-node-border-radius: 0;--ff-node-shadow: none;--ff-node-shadow-selected: none}.sm-gnode-host.f-selected[_ngcontent-%COMP%]{filter:drop-shadow(0 0 6px var(--p-primary-color-300))}.sm-gnode-host.f-selected[_ngcontent-%COMP%] > .sm-gnode[_ngcontent-%COMP%]{box-shadow:0 0 0 3px var(--p-primary-color),var(--sm-shadow-card)}.f-conn--invokes[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-invokes);--ff-connection-width: 1.5px;--ff-marker-color: var(--sm-edge-invokes)}.f-conn--references[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-references);--ff-connection-width: 1.25px;--ff-marker-color: var(--sm-edge-references)}.f-conn--mentions[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-mentions);--ff-connection-width: 1px;--ff-marker-color: var(--sm-edge-mentions)}.f-conn--supersedes[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-supersedes);--ff-connection-width: 1.25px;--ff-marker-color: var(--sm-edge-supersedes)}.graph__canvas-wrap[_ngcontent-%COMP%] .f-conn--supersedes .f-connection-path{stroke-dasharray:none}.f-conn--highlighted[_ngcontent-%COMP%]{--ff-connection-width: 2px}.f-conn--dimmed[_ngcontent-%COMP%]{opacity:.15}.f-connection.f-selected[_ngcontent-%COMP%]{--ff-connection-width: 2.5px}.f-conn--invokes.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-invokes-active);--ff-connection-selected-color: var(--sm-edge-invokes-active);--ff-marker-color: var(--sm-edge-invokes-active)}.f-conn--references.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-references-active);--ff-connection-selected-color: var(--sm-edge-references-active);--ff-marker-color: var(--sm-edge-references-active)}.f-conn--mentions.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-mentions-active);--ff-connection-selected-color: var(--sm-edge-mentions-active);--ff-marker-color: var(--sm-edge-mentions-active)}.f-conn--supersedes.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-supersedes-active);--ff-connection-selected-color: var(--sm-edge-supersedes-active);--ff-marker-color: var(--sm-edge-supersedes-active)}.sm-gnode__marker-anchor[_ngcontent-%COMP%]{position:absolute;top:-10px;right:-10px;z-index:4;display:inline-flex;align-items:center;gap:.25rem;pointer-events:none;transition:opacity .15s ease}sm-node-card.sm-gnode--dimmed[_ngcontent-%COMP%] + .sm-gnode__marker-anchor[_ngcontent-%COMP%]{opacity:.25}sm-node-card.sm-gnode--deprecated[_ngcontent-%COMP%] + .sm-gnode__marker-anchor[_ngcontent-%COMP%]{opacity:.55}"],changeDetection:0})};export{ek as GraphView};
|