@next-bricks/diagram 0.23.1 → 0.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +3 -3
- package/dist/chunks/2696.826d69c1.js +2 -0
- package/dist/chunks/2696.826d69c1.js.map +1 -0
- package/dist/chunks/{3780.57b33842.js → 3132.ccc1512e.js} +3 -3
- package/dist/chunks/3132.ccc1512e.js.map +1 -0
- package/dist/chunks/3664.63190754.js +3 -0
- package/dist/chunks/3664.63190754.js.map +1 -0
- package/dist/chunks/5676.b73cbbce.js +2 -0
- package/dist/chunks/5676.b73cbbce.js.map +1 -0
- package/dist/chunks/eo-draw-canvas.a55166a4.js +2 -0
- package/dist/chunks/eo-draw-canvas.a55166a4.js.map +1 -0
- package/dist/chunks/{main.96890609.js → main.778b4e4a.js} +2 -2
- package/dist/chunks/{main.96890609.js.map → main.778b4e4a.js.map} +1 -1
- package/dist/examples.json +3 -3
- package/dist/index.593ec971.js +2 -0
- package/dist/{index.86b6ec27.js.map → index.593ec971.js.map} +1 -1
- package/dist/manifest.json +37 -37
- package/dist/types.json +67 -67
- package/dist-types/draw-canvas/index.d.ts +5 -1
- package/dist-types/draw-canvas/processors/updateCells.d.ts +4 -2
- package/package.json +2 -2
- package/dist/chunks/2680.440281fd.js +0 -3
- package/dist/chunks/2680.440281fd.js.map +0 -1
- package/dist/chunks/2696.8ec49230.js +0 -2
- package/dist/chunks/2696.8ec49230.js.map +0 -1
- package/dist/chunks/3780.57b33842.js.map +0 -1
- package/dist/chunks/5676.25458ec2.js +0 -2
- package/dist/chunks/5676.25458ec2.js.map +0 -1
- package/dist/chunks/eo-draw-canvas.623578df.js +0 -2
- package/dist/chunks/eo-draw-canvas.623578df.js.map +0 -1
- package/dist/index.86b6ec27.js +0 -2
- /package/dist/chunks/{3780.57b33842.js.LICENSE.txt → 3132.ccc1512e.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{2680.440281fd.js.LICENSE.txt → 3664.63190754.js.LICENSE.txt} +0 -0
package/dist/bricks.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "bricks/diagram",
|
|
3
3
|
"bricks": [
|
|
4
|
-
"diagram.
|
|
5
|
-
"diagram.
|
|
4
|
+
"diagram.editable-label",
|
|
5
|
+
"diagram.experimental-node"
|
|
6
6
|
],
|
|
7
7
|
"elements": [
|
|
8
8
|
"eo-diagram",
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"basic.lock-body-scroll"
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
|
-
"filePath": "bricks/diagram/dist/index.
|
|
17
|
+
"filePath": "bricks/diagram/dist/index.593ec971.js"
|
|
18
18
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[2696],{5776:(e,t,n)=>{n.d(t,{s:()=>E});var r=n(5600),a=n.n(r),o=n(1252),i=n.n(o),c=n(7181),l=n(6960),d=n(960);function s(e,t){return e.find((e=>(0,c.G4)(e)&&e.id===t))}function v(e){var{edge:t,cells:n,markerEnd:o,defaultEdgeLines:c}=e,v=(0,r.useMemo)((()=>s(n,t.source)),[n,t.source]),f=(0,r.useMemo)((()=>s(n,t.target)),[n,t.target]),h=(0,r.useMemo)((()=>null==c?void 0:c.find((e=>(0,l.checkIfByTransform)(e,{edge:t})))),[c,t]),w=(0,r.useMemo)((()=>v&&f?(0,d.g)(u(v.view,5),u(f.view,5)):null),[v,f]);if(!w)return null;var m="M".concat(w[0].x," ").concat(w[0].y,"L").concat(w[1].x," ").concat(w[1].y);return a().createElement(a().Fragment,null,a().createElement("path",{d:m,fill:"none",stroke:"transparent",strokeWidth:16}),a().createElement("path",{className:i()("line",{dashed:null==h?void 0:h.dashed}),d:m,fill:"none",stroke:"gray",markerEnd:"url(#".concat(o,")")}),a().createElement("path",{className:"line-active-bg",d:m,fill:"none"}))}function u(e,t){return{x:e.x+e.width/2,y:e.y+e.height/2,width:e.width+t,height:e.height+t}}var f=n(6196),h=n(7568);function w(e){var{node:t,defaultNodeBricks:n}=e,o=function(e){var[t,n]=(0,r.useState)(e);return(0,r.useEffect)((()=>{n((t=>(0,h.isEqual)(t,e)?t:e))}),[e]),t}({node:{id:t.id,data:t.data}}),i=t.useBrick,c=(0,r.useMemo)((()=>{var e;return null!=i?i:null==n||null===(e=n.find((e=>(0,l.checkIfByTransform)(e,o))))||void 0===e?void 0:e.useBrick}),[n,i,o]);return c?a().createElement("foreignObject",{width:t.view.width,height:t.view.height,className:"node"},c&&a().createElement(f.ReactUseBrick,{useBrick:c,data:o})):null}function m(e){return"edge"===e.type?(0,h.pick)(e,["type","source","target","data"]):(0,h.pick)(e,["type","id","data"])}function g(e,t){var{action:n,cell:r,scale:a,onCellMoving:o,onCellMoved:i,onCellResizing:c,onCellResized:l,onSwitchActiveTarget:d}=t;if(e.stopPropagation(),d(m(r)),"edge"!==r.type){var s=[e.clientX,e.clientY],v="move"===n?[r.view.x,r.view.y]:[r.view.width,r.view.height],u=!1,f=(e,t)=>{var d,f,h=function(e){return[(e.clientX-s[0])/a,(e.clientY-s[1])/a]}(e);u||(u=h[0]**2+h[1]**2>=9),u&&("move"===n?null===(d=t?i:o)||void 0===d||d({type:r.type,id:r.id,x:v[0]+h[0],y:v[1]+h[1]}):null===(f=t?l:c)||void 0===f||f({type:r.type,id:r.id,width:v[0]+h[0],height:v[1]+h[1]}))},h=e=>{f(e)},w=e=>{f(e,!0),u=!1,document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",w)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",w)}}function p(e){var{cell:t,transform:n,onCellResizing:o,onCellResized:i,onSwitchActiveTarget:c}=e,l=a().useRef(null);return(0,r.useEffect)((()=>{var e=l.current,r=e=>{g(e,{action:"resize",cell:t,scale:n.k,onCellResizing:o,onCellResized:i,onSwitchActiveTarget:c})};return null==e||e.addEventListener("mousedown",r),()=>{null==e||e.removeEventListener("mousedown",r)}}),[t,i,o,c,n.k]),a().createElement("g",{className:"decorator-area"},a().createElement("rect",{width:t.view.width,height:t.view.height,className:"area"}),a().createElement("g",{ref:l,className:"resize-handle",transform:"translate(".concat(t.view.width-20," ").concat(t.view.height-20,")")},a().createElement("rect",{width:20,height:20}),a().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})))}var y=n(4412);function k(e){var t,{cell:n,onDecoratorTextEditing:o,onDecoratorTextChange:c}=e,l=null!==(t=n.view.text)&&void 0!==t?t:"",[d,s]=(0,r.useState)(l),[v,u]=(0,r.useState)(!1),f=(0,r.useRef)(!1),[h,w]=(0,r.useState)(!1),m=(0,r.useRef)(null),g=(0,r.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),u(!0)}),[]);(0,r.useEffect)((()=>{var e=m.current;e&&e.textContent!==d&&(e.textContent=d)}),[d]),(0,r.useEffect)((()=>{v&&m.current&&(m.current.focus(),function(e){var t=document.createRange();t.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(t)}(m.current)),o({id:n.id,editing:v})}),[n.id,v,o]),(0,r.useEffect)((()=>{f.current?null==o||o({id:n.id,editing:v}):f.current=!0}),[n.id,v,o]);var p=(0,r.useCallback)((e=>{s(e.target.textContent)}),[]),k=(0,r.useCallback)((()=>{u(!1),w(!0)}),[]);return(0,r.useEffect)((()=>{h&&(null==c||c({id:n.id,view:(0,y.c)((0,y.c)({},n.view),{},{text:d})}),w(!1))}),[n,d,c,h]),a().createElement("foreignObject",{className:"decorator-text"},a().createElement("div",{className:i()("text-container",{editing:v}),onDoubleClick:g},a().createElement("div",{className:"text",contentEditable:v,ref:m,onInput:p,onBlur:k})))}function x(e){var t,{cell:n,transform:r,onCellResizing:o,onCellResized:i,onSwitchActiveTarget:c,onDecoratorTextEditing:l,onDecoratorTextChange:d}=e;switch(n.decorator){case"area":t=p;break;case"text":t=k;break;default:return console.error("Unknown decorator: ".concat(n.decorator)),null}return a().createElement(t,{cell:n,transform:r,onCellResizing:o,onCellResized:i,onSwitchActiveTarget:c,onDecoratorTextEditing:l,onDecoratorTextChange:d})}function E(e){var{cell:t,cells:n,defaultNodeBricks:o,defaultEdgeLines:l,markerEnd:d,active:s,transform:u,onCellMoving:f,onCellMoved:h,onCellResizing:p,onCellResized:y,onSwitchActiveTarget:k,onCellContextMenu:E,onDecoratorTextEditing:C,onDecoratorTextChange:M}=e,z=(0,r.useRef)(null);(0,r.useEffect)((()=>{var e=z.current,n=e=>{g(e,{action:"move",cell:t,scale:u.k,onCellMoving:f,onCellMoved:h,onSwitchActiveTarget:k})};return null==e||e.addEventListener("mousedown",n),()=>{null==e||e.removeEventListener("mousedown",n)}}),[t,h,f,k,u.k]);var b=(0,r.useCallback)((e=>{e.preventDefault(),k(m(t)),E({cell:t,clientX:e.clientX,clientY:e.clientY})}),[t,E,k]);return a().createElement("g",{className:i()("cell",{active:s}),ref:z,transform:"edge"===t.type?void 0:"translate(".concat(t.view.x," ").concat(t.view.y,")"),onContextMenu:b},(0,c.G4)(t)?a().createElement(w,{node:t,defaultNodeBricks:o}):(0,c.Wk)(t)?a().createElement(v,{edge:t,defaultEdgeLines:l,cells:n,markerEnd:d}):(0,c.c1)(t)?a().createElement(x,{cell:t,transform:u,onCellResizing:p,onCellResized:y,onSwitchActiveTarget:k,onDecoratorTextEditing:C,onDecoratorTextChange:M}):null)}},8044:(e,t,n)=>{n.d(t,{E:()=>c});var r=n(5600),a=n.n(r),o=n(1252),i=n.n(o);function c(e){var{connectLineState:t,transform:n,markerEnd:o,onConnect:c}=e,[l,d]=(0,r.useState)(null);return(0,r.useEffect)((()=>{t&&d(t.from)}),[t]),(0,r.useEffect)((()=>{if(t){var e=e=>{d([(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},r=e=>{e.stopPropagation()},a=e=>{e.stopPropagation(),o(),c(t,[(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},o=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mousedown",r,{capture:!0}),document.removeEventListener("click",a,{capture:!0}),d(null)};return document.addEventListener("mousemove",e),document.addEventListener("mousedown",r,{capture:!0}),document.addEventListener("click",a,{capture:!0}),o}}),[t,c,n]),a().createElement("path",{className:i()("connect-line",{connecting:!!t&&l&&(l[0]-t.from[0])**2+(l[1]-t.from[1])**2>25}),d:t&&l?"M".concat(t.from.join(" "),"L").concat(l.join(" ")):"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:"url(#".concat(o,")")})}},7181:(e,t,n)=>{function r(e){return"node"===e.type}function a(e){return"decorator"===e.type}function o(e){return"node"===e.type}function i(e){return"edge"===e.type}n.d(t,{Cy:()=>o,G4:()=>r,Wk:()=>i,c1:()=>a})},6876:(e,t,n)=>{n.d(t,{Y:()=>a});var r=n(4552);function a(e,t){var{cells:n,activeTarget:a}=t,o=n.find((e=>(0,r.M)(e,a)));if(o)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cell",cell:o}}}},7876:(e,t,n)=>{n.d(t,{S:()=>o});var r=n(4412),a=n(7181);function o(e,t){var{defaultNodeSize:n}=t;return(null!=e?e:[]).map((e=>{var t,o;return!(0,a.Cy)(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:(0,r.c)((0,r.c)({},e),{},{view:(0,r.c)({width:n[0],height:n[1]},e.view)})}))}},4552:(e,t,n)=>{function r(e,t){return e?!!t&&e.type===t.type&&("node"===e.type||"decorator"===e.type?e.id===t.id:e.source===t.source&&e.target===t.target):!t}n.d(t,{M:()=>r})},3788:(e,t,n)=>{n.d(t,{c:()=>a});var r=n(7181);function a(e,t){var{canvasWidth:n,canvasHeight:a,scaleRange:o}=t,i=1/0,c=1/0,l=-1/0,d=-1/0,s=!0;for(var v of e)if(!(0,r.Wk)(v)){s=!1;var{view:u}=v,f=u.x+u.width,h=u.y+u.height;u.x<i&&(i=u.x),f>l&&(l=f),u.y<c&&(c=u.y),h>d&&(d=h)}var w=l-i,m=d-c,g=o&&!s&&(w>n||m>a)?Math.max(Math.min(n/w,a/m,o[1]),o[0]):1;return{x:s?0:(n-w*g)/2-i*g,y:s?0:(a-m*g)/2-c*g,k:g}}},2872:(e,t,n)=>{n.d(t,{s:()=>o});var r=n(7181),a=n(7876);function o(e){var{cells:t,defaultNodeSize:n,canvasHeight:o,transform:i,reason:c,parent:l}=e,d=(0,a.S)(t,{defaultNodeSize:n}),s=[],v=new Map;for(var u of d)(0,r.G4)(u)&&v.set(u.id,u);var f=!1;if("add-related-nodes"===c&&l){var h=new Set;for(var w of d)(0,r.Wk)(w)&&w.source===l&&w.target!==l&&h.add(w.target);var m=v.get(l);if(void 0!==(null==m?void 0:m.view.x)&&void 0!==m.view.y){f=!0;var g=[...h].map((e=>v.get(e))).filter(Boolean),p=void 0;for(var y of g)void 0!==y.view.x&&void 0!==y.view.y?(!p||y.view.x>p.view.x)&&y.view.y>m.view.y&&(p=y):s.push(y);if(s.length>0){var k,x;if(p)k=p.view.x+p.view.width+20,x=p.view.y;else{var E=s.reduce(((e,t)=>e+t.view.width+20),-20);k=m.view.x-E/2+m.view.width/2,x=m.view.y+m.view.height+20}for(var C of s)C.view.x=k,C.view.y=x,k+=C.view.width+20}}}if(!f){var M=n[0],z=n[1],b=[];for(var L of d)(0,r.G4)(L)&&(L.view.width>M&&(M=L.view.width),L.view.height>z&&(z=L.view.height),void 0===L.view.x||void 0===L.view.y?s.push(L):b.push(L.view));var R=M+20,S=z+20,T=new Set;for(var N of b)for(var D=Math.floor((N.x+i.x/i.k)/R),B=Math.floor((N.y+i.y/i.k)/S),A=Math.floor((N.x+i.x/i.k+N.width)/R),I=Math.floor((N.y+i.y/i.k+N.height)/S),W=D;W<=A;W++)for(var Y=B;Y<=I;Y++)T.add("".concat(W,",").concat(Y));var j=R*i.k,X=S*i.k,_=Math.max(1,Math.floor(o/X)),G=0;for(var P of s){var O=void 0,H=void 0;do{O=Math.floor(G/_),H=G%_,G++}while(T.has("".concat(O,",").concat(H)));P.view.x=(O*j-i.x)/i.k+10,P.view.y=(H*X-i.y)/i.k+10}}return{cells:d,updated:s}}},3876:(e,t,n)=>{n.d(t,{M:()=>i});var r=n(4412);function a(e,t,n){var r=e.findLastIndex(n)+1;return[...e.slice(0,r),t,...e.slice(r)]}var o,i=(o={cells:(e,t)=>{switch(t.type){case"drop-node":return a(e,t.payload,(e=>!("decorator"===e.type&&"text"===e.decorator)));case"drop-decorator":return"text"===t.payload.decorator?[...e,t.payload]:a(e,t.payload,(e=>"decorator"===e.type&&"area"===e.decorator));case"add-nodes":var n=e.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1;return[...e.slice(0,n),...t.payload,...e.slice(n)];case"add-edge":return a(e,t.payload,(e=>"edge"===e.type||"decorator"===e.type&&"area"===e.decorator));case"move-cell":var{type:o,id:i,x:c,y:l}=t.payload,d=e.findIndex((e=>e.type===o&&e.id===i));if(-1!==d){var s=e[d];return[...e.slice(0,d),(0,r.c)((0,r.c)({},s),{},{view:(0,r.c)((0,r.c)({},s.view),{},{x:c,y:l})}),...e.slice(d+1)]}return e;case"resize-cell":var{type:v,id:u,width:f,height:h}=t.payload,w=e.findIndex((e=>e.type===v&&e.id===u));if(-1!==w){var m=e[w];return[...e.slice(0,w),(0,r.c)((0,r.c)({},m),{},{view:(0,r.c)((0,r.c)({},m.view),{},{width:f,height:h})}),...e.slice(w+1)]}return e;case"update-cells":return t.payload}return e}},(e,t)=>Object.fromEntries(Object.entries(o).map((n=>{var[r,a]=n;return[r,a(e[r],t)]}))))},7584:(e,t,n)=>{n.d(t,{c:()=>c});var r=n(8304),a=n.n(r),o=n(1849),i=n.n(o)()(a());i.push([e.id,"*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root:focus{outline:none}.decorator-area .area{fill:rgba(119,141,195,0.1);stroke:none;stroke-width:0}.node,\n.decorator-text{overflow:visible}.cell.active .decorator-area .area,\n.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:4;stroke-width:1}.cell{-webkit-user-select:none;-moz-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}.cell.active .decorator-area .resize-handle,\n.decorator-area:hover .resize-handle{opacity:1}.connect-line:not(.connecting){display:none}.line.dashed{stroke-dasharray:4}.cell.active .decorator-text .text-container{outline:1px dashed var(--palette-blue-5)}.decorator-text .text-container{width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:0.5em}.decorator-text .text:focus{outline:none}",""]);const c=i.toString()}}]);
|
|
2
|
+
//# sourceMappingURL=2696.826d69c1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunks/2696.826d69c1.js","mappings":"oNAGO,SAASA,EAASC,EAAeC,GACtC,OAAOD,EAAME,MAAMC,IAASC,EAAAA,EAAAA,IAAWD,IAASA,EAAKF,KAAOA,GAG9D,CCQO,SAASI,EAAaC,GAKc,IALb,KAC5BC,EAAI,MACJP,EAAK,UACLQ,EAAS,iBACTC,GACmBH,EACbI,GAAaC,EAAAA,EAAAA,UACjB,IAAMZ,EAASC,EAAOO,EAAKK,SAC3B,CAACZ,EAAOO,EAAKK,SAETC,GAAaF,EAAAA,EAAAA,UACjB,IAAMZ,EAASC,EAAOO,EAAKO,SAC3B,CAACd,EAAOO,EAAKO,SAETC,GAAWJ,EAAAA,EAAAA,UACf,IAAMF,aAAgB,EAAhBA,EAAkBP,MAAMc,IAASC,EAAAA,EAAAA,oBAAmBD,EAAM,CAAET,YAClE,CAACE,EAAkBF,IAKfW,GAAOP,EAAAA,EAAAA,UACX,IACED,GAAcG,GACVM,EAAAA,EAAAA,GACEC,EAAmBV,EAAWW,KANxB,GAOND,EAA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AOD,CAAK,GCjEJ,CAACA,EAAOpL,IACduL,OAAOC,YACLD,OAAOE,QAAyBP,GAAUvE,KAAI/J,IAAA,IAAEyJ,EAAKvH,GAAMlC,EAAA,MAAK,CAC9DyJ,EACAvH,EAAMsM,EAAM/E,GAAiBrG,GAC9B,K,mECbH0L,E,MAA0B,GAA4B,KAE1DA,EAAwB1C,KAAK,CAAC2C,EAAOpP,GAAI,0iCAIqU,KAE9W,QAAemP,EAAwBE,U","sources":["webpack:///./src/draw-canvas/processors/findNode.ts","webpack:///./src/draw-canvas/EdgeComponent.tsx","webpack:///./src/draw-canvas/NodeComponent.tsx","webpack:///./src/draw-canvas/processors/cellToTarget.ts","webpack:///./src/draw-canvas/processors/handleMouseDown.ts","webpack:///./src/draw-canvas/decorators/DecoratorArea.tsx","webpack:///./src/draw-canvas/decorators/DecoratorText.tsx","webpack:///./src/draw-canvas/decorators/index.tsx","webpack:///./src/draw-canvas/CellComponent.tsx","webpack:///./src/draw-canvas/ConnectLineComponent.tsx","webpack:///./src/draw-canvas/processors/asserts.ts","webpack:///./src/draw-canvas/processors/handleKeyboard.ts","webpack:///./src/draw-canvas/processors/initializeCells.ts","webpack:///./src/draw-canvas/processors/sameTarget.ts","webpack:///./src/draw-canvas/processors/transformToCenter.ts","webpack:///./src/draw-canvas/processors/updateCells.ts","webpack:///./src/draw-canvas/reducers/cells.ts","webpack:///./src/draw-canvas/reducers/index.ts","webpack:///./src/draw-canvas/styles.shadow.css"],"sourcesContent":["import type { Cell, NodeCell, NodeId } from \"../interfaces\";\nimport { isNodeCell } from \"./asserts\";\n\nexport function findNode(cells: Cell[], id: NodeId): NodeCell | undefined {\n return cells.find((cell) => isNodeCell(cell) && cell.id === id) as\n | NodeCell\n | undefined;\n}\n","import React, { useMemo } from \"react\";\nimport { checkIfByTransform } from \"@next-core/runtime\";\nimport classNames from \"classnames\";\nimport type { Cell, EdgeCell, EdgeLineConf, NodeView } from \"./interfaces\";\nimport { getDirectLinePoints } from \"../diagram/lines/getDirectLinePoints\";\nimport type { NodeRect } from \"../diagram/interfaces\";\nimport { findNode } from \"./processors/findNode\";\n\nexport interface EdgeComponentProps {\n edge: EdgeCell;\n cells: Cell[];\n markerEnd: string;\n defaultEdgeLines?: EdgeLineConf[];\n}\n\nexport function EdgeComponent({\n edge,\n cells,\n markerEnd,\n defaultEdgeLines,\n}: EdgeComponentProps): JSX.Element | null {\n const sourceNode = useMemo(\n () => findNode(cells, edge.source),\n [cells, edge.source]\n );\n const targetNode = useMemo(\n () => findNode(cells, edge.target),\n [cells, edge.target]\n );\n const lineConf = useMemo(\n () => defaultEdgeLines?.find((item) => checkIfByTransform(item, { edge })),\n [defaultEdgeLines, edge]\n );\n\n const padding = 5;\n\n const line = useMemo(\n () =>\n sourceNode && targetNode\n ? getDirectLinePoints(\n nodeViewToNodeRect(sourceNode.view, padding),\n nodeViewToNodeRect(targetNode.view, padding)\n )\n : null,\n [sourceNode, targetNode]\n );\n\n if (!line) {\n // This happens when source or target is not found\n return null;\n }\n\n const d = `M${line[0].x} ${line[0].y}L${line[1].x} ${line[1].y}`;\n\n return (\n <>\n <path\n // This `path` is made for expanding interaction area of graph lines.\n d={d}\n fill=\"none\"\n stroke=\"transparent\"\n strokeWidth={16}\n />\n <path\n className={classNames(\"line\", { dashed: lineConf?.dashed })}\n d={d}\n fill=\"none\"\n stroke=\"gray\"\n markerEnd={`url(#${markerEnd})`}\n />\n <path className=\"line-active-bg\" d={d} fill=\"none\" />\n </>\n );\n}\n\nfunction nodeViewToNodeRect(view: NodeView, padding: number): NodeRect {\n return {\n x: view.x + view.width / 2,\n y: view.y + view.height / 2,\n width: view.width + padding,\n height: view.height + padding,\n };\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { ReactUseBrick } from \"@next-core/react-runtime\";\nimport { checkIfByTransform } from \"@next-core/runtime\";\nimport { isEqual } from \"lodash\";\nimport type { NodeBrickCell, NodeBrickConf, NodeCell } from \"./interfaces\";\n\nexport interface NodeComponentProps {\n node: NodeCell;\n defaultNodeBricks?: NodeBrickConf[];\n}\n\nexport function NodeComponent({\n node,\n defaultNodeBricks,\n}: NodeComponentProps): JSX.Element | null {\n const memoizedData = useDeepMemo({ node: { id: node.id, data: node.data } });\n const specifiedUseBrick = (node as NodeBrickCell).useBrick;\n\n const useBrick = useMemo(() => {\n return (\n specifiedUseBrick ??\n defaultNodeBricks?.find((item) => checkIfByTransform(item, memoizedData))\n ?.useBrick\n );\n }, [defaultNodeBricks, specifiedUseBrick, memoizedData]);\n\n return useBrick ? (\n <foreignObject\n width={node.view.width}\n height={node.view.height}\n className=\"node\"\n >\n {useBrick && <ReactUseBrick useBrick={useBrick} data={memoizedData} />}\n </foreignObject>\n ) : null;\n}\n\nfunction useDeepMemo<T>(value: T): T {\n const [memoizedValue, setMemoizedValue] = useState(value);\n\n useEffect(() => {\n setMemoizedValue((prev) => (isEqual(prev, value) ? prev : value));\n }, [value]);\n\n return memoizedValue;\n}\n","import { pick } from \"lodash\";\nimport type { ActiveTarget, Cell } from \"../interfaces\";\n\nexport function cellToTarget(cell: Cell): ActiveTarget {\n return cell.type === \"edge\"\n ? pick(cell, [\"type\", \"source\", \"target\", \"data\"])\n : pick(cell, [\"type\", \"id\", \"data\"]);\n}\n","import type { PositionTuple } from \"../../diagram/interfaces\";\nimport type { ActiveTarget, Cell } from \"../interfaces\";\nimport type {\n MoveCellPayload,\n ResizeCellPayload,\n} from \"../reducers/interfaces\";\nimport { cellToTarget } from \"./cellToTarget\";\n\nexport function handleMouseDown(\n event: MouseEvent,\n {\n action,\n cell,\n scale,\n onCellMoving,\n onCellMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n }: {\n action: \"move\" | \"resize\";\n cell: Cell;\n scale: number;\n onCellMoving?(info: MoveCellPayload): void;\n onCellMoved?(info: MoveCellPayload): void;\n onCellResizing?(info: ResizeCellPayload): void;\n onCellResized?(info: ResizeCellPayload): void;\n onSwitchActiveTarget(activeTarget: ActiveTarget | null): void;\n }\n) {\n event.stopPropagation();\n // Drag node\n onSwitchActiveTarget(cellToTarget(cell));\n\n if (cell.type === \"edge\") {\n return;\n }\n\n const from: PositionTuple = [event.clientX, event.clientY];\n const original =\n action === \"move\"\n ? [cell.view.x, cell.view.y]\n : [cell.view.width, cell.view.height];\n\n function getMovement(e: MouseEvent): PositionTuple {\n return [(e.clientX - from[0]) / scale, (e.clientY - from[1]) / scale];\n }\n\n let moved = false;\n\n const handleMove = (e: MouseEvent, finished?: boolean) => {\n // Respect the scale\n const movement = getMovement(e);\n if (!moved) {\n moved = movement[0] ** 2 + movement[1] ** 2 >= 9;\n }\n // const [x, y] = getNewPosition(movement);\n // adjustCellPosition(x, y);\n if (moved) {\n if (action === \"move\") {\n (finished ? onCellMoved : onCellMoving)?.({\n type: cell.type,\n id: cell.id,\n x: original[0] + movement[0],\n y: original[1] + movement[1],\n });\n } else {\n (finished ? onCellResized : onCellResizing)?.({\n type: cell.type,\n id: cell.id,\n width: original[0] + movement[0],\n height: original[1] + movement[1],\n });\n }\n }\n };\n\n const onMouseMove = (e: MouseEvent) => {\n handleMove(e);\n };\n const onMouseUp = (e: MouseEvent) => {\n handleMove(e, true);\n moved = false;\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n };\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n}\n","import React, { useEffect } from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport { handleMouseDown } from \"../processors/handleMouseDown\";\n\nexport function DecoratorArea({\n cell,\n transform,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n}: BasicDecoratorProps): JSX.Element {\n const resizeHandleRef = React.useRef<SVGGElement>(null);\n\n useEffect(() => {\n const resizeHandle = resizeHandleRef.current;\n const onMouseDown = (event: MouseEvent) => {\n handleMouseDown(event, {\n action: \"resize\",\n cell,\n scale: transform.k,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n });\n };\n resizeHandle?.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n resizeHandle?.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [cell, onCellResized, onCellResizing, onSwitchActiveTarget, transform.k]);\n\n return (\n <g className=\"decorator-area\">\n <rect\n // x={cell.view.x}\n // y={cell.view.y}\n width={cell.view.width}\n height={cell.view.height}\n className=\"area\"\n />\n <g\n ref={resizeHandleRef}\n className=\"resize-handle\"\n transform={`translate(${cell.view.width - 20} ${cell.view.height - 20})`}\n >\n <rect width={20} height={20} />\n <path d=\"M10 18L18 10 M15 18L18 15\" />\n </g>\n </g>\n );\n}\n","import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport classNames from \"classnames\";\n\nexport type DecoratorTextProps = Pick<\n BasicDecoratorProps,\n \"cell\" | \"onDecoratorTextEditing\" | \"onDecoratorTextChange\"\n>;\n\nexport function DecoratorText({\n cell,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: DecoratorTextProps): JSX.Element {\n const label = cell.view.text ?? \"\";\n const [currentLabel, setCurrentLabel] = useState<string>(label);\n const [editingLabel, setEditingLabel] = useState(false);\n const editingLabelInitialized = useRef(false);\n const [shouldEmitLabelChange, setShouldEmitLabelChange] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n const handleEnableEdit = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setEditingLabel(true);\n }, []);\n\n useEffect(() => {\n const element = ref.current;\n if (element && element.textContent !== currentLabel) {\n element.textContent = currentLabel;\n }\n }, [currentLabel]);\n\n useEffect(() => {\n if (editingLabel && ref.current) {\n ref.current.focus();\n selectAllText(ref.current);\n }\n onDecoratorTextEditing({ id: cell.id, editing: editingLabel });\n }, [cell.id, editingLabel, onDecoratorTextEditing]);\n\n useEffect(() => {\n if (editingLabelInitialized.current) {\n onDecoratorTextEditing?.({ id: cell.id, editing: editingLabel });\n } else {\n editingLabelInitialized.current = true;\n }\n }, [cell.id, editingLabel, onDecoratorTextEditing]);\n\n const handleInput = useCallback((event: React.FormEvent<HTMLDivElement>) => {\n setCurrentLabel((event.target as HTMLDivElement).textContent!);\n }, []);\n\n const handleBlur = useCallback(() => {\n setEditingLabel(false);\n setShouldEmitLabelChange(true);\n }, []);\n\n useEffect(() => {\n if (shouldEmitLabelChange) {\n onDecoratorTextChange?.({\n id: cell.id,\n view: { ...cell.view, text: currentLabel },\n });\n setShouldEmitLabelChange(false);\n }\n }, [cell, currentLabel, onDecoratorTextChange, shouldEmitLabelChange]);\n\n return (\n <foreignObject className=\"decorator-text\">\n <div\n className={classNames(\"text-container\", { editing: editingLabel })}\n onDoubleClick={handleEnableEdit}\n >\n <div\n className=\"text\"\n contentEditable={editingLabel}\n ref={ref}\n onInput={handleInput}\n onBlur={handleBlur}\n />\n </div>\n </foreignObject>\n );\n}\n\nfunction selectAllText(element: HTMLElement) {\n const range = document.createRange();\n range.selectNodeContents(element);\n const selection = window.getSelection()!;\n selection.removeAllRanges();\n selection.addRange(range);\n}\n","import React from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport { DecoratorArea } from \"./DecoratorArea\";\nimport { DecoratorText } from \"./DecoratorText\";\n\nexport function DecoratorComponent({\n cell,\n transform,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: BasicDecoratorProps): JSX.Element | null {\n let SpecifiedComponent: (props: BasicDecoratorProps) => JSX.Element | null;\n\n switch (cell.decorator) {\n case \"area\":\n SpecifiedComponent = DecoratorArea;\n break;\n case \"text\":\n SpecifiedComponent = DecoratorText;\n break;\n // istanbul ignore next\n default:\n // eslint-disable-next-line no-console\n console.error(`Unknown decorator: ${cell.decorator}`);\n return null;\n }\n\n return (\n <SpecifiedComponent\n cell={cell}\n transform={transform}\n onCellResizing={onCellResizing}\n onCellResized={onCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onDecoratorTextEditing={onDecoratorTextEditing}\n onDecoratorTextChange={onDecoratorTextChange}\n />\n );\n}\n","import React, { useCallback, useEffect, useRef } from \"react\";\nimport classNames from \"classnames\";\nimport type {\n ActiveTarget,\n Cell,\n CellContextMenuDetail,\n DecoratorTextChangeDetail,\n EdgeLineConf,\n NodeBrickConf,\n} from \"./interfaces\";\nimport { isDecoratorCell, isEdgeCell, isNodeCell } from \"./processors/asserts\";\nimport { EdgeComponent } from \"./EdgeComponent\";\nimport { NodeComponent } from \"./NodeComponent\";\nimport { handleMouseDown } from \"./processors/handleMouseDown\";\nimport type { MoveCellPayload, ResizeCellPayload } from \"./reducers/interfaces\";\nimport { DecoratorComponent } from \"./decorators\";\nimport { cellToTarget } from \"./processors/cellToTarget\";\nimport type { TransformLiteral } from \"../diagram/interfaces\";\n\nexport interface CellComponentProps {\n cell: Cell;\n cells: Cell[];\n defaultNodeBricks?: NodeBrickConf[];\n defaultEdgeLines?: EdgeLineConf[];\n transform: TransformLiteral;\n markerEnd: string;\n active: boolean;\n onCellMoving(info: MoveCellPayload): void;\n onCellMoved(info: MoveCellPayload): void;\n onCellResizing(info: ResizeCellPayload): void;\n onCellResized(info: ResizeCellPayload): void;\n onSwitchActiveTarget(target: ActiveTarget | null): void;\n onCellContextMenu(detail: CellContextMenuDetail): void;\n onDecoratorTextEditing(detail: { id: string; editing: boolean }): void;\n onDecoratorTextChange(detail: DecoratorTextChangeDetail): void;\n}\n\nexport function CellComponent({\n cell,\n cells,\n defaultNodeBricks,\n defaultEdgeLines,\n markerEnd,\n active,\n transform,\n onCellMoving,\n onCellMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onCellContextMenu,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: CellComponentProps): JSX.Element | null {\n const gRef = useRef<SVGGElement>(null);\n\n useEffect(() => {\n const g = gRef.current;\n const onMouseDown = (event: MouseEvent) => {\n handleMouseDown(event, {\n action: \"move\",\n cell,\n scale: transform.k,\n onCellMoving,\n onCellMoved,\n onSwitchActiveTarget,\n });\n };\n g?.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n g?.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [cell, onCellMoved, onCellMoving, onSwitchActiveTarget, transform.k]);\n\n const handleContextMenu = useCallback(\n (event: React.MouseEvent<SVGGElement>) => {\n event.preventDefault();\n onSwitchActiveTarget(cellToTarget(cell));\n onCellContextMenu({\n cell,\n clientX: event.clientX,\n clientY: event.clientY,\n });\n },\n [cell, onCellContextMenu, onSwitchActiveTarget]\n );\n\n return (\n <g\n className={classNames(\"cell\", { active })}\n ref={gRef}\n transform={\n cell.type === \"edge\"\n ? undefined\n : `translate(${cell.view.x} ${cell.view.y})`\n }\n onContextMenu={handleContextMenu}\n >\n {isNodeCell(cell) ? (\n <NodeComponent node={cell} defaultNodeBricks={defaultNodeBricks} />\n ) : isEdgeCell(cell) ? (\n <EdgeComponent\n edge={cell}\n defaultEdgeLines={defaultEdgeLines}\n cells={cells}\n markerEnd={markerEnd}\n />\n ) : isDecoratorCell(cell) ? (\n <DecoratorComponent\n cell={cell}\n transform={transform}\n onCellResizing={onCellResizing}\n onCellResized={onCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onDecoratorTextEditing={onDecoratorTextEditing}\n onDecoratorTextChange={onDecoratorTextChange}\n />\n ) : null}\n </g>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport classNames from \"classnames\";\nimport type { ConnectLineState } from \"./interfaces\";\nimport type { PositionTuple, TransformLiteral } from \"../diagram/interfaces\";\n\nexport interface ConnectLineComponentProps {\n connectLineState: ConnectLineState | null;\n transform: TransformLiteral;\n markerEnd: string;\n onConnect(state: ConnectLineState, to: PositionTuple): void;\n}\n\nexport function ConnectLineComponent({\n connectLineState,\n transform,\n markerEnd,\n onConnect,\n}: ConnectLineComponentProps): JSX.Element {\n const [connectLineTo, setConnectLineTo] = useState<PositionTuple | null>(\n null\n );\n\n useEffect(() => {\n if (connectLineState) {\n setConnectLineTo(connectLineState.from);\n }\n }, [connectLineState]);\n\n useEffect(() => {\n if (connectLineState) {\n const onMouseMove = (e: MouseEvent) => {\n // Set connect line to based on the mouse position and the transform\n setConnectLineTo([\n (e.clientX - transform.x - connectLineState.offset[0]) / transform.k,\n (e.clientY - transform.y - connectLineState.offset[1]) / transform.k,\n ]);\n };\n const onMouseDown = (e: MouseEvent) => {\n e.stopPropagation();\n };\n const onClick = (e: MouseEvent) => {\n e.stopPropagation();\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n reset();\n onConnect(connectLineState, [\n (e.clientX - transform.x - connectLineState.offset[0]) / transform.k,\n (e.clientY - transform.y - connectLineState.offset[1]) / transform.k,\n ]);\n };\n const reset = () => {\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mousedown\", onMouseDown, {\n capture: true,\n });\n document.removeEventListener(\"click\", onClick, { capture: true });\n setConnectLineTo(null);\n };\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mousedown\", onMouseDown, { capture: true });\n document.addEventListener(\"click\", onClick, { capture: true });\n\n return reset;\n }\n }, [connectLineState, onConnect, transform]);\n\n return (\n <path\n className={classNames(\"connect-line\", {\n connecting:\n !!connectLineState &&\n connectLineTo &&\n // Do not show when the distance of mouse move is less than 5px\n (connectLineTo[0] - connectLineState.from[0]) ** 2 +\n (connectLineTo[1] - connectLineState.from[1]) ** 2 >\n 25,\n })}\n d={\n connectLineState && connectLineTo\n ? `M${connectLineState.from.join(\" \")}L${connectLineTo.join(\" \")}`\n : \"\"\n }\n fill=\"none\"\n stroke=\"gray\"\n strokeWidth={1}\n markerEnd={`url(#${markerEnd})`}\n />\n );\n}\n","import type {\n Cell,\n DecoratorCell,\n EdgeCell,\n InitialCell,\n InitialNodeCell,\n NodeCell,\n} from \"../interfaces\";\n\nexport function isNodeCell(cell: Cell): cell is NodeCell {\n return cell.type === \"node\";\n}\n\nexport function isDecoratorCell(cell: Cell): cell is DecoratorCell {\n return cell.type === \"decorator\";\n}\n\nexport function isInitialNodeCell(cell: InitialCell): cell is InitialNodeCell {\n return cell.type === \"node\";\n}\n\nexport function isEdgeCell(cell: Cell): cell is EdgeCell {\n return cell.type === \"edge\";\n}\n","import type { ActiveTarget, Cell } from \"../interfaces\";\nimport { sameTarget } from \"./sameTarget\";\n\nexport type KeyboardAction = KeyboardActionDeleteCell;\n\nexport interface KeyboardActionDeleteCell {\n action: \"delete-cell\";\n cell: Cell;\n}\n\nexport function handleKeyboard(\n event: KeyboardEvent,\n {\n cells,\n activeTarget,\n }: {\n cells: Cell[];\n activeTarget: ActiveTarget | null | undefined;\n }\n): KeyboardAction | undefined {\n const activeCell = cells.find((cell) => sameTarget(cell, activeTarget));\n\n if (!activeCell) {\n return;\n }\n\n const key =\n event.key ||\n /* istanbul ignore next: compatibility */ event.keyCode ||\n /* istanbul ignore next: compatibility */ event.which;\n\n switch (key) {\n case \"Backspace\":\n case 8:\n case \"Delete\":\n case 46: {\n event.preventDefault();\n event.stopPropagation();\n return {\n action: \"delete-cell\",\n cell: activeCell,\n };\n }\n }\n}\n","import type { SizeTuple } from \"../../diagram/interfaces\";\nimport type { Cell, InitialCell, NodeCell } from \"../interfaces\";\nimport { isInitialNodeCell } from \"./asserts\";\n\nexport function initializeCells(\n initialCells: InitialCell[] | undefined,\n {\n defaultNodeSize,\n }: {\n defaultNodeSize: SizeTuple;\n }\n): Cell[] {\n const originalCells = initialCells ?? [];\n const finalCells: Cell[] = originalCells.map<Cell>((cell) => {\n if (\n !isInitialNodeCell(cell) ||\n (cell.view?.width !== undefined && cell.view?.height !== undefined)\n ) {\n return cell as NodeCell;\n }\n return {\n ...cell,\n view: {\n width: defaultNodeSize[0],\n height: defaultNodeSize[1],\n ...cell.view,\n },\n } as NodeCell;\n });\n return finalCells;\n}\n","import type {\n ActiveTarget,\n ActiveTargetOfEdge,\n ActiveTargetOfNode,\n} from \"../interfaces\";\n\nexport function sameTarget(\n a: ActiveTarget | null | undefined,\n b: ActiveTarget | null | undefined\n): boolean {\n return a\n ? !!b &&\n a.type === b.type &&\n (a.type === \"node\" || a.type === \"decorator\"\n ? a.id === (b as ActiveTargetOfNode).id\n : a.source === (b as ActiveTargetOfEdge).source &&\n a.target === (b as ActiveTargetOfEdge).target)\n : !b;\n}\n","import type { TransformLiteral } from \"../../diagram/interfaces\";\nimport type { Cell } from \"../interfaces\";\nimport { isEdgeCell } from \"./asserts\";\n\nexport interface TransformToCenterOptions {\n canvasWidth: number;\n canvasHeight: number;\n scaleRange?: [min: number, max: number];\n}\n\nexport function transformToCenter(\n cells: Cell[],\n { canvasWidth, canvasHeight, scaleRange }: TransformToCenterOptions\n): TransformLiteral {\n let left = Infinity;\n let top = Infinity;\n let right = -Infinity;\n let bottom = -Infinity;\n let empty = true;\n for (const cell of cells) {\n if (!isEdgeCell(cell)) {\n empty = false;\n const { view } = cell;\n const r = view.x + view.width;\n const b = view.y + view.height;\n if (view.x < left) {\n left = view.x;\n }\n if (r > right) {\n right = r;\n }\n if (view.y < top) {\n top = view.y;\n }\n if (b > bottom) {\n bottom = b;\n }\n }\n }\n\n const width = right - left;\n const height = bottom - top;\n\n const scale =\n scaleRange && !empty && (width > canvasWidth || height > canvasHeight)\n ? Math.max(\n Math.min(canvasWidth / width, canvasHeight / height, scaleRange[1]),\n scaleRange[0]\n )\n : 1;\n\n const x = empty ? 0 : (canvasWidth - width * scale) / 2 - left * scale;\n const y = empty ? 0 : (canvasHeight - height * scale) / 2 - top * scale;\n\n return { x, y, k: scale };\n}\n","import type { SizeTuple, TransformLiteral } from \"../../diagram/interfaces\";\nimport type {\n Cell,\n InitialCell,\n NodeCell,\n NodeId,\n NodeView,\n} from \"../interfaces\";\nimport { isEdgeCell, isNodeCell } from \"./asserts\";\nimport { initializeCells } from \"./initializeCells\";\n\nexport function updateCells({\n cells,\n defaultNodeSize,\n canvasHeight,\n transform,\n reason,\n parent,\n}: {\n cells: InitialCell[];\n defaultNodeSize: SizeTuple;\n canvasHeight: number;\n transform: TransformLiteral;\n reason?: \"add-related-nodes\";\n parent?: NodeId;\n}): {\n cells: Cell[];\n updated: Cell[];\n} {\n const newCells = initializeCells(cells, { defaultNodeSize });\n const updateCandidates: NodeCell[] = [];\n\n const nodesMap = new Map<string, NodeCell>();\n for (const cell of newCells) {\n if (isNodeCell(cell)) {\n nodesMap.set(cell.id, cell);\n }\n }\n\n let handled = false;\n\n if (reason === \"add-related-nodes\" && parent) {\n // Place these unpositioned downstream nodes below the parent node, and\n // on the right side of the positioned siblings.\n const downstreamNodeIds = new Set<string>();\n for (const cell of newCells) {\n if (\n isEdgeCell(cell) &&\n cell.source === parent &&\n cell.target !== parent\n ) {\n downstreamNodeIds.add(cell.target);\n }\n }\n const parentNode = nodesMap.get(parent);\n if (parentNode?.view.x !== undefined && parentNode.view.y !== undefined) {\n handled = true;\n const downstreamNodes = [...downstreamNodeIds]\n .map((id) => nodesMap.get(id))\n .filter(Boolean) as NodeCell[];\n let rightMostNode: NodeCell | undefined = undefined;\n for (const node of downstreamNodes) {\n if (node.view.x !== undefined && node.view.y !== undefined) {\n // Find the rightmost node that is below the parent node.\n if (\n (!rightMostNode || node.view.x > rightMostNode.view.x) &&\n node.view.y > parentNode.view.y\n ) {\n rightMostNode = node;\n }\n } else {\n // Unpositioned nodes\n updateCandidates.push(node);\n }\n }\n if (updateCandidates.length > 0) {\n const gap = 20;\n let nextX: number;\n let nextY: number;\n if (rightMostNode) {\n // Place unpositioned nodes on the right side of the rightmost positioned siblings.\n nextX = rightMostNode.view.x + rightMostNode.view.width + gap;\n nextY = rightMostNode.view.y;\n } else {\n // If there are no positioned siblings, just place them below the parent.\n const totalWidth = updateCandidates.reduce(\n (acc, node) => acc + node.view.width + gap,\n -gap\n );\n nextX =\n parentNode.view.x - totalWidth / 2 + parentNode.view.width / 2;\n nextY = parentNode.view.y + parentNode.view.height + gap;\n }\n for (const node of updateCandidates) {\n node.view.x = nextX;\n node.view.y = nextY;\n nextX += node.view.width + gap;\n }\n }\n }\n }\n\n if (!handled) {\n // By default, place unpositioned nodes in a grid.\n let maxWidth = defaultNodeSize[0];\n let maxHeight = defaultNodeSize[1];\n const gap = 20;\n const occupiedViews: NodeView[] = [];\n for (const cell of newCells) {\n if (isNodeCell(cell)) {\n if (cell.view.width > maxWidth) {\n maxWidth = cell.view.width;\n }\n if (cell.view.height > maxHeight) {\n maxHeight = cell.view.height;\n }\n if (cell.view.x === undefined || cell.view.y === undefined) {\n updateCandidates.push(cell);\n } else {\n occupiedViews.push(cell.view);\n }\n }\n }\n\n const deltaX = maxWidth + gap;\n const deltaY = maxHeight + gap;\n\n const occupiedIndexes = new Set<string>();\n for (const view of occupiedViews) {\n const x0 = Math.floor((view.x + transform.x / transform.k) / deltaX);\n const y0 = Math.floor((view.y + transform.y / transform.k) / deltaY);\n const x1 = Math.floor(\n (view.x + transform.x / transform.k + view.width) / deltaX\n );\n const y1 = Math.floor(\n (view.y + transform.y / transform.k + view.height) / deltaY\n );\n\n for (let i = x0; i <= x1; i++) {\n for (let j = y0; j <= y1; j++) {\n occupiedIndexes.add(`${i},${j}`);\n }\n }\n }\n\n const scaledDeltaX = deltaX * transform.k;\n const scaledDeltaY = deltaY * transform.k;\n const rows = Math.max(1, Math.floor(canvasHeight / scaledDeltaY));\n let i = 0;\n for (const node of updateCandidates) {\n let xIndex: number;\n let yIndex: number;\n do {\n xIndex = Math.floor(i / rows);\n yIndex = i % rows;\n i++;\n } while (occupiedIndexes.has(`${xIndex},${yIndex}`));\n\n node.view.x =\n (xIndex * scaledDeltaX - transform.x) / transform.k + gap / 2;\n node.view.y =\n (yIndex * scaledDeltaY - transform.y) / transform.k + gap / 2;\n }\n }\n\n return { cells: newCells, updated: updateCandidates };\n}\n","import type { Reducer } from \"react\";\nimport type { DrawCanvasAction } from \"./interfaces\";\nimport type { Cell, NodeCell } from \"../interfaces\";\n\nexport const cells: Reducer<Cell[], DrawCanvasAction> = (state, action) => {\n switch (action.type) {\n case \"drop-node\":\n return insertCellAfter(\n state,\n action.payload,\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n );\n case \"drop-decorator\": {\n if (action.payload.decorator === \"text\") {\n return [...state, action.payload];\n }\n return insertCellAfter(\n state,\n action.payload,\n (cell) => cell.type === \"decorator\" && cell.decorator === \"area\"\n );\n }\n case \"add-nodes\": {\n const index =\n state.findLastIndex(\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n ) + 1;\n return [\n ...state.slice(0, index),\n ...action.payload,\n ...state.slice(index),\n ];\n }\n case \"add-edge\":\n // Add the edge to just next to the previous last edge or area decorator.\n // If not found, append to the start.\n return insertCellAfter(\n state,\n action.payload,\n (cell) =>\n cell.type === \"edge\" ||\n (cell.type === \"decorator\" && cell.decorator === \"area\")\n );\n case \"move-cell\": {\n const { type, id, x, y } = action.payload;\n const index = state.findIndex(\n (cell) => cell.type === type && cell.id === id\n );\n if (index !== -1) {\n const node = state[index] as NodeCell;\n return [\n ...state.slice(0, index),\n { ...node, view: { ...node.view, x, y } },\n ...state.slice(index + 1),\n ];\n }\n return state;\n }\n case \"resize-cell\": {\n const { type, id, width, height } = action.payload;\n const index = state.findIndex(\n (cell) => cell.type === type && cell.id === id\n );\n if (index !== -1) {\n const node = state[index] as NodeCell;\n return [\n ...state.slice(0, index),\n { ...node, view: { ...node.view, width, height } },\n ...state.slice(index + 1),\n ];\n }\n return state;\n }\n case \"update-cells\":\n return action.payload;\n }\n return state;\n};\n\nfunction insertCellAfter(\n cells: Cell[],\n newCell: Cell,\n after: (cell: Cell) => boolean\n) {\n const index = cells.findLastIndex(after) + 1;\n return [...cells.slice(0, index), newCell, ...cells.slice(index)];\n}\n","import { Reducer } from \"react\";\nimport type { DrawCanvasAction, DrawCanvasState } from \"./interfaces\";\nimport { cells } from \"./cells\";\n\ntype ReducersMapObject<S, A> = {\n [K in keyof S]: Reducer<S[K], A>;\n};\n\nfunction combineReducers<S, A>(\n reducers: ReducersMapObject<S, A>\n): Reducer<S, A> {\n return ((state, action) =>\n Object.fromEntries(\n Object.entries<Reducer<any, A>>(reducers).map(([key, value]) => [\n key,\n value(state[key as keyof S], action),\n ])\n )) as Reducer<S, A>;\n}\n\nexport const rootReducer = combineReducers<DrawCanvasState, DrawCanvasAction>({\n cells,\n});\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root:focus{outline:none}.decorator-area .area{fill:rgba(119,141,195,0.1);stroke:none;stroke-width:0}.node,\n.decorator-text{overflow:visible}.cell.active .decorator-area .area,\n.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:4;stroke-width:1}.cell{-webkit-user-select:none;-moz-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}.cell.active .decorator-area .resize-handle,\n.decorator-area:hover .resize-handle{opacity:1}.connect-line:not(.connecting){display:none}.line.dashed{stroke-dasharray:4}.cell.active .decorator-text .text-container{outline:1px dashed var(--palette-blue-5)}.decorator-text .text-container{width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:0.5em}.decorator-text .text:focus{outline:none}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n"],"names":["findNode","cells","id","find","cell","isNodeCell","EdgeComponent","_ref","edge","markerEnd","defaultEdgeLines","sourceNode","useMemo","source","targetNode","target","lineConf","item","checkIfByTransform","line","getDirectLinePoints","nodeViewToNodeRect","view","d","concat","x","y","React","fill","stroke","strokeWidth","className","classNames","dashed","padding","width","height","NodeComponent","node","defaultNodeBricks","memoizedData","value","memoizedValue","setMemoizedValue","useState","useEffect","prev","isEqual","useDeepMemo","data","specifiedUseBrick","useBrick","_defaultNodeBricks$fi","ReactUseBrick","cellToTarget","type","pick","handleMouseDown","event","action","scale","onCellMoving","onCellMoved","onCellResizing","onCellResized","onSwitchActiveTarget","stopPropagation","from","clientX","clientY","original","moved","handleMove","e","finished","_ref2","_ref3","movement","getMovement","onMouseMove","onMouseUp","document","removeEventListener","addEventListener","DecoratorArea","transform","resizeHandleRef","resizeHandle","current","onMouseDown","k","ref","DecoratorText","_cell$view$text","onDecoratorTextEditing","onDecoratorTextChange","label","text","currentLabel","setCurrentLabel","editingLabel","setEditingLabel","editingLabelInitialized","useRef","shouldEmitLabelChange","setShouldEmitLabelChange","handleEnableEdit","useCallback","preventDefault","element","textContent","focus","range","createRange","selectNodeContents","selection","window","getSelection","removeAllRanges","addRange","selectAllText","editing","handleInput","handleBlur","_objectSpread","onDoubleClick","contentEditable","onInput","onBlur","DecoratorComponent","SpecifiedComponent","decorator","console","error","CellComponent","active","onCellContextMenu","gRef","g","handleContextMenu","undefined","onContextMenu","isEdgeCell","isDecoratorCell","ConnectLineComponent","connectLineState","onConnect","connectLineTo","setConnectLineTo","offset","onClick","reset","capture","connecting","join","isInitialNodeCell","handleKeyboard","activeTarget","activeCell","sameTarget","key","keyCode","which","initializeCells","initialCells","defaultNodeSize","map","_cell$view","_cell$view2","a","b","transformToCenter","canvasWidth","canvasHeight","scaleRange","left","Infinity","top","right","bottom","empty","r","Math","max","min","updateCells","reason","parent","newCells","updateCandidates","nodesMap","Map","set","handled","downstreamNodeIds","Set","add","parentNode","get","downstreamNodes","filter","Boolean","rightMostNode","push","length","nextX","nextY","totalWidth","reduce","acc","maxWidth","maxHeight","occupiedViews","deltaX","deltaY","occupiedIndexes","x0","floor","y0","x1","y1","i","j","scaledDeltaX","scaledDeltaY","rows","xIndex","yIndex","has","gap","updated","insertCellAfter","newCell","after","index","findLastIndex","slice","reducers","rootReducer","state","payload","findIndex","Object","fromEntries","entries","___CSS_LOADER_EXPORT___","module","toString"],"sourceRoot":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! For license information please see
|
|
2
|
-
(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[3780],{228:(e,t,n)=>{e.exports={graphlib:n(2336),layout:n(4484),debug:n(7039),util:{time:n(8436).time,notime:n(8436).notime},version:n(7880)}},4080:(e,t,n)=>{"use strict";let r=n(9128),i=n(8436).uniqueId;e.exports={run:function(e){("greedy"===e.graph().acyclicer?r(e,function(e){return t=>e.edge(t).weight}(e)):function(e){let t=[],n={},r={};return e.nodes().forEach((function i(o){r.hasOwnProperty(o)||(r[o]=!0,n[o]=!0,e.outEdges(o).forEach((e=>{n.hasOwnProperty(e.w)?t.push(e):i(e.w)})),delete n[o])})),t}(e)).forEach((t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,i("rev"))}))},undo:function(e){e.edges().forEach((t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},9416:(e,t,n)=>{let r=n(8436);function i(e,t,n,i,o,s){let a={width:0,height:0,rank:s,borderType:t},h=o[t][s-1],u=r.addDummyNode(e,"border",a,n);o[t][s]=u,e.setParent(u,i),h&&e.setEdge(h,u,{weight:1})}e.exports=function(e){e.children().forEach((function t(n){let r=e.children(n),o=e.node(n);if(r.length&&r.forEach(t),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(let t=o.minRank,r=o.maxRank+1;t<r;++t)i(e,"borderLeft","_bl",n,o,t),i(e,"borderRight","_br",n,o,t)}}))}},1275:e=>{"use strict";function t(e){e.nodes().forEach((t=>n(e.node(t)))),e.edges().forEach((t=>n(e.edge(t))))}function n(e){let t=e.width;e.width=e.height,e.height=t}function r(e){e.y=-e.y}function i(e){let t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){let n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||t(e)},undo:function(e){let n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){e.nodes().forEach((t=>r(e.node(t)))),e.edges().forEach((t=>{let n=e.edge(t);n.points.forEach(r),n.hasOwnProperty("y")&&r(n)}))}(e),"lr"!==n&&"rl"!==n||(function(e){e.nodes().forEach((t=>i(e.node(t)))),e.edges().forEach((t=>{let n=e.edge(t);n.points.forEach(i),n.hasOwnProperty("x")&&i(n)}))}(e),t(e))}}},4636:e=>{function t(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function n(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,n=e._prev;if(n!==e)return t(n),n}enqueue(e){let n=this._sentinel;e._prev&&e._next&&t(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,n)),r=r._prev;return"["+e.join(", ")+"]"}}},7039:(e,t,n)=>{let r=n(8436),i=n(2336).Graph;e.exports={debugOrdering:function(e){let t=r.buildLayerMatrix(e),n=new i({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach((t=>{n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),e.edges().forEach((e=>n.setEdge(e.v,e.w,{},e.name))),t.forEach(((e,t)=>{let r="layer"+t;n.setNode(r,{rank:"same"}),e.reduce(((e,t)=>(n.setEdge(e,t,{style:"invis"}),t)))})),n}}},9128:(e,t,n)=>{let r=n(2336).Graph,i=n(4636);e.exports=function(e,t){if(e.nodeCount()<=1)return[];let n=function(e,t){let n=new r,o=0,s=0;e.nodes().forEach((e=>{n.setNode(e,{v:e,in:0,out:0})})),e.edges().forEach((e=>{let r=n.edge(e.v,e.w)||0,i=t(e),a=r+i;n.setEdge(e.v,e.w,a),s=Math.max(s,n.node(e.v).out+=i),o=Math.max(o,n.node(e.w).in+=i)}));let h=function(e){const t=[];for(let n=0;n<e;n++)t.push(n);return t}(s+o+3).map((()=>new i)),u=o+1;return n.nodes().forEach((e=>{a(h,u,n.node(e))})),{graph:n,buckets:h,zeroIdx:u}}(e,t||o);return function(e,t,n){let r,i=[],o=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(let o=t.length-2;o>0;--o)if(r=t[o].dequeue(),r){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx).flatMap((t=>e.outEdges(t.v,t.w)))};let o=()=>1;function s(e,t,n,r,i){let o=i?[]:void 0;return e.inEdges(r.v).forEach((r=>{let s=e.edge(r),h=e.node(r.v);i&&o.push({v:r.v,w:r.w}),h.out-=s,a(t,n,h)})),e.outEdges(r.v).forEach((r=>{let i=e.edge(r),o=r.w,s=e.node(o);s.in-=i,a(t,n,s)})),e.removeNode(r.v),o}function a(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},4484:(e,t,n)=>{"use strict";let r=n(4080),i=n(4332),o=n(9699),s=n(8436).normalizeRanks,a=n(4152),h=n(8436).removeEmptyRanks,u=n(6024),c=n(9416),d=n(1275),l=n(1212),f=n(7832),p=n(8436),g=n(2336).Graph;e.exports=function(e,t){let n=t&&t.debugTiming?p.time:p.notime;n("layout",(()=>{let t=n(" buildLayoutGraph",(()=>function(e){let t=new g({multigraph:!0,compound:!0}),n=k(e.graph());return t.setGraph(Object.assign({},y,N(n,v),p.pick(n,_))),e.nodes().forEach((n=>{const r=N(k(e.node(n)),w);Object.keys(m).forEach((e=>{void 0===r[e]&&(r[e]=m[e])})),t.setNode(n,r),t.setParent(n,e.parent(n))})),e.edges().forEach((n=>{let r=k(e.edge(n));t.setEdge(n,Object.assign({},b,N(r,x),p.pick(r,E)))})),t}(e)));n(" runLayout",(()=>function(e,t){t(" makeSpaceForEdgeLabels",(()=>function(e){let t=e.graph();t.ranksep/=2,e.edges().forEach((n=>{let r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e))),t(" removeSelfEdges",(()=>function(e){e.edges().forEach((t=>{if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e))),t(" acyclic",(()=>r.run(e))),t(" nestingGraph.run",(()=>u.run(e))),t(" rank",(()=>o(p.asNonCompoundGraph(e)))),t(" injectEdgeLabelProxies",(()=>function(e){e.edges().forEach((t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v),r={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};p.addDummyNode(e,"edge-proxy",r,"_ep")}}))}(e))),t(" removeEmptyRanks",(()=>h(e))),t(" nestingGraph.cleanup",(()=>u.cleanup(e))),t(" normalizeRanks",(()=>s(e))),t(" assignRankMinMax",(()=>function(e){let t=0;e.nodes().forEach((n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))})),e.graph().maxRank=t}(e))),t(" removeEdgeLabelProxies",(()=>function(e){e.nodes().forEach((t=>{let n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e))),t(" normalize.run",(()=>i.run(e))),t(" parentDummyChains",(()=>a(e))),t(" addBorderSegments",(()=>c(e))),t(" order",(()=>l(e))),t(" insertSelfEdges",(()=>function(e){p.buildLayerMatrix(e).forEach((t=>{var n=0;t.forEach(((t,r)=>{var i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach((t=>{p.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},"_se")})),delete i.selfEdges}))}))}(e))),t(" adjustCoordinateSystem",(()=>d.adjust(e))),t(" position",(()=>f(e))),t(" positionSelfEdges",(()=>function(e){e.nodes().forEach((t=>{var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,s=n.x-i,a=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*s/3,y:o-a},{x:i+5*s/6,y:o-a},{x:i+s,y:o},{x:i+5*s/6,y:o+a},{x:i+2*s/3,y:o+a}],n.label.x=n.x,n.label.y=n.y}}))}(e))),t(" removeBorderNodes",(()=>function(e){e.nodes().forEach((t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),o=e.node(n.borderLeft[n.borderLeft.length-1]),s=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(s.x-o.x),n.height=Math.abs(i.y-r.y),n.x=o.x+n.width/2,n.y=r.y+n.height/2}})),e.nodes().forEach((t=>{"border"===e.node(t).dummy&&e.removeNode(t)}))}(e))),t(" normalize.undo",(()=>i.undo(e))),t(" fixupEdgeLabelCoords",(()=>function(e){e.edges().forEach((t=>{let n=e.edge(t);if(n.hasOwnProperty("x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e))),t(" undoCoordinateSystem",(()=>d.undo(e))),t(" translateGraph",(()=>function(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,o=e.graph(),s=o.marginx||0,a=o.marginy||0;function h(e){let o=e.x,s=e.y,a=e.width,h=e.height;t=Math.min(t,o-a/2),n=Math.max(n,o+a/2),r=Math.min(r,s-h/2),i=Math.max(i,s+h/2)}e.nodes().forEach((t=>h(e.node(t)))),e.edges().forEach((t=>{let n=e.edge(t);n.hasOwnProperty("x")&&h(n)})),t-=s,r-=a,e.nodes().forEach((n=>{let i=e.node(n);i.x-=t,i.y-=r})),e.edges().forEach((n=>{let i=e.edge(n);i.points.forEach((e=>{e.x-=t,e.y-=r})),i.hasOwnProperty("x")&&(i.x-=t),i.hasOwnProperty("y")&&(i.y-=r)})),o.width=n-t+s,o.height=i-r+a}(e))),t(" assignNodeIntersects",(()=>function(e){e.edges().forEach((t=>{let n,r,i=e.edge(t),o=e.node(t.v),s=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=s,r=o),i.points.unshift(p.intersectRect(o,n)),i.points.push(p.intersectRect(s,r))}))}(e))),t(" reversePoints",(()=>function(e){e.edges().forEach((t=>{let n=e.edge(t);n.reversed&&n.points.reverse()}))}(e))),t(" acyclic.undo",(()=>r.undo(e)))}(t,n))),n(" updateInputGraph",(()=>function(e,t){e.nodes().forEach((n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))})),e.edges().forEach((n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,i.hasOwnProperty("x")&&(r.x=i.x,r.y=i.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)))}))};let v=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_=["acyclicer","ranker","rankdir","align"],w=["width","height"],m={width:0,height:0},x=["minlen","weight","width","height","labeloffset"],b={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},E=["labelpos"];function N(e,t){return p.mapValues(p.pick(e,t),Number)}function k(e){var t={};return e&&Object.entries(e).forEach((([e,n])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=n})),t}},6024:(e,t,n)=>{let r=n(8436);function i(e,t,n,o,s,a,h){let u=e.children(h);if(!u.length)return void(h!==t&&e.setEdge(t,h,{weight:0,minlen:n}));let c=r.addBorderNode(e,"_bt"),d=r.addBorderNode(e,"_bb"),l=e.node(h);e.setParent(c,h),l.borderTop=c,e.setParent(d,h),l.borderBottom=d,u.forEach((r=>{i(e,t,n,o,s,a,r);let u=e.node(r),l=u.borderTop?u.borderTop:r,f=u.borderBottom?u.borderBottom:r,p=u.borderTop?o:2*o,g=l!==f?1:s-a[h]+1;e.setEdge(c,l,{weight:p,minlen:g,nestingEdge:!0}),e.setEdge(f,d,{weight:p,minlen:g,nestingEdge:!0})})),e.parent(h)||e.setEdge(t,c,{weight:0,minlen:s+a[h]})}e.exports={run:function(e){let t=r.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(r,i){var o=e.children(r);o&&o.length&&o.forEach((e=>n(e,i+1))),t[r]=i}return e.children().forEach((e=>n(e,1))),t}(e),o=Math.max(...Object.values(n))-1,s=2*o+1;e.graph().nestingRoot=t,e.edges().forEach((t=>e.edge(t).minlen*=s));let a=function(e){return e.edges().reduce(((t,n)=>t+e.edge(n).weight),0)}(e)+1;e.children().forEach((r=>i(e,t,s,a,o,n,r))),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach((t=>{e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},4332:(e,t,n)=>{"use strict";let r=n(8436);e.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach((t=>function(e,t){let n,i,o,s=t.v,a=e.node(s).rank,h=t.w,u=e.node(h).rank,c=t.name,d=e.edge(t),l=d.labelRank;if(u!==a+1){for(e.removeEdge(t),o=0,++a;a<u;++o,++a)d.points=[],i={width:0,height:0,edgeLabel:d,edgeObj:t,rank:a},n=r.addDummyNode(e,"edge",i,"_d"),a===l&&(i.width=d.width,i.height=d.height,i.dummy="edge-label",i.labelpos=d.labelpos),e.setEdge(s,n,{weight:d.weight},c),0===o&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,h,{weight:d.weight},c)}}(e,t)))},undo:function(e){e.graph().dummyChains.forEach((t=>{let n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),t=n,r=e.node(t)}))}}},3236:e=>{e.exports=function(e,t,n){let r,i={};n.forEach((n=>{let o,s,a=e.parent(n);for(;a;){if(o=e.parent(a),o?(s=i[o],i[o]=a):(s=r,r=a),s&&s!==a)return void t.setEdge(s,a);a=o}}))}},5472:e=>{e.exports=function(e,t=[]){return t.map((t=>{let n=e.inEdges(t);if(n.length){let r=n.reduce(((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}}))}},6520:(e,t,n)=>{let r=n(2336).Graph,i=n(8436);e.exports=function(e,t,n){let o=function(e){for(var t;e.hasNode(t=i.uniqueId("_root")););return t}(e),s=new r({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((t=>e.node(t)));return e.nodes().forEach((r=>{let i=e.node(r),a=e.parent(r);(i.rank===t||i.minRank<=t&&t<=i.maxRank)&&(s.setNode(r),s.setParent(r,a||o),e[n](r).forEach((t=>{let n=t.v===r?t.w:t.v,i=s.edge(n,r),o=void 0!==i?i.weight:0;s.setEdge(n,r,{weight:e.edge(t).weight+o})})),i.hasOwnProperty("minRank")&&s.setNode(r,{borderLeft:i.borderLeft[t],borderRight:i.borderRight[t]}))})),s}},6896:(e,t,n)=>{"use strict";let r=n(8436).zipObject;function i(e,t,n){let i=r(n,n.map(((e,t)=>t))),o=t.flatMap((t=>e.outEdges(t).map((t=>({pos:i[t.w],weight:e.edge(t).weight}))).sort(((e,t)=>e.pos-t.pos)))),s=1;for(;s<n.length;)s<<=1;let a=2*s-1;s-=1;let h=new Array(a).fill(0),u=0;return o.forEach((e=>{let t=e.pos+s;h[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=h[t+1]),t=t-1>>1,h[t]+=e.weight;u+=e.weight*n})),u}e.exports=function(e,t){let n=0;for(let r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}},1212:(e,t,n)=>{"use strict";let r=n(3032),i=n(6896),o=n(1061),s=n(6520),a=n(3236),h=n(2336).Graph,u=n(8436);function c(e,t,n){return t.map((function(t){return s(e,t,n)}))}function d(e,t){let n=new h;e.forEach((function(e){let r=e.graph().root,i=o(e,r,n,t);i.vs.forEach(((t,n)=>e.node(t).order=n)),a(e,n,i.vs)}))}function l(e,t){Object.values(t).forEach((t=>t.forEach(((t,n)=>e.node(t).order=n))))}e.exports=function(e){let t=u.maxRank(e),n=c(e,u.range(1,t+1),"inEdges"),o=c(e,u.range(t-1,-1,-1),"outEdges"),s=r(e);l(e,s);let a,h=Number.POSITIVE_INFINITY;for(let t=0,r=0;r<4;++t,++r){d(t%2?n:o,t%4>=2),s=u.buildLayerMatrix(e);let c=i(e,s);c<h&&(r=0,a=Object.assign({},s),h=c)}l(e,a)}},3032:(e,t,n)=>{"use strict";let r=n(8436);e.exports=function(e){let t={},n=e.nodes().filter((t=>!e.children(t).length)),i=Math.max(...n.map((t=>e.node(t).rank))),o=r.range(i+1).map((()=>[]));return n.sort(((t,n)=>e.node(t).rank-e.node(n).rank)).forEach((function n(r){if(t[r])return;t[r]=!0;let i=e.node(r);o[i.rank].push(r),e.successors(r).forEach(n)})),o}},2292:(e,t,n)=>{"use strict";let r=n(8436);e.exports=function(e,t){let n={};return e.forEach(((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight)})),t.edges().forEach((e=>{let t=n[e.v],r=n[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(n[e.w]))})),function(e){let t=[];function n(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function i(t){return n=>{n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter((e=>!e.merged)).map((e=>r.pick(e,["vs","i","barycenter","weight"])))}(Object.values(n).filter((e=>!e.indegree)))}},1061:(e,t,n)=>{let r=n(5472),i=n(2292),o=n(7396);e.exports=function e(t,n,s,a){let h=t.children(n),u=t.node(n),c=u?u.borderLeft:void 0,d=u?u.borderRight:void 0,l={};c&&(h=h.filter((e=>e!==c&&e!==d)));let f=r(t,h);f.forEach((n=>{if(t.children(n.v).length){let o=e(t,n.v,s,a);l[n.v]=o,o.hasOwnProperty("barycenter")&&(i=o,void 0!==(r=n).barycenter?(r.barycenter=(r.barycenter*r.weight+i.barycenter*i.weight)/(r.weight+i.weight),r.weight+=i.weight):(r.barycenter=i.barycenter,r.weight=i.weight))}var r,i}));let p=i(f,s);!function(e,t){e.forEach((e=>{e.vs=e.vs.flatMap((e=>t[e]?t[e].vs:e))}))}(p,l);let g=o(p,a);if(c&&(g.vs=[c,g.vs,d].flat(!0),t.predecessors(c).length)){let e=t.node(t.predecessors(c)[0]),n=t.node(t.predecessors(d)[0]);g.hasOwnProperty("barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+e.order+n.order)/(g.weight+2),g.weight+=2}return g}},7396:(e,t,n)=>{let r=n(8436);function i(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}e.exports=function(e,t){let n=r.partition(e,(e=>e.hasOwnProperty("barycenter"))),o=n.lhs,s=n.rhs.sort(((e,t)=>t.i-e.i)),a=[],h=0,u=0,c=0;var d;o.sort((d=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:d?t.i-e.i:e.i-t.i)),c=i(a,s,c),o.forEach((e=>{c+=e.vs.length,a.push(e.vs),h+=e.barycenter*e.weight,u+=e.weight,c=i(a,s,c)}));let l={vs:a.flat(!0)};return u&&(l.barycenter=h/u,l.weight=u),l}},4152:e=>{e.exports=function(e){let t=function(e){let t={},n=0;return e.children().forEach((function r(i){let o=n;e.children(i).forEach(r),t[i]={low:o,lim:n++}})),t}(e);e.graph().dummyChains.forEach((n=>{let r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){let i,o,s=[],a=[],h=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),s.push(i)}while(i&&(t[i].low>h||u>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)a.push(i);return{path:s.concat(a.reverse()),lca:o}}(e,t,i.v,i.w),s=o.path,a=o.lca,h=0,u=s[h],c=!0;for(;n!==i.w;){if(r=e.node(n),c){for(;(u=s[h])!==a&&e.node(u).maxRank<r.rank;)h++;u===a&&(c=!1)}if(!c){for(;h<s.length-1&&e.node(u=s[h+1]).minRank<=r.rank;)h++;u=s[h]}e.setParent(n,u),n=e.successors(n)[0]}}))}},2571:(e,t,n)=>{"use strict";let r=n(2336).Graph,i=n(8436);function o(e,t){let n={};return t.reduce((function(t,r){let i=0,o=0,s=t.length,h=r[r.length-1];return r.forEach(((t,u)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find((t=>e.node(t).dummy))}(e,t),d=c?e.node(c).order:s;(c||t===h)&&(r.slice(o,u+1).forEach((t=>{e.predecessors(t).forEach((r=>{let o=e.node(r),s=o.order;!(s<i||d<s)||o.dummy&&e.node(t).dummy||a(n,r,t)}))})),o=u+1,i=d)})),r})),n}function s(e,t){let n={};function r(t,r,o,s,h){let u;i.range(r,o).forEach((r=>{u=t[r],e.node(u).dummy&&e.predecessors(u).forEach((t=>{let r=e.node(t);r.dummy&&(r.order<s||r.order>h)&&a(n,t,u)}))}))}return t.reduce((function(t,n){let i,o=-1,s=0;return n.forEach(((a,h)=>{if("border"===e.node(a).dummy){let t=e.predecessors(a);t.length&&(i=e.node(t[0]).order,r(n,s,h,o,i),s=h,o=i)}r(n,s,n.length,i,t.length)})),n})),n}function a(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function h(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&e[t].hasOwnProperty(n)}function u(e,t,n,r){let i={},o={},s={};return t.forEach((e=>{e.forEach(((e,t)=>{i[e]=e,o[e]=e,s[e]=t}))})),t.forEach((e=>{let t=-1;e.forEach((e=>{let a=r(e);if(a.length){a=a.sort(((e,t)=>s[e]-s[t]));let r=(a.length-1)/2;for(let u=Math.floor(r),c=Math.ceil(r);u<=c;++u){let r=a[u];o[e]===e&&t<s[r]&&!h(n,e,r)&&(o[r]=e,o[e]=i[e]=i[r],t=s[r])}}}))})),{root:i,align:o}}function c(e,t,n,i,o){let s={},a=function(e,t,n,i){let o=new r,s=e.graph(),a=function(e,t,n){return(r,i,o)=>{let s,a=r.node(i),h=r.node(o),u=0;if(u+=a.width/2,a.hasOwnProperty("labelpos"))switch(a.labelpos.toLowerCase()){case"l":s=-a.width/2;break;case"r":s=a.width/2}if(s&&(u+=n?s:-s),s=0,u+=(a.dummy?t:e)/2,u+=(h.dummy?t:e)/2,u+=h.width/2,h.hasOwnProperty("labelpos"))switch(h.labelpos.toLowerCase()){case"l":s=h.width/2;break;case"r":s=-h.width/2}return s&&(u+=n?s:-s),s=0,u}}(s.nodesep,s.edgesep,i);return t.forEach((t=>{let r;t.forEach((t=>{let i=n[t];if(o.setNode(i),r){var s=n[r],h=o.edge(s,i);o.setEdge(s,i,Math.max(a(e,t,r),h||0))}r=t}))})),o}(e,t,n,o),h=o?"borderLeft":"borderRight";function u(e,t){let n=a.nodes(),r=n.pop(),i={};for(;r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return u((function(e){s[e]=a.inEdges(e).reduce(((e,t)=>Math.max(e,s[t.v]+a.edge(t))),0)}),a.predecessors.bind(a)),u((function(t){let n=a.outEdges(t).reduce(((e,t)=>Math.min(e,s[t.w]-a.edge(t))),Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==h&&(s[t]=Math.max(s[t],n))}),a.successors.bind(a)),Object.keys(i).forEach((e=>s[e]=s[n[e]])),s}function d(e,t){return Object.values(t).reduce(((t,n)=>{let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(n).forEach((([t,n])=>{let o=function(e,t){return e.node(t).width}(e,t)/2;r=Math.max(n+o,r),i=Math.min(n-o,i)}));const o=r-i;return o<t[0]&&(t=[o,n]),t}),[Number.POSITIVE_INFINITY,null])[1]}function l(e,t){let n=Object.values(t),r=Math.min(...n),o=Math.max(...n);["u","d"].forEach((n=>{["l","r"].forEach((s=>{let a=n+s,h=e[a];if(h===t)return;let u=Object.values(h),c=r-Math.min(...u);"l"!==s&&(c=o-Math.max(...u)),c&&(e[a]=i.mapValues(h,(e=>e+c)))}))}))}function f(e,t){return i.mapValues(e.ul,((n,r)=>{if(t)return e[t.toLowerCase()][r];{let t=Object.values(e).map((e=>e[r])).sort(((e,t)=>e-t));return(t[1]+t[2])/2}}))}e.exports={positionX:function(e){let t,n=i.buildLayerMatrix(e),r=Object.assign(o(e,n),s(e,n)),a={};["u","d"].forEach((o=>{t="u"===o?n:Object.values(n).reverse(),["l","r"].forEach((n=>{"r"===n&&(t=t.map((e=>Object.values(e).reverse())));let s=("u"===o?e.predecessors:e.successors).bind(e),h=u(0,t,r,s),d=c(e,t,h.root,h.align,"r"===n);"r"===n&&(d=i.mapValues(d,(e=>-e))),a[o+n]=d}))}));let h=d(e,a);return l(a,h),f(a,e.graph().align)},findType1Conflicts:o,findType2Conflicts:s,addConflict:a,hasConflict:h,verticalAlignment:u,horizontalCompaction:c,alignCoordinates:l,findSmallestWidthAlignment:d,balance:f}},7832:(e,t,n)=>{"use strict";let r=n(8436),i=n(2571).positionX;e.exports=function(e){(function(e){let t=r.buildLayerMatrix(e),n=e.graph().ranksep,i=0;t.forEach((t=>{const r=t.reduce(((t,n)=>{const r=e.node(n).height;return t>r?t:r}),0);t.forEach((t=>e.node(t).y=i+r/2)),i+=r+n}))})(e=r.asNonCompoundGraph(e)),Object.entries(i(e)).forEach((([t,n])=>e.node(t).x=n))}},4204:(e,t,n)=>{"use strict";var r=n(2336).Graph,i=n(3632).slack;function o(e,t){return e.nodes().forEach((function n(r){t.nodeEdges(r).forEach((o=>{var s=o.v,a=r===s?o.w:s;e.hasNode(a)||i(t,o)||(e.setNode(a,{}),e.setEdge(r,a,{}),n(a))}))})),e.nodeCount()}function s(e,t){return t.edges().reduce(((n,r)=>{let o=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(o=i(t,r)),o<n[0]?[o,r]:n}),[Number.POSITIVE_INFINITY,null])[1]}function a(e,t,n){e.nodes().forEach((e=>t.node(e).rank+=n))}e.exports=function(e){var t,n,h=new r({directed:!1}),u=e.nodes()[0],c=e.nodeCount();for(h.setNode(u,{});o(h,e)<c;)t=s(h,e),n=h.hasNode(t.v)?i(e,t):-i(e,t),a(h,e,n);return h}},9699:(e,t,n)=>{"use strict";var r=n(3632).longestPath,i=n(4204),o=n(1808);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){o(e)}(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":s(e)}};var s=r},1808:(e,t,n)=>{"use strict";var r=n(4204),i=n(3632).slack,o=n(3632).longestPath,s=n(2336).alg.preorder,a=n(2336).alg.postorder,h=n(8436).simplify;function u(e){e=h(e),o(e);var t,n=r(e);for(l(n),c(n,e);t=p(n);)v(n,e,t,g(n,e,t))}function c(e,t){var n=a(e,e.nodes());(n=n.slice(0,n.length-1)).forEach((n=>function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=d(e,t,n)}(e,t,n)))}function d(e,t,n){var r=e.node(n).parent,i=!0,o=t.edge(n,r),s=0;return o||(i=!1,o=t.edge(r,n)),s=o.weight,t.nodeEdges(n).forEach((o=>{var a,h,u=o.v===n,c=u?o.w:o.v;if(c!==r){var d=u===i,l=t.edge(o).weight;if(s+=d?l:-l,a=n,h=c,e.hasEdge(a,h)){var f=e.edge(n,c).cutvalue;s+=d?-f:f}}})),s}function l(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,n,r,i){var o=n,s=e.node(r);return t[r]=!0,e.neighbors(r).forEach((i=>{t.hasOwnProperty(i)||(n=f(e,t,n,i,r))})),s.low=o,s.lim=n++,i?s.parent=i:delete s.parent,n}function p(e){return e.edges().find((t=>e.edge(t).cutvalue<0))}function g(e,t,n){var r=n.v,o=n.w;t.hasEdge(r,o)||(r=n.w,o=n.v);var s=e.node(r),a=e.node(o),h=s,u=!1;s.lim>a.lim&&(h=a,u=!0);var c=t.edges().filter((t=>u===y(0,e.node(t.v),h)&&u!==y(0,e.node(t.w),h)));return c.reduce(((e,n)=>i(t,n)<i(t,e)?n:e))}function v(e,t,n,r){var i=n.v,o=n.w;e.removeEdge(i,o),e.setEdge(r.v,r.w,{}),l(e),c(e,t),function(e,t){var n=e.nodes().find((e=>!t.node(e).parent)),r=s(e,n);(r=r.slice(1)).forEach((n=>{var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function y(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=u,u.initLowLimValues=l,u.initCutValues=c,u.calcCutValue=d,u.leaveEdge=p,u.enterEdge=g,u.exchangeEdges=v},3632:e=>{"use strict";e.exports={longestPath:function(e){var t={};e.sources().forEach((function n(r){var i=e.node(r);if(t.hasOwnProperty(r))return i.rank;t[r]=!0;var o=Math.min(...e.outEdges(r).map((t=>null==t?Number.POSITIVE_INFINITY:n(t.w)-e.edge(t).minlen)));return o===Number.POSITIVE_INFINITY&&(o=0),i.rank=o}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},8436:(e,t,n)=>{"use strict";let r=n(2336).Graph;function i(e,t,n,r){let i;do{i=a(r)}while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function o(e){return Math.max(...e.nodes().map((t=>{let n=e.node(t).rank;return void 0===n?Number.MIN_VALUE:n})))}e.exports={addBorderNode:function(e,t,n,r){let o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),i(e,"border",o,t)},addDummyNode:i,asNonCompoundGraph:function(e){let t=new r({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach((n=>{e.children(n).length||t.setNode(n,e.node(n))})),e.edges().forEach((n=>{t.setEdge(n,e.edge(n))})),t},buildLayerMatrix:function(e){let t=h(o(e)+1).map((()=>[]));return e.nodes().forEach((n=>{let r=e.node(n),i=r.rank;void 0!==i&&(t[i][r.order]=n)})),t},intersectRect:function(e,t){let n,r,i=e.x,o=e.y,s=t.x-i,a=t.y-o,h=e.width/2,u=e.height/2;if(!s&&!a)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*h>Math.abs(s)*u?(a<0&&(u=-u),n=u*s/a,r=u):(s<0&&(h=-h),n=h,r=h*a/s),{x:i+n,y:o+r}},mapValues:function(e,t){let n=t;return"string"==typeof t&&(n=e=>e[t]),Object.entries(e).reduce(((e,[t,r])=>(e[t]=n(r,t),e)),{})},maxRank:o,normalizeRanks:function(e){let t=Math.min(...e.nodes().map((t=>{let n=e.node(t).rank;return void 0===n?Number.MAX_VALUE:n})));e.nodes().forEach((n=>{let r=e.node(n);r.hasOwnProperty("rank")&&(r.rank-=t)}))},notime:function(e,t){return t()},partition:function(e,t){let n={lhs:[],rhs:[]};return e.forEach((e=>{t(e)?n.lhs.push(e):n.rhs.push(e)})),n},pick:function(e,t){const n={};for(const r of t)void 0!==e[r]&&(n[r]=e[r]);return n},predecessorWeights:function(e){let t=e.nodes().map((t=>{let n={};return e.inEdges(t).forEach((t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return u(e.nodes(),t)},range:h,removeEmptyRanks:function(e){let t=Math.min(...e.nodes().map((t=>e.node(t).rank))),n=[];e.nodes().forEach((r=>{let i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));let r=0,i=e.graph().nodeRankFactor;Array.from(n).forEach(((t,n)=>{void 0===t&&n%i!=0?--r:void 0!==t&&r&&t.forEach((t=>e.node(t).rank+=r))}))},simplify:function(e){let t=(new r).setGraph(e.graph());return e.nodes().forEach((n=>t.setNode(n,e.node(n)))),e.edges().forEach((n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},successorWeights:function(e){let t=e.nodes().map((t=>{let n={};return e.outEdges(t).forEach((t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return u(e.nodes(),t)},time:function(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}},uniqueId:a,zipObject:u};let s=0;function a(e){var t=++s;return toString(e)+t}function h(e,t,n=1){null==t&&(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);const i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function u(e,t){return e.reduce(((e,n,r)=>(e[n]=t[r],e)),{})}},7880:e=>{e.exports="1.0.4"},2336:(e,t,n)=>{var r=n(7728);e.exports={Graph:r.Graph,json:n(4800),alg:n(8128),version:r.version}},4116:e=>{e.exports=function(e){var t,n={},r=[];function i(r){n.hasOwnProperty(r)||(n[r]=!0,t.push(r),e.successors(r).forEach(i),e.predecessors(r).forEach(i))}return e.nodes().forEach((function(e){t=[],i(e),t.length&&r.push(t)})),r}},947:e=>{function t(e,t,n,i){for(var o=[[e,!1]];o.length>0;){var s=o.pop();s[1]?i.push(s[0]):n.hasOwnProperty(s[0])||(n[s[0]]=!0,o.push([s[0],!0]),r(t(s[0]),(e=>o.push([e,!1]))))}}function n(e,t,n,i){for(var o=[e];o.length>0;){var s=o.pop();n.hasOwnProperty(s)||(n[s]=!0,i.push(s),r(t(s),(e=>o.push(e))))}}function r(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}e.exports=function(e,r,i){Array.isArray(r)||(r=[r]);var o=e.isDirected()?t=>e.successors(t):t=>e.neighbors(t),s="post"===i?t:n,a=[],h={};return r.forEach((t=>{if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);s(t,o,h,a)})),a}},9096:(e,t,n)=>{var r=n(8036);e.exports=function(e,t,n){return e.nodes().reduce((function(i,o){return i[o]=r(e,o,t,n),i}),{})}},8036:(e,t,n)=>{var r=n(4252);e.exports=function(e,t,n,o){return function(e,t,n,i){var o,s,a={},h=new r,u=function(e){var t=e.v!==o?e.v:e.w,r=a[t],i=n(e),u=s.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u<r.distance&&(r.distance=u,r.predecessor=o,h.decrease(t,u))};for(e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;a[e]={distance:n},h.add(e,n)}));h.size()>0&&(o=h.removeMin(),(s=a[o]).distance!==Number.POSITIVE_INFINITY);)i(o).forEach(u);return a}(e,String(t),n||i,o||function(t){return e.outEdges(t)})};var i=()=>1},5544:(e,t,n)=>{var r=n(144);e.exports=function(e){return r(e).filter((function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},2684:e=>{e.exports=function(e,n,r){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],s=o[n],a=r.distance+i.distance;a<s.distance&&(s.distance=a,s.predecessor=i.predecessor)}))}))})),r}(e,n||t,r||function(t){return e.outEdges(t)})};var t=()=>1},8128:(e,t,n)=>{e.exports={components:n(4116),dijkstra:n(8036),dijkstraAll:n(9096),findCycles:n(5544),floydWarshall:n(2684),isAcyclic:n(8492),postorder:n(1900),preorder:n(1624),prim:n(1004),tarjan:n(144),topsort:n(6816)}},8492:(e,t,n)=>{var r=n(6816);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1900:(e,t,n)=>{var r=n(947);e.exports=function(e,t){return r(e,t,"post")}},1624:(e,t,n)=>{var r=n(947);e.exports=function(e,t){return r(e,t,"pre")}},1004:(e,t,n)=>{var r=n(44),i=n(4252);e.exports=function(e,t){var n,o=new r,s={},a=new i;function h(e){var r=e.v===n?e.w:e.v,i=a.priority(r);if(void 0!==i){var o=t(e);o<i&&(s[r]=n,a.decrease(r,o))}}if(0===e.nodeCount())return o;e.nodes().forEach((function(e){a.add(e,Number.POSITIVE_INFINITY),o.setNode(e)})),a.decrease(e.nodes()[0],0);for(var u=!1;a.size()>0;){if(n=a.removeMin(),s.hasOwnProperty(n))o.setEdge(n,s[n]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(n).forEach(h)}return o}},144:e=>{e.exports=function(e){var t=0,n=[],r={},i=[];function o(s){var a=r[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.hasOwnProperty(e)?r[e].onStack&&(a.lowlink=Math.min(a.lowlink,r[e].index)):(o(e),a.lowlink=Math.min(a.lowlink,r[e].lowlink))})),a.lowlink===a.index){var h,u=[];do{h=n.pop(),r[h].onStack=!1,u.push(h)}while(s!==h);i.push(u)}}return e.nodes().forEach((function(e){r.hasOwnProperty(e)||o(e)})),i}},6816:e=>{function t(e){var t={},r={},i=[];if(e.sinks().forEach((function o(s){if(r.hasOwnProperty(s))throw new n;t.hasOwnProperty(s)||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(o),delete r[s],i.push(s))})),Object.keys(t).length!==e.nodeCount())throw new n;return i}class n extends Error{constructor(){super(...arguments)}}e.exports=t,t.CycleException=n},4252:e=>{e.exports=class{#e=[];#t={};size(){return this.#e.length}keys(){return this.#e.map((function(e){return e.key}))}has(e){return this.#t.hasOwnProperty(e)}priority(e){var t=this.#t[e];if(void 0!==t)return this.#e[t].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this.#e[0].key}add(e,t){var n=this.#t;if(e=String(e),!n.hasOwnProperty(e)){var r=this.#e,i=r.length;return n[e]=i,r.push({key:e,priority:t}),this.#n(i),!0}return!1}removeMin(){this.#r(0,this.#e.length-1);var e=this.#e.pop();return delete this.#t[e.key],this.#i(0),e.key}decrease(e,t){var n=this.#t[e];if(t>this.#e[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this.#e[n].priority+" New: "+t);this.#e[n].priority=t,this.#n(n)}#i(e){var t=this.#e,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this.#r(e,i),this.#i(i)))}#n(e){for(var t,n=this.#e,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this.#r(e,t),e=t}#r(e,t){var n=this.#e,r=this.#t,i=n[e],o=n[t];n[e]=o,n[t]=i,r[o.key]=e,r[i.key]=t}}},44:e=>{"use strict";var t="\0",n="\0",r="";function i(e,t){e[t]?e[t]++:e[t]=1}function o(e,t){--e[t]||delete e[t]}function s(e,n,i,o){var s=""+n,a=""+i;if(!e&&s>a){var h=s;s=a,a=h}return s+r+a+r+(void 0===o?t:o)}function a(e,t){return s(e,t.v,t.w,t.name)}e.exports=class{#o=!0;#s=!1;#a=!1;#h;#u=()=>{};#c=()=>{};#d={};#l={};#f={};#p={};#g={};#v={};#y={};#_=0;#w=0;#m;#x;constructor(e){e&&(this.#o=!e.hasOwnProperty("directed")||e.directed,this.#s=!!e.hasOwnProperty("multigraph")&&e.multigraph,this.#a=!!e.hasOwnProperty("compound")&&e.compound),this.#a&&(this.#m={},this.#x={},this.#x[n]={})}isDirected(){return this.#o}isMultigraph(){return this.#s}isCompound(){return this.#a}setGraph(e){return this.#h=e,this}graph(){return this.#h}setDefaultNodeLabel(e){return this.#u=e,"function"!=typeof e&&(this.#u=()=>e),this}nodeCount(){return this.#_}nodes(){return Object.keys(this.#d)}sources(){var e=this;return this.nodes().filter((t=>0===Object.keys(e.#l[t]).length))}sinks(){var e=this;return this.nodes().filter((t=>0===Object.keys(e.#p[t]).length))}setNodes(e,t){var n=arguments,r=this;return e.forEach((function(e){n.length>1?r.setNode(e,t):r.setNode(e)})),this}setNode(e,t){return this.#d.hasOwnProperty(e)?(arguments.length>1&&(this.#d[e]=t),this):(this.#d[e]=arguments.length>1?t:this.#u(e),this.#a&&(this.#m[e]=n,this.#x[e]={},this.#x[n][e]=!0),this.#l[e]={},this.#f[e]={},this.#p[e]={},this.#g[e]={},++this.#_,this)}node(e){return this.#d[e]}hasNode(e){return this.#d.hasOwnProperty(e)}removeNode(e){var t=this;if(this.#d.hasOwnProperty(e)){var n=e=>t.removeEdge(t.#v[e]);delete this.#d[e],this.#a&&(this.#b(e),delete this.#m[e],this.children(e).forEach((function(e){t.setParent(e)})),delete this.#x[e]),Object.keys(this.#l[e]).forEach(n),delete this.#l[e],delete this.#f[e],Object.keys(this.#p[e]).forEach(n),delete this.#p[e],delete this.#g[e],--this.#_}return this}setParent(e,t){if(!this.#a)throw new Error("Cannot set parent in a non-compound graph");if(void 0===t)t=n;else{for(var r=t+="";void 0!==r;r=this.parent(r))if(r===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this.#b(e),this.#m[e]=t,this.#x[t][e]=!0,this}#b(e){delete this.#x[this.#m[e]][e]}parent(e){if(this.#a){var t=this.#m[e];if(t!==n)return t}}children(e=n){if(this.#a){var t=this.#x[e];if(t)return Object.keys(t)}else{if(e===n)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this.#f[e];if(t)return Object.keys(t)}successors(e){var t=this.#g[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){const r=new Set(t);for(var n of this.successors(e))r.add(n);return Array.from(r.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this.#o,multigraph:this.#s,compound:this.#a});t.setGraph(this.graph());var n=this;Object.entries(this.#d).forEach((function([n,r]){e(n)&&t.setNode(n,r)})),Object.values(this.#v).forEach((function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var r={};function i(e){var o=n.parent(e);return void 0===o||t.hasNode(o)?(r[e]=o,o):o in r?r[o]:i(o)}return this.#a&&t.nodes().forEach((e=>t.setParent(e,i(e)))),t}setDefaultEdgeLabel(e){return this.#c=e,"function"!=typeof e&&(this.#c=()=>e),this}edgeCount(){return this.#w}edges(){return Object.values(this.#v)}setPath(e,t){var n=this,r=arguments;return e.reduce((function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i})),this}setEdge(){var e,t,n,r,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(r=arguments[1],o=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var h=s(this.#o,e,t,n);if(this.#y.hasOwnProperty(h))return o&&(this.#y[h]=r),this;if(void 0!==n&&!this.#s)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this.#y[h]=o?r:this.#c(e,t,n);var u=function(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var s=i;i=o,o=s}var a={v:i,w:o};return r&&(a.name=r),a}(this.#o,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this.#v[h]=u,i(this.#f[t],e),i(this.#g[e],t),this.#l[t][h]=u,this.#p[e][h]=u,this.#w++,this}edge(e,t,n){var r=1===arguments.length?a(this.#o,arguments[0]):s(this.#o,e,t,n);return this.#y[r]}edgeAsObj(){const e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,n){var r=1===arguments.length?a(this.#o,arguments[0]):s(this.#o,e,t,n);return this.#y.hasOwnProperty(r)}removeEdge(e,t,n){var r=1===arguments.length?a(this.#o,arguments[0]):s(this.#o,e,t,n),i=this.#v[r];return i&&(e=i.v,t=i.w,delete this.#y[r],delete this.#v[r],o(this.#f[t],e),o(this.#g[e],t),delete this.#l[t][r],delete this.#p[e][r],this.#w--),this}inEdges(e,t){var n=this.#l[e];if(n){var r=Object.values(n);return t?r.filter((e=>e.v===t)):r}}outEdges(e,t){var n=this.#p[e];if(n){var r=Object.values(n);return t?r.filter((e=>e.w===t)):r}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}}},7728:(e,t,n)=>{e.exports={Graph:n(44),version:n(3656)}},4800:(e,t,n)=>{var r=n(44);function i(e){return e.nodes().map((function(t){var n=e.node(t),r=e.parent(t),i={v:t};return void 0!==n&&(i.value=n),void 0!==r&&(i.parent=r),i}))}function o(e){return e.edges().map((function(t){var n=e.edge(t),r={v:t.v,w:t.w};return void 0!==t.name&&(r.name=t.name),void 0!==n&&(r.value=n),r}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:i(e),edges:o(e)};return void 0!==e.graph()&&(t.value=structuredClone(e.graph())),t},read:function(e){var t=new r(e.options).setGraph(e.value);return e.nodes.forEach((function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),e.edges.forEach((function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},3656:e=>{e.exports="2.1.13"},2504:(e,t,n)=>{"use strict";n.d(t,{c:()=>E});var r=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];e.call(t,i[1],i[0])}},t}()}(),i="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,o=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),s="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(o):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},a=["top","right","bottom","left","width","height","size","weight"],h="undefined"!=typeof MutationObserver,u=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&h()}function a(){s(o)}function h(){var e=Date.now();if(n){if(e-i<2)return;r=!0}else n=!0,r=!1,setTimeout(a,t);i=e}return h}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),h?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){i&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;a.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),c=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},d=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||o},l=y(0,0,0,0);function f(e){return parseFloat(e)||0}function p(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+f(e["border-"+n+"-width"])}),0)}var g="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof d(e).SVGGraphicsElement}:function(e){return e instanceof d(e).SVGElement&&"function"==typeof e.getBBox};function v(e){return i?g(e)?function(e){var t=e.getBBox();return y(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return l;var r=d(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=e["padding-"+i];t[i]=f(o)}return t}(r),o=i.left+i.right,s=i.top+i.bottom,a=f(r.width),h=f(r.height);if("border-box"===r.boxSizing&&(Math.round(a+o)!==t&&(a-=p(r,"left","right")+o),Math.round(h+s)!==n&&(h-=p(r,"top","bottom")+s)),!function(e){return e===d(e).document.documentElement}(e)){var u=Math.round(a+o)-t,c=Math.round(h+s)-n;1!==Math.abs(u)&&(a-=u),1!==Math.abs(c)&&(h-=c)}return y(i.left,i.top,a,h)}(e):l}function y(e,t,n,r){return{x:e,y:t,width:n,height:r}}var _=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=y(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=v(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),w=function(e,t){var n,r,i,o,s,a,h,u=(r=(n=t).x,i=n.y,o=n.width,s=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,h=Object.create(a.prototype),c(h,{x:r,y:i,width:o,height:s,top:i,right:r+o,bottom:s+i,left:r}),h);c(this,{target:e,contentRect:u})},m=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new r,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof d(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new _(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof d(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new w(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),x="undefined"!=typeof WeakMap?new WeakMap:new r,b=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),r=new m(t,n,this);x.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){b.prototype[e]=function(){var t;return(t=x.get(this))[e].apply(t,arguments)}}));const E=void 0!==o.ResizeObserver?o.ResizeObserver:b},5996:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(8944),i=n(5800),o=function(){var e=(0,r.c)((function*(e,t,n){return(yield i.http.post("api/gateway/cmdb.instance.CreateInstance/v2/object/".concat(e,"/instance"),t,n)).data}));return function(t,n,r){return e.apply(this,arguments)}}()},6851:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r=n(8944),i=n(5800),o=function(){var e=(0,r.c)((function*(e,t,n){return(yield i.http.post("api/gateway/cmdb.instance.PostSearchV3/v3/object/".concat(e,"/instance/_search"),t,n)).data}));return function(t,n,r){return e.apply(this,arguments)}}()},236:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var r=n(8944),i=n(5800),o=function(){var e=(0,r.c)((function*(e,t,n,r){return(yield i.http.put("api/gateway/cmdb.instance.UpdateInstanceV2/v2/object/".concat(e,"/instance/").concat(t),n,r)).data}));return function(t,n,r,i){return e.apply(this,arguments)}}()},5064:(e,t,n)=>{"use strict";n.d(t,{c:()=>h});var r=n(1768),i=n(3840),o=n(1032);function s(e){return e.x+e.vx}function a(e){return e.y+e.vy}function h(e){var t,n,h,u=1,c=1;function d(){for(var e,i,d,f,p,g,v,y=t.length,_=0;_<c;++_)for(i=(0,r.c)(t,s,a).visitAfter(l),e=0;e<y;++e)d=t[e],g=n[d.index],v=g*g,f=d.x+d.vx,p=d.y+d.vy,i.visit(w);function w(e,t,n,r,i){var s=e.data,a=e.r,c=g+a;if(!s)return t>f+c||r<f-c||n>p+c||i<p-c;if(s.index>d.index){var l=f-s.x-s.vx,y=p-s.y-s.vy,_=l*l+y*y;_<c*c&&(0===l&&(_+=(l=(0,o.c)(h))*l),0===y&&(_+=(y=(0,o.c)(h))*y),_=(c-(_=Math.sqrt(_)))/_*u,d.vx+=(l*=_)*(c=(a*=a)/(v+a)),d.vy+=(y*=_)*c,s.vx-=l*(c=1-c),s.vy-=y*c)}}}function l(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function f(){if(t){var r,i,o=t.length;for(n=new Array(o),r=0;r<o;++r)i=t[r],n[i.index]=+e(i,r,t)}}return"function"!=typeof e&&(e=(0,i.c)(null==e?1:+e)),d.initialize=function(e,n){t=e,h=n,f()},d.iterations=function(e){return arguments.length?(c=+e,d):c},d.strength=function(e){return arguments.length?(u=+e,d):u},d.radius=function(t){return arguments.length?(e="function"==typeof t?t:(0,i.c)(+t),f(),d):e},d}},3840:(e,t,n)=>{"use strict";function r(e){return function(){return e}}n.d(t,{c:()=>r})},1032:(e,t,n)=>{"use strict";function r(e){return 1e-6*(e()-.5)}n.d(t,{c:()=>r})},1108:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});var r=n(3840),i=n(1032);function o(e){return e.index}function s(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function a(e){var t,n,a,h,u,c,d=o,l=function(e){return 1/Math.min(h[e.source.index],h[e.target.index])},f=(0,r.c)(30),p=1;function g(r){for(var o=0,s=e.length;o<p;++o)for(var a,h,d,l,f,g,v,y=0;y<s;++y)h=(a=e[y]).source,l=(d=a.target).x+d.vx-h.x-h.vx||(0,i.c)(c),f=d.y+d.vy-h.y-h.vy||(0,i.c)(c),l*=g=((g=Math.sqrt(l*l+f*f))-n[y])/g*r*t[y],f*=g,d.vx-=l*(v=u[y]),d.vy-=f*v,h.vx+=l*(v=1-v),h.vy+=f*v}function v(){if(a){var r,i,o=a.length,c=e.length,l=new Map(a.map(((e,t)=>[d(e,t,a),e])));for(r=0,h=new Array(o);r<c;++r)(i=e[r]).index=r,"object"!=typeof i.source&&(i.source=s(l,i.source)),"object"!=typeof i.target&&(i.target=s(l,i.target)),h[i.source.index]=(h[i.source.index]||0)+1,h[i.target.index]=(h[i.target.index]||0)+1;for(r=0,u=new Array(c);r<c;++r)i=e[r],u[r]=h[i.source.index]/(h[i.source.index]+h[i.target.index]);t=new Array(c),y(),n=new Array(c),_()}}function y(){if(a)for(var n=0,r=e.length;n<r;++n)t[n]=+l(e[n],n,e)}function _(){if(a)for(var t=0,r=e.length;t<r;++t)n[t]=+f(e[t],t,e)}return null==e&&(e=[]),g.initialize=function(e,t){a=e,c=t,v()},g.links=function(t){return arguments.length?(e=t,v(),g):e},g.id=function(e){return arguments.length?(d=e,g):d},g.iterations=function(e){return arguments.length?(p=+e,g):p},g.strength=function(e){return arguments.length?(l="function"==typeof e?e:(0,r.c)(+e),y(),g):l},g.distance=function(e){return arguments.length?(f="function"==typeof e?e:(0,r.c)(+e),_(),g):f},g}},9388:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});var r=n(1768),i=n(3840),o=n(1032),s=n(9472);function a(){var e,t,n,a,h,u=(0,i.c)(-30),c=1,d=1/0,l=.81;function f(n){var i,o=e.length,h=(0,r.c)(e,s.x,s.y).visitAfter(g);for(a=n,i=0;i<o;++i)t=e[i],h.visit(v)}function p(){if(e){var t,n,r=e.length;for(h=new Array(r),t=0;t<r;++t)n=e[t],h[n.index]=+u(n,t,e)}}function g(e){var t,n,r,i,o,s=0,a=0;if(e.length){for(r=i=o=0;o<4;++o)(t=e[o])&&(n=Math.abs(t.value))&&(s+=t.value,a+=n,r+=n*t.x,i+=n*t.y);e.x=r/a,e.y=i/a}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=h[t.data.index]}while(t=t.next)}e.value=s}function v(e,r,i,s){if(!e.value)return!0;var u=e.x-t.x,f=e.y-t.y,p=s-r,g=u*u+f*f;if(p*p/l<g)return g<d&&(0===u&&(g+=(u=(0,o.c)(n))*u),0===f&&(g+=(f=(0,o.c)(n))*f),g<c&&(g=Math.sqrt(c*g)),t.vx+=u*e.value*a/g,t.vy+=f*e.value*a/g),!0;if(!(e.length||g>=d)){(e.data!==t||e.next)&&(0===u&&(g+=(u=(0,o.c)(n))*u),0===f&&(g+=(f=(0,o.c)(n))*f),g<c&&(g=Math.sqrt(c*g)));do{e.data!==t&&(p=h[e.data.index]*a/g,t.vx+=u*p,t.vy+=f*p)}while(e=e.next)}}return f.initialize=function(t,r){e=t,n=r,p()},f.strength=function(e){return arguments.length?(u="function"==typeof e?e:(0,i.c)(+e),p(),f):u},f.distanceMin=function(e){return arguments.length?(c=e*e,f):Math.sqrt(c)},f.distanceMax=function(e){return arguments.length?(d=e*e,f):Math.sqrt(d)},f.theta=function(e){return arguments.length?(l=e*e,f):Math.sqrt(l)},f}},9472:(e,t,n)=>{"use strict";n.d(t,{c:()=>l,x:()=>h,y:()=>u});var r=n(7679),i=n(5432);const o=1664525,s=1013904223,a=4294967296;function h(e){return e.x}function u(e){return e.y}var c=10,d=Math.PI*(3-Math.sqrt(5));function l(e){var t,n=1,h=.001,u=1-Math.pow(h,1/300),l=0,f=.6,p=new Map,g=(0,i.kD)(_),v=(0,r.c)("tick","end"),y=function(){let e=1;return()=>(e=(o*e+s)%a)/a}();function _(){w(),v.call("tick",t),n<h&&(g.stop(),v.call("end",t))}function w(r){var i,o,s=e.length;void 0===r&&(r=1);for(var a=0;a<r;++a)for(n+=(l-n)*u,p.forEach((function(e){e(n)})),i=0;i<s;++i)null==(o=e[i]).fx?o.x+=o.vx*=f:(o.x=o.fx,o.vx=0),null==o.fy?o.y+=o.vy*=f:(o.y=o.fy,o.vy=0);return t}function m(){for(var t,n=0,r=e.length;n<r;++n){if((t=e[n]).index=n,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var i=c*Math.sqrt(.5+n),o=n*d;t.x=i*Math.cos(o),t.y=i*Math.sin(o)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function x(t){return t.initialize&&t.initialize(e,y),t}return null==e&&(e=[]),m(),t={tick:w,restart:function(){return g.restart(_),t},stop:function(){return g.stop(),t},nodes:function(n){return arguments.length?(e=n,m(),p.forEach(x),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(h=+e,t):h},alphaDecay:function(e){return arguments.length?(u=+e,t):+u},alphaTarget:function(e){return arguments.length?(l=+e,t):l},velocityDecay:function(e){return arguments.length?(f=1-e,t):1-f},randomSource:function(e){return arguments.length?(y=e,p.forEach(x),t):y},force:function(e,n){return arguments.length>1?(null==n?p.delete(e):p.set(e,x(n)),t):p.get(e)},find:function(t,n,r){var i,o,s,a,h,u=0,c=e.length;for(null==r?r=1/0:r*=r,u=0;u<c;++u)(s=(i=t-(a=e[u]).x)*i+(o=n-a.y)*o)<r&&(h=a,r=s);return h},on:function(e,n){return arguments.length>1?(v.on(e,n),t):v.on(e)}}}},7339:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(3840);function i(e){var t,n,i,o=(0,r.c)(.1);function s(e){for(var r,o=0,s=t.length;o<s;++o)(r=t[o]).vx+=(i[o]-r.x)*n[o]*e}function a(){if(t){var r,s=t.length;for(n=new Array(s),i=new Array(s),r=0;r<s;++r)n[r]=isNaN(i[r]=+e(t[r],r,t))?0:+o(t[r],r,t)}}return"function"!=typeof e&&(e=(0,r.c)(null==e?0:+e)),s.initialize=function(e){t=e,a()},s.strength=function(e){return arguments.length?(o="function"==typeof e?e:(0,r.c)(+e),a(),s):o},s.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,r.c)(+t),a(),s):e},s}},5336:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(3840);function i(e){var t,n,i,o=(0,r.c)(.1);function s(e){for(var r,o=0,s=t.length;o<s;++o)(r=t[o]).vy+=(i[o]-r.y)*n[o]*e}function a(){if(t){var r,s=t.length;for(n=new Array(s),i=new Array(s),r=0;r<s;++r)n[r]=isNaN(i[r]=+e(t[r],r,t))?0:+o(t[r],r,t)}}return"function"!=typeof e&&(e=(0,r.c)(null==e?0:+e)),s.initialize=function(e){t=e,a()},s.strength=function(e){return arguments.length?(o="function"==typeof e?e:(0,r.c)(+e),a(),s):o},s.y=function(t){return arguments.length?(e="function"==typeof t?t:(0,r.c)(+t),a(),s):e},s}},1768:(e,t,n)=>{"use strict";function r(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o,s,a,h,u,c,d,l,f=e._root,p={data:r},g=e._x0,v=e._y0,y=e._x1,_=e._y1;if(!f)return e._root=p,e;for(;f.length;)if((u=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(s=(v+_)/2))?v=s:_=s,i=f,!(f=f[d=c<<1|u]))return i[d]=p,e;if(a=+e._x.call(null,f.data),h=+e._y.call(null,f.data),t===a&&n===h)return p.next=f,i?i[d]=p:e._root=p,e;do{i=i?i[d]=new Array(4):e._root=new Array(4),(u=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(s=(v+_)/2))?v=s:_=s}while((d=c<<1|u)==(l=(h>=s)<<1|a>=o));return i[l]=f,i[d]=p,e}function i(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function o(e){return e[0]}function s(e){return e[1]}function a(e,t,n){var r=new h(null==t?o:t,null==n?s:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function h(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function u(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}n.d(t,{c:()=>a});var c=a.prototype=h.prototype;c.copy=function(){var e,t,n=new h(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=u(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=u(t));return n},c.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return r(this.cover(t,n),t,n,e)},c.addAll=function(e){var t,n,i,o,s=e.length,a=new Array(s),h=new Array(s),u=1/0,c=1/0,d=-1/0,l=-1/0;for(n=0;n<s;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(a[n]=i,h[n]=o,i<u&&(u=i),i>d&&(d=i),o<c&&(c=o),o>l&&(l=o));if(u>d||c>l)return this;for(this.cover(u,c).cover(d,l),n=0;n<s;++n)r(this,a[n],h[n],e[n]);return this},c.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,o=(r=Math.floor(t))+1;else{for(var s,a,h=i-n||1,u=this._root;n>e||e>=i||r>t||t>=o;)switch(a=(t<r)<<1|e<n,(s=new Array(4))[a]=u,u=s,h*=2,a){case 0:i=n+h,o=r+h;break;case 1:n=i-h,o=r+h;break;case 2:i=n+h,r=o-h;break;case 3:n=i-h,r=o-h}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},c.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},c.extent=function(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},c.find=function(e,t,n){var r,o,s,a,h,u,c,d=this._x0,l=this._y0,f=this._x1,p=this._y1,g=[],v=this._root;for(v&&g.push(new i(v,d,l,f,p)),null==n?n=1/0:(d=e-n,l=t-n,f=e+n,p=t+n,n*=n);u=g.pop();)if(!(!(v=u.node)||(o=u.x0)>f||(s=u.y0)>p||(a=u.x1)<d||(h=u.y1)<l))if(v.length){var y=(o+a)/2,_=(s+h)/2;g.push(new i(v[3],y,_,a,h),new i(v[2],o,_,y,h),new i(v[1],y,s,a,_),new i(v[0],o,s,y,_)),(c=(t>=_)<<1|e>=y)&&(u=g[g.length-1],g[g.length-1]=g[g.length-1-c],g[g.length-1-c]=u)}else{var w=e-+this._x.call(null,v.data),m=t-+this._y.call(null,v.data),x=w*w+m*m;if(x<n){var b=Math.sqrt(n=x);d=e-b,l=t-b,f=e+b,p=t+b,r=v.data}}return r},c.remove=function(e){if(isNaN(o=+this._x.call(null,e))||isNaN(s=+this._y.call(null,e)))return this;var t,n,r,i,o,s,a,h,u,c,d,l,f=this._root,p=this._x0,g=this._y0,v=this._x1,y=this._y1;if(!f)return this;if(f.length)for(;;){if((u=o>=(a=(p+v)/2))?p=a:v=a,(c=s>=(h=(g+y)/2))?g=h:y=h,t=f,!(f=f[d=c<<1|u]))return this;if(!f.length)break;(t[d+1&3]||t[d+2&3]||t[d+3&3])&&(n=t,l=d)}for(;f.data!==e;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):t?(i?t[d]=i:delete t[d],(f=t[0]||t[1]||t[2]||t[3])&&f===(t[3]||t[2]||t[1]||t[0])&&!f.length&&(n?n[l]=f:this._root=f),this):(this._root=i,this)},c.removeAll=function(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this},c.root=function(){return this._root},c.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},c.visit=function(e){var t,n,r,o,s,a,h=[],u=this._root;for(u&&h.push(new i(u,this._x0,this._y0,this._x1,this._y1));t=h.pop();)if(!e(u=t.node,r=t.x0,o=t.y0,s=t.x1,a=t.y1)&&u.length){var c=(r+s)/2,d=(o+a)/2;(n=u[3])&&h.push(new i(n,c,d,s,a)),(n=u[2])&&h.push(new i(n,r,d,c,a)),(n=u[1])&&h.push(new i(n,c,o,s,d)),(n=u[0])&&h.push(new i(n,r,o,c,d))}return this},c.visitAfter=function(e){var t,n=[],r=[];for(this._root&&n.push(new i(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var o=t.node;if(o.length){var s,a=t.x0,h=t.y0,u=t.x1,c=t.y1,d=(a+u)/2,l=(h+c)/2;(s=o[0])&&n.push(new i(s,a,h,d,l)),(s=o[1])&&n.push(new i(s,d,h,u,l)),(s=o[2])&&n.push(new i(s,a,l,d,c)),(s=o[3])&&n.push(new i(s,d,l,u,c))}r.push(t)}for(;t=r.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},c.x=function(e){return arguments.length?(this._x=e,this):this._x},c.y=function(e){return arguments.length?(this._y=e,this):this._y}},2760:(e,t,n)=>{"use strict";function r(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function i(e){this._context=e}function o(e){return new i(e)}n.d(t,{cp:()=>o}),i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:r(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:r(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}},2128:(e,t,n)=>{"use strict";n.d(t,{KQ:()=>i,yM:()=>o});class r{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function i(e){return new r(e,!0)}function o(e){return new r(e,!1)}},3584:(e,t,n)=>{"use strict";function r(e){this._context=e}function i(e){return new r(e)}n.d(t,{c:()=>i}),r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}}},5416:(e,t,n)=>{"use strict";function r(e){return e<0?-1:1}function i(e,t,n){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(n-e._y1)/(o||i<0&&-0),h=(s*o+a*i)/(i+o);return(r(s)+r(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(h))||0}function o(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function s(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function a(e){this._context=e}function h(e){this._context=new u(e)}function u(e){this._context=e}function c(e){return new a(e)}function d(e){return new h(e)}n.d(t,{O:()=>c,o:()=>d}),a.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:s(this,this._t0,o(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,s(this,o(this,n=i(this,e,t)),n);break;default:s(this,this._t0,n=i(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(h.prototype=Object.create(a.prototype)).point=function(e,t){a.prototype.point.call(this,t,e)},u.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}}},4348:(e,t,n)=>{"use strict";function r(e){this._context=e}function i(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),s=new Array(r);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function o(e){return new r(e)}n.d(t,{c:()=>o}),r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=i(e),o=i(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],o[0][s],r[1][s],o[1][s],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}}},1260:(e,t,n)=>{"use strict";function r(e){return function(){return e}}n.d(t,{c:()=>f}),Array.prototype.slice;var i=n(3584);const o=Math.PI,s=2*o,a=1e-6,h=s-a;function u(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class c{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?u:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return u;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,o){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let s=this._x1,h=this._y1,u=n-e,c=r-t,d=s-e,l=h-t,f=d*d+l*l;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(f>a)if(Math.abs(l*u-c*d)>a&&i){let p=n-s,g=r-h,v=u*u+c*c,y=p*p+g*g,_=Math.sqrt(v),w=Math.sqrt(f),m=i*Math.tan((o-Math.acos((v+f-y)/(2*_*w)))/2),x=m/w,b=m/_;Math.abs(x-1)>a&&this._append`L${e+x*d},${t+x*l}`,this._append`A${i},${i},0,0,${+(l*p>d*g)},${this._x1=e+b*u},${this._y1=t+b*c}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,r,i,u){if(e=+e,t=+t,u=!!u,(n=+n)<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(r),d=n*Math.sin(r),l=e+c,f=t+d,p=1^u,g=u?r-i:i-r;null===this._x1?this._append`M${l},${f}`:(Math.abs(this._x1-l)>a||Math.abs(this._y1-f)>a)&&this._append`L${l},${f}`,n&&(g<0&&(g=g%s+s),g>h?this._append`A${n},${n},0,1,${p},${e-c},${t-d}A${n},${n},0,1,${p},${this._x1=l},${this._y1=f}`:g>a&&this._append`A${n},${n},0,${+(g>=o)},${p},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function d(e){return e[0]}function l(e){return e[1]}function f(e,t){var n=r(!0),o=null,s=i.c,a=null,h=function(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new c(t)}(u);function u(r){var i,u,c,d=(r=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(r)).length,l=!1;for(null==o&&(a=s(c=h())),i=0;i<=d;++i)!(i<d&&n(u=r[i],i,r))===l&&((l=!l)?a.lineStart():a.lineEnd()),l&&a.point(+e(u,i,r),+t(u,i,r));if(c)return a=null,c+""||null}return e="function"==typeof e?e:void 0===e?d:r(e),t="function"==typeof t?t:void 0===t?l:r(t),u.x=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),u):e},u.y=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),u):t},u.defined=function(e){return arguments.length?(n="function"==typeof e?e:r(!!e),u):n},u.curve=function(e){return arguments.length?(s=e,null!=o&&(a=s(o)),u):s},u.context=function(e){return arguments.length?(null==e?o=a=null:a=s(o=e),u):o},u}c.prototype}}]);
|
|
3
|
-
//# sourceMappingURL=
|
|
1
|
+
/*! For license information please see 3132.ccc1512e.js.LICENSE.txt */
|
|
2
|
+
(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[3132],{228:(e,t,n)=>{e.exports={graphlib:n(2336),layout:n(4484),debug:n(7039),util:{time:n(8436).time,notime:n(8436).notime},version:n(7880)}},4080:(e,t,n)=>{"use strict";let r=n(9128),i=n(8436).uniqueId;e.exports={run:function(e){("greedy"===e.graph().acyclicer?r(e,function(e){return t=>e.edge(t).weight}(e)):function(e){let t=[],n={},r={};return e.nodes().forEach((function i(o){r.hasOwnProperty(o)||(r[o]=!0,n[o]=!0,e.outEdges(o).forEach((e=>{n.hasOwnProperty(e.w)?t.push(e):i(e.w)})),delete n[o])})),t}(e)).forEach((t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,i("rev"))}))},undo:function(e){e.edges().forEach((t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},9416:(e,t,n)=>{let r=n(8436);function i(e,t,n,i,o,s){let a={width:0,height:0,rank:s,borderType:t},h=o[t][s-1],u=r.addDummyNode(e,"border",a,n);o[t][s]=u,e.setParent(u,i),h&&e.setEdge(h,u,{weight:1})}e.exports=function(e){e.children().forEach((function t(n){let r=e.children(n),o=e.node(n);if(r.length&&r.forEach(t),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(let t=o.minRank,r=o.maxRank+1;t<r;++t)i(e,"borderLeft","_bl",n,o,t),i(e,"borderRight","_br",n,o,t)}}))}},1275:e=>{"use strict";function t(e){e.nodes().forEach((t=>n(e.node(t)))),e.edges().forEach((t=>n(e.edge(t))))}function n(e){let t=e.width;e.width=e.height,e.height=t}function r(e){e.y=-e.y}function i(e){let t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){let n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||t(e)},undo:function(e){let n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){e.nodes().forEach((t=>r(e.node(t)))),e.edges().forEach((t=>{let n=e.edge(t);n.points.forEach(r),n.hasOwnProperty("y")&&r(n)}))}(e),"lr"!==n&&"rl"!==n||(function(e){e.nodes().forEach((t=>i(e.node(t)))),e.edges().forEach((t=>{let n=e.edge(t);n.points.forEach(i),n.hasOwnProperty("x")&&i(n)}))}(e),t(e))}}},4636:e=>{function t(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function n(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,n=e._prev;if(n!==e)return t(n),n}enqueue(e){let n=this._sentinel;e._prev&&e._next&&t(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,n)),r=r._prev;return"["+e.join(", ")+"]"}}},7039:(e,t,n)=>{let r=n(8436),i=n(2336).Graph;e.exports={debugOrdering:function(e){let t=r.buildLayerMatrix(e),n=new i({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach((t=>{n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),e.edges().forEach((e=>n.setEdge(e.v,e.w,{},e.name))),t.forEach(((e,t)=>{let r="layer"+t;n.setNode(r,{rank:"same"}),e.reduce(((e,t)=>(n.setEdge(e,t,{style:"invis"}),t)))})),n}}},9128:(e,t,n)=>{let r=n(2336).Graph,i=n(4636);e.exports=function(e,t){if(e.nodeCount()<=1)return[];let n=function(e,t){let n=new r,o=0,s=0;e.nodes().forEach((e=>{n.setNode(e,{v:e,in:0,out:0})})),e.edges().forEach((e=>{let r=n.edge(e.v,e.w)||0,i=t(e),a=r+i;n.setEdge(e.v,e.w,a),s=Math.max(s,n.node(e.v).out+=i),o=Math.max(o,n.node(e.w).in+=i)}));let h=function(e){const t=[];for(let n=0;n<e;n++)t.push(n);return t}(s+o+3).map((()=>new i)),u=o+1;return n.nodes().forEach((e=>{a(h,u,n.node(e))})),{graph:n,buckets:h,zeroIdx:u}}(e,t||o);return function(e,t,n){let r,i=[],o=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(let o=t.length-2;o>0;--o)if(r=t[o].dequeue(),r){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx).flatMap((t=>e.outEdges(t.v,t.w)))};let o=()=>1;function s(e,t,n,r,i){let o=i?[]:void 0;return e.inEdges(r.v).forEach((r=>{let s=e.edge(r),h=e.node(r.v);i&&o.push({v:r.v,w:r.w}),h.out-=s,a(t,n,h)})),e.outEdges(r.v).forEach((r=>{let i=e.edge(r),o=r.w,s=e.node(o);s.in-=i,a(t,n,s)})),e.removeNode(r.v),o}function a(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},4484:(e,t,n)=>{"use strict";let r=n(4080),i=n(4332),o=n(9699),s=n(8436).normalizeRanks,a=n(4152),h=n(8436).removeEmptyRanks,u=n(6024),c=n(9416),d=n(1275),l=n(1212),f=n(7832),p=n(8436),g=n(2336).Graph;e.exports=function(e,t){let n=t&&t.debugTiming?p.time:p.notime;n("layout",(()=>{let t=n(" buildLayoutGraph",(()=>function(e){let t=new g({multigraph:!0,compound:!0}),n=k(e.graph());return t.setGraph(Object.assign({},y,N(n,v),p.pick(n,_))),e.nodes().forEach((n=>{const r=N(k(e.node(n)),w);Object.keys(m).forEach((e=>{void 0===r[e]&&(r[e]=m[e])})),t.setNode(n,r),t.setParent(n,e.parent(n))})),e.edges().forEach((n=>{let r=k(e.edge(n));t.setEdge(n,Object.assign({},b,N(r,x),p.pick(r,E)))})),t}(e)));n(" runLayout",(()=>function(e,t){t(" makeSpaceForEdgeLabels",(()=>function(e){let t=e.graph();t.ranksep/=2,e.edges().forEach((n=>{let r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e))),t(" removeSelfEdges",(()=>function(e){e.edges().forEach((t=>{if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e))),t(" acyclic",(()=>r.run(e))),t(" nestingGraph.run",(()=>u.run(e))),t(" rank",(()=>o(p.asNonCompoundGraph(e)))),t(" injectEdgeLabelProxies",(()=>function(e){e.edges().forEach((t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v),r={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};p.addDummyNode(e,"edge-proxy",r,"_ep")}}))}(e))),t(" removeEmptyRanks",(()=>h(e))),t(" nestingGraph.cleanup",(()=>u.cleanup(e))),t(" normalizeRanks",(()=>s(e))),t(" assignRankMinMax",(()=>function(e){let t=0;e.nodes().forEach((n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))})),e.graph().maxRank=t}(e))),t(" removeEdgeLabelProxies",(()=>function(e){e.nodes().forEach((t=>{let n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e))),t(" normalize.run",(()=>i.run(e))),t(" parentDummyChains",(()=>a(e))),t(" addBorderSegments",(()=>c(e))),t(" order",(()=>l(e))),t(" insertSelfEdges",(()=>function(e){p.buildLayerMatrix(e).forEach((t=>{var n=0;t.forEach(((t,r)=>{var i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach((t=>{p.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},"_se")})),delete i.selfEdges}))}))}(e))),t(" adjustCoordinateSystem",(()=>d.adjust(e))),t(" position",(()=>f(e))),t(" positionSelfEdges",(()=>function(e){e.nodes().forEach((t=>{var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,s=n.x-i,a=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*s/3,y:o-a},{x:i+5*s/6,y:o-a},{x:i+s,y:o},{x:i+5*s/6,y:o+a},{x:i+2*s/3,y:o+a}],n.label.x=n.x,n.label.y=n.y}}))}(e))),t(" removeBorderNodes",(()=>function(e){e.nodes().forEach((t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),o=e.node(n.borderLeft[n.borderLeft.length-1]),s=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(s.x-o.x),n.height=Math.abs(i.y-r.y),n.x=o.x+n.width/2,n.y=r.y+n.height/2}})),e.nodes().forEach((t=>{"border"===e.node(t).dummy&&e.removeNode(t)}))}(e))),t(" normalize.undo",(()=>i.undo(e))),t(" fixupEdgeLabelCoords",(()=>function(e){e.edges().forEach((t=>{let n=e.edge(t);if(n.hasOwnProperty("x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e))),t(" undoCoordinateSystem",(()=>d.undo(e))),t(" translateGraph",(()=>function(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,o=e.graph(),s=o.marginx||0,a=o.marginy||0;function h(e){let o=e.x,s=e.y,a=e.width,h=e.height;t=Math.min(t,o-a/2),n=Math.max(n,o+a/2),r=Math.min(r,s-h/2),i=Math.max(i,s+h/2)}e.nodes().forEach((t=>h(e.node(t)))),e.edges().forEach((t=>{let n=e.edge(t);n.hasOwnProperty("x")&&h(n)})),t-=s,r-=a,e.nodes().forEach((n=>{let i=e.node(n);i.x-=t,i.y-=r})),e.edges().forEach((n=>{let i=e.edge(n);i.points.forEach((e=>{e.x-=t,e.y-=r})),i.hasOwnProperty("x")&&(i.x-=t),i.hasOwnProperty("y")&&(i.y-=r)})),o.width=n-t+s,o.height=i-r+a}(e))),t(" assignNodeIntersects",(()=>function(e){e.edges().forEach((t=>{let n,r,i=e.edge(t),o=e.node(t.v),s=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=s,r=o),i.points.unshift(p.intersectRect(o,n)),i.points.push(p.intersectRect(s,r))}))}(e))),t(" reversePoints",(()=>function(e){e.edges().forEach((t=>{let n=e.edge(t);n.reversed&&n.points.reverse()}))}(e))),t(" acyclic.undo",(()=>r.undo(e)))}(t,n))),n(" updateInputGraph",(()=>function(e,t){e.nodes().forEach((n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))})),e.edges().forEach((n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,i.hasOwnProperty("x")&&(r.x=i.x,r.y=i.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)))}))};let v=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_=["acyclicer","ranker","rankdir","align"],w=["width","height"],m={width:0,height:0},x=["minlen","weight","width","height","labeloffset"],b={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},E=["labelpos"];function N(e,t){return p.mapValues(p.pick(e,t),Number)}function k(e){var t={};return e&&Object.entries(e).forEach((([e,n])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=n})),t}},6024:(e,t,n)=>{let r=n(8436);function i(e,t,n,o,s,a,h){let u=e.children(h);if(!u.length)return void(h!==t&&e.setEdge(t,h,{weight:0,minlen:n}));let c=r.addBorderNode(e,"_bt"),d=r.addBorderNode(e,"_bb"),l=e.node(h);e.setParent(c,h),l.borderTop=c,e.setParent(d,h),l.borderBottom=d,u.forEach((r=>{i(e,t,n,o,s,a,r);let u=e.node(r),l=u.borderTop?u.borderTop:r,f=u.borderBottom?u.borderBottom:r,p=u.borderTop?o:2*o,g=l!==f?1:s-a[h]+1;e.setEdge(c,l,{weight:p,minlen:g,nestingEdge:!0}),e.setEdge(f,d,{weight:p,minlen:g,nestingEdge:!0})})),e.parent(h)||e.setEdge(t,c,{weight:0,minlen:s+a[h]})}e.exports={run:function(e){let t=r.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(r,i){var o=e.children(r);o&&o.length&&o.forEach((e=>n(e,i+1))),t[r]=i}return e.children().forEach((e=>n(e,1))),t}(e),o=Math.max(...Object.values(n))-1,s=2*o+1;e.graph().nestingRoot=t,e.edges().forEach((t=>e.edge(t).minlen*=s));let a=function(e){return e.edges().reduce(((t,n)=>t+e.edge(n).weight),0)}(e)+1;e.children().forEach((r=>i(e,t,s,a,o,n,r))),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach((t=>{e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},4332:(e,t,n)=>{"use strict";let r=n(8436);e.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach((t=>function(e,t){let n,i,o,s=t.v,a=e.node(s).rank,h=t.w,u=e.node(h).rank,c=t.name,d=e.edge(t),l=d.labelRank;if(u!==a+1){for(e.removeEdge(t),o=0,++a;a<u;++o,++a)d.points=[],i={width:0,height:0,edgeLabel:d,edgeObj:t,rank:a},n=r.addDummyNode(e,"edge",i,"_d"),a===l&&(i.width=d.width,i.height=d.height,i.dummy="edge-label",i.labelpos=d.labelpos),e.setEdge(s,n,{weight:d.weight},c),0===o&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,h,{weight:d.weight},c)}}(e,t)))},undo:function(e){e.graph().dummyChains.forEach((t=>{let n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),t=n,r=e.node(t)}))}}},3236:e=>{e.exports=function(e,t,n){let r,i={};n.forEach((n=>{let o,s,a=e.parent(n);for(;a;){if(o=e.parent(a),o?(s=i[o],i[o]=a):(s=r,r=a),s&&s!==a)return void t.setEdge(s,a);a=o}}))}},5472:e=>{e.exports=function(e,t=[]){return t.map((t=>{let n=e.inEdges(t);if(n.length){let r=n.reduce(((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}}))}},6520:(e,t,n)=>{let r=n(2336).Graph,i=n(8436);e.exports=function(e,t,n){let o=function(e){for(var t;e.hasNode(t=i.uniqueId("_root")););return t}(e),s=new r({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((t=>e.node(t)));return e.nodes().forEach((r=>{let i=e.node(r),a=e.parent(r);(i.rank===t||i.minRank<=t&&t<=i.maxRank)&&(s.setNode(r),s.setParent(r,a||o),e[n](r).forEach((t=>{let n=t.v===r?t.w:t.v,i=s.edge(n,r),o=void 0!==i?i.weight:0;s.setEdge(n,r,{weight:e.edge(t).weight+o})})),i.hasOwnProperty("minRank")&&s.setNode(r,{borderLeft:i.borderLeft[t],borderRight:i.borderRight[t]}))})),s}},6896:(e,t,n)=>{"use strict";let r=n(8436).zipObject;function i(e,t,n){let i=r(n,n.map(((e,t)=>t))),o=t.flatMap((t=>e.outEdges(t).map((t=>({pos:i[t.w],weight:e.edge(t).weight}))).sort(((e,t)=>e.pos-t.pos)))),s=1;for(;s<n.length;)s<<=1;let a=2*s-1;s-=1;let h=new Array(a).fill(0),u=0;return o.forEach((e=>{let t=e.pos+s;h[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=h[t+1]),t=t-1>>1,h[t]+=e.weight;u+=e.weight*n})),u}e.exports=function(e,t){let n=0;for(let r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}},1212:(e,t,n)=>{"use strict";let r=n(3032),i=n(6896),o=n(1061),s=n(6520),a=n(3236),h=n(2336).Graph,u=n(8436);function c(e,t,n){return t.map((function(t){return s(e,t,n)}))}function d(e,t){let n=new h;e.forEach((function(e){let r=e.graph().root,i=o(e,r,n,t);i.vs.forEach(((t,n)=>e.node(t).order=n)),a(e,n,i.vs)}))}function l(e,t){Object.values(t).forEach((t=>t.forEach(((t,n)=>e.node(t).order=n))))}e.exports=function(e){let t=u.maxRank(e),n=c(e,u.range(1,t+1),"inEdges"),o=c(e,u.range(t-1,-1,-1),"outEdges"),s=r(e);l(e,s);let a,h=Number.POSITIVE_INFINITY;for(let t=0,r=0;r<4;++t,++r){d(t%2?n:o,t%4>=2),s=u.buildLayerMatrix(e);let c=i(e,s);c<h&&(r=0,a=Object.assign({},s),h=c)}l(e,a)}},3032:(e,t,n)=>{"use strict";let r=n(8436);e.exports=function(e){let t={},n=e.nodes().filter((t=>!e.children(t).length)),i=Math.max(...n.map((t=>e.node(t).rank))),o=r.range(i+1).map((()=>[]));return n.sort(((t,n)=>e.node(t).rank-e.node(n).rank)).forEach((function n(r){if(t[r])return;t[r]=!0;let i=e.node(r);o[i.rank].push(r),e.successors(r).forEach(n)})),o}},2292:(e,t,n)=>{"use strict";let r=n(8436);e.exports=function(e,t){let n={};return e.forEach(((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight)})),t.edges().forEach((e=>{let t=n[e.v],r=n[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(n[e.w]))})),function(e){let t=[];function n(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function i(t){return n=>{n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter((e=>!e.merged)).map((e=>r.pick(e,["vs","i","barycenter","weight"])))}(Object.values(n).filter((e=>!e.indegree)))}},1061:(e,t,n)=>{let r=n(5472),i=n(2292),o=n(7396);e.exports=function e(t,n,s,a){let h=t.children(n),u=t.node(n),c=u?u.borderLeft:void 0,d=u?u.borderRight:void 0,l={};c&&(h=h.filter((e=>e!==c&&e!==d)));let f=r(t,h);f.forEach((n=>{if(t.children(n.v).length){let o=e(t,n.v,s,a);l[n.v]=o,o.hasOwnProperty("barycenter")&&(i=o,void 0!==(r=n).barycenter?(r.barycenter=(r.barycenter*r.weight+i.barycenter*i.weight)/(r.weight+i.weight),r.weight+=i.weight):(r.barycenter=i.barycenter,r.weight=i.weight))}var r,i}));let p=i(f,s);!function(e,t){e.forEach((e=>{e.vs=e.vs.flatMap((e=>t[e]?t[e].vs:e))}))}(p,l);let g=o(p,a);if(c&&(g.vs=[c,g.vs,d].flat(!0),t.predecessors(c).length)){let e=t.node(t.predecessors(c)[0]),n=t.node(t.predecessors(d)[0]);g.hasOwnProperty("barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+e.order+n.order)/(g.weight+2),g.weight+=2}return g}},7396:(e,t,n)=>{let r=n(8436);function i(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}e.exports=function(e,t){let n=r.partition(e,(e=>e.hasOwnProperty("barycenter"))),o=n.lhs,s=n.rhs.sort(((e,t)=>t.i-e.i)),a=[],h=0,u=0,c=0;var d;o.sort((d=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:d?t.i-e.i:e.i-t.i)),c=i(a,s,c),o.forEach((e=>{c+=e.vs.length,a.push(e.vs),h+=e.barycenter*e.weight,u+=e.weight,c=i(a,s,c)}));let l={vs:a.flat(!0)};return u&&(l.barycenter=h/u,l.weight=u),l}},4152:e=>{e.exports=function(e){let t=function(e){let t={},n=0;return e.children().forEach((function r(i){let o=n;e.children(i).forEach(r),t[i]={low:o,lim:n++}})),t}(e);e.graph().dummyChains.forEach((n=>{let r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){let i,o,s=[],a=[],h=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),s.push(i)}while(i&&(t[i].low>h||u>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)a.push(i);return{path:s.concat(a.reverse()),lca:o}}(e,t,i.v,i.w),s=o.path,a=o.lca,h=0,u=s[h],c=!0;for(;n!==i.w;){if(r=e.node(n),c){for(;(u=s[h])!==a&&e.node(u).maxRank<r.rank;)h++;u===a&&(c=!1)}if(!c){for(;h<s.length-1&&e.node(u=s[h+1]).minRank<=r.rank;)h++;u=s[h]}e.setParent(n,u),n=e.successors(n)[0]}}))}},2571:(e,t,n)=>{"use strict";let r=n(2336).Graph,i=n(8436);function o(e,t){let n={};return t.reduce((function(t,r){let i=0,o=0,s=t.length,h=r[r.length-1];return r.forEach(((t,u)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find((t=>e.node(t).dummy))}(e,t),d=c?e.node(c).order:s;(c||t===h)&&(r.slice(o,u+1).forEach((t=>{e.predecessors(t).forEach((r=>{let o=e.node(r),s=o.order;!(s<i||d<s)||o.dummy&&e.node(t).dummy||a(n,r,t)}))})),o=u+1,i=d)})),r})),n}function s(e,t){let n={};function r(t,r,o,s,h){let u;i.range(r,o).forEach((r=>{u=t[r],e.node(u).dummy&&e.predecessors(u).forEach((t=>{let r=e.node(t);r.dummy&&(r.order<s||r.order>h)&&a(n,t,u)}))}))}return t.reduce((function(t,n){let i,o=-1,s=0;return n.forEach(((a,h)=>{if("border"===e.node(a).dummy){let t=e.predecessors(a);t.length&&(i=e.node(t[0]).order,r(n,s,h,o,i),s=h,o=i)}r(n,s,n.length,i,t.length)})),n})),n}function a(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function h(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&e[t].hasOwnProperty(n)}function u(e,t,n,r){let i={},o={},s={};return t.forEach((e=>{e.forEach(((e,t)=>{i[e]=e,o[e]=e,s[e]=t}))})),t.forEach((e=>{let t=-1;e.forEach((e=>{let a=r(e);if(a.length){a=a.sort(((e,t)=>s[e]-s[t]));let r=(a.length-1)/2;for(let u=Math.floor(r),c=Math.ceil(r);u<=c;++u){let r=a[u];o[e]===e&&t<s[r]&&!h(n,e,r)&&(o[r]=e,o[e]=i[e]=i[r],t=s[r])}}}))})),{root:i,align:o}}function c(e,t,n,i,o){let s={},a=function(e,t,n,i){let o=new r,s=e.graph(),a=function(e,t,n){return(r,i,o)=>{let s,a=r.node(i),h=r.node(o),u=0;if(u+=a.width/2,a.hasOwnProperty("labelpos"))switch(a.labelpos.toLowerCase()){case"l":s=-a.width/2;break;case"r":s=a.width/2}if(s&&(u+=n?s:-s),s=0,u+=(a.dummy?t:e)/2,u+=(h.dummy?t:e)/2,u+=h.width/2,h.hasOwnProperty("labelpos"))switch(h.labelpos.toLowerCase()){case"l":s=h.width/2;break;case"r":s=-h.width/2}return s&&(u+=n?s:-s),s=0,u}}(s.nodesep,s.edgesep,i);return t.forEach((t=>{let r;t.forEach((t=>{let i=n[t];if(o.setNode(i),r){var s=n[r],h=o.edge(s,i);o.setEdge(s,i,Math.max(a(e,t,r),h||0))}r=t}))})),o}(e,t,n,o),h=o?"borderLeft":"borderRight";function u(e,t){let n=a.nodes(),r=n.pop(),i={};for(;r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return u((function(e){s[e]=a.inEdges(e).reduce(((e,t)=>Math.max(e,s[t.v]+a.edge(t))),0)}),a.predecessors.bind(a)),u((function(t){let n=a.outEdges(t).reduce(((e,t)=>Math.min(e,s[t.w]-a.edge(t))),Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==h&&(s[t]=Math.max(s[t],n))}),a.successors.bind(a)),Object.keys(i).forEach((e=>s[e]=s[n[e]])),s}function d(e,t){return Object.values(t).reduce(((t,n)=>{let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(n).forEach((([t,n])=>{let o=function(e,t){return e.node(t).width}(e,t)/2;r=Math.max(n+o,r),i=Math.min(n-o,i)}));const o=r-i;return o<t[0]&&(t=[o,n]),t}),[Number.POSITIVE_INFINITY,null])[1]}function l(e,t){let n=Object.values(t),r=Math.min(...n),o=Math.max(...n);["u","d"].forEach((n=>{["l","r"].forEach((s=>{let a=n+s,h=e[a];if(h===t)return;let u=Object.values(h),c=r-Math.min(...u);"l"!==s&&(c=o-Math.max(...u)),c&&(e[a]=i.mapValues(h,(e=>e+c)))}))}))}function f(e,t){return i.mapValues(e.ul,((n,r)=>{if(t)return e[t.toLowerCase()][r];{let t=Object.values(e).map((e=>e[r])).sort(((e,t)=>e-t));return(t[1]+t[2])/2}}))}e.exports={positionX:function(e){let t,n=i.buildLayerMatrix(e),r=Object.assign(o(e,n),s(e,n)),a={};["u","d"].forEach((o=>{t="u"===o?n:Object.values(n).reverse(),["l","r"].forEach((n=>{"r"===n&&(t=t.map((e=>Object.values(e).reverse())));let s=("u"===o?e.predecessors:e.successors).bind(e),h=u(0,t,r,s),d=c(e,t,h.root,h.align,"r"===n);"r"===n&&(d=i.mapValues(d,(e=>-e))),a[o+n]=d}))}));let h=d(e,a);return l(a,h),f(a,e.graph().align)},findType1Conflicts:o,findType2Conflicts:s,addConflict:a,hasConflict:h,verticalAlignment:u,horizontalCompaction:c,alignCoordinates:l,findSmallestWidthAlignment:d,balance:f}},7832:(e,t,n)=>{"use strict";let r=n(8436),i=n(2571).positionX;e.exports=function(e){(function(e){let t=r.buildLayerMatrix(e),n=e.graph().ranksep,i=0;t.forEach((t=>{const r=t.reduce(((t,n)=>{const r=e.node(n).height;return t>r?t:r}),0);t.forEach((t=>e.node(t).y=i+r/2)),i+=r+n}))})(e=r.asNonCompoundGraph(e)),Object.entries(i(e)).forEach((([t,n])=>e.node(t).x=n))}},4204:(e,t,n)=>{"use strict";var r=n(2336).Graph,i=n(3632).slack;function o(e,t){return e.nodes().forEach((function n(r){t.nodeEdges(r).forEach((o=>{var s=o.v,a=r===s?o.w:s;e.hasNode(a)||i(t,o)||(e.setNode(a,{}),e.setEdge(r,a,{}),n(a))}))})),e.nodeCount()}function s(e,t){return t.edges().reduce(((n,r)=>{let o=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(o=i(t,r)),o<n[0]?[o,r]:n}),[Number.POSITIVE_INFINITY,null])[1]}function a(e,t,n){e.nodes().forEach((e=>t.node(e).rank+=n))}e.exports=function(e){var t,n,h=new r({directed:!1}),u=e.nodes()[0],c=e.nodeCount();for(h.setNode(u,{});o(h,e)<c;)t=s(h,e),n=h.hasNode(t.v)?i(e,t):-i(e,t),a(h,e,n);return h}},9699:(e,t,n)=>{"use strict";var r=n(3632).longestPath,i=n(4204),o=n(1808);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){o(e)}(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":s(e)}};var s=r},1808:(e,t,n)=>{"use strict";var r=n(4204),i=n(3632).slack,o=n(3632).longestPath,s=n(2336).alg.preorder,a=n(2336).alg.postorder,h=n(8436).simplify;function u(e){e=h(e),o(e);var t,n=r(e);for(l(n),c(n,e);t=p(n);)v(n,e,t,g(n,e,t))}function c(e,t){var n=a(e,e.nodes());(n=n.slice(0,n.length-1)).forEach((n=>function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=d(e,t,n)}(e,t,n)))}function d(e,t,n){var r=e.node(n).parent,i=!0,o=t.edge(n,r),s=0;return o||(i=!1,o=t.edge(r,n)),s=o.weight,t.nodeEdges(n).forEach((o=>{var a,h,u=o.v===n,c=u?o.w:o.v;if(c!==r){var d=u===i,l=t.edge(o).weight;if(s+=d?l:-l,a=n,h=c,e.hasEdge(a,h)){var f=e.edge(n,c).cutvalue;s+=d?-f:f}}})),s}function l(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,n,r,i){var o=n,s=e.node(r);return t[r]=!0,e.neighbors(r).forEach((i=>{t.hasOwnProperty(i)||(n=f(e,t,n,i,r))})),s.low=o,s.lim=n++,i?s.parent=i:delete s.parent,n}function p(e){return e.edges().find((t=>e.edge(t).cutvalue<0))}function g(e,t,n){var r=n.v,o=n.w;t.hasEdge(r,o)||(r=n.w,o=n.v);var s=e.node(r),a=e.node(o),h=s,u=!1;s.lim>a.lim&&(h=a,u=!0);var c=t.edges().filter((t=>u===y(0,e.node(t.v),h)&&u!==y(0,e.node(t.w),h)));return c.reduce(((e,n)=>i(t,n)<i(t,e)?n:e))}function v(e,t,n,r){var i=n.v,o=n.w;e.removeEdge(i,o),e.setEdge(r.v,r.w,{}),l(e),c(e,t),function(e,t){var n=e.nodes().find((e=>!t.node(e).parent)),r=s(e,n);(r=r.slice(1)).forEach((n=>{var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function y(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=u,u.initLowLimValues=l,u.initCutValues=c,u.calcCutValue=d,u.leaveEdge=p,u.enterEdge=g,u.exchangeEdges=v},3632:e=>{"use strict";e.exports={longestPath:function(e){var t={};e.sources().forEach((function n(r){var i=e.node(r);if(t.hasOwnProperty(r))return i.rank;t[r]=!0;var o=Math.min(...e.outEdges(r).map((t=>null==t?Number.POSITIVE_INFINITY:n(t.w)-e.edge(t).minlen)));return o===Number.POSITIVE_INFINITY&&(o=0),i.rank=o}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},8436:(e,t,n)=>{"use strict";let r=n(2336).Graph;function i(e,t,n,r){let i;do{i=a(r)}while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function o(e){return Math.max(...e.nodes().map((t=>{let n=e.node(t).rank;return void 0===n?Number.MIN_VALUE:n})))}e.exports={addBorderNode:function(e,t,n,r){let o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),i(e,"border",o,t)},addDummyNode:i,asNonCompoundGraph:function(e){let t=new r({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach((n=>{e.children(n).length||t.setNode(n,e.node(n))})),e.edges().forEach((n=>{t.setEdge(n,e.edge(n))})),t},buildLayerMatrix:function(e){let t=h(o(e)+1).map((()=>[]));return e.nodes().forEach((n=>{let r=e.node(n),i=r.rank;void 0!==i&&(t[i][r.order]=n)})),t},intersectRect:function(e,t){let n,r,i=e.x,o=e.y,s=t.x-i,a=t.y-o,h=e.width/2,u=e.height/2;if(!s&&!a)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*h>Math.abs(s)*u?(a<0&&(u=-u),n=u*s/a,r=u):(s<0&&(h=-h),n=h,r=h*a/s),{x:i+n,y:o+r}},mapValues:function(e,t){let n=t;return"string"==typeof t&&(n=e=>e[t]),Object.entries(e).reduce(((e,[t,r])=>(e[t]=n(r,t),e)),{})},maxRank:o,normalizeRanks:function(e){let t=Math.min(...e.nodes().map((t=>{let n=e.node(t).rank;return void 0===n?Number.MAX_VALUE:n})));e.nodes().forEach((n=>{let r=e.node(n);r.hasOwnProperty("rank")&&(r.rank-=t)}))},notime:function(e,t){return t()},partition:function(e,t){let n={lhs:[],rhs:[]};return e.forEach((e=>{t(e)?n.lhs.push(e):n.rhs.push(e)})),n},pick:function(e,t){const n={};for(const r of t)void 0!==e[r]&&(n[r]=e[r]);return n},predecessorWeights:function(e){let t=e.nodes().map((t=>{let n={};return e.inEdges(t).forEach((t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return u(e.nodes(),t)},range:h,removeEmptyRanks:function(e){let t=Math.min(...e.nodes().map((t=>e.node(t).rank))),n=[];e.nodes().forEach((r=>{let i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));let r=0,i=e.graph().nodeRankFactor;Array.from(n).forEach(((t,n)=>{void 0===t&&n%i!=0?--r:void 0!==t&&r&&t.forEach((t=>e.node(t).rank+=r))}))},simplify:function(e){let t=(new r).setGraph(e.graph());return e.nodes().forEach((n=>t.setNode(n,e.node(n)))),e.edges().forEach((n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},successorWeights:function(e){let t=e.nodes().map((t=>{let n={};return e.outEdges(t).forEach((t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return u(e.nodes(),t)},time:function(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}},uniqueId:a,zipObject:u};let s=0;function a(e){var t=++s;return toString(e)+t}function h(e,t,n=1){null==t&&(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);const i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function u(e,t){return e.reduce(((e,n,r)=>(e[n]=t[r],e)),{})}},7880:e=>{e.exports="1.0.4"},2336:(e,t,n)=>{var r=n(7728);e.exports={Graph:r.Graph,json:n(4800),alg:n(8128),version:r.version}},4116:e=>{e.exports=function(e){var t,n={},r=[];function i(r){n.hasOwnProperty(r)||(n[r]=!0,t.push(r),e.successors(r).forEach(i),e.predecessors(r).forEach(i))}return e.nodes().forEach((function(e){t=[],i(e),t.length&&r.push(t)})),r}},947:e=>{function t(e,t,n,i){for(var o=[[e,!1]];o.length>0;){var s=o.pop();s[1]?i.push(s[0]):n.hasOwnProperty(s[0])||(n[s[0]]=!0,o.push([s[0],!0]),r(t(s[0]),(e=>o.push([e,!1]))))}}function n(e,t,n,i){for(var o=[e];o.length>0;){var s=o.pop();n.hasOwnProperty(s)||(n[s]=!0,i.push(s),r(t(s),(e=>o.push(e))))}}function r(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}e.exports=function(e,r,i){Array.isArray(r)||(r=[r]);var o=e.isDirected()?t=>e.successors(t):t=>e.neighbors(t),s="post"===i?t:n,a=[],h={};return r.forEach((t=>{if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);s(t,o,h,a)})),a}},9096:(e,t,n)=>{var r=n(8036);e.exports=function(e,t,n){return e.nodes().reduce((function(i,o){return i[o]=r(e,o,t,n),i}),{})}},8036:(e,t,n)=>{var r=n(4252);e.exports=function(e,t,n,o){return function(e,t,n,i){var o,s,a={},h=new r,u=function(e){var t=e.v!==o?e.v:e.w,r=a[t],i=n(e),u=s.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u<r.distance&&(r.distance=u,r.predecessor=o,h.decrease(t,u))};for(e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;a[e]={distance:n},h.add(e,n)}));h.size()>0&&(o=h.removeMin(),(s=a[o]).distance!==Number.POSITIVE_INFINITY);)i(o).forEach(u);return a}(e,String(t),n||i,o||function(t){return e.outEdges(t)})};var i=()=>1},5544:(e,t,n)=>{var r=n(144);e.exports=function(e){return r(e).filter((function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},2684:e=>{e.exports=function(e,n,r){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],s=o[n],a=r.distance+i.distance;a<s.distance&&(s.distance=a,s.predecessor=i.predecessor)}))}))})),r}(e,n||t,r||function(t){return e.outEdges(t)})};var t=()=>1},8128:(e,t,n)=>{e.exports={components:n(4116),dijkstra:n(8036),dijkstraAll:n(9096),findCycles:n(5544),floydWarshall:n(2684),isAcyclic:n(8492),postorder:n(1900),preorder:n(1624),prim:n(1004),tarjan:n(144),topsort:n(6816)}},8492:(e,t,n)=>{var r=n(6816);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1900:(e,t,n)=>{var r=n(947);e.exports=function(e,t){return r(e,t,"post")}},1624:(e,t,n)=>{var r=n(947);e.exports=function(e,t){return r(e,t,"pre")}},1004:(e,t,n)=>{var r=n(44),i=n(4252);e.exports=function(e,t){var n,o=new r,s={},a=new i;function h(e){var r=e.v===n?e.w:e.v,i=a.priority(r);if(void 0!==i){var o=t(e);o<i&&(s[r]=n,a.decrease(r,o))}}if(0===e.nodeCount())return o;e.nodes().forEach((function(e){a.add(e,Number.POSITIVE_INFINITY),o.setNode(e)})),a.decrease(e.nodes()[0],0);for(var u=!1;a.size()>0;){if(n=a.removeMin(),s.hasOwnProperty(n))o.setEdge(n,s[n]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(n).forEach(h)}return o}},144:e=>{e.exports=function(e){var t=0,n=[],r={},i=[];function o(s){var a=r[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.hasOwnProperty(e)?r[e].onStack&&(a.lowlink=Math.min(a.lowlink,r[e].index)):(o(e),a.lowlink=Math.min(a.lowlink,r[e].lowlink))})),a.lowlink===a.index){var h,u=[];do{h=n.pop(),r[h].onStack=!1,u.push(h)}while(s!==h);i.push(u)}}return e.nodes().forEach((function(e){r.hasOwnProperty(e)||o(e)})),i}},6816:e=>{function t(e){var t={},r={},i=[];if(e.sinks().forEach((function o(s){if(r.hasOwnProperty(s))throw new n;t.hasOwnProperty(s)||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(o),delete r[s],i.push(s))})),Object.keys(t).length!==e.nodeCount())throw new n;return i}class n extends Error{constructor(){super(...arguments)}}e.exports=t,t.CycleException=n},4252:e=>{e.exports=class{#e=[];#t={};size(){return this.#e.length}keys(){return this.#e.map((function(e){return e.key}))}has(e){return this.#t.hasOwnProperty(e)}priority(e){var t=this.#t[e];if(void 0!==t)return this.#e[t].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this.#e[0].key}add(e,t){var n=this.#t;if(e=String(e),!n.hasOwnProperty(e)){var r=this.#e,i=r.length;return n[e]=i,r.push({key:e,priority:t}),this.#n(i),!0}return!1}removeMin(){this.#r(0,this.#e.length-1);var e=this.#e.pop();return delete this.#t[e.key],this.#i(0),e.key}decrease(e,t){var n=this.#t[e];if(t>this.#e[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this.#e[n].priority+" New: "+t);this.#e[n].priority=t,this.#n(n)}#i(e){var t=this.#e,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this.#r(e,i),this.#i(i)))}#n(e){for(var t,n=this.#e,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this.#r(e,t),e=t}#r(e,t){var n=this.#e,r=this.#t,i=n[e],o=n[t];n[e]=o,n[t]=i,r[o.key]=e,r[i.key]=t}}},44:e=>{"use strict";var t="\0",n="\0",r="";function i(e,t){e[t]?e[t]++:e[t]=1}function o(e,t){--e[t]||delete e[t]}function s(e,n,i,o){var s=""+n,a=""+i;if(!e&&s>a){var h=s;s=a,a=h}return s+r+a+r+(void 0===o?t:o)}function a(e,t){return s(e,t.v,t.w,t.name)}e.exports=class{#o=!0;#s=!1;#a=!1;#h;#u=()=>{};#c=()=>{};#d={};#l={};#f={};#p={};#g={};#v={};#y={};#_=0;#w=0;#m;#x;constructor(e){e&&(this.#o=!e.hasOwnProperty("directed")||e.directed,this.#s=!!e.hasOwnProperty("multigraph")&&e.multigraph,this.#a=!!e.hasOwnProperty("compound")&&e.compound),this.#a&&(this.#m={},this.#x={},this.#x[n]={})}isDirected(){return this.#o}isMultigraph(){return this.#s}isCompound(){return this.#a}setGraph(e){return this.#h=e,this}graph(){return this.#h}setDefaultNodeLabel(e){return this.#u=e,"function"!=typeof e&&(this.#u=()=>e),this}nodeCount(){return this.#_}nodes(){return Object.keys(this.#d)}sources(){var e=this;return this.nodes().filter((t=>0===Object.keys(e.#l[t]).length))}sinks(){var e=this;return this.nodes().filter((t=>0===Object.keys(e.#p[t]).length))}setNodes(e,t){var n=arguments,r=this;return e.forEach((function(e){n.length>1?r.setNode(e,t):r.setNode(e)})),this}setNode(e,t){return this.#d.hasOwnProperty(e)?(arguments.length>1&&(this.#d[e]=t),this):(this.#d[e]=arguments.length>1?t:this.#u(e),this.#a&&(this.#m[e]=n,this.#x[e]={},this.#x[n][e]=!0),this.#l[e]={},this.#f[e]={},this.#p[e]={},this.#g[e]={},++this.#_,this)}node(e){return this.#d[e]}hasNode(e){return this.#d.hasOwnProperty(e)}removeNode(e){var t=this;if(this.#d.hasOwnProperty(e)){var n=e=>t.removeEdge(t.#v[e]);delete this.#d[e],this.#a&&(this.#b(e),delete this.#m[e],this.children(e).forEach((function(e){t.setParent(e)})),delete this.#x[e]),Object.keys(this.#l[e]).forEach(n),delete this.#l[e],delete this.#f[e],Object.keys(this.#p[e]).forEach(n),delete this.#p[e],delete this.#g[e],--this.#_}return this}setParent(e,t){if(!this.#a)throw new Error("Cannot set parent in a non-compound graph");if(void 0===t)t=n;else{for(var r=t+="";void 0!==r;r=this.parent(r))if(r===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this.#b(e),this.#m[e]=t,this.#x[t][e]=!0,this}#b(e){delete this.#x[this.#m[e]][e]}parent(e){if(this.#a){var t=this.#m[e];if(t!==n)return t}}children(e=n){if(this.#a){var t=this.#x[e];if(t)return Object.keys(t)}else{if(e===n)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this.#f[e];if(t)return Object.keys(t)}successors(e){var t=this.#g[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){const r=new Set(t);for(var n of this.successors(e))r.add(n);return Array.from(r.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this.#o,multigraph:this.#s,compound:this.#a});t.setGraph(this.graph());var n=this;Object.entries(this.#d).forEach((function([n,r]){e(n)&&t.setNode(n,r)})),Object.values(this.#v).forEach((function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var r={};function i(e){var o=n.parent(e);return void 0===o||t.hasNode(o)?(r[e]=o,o):o in r?r[o]:i(o)}return this.#a&&t.nodes().forEach((e=>t.setParent(e,i(e)))),t}setDefaultEdgeLabel(e){return this.#c=e,"function"!=typeof e&&(this.#c=()=>e),this}edgeCount(){return this.#w}edges(){return Object.values(this.#v)}setPath(e,t){var n=this,r=arguments;return e.reduce((function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i})),this}setEdge(){var e,t,n,r,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(r=arguments[1],o=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var h=s(this.#o,e,t,n);if(this.#y.hasOwnProperty(h))return o&&(this.#y[h]=r),this;if(void 0!==n&&!this.#s)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this.#y[h]=o?r:this.#c(e,t,n);var u=function(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var s=i;i=o,o=s}var a={v:i,w:o};return r&&(a.name=r),a}(this.#o,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this.#v[h]=u,i(this.#f[t],e),i(this.#g[e],t),this.#l[t][h]=u,this.#p[e][h]=u,this.#w++,this}edge(e,t,n){var r=1===arguments.length?a(this.#o,arguments[0]):s(this.#o,e,t,n);return this.#y[r]}edgeAsObj(){const e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,n){var r=1===arguments.length?a(this.#o,arguments[0]):s(this.#o,e,t,n);return this.#y.hasOwnProperty(r)}removeEdge(e,t,n){var r=1===arguments.length?a(this.#o,arguments[0]):s(this.#o,e,t,n),i=this.#v[r];return i&&(e=i.v,t=i.w,delete this.#y[r],delete this.#v[r],o(this.#f[t],e),o(this.#g[e],t),delete this.#l[t][r],delete this.#p[e][r],this.#w--),this}inEdges(e,t){var n=this.#l[e];if(n){var r=Object.values(n);return t?r.filter((e=>e.v===t)):r}}outEdges(e,t){var n=this.#p[e];if(n){var r=Object.values(n);return t?r.filter((e=>e.w===t)):r}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}}},7728:(e,t,n)=>{e.exports={Graph:n(44),version:n(3656)}},4800:(e,t,n)=>{var r=n(44);function i(e){return e.nodes().map((function(t){var n=e.node(t),r=e.parent(t),i={v:t};return void 0!==n&&(i.value=n),void 0!==r&&(i.parent=r),i}))}function o(e){return e.edges().map((function(t){var n=e.edge(t),r={v:t.v,w:t.w};return void 0!==t.name&&(r.name=t.name),void 0!==n&&(r.value=n),r}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:i(e),edges:o(e)};return void 0!==e.graph()&&(t.value=structuredClone(e.graph())),t},read:function(e){var t=new r(e.options).setGraph(e.value);return e.nodes.forEach((function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),e.edges.forEach((function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},3656:e=>{e.exports="2.1.13"},2504:(e,t,n)=>{"use strict";n.d(t,{c:()=>E});var r=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];e.call(t,i[1],i[0])}},t}()}(),i="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,o=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),s="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(o):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},a=["top","right","bottom","left","width","height","size","weight"],h="undefined"!=typeof MutationObserver,u=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&h()}function a(){s(o)}function h(){var e=Date.now();if(n){if(e-i<2)return;r=!0}else n=!0,r=!1,setTimeout(a,t);i=e}return h}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),h?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){i&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;a.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),c=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},d=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||o},l=y(0,0,0,0);function f(e){return parseFloat(e)||0}function p(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+f(e["border-"+n+"-width"])}),0)}var g="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof d(e).SVGGraphicsElement}:function(e){return e instanceof d(e).SVGElement&&"function"==typeof e.getBBox};function v(e){return i?g(e)?function(e){var t=e.getBBox();return y(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return l;var r=d(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=e["padding-"+i];t[i]=f(o)}return t}(r),o=i.left+i.right,s=i.top+i.bottom,a=f(r.width),h=f(r.height);if("border-box"===r.boxSizing&&(Math.round(a+o)!==t&&(a-=p(r,"left","right")+o),Math.round(h+s)!==n&&(h-=p(r,"top","bottom")+s)),!function(e){return e===d(e).document.documentElement}(e)){var u=Math.round(a+o)-t,c=Math.round(h+s)-n;1!==Math.abs(u)&&(a-=u),1!==Math.abs(c)&&(h-=c)}return y(i.left,i.top,a,h)}(e):l}function y(e,t,n,r){return{x:e,y:t,width:n,height:r}}var _=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=y(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=v(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),w=function(e,t){var n,r,i,o,s,a,h,u=(r=(n=t).x,i=n.y,o=n.width,s=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,h=Object.create(a.prototype),c(h,{x:r,y:i,width:o,height:s,top:i,right:r+o,bottom:s+i,left:r}),h);c(this,{target:e,contentRect:u})},m=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new r,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof d(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new _(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof d(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new w(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),x="undefined"!=typeof WeakMap?new WeakMap:new r,b=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),r=new m(t,n,this);x.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){b.prototype[e]=function(){var t;return(t=x.get(this))[e].apply(t,arguments)}}));const E=void 0!==o.ResizeObserver?o.ResizeObserver:b},640:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,{c:()=>r})},5996:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(8944),i=n(5800),o=function(){var e=(0,r.c)((function*(e,t,n){return(yield i.http.post("api/gateway/cmdb.instance.CreateInstance/v2/object/".concat(e,"/instance"),t,n)).data}));return function(t,n,r){return e.apply(this,arguments)}}()},6851:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r=n(8944),i=n(5800),o=function(){var e=(0,r.c)((function*(e,t,n){return(yield i.http.post("api/gateway/cmdb.instance.PostSearchV3/v3/object/".concat(e,"/instance/_search"),t,n)).data}));return function(t,n,r){return e.apply(this,arguments)}}()},236:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var r=n(8944),i=n(5800),o=function(){var e=(0,r.c)((function*(e,t,n,r){return(yield i.http.put("api/gateway/cmdb.instance.UpdateInstanceV2/v2/object/".concat(e,"/instance/").concat(t),n,r)).data}));return function(t,n,r,i){return e.apply(this,arguments)}}()},5064:(e,t,n)=>{"use strict";n.d(t,{c:()=>h});var r=n(1768),i=n(3840),o=n(1032);function s(e){return e.x+e.vx}function a(e){return e.y+e.vy}function h(e){var t,n,h,u=1,c=1;function d(){for(var e,i,d,f,p,g,v,y=t.length,_=0;_<c;++_)for(i=(0,r.c)(t,s,a).visitAfter(l),e=0;e<y;++e)d=t[e],g=n[d.index],v=g*g,f=d.x+d.vx,p=d.y+d.vy,i.visit(w);function w(e,t,n,r,i){var s=e.data,a=e.r,c=g+a;if(!s)return t>f+c||r<f-c||n>p+c||i<p-c;if(s.index>d.index){var l=f-s.x-s.vx,y=p-s.y-s.vy,_=l*l+y*y;_<c*c&&(0===l&&(_+=(l=(0,o.c)(h))*l),0===y&&(_+=(y=(0,o.c)(h))*y),_=(c-(_=Math.sqrt(_)))/_*u,d.vx+=(l*=_)*(c=(a*=a)/(v+a)),d.vy+=(y*=_)*c,s.vx-=l*(c=1-c),s.vy-=y*c)}}}function l(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function f(){if(t){var r,i,o=t.length;for(n=new Array(o),r=0;r<o;++r)i=t[r],n[i.index]=+e(i,r,t)}}return"function"!=typeof e&&(e=(0,i.c)(null==e?1:+e)),d.initialize=function(e,n){t=e,h=n,f()},d.iterations=function(e){return arguments.length?(c=+e,d):c},d.strength=function(e){return arguments.length?(u=+e,d):u},d.radius=function(t){return arguments.length?(e="function"==typeof t?t:(0,i.c)(+t),f(),d):e},d}},3840:(e,t,n)=>{"use strict";function r(e){return function(){return e}}n.d(t,{c:()=>r})},1032:(e,t,n)=>{"use strict";function r(e){return 1e-6*(e()-.5)}n.d(t,{c:()=>r})},1108:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});var r=n(3840),i=n(1032);function o(e){return e.index}function s(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function a(e){var t,n,a,h,u,c,d=o,l=function(e){return 1/Math.min(h[e.source.index],h[e.target.index])},f=(0,r.c)(30),p=1;function g(r){for(var o=0,s=e.length;o<p;++o)for(var a,h,d,l,f,g,v,y=0;y<s;++y)h=(a=e[y]).source,l=(d=a.target).x+d.vx-h.x-h.vx||(0,i.c)(c),f=d.y+d.vy-h.y-h.vy||(0,i.c)(c),l*=g=((g=Math.sqrt(l*l+f*f))-n[y])/g*r*t[y],f*=g,d.vx-=l*(v=u[y]),d.vy-=f*v,h.vx+=l*(v=1-v),h.vy+=f*v}function v(){if(a){var r,i,o=a.length,c=e.length,l=new Map(a.map(((e,t)=>[d(e,t,a),e])));for(r=0,h=new Array(o);r<c;++r)(i=e[r]).index=r,"object"!=typeof i.source&&(i.source=s(l,i.source)),"object"!=typeof i.target&&(i.target=s(l,i.target)),h[i.source.index]=(h[i.source.index]||0)+1,h[i.target.index]=(h[i.target.index]||0)+1;for(r=0,u=new Array(c);r<c;++r)i=e[r],u[r]=h[i.source.index]/(h[i.source.index]+h[i.target.index]);t=new Array(c),y(),n=new Array(c),_()}}function y(){if(a)for(var n=0,r=e.length;n<r;++n)t[n]=+l(e[n],n,e)}function _(){if(a)for(var t=0,r=e.length;t<r;++t)n[t]=+f(e[t],t,e)}return null==e&&(e=[]),g.initialize=function(e,t){a=e,c=t,v()},g.links=function(t){return arguments.length?(e=t,v(),g):e},g.id=function(e){return arguments.length?(d=e,g):d},g.iterations=function(e){return arguments.length?(p=+e,g):p},g.strength=function(e){return arguments.length?(l="function"==typeof e?e:(0,r.c)(+e),y(),g):l},g.distance=function(e){return arguments.length?(f="function"==typeof e?e:(0,r.c)(+e),_(),g):f},g}},9388:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});var r=n(1768),i=n(3840),o=n(1032),s=n(9472);function a(){var e,t,n,a,h,u=(0,i.c)(-30),c=1,d=1/0,l=.81;function f(n){var i,o=e.length,h=(0,r.c)(e,s.x,s.y).visitAfter(g);for(a=n,i=0;i<o;++i)t=e[i],h.visit(v)}function p(){if(e){var t,n,r=e.length;for(h=new Array(r),t=0;t<r;++t)n=e[t],h[n.index]=+u(n,t,e)}}function g(e){var t,n,r,i,o,s=0,a=0;if(e.length){for(r=i=o=0;o<4;++o)(t=e[o])&&(n=Math.abs(t.value))&&(s+=t.value,a+=n,r+=n*t.x,i+=n*t.y);e.x=r/a,e.y=i/a}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=h[t.data.index]}while(t=t.next)}e.value=s}function v(e,r,i,s){if(!e.value)return!0;var u=e.x-t.x,f=e.y-t.y,p=s-r,g=u*u+f*f;if(p*p/l<g)return g<d&&(0===u&&(g+=(u=(0,o.c)(n))*u),0===f&&(g+=(f=(0,o.c)(n))*f),g<c&&(g=Math.sqrt(c*g)),t.vx+=u*e.value*a/g,t.vy+=f*e.value*a/g),!0;if(!(e.length||g>=d)){(e.data!==t||e.next)&&(0===u&&(g+=(u=(0,o.c)(n))*u),0===f&&(g+=(f=(0,o.c)(n))*f),g<c&&(g=Math.sqrt(c*g)));do{e.data!==t&&(p=h[e.data.index]*a/g,t.vx+=u*p,t.vy+=f*p)}while(e=e.next)}}return f.initialize=function(t,r){e=t,n=r,p()},f.strength=function(e){return arguments.length?(u="function"==typeof e?e:(0,i.c)(+e),p(),f):u},f.distanceMin=function(e){return arguments.length?(c=e*e,f):Math.sqrt(c)},f.distanceMax=function(e){return arguments.length?(d=e*e,f):Math.sqrt(d)},f.theta=function(e){return arguments.length?(l=e*e,f):Math.sqrt(l)},f}},9472:(e,t,n)=>{"use strict";n.d(t,{c:()=>l,x:()=>h,y:()=>u});var r=n(7679),i=n(5432);const o=1664525,s=1013904223,a=4294967296;function h(e){return e.x}function u(e){return e.y}var c=10,d=Math.PI*(3-Math.sqrt(5));function l(e){var t,n=1,h=.001,u=1-Math.pow(h,1/300),l=0,f=.6,p=new Map,g=(0,i.kD)(_),v=(0,r.c)("tick","end"),y=function(){let e=1;return()=>(e=(o*e+s)%a)/a}();function _(){w(),v.call("tick",t),n<h&&(g.stop(),v.call("end",t))}function w(r){var i,o,s=e.length;void 0===r&&(r=1);for(var a=0;a<r;++a)for(n+=(l-n)*u,p.forEach((function(e){e(n)})),i=0;i<s;++i)null==(o=e[i]).fx?o.x+=o.vx*=f:(o.x=o.fx,o.vx=0),null==o.fy?o.y+=o.vy*=f:(o.y=o.fy,o.vy=0);return t}function m(){for(var t,n=0,r=e.length;n<r;++n){if((t=e[n]).index=n,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var i=c*Math.sqrt(.5+n),o=n*d;t.x=i*Math.cos(o),t.y=i*Math.sin(o)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function x(t){return t.initialize&&t.initialize(e,y),t}return null==e&&(e=[]),m(),t={tick:w,restart:function(){return g.restart(_),t},stop:function(){return g.stop(),t},nodes:function(n){return arguments.length?(e=n,m(),p.forEach(x),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(h=+e,t):h},alphaDecay:function(e){return arguments.length?(u=+e,t):+u},alphaTarget:function(e){return arguments.length?(l=+e,t):l},velocityDecay:function(e){return arguments.length?(f=1-e,t):1-f},randomSource:function(e){return arguments.length?(y=e,p.forEach(x),t):y},force:function(e,n){return arguments.length>1?(null==n?p.delete(e):p.set(e,x(n)),t):p.get(e)},find:function(t,n,r){var i,o,s,a,h,u=0,c=e.length;for(null==r?r=1/0:r*=r,u=0;u<c;++u)(s=(i=t-(a=e[u]).x)*i+(o=n-a.y)*o)<r&&(h=a,r=s);return h},on:function(e,n){return arguments.length>1?(v.on(e,n),t):v.on(e)}}}},7339:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(3840);function i(e){var t,n,i,o=(0,r.c)(.1);function s(e){for(var r,o=0,s=t.length;o<s;++o)(r=t[o]).vx+=(i[o]-r.x)*n[o]*e}function a(){if(t){var r,s=t.length;for(n=new Array(s),i=new Array(s),r=0;r<s;++r)n[r]=isNaN(i[r]=+e(t[r],r,t))?0:+o(t[r],r,t)}}return"function"!=typeof e&&(e=(0,r.c)(null==e?0:+e)),s.initialize=function(e){t=e,a()},s.strength=function(e){return arguments.length?(o="function"==typeof e?e:(0,r.c)(+e),a(),s):o},s.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,r.c)(+t),a(),s):e},s}},5336:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(3840);function i(e){var t,n,i,o=(0,r.c)(.1);function s(e){for(var r,o=0,s=t.length;o<s;++o)(r=t[o]).vy+=(i[o]-r.y)*n[o]*e}function a(){if(t){var r,s=t.length;for(n=new Array(s),i=new Array(s),r=0;r<s;++r)n[r]=isNaN(i[r]=+e(t[r],r,t))?0:+o(t[r],r,t)}}return"function"!=typeof e&&(e=(0,r.c)(null==e?0:+e)),s.initialize=function(e){t=e,a()},s.strength=function(e){return arguments.length?(o="function"==typeof e?e:(0,r.c)(+e),a(),s):o},s.y=function(t){return arguments.length?(e="function"==typeof t?t:(0,r.c)(+t),a(),s):e},s}},1768:(e,t,n)=>{"use strict";function r(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o,s,a,h,u,c,d,l,f=e._root,p={data:r},g=e._x0,v=e._y0,y=e._x1,_=e._y1;if(!f)return e._root=p,e;for(;f.length;)if((u=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(s=(v+_)/2))?v=s:_=s,i=f,!(f=f[d=c<<1|u]))return i[d]=p,e;if(a=+e._x.call(null,f.data),h=+e._y.call(null,f.data),t===a&&n===h)return p.next=f,i?i[d]=p:e._root=p,e;do{i=i?i[d]=new Array(4):e._root=new Array(4),(u=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(s=(v+_)/2))?v=s:_=s}while((d=c<<1|u)==(l=(h>=s)<<1|a>=o));return i[l]=f,i[d]=p,e}function i(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function o(e){return e[0]}function s(e){return e[1]}function a(e,t,n){var r=new h(null==t?o:t,null==n?s:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function h(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function u(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}n.d(t,{c:()=>a});var c=a.prototype=h.prototype;c.copy=function(){var e,t,n=new h(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=u(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=u(t));return n},c.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return r(this.cover(t,n),t,n,e)},c.addAll=function(e){var t,n,i,o,s=e.length,a=new Array(s),h=new Array(s),u=1/0,c=1/0,d=-1/0,l=-1/0;for(n=0;n<s;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(a[n]=i,h[n]=o,i<u&&(u=i),i>d&&(d=i),o<c&&(c=o),o>l&&(l=o));if(u>d||c>l)return this;for(this.cover(u,c).cover(d,l),n=0;n<s;++n)r(this,a[n],h[n],e[n]);return this},c.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,o=(r=Math.floor(t))+1;else{for(var s,a,h=i-n||1,u=this._root;n>e||e>=i||r>t||t>=o;)switch(a=(t<r)<<1|e<n,(s=new Array(4))[a]=u,u=s,h*=2,a){case 0:i=n+h,o=r+h;break;case 1:n=i-h,o=r+h;break;case 2:i=n+h,r=o-h;break;case 3:n=i-h,r=o-h}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},c.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},c.extent=function(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},c.find=function(e,t,n){var r,o,s,a,h,u,c,d=this._x0,l=this._y0,f=this._x1,p=this._y1,g=[],v=this._root;for(v&&g.push(new i(v,d,l,f,p)),null==n?n=1/0:(d=e-n,l=t-n,f=e+n,p=t+n,n*=n);u=g.pop();)if(!(!(v=u.node)||(o=u.x0)>f||(s=u.y0)>p||(a=u.x1)<d||(h=u.y1)<l))if(v.length){var y=(o+a)/2,_=(s+h)/2;g.push(new i(v[3],y,_,a,h),new i(v[2],o,_,y,h),new i(v[1],y,s,a,_),new i(v[0],o,s,y,_)),(c=(t>=_)<<1|e>=y)&&(u=g[g.length-1],g[g.length-1]=g[g.length-1-c],g[g.length-1-c]=u)}else{var w=e-+this._x.call(null,v.data),m=t-+this._y.call(null,v.data),x=w*w+m*m;if(x<n){var b=Math.sqrt(n=x);d=e-b,l=t-b,f=e+b,p=t+b,r=v.data}}return r},c.remove=function(e){if(isNaN(o=+this._x.call(null,e))||isNaN(s=+this._y.call(null,e)))return this;var t,n,r,i,o,s,a,h,u,c,d,l,f=this._root,p=this._x0,g=this._y0,v=this._x1,y=this._y1;if(!f)return this;if(f.length)for(;;){if((u=o>=(a=(p+v)/2))?p=a:v=a,(c=s>=(h=(g+y)/2))?g=h:y=h,t=f,!(f=f[d=c<<1|u]))return this;if(!f.length)break;(t[d+1&3]||t[d+2&3]||t[d+3&3])&&(n=t,l=d)}for(;f.data!==e;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):t?(i?t[d]=i:delete t[d],(f=t[0]||t[1]||t[2]||t[3])&&f===(t[3]||t[2]||t[1]||t[0])&&!f.length&&(n?n[l]=f:this._root=f),this):(this._root=i,this)},c.removeAll=function(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this},c.root=function(){return this._root},c.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},c.visit=function(e){var t,n,r,o,s,a,h=[],u=this._root;for(u&&h.push(new i(u,this._x0,this._y0,this._x1,this._y1));t=h.pop();)if(!e(u=t.node,r=t.x0,o=t.y0,s=t.x1,a=t.y1)&&u.length){var c=(r+s)/2,d=(o+a)/2;(n=u[3])&&h.push(new i(n,c,d,s,a)),(n=u[2])&&h.push(new i(n,r,d,c,a)),(n=u[1])&&h.push(new i(n,c,o,s,d)),(n=u[0])&&h.push(new i(n,r,o,c,d))}return this},c.visitAfter=function(e){var t,n=[],r=[];for(this._root&&n.push(new i(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var o=t.node;if(o.length){var s,a=t.x0,h=t.y0,u=t.x1,c=t.y1,d=(a+u)/2,l=(h+c)/2;(s=o[0])&&n.push(new i(s,a,h,d,l)),(s=o[1])&&n.push(new i(s,d,h,u,l)),(s=o[2])&&n.push(new i(s,a,l,d,c)),(s=o[3])&&n.push(new i(s,d,l,u,c))}r.push(t)}for(;t=r.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},c.x=function(e){return arguments.length?(this._x=e,this):this._x},c.y=function(e){return arguments.length?(this._y=e,this):this._y}},2760:(e,t,n)=>{"use strict";function r(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function i(e){this._context=e}function o(e){return new i(e)}n.d(t,{cp:()=>o}),i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:r(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:r(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}},2128:(e,t,n)=>{"use strict";n.d(t,{KQ:()=>i,yM:()=>o});class r{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function i(e){return new r(e,!0)}function o(e){return new r(e,!1)}},3584:(e,t,n)=>{"use strict";function r(e){this._context=e}function i(e){return new r(e)}n.d(t,{c:()=>i}),r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}}},5416:(e,t,n)=>{"use strict";function r(e){return e<0?-1:1}function i(e,t,n){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(n-e._y1)/(o||i<0&&-0),h=(s*o+a*i)/(i+o);return(r(s)+r(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(h))||0}function o(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function s(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function a(e){this._context=e}function h(e){this._context=new u(e)}function u(e){this._context=e}function c(e){return new a(e)}function d(e){return new h(e)}n.d(t,{O:()=>c,o:()=>d}),a.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:s(this,this._t0,o(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,s(this,o(this,n=i(this,e,t)),n);break;default:s(this,this._t0,n=i(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(h.prototype=Object.create(a.prototype)).point=function(e,t){a.prototype.point.call(this,t,e)},u.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}}},4348:(e,t,n)=>{"use strict";function r(e){this._context=e}function i(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),s=new Array(r);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function o(e){return new r(e)}n.d(t,{c:()=>o}),r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=i(e),o=i(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],o[0][s],r[1][s],o[1][s],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}}},1260:(e,t,n)=>{"use strict";function r(e){return function(){return e}}n.d(t,{c:()=>f}),Array.prototype.slice;var i=n(3584);const o=Math.PI,s=2*o,a=1e-6,h=s-a;function u(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class c{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?u:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return u;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,o){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let s=this._x1,h=this._y1,u=n-e,c=r-t,d=s-e,l=h-t,f=d*d+l*l;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(f>a)if(Math.abs(l*u-c*d)>a&&i){let p=n-s,g=r-h,v=u*u+c*c,y=p*p+g*g,_=Math.sqrt(v),w=Math.sqrt(f),m=i*Math.tan((o-Math.acos((v+f-y)/(2*_*w)))/2),x=m/w,b=m/_;Math.abs(x-1)>a&&this._append`L${e+x*d},${t+x*l}`,this._append`A${i},${i},0,0,${+(l*p>d*g)},${this._x1=e+b*u},${this._y1=t+b*c}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,r,i,u){if(e=+e,t=+t,u=!!u,(n=+n)<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(r),d=n*Math.sin(r),l=e+c,f=t+d,p=1^u,g=u?r-i:i-r;null===this._x1?this._append`M${l},${f}`:(Math.abs(this._x1-l)>a||Math.abs(this._y1-f)>a)&&this._append`L${l},${f}`,n&&(g<0&&(g=g%s+s),g>h?this._append`A${n},${n},0,1,${p},${e-c},${t-d}A${n},${n},0,1,${p},${this._x1=l},${this._y1=f}`:g>a&&this._append`A${n},${n},0,${+(g>=o)},${p},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function d(e){return e[0]}function l(e){return e[1]}function f(e,t){var n=r(!0),o=null,s=i.c,a=null,h=function(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new c(t)}(u);function u(r){var i,u,c,d=(r=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(r)).length,l=!1;for(null==o&&(a=s(c=h())),i=0;i<=d;++i)!(i<d&&n(u=r[i],i,r))===l&&((l=!l)?a.lineStart():a.lineEnd()),l&&a.point(+e(u,i,r),+t(u,i,r));if(c)return a=null,c+""||null}return e="function"==typeof e?e:void 0===e?d:r(e),t="function"==typeof t?t:void 0===t?l:r(t),u.x=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),u):e},u.y=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),u):t},u.defined=function(e){return arguments.length?(n="function"==typeof e?e:r(!!e),u):n},u.curve=function(e){return arguments.length?(s=e,null!=o&&(a=s(o)),u):s},u.context=function(e){return arguments.length?(null==e?o=a=null:a=s(o=e),u):o},u}c.prototype}}]);
|
|
3
|
+
//# sourceMappingURL=3132.ccc1512e.js.map
|