@skill-map/cli 0.20.0 → 0.20.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 +1 -1
- 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-LQTUSDHD.js → chunk-4NLC7QD2.js} +1 -1
- package/dist/ui/{chunk-DLT5AP43.js → chunk-6BZZQV42.js} +1 -1
- package/dist/ui/{chunk-QICH7GU2.js → chunk-6GUHSAP5.js} +1 -1
- package/dist/ui/{chunk-HJSRMZTK.js → chunk-E4ALROJS.js} +1 -1
- package/dist/ui/{chunk-2W62S3FU.js → chunk-EZZF5RL5.js} +1 -1
- package/dist/ui/{chunk-HOBQ4G4O.js → chunk-FWX4RRDF.js} +1 -1
- package/dist/ui/{chunk-UJRROL5X.js → chunk-GGMXMGRJ.js} +1 -1
- package/dist/ui/{chunk-IBUV6OG2.js → chunk-K5PULFK7.js} +1 -1
- package/dist/ui/{chunk-VLNLJAUB.js → chunk-OJ6W6OIB.js} +1 -1
- package/dist/ui/{chunk-C7QWBAYP.js → chunk-PTCD42GB.js} +1 -1
- package/dist/ui/{chunk-W3JLG7BI.js → chunk-ZSRIBCAW.js} +5 -5
- package/dist/ui/index.html +1 -1
- package/dist/ui/main-5FJWWH5I.js +1 -0
- package/package.json +1 -1
- package/dist/ui/main-QHE47BCM.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as xn,d as Wh}from"./chunk-IBUV6OG2.js";import{a as wo,b as So,c as Io,d as bn,e as To,f as wn}from"./chunk-DLT5AP43.js";import{b as Oh,d as po,e as Fh,i as _o,j as Vh,k as Qe,l as je,m as Mt,n as yo,o as Zt,p as Dt,r as vo}from"./chunk-VLNLJAUB.js";import{c as jh,d as Uh,e as $h}from"./chunk-LQTUSDHD.js";import{h as Co,i as xo,j as bo}from"./chunk-QICH7GU2.js";import{$a as _n,$c as vn,Aa as Me,Db as ot,Dc as Lh,Eb as Ae,Ec as Bh,Fb as Q,Fc as gn,Gb as Ie,Gc as mo,Ic as zh,J as g,Ja as Z,K as no,Lc as Gh,M as fe,Ma as w,Mc as Hh,N as pn,Na as S,O as d,Pa as we,Pb as ei,Qa as J,R as Ch,Ra as ee,Rb as gt,S as j,Sa as T,Sb as P,Sc as ti,T as U,Ta as u,Tc as go,U as $e,Ua as f,V as Ye,Va as A,Vb as He,W as io,Wa as H,Wb as F,X as Ze,Xa as $,Xb as Te,Ya as Pt,Yb as lo,Z as nt,Za as Wt,Zb as Cu,_ as Qn,_a as qt,_b as Kt,_c as yn,ab as ao,ac as xe,ba as q,bb as co,bc as We,ca as me,cb as ae,da as mn,db as yu,dd as Cn,ea as ne,eb as K,ed as Yt,g as C,ga as Se,gb as p,ha as oo,hb as Xt,ia as xh,ib as De,ja as _u,jb as Ph,kc as kh,la as bh,lb as wt,m as eo,ma as wh,mb as St,mc as Rh,n as vh,na as c,nb as vu,nc as uo,oa as Sh,ob as ft,oc as fo,pa as Ih,pb as it,qa as Th,qc as Nh,ra as gu,rb as at,rc as ho,sa as ro,sb as de,tb as Mh,u as to,ub as Ce,va as te,vb as m,wa as so,wb as y,xa as Pe,xb as Ge,ya as Eh,yb as Jn,yc as xu,za as _e,zb as Dh}from"./chunk-W3JLG7BI.js";import{V as Ah}from"./chunk-3R7E3HPC.js";import{a as ue,b as mu}from"./chunk-Q7L6LLAK.js";var Qt=class{constructor(i,e,n,o,r){this.center=i,this.radiusX=e,this.radiusY=n,this.startAngle=o,this.endAngle=r}},L=class t{static castToPoint(i){return i||t.initialize()}static initialize(i=0,e=0){return{x:i,y:e}}static copy(i){return t.initialize(i.x,i.y)}static isEqual(i,e){return i.x===e.x&&i.y===e.y}static sum(i,e){return{x:i.x+e.x,y:i.y+e.y}}static sub(i,e){return{x:i.x-e.x,y:i.y-e.y}}static div(i,e){return{x:i.x/e,y:i.y/e}}static mult(i,e){return{x:i.x*e,y:i.y*e}}static interpolatePoints(i,e,n){let o=1-n;return t.initialize(i.x*o+e.x*n,i.y*o+e.y*n)}static roundTo(i,e){let n=Math.trunc(i.x/e),o=Math.trunc(i.y/e);return{x:n*e,y:o*e}}static hypotenuse(i,e){let n=e.x-i.x,o=e.y-i.y;return Math.abs(Math.sqrt(n*n+o*o))}static distance(i,e){let n=i.x-e.x,o=i.y-e.y;return Math.sqrt(n*n+o*o)}static getMinimum(i,e){return t.initialize(Math.min(i.x,e.x),Math.min(i.y,e.y))}static getMaximum(i,e){return t.initialize(Math.max(i.x,e.x),Math.max(i.y,e.y))}static matrixTransform(i,e){let n=t.initialize(i.x,i.y),o=e.getScreenCTM();if(o){let r=e.createSVGPoint();r.x=i.x,r.y=i.y,n=r.matrixTransform(o.inverse())}return n}static elementTransform(i,e){let n=t.initialize(i.x,i.y),o=e.getBoundingClientRect();return n=t.sub(n,t.initialize(o.left,o.top)),n}},X=class t{constructor(i=0,e=0){this.x=i,this.y=e}static fromPoint(i){return new t(i.x,i.y)}add(i){let e=L.sum(this,i);return t.fromPoint(e)}sub(i){let e=L.sub(this,i);return t.fromPoint(e)}subNumber(i){let e=L.sub(this,new t(i,i));return t.fromPoint(e)}div(i){let e=L.div(this,i);return t.fromPoint(e)}mult(i){let e=L.mult(this,i);return t.fromPoint(e)}matrixTransform(i){let e=L.matrixTransform(this,i);return t.fromPoint(e)}elementTransform(i){let e=L.elementTransform(this,i);return t.fromPoint(e)}},ni=class{static initialize(i=L.initialize(),e=L.initialize()){return{point1:i,point2:e}}static copy(i){return{point1:i.point1,point2:i.point2}}static hypotenuse(i){return Math.sqrt(Math.pow(i.point1.x-i.point2.x,2)+Math.pow(i.point1.y-i.point2.y,2))}},Jt=class{constructor(i,e){this.point1=i,this.point2=e}},G=class t{static initialize(i=0,e=0,n=0,o=0){n<0&&(i=i+n,n=-n),o<0&&(e=e+o,o=-o);let r=L.initialize(i+n/2,e+o/2);return{x:i,y:e,width:n,height:o,gravityCenter:r}}static copy(i){return t.initialize(i.x,i.y,i.width,i.height)}static fromElement(i){let{x:e,y:n,width:o,height:r}=i.getBoundingClientRect();return t.initialize(e,n,o,r)}static isIncludePoint(i,e){return e.x>=t.left(i)&&e.x<=t.right(i)&&e.y>=t.top(i)&&e.y<=t.bottom(i)}static intersectionWithRect(i,e){return!(i.x+i.width<e.x||e.x+e.width<i.x||i.y+i.height<e.y||e.y+e.height<i.y)}static left(i){return i.x}static top(i){return i.y}static right(i){return i.x+i.width}static bottom(i){return i.y+i.height}static addPoint(i,e){let n=t.copy(i);return n.x+=e.x,n.y+=e.y,this.initialize(n.x,n.y,n.width,n.height)}static mult(i,e){let n=t.copy(i);return n.x*=e,n.y*=e,n.width*=e,n.height*=e,this.initialize(n.x,n.y,n.width,n.height)}static div(i,e){let n=t.copy(i);return n.x/=e,n.y/=e,n.width/=e,n.height/=e,this.initialize(n.x,n.y,n.width,n.height)}static addPointToSize(i,e){let n=t.copy(i);return n.width+=e.x,n.height+=e.y,this.initialize(n.x,n.y,n.width,n.height)}static union(i){return!i||i.length===0?null:i.reduce((e,n)=>{let o=Math.min(e.x,n.x),r=Math.min(e.y,n.y),s=Math.max(e.x+e.width,n.x+n.width),a=Math.max(e.y+e.height,n.y+n.height);return t.initialize(o,r,s-o,a-r)},i[0])}static elementTransform(i,e){let n=e.getBoundingClientRect(),o=L.sub(i,L.initialize(n.left,n.top));return t.initialize(o.x,o.y,i.width,i.height)}static updateIsNotFinite(i){return!Number.isFinite(i.width)||!Number.isFinite(i.height)||!Number.isFinite(i.x)||!Number.isFinite(i.y)?t.initialize(0,0,0,0):i}};function qh(t,i){let e=Math.max(t.width,i),n=Math.max(t.height,i),o=(e-t.width)/2,r=(n-t.height)/2;return G.initialize(t.x-o,t.y-r,e,n)}function wu(t,i){t=G.updateIsNotFinite(t),i.setAttribute("x",t.x.toString()),i.setAttribute("y",t.y.toString()),i.setAttribute("width",t.width.toString()),i.setAttribute("height",t.height.toString())}function Xh(t,i){t=G.updateIsNotFinite(t),i.setAttribute("viewBox",`${t.x} ${t.y} ${t.width} ${t.height}`)}var ke=class t{constructor(i=0,e=0,n=0,o=0,r=0,s=0,a=0,l=0){this.x=i,this.y=e,this.width=n,this.height=o,this.radius1=r,this.radius2=s,this.radius3=a,this.radius4=l,this.gravityCenter=L.initialize(),this.gravityCenter=this.calculateGravityCenter(this)}calculateGravityCenter(i){return new X(i.x+i.width/2,i.y+i.height/2)}static fromRect(i){return new t(i.x,i.y,i.width,i.height)}static fromRoundedRect(i){return new t(i.x,i.y,i.width,i.height,i.radius1,i.radius2,i.radius3,i.radius4)}static fromCenter(i,e,n){return new t(i.gravityCenter.x-e/2,i.gravityCenter.y-n/2,e,n,i.radius1,i.radius2,i.radius3,i.radius4)}static fromPoint(i){return new t(i.x,i.y)}addPoint(i){let e=t.fromRoundedRect(this);return e.x+=i.x,e.y+=i.y,e.gravityCenter=this.calculateGravityCenter(e),e}},ht=class t{static initialize(i=0,e=0){return{width:i,height:e}}static isEqual(i,e){return i.width===e.width&&i.height===e.height}static offsetFromElement(i){if(i instanceof SVGGraphicsElement){let e=i.getBBox();return t.initialize(e.width,e.height)}else if(i instanceof HTMLElement)return t.initialize(i.offsetWidth,i.offsetHeight)}};function D_(){return{position:L.initialize(),scaledPosition:L.initialize(),scale:1,rotate:0}}function k_(t){let i;if(t){t=t.replace("matrix(",""),t=t.replace(")","");let e=t.split(" ");i={position:{x:Number(e[4]),y:Number(e[5])},scaledPosition:L.initialize(),scale:Number(e[0]),rotate:0}}return i}var kt=class{static toString(i){let e=L.sum(i.position,i.scaledPosition);return`matrix(${i.scale}, 0, 0, ${i.scale}, ${e.x}, ${e.y})`}static fromString(i){return k_(i)}static default(){return D_()}},Je=class t{static initialize(i=0,e=0){return L.initialize(i,e)}static fromPoints(i,e){return t.initialize(e.x-i.x,e.y-i.y)}static vectorLength(i){return Math.sqrt(t.magnitudeSquared(i))}static magnitudeSquared(i){return i.x*i.x+i.y*i.y}static dotProduct(i,e){return i.x*e.x+i.y*e.y}static crossProduct(i,e){return i.x*e.y-i.y*e.x}static subtract(i,e){return t.initialize(i.x-e.x,i.y-e.y)}static add(i,e){return t.initialize(i.x+e.x,i.y+e.y)}static scale(i,e){return t.initialize(i.x*e,i.y*e)}static angle(i,e){let n=Math.acos(Math.max(-1,Math.min(t.dotProduct(i,e)/(t.vectorLength(i)*t.vectorLength(e)),1)));return t.crossProduct(i,e)<0?-n:n}},bu=class{static parseRoundedRect(i){let e=Math.PI*.5,n=i.x,o=i.y,r=i.x+i.width,s=i.y+i.height,a=i.x+i.radius1,l=i.y+i.radius1,h=i.x+i.width-i.radius2,_=i.y+i.radius2,v=i.x+i.width-i.radius3,b=i.y+i.height-i.radius3,I=i.x+i.radius4,N=i.y+i.height-i.radius4;return[new Qt({x:a,y:l},i.radius1,i.radius1,2*e,3*e),new Jt({x:a,y:o},{x:h,y:o}),new Qt({x:h,y:_},i.radius2,i.radius2,3*e,4*e),new Jt({x:r,y:_},{x:r,y:b}),new Qt({x:v,y:b},i.radius3,i.radius3,0,e),new Jt({x:v,y:s},{x:I,y:s}),new Qt({x:I,y:N},i.radius4,i.radius4,e,2*e),new Jt({x:n,y:N},{x:n,y:l})]}},Sn=class{static getRoundedRectIntersections(i,e,n){let o=bu.parseRoundedRect(n);for(let r of o)if(r instanceof Qt){let s=this.intersectArcWithLine(r,i,e);if(s.length>0)return s}else if(r instanceof Jt){let s=this.intersectLineSegments(i,e,r.point1,r.point2);if(s)return[s]}return[]}static getRoundedRectIntersectionsWithSVGPath(i,e){let n=i.getTotalLength(),o=[];for(let r=0;r<=n;r+=1){let s=i.getPointAtLength(r);o.push({x:s.x,y:s.y})}for(let r=1;r<o.length;r++){let s=this.getRoundedRectIntersections(o[r-1],o[r],e);if(s.length>0)return s}return[]}static intersectArcWithLine(i,e,n){return this.filterPointsWithinArc(this.findEllipseLineIntersections(i.center,i.radiusX,i.radiusY,e,n),i)}static intersectLineSegments(i,e,n,o){let r=e.x-i.x,s=e.y-i.y,a=o.x-n.x,l=o.y-n.y,h=(-s*(i.x-n.x)+r*(i.y-n.y))/(-a*s+r*l),_=(a*(i.y-n.y)-l*(i.x-n.x))/(-a*s+r*l);return h>=0&&h<=1&&_>=0&&_<=1?{x:i.x+_*r,y:i.y+_*s}:null}static filterPointsWithinArc(i,e){let{center:n,startAngle:o,endAngle:r}=e;if(i.length===0)return i;r<o&&([o,r]=[r,o]),(o<0||r<0)&&(o+=2*Math.PI,r+=2*Math.PI);let s=[];for(let a of i){let l=this.normalizeAngle(Je.angle(Je.initialize(1,0),Je.initialize(a.x-n.x,a.y-n.y)));l<o&&(l+=2*Math.PI),o<=l&&l<=r&&s.push(a)}return s}static normalizeAngle(i){let e=i%(2*Math.PI);return e<0?e+2*Math.PI:e}static findEllipseLineIntersections(i,e,n,o,r){let s=Je.initialize(o.x,o.y),a=Je.fromPoints(o,r),l=Je.initialize(i.x,i.y),h=Je.subtract(s,l),_=Je.initialize(a.x/(e*e),a.y/(n*n)),v=Je.initialize(h.x/(e*e),h.y/(n*n)),b=Je.dotProduct(a,_),I=Je.dotProduct(a,v),N=Je.dotProduct(h,v)-1,D=I*I-b*N;return D<0?[]:this.calculateIntersectionPoints(D,b,I,o,r)}static calculateIntersectionPoints(i,e,n,o,r){let s=[];if(i>0){let a=Math.sqrt(i),l=(-n-a)/e,h=(-n+a)/e;l>=0&&l<=1&&s.push(L.interpolatePoints(o,r,l)),h>=0&&h<=1&&s.push(L.interpolatePoints(o,r,h))}else{let a=-n/e;a>=0&&a<=1&&s.push(L.interpolatePoints(o,r,a))}return s}};var Su=class{handle(i,e){let n=!0;if(this.validator&&(n=e.get(this.validator).handle(i)),!!n)return e.get(this.execution).handle(i)}execute(i,e){return e.get(this.execution).handle(i)}setValidator(i){this.validator=i}setExecution(i){this.execution=i}},R=class t{constructor(){this._injector=d(Ye)}static registerPipeline(i,e,n){if(!i||!i.fToken)throw new Error("Type must have a fToken static property.");let o=this.pipelines.get(i.fToken)||new Su;n?o.setValidator(e):o.setExecution(e),this.pipelines.set(i.fToken,o)}send(i){let e=t.pipelines.get(i.constructor.fToken);if(e)return e.handle(i,this._injector);throw new Error("Handler not registered for request type.")}execute(i){return t.pipelines.get(i.constructor.fToken).execute(i,this._injector)}};R.pipelines=new Map;R.\u0275fac=function(i){return new(i||R)};R.\u0275prov=g({token:R,factory:R.\u0275fac});function x(t){return function(i){R.registerPipeline(t,i,!1)}}var R_=(()=>{class t{setItem(e,n){localStorage.setItem(e,n)}getItem(e){return localStorage.getItem(e)}removeItem(e){localStorage.removeItem(e)}clear(){localStorage.clear()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),N_=(()=>{class t{storage={};setItem(e,n){this.storage[e]=n}getItem(e){return this.storage[e]||null}removeItem(e){delete this.storage[e]}clear(){this.storage={}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),O_=new fe("F_LOCAL_STORAGE",{providedIn:"root",factory:()=>fo(d(oo))?d(R_):d(N_)}),F_=(()=>{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,n,o){window.open(e,n,o)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),A_=(()=>{class t{getComputedStyle(e){return new Proxy({getPropertyValue:n=>"0"},{get:(n,o)=>o==="getPropertyValue"?n.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,n,o){}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),L_=new fe("F_WINDOW",{providedIn:"root",factory:()=>fo(d(oo))?d(F_):d(A_)}),Rt=(function(t){return t.MAC_OS="macos",t.IOS="ios",t.WINDOWS="windows",t.ANDROID="android",t.LINUX="linux",t})(Rt||{}),Iu;try{Iu=typeof Intl<"u"&&Intl.v8BreakIterator}catch{Iu=!1}var Tu=(()=>{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||Iu)&&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?fo(this._platformId):typeof document=="object"&&!!document}getOS(){let e=navigator.userAgent.toLowerCase(),n=/(macintosh|macintel|macppc|mac68k|macos)/i,o=/(win32|win64|windows|wince)/i,r;return n.test(e)?r=Rt.MAC_OS:this.IOS?r=Rt.IOS:o.test(e)?r=Rt.WINDOWS:this.ANDROID?r=Rt.ANDROID:!r&&/linux/.test(e)&&(r=Rt.LINUX),r}static \u0275fac=function(n){return new(n||t)(pn(oo))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Re=(()=>{class t{injectedDocument;windowService;localStorageService;platformService;constructor(e,n,o,r){this.injectedDocument=e,this.windowService=n,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,n,o,r){if(e.endsWith("px"))return parseFloat(e);if(e.endsWith("%")){let s=parseFloat(e)/100;return Math.max(n,o)*s}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 s=this.window.innerHeight/100;return parseFloat(e)*s}else if(e.endsWith("vw")){let s=this.window.innerWidth/100;return parseFloat(e)*s}}return parseFloat(e)||0}static \u0275fac=function(n){return new(n||t)(pn(io),pn(L_),pn(O_),pn(Tu))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Eu(t,i){return t.reduce((e,n)=>[...e,...i(n)],[])}function Pu(t){let i=t.cloneNode(!0),e=i.querySelectorAll("[id]"),n=t.nodeName.toLowerCase();i.removeAttribute("id");for(let o=0;o<e.length;o++)e[o].removeAttribute("id");return n==="canvas"?Zh(t,i):(n==="input"||n==="select"||n==="textarea")&&Yh(t,i),Kh("canvas",t,i,Zh),Kh("input, textarea, select",t,i,Yh),i}function Kh(t,i,e,n){let o=i.querySelectorAll(t);if(o.length){let r=e.querySelectorAll(t);for(let s=0;s<o.length;s++)n(o[s],r[s])}}var B_=0;function Yh(t,i){i.type!=="file"&&(i.value=t.value),i.type==="radio"&&i.name&&(i.name=`mat-clone-${i.name}-${B_++}`)}function Zh(t,i){let e=i.getContext("2d");if(e)try{e.drawImage(t,0,0)}catch{}}function Mu(t,i,e){for(let n in i)if(i.hasOwnProperty(n)){let o=i[n];o?t.setProperty(n,o,e?.has(n)?"important":""):t.removeProperty(n)}return t}function Qh(t){Mu(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 Jh(t,i,e){return z_(t,e).dataset[i]}function z_(t,i){return t.closest(i)}function Du(t,i){let e=t.rootNodes;if(e.length===1&&e[0].nodeType===i.ELEMENT_NODE)return e[0];let n=i.createElement("div");return e.forEach(o=>n.appendChild(o)),n}function ii(t,i){let e=V_(t,i);return!!e&&!e.classList.contains(i+"-disabled")}function V_(t,i){return t.closest(i)}function It(t){return t.match(/^[a-zA-Z_]/)||(t="_"+t),t.replace(/[^a-zA-Z0-9_\-:.]/g,"_")}function In(t,i,e){let n=e[t.toUpperCase()]||G_(e,t.toLowerCase());if(n===void 0)throw new Error(`Unknown ${i}: ${t}. Accepted values: ${Object.keys(e).join(", ")}`);return n}function G_(t,i){return Object.keys(t).find(e=>t[e]===i)}var H_=["markerElement"],j_=["fConnectionGradientRenderer",""],U_=["f-connection-path",""],$_=["fConnectionSelection",""],W_=["f-connection-drag-handle-start",""],q_=["f-connection-drag-handle-end",""],X_=["defs"],K_=["*"],Y_=["fGroupsContainer"],Z_=["fNodesContainer"],Q_=["fConnectionsContainer"],J_=[[["","fGroup",""],["","fGroups",""]],[["f-snap-connection"]],[["f-connection"],["","fConnections",""]],[["f-connection-for-create"]],[["","fNode",""],["","fNodes",""]]],eg=["[fGroup], [fGroups]","f-snap-connection","f-connection, [fConnections]","f-connection-for-create","[fNode], [fNodes]"],tg=[[["svg","fMarker",""]],[["f-connection-marker-circle"],["f-connection-marker-arrow"]],[["f-connection-gradient"]],[["f-connection-waypoints"]],[["","fConnectionContent",""]]],ng=["svg[fMarker]","f-connection-marker-circle, f-connection-marker-arrow","f-connection-gradient","f-connection-waypoints","[fConnectionContent]"];function ig(t,i){t&1&&($e(),A(0,"linearGradient",3)),t&2&&T("fConnectionGradientRendererFor",i)}function og(t,i){t&1&&($e(),A(0,"circle",6))}function rg(t,i){t&1&&De(0,4)}var sg="[_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}",ag=[[["","fDefinitions",""]],[["f-background"]],[["f-line-alignment"]],[["f-canvas"]],[["f-selection-area"]],"*"],cg=["[fDefinitions]","f-background","f-line-alignment","f-canvas","f-selection-area","*"],Fu=new fe("F_BACKGROUND_PATTERN"),Qa=class{fPattern;static fToken=Symbol("AddPatternToBackgroundRequest");constructor(i){this.fPattern=i}},Mn=class{_items=[];_byId=new Map;get(i){return this._byId.get(i)}require(i){let e=this._byId.get(i);if(!e)throw new Error(`${this.kind} not found: ${i}`);return e}has(i){return this._byId.has(i)}getAll(){return this._items}size(){return this._items.length}add(i){let e=i.fId();if(this._byId.has(e))throw new Error(`${this.kind} already exists: ${e}`);this._items.push(i),this._byId.set(e,i)}addMany(i){for(let e of i)this.add(e)}remove(i){let e=i.fId(),n=this._byId.get(e);if(!n)return!1;this._byId.delete(e);let o=this._items.indexOf(n);return o>=0&&this._items.splice(o,1),!0}removeById(i){let e=this._byId.get(i);if(!e)return;this._byId.delete(i);let n=this._items.indexOf(e);return n>=0&&this._items.splice(n,1),e}clear(){this._items.length=0,this._byId.clear()}};function en(t){return{name:t}}var Au=class{_instances=new Map;get(i){return this._instances.get(i.name)}require(i){let e=this.get(i);if(!e)throw new Error(`Instance not found: ${i.name}`);return e}has(i){return this._instances.has(i.name)}add(i,e){if(this._instances.has(i.name))throw new Error(`${i.name} already exists`);this._instances.set(i.name,e)}remove(i){if(!this._instances.has(i.name))throw new Error(`${i.name} does not exist`);return this._instances.delete(i.name),!0}clear(){this._instances.clear()}},si=class extends Mn{kind;constructor(i){super(),this.kind=i}},Lu=class extends Mn{kind="Connection Marker"},Bu=class extends Mn{kind="Connection";_instancesForCreate;_instancesForSnap;getForSnap(){return this._instancesForSnap}getForCreate(){return this._instancesForCreate}addForCreate(i){this._instancesForCreate=i}addForSnap(i){this._instancesForSnap=i}removeInstanceForCreate(){this._instancesForCreate=void 0}removeInstanceForSnap(){this._instancesForSnap=void 0}},zu=class extends Mn{kind="Node"},Tn=class{notifyOnSubscribe;static fToken=Symbol("ListenConnectionsChangesRequest");constructor(i=!0){this.notifyOnSubscribe=i}};function dg(){return t=>{let i=null,e=null,n=()=>{i!==null&&cancelAnimationFrame(i),e!==null&&cancelAnimationFrame(e),i=e=null};return{callback:()=>{n(),i=requestAnimationFrame(()=>{i=null,e=requestAnimationFrame(()=>{e=null,t()})})},cleanup:n}}}function lg(){return t=>{let i=null;return{callback:()=>{i!==null&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=null,t()})},cleanup:()=>{i!==null&&cancelAnimationFrame(i),i=null}}}}function Ja(t){return i=>{let e=null;return{callback:()=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{e=null,i()},t)},cleanup:()=>{e!==null&&clearTimeout(e),e=null}}}}var ct=class{_listeners=new Set;notify(){this._listeners.forEach(i=>i())}listen(i){return this._listeners.add(i),()=>this.stop(i)}stop(i){this._listeners.delete(i)}},Vu=class extends ct{_htmlElement;_observer=new ResizeObserver(()=>this.notify());_isObserving=!1;constructor(i){super(),this._htmlElement=i}listen(i){return this._isObserving||(this._observer.observe(this._htmlElement),this._isObserving=!0),super.listen(i)}stop(i){super.stop(i),this._listeners.size===0&&this._disconnect()}_disconnect(){this._observer.unobserve(this._htmlElement),this._observer.disconnect(),this._isObserving=!1}},vt=class t{_channels=[];_operators=[];constructor(...i){this._channels=[...i]}pipe(...i){let e=new t(...this._channels);return e._operators=[...this._operators,...i],e}listen(i,e){let n=e,o=[],r=[],s=[];for(let v of[...this._operators].reverse()){let b=v(n);n=b.callback,b.cleanup&&o.push(b.cleanup),b.onSubscribe&&r.push(b.onSubscribe),b.setTeardown&&s.push(b.setTeardown)}let a=this._channels.map(v=>v.listen(()=>n())),l=null,h=!1,_=()=>{h||(h=!0,l?.(),l=null,a.forEach(v=>v()),o.forEach(v=>v()))};s.slice().reverse().forEach(v=>v(_)),r.slice().reverse().forEach(v=>v(n)),l=i.onDestroy(_)}};function Sl(){return t=>{let i=!0;return{callback:t,onSubscribe:e=>{queueMicrotask(()=>{i&&e()})},cleanup:()=>{i=!1}}}}function ep(){return t=>{let i=!1,e=null;return{setTeardown:n=>e=n,callback:()=>{if(!i){i=!0;try{t()}finally{e?.()}}}}}}var ug=(()=>{let t=class Mo{_store=d(E);handle({notifyOnSubscribe:e}){return e?new vt(this._store.connectionsChanges$).pipe(Sl(),Ja(1)):new vt(this._store.connectionsChanges$).pipe(Ja(1))}static \u0275fac=function(n){return new(n||Mo)};static \u0275prov=g({token:Mo,factory:Mo.\u0275fac})};return t=C([x(Tn)],t),t})(),Gu=class{static fToken=Symbol("ListenNodesChangesRequest")},fg=(()=>{let t=class Do{_store=d(E);handle(e){return new vt(this._store.nodesChanges$)}static \u0275fac=function(n){return new(n||Do)};static \u0275prov=g({token:Do,factory:Do.\u0275fac})};return t=C([x(Gu)],t),t})(),ec=class{static fToken=Symbol("ListenTransformChangesRequest")},hg=(()=>{let t=class ko{_store=d(E);handle(e){return new vt(this._store.transformChanges$,this._store.connectionsChanges$,this._store.nodesChanges$)}static \u0275fac=function(n){return new(n||ko)};static \u0275prov=g({token:ko,factory:ko.\u0275fac})};return t=C([x(ec)],t),t})(),tn=class{static fToken=Symbol("EmitConnectionsChangesRequest")},pg=(()=>{let t=class Ro{_store=d(E);handle(e){this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Ro)};static \u0275prov=g({token:Ro,factory:Ro.\u0275fac})};return t=C([x(tn)],t),t})(),At=class{static fToken=Symbol("NotifyTransformChangedRequest")},E=(()=>{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 zu;connections=new Bu;connectionMarkers=new Lu;outputs=new si("Output");inputs=new si("Input");outlets=new si("Outlet");instances=new Au;fDraggable;emitNodeChanges(){this._nodesRevision++,this.nodesChanges$.notify()}emitConnectionChanges(){this._connectionsRevision++,this.connectionsChanges$.notify()}completeConnectionsRender(e,n){e<this._connectionsRenderedRevision||e===this._connectionsRenderedRevision&&n<=this._connectionsRenderedNodesRevision||(this._connectionsRenderedRevision=Math.min(e,this._connectionsRevision),this._connectionsRenderedNodesRevision=n,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(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),ye={MAGNETIC_LINES:en("magnetic-lines"),MAGNETIC_RECTS:en("magnetic-rects"),ZOOM:en("zoom-controls"),BACKGROUND:en("background"),SELECTION_AREA:en("selection-area"),MINIMAP:en("minimap"),AUTO_PAN:en("auto-pan")},mg=(()=>{let t=class No{_store=d(E);handle(e){this._store.transformChanged()}static \u0275fac=function(n){return new(n||No)};static \u0275prov=g({token:No,factory:No.\u0275fac})};return t=C([x(At)],t),t})(),Lt=class{key;instance;static fToken=Symbol("RegisterPluginInstanceRequest");constructor(i,e){this.key=i,this.instance=e}},_g=(()=>{let t=class Oo{_store=d(E);handle({key:e,instance:n}){this._store.instances.add(e,n)}static \u0275fac=function(n){return new(n||Oo)};static \u0275prov=g({token:Oo,factory:Oo.\u0275fac})};return t=C([x(Lt)],t),t})(),Bt=class{key;static fToken=Symbol("RemovePluginInstanceRequest");constructor(i){this.key=i}},gg=(()=>{let t=class Fo{_store=d(E);handle({key:e}){this._store.instances.remove(e)}static \u0275fac=function(n){return new(n||Fo)};static \u0275prov=g({token:Fo,factory:Fo.\u0275fac})};return t=C([x(Bt)],t),t})(),yg=[E,fg,ug,hg,pg,mg,_g,gg],vg=0,Cg=(()=>{let t=class Ao{_store=d(E);_browser=d(Re);get _backgroundElement(){return this._store.instances.get(ye.BACKGROUND)?.hostElement}handle(e){let n=this._getPatterns(e.fPattern?.hostElement);if(!n?.length)return;let o=Pn("defs",this._browser);if(e.fPattern?.hostElement.remove(),n.forEach(r=>{o.append(r)}),n.length){this._backgroundElement?.firstChild?.appendChild(o),n[n.length-1].id="f-background-pattern-"+vg++;let r=n[n.length-1].id,s=Pn("rect",this._browser);s.setAttribute("fill","url(#"+r+")"),s.setAttribute("width","100%"),s.setAttribute("height","100%"),this._backgroundElement?.firstChild?.appendChild(s);let a=this._store.fCanvas?.transform||kt.default();e.fPattern?.setTransform(a)}}_getPatterns(e){return Array.from(e?.getElementsByTagName("pattern")||[])}static \u0275fac=function(n){return new(n||Ao)};static \u0275prov=g({token:Ao,factory:Ao.\u0275fac})};return t=C([x(Qa)],t),t})(),ai=class{fTransform;static fToken=Symbol("SetBackgroundTransformRequest");constructor(i){this.fTransform=i}},xg=(()=>{let t=class Lo{_store=d(E);handle(e){this._store.instances.get(ye.BACKGROUND)?.setTransform(e.fTransform)}static \u0275fac=function(n){return new(n||Lo)};static \u0275prov=g({token:Lo,factory:Lo.\u0275fac})};return t=C([x(ai)],t),t})(),bg=[Cg,xg],tc=class{instance;static fToken=Symbol("AddCanvasToStoreRequest");constructor(i){this.instance=i}},wg=(()=>{let t=class Bo{_store=d(E);handle({instance:e}){this._store.fCanvas=e}static \u0275fac=function(n){return new(n||Bo)};static \u0275prov=g({token:Bo,factory:Bo.\u0275fac})};return t=C([x(tc)],t),t})(),nc=class{id;animated;static fToken=Symbol("CenterGroupOrNodeRequest");constructor(i,e){this.id=i,this.animated=e}},Sg=(()=>{let t=class zo{_store=d(E);_mediator=d(R);get _transform(){return this._store.transform}handle({id:e,animated:n}){let o=this._store.nodes.get(e);o&&(this._toCenter(this._getNodeRect(o),this._getFlowRect(),o._position),this._mediator.execute(new Dn(n,nn.VIEWPORT_ONLY)))}_toCenter(e,n,o){this._transform.scaledPosition=L.initialize(),this._transform.position=L.initialize((n.width-e.width)/2-o.x*this._transform.scale,(n.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(n){return new(n||zo)};static \u0275prov=g({token:zo,factory:zo.\u0275fac})};return t=C([x(nc)],t),t})(),ic=class{toCenter;animated;static fToken=Symbol("FitToFlowRequest");constructor(i,e){this.toCenter=i,this.animated=e}},Ig=(()=>{let t=class Vo{_store=d(E);get _transform(){return this._store.transform}_mediator=d(R);handle({toCenter:e,animated:n}){let o=this._mediator.execute(new Ln)||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 Dn(n,nn.VIEWPORT_ONLY)))}fitToParent(e,n,o,r){this._transform.scaledPosition=L.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let s=e.width/this._transform.scale+r.x,a=e.height/this._transform.scale+r.y;(s>n.width||a>n.height||s<n.width&&a<n.height)&&(this._transform.scale=Math.min(n.width/s,n.height/a));let l=(n.width-s*this._transform.scale)/2-this._transform.position.x*this._transform.scale,h=(n.height-a*this._transform.scale)/2-this._transform.position.y*this._transform.scale;this._transform.position=L.initialize(l+r.x/2*this._transform.scale,h+r.y/2*this._transform.scale)}_getZeroPositionWithoutScale(e){let n=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return L.initialize(n,o)}static \u0275fac=function(n){return new(n||Vo)};static \u0275prov=g({token:Vo,factory:Vo.\u0275fac})};return t=C([x(ic)],t),t})(),oc=class{transform;position;static fToken=Symbol("InputCanvasPositionRequest");constructor(i,e){this.transform=i,this.position=e}},Tg=(()=>{let t=class Go{_store=d(E);handle({transform:e,position:n}){n&&(L.isEqual(this._calculateTransformPosition(e),n)||(e.position=n,e.scaledPosition=L.initialize(),this._store.fCanvas?.redraw()))}_calculateTransformPosition(e){return L.sum(e.position,e.scaledPosition)}static \u0275fac=function(n){return new(n||Go)};static \u0275prov=g({token:Go,factory:Go.\u0275fac})};return t=C([x(oc)],t),t})(),rc=class{transform;scale;static fToken=Symbol("InputCanvasScaleRequest");constructor(i,e){this.transform=i,this.scale=e}},Eg=(()=>{let t=class Ho{_store=d(E);handle(e){!e.scale&&e.scale!==0||(e.transform.scale=e.scale,this._store.fCanvas?.redraw())}static \u0275fac=function(n){return new(n||Ho)};static \u0275prov=g({token:Ho,factory:Ho.\u0275fac})};return t=C([x(rc)],t),t})(),nn=(function(t){return t.VIEWPORT_ONLY="VIEWPORT_ONLY",t.WITH_CONNECTION_CHANGES="WITH_CONNECTION_CHANGES",t})(nn||{}),Dn=class{animated;context;static fToken=Symbol("RedrawCanvasWithAnimationRequest");constructor(i,e=nn.WITH_CONNECTION_CHANGES){this.animated=i,this.context=e}};function Ep(t,i){let e=n=>{n.propertyName==="transform"&&(t.removeEventListener("transitionend",e),i(n))};t.addEventListener("transitionend",e)}var Pg=(()=>{let t=class jo{_store=d(E);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(),Ep(this._canvas.hostElement,()=>{this._store.endViewportAnimation(),e===nn.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()})}_redraw(e){this._canvas?.redraw(),e===nn.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||jo)};static \u0275prov=g({token:jo,factory:jo.\u0275fac})};return t=C([x(Dn)],t),t})(),sc=class{static fToken=Symbol("RemoveCanvasFromStoreRequest")},Mg=(()=>{let t=class Uo{_store=d(E);handle(e){this._store.fCanvas=void 0}static \u0275fac=function(n){return new(n||Uo)};static \u0275prov=g({token:Uo,factory:Uo.\u0275fac})};return t=C([x(sc)],t),t})(),ac=class{static fToken=Symbol("ResetScaleRequest")},Dg=(()=>{let t=class $o{_store=d(E);get _transform(){return this._store.transform}handle(e){this._transform.scale=1,this._transform.scaledPosition=L.initialize()}static \u0275fac=function(n){return new(n||$o)};static \u0275prov=g({token:$o,factory:$o.\u0275fac})};return t=C([x(ac)],t),t})(),cc=class{animated;static fToken=Symbol("ResetScaleAndCenterRequest");constructor(i){this.animated=i}},kg=(()=>{let t=class Wo{_mediator=d(R);_store=d(E);get _transform(){return this._store.transform}handle({animated:e}){let n=this._mediator.execute(new Ln)||G.initialize();n.width===0||n.height===0||(this._oneToOneCentering(n,G.fromElement(this._store.flowHost),this._store.nodes.getAll().map(o=>o._position)),this._mediator.execute(new Dn(e,nn.VIEWPORT_ONLY)))}_oneToOneCentering(e,n,o){this._transform.scaledPosition=L.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let r=(n.width-e.width/this._transform.scale)/2-this._transform.position.x,s=(n.height-e.height/this._transform.scale)/2-this._transform.position.y;this._transform.scale=1,this._transform.position=L.initialize(r,s)}_getZeroPositionWithoutScale(e){let n=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return L.initialize(n,o)}static \u0275fac=function(n){return new(n||Wo)};static \u0275prov=g({token:Wo,factory:Wo.\u0275fac})};return t=C([x(cc)],t),t})(),dc=class{scale;toPosition;static fToken=Symbol("UpdateScaleRequest");constructor(i,e){this.scale=i,this.toPosition=e}},Rg=(()=>{let t=class qo{_store=d(E);get _transform(){return this._store.transform}handle({scale:e,toPosition:n}){if(e===this._transform.scale)return;let o=L.sum(this._transform.scaledPosition,this._transform.position),r=n.x-(n.x-o.x)*e/this._transform.scale,s=n.y-(n.y-o.y)*e/this._transform.scale;this._transform.scale=e,this._transform.scaledPosition=L.sub(L.initialize(r,s),this._transform.position)}static \u0275fac=function(n){return new(n||qo)};static \u0275prov=g({token:qo,factory:qo.\u0275fac})};return t=C([x(dc)],t),t})(),Ng=[wg,Sg,Ig,Tg,Eg,Pg,Mg,Dg,kg,Rg],Hu=class{connection;static fToken=Symbol("AddConnectionForCreateToStoreRequest");constructor(i){this.connection=i}},Og=(()=>{let t=class Xo{_store=d(E);handle({connection:e}){this._store.connections.addForCreate(e)}static \u0275fac=function(n){return new(n||Xo)};static \u0275prov=g({token:Xo,factory:Xo.\u0275fac})};return t=C([x(Hu)],t),t})(),ju=class{instance;static fToken=Symbol("AddConnectionMarkerToStoreRequest");constructor(i){this.instance=i}},Fg=(()=>{let t=class Ko{_store=d(E);handle({instance:e}){this._store.connectionMarkers.add(e),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Ko)};static \u0275prov=g({token:Ko,factory:Ko.\u0275fac})};return t=C([x(ju)],t),t})(),lc=class{connection;static fToken=Symbol("AddConnectionToStoreRequest");constructor(i){this.connection=i}},Ag=(()=>{let t=class Yo{_store=d(E);handle({connection:e}){this._store.connections.add(e),this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Yo)};static \u0275prov=g({token:Yo,factory:Yo.\u0275fac})};return t=C([x(lc)],t),t})(),Uu=class{connection;static fToken=Symbol("AddSnapConnectionToStoreRequest");constructor(i){this.connection=i}},Lg=(()=>{let t=class Zo{_store=d(E);handle({connection:e}){this._store.connections.addForSnap(e)}static \u0275fac=function(n){return new(n||Zo)};static \u0275prov=g({token:Zo,factory:Zo.\u0275fac})};return t=C([x(Uu)],t),t})(),kn=class{connection;static fToken=Symbol("CreateConnectionMarkersRequest");constructor(i){this.connection=i}},tp=new fe("F_CONNECTION_CONTENT");var uc=class t{points;cumulativeLengths;segmentTangents;totalLength;constructor(i){let e=t._removeConsecutiveDuplicates(i);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 n=this.points.length,o=n-1,r=new Array(n).fill(0),s=new Array(o),a=0;for(let l=0;l<o;l++){let h=this.points[l+1].x-this.points[l].x,_=this.points[l+1].y-this.points[l].y,v=Math.hypot(h,_),b=v?h/v:1,I=v?_/v:0;s[l]={x:b,y:I},a+=v,r[l+1]=a}this.cumulativeLengths=r,this.segmentTangents=s,this.totalLength=a||1}static from(i){return new t(i.map(e=>({x:e.x,y:e.y})))}static _removeConsecutiveDuplicates(i){let e=[];for(let n of i){let o=e[e.length-1];(!o||o.x!==n.x||o.y!==n.y)&&e.push({x:n.x,y:n.y})}return e}},$u=class t{_polyline;constructor(i=[]){this._polyline=new uc(i)}updatePoints(i){return this._polyline=new uc(i),this._polyline.totalLength}calculateTotalLength(i){return this.updatePoints(i)}get totalLength(){return this._polyline.totalLength}getPointAtProgress(i){let{points:e,cumulativeLengths:n,segmentTangents:o,totalLength:r}=this._polyline,a=t._clamp(i,0,1)*r,l=.5;if(a<=l)return{point:e[0],tangent:o[0]??{x:1,y:0},atEdge:!0};if(r-a<=l){let O=e.length-1;return{point:e[O],tangent:o[O-1]??{x:1,y:0},atEdge:!0}}let h=t._findRightIndex(n,a),_=Math.max(1,h),v=n[_-1],b=n[_],I=t._safeRatio(a-v,b-v),N=e[_-1],D=e[_],M={x:t._lerp(N.x,D.x,I),y:t._lerp(N.y,D.y,I)},k=o[_-1]??{x:1,y:0};return{point:M,tangent:k,atEdge:!1}}getPointAtLength(i){return this.getPointAtProgress(i)}getPointAtDistance(i){let e=this._polyline.totalLength?i/this._polyline.totalLength:0;return this.getPointAtProgress(e)}static _findRightIndex(i,e){let n=0,o=i.length-1;for(;n<o;){let r=n+o>>1;i[r]<e?n=r+1:o=r}return n}static _lerp(i,e,n){return i+(e-i)*n}static _clamp(i,e,n){return i<e?e:i>n?n:i}static _safeRatio(i,e){let n=Math.abs(e)<1e-6?1e-6:e;return i/n}},Pp=(function(t){return t.NONE="none",t.ALONG="along",t})(Pp||{}),Wu=class{compute(i,e){let n=this._clamp01(e.position()),{point:o,tangent:r}=i.getPointAtLength(n),s={x:-r.y,y:r.x},a=e.offset()??0,l=o.x+s.x*a,h=o.y+s.y*a,v=this._sizeAlongDirection(e.hostElement,r)*.5,b=n*i.totalLength,I=i.totalLength-b,N=this._applyEdgeGuard(l,h,r,b,I,v),D=this._calculateContentRotation(e.align(),r);return{position:N,rotationDeg:D}}_clamp01(i){return i<=0?0:i>=1?1:i}_applyEdgeGuard(i,e,n,o,r,s){if(o<=s){let a=s-o;return{x:i+n.x*a,y:e+n.y*a}}if(r<=s){let a=s-r;return{x:i-n.x*a,y:e-n.y*a}}return{x:i,y:e}}_sizeAlongDirection(i,e){let n=G.fromElement(i);return Math.abs(e.x)*n.width+Math.abs(e.y)*n.height}_normalize180(i){let e=(i+180)%360;return e<0&&(e+=360),e-180}_keepUpright(i){let e=this._normalize180(i);return e>90?e-=180:e<-90&&(e+=180),e}_calculateContentRotation(i,e){let n=0;return i===Pp.ALONG&&(n=Math.atan2(e.y,e.x)*180/Math.PI,n=this._keepUpright(n)),n}},qu=class{_placement;constructor(i=new Wu){this._placement=i}layout(i,e){let n=new $u(i),o=n.totalLength;for(let r of e){let{position:s,rotationDeg:a}=this._placement.compute(n,r);r.hostElement.style.transform=this._createTransformString(s,a)}return o}_createTransformString(i,e){return`translate3d(${i.x}px, ${i.y}px, 0) translate(-50%, -50%) rotate(${e}deg)`}};var np=new fe("F_CONNECTION_WAYPOINTS");function Mp(t,i,e){return(t.x-i.x)**2+(t.y-i.y)**2<=e**2}function Bg(t,i){let e=t.fWaypoints(),n=e?.radius()||8;return e?.candidates().find(o=>Mp(i,o,n))}function zg(t,i){let e=t.fWaypoints(),n=e?.radius()||8;return e?.waypoints().find(o=>Mp(i,o,n))}function Vg(t,i){for(let e of t){let n=zg(e,i);if(n&&e.fWaypoints()?.visibility())return{connection:e,waypoint:n};let o=Bg(e,i);if(o&&e.fWaypoints()?.visibility())return{connection:e,candidate:o}}}var Il=new fe("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||{}),Xu=new fe("F_CONNECTION_MARKER"),Gg=0,Ku=class{fId=q(`f-marker-${Gg++}`);hostElement=d(Se).nativeElement};function Hg(t,i=ge.START){if(typeof t!="string")return i;let e=t.trim().toLowerCase();return e?jg(e)??i:i}function jg(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 Dp=(()=>{class t extends Ku{_markerElement=Te.required("markerElement");_type=F(ge.END_ALL_STATES,{alias:"type",transform:e=>Hg(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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-connection-marker-arrow"]],viewQuery:function(n,o){n&1&&ft(o._markerElement,H_,5),n&2&&it()},hostAttrs:[1,"f-component",2,"display","none"],inputs:{_type:[1,"type","_type"]},features:[Ie([{provide:Xu,useExisting:t}]),_e],decls:3,vars:0,consts:[["markerElement",""],["viewBox","0 0 6 6",1,"f-marker"],["d","M0,0 L6,3 0,6Z"]],template:function(n,o){n&1&&($e(),H(0,"svg",1,0),Pt(2,"path",2),$())},encapsulation:2})}return t})();var Ot=(function(t){return t.FIXED="fixed",t.FIXED_CENTER="fixed_center",t.FLOATING="floating",t})(Ot||{}),qe=(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})(qe||{});function Ug({sourceRect:t,targetRect:i}){return{point1:t.gravityCenter,point2:i.gravityCenter}}var B=(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})(B||{}),Nt=(function(t){return t.SEGMENT="segment",t.STRAIGHT="straight",t.BEZIER="bezier",t.ADAPTIVE_CURVE="adaptive-curve",t})(Nt||{});function $g({sourceRect:t,sourceConnectableSide:i,targetRect:e,targetConnectableSide:n}){return{point1:ip(t,i===B.AUTO?B.BOTTOM:i),point2:ip(e,n===B.AUTO?B.TOP:n)}}function ip(t,i){switch(i){case B.TOP:return{x:t.x+t.width/2,y:t.y};case B.BOTTOM:return{x:t.x+t.width/2,y:t.y+t.height};case B.LEFT:return{x:t.x,y:t.y+t.height/2};case B.RIGHT:return{x:t.x+t.width,y:t.y+t.height/2};default:throw new Error(`Unknown side: ${i}`)}}function kp(t,i,e,n){if(!n||!n.rotationDeg)return Sn.getRoundedRectIntersections(t,i,e)[0];let o=Qo(t,-n.rotationDeg,n.pivot),r=Qo(i,-n.rotationDeg,n.pivot),s=Wg(e,-n.rotationDeg,n.pivot),a=Sn.getRoundedRectIntersections(o,r,s)[0];return a?Qo(a,n.rotationDeg,n.pivot):void 0}function Wg(t,i,e){let n=Qo(qg(t),i,e);return new ke(n.x-t.width/2,n.y-t.height/2,t.width,t.height,t.radius1,t.radius2,t.radius3,t.radius4)}function qg(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Qo(t,i,e){let n=t.x-e.x,o=t.y-e.y,r=i*Math.PI/180,s=Math.cos(r),a=Math.sin(r);return{x:n*s-o*a+e.x,y:n*a+o*s+e.y}}function Xg({sourceRect:t,targetRect:i,sourceRotationContext:e,targetRotationContext:n}){return Zg(Kg(t,i,e),Yg(t,i,n),t,i)}function Kg(t,i,e){return kp(t.gravityCenter,i.gravityCenter,t,e)}function Yg(t,i,e){return kp(i.gravityCenter,t.gravityCenter,i,e)}function Zg(t,i,e,n){return{point1:t||e.gravityCenter,point2:i||n.gravityCenter}}var Eo=.5,Qg={[Ot.FLOATING]:Xg,[Ot.FIXED_CENTER]:Ug,[Ot.FIXED]:$g},jn=(()=>{class t{handle(e){let n=this._calculateDirectionalVectors(e.sourceRect.gravityCenter.x,e.sourceRect.gravityCenter.y,e.targetRect.gravityCenter.x,e.targetRect.gravityCenter.y),o=this._determineSourceSide(e,n),r=this._determineTargetSide(e,n);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,n,o,r){let s=o-e,a=r-n;return{sourceToTargetX:s,sourceToTargetY:a,targetToSourceX:-s,targetToSourceY:-a}}_determineSourceSide(e,n){return this._resolveConnectableSide(e.connection.fOutputSide(),n.sourceToTargetX,n.sourceToTargetY,e.sourceConnectableSide)}_determineTargetSide(e,n){return this._resolveConnectableSide(e.connection.fInputSide(),n.targetToSourceX,n.targetToSourceY,e.targetConnectableSide)}_resolveConnectableSide(e,n,o,r){if(e===qe.DEFAULT)return r;let s=Math.abs(n),a=Math.abs(o);if(s<Eo&&a<Eo)return r;let h=s>=a;switch(e){case qe.CALCULATE:return h?n>=0?B.RIGHT:B.LEFT:o>=0?B.BOTTOM:B.TOP;case qe.CALCULATE_HORIZONTAL:return s<Eo?r:n>=0?B.RIGHT:B.LEFT;case qe.CALCULATE_VERTICAL:return a<Eo?r:o>=0?B.BOTTOM:B.TOP;case qe.TOP:return B.TOP;case qe.BOTTOM:return B.BOTTOM;case qe.LEFT:return B.LEFT;case qe.RIGHT:return B.RIGHT;default:return r}}_getBehaviorHandler(e){let n=Qg[e];if(!n)throw new Error(`[Behavior] No handler for behavior: ${e}`);return n}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),mt=class{sourceRect;targetRect;connection;sourceConnectableSide;targetConnectableSide;sourceRotationContext;targetRotationContext;constructor(i,e,n,o,r,s,a){this.sourceRect=i,this.targetRect=e,this.connection=n,this.sourceConnectableSide=o,this.targetConnectableSide=r,this.sourceRotationContext=s,this.targetRotationContext=a}};function Tl(t,i,e){return[t,...e??[],i]}function Jg(t,i){let e=Math.abs(i.x-t.x)/2,n=i.x<t.x?i.x+e:i.x-e,o=Math.abs(i.y-t.y)/2,r=i.y<t.y?i.y+o:i.y-o;return{x:n,y:r}}function e0(t,i=32){let e=new Array(i+1);e[0]=ue({},t[0]);for(let n=1;n<=i;n++)e[n]=Rp(t[0],t[1],t[2],t[3],n/i);return e}function Rp(t,i,e,n,o){let r=1-o,s=o*o,a=r*r,l=a*r,h=s*o;return{x:l*t.x+3*a*o*i.x+3*r*s*e.x+h*n.x,y:l*t.y+3*a*o*i.y+3*r*s*e.y+h*n.y}}function Np(t){return t.map(i=>Rp(i.p0,i.c1,i.c2,i.p3,.5))}function t0(t){if(t.length<2)throw new Error("Polylines must be at least two points");let i=n0(t);return i<=0?[ue({},t[0])]:[i0(t,i/2)]}function n0(t){let i=0;for(let e=0;e<t.length-1;e++)i+=Op(t[e],t[e+1]);return i}function i0(t,i){let e=0;for(let o=0;o<t.length-1;o++){let r=t[o],s=t[o+1],a=Op(r,s);if(!(a<=0)){if(e+a>=i){let l=(i-e)/a;return{x:r.x+(s.x-r.x)*l,y:r.y+(s.y-r.y)*l}}e+=a}}let n=t[t.length-1];return{x:n.x,y:n.y}}function Op(t,i){return Math.hypot(i.x-t.x,i.y-t.y)}function o0(t){let i=[];for(let e of t)for(let n of e){let o=i[i.length-1];(!o||o.x!==n.x||o.y!==n.y)&&i.push(n)}return i}function Fp(t){if(!t.length)return"";let i=`M ${t[0].p0.x} ${t[0].p0.y}`;for(let e=0;e<t.length;e++){let n=t[e],o=e===t.length-1,r=o?n.p3.x+2e-4:n.p3.x,s=o?n.p3.y+2e-4:n.p3.y;i+=` C ${n.c1.x} ${n.c1.y}, ${n.c2.x} ${n.c2.y}, ${r} ${s}`}return i}function Ap(t,i=16){if(!t.length)return[];let e=[];for(let n=0;n<t.length;n++){let o=t[n],r=e0([o.p0,o.c1,o.c2,o.p3],i);n>0&&r.shift(),e.push(...r)}return e}function r0(t,i=1e-6){let e=t.length;if(e<=2)return t;let n=[];n.push(t[0]);for(let r=1;r<e;r++){let s=t[r],a=n[n.length-1];(Math.abs(s.x-a.x)>i||Math.abs(s.y-a.y)>i)&&n.push(s)}if(n.length<=2)return n;let o=[];o.push(n[0]);for(let r=1;r<n.length-1;r++){let s=o[o.length-1],a=n[r],l=n[r+1],h=Math.abs(s.x-a.x)<=i&&Math.abs(a.x-l.x)<=i,_=Math.abs(s.y-a.y)<=i&&Math.abs(a.y-l.y)<=i;!h&&!_&&o.push(a)}return o.push(n[n.length-1]),o}var Yu=class t{static _dir(i){switch(i){case B.LEFT:return{x:-1,y:0};case B.RIGHT:return{x:1,y:0};case B.TOP:return{x:0,y:-1};case B.BOTTOM:return{x:0,y:1};case B.AUTO:return{x:0,y:0}}return{x:0,y:0}}static _isHorizontal(i){return i===B.LEFT||i===B.RIGHT}static _handleLength(i,e,n,o){let r=Math.abs(e.x-i.x),s=Math.abs(e.y-i.y),a=Math.hypot(r,s),l=n===B.AUTO?Math.max(r,s):this._isHorizontal(n)?r:s,h=Math.max(8,o),_=o+.5*a,v=o*1.05+l*.3;return Math.min(_,Math.max(h,v))}static _softControl(i,e,n,o){let r=this._dir(i),s=n.x-e.x,a=n.y-e.y,l=Math.hypot(s,a)||1,h=s/l,_=a/l;if(i===B.AUTO)return{x:e.x+h*o,y:e.y+_*o};let v=r.x*h+r.y*_,b=.12,I=Math.max(0,-v)*.08,N=Math.min(.2,b+I),D=r.x*(1-N)+h*N,M=r.y*(1-N)+_*N,k=Math.hypot(D,M)||1;return{x:e.x+D/k*o,y:e.y+M/k*o}}handle({source:i,sourceSide:e,target:n,targetSide:o,offset:r,waypoints:s}){let a=Math.max(0,r??0),l=Tl(i,n,s),h=[];for(let v=0;v<l.length-1;v++){let b=l[v],I=l[v+1],N=t._handleLength(b,I,e,a),D=t._handleLength(I,b,o,a),M=t._softControl(e,b,I,N),k=t._softControl(o,I,b,D);h.push({p0:b,c1:M,c2:k,p3:I,chainIndex:v})}let _=Ap(h,12);return{path:Fp(h),secondPoint:h[0]?.c1??i,penultimatePoint:h[h.length-1]?.c2??n,points:_,candidates:Np(h)}}},Zu=class{handle({source:i,sourceSide:e,target:n,targetSide:o,offset:r,waypoints:s}){let a=Tl(i,n,s),l=[];for(let _=0;_<a.length-1;_++){let v=a[_],b=a[_+1],I=op(e,v,b,r??0),N=op(o,b,v,r??0);l.push({p0:v,c1:I,c2:N,p3:b,chainIndex:_})}let h=Ap(l,12);return{path:Fp(l),secondPoint:l[0]?.c1??i,penultimatePoint:l[l.length-1]?.c2??n,points:h,candidates:Np(l)}}};function op(t,i,e,n){let o={x:i.x,y:i.y};switch(t){case B.LEFT:o.x-=Po(i.x-e.x,n);break;case B.RIGHT:o.x+=Po(e.x-i.x,n);break;case B.TOP:o.y-=Po(i.y-e.y,n);break;case B.BOTTOM:o.y+=Po(e.y-i.y,n);break;case B.AUTO:break}return o}function Po(t,i){return t>=i?t:i*Math.sqrt(i-t)}function s0(t){let{axis:i,source:e,target:n,sourceSide:o,targetSide:r,sourceGap:s,targetGap:a,sourceDir:l,targetDir:h,currentDir:_,offset:v,sourceGapOffset:b,targetGapOffset:I}=t,N=a0(s,a),D=c0(i,l,_,N);return o===r?d0(i,e,n,v,l,_,s,a,b,I):D=l0(i,l,h,s,a,N,D),D}function a0(t,i){return{sourceTarget:[{x:t.x,y:i.y}],targetSource:[{x:i.x,y:t.y}]}}function c0(t,i,e,n){return t==="x"?i.x===e?n.targetSource:n.sourceTarget:i.y===e?n.sourceTarget:n.targetSource}function d0(t,i,e,n,o,r,s,a,l,h){let _=Math.abs(i[t]-e[t]);if(_>n)return;let v=Math.min(n-1,n-_);v<=0||(o[t]===r?l[t]=(s[t]>i[t]?-1:1)*v:h[t]=(a[t]>e[t]?-1:1)*v)}function l0(t,i,e,n,o,r,s){let a=t==="x"?"y":"x",l=i[t]===e[a],h=n[a]>o[a],_=n[a]<o[a];return i[t]===1&&(!l&&h||l&&_)||i[t]!==1&&(!l&&_||l&&h)?t==="x"?r.sourceTarget:r.targetSource:s}var oi=1e-6,rp=2e-4,u0=.75;function f0(t,i){let e=t.length,n=[];n.push(`M ${t[0].x} ${t[0].y}`);for(let r=1;r<e-1;r++)n.push(h0(t[r-1],t[r],t[r+1],i));let o=t[e-1];return n.push(`L ${o.x+rp} ${o.y+rp}`),n.join(" ")}function h0(t,i,e,n){let o=i.x,r=i.y;if(n<=0)return`L ${o} ${r}`;let s=Math.abs(t.x-o)<=oi&&Math.abs(o-e.x)<=oi,a=Math.abs(t.y-r)<=oi&&Math.abs(r-e.y)<=oi;if(s||a)return`L ${o} ${r}`;let l=Math.hypot(o-t.x,r-t.y),h=Math.hypot(e.x-o,e.y-r),_=Math.min(l*.5,h*.5,n);if(_<u0)return`L ${o} ${r}`;if(Math.abs(t.y-r)<=oi){let M=t.x<e.x?-1:1,k=t.y<e.y?1:-1,O=o+_*M,z=r+_*k;return`L ${O} ${r} Q ${o} ${r} ${o} ${z}`}let b=t.x<e.x?1:-1,I=t.y<e.y?-1:1,N=r+_*I,D=o+_*b;return`L ${o} ${N} Q ${o} ${r} ${D} ${r}`}var sp={[B.LEFT]:L.initialize(-1,0),[B.RIGHT]:L.initialize(1,0),[B.TOP]:L.initialize(0,-1),[B.BOTTOM]:L.initialize(0,1),[B.AUTO]:L.initialize(0,0)},Qu=class{handle({source:i,sourceSide:e,target:n,targetSide:o,waypoints:r,offset:s,radius:a}){let l=Tl(i,n,r),h=[],_=[];for(let N=0;N<l.length-1;N++){let D=l[N],M=l[N+1],k=this._getPathPoints(D,e,M,o,s??0);h.push(k),_.push(...t0(k))}let v=r0(o0(h)),b=v.length>1?v[v.length-2]:i,I=v.length>1?v[1]:n;return{path:f0(v,a??0),penultimatePoint:b,secondPoint:I,points:v,candidates:_}}_getPathPoints(i,e,n,o,r){let s=sp[e],a=sp[o],l={x:i.x+s.x*r,y:i.y+s.y*r},h={x:n.x+a.x*r,y:n.y+a.y*r},_=this._getDirection(l,e,h),v=_.x!==0?"x":"y",b=_[v],I=[],N=L.initialize(),D=L.initialize(),M=Jg(i,n);if(s[v]*a[v]===-1){let k=[{x:M.x,y:l.y},{x:M.x,y:h.y}],O=[{x:l.x,y:M.y},{x:h.x,y:M.y}];s[v]===b?I=v==="x"?k:O:I=v==="x"?O:k}else I=s0({axis:v,source:i,target:n,sourceSide:e,targetSide:o,sourceGap:l,targetGap:h,sourceDir:s,targetDir:a,currentDir:b,offset:r,sourceGapOffset:N,targetGapOffset:D});return[i,{x:l.x+N.x,y:l.y+N.y},...I,{x:h.x+D.x,y:h.y+D.y},n]}_getDirection(i,e,n){return e===B.LEFT||e===B.RIGHT?i.x<n.x?L.initialize(1,0):L.initialize(-1,0):i.y<n.y?L.initialize(0,1):L.initialize(0,-1)}},ap=2e-4,Ju=class{handle(i){let e=Tl(i.source,i.target,i.waypoints),n=e.length,o=e[0],r=`M ${o.x} ${o.y}`,s=new Array(n-1);for(let a=0;a<n-1;a++){let l=e[a],h=e[a+1],_=a===n-2,v=_?h.x+ap:h.x,b=_?h.y+ap:h.y;r+=` L ${v} ${b}`,s[a]={x:(l.x+h.x)*.5,y:(l.y+h.y)*.5}}return{path:r,candidates:s,points:e,secondPoint:e[1]??i.target,penultimatePoint:e[n-2]??i.source}}},p0=new fe("F_CONNECTION_BUILDERS"),Lp=(()=>{class t{_builtinBuilders={[Nt.STRAIGHT]:new Ju,[Nt.BEZIER]:new Zu,[Nt.ADAPTIVE_CURVE]:new Yu,[Nt.SEGMENT]:new Qu};_providedBuilders;_builders;constructor(){this._providedBuilders=d(p0,{optional:!0})||{},this._builders=ue(ue({},this._builtinBuilders),this._providedBuilders)}handle({type:e,payload:n}){let o=this._builders[e];if(!o)throw this._createBuilderNotFoundError(e);return o.handle(n)}_createBuilderNotFoundError(e){let n=Object.keys(this._builtinBuilders).sort(),o=Object.keys(this._providedBuilders).sort(),r=Object.keys(this._builders).sort(),s=n.filter(l=>l in this._providedBuilders).sort(),a=[`Connection Builder Error: builder type "${e}" not found.`,`Registered types: ${r.length?r.join(", "):"(none)"}`,`Built-in types: ${n.length?n.join(", "):"(none)"}`,`Provided (F_CONNECTION_BUILDERS) types: ${o.length?o.join(", "):"(none)"}`,s.length?`Overridden built-ins: ${s.join(", ")}`:null,"Tip: ensure you pass a valid Connection Type or provide a builder via F_CONNECTION_BUILDERS."].filter(Boolean);return new Error(a.join(`
|
|
1
|
+
import{b as xn,d as Wh}from"./chunk-K5PULFK7.js";import{a as wo,b as So,c as Io,d as bn,e as To,f as wn}from"./chunk-6BZZQV42.js";import{b as Oh,d as po,e as Fh,i as _o,j as Vh,k as Qe,l as je,m as Mt,n as yo,o as Zt,p as Dt,r as vo}from"./chunk-OJ6W6OIB.js";import{c as jh,d as Uh,e as $h}from"./chunk-4NLC7QD2.js";import{h as Co,i as xo,j as bo}from"./chunk-6GUHSAP5.js";import{$a as _n,$c as yn,Aa as Me,Db as ot,Eb as Ae,Ec as Lh,Fb as Q,Fc as Bh,Gb as Ie,Gc as gn,Hc as mo,J as g,Ja as Z,Jc as zh,K as no,M as fe,Ma as w,Mc as Gh,N as pn,Na as S,Nc as Hh,O as d,Pa as we,Pb as ei,Qa as J,R as Ch,Ra as ee,Rb as gt,S as j,Sa as T,Sb as P,T as U,Ta as u,Tc as ti,U as $e,Ua as f,Uc as go,V as Ye,Va as A,Vb as He,W as io,Wa as H,Wb as F,X as Ze,Xa as $,Xb as Te,Ya as Pt,Yb as lo,Z as nt,Za as Wt,Zb as Cu,_ as Qn,_a as qt,_b as Kt,ab as ao,ad as vn,ba as q,bb as co,bc as xe,ca as me,cb as ae,cc as We,da as mn,db as yu,ea as ne,eb as K,ed as Cn,fd as Yt,g as C,ga as Se,gb as p,ha as oo,hb as Xt,ia as xh,ib as De,ja as _u,jb as Ph,la as bh,lb as wt,lc as kh,m as eo,ma as wh,mb as St,n as vh,na as c,nb as vu,nc as Rh,oa as Sh,ob as ft,oc as uo,pa as Ih,pb as it,pc as fo,qa as Th,ra as gu,rb as at,rc as Nh,sa as ro,sb as de,sc as ho,tb as Mh,u as to,ub as Ce,va as te,vb as m,wa as so,wb as y,xa as Pe,xb as Ge,ya as Eh,yb as Jn,za as _e,zb as Dh,zc as xu}from"./chunk-ZSRIBCAW.js";import{V as Ah}from"./chunk-3R7E3HPC.js";import{a as ue,b as mu}from"./chunk-Q7L6LLAK.js";var Qt=class{constructor(i,e,n,o,r){this.center=i,this.radiusX=e,this.radiusY=n,this.startAngle=o,this.endAngle=r}},L=class t{static castToPoint(i){return i||t.initialize()}static initialize(i=0,e=0){return{x:i,y:e}}static copy(i){return t.initialize(i.x,i.y)}static isEqual(i,e){return i.x===e.x&&i.y===e.y}static sum(i,e){return{x:i.x+e.x,y:i.y+e.y}}static sub(i,e){return{x:i.x-e.x,y:i.y-e.y}}static div(i,e){return{x:i.x/e,y:i.y/e}}static mult(i,e){return{x:i.x*e,y:i.y*e}}static interpolatePoints(i,e,n){let o=1-n;return t.initialize(i.x*o+e.x*n,i.y*o+e.y*n)}static roundTo(i,e){let n=Math.trunc(i.x/e),o=Math.trunc(i.y/e);return{x:n*e,y:o*e}}static hypotenuse(i,e){let n=e.x-i.x,o=e.y-i.y;return Math.abs(Math.sqrt(n*n+o*o))}static distance(i,e){let n=i.x-e.x,o=i.y-e.y;return Math.sqrt(n*n+o*o)}static getMinimum(i,e){return t.initialize(Math.min(i.x,e.x),Math.min(i.y,e.y))}static getMaximum(i,e){return t.initialize(Math.max(i.x,e.x),Math.max(i.y,e.y))}static matrixTransform(i,e){let n=t.initialize(i.x,i.y),o=e.getScreenCTM();if(o){let r=e.createSVGPoint();r.x=i.x,r.y=i.y,n=r.matrixTransform(o.inverse())}return n}static elementTransform(i,e){let n=t.initialize(i.x,i.y),o=e.getBoundingClientRect();return n=t.sub(n,t.initialize(o.left,o.top)),n}},X=class t{constructor(i=0,e=0){this.x=i,this.y=e}static fromPoint(i){return new t(i.x,i.y)}add(i){let e=L.sum(this,i);return t.fromPoint(e)}sub(i){let e=L.sub(this,i);return t.fromPoint(e)}subNumber(i){let e=L.sub(this,new t(i,i));return t.fromPoint(e)}div(i){let e=L.div(this,i);return t.fromPoint(e)}mult(i){let e=L.mult(this,i);return t.fromPoint(e)}matrixTransform(i){let e=L.matrixTransform(this,i);return t.fromPoint(e)}elementTransform(i){let e=L.elementTransform(this,i);return t.fromPoint(e)}},ni=class{static initialize(i=L.initialize(),e=L.initialize()){return{point1:i,point2:e}}static copy(i){return{point1:i.point1,point2:i.point2}}static hypotenuse(i){return Math.sqrt(Math.pow(i.point1.x-i.point2.x,2)+Math.pow(i.point1.y-i.point2.y,2))}},Jt=class{constructor(i,e){this.point1=i,this.point2=e}},G=class t{static initialize(i=0,e=0,n=0,o=0){n<0&&(i=i+n,n=-n),o<0&&(e=e+o,o=-o);let r=L.initialize(i+n/2,e+o/2);return{x:i,y:e,width:n,height:o,gravityCenter:r}}static copy(i){return t.initialize(i.x,i.y,i.width,i.height)}static fromElement(i){let{x:e,y:n,width:o,height:r}=i.getBoundingClientRect();return t.initialize(e,n,o,r)}static isIncludePoint(i,e){return e.x>=t.left(i)&&e.x<=t.right(i)&&e.y>=t.top(i)&&e.y<=t.bottom(i)}static intersectionWithRect(i,e){return!(i.x+i.width<e.x||e.x+e.width<i.x||i.y+i.height<e.y||e.y+e.height<i.y)}static left(i){return i.x}static top(i){return i.y}static right(i){return i.x+i.width}static bottom(i){return i.y+i.height}static addPoint(i,e){let n=t.copy(i);return n.x+=e.x,n.y+=e.y,this.initialize(n.x,n.y,n.width,n.height)}static mult(i,e){let n=t.copy(i);return n.x*=e,n.y*=e,n.width*=e,n.height*=e,this.initialize(n.x,n.y,n.width,n.height)}static div(i,e){let n=t.copy(i);return n.x/=e,n.y/=e,n.width/=e,n.height/=e,this.initialize(n.x,n.y,n.width,n.height)}static addPointToSize(i,e){let n=t.copy(i);return n.width+=e.x,n.height+=e.y,this.initialize(n.x,n.y,n.width,n.height)}static union(i){return!i||i.length===0?null:i.reduce((e,n)=>{let o=Math.min(e.x,n.x),r=Math.min(e.y,n.y),s=Math.max(e.x+e.width,n.x+n.width),a=Math.max(e.y+e.height,n.y+n.height);return t.initialize(o,r,s-o,a-r)},i[0])}static elementTransform(i,e){let n=e.getBoundingClientRect(),o=L.sub(i,L.initialize(n.left,n.top));return t.initialize(o.x,o.y,i.width,i.height)}static updateIsNotFinite(i){return!Number.isFinite(i.width)||!Number.isFinite(i.height)||!Number.isFinite(i.x)||!Number.isFinite(i.y)?t.initialize(0,0,0,0):i}};function qh(t,i){let e=Math.max(t.width,i),n=Math.max(t.height,i),o=(e-t.width)/2,r=(n-t.height)/2;return G.initialize(t.x-o,t.y-r,e,n)}function wu(t,i){t=G.updateIsNotFinite(t),i.setAttribute("x",t.x.toString()),i.setAttribute("y",t.y.toString()),i.setAttribute("width",t.width.toString()),i.setAttribute("height",t.height.toString())}function Xh(t,i){t=G.updateIsNotFinite(t),i.setAttribute("viewBox",`${t.x} ${t.y} ${t.width} ${t.height}`)}var ke=class t{constructor(i=0,e=0,n=0,o=0,r=0,s=0,a=0,l=0){this.x=i,this.y=e,this.width=n,this.height=o,this.radius1=r,this.radius2=s,this.radius3=a,this.radius4=l,this.gravityCenter=L.initialize(),this.gravityCenter=this.calculateGravityCenter(this)}calculateGravityCenter(i){return new X(i.x+i.width/2,i.y+i.height/2)}static fromRect(i){return new t(i.x,i.y,i.width,i.height)}static fromRoundedRect(i){return new t(i.x,i.y,i.width,i.height,i.radius1,i.radius2,i.radius3,i.radius4)}static fromCenter(i,e,n){return new t(i.gravityCenter.x-e/2,i.gravityCenter.y-n/2,e,n,i.radius1,i.radius2,i.radius3,i.radius4)}static fromPoint(i){return new t(i.x,i.y)}addPoint(i){let e=t.fromRoundedRect(this);return e.x+=i.x,e.y+=i.y,e.gravityCenter=this.calculateGravityCenter(e),e}},ht=class t{static initialize(i=0,e=0){return{width:i,height:e}}static isEqual(i,e){return i.width===e.width&&i.height===e.height}static offsetFromElement(i){if(i instanceof SVGGraphicsElement){let e=i.getBBox();return t.initialize(e.width,e.height)}else if(i instanceof HTMLElement)return t.initialize(i.offsetWidth,i.offsetHeight)}};function D_(){return{position:L.initialize(),scaledPosition:L.initialize(),scale:1,rotate:0}}function k_(t){let i;if(t){t=t.replace("matrix(",""),t=t.replace(")","");let e=t.split(" ");i={position:{x:Number(e[4]),y:Number(e[5])},scaledPosition:L.initialize(),scale:Number(e[0]),rotate:0}}return i}var kt=class{static toString(i){let e=L.sum(i.position,i.scaledPosition);return`matrix(${i.scale}, 0, 0, ${i.scale}, ${e.x}, ${e.y})`}static fromString(i){return k_(i)}static default(){return D_()}},Je=class t{static initialize(i=0,e=0){return L.initialize(i,e)}static fromPoints(i,e){return t.initialize(e.x-i.x,e.y-i.y)}static vectorLength(i){return Math.sqrt(t.magnitudeSquared(i))}static magnitudeSquared(i){return i.x*i.x+i.y*i.y}static dotProduct(i,e){return i.x*e.x+i.y*e.y}static crossProduct(i,e){return i.x*e.y-i.y*e.x}static subtract(i,e){return t.initialize(i.x-e.x,i.y-e.y)}static add(i,e){return t.initialize(i.x+e.x,i.y+e.y)}static scale(i,e){return t.initialize(i.x*e,i.y*e)}static angle(i,e){let n=Math.acos(Math.max(-1,Math.min(t.dotProduct(i,e)/(t.vectorLength(i)*t.vectorLength(e)),1)));return t.crossProduct(i,e)<0?-n:n}},bu=class{static parseRoundedRect(i){let e=Math.PI*.5,n=i.x,o=i.y,r=i.x+i.width,s=i.y+i.height,a=i.x+i.radius1,l=i.y+i.radius1,h=i.x+i.width-i.radius2,_=i.y+i.radius2,v=i.x+i.width-i.radius3,b=i.y+i.height-i.radius3,I=i.x+i.radius4,N=i.y+i.height-i.radius4;return[new Qt({x:a,y:l},i.radius1,i.radius1,2*e,3*e),new Jt({x:a,y:o},{x:h,y:o}),new Qt({x:h,y:_},i.radius2,i.radius2,3*e,4*e),new Jt({x:r,y:_},{x:r,y:b}),new Qt({x:v,y:b},i.radius3,i.radius3,0,e),new Jt({x:v,y:s},{x:I,y:s}),new Qt({x:I,y:N},i.radius4,i.radius4,e,2*e),new Jt({x:n,y:N},{x:n,y:l})]}},Sn=class{static getRoundedRectIntersections(i,e,n){let o=bu.parseRoundedRect(n);for(let r of o)if(r instanceof Qt){let s=this.intersectArcWithLine(r,i,e);if(s.length>0)return s}else if(r instanceof Jt){let s=this.intersectLineSegments(i,e,r.point1,r.point2);if(s)return[s]}return[]}static getRoundedRectIntersectionsWithSVGPath(i,e){let n=i.getTotalLength(),o=[];for(let r=0;r<=n;r+=1){let s=i.getPointAtLength(r);o.push({x:s.x,y:s.y})}for(let r=1;r<o.length;r++){let s=this.getRoundedRectIntersections(o[r-1],o[r],e);if(s.length>0)return s}return[]}static intersectArcWithLine(i,e,n){return this.filterPointsWithinArc(this.findEllipseLineIntersections(i.center,i.radiusX,i.radiusY,e,n),i)}static intersectLineSegments(i,e,n,o){let r=e.x-i.x,s=e.y-i.y,a=o.x-n.x,l=o.y-n.y,h=(-s*(i.x-n.x)+r*(i.y-n.y))/(-a*s+r*l),_=(a*(i.y-n.y)-l*(i.x-n.x))/(-a*s+r*l);return h>=0&&h<=1&&_>=0&&_<=1?{x:i.x+_*r,y:i.y+_*s}:null}static filterPointsWithinArc(i,e){let{center:n,startAngle:o,endAngle:r}=e;if(i.length===0)return i;r<o&&([o,r]=[r,o]),(o<0||r<0)&&(o+=2*Math.PI,r+=2*Math.PI);let s=[];for(let a of i){let l=this.normalizeAngle(Je.angle(Je.initialize(1,0),Je.initialize(a.x-n.x,a.y-n.y)));l<o&&(l+=2*Math.PI),o<=l&&l<=r&&s.push(a)}return s}static normalizeAngle(i){let e=i%(2*Math.PI);return e<0?e+2*Math.PI:e}static findEllipseLineIntersections(i,e,n,o,r){let s=Je.initialize(o.x,o.y),a=Je.fromPoints(o,r),l=Je.initialize(i.x,i.y),h=Je.subtract(s,l),_=Je.initialize(a.x/(e*e),a.y/(n*n)),v=Je.initialize(h.x/(e*e),h.y/(n*n)),b=Je.dotProduct(a,_),I=Je.dotProduct(a,v),N=Je.dotProduct(h,v)-1,D=I*I-b*N;return D<0?[]:this.calculateIntersectionPoints(D,b,I,o,r)}static calculateIntersectionPoints(i,e,n,o,r){let s=[];if(i>0){let a=Math.sqrt(i),l=(-n-a)/e,h=(-n+a)/e;l>=0&&l<=1&&s.push(L.interpolatePoints(o,r,l)),h>=0&&h<=1&&s.push(L.interpolatePoints(o,r,h))}else{let a=-n/e;a>=0&&a<=1&&s.push(L.interpolatePoints(o,r,a))}return s}};var Su=class{handle(i,e){let n=!0;if(this.validator&&(n=e.get(this.validator).handle(i)),!!n)return e.get(this.execution).handle(i)}execute(i,e){return e.get(this.execution).handle(i)}setValidator(i){this.validator=i}setExecution(i){this.execution=i}},R=class t{constructor(){this._injector=d(Ye)}static registerPipeline(i,e,n){if(!i||!i.fToken)throw new Error("Type must have a fToken static property.");let o=this.pipelines.get(i.fToken)||new Su;n?o.setValidator(e):o.setExecution(e),this.pipelines.set(i.fToken,o)}send(i){let e=t.pipelines.get(i.constructor.fToken);if(e)return e.handle(i,this._injector);throw new Error("Handler not registered for request type.")}execute(i){return t.pipelines.get(i.constructor.fToken).execute(i,this._injector)}};R.pipelines=new Map;R.\u0275fac=function(i){return new(i||R)};R.\u0275prov=g({token:R,factory:R.\u0275fac});function x(t){return function(i){R.registerPipeline(t,i,!1)}}var R_=(()=>{class t{setItem(e,n){localStorage.setItem(e,n)}getItem(e){return localStorage.getItem(e)}removeItem(e){localStorage.removeItem(e)}clear(){localStorage.clear()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),N_=(()=>{class t{storage={};setItem(e,n){this.storage[e]=n}getItem(e){return this.storage[e]||null}removeItem(e){delete this.storage[e]}clear(){this.storage={}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),O_=new fe("F_LOCAL_STORAGE",{providedIn:"root",factory:()=>fo(d(oo))?d(R_):d(N_)}),F_=(()=>{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,n,o){window.open(e,n,o)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),A_=(()=>{class t{getComputedStyle(e){return new Proxy({getPropertyValue:n=>"0"},{get:(n,o)=>o==="getPropertyValue"?n.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,n,o){}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),L_=new fe("F_WINDOW",{providedIn:"root",factory:()=>fo(d(oo))?d(F_):d(A_)}),Rt=(function(t){return t.MAC_OS="macos",t.IOS="ios",t.WINDOWS="windows",t.ANDROID="android",t.LINUX="linux",t})(Rt||{}),Iu;try{Iu=typeof Intl<"u"&&Intl.v8BreakIterator}catch{Iu=!1}var Tu=(()=>{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||Iu)&&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?fo(this._platformId):typeof document=="object"&&!!document}getOS(){let e=navigator.userAgent.toLowerCase(),n=/(macintosh|macintel|macppc|mac68k|macos)/i,o=/(win32|win64|windows|wince)/i,r;return n.test(e)?r=Rt.MAC_OS:this.IOS?r=Rt.IOS:o.test(e)?r=Rt.WINDOWS:this.ANDROID?r=Rt.ANDROID:!r&&/linux/.test(e)&&(r=Rt.LINUX),r}static \u0275fac=function(n){return new(n||t)(pn(oo))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Re=(()=>{class t{injectedDocument;windowService;localStorageService;platformService;constructor(e,n,o,r){this.injectedDocument=e,this.windowService=n,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,n,o,r){if(e.endsWith("px"))return parseFloat(e);if(e.endsWith("%")){let s=parseFloat(e)/100;return Math.max(n,o)*s}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 s=this.window.innerHeight/100;return parseFloat(e)*s}else if(e.endsWith("vw")){let s=this.window.innerWidth/100;return parseFloat(e)*s}}return parseFloat(e)||0}static \u0275fac=function(n){return new(n||t)(pn(io),pn(L_),pn(O_),pn(Tu))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Eu(t,i){return t.reduce((e,n)=>[...e,...i(n)],[])}function Pu(t){let i=t.cloneNode(!0),e=i.querySelectorAll("[id]"),n=t.nodeName.toLowerCase();i.removeAttribute("id");for(let o=0;o<e.length;o++)e[o].removeAttribute("id");return n==="canvas"?Zh(t,i):(n==="input"||n==="select"||n==="textarea")&&Yh(t,i),Kh("canvas",t,i,Zh),Kh("input, textarea, select",t,i,Yh),i}function Kh(t,i,e,n){let o=i.querySelectorAll(t);if(o.length){let r=e.querySelectorAll(t);for(let s=0;s<o.length;s++)n(o[s],r[s])}}var B_=0;function Yh(t,i){i.type!=="file"&&(i.value=t.value),i.type==="radio"&&i.name&&(i.name=`mat-clone-${i.name}-${B_++}`)}function Zh(t,i){let e=i.getContext("2d");if(e)try{e.drawImage(t,0,0)}catch{}}function Mu(t,i,e){for(let n in i)if(i.hasOwnProperty(n)){let o=i[n];o?t.setProperty(n,o,e?.has(n)?"important":""):t.removeProperty(n)}return t}function Qh(t){Mu(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 Jh(t,i,e){return z_(t,e).dataset[i]}function z_(t,i){return t.closest(i)}function Du(t,i){let e=t.rootNodes;if(e.length===1&&e[0].nodeType===i.ELEMENT_NODE)return e[0];let n=i.createElement("div");return e.forEach(o=>n.appendChild(o)),n}function ii(t,i){let e=V_(t,i);return!!e&&!e.classList.contains(i+"-disabled")}function V_(t,i){return t.closest(i)}function It(t){return t.match(/^[a-zA-Z_]/)||(t="_"+t),t.replace(/[^a-zA-Z0-9_\-:.]/g,"_")}function In(t,i,e){let n=e[t.toUpperCase()]||G_(e,t.toLowerCase());if(n===void 0)throw new Error(`Unknown ${i}: ${t}. Accepted values: ${Object.keys(e).join(", ")}`);return n}function G_(t,i){return Object.keys(t).find(e=>t[e]===i)}var H_=["markerElement"],j_=["fConnectionGradientRenderer",""],U_=["f-connection-path",""],$_=["fConnectionSelection",""],W_=["f-connection-drag-handle-start",""],q_=["f-connection-drag-handle-end",""],X_=["defs"],K_=["*"],Y_=["fGroupsContainer"],Z_=["fNodesContainer"],Q_=["fConnectionsContainer"],J_=[[["","fGroup",""],["","fGroups",""]],[["f-snap-connection"]],[["f-connection"],["","fConnections",""]],[["f-connection-for-create"]],[["","fNode",""],["","fNodes",""]]],eg=["[fGroup], [fGroups]","f-snap-connection","f-connection, [fConnections]","f-connection-for-create","[fNode], [fNodes]"],tg=[[["svg","fMarker",""]],[["f-connection-marker-circle"],["f-connection-marker-arrow"]],[["f-connection-gradient"]],[["f-connection-waypoints"]],[["","fConnectionContent",""]]],ng=["svg[fMarker]","f-connection-marker-circle, f-connection-marker-arrow","f-connection-gradient","f-connection-waypoints","[fConnectionContent]"];function ig(t,i){t&1&&($e(),A(0,"linearGradient",3)),t&2&&T("fConnectionGradientRendererFor",i)}function og(t,i){t&1&&($e(),A(0,"circle",6))}function rg(t,i){t&1&&De(0,4)}var sg="[_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}",ag=[[["","fDefinitions",""]],[["f-background"]],[["f-line-alignment"]],[["f-canvas"]],[["f-selection-area"]],"*"],cg=["[fDefinitions]","f-background","f-line-alignment","f-canvas","f-selection-area","*"],Fu=new fe("F_BACKGROUND_PATTERN"),Qa=class{fPattern;static fToken=Symbol("AddPatternToBackgroundRequest");constructor(i){this.fPattern=i}},Mn=class{_items=[];_byId=new Map;get(i){return this._byId.get(i)}require(i){let e=this._byId.get(i);if(!e)throw new Error(`${this.kind} not found: ${i}`);return e}has(i){return this._byId.has(i)}getAll(){return this._items}size(){return this._items.length}add(i){let e=i.fId();if(this._byId.has(e))throw new Error(`${this.kind} already exists: ${e}`);this._items.push(i),this._byId.set(e,i)}addMany(i){for(let e of i)this.add(e)}remove(i){let e=i.fId(),n=this._byId.get(e);if(!n)return!1;this._byId.delete(e);let o=this._items.indexOf(n);return o>=0&&this._items.splice(o,1),!0}removeById(i){let e=this._byId.get(i);if(!e)return;this._byId.delete(i);let n=this._items.indexOf(e);return n>=0&&this._items.splice(n,1),e}clear(){this._items.length=0,this._byId.clear()}};function en(t){return{name:t}}var Au=class{_instances=new Map;get(i){return this._instances.get(i.name)}require(i){let e=this.get(i);if(!e)throw new Error(`Instance not found: ${i.name}`);return e}has(i){return this._instances.has(i.name)}add(i,e){if(this._instances.has(i.name))throw new Error(`${i.name} already exists`);this._instances.set(i.name,e)}remove(i){if(!this._instances.has(i.name))throw new Error(`${i.name} does not exist`);return this._instances.delete(i.name),!0}clear(){this._instances.clear()}},si=class extends Mn{kind;constructor(i){super(),this.kind=i}},Lu=class extends Mn{kind="Connection Marker"},Bu=class extends Mn{kind="Connection";_instancesForCreate;_instancesForSnap;getForSnap(){return this._instancesForSnap}getForCreate(){return this._instancesForCreate}addForCreate(i){this._instancesForCreate=i}addForSnap(i){this._instancesForSnap=i}removeInstanceForCreate(){this._instancesForCreate=void 0}removeInstanceForSnap(){this._instancesForSnap=void 0}},zu=class extends Mn{kind="Node"},Tn=class{notifyOnSubscribe;static fToken=Symbol("ListenConnectionsChangesRequest");constructor(i=!0){this.notifyOnSubscribe=i}};function dg(){return t=>{let i=null,e=null,n=()=>{i!==null&&cancelAnimationFrame(i),e!==null&&cancelAnimationFrame(e),i=e=null};return{callback:()=>{n(),i=requestAnimationFrame(()=>{i=null,e=requestAnimationFrame(()=>{e=null,t()})})},cleanup:n}}}function lg(){return t=>{let i=null;return{callback:()=>{i!==null&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=null,t()})},cleanup:()=>{i!==null&&cancelAnimationFrame(i),i=null}}}}function Ja(t){return i=>{let e=null;return{callback:()=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{e=null,i()},t)},cleanup:()=>{e!==null&&clearTimeout(e),e=null}}}}var ct=class{_listeners=new Set;notify(){this._listeners.forEach(i=>i())}listen(i){return this._listeners.add(i),()=>this.stop(i)}stop(i){this._listeners.delete(i)}},Vu=class extends ct{_htmlElement;_observer=new ResizeObserver(()=>this.notify());_isObserving=!1;constructor(i){super(),this._htmlElement=i}listen(i){return this._isObserving||(this._observer.observe(this._htmlElement),this._isObserving=!0),super.listen(i)}stop(i){super.stop(i),this._listeners.size===0&&this._disconnect()}_disconnect(){this._observer.unobserve(this._htmlElement),this._observer.disconnect(),this._isObserving=!1}},vt=class t{_channels=[];_operators=[];constructor(...i){this._channels=[...i]}pipe(...i){let e=new t(...this._channels);return e._operators=[...this._operators,...i],e}listen(i,e){let n=e,o=[],r=[],s=[];for(let v of[...this._operators].reverse()){let b=v(n);n=b.callback,b.cleanup&&o.push(b.cleanup),b.onSubscribe&&r.push(b.onSubscribe),b.setTeardown&&s.push(b.setTeardown)}let a=this._channels.map(v=>v.listen(()=>n())),l=null,h=!1,_=()=>{h||(h=!0,l?.(),l=null,a.forEach(v=>v()),o.forEach(v=>v()))};s.slice().reverse().forEach(v=>v(_)),r.slice().reverse().forEach(v=>v(n)),l=i.onDestroy(_)}};function Sl(){return t=>{let i=!0;return{callback:t,onSubscribe:e=>{queueMicrotask(()=>{i&&e()})},cleanup:()=>{i=!1}}}}function ep(){return t=>{let i=!1,e=null;return{setTeardown:n=>e=n,callback:()=>{if(!i){i=!0;try{t()}finally{e?.()}}}}}}var ug=(()=>{let t=class Mo{_store=d(E);handle({notifyOnSubscribe:e}){return e?new vt(this._store.connectionsChanges$).pipe(Sl(),Ja(1)):new vt(this._store.connectionsChanges$).pipe(Ja(1))}static \u0275fac=function(n){return new(n||Mo)};static \u0275prov=g({token:Mo,factory:Mo.\u0275fac})};return t=C([x(Tn)],t),t})(),Gu=class{static fToken=Symbol("ListenNodesChangesRequest")},fg=(()=>{let t=class Do{_store=d(E);handle(e){return new vt(this._store.nodesChanges$)}static \u0275fac=function(n){return new(n||Do)};static \u0275prov=g({token:Do,factory:Do.\u0275fac})};return t=C([x(Gu)],t),t})(),ec=class{static fToken=Symbol("ListenTransformChangesRequest")},hg=(()=>{let t=class ko{_store=d(E);handle(e){return new vt(this._store.transformChanges$,this._store.connectionsChanges$,this._store.nodesChanges$)}static \u0275fac=function(n){return new(n||ko)};static \u0275prov=g({token:ko,factory:ko.\u0275fac})};return t=C([x(ec)],t),t})(),tn=class{static fToken=Symbol("EmitConnectionsChangesRequest")},pg=(()=>{let t=class Ro{_store=d(E);handle(e){this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Ro)};static \u0275prov=g({token:Ro,factory:Ro.\u0275fac})};return t=C([x(tn)],t),t})(),At=class{static fToken=Symbol("NotifyTransformChangedRequest")},E=(()=>{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 zu;connections=new Bu;connectionMarkers=new Lu;outputs=new si("Output");inputs=new si("Input");outlets=new si("Outlet");instances=new Au;fDraggable;emitNodeChanges(){this._nodesRevision++,this.nodesChanges$.notify()}emitConnectionChanges(){this._connectionsRevision++,this.connectionsChanges$.notify()}completeConnectionsRender(e,n){e<this._connectionsRenderedRevision||e===this._connectionsRenderedRevision&&n<=this._connectionsRenderedNodesRevision||(this._connectionsRenderedRevision=Math.min(e,this._connectionsRevision),this._connectionsRenderedNodesRevision=n,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(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),ye={MAGNETIC_LINES:en("magnetic-lines"),MAGNETIC_RECTS:en("magnetic-rects"),ZOOM:en("zoom-controls"),BACKGROUND:en("background"),SELECTION_AREA:en("selection-area"),MINIMAP:en("minimap"),AUTO_PAN:en("auto-pan")},mg=(()=>{let t=class No{_store=d(E);handle(e){this._store.transformChanged()}static \u0275fac=function(n){return new(n||No)};static \u0275prov=g({token:No,factory:No.\u0275fac})};return t=C([x(At)],t),t})(),Lt=class{key;instance;static fToken=Symbol("RegisterPluginInstanceRequest");constructor(i,e){this.key=i,this.instance=e}},_g=(()=>{let t=class Oo{_store=d(E);handle({key:e,instance:n}){this._store.instances.add(e,n)}static \u0275fac=function(n){return new(n||Oo)};static \u0275prov=g({token:Oo,factory:Oo.\u0275fac})};return t=C([x(Lt)],t),t})(),Bt=class{key;static fToken=Symbol("RemovePluginInstanceRequest");constructor(i){this.key=i}},gg=(()=>{let t=class Fo{_store=d(E);handle({key:e}){this._store.instances.remove(e)}static \u0275fac=function(n){return new(n||Fo)};static \u0275prov=g({token:Fo,factory:Fo.\u0275fac})};return t=C([x(Bt)],t),t})(),yg=[E,fg,ug,hg,pg,mg,_g,gg],vg=0,Cg=(()=>{let t=class Ao{_store=d(E);_browser=d(Re);get _backgroundElement(){return this._store.instances.get(ye.BACKGROUND)?.hostElement}handle(e){let n=this._getPatterns(e.fPattern?.hostElement);if(!n?.length)return;let o=Pn("defs",this._browser);if(e.fPattern?.hostElement.remove(),n.forEach(r=>{o.append(r)}),n.length){this._backgroundElement?.firstChild?.appendChild(o),n[n.length-1].id="f-background-pattern-"+vg++;let r=n[n.length-1].id,s=Pn("rect",this._browser);s.setAttribute("fill","url(#"+r+")"),s.setAttribute("width","100%"),s.setAttribute("height","100%"),this._backgroundElement?.firstChild?.appendChild(s);let a=this._store.fCanvas?.transform||kt.default();e.fPattern?.setTransform(a)}}_getPatterns(e){return Array.from(e?.getElementsByTagName("pattern")||[])}static \u0275fac=function(n){return new(n||Ao)};static \u0275prov=g({token:Ao,factory:Ao.\u0275fac})};return t=C([x(Qa)],t),t})(),ai=class{fTransform;static fToken=Symbol("SetBackgroundTransformRequest");constructor(i){this.fTransform=i}},xg=(()=>{let t=class Lo{_store=d(E);handle(e){this._store.instances.get(ye.BACKGROUND)?.setTransform(e.fTransform)}static \u0275fac=function(n){return new(n||Lo)};static \u0275prov=g({token:Lo,factory:Lo.\u0275fac})};return t=C([x(ai)],t),t})(),bg=[Cg,xg],tc=class{instance;static fToken=Symbol("AddCanvasToStoreRequest");constructor(i){this.instance=i}},wg=(()=>{let t=class Bo{_store=d(E);handle({instance:e}){this._store.fCanvas=e}static \u0275fac=function(n){return new(n||Bo)};static \u0275prov=g({token:Bo,factory:Bo.\u0275fac})};return t=C([x(tc)],t),t})(),nc=class{id;animated;static fToken=Symbol("CenterGroupOrNodeRequest");constructor(i,e){this.id=i,this.animated=e}},Sg=(()=>{let t=class zo{_store=d(E);_mediator=d(R);get _transform(){return this._store.transform}handle({id:e,animated:n}){let o=this._store.nodes.get(e);o&&(this._toCenter(this._getNodeRect(o),this._getFlowRect(),o._position),this._mediator.execute(new Dn(n,nn.VIEWPORT_ONLY)))}_toCenter(e,n,o){this._transform.scaledPosition=L.initialize(),this._transform.position=L.initialize((n.width-e.width)/2-o.x*this._transform.scale,(n.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(n){return new(n||zo)};static \u0275prov=g({token:zo,factory:zo.\u0275fac})};return t=C([x(nc)],t),t})(),ic=class{toCenter;animated;static fToken=Symbol("FitToFlowRequest");constructor(i,e){this.toCenter=i,this.animated=e}},Ig=(()=>{let t=class Vo{_store=d(E);get _transform(){return this._store.transform}_mediator=d(R);handle({toCenter:e,animated:n}){let o=this._mediator.execute(new Ln)||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 Dn(n,nn.VIEWPORT_ONLY)))}fitToParent(e,n,o,r){this._transform.scaledPosition=L.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let s=e.width/this._transform.scale+r.x,a=e.height/this._transform.scale+r.y;(s>n.width||a>n.height||s<n.width&&a<n.height)&&(this._transform.scale=Math.min(n.width/s,n.height/a));let l=(n.width-s*this._transform.scale)/2-this._transform.position.x*this._transform.scale,h=(n.height-a*this._transform.scale)/2-this._transform.position.y*this._transform.scale;this._transform.position=L.initialize(l+r.x/2*this._transform.scale,h+r.y/2*this._transform.scale)}_getZeroPositionWithoutScale(e){let n=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return L.initialize(n,o)}static \u0275fac=function(n){return new(n||Vo)};static \u0275prov=g({token:Vo,factory:Vo.\u0275fac})};return t=C([x(ic)],t),t})(),oc=class{transform;position;static fToken=Symbol("InputCanvasPositionRequest");constructor(i,e){this.transform=i,this.position=e}},Tg=(()=>{let t=class Go{_store=d(E);handle({transform:e,position:n}){n&&(L.isEqual(this._calculateTransformPosition(e),n)||(e.position=n,e.scaledPosition=L.initialize(),this._store.fCanvas?.redraw()))}_calculateTransformPosition(e){return L.sum(e.position,e.scaledPosition)}static \u0275fac=function(n){return new(n||Go)};static \u0275prov=g({token:Go,factory:Go.\u0275fac})};return t=C([x(oc)],t),t})(),rc=class{transform;scale;static fToken=Symbol("InputCanvasScaleRequest");constructor(i,e){this.transform=i,this.scale=e}},Eg=(()=>{let t=class Ho{_store=d(E);handle(e){!e.scale&&e.scale!==0||(e.transform.scale=e.scale,this._store.fCanvas?.redraw())}static \u0275fac=function(n){return new(n||Ho)};static \u0275prov=g({token:Ho,factory:Ho.\u0275fac})};return t=C([x(rc)],t),t})(),nn=(function(t){return t.VIEWPORT_ONLY="VIEWPORT_ONLY",t.WITH_CONNECTION_CHANGES="WITH_CONNECTION_CHANGES",t})(nn||{}),Dn=class{animated;context;static fToken=Symbol("RedrawCanvasWithAnimationRequest");constructor(i,e=nn.WITH_CONNECTION_CHANGES){this.animated=i,this.context=e}};function Ep(t,i){let e=n=>{n.propertyName==="transform"&&(t.removeEventListener("transitionend",e),i(n))};t.addEventListener("transitionend",e)}var Pg=(()=>{let t=class jo{_store=d(E);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(),Ep(this._canvas.hostElement,()=>{this._store.endViewportAnimation(),e===nn.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()})}_redraw(e){this._canvas?.redraw(),e===nn.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||jo)};static \u0275prov=g({token:jo,factory:jo.\u0275fac})};return t=C([x(Dn)],t),t})(),sc=class{static fToken=Symbol("RemoveCanvasFromStoreRequest")},Mg=(()=>{let t=class Uo{_store=d(E);handle(e){this._store.fCanvas=void 0}static \u0275fac=function(n){return new(n||Uo)};static \u0275prov=g({token:Uo,factory:Uo.\u0275fac})};return t=C([x(sc)],t),t})(),ac=class{static fToken=Symbol("ResetScaleRequest")},Dg=(()=>{let t=class $o{_store=d(E);get _transform(){return this._store.transform}handle(e){this._transform.scale=1,this._transform.scaledPosition=L.initialize()}static \u0275fac=function(n){return new(n||$o)};static \u0275prov=g({token:$o,factory:$o.\u0275fac})};return t=C([x(ac)],t),t})(),cc=class{animated;static fToken=Symbol("ResetScaleAndCenterRequest");constructor(i){this.animated=i}},kg=(()=>{let t=class Wo{_mediator=d(R);_store=d(E);get _transform(){return this._store.transform}handle({animated:e}){let n=this._mediator.execute(new Ln)||G.initialize();n.width===0||n.height===0||(this._oneToOneCentering(n,G.fromElement(this._store.flowHost),this._store.nodes.getAll().map(o=>o._position)),this._mediator.execute(new Dn(e,nn.VIEWPORT_ONLY)))}_oneToOneCentering(e,n,o){this._transform.scaledPosition=L.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let r=(n.width-e.width/this._transform.scale)/2-this._transform.position.x,s=(n.height-e.height/this._transform.scale)/2-this._transform.position.y;this._transform.scale=1,this._transform.position=L.initialize(r,s)}_getZeroPositionWithoutScale(e){let n=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return L.initialize(n,o)}static \u0275fac=function(n){return new(n||Wo)};static \u0275prov=g({token:Wo,factory:Wo.\u0275fac})};return t=C([x(cc)],t),t})(),dc=class{scale;toPosition;static fToken=Symbol("UpdateScaleRequest");constructor(i,e){this.scale=i,this.toPosition=e}},Rg=(()=>{let t=class qo{_store=d(E);get _transform(){return this._store.transform}handle({scale:e,toPosition:n}){if(e===this._transform.scale)return;let o=L.sum(this._transform.scaledPosition,this._transform.position),r=n.x-(n.x-o.x)*e/this._transform.scale,s=n.y-(n.y-o.y)*e/this._transform.scale;this._transform.scale=e,this._transform.scaledPosition=L.sub(L.initialize(r,s),this._transform.position)}static \u0275fac=function(n){return new(n||qo)};static \u0275prov=g({token:qo,factory:qo.\u0275fac})};return t=C([x(dc)],t),t})(),Ng=[wg,Sg,Ig,Tg,Eg,Pg,Mg,Dg,kg,Rg],Hu=class{connection;static fToken=Symbol("AddConnectionForCreateToStoreRequest");constructor(i){this.connection=i}},Og=(()=>{let t=class Xo{_store=d(E);handle({connection:e}){this._store.connections.addForCreate(e)}static \u0275fac=function(n){return new(n||Xo)};static \u0275prov=g({token:Xo,factory:Xo.\u0275fac})};return t=C([x(Hu)],t),t})(),ju=class{instance;static fToken=Symbol("AddConnectionMarkerToStoreRequest");constructor(i){this.instance=i}},Fg=(()=>{let t=class Ko{_store=d(E);handle({instance:e}){this._store.connectionMarkers.add(e),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Ko)};static \u0275prov=g({token:Ko,factory:Ko.\u0275fac})};return t=C([x(ju)],t),t})(),lc=class{connection;static fToken=Symbol("AddConnectionToStoreRequest");constructor(i){this.connection=i}},Ag=(()=>{let t=class Yo{_store=d(E);handle({connection:e}){this._store.connections.add(e),this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Yo)};static \u0275prov=g({token:Yo,factory:Yo.\u0275fac})};return t=C([x(lc)],t),t})(),Uu=class{connection;static fToken=Symbol("AddSnapConnectionToStoreRequest");constructor(i){this.connection=i}},Lg=(()=>{let t=class Zo{_store=d(E);handle({connection:e}){this._store.connections.addForSnap(e)}static \u0275fac=function(n){return new(n||Zo)};static \u0275prov=g({token:Zo,factory:Zo.\u0275fac})};return t=C([x(Uu)],t),t})(),kn=class{connection;static fToken=Symbol("CreateConnectionMarkersRequest");constructor(i){this.connection=i}},tp=new fe("F_CONNECTION_CONTENT");var uc=class t{points;cumulativeLengths;segmentTangents;totalLength;constructor(i){let e=t._removeConsecutiveDuplicates(i);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 n=this.points.length,o=n-1,r=new Array(n).fill(0),s=new Array(o),a=0;for(let l=0;l<o;l++){let h=this.points[l+1].x-this.points[l].x,_=this.points[l+1].y-this.points[l].y,v=Math.hypot(h,_),b=v?h/v:1,I=v?_/v:0;s[l]={x:b,y:I},a+=v,r[l+1]=a}this.cumulativeLengths=r,this.segmentTangents=s,this.totalLength=a||1}static from(i){return new t(i.map(e=>({x:e.x,y:e.y})))}static _removeConsecutiveDuplicates(i){let e=[];for(let n of i){let o=e[e.length-1];(!o||o.x!==n.x||o.y!==n.y)&&e.push({x:n.x,y:n.y})}return e}},$u=class t{_polyline;constructor(i=[]){this._polyline=new uc(i)}updatePoints(i){return this._polyline=new uc(i),this._polyline.totalLength}calculateTotalLength(i){return this.updatePoints(i)}get totalLength(){return this._polyline.totalLength}getPointAtProgress(i){let{points:e,cumulativeLengths:n,segmentTangents:o,totalLength:r}=this._polyline,a=t._clamp(i,0,1)*r,l=.5;if(a<=l)return{point:e[0],tangent:o[0]??{x:1,y:0},atEdge:!0};if(r-a<=l){let O=e.length-1;return{point:e[O],tangent:o[O-1]??{x:1,y:0},atEdge:!0}}let h=t._findRightIndex(n,a),_=Math.max(1,h),v=n[_-1],b=n[_],I=t._safeRatio(a-v,b-v),N=e[_-1],D=e[_],M={x:t._lerp(N.x,D.x,I),y:t._lerp(N.y,D.y,I)},k=o[_-1]??{x:1,y:0};return{point:M,tangent:k,atEdge:!1}}getPointAtLength(i){return this.getPointAtProgress(i)}getPointAtDistance(i){let e=this._polyline.totalLength?i/this._polyline.totalLength:0;return this.getPointAtProgress(e)}static _findRightIndex(i,e){let n=0,o=i.length-1;for(;n<o;){let r=n+o>>1;i[r]<e?n=r+1:o=r}return n}static _lerp(i,e,n){return i+(e-i)*n}static _clamp(i,e,n){return i<e?e:i>n?n:i}static _safeRatio(i,e){let n=Math.abs(e)<1e-6?1e-6:e;return i/n}},Pp=(function(t){return t.NONE="none",t.ALONG="along",t})(Pp||{}),Wu=class{compute(i,e){let n=this._clamp01(e.position()),{point:o,tangent:r}=i.getPointAtLength(n),s={x:-r.y,y:r.x},a=e.offset()??0,l=o.x+s.x*a,h=o.y+s.y*a,v=this._sizeAlongDirection(e.hostElement,r)*.5,b=n*i.totalLength,I=i.totalLength-b,N=this._applyEdgeGuard(l,h,r,b,I,v),D=this._calculateContentRotation(e.align(),r);return{position:N,rotationDeg:D}}_clamp01(i){return i<=0?0:i>=1?1:i}_applyEdgeGuard(i,e,n,o,r,s){if(o<=s){let a=s-o;return{x:i+n.x*a,y:e+n.y*a}}if(r<=s){let a=s-r;return{x:i-n.x*a,y:e-n.y*a}}return{x:i,y:e}}_sizeAlongDirection(i,e){let n=G.fromElement(i);return Math.abs(e.x)*n.width+Math.abs(e.y)*n.height}_normalize180(i){let e=(i+180)%360;return e<0&&(e+=360),e-180}_keepUpright(i){let e=this._normalize180(i);return e>90?e-=180:e<-90&&(e+=180),e}_calculateContentRotation(i,e){let n=0;return i===Pp.ALONG&&(n=Math.atan2(e.y,e.x)*180/Math.PI,n=this._keepUpright(n)),n}},qu=class{_placement;constructor(i=new Wu){this._placement=i}layout(i,e){let n=new $u(i),o=n.totalLength;for(let r of e){let{position:s,rotationDeg:a}=this._placement.compute(n,r);r.hostElement.style.transform=this._createTransformString(s,a)}return o}_createTransformString(i,e){return`translate3d(${i.x}px, ${i.y}px, 0) translate(-50%, -50%) rotate(${e}deg)`}};var np=new fe("F_CONNECTION_WAYPOINTS");function Mp(t,i,e){return(t.x-i.x)**2+(t.y-i.y)**2<=e**2}function Bg(t,i){let e=t.fWaypoints(),n=e?.radius()||8;return e?.candidates().find(o=>Mp(i,o,n))}function zg(t,i){let e=t.fWaypoints(),n=e?.radius()||8;return e?.waypoints().find(o=>Mp(i,o,n))}function Vg(t,i){for(let e of t){let n=zg(e,i);if(n&&e.fWaypoints()?.visibility())return{connection:e,waypoint:n};let o=Bg(e,i);if(o&&e.fWaypoints()?.visibility())return{connection:e,candidate:o}}}var Il=new fe("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||{}),Xu=new fe("F_CONNECTION_MARKER"),Gg=0,Ku=class{fId=q(`f-marker-${Gg++}`);hostElement=d(Se).nativeElement};function Hg(t,i=ge.START){if(typeof t!="string")return i;let e=t.trim().toLowerCase();return e?jg(e)??i:i}function jg(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 Dp=(()=>{class t extends Ku{_markerElement=Te.required("markerElement");_type=F(ge.END_ALL_STATES,{alias:"type",transform:e=>Hg(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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-connection-marker-arrow"]],viewQuery:function(n,o){n&1&&ft(o._markerElement,H_,5),n&2&&it()},hostAttrs:[1,"f-component",2,"display","none"],inputs:{_type:[1,"type","_type"]},features:[Ie([{provide:Xu,useExisting:t}]),_e],decls:3,vars:0,consts:[["markerElement",""],["viewBox","0 0 6 6",1,"f-marker"],["d","M0,0 L6,3 0,6Z"]],template:function(n,o){n&1&&($e(),H(0,"svg",1,0),Pt(2,"path",2),$())},encapsulation:2})}return t})();var Ot=(function(t){return t.FIXED="fixed",t.FIXED_CENTER="fixed_center",t.FLOATING="floating",t})(Ot||{}),qe=(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})(qe||{});function Ug({sourceRect:t,targetRect:i}){return{point1:t.gravityCenter,point2:i.gravityCenter}}var B=(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})(B||{}),Nt=(function(t){return t.SEGMENT="segment",t.STRAIGHT="straight",t.BEZIER="bezier",t.ADAPTIVE_CURVE="adaptive-curve",t})(Nt||{});function $g({sourceRect:t,sourceConnectableSide:i,targetRect:e,targetConnectableSide:n}){return{point1:ip(t,i===B.AUTO?B.BOTTOM:i),point2:ip(e,n===B.AUTO?B.TOP:n)}}function ip(t,i){switch(i){case B.TOP:return{x:t.x+t.width/2,y:t.y};case B.BOTTOM:return{x:t.x+t.width/2,y:t.y+t.height};case B.LEFT:return{x:t.x,y:t.y+t.height/2};case B.RIGHT:return{x:t.x+t.width,y:t.y+t.height/2};default:throw new Error(`Unknown side: ${i}`)}}function kp(t,i,e,n){if(!n||!n.rotationDeg)return Sn.getRoundedRectIntersections(t,i,e)[0];let o=Qo(t,-n.rotationDeg,n.pivot),r=Qo(i,-n.rotationDeg,n.pivot),s=Wg(e,-n.rotationDeg,n.pivot),a=Sn.getRoundedRectIntersections(o,r,s)[0];return a?Qo(a,n.rotationDeg,n.pivot):void 0}function Wg(t,i,e){let n=Qo(qg(t),i,e);return new ke(n.x-t.width/2,n.y-t.height/2,t.width,t.height,t.radius1,t.radius2,t.radius3,t.radius4)}function qg(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Qo(t,i,e){let n=t.x-e.x,o=t.y-e.y,r=i*Math.PI/180,s=Math.cos(r),a=Math.sin(r);return{x:n*s-o*a+e.x,y:n*a+o*s+e.y}}function Xg({sourceRect:t,targetRect:i,sourceRotationContext:e,targetRotationContext:n}){return Zg(Kg(t,i,e),Yg(t,i,n),t,i)}function Kg(t,i,e){return kp(t.gravityCenter,i.gravityCenter,t,e)}function Yg(t,i,e){return kp(i.gravityCenter,t.gravityCenter,i,e)}function Zg(t,i,e,n){return{point1:t||e.gravityCenter,point2:i||n.gravityCenter}}var Eo=.5,Qg={[Ot.FLOATING]:Xg,[Ot.FIXED_CENTER]:Ug,[Ot.FIXED]:$g},jn=(()=>{class t{handle(e){let n=this._calculateDirectionalVectors(e.sourceRect.gravityCenter.x,e.sourceRect.gravityCenter.y,e.targetRect.gravityCenter.x,e.targetRect.gravityCenter.y),o=this._determineSourceSide(e,n),r=this._determineTargetSide(e,n);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,n,o,r){let s=o-e,a=r-n;return{sourceToTargetX:s,sourceToTargetY:a,targetToSourceX:-s,targetToSourceY:-a}}_determineSourceSide(e,n){return this._resolveConnectableSide(e.connection.fOutputSide(),n.sourceToTargetX,n.sourceToTargetY,e.sourceConnectableSide)}_determineTargetSide(e,n){return this._resolveConnectableSide(e.connection.fInputSide(),n.targetToSourceX,n.targetToSourceY,e.targetConnectableSide)}_resolveConnectableSide(e,n,o,r){if(e===qe.DEFAULT)return r;let s=Math.abs(n),a=Math.abs(o);if(s<Eo&&a<Eo)return r;let h=s>=a;switch(e){case qe.CALCULATE:return h?n>=0?B.RIGHT:B.LEFT:o>=0?B.BOTTOM:B.TOP;case qe.CALCULATE_HORIZONTAL:return s<Eo?r:n>=0?B.RIGHT:B.LEFT;case qe.CALCULATE_VERTICAL:return a<Eo?r:o>=0?B.BOTTOM:B.TOP;case qe.TOP:return B.TOP;case qe.BOTTOM:return B.BOTTOM;case qe.LEFT:return B.LEFT;case qe.RIGHT:return B.RIGHT;default:return r}}_getBehaviorHandler(e){let n=Qg[e];if(!n)throw new Error(`[Behavior] No handler for behavior: ${e}`);return n}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),mt=class{sourceRect;targetRect;connection;sourceConnectableSide;targetConnectableSide;sourceRotationContext;targetRotationContext;constructor(i,e,n,o,r,s,a){this.sourceRect=i,this.targetRect=e,this.connection=n,this.sourceConnectableSide=o,this.targetConnectableSide=r,this.sourceRotationContext=s,this.targetRotationContext=a}};function Tl(t,i,e){return[t,...e??[],i]}function Jg(t,i){let e=Math.abs(i.x-t.x)/2,n=i.x<t.x?i.x+e:i.x-e,o=Math.abs(i.y-t.y)/2,r=i.y<t.y?i.y+o:i.y-o;return{x:n,y:r}}function e0(t,i=32){let e=new Array(i+1);e[0]=ue({},t[0]);for(let n=1;n<=i;n++)e[n]=Rp(t[0],t[1],t[2],t[3],n/i);return e}function Rp(t,i,e,n,o){let r=1-o,s=o*o,a=r*r,l=a*r,h=s*o;return{x:l*t.x+3*a*o*i.x+3*r*s*e.x+h*n.x,y:l*t.y+3*a*o*i.y+3*r*s*e.y+h*n.y}}function Np(t){return t.map(i=>Rp(i.p0,i.c1,i.c2,i.p3,.5))}function t0(t){if(t.length<2)throw new Error("Polylines must be at least two points");let i=n0(t);return i<=0?[ue({},t[0])]:[i0(t,i/2)]}function n0(t){let i=0;for(let e=0;e<t.length-1;e++)i+=Op(t[e],t[e+1]);return i}function i0(t,i){let e=0;for(let o=0;o<t.length-1;o++){let r=t[o],s=t[o+1],a=Op(r,s);if(!(a<=0)){if(e+a>=i){let l=(i-e)/a;return{x:r.x+(s.x-r.x)*l,y:r.y+(s.y-r.y)*l}}e+=a}}let n=t[t.length-1];return{x:n.x,y:n.y}}function Op(t,i){return Math.hypot(i.x-t.x,i.y-t.y)}function o0(t){let i=[];for(let e of t)for(let n of e){let o=i[i.length-1];(!o||o.x!==n.x||o.y!==n.y)&&i.push(n)}return i}function Fp(t){if(!t.length)return"";let i=`M ${t[0].p0.x} ${t[0].p0.y}`;for(let e=0;e<t.length;e++){let n=t[e],o=e===t.length-1,r=o?n.p3.x+2e-4:n.p3.x,s=o?n.p3.y+2e-4:n.p3.y;i+=` C ${n.c1.x} ${n.c1.y}, ${n.c2.x} ${n.c2.y}, ${r} ${s}`}return i}function Ap(t,i=16){if(!t.length)return[];let e=[];for(let n=0;n<t.length;n++){let o=t[n],r=e0([o.p0,o.c1,o.c2,o.p3],i);n>0&&r.shift(),e.push(...r)}return e}function r0(t,i=1e-6){let e=t.length;if(e<=2)return t;let n=[];n.push(t[0]);for(let r=1;r<e;r++){let s=t[r],a=n[n.length-1];(Math.abs(s.x-a.x)>i||Math.abs(s.y-a.y)>i)&&n.push(s)}if(n.length<=2)return n;let o=[];o.push(n[0]);for(let r=1;r<n.length-1;r++){let s=o[o.length-1],a=n[r],l=n[r+1],h=Math.abs(s.x-a.x)<=i&&Math.abs(a.x-l.x)<=i,_=Math.abs(s.y-a.y)<=i&&Math.abs(a.y-l.y)<=i;!h&&!_&&o.push(a)}return o.push(n[n.length-1]),o}var Yu=class t{static _dir(i){switch(i){case B.LEFT:return{x:-1,y:0};case B.RIGHT:return{x:1,y:0};case B.TOP:return{x:0,y:-1};case B.BOTTOM:return{x:0,y:1};case B.AUTO:return{x:0,y:0}}return{x:0,y:0}}static _isHorizontal(i){return i===B.LEFT||i===B.RIGHT}static _handleLength(i,e,n,o){let r=Math.abs(e.x-i.x),s=Math.abs(e.y-i.y),a=Math.hypot(r,s),l=n===B.AUTO?Math.max(r,s):this._isHorizontal(n)?r:s,h=Math.max(8,o),_=o+.5*a,v=o*1.05+l*.3;return Math.min(_,Math.max(h,v))}static _softControl(i,e,n,o){let r=this._dir(i),s=n.x-e.x,a=n.y-e.y,l=Math.hypot(s,a)||1,h=s/l,_=a/l;if(i===B.AUTO)return{x:e.x+h*o,y:e.y+_*o};let v=r.x*h+r.y*_,b=.12,I=Math.max(0,-v)*.08,N=Math.min(.2,b+I),D=r.x*(1-N)+h*N,M=r.y*(1-N)+_*N,k=Math.hypot(D,M)||1;return{x:e.x+D/k*o,y:e.y+M/k*o}}handle({source:i,sourceSide:e,target:n,targetSide:o,offset:r,waypoints:s}){let a=Math.max(0,r??0),l=Tl(i,n,s),h=[];for(let v=0;v<l.length-1;v++){let b=l[v],I=l[v+1],N=t._handleLength(b,I,e,a),D=t._handleLength(I,b,o,a),M=t._softControl(e,b,I,N),k=t._softControl(o,I,b,D);h.push({p0:b,c1:M,c2:k,p3:I,chainIndex:v})}let _=Ap(h,12);return{path:Fp(h),secondPoint:h[0]?.c1??i,penultimatePoint:h[h.length-1]?.c2??n,points:_,candidates:Np(h)}}},Zu=class{handle({source:i,sourceSide:e,target:n,targetSide:o,offset:r,waypoints:s}){let a=Tl(i,n,s),l=[];for(let _=0;_<a.length-1;_++){let v=a[_],b=a[_+1],I=op(e,v,b,r??0),N=op(o,b,v,r??0);l.push({p0:v,c1:I,c2:N,p3:b,chainIndex:_})}let h=Ap(l,12);return{path:Fp(l),secondPoint:l[0]?.c1??i,penultimatePoint:l[l.length-1]?.c2??n,points:h,candidates:Np(l)}}};function op(t,i,e,n){let o={x:i.x,y:i.y};switch(t){case B.LEFT:o.x-=Po(i.x-e.x,n);break;case B.RIGHT:o.x+=Po(e.x-i.x,n);break;case B.TOP:o.y-=Po(i.y-e.y,n);break;case B.BOTTOM:o.y+=Po(e.y-i.y,n);break;case B.AUTO:break}return o}function Po(t,i){return t>=i?t:i*Math.sqrt(i-t)}function s0(t){let{axis:i,source:e,target:n,sourceSide:o,targetSide:r,sourceGap:s,targetGap:a,sourceDir:l,targetDir:h,currentDir:_,offset:v,sourceGapOffset:b,targetGapOffset:I}=t,N=a0(s,a),D=c0(i,l,_,N);return o===r?d0(i,e,n,v,l,_,s,a,b,I):D=l0(i,l,h,s,a,N,D),D}function a0(t,i){return{sourceTarget:[{x:t.x,y:i.y}],targetSource:[{x:i.x,y:t.y}]}}function c0(t,i,e,n){return t==="x"?i.x===e?n.targetSource:n.sourceTarget:i.y===e?n.sourceTarget:n.targetSource}function d0(t,i,e,n,o,r,s,a,l,h){let _=Math.abs(i[t]-e[t]);if(_>n)return;let v=Math.min(n-1,n-_);v<=0||(o[t]===r?l[t]=(s[t]>i[t]?-1:1)*v:h[t]=(a[t]>e[t]?-1:1)*v)}function l0(t,i,e,n,o,r,s){let a=t==="x"?"y":"x",l=i[t]===e[a],h=n[a]>o[a],_=n[a]<o[a];return i[t]===1&&(!l&&h||l&&_)||i[t]!==1&&(!l&&_||l&&h)?t==="x"?r.sourceTarget:r.targetSource:s}var oi=1e-6,rp=2e-4,u0=.75;function f0(t,i){let e=t.length,n=[];n.push(`M ${t[0].x} ${t[0].y}`);for(let r=1;r<e-1;r++)n.push(h0(t[r-1],t[r],t[r+1],i));let o=t[e-1];return n.push(`L ${o.x+rp} ${o.y+rp}`),n.join(" ")}function h0(t,i,e,n){let o=i.x,r=i.y;if(n<=0)return`L ${o} ${r}`;let s=Math.abs(t.x-o)<=oi&&Math.abs(o-e.x)<=oi,a=Math.abs(t.y-r)<=oi&&Math.abs(r-e.y)<=oi;if(s||a)return`L ${o} ${r}`;let l=Math.hypot(o-t.x,r-t.y),h=Math.hypot(e.x-o,e.y-r),_=Math.min(l*.5,h*.5,n);if(_<u0)return`L ${o} ${r}`;if(Math.abs(t.y-r)<=oi){let M=t.x<e.x?-1:1,k=t.y<e.y?1:-1,O=o+_*M,z=r+_*k;return`L ${O} ${r} Q ${o} ${r} ${o} ${z}`}let b=t.x<e.x?1:-1,I=t.y<e.y?-1:1,N=r+_*I,D=o+_*b;return`L ${o} ${N} Q ${o} ${r} ${D} ${r}`}var sp={[B.LEFT]:L.initialize(-1,0),[B.RIGHT]:L.initialize(1,0),[B.TOP]:L.initialize(0,-1),[B.BOTTOM]:L.initialize(0,1),[B.AUTO]:L.initialize(0,0)},Qu=class{handle({source:i,sourceSide:e,target:n,targetSide:o,waypoints:r,offset:s,radius:a}){let l=Tl(i,n,r),h=[],_=[];for(let N=0;N<l.length-1;N++){let D=l[N],M=l[N+1],k=this._getPathPoints(D,e,M,o,s??0);h.push(k),_.push(...t0(k))}let v=r0(o0(h)),b=v.length>1?v[v.length-2]:i,I=v.length>1?v[1]:n;return{path:f0(v,a??0),penultimatePoint:b,secondPoint:I,points:v,candidates:_}}_getPathPoints(i,e,n,o,r){let s=sp[e],a=sp[o],l={x:i.x+s.x*r,y:i.y+s.y*r},h={x:n.x+a.x*r,y:n.y+a.y*r},_=this._getDirection(l,e,h),v=_.x!==0?"x":"y",b=_[v],I=[],N=L.initialize(),D=L.initialize(),M=Jg(i,n);if(s[v]*a[v]===-1){let k=[{x:M.x,y:l.y},{x:M.x,y:h.y}],O=[{x:l.x,y:M.y},{x:h.x,y:M.y}];s[v]===b?I=v==="x"?k:O:I=v==="x"?O:k}else I=s0({axis:v,source:i,target:n,sourceSide:e,targetSide:o,sourceGap:l,targetGap:h,sourceDir:s,targetDir:a,currentDir:b,offset:r,sourceGapOffset:N,targetGapOffset:D});return[i,{x:l.x+N.x,y:l.y+N.y},...I,{x:h.x+D.x,y:h.y+D.y},n]}_getDirection(i,e,n){return e===B.LEFT||e===B.RIGHT?i.x<n.x?L.initialize(1,0):L.initialize(-1,0):i.y<n.y?L.initialize(0,1):L.initialize(0,-1)}},ap=2e-4,Ju=class{handle(i){let e=Tl(i.source,i.target,i.waypoints),n=e.length,o=e[0],r=`M ${o.x} ${o.y}`,s=new Array(n-1);for(let a=0;a<n-1;a++){let l=e[a],h=e[a+1],_=a===n-2,v=_?h.x+ap:h.x,b=_?h.y+ap:h.y;r+=` L ${v} ${b}`,s[a]={x:(l.x+h.x)*.5,y:(l.y+h.y)*.5}}return{path:r,candidates:s,points:e,secondPoint:e[1]??i.target,penultimatePoint:e[n-2]??i.source}}},p0=new fe("F_CONNECTION_BUILDERS"),Lp=(()=>{class t{_builtinBuilders={[Nt.STRAIGHT]:new Ju,[Nt.BEZIER]:new Zu,[Nt.ADAPTIVE_CURVE]:new Yu,[Nt.SEGMENT]:new Qu};_providedBuilders;_builders;constructor(){this._providedBuilders=d(p0,{optional:!0})||{},this._builders=ue(ue({},this._builtinBuilders),this._providedBuilders)}handle({type:e,payload:n}){let o=this._builders[e];if(!o)throw this._createBuilderNotFoundError(e);return o.handle(n)}_createBuilderNotFoundError(e){let n=Object.keys(this._builtinBuilders).sort(),o=Object.keys(this._providedBuilders).sort(),r=Object.keys(this._builders).sort(),s=n.filter(l=>l in this._providedBuilders).sort(),a=[`Connection Builder Error: builder type "${e}" not found.`,`Registered types: ${r.length?r.join(", "):"(none)"}`,`Built-in types: ${n.length?n.join(", "):"(none)"}`,`Provided (F_CONNECTION_BUILDERS) types: ${o.length?o.join(", "):"(none)"}`,s.length?`Overridden built-ins: ${s.join(", ")}`:null,"Tip: ensure you pass a valid Connection Type or provide a builder via F_CONNECTION_BUILDERS."].filter(Boolean);return new Error(a.join(`
|
|
2
2
|
`))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})();function m0(t,i,e){return It("connection_"+t+i+e)}function _0(t,i,e){return It("connection_for_selection_"+t+i+e)}function Bp(t){return It("connection_gradient_"+t)}function g0(t){return`url(#${Bp(t)})`}var y0=(()=>{class t{_connection=d(Il);_hostElement=d(Se).nativeElement;_injector=d(Ye);_hostAttributes=new Map;_startColor;_endColor;gradientId=P(()=>Bp(this._connection.fId()));ngOnInit(){this._listenColorChanges()}_listenColorChanges(){me(()=>{this.gradient().fStartColor(),this.gradient().fEndColor(),gt(()=>{this._updateGradient()})},{injector:this._injector})}get stop1Element(){return this._hostElement.children.item(0)}get stop2Element(){return this._hostElement.children.item(1)}redraw(e){let n=e.point2.x-e.point1.x,o=e.point2.y-e.point1.y,r=Math.sqrt(n*n+o*o)||.01,s=new X(.5-.5*n/r,.5-.5*o/r);this._setHostAttribute("x1",s.x.toString()),this._setHostAttribute("y1",s.y.toString());let a=new X(.5+.5*n/r,.5+.5*o/r);this._setHostAttribute("x2",a.x.toString()),this._setHostAttribute("y2",a.y.toString()),this._updateGradient()}_updateGradient(){let e=this.gradient();this._setFromColor(e.fStartColor()),this._setToColor(e.fEndColor())}_setFromColor(e){let n=e||"transparent";this._startColor!==n&&(this._startColor=n,this.stop1Element.setAttribute("stop-color",n),this.stop1Element.style.setProperty("stop-color",n))}_setToColor(e){let n=e||"transparent";this._endColor!==n&&(this._endColor=n,this.stop2Element.setAttribute("stop-color",n),this.stop2Element.style.setProperty("stop-color",n))}_setHostAttribute(e,n){this._hostAttributes.get(e)!==n&&(this._hostAttributes.set(e,n),this._hostElement.setAttribute(e,n))}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,standalone:!1})}return t})(),ef=(()=>{class t extends y0{gradient=F.required({alias:"fConnectionGradientRendererFor"});static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["linearGradient","fConnectionGradientRenderer",""]],hostVars:1,hostBindings:function(n,o){n&2&&Z("id",o.gradientId())},inputs:{gradient:[1,"fConnectionGradientRendererFor","gradient"]},features:[_e],attrs:j_,decls:3,vars:0,consts:[[0,"xmlns","svg","http://www.w3.org/2000/svg"],["offset","0%"],["offset","100%"]],template:function(n,o){n&1&&(ao(0,0),$e(),Pt(1,"stop",1)(2,"stop",2),co())},encapsulation:2,changeDetection:0})}return t})(),cp=new fe("F_CONNECTION_GRADIENT");var tf=new fe("F_CONNECTION_PATH"),nf=class{hostElement=d(Se).nativeElement},v0=(()=>{class t extends nf{_connection=d(Il);useGradient=F(!1);linkToGradient=P(()=>this.useGradient()?g0(this._connection.fId()):null);get fPathId(){return this._connection.fId()}get attrConnectionId(){return m0(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(#${b0(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${w0(this._connection.fId())})`)}deselect(){this.hostElement.setAttribute("marker-start",`url(#${C0(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${x0(this._connection.fId())})`)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["path","f-connection-path",""]],hostAttrs:[1,"f-component","f-connection-path"],hostVars:4,hostBindings:function(n,o){n&2&&(Z("id",o.attrConnectionId)("data-f-path-id",o.fPathId),at("stroke",o.linkToGradient()))},inputs:{useGradient:[1,"useGradient"]},standalone:!1,features:[Ie([{provide:tf,useExisting:t}]),_e],attrs:U_,decls:0,vars:0,template:function(n,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})();function C0(t){return It(`f-connection-marker-start-${t}`)}function x0(t){return It(`f-connection-marker-end-${t}`)}function b0(t){return It(`f-connection-selected-marker-start-${t}`)}function w0(t){return It(`f-connection-selected-marker-end-${t}`)}var of=new fe("F_CONNECTION_SELECTION"),rf=class{hostElement=d(Se).nativeElement},S0=(()=>{class t extends rf{_connection=d(Il);get connectionForSelectionId(){return _0(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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["path","fConnectionSelection",""]],hostAttrs:[1,"f-component","f-connection-selection"],hostVars:1,hostBindings:function(n,o){n&2&&Z("id",o.connectionForSelectionId)},standalone:!1,features:[Ie([{provide:of,useExisting:t}]),_e],attrs:$_,decls:0,vars:0,template:function(n,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})(),sf=new fe("F_CONNECTION_DRAG_HANDLE_END"),af=new fe("F_CONNECTION_DRAG_HANDLE_START"),fc=class{hostElement=d(Se).nativeElement;point=L.initialize();class="f-connection-drag-handle";calculateCircleCenter(i,e,n){let o={x:e.x-i.x,y:e.y-i.y},r=Math.sqrt(o.x*o.x+o.y*o.y)||1,s={x:o.x/r,y:o.y/r},a={x:s.x*n,y:s.y*n};return{x:e.x-a.x,y:e.y-a.y}}},I0=(()=>{class t extends fc{redraw(e,n){this.point=this.calculateCircleCenter(e,n,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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["circle","f-connection-drag-handle-start",""]],hostVars:2,hostBindings:function(n,o){n&2&&Ce(o.class)},standalone:!1,features:[Ie([{provide:af,useExisting:t}]),_e],attrs:W_,decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})(),T0=(()=>{class t extends fc{redraw(e,n){this.point=this.calculateCircleCenter(e,n,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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["circle","f-connection-drag-handle-end",""]],hostVars:2,hostBindings:function(n,o){n&2&&Ce(o.class)},standalone:!1,features:[Ie([{provide:sf,useExisting:t}]),_e],attrs:q_,decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})(),ku="f-selected";function zp(t){return class extends t{fId=q("");fSelectionDisabled=q(!1);unmarkAsSelected(){this.unmarkChildrenAsSelected?.(),this.hostElement.classList.remove(ku)}markAsSelected(){this.markChildrenAsSelected?.(),this.isSelected()||this.hostElement.classList.add(ku)}isSelected(){return this.hostElement.classList.contains(ku)}markChildrenAsSelected(){}unmarkChildrenAsSelected(){}constructor(...i){super(...i)}}}function E0(t){return class extends t{show(){this.hostElement.style.display="unset"}hide(){this.hostElement.style.display="none"}constructor(...i){super(...i)}}}var P0=zp(E0(class{hostElement;constructor(t){this.hostElement=t}})),M0=(()=>{class t extends P0{_fConnectionBuilder=d(Lp);path="";line=ni.initialize();fReassignableStart=q(!1);fDraggingDisabled=q(!1);fSelectionDisabled=q(!1);fDefs=Te.required("defs");fPath=Te.required(tf);fDragHandleStart=Te(af);fDragHandleEnd=Te.required(sf);fSelection=Te.required(of);fContents=Cu(tp,{descendants:!0});fMarkers=Cu(Xu,{descendants:!0});fGradient=lo(cp);_fGradientRenderer=Te(ef);fWaypoints=lo(np);fInputSide=q(qe.DEFAULT);_contentLayoutEngine=new qu;_sourceSide=B.AUTO;fOutputSide=q(qe.DEFAULT);_targetSide=B.AUTO;_penultimatePoint=L.initialize();_secondPoint=L.initialize();constructor(){super(d(Se).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(n=>n.hostElement?.contains(e))||this.fWaypoints()?.hostElement?.contains(e)}setLine({point1:e,point2:n}){this.line=ni.initialize(e,n);let{path:o,points:r,penultimatePoint:s,secondPoint:a,candidates:l}=this._getPathResult(e,n);this.path=o,this._penultimatePoint=s||e,this._secondPoint=a||n,this.fWaypoints()?.candidates.set(l||[]),this._contentLayoutEngine.layout(r||[],this._contents())}_contents(){return Array.from(this.fContents()?.values()??[])}_getPathResult(e,n){return this._fConnectionBuilder.handle({type:this.fType,payload:{source:e,sourceSide:this._sourceSide,target:n,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,n){this._sourceSide=e,this._targetSide=n}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,contentQueries:function(n,o,r){n&1&&vu(r,o.fContents,tp,5)(r,o.fMarkers,Xu,5)(r,o.fGradient,cp,5)(r,o.fWaypoints,np,5),n&2&&it(4)},viewQuery:function(n,o){n&1&&ft(o.fDefs,X_,5)(o.fPath,tf,5)(o.fDragHandleStart,af,5)(o.fDragHandleEnd,sf,5)(o.fSelection,of,5)(o._fGradientRenderer,ef,5),n&2&&it(6)},standalone:!1,features:[_e]})}return t})(),D0=(()=>{let t=class Jo{_browser=d(Re);_markerCache=new WeakMap;handle({connection:e}){let n=this._findConnectionMarkers(e),o=e.fDefs();if(!o)return!1;let r=k0(n),s=this._markerCache.get(e);if(s?.signature===r&&s.defsElement===o.nativeElement)return!1;let a=Gp("defs",this._browser);return n.forEach(l=>{Vp(l.type).forEach(h=>{let _=R0(h,l,e.fId(),this._browser),v=l.markerElement.cloneNode(!0);v.setAttribute("height",`${l.height}`),v.setAttribute("width",`${l.width}`),v.removeAttribute("markerUnits"),v.style.display="unset",_.append(v),a.append(_)})}),o.nativeElement.innerHTML=a.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(n){return new(n||Jo)};static \u0275prov=g({token:Jo,factory:Jo.\u0275fac})};return t=C([x(kn)],t),t})();function k0(t){return t.map(i=>[...Vp(i.type),i.width,i.height,i.refX,i.refY,i.orient,i.markerUnits,i.markerElement.outerHTML].join("|")).join("||")}function R0(t,i,e,n){let o=Gp("marker",n);return o.setAttribute("id",It(t+"-"+e)),o.setAttribute("markerHeight",`${i.height}`),o.setAttribute("markerWidth",`${i.width}`),o.setAttribute("orient",`${i.orient}`),o.setAttribute("refX",`${i.refX}`),o.setAttribute("refY",`${i.refY}`),o.setAttribute("markerUnits",`${i.markerUnits}`),o}function Vp(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 Gp(t,i){return i.document.createElementNS("http://www.w3.org/2000/svg",t)}var El=(()=>{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,n){this._connectedInPreviousRender.add(e),this._connectedInPreviousRender.add(n)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),N0=String.raw`
|
|
3
3
|
const EPSILON = 0.5;
|
|
4
4
|
|