@next-bricks/diagram 0.64.5 → 0.65.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 +2 -2
- package/dist/chunks/{296.beed0507.js → 296.f72b7a0e.js} +2 -2
- package/dist/chunks/296.f72b7a0e.js.map +1 -0
- package/dist/chunks/{5670.73de56d6.js → 5670.f356b145.js} +3 -3
- package/dist/chunks/5670.f356b145.js.map +1 -0
- package/dist/chunks/{7304.2ae2d399.js → 7304.da01ff98.js} +2 -2
- package/dist/chunks/7304.da01ff98.js.map +1 -0
- package/dist/chunks/editable-label.90e84065.js +3 -0
- package/dist/chunks/editable-label.90e84065.js.map +1 -0
- package/dist/chunks/{main.77a22229.js → main.5d39a463.js} +2 -2
- package/dist/chunks/{main.77a22229.js.map → main.5d39a463.js.map} +1 -1
- package/dist/examples.json +4 -4
- package/dist/index.12320a74.js +2 -0
- package/dist/{index.996bbea1.js.map → index.12320a74.js.map} +1 -1
- package/dist/manifest.json +135 -135
- package/dist/types.json +8 -0
- package/dist-types/draw-canvas/constants.d.ts +2 -0
- package/dist-types/draw-canvas/interfaces.d.ts +1 -1
- package/dist-types/draw-canvas/processors/initaliContainerLayout.d.ts +5 -1
- package/dist-types/draw-canvas/processors/staggeredLayout.d.ts +16 -0
- package/docs/eo-draw-canvas.md +2 -1
- package/package.json +2 -2
- package/dist/chunks/296.beed0507.js.map +0 -1
- package/dist/chunks/5670.73de56d6.js.map +0 -1
- package/dist/chunks/7304.2ae2d399.js.map +0 -1
- package/dist/chunks/editable-label.5a0ece68.js +0 -3
- package/dist/chunks/editable-label.5a0ece68.js.map +0 -1
- package/dist/index.996bbea1.js +0 -2
- /package/dist/chunks/{5670.73de56d6.js.LICENSE.txt → 5670.f356b145.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{editable-label.5a0ece68.js.LICENSE.txt → editable-label.90e84065.js.LICENSE.txt} +0 -0
package/dist/bricks.json
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"diagram.editable-label"
|
|
6
6
|
],
|
|
7
7
|
"elements": [
|
|
8
|
-
"eo-diagram",
|
|
9
8
|
"eo-display-canvas",
|
|
9
|
+
"eo-diagram",
|
|
10
10
|
"eo-draw-canvas"
|
|
11
11
|
],
|
|
12
12
|
"processors": [],
|
|
@@ -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.12320a74.js"
|
|
20
20
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[296],{227:(e,t,n)=>{n.d(t,{Y:()=>i});var o=n(4197);function i(e,t,n,i){const r=[];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)&&r.push(t);break;case"decorator":i&&"text"!=t.decorator&&!n.has(t.id)||r.push(t);break;default:r.push(t)}}else switch(null==n?void 0:n.type){case"multi":{const t=new Map,i=new Set,l=new Set;for(const e of n.targets)"node"===e.type&&(i.add(e.id),l.add(e.id));for(const a of e)"node"===a.type?t.set(a.id,a):"edge"===a.type?i.has(a.source)?l.add(a.target):i.has(a.target)?l.add(a.source):(0,o.Q)(a,n)||r.push(a):(0,o.Q)(a,n)||r.push(a);for(const[e,n]of t)l.has(e)||r.push(n);break}case"node":{const t=new Map,o=new Set([n.id]);for(const i of e)"node"===i.type?t.set(i.id,i):"edge"===i.type?i.source===n.id?o.add(i.target):i.target===n.id?o.add(i.source):r.push(i):r.push(i);for(const[e,n]of t)o.has(e)||r.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))||r.push(t)}return r}},531:(e,t,n)=>{n.d(t,{N:()=>i,OD:()=>f,VF:()=>h,WW:()=>a,_m:()=>v,bo:()=>d,jw:()=>g,kN:()=>m,mH:()=>r,nv:()=>c,o6:()=>s,om:()=>p,t2:()=>u,vC:()=>l});var o=n(1030);function i(e){return"node"===e.type}function r(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&&"line"===e.decorator}function f(e){return!["manual",void 0].includes(e)}function h(e){return!(e.width&&e.height)}function m(e){return(0,o.isNil)(e.x)||(0,o.isNil)(e.y)}function g(e){return!("polyline"===e||"curve"===e)}function p(e){return!!e.edge}},967:(e,t,n)=>{n.d(t,{V:()=>u,P:()=>v});var o=n(1030),i=n(8875),r=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,p){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"===p?[{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 i,r,l,a;if(I)i=h(e,I);else{let r;if(C.length>1?r=C[1]:L&&(r=h(t,L)),r)i=m(n,e,n.y===r.y);else{const n=o.y<t.y||o.y>t.y+t.height?"ns":"ew";({point:i,direction:l}=g(e,t,C,n))}}if(L)r=h(t,L);else{let i;if(C.length>1?i=C[C.length-2]:I&&(i=h(e,I)),i)r=m(o,t,o.y===i.y);else{const o=n.x<e.x||n.x>e.x+e.width?"ew":"ns";({point:r,direction:a}=g(t,e,C.slice().reverse(),o))}}const{x:c,y:s}=i,{x:d,y:u}=r,f=[i,...C,r],p=[...C];return n&&n.x!==c&&n.y!==s&&p.unshift("ns"===l?{x:c,y:n.y}:"ew"===l?{x:n.x,y:s}:n.x===f[2].x?{x:c,y:n.y}:{x:n.x,y:s}),o&&o.x!==d&&o.y!==u&&p.push("ns"===a?{x:d,y:o.y}:"ew"===a?{x:o.x,y:u}:o.x===f[f.length-3].x?{x:d,y:o.y}:{x:o.x,y:u}),[i,...v(i,p,r),r]}const S=null!=I?I:f(t,e),N=null!=L?L:f(e,t),{x:z,y:P}=h(e,S),{x:R,y:A}=h(t,N),T=(0,i.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,j=[...H],Z=[...W];z<R?((0,o.pull)(j,"left"),(0,o.pull)(Z,"right")):((0,o.pull)(j,"right"),(0,o.pull)(Z,"left")),P<A?((0,o.pull)(j,"top"),(0,o.pull)(Z,"bottom")):((0,o.pull)(j,"bottom"),(0,o.pull)(Z,"top"));const D=null!==(k=j[0])&&void 0!==k?k:H[0],$=null!==(b=Z[0])&&void 0!==b?b:W[0],B="left"===D||"right"===D?S.y:S.x,O="left"===$||"right"===$?N.y:N.x;return(0,r.o)(l(e,a.XK),l(t,a.XK),D,$,B,O)}function v(e,t,n){const o=[];let i,r=e,l=0;for(;l<t.length;){const e=t[l],a=e.x!==r.x,c=e.y!==r.y;if(a||c){const c=a?"ew":"ns";if(c!==i){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")&&(i=c,o.push(e),r=e)}}l++}return o}function f(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 h(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 m(e,t,n){let o,i,r,l,c;if(n?(o="y",i="x",r="height",l="width"):(o="x",i="y",r="width",l="height"),t[i]+t[l]<e[i]&&(c={[o]:.5,[i]:1}),t[i]>e[i]&&(c={[o]:.5,[i]:0}),c)return h(t,c);const s=t[o]<e[o]?1:0;return{[o]:t[o]-a.XK/2+s*(t[r]+a.XK),[i]:e[i]}}function g(e,t,n,o){let i,r,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])i={[l]:v[l],[a]:e[a]+e[s]},r=d;else if(v[a]<e[a])i={[l]:v[l],[a]:e[a]},r=d;else{var f;const o=null!==(f=n[1])&&void 0!==f?f:t;i={[l]:v[l],[a]:o[a]<v[a]?v[a]:e[a]+e[s]},r=d}else v[a]<e[a]?(i={[l]:e[l]+e[c]/2,[a]:e[a]},r=d):v[a]>e[a]+e[s]?(i={[l]:e[l]+e[c]/2,[a]:e[a]+e[s]},r=d):v[l]<e[l]?(i={[l]:e[l],[a]:v[a]},r=u):(i={[l]:e[l]+e[c],[a]:v[a]},r=u);return{point:i,direction:r}}},1103:(e,t,n)=>{n.d(t,{X:()=>u});var o=n(8769),i=n.n(o),r=n(3373),l=n.n(r),a=n(8653),c=n(9978),s=n(967),d=n(7531);function u(e){let{transform:t,lineSettings:n,options:r}=e;const[u,v]=(0,o.useState)(null),{hoverState:f,smartConnectLineState:h,setSmartConnectLineState:m}=(0,c.s)();(0,o.useEffect)((()=>{if(h)return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),o;function e(e){v([(e.clientX-t.x-h.offset[0])/t.k,(e.clientY-t.y-h.offset[1])/t.k])}function n(e){e.preventDefault(),o()}function o(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n),v(null),m(null)}}),[m,h,t]);const g=(0,o.useMemo)((()=>{const e=function(e,t,n,o){if(!e||!t&&void 0===(null==n?void 0:n.activePointIndex))return null;const i=e.source.view;if(void 0!==(null==n?void 0:n.activePointIndex))return(0,s.V)(i,n.cell.view,{...o,exitPosition:e.exitPosition,entryPosition:n.relativePoints[n.activePointIndex]});const[r,l]=t;return(0,s.V)(i,{x:r,y:l,width:0,height:0},{...o,exitPosition:e.exitPosition})}(h,u,f,n);return(0,a.S)(e,"curve"===(null==n?void 0:n.type)?n.curveType:"curveLinear",0,1)}),[u,f,h,n]);let p,y;const w=(0,d.I)(r);for(const e of w)"start"===e.placement?p=r.$markerStartUrl:y=r.$markerEndUrl;return i().createElement("path",{className:l()("connect-line",{connecting:!(!h||!u)}),d:g,fill:"none",stroke:r.strokeColor,strokeWidth:r.strokeWidth,markerStart:p,markerEnd:y})}},1484:(e,t,n)=>{n.d(t,{g:()=>m});var o=n(8769),i=n(7566),r=n(9047),l=n(3033),a=n(531),c=n(4282),s=n(8802),d=n(1489),u=n(6170),v=n(9127);const f=new Map([["center",.5],["left",0],["right",1],["top",0],["bottom",1]]);function h(e,t){if("string"==typeof e){const n=f.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 m(e){let{layout:t,layoutOptions:n,autoSize:f,rootRef:m,cells:g,zoomable:p,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:f,scaleRange:h,autoCenterWhenCellsChange:m,autoSize:g,padding:p}=e;const[y,w]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{n.some((e=>(0,a.N)(e)||(0,a.mH)(e)))&&!m||w(!1)}),[n,m]),(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 m=e.clientWidth,x=e.clientHeight;const E=!(null==g||!g.width),k=!(null==g||!g.height),b=(0,s.D)(null!=p?p:l.rn);var M,C,I,L;E&&(m=Math.min(Math.max(o.width+b[1]+b[3],null!==(M=g.minWidth)&&void 0!==M?M:0),null!==(C=g.maxWidth)&&void 0!==C?C:1/0),e.style.minWidth=`${m}px`),k&&(x=Math.min(Math.max(o.height+b[0]+b[2],null!==(I=g.minHeight)&&void 0!==I?I:0),null!==(L=g.maxHeight)&&void 0!==L?L:1/0),e.style.minHeight=`${x}px`);const{k:S,x:N,y:z}=(0,d.P)(o,{canvasWidth:m,canvasHeight:x,canvasPadding:b,scaleRange:v?h:void 0});f.transform((0,i.A)(e),new r.uV(S,N,z)),w(!0)}),[n,y,u,t,h,v,f,g,p]),[y,w]}({rootRef:m,layoutInitialized:M,cells:g,zoomable:p,zoomer:y,scaleRange:w,autoCenterWhenCellsChange:k,autoSize:f,padding:null==n?void 0:n.padding}),z=(0,o.useRef)(null);return(0,o.useEffect)((()=>{if(g.some((e=>(0,a.N)(e)&&!e[l.CV]))||0===g.length)return;if("force"!==t&&"dagre"!==t)return void C(!0);if(I.current!==x||(e=z.current,o=g.filter(a.nv),(null==e?void 0:e.length)===o.length&&e.every(((e,t)=>e===o[t]))))return;var e,o;let i,r;({getNodeView:i,nodePaddings:r}="force"===t?(0,u.k)({cells:g,layoutOptions:n,allowEdgeToArea:E}):(0,v.C)({cells:g,layoutOptions:n,allowEdgeToArea:E}));const c=function(e){const t=null!=e?e:[.5,.5];return[h(t[0],"x"),h(t[1],"y")]}(null==n?void 0:n.alignOrigin),s=g.map((e=>{if(E&&(0,a.o6)(e)||(0,a.N)(e)){const t=i(e.id);return{...e,view:{...e.view,x:t.x-t.width*c[0]+r[3],y:t.y-t.height*c[1]+r[0]},[l.xc]:!0}}return e}));z.current=s.filter(a.nv),b({type:"update-cells",payload:s}),C(!0)}),[g,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:i,scaleRange:r}=t;const{left:l,top:a,width:c,height:s,empty:d}=e,[u,v,f,h]=null!=i?i:[0,0,0,0],m=n-h-v,g=o-u-f,p=r&&!d&&(c>m||s>g)?Math.max(Math.min(m/c,g/s,r[1]),r[0]):1;return{x:d?0:(m-c*p)/2+h-l*p,y:d?0:(g-s*p)/2+u-a*p,k:p}}n.d(t,{P:()=>o})},1609:(e,t,n)=>{n.d(t,{m:()=>D});var o=n(8769),i=n.n(o),r=n(3373),l=n.n(r),a=n(531),c=n(1030),s=n(9126),d=n(3033),u=n(8653),v=n(7531),f=n(5903),h=n(8917);function m(e){let{edge:t,position:n,offset:o,label:r,text:a,onRendered:c,onClick:s}=e;if(!r&&!a)return null;const d=!(!n||!o);return i().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},r?i().createElement("div",{className:"line-label label"},i().createElement(p,{edge:t,label:r,onRendered:c})):i().createElement(g,{text:a,onRendered:c}))}function g(e){let{text:t,onRendered:n}=e;const r=(0,o.useCallback)((e=>{null==n||n(e)}),[n]);return i().createElement("div",{className:"line-label text",ref:r,style:t.style},t.content)}function p(e){let{edge:t,label:n,onRendered:r}=e;const l=(0,o.useMemo)((()=>(0,f.checkIfOfComputed)(n)?n.useBrick:null),[n]),a=(0,o.useMemo)((()=>({edge:t})),[t]);(0,o.useEffect)((()=>{l||setTimeout((()=>{null==r||r(null)}))}),[r,l]),(0,o.useEffect)((()=>()=>{null==r||r(null)}),[]);const c=(0,o.useCallback)((e=>{e&&setTimeout((()=>{null==r||r(e.parentElement)}))}),[r]),s=(0,o.useCallback)((()=>{setTimeout((()=>{null==r||r(null)}))}),[r]);return l?i().createElement(h.ReactUseBrick,{refCallback:c,ignoredCallback:s,useBrick:l,data:a}):null}var y=n(9386);function w(e){var t,n,r,a,f,h,g;let{edge:p,lineConfMap:w,editableLineMap:x,readOnly:E,active:k,activeRelated:b,onSwitchActiveTarget:M}=e;const C=(0,o.useRef)(null),I=w.get(p),{points:L,jumpsMap:S}=null!==(t=x.get(p))&&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),j=(0,o.useCallback)((()=>{const e=C.current,{label:t,text:n}=I;if(e&&L&&(t||n)){var o,i;const r=null!==(o=t?t.placement:n.placement)&&void 0!==o?o:"center",l=null!==(i=t?t.offset:n.offset)&&void 0!==i?i:0,a=e.getTotalLength(),c=a/2,s=e.getPointAtLength("start"===r?0:"end"===r?a:c+l);let d="center",u=0;if("start"===r||"end"===r){let e,t;"start"===r?(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]),[Z,D]=(0,o.useState)(null),$=(0,o.useCallback)((e=>{if(C.current=e,e){var t,n,o;D(null!==(t=null===(n=e.getTotalLength)||void 0===n?void 0:n.call(e))&&void 0!==t?t:100);const i=null===(o=e.getBBox)||void 0===o?void 0:o.call(e);p.view={...p.view,x:null==i?void 0:i.x,y:null==i?void 0:i.y,width:null==i?void 0:i.width,height:null==i?void 0:i.height}}j()}),[j,p]),[B,O]=(0,o.useState)(null);(0,o.useEffect)((()=>{if(!B)return void T(null);const e=new s.A((()=>{const{offsetWidth:e,offsetHeight:t}=B;T(0!==e&&0!==t?[e,t]:null)}));return e.observe(B),()=>{e.disconnect()}}),[B]);const U=(0,o.useCallback)((e=>{O(e)}),[]);(0,o.useEffect)((()=>{j()}),[j,L]);const V=(0,o.useCallback)((()=>{null==M||M((0,y.P)(p))}),[p,M]),G=(0,o.useCallback)((e=>{var t,n;!E&&I.callLabelOnDoubleClick&&(e.preventDefault(),e.stopPropagation(),null==B||null===(t=B.firstElementChild)||void 0===t||null===(n=t[I.callLabelOnDoubleClick])||void 0===n||n.call(t))}),[B,I,E]),[X,F]=(0,o.useMemo)((()=>function(e,t){if(!e||!t)return[null,null];const[n,o,i,r,l]=e,[a,c]=t,s=n-a/2-3,d=o-c/2-3;let u=0,v=0;const f=a/2+3,h=c/2+3;switch(i){case"top":u=l*Math.cos(r)-h/Math.tan(r),v=l*Math.sin(r)-h;break;case"bottom":u=l*Math.cos(r)+h/Math.tan(r),v=l*Math.sin(r)+h;break;case"left":u=l*Math.cos(r)-f,v=l*Math.sin(r)-f*Math.tan(r);break;case"right":u=l*Math.cos(r)+f,v=l*Math.sin(r)+f*Math.tan(r)}return[{left:s+u,top:d+v,width:a+6,height:c+6},[u,v]]}(P,A)),[P,A]),Y=(0,o.useMemo)((()=>{if(!X||!H)return null;const e=H.x+H.width,t=H.y+H.height,n=X.left+X.width,o=X.top+X.height;return[[X.left,o],[n,o],[n,X.top],[X.left,X.top],[X.left,H.y],[e,H.y],[e,t],[H.x,t],[H.x,H.y],[X.left,H.y]].map((e=>e.join(","))).join(" ")}),[H,X]);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 ie,re;"start"===e.placement?Q=null!==(ie=I.$activeMarkerStartUrl)&&void 0!==ie?ie:I.$markerStartUrl:J=null!==(re=I.$activeMarkerEndUrl)&&void 0!==re?re: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===(r=q)||void 0===r?void 0:r.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 fe,he;Z&&(ve=Z/(null!==(fe=null===(he=q)||void 0===he?void 0:he.speed)&&void 0!==fe?fe:d.Jo)+"s");const me=[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===(f=I.overrides)||void 0===f||null===(f=f.activeRelated)||void 0===f||null===(f=f.motion)||void 0===f?void 0:f.shape].some((e=>"dot"===e||"triangle"===e)),ge=Y?`url(#${z})`:void 0;return i().createElement(i().Fragment,null,Y&&i().createElement("defs",null,i().createElement("clipPath",{id:z},i().createElement("polygon",{points:Y}))),i().createElement("g",{className:"line-group",onDoubleClick:G},i().createElement("path",{d:N,fill:"none",stroke:"transparent",strokeWidth:I.interactStrokeWidth,clipPath:ge}),i().createElement("path",{ref:$,className:l()("line",{dashed:I.dashed,dotted:I.dotted,[(I.dashed?"dashed":I.dotted?"dotted":"solid")+"-animation"]:I.animate.useAnimate}),clipPath:ge,style:{"--time":`${null!==(h=I.animate.duration)&&void 0!==h?h:d.Be}s`,"--solid-length":Z},d:N,fill:"none",stroke:_,strokeWidth:K,markerStart:Q,markerEnd:J}),!(null!==(g=I.overrides)&&void 0!==g&&g.active)&&i().createElement("path",{className:"line-active-bg",d:N,fill:"none",clipPath:ge}),me&&ve&&i().createElement("path",{className:l()("motion",{visible:!!ue}),d:ue,fill:_},i().createElement("animateMotion",{dur:ve,repeatCount:"indefinite",rotate:"auto",path:N}))),i().createElement(m,{edge:p,position:P,offset:F,label:I.label,text:I.text,onClick:V,onRendered:U}))}var x=n(9575);function E(e){let{x:t,y:n}=e;return i().createElement("g",{transform:`translate(${t}, ${n}) scale(0.0234375)`,className:"lock-icon"},i().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:r,y:l,degraded:a,degradedNodeLabel:d,defaultNodeBricks:u,locked:v,containerLocked:m,onResize:g}=e;const p=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}}),y=n.useBrick,w=n.component,k=(0,o.useRef)(null),{useBrick:b,component:M}=null!==(t=(0,o.useMemo)((()=>a?null:y?{useBrick:y}:w?{component:w}:null==u?void 0:u.find((e=>(0,f.checkIfByTransform)(e,p)))),[u,a,p,w,y]))&&void 0!==t?t:{},C=(0,o.useMemo)((()=>a?String(f.__secret_internals.legacyDoTransform(p,null!=d?d:"<% DATA.node.id %>")):""),[a,d,p]),I=(0,o.useRef)(null),L=(0,o.useRef)(r),S=(0,o.useRef)(l),N=(0,o.useCallback)((e=>{I.current=e;const t=k.current;t&&(t.disconnect(),k.current=null),e?(null!=L.current&&null!=S.current&&(e.style.left=`${L.current}px`,e.style.top=`${S.current}px`),setTimeout((()=>{const t=new s.A((()=>{g(n.id,[e.offsetWidth,e.offsetHeight])}));t.observe(e),k.current=t}))):g(n.id,null)}),[n.id,g]);(0,o.useEffect)((()=>{L.current=r,S.current=l;const e=I.current;e&&null!=r&&null!=l&&(e.style.top=`${l}px`,e.style.left=`${r}px`)}),[r,l]);const z=(0,o.useCallback)((e=>{if(e){const t=e.getBBox();g(n.id,[t.width,t.height])}else g(n.id,null)}),[n.id,g]),P=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const e=P.current;if(!e||!/firefox/i.test(navigator.userAgent))return;e.style.overflow="hidden";const t=setTimeout((()=>{e.style.overflow="visible"}),500);return()=>clearTimeout(t)}),[]),i().createElement(i().Fragment,null,b||M?i().createElement("foreignObject",{width:9999,height:9999,className:"node",ref:P},M?i().createElement(M,(0,x.A)({},p,{refCallback:N})):i().createElement(h.ReactUseBrick,{useBrick:b,data:p,refCallback:N})):a?i().createElement("g",{className:"degraded",ref:z},i().createElement("circle",{cx:8,cy:8,r:8}),i().createElement("text",{x:8,y:32},C)):null,v&&!m&&null!=r&&null!=l&&i().createElement(E,{x:r+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 r of null!==(o=null==t||null===(i=t.split(/\s+/g))||void 0===i?void 0:i.flatMap((e=>"all"===e?b:e)))&&void 0!==o?o:[]){var o,i;let t;const l=e.x+e.width/2,a=e.y+e.height/2;switch(r){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: "${r}"`)}n[r]=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:i,scale:r,layout:l,layoutOptions:c,activeTarget:s,cells:u,onCellsMoving:v,onCellsMoved:f,onCellResizing:h,onCellResized:m,onSwitchActiveTarget:g,updateCurActiveEditableLine:p}=t;if(e.stopPropagation(),2===e.button||0===e.button&&e.ctrlKey)return;const w=(0,L.Q)(i,s),x=(0,C.E)(u);let E=!1;if(e.shiftKey){const e=s?"multi"===(null==s?void 0:s.type)?s.targets:[s]:[];let t=[];w?t=e.filter((e=>!(0,I.c)(e,i))):(t=[...e,i],E=!0),null==g||g(t.length>0?{type:"multi",targets:t}:null)}else"resize"!==o&&w||(null==g||g((0,y.P)(i)),E=!0);if((0,C.l)(i,x))return;if(E&&((0,a.WW)(i)||(0,a._m)(i))&&(null==p||p(i)),(0,a.WW)(i))return;const k=[],b="multi"===(null==s?void 0:s.type)&&"move"===o?u.filter((e=>(0,L.Q)(e,s))):[i];b.forEach((e=>{k.push(e),"move"===o&&(0,a.t2)(e)&&k.push(...u.filter((t=>(0,a.N)(t)&&t.containerId===e.id&&!b.includes(t))))}));const z="force"===l||"dagre"===l,P=k.filter((e=>!(0,C.l)(e,x)&&((0,a.N)(e)&&!z||(0,a.mH)(e))));if(0===P.length)return;const R=function(e){var t,n,o;const i=e?!0===e?{grid:!0,object:!0}:e:null,r=null!=i&&i.grid?!0===i.grid?{}:i.grid:null,l=null!=i&&i.object?!0===i.object?{}:i.object:null;return{grid:r?{size:null!==(t=r.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==c?void 0:c.snap),A=null===(n=R.object)||void 0===n?void 0:n.positions,T=[e.clientX,e.clientY],H=P.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,A)}))),W=H[0].position;let j=[];if("move"===o&&R.object){const e=u.filter((e=>!(0,a.WW)(e)&&!(0,a._m)(e)&&!k.includes(e)));j=e.map((e=>({cell:e,snapPositions:M(e.view,A)})))}let Z=!1;const D=(e,t)=>{const n=function(e){return[(e.clientX-T[0])/r,(e.clientY-T[1])/r]}(e),l=[...n];let c,s,d,u,g;if(Z||(Z=n[0]**2+n[1]**2>=9),!R.grid&&!R.object||e.altKey)c=H.map((e=>{let{position:t}=e;return[t[0]+n[0],t[1]+n[1]]}));else{let e=1/0,t=1/0;if(R.object){const o=R.object.distance;let i,r,a,c,v=0,f=0;for(const{cell:s,snapPositions:d}of j)for(const{cell:h,snapPositions:m}of H)for(const[p,y]of Object.entries(m)){const m=S.includes(p),w=N.includes(p),[x,E]=d[p],[k,b]=y;if(m){const t=Math.abs(k+n[0]-x);t<o&&t<e&&(e=t,l[0]=x-k,u=h,a=s,i=[x,E],v=b)}if(w){const e=Math.abs(b+n[1]-E);e<o&&e<t&&(t=e,l[1]=E-b,g=h,c=s,r=[x,E],f=k)}}if(a&&a===c){const e=a.view.height/2,t=a.view.width/2;s=[[i[0],i[1]-e],[i[0],i[1]+e]],d=[[r[0]-t,r[1]],[r[0]+t,r[1]]]}else i&&(s=[i,[i[0],v+l[1]]]),r&&(d=[r,[f+l[0],r[1]]])}if(R.grid){const o=R.grid.size,i=[Math.round((W[0]+n[0])/o)*o,Math.round((W[1]+n[1])/o)*o],r=[i[0]-W[0],i[1]-W[1]],a=Math.abs(r[0]-n[0]),c=Math.abs(r[1]-n[1]);a<e&&(e=a,l[0]=r[0],s=void 0,u=void 0),c<t&&(t=c,l[1]=r[1],d=void 0,g=void 0)}c=H.map((e=>{let{position:t}=e;return[t[0]+l[0],t[1]+l[1]]}))}if(Z)if("move"===o){var p;const e=H.map(((e,n)=>{var o;let{cell:i}=e;return{type:i.type,id:i.id,x:c[n][0],y:c[n][1],width:i.view.width,height:i.view.height,decorator:(0,a.mH)(i)?i.decorator:void 0,guideLines:t?void 0:[...u===i?[s]:[],...g===i?[d]:[]],...(0,a._m)(i)?{source:{x:i.view.source.x+l[0],y:i.view.source.y+l[1]},target:{x:i.view.target.x+l[0],y:i.view.target.y+l[1]},vertices:null===(o=i.view.vertices)||void 0===o?void 0:o.map((e=>({x:e.x+l[0],y:e.y+l[1]})))}:null}}));null===(p=t?f:v)||void 0===p||p(e)}else{var y;null===(y=t?m:h)||void 0===y||y({type:i.type,id:i.id,width:c[0][0],height:c[0][1]})}},$=e=>{D(e)},B=e=>{D(e,!0),Z=!1,document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",B)};document.addEventListener("mousemove",$),document.addEventListener("mouseup",B)}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);const H=new Map([["container",function(e){let{cell:t,transform:n,readOnly:r,layout:s,view:d,activeTarget:u,cells:v,locked:f,onCellResizing:h,onCellResized:m,onSwitchActiveTarget:g,onDecoratorTextEditing:p,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=i().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,j]=(0,o.useState)({x:0,y:0,width:t.view.width,height:t.view.height}),Z=(0,o.useCallback)((e=>{r||f||(e.preventDefault(),e.stopPropagation(),C(!0))}),[r,f]),D=(0,o.useCallback)((e=>{r||L(e.target.textContent)}),[r]),$=(0,o.useCallback)((()=>{r||(C(!1),N(!0),H((0,T.uuidV4)()))}),[r]);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)?j({width:e,height:d.height,x:"left"===x?-e:d.width,y:0}):j({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==p||p({id:t.id,editing:M})}),[t.id,M,p]),(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||r)return;const o=e=>{z(e,{action:"resize",cell:t,scale:n.k,activeTarget:u,cells:v,onCellResizing:h,onCellResized:m,onSwitchActiveTarget:g})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[u,t,v,m,h,g,r,n.k]),i().createElement("g",{className:"decorator-container"},i().createElement("foreignObject",W,i().createElement("div",{className:l()("text-container",{editing:M,[["left","right"].includes(x)?"vertical":"horizontal"]:!0}),onDoubleClick:Z,style:t.view.titleStyle},i().createElement("div",{className:"text",contentEditable:R(M),ref:k,onInput:D,onBlur:$}))),i().createElement("foreignObject",{className:"container-wrapper"},i().createElement("div",{className:"container",style:{...t.view.style,width:d.width,height:d.height}})),!r&&!f&&!(0,a.OD)(s)&&i().createElement("g",{ref:b,className:"resize-handle",transform:`translate(${d.width-20} ${d.height-20})`},i().createElement("rect",{width:20,height:20}),i().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),f&&i().createElement(E,{x:t.view.width-16,y:t.view.height-16}))}],["area",function(e){let{cell:t,transform:n,readOnly:r,layoutOptions:l,activeTarget:a,cells:c,locked:s,onCellResizing:d,onCellResized:u,onSwitchActiveTarget:v}=e;const f=i().useRef(null);return(0,o.useEffect)((()=>{const e=f.current;if(!e||r)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,r,n.k]),i().createElement("g",{className:"decorator-area-container"},i().createElement("foreignObject",{className:"decorator-area",width:"9999",height:"9999"},i().createElement("div",{className:"area",style:{...t.view.style,width:t.view.width,height:t.view.height}})),!r&&!s&&i().createElement("g",{ref:f,className:"resize-handle",transform:`translate(${t.view.width-20} ${t.view.height-20})`},i().createElement("rect",{width:20,height:20}),i().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),s&&i().createElement(E,{x:t.view.width-16,y:t.view.height-16}))}],["text",function(e){var t;let{cell:n,readOnly:r,locked:a,onDecoratorTextEditing:c,onDecoratorTextChange:s}=e;const d=null!==(t=n.view.text)&&void 0!==t?t:"",[u,v]=(0,o.useState)(d),[f,h]=(0,o.useState)(!1),m=(0,o.useRef)(!1),[g,p]=(0,o.useState)(!1),y=(0,o.useRef)(null),w=(0,o.useCallback)((e=>{r||a||(e.preventDefault(),e.stopPropagation(),h(!0))}),[r,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)((()=>{f&&y.current&&(y.current.focus(),A(y.current)),null==c||c({id:n.id,editing:f})}),[n.id,f,c]),(0,o.useEffect)((()=>{m.current?null==c||c({id:n.id,editing:f}):m.current=!0}),[n.id,f,c]);const x=(0,o.useCallback)((e=>{r||v(e.target.textContent)}),[r]),k=(0,o.useCallback)((()=>{r||(h(!1),p(!0))}),[r]);return(0,o.useEffect)((()=>{g&&(null==s||s({id:n.id,view:{...n.view,text:u}}),p(!1))}),[n,u,s,g]),i().createElement(i().Fragment,null,i().createElement("foreignObject",{className:"decorator-text",width:"9999",height:"9999"},i().createElement("div",{className:l()("text-container",{editing:f}),onDoubleClick:w,style:n.view.style},i().createElement("div",{className:"text",contentEditable:R(f),ref:y,onInput:x,onBlur:k}))),a&&i().createElement(E,{x:n.view.width,y:(n.view.height-12)/2}))}],["rect",function(e){let{cell:t,transform:n,readOnly:r,layout:l,view:c,activeTarget:s,cells:d,locked:u,onCellResizing:v,onCellResized:f,onSwitchActiveTarget:h}=e;const m=i().useRef(null);return(0,o.useEffect)((()=>{const e=m.current;if(!e||r)return;const o=e=>{z(e,{action:"resize",cell:t,scale:n.k,layout:l,activeTarget:s,cells:d,onCellResizing:v,onCellResized:f,onSwitchActiveTarget:h})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[s,t,d,f,v,h,r,n.k,l]),i().createElement("g",{className:"decorator-rect-container"},i().createElement("foreignObject",{className:"decorator-rect",width:"9999",height:"9999"},i().createElement("div",{className:"rect-container",style:{...t.view.style,width:c.width,height:c.height}})),!r&&!u&&!(0,a.OD)(l)&&i().createElement("g",{ref:m,className:"resize-handle",transform:`translate(${c.width-20} ${c.height-20})`},i().createElement("rect",{width:20,height:20}),i().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),u&&i().createElement(E,{x:t.view.width-16,y:t.view.height-16}))}],["line",function(e){var t;let{cell:n,active:r,lineConfMap:a,editableLineMap:c,locked:s}=e;const d=a.get(n),{points:f,jumpsMap:h}=null!==(t=c.get(n))&&void 0!==t?t:{},m=(0,o.useMemo)((()=>d?(0,u.S)(f,"curve"===d.type?d.curveType:"curveLinear",0,1,h):null),[d,f,h]),g=(0,o.useRef)(null),p=(0,o.useCallback)((e=>{if(g.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&&f?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,i=t.x-n.x;let r;r=Math.abs(o)>Math.abs(i)?o>0:i>0;const l=r?e[e.length-2]:e[1],a=r?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}}(f):null),[s,f]);if(!m||!d)return null;let w,x,k,b;const M=(0,v.I)(d);if(r){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 i().createElement("g",{className:"decorator-line"},i().createElement("path",{d:m,fill:"none",stroke:"transparent",strokeWidth:d.interactStrokeWidth}),i().createElement("path",{className:l()("line",{dashed:d.dashed,dotted:d.dotted}),ref:p,d:m,fill:"none",stroke:k,strokeWidth:b,markerStart:w,markerEnd:x}),s&&i().createElement(E,{x:y.x,y:y.y}))}]]);function W(e){let{cell:t,view:n,transform:o,readOnly:r,layout:l,layoutOptions:a,active:c,activeTarget:s,cells:d,lineConfMap:u,editableLineMap:v,locked:f,onCellResizing:h,onCellResized:m,onSwitchActiveTarget:g,onDecoratorTextEditing:p,onDecoratorTextChange:y}=e;const w=H.get(t.decorator);return w?i().createElement(w,{cell:t,view:n,transform:o,readOnly:r,layout:l,layoutOptions:a,active:c,activeTarget:s,cells:d,lineConfMap:u,editableLineMap:v,locked:f,onCellResizing:h,onCellResized:m,onSwitchActiveTarget:g,onDecoratorTextEditing:p,onDecoratorTextChange:y}):(console.error(`Unknown decorator: ${t.decorator}`),null)}var j=n(4516),Z=n(9978);function D(e){let{layout:t,layoutOptions:n,cell:r,cells:s,degraded:d,degradedNodeLabel:u,defaultNodeBricks:v,lineConfMap:f,editableLineMap:h,activeTarget:m,dragoverContainer:g,readOnly:p,transform:x,hoverCell:E,unrelatedCells:b,allowEdgeToArea:M,curActiveEditableLine:C,locked:S,containerLocked:N,updateCurActiveEditableLine:P,onCellsMoving:R,onCellsMoved:A,onCellResizing:T,onCellResized:H,onSwitchActiveTarget:D,onCellContextMenu:$,onCellClick:B,onDecoratorTextEditing:O,onDecoratorTextChange:U,onNodeBrickResize:V,onCellMouseEnter:G,onCellMouseLeave:X}=e;const{lineEditorState:F,smartConnectLineState:Y,setSmartConnectLineState:Q,onConnect:J,setLineEditorState:_,onChangeEdgeView:K}=(0,Z.s)(),q=(0,o.useRef)(null),ee=(0,o.useMemo)((()=>b.some((e=>(0,I.c)(e,r)))),[r,b]),te=(0,o.useMemo)((()=>{if((0,a.t2)(r)&&(0,a.OD)(t)){const e=s.filter((e=>(0,a.N)(e)&&e.containerId===r.id)),t={...r.view,...(0,j.Z)(e)};return r.view=t,t}return(0,a.WW)(r)||(0,a._m)(r)?void 0:(0,c.get)(r,"view",{x:0,y:0,width:0,height:0})}),[t,r,s]);(0,o.useEffect)((()=>{const e=q.current;if(!e)return;const o=e=>{p||(0,a.t2)(r)&&(0,a.OD)(t)?e.stopPropagation():z(e,{layout:t,layoutOptions:n,action:"move",cell:r,scale:x.k,activeTarget:m,cells:s,onCellsMoving:R,onCellsMoved:A,onSwitchActiveTarget:D,updateCurActiveEditableLine:P})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[t,n,r,m,s,A,R,D,P,p,x.k]),(0,o.useEffect)((()=>{const e=q.current;if(!e||!(0,a.bo)(r,M)||!(Y||F&&"control"!==F.type))return;const t=e=>{if(!C||!F||"decorator"!==C.type)if(e.preventDefault(),e.stopPropagation(),Y)Y.source!==r&&(null==J||J(Y.source,r,Y.exitPosition,void 0)),Q(null);else if(C&&F){const{type:e}=F,{source:t,target:n}=h.get(C),{view:o}=C,i="entry"===e;(i?n:t)===r&&(i?null==K||K(t,n,{...o,entryPosition:null}):null==K||K(t,n,{...o,exitPosition:null})),_(null)}};return e.addEventListener("mouseup",t),()=>{e.removeEventListener("mouseup",t)}}),[C,h,M,r,F,K,J,_,Q,Y,P]);const ne=(0,o.useCallback)((e=>{if(p&&"decorator"===r.type)return;e.preventDefault(),e.stopPropagation();let t=m;(0,L.Q)(r,m)||(t=(0,y.P)(r),D(t)),$({cell:r,clientX:e.clientX,clientY:e.clientY,locked:S,target:t})}),[p,r,m,$,S,D]),oe=(0,o.useCallback)((e=>{B&&"decorator"!==r.type&&B({cell:r,clientX:e.clientX,clientY:e.clientY,locked:S})}),[r,B,S]),ie=(0,o.useCallback)((()=>{null==G||G(r)}),[r,G]),re=(0,o.useCallback)((()=>{null==X||X(r)}),[r,X]),le=(0,L.Q)(r,m);return i().createElement("g",{className:l()("cell",{active:le,faded:ee,"read-only":p,"container-dragover":g}),ref:q,transform:(0,a.N)(r)&&!d||(0,a.WW)(r)||(0,a._m)(r)||null==r.view.x||null==r.view.y?void 0:`translate(${te.x},${te.y})`,onContextMenu:ne,onClick:oe,onMouseEnter:ie,onMouseLeave:re},(0,a.N)(r)?i().createElement(k,{node:r,x:null==te?void 0:te.x,y:null==te?void 0:te.y,degraded:d,degradedNodeLabel:u,defaultNodeBricks:v,locked:S,containerLocked:N,onResize:V}):(0,a.WW)(r)?i().createElement(w,{edge:r,active:p?E===r:le,activeRelated:!!(p?E:m)&&!ee,lineConfMap:f,editableLineMap:h,readOnly:p,onSwitchActiveTarget:D}):(0,a.mH)(r)?i().createElement(W,{cell:r,view:te,transform:x,readOnly:p,layout:t,layoutOptions:n,active:le,activeTarget:m,cells:s,lineConfMap:f,editableLineMap:h,locked:S,onCellResizing:T,onCellResized:H,onSwitchActiveTarget:D,onDecoratorTextEditing:O,onDecoratorTextChange:U}):null)}},1819:(e,t,n)=>{n.d(t,{J:()=>r});var o=n(8769),i=n(8185);function r(e){let{rootRef:t,activeTarget:n,doNotResetActiveTargetForSelector:r,doNotResetActiveTargetOutsideCanvas:l,onActiveTargetChange:a}=e;const c=null!=n?n:null,[s,d]=(0,o.useState)(c);(0,o.useEffect)((()=>{d((e=>(0,i.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)||r&&n.some((e=>e instanceof Element&&e.matches(r))))||d(null)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[s,l,r,t]),s}},1825:(e,t,n)=>{n.d(t,{W:()=>m});var o=n(8769),i=n.n(o),r=n(3373),l=n.n(r),a=n(8653),c=n(9978),s=n(1030),d=n(967),u=n(531);function v(e,t,n,o){const{control:i}=t,{points:r}=n.get(e),l=[],[a,c]=o,s=r[0],u=r[r.length-1];0===i.index&&l.push("ns"===i.direction?{x:s.x,y:c}:{x:a,y:s.y});for(let e=1;e<r.length-1;e++){const t=r[e];l.push(e===i.index||e===i.index+1?"ns"===i.direction?{x:t.x,y:c}:{x:a,y:t.y}:t)}return i.index===r.length-2&&l.push("ns"===i.direction?{x:u.x,y:c}:{x:a,y:u.y}),(0,d.P)(s,l,u)}var f=n(7531);const h=["control","corner","break"];function m(e){let{cells:t,editableLineMap:n,transform:r,options:m,activeEditableLine:g}=e;const[p,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(!g||!x)return;M.current=!1;const{type:e,offset:o,from:i}=x,l=l=>{const a={x:(l.clientX-r.x-o[0])/r.k,y:(l.clientY-r.y-o[1])/r.k},c=n.get(g).points,s={x:1/0,y:1/0};let d,v;const f=()=>{if(!M.current){const e=(l.clientX-i[0])/r.k,t=(l.clientY-i[1])/r.k;M.current=e**2+t**2>=9}return[a.x,a.y]};if(h.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)(g)||"exit"!==e&&"entry"!==e||l.altKey)return f();{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===g)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 f()},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)(g);if("control"!==(null==x?void 0:x.type)){if(!o)switch(null==x?void 0:x.type){case"entry":case"exit":null==b||b(g,{...g.view,["entry"===x.type?"target":"source"]:{x:t[0],y:t[1]}});break;case"corner":null==b||b(g,{...g.view,vertices:g.view.vertices.map(((e,n)=>n===x.control.index?{x:t[0],y:t[1]}:e))});break;case"break":{var i;const e=[...null!==(i=g.view.vertices)&&void 0!==i?i:[]];e.splice(x.control.index,0,{x:t[0],y:t[1]}),null==b||b(g,{...g.view,vertices:e});break}}}else if(o){const e=n.get(g),{source:o,target:i}=e;null==k||k(o,i,{...g.view,vertices:v(g,x,n,t)})}else null==b||b(g,{...g.view,vertices:v(g,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}),[g,n,x,r,E,k,t,b]),(0,o.useEffect)((()=>{if(!g)return;const e=e=>{M.current&&(e.stopPropagation(),e.preventDefault())};return document.body.addEventListener("click",e),()=>{document.body.removeEventListener("click",e)}}),[g]);const C=(0,o.useMemo)((()=>{const e=function(e,t,n,o,i){if(!e||!t||!(o||"control"!==t.type&&void 0!==(null==i?void 0:i.activePointIndex)))return null;const r=n.get(e);if(!r)return null;const{type:l}=t;let a,c;const f=e.type;if((0,u.om)(r))a=r.source.view,c=r.target.view;else{const e=r.decorator.view;a={...e.source,width:0,height:0},c={...e.target,width:0,height:0}}const h=e.view,{exitPosition:m,entryPosition:g,vertices:p}=null!=h?h:{},y=(0,s.pick)(h,["type","curveType"]);if("control"===l){const i=v(e,t,n,o);return(0,d.V)(a,c,{...y,exitPosition:m,entryPosition:g,vertices:i},0,f)}if("corner"===l){const e=[...p];return e.splice(t.control.index,1,{x:o[0],y:o[1]}),(0,d.V)(a,c,{...y,exitPosition:m,entryPosition:g,vertices:e},0,f)}if("break"===l){const e=[...null!=p?p:[]];return e.splice(t.control.index,0,{x:o[0],y:o[1]}),(0,d.V)(a,c,{...y,exitPosition:m,entryPosition:g,vertices:e},0,f)}if("edge"===f&&void 0!==(null==i?void 0:i.activePointIndex)){const e=i.relativePoints[i.activePointIndex];return(0,d.V)(a,c,{...y,..."entry"===l?{exitPosition:m,entryPosition:e}:{exitPosition:e,entryPosition:g},vertices:p},0,f)}const[w,x]=o;return"entry"===l?(0,d.V)(a,{x:w,y:x,width:0,height:0},{...y,exitPosition:m,vertices:p},0,f):(0,d.V)({x:w,y:x,width:0,height:0},c,{...y,entryPosition:g,vertices:p},0,f)}(g,x,n,p,w),t=null==g?void 0:g.view;return(0,a.S)(e,"curve"===(null==t?void 0:t.type)?t.curveType:"curveLinear",0,1)}),[p,w,g,x,n]);let I,L;const S=(0,f.I)(m);for(const e of S)"start"===e.placement?I=m.$editingStartMarkerUrl:L=m.$editingEndMarkerUrl;return i().createElement("path",{className:l()("editing-line",{editing:!(!x||!p)}),d:C,fill:"none",stroke:m.editingStrokeColor,markerStart:I,markerEnd:L})}},1991:(e,t,n)=>{n.d(t,{_:()=>i});var o=n(531);function i(e,t,n){const i=t.filter((e=>(0,o.N)(e))),r=e.filter((e=>(0,o.t2)(e))).map((e=>e.id)),l=e.filter((e=>{const t=i.find((t=>t.id===e.id)),n=(null==t?void 0:t.containerId)&&r.includes(t.containerId);return(0,o.N)(e)&&!n}));l.forEach((e=>{const n=e.x,i=e.x+e.width,r=e.y,l=e.y+e.height,a=t.filter((e=>{var t;return(0,o.t2)(e)&&!(null!==(t=e.view)&&void 0!==t&&t.locked)}));for(const t of a){const o=t.view.x,a=t.view.x+t.view.width,c=t.view.y,s=t.view.y+t.view.height;if(n>=o&&i<=a&&r>=c&&l<=s){e.containerCell=t;break}}}));let a=[];return a=l.filter((e=>{var t;const n=i.find((t=>t.id===e.id));return(null==n?void 0:n.containerId)!==(null===(t=e.containerCell)||void 0===t?void 0:t.id)})),a.length>0&&(null==n||n(a)),a}},2202:(e,t,n)=>{n.d(t,{F:()=>f});var o=n(9575),i=n(8769),r=n.n(i),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 f(e){let{scale:t,editableLineMap:n,activeEditableLine:f,updateCurActiveEditableLine:h}=e;const{rootRef:m,movingCells:g,lineEditorState:p,setLineEditorState:y}=(0,l.s)(),w=(0,i.useRef)(null),x=(0,i.useRef)(null),E=(0,i.useRef)([]),k=(0,a._m)(f);(0,i.useEffect)((()=>{const e=w.current,t=x.current;if(!e||!t||!f)return;const n=e=>t=>{t.stopPropagation(),t.preventDefault();const n=m.current.getBoundingClientRect();y({offset:[n.left,n.top],from:[t.clientX,t.clientY],type:e}),null==h||h(f)},o=n("exit"),i=n("entry");return e.addEventListener("mousedown",o),t.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",o),t.removeEventListener("mousedown",i)}}),[f,m,y,h]);const b=(0,i.useMemo)((()=>{var e;if(!f)return[];const t=n.get(f).points;return(0,a.jw)(null===(e=f.view)||void 0===e?void 0:e.type)?k?function(e){const t=[];let n=e[0],o=1;for(;o<e.length;){const i=e[o];t.push({type:"break",index:o-1,x:(n.x+i.x)/2,y:(n.y+i.y)/2}),o<e.length-1&&t.push({...i,type:"corner",index:o-1}),n=i,o++}return t}(t):[]:function(e){const t=[];let n=e[0],o=1;for(;o<e.length;){const i=e[o],r=n.y===i.y,l=n.x===i.x;if(!r||!l){const e=r?"ns":"ew";t.push({type:"control",direction:e,index:o-1,x:(n.x+i.x)/2,y:(n.y+i.y)/2})}n=i,o++}return t}(t)}),[f,n,k]);(0,i.useEffect)((()=>{if(!f)return;const e=E.current,t=b.map((e=>(e=>t=>{t.stopPropagation(),t.preventDefault(),null==h||h(f);const n=m.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])}))}}),[f,b,m,y,h]);const M=(0,i.useRef)(null);if((0,i.useEffect)((()=>{const e=M.current,t=e=>{e.stopPropagation(),e.preventDefault()};return null==e||e.addEventListener("click",t),()=>{null==e||e.removeEventListener("click",t)}}),[]),g)return null;const C=f.view,I=n.get(f).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 r().createElement("g",{ref:M},r().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)=>r().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==p?void 0:p.type)&&p.control===e?1:.4,xlinkHref:u,cursor:k?"crosshair":"ns"===e.direction?"row-resize":"col-resize"})))),r().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:i,onLassoed:r}=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?r:i)({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})},2722:(e,t,n)=>{n.d(t,{T:()=>f});var o=n(8769),i=n.n(o),r=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 f(e){let{activeTarget:t,editableLineMap:n,scale:s,activeEditableLine:d,disabled:v}=e;const{unsetHoverStateTimeoutRef:f,hoverState:m,setHoverState:g,smartConnectLineState:p,lineEditorState:y}=(0,r.s)(),w=(0,o.useCallback)((()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)}),[f]),x=(0,o.useCallback)((()=>{w(),g((e=>void 0===(null==e?void 0:e.activePointIndex)?e:{...m,activePointIndex:void 0}))}),[m,g,w]),E=(0,o.useCallback)((()=>{f.current=setTimeout((()=>{g(null)}))}),[g,f]);let k,b,M;const C=!v&&m&&(!!p||(d&&y?(M=n.get(d))&&!!(0,c.om)(M)&&(({source:k,target:b}=M),"entry"===y.type?m.cell===b:"exit"===y.type&&m.cell===k):!(0,l.Q)(m.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 i().createElement("g",{onMouseEnter:x,onMouseLeave:E},C&&i().createElement(i().Fragment,null,i().createElement("rect",{x:m.cell.view.x-L,y:m.cell.view.y-L,width:m.cell.view.width+I,height:m.cell.view.height+I,fill:"none",stroke:"transparent",strokeWidth:2*u/s,pointerEvents:"stroke"}),void 0!==m.activePointIndex&&i().createElement("circle",{cx:m.points[m.activePointIndex].x,cy:m.points[m.activePointIndex].y,r:u/s,fill:"lightgreen",fillOpacity:.5,pointerEvents:"none"}),m.points.map(((e,t)=>i().createElement(h,{key:t,editableLineMap:n,index:t,point:e,scale:s,activeEditableLine:d,unsetActivePointIndex:x,unsetTimeout:w})))))}function h(e){let{editableLineMap:t,index:n,point:l,scale:a,activeEditableLine:c,unsetTimeout:f,unsetActivePointIndex:h}=e;const{rootRef:m,smartConnectLineState:g,hoverState:p,setHoverState:y,setSmartConnectLineState:w,onConnect:x,lineEditorState:E,setLineEditorState:k,onChangeEdgeView:b}=(0,r.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)),f(),y((e=>e&&e.activePointIndex!==n?{...p,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)}}),[p,n,y,f]),(0,o.useEffect)((()=>{if(E)return;const e=e=>{e.preventDefault(),e.stopPropagation();const t=m.current.getBoundingClientRect(),o=p.points[n];w({source:p.cell,from:[o.x,o.y],offset:[t.left,t.top],exitPosition:p.relativePoints[n]})},t=M.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[p,n,E,m,w]),(0,o.useEffect)((()=>{const e=e=>{if(!c||!E||"decorator"!==c.type)if(e.preventDefault(),e.stopPropagation(),g)g.source!==(null==p?void 0:p.cell)&&(null==x||x(g.source,p.cell,g.exitPosition,p.relativePoints[p.activePointIndex])),w(null);else if(c&&E){const e=p.relativePoints[p.activePointIndex],{type:n}=E,{source:o,target:i}=t.get(c),{view:r}=c;"entry"===n?null==b||b(o,i,{...r,entryPosition:e}):null==b||b(o,i,{...r,exitPosition:e}),k(null)}},n=M.current;return null==n||n.addEventListener("mouseup",e),()=>{null==n||n.removeEventListener("mouseup",e)}}),[g,p,x,w,c,E,t,b,k]),i().createElement("g",{ref:M,onMouseLeave:h},i().createElement("circle",{cx:l.x,cy:l.y,r:u,fill:"transparent"}),i().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:()=>r});var o=n(8944),i=n(4197);function r(e,t){let{cells:n,activeTarget:r,lockedContainerIds:l}=t;const a=n.filter((e=>(0,i.Q)(e,r)&&!(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:()=>r});var o=n(531),i=n(4197);function r(e,t,n,r){const l=[],a=[];for(const t of n)if((0,i.Q)(t,e)){var c;if((0,o.N)(t)&&t.containerId&&r.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),i=n.n(o),r=n(935),l=n.n(r)()(i());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)}.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.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:()=>h,CV:()=>o,D9:()=>a,Dm:()=>l,HP:()=>r,Ie:()=>m,Jo:()=>I,N8:()=>c,Ub:()=>p,VO:()=>f,XK:()=>M,XV:()=>g,Yt:()=>u,gx:()=>x,ld:()=>E,mF:()=>v,o5:()=>k,p6:()=>b,pC:()=>w,rn:()=>C,sS:()=>d,w1:()=>s,xc:()=>i});const o=Symbol.for("size-initialized"),i=Symbol.for("layout-initialized"),r=20,l=36,a=50,c=180,s=120,d=.5,u=2,v="gray",f=1,h="rgba(73, 126, 255, 0.7)",m=15,g=!1,p=!0,y=1,w=500,x=10,E=5,k="all",b=5,M=0,C=0,I=50},3371:(e,t,n)=>{n.d(t,{L:()=>h});var o=n(1030),i=n(3033),r=n(531),l=n(3783),a=n(4282),c=n(1489),s=n(6170),d=n(9127),u=n(8185);function v(e,t,n,o,i,r,l,a){const c=e+n/2,s=t+o/2,d=i+l/2,u=r+a/2,v=(n+l)/2,f=(o+a)/2;return Math.abs(c-d)<v&&Math.abs(s-u)<f}var f=n(9617);function h(e){let{cells:t,layout:n,previousCells:h,defaultNodeSize:m,canvasWidth:g,canvasHeight:p,scaleRange:y,transform:w,reason:x,parent:E,allowEdgeToArea:k,layoutOptions:b}=e;const M="force"!==n&&"dagre"!==n,C=(0,l.C)(t,{defaultNodeSize:m,layoutOptions:b,isInitialize:!1}),I=[];let L=!1;const S=new Map;let N=!1;for(const e of h)(0,r.mH)(e)?N=!0:(0,r.N)(e)&&(N=!0,e[i.CV]&&S.set(e.id,e));const z=new Map;for(const e of C)if((0,r.N)(e)){z.set(e.id,e);const t=S.get(e.id);t&&(e.view.width=t.view.width,e.view.height=t.view.height,e[i.CV]=!0)}let P=!1;if("add-related-nodes"===x&&E){const e=new Set;for(const t of C)(0,r.WW)(t)&&t.source===E&&t.target!==E&&e.add(t.target);const t=z.get(E);if(void 0!==(null==t?void 0:t.view.x)&&void 0!==t.view.y){if(P=!0,M)for(const t of C)((0,r.N)(t)&&void 0===t.view.x||(0,r.N)(t)&&void 0===t.view.y)&&e.add(t.id);const n=[...e].map((e=>z.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):I.push(e);if(I.length>0&&M){let e,n;if(o)e=o.view.x+o.view.width+i.Dm,n=o.view.y;else{const o=I.reduce(((e,t)=>e+t.view.width+i.Dm),-i.Dm);e=t.view.x-o/2+t.view.width/2,n=t.view.y+t.view.height+i.D9}for(const t of I)t.view.x=e,t.view.y=n,e+=t.view.width+i.Dm}}}if(!P){const e=[];let t=!1;for(const n of C)(0,r.N)(n)?(0,r.kN)(n.view)?I.push(n):e.push(n):(0,r.mH)(n)&&(t=!0);if(M){let n;N||(w=function(e,t){const n=(0,a.S)(e);return(0,c.P)(n,t)}((0,o.without)(C,...I),{canvasWidth:g,canvasHeight:p,scaleRange:y})),0===e.length||1===e.length&&!t&&I.length>0?(I.push(...e),({getNodeView:n}=(0,d.C)({cells:C,allowEdgeToArea:k})),L=0===h.length||h.length===C.length&&h.every(((e,t)=>(0,u.c)(e,C[t])))):({getNodeView:n}=(0,s.k)({cells:C,fixedPosition:!0,allowEdgeToArea:k,center:[(g/2-w.x)/w.k,(p/2-w.y)/w.k]}));const i=C.filter((e=>(0,r.t2)(e)&&(0,r.VF)(e.view)));i.length>0?(I.push(...i),(0,f.a)(C)):function(e,t){let{defaultNodeSize:n}=t;const i=e.filter((e=>"node"===e.type&&(0,r.kN)(e.view)&&!(0,o.isNil)(e.containerId)));if(!i.length)return;const l={};(0,o.forEach)((0,o.groupBy)(i,"containerId"),((e,t)=>{l[t]=e})),e.filter((e=>(0,r.t2)(e)&&l[e.id])).forEach((t=>{const o=t.id,i=t.view,a=e.filter((e=>(null==e?void 0:e.containerId)===o&&!(0,r.kN)(e.view))).map((e=>({x:e.view.x,y:e.view.y})));l[o].forEach((e=>{var t,o;const r=(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],c=function(e,t,n,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;const{x:l,y:a,width:c}=e,s=n+i,d=o+i,u=Math.floor((c-2*r)/s);let f=0;for(;;){for(let e=0;e<u;e++){const i=l+r+e*s,c=a+r+f*d;if(!t.some((e=>v(i,c,n,o,e.x,e.y,n,o))))return{x:i,y:c}}f++}}(i,a,r,l,10,20);c&&(e.view={...e.view,x:c.x,y:c.y},a.push(c))}))}))}(C,{defaultNodeSize:m});for(const e of C)if((0,r.N)(e)&&(0,r.kN)(e.view)){const t=n(e.id);e.view.x=t.x,e.view.y=t.y}}}return{cells:C,updated:I,shouldReCenter:L}}},3639:(e,t,n)=>{n.d(t,{w:()=>a});var o=n(8769),i=n.n(o),r=n(3373),l=n.n(r);function a(e){let{connectLineState:t,transform:n,markerEnd:r,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))},i=e=>{e.stopPropagation()},r=n=>{n.stopPropagation(),l(),a(t,e(n))},l=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mousedown",i,{capture:!0}),document.removeEventListener("click",r,{capture:!0}),s(null)};return document.addEventListener("mousemove",o),document.addEventListener("mousedown",i,{capture:!0}),document.addEventListener("click",r,{capture:!0}),l}}),[t,a,n]),i().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(#${r})`})}},3783:(e,t,n)=>{n.d(t,{C:()=>l});var o=n(1030),i=n(531),r=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,r.a)(c),c.map((e=>{var t,o;return!(0,i.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}}}))}},4117:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(8769),i=n(531);function r(e,t){return e.find((e=>(0,i.o6)(e)&&e.id===t))}var l=n(967),a=n(1030),c=n(4525);const s=6;function d(e,t,n,o,i){const r=(0,c.y)([e.x,e.y],[t.x,t.y],[n.x,n.y],[o.x,o.y]);if(r){const l=i*i;for(const i of[e,t,n,o]){const e=r[0]-i.x,t=r[1]-i.y;if(e*e+t*t<l)return null}return{x:r[0],y:r[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 i=[],r=[];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=[],f=s/2+o.strokeWidth-1;if(o.jumps)e:for(const n of t){const t=d(c,u,n.start,n.end,f);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))<f+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:f};e.push(t),i.push(t)}r.push({start:c,end:u})}t.push(...r)}return i.length>0?new Map(i.map((e=>[e.index,e]))):null}}();for(const a of t)if((0,i.WW)(a)){var c;const s=n.get(a);if(!s)continue;const d=r(t,a.source),u=r(t,a.target),v=(0,i.jw)(null===(c=a.view)||void 0===c?void 0:c.type)&&t.some((e=>{var t;return(0,i.WW)(e)&&a.source===e.target&&a.target===e.source&&(0,i.jw)(null===(t=e.view)||void 0===t?void 0:t.type)}))?s.parallelGap:0,f=d&&u&&null!=d.view.x&&null!=u.view.x?(0,l.V)(d.view,u.view,a.view,v,a.type):null;if(f){const t=o(f,s);e.set(a,{edge:a,points:f,source:d,target:u,parallelGap:v,jumpsMap:t})}}else if((0,i._m)(a)){const t=n.get(a);if(!t)continue;const{source:i,target:r}=a.view,c=i&&r?(0,l.V)({...i,width:0,height:0},{...r,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:()=>i});var o=n(8185);function i(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:()=>i});var o=n(531);function i(e){const t=[];let n=!0;for(const i of e)(0,o.WW)(i)||(n=!1,t.push(i.view));const{x:i,y:r,width:l,height:a}=function(e){let t=1/0,n=1/0,o=-1/0,i=-1/0;for(const r of e){const e=r.x+r.width,l=r.y+r.height;r.x<t&&(t=r.x),e>o&&(o=e),r.y<n&&(n=r.y),l>i&&(i=l)}return{x:t,y:n,width:o-t,height:i-n}}(t);return{left:i,top:r,width:l,height:a,empty:n}}},4516:(e,t,n)=>{function o(e){let t=1/0,n=1/0,o=-1/0,i=-1/0;return e.forEach((e=>{const{x:r,y:l,width:a,height:c}=e.view;r<t&&(t=r),l<n&&(n=l),r+a>o&&(o=r+a),l+c>i&&(i=l+c)})),[t,o,n,i].some((e=>isFinite(e)))?{x:t-20,y:n-20,width:o-t+40,height:i-n+40}:{}}n.d(t,{Z:()=>o})},5748:(e,t,n)=>{n.d(t,{d:()=>d});var o=n(1030),i=n(531),r=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 i=e.map((e=>{const i=t.payload.find((t=>e.type===t.type&&e.id===t.id));return i?(n=!0,{...e,view:{...e.view,x:i.x,y:i.y,...(0,o.pick)(i,"source","target","vertices")}}):e}));return n?i:e}case"resize-cell":{const{type:n,id:o,width:i,height:r}=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:i,height:r}},...e.slice(l+1)]}return e}case"update-cells":return t.payload;case"update-node-size":return e.map((e=>(0,i.N)(e)&&e.id===t.payload.id?{...e,[r.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,i]=n;return[o,i(e[o],t)]}))));var u},6170:(e,t,n)=>{n.d(t,{k:()=>v});var o=n(1030),i=n(6149),r=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:f,allowEdgeToArea:h}=e;const{nodePadding:m,collide:g}={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}},p=(0,u.D)(m),y=[],w=[],x=new Map;for(const e of t)if(h&&(0,d.o6)(e)||(0,d.N)(e)){const t={id:e.id,width:e.view.width+p[1]+p[3],height:e.view.height+p[0]+p[2],...f?{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,i.A)(w).id((e=>e.id)),k=(0,r.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 g&&k.force("collide",(0,s.A)().radius((e=>Math.sqrt(e.width**2+e.height**2)/2+g.radiusDiff)).strength(g.strength).iterations(g.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:p}}},6237:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),i=n.n(o),r=n(935),l=n.n(r)()(i());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:()=>h});var o=n(8769),i=n.n(o),r=n(1895),l=n(6768),a=n(6313),c=n(5694),s=n(8917),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"})),f=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 h(e){let{shadowRoot:t,scale:n,scaleRange:d,onZoomChange:h,onReCenter:m}=e;const g=(0,s.useCurrentTheme)(),p=(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)((()=>{h(Math.min(E+5,x))}),[x,h,E]),M=(0,o.useCallback)((()=>{h(Math.max(E-5,w))}),[w,h,E]);return i().createElement(r.Ay,{theme:{algorithm:"dark-v2"===g?l.A.darkAlgorithm:l.A.defaultAlgorithm}},i().createElement(c.N7,{container:t,autoClear:!0,cache:p,hashPriority:"high"},i().createElement("div",{className:"zoom-bar",ref:y},i().createElement("div",{className:"center-button",onClick:m,role:"button"},i().createElement(u,null)),i().createElement("div",{className:"zoom-slider"},i().createElement("div",{className:"zoom-button",role:"button",onClick:b},i().createElement(v,null)),i().createElement(a.A,{min:w,max:x,value:E,step:5,vertical:!0,included:!1,tooltip:k,onChange:h}),i().createElement("div",{className:"zoom-button",role:"button",onClick:M},i().createElement(f,null))))))}},7531:(e,t,n)=>{n.d(t,{I:()=>d,d:()=>c});var o=n(8769),i=n(5903),r=n(1030),l=n(531),a=n(3033);function c(e){let{cells:t,defaultEdgeLines:n,markerPrefix:c,lineConnector:f,useMemoizedResult:h}=e;const m=(0,o.useRef)(null);return(0,o.useMemo)((()=>{if(h&&m.current)return m.current;const e=[{strokeColor:a.mF,markerType:"arrow"}];let o=null;if(f){o={...v(),editingStrokeColor:"var(--palette-blue-5)",...(0,r.omitBy)(!0===f?{}:f,r.isUndefined)};const t=d(o);for(const n of t){const{placement:t,type:i}=n,r=null!=i?i:"arrow",l=u({strokeColor:o.strokeColor,markerType:r},e),a=u({strokeColor:o.editingStrokeColor,markerType:r},e);"start"===t?(o.$markerStartUrl=`url(#${c}${l})`,o.$editingStartMarkerUrl=`url(#${c}${a})`):(o.$markerEndUrl=`url(#${c}${l})`,o.$editingEndMarkerUrl=`url(#${c}${a})`)}}const g=new WeakMap;for(const o of t){const t=(0,l.WW)(o),f=(0,l._m)(o);let h;if(t){var p,y;const e=null!==(p=Array.isArray(n)?s(n.find((e=>(0,i.checkIfByTransform)(e,{edge:o}))),o):null===(y=i.__secret_internals.legacyDoTransform({edge:o},n))||void 0===y?void 0:y.find((e=>(0,i.checkIfOfComputed)(e))))&&void 0!==p?p:{};h={...v(),...(0,r.omitBy)(e,r.isUndefined),...(0,r.omitBy)(o.view,r.isUndefined)},void 0===h.parallelGap&&(h.parallelGap=h.interactStrokeWidth)}else h={...v(),showEndArrow:!1,strokeColor:a.CE,...(0,r.omitBy)(o.view,r.isUndefined)};if(t||f){const n=d(h);for(const o of n){var w;const{placement:n,type:i}=o,r=null!=i?i:"arrow",l=u({strokeColor:h.strokeColor,markerType:r},e);"start"===n?h.$markerStartUrl=`url(#${c}${l})`:h.$markerEndUrl=`url(#${c}${l})`;const a=null===(w=h.overrides)||void 0===w||null===(w=w.active)||void 0===w?void 0:w.strokeColor;if(a&&a!==h.strokeColor){const t=u({strokeColor:a,markerType:r},e);"start"===n?h.$activeMarkerStartUrl=`url(#${c}${t})`:h.$activeMarkerEndUrl=`url(#${c}${t})`}if(t){var x;const t=null===(x=h.overrides)||void 0===x||null===(x=x.activeRelated)||void 0===x?void 0:x.strokeColor;if(t&&t!==h.strokeColor){const o=u({strokeColor:t,markerType:r},e);"start"===n?h.$activeRelatedMarkerStartUrl=`url(#${c}${o})`:h.$activeRelatedMarkerEndUrl=`url(#${c}${o})`}}}g.set(o,h)}}return m.current={lineConfMap:g,lineConnectorConf:o,markers:e}}),[t,n,f,c,h])}function s(e,t){var n;if(null!=e&&null!==(n=e.label)&&void 0!==n&&n.useBrick){const{label:{useBrick:n,...o},...r}=e,l=i.__secret_internals.legacyDoTransform({edge:t},{...r,label:o});return{...l,label:{...l.label,useBrick:n}}}return i.__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,r.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}}},8091:(e,t,n)=>{n.d(t,{f:()=>v});var o,i,r,l=n(8769),a=n(7566),c=n(9047),s=n(3033);const d=/mac/i.test(null!==(o=null!==(i=null===(r=navigator.userAgentData)||void 0===r?void 0:r.platform)&&void 0!==i?i: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:i,draggable:r,ctrlDraggable:d,scaleRange:v,onSwitchActiveTarget:f}=e;const[h,m]=(0,l.useState)(!1),[g,p]=(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,m(!0)})).on("zoom",(t=>{e=!0,p(t.transform)})).on("end",(()=>{m(!1),e||null==f||f(null)})).filter((e=>("wheel"===e.type?e.ctrlKey:d?r||e.ctrlKey:!e.ctrlKey)&&!e.button))}),[f,y,n,w,d,r]),(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||i)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),(r||d)&&i||l.on("mousedown.zoom",null),i||l.on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),c;c()}),[d,r,i,t,o,n,w]),{grabbing:h,transform:g,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),i=n(531),r=n(3033);function l(e){let{cells:t,layout:n,centered:l}=e;return(0,o.useMemo)((()=>l&&t.every((e=>!(0,i.N)(e)||e[r.CV]&&("force"!==n&&"dagre"!==n||e[r.xc])))),[t,l,n])}},8875:(e,t,n)=>{n.d(t,{G:()=>l,X:()=>r});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"]}],i=o.map((e=>({x:e.x,y:e.y})));function r(){return o}function l(){return i}},8944:(e,t,n)=>{n.d(t,{E:()=>i,l:()=>r});var o=n(531);function i(e){return e.filter((e=>{var t;return(null===(t=e.view)||void 0===t?void 0:t.locked)&&(0,o.t2)(e)})).map((e=>e.id))}function r(e,t){var n;return(null===(n=e.view)||void 0===n?void 0:n.locked)||!!((0,o.N)(e)&&e.containerId&&null!=t&&t.includes(e.containerId))}},9127:(e,t,n)=>{n.d(t,{C:()=>c});var o=n(1030),i=n(7586),r=n.n(i),l=n(8802),a=n(531);function c(e){let{cells:t,layoutOptions:n,allowEdgeToArea:i}=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(r().graphlib.Graph);u.setGraph(s),u.setDefaultEdgeLabel((function(){return{}}));for(const e of t)i&&(0,a.o6)(e)||(0,a.N)(e)?u.setNode(e.id,{id:e.id,width:e.view.width+d[1]+d[3],height:e.view.height+d[0]+d[2]}):(0,a.WW)(e)&&u.setEdge(e.source,e.target);return r().layout(u),{getNodeView:e=>u.node(e),nodePaddings:d}}},9386:(e,t,n)=>{n.d(t,{P:()=>i});var o=n(1030);function i(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:()=>c});var o=n(1030),i=n(531),r=n(9127),l=n(4516),a=n(3033);function c(e){const t=e.filter((e=>"node"===e.type&&!(0,o.isNil)(e.containerId)));if(!t.length)return;const n=e.filter(i.WW),c=e.filter(i.t2),s={},d={};(0,o.forEach)((0,o.groupBy)(t,"containerId"),((e,t)=>{s[t]=e,d[t]=new Set(e.map((e=>e.id)))})),n.forEach((e=>{for(const[t,n]of Object.entries(d))if(n.has(e.source)&&n.has(e.target)){s[t].push(e);break}}));let u=0,v=0,f=[];const h=[];(0,o.orderBy)(c.filter((e=>s[e.id])),[e=>(0,i.VF)(e.view)?1:0,e=>(0,o.get)(e,"view.level",1)],["asc","asc"]).map((e=>e.id)).forEach((e=>{const t=c.find((t=>t.id===e)),n=s[e];["top","bottom"].includes((0,o.get)(t,"view.direction","top"))&&(u+=40);const{getNodeView:d}=(0,r.C)({cells:n});f=n.filter((e=>"node"===e.type)).map((e=>{if((0,i.kN)(e.view)){const t=d(e.id);e.view={...e.view,x:t.x,y:t.y+u,width:t.width,height:t.height}}return e}));let m=0,g=0;if((0,i.VF)(t.view)){const e=(0,l.Z)(f);m=(0,o.get)(e,"height",a.w1),g=(0,o.get)(e,"width",a.N8),t.view={...t.view,...e},h.push(t)}else m=(0,o.get)(t,"view.height"),g=(0,o.get)(t,"view.width");v=Math.max(g,v),u+=m+50})),h.forEach((e=>{e.view.width=Math.max(a.N8,v)}))}},9978:(e,t,n)=>{n.d(t,{H:()=>r,s:()=>l});var o=n(8769),i=n.n(o);const r=i().createContext({rootRef:{current:null},smartConnectLineState:null,unsetHoverStateTimeoutRef:{current:null},hoverState:null,activeEditableLines:[],lineEditorState:null,setLineEditorState:()=>{},setHoverState:()=>{},setSmartConnectLineState:()=>{}});function l(){return i().useContext(r)}}}]);
|
|
2
|
-
//# sourceMappingURL=296.
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[296],{227:(e,t,n)=>{n.d(t,{Y:()=>i});var o=n(4197);function i(e,t,n,i){const r=[];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)&&r.push(t);break;case"decorator":i&&"text"!=t.decorator&&!n.has(t.id)||r.push(t);break;default:r.push(t)}}else switch(null==n?void 0:n.type){case"multi":{const t=new Map,i=new Set,l=new Set;for(const e of n.targets)"node"===e.type&&(i.add(e.id),l.add(e.id));for(const a of e)"node"===a.type?t.set(a.id,a):"edge"===a.type?i.has(a.source)?l.add(a.target):i.has(a.target)?l.add(a.source):(0,o.Q)(a,n)||r.push(a):(0,o.Q)(a,n)||r.push(a);for(const[e,n]of t)l.has(e)||r.push(n);break}case"node":{const t=new Map,o=new Set([n.id]);for(const i of e)"node"===i.type?t.set(i.id,i):"edge"===i.type?i.source===n.id?o.add(i.target):i.target===n.id?o.add(i.source):r.push(i):r.push(i);for(const[e,n]of t)o.has(e)||r.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))||r.push(t)}return r}},531:(e,t,n)=>{n.d(t,{N:()=>i,OD:()=>f,VF:()=>h,WW:()=>a,_m:()=>v,bo:()=>d,jw:()=>m,kN:()=>g,mH:()=>r,nv:()=>c,o6:()=>s,om:()=>p,t2:()=>u,vC:()=>l});var o=n(1030);function i(e){return"node"===e.type}function r(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&&"line"===e.decorator}function f(e){return!["manual",void 0].includes(e)}function h(e){return!(e.width&&e.height)}function g(e){return(0,o.isNil)(e.x)||(0,o.isNil)(e.y)}function m(e){return!("polyline"===e||"curve"===e)}function p(e){return!!e.edge}},967:(e,t,n)=>{n.d(t,{V:()=>u,P:()=>v});var o=n(1030),i=n(8875),r=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,p){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"===p?[{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 i,r,l,a;if(I)i=h(e,I);else{let r;if(C.length>1?r=C[1]:L&&(r=h(t,L)),r)i=g(n,e,n.y===r.y);else{const n=o.y<t.y||o.y>t.y+t.height?"ns":"ew";({point:i,direction:l}=m(e,t,C,n))}}if(L)r=h(t,L);else{let i;if(C.length>1?i=C[C.length-2]:I&&(i=h(e,I)),i)r=g(o,t,o.y===i.y);else{const o=n.x<e.x||n.x>e.x+e.width?"ew":"ns";({point:r,direction:a}=m(t,e,C.slice().reverse(),o))}}const{x:c,y:s}=i,{x:d,y:u}=r,f=[i,...C,r],p=[...C];return n&&n.x!==c&&n.y!==s&&p.unshift("ns"===l?{x:c,y:n.y}:"ew"===l?{x:n.x,y:s}:n.x===f[2].x?{x:c,y:n.y}:{x:n.x,y:s}),o&&o.x!==d&&o.y!==u&&p.push("ns"===a?{x:d,y:o.y}:"ew"===a?{x:o.x,y:u}:o.x===f[f.length-3].x?{x:d,y:o.y}:{x:o.x,y:u}),[i,...v(i,p,r),r]}const S=null!=I?I:f(t,e),N=null!=L?L:f(e,t),{x:z,y:P}=h(e,S),{x:R,y:A}=h(t,N),T=(0,i.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,j=[...H],Z=[...W];z<R?((0,o.pull)(j,"left"),(0,o.pull)(Z,"right")):((0,o.pull)(j,"right"),(0,o.pull)(Z,"left")),P<A?((0,o.pull)(j,"top"),(0,o.pull)(Z,"bottom")):((0,o.pull)(j,"bottom"),(0,o.pull)(Z,"top"));const D=null!==(k=j[0])&&void 0!==k?k:H[0],$=null!==(b=Z[0])&&void 0!==b?b:W[0],B="left"===D||"right"===D?S.y:S.x,O="left"===$||"right"===$?N.y:N.x;return(0,r.o)(l(e,a.XK),l(t,a.XK),D,$,B,O)}function v(e,t,n){const o=[];let i,r=e,l=0;for(;l<t.length;){const e=t[l],a=e.x!==r.x,c=e.y!==r.y;if(a||c){const c=a?"ew":"ns";if(c!==i){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")&&(i=c,o.push(e),r=e)}}l++}return o}function f(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 h(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,i,r,l,c;if(n?(o="y",i="x",r="height",l="width"):(o="x",i="y",r="width",l="height"),t[i]+t[l]<e[i]&&(c={[o]:.5,[i]:1}),t[i]>e[i]&&(c={[o]:.5,[i]:0}),c)return h(t,c);const s=t[o]<e[o]?1:0;return{[o]:t[o]-a.XK/2+s*(t[r]+a.XK),[i]:e[i]}}function m(e,t,n,o){let i,r,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])i={[l]:v[l],[a]:e[a]+e[s]},r=d;else if(v[a]<e[a])i={[l]:v[l],[a]:e[a]},r=d;else{var f;const o=null!==(f=n[1])&&void 0!==f?f:t;i={[l]:v[l],[a]:o[a]<v[a]?v[a]:e[a]+e[s]},r=d}else v[a]<e[a]?(i={[l]:e[l]+e[c]/2,[a]:e[a]},r=d):v[a]>e[a]+e[s]?(i={[l]:e[l]+e[c]/2,[a]:e[a]+e[s]},r=d):v[l]<e[l]?(i={[l]:e[l],[a]:v[a]},r=u):(i={[l]:e[l]+e[c],[a]:v[a]},r=u);return{point:i,direction:r}}},1103:(e,t,n)=>{n.d(t,{X:()=>u});var o=n(8769),i=n.n(o),r=n(3373),l=n.n(r),a=n(8653),c=n(9978),s=n(967),d=n(7531);function u(e){let{transform:t,lineSettings:n,options:r}=e;const[u,v]=(0,o.useState)(null),{hoverState:f,smartConnectLineState:h,setSmartConnectLineState:g}=(0,c.s)();(0,o.useEffect)((()=>{if(h)return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),o;function e(e){v([(e.clientX-t.x-h.offset[0])/t.k,(e.clientY-t.y-h.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,h,t]);const m=(0,o.useMemo)((()=>{const e=function(e,t,n,o){if(!e||!t&&void 0===(null==n?void 0:n.activePointIndex))return null;const i=e.source.view;if(void 0!==(null==n?void 0:n.activePointIndex))return(0,s.V)(i,n.cell.view,{...o,exitPosition:e.exitPosition,entryPosition:n.relativePoints[n.activePointIndex]});const[r,l]=t;return(0,s.V)(i,{x:r,y:l,width:0,height:0},{...o,exitPosition:e.exitPosition})}(h,u,f,n);return(0,a.S)(e,"curve"===(null==n?void 0:n.type)?n.curveType:"curveLinear",0,1)}),[u,f,h,n]);let p,y;const w=(0,d.I)(r);for(const e of w)"start"===e.placement?p=r.$markerStartUrl:y=r.$markerEndUrl;return i().createElement("path",{className:l()("connect-line",{connecting:!(!h||!u)}),d:m,fill:"none",stroke:r.strokeColor,strokeWidth:r.strokeWidth,markerStart:p,markerEnd:y})}},1484:(e,t,n)=>{n.d(t,{g:()=>g});var o=n(8769),i=n(7566),r=n(9047),l=n(3033),a=n(531),c=n(4282),s=n(8802),d=n(1489),u=n(6170),v=n(9127);const f=new Map([["center",.5],["left",0],["right",1],["top",0],["bottom",1]]);function h(e,t){if("string"==typeof e){const n=f.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:f,rootRef:g,cells:m,zoomable:p,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:f,scaleRange:h,autoCenterWhenCellsChange:g,autoSize:m,padding:p}=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==m||!m.width),k=!(null==m||!m.height),b=(0,s.D)(null!=p?p:l.rn);var M,C,I,L;E&&(g=Math.min(Math.max(o.width+b[1]+b[3],null!==(M=m.minWidth)&&void 0!==M?M:0),null!==(C=m.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=m.minHeight)&&void 0!==I?I:0),null!==(L=m.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?h:void 0});f.transform((0,i.A)(e),new r.uV(S,N,z)),w(!0)}),[n,y,u,t,h,v,f,m,p]),[y,w]}({rootRef:g,layoutInitialized:M,cells:m,zoomable:p,zoomer:y,scaleRange:w,autoCenterWhenCellsChange:k,autoSize:f,padding:null==n?void 0:n.padding}),z=(0,o.useRef)(null);return(0,o.useEffect)((()=>{if(m.some((e=>(0,a.N)(e)&&!e[l.CV]))||0===m.length)return;if("force"!==t&&"dagre"!==t)return void C(!0);if(I.current!==x||(e=z.current,o=m.filter(a.nv),(null==e?void 0:e.length)===o.length&&e.every(((e,t)=>e===o[t]))))return;var e,o;let i,r;({getNodeView:i,nodePaddings:r}="force"===t?(0,u.k)({cells:m,layoutOptions:n,allowEdgeToArea:E}):(0,v.C)({cells:m,layoutOptions:n,allowEdgeToArea:E}));const c=function(e){const t=null!=e?e:[.5,.5];return[h(t[0],"x"),h(t[1],"y")]}(null==n?void 0:n.alignOrigin),s=m.map((e=>{if(E&&(0,a.o6)(e)||(0,a.N)(e)){const t=i(e.id);return{...e,view:{...e.view,x:t.x-t.width*c[0]+r[3],y:t.y-t.height*c[1]+r[0]},[l.xc]:!0}}return e}));z.current=s.filter(a.nv),b({type:"update-cells",payload:s}),C(!0)}),[m,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:i,scaleRange:r}=t;const{left:l,top:a,width:c,height:s,empty:d}=e,[u,v,f,h]=null!=i?i:[0,0,0,0],g=n-h-v,m=o-u-f,p=r&&!d&&(c>g||s>m)?Math.max(Math.min(g/c,m/s,r[1]),r[0]):1;return{x:d?0:(g-c*p)/2+h-l*p,y:d?0:(m-s*p)/2+u-a*p,k:p}}n.d(t,{P:()=>o})},1609:(e,t,n)=>{n.d(t,{m:()=>D});var o=n(8769),i=n.n(o),r=n(3373),l=n.n(r),a=n(531),c=n(1030),s=n(9126),d=n(3033),u=n(8653),v=n(7531),f=n(5903),h=n(8917);function g(e){let{edge:t,position:n,offset:o,label:r,text:a,onRendered:c,onClick:s}=e;if(!r&&!a)return null;const d=!(!n||!o);return i().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},r?i().createElement("div",{className:"line-label label"},i().createElement(p,{edge:t,label:r,onRendered:c})):i().createElement(m,{text:a,onRendered:c}))}function m(e){let{text:t,onRendered:n}=e;const r=(0,o.useCallback)((e=>{null==n||n(e)}),[n]);return i().createElement("div",{className:"line-label text",ref:r,style:t.style},t.content)}function p(e){let{edge:t,label:n,onRendered:r}=e;const l=(0,o.useMemo)((()=>(0,f.checkIfOfComputed)(n)?n.useBrick:null),[n]),a=(0,o.useMemo)((()=>({edge:t})),[t]);(0,o.useEffect)((()=>{l||setTimeout((()=>{null==r||r(null)}))}),[r,l]),(0,o.useEffect)((()=>()=>{null==r||r(null)}),[]);const c=(0,o.useCallback)((e=>{e&&setTimeout((()=>{null==r||r(e.parentElement)}))}),[r]),s=(0,o.useCallback)((()=>{setTimeout((()=>{null==r||r(null)}))}),[r]);return l?i().createElement(h.ReactUseBrick,{refCallback:c,ignoredCallback:s,useBrick:l,data:a}):null}var y=n(9386);function w(e){var t,n,r,a,f,h,m;let{edge:p,lineConfMap:w,editableLineMap:x,readOnly:E,active:k,activeRelated:b,onSwitchActiveTarget:M}=e;const C=(0,o.useRef)(null),I=w.get(p),{points:L,jumpsMap:S}=null!==(t=x.get(p))&&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),j=(0,o.useCallback)((()=>{const e=C.current,{label:t,text:n}=I;if(e&&L&&(t||n)){var o,i;const r=null!==(o=t?t.placement:n.placement)&&void 0!==o?o:"center",l=null!==(i=t?t.offset:n.offset)&&void 0!==i?i:0,a=e.getTotalLength(),c=a/2,s=e.getPointAtLength("start"===r?0:"end"===r?a:c+l);let d="center",u=0;if("start"===r||"end"===r){let e,t;"start"===r?(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]),[Z,D]=(0,o.useState)(null),$=(0,o.useCallback)((e=>{if(C.current=e,e){var t,n,o;D(null!==(t=null===(n=e.getTotalLength)||void 0===n?void 0:n.call(e))&&void 0!==t?t:100);const i=null===(o=e.getBBox)||void 0===o?void 0:o.call(e);p.view={...p.view,x:null==i?void 0:i.x,y:null==i?void 0:i.y,width:null==i?void 0:i.width,height:null==i?void 0:i.height}}j()}),[j,p]),[B,O]=(0,o.useState)(null);(0,o.useEffect)((()=>{if(!B)return void T(null);const e=new s.A((()=>{const{offsetWidth:e,offsetHeight:t}=B;T(0!==e&&0!==t?[e,t]:null)}));return e.observe(B),()=>{e.disconnect()}}),[B]);const U=(0,o.useCallback)((e=>{O(e)}),[]);(0,o.useEffect)((()=>{j()}),[j,L]);const V=(0,o.useCallback)((()=>{null==M||M((0,y.P)(p))}),[p,M]),G=(0,o.useCallback)((e=>{var t,n;!E&&I.callLabelOnDoubleClick&&(e.preventDefault(),e.stopPropagation(),null==B||null===(t=B.firstElementChild)||void 0===t||null===(n=t[I.callLabelOnDoubleClick])||void 0===n||n.call(t))}),[B,I,E]),[Y,X]=(0,o.useMemo)((()=>function(e,t){if(!e||!t)return[null,null];const[n,o,i,r,l]=e,[a,c]=t,s=n-a/2-3,d=o-c/2-3;let u=0,v=0;const f=a/2+3,h=c/2+3;switch(i){case"top":u=l*Math.cos(r)-h/Math.tan(r),v=l*Math.sin(r)-h;break;case"bottom":u=l*Math.cos(r)+h/Math.tan(r),v=l*Math.sin(r)+h;break;case"left":u=l*Math.cos(r)-f,v=l*Math.sin(r)-f*Math.tan(r);break;case"right":u=l*Math.cos(r)+f,v=l*Math.sin(r)+f*Math.tan(r)}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 ie,re;"start"===e.placement?Q=null!==(ie=I.$activeMarkerStartUrl)&&void 0!==ie?ie:I.$markerStartUrl:J=null!==(re=I.$activeMarkerEndUrl)&&void 0!==re?re: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===(r=q)||void 0===r?void 0:r.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 fe,he;Z&&(ve=Z/(null!==(fe=null===(he=q)||void 0===he?void 0:he.speed)&&void 0!==fe?fe: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===(f=I.overrides)||void 0===f||null===(f=f.activeRelated)||void 0===f||null===(f=f.motion)||void 0===f?void 0:f.shape].some((e=>"dot"===e||"triangle"===e)),me=F?`url(#${z})`:void 0;return i().createElement(i().Fragment,null,F&&i().createElement("defs",null,i().createElement("clipPath",{id:z},i().createElement("polygon",{points:F}))),i().createElement("g",{className:"line-group",onDoubleClick:G},i().createElement("path",{d:N,fill:"none",stroke:"transparent",strokeWidth:I.interactStrokeWidth,clipPath:me}),i().createElement("path",{ref:$,className:l()("line",{dashed:I.dashed,dotted:I.dotted,[(I.dashed?"dashed":I.dotted?"dotted":"solid")+"-animation"]:I.animate.useAnimate}),clipPath:me,style:{"--time":`${null!==(h=I.animate.duration)&&void 0!==h?h:d.Be}s`,"--solid-length":Z},d:N,fill:"none",stroke:_,strokeWidth:K,markerStart:Q,markerEnd:J}),!(null!==(m=I.overrides)&&void 0!==m&&m.active)&&i().createElement("path",{className:"line-active-bg",d:N,fill:"none",clipPath:me}),ge&&ve&&i().createElement("path",{className:l()("motion",{visible:!!ue}),d:ue,fill:_},i().createElement("animateMotion",{dur:ve,repeatCount:"indefinite",rotate:"auto",path:N}))),i().createElement(g,{edge:p,position:P,offset:X,label:I.label,text:I.text,onClick:V,onRendered:U}))}var x=n(9575);function E(e){let{x:t,y:n}=e;return i().createElement("g",{transform:`translate(${t}, ${n}) scale(0.0234375)`,className:"lock-icon"},i().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:r,y:l,degraded:a,degradedNodeLabel:d,defaultNodeBricks:u,locked:v,containerLocked:g,onResize:m}=e;const p=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}}),y=n.useBrick,w=n.component,k=(0,o.useRef)(null),{useBrick:b,component:M}=null!==(t=(0,o.useMemo)((()=>a?null:y?{useBrick:y}:w?{component:w}:null==u?void 0:u.find((e=>(0,f.checkIfByTransform)(e,p)))),[u,a,p,w,y]))&&void 0!==t?t:{},C=(0,o.useMemo)((()=>a?String(f.__secret_internals.legacyDoTransform(p,null!=d?d:"<% DATA.node.id %>")):""),[a,d,p]),I=(0,o.useRef)(null),L=(0,o.useRef)(r),S=(0,o.useRef)(l),N=(0,o.useCallback)((e=>{I.current=e;const t=k.current;t&&(t.disconnect(),k.current=null),e?(null!=L.current&&null!=S.current&&(e.style.left=`${L.current}px`,e.style.top=`${S.current}px`),setTimeout((()=>{const t=new s.A((()=>{m(n.id,[e.offsetWidth,e.offsetHeight])}));t.observe(e),k.current=t}))):m(n.id,null)}),[n.id,m]);(0,o.useEffect)((()=>{L.current=r,S.current=l;const e=I.current;e&&null!=r&&null!=l&&(e.style.top=`${l}px`,e.style.left=`${r}px`)}),[r,l]);const z=(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]),P=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const e=P.current;if(!e||!/firefox/i.test(navigator.userAgent))return;e.style.overflow="hidden";const t=setTimeout((()=>{e.style.overflow="visible"}),500);return()=>clearTimeout(t)}),[]),i().createElement(i().Fragment,null,b||M?i().createElement("foreignObject",{width:9999,height:9999,className:"node",ref:P},M?i().createElement(M,(0,x.A)({},p,{refCallback:N})):i().createElement(h.ReactUseBrick,{useBrick:b,data:p,refCallback:N})):a?i().createElement("g",{className:"degraded",ref:z},i().createElement("circle",{cx:8,cy:8,r:8}),i().createElement("text",{x:8,y:32},C)):null,v&&!g&&null!=r&&null!=l&&i().createElement(E,{x:r+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 r of null!==(o=null==t||null===(i=t.split(/\s+/g))||void 0===i?void 0:i.flatMap((e=>"all"===e?b:e)))&&void 0!==o?o:[]){var o,i;let t;const l=e.x+e.width/2,a=e.y+e.height/2;switch(r){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: "${r}"`)}n[r]=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:i,scale:r,layout:l,layoutOptions:c,activeTarget:s,cells:u,onCellsMoving:v,onCellsMoved:f,onCellResizing:h,onCellResized:g,onSwitchActiveTarget:m,updateCurActiveEditableLine:p}=t;if(e.stopPropagation(),2===e.button||0===e.button&&e.ctrlKey)return;const w=(0,L.Q)(i,s),x=(0,C.E)(u);let E=!1;if(e.shiftKey){const e=s?"multi"===(null==s?void 0:s.type)?s.targets:[s]:[];let t=[];w?t=e.filter((e=>!(0,I.c)(e,i))):(t=[...e,i],E=!0),null==m||m(t.length>0?{type:"multi",targets:t}:null)}else"resize"!==o&&w||(null==m||m((0,y.P)(i)),E=!0);if((0,C.l)(i,x))return;if(E&&((0,a.WW)(i)||(0,a._m)(i))&&(null==p||p(i)),(0,a.WW)(i))return;const k=[],b="multi"===(null==s?void 0:s.type)&&"move"===o?u.filter((e=>(0,L.Q)(e,s))):[i];b.forEach((e=>{k.push(e),"move"===o&&(0,a.t2)(e)&&k.push(...u.filter((t=>(0,a.N)(t)&&t.containerId===e.id&&!b.includes(t))))}));const z="force"===l||"dagre"===l,P=k.filter((e=>!(0,C.l)(e,x)&&((0,a.N)(e)&&!z||(0,a.mH)(e))));if(0===P.length)return;const R=function(e){var t,n,o;const i=e?!0===e?{grid:!0,object:!0}:e:null,r=null!=i&&i.grid?!0===i.grid?{}:i.grid:null,l=null!=i&&i.object?!0===i.object?{}:i.object:null;return{grid:r?{size:null!==(t=r.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==c?void 0:c.snap),A=null===(n=R.object)||void 0===n?void 0:n.positions,T=[e.clientX,e.clientY],H=P.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,A)}))),W=H[0].position;let j=[];if("move"===o&&R.object){const e=u.filter((e=>!(0,a.WW)(e)&&!(0,a._m)(e)&&!k.includes(e)));j=e.map((e=>({cell:e,snapPositions:M(e.view,A)})))}let Z=!1;const D=(e,t)=>{const n=function(e){return[(e.clientX-T[0])/r,(e.clientY-T[1])/r]}(e),l=[...n];let c,s,d,u,m;if(Z||(Z=n[0]**2+n[1]**2>=9),!R.grid&&!R.object||e.altKey)c=H.map((e=>{let{position:t}=e;return[t[0]+n[0],t[1]+n[1]]}));else{let e=1/0,t=1/0;if(R.object){const o=R.object.distance;let i,r,a,c,v=0,f=0;for(const{cell:s,snapPositions:d}of j)for(const{cell:h,snapPositions:g}of H)for(const[p,y]of Object.entries(g)){const g=S.includes(p),w=N.includes(p),[x,E]=d[p],[k,b]=y;if(g){const t=Math.abs(k+n[0]-x);t<o&&t<e&&(e=t,l[0]=x-k,u=h,a=s,i=[x,E],v=b)}if(w){const e=Math.abs(b+n[1]-E);e<o&&e<t&&(t=e,l[1]=E-b,m=h,c=s,r=[x,E],f=k)}}if(a&&a===c){const e=a.view.height/2,t=a.view.width/2;s=[[i[0],i[1]-e],[i[0],i[1]+e]],d=[[r[0]-t,r[1]],[r[0]+t,r[1]]]}else i&&(s=[i,[i[0],v+l[1]]]),r&&(d=[r,[f+l[0],r[1]]])}if(R.grid){const o=R.grid.size,i=[Math.round((W[0]+n[0])/o)*o,Math.round((W[1]+n[1])/o)*o],r=[i[0]-W[0],i[1]-W[1]],a=Math.abs(r[0]-n[0]),c=Math.abs(r[1]-n[1]);a<e&&(e=a,l[0]=r[0],s=void 0,u=void 0),c<t&&(t=c,l[1]=r[1],d=void 0,m=void 0)}c=H.map((e=>{let{position:t}=e;return[t[0]+l[0],t[1]+l[1]]}))}if(Z)if("move"===o){var p;const e=H.map(((e,n)=>{var o;let{cell:i}=e;return{type:i.type,id:i.id,x:c[n][0],y:c[n][1],width:i.view.width,height:i.view.height,decorator:(0,a.mH)(i)?i.decorator:void 0,guideLines:t?void 0:[...u===i?[s]:[],...m===i?[d]:[]],...(0,a._m)(i)?{source:{x:i.view.source.x+l[0],y:i.view.source.y+l[1]},target:{x:i.view.target.x+l[0],y:i.view.target.y+l[1]},vertices:null===(o=i.view.vertices)||void 0===o?void 0:o.map((e=>({x:e.x+l[0],y:e.y+l[1]})))}:null}}));null===(p=t?f:v)||void 0===p||p(e)}else{var y;null===(y=t?g:h)||void 0===y||y({type:i.type,id:i.id,width:c[0][0],height:c[0][1]})}},$=e=>{D(e)},B=e=>{D(e,!0),Z=!1,document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",B)};document.addEventListener("mousemove",$),document.addEventListener("mouseup",B)}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);const H=new Map([["container",function(e){let{cell:t,transform:n,readOnly:r,layout:s,view:d,activeTarget:u,cells:v,locked:f,onCellResizing:h,onCellResized:g,onSwitchActiveTarget:m,onDecoratorTextEditing:p,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=i().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,j]=(0,o.useState)({x:0,y:0,width:t.view.width,height:t.view.height}),Z=(0,o.useCallback)((e=>{r||f||(e.preventDefault(),e.stopPropagation(),C(!0))}),[r,f]),D=(0,o.useCallback)((e=>{r||L(e.target.textContent)}),[r]),$=(0,o.useCallback)((()=>{r||(C(!1),N(!0),H((0,T.uuidV4)()))}),[r]);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)?j({width:e,height:d.height,x:"left"===x?-e:d.width,y:0}):j({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==p||p({id:t.id,editing:M})}),[t.id,M,p]),(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||r)return;const o=e=>{z(e,{action:"resize",cell:t,scale:n.k,activeTarget:u,cells:v,onCellResizing:h,onCellResized:g,onSwitchActiveTarget:m})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[u,t,v,g,h,m,r,n.k]),i().createElement("g",{className:"decorator-container"},i().createElement("foreignObject",W,i().createElement("div",{className:l()("text-container",{editing:M,[["left","right"].includes(x)?"vertical":"horizontal"]:!0}),onDoubleClick:Z,style:t.view.titleStyle},i().createElement("div",{className:"text",contentEditable:R(M),ref:k,onInput:D,onBlur:$}))),i().createElement("foreignObject",{className:"container-wrapper"},i().createElement("div",{className:"container",style:{...t.view.style,width:d.width,height:d.height}})),!r&&!f&&!(0,a.OD)(s)&&i().createElement("g",{ref:b,className:"resize-handle",transform:`translate(${d.width-20} ${d.height-20})`},i().createElement("rect",{width:20,height:20}),i().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),f&&i().createElement(E,{x:t.view.width-16,y:t.view.height-16}))}],["area",function(e){let{cell:t,transform:n,readOnly:r,layoutOptions:l,activeTarget:a,cells:c,locked:s,onCellResizing:d,onCellResized:u,onSwitchActiveTarget:v}=e;const f=i().useRef(null);return(0,o.useEffect)((()=>{const e=f.current;if(!e||r)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,r,n.k]),i().createElement("g",{className:"decorator-area-container"},i().createElement("foreignObject",{className:"decorator-area",width:"9999",height:"9999"},i().createElement("div",{className:"area",style:{...t.view.style,width:t.view.width,height:t.view.height}})),!r&&!s&&i().createElement("g",{ref:f,className:"resize-handle",transform:`translate(${t.view.width-20} ${t.view.height-20})`},i().createElement("rect",{width:20,height:20}),i().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),s&&i().createElement(E,{x:t.view.width-16,y:t.view.height-16}))}],["text",function(e){var t;let{cell:n,readOnly:r,locked:a,onDecoratorTextEditing:c,onDecoratorTextChange:s}=e;const d=null!==(t=n.view.text)&&void 0!==t?t:"",[u,v]=(0,o.useState)(d),[f,h]=(0,o.useState)(!1),g=(0,o.useRef)(!1),[m,p]=(0,o.useState)(!1),y=(0,o.useRef)(null),w=(0,o.useCallback)((e=>{r||a||(e.preventDefault(),e.stopPropagation(),h(!0))}),[r,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)((()=>{f&&y.current&&(y.current.focus(),A(y.current)),null==c||c({id:n.id,editing:f})}),[n.id,f,c]),(0,o.useEffect)((()=>{g.current?null==c||c({id:n.id,editing:f}):g.current=!0}),[n.id,f,c]);const x=(0,o.useCallback)((e=>{r||v(e.target.textContent)}),[r]),k=(0,o.useCallback)((()=>{r||(h(!1),p(!0))}),[r]);return(0,o.useEffect)((()=>{m&&(null==s||s({id:n.id,view:{...n.view,text:u}}),p(!1))}),[n,u,s,m]),i().createElement(i().Fragment,null,i().createElement("foreignObject",{className:"decorator-text",width:"9999",height:"9999"},i().createElement("div",{className:l()("text-container",{editing:f}),onDoubleClick:w,style:n.view.style},i().createElement("div",{className:"text",contentEditable:R(f),ref:y,onInput:x,onBlur:k}))),a&&i().createElement(E,{x:n.view.width,y:(n.view.height-12)/2}))}],["rect",function(e){let{cell:t,transform:n,readOnly:r,layout:l,view:c,activeTarget:s,cells:d,locked:u,onCellResizing:v,onCellResized:f,onSwitchActiveTarget:h}=e;const g=i().useRef(null);return(0,o.useEffect)((()=>{const e=g.current;if(!e||r)return;const o=e=>{z(e,{action:"resize",cell:t,scale:n.k,layout:l,activeTarget:s,cells:d,onCellResizing:v,onCellResized:f,onSwitchActiveTarget:h})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[s,t,d,f,v,h,r,n.k,l]),i().createElement("g",{className:"decorator-rect-container"},i().createElement("foreignObject",{className:"decorator-rect",width:"9999",height:"9999"},i().createElement("div",{className:"rect-container",style:{...t.view.style,width:c.width,height:c.height}})),!r&&!u&&!(0,a.OD)(l)&&i().createElement("g",{ref:g,className:"resize-handle",transform:`translate(${c.width-20} ${c.height-20})`},i().createElement("rect",{width:20,height:20}),i().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),u&&i().createElement(E,{x:t.view.width-16,y:t.view.height-16}))}],["line",function(e){var t;let{cell:n,active:r,lineConfMap:a,editableLineMap:c,locked:s}=e;const d=a.get(n),{points:f,jumpsMap:h}=null!==(t=c.get(n))&&void 0!==t?t:{},g=(0,o.useMemo)((()=>d?(0,u.S)(f,"curve"===d.type?d.curveType:"curveLinear",0,1,h):null),[d,f,h]),m=(0,o.useRef)(null),p=(0,o.useCallback)((e=>{if(m.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&&f?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,i=t.x-n.x;let r;r=Math.abs(o)>Math.abs(i)?o>0:i>0;const l=r?e[e.length-2]:e[1],a=r?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}}(f):null),[s,f]);if(!g||!d)return null;let w,x,k,b;const M=(0,v.I)(d);if(r){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 i().createElement("g",{className:"decorator-line"},i().createElement("path",{d:g,fill:"none",stroke:"transparent",strokeWidth:d.interactStrokeWidth}),i().createElement("path",{className:l()("line",{dashed:d.dashed,dotted:d.dotted}),ref:p,d:g,fill:"none",stroke:k,strokeWidth:b,markerStart:w,markerEnd:x}),s&&i().createElement(E,{x:y.x,y:y.y}))}]]);function W(e){let{cell:t,view:n,transform:o,readOnly:r,layout:l,layoutOptions:a,active:c,activeTarget:s,cells:d,lineConfMap:u,editableLineMap:v,locked:f,onCellResizing:h,onCellResized:g,onSwitchActiveTarget:m,onDecoratorTextEditing:p,onDecoratorTextChange:y}=e;const w=H.get(t.decorator);return w?i().createElement(w,{cell:t,view:n,transform:o,readOnly:r,layout:l,layoutOptions:a,active:c,activeTarget:s,cells:d,lineConfMap:u,editableLineMap:v,locked:f,onCellResizing:h,onCellResized:g,onSwitchActiveTarget:m,onDecoratorTextEditing:p,onDecoratorTextChange:y}):(console.error(`Unknown decorator: ${t.decorator}`),null)}var j=n(4516),Z=n(9978);function D(e){let{layout:t,layoutOptions:n,cell:r,cells:s,degraded:d,degradedNodeLabel:u,defaultNodeBricks:v,lineConfMap:f,editableLineMap:h,activeTarget:g,dragoverContainer:m,readOnly:p,transform:x,hoverCell:E,unrelatedCells:b,allowEdgeToArea:M,curActiveEditableLine:C,locked:S,containerLocked:N,updateCurActiveEditableLine:P,onCellsMoving:R,onCellsMoved:A,onCellResizing:T,onCellResized:H,onSwitchActiveTarget:D,onCellContextMenu:$,onCellClick:B,onDecoratorTextEditing:O,onDecoratorTextChange:U,onNodeBrickResize:V,onCellMouseEnter:G,onCellMouseLeave:Y}=e;const{lineEditorState:X,smartConnectLineState:F,setSmartConnectLineState:Q,onConnect:J,setLineEditorState:_,onChangeEdgeView:K}=(0,Z.s)(),q=(0,o.useRef)(null),ee=(0,o.useMemo)((()=>b.some((e=>(0,I.c)(e,r)))),[r,b]),te=(0,o.useMemo)((()=>{if((0,a.t2)(r)&&(0,a.OD)(t)){const e=s.filter((e=>(0,a.N)(e)&&e.containerId===r.id)),t={...r.view,...(0,j.Z)(e)};return r.view=t,t}return(0,a.WW)(r)||(0,a._m)(r)?void 0:(0,c.get)(r,"view",{x:0,y:0,width:0,height:0})}),[t,r,s]);(0,o.useEffect)((()=>{const e=q.current;if(!e)return;const o=e=>{p||(0,a.t2)(r)&&(0,a.OD)(t)?e.stopPropagation():z(e,{layout:t,layoutOptions:n,action:"move",cell:r,scale:x.k,activeTarget:g,cells:s,onCellsMoving:R,onCellsMoved:A,onSwitchActiveTarget:D,updateCurActiveEditableLine:P})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[t,n,r,g,s,A,R,D,P,p,x.k]),(0,o.useEffect)((()=>{const e=q.current;if(!e||!(0,a.bo)(r,M)||!(F||X&&"control"!==X.type))return;const t=e=>{if(!C||!X||"decorator"!==C.type)if(e.preventDefault(),e.stopPropagation(),F)F.source!==r&&(null==J||J(F.source,r,F.exitPosition,void 0)),Q(null);else if(C&&X){const{type:e}=X,{source:t,target:n}=h.get(C),{view:o}=C,i="entry"===e;(i?n:t)===r&&(i?null==K||K(t,n,{...o,entryPosition:null}):null==K||K(t,n,{...o,exitPosition:null})),_(null)}};return e.addEventListener("mouseup",t),()=>{e.removeEventListener("mouseup",t)}}),[C,h,M,r,X,K,J,_,Q,F,P]);const ne=(0,o.useCallback)((e=>{if(p&&"decorator"===r.type)return;e.preventDefault(),e.stopPropagation();let t=g;(0,L.Q)(r,g)||(t=(0,y.P)(r),D(t)),$({cell:r,clientX:e.clientX,clientY:e.clientY,locked:S,target:t})}),[p,r,g,$,S,D]),oe=(0,o.useCallback)((e=>{B&&"decorator"!==r.type&&B({cell:r,clientX:e.clientX,clientY:e.clientY,locked:S})}),[r,B,S]),ie=(0,o.useCallback)((()=>{null==G||G(r)}),[r,G]),re=(0,o.useCallback)((()=>{null==Y||Y(r)}),[r,Y]),le=(0,L.Q)(r,g);return i().createElement("g",{className:l()("cell",{active:le,faded:ee,"read-only":p,"container-dragover":m}),ref:q,transform:(0,a.N)(r)&&!d||(0,a.WW)(r)||(0,a._m)(r)||null==r.view.x||null==r.view.y?void 0:`translate(${te.x},${te.y})`,onContextMenu:ne,onClick:oe,onMouseEnter:ie,onMouseLeave:re},(0,a.N)(r)?i().createElement(k,{node:r,x:null==te?void 0:te.x,y:null==te?void 0:te.y,degraded:d,degradedNodeLabel:u,defaultNodeBricks:v,locked:S,containerLocked:N,onResize:V}):(0,a.WW)(r)?i().createElement(w,{edge:r,active:p?E===r:le,activeRelated:!!(p?E:g)&&!ee,lineConfMap:f,editableLineMap:h,readOnly:p,onSwitchActiveTarget:D}):(0,a.mH)(r)?i().createElement(W,{cell:r,view:te,transform:x,readOnly:p,layout:t,layoutOptions:n,active:le,activeTarget:g,cells:s,lineConfMap:f,editableLineMap:h,locked:S,onCellResizing:T,onCellResized:H,onSwitchActiveTarget:D,onDecoratorTextEditing:O,onDecoratorTextChange:U}):null)}},1819:(e,t,n)=>{n.d(t,{J:()=>r});var o=n(8769),i=n(8185);function r(e){let{rootRef:t,activeTarget:n,doNotResetActiveTargetForSelector:r,doNotResetActiveTargetOutsideCanvas:l,onActiveTargetChange:a}=e;const c=null!=n?n:null,[s,d]=(0,o.useState)(c);(0,o.useEffect)((()=>{d((e=>(0,i.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)||r&&n.some((e=>e instanceof Element&&e.matches(r))))||d(null)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[s,l,r,t]),s}},1825:(e,t,n)=>{n.d(t,{W:()=>g});var o=n(8769),i=n.n(o),r=n(3373),l=n.n(r),a=n(8653),c=n(9978),s=n(1030),d=n(967),u=n(531);function v(e,t,n,o){const{control:i}=t,{points:r}=n.get(e),l=[],[a,c]=o,s=r[0],u=r[r.length-1];0===i.index&&l.push("ns"===i.direction?{x:s.x,y:c}:{x:a,y:s.y});for(let e=1;e<r.length-1;e++){const t=r[e];l.push(e===i.index||e===i.index+1?"ns"===i.direction?{x:t.x,y:c}:{x:a,y:t.y}:t)}return i.index===r.length-2&&l.push("ns"===i.direction?{x:u.x,y:c}:{x:a,y:u.y}),(0,d.P)(s,l,u)}var f=n(7531);const h=["control","corner","break"];function g(e){let{cells:t,editableLineMap:n,transform:r,options:g,activeEditableLine:m}=e;const[p,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(!m||!x)return;M.current=!1;const{type:e,offset:o,from:i}=x,l=l=>{const a={x:(l.clientX-r.x-o[0])/r.k,y:(l.clientY-r.y-o[1])/r.k},c=n.get(m).points,s={x:1/0,y:1/0};let d,v;const f=()=>{if(!M.current){const e=(l.clientX-i[0])/r.k,t=(l.clientY-i[1])/r.k;M.current=e**2+t**2>=9}return[a.x,a.y]};if(h.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)(m)||"exit"!==e&&"entry"!==e||l.altKey)return f();{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===m)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 f()},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)(m);if("control"!==(null==x?void 0:x.type)){if(!o)switch(null==x?void 0:x.type){case"entry":case"exit":null==b||b(m,{...m.view,["entry"===x.type?"target":"source"]:{x:t[0],y:t[1]}});break;case"corner":null==b||b(m,{...m.view,vertices:m.view.vertices.map(((e,n)=>n===x.control.index?{x:t[0],y:t[1]}:e))});break;case"break":{var i;const e=[...null!==(i=m.view.vertices)&&void 0!==i?i:[]];e.splice(x.control.index,0,{x:t[0],y:t[1]}),null==b||b(m,{...m.view,vertices:e});break}}}else if(o){const e=n.get(m),{source:o,target:i}=e;null==k||k(o,i,{...m.view,vertices:v(m,x,n,t)})}else null==b||b(m,{...m.view,vertices:v(m,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}),[m,n,x,r,E,k,t,b]),(0,o.useEffect)((()=>{if(!m)return;const e=e=>{M.current&&(e.stopPropagation(),e.preventDefault())};return document.body.addEventListener("click",e),()=>{document.body.removeEventListener("click",e)}}),[m]);const C=(0,o.useMemo)((()=>{const e=function(e,t,n,o,i){if(!e||!t||!(o||"control"!==t.type&&void 0!==(null==i?void 0:i.activePointIndex)))return null;const r=n.get(e);if(!r)return null;const{type:l}=t;let a,c;const f=e.type;if((0,u.om)(r))a=r.source.view,c=r.target.view;else{const e=r.decorator.view;a={...e.source,width:0,height:0},c={...e.target,width:0,height:0}}const h=e.view,{exitPosition:g,entryPosition:m,vertices:p}=null!=h?h:{},y=(0,s.pick)(h,["type","curveType"]);if("control"===l){const i=v(e,t,n,o);return(0,d.V)(a,c,{...y,exitPosition:g,entryPosition:m,vertices:i},0,f)}if("corner"===l){const e=[...p];return e.splice(t.control.index,1,{x:o[0],y:o[1]}),(0,d.V)(a,c,{...y,exitPosition:g,entryPosition:m,vertices:e},0,f)}if("break"===l){const e=[...null!=p?p:[]];return e.splice(t.control.index,0,{x:o[0],y:o[1]}),(0,d.V)(a,c,{...y,exitPosition:g,entryPosition:m,vertices:e},0,f)}if("edge"===f&&void 0!==(null==i?void 0:i.activePointIndex)){const e=i.relativePoints[i.activePointIndex];return(0,d.V)(a,c,{...y,..."entry"===l?{exitPosition:g,entryPosition:e}:{exitPosition:e,entryPosition:m},vertices:p},0,f)}const[w,x]=o;return"entry"===l?(0,d.V)(a,{x:w,y:x,width:0,height:0},{...y,exitPosition:g,vertices:p},0,f):(0,d.V)({x:w,y:x,width:0,height:0},c,{...y,entryPosition:m,vertices:p},0,f)}(m,x,n,p,w),t=null==m?void 0:m.view;return(0,a.S)(e,"curve"===(null==t?void 0:t.type)?t.curveType:"curveLinear",0,1)}),[p,w,m,x,n]);let I,L;const S=(0,f.I)(g);for(const e of S)"start"===e.placement?I=g.$editingStartMarkerUrl:L=g.$editingEndMarkerUrl;return i().createElement("path",{className:l()("editing-line",{editing:!(!x||!p)}),d:C,fill:"none",stroke:g.editingStrokeColor,markerStart:I,markerEnd:L})}},1991:(e,t,n)=>{n.d(t,{_:()=>i});var o=n(531);function i(e,t,n){const i=t.filter((e=>(0,o.N)(e))),r=e.filter((e=>(0,o.t2)(e))).map((e=>e.id)),l=e.filter((e=>{const t=i.find((t=>t.id===e.id)),n=(null==t?void 0:t.containerId)&&r.includes(t.containerId);return(0,o.N)(e)&&!n}));l.forEach((e=>{const n=e.x,i=e.x+e.width,r=e.y,l=e.y+e.height,a=t.filter((e=>{var t;return(0,o.t2)(e)&&!(null!==(t=e.view)&&void 0!==t&&t.locked)}));for(const t of a){const o=t.view.x,a=t.view.x+t.view.width,c=t.view.y,s=t.view.y+t.view.height;if(n>=o&&i<=a&&r>=c&&l<=s){e.containerCell=t;break}}}));let a=[];return a=l.filter((e=>{var t;const n=i.find((t=>t.id===e.id));return(null==n?void 0:n.containerId)!==(null===(t=e.containerCell)||void 0===t?void 0:t.id)})),a.length>0&&(null==n||n(a)),a}},2202:(e,t,n)=>{n.d(t,{F:()=>f});var o=n(9575),i=n(8769),r=n.n(i),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 f(e){let{scale:t,editableLineMap:n,activeEditableLine:f,updateCurActiveEditableLine:h}=e;const{rootRef:g,movingCells:m,lineEditorState:p,setLineEditorState:y}=(0,l.s)(),w=(0,i.useRef)(null),x=(0,i.useRef)(null),E=(0,i.useRef)([]),k=(0,a._m)(f);(0,i.useEffect)((()=>{const e=w.current,t=x.current;if(!e||!t||!f)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==h||h(f)},o=n("exit"),i=n("entry");return e.addEventListener("mousedown",o),t.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",o),t.removeEventListener("mousedown",i)}}),[f,g,y,h]);const b=(0,i.useMemo)((()=>{var e;if(!f)return[];const t=n.get(f).points;return(0,a.jw)(null===(e=f.view)||void 0===e?void 0:e.type)?k?function(e){const t=[];let n=e[0],o=1;for(;o<e.length;){const i=e[o];t.push({type:"break",index:o-1,x:(n.x+i.x)/2,y:(n.y+i.y)/2}),o<e.length-1&&t.push({...i,type:"corner",index:o-1}),n=i,o++}return t}(t):[]:function(e){const t=[];let n=e[0],o=1;for(;o<e.length;){const i=e[o],r=n.y===i.y,l=n.x===i.x;if(!r||!l){const e=r?"ns":"ew";t.push({type:"control",direction:e,index:o-1,x:(n.x+i.x)/2,y:(n.y+i.y)/2})}n=i,o++}return t}(t)}),[f,n,k]);(0,i.useEffect)((()=>{if(!f)return;const e=E.current,t=b.map((e=>(e=>t=>{t.stopPropagation(),t.preventDefault(),null==h||h(f);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])}))}}),[f,b,g,y,h]);const M=(0,i.useRef)(null);if((0,i.useEffect)((()=>{const e=M.current,t=e=>{e.stopPropagation(),e.preventDefault()};return null==e||e.addEventListener("click",t),()=>{null==e||e.removeEventListener("click",t)}}),[]),m)return null;const C=f.view,I=n.get(f).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 r().createElement("g",{ref:M},r().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)=>r().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==p?void 0:p.type)&&p.control===e?1:.4,xlinkHref:u,cursor:k?"crosshair":"ns"===e.direction?"row-resize":"col-resize"})))),r().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:i,onLassoed:r}=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?r:i)({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})},2722:(e,t,n)=>{n.d(t,{T:()=>f});var o=n(8769),i=n.n(o),r=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 f(e){let{activeTarget:t,editableLineMap:n,scale:s,activeEditableLine:d,disabled:v}=e;const{unsetHoverStateTimeoutRef:f,hoverState:g,setHoverState:m,smartConnectLineState:p,lineEditorState:y}=(0,r.s)(),w=(0,o.useCallback)((()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)}),[f]),x=(0,o.useCallback)((()=>{w(),m((e=>void 0===(null==e?void 0:e.activePointIndex)?e:{...g,activePointIndex:void 0}))}),[g,m,w]),E=(0,o.useCallback)((()=>{f.current=setTimeout((()=>{m(null)}))}),[m,f]);let k,b,M;const C=!v&&g&&(!!p||(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 i().createElement("g",{onMouseEnter:x,onMouseLeave:E},C&&i().createElement(i().Fragment,null,i().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&&i().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)=>i().createElement(h,{key:t,editableLineMap:n,index:t,point:e,scale:s,activeEditableLine:d,unsetActivePointIndex:x,unsetTimeout:w})))))}function h(e){let{editableLineMap:t,index:n,point:l,scale:a,activeEditableLine:c,unsetTimeout:f,unsetActivePointIndex:h}=e;const{rootRef:g,smartConnectLineState:m,hoverState:p,setHoverState:y,setSmartConnectLineState:w,onConnect:x,lineEditorState:E,setLineEditorState:k,onChangeEdgeView:b}=(0,r.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)),f(),y((e=>e&&e.activePointIndex!==n?{...p,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)}}),[p,n,y,f]),(0,o.useEffect)((()=>{if(E)return;const e=e=>{e.preventDefault(),e.stopPropagation();const t=g.current.getBoundingClientRect(),o=p.points[n];w({source:p.cell,from:[o.x,o.y],offset:[t.left,t.top],exitPosition:p.relativePoints[n]})},t=M.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[p,n,E,g,w]),(0,o.useEffect)((()=>{const e=e=>{if(!c||!E||"decorator"!==c.type)if(e.preventDefault(),e.stopPropagation(),m)m.source!==(null==p?void 0:p.cell)&&(null==x||x(m.source,p.cell,m.exitPosition,p.relativePoints[p.activePointIndex])),w(null);else if(c&&E){const e=p.relativePoints[p.activePointIndex],{type:n}=E,{source:o,target:i}=t.get(c),{view:r}=c;"entry"===n?null==b||b(o,i,{...r,entryPosition:e}):null==b||b(o,i,{...r,exitPosition:e}),k(null)}},n=M.current;return null==n||n.addEventListener("mouseup",e),()=>{null==n||n.removeEventListener("mouseup",e)}}),[m,p,x,w,c,E,t,b,k]),i().createElement("g",{ref:M,onMouseLeave:h},i().createElement("circle",{cx:l.x,cy:l.y,r:u,fill:"transparent"}),i().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:()=>r});var o=n(8944),i=n(4197);function r(e,t){let{cells:n,activeTarget:r,lockedContainerIds:l}=t;const a=n.filter((e=>(0,i.Q)(e,r)&&!(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:()=>r});var o=n(531),i=n(4197);function r(e,t,n,r){const l=[],a=[];for(const t of n)if((0,i.Q)(t,e)){var c;if((0,o.N)(t)&&t.containerId&&r.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),i=n.n(o),r=n(935),l=n.n(r)()(i());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)}.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.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:()=>h,CV:()=>o,D9:()=>a,Dm:()=>l,Go:()=>S,HP:()=>r,Ie:()=>g,Jo:()=>I,N8:()=>c,Ub:()=>p,VO:()=>f,XK:()=>M,XV:()=>m,Yl:()=>L,Yt:()=>u,gx:()=>x,ld:()=>E,mF:()=>v,o5:()=>k,p6:()=>b,pC:()=>w,rn:()=>C,sS:()=>d,w1:()=>s,xc:()=>i});const o=Symbol.for("size-initialized"),i=Symbol.for("layout-initialized"),r=20,l=36,a=50,c=180,s=120,d=.5,u=2,v="gray",f=1,h="rgba(73, 126, 255, 0.7)",g=15,m=!1,p=!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:()=>h});var o=n(1030),i=n(3033),r=n(531),l=n(3783),a=n(4282),c=n(1489),s=n(6170),d=n(9127),u=n(8185);function v(e,t,n,o,i,r,l,a){const c=e+n/2,s=t+o/2,d=i+l/2,u=r+a/2,v=(n+l)/2,f=(o+a)/2;return Math.abs(c-d)<v&&Math.abs(s-u)<f}var f=n(4430);function h(e){let{cells:t,layout:n,previousCells:h,defaultNodeSize:g,canvasWidth:m,canvasHeight:p,scaleRange:y,transform:w,reason:x,parent:E,allowEdgeToArea:k,layoutOptions:b}=e;const M="force"!==n&&"dagre"!==n,C=(0,l.C)(t,{defaultNodeSize:g,layoutOptions:b,isInitialize:!1}),I=[];let L=!1;const S=new Map;let N=!1;for(const e of h)(0,r.mH)(e)?N=!0:(0,r.N)(e)&&(N=!0,e[i.CV]&&S.set(e.id,e));const z=new Map;for(const e of C)if((0,r.N)(e)){z.set(e.id,e);const t=S.get(e.id);t&&(e.view.width=t.view.width,e.view.height=t.view.height,e[i.CV]=!0)}let P=!1;if("add-related-nodes"===x&&E){const e=new Set;for(const t of C)(0,r.WW)(t)&&t.source===E&&t.target!==E&&e.add(t.target);const t=z.get(E);if(void 0!==(null==t?void 0:t.view.x)&&void 0!==t.view.y){if(P=!0,M)for(const t of C)((0,r.N)(t)&&void 0===t.view.x||(0,r.N)(t)&&void 0===t.view.y)&&e.add(t.id);const n=[...e].map((e=>z.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):I.push(e);if(I.length>0&&M){let e,n;if(o)e=o.view.x+o.view.width+i.Dm,n=o.view.y;else{const o=I.reduce(((e,t)=>e+t.view.width+i.Dm),-i.Dm);e=t.view.x-o/2+t.view.width/2,n=t.view.y+t.view.height+i.D9}for(const t of I)t.view.x=e,t.view.y=n,e+=t.view.width+i.Dm}}}if(!P){const e=[];let t=!1;for(const n of C)(0,r.N)(n)?(0,r.kN)(n.view)?I.push(n):e.push(n):(0,r.mH)(n)&&(t=!0);if(M){let n;N||(w=function(e,t){const n=(0,a.S)(e);return(0,c.P)(n,t)}((0,o.without)(C,...I),{canvasWidth:m,canvasHeight:p,scaleRange:y})),0===e.length||1===e.length&&!t&&I.length>0?(I.push(...e),({getNodeView:n}=(0,d.C)({cells:C,allowEdgeToArea:k})),L=0===h.length||h.length===C.length&&h.every(((e,t)=>(0,u.c)(e,C[t])))):({getNodeView:n}=(0,s.k)({cells:C,fixedPosition:!0,allowEdgeToArea:k,center:[(m/2-w.x)/w.k,(p/2-w.y)/w.k]}));const i=C.filter((e=>(0,r.t2)(e)&&(0,r.VF)(e.view)));if(i.length>0){const e="layered-staggered"===(0,o.get)(b,"initialLayout")?"staggered":"dagre";(0,f.a)(C,{nodeLayout:e}),I.push(...i)}else!function(e,t){let{defaultNodeSize:n}=t;const i=e.filter((e=>"node"===e.type&&(0,r.kN)(e.view)&&!(0,o.isNil)(e.containerId)));if(!i.length)return;const l={};(0,o.forEach)((0,o.groupBy)(i,"containerId"),((e,t)=>{l[t]=e})),e.filter((e=>(0,r.t2)(e)&&l[e.id])).forEach((t=>{const o=t.id,i=t.view,a=e.filter((e=>(null==e?void 0:e.containerId)===o&&!(0,r.kN)(e.view))).map((e=>({x:e.view.x,y:e.view.y})));l[o].forEach((e=>{var t,o;const r=(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],c=function(e,t,n,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;const{x:l,y:a,width:c}=e,s=n+i,d=o+i,u=Math.floor((c-2*r)/s);let f=0;for(;;){for(let e=0;e<u;e++){const i=l+r+e*s,c=a+r+f*d;if(!t.some((e=>v(i,c,n,o,e.x,e.y,n,o))))return{x:i,y:c}}f++}}(i,a,r,l,10,20);c&&(e.view={...e.view,x:c.x,y:c.y},a.push(c))}))}))}(C,{defaultNodeSize:g});for(const e of C)if((0,r.N)(e)&&(0,r.kN)(e.view)){const t=n(e.id);e.view.x=t.x,e.view.y=t.y}}}return{cells:C,updated:I,shouldReCenter:L}}},3639:(e,t,n)=>{n.d(t,{w:()=>a});var o=n(8769),i=n.n(o),r=n(3373),l=n.n(r);function a(e){let{connectLineState:t,transform:n,markerEnd:r,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))},i=e=>{e.stopPropagation()},r=n=>{n.stopPropagation(),l(),a(t,e(n))},l=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mousedown",i,{capture:!0}),document.removeEventListener("click",r,{capture:!0}),s(null)};return document.addEventListener("mousemove",o),document.addEventListener("mousedown",i,{capture:!0}),document.addEventListener("click",r,{capture:!0}),l}}),[t,a,n]),i().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(#${r})`})}},3783:(e,t,n)=>{n.d(t,{C:()=>l});var o=n(1030),i=n(531),r=n(4430);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,r.a)(c,{nodeLayout:"dagre"}):"layered-staggered"===(0,o.get)(l,"initialLayout")&&(0,r.a)(c,{nodeLayout:"staggered"})),c.map((e=>{var t,o;return!(0,i.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}}}))}},4117:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(8769),i=n(531);function r(e,t){return e.find((e=>(0,i.o6)(e)&&e.id===t))}var l=n(967),a=n(1030),c=n(4525);const s=6;function d(e,t,n,o,i){const r=(0,c.y)([e.x,e.y],[t.x,t.y],[n.x,n.y],[o.x,o.y]);if(r){const l=i*i;for(const i of[e,t,n,o]){const e=r[0]-i.x,t=r[1]-i.y;if(e*e+t*t<l)return null}return{x:r[0],y:r[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 i=[],r=[];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=[],f=s/2+o.strokeWidth-1;if(o.jumps)e:for(const n of t){const t=d(c,u,n.start,n.end,f);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))<f+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:f};e.push(t),i.push(t)}r.push({start:c,end:u})}t.push(...r)}return i.length>0?new Map(i.map((e=>[e.index,e]))):null}}();for(const a of t)if((0,i.WW)(a)){var c;const s=n.get(a);if(!s)continue;const d=r(t,a.source),u=r(t,a.target),v=(0,i.jw)(null===(c=a.view)||void 0===c?void 0:c.type)&&t.some((e=>{var t;return(0,i.WW)(e)&&a.source===e.target&&a.target===e.source&&(0,i.jw)(null===(t=e.view)||void 0===t?void 0:t.type)}))?s.parallelGap:0,f=d&&u&&null!=d.view.x&&null!=u.view.x?(0,l.V)(d.view,u.view,a.view,v,a.type):null;if(f){const t=o(f,s);e.set(a,{edge:a,points:f,source:d,target:u,parallelGap:v,jumpsMap:t})}}else if((0,i._m)(a)){const t=n.get(a);if(!t)continue;const{source:i,target:r}=a.view,c=i&&r?(0,l.V)({...i,width:0,height:0},{...r,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:()=>i});var o=n(8185);function i(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:()=>i});var o=n(531);function i(e){const t=[];let n=!0;for(const i of e)(0,o.WW)(i)||(n=!1,t.push(i.view));const{x:i,y:r,width:l,height:a}=function(e){let t=1/0,n=1/0,o=-1/0,i=-1/0;for(const r of e){const e=r.x+r.width,l=r.y+r.height;r.x<t&&(t=r.x),e>o&&(o=e),r.y<n&&(n=r.y),l>i&&(i=l)}return{x:t,y:n,width:o-t,height:i-n}}(t);return{left:i,top:r,width:l,height:a,empty:n}}},4430:(e,t,n)=>{n.d(t,{a:()=>c});var o=n(1030),i=n(531),r=n(9127),l=n(4516),a=n(3033);function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.filter((e=>"node"===e.type&&!(0,o.isNil)(e.containerId)));if(!n.length)return;const{nodeLayout:c="dagre"}=t,s=e.filter(i.WW),d=e.filter(i.t2),u={},v={};(0,o.forEach)((0,o.groupBy)(n,"containerId"),((e,t)=>{u[t]=e,v[t]=new Set(e.map((e=>e.id)))})),s.forEach((e=>{for(const[t,n]of Object.entries(v))if(n.has(e.source)&&n.has(e.target)){u[t].push(e);break}}));let f=0,h=0,g=[];const m=[];(0,o.orderBy)(d.filter((e=>u[e.id])),[e=>(0,i.VF)(e.view)?1:0,e=>(0,o.get)(e,"view.level",1)],["asc","asc"]).map((e=>e.id)).forEach((e=>{const t=d.find((t=>t.id===e)),n=u[e];["top","bottom"].includes((0,o.get)(t,"view.direction","top"))&&(f+=a.Yl);const s=n.filter((e=>"node"===e.type));if("dagre"===c){const{getNodeView:e}=(0,r.C)({cells:n});g=s.map((t=>{if((0,i.kN)(t.view)){const n=e(t.id);t.view={...t.view,x:n.x,y:n.y+f,width:n.width,height:n.height}}return t}))}else"staggered"===c&&(g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{gapX:n=50,gapY:i=50,offsetY:r=a.Yl,maxPerRow:l=a.Go}=t,c=l,s=l-1,d=[];let u=0,v=0;for(;u<e.length;){const t=e[u],l=(0,o.get)(t,"view.width",a.HP),f=(0,o.get)(t,"view.height",a.HP),h=v%2==1,g=h?s:c,m=h?(l+n)/2:0;for(let t=0;t<g&&u<e.length;t++,u++){const o=m+t*(l+n),a=v*(f+i)+r;e[u].view={...e[u].view,x:o,y:a,width:l,height:f},d.push(e[u])}v++}return d}(s,{offsetY:f}));let v=0,p=0;if((0,i.VF)(t.view)){const e=(0,l.Z)(g);v=(0,o.get)(e,"height",a.w1),p=(0,o.get)(e,"width",a.N8),t.view={...t.view,...e},m.push(t)}else v=(0,o.get)(t,"view.height"),p=(0,o.get)(t,"view.width");h=Math.max(p,h),f+=v+50})),m.forEach((e=>{e.view.width=Math.max(a.N8,h)}))}},4516:(e,t,n)=>{function o(e){let t=1/0,n=1/0,o=-1/0,i=-1/0;return e.forEach((e=>{const{x:r,y:l,width:a,height:c}=e.view;r<t&&(t=r),l<n&&(n=l),r+a>o&&(o=r+a),l+c>i&&(i=l+c)})),[t,o,n,i].some((e=>isFinite(e)))?{x:t-40,y:n-40,width:o-t+80,height:i-n+80}:{}}n.d(t,{Z:()=>o})},5748:(e,t,n)=>{n.d(t,{d:()=>d});var o=n(1030),i=n(531),r=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 i=e.map((e=>{const i=t.payload.find((t=>e.type===t.type&&e.id===t.id));return i?(n=!0,{...e,view:{...e.view,x:i.x,y:i.y,...(0,o.pick)(i,"source","target","vertices")}}):e}));return n?i:e}case"resize-cell":{const{type:n,id:o,width:i,height:r}=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:i,height:r}},...e.slice(l+1)]}return e}case"update-cells":return t.payload;case"update-node-size":return e.map((e=>(0,i.N)(e)&&e.id===t.payload.id?{...e,[r.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,i]=n;return[o,i(e[o],t)]}))));var u},6170:(e,t,n)=>{n.d(t,{k:()=>v});var o=n(1030),i=n(6149),r=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:f,allowEdgeToArea:h}=e;const{nodePadding:g,collide:m}={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}},p=(0,u.D)(g),y=[],w=[],x=new Map;for(const e of t)if(h&&(0,d.o6)(e)||(0,d.N)(e)){const t={id:e.id,width:e.view.width+p[1]+p[3],height:e.view.height+p[0]+p[2],...f?{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,i.A)(w).id((e=>e.id)),k=(0,r.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 m&&k.force("collide",(0,s.A)().radius((e=>Math.sqrt(e.width**2+e.height**2)/2+m.radiusDiff)).strength(m.strength).iterations(m.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:p}}},6237:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),i=n.n(o),r=n(935),l=n.n(r)()(i());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:()=>h});var o=n(8769),i=n.n(o),r=n(1895),l=n(6768),a=n(6313),c=n(5694),s=n(8917),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"})),f=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 h(e){let{shadowRoot:t,scale:n,scaleRange:d,onZoomChange:h,onReCenter:g}=e;const m=(0,s.useCurrentTheme)(),p=(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)((()=>{h(Math.min(E+5,x))}),[x,h,E]),M=(0,o.useCallback)((()=>{h(Math.max(E-5,w))}),[w,h,E]);return i().createElement(r.Ay,{theme:{algorithm:"dark-v2"===m?l.A.darkAlgorithm:l.A.defaultAlgorithm}},i().createElement(c.N7,{container:t,autoClear:!0,cache:p,hashPriority:"high"},i().createElement("div",{className:"zoom-bar",ref:y},i().createElement("div",{className:"center-button",onClick:g,role:"button"},i().createElement(u,null)),i().createElement("div",{className:"zoom-slider"},i().createElement("div",{className:"zoom-button",role:"button",onClick:b},i().createElement(v,null)),i().createElement(a.A,{min:w,max:x,value:E,step:5,vertical:!0,included:!1,tooltip:k,onChange:h}),i().createElement("div",{className:"zoom-button",role:"button",onClick:M},i().createElement(f,null))))))}},7531:(e,t,n)=>{n.d(t,{I:()=>d,d:()=>c});var o=n(8769),i=n(5903),r=n(1030),l=n(531),a=n(3033);function c(e){let{cells:t,defaultEdgeLines:n,markerPrefix:c,lineConnector:f,useMemoizedResult:h}=e;const g=(0,o.useRef)(null);return(0,o.useMemo)((()=>{if(h&&g.current)return g.current;const e=[{strokeColor:a.mF,markerType:"arrow"}];let o=null;if(f){o={...v(),editingStrokeColor:"var(--palette-blue-5)",...(0,r.omitBy)(!0===f?{}:f,r.isUndefined)};const t=d(o);for(const n of t){const{placement:t,type:i}=n,r=null!=i?i:"arrow",l=u({strokeColor:o.strokeColor,markerType:r},e),a=u({strokeColor:o.editingStrokeColor,markerType:r},e);"start"===t?(o.$markerStartUrl=`url(#${c}${l})`,o.$editingStartMarkerUrl=`url(#${c}${a})`):(o.$markerEndUrl=`url(#${c}${l})`,o.$editingEndMarkerUrl=`url(#${c}${a})`)}}const m=new WeakMap;for(const o of t){const t=(0,l.WW)(o),f=(0,l._m)(o);let h;if(t){var p,y;const e=null!==(p=Array.isArray(n)?s(n.find((e=>(0,i.checkIfByTransform)(e,{edge:o}))),o):null===(y=i.__secret_internals.legacyDoTransform({edge:o},n))||void 0===y?void 0:y.find((e=>(0,i.checkIfOfComputed)(e))))&&void 0!==p?p:{};h={...v(),...(0,r.omitBy)(e,r.isUndefined),...(0,r.omitBy)(o.view,r.isUndefined)},void 0===h.parallelGap&&(h.parallelGap=h.interactStrokeWidth)}else h={...v(),showEndArrow:!1,strokeColor:a.CE,...(0,r.omitBy)(o.view,r.isUndefined)};if(t||f){const n=d(h);for(const o of n){var w;const{placement:n,type:i}=o,r=null!=i?i:"arrow",l=u({strokeColor:h.strokeColor,markerType:r},e);"start"===n?h.$markerStartUrl=`url(#${c}${l})`:h.$markerEndUrl=`url(#${c}${l})`;const a=null===(w=h.overrides)||void 0===w||null===(w=w.active)||void 0===w?void 0:w.strokeColor;if(a&&a!==h.strokeColor){const t=u({strokeColor:a,markerType:r},e);"start"===n?h.$activeMarkerStartUrl=`url(#${c}${t})`:h.$activeMarkerEndUrl=`url(#${c}${t})`}if(t){var x;const t=null===(x=h.overrides)||void 0===x||null===(x=x.activeRelated)||void 0===x?void 0:x.strokeColor;if(t&&t!==h.strokeColor){const o=u({strokeColor:t,markerType:r},e);"start"===n?h.$activeRelatedMarkerStartUrl=`url(#${c}${o})`:h.$activeRelatedMarkerEndUrl=`url(#${c}${o})`}}}m.set(o,h)}}return g.current={lineConfMap:m,lineConnectorConf:o,markers:e}}),[t,n,f,c,h])}function s(e,t){var n;if(null!=e&&null!==(n=e.label)&&void 0!==n&&n.useBrick){const{label:{useBrick:n,...o},...r}=e,l=i.__secret_internals.legacyDoTransform({edge:t},{...r,label:o});return{...l,label:{...l.label,useBrick:n}}}return i.__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,r.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}}},8091:(e,t,n)=>{n.d(t,{f:()=>v});var o,i,r,l=n(8769),a=n(7566),c=n(9047),s=n(3033);const d=/mac/i.test(null!==(o=null!==(i=null===(r=navigator.userAgentData)||void 0===r?void 0:r.platform)&&void 0!==i?i: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:i,draggable:r,ctrlDraggable:d,scaleRange:v,onSwitchActiveTarget:f}=e;const[h,g]=(0,l.useState)(!1),[m,p]=(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,p(t.transform)})).on("end",(()=>{g(!1),e||null==f||f(null)})).filter((e=>("wheel"===e.type?e.ctrlKey:d?r||e.ctrlKey:!e.ctrlKey)&&!e.button))}),[f,y,n,w,d,r]),(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||i)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),(r||d)&&i||l.on("mousedown.zoom",null),i||l.on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),c;c()}),[d,r,i,t,o,n,w]),{grabbing:h,transform:m,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),i=n(531),r=n(3033);function l(e){let{cells:t,layout:n,centered:l}=e;return(0,o.useMemo)((()=>l&&t.every((e=>!(0,i.N)(e)||e[r.CV]&&("force"!==n&&"dagre"!==n||e[r.xc])))),[t,l,n])}},8875:(e,t,n)=>{n.d(t,{G:()=>l,X:()=>r});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"]}],i=o.map((e=>({x:e.x,y:e.y})));function r(){return o}function l(){return i}},8944:(e,t,n)=>{n.d(t,{E:()=>i,l:()=>r});var o=n(531);function i(e){return e.filter((e=>{var t;return(null===(t=e.view)||void 0===t?void 0:t.locked)&&(0,o.t2)(e)})).map((e=>e.id))}function r(e,t){var n;return(null===(n=e.view)||void 0===n?void 0:n.locked)||!!((0,o.N)(e)&&e.containerId&&null!=t&&t.includes(e.containerId))}},9127:(e,t,n)=>{n.d(t,{C:()=>c});var o=n(1030),i=n(7586),r=n.n(i),l=n(8802),a=n(531);function c(e){let{cells:t,layoutOptions:n,allowEdgeToArea:i}=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(r().graphlib.Graph);u.setGraph(s),u.setDefaultEdgeLabel((function(){return{}}));for(const e of t)i&&(0,a.o6)(e)||(0,a.N)(e)?u.setNode(e.id,{id:e.id,width:e.view.width+d[1]+d[3],height:e.view.height+d[0]+d[2]}):(0,a.WW)(e)&&u.setEdge(e.source,e.target);return r().layout(u),{getNodeView:e=>u.node(e),nodePaddings:d}}},9386:(e,t,n)=>{n.d(t,{P:()=>i});var o=n(1030);function i(e){return"edge"===e.type?(0,o.pick)(e,["type","source","target","data"]):(0,o.pick)(e,["type","id","data"])}},9978:(e,t,n)=>{n.d(t,{H:()=>r,s:()=>l});var o=n(8769),i=n.n(o);const r=i().createContext({rootRef:{current:null},smartConnectLineState:null,unsetHoverStateTimeoutRef:{current:null},hoverState:null,activeEditableLines:[],lineEditorState:null,setLineEditorState:()=>{},setHoverState:()=>{},setSmartConnectLineState:()=>{}});function l(){return i().useContext(r)}}}]);
|
|
2
|
+
//# sourceMappingURL=296.f72b7a0e.js.map
|