@next-bricks/diagram 0.65.2 → 0.66.0
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/bricks.json +3 -3
- package/dist/chunks/551.6afac48c.js +2 -0
- package/dist/chunks/551.6afac48c.js.map +1 -0
- package/dist/chunks/5670.3f0c377e.js +3 -0
- package/dist/chunks/5670.3f0c377e.js.map +1 -0
- package/dist/chunks/{7304.da01ff98.js → 7304.2ae2d399.js} +2 -2
- package/dist/chunks/7304.2ae2d399.js.map +1 -0
- package/dist/chunks/9711.dac4a790.js +2 -0
- package/dist/chunks/9711.dac4a790.js.map +1 -0
- package/dist/chunks/{eo-display-canvas.1dbece57.js → eo-display-canvas.331140e5.js} +2 -2
- package/dist/chunks/{eo-display-canvas.1dbece57.js.map → eo-display-canvas.331140e5.js.map} +1 -1
- package/dist/chunks/eo-draw-canvas.d66c3fcc.js +2 -0
- package/dist/chunks/eo-draw-canvas.d66c3fcc.js.map +1 -0
- package/dist/chunks/{main.64e4345c.js → main.6c3da929.js} +2 -2
- package/dist/chunks/{main.64e4345c.js.map → main.6c3da929.js.map} +1 -1
- package/dist/examples.json +3 -3
- package/dist/{index.55260b97.js → index.af95d6cd.js} +2 -2
- package/dist/{index.55260b97.js.map → index.af95d6cd.js.map} +1 -1
- package/dist/manifest.json +187 -180
- package/dist/types.json +5342 -5159
- package/dist-types/draw-canvas/CellComponent.d.ts +4 -2
- package/dist-types/draw-canvas/NodeComponent.d.ts +2 -1
- package/dist-types/draw-canvas/decorators/DecoratorGroup.d.ts +3 -0
- package/dist-types/draw-canvas/decorators/index.d.ts +1 -1
- package/dist-types/draw-canvas/index.d.ts +3 -1
- package/dist-types/draw-canvas/interfaces.d.ts +7 -1
- package/dist-types/draw-canvas/processors/asserts.d.ts +1 -0
- package/dist-types/draw-canvas/processors/{computeContainerRect.d.ts → computeBoundingBox.d.ts} +3 -1
- package/dist-types/draw-canvas/processors/handleKeyboard.d.ts +2 -2
- package/dist-types/draw-canvas/processors/initaliContainerLayout.d.ts +1 -2
- package/dist-types/draw-canvas/processors/initaliGroupLayout.d.ts +7 -0
- package/dist-types/draw-canvas/processors/isLocked.d.ts +1 -1
- package/dist-types/draw-canvas/processors/staggeredLayout.d.ts +3 -3
- package/dist-types/draw-canvas/reducers/interfaces.d.ts +2 -1
- package/docs/eo-draw-canvas.md +26 -4
- package/package.json +2 -2
- package/dist/chunks/296.d133f1de.js +0 -2
- package/dist/chunks/296.d133f1de.js.map +0 -1
- package/dist/chunks/5670.f356b145.js +0 -3
- package/dist/chunks/5670.f356b145.js.map +0 -1
- package/dist/chunks/7304.da01ff98.js.map +0 -1
- package/dist/chunks/9711.e769a674.js +0 -2
- package/dist/chunks/9711.e769a674.js.map +0 -1
- package/dist/chunks/eo-draw-canvas.276d3b61.js +0 -2
- package/dist/chunks/eo-draw-canvas.276d3b61.js.map +0 -1
- /package/dist/chunks/{5670.f356b145.js.LICENSE.txt → 5670.3f0c377e.js.LICENSE.txt} +0 -0
- /package/dist-types/draw-canvas/processors/{computeContainerRect.spec.d.ts → computeBoundingBox.spec.d.ts} +0 -0
package/dist/bricks.json
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
],
|
|
7
7
|
"elements": [
|
|
8
8
|
"eo-diagram",
|
|
9
|
-
"eo-
|
|
10
|
-
"eo-
|
|
9
|
+
"eo-display-canvas",
|
|
10
|
+
"eo-draw-canvas"
|
|
11
11
|
],
|
|
12
12
|
"processors": [],
|
|
13
13
|
"editors": [],
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"basic.lock-body-scroll"
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
|
-
"filePath": "bricks/diagram/dist/index.
|
|
19
|
+
"filePath": "bricks/diagram/dist/index.af95d6cd.js"
|
|
20
20
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[551],{227:(e,t,n)=>{n.d(t,{Y:()=>r});var o=n(4197);function r(e,t,n,r){const i=[];if(t){const n=new Set;for(const o of e)"edge"===o.type&&o.source===t.source.id&&n.add(o.target);for(const t of e)switch(t.type){case"node":n.has(t.id)&&i.push(t);break;case"decorator":r&&"text"!=t.decorator&&!n.has(t.id)||i.push(t);break;default:i.push(t)}}else switch(null==n?void 0:n.type){case"multi":{const t=new Map,r=new Set,l=new Set;for(const e of n.targets)"node"===e.type&&(r.add(e.id),l.add(e.id));for(const a of e)"node"===a.type?t.set(a.id,a):"edge"===a.type?r.has(a.source)?l.add(a.target):r.has(a.target)?l.add(a.source):(0,o.Q)(a,n)||i.push(a):(0,o.Q)(a,n)||i.push(a);for(const[e,n]of t)l.has(e)||i.push(n);break}case"node":{const t=new Map,o=new Set([n.id]);for(const r of e)"node"===r.type?t.set(r.id,r):"edge"===r.type?r.source===n.id?o.add(r.target):r.target===n.id?o.add(r.source):i.push(r):i.push(r);for(const[e,n]of t)o.has(e)||i.push(n);break}case"edge":for(const t of e)("edge"===t.type?(0,o.Q)(t,n):"node"===t.type&&(t.id===n.source||t.id===n.target))||i.push(t)}return i}},531:(e,t,n)=>{n.d(t,{N:()=>r,OD:()=>f,VF:()=>g,WW:()=>a,_m:()=>h,bo:()=>d,dS:()=>v,jw:()=>m,kN:()=>p,mH:()=>i,nv:()=>c,o6:()=>s,om:()=>y,t2:()=>u,vC:()=>l});var o=n(1030);function r(e){return"node"===e.type}function i(e){return"decorator"===e.type}function l(e){return"node"===e.type}function a(e){return"edge"===e.type}function c(e){return"node"===e.type||"edge"===e.type}function s(e){return"node"===e.type||"decorator"===e.type&&"area"===e.decorator}function d(e,t){return"node"===e.type||!!t&&"decorator"===e.type&&"area"===e.decorator}function u(e){return"decorator"===e.type&&"container"===e.decorator}function v(e){return"decorator"===e.type&&"group"===e.decorator}function h(e){return"decorator"===e.type&&"line"===e.decorator}function f(e){return!["manual",void 0].includes(e)}function g(e){return!(null!=e&&e.width&&null!=e&&e.height)}function p(e){return(0,o.isNil)(null==e?void 0:e.x)||(0,o.isNil)(null==e?void 0:e.y)}function m(e){return!("polyline"===e||"curve"===e)}function y(e){return!!e.edge}},967:(e,t,n)=>{n.d(t,{V:()=>u,P:()=>v});var o=n(1030),r=n(8875),i=n(4059);function l(e,t){return{x:e.x+e.width/2,y:e.y+e.height/2,width:e.width+t,height:e.height+t}}var a=n(3033),c=n(3188),s=n(531);const d=["right","top","left","bottom"];function u(e,t,n,u,m){var y,w,x,E,k,b;const{type:M,vertices:C,exitPosition:I,entryPosition:L}=null!=n?n:{};if((0,s.jw)(M))return"decorator"===m?[{x:e.x,y:e.y},...null!=C?C:[],{x:t.x,y:t.y}]:(0,c.h)(l(e,I?a.XK:a.p6),l(t,L?a.XK:a.p6),u,n);if(null!=C&&C.length){const n=C[0],o=C[C.length-1];let r,i,l,a;if(I)r=f(e,I);else{let i;if(C.length>1?i=C[1]:L&&(i=f(t,L)),i)r=g(n,e,n.y===i.y);else{const n=o.y<t.y||o.y>t.y+t.height?"ns":"ew";({point:r,direction:l}=p(e,t,C,n))}}if(L)i=f(t,L);else{let r;if(C.length>1?r=C[C.length-2]:I&&(r=f(e,I)),r)i=g(o,t,o.y===r.y);else{const o=n.x<e.x||n.x>e.x+e.width?"ew":"ns";({point:i,direction:a}=p(t,e,C.slice().reverse(),o))}}const{x:c,y:s}=r,{x:d,y:u}=i,h=[r,...C,i],m=[...C];return n&&n.x!==c&&n.y!==s&&m.unshift("ns"===l?{x:c,y:n.y}:"ew"===l?{x:n.x,y:s}:n.x===h[2].x?{x:c,y:n.y}:{x:n.x,y:s}),o&&o.x!==d&&o.y!==u&&m.push("ns"===a?{x:d,y:o.y}:"ew"===a?{x:o.x,y:u}:o.x===h[h.length-3].x?{x:d,y:o.y}:{x:o.x,y:u}),[r,...v(r,m,i),i]}const S=null!=I?I:h(t,e),N=null!=L?L:h(e,t),{x:z,y:P}=f(e,S),{x:R,y:A}=f(t,N),T=(0,r.X)(),H=null!==(y=null===(w=T.find((e=>e.x===S.x&&e.y===S.y)))||void 0===w?void 0:w.d)&&void 0!==y?y:d,W=null!==(x=null===(E=T.find((e=>e.x===N.x&&e.y===N.y)))||void 0===E?void 0:E.d)&&void 0!==x?x:d,D=[...H],j=[...W];z<R?((0,o.pull)(D,"left"),(0,o.pull)(j,"right")):((0,o.pull)(D,"right"),(0,o.pull)(j,"left")),P<A?((0,o.pull)(D,"top"),(0,o.pull)(j,"bottom")):((0,o.pull)(D,"bottom"),(0,o.pull)(j,"top"));const B=null!==(k=D[0])&&void 0!==k?k:H[0],$=null!==(b=j[0])&&void 0!==b?b:W[0],Z="left"===B||"right"===B?S.y:S.x,O="left"===$||"right"===$?N.y:N.x;return(0,i.o)(l(e,a.XK),l(t,a.XK),B,$,Z,O)}function v(e,t,n){const o=[];let r,i=e,l=0;for(;l<t.length;){const e=t[l],a=e.x!==i.x,c=e.y!==i.y;if(a||c){const c=a?"ew":"ns";if(c!==r){const a=l===t.length-1?n:t[l+1],s=a.x!==e.x,d=a.y!==e.y;(s||d)&&c!==(s?"ew":"ns")&&(r=c,o.push(e),i=e)}}l++}return o}function h(e,t){return t.y+t.height<e.y?{x:.5,y:1}:t.y>e.y+e.height?{x:.5,y:0}:t.x<e.x?{x:1,y:.5}:{x:0,y:.5}}function f(e,t){const n=a.XK/2;return{x:e.x-n+t.x*(e.width+a.XK),y:e.y-n+t.y*(e.height+a.XK)}}function g(e,t,n){let o,r,i,l,c;if(n?(o="y",r="x",i="height",l="width"):(o="x",r="y",i="width",l="height"),t[r]+t[l]<e[r]&&(c={[o]:.5,[r]:1}),t[r]>e[r]&&(c={[o]:.5,[r]:0}),c)return f(t,c);const s=t[o]<e[o]?1:0;return{[o]:t[o]-a.XK/2+s*(t[i]+a.XK),[r]:e[r]}}function p(e,t,n,o){let r,i,l,a,c,s,d,u;"ns"===o?(l="x",a="y",c="width",s="height",d="ns",u="ew"):(l="y",a="x",c="height",s="width",d="ew",u="ns");const v=n[0];if(v[l]>=e[l]&&v[l]<=e[l]+e[c])if(v[a]>e[a]+e[s])r={[l]:v[l],[a]:e[a]+e[s]},i=d;else if(v[a]<e[a])r={[l]:v[l],[a]:e[a]},i=d;else{var h;const o=null!==(h=n[1])&&void 0!==h?h:t;r={[l]:v[l],[a]:o[a]<v[a]?v[a]:e[a]+e[s]},i=d}else v[a]<e[a]?(r={[l]:e[l]+e[c]/2,[a]:e[a]},i=d):v[a]>e[a]+e[s]?(r={[l]:e[l]+e[c]/2,[a]:e[a]+e[s]},i=d):v[l]<e[l]?(r={[l]:e[l],[a]:v[a]},i=u):(r={[l]:e[l]+e[c],[a]:v[a]},i=u);return{point:r,direction:i}}},1103:(e,t,n)=>{n.d(t,{X:()=>u});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i),a=n(8653),c=n(9978),s=n(967),d=n(7531);function u(e){let{transform:t,lineSettings:n,options:i}=e;const[u,v]=(0,o.useState)(null),{hoverState:h,smartConnectLineState:f,setSmartConnectLineState:g}=(0,c.s)();(0,o.useEffect)((()=>{if(f)return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),o;function e(e){v([(e.clientX-t.x-f.offset[0])/t.k,(e.clientY-t.y-f.offset[1])/t.k])}function n(e){e.preventDefault(),o()}function o(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n),v(null),g(null)}}),[g,f,t]);const p=(0,o.useMemo)((()=>{const e=function(e,t,n,o){if(!e||!t&&void 0===(null==n?void 0:n.activePointIndex))return null;const r=e.source.view;if(void 0!==(null==n?void 0:n.activePointIndex))return(0,s.V)(r,n.cell.view,{...o,exitPosition:e.exitPosition,entryPosition:n.relativePoints[n.activePointIndex]});const[i,l]=t;return(0,s.V)(r,{x:i,y:l,width:0,height:0},{...o,exitPosition:e.exitPosition})}(f,u,h,n);return(0,a.S)(e,"curve"===(null==n?void 0:n.type)?n.curveType:"curveLinear",0,1)}),[u,h,f,n]);let m,y;const w=(0,d.I)(i);for(const e of w)"start"===e.placement?m=i.$markerStartUrl:y=i.$markerEndUrl;return r().createElement("path",{className:l()("connect-line",{connecting:!(!f||!u)}),d:p,fill:"none",stroke:i.strokeColor,strokeWidth:i.strokeWidth,markerStart:m,markerEnd:y})}},1484:(e,t,n)=>{n.d(t,{g:()=>g});var o=n(8769),r=n(7566),i=n(9047),l=n(3033),a=n(531),c=n(4282),s=n(8802),d=n(1489),u=n(6170),v=n(9127);const h=new Map([["center",.5],["left",0],["right",1],["top",0],["bottom",1]]);function f(e,t){if("string"==typeof e){const n=h.get(e);if(void 0!==n)return n;const o=e.match(/^(-?\d+(?:\.\d+)?)%$/);if(o)return Number(o[1])/100;console.error("Unexpected align origin %s:",t,e)}else{if("number"==typeof e)return e;console.error("Unexpected align origin %s, expected %s, received %s:",t,"string | number",typeof e,e)}return.5}function g(e){let{layout:t,layoutOptions:n,autoSize:h,rootRef:g,cells:p,zoomable:m,zoomer:y,scaleRange:w,layoutKey:x,allowEdgeToArea:E,autoCenterWhenCellsChange:k,dispatch:b}=e;const[M,C]=(0,o.useState)("force"!==t&&"dagre"!==t),I=(0,o.useRef)(x),L=(0,o.useCallback)((()=>++I.current),[]),[S,N]=function(e){let{rootRef:t,cells:n,layoutInitialized:u,zoomable:v,zoomer:h,scaleRange:f,autoCenterWhenCellsChange:g,autoSize:p,padding:m}=e;const[y,w]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{n.some((e=>(0,a.N)(e)||(0,a.mH)(e)))&&!g||w(!1)}),[n,g]),(0,o.useEffect)((()=>{const e=t.current;if(!e||!u||y||!n.some((e=>(0,a.N)(e)||(0,a.mH)(e)))||n.some((e=>(0,a.N)(e)&&!e[l.CV])))return;const o=(0,c.S)(n);let g=e.clientWidth,x=e.clientHeight;const E=!(null==p||!p.width),k=!(null==p||!p.height),b=(0,s.D)(null!=m?m:l.rn);var M,C,I,L;E&&(g=Math.min(Math.max(o.width+b[1]+b[3],null!==(M=p.minWidth)&&void 0!==M?M:0),null!==(C=p.maxWidth)&&void 0!==C?C:1/0),e.style.minWidth=`${g}px`),k&&(x=Math.min(Math.max(o.height+b[0]+b[2],null!==(I=p.minHeight)&&void 0!==I?I:0),null!==(L=p.maxHeight)&&void 0!==L?L:1/0),e.style.minHeight=`${x}px`);const{k:S,x:N,y:z}=(0,d.P)(o,{canvasWidth:g,canvasHeight:x,canvasPadding:b,scaleRange:v?f:void 0});h.transform((0,r.A)(e),new i.uV(S,N,z)),w(!0)}),[n,y,u,t,f,v,h,p,m]),[y,w]}({rootRef:g,layoutInitialized:M,cells:p,zoomable:m,zoomer:y,scaleRange:w,autoCenterWhenCellsChange:k,autoSize:h,padding:null==n?void 0:n.padding}),z=(0,o.useRef)(null);return(0,o.useEffect)((()=>{if(p.some((e=>(0,a.N)(e)&&!e[l.CV]))||0===p.length)return;if("force"!==t&&"dagre"!==t)return void C(!0);if(I.current!==x||(e=z.current,o=p.filter(a.nv),(null==e?void 0:e.length)===o.length&&e.every(((e,t)=>e===o[t]))))return;var e,o;let r,i;({getNodeView:r,nodePaddings:i}="force"===t?(0,u.k)({cells:p,layoutOptions:n,allowEdgeToArea:E}):(0,v.C)({cells:p,layoutOptions:n,allowEdgeToArea:E}));const c=function(e){const t=null!=e?e:[.5,.5];return[f(t[0],"x"),f(t[1],"y")]}(null==n?void 0:n.alignOrigin),s=p.map((e=>{if(E&&(0,a.o6)(e)||(0,a.N)(e)){const t=r(e.id);return{...e,view:{...e.view,x:t.x-t.width*c[0]+i[3],y:t.y-t.height*c[1]+i[0]},[l.xc]:!0}}return e}));z.current=s.filter(a.nv),b({type:"update-cells",payload:s}),C(!0)}),[p,b,t,x,n,E]),{centered:S,setCentered:N,getNextLayoutKey:L}}},1489:(e,t,n)=>{function o(e,t){let{canvasWidth:n,canvasHeight:o,canvasPadding:r,scaleRange:i}=t;const{left:l,top:a,width:c,height:s,empty:d}=e,[u,v,h,f]=null!=r?r:[0,0,0,0],g=n-f-v,p=o-u-h,m=i&&!d&&(c>g||s>p)?Math.max(Math.min(g/c,p/s,i[1]),i[0]):1;return{x:d?0:(g-c*m)/2+f-l*m,y:d?0:(p-s*m)/2+u-a*m,k:m}}n.d(t,{P:()=>o})},1819:(e,t,n)=>{n.d(t,{J:()=>i});var o=n(8769),r=n(8185);function i(e){let{rootRef:t,activeTarget:n,doNotResetActiveTargetForSelector:i,doNotResetActiveTargetOutsideCanvas:l,onActiveTargetChange:a}=e;const c=null!=n?n:null,[s,d]=(0,o.useState)(c);(0,o.useEffect)((()=>{d((e=>(0,r.c)(e,c)?e:c))}),[c]);const u=(0,o.useRef)(!1);return(0,o.useEffect)((()=>{u.current?a(s):u.current=!0}),[s,a]),(0,o.useEffect)((()=>{if(!s)return;const e=e=>{const n=e.composedPath(),o=n.indexOf(t.current);(l?0!==o:!(o<=0)||i&&n.some((e=>e instanceof Element&&e.matches(i))))||d(null)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[s,l,i,t]),s}},1825:(e,t,n)=>{n.d(t,{W:()=>g});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i),a=n(8653),c=n(9978),s=n(1030),d=n(967),u=n(531);function v(e,t,n,o){const{control:r}=t,{points:i}=n.get(e),l=[],[a,c]=o,s=i[0],u=i[i.length-1];0===r.index&&l.push("ns"===r.direction?{x:s.x,y:c}:{x:a,y:s.y});for(let e=1;e<i.length-1;e++){const t=i[e];l.push(e===r.index||e===r.index+1?"ns"===r.direction?{x:t.x,y:c}:{x:a,y:t.y}:t)}return r.index===i.length-2&&l.push("ns"===r.direction?{x:u.x,y:c}:{x:a,y:u.y}),(0,d.P)(s,l,u)}var h=n(7531);const f=["control","corner","break"];function g(e){let{cells:t,editableLineMap:n,transform:i,options:g,activeEditableLine:p}=e;const[m,y]=(0,o.useState)(null),{hoverState:w,lineEditorState:x,setLineEditorState:E,onChangeEdgeView:k,onChangeDecoratorView:b}=(0,c.s)(),M=(0,o.useRef)(!1);(0,o.useEffect)((()=>{x||setTimeout((()=>{M.current=!1}),0)}),[x]),(0,o.useEffect)((()=>{if(!p||!x)return;M.current=!1;const{type:e,offset:o,from:r}=x,l=l=>{const a={x:(l.clientX-i.x-o[0])/i.k,y:(l.clientY-i.y-o[1])/i.k},c=n.get(p).points,s={x:1/0,y:1/0};let d,v;const h=()=>{if(!M.current){const e=(l.clientX-r[0])/i.k,t=(l.clientY-r[1])/i.k;M.current=e**2+t**2>=9}return[a.x,a.y]};if(f.includes(e)&&!l.altKey){const t=x.control;v="control"===e?["ns"===t.direction?"y":"x"]:["x","y"],d=c.filter(((n,o)=>0===o||o===c.length-1||("control"===e?o!==t.index&&o!==t.index+1:"corner"!==e||o!==t.index+1)))}else{if(!(0,u._m)(p)||"exit"!==e&&"entry"!==e||l.altKey)return h();{const t="exit"===e?c[0]:c[c.length-1];d=c.filter((e=>e!==t)),v=["x","y"]}}for(const e of t){if(!(0,u.WW)(e)&&!(0,u._m)(e)||e===p)continue;const t=n.get(e);t&&d.push(...t.points.slice(1,-1))}for(const e of d)for(const t of v){const n=Math.abs(e[t]-a[t]);n<=5&&n<s[t]&&(a[t]=e[t],s[t]=n)}return h()},a=e=>{const t=l(e);M.current&&y(t)};function c(e){if(e.preventDefault(),s(),!M.current)return;const t=l(e),o=(0,u.WW)(p);if("control"!==(null==x?void 0:x.type)){if(!o)switch(null==x?void 0:x.type){case"entry":case"exit":null==b||b(p,{...p.view,["entry"===x.type?"target":"source"]:{x:t[0],y:t[1]}});break;case"corner":null==b||b(p,{...p.view,vertices:p.view.vertices.map(((e,n)=>n===x.control.index?{x:t[0],y:t[1]}:e))});break;case"break":{var r;const e=[...null!==(r=p.view.vertices)&&void 0!==r?r:[]];e.splice(x.control.index,0,{x:t[0],y:t[1]}),null==b||b(p,{...p.view,vertices:e});break}}}else if(o){const e=n.get(p),{source:o,target:r}=e;null==k||k(o,r,{...p.view,vertices:v(p,x,n,t)})}else null==b||b(p,{...p.view,vertices:v(p,x,n,t)})}function s(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",c),y(null),E(null)}return document.addEventListener("mousemove",a),document.addEventListener("mouseup",c),s}),[p,n,x,i,E,k,t,b]),(0,o.useEffect)((()=>{if(!p)return;const e=e=>{M.current&&(e.stopPropagation(),e.preventDefault())};return document.body.addEventListener("click",e),()=>{document.body.removeEventListener("click",e)}}),[p]);const C=(0,o.useMemo)((()=>{const e=function(e,t,n,o,r){if(!e||!t||!(o||"control"!==t.type&&void 0!==(null==r?void 0:r.activePointIndex)))return null;const i=n.get(e);if(!i)return null;const{type:l}=t;let a,c;const h=e.type;if((0,u.om)(i))a=i.source.view,c=i.target.view;else{const e=i.decorator.view;a={...e.source,width:0,height:0},c={...e.target,width:0,height:0}}const f=e.view,{exitPosition:g,entryPosition:p,vertices:m}=null!=f?f:{},y=(0,s.pick)(f,["type","curveType"]);if("control"===l){const r=v(e,t,n,o);return(0,d.V)(a,c,{...y,exitPosition:g,entryPosition:p,vertices:r},0,h)}if("corner"===l){const e=[...m];return e.splice(t.control.index,1,{x:o[0],y:o[1]}),(0,d.V)(a,c,{...y,exitPosition:g,entryPosition:p,vertices:e},0,h)}if("break"===l){const e=[...null!=m?m:[]];return e.splice(t.control.index,0,{x:o[0],y:o[1]}),(0,d.V)(a,c,{...y,exitPosition:g,entryPosition:p,vertices:e},0,h)}if("edge"===h&&void 0!==(null==r?void 0:r.activePointIndex)){const e=r.relativePoints[r.activePointIndex];return(0,d.V)(a,c,{...y,..."entry"===l?{exitPosition:g,entryPosition:e}:{exitPosition:e,entryPosition:p},vertices:m},0,h)}const[w,x]=o;return"entry"===l?(0,d.V)(a,{x:w,y:x,width:0,height:0},{...y,exitPosition:g,vertices:m},0,h):(0,d.V)({x:w,y:x,width:0,height:0},c,{...y,entryPosition:p,vertices:m},0,h)}(p,x,n,m,w),t=null==p?void 0:p.view;return(0,a.S)(e,"curve"===(null==t?void 0:t.type)?t.curveType:"curveLinear",0,1)}),[m,w,p,x,n]);let I,L;const S=(0,h.I)(g);for(const e of S)"start"===e.placement?I=g.$editingStartMarkerUrl:L=g.$editingEndMarkerUrl;return r().createElement("path",{className:l()("editing-line",{editing:!(!x||!m)}),d:C,fill:"none",stroke:g.editingStrokeColor,markerStart:I,markerEnd:L})}},1991:(e,t,n)=>{n.d(t,{_:()=>r});var o=n(531);function r(e,t,n){const r=t.filter((e=>(0,o.N)(e)||(0,o.dS)(e))),i=e.filter((e=>(0,o.t2)(e))).map((e=>e.id)),l=e.filter((e=>{const t=r.find((t=>t.id===e.id)),n=(null==t?void 0:t.containerId)&&i.includes(t.containerId);return((0,o.N)(e)&&!e.groupId||(0,o.dS)(e))&&!n})),a=t.filter((e=>{var t;return(0,o.t2)(e)&&!(null!==(t=e.view)&&void 0!==t&&t.locked)}));l.forEach((e=>{const t=e.x,n=e.x+e.width,o=e.y,r=e.y+e.height;for(const i of a){const l=i.view.x,a=i.view.x+i.view.width,c=i.view.y,s=i.view.y+i.view.height;if(t>=l&&n<=a&&o>=c&&r<=s){e.containerId=i.id;break}}}));let c=[];return c=l.filter((e=>{const t=r.find((t=>t.id===e.id));return(null==t?void 0:t.containerId)!==e.containerId})),c.length>0&&(null==n||n(c)),c}},2202:(e,t,n)=>{n.d(t,{F:()=>h});var o=n(9575),r=n(8769),i=n.n(r),l=n(9978),a=n(531);const c="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyMnB4IiBoZWlnaHQ9IjIycHgiIHZlcnNpb249IjEuMSI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iNyIgc3Ryb2tlPSIjZmZmIiBmaWxsPSIjMjliNmYyIi8+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iMyIgc3Ryb2tlPSIjZmZmIiBmaWxsPSJ0cmFuc3BhcmVudCIvPjwvc3ZnPg==",s="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiIHZlcnNpb249IjEuMSIgc3R5bGU9ImNvbG9yLXNjaGVtZTogbGlnaHQgZGFyazsiPjxjaXJjbGUgY3g9IjkiIGN5PSI5IiByPSI2IiBzdHJva2U9IiNmZmYiIGZpbGw9IiMyOWI2ZjIiLz48L3N2Zz4=",d="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyMnB4IiBoZWlnaHQ9IjIycHgiIHZlcnNpb249IjEuMSI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iNyIgc3Ryb2tlPSIjZmZmIiBmaWxsPSIjMDFiZDIyIi8+PHBhdGggZD0ibSA4IDggTCAxNCAxNE0gOCAxNCBMIDE0IDgiIHN0cm9rZT0iI2ZmZiIvPjwvc3ZnPg==",u="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiIHZlcnNpb249IjEuMSI+PGNpcmNsZSBjeD0iOSIgY3k9IjkiIHI9IjUiIHN0cm9rZT0iI2ZmZiIgZmlsbD0iIzI5YjZmMiIvPjwvc3ZnPg==",v=22;function h(e){let{scale:t,editableLineMap:n,activeEditableLine:h,updateCurActiveEditableLine:f}=e;const{rootRef:g,movingCells:p,lineEditorState:m,setLineEditorState:y}=(0,l.s)(),w=(0,r.useRef)(null),x=(0,r.useRef)(null),E=(0,r.useRef)([]),k=(0,a._m)(h);(0,r.useEffect)((()=>{const e=w.current,t=x.current;if(!e||!t||!h)return;const n=e=>t=>{t.stopPropagation(),t.preventDefault();const n=g.current.getBoundingClientRect();y({offset:[n.left,n.top],from:[t.clientX,t.clientY],type:e}),null==f||f(h)},o=n("exit"),r=n("entry");return e.addEventListener("mousedown",o),t.addEventListener("mousedown",r),()=>{e.removeEventListener("mousedown",o),t.removeEventListener("mousedown",r)}}),[h,g,y,f]);const b=(0,r.useMemo)((()=>{var e;if(!h)return[];const t=n.get(h).points;return(0,a.jw)(null===(e=h.view)||void 0===e?void 0:e.type)?k?function(e){const t=[];let n=e[0],o=1;for(;o<e.length;){const r=e[o];t.push({type:"break",index:o-1,x:(n.x+r.x)/2,y:(n.y+r.y)/2}),o<e.length-1&&t.push({...r,type:"corner",index:o-1}),n=r,o++}return t}(t):[]:function(e){const t=[];let n=e[0],o=1;for(;o<e.length;){const r=e[o],i=n.y===r.y,l=n.x===r.x;if(!i||!l){const e=i?"ns":"ew";t.push({type:"control",direction:e,index:o-1,x:(n.x+r.x)/2,y:(n.y+r.y)/2})}n=r,o++}return t}(t)}),[h,n,k]);(0,r.useEffect)((()=>{if(!h)return;const e=E.current,t=b.map((e=>(e=>t=>{t.stopPropagation(),t.preventDefault(),null==f||f(h);const n=g.current.getBoundingClientRect();y({offset:[n.left,n.top],from:[t.clientX,t.clientY],type:e.type,control:e})})(e)));return e.forEach(((e,n)=>{null==e||e.addEventListener("mousedown",t[n])})),()=>{e.forEach(((e,n)=>{null==e||e.removeEventListener("mousedown",t[n])}))}}),[h,b,g,y,f]);const M=(0,r.useRef)(null);if((0,r.useEffect)((()=>{const e=M.current,t=e=>{e.stopPropagation(),e.preventDefault()};return null==e||e.addEventListener("click",t),()=>{null==e||e.removeEventListener("click",t)}}),[]),p)return null;const C=h.view,I=n.get(h).points,{exitPosition:L,entryPosition:S}=null!=C?C:{},N={width:v/t,height:v/t,preserveAspectRatio:"none",cursor:"pointer",pointerEvents:"fill"},z=I[0],P=I[I.length-1],R=v/t/2;return i().createElement("g",{ref:M},i().createElement("image",(0,o.A)({ref:w},N,{x:z.x-R,y:z.y-R,xlinkHref:k?u:L?d:c})),b.map(((e,t)=>i().createElement("image",(0,o.A)({key:t,ref:e=>{E.current[t]=e}},N,{x:e.x-R,y:e.y-R,opacity:"break"!==e.type||"break"===(null==m?void 0:m.type)&&m.control===e?1:.4,xlinkHref:u,cursor:k?"crosshair":"ns"===e.direction?"row-resize":"col-resize"})))),i().createElement("image",(0,o.A)({ref:x},N,{x:P.x-R,y:P.y-R,xlinkHref:k?s:S?d:c})))}},2219:(e,t,n)=>{function o(e,t){let{transform:n,offset:o,onLassoing:r,onLassoed:i}=t;if(e.ctrlKey||e.button)return;e.stopPropagation();const l=[e.clientX,e.clientY],a=(e.clientX-o[0]-n.x)/n.k,c=(e.clientY-o[1]-n.y)/n.k;let s=!1;const d=(e,t)=>{const o=function(e){return[(e.clientX-l[0])/n.k,(e.clientY-l[1])/n.k]}(e);if(s||(s=o[0]**2+o[1]**2>=9),s){let[e,n]=o,l=a,s=c;e<0&&(l=a+e,e=-e),n<0&&(s=c+n,n=-n),(t?i:r)({x:l,y:s,width:e,height:n})}},u=e=>{d(e)},v=e=>{d(e,!0),s=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",v)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",v)}n.d(t,{F:()=>o})},2717:(e,t,n)=>{n.d(t,{Gd:()=>u,XV:()=>s,YM:()=>d});var o=n(1030),r=n(531),i=n(9127),l=n(3820),a=n(9940),c=n(3033);const s=12;function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={},d=e.filter((e=>(0,r.dS)(e)&&(0,r.kN)(e.view)));if(!d.length)return{groupMap:n};const{nodeLayout:u="dagre"}=t,v=e.filter((e=>"node"===e.type)),h=e.filter(r.WW),f=new Map;d.forEach((e=>{f.set(e.id,e)}));const g={};return v.forEach((e=>{const{groupId:t}=e;t&&(n[t]||(n[t]=[],g[t]=new Set),n[t].push(e),g[t].add(e.id))})),h.forEach((e=>{for(const[t,o]of Object.entries(g))if(o.has(e.source)&&o.has(e.target)){n[t].push(e);break}})),function(e,t,n,d){let u=0;e.forEach((e=>{const v=n.get(e),h=t[e].filter((e=>"node"===e.type));u+=c.Yl;let f=[];if("dagre"===d){const{getNodeView:e}=(0,i.C)({cells:h});f=h.map((t=>{if((0,r.kN)(t.view)){const n=e(t.id);t.view={...t.view,x:n.x,y:n.y+u,width:n.width,height:n.height}}return t}))}else"staggered"===d&&(f=(0,l.l)(h,{offsetY:u}));const g=(0,a.x)(f,{padding:s});v.view={...v.view,...g},u+=(0,o.get)(g,"height",0)+50}))}((0,o.orderBy)(d.filter((e=>n[e.id])),[e=>(0,r.VF)(e.view)?1:0,e=>(0,o.get)(e,"view.level",1)],["asc","asc"]).map((e=>e.id)),n,f,u),{groupMap:n}}function u(e,t,n){let o=[];return"multi"===(null==t?void 0:t.type)?o=t.targets:"node"===(null==t?void 0:t.type)&&o.push(t),o.some((t=>{var o;return"node"===(null==t?void 0:t.type)&&(null===(o=n.find((e=>(0,r.N)(e)&&e.id===t.id)))||void 0===o?void 0:o.groupId)===e.id}))}},2722:(e,t,n)=>{n.d(t,{T:()=>h});var o=n(8769),r=n.n(o),i=n(9978),l=n(4197),a=n(3033),c=n(531);const s="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSI1cHgiIGhlaWdodD0iNXB4IiB2ZXJzaW9uPSIxLjEiPjxwYXRoIGQ9Im0gMCAwIEwgNSA1IE0gMCA1IEwgNSAwIiBzdHJva2Utd2lkdGg9IjIiIHN0eWxlPSJzdHJva2Utb3BhY2l0eTowLjQiIHN0cm9rZT0iI2ZmZmZmZiIvPjxwYXRoIGQ9Im0gMCAwIEwgNSA1IE0gMCA1IEwgNSAwIiBzdHJva2U9IiMyOWI2ZjIiLz48L3N2Zz4=",d=5,u=8,v=d/2;function h(e){let{activeTarget:t,editableLineMap:n,scale:s,activeEditableLine:d,disabled:v}=e;const{unsetHoverStateTimeoutRef:h,hoverState:g,setHoverState:p,smartConnectLineState:m,lineEditorState:y}=(0,i.s)(),w=(0,o.useCallback)((()=>{null!==h.current&&(clearTimeout(h.current),h.current=null)}),[h]),x=(0,o.useCallback)((()=>{w(),p((e=>void 0===(null==e?void 0:e.activePointIndex)?e:{...g,activePointIndex:void 0}))}),[g,p,w]),E=(0,o.useCallback)((()=>{h.current=setTimeout((()=>{p(null)}))}),[p,h]);let k,b,M;const C=!v&&g&&(!!m||(d&&y?(M=n.get(d))&&!!(0,c.om)(M)&&(({source:k,target:b}=M),"entry"===y.type?g.cell===b:"exit"===y.type&&g.cell===k):!(0,l.Q)(g.cell,t)&&!function(e){return e&&("edge"===e.type||"multi"===e.type&&e.targets.some((e=>"edge"===e.type)))}(t))),I=a.XK,L=I/2;return r().createElement("g",{onMouseEnter:x,onMouseLeave:E},C&&r().createElement(r().Fragment,null,r().createElement("rect",{x:g.cell.view.x-L,y:g.cell.view.y-L,width:g.cell.view.width+I,height:g.cell.view.height+I,fill:"none",stroke:"transparent",strokeWidth:2*u/s,pointerEvents:"stroke"}),void 0!==g.activePointIndex&&r().createElement("circle",{cx:g.points[g.activePointIndex].x,cy:g.points[g.activePointIndex].y,r:u/s,fill:"lightgreen",fillOpacity:.5,pointerEvents:"none"}),g.points.map(((e,t)=>r().createElement(f,{key:t,editableLineMap:n,index:t,point:e,scale:s,activeEditableLine:d,unsetActivePointIndex:x,unsetTimeout:w})))))}function f(e){let{editableLineMap:t,index:n,point:l,scale:a,activeEditableLine:c,unsetTimeout:h,unsetActivePointIndex:f}=e;const{rootRef:g,smartConnectLineState:p,hoverState:m,setHoverState:y,setSmartConnectLineState:w,onConnect:x,lineEditorState:E,setLineEditorState:k,onChangeEdgeView:b}=(0,i.s)(),M=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const e=M.current,t=o=>{"mousemove"===o.type&&(null==e||e.removeEventListener(o.type,t)),h(),y((e=>e&&e.activePointIndex!==n?{...m,activePointIndex:n}:e))};return null==e||e.addEventListener("mouseenter",t),null==e||e.addEventListener("mousemove",t),()=>{null==e||e.removeEventListener("mouseenter",t),null==e||e.removeEventListener("mousemove",t)}}),[m,n,y,h]),(0,o.useEffect)((()=>{if(E)return;const e=e=>{e.preventDefault(),e.stopPropagation();const t=g.current.getBoundingClientRect(),o=m.points[n];w({source:m.cell,from:[o.x,o.y],offset:[t.left,t.top],exitPosition:m.relativePoints[n]})},t=M.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[m,n,E,g,w]),(0,o.useEffect)((()=>{const e=e=>{if(!c||!E||"decorator"!==c.type)if(e.preventDefault(),e.stopPropagation(),p)p.source!==(null==m?void 0:m.cell)&&(null==x||x(p.source,m.cell,p.exitPosition,m.relativePoints[m.activePointIndex])),w(null);else if(c&&E){const e=m.relativePoints[m.activePointIndex],{type:n}=E,{source:o,target:r}=t.get(c),{view:i}=c;"entry"===n?null==b||b(o,r,{...i,entryPosition:e}):null==b||b(o,r,{...i,exitPosition:e}),k(null)}},n=M.current;return null==n||n.addEventListener("mouseup",e),()=>{null==n||n.removeEventListener("mouseup",e)}}),[p,m,x,w,c,E,t,b,k]),r().createElement("g",{ref:M,onMouseLeave:f},r().createElement("circle",{cx:l.x,cy:l.y,r:u,fill:"transparent"}),r().createElement("image",{x:l.x-v/a,y:l.y-v/a,width:d/a,height:d/a,xlinkHref:s,preserveAspectRatio:"none"}))}},2733:(e,t,n)=>{n.d(t,{a:()=>i});var o=n(8944),r=n(4197);function i(e,t){let{cells:n,activeTarget:i,lockedIds:l}=t;const a=n.filter((e=>(0,r.Q)(e,i)&&!(0,o.l)(e,l)));if(0!==a.length)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cells",cells:a}}}},2969:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(531),r=n(4197);function i(e,t,n,i){const l=[],a=[];for(const t of n)if((0,r.Q)(t,e)){var c;if((0,o.N)(t)&&t.containerId&&i.includes(t.containerId))continue;(null!==(c=t.view)&&void 0!==c&&c.locked?l:a).push(t)}let s=null;const d=[];return"unlock"!==t&&a.length>0?s=n.map((e=>{if(a.includes(e)){const t={...e,view:{...e.view,locked:!0}};return d.push(t),t}return e})):"lock"!==t&&l.length>0&&(s=n.map((e=>{if(l.includes(e)){const t={...e,view:{...e.view,locked:!1}};return d.push(t),t}return e}))),{newCells:s,updates:d}}},3012:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),r=n.n(o),i=n(935),l=n.n(i)()(r());l.push([e.id,"*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden;--animation-dasharray:48;--stroke-dashedoffset:96;--stroke-dottedoffset:24;--dasharray:4;--dotted:1;--area-bg-color:rgba(119,141,195,0.1)}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}@keyframes solidAnimation{to{stroke-dashoffset:0}}@keyframes dashedAnimation{0%{stroke-dashoffset:var(--stroke-dashedoffset)}to{stroke-dashoffset:0}}@keyframes dottedAnimation{0%{stroke-dashoffset:var(--stroke-dottedoffset)}to{stroke-dashoffset:0}}.solid-animation{stroke-dasharray:var(--solid-length);stroke-dashoffset:var(--solid-length);animation:solidAnimation var(--time) linear infinite}.dashed-animation{animation:dashedAnimation var(--time) linear infinite}.dotted-animation{animation:dottedAnimation var(--time) linear infinite}.decorator-area .area,\n.container-wrapper .container{background-color:var(--area-bg-color);border:1px solid transparent}.decorator-text .text-container{border:1px solid transparent}.decorator-rect-container .rect-container{border:1px solid rgba(73,126,255,0.7)}.decorator-group{position:relative}.decorator-group .lock-icon,.decorator-group .plus-wrapper,.decorator-group .plus-icon{opacity:0}.decorator-group .plus-icon{cursor:pointer}.decorator-group .plus-icon:hover{color:rgba(33,212,243,1)}.decorator-group.active-group:not(.does-not-exist) .group,.cell.active .decorator-group .group{border:1px dashed rgba(33,212,243,1)}.decorator-group.active-group:not(.does-not-exist) .resize-handle,.cell.active .decorator-group .resize-handle,.decorator-group.active-group:not(.does-not-exist) .lock-icon,.cell.active .decorator-group .lock-icon,.decorator-group.active-group:not(.does-not-exist) .plus-wrapper,.cell.active .decorator-group .plus-wrapper,.decorator-group.active-group:not(.does-not-exist) .plus-icon,.cell.active .decorator-group .plus-icon{opacity:1}.cell:has(.decorator-group.active-group){opacity:1}.cell.active .decorator-area .area,\n.cell.active .decorator-rect-container .rect-container,\n.cell.active .decorator-text .text-container,\n.cell.active .container-wrapper .container,\n.cell.active .group-wrapper .group,\n.container-dragover .decorator-container .container{border-style:dashed;border-color:rgba(73,126,255,0.7)}.node,\n.container-wrapper{overflow:visible}.decorator-text,\n.decorator-rect,\n.decorator-area{overflow:visible;pointer-events:none}.lock-icon,\n.decorator-text > *,\n.decorator-rect > *,\n.decorator-area > *{pointer-events:auto}.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:var(--dasharray);stroke-width:1}.cell:not(.read-only){-webkit-user-select:none;user-select:none}.resize-handle{cursor:nwse-resize;opacity:0}.resize-handle rect{fill:transparent;stroke:none}.resize-handle path{fill:none;stroke:var(--palette-gray-5);stroke-width:1.5}.decorator-area-container:hover .resize-handle,\n.decorator-rect-container:hover .resize-handle,\n.decorator-container:hover .resize-handle{opacity:1}.connect-line{pointer-events:none}.connect-line:not(.connecting){display:none}.editing-line{pointer-events:none;stroke-dasharray:var(--dasharray);stroke-width:1}.editing-line:not(.editing){display:none}.line.dashed{stroke-dasharray:var(--dasharray)}.line.dotted{stroke-dasharray:var(--dotted)}.decorator-text .text-container{width:max-content;padding:0.5em;white-space:pre}.cell:not(.read-only) .decorator-text .text-container:hover{color:#497eff}.decorator-text .text:focus{outline:none}.cell.faded{opacity:0.3}.cell.container-dragover{opacity:1}.cell .node{pointer-events:none}.cell .node > *{position:fixed;pointer-events:auto}.degraded{pointer-events:bounding-box}.degraded circle{fill:rgb(119,141,195)}.degraded text{text-anchor:middle;fill:var(--antd-text-color)}.cell.active .degraded circle,\n.cell.active .degraded text,\n.degraded:hover circle,\n.degraded:hover text{fill:var(--color-brand)}.decorator-container{--defaultSize:24px}.decorator-container .text-container{display:flex;align-items:center;justify-content:center;padding:0.5em;text-align:center;font-size:16px;color:#262626;background-color:rgba(119,141,195,0.25);overflow:hidden}.decorator-container .horizontal{height:max-content;width:100%}.decorator-container .horizontal .text{min-height:var(--defaultSize)}.decorator-container .vertical{width:max-content;height:100%;writing-mode:vertical-lr;-webkit-text-orientation:upright;text-orientation:upright;letter-spacing:4px}.decorator-container .vertical .text{min-width:var(--defaultSize)}.line-label-container{overflow:visible;opacity:0}.line-label-container.ready{opacity:1}.line-label{position:absolute;display:block;transform:translate(-50%,-50%);white-space:pre-line;width:max-content;text-align:center}.line-label.text{font-size:11px;color:var(--color-secondary-text);font-weight:400;line-height:1.63636364}.motion:not(.visible){opacity:0}",""]);const a=l.toString()},3033:(e,t,n)=>{n.d(t,{Be:()=>y,CE:()=>f,CV:()=>o,D9:()=>a,Dm:()=>l,Go:()=>S,HP:()=>i,Ie:()=>g,Jo:()=>I,N8:()=>c,Ub:()=>m,VO:()=>h,XK:()=>M,XV:()=>p,Yl:()=>L,Yt:()=>u,gx:()=>x,ld:()=>E,mF:()=>v,o5:()=>k,p6:()=>b,pC:()=>w,rn:()=>C,sS:()=>d,w1:()=>s,xc:()=>r});const o=Symbol.for("size-initialized"),r=Symbol.for("layout-initialized"),i=20,l=36,a=50,c=180,s=120,d=.5,u=2,v="gray",h=1,f="rgba(73, 126, 255, 0.7)",g=15,p=!1,m=!0,y=1,w=500,x=10,E=5,k="all",b=5,M=0,C=0,I=50,L=40,S=12},3371:(e,t,n)=>{n.d(t,{L:()=>m});var o=n(1030),r=n(3033),i=n(531),l=n(3783),a=n(4282),c=n(1489),s=n(6170),d=n(9127),u=n(8185),v=n(9940),h=n(2717);function f(e,t,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;const{x:l,y:a,width:c}=e,s=n+r,d=o+r,u=Math.max(Math.floor((c-2*i)/s),1);let v=0;for(;;){for(let e=0;e<u;e++){const r=l+i+e*s,c=a+i+v*d;if(!t.some((e=>g(r,c,n,o,e.x,e.y,n,o))))return{x:r,y:c}}v++}}function g(e,t,n,o,r,i,l,a){const c=e+n/2,s=t+o/2,d=r+l/2,u=i+a/2,v=(n+l)/2,h=(o+a)/2;return Math.abs(c-d)<v&&Math.abs(s-u)<h}var p=n(9617);function m(e){let{cells:t,layout:n,previousCells:g,defaultNodeSize:m,canvasWidth:y,canvasHeight:w,scaleRange:x,transform:E,reason:k,parent:b,allowEdgeToArea:M,layoutOptions:C}=e;const I="force"!==n&&"dagre"!==n,L=(0,l.C)(t,{defaultNodeSize:m,layoutOptions:C,isInitialize:!1}),S=[];let N=!1;const z=new Map;let P=!1;for(const e of g)(0,i.mH)(e)?P=!0:(0,i.N)(e)&&(P=!0,e[r.CV]&&z.set(e.id,e));const R=new Map;for(const e of L)if((0,i.N)(e)){R.set(e.id,e);const t=z.get(e.id);t&&(e.view.width=t.view.width,e.view.height=t.view.height,e[r.CV]=!0)}let A=!1;if("add-related-nodes"===k&&b){const e=new Set;for(const t of L)(0,i.WW)(t)&&t.source===b&&t.target!==b&&e.add(t.target);const t=R.get(b);if(void 0!==(null==t?void 0:t.view.x)&&void 0!==t.view.y){if(A=!0,I)for(const t of L)((0,i.N)(t)&&void 0===t.view.x||(0,i.N)(t)&&void 0===t.view.y)&&e.add(t.id);const n=[...e].map((e=>R.get(e))).filter(Boolean);let o;for(const e of n)void 0!==e.view.x&&void 0!==e.view.y?(!o||e.view.x>o.view.x)&&e.view.y>t.view.y&&(o=e):S.push(e);if(S.length>0&&I){let e,n;if(o)e=o.view.x+o.view.width+r.Dm,n=o.view.y;else{const o=S.reduce(((e,t)=>e+t.view.width+r.Dm),-r.Dm);e=t.view.x-o/2+t.view.width/2,n=t.view.y+t.view.height+r.D9}for(const t of S)t.view.x=e,t.view.y=n,e+=t.view.width+r.Dm}}}if(!A){const e=[];let t=!1;for(const n of L)(0,i.N)(n)?(0,i.kN)(n.view)?S.push(n):e.push(n):(0,i.mH)(n)&&(t=!0);if(I){let n;P||(E=function(e,t){const n=(0,a.S)(e);return(0,c.P)(n,t)}((0,o.without)(L,...S),{canvasWidth:y,canvasHeight:w,scaleRange:x})),0===e.length||1===e.length&&!t&&S.length>0?(S.push(...e),({getNodeView:n}=(0,d.C)({cells:L,allowEdgeToArea:M})),N=0===g.length||g.length===L.length&&g.every(((e,t)=>(0,u.c)(e,L[t])))):({getNodeView:n}=(0,s.k)({cells:L,fixedPosition:!0,allowEdgeToArea:M,center:[(y/2-E.x)/E.k,(w/2-E.y)/E.k]}));const l=[...L.filter((e=>(0,i.t2)(e)&&(0,i.VF)(e.view))),...L.filter((e=>(0,i.dS)(e)&&(0,i.VF)(e.view)))],k="layered-staggered"===(0,o.get)(C,"initialLayout")?"staggered":"dagre";l.length>0?((0,p.a)(L,{nodeLayout:k}),S.push(...l)):function(e,t){let{defaultNodeSize:n}=t;const l=e.filter((e=>"node"===e.type&&(0,i.kN)(e.view)&&!(0,o.isNil)(e.containerId))),a=e.filter((e=>"node"===e.type&&(0,i.kN)(e.view)&&!(0,o.isNil)(e.groupId)));if(a.length){const t={};(0,o.forEach)((0,o.groupBy)(a,"groupId"),((e,n)=>{t[n]=e})),e.filter((e=>(0,i.dS)(e)&&t[e.id])).forEach((o=>{const l=o.id,a=t[l],c=(0,i.kN)(o.view)?(0,v.x)(e.filter((e=>"node"===e.type&&e.groupId===l)),{padding:h.XV}):o.view,s=e.filter((e=>(null==e?void 0:e.groupId)===l&&!(0,i.kN)(e.view))).map((e=>({x:e.view.x,y:e.view.y})));a.forEach((e=>{var t,o;const i=(null===(t=e.view)||void 0===t?void 0:t.width)||n[0],l=(null===(o=e.view)||void 0===o?void 0:o.height)||n[1],a=r.Yl,d=f(c,s,i,l,10,a);d&&(e.view={...e.view,x:d.x,y:d.y},s.push(d))}))}))}if(l.length){const t={};(0,o.forEach)((0,o.groupBy)(l,"containerId"),((e,n)=>{t[n]=e})),e.filter((e=>(0,i.t2)(e)&&t[e.id])).forEach((o=>{const l=o.id,a=o.view,c=e.filter((e=>(null==e?void 0:e.containerId)===l&&!(0,i.kN)(e.view))).map((e=>({x:e.view.x,y:e.view.y})));t[l].forEach((e=>{var t,o;const i=(null===(t=e.view)||void 0===t?void 0:t.width)||n[0],l=(null===(o=e.view)||void 0===o?void 0:o.height)||n[1],s=r.Yl,d=f(a,c,i,l,10,s);d&&(e.view={...e.view,x:d.x,y:d.y},c.push(d))}))}))}}(L,{defaultNodeSize:m});for(const e of L)if((0,i.N)(e)&&(0,i.kN)(e.view)){const t=n(e.id);e.view.x=t.x,e.view.y=t.y}}}return{cells:L,updated:S,shouldReCenter:N}}},3639:(e,t,n)=>{n.d(t,{w:()=>a});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i);function a(e){let{connectLineState:t,transform:n,markerEnd:i,onConnect:a}=e;const[c,s]=(0,o.useState)(null);return(0,o.useEffect)((()=>{t&&s(t.from)}),[t]),(0,o.useEffect)((()=>{if(t){const e=e=>[(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k],o=t=>{s(e(t))},r=e=>{e.stopPropagation()},i=n=>{n.stopPropagation(),l(),a(t,e(n))},l=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mousedown",r,{capture:!0}),document.removeEventListener("click",i,{capture:!0}),s(null)};return document.addEventListener("mousemove",o),document.addEventListener("mousedown",r,{capture:!0}),document.addEventListener("click",i,{capture:!0}),l}}),[t,a,n]),r().createElement("path",{className:l()("connect-line",{connecting:!!t&&c&&(c[0]-t.from[0])**2+(c[1]-t.from[1])**2>25}),d:t&&c?`M${t.from.join(" ")}L${c.join(" ")}`:"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:`url(#${i})`})}},3783:(e,t,n)=>{n.d(t,{C:()=>l});var o=n(1030),r=n(531),i=n(9617);function l(e,t){let{defaultNodeSize:n,layoutOptions:l,isInitialize:a}=t;const c=null!=e?e:[];return a&&("layered-architecture"===(0,o.get)(l,"initialLayout")?(0,i.a)(c,{nodeLayout:"dagre"}):"layered-staggered"===(0,o.get)(l,"initialLayout")&&(0,i.a)(c,{nodeLayout:"staggered"})),c.map((e=>{var t,o;return!(0,r.vC)(e)||void 0!==(null===(t=e.view)||void 0===t?void 0:t.width)&&void 0!==(null===(o=e.view)||void 0===o?void 0:o.height)?e:{...e,view:{width:n[0],height:n[1],...e.view}}}))}},3820:(e,t,n)=>{n.d(t,{l:()=>l});var o=n(1030),r=n(3033),i=n(531);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{gapX:n=50,gapY:l=50,offsetY:a=r.Yl,maxPerRow:c=r.Go}=t,s=c,d=c-1,u=[];let v=0,h=0,f=a;for(;v<e.length;){const t=h%2==1,a=t?d:s;let c=t?r.Yl:0,g=0;for(let t=0;t<a&&v<e.length;t++,v++){const t=e[v],l=(0,o.get)(t,"view.width",r.HP),a=(0,o.get)(t,"view.height",r.HP),s=c,d=f;(0,i.kN)(e[v].view)&&(e[v].view={...e[v].view,x:s,y:d,width:l,height:a}),c=s+(l+n),g=Math.max(g,a),u.push(e[v])}f=f+g+l,h++}return u}},4117:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(8769),r=n(531);function i(e,t){return e.find((e=>(0,r.o6)(e)&&e.id===t))}var l=n(967),a=n(1030),c=n(4525);const s=6;function d(e,t,n,o,r){const i=(0,c.y)([e.x,e.y],[t.x,t.y],[n.x,n.y],[o.x,o.y]);if(i){const l=r*r;for(const r of[e,t,n,o]){const e=i[0]-r.x,t=i[1]-r.y;if(e*e+t*t<l)return null}return{x:i[0],y:i[1]}}return null}function u(e){let{cells:t,lineConfMap:n}=e;return(0,o.useMemo)((()=>{const e=new WeakMap,o=function(){const e=[],t=[];return function(n,o){const r=[],i=[];if("curve"!==o.type||"curveLinear"===o.curveType){for(let l=0;l<n.length-1;l++){const c=n[l],u=n[l+1],v=[],h=s/2+o.strokeWidth-1;if(o.jumps)e:for(const n of t){const t=d(c,u,n.start,n.end,h);if(t){for(const n of e)for(const e of n.jumpPoints)if(Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))<h+n.radius)continue e;v.push(t)}}if(v.length>0){const t={jumpPoints:(0,a.sortBy)(v,(e=>(e.x-n[0].x)**2+(e.y-n[0].y)**2)),index:l,radius:h};e.push(t),r.push(t)}i.push({start:c,end:u})}t.push(...i)}return r.length>0?new Map(r.map((e=>[e.index,e]))):null}}();for(const a of t)if((0,r.WW)(a)){var c;const s=n.get(a);if(!s)continue;const d=i(t,a.source),u=i(t,a.target),v=(0,r.jw)(null===(c=a.view)||void 0===c?void 0:c.type)&&t.some((e=>{var t;return(0,r.WW)(e)&&a.source===e.target&&a.target===e.source&&(0,r.jw)(null===(t=e.view)||void 0===t?void 0:t.type)}))?s.parallelGap:0,h=d&&u&&null!=d.view.x&&null!=u.view.x?(0,l.V)(d.view,u.view,a.view,v,a.type):null;if(h){const t=o(h,s);e.set(a,{edge:a,points:h,source:d,target:u,parallelGap:v,jumpsMap:t})}}else if((0,r._m)(a)){const t=n.get(a);if(!t)continue;const{source:r,target:i}=a.view,c=r&&i?(0,l.V)({...r,width:0,height:0},{...i,width:0,height:0},a.view,0,a.type):null;if(c){const n=o(c,t);e.set(a,{decorator:a,points:c,parallelGap:0,jumpsMap:n})}}return e}),[t,n])}},4197:(e,t,n)=>{n.d(t,{Q:()=>r});var o=n(8185);function r(e,t){return!!t&&("multi"===t.type?t.targets:[t]).some((t=>(0,o.c)(t,e)))}},4282:(e,t,n)=>{n.d(t,{S:()=>r});var o=n(531);function r(e){const t=[];let n=!0;for(const r of e)(0,o.WW)(r)||(n=!1,t.push(r.view));const{x:r,y:i,width:l,height:a}=function(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(const i of e){const e=i.x+i.width,l=i.y+i.height;i.x<t&&(t=i.x),e>o&&(o=e),i.y<n&&(n=i.y),l>r&&(r=l)}return{x:t,y:n,width:o-t,height:r-n}}(t);return{left:r,top:i,width:l,height:a,empty:n}}},5748:(e,t,n)=>{n.d(t,{d:()=>d});var o=n(1030),r=n(531),i=n(3033);const l=[{type:"decorator",decorators:["line","area","container","rect"]},{type:"edge"},{type:"node"},{type:"decorator",decorators:["text"]}];function a(e,t){return c(e,[t])}function c(e,t){if(0===t.length)return e;const n=l.findIndex((e=>s(t[0],e)));-1===n&&console.warn("Default order index unhandled for the cell: %o.\n%s",t[0],"This is a bug of diagram-NB, please report it.");const o=e.findLastIndex((e=>l.findIndex((t=>s(e,t)))<=n))+1;return[...e.slice(0,o),...t,...e.slice(o)]}function s(e,t){return e.type===t.type&&("decorator"!==t.type||t.decorators.includes(e.decorator))}const d=(u={cells:(e,t)=>{switch(t.type){case"drop-node":case"drop-decorator":return a(e,t.payload);case"add-nodes":return c(e,t.payload);case"add-edge":{const n=e.findIndex((e=>"edge"===e.type&&e.source===t.payload.source&&e.target===t.payload.target));return-1===n?a(e,t.payload):[...e.slice(0,n),t.payload,...e.slice(n+1)]}case"change-edge-view":{const n=e.findIndex((e=>"edge"===e.type&&e.source===t.payload.source&&e.target===t.payload.target));return-1===n?e:[...e.slice(0,n),{...e[n],view:t.payload.view},...e.slice(n+1)]}case"change-decorator-view":{const n=e.findIndex((e=>"decorator"===e.type&&e.id===t.payload.id));return-1===n?e:[...e.slice(0,n),{...e[n],view:t.payload.view},...e.slice(n+1)]}case"move-cells":{let n=!1;const r=e.map((e=>{const r=t.payload.find((t=>e.type===t.type&&e.id===t.id));return r?(n=!0,{...e,view:{...e.view,x:r.x,y:r.y,...(0,o.pick)(r,"source","target","vertices")}}):e}));return n?r:e}case"resize-cell":{const{type:n,id:o,width:r,height:i}=t.payload,l=e.findIndex((e=>e.type===n&&e.id===o));if(-1!==l){const t=e[l];return[...e.slice(0,l),{...t,view:{...t.view,width:r,height:i}},...e.slice(l+1)]}return e}case"update-cells":return t.payload;case"update-node-size":return e.map((e=>(0,r.N)(e)&&e.id===t.payload.id?{...e,[i.CV]:!0,view:t.payload.size?{...e.view,width:t.payload.size[0],height:t.payload.size[1]}:e.view}:e))}return e},layoutKey:(e,t)=>"update-node-size"===t.type?t.layoutKey:e},(e,t)=>Object.fromEntries(Object.entries(u).map((n=>{let[o,r]=n;return[o,r(e[o],t)]}))));var u},6170:(e,t,n)=>{n.d(t,{k:()=>v});var o=n(1030),r=n(6149),i=n(4842),l=n(1945),a=n(9418),c=n(3854),s=n(7931),d=n(531),u=n(8802);function v(e){let{cells:t,layoutOptions:n,center:v,fixedPosition:h,allowEdgeToArea:f}=e;const{nodePadding:g,collide:p}={nodePadding:0,...(0,o.pick)(n,["nodePadding"]),collide:!1!==(null==n?void 0:n.collide)&&{radiusDiff:18,strength:1,iterations:1,...!0===(null==n?void 0:n.collide)?null:null==n?void 0:n.collide}},m=(0,u.D)(g),y=[],w=[],x=new Map;for(const e of t)if(f&&(0,d.o6)(e)||(0,d.N)(e)){const t={id:e.id,width:e.view.width+m[1]+m[3],height:e.view.height+m[0]+m[2],...h?{fx:e.view.x,fy:e.view.y}:null};y.push(t),x.set(t.id,t)}else(0,d.WW)(e)&&w.push({source:e.source,target:e.target});const E=(0,r.A)(w).id((e=>e.id)),k=(0,i.A)(y).force("link",E).force("x",(0,l.A)(null==v?void 0:v[0])).force("y",(0,a.A)(null==v?void 0:v[1])).force("charge",(0,c.A)());return p&&k.force("collide",(0,s.A)().radius((e=>Math.sqrt(e.width**2+e.height**2)/2+p.radiusDiff)).strength(p.strength).iterations(p.iterations)),k.stop(),function(e){e.tick(Math.ceil(Math.log(e.alphaMin())/Math.log(1-e.alphaDecay())))}(k),{getNodeView:e=>x.get(e),nodePaddings:m}}},6237:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),r=n.n(o),i=n(935),l=n.n(i)()(r());l.push([e.id,'.zoom-bar{position:absolute;bottom:20px;right:20px;width:40px;scale:0.8}.zoom-slider,\n.center-button{width:100%;display:flex;align-items:center;border:1px solid var(--antd-background-color-base);border-radius:var(--larger-border-radius);box-shadow:var(--connected-overlay-shadow);background-color:var(--color-fill-bg-container-4)}.zoom-slider{height:140px;padding:8px 0;flex-direction:column}[role="button"]{cursor:pointer}.center-button{justify-content:center;margin-bottom:8px;height:40px}.center-button:hover{border-color:var(--antd-btn-default-hover-border-color)}.center-button path{fill:var(--antd-link-hover-color)}.center-button:hover path{fill:var(--palette-blue-7)}.zoom-button{font-size:16px;line-height:0}.zoom-button svg{width:1em;height:1em;fill:var(--antd-link-hover-color)}.zoom-slider .ant-slider-vertical{padding-left:5px;padding-right:5px}.zoom-slider .ant-slider-vertical .ant-slider-rail{width:2px}.zoom-slider .ant-slider-vertical .ant-slider-handle{width:6px;height:6px;left:3px}.zoom-slider .ant-slider .ant-slider-handle:hover::before,\n.zoom-slider .ant-slider .ant-slider-handle:focus::before,\n.zoom-slider .ant-slider .ant-slider-handle::before{width:10px;height:10px;left:-2px}.zoom-slider .ant-slider .ant-slider-handle:hover::after,\n.zoom-slider .ant-slider .ant-slider-handle:focus::after,\n.zoom-slider .ant-slider .ant-slider-handle::after{width:6px;height:6px;top:0;left:0}',""]);const a=l.toString()},7099:(e,t,n)=>{n.d(t,{Y:()=>f});var o=n(8769),r=n.n(o),i=n(1895),l=n(6768),a=n(6313),c=n(5694),s=n(4273),d=n(9575);const u=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),o.createElement("path",{d:"M12 0a.5.5 0 0 1 .5.5v2.013a9.5 9.5 0 0 1 8.987 8.988L23.5 11.5a.5.5 0 0 1 0 1h-2.013a9.5 9.5 0 0 1-8.987 8.987V23.5a.5.5 0 0 1-1 0v-2.013A9.5 9.5 0 0 1 2.514 12.5H.5a.5.5 0 0 1 0-1h2.013A9.5 9.5 0 0 1 11.5 2.514V.5A.5.5 0 0 1 12 0M3.514 11.5H7.5a.5.5 0 0 1 0 1H3.514a8.5 8.5 0 0 0 7.987 7.986L11.5 16.5a.5.5 0 0 1 1 0v3.986a8.5 8.5 0 0 0 7.986-7.986H16.5a.5.5 0 0 1 0-1h3.986A8.5 8.5 0 0 0 12.5 3.515V7.5a.5.5 0 0 1-1 0V3.514a8.5 8.5 0 0 0-7.986 7.987zm8.486-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3"})),v=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),o.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),o.createElement("path",{d:"M744.448 486.4h-204.8V281.6a25.6 25.6 0 1 0-51.2 0v204.8h-204.8a25.6 25.6 0 0 0 0 51.2h204.8v204.8a25.6 25.6 0 0 0 51.2 0V537.6h204.8a25.6 25.6 0 0 0 0-51.2"})),h=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),o.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),o.createElement("path",{d:"M744.448 486.4H280.064a25.6 25.6 0 1 0 0 51.2h464.384a25.6 25.6 0 0 0 0-51.2"}));function f(e){let{shadowRoot:t,scale:n,scaleRange:d,onZoomChange:f,onReCenter:g}=e;const p=(0,s.useCurrentTheme)(),m=(0,o.useMemo)((()=>(0,c.VC)()),[]),y=(0,o.useRef)(null),w=100*d[0],x=100*d[1],E=100*n,k=(0,o.useMemo)((()=>({formatter:e=>`${e}%`,placement:"left",getPopupContainer:()=>y.current})),[]),b=(0,o.useCallback)((()=>{f(Math.min(E+5,x))}),[x,f,E]),M=(0,o.useCallback)((()=>{f(Math.max(E-5,w))}),[w,f,E]);return r().createElement(i.Ay,{theme:{algorithm:"dark-v2"===p?l.A.darkAlgorithm:l.A.defaultAlgorithm}},r().createElement(c.N7,{container:t,autoClear:!0,cache:m,hashPriority:"high"},r().createElement("div",{className:"zoom-bar",ref:y},r().createElement("div",{className:"center-button",onClick:g,role:"button"},r().createElement(u,null)),r().createElement("div",{className:"zoom-slider"},r().createElement("div",{className:"zoom-button",role:"button",onClick:b},r().createElement(v,null)),r().createElement(a.A,{min:w,max:x,value:E,step:5,vertical:!0,included:!1,tooltip:k,onChange:f}),r().createElement("div",{className:"zoom-button",role:"button",onClick:M},r().createElement(h,null))))))}},7531:(e,t,n)=>{n.d(t,{I:()=>d,d:()=>c});var o=n(8769),r=n(3081),i=n(1030),l=n(531),a=n(3033);function c(e){let{cells:t,defaultEdgeLines:n,markerPrefix:c,lineConnector:h,useMemoizedResult:f}=e;const g=(0,o.useRef)(null);return(0,o.useMemo)((()=>{if(f&&g.current)return g.current;const e=[{strokeColor:a.mF,markerType:"arrow"}];let o=null;if(h){o={...v(),editingStrokeColor:"var(--palette-blue-5)",...(0,i.omitBy)(!0===h?{}:h,i.isUndefined)};const t=d(o);for(const n of t){const{placement:t,type:r}=n,i=null!=r?r:"arrow",l=u({strokeColor:o.strokeColor,markerType:i},e),a=u({strokeColor:o.editingStrokeColor,markerType:i},e);"start"===t?(o.$markerStartUrl=`url(#${c}${l})`,o.$editingStartMarkerUrl=`url(#${c}${a})`):(o.$markerEndUrl=`url(#${c}${l})`,o.$editingEndMarkerUrl=`url(#${c}${a})`)}}const p=new WeakMap;for(const o of t){const t=(0,l.WW)(o),h=(0,l._m)(o);let f;if(t){var m,y;const e=null!==(m=Array.isArray(n)?s(n.find((e=>(0,r.checkIfByTransform)(e,{edge:o}))),o):null===(y=r.__secret_internals.legacyDoTransform({edge:o},n))||void 0===y?void 0:y.find((e=>(0,r.checkIfOfComputed)(e))))&&void 0!==m?m:{};f={...v(),...(0,i.omitBy)(e,i.isUndefined),...(0,i.omitBy)(o.view,i.isUndefined)},void 0===f.parallelGap&&(f.parallelGap=f.interactStrokeWidth)}else f={...v(),showEndArrow:!1,strokeColor:a.CE,...(0,i.omitBy)(o.view,i.isUndefined)};if(t||h){const n=d(f);for(const o of n){var w;const{placement:n,type:r}=o,i=null!=r?r:"arrow",l=u({strokeColor:f.strokeColor,markerType:i},e);"start"===n?f.$markerStartUrl=`url(#${c}${l})`:f.$markerEndUrl=`url(#${c}${l})`;const a=null===(w=f.overrides)||void 0===w||null===(w=w.active)||void 0===w?void 0:w.strokeColor;if(a&&a!==f.strokeColor){const t=u({strokeColor:a,markerType:i},e);"start"===n?f.$activeMarkerStartUrl=`url(#${c}${t})`:f.$activeMarkerEndUrl=`url(#${c}${t})`}if(t){var x;const t=null===(x=f.overrides)||void 0===x||null===(x=x.activeRelated)||void 0===x?void 0:x.strokeColor;if(t&&t!==f.strokeColor){const o=u({strokeColor:t,markerType:i},e);"start"===n?f.$activeRelatedMarkerStartUrl=`url(#${c}${o})`:f.$activeRelatedMarkerEndUrl=`url(#${c}${o})`}}}p.set(o,f)}}return g.current={lineConfMap:p,lineConnectorConf:o,markers:e}}),[t,n,h,c,f])}function s(e,t){var n;if(null!=e&&null!==(n=e.label)&&void 0!==n&&n.useBrick){const{label:{useBrick:n,...o},...i}=e,l=r.__secret_internals.legacyDoTransform({edge:t},{...i,label:o});return{...l,label:{...l.label,useBrick:n}}}return r.__secret_internals.legacyDoTransform({edge:t},e)}function d(e){let t=[];return e.markers?t=e.markers:(e.showStartArrow&&t.push({type:"arrow",placement:"start"}),e.showEndArrow&&t.push({type:"arrow",placement:"end"})),t}function u(e,t){let n=(0,i.findIndex)(t,e);return-1===n&&(n=t.push(e)-1),n}function v(){return{type:"straight",dashed:!1,strokeColor:a.mF,strokeWidth:a.VO,interactStrokeWidth:a.Ie,showStartArrow:a.XV,showEndArrow:a.Ub,animate:{useAnimate:!1,duration:a.Be},jumps:!1}}},7590:(e,t,n)=>{n.d(t,{m:()=>$});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i),a=n(531),c=n(1030),s=n(9126),d=n(3033),u=n(8653),v=n(7531),h=n(3081),f=n(4273);function g(e){let{edge:t,position:n,offset:o,label:i,text:a,onRendered:c,onClick:s}=e;if(!i&&!a)return null;const d=!(!n||!o);return r().createElement("foreignObject",{className:l()("line-label-container",{ready:d}),x:d?n[0]+o[0]:0,y:d?n[1]+o[1]:0,onClick:s},i?r().createElement("div",{className:"line-label label"},r().createElement(m,{edge:t,label:i,onRendered:c})):r().createElement(p,{text:a,onRendered:c}))}function p(e){let{text:t,onRendered:n}=e;const i=(0,o.useCallback)((e=>{null==n||n(e)}),[n]);return r().createElement("div",{className:"line-label text",ref:i,style:t.style},t.content)}function m(e){let{edge:t,label:n,onRendered:i}=e;const l=(0,o.useMemo)((()=>(0,h.checkIfOfComputed)(n)?n.useBrick:null),[n]),a=(0,o.useMemo)((()=>({edge:t})),[t]);(0,o.useEffect)((()=>{l||setTimeout((()=>{null==i||i(null)}))}),[i,l]),(0,o.useEffect)((()=>()=>{null==i||i(null)}),[]);const c=(0,o.useCallback)((e=>{e&&setTimeout((()=>{null==i||i(e.parentElement)}))}),[i]),s=(0,o.useCallback)((()=>{setTimeout((()=>{null==i||i(null)}))}),[i]);return l?r().createElement(f.ReactUseBrick,{refCallback:c,ignoredCallback:s,useBrick:l,data:a}):null}var y=n(9386);function w(e){var t,n,i,a,h,f,p;let{edge:m,lineConfMap:w,editableLineMap:x,readOnly:E,active:k,activeRelated:b,onSwitchActiveTarget:M}=e;const C=(0,o.useRef)(null),I=w.get(m),{points:L,jumpsMap:S}=null!==(t=x.get(m))&&void 0!==t?t:{},N=(0,o.useMemo)((()=>(0,u.S)(L,"curve"===I.type?I.curveType:"curveLinear",0,1,S)),[I,L,S]),z=(0,o.useMemo)((()=>(0,c.uniqueId)("line-mask-")),[]),[P,R]=(0,o.useState)(null),[A,T]=(0,o.useState)(null),[H,W]=(0,o.useState)(null),D=(0,o.useCallback)((()=>{const e=C.current,{label:t,text:n}=I;if(e&&L&&(t||n)){var o,r;const i=null!==(o=t?t.placement:n.placement)&&void 0!==o?o:"center",l=null!==(r=t?t.offset:n.offset)&&void 0!==r?r:0,a=e.getTotalLength(),c=a/2,s=e.getPointAtLength("start"===i?0:"end"===i?a:c+l);let d="center",u=0;if("start"===i||"end"===i){let e,t;"start"===i?(e=L[0],t=L[1]):(e=L[L.length-1],t=L[L.length-2]),u=Math.atan2(t.y-e.y,t.x-e.x),d=Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?e.x>t.x?"left":"right":e.y>t.y?"top":"bottom"}R([s.x,s.y,d,u,l]);const v=e.getBBox();W({x:v.x-1e3,y:v.y-1e3,width:v.width+2e3,height:v.height+2e3})}}),[I,L]),[j,B]=(0,o.useState)(null),$=(0,o.useCallback)((e=>{if(C.current=e,e){var t,n,o;B(null!==(t=null===(n=e.getTotalLength)||void 0===n?void 0:n.call(e))&&void 0!==t?t:100);const r=null===(o=e.getBBox)||void 0===o?void 0:o.call(e);m.view={...m.view,x:null==r?void 0:r.x,y:null==r?void 0:r.y,width:null==r?void 0:r.width,height:null==r?void 0:r.height}}D()}),[D,m]),[Z,O]=(0,o.useState)(null);(0,o.useEffect)((()=>{if(!Z)return void T(null);const e=new s.A((()=>{const{offsetWidth:e,offsetHeight:t}=Z;T(0!==e&&0!==t?[e,t]:null)}));return e.observe(Z),()=>{e.disconnect()}}),[Z]);const V=(0,o.useCallback)((e=>{O(e)}),[]);(0,o.useEffect)((()=>{D()}),[D,L]);const U=(0,o.useCallback)((()=>{null==M||M((0,y.P)(m))}),[m,M]),G=(0,o.useCallback)((e=>{var t,n;!E&&I.callLabelOnDoubleClick&&(e.preventDefault(),e.stopPropagation(),null==Z||null===(t=Z.firstElementChild)||void 0===t||null===(n=t[I.callLabelOnDoubleClick])||void 0===n||n.call(t))}),[Z,I,E]),[Y,X]=(0,o.useMemo)((()=>function(e,t){if(!e||!t)return[null,null];const[n,o,r,i,l]=e,[a,c]=t,s=n-a/2-3,d=o-c/2-3;let u=0,v=0;const h=a/2+3,f=c/2+3;switch(r){case"top":u=l*Math.cos(i)-f/Math.tan(i),v=l*Math.sin(i)-f;break;case"bottom":u=l*Math.cos(i)+f/Math.tan(i),v=l*Math.sin(i)+f;break;case"left":u=l*Math.cos(i)-h,v=l*Math.sin(i)-h*Math.tan(i);break;case"right":u=l*Math.cos(i)+h,v=l*Math.sin(i)+h*Math.tan(i)}return[{left:s+u,top:d+v,width:a+6,height:c+6},[u,v]]}(P,A)),[P,A]),F=(0,o.useMemo)((()=>{if(!Y||!H)return null;const e=H.x+H.width,t=H.y+H.height,n=Y.left+Y.width,o=Y.top+Y.height;return[[Y.left,o],[n,o],[n,Y.top],[Y.left,Y.top],[Y.left,H.y],[e,H.y],[e,t],[H.x,t],[H.x,H.y],[Y.left,H.y]].map((e=>e.join(","))).join(" ")}),[H,Y]);if(!N)return null;let Q,J,_,K,q;const ee=(0,v.I)(I);if(k){var te,ne,oe;const e=null===(te=I.overrides)||void 0===te?void 0:te.active;_=null!==(ne=null==e?void 0:e.strokeColor)&&void 0!==ne?ne:I.strokeColor,K=null!==(oe=null==e?void 0:e.strokeWidth)&&void 0!==oe?oe:I.strokeWidth,q=null==e?void 0:e.motion;for(const e of ee){var re,ie;"start"===e.placement?Q=null!==(re=I.$activeMarkerStartUrl)&&void 0!==re?re:I.$markerStartUrl:J=null!==(ie=I.$activeMarkerEndUrl)&&void 0!==ie?ie:I.$markerEndUrl}}else if(b){var le,ae,ce;const e=null===(le=I.overrides)||void 0===le?void 0:le.activeRelated;_=null!==(ae=null==e?void 0:e.strokeColor)&&void 0!==ae?ae:I.strokeColor,K=null!==(ce=null==e?void 0:e.strokeWidth)&&void 0!==ce?ce:I.strokeWidth,q=null==e?void 0:e.motion;for(const e of ee){var se,de;"start"===e.placement?Q=null!==(se=I.$activeRelatedMarkerStartUrl)&&void 0!==se?se:I.$markerStartUrl:J=null!==(de=I.$activeRelatedMarkerEndUrl)&&void 0!==de?de:I.$markerEndUrl}}else{_=I.strokeColor,K=I.strokeWidth;for(const e of ee)"start"===e.placement?Q=I.$markerStartUrl:J=I.$markerEndUrl}let ue,ve;if("dot"===(null===(n=q)||void 0===n?void 0:n.shape)){const e=null==q.size?2*K:q.size/2;ue=`M 0,${-e} A ${e},${e} 0,1,1 0,${e} A ${e},${e} 0,1,1 0,${-e} z`}else if("triangle"===(null===(i=q)||void 0===i?void 0:i.shape)){const e=null==q.size?2*K:q.size/2,t=e/Math.sqrt(3);ue=`M ${-t},${e} v ${2*-e} L ${2*t},0 z`}var he,fe;j&&(ve=j/(null!==(he=null===(fe=q)||void 0===fe?void 0:fe.speed)&&void 0!==he?he:d.Jo)+"s");const ge=[null===(a=I.overrides)||void 0===a||null===(a=a.active)||void 0===a||null===(a=a.motion)||void 0===a?void 0:a.shape,null===(h=I.overrides)||void 0===h||null===(h=h.activeRelated)||void 0===h||null===(h=h.motion)||void 0===h?void 0:h.shape].some((e=>"dot"===e||"triangle"===e)),pe=F?`url(#${z})`:void 0;return r().createElement(r().Fragment,null,F&&r().createElement("defs",null,r().createElement("clipPath",{id:z},r().createElement("polygon",{points:F}))),r().createElement("g",{className:"line-group",onDoubleClick:G},r().createElement("path",{d:N,fill:"none",stroke:"transparent",strokeWidth:I.interactStrokeWidth,clipPath:pe}),r().createElement("path",{ref:$,className:l()("line",{dashed:I.dashed,dotted:I.dotted,[(I.dashed?"dashed":I.dotted?"dotted":"solid")+"-animation"]:I.animate.useAnimate}),clipPath:pe,style:{"--time":`${null!==(f=I.animate.duration)&&void 0!==f?f:d.Be}s`,"--solid-length":j},d:N,fill:"none",stroke:_,strokeWidth:K,markerStart:Q,markerEnd:J}),!(null!==(p=I.overrides)&&void 0!==p&&p.active)&&r().createElement("path",{className:"line-active-bg",d:N,fill:"none",clipPath:pe}),ge&&ve&&r().createElement("path",{className:l()("motion",{visible:!!ue}),d:ue,fill:_},r().createElement("animateMotion",{dur:ve,repeatCount:"indefinite",rotate:"auto",path:N}))),r().createElement(g,{edge:m,position:P,offset:X,label:I.label,text:I.text,onClick:U,onRendered:V}))}var x=n(9575);function E(e){let{x:t,y:n}=e;return r().createElement("g",{transform:`translate(${t}, ${n}) scale(0.0234375)`,className:"lock-icon"},r().createElement("path",{d:"M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z",fill:"var(--color-secondary-text)",stroke:"none"}))}function k(e){var t;let{node:n,x:i,y:l,degraded:a,degradedNodeLabel:d,defaultNodeBricks:u,locked:v,containerLocked:g,groupLocked:p,onResize:m}=e;const y=function(e){const[t,n]=(0,o.useState)(e);return(0,o.useEffect)((()=>{n((t=>(0,c.isEqual)(t,e)?t:e))}),[e]),t}({node:{id:n.id,data:n.data,locked:!!v}}),w=n.useBrick,k=n.component,b=(0,o.useRef)(null),{useBrick:M,component:C}=null!==(t=(0,o.useMemo)((()=>a?null:w?{useBrick:w}:k?{component:k}:null==u?void 0:u.find((e=>(0,h.checkIfByTransform)(e,y)))),[u,a,y,k,w]))&&void 0!==t?t:{},I=(0,o.useMemo)((()=>a?String(h.__secret_internals.legacyDoTransform(y,null!=d?d:"<% DATA.node.id %>")):""),[a,d,y]),L=(0,o.useRef)(null),S=(0,o.useRef)(i),N=(0,o.useRef)(l),z=(0,o.useCallback)((e=>{L.current=e;const t=b.current;t&&(t.disconnect(),b.current=null),e?(null!=S.current&&null!=N.current&&(e.style.left=`${S.current}px`,e.style.top=`${N.current}px`),setTimeout((()=>{const t=new s.A((()=>{m(n.id,[e.offsetWidth,e.offsetHeight])}));t.observe(e),b.current=t}))):m(n.id,null)}),[n.id,m]);(0,o.useEffect)((()=>{S.current=i,N.current=l;const e=L.current;e&&null!=i&&null!=l&&(e.style.top=`${l}px`,e.style.left=`${i}px`)}),[i,l]);const P=(0,o.useCallback)((e=>{if(e){const t=e.getBBox();m(n.id,[t.width,t.height])}else m(n.id,null)}),[n.id,m]),R=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const e=R.current;if(!e||!/firefox/i.test(navigator.userAgent))return;e.style.overflow="hidden";const t=setTimeout((()=>{e.style.overflow="visible"}),500);return()=>clearTimeout(t)}),[]),r().createElement(r().Fragment,null,M||C?r().createElement("foreignObject",{width:9999,height:9999,className:"node",ref:R},C?r().createElement(C,(0,x.A)({},y,{refCallback:z})):r().createElement(f.ReactUseBrick,{useBrick:M,data:y,refCallback:z})):a?r().createElement("g",{className:"degraded",ref:P},r().createElement("circle",{cx:8,cy:8,r:8}),r().createElement("text",{x:8,y:32},I)):null,v&&![g,p].some(Boolean)&&null!=i&&null!=l&&r().createElement(E,{x:i+n.view.width+4,y:l+n.view.height-12}))}const b=["center","top","bottom","left","right"];function M(e,t){const n={};for(const i of null!==(o=null==t||null===(r=t.split(/\s+/g))||void 0===r?void 0:r.flatMap((e=>"all"===e?b:e)))&&void 0!==o?o:[]){var o,r;let t;const l=e.x+e.width/2,a=e.y+e.height/2;switch(i){case"center":t=[l,a];break;case"top":t=[l,e.y];break;case"right":t=[e.x+e.width,a];break;case"bottom":t=[l,e.y+e.height];break;case"left":t=[e.x,a];break;default:throw new Error(`Unknown snap position: "${i}"`)}n[i]=t}return n}var C=n(8944),I=n(8185),L=n(4197);const S=["left","center","right"],N=["top","center","bottom"];function z(e,t){var n;let{action:o,cell:r,scale:i,layout:l,layoutOptions:s,activeTarget:u,cells:v,onCellsMoving:h,onCellsMoved:f,onCellResizing:g,onCellResized:p,onSwitchActiveTarget:m,updateCurActiveEditableLine:w}=t;if(e.stopPropagation(),2===e.button||0===e.button&&e.ctrlKey)return;const x=(0,L.Q)(r,u),E=(0,C.E)(v);let k=!1;if(e.shiftKey){const e=u?"multi"===(null==u?void 0:u.type)?u.targets:[u]:[];let t=[];x?t=e.filter((e=>!(0,I.c)(e,r))):(t=[...e,r],k=!0),null==m||m(t.length>0?{type:"multi",targets:t}:null)}else"resize"!==o&&x||(null==m||m((0,y.P)(r)),k=!0);if((0,C.l)(r,E))return;if(k&&((0,a.WW)(r)||(0,a._m)(r))&&(null==w||w(r)),(0,a.WW)(r))return;const b=[],z="multi"===(null==u?void 0:u.type)&&"move"===o?v.filter((e=>(0,L.Q)(e,u))):[r];z.forEach((e=>{if(b.push(e),"move"===o){if((0,a.t2)(e)){const t=(0,c.map)(v.filter((t=>(0,a.dS)(t)&&t.containerId===e.id)),"id"),n=v.filter((n=>((0,a.N)(n)||(0,a.dS)(n))&&n.containerId===e.id&&!z.includes(n)||(0,a.N)(n)&&t.includes(null==n?void 0:n.groupId)));b.push(...n)}(0,a.dS)(e)&&b.push(...v.filter((t=>(0,a.N)(t)&&t.groupId===e.id&&!z.includes(t))))}}));const P="force"===l||"dagre"===l,R=b.filter((e=>!(0,C.l)(e,E)&&((0,a.N)(e)&&!P||(0,a.mH)(e))));if(0===R.length)return;const A=function(e){var t,n,o;const r=e?!0===e?{grid:!0,object:!0}:e:null,i=null!=r&&r.grid?!0===r.grid?{}:r.grid:null,l=null!=r&&r.object?!0===r.object?{}:r.object:null;return{grid:i?{size:null!==(t=i.size)&&void 0!==t?t:d.gx}:null,object:l?{distance:null!==(n=l.distance)&&void 0!==n?n:d.ld,positions:null!==(o=l.positions)&&void 0!==o?o:d.o5}:null}}(null==s?void 0:s.snap),T=null===(n=A.object)||void 0===n?void 0:n.positions,H=[e.clientX,e.clientY],W=R.map((e=>({cell:e,position:"move"===o?[e.view.x,e.view.y]:[e.view.width,e.view.height],snapPositions:"move"!==o||(0,a.WW)(e)?null:M(e.view,T)}))),D=W[0].position;let j=[];if("move"===o&&A.object){const e=v.filter((e=>!(0,a.WW)(e)&&!(0,a._m)(e)&&!b.includes(e)));j=e.map((e=>({cell:e,snapPositions:M(e.view,T)})))}let B=!1;const $=(e,t)=>{const n=function(e){return[(e.clientX-H[0])/i,(e.clientY-H[1])/i]}(e),l=[...n];let c,s,d,u,v;if(B||(B=n[0]**2+n[1]**2>=9),!A.grid&&!A.object||e.altKey)c=W.map((e=>{let{position:t}=e;return[t[0]+n[0],t[1]+n[1]]}));else{let e=1/0,t=1/0;if(A.object){const o=A.object.distance;let r,i,a,c,h=0,f=0;for(const{cell:s,snapPositions:d}of j)for(const{cell:g,snapPositions:p}of W)for(const[m,y]of Object.entries(p)){const p=S.includes(m),w=N.includes(m),[x,E]=d[m],[k,b]=y;if(p){const t=Math.abs(k+n[0]-x);t<o&&t<e&&(e=t,l[0]=x-k,u=g,a=s,r=[x,E],h=b)}if(w){const e=Math.abs(b+n[1]-E);e<o&&e<t&&(t=e,l[1]=E-b,v=g,c=s,i=[x,E],f=k)}}if(a&&a===c){const e=a.view.height/2,t=a.view.width/2;s=[[r[0],r[1]-e],[r[0],r[1]+e]],d=[[i[0]-t,i[1]],[i[0]+t,i[1]]]}else r&&(s=[r,[r[0],h+l[1]]]),i&&(d=[i,[f+l[0],i[1]]])}if(A.grid){const o=A.grid.size,r=[Math.round((D[0]+n[0])/o)*o,Math.round((D[1]+n[1])/o)*o],i=[r[0]-D[0],r[1]-D[1]],a=Math.abs(i[0]-n[0]),c=Math.abs(i[1]-n[1]);a<e&&(e=a,l[0]=i[0],s=void 0,u=void 0),c<t&&(t=c,l[1]=i[1],d=void 0,v=void 0)}c=W.map((e=>{let{position:t}=e;return[t[0]+l[0],t[1]+l[1]]}))}if(B)if("move"===o){var m;const e=W.map(((e,n)=>{var o;let{cell:r}=e;return{type:r.type,id:r.id,x:c[n][0],y:c[n][1],groupId:r.groupId,containerId:r.containerId,width:r.view.width,height:r.view.height,decorator:(0,a.mH)(r)?r.decorator:void 0,guideLines:t?void 0:[...u===r?[s]:[],...v===r?[d]:[]],...(0,a._m)(r)?{source:{x:r.view.source.x+l[0],y:r.view.source.y+l[1]},target:{x:r.view.target.x+l[0],y:r.view.target.y+l[1]},vertices:null===(o=r.view.vertices)||void 0===o?void 0:o.map((e=>({x:e.x+l[0],y:e.y+l[1]})))}:null}}));null===(m=t?f:h)||void 0===m||m(e)}else{var y;null===(y=t?p:g)||void 0===y||y({type:r.type,id:r.id,width:c[0][0],height:c[0][1]})}},Z=e=>{$(e)},O=e=>{$(e,!0),B=!1,document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",O)};document.addEventListener("mousemove",Z),document.addEventListener("mouseup",O)}let P;function R(e){return e?function(){if("boolean"!=typeof P){const e=document.createElement("div");e.setAttribute("contenteditable","PLAINTEXT-ONLY"),P="plaintext-only"===e.contentEditable}return P}()?"plaintext-only":"true":"false"}function A(e){const t=document.createRange();t.selectNodeContents(e);const n=window.getSelection();n.removeAllRanges(),n.addRange(t)}var T=n(9068),H=n(2717);const W=new Map([["group",function(e){var t;let{cell:n,view:i,activeTarget:a,cells:c,locked:s,onDecoratorGroupPlusClick:d}=e;const u=(0,o.useMemo)((()=>(0,H.Gd)(n,a,c)),[a,n,c]);return r().createElement("g",{className:l()("decorator-group",{"active-group":u})},r().createElement("foreignObject",{className:"group-wrapper",width:n.view.width,height:n.view.height},r().createElement("div",{className:"group",style:{...null===(t=n.view)||void 0===t?void 0:t.style,width:n.view.width,height:n.view.height}})),i.usePlus&&n.view.width&&n.view.height&&r().createElement("g",{transform:`translate(${n.view.width/2-8}, ${n.view.height-8}) scale(0.0234375)`,className:"plus-wrapper",onClick:()=>null==d?void 0:d(n)},r().createElement("svg",{className:"plus-icon",viewBox:"64 64 896 896",fill:"currentColor"},r().createElement("rect",{x:"0",y:"0",width:"101%",height:"101%",fill:"#f5f5f5"}),r().createElement("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),r().createElement("path",{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}))),s&&r().createElement(E,{x:n.view.width-16,y:n.view.height-16}))}],["container",function(e){let{cell:t,transform:n,readOnly:i,layout:s,view:d,activeTarget:u,cells:v,locked:h,onCellResizing:f,onCellResized:g,onSwitchActiveTarget:p,onDecoratorTextEditing:m,onDecoratorTextChange:y}=e;const w=(0,c.get)(t.view,"text",""),x=(0,c.get)(t.view,"direction","top"),k=(0,o.useRef)(null),b=r().useRef(null),[M,C]=(0,o.useState)(!1),[I,L]=(0,o.useState)(w),[S,N]=(0,o.useState)(!1),[P,H]=(0,o.useState)(),[W,D]=(0,o.useState)({x:0,y:0,width:t.view.width,height:t.view.height}),j=(0,o.useCallback)((e=>{i||h||(e.preventDefault(),e.stopPropagation(),C(!0))}),[i,h]),B=(0,o.useCallback)((e=>{i||L(e.target.textContent)}),[i]),$=(0,o.useCallback)((()=>{i||(C(!1),N(!0),H((0,T.uuidV4)()))}),[i]);return(0,o.useEffect)((()=>{L(w)}),[w]),(0,o.useEffect)((()=>{const e=k.current;e&&e.textContent!==I&&(e.textContent=I)}),[I]),(0,o.useEffect)((()=>{var e;const t=null===(e=k.current)||void 0===e?void 0:e.parentElement;if(!t)return;const n=new ResizeObserver((()=>{const{clientWidth:e,clientHeight:n}=t;["left","right"].includes(x)?D({width:e,height:d.height,x:"left"===x?-e:d.width,y:0}):D({width:d.width,height:n,x:0,y:"top"===x?-n:d.height})}));return n.observe(t),()=>n.disconnect()}),[d,I,x,P]),(0,o.useEffect)((()=>{M&&k.current&&(k.current.focus(),A(k.current)),null==m||m({id:t.id,editing:M})}),[t.id,M,m]),(0,o.useEffect)((()=>{S&&(null==y||y({id:t.id,view:{...d,text:I}}),N(!1))}),[t,d,I,y,S]),(0,o.useEffect)((()=>{const e=b.current;if(!e||i)return;const o=e=>{z(e,{action:"resize",cell:t,scale:n.k,activeTarget:u,cells:v,onCellResizing:f,onCellResized:g,onSwitchActiveTarget:p})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[u,t,v,g,f,p,i,n.k]),r().createElement("g",{className:"decorator-container"},r().createElement("foreignObject",W,r().createElement("div",{className:l()("text-container",{editing:M,[["left","right"].includes(x)?"vertical":"horizontal"]:!0}),onDoubleClick:j,style:t.view.titleStyle},r().createElement("div",{className:"text",contentEditable:R(M),ref:k,onInput:B,onBlur:$}))),r().createElement("foreignObject",{className:"container-wrapper"},r().createElement("div",{className:"container",style:{...t.view.style,width:d.width,height:d.height}})),!i&&!h&&!(0,a.OD)(s)&&r().createElement("g",{ref:b,className:"resize-handle",transform:`translate(${d.width-20} ${d.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),h&&r().createElement(E,{x:t.view.width-16,y:t.view.height-16}))}],["area",function(e){let{cell:t,transform:n,readOnly:i,layoutOptions:l,activeTarget:a,cells:c,locked:s,onCellResizing:d,onCellResized:u,onSwitchActiveTarget:v}=e;const h=r().useRef(null);return(0,o.useEffect)((()=>{const e=h.current;if(!e||i)return;const o=e=>{z(e,{action:"resize",cell:t,scale:n.k,layoutOptions:l,activeTarget:a,cells:c,onCellResizing:d,onCellResized:u,onSwitchActiveTarget:v})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[a,t,c,l,u,d,v,i,n.k]),r().createElement("g",{className:"decorator-area-container"},r().createElement("foreignObject",{className:"decorator-area",width:"9999",height:"9999"},r().createElement("div",{className:"area",style:{...t.view.style,width:t.view.width,height:t.view.height}})),!i&&!s&&r().createElement("g",{ref:h,className:"resize-handle",transform:`translate(${t.view.width-20} ${t.view.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),s&&r().createElement(E,{x:t.view.width-16,y:t.view.height-16}))}],["text",function(e){var t;let{cell:n,readOnly:i,locked:a,onDecoratorTextEditing:c,onDecoratorTextChange:s}=e;const d=null!==(t=n.view.text)&&void 0!==t?t:"",[u,v]=(0,o.useState)(d),[h,f]=(0,o.useState)(!1),g=(0,o.useRef)(!1),[p,m]=(0,o.useState)(!1),y=(0,o.useRef)(null),w=(0,o.useCallback)((e=>{i||a||(e.preventDefault(),e.stopPropagation(),f(!0))}),[i,a]);(0,o.useEffect)((()=>{const e=y.current;e&&e.textContent!==u&&(e.textContent=u)}),[u]),(0,o.useEffect)((()=>{var e;const t=null===(e=y.current)||void 0===e?void 0:e.parentElement;t&&(n.view.width=t.clientWidth,n.view.height=t.clientHeight)}),[u,n.id]),(0,o.useEffect)((()=>{h&&y.current&&(y.current.focus(),A(y.current)),null==c||c({id:n.id,editing:h})}),[n.id,h,c]),(0,o.useEffect)((()=>{g.current?null==c||c({id:n.id,editing:h}):g.current=!0}),[n.id,h,c]);const x=(0,o.useCallback)((e=>{i||v(e.target.textContent)}),[i]),k=(0,o.useCallback)((()=>{i||(f(!1),m(!0))}),[i]);return(0,o.useEffect)((()=>{p&&(null==s||s({id:n.id,view:{...n.view,text:u}}),m(!1))}),[n,u,s,p]),r().createElement(r().Fragment,null,r().createElement("foreignObject",{className:"decorator-text",width:"9999",height:"9999"},r().createElement("div",{className:l()("text-container",{editing:h}),onDoubleClick:w,style:n.view.style},r().createElement("div",{className:"text",contentEditable:R(h),ref:y,onInput:x,onBlur:k}))),a&&r().createElement(E,{x:n.view.width,y:(n.view.height-12)/2}))}],["rect",function(e){let{cell:t,transform:n,readOnly:i,layout:l,view:c,activeTarget:s,cells:d,locked:u,onCellResizing:v,onCellResized:h,onSwitchActiveTarget:f}=e;const g=r().useRef(null);return(0,o.useEffect)((()=>{const e=g.current;if(!e||i)return;const o=e=>{z(e,{action:"resize",cell:t,scale:n.k,layout:l,activeTarget:s,cells:d,onCellResizing:v,onCellResized:h,onSwitchActiveTarget:f})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[s,t,d,h,v,f,i,n.k,l]),r().createElement("g",{className:"decorator-rect-container"},r().createElement("foreignObject",{className:"decorator-rect",width:"9999",height:"9999"},r().createElement("div",{className:"rect-container",style:{...t.view.style,width:c.width,height:c.height}})),!i&&!u&&!(0,a.OD)(l)&&r().createElement("g",{ref:g,className:"resize-handle",transform:`translate(${c.width-20} ${c.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),u&&r().createElement(E,{x:t.view.width-16,y:t.view.height-16}))}],["line",function(e){var t;let{cell:n,active:i,lineConfMap:a,editableLineMap:c,locked:s}=e;const d=a.get(n),{points:h,jumpsMap:f}=null!==(t=c.get(n))&&void 0!==t?t:{},g=(0,o.useMemo)((()=>d?(0,u.S)(h,"curve"===d.type?d.curveType:"curveLinear",0,1,f):null),[d,h,f]),p=(0,o.useRef)(null),m=(0,o.useCallback)((e=>{if(p.current=e,e){const t=e.getBBox();n.view={...n.view,x:t.x,y:t.y,width:t.width,height:t.height}}}),[n]),y=(0,o.useMemo)((()=>s&&h?function(e){const t=e[e.length-1];if(e.length<2)return{x:t.x+16,y:t.y-6};const n=e[0],o=t.y-n.y,r=t.x-n.x;let i;i=Math.abs(o)>Math.abs(r)?o>0:r>0;const l=i?e[e.length-2]:e[1],a=i?t:n,c=Math.atan2(a.y-l.y,a.x-l.x)-3*Math.PI/4;return{x:a.x+16*Math.cos(c)-6,y:a.y+16*Math.sin(c)-6}}(h):null),[s,h]);if(!g||!d)return null;let w,x,k,b;const M=(0,v.I)(d);if(i){var C,I,L;const e=null===(C=d.overrides)||void 0===C?void 0:C.active;k=null!==(I=null==e?void 0:e.strokeColor)&&void 0!==I?I:d.strokeColor,b=null!==(L=null==e?void 0:e.strokeWidth)&&void 0!==L?L:d.strokeWidth;for(const e of M){var S,N;"start"===e.placement?w=null!==(S=d.$activeMarkerStartUrl)&&void 0!==S?S:d.$markerStartUrl:x=null!==(N=d.$activeMarkerEndUrl)&&void 0!==N?N:d.$markerEndUrl}}else{k=d.strokeColor,b=d.strokeWidth;for(const e of M)"start"===e.placement?w=d.$markerStartUrl:x=d.$markerEndUrl}return r().createElement("g",{className:"decorator-line"},r().createElement("path",{d:g,fill:"none",stroke:"transparent",strokeWidth:d.interactStrokeWidth}),r().createElement("path",{className:l()("line",{dashed:d.dashed,dotted:d.dotted}),ref:m,d:g,fill:"none",stroke:k,strokeWidth:b,markerStart:w,markerEnd:x}),s&&r().createElement(E,{x:y.x,y:y.y}))}]]);function D(e){let{cell:t,view:n,transform:o,readOnly:i,layout:l,layoutOptions:a,active:c,activeTarget:s,cells:d,lineConfMap:u,editableLineMap:v,locked:h,onCellResizing:f,onCellResized:g,onSwitchActiveTarget:p,onDecoratorTextEditing:m,onDecoratorTextChange:y,onDecoratorGroupPlusClick:w}=e;const x=W.get(t.decorator);return x?r().createElement(x,{cell:t,view:n,transform:o,readOnly:i,layout:l,layoutOptions:a,active:c,activeTarget:s,cells:d,lineConfMap:u,editableLineMap:v,locked:h,onCellResizing:f,onCellResized:g,onSwitchActiveTarget:p,onDecoratorTextEditing:m,onDecoratorTextChange:y,onDecoratorGroupPlusClick:w}):(console.error(`Unknown decorator: ${t.decorator}`),null)}var j=n(9940),B=n(9978);function $(e){var t,n;let{layout:i,layoutOptions:s,cell:d,cells:u,degraded:v,degradedNodeLabel:h,defaultNodeBricks:f,lineConfMap:g,editableLineMap:p,activeTarget:m,dragoverContainer:x,readOnly:E,transform:b,hoverCell:M,unrelatedCells:C,allowEdgeToArea:S,curActiveEditableLine:N,locked:P,containerLocked:R,groupLocked:A,updateCurActiveEditableLine:T,onCellsMoving:W,onCellsMoved:$,onCellResizing:Z,onCellResized:O,onSwitchActiveTarget:V,onCellContextMenu:U,onCellClick:G,onDecoratorTextEditing:Y,onDecoratorTextChange:X,onDecoratorGroupPlusClick:F,onNodeBrickResize:Q,onCellMouseEnter:J,onCellMouseLeave:_}=e;const{lineEditorState:K,smartConnectLineState:q,setSmartConnectLineState:ee,onConnect:te,setLineEditorState:ne,onChangeEdgeView:oe}=(0,B.s)(),re=(0,o.useRef)(null),ie=(0,o.useMemo)((()=>C.some((e=>(0,I.c)(e,d)))),[d,C]),le=(0,o.useMemo)((()=>{if((0,a.t2)(d)&&(0,a.OD)(i)){const e=u.filter((e=>(0,a.N)(e)&&e.containerId===d.id)),t={...d.view,...(0,j.x)(e)};return d.view=t,t}if((0,a.dS)(d)&&(0,H.Gd)(d,m,u)){const e=u.filter((e=>"node"===e.type&&e.groupId===d.id)),t={...d.view,...(0,j.x)(e,{padding:H.XV})};return d.view=t,t}return(0,a.WW)(d)||(0,a._m)(d)?void 0:(0,c.get)(d,"view",{x:0,y:0,width:0,height:0})}),[i,d,u,m]);(0,o.useEffect)((()=>{const e=re.current;if(!e)return;const t=e=>{E||[(0,a.t2)(d),(0,a.dS)(d)].some(Boolean)&&(0,a.OD)(i)?e.stopPropagation():z(e,{layout:i,layoutOptions:s,action:"move",cell:d,scale:b.k,activeTarget:m,cells:u,onCellsMoving:W,onCellsMoved:$,onSwitchActiveTarget:V,updateCurActiveEditableLine:T})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[i,s,d,m,u,$,W,V,T,E,b.k]),(0,o.useEffect)((()=>{const e=re.current;if(!e||!(0,a.bo)(d,S)||!(q||K&&"control"!==K.type))return;const t=e=>{if(!N||!K||"decorator"!==N.type)if(e.preventDefault(),e.stopPropagation(),q)q.source!==d&&(null==te||te(q.source,d,q.exitPosition,void 0)),ee(null);else if(N&&K){const{type:e}=K,{source:t,target:n}=p.get(N),{view:o}=N,r="entry"===e;(r?n:t)===d&&(r?null==oe||oe(t,n,{...o,entryPosition:null}):null==oe||oe(t,n,{...o,exitPosition:null})),ne(null)}};return e.addEventListener("mouseup",t),()=>{e.removeEventListener("mouseup",t)}}),[N,p,S,d,K,oe,te,ne,ee,q,T]);const ae=(0,o.useCallback)((e=>{if(E&&"decorator"===d.type)return;e.preventDefault(),e.stopPropagation();let t=m;(0,L.Q)(d,m)||(t=(0,y.P)(d),V(t)),U({cell:d,clientX:e.clientX,clientY:e.clientY,locked:P,target:t})}),[E,d,m,U,P,V]),ce=(0,o.useCallback)((e=>{G&&"decorator"!==d.type&&G({cell:d,clientX:e.clientX,clientY:e.clientY,locked:P})}),[d,G,P]),se=(0,o.useCallback)((()=>{null==J||J(d)}),[d,J]),de=(0,o.useCallback)((()=>{null==_||_(d)}),[d,_]),ue=(0,L.Q)(d,m);return r().createElement("g",{className:l()("cell",{active:ue,faded:ie,"read-only":E,"container-dragover":x}),ref:re,transform:(0,a.N)(d)&&!v||(0,a.WW)(d)||(0,a._m)(d)||null==(null===(t=d.view)||void 0===t?void 0:t.x)||null==(null===(n=d.view)||void 0===n?void 0:n.y)?void 0:`translate(${le.x},${le.y})`,onContextMenu:ae,onClick:ce,onMouseEnter:se,onMouseLeave:de},(0,a.N)(d)?r().createElement(k,{node:d,x:null==le?void 0:le.x,y:null==le?void 0:le.y,degraded:v,degradedNodeLabel:h,defaultNodeBricks:f,locked:P,containerLocked:R,groupLocked:A,onResize:Q}):(0,a.WW)(d)?r().createElement(w,{edge:d,active:E?M===d:ue,activeRelated:!!(E?M:m)&&!ie,lineConfMap:g,editableLineMap:p,readOnly:E,onSwitchActiveTarget:V}):(0,a.mH)(d)?r().createElement(D,{cell:d,view:le,transform:b,readOnly:E,layout:i,layoutOptions:s,active:ue,activeTarget:m,cells:u,lineConfMap:g,editableLineMap:p,locked:P,onCellResizing:Z,onCellResized:O,onSwitchActiveTarget:V,onDecoratorTextEditing:Y,onDecoratorTextChange:X,onDecoratorGroupPlusClick:F}):null)}},8091:(e,t,n)=>{n.d(t,{f:()=>v});var o,r,i,l=n(8769),a=n(7566),c=n(9047),s=n(3033);const d=/mac/i.test(null!==(o=null!==(r=null===(i=navigator.userAgentData)||void 0===i?void 0:i.platform)&&void 0!==r?r:navigator.platform)&&void 0!==o?o:navigator.userAgent);function u(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey&&d?10:1)}function v(e){let{rootRef:t,zoomable:n,scrollable:o,pannable:r,draggable:i,ctrlDraggable:d,scaleRange:v,onSwitchActiveTarget:h}=e;const[f,g]=(0,l.useState)(!1),[p,m]=(0,l.useState)({k:1,x:0,y:0}),y=(0,l.useMemo)((()=>null!=v?v:[s.sS,s.Yt]),[v]),w=(0,l.useMemo)((()=>(0,c.s_)().wheelDelta(u)),[]);return(0,l.useEffect)((()=>{let e=!1;w.scaleExtent(n?y:[1,1]).on("start",(()=>{e=!1,g(!0)})).on("zoom",(t=>{e=!0,m(t.transform)})).on("end",(()=>{g(!1),e||null==h||h(null)})).filter((e=>("wheel"===e.type?e.ctrlKey:d?i||e.ctrlKey:!e.ctrlKey)&&!e.button))}),[h,y,n,w,d,i]),(0,l.useEffect)((()=>{if(d){const e=e=>{e.ctrlKey&&e.preventDefault()};return document.addEventListener("contextmenu",e,!0),()=>{document.removeEventListener("contextmenu",e,!0)}}}),[d]),(0,l.useEffect)((()=>{const e=t.current;if(!e)return;const l=(0,a.A)(e),c=()=>{l.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(n||o||r)return(n||o)&&l.on("wheel.zoom.custom",(e=>{!e.ctrlKey&&o&&(e.preventDefault(),w.translateBy(l,e.wheelDeltaX/5,e.wheelDeltaY/5))})),l.call(w).on("wheel",(e=>{(o||n&&e.ctrlKey)&&e.preventDefault()})).on("dblclick.zoom",null),(i||d)&&r||l.on("mousedown.zoom",null),r||l.on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),c;c()}),[d,i,r,t,o,n,w]),{grabbing:f,transform:p,zoomer:w,scaleRange:y}}},8185:(e,t,n)=>{function o(e,t){return e?!!t&&e.type===t.type&&("multi"===e.type?e.targets.length===t.targets.length&&e.targets.every((e=>t.targets.some((t=>o(e,t))))):"node"===e.type||"decorator"===e.type?e.id===t.id:e.source===t.source&&e.target===t.target):!t}n.d(t,{c:()=>o})},8197:(e,t,n)=>{n.d(t,{H:()=>l});var o=n(8769),r=n(531),i=n(3033);function l(e){let{cells:t,layout:n,centered:l}=e;return(0,o.useMemo)((()=>l&&t.every((e=>!(0,r.N)(e)||e[i.CV]&&("force"!==n&&"dagre"!==n||e[i.xc])))),[t,l,n])}},8875:(e,t,n)=>{n.d(t,{G:()=>l,X:()=>i});const o=[{x:0,y:0,d:["top","left"]},{x:.5,y:0,d:["top"]},{x:1,y:0,d:["top","right"]},{x:0,y:.5,d:["left"]},{x:1,y:.5,d:["right"]},{x:0,y:1,d:["bottom","left"]},{x:.5,y:1,d:["bottom"]},{x:1,y:1,d:["bottom","right"]}],r=o.map((e=>({x:e.x,y:e.y})));function i(){return o}function l(){return r}},8944:(e,t,n)=>{n.d(t,{E:()=>r,l:()=>i});var o=n(531);function r(e){return e.filter((e=>{var t,n;return(null===(t=e.view)||void 0===t?void 0:t.locked)&&(0,o.t2)(e)||(null===(n=e.view)||void 0===n?void 0:n.locked)&&(0,o.dS)(e)})).map((e=>e.id))}function i(e,t){var n;return(null===(n=e.view)||void 0===n?void 0:n.locked)||!(!(0,o.N)(e)&&!(0,o.dS)(e)||!e.containerId||null==t||!t.includes(e.containerId))||!!((0,o.N)(e)&&e.groupId&&null!=t&&t.includes(e.groupId))}},9127:(e,t,n)=>{n.d(t,{C:()=>c});var o=n(1030),r=n(7586),i=n.n(r),l=n(8802),a=n(531);function c(e){let{cells:t,layoutOptions:n,allowEdgeToArea:r}=e;const{nodePadding:c,...s}={nodePadding:0,rankdir:"TB",ranksep:50,edgesep:10,nodesep:50,...(0,o.pick)(n,["nodePadding","rankdir","ranksep","edgesep","nodesep","align"])},d=(0,l.D)(c);if(!t.some(a.N))return{getNodeView:()=>null,nodePaddings:d};const u=new(i().graphlib.Graph);u.setGraph(s),u.setDefaultEdgeLabel((function(){return{}}));for(const e of t)r&&(0,a.o6)(e)||(0,a.N)(e)||(0,a.dS)(e)?u.setNode(e.id,{id:e.id,width:(0,o.get)(e,"view.width",0)+d[1]+d[3],height:(0,o.get)(e,"view.height",0)+d[0]+d[2]}):(0,a.WW)(e)&&u.setEdge(e.source,e.target);return i().layout(u),{getNodeView:e=>u.node(e),nodePaddings:d}}},9386:(e,t,n)=>{n.d(t,{P:()=>r});var o=n(1030);function r(e){return"edge"===e.type?(0,o.pick)(e,["type","source","target","data"]):(0,o.pick)(e,["type","id","data"])}},9617:(e,t,n)=>{n.d(t,{a:()=>d});var o=n(1030),r=n(531),i=n(9127),l=n(9940),a=n(3033),c=n(3820),s=n(2717);function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{groupMap:n}=(0,s.YM)(e,t),d=e.filter((e=>"node"===e.type&&!(0,o.isNil)(e.containerId))),u=e.filter((e=>"decorator"===e.type&&"group"===e.decorator&&!(0,o.isNil)(e.containerId)));if(!d.length&&!u.length)return;const{nodeLayout:v="dagre"}=t,h=e.filter(r.WW),f=e.filter((e=>(0,r.t2)(e))),g=new Map;let p=0,m=0;f.forEach((e=>{g.set(e.id,e)}));const y={},w={};(0,o.forEach)((0,o.groupBy)([...d,...u],"containerId"),((e,t)=>{y[t]=e,w[t]=new Set(e.map((e=>e.id)))})),h.forEach((e=>{for(const[t,n]of Object.entries(w))if(n.has(e.source)&&n.has(e.target)){y[t].push(e);break}}));const x=[],E=(0,o.orderBy)(f.filter((e=>y[e.id])),[e=>(0,r.VF)(e.view)?1:0,e=>(0,o.get)(e,"view.level",1)],["asc","asc"]).map((e=>e.id)),{updatedGap:k,updatedMaxWidth:b}=function(e,t,n,d,u,v,h,f){let g=u,p=h;return e.forEach((e=>{const u=n.get(e),h=t[e];["top","bottom"].includes((0,o.get)(u,"view.direction","top"))&&(g+=a.Yl);const m=h.filter((e=>"node"===e.type)),y=(0,o.get)(f,"groupCells",[]).filter((t=>t.containerId===e));let w=[];if("dagre"===d){const{getNodeView:e}=(0,i.C)({cells:[...h,...y]});w=[...m,...y].map((t=>{if((0,r.kN)(t.view)||(0,r.dS)(t)){const n=e(t.id);t.view={...t.view,x:n.x,y:n.y+g,width:n.width,height:n.height}}return t}))}else"staggered"===d&&(w=(0,c.l)([...m,...y],{offsetY:g}));let x=0,E=0;if((0,r.VF)(u.view)){const e=(0,l.x)(w);x=(0,o.get)(e,"height",a.w1),E=(0,o.get)(e,"width",a.N8),u.view={...u.view,...e},v.push(u)}else x=(0,o.get)(u,"view.height"),E=(0,o.get)(u,"view.width");if(y.length>0){const e=(0,o.get)(f,"groupMap",{});y.forEach((t=>{const n=t.id,{x:r,y:i}=t.view,l=(0,o.get)(e,n,[]);if(!l.length)return;const a=l[0].view.x,c=l[0].view.y;l.forEach((e=>{var t,n;e.view={...e.view,x:r+((null===(t=e.view)||void 0===t?void 0:t.x)-a),y:i+((null===(n=e.view)||void 0===n?void 0:n.y)-c)}})),t.view={...t.view,x:r-s.XV,y:i-s.XV}}))}p=Math.max(E,p),g+=x+50})),{updatedGap:g,updatedMaxWidth:p}}(E,y,g,v,p,x,m,{groupCells:u,groupMap:n});p=k,m=b,x.forEach((e=>{e.view.width=Math.max(a.N8,m)}))}},9940:(e,t,n)=>{n.d(t,{x:()=>i});var o=n(1030),r=n(3033);function i(e,t){let n=1/0,i=1/0,l=-1/0,a=-1/0;if(e.forEach((e=>{const{x:t,y:o,width:r,height:c}=e.view;t<n&&(n=t),o<i&&(i=o),t+r>l&&(l=t+r),o+c>a&&(a=o+c)})),![n,l,i,a].some((e=>isFinite(e))))return{};const c=(0,o.get)(t,"padding",r.Yl);return{x:n-c,y:i-c,width:l-n+2*c,height:a-i+2*c}}},9978:(e,t,n)=>{n.d(t,{H:()=>i,s:()=>l});var o=n(8769),r=n.n(o);const i=r().createContext({rootRef:{current:null},smartConnectLineState:null,unsetHoverStateTimeoutRef:{current:null},hoverState:null,activeEditableLines:[],lineEditorState:null,setLineEditorState:()=>{},setHoverState:()=>{},setSmartConnectLineState:()=>{}});function l(){return r().useContext(i)}}}]);
|
|
2
|
+
//# sourceMappingURL=551.6afac48c.js.map
|