@next-bricks/diagram 0.37.12 → 0.37.13

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.
Files changed (48) hide show
  1. package/dist/bricks.json +1 -1
  2. package/dist/chunks/1122.1ab8b219.js +2 -0
  3. package/dist/chunks/1122.1ab8b219.js.map +1 -0
  4. package/dist/chunks/2272.d288dc9a.js +2 -0
  5. package/dist/chunks/{2272.25e1a5b4.js.map → 2272.d288dc9a.js.map} +1 -1
  6. package/dist/chunks/2416.04ee5202.js +2 -0
  7. package/dist/chunks/{2416.ac83873e.js.map → 2416.04ee5202.js.map} +1 -1
  8. package/dist/chunks/{3171.8ee6cc61.js → 3171.e79b5f32.js} +2 -2
  9. package/dist/chunks/{3171.8ee6cc61.js.map → 3171.e79b5f32.js.map} +1 -1
  10. package/dist/chunks/{3933.42e0e086.js → 3933.49186cfa.js} +2 -2
  11. package/dist/chunks/{6314.c78fd934.js.map → 3933.49186cfa.js.map} +1 -1
  12. package/dist/chunks/4837.bcf80bbb.js +2 -0
  13. package/dist/chunks/{7218.d0db630a.js.map → 4837.bcf80bbb.js.map} +1 -1
  14. package/dist/chunks/{4937.fd9c2a63.js → 4937.4c3a75db.js} +3 -3
  15. package/dist/chunks/{4937.fd9c2a63.js.map → 4937.4c3a75db.js.map} +1 -1
  16. package/dist/chunks/4947.c4af59bc.js +3 -0
  17. package/dist/chunks/4947.c4af59bc.js.map +1 -0
  18. package/dist/chunks/5399.b0a1369b.js +2 -0
  19. package/dist/chunks/5399.b0a1369b.js.map +1 -0
  20. package/dist/chunks/{5552.bb309dc4.js → 5552.f50784be.js} +2 -2
  21. package/dist/chunks/{5552.bb309dc4.js.map → 5552.f50784be.js.map} +1 -1
  22. package/dist/chunks/{6314.c78fd934.js → 6314.2ecfe11c.js} +2 -2
  23. package/dist/chunks/{3933.42e0e086.js.map → 6314.2ecfe11c.js.map} +1 -1
  24. package/dist/chunks/7218.7320f0ee.js +2 -0
  25. package/dist/chunks/{4837.2619a231.js.map → 7218.7320f0ee.js.map} +1 -1
  26. package/dist/chunks/{eo-draw-canvas.59ef988e.js → eo-draw-canvas.400147a8.js} +2 -2
  27. package/dist/chunks/{eo-draw-canvas.59ef988e.js.map → eo-draw-canvas.400147a8.js.map} +1 -1
  28. package/dist/chunks/main.774ca1ec.js +2 -0
  29. package/dist/chunks/{main.2afbaec0.js.map → main.774ca1ec.js.map} +1 -1
  30. package/dist/index.8e86e7d3.js +2 -0
  31. package/dist/index.8e86e7d3.js.map +1 -0
  32. package/dist/manifest.json +41 -41
  33. package/package.json +2 -2
  34. package/dist/chunks/1122.da9a8118.js +0 -2
  35. package/dist/chunks/1122.da9a8118.js.map +0 -1
  36. package/dist/chunks/2272.25e1a5b4.js +0 -2
  37. package/dist/chunks/2416.ac83873e.js +0 -2
  38. package/dist/chunks/4837.2619a231.js +0 -2
  39. package/dist/chunks/4947.74478519.js +0 -3
  40. package/dist/chunks/4947.74478519.js.map +0 -1
  41. package/dist/chunks/5399.aa4bf5e6.js +0 -2
  42. package/dist/chunks/5399.aa4bf5e6.js.map +0 -1
  43. package/dist/chunks/7218.d0db630a.js +0 -2
  44. package/dist/chunks/main.2afbaec0.js +0 -2
  45. package/dist/index.3c7385ed.js +0 -2
  46. package/dist/index.3c7385ed.js.map +0 -1
  47. /package/dist/chunks/{4937.fd9c2a63.js.LICENSE.txt → 4937.4c3a75db.js.LICENSE.txt} +0 -0
  48. /package/dist/chunks/{4947.74478519.js.LICENSE.txt → 4947.c4af59bc.js.LICENSE.txt} +0 -0
@@ -1,3 +1,3 @@
1
- /*! For license information please see 4937.fd9c2a63.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[4937],{6663:(e,t,n)=>{n.r(t);var i,a=n(4635),s=n(918),l=n(6902),o=n(5536),r=n(6121),h=n(829),c=n(2740),d=n(8769),u=n.n(d),p=n(5351),g=n(3340),f=(n(9583),n(7566)),A=n(1517),y=n(3373),v=n.n(y),m=n(1030),b=n(9126),k=n(8892),w=n(5157),x=n(8308),_=n(9576),M=n(9137),E=n(2547),C=n(1803),N=n(3739),T=n(9191),W=n(6671),R=n(8060),L=n(2448),S=n(8657),$=n(8069),z=n(1324),B=n(821),D=n(9741),P=n(2673),O=n(5987);let H,I,K,Y,U,X,j,V,q,Z,F,J,G,Q,ee,te,ne,ie,ae,se,le,oe,re,he,ce,de,ue,pe,ge,fe,Ae,ye,ve,me,be,ke,we,xe,_e,Me,Ee,Ce,Ne,Te,We,Re,Le,Se,$e,ze,Be,De,Pe,Oe;const{defineElement:He,property:Ie,event:Ke,method:Ye}=(0,p.createDecorators)(),Ue=(0,d.forwardRef)(wt);let Xe;var je=new WeakMap,Ve=new WeakMap,qe=new WeakMap,Ze=new WeakMap,Fe=new WeakMap,Je=new WeakMap,Ge=new WeakMap,Qe=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,it=new WeakMap,at=new WeakMap,st=new WeakMap,lt=new WeakMap,ot=new WeakSet,rt=new WeakMap,ht=new WeakMap,ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,ft=new WeakMap,At=new WeakMap,yt=new WeakMap,vt=new WeakMap,mt=new WeakMap,bt=new WeakMap;class kt extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,ot),(0,s.A)(this,je,(H(this),K(this))),(0,s.A)(this,Ve,(Y(this),U(this))),(0,s.A)(this,qe,(X(this),j(this))),(0,s.A)(this,Ze,(V(this),q(this))),(0,s.A)(this,Fe,(Z(this),F(this))),(0,s.A)(this,Je,(J(this),G(this))),(0,s.A)(this,Ge,(Q(this),ee(this))),(0,s.A)(this,Qe,(te(this),ne(this))),(0,s.A)(this,et,(ie(this),ae(this))),(0,s.A)(this,tt,(se(this),le(this))),(0,s.A)(this,nt,(oe(this),re(this,!0))),(0,s.A)(this,it,(he(this),ce(this,!0))),(0,s.A)(this,at,(de(this),ue(this,!0))),(0,s.A)(this,st,(pe(this),ge(this))),(0,s.A)(this,lt,(fe(this),Ae(this))),(0,s.A)(this,rt,(me(this),e=>{(0,o.A)(ot,this,ye).emit(e)})),(0,s.A)(this,ht,be(this)),(0,s.A)(this,ct,(xe(this),e=>{(0,o.A)(ot,this,ke).emit(e)})),(0,s.A)(this,dt,_e(this)),(0,s.A)(this,ut,(Ce(this),e=>{(0,o.A)(ot,this,Me).emit(e)})),(0,s.A)(this,pt,Ne(this)),(0,s.A)(this,gt,(Re(this),e=>{(0,o.A)(ot,this,Te).emit(e)})),(0,s.A)(this,ft,Le(this)),(0,s.A)(this,At,(ze(this),e=>{(0,o.A)(ot,this,Se).emit(e)})),(0,s.A)(this,yt,Be(this)),(0,s.A)(this,vt,(Oe(this),e=>{(0,o.A)(ot,this,De).emit(e)})),(0,s.A)(this,mt,(e=>{(0,P.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,bt,(0,d.createRef)())}get layout(){return(0,h.A)(je,this)}set layout(e){(0,r.A)(je,this,e)}get nodes(){return(0,h.A)(Ve,this)}set nodes(e){(0,r.A)(Ve,this,e)}get edges(){return(0,h.A)(qe,this)}set edges(e){(0,r.A)(qe,this,e)}get nodeBricks(){return(0,h.A)(Ze,this)}set nodeBricks(e){(0,r.A)(Ze,this,e)}get lines(){return(0,h.A)(Fe,this)}set lines(e){(0,r.A)(Fe,this,e)}get layoutOptions(){return(0,h.A)(Je,this)}set layoutOptions(e){(0,r.A)(Je,this,e)}get activeTarget(){return(0,h.A)(Ge,this)}set activeTarget(e){(0,r.A)(Ge,this,e)}get disableKeyboardAction(){return(0,h.A)(Qe,this)}set disableKeyboardAction(e){(0,r.A)(Qe,this,e)}get connectNodes(){return(0,h.A)(et,this)}set connectNodes(e){(0,r.A)(et,this,e)}get dragNodes(){return(0,h.A)(tt,this)}set dragNodes(e){(0,r.A)(tt,this,e)}get zoomable(){return(0,h.A)(nt,this)}set zoomable(e){(0,r.A)(nt,this,e)}get scrollable(){return(0,h.A)(it,this)}set scrollable(e){(0,r.A)(it,this,e)}get pannable(){return(0,h.A)(at,this)}set pannable(e){(0,r.A)(at,this,e)}get scaleRange(){return(0,h.A)(st,this)}set scaleRange(e){(0,r.A)(st,this,e)}callOnLineLabel(e,t){for(var n,i=arguments.length,a=new Array(i>2?i-2:0),s=2;s<i;s++)a[s-2]=arguments[s];null===(n=(0,h.A)(bt,this).current)||void 0===n||n.callOnLineLabel(e,t,...a)}render(){return u().createElement(Ue,{ref:(0,h.A)(bt,this),layout:this.layout,nodes:this.nodes,edges:this.edges,nodeBricks:this.nodeBricks,lines:this.lines,layoutOptions:this.layoutOptions,connectNodes:this.connectNodes,dragNodes:this.dragNodes,activeTarget:this.activeTarget,disableKeyboardAction:this.disableKeyboardAction,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:(0,h.A)(rt,this),onSwitchActiveTarget:(0,h.A)(mt,this),onNodeDelete:(0,h.A)(ct,this),onEdgeDelete:(0,h.A)(ut,this),onLineClick:(0,h.A)(gt,this),onLineDoubleClick:(0,h.A)(At,this),onNodesConnect:(0,h.A)(vt,this)})}}function wt(e,t){let{layout:n,nodes:i,edges:a,nodeBricks:s,lines:l,layoutOptions:o,connectNodes:r,dragNodes:h,activeTarget:c,disableKeyboardAction:p,zoomable:g,scrollable:y,pannable:B,scaleRange:H,onActiveTargetChange:I,onSwitchActiveTarget:K,onNodeDelete:Y,onEdgeDelete:U,onLineClick:X,onLineDoubleClick:j,onNodesConnect:V}=e;const[q,Z]=(0,d.useState)(!1),[F,J]=(0,d.useState)(0),[G,Q]=(0,d.useState)(null),[ee,te]=(0,d.useState)(!1),[ne,ie]=(0,d.useState)(0),[ae,se]=(0,d.useState)(null),[le,oe]=(0,d.useState)([]),[re,he]=(0,d.useState)(!1),[ce,de]=(0,d.useState)({k:1,x:0,y:0}),ue=(0,d.useRef)(new Map),pe=(0,d.useRef)(null),ge=(0,d.useRef)(null),[fe,Ae]=(0,d.useState)(!1),{userViewReady:ye,userViewNodesMap:ve,saveUserView:me}=(0,D._)(null==h?void 0:h.save),[be,ke]=(0,d.useState)([0,0]),[we,xe]=(0,d.useState)(null),[_e,Me]=(0,d.useState)("initial"),[Ee,Ce]=(0,d.useState)(null);(0,d.useImperativeHandle)(t,(()=>({callOnLineLabel(e,t){for(var n,i=arguments.length,a=new Array(i>2?i-2:0),s=2;s<i;s++)a[s-2]=arguments[s];null==ae||null===(n=ae.get(e))||void 0===n||null===(n=n.firstElementChild)||void 0===n||n[t](...a)}}))),(0,d.useEffect)((()=>{const e=e=>{(0,L.P)(e,{nodes:i,nodesRefRepository:G,connectNodes:r,dragNodes:h,scale:ce.k,setConnectLineState:xe,setConnectLineTo:ke,setManualLayoutStatus:Me,setNodeMovement:Ce,onSwitchActiveTarget:K,onNodesConnect:V})},t=ge.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[i,r,h,ce.k,G,V,K]);const{normalizedLines:Ne,normalizedLinesMap:Te,markers:We}=(0,d.useMemo)((()=>(0,M.t)(a,l)),[a,l]),Re=(0,d.useMemo)((()=>Ne.flatMap((e=>{let t,n,{line:{text:i,label:a,$id:s},edge:l}=e;return i||a?(a?(t="label",n=[].concat(a)):(t="text",n=[].concat(i)),n.map((e=>({[t]:e,id:`${s}-${e.placement??"center"}`,edge:l})))):[]}))),[Ne]),{nodes:Le,edges:Se}=(0,$.o)({layout:n,nodes:i,edges:a,manualLayoutStatus:_e,userViewReady:ye,userViewNodesMap:ve,nodeMovement:Ee,nodesRefRepository:G,lineLabelsRefRepository:ae,normalizedLinesMap:Te,layoutOptions:o,nodesRenderId:F,lineLabelsRenderId:ne});(0,d.useEffect)((()=>{"finished"===_e&&me(Le.map((e=>({id:e.id,x:e.x,y:e.y}))))}),[_e]);const $e=(0,d.useMemo)((()=>(0,_.R)(Se,Le,Ne)),[Ne,Le,Se]),ze=c??null,[Be,De]=(0,d.useState)(ze);(0,d.useEffect)((()=>{De((e=>(0,P.c)(e,ze)?e:ze))}),[ze]);const Pe=(0,d.useRef)(!1);(0,d.useEffect)((()=>{Pe.current?null==I||I(Be):Pe.current=!0}),[Be,I]),(0,d.useEffect)((()=>{const e=pe.current;if(!e||p)return;const t=e=>{const t=(0,w.a)(e,{renderedNodes:Le,activeTarget:Be});"delete-node"===(null==t?void 0:t.action)?null==Y||Y(t.node):"delete-edge"===(null==t?void 0:t.action)?null==U||U(t.edge):"switch-active-node"===(null==t?void 0:t.action)&&t.node&&(null==K||K({type:"node",nodeId:t.node.id}))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[Be,Le,p,K,Y,U]);const Oe=(0,d.useCallback)((e=>{e&&(J((e=>e+1)),Q(e)),Z((t=>t||!!e))}),[]),He=(0,d.useCallback)((e=>{e&&(ie((e=>e+1)),se(e)),te((t=>t||!!e))}),[]),Ie=(0,d.useMemo)((()=>H??[S.sS,S.Yt]),[H]),Ke=(0,d.useMemo)((()=>(0,A.s_)()),[]);(0,d.useEffect)((()=>{let e=!1;Ke.scaleExtent(g?Ie:[1,1]).on("start",(()=>{e=!1,he(!0)})).on("zoom",(t=>{e=!0,de(t.transform)})).on("end",(()=>{he(!1),e||null==K||K(null)}))}),[K,Ie,g,Ke]),(0,d.useEffect)((()=>{const e=pe.current;if(!e)return;const t=(0,f.A)(e),n=()=>{t.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(g||y||B)return(g||y)&&t.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),y&&(e.preventDefault(),Ke.translateBy(t,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),t.call(Ke).on("wheel",(e=>e.preventDefault())).on("dblclick.zoom",null),B||t.on("mousedown.zoom",null).on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),n;n()}),[B,y,g,Ke]),(0,d.useEffect)((()=>{const e=pe.current;if(0===Le.length||!e||fe)return;const{k:t,x:n,y:i}=(0,x.r)(Le,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:g?Ie:void 0});Ke.transform((0,f.A)(e),new A.uV(t,n,i)),Ae(!0)}),[fe,Le,Ie,g,Ke]);const Ye=(0,d.useMemo)((()=>`${(0,m.uniqueId)("diagram-")}-`),[]),Ue=`${Ye}line-arrow-`,Xe=`${Ye}mask-`,je=`${Ye}active-line-`;(0,d.useEffect)((()=>{oe((e=>(0,R.z)(e,$e,ue.current)))}),[$e]);const[Ve,qe]=u().useState(new Map);return(0,d.useEffect)((()=>{if(!ae)return;(0,z.F)(le,ae);const e=new b.A((()=>{qe((0,O.G)(le,ae))}));for(const t of ae.values())e.observe(t);return()=>{e.disconnect()}}),[ne,ae,le]),"dagre"!==n&&"force"!==n?u().createElement("div",null,`Diagram layout not supported: "${n}"`):u().createElement("div",{className:v()("diagram",{ready:q&&fe,grabbing:re,pannable:B}),tabIndex:-1,ref:pe},u().createElement("svg",{width:"100%",height:"100%",className:"lines"},u().createElement("defs",null,We.map(((e,t)=>{let{type:n,strokeColor:i}=e;return u().createElement(N.c,{key:t,id:`${Ue}${t}`,type:n,strokeColor:i})})),[...Ve].map((e=>{let[t,n]=e;return u().createElement(T.y,{key:t,lineId:t,rects:n,maskPrefix:Xe,renderedLineLabels:le})})),u().createElement("marker",{id:`${je}start`,viewBox:"0 0 8 8",refX:4,refY:4,markerWidth:8,markerHeight:8,orient:"auto"},u().createElement("path",{d:"M 0.5 0.5 H 7.5 V 7.5 H 0.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"})),u().createElement("marker",{id:`${je}end`,viewBox:"0 0 14 8",refX:3,refY:4,markerWidth:14,markerHeight:8,orient:"auto"},u().createElement("path",{d:"M 0.5 1.5 L 5.5 4 L 0.5 6.5 z",stroke:"var(--palette-blue-3)",strokeWidth:1,fill:"var(--palette-blue-3)"}),u().createElement("path",{d:"M 6.5 0.5 H 13.5 V 7.5 H 6.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"}))),u().createElement("g",{transform:`translate(${ce.x} ${ce.y}) scale(${ce.k})`},$e.map((e=>u().createElement(C.m,{key:e.line.$id,line:e,linePaths:ue.current,lineMaskRects:Ve,maskPrefix:Xe,markerPrefix:Ue,activeLineMarkerPrefix:je,active:"edge"===(null==Be?void 0:Be.type)&&Be.edge.source===e.edge.source&&Be.edge.target===e.edge.target,activeRelated:"node"===(null==Be?void 0:Be.type)&&(e.edge.source===Be.nodeId||e.edge.target===Be.nodeId),onLineClick:X,onLineDoubleClick:j}))))),u().createElement("div",{className:v()("line-labels",{ready:ee}),style:{left:ce.x,top:ce.y,transform:`scale(${ce.k})`}},u().createElement(E.d2,{labels:Re,onRendered:He})),u().createElement("div",{className:"nodes",ref:ge,style:{left:ce.x,top:ce.y,transform:`scale(${ce.k})`}},u().createElement(k.p,{nodes:i,nodeBricks:s,onRendered:Oe})),u().createElement(W.w,{connectLineState:we,connectLineTo:be,markerPrefix:Ue}))}i=kt,({e:[K,Y,U,X,j,V,q,Z,F,J,G,Q,ee,te,ne,ie,ae,se,le,oe,re,he,ce,de,ue,pe,ge,fe,Ae,ye,ve,me,be,ke,we,xe,_e,Me,Ee,Ce,Ne,Te,We,Re,Le,Se,$e,ze,Be,De,Pe,Oe,H],c:[Xe,I]}=(0,c.A)(i,[He("eo-diagram",{styleTexts:[B.A]})],[[Ie({type:String}),1,"layout"],[Ie({attribute:!1}),1,"nodes"],[Ie({attribute:!1}),1,"edges"],[Ie({attribute:!1}),1,"nodeBricks"],[Ie({attribute:!1}),1,"lines"],[Ie({attribute:!1}),1,"layoutOptions"],[Ie({attribute:!1}),1,"activeTarget"],[Ie({type:Boolean}),1,"disableKeyboardAction"],[Ie({attribute:!1}),1,"connectNodes"],[Ie({attribute:!1}),1,"dragNodes"],[Ie({type:Boolean}),1,"zoomable"],[Ie({type:Boolean}),1,"scrollable"],[Ie({type:Boolean}),1,"pannable"],[Ie({attribute:!1}),1,"scaleRange"],[Ke({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,h.A)(lt,e),(e,t)=>(0,r.A)(lt,e,t)],[Ke({type:"node.delete"}),1,"nodeDelete",e=>(0,h.A)(ht,e),(e,t)=>(0,r.A)(ht,e,t)],[Ke({type:"edge.delete"}),1,"edgeDelete",e=>(0,h.A)(dt,e),(e,t)=>(0,r.A)(dt,e,t)],[Ke({type:"line.click"}),1,"lineClick",e=>(0,h.A)(pt,e),(e,t)=>(0,r.A)(pt,e,t)],[Ke({type:"line.dblclick"}),1,"lineDoubleClick",e=>(0,h.A)(ft,e),(e,t)=>(0,r.A)(ft,e,t)],[Ke({type:"nodes.connect"}),1,"connectNodes",e=>(0,h.A)(yt,e),(e,t)=>(0,r.A)(yt,e,t)],[Ye(),2,"callOnLineLabel"]],0,(e=>bt.has((0,l.A)(e))),g.ReactNextElement)),I();var xt,_t=n(3971);let Mt,Et,Ct,Nt,Tt,Wt,Rt,Lt,St,$t,zt,Bt,Dt,Pt;const{defineElement:Ot,property:Ht,event:It,method:Kt}=(0,p.createDecorators)(),Yt=(0,d.forwardRef)(en);let Ut;var Xt=new WeakMap,jt=new WeakMap,Vt=new WeakMap,qt=new WeakSet,Zt=new WeakMap,Ft=new WeakMap,Jt=new WeakMap,Gt=new WeakMap;class Qt extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,qt),(0,s.A)(this,Xt,(Mt(this),Ct(this))),(0,s.A)(this,jt,(Nt(this),Tt(this))),(0,s.A)(this,Vt,(Wt(this),Rt(this))),(0,s.A)(this,Zt,($t(this),e=>{(0,o.A)(qt,this,Lt).emit(e)})),(0,s.A)(this,Ft,zt(this)),(0,s.A)(this,Jt,(Pt(this),e=>{(0,o.A)(qt,this,Bt).emit(e)})),(0,s.A)(this,Gt,(0,d.createRef)())}get label(){return(0,h.A)(Xt,this)}set label(e){(0,r.A)(Xt,this,e)}get type(){return(0,h.A)(jt,this)}set type(e){(0,r.A)(jt,this,e)}enableEditing(){var e;null===(e=(0,h.A)(Gt,this).current)||void 0===e||e.enableEditing()}render(){return u().createElement(Yt,{ref:(0,h.A)(Gt,this),label:this.label,onLabelEditingChange:(0,h.A)(Zt,this),onLabelChange:(0,h.A)(Jt,this)})}}function en(e,t){let{label:n,onLabelChange:i,onLabelEditingChange:a}=e;const s=n??"",[l,o]=(0,d.useState)(s),[r,h]=(0,d.useState)(!1),c=(0,d.useRef)(!1),[p,g]=(0,d.useState)(!1),f=(0,d.useRef)(null);(0,d.useImperativeHandle)(t,(()=>({enableEditing(){h(!0)}}))),(0,d.useEffect)((()=>{o(s)}),[s]);const A=(0,d.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),h(!0)}),[]);(0,d.useEffect)((()=>{var e,t;r&&(null===(e=f.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=f.current)||void 0===t||t.select())}),[r]),(0,d.useEffect)((()=>{c.current?null==a||a(r):c.current=!0}),[r,a]);const y=(0,d.useCallback)((e=>{o(e.target.value)}),[]),m=(0,d.useCallback)((e=>{const t=e.key||e.keyCode||e.which;var n;"Enter"!==t&&13!==t||null===(n=f.current)||void 0===n||n.blur()}),[]),b=(0,d.useCallback)((()=>{h(!1),g(!0)}),[]);(0,d.useEffect)((()=>{p&&(null==i||i(l),g(!1))}),[l,i,p]);const k=(0,d.useCallback)((e=>{e.stopPropagation()}),[]);return u().createElement("div",{className:v()("label",{editing:r,empty:!l}),onDoubleClick:k,onMouseDown:k},u().createElement("input",{className:"label-input",value:l,ref:f,onChange:y,onKeyDown:m,onBlur:b}),u().createElement("div",{className:"label-text",onDoubleClick:A},l))}xt=Qt,({e:[Ct,Nt,Tt,Wt,Rt,Lt,St,$t,zt,Bt,Dt,Pt,Mt],c:[Ut,Et]}=(0,c.A)(xt,[Ot("diagram.editable-label",{styleTexts:[_t.A]})],[[Ht(),1,"label"],[Ht({render:!1}),1,"type"],[It({type:"label.editing.change"}),1,"labelEditingChange",e=>(0,h.A)(Vt,e),(e,t)=>(0,r.A)(Vt,e,t)],[It({type:"label.change"}),1,"labelChange",e=>(0,h.A)(Ft,e),(e,t)=>(0,r.A)(Ft,e,t)],[Kt(),2,"enableEditing"]],0,(e=>Gt.has((0,l.A)(e))),g.ReactNextElement)),Et();var tn=n(2559),nn=n(9991),an=n(5748),sn=n(531),ln=n(8185),on=n(4197),rn=n(908);function hn(e){let{connectLineState:t,transform:n,markerEnd:i,onConnect:a}=e;const[s,l]=(0,d.useState)(null);return(0,d.useEffect)((()=>{t&&l(t.from)}),[t]),(0,d.useEffect)((()=>{if(t){const e=e=>{l([(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},i=e=>{e.stopPropagation()},s=e=>{e.stopPropagation(),o(),a(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",i,{capture:!0}),document.removeEventListener("click",s,{capture:!0}),l(null)};return document.addEventListener("mousemove",e),document.addEventListener("mousedown",i,{capture:!0}),document.addEventListener("click",s,{capture:!0}),o}}),[t,a,n]),u().createElement("path",{className:v()("connect-line",{connecting:!!t&&s&&(s[0]-t.from[0])**2+(s[1]-t.from[1])**2>25}),d:t&&s?`M${t.from.join(" ")}L${s.join(" ")}`:"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:`url(#${i})`})}var cn=n(3783),dn=n(2098),un=n(227),pn=n(3033),gn=n(8091),fn=n(1819),An=n(7099),yn=n(1484),vn=n(8197),mn=n(7531);var bn,kn=n(3012),wn=n(6237),xn=n(9386);let _n,Mn,En,Cn,Nn,Tn,Wn,Rn,Ln,Sn,$n,zn,Bn,Dn,Pn,On,Hn,In,Kn,Yn,Un,Xn,jn,Vn,qn,Zn,Fn,Jn,Gn,Qn,ei,ti,ni,ii,ai,si,li,oi,ri,hi,ci,di,ui,pi,gi,fi,Ai,yi,vi,mi,bi,ki,wi,xi,_i,Mi,Ei,Ci,Ni,Ti,Wi,Ri,Li,Si,$i,zi,Bi,Di,Pi,Oi,Hi,Ii,Ki,Yi,Ui,Xi,ji,Vi,qi,Zi,Fi,Ji;const Gi=(0,nn.unwrapProvider)("basic.lock-body-scroll"),{defineElement:Qi,property:ea,method:ta,event:na}=(0,p.createDecorators)(),ia=u().forwardRef(qa);let aa;var sa=new WeakMap,la=new WeakMap,oa=new WeakMap,ra=new WeakMap,ha=new WeakMap,ca=new WeakMap,da=new WeakMap,ua=new WeakMap,pa=new WeakMap,ga=new WeakMap,fa=new WeakMap,Aa=new WeakMap,ya=new WeakMap,va=new WeakMap,ma=new WeakMap,ba=new WeakMap,ka=new WeakMap,wa=new WeakMap,xa=new WeakMap,_a=new WeakSet,Ma=new WeakMap,Ea=new WeakMap,Ca=new WeakMap,Na=new WeakMap,Ta=new WeakMap,Wa=new WeakMap,Ra=new WeakMap,La=new WeakMap,Sa=new WeakMap,$a=new WeakMap,za=new WeakMap,Ba=new WeakMap,Da=new WeakMap,Pa=new WeakMap,Oa=new WeakMap,Ha=new WeakMap,Ia=new WeakMap,Ka=new WeakMap,Ya=new WeakMap,Ua=new WeakMap,Xa=new WeakMap;class ja extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,_a),(0,s.A)(this,sa,(_n(this),En(this))),(0,s.A)(this,la,(Cn(this),Nn(this))),(0,s.A)(this,oa,(Tn(this),Wn(this))),(0,s.A)(this,ra,(Rn(this),Ln(this,[pn.HP,pn.HP]))),(0,s.A)(this,ha,(Sn(this),$n(this))),(0,s.A)(this,ca,(zn(this),Bn(this))),(0,s.A)(this,da,(Dn(this),Pn(this))),(0,s.A)(this,ua,(On(this),Hn(this))),(0,s.A)(this,pa,(In(this),Kn(this))),(0,s.A)(this,ga,(Yn(this),Un(this))),(0,s.A)(this,fa,(Xn(this),jn(this,!0))),(0,s.A)(this,Aa,(Vn(this),qn(this,!0))),(0,s.A)(this,ya,(Zn(this),Fn(this,!0))),(0,s.A)(this,va,(Jn(this),Gn(this,!0))),(0,s.A)(this,ma,(Qn(this),ei(this,!1))),(0,s.A)(this,ba,(ti(this),ni(this))),(0,s.A)(this,ka,(ii(this),ai(this))),(0,s.A)(this,wa,(si(this),li(this))),(0,s.A)(this,xa,(oi(this),ri(this))),(0,s.A)(this,Ma,(di(this),e=>{(0,o.A)(_a,this,hi).emit(e)})),(0,s.A)(this,Ea,(e=>{(0,ln.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,Ca,ui(this)),(0,s.A)(this,Na,(fi(this),Ai(this))),(0,s.A)(this,Ta,(mi(this),e=>{(0,o.A)(_a,this,yi).emit(e),"node"===e.type&&(0,o.A)(_a,this,pi).emit(e)})),(0,s.A)(this,Wa,bi(this)),(0,s.A)(this,Ra,(xi(this),e=>{(0,o.A)(_a,this,ki).emit(e)})),(0,s.A)(this,La,_i(this)),(0,s.A)(this,Sa,(Ci(this),e=>{(0,o.A)(_a,this,Mi).emit(e)})),(0,s.A)(this,$a,Ni(this)),(0,s.A)(this,za,(Ri(this),Li(this))),(0,s.A)(this,Ba,(zi(this),e=>{(0,o.A)(_a,this,Si).emit(e),"node"===e.type&&(0,o.A)(_a,this,Ti).emit(e)})),(0,s.A)(this,Da,Bi(this)),(0,s.A)(this,Pa,(Oi(this),e=>{(0,o.A)(_a,this,Di).emit(e)})),(0,s.A)(this,Oa,Hi(this)),(0,s.A)(this,Ha,(Yi(this),e=>{(0,o.A)(_a,this,Ii).emit(e)})),(0,s.A)(this,Ia,Ui(this)),(0,s.A)(this,Ka,(Vi(this),e=>{(0,o.A)(_a,this,Xi).emit(e)})),(0,s.A)(this,Ya,qi(this)),(0,s.A)(this,Ua,(Ji(this),e=>{(0,o.A)(_a,this,Zi).emit(e)})),(0,s.A)(this,Xa,(0,d.createRef)())}get cells(){return(0,h.A)(sa,this)}set cells(e){(0,r.A)(sa,this,e)}get layout(){return(0,h.A)(la,this)}set layout(e){(0,r.A)(la,this,e)}get layoutOptions(){return(0,h.A)(oa,this)}set layoutOptions(e){(0,r.A)(oa,this,e)}get defaultNodeSize(){return(0,h.A)(ra,this)}set defaultNodeSize(e){(0,r.A)(ra,this,e)}get defaultNodeBricks(){return(0,h.A)(ha,this)}set defaultNodeBricks(e){(0,r.A)(ha,this,e)}get degradedThreshold(){return(0,h.A)(ca,this)}set degradedThreshold(e){(0,r.A)(ca,this,e)}get degradedNodeLabel(){return(0,h.A)(da,this)}set degradedNodeLabel(e){(0,r.A)(da,this,e)}get defaultEdgeLines(){return(0,h.A)(ua,this)}set defaultEdgeLines(e){(0,r.A)(ua,this,e)}get activeTarget(){return(0,h.A)(pa,this)}set activeTarget(e){(0,r.A)(pa,this,e)}get fadeUnrelatedCells(){return(0,h.A)(ga,this)}set fadeUnrelatedCells(e){(0,r.A)(ga,this,e)}get zoomable(){return(0,h.A)(fa,this)}set zoomable(e){(0,r.A)(fa,this,e)}get scrollable(){return(0,h.A)(Aa,this)}set scrollable(e){(0,r.A)(Aa,this,e)}get pannable(){return(0,h.A)(ya,this)}set pannable(e){(0,r.A)(ya,this,e)}get selectable(){return(0,h.A)(va,this)}set selectable(e){(0,r.A)(va,this,e)}get allowEdgeToArea(){return(0,h.A)(ma,this)}set allowEdgeToArea(e){(0,r.A)(ma,this,e)}get dragBehavior(){return(0,h.A)(ba,this)}set dragBehavior(e){(0,r.A)(ba,this,e)}get ctrlDragBehavior(){return(0,h.A)(ka,this)}set ctrlDragBehavior(e){(0,r.A)(ka,this,e)}get scaleRange(){return(0,h.A)(wa,this)}set scaleRange(e){(0,r.A)(wa,this,e)}async dropNode(e){var t,n;let{id:i,position:a,size:s,data:l,useBrick:o}=e;if(null===(t=(n=document).elementsFromPoint)||void 0===t||null===(t=t.call(n,a[0],a[1]))||void 0===t?void 0:t.includes(this)){var r;const e=this.getBoundingClientRect(),t=(0,h.A)(Xa,this).current.getTransform(),n={type:"node",id:i,view:{..."force"===this.layout||"dagre"===this.layout?null:{x:(a[0]-e.left-t.x)/t.k,y:(a[1]-e.top-t.y)/t.k},width:(null==s?void 0:s[0])??this.defaultNodeSize[0],height:(null==s?void 0:s[1])??this.defaultNodeSize[0]},data:l,useBrick:o};return null===(r=(0,h.A)(Xa,this).current)||void 0===r||r.dropNode(n),n}return null}async dropDecorator(e){var t,n;let{position:i,decorator:a,text:s}=e;if(null===(t=(n=document).elementsFromPoint)||void 0===t||null===(t=t.call(n,i[0],i[1]))||void 0===t?void 0:t.includes(this)){var l;const e=this.getBoundingClientRect(),t=(0,h.A)(Xa,this).current.getTransform(),n={type:"decorator",decorator:a,id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),view:{x:(i[0]-e.left-t.x)/t.k,y:(i[1]-e.top-t.y)/t.k,width:pn.N8,height:pn.w1,text:s}};return null===(l=(0,h.A)(Xa,this).current)||void 0===l||l.dropDecorator(n),n}return null}async addNodes(e){if(0===e.length)return[];const t=e.map((e=>{let{size:t,useBrick:n,id:i,data:a}=e;return{type:"node",id:i,data:a,view:{width:(null==t?void 0:t[0])??this.defaultNodeSize[0],height:(null==t?void 0:t[1])??this.defaultNodeSize[0]},useBrick:n}}));return(0,h.A)(Xa,this).current.addNodes(t,{defaultNodeSize:this.defaultNodeSize,canvasWidth:this.clientWidth,canvasHeight:this.clientHeight})}async addEdge(e){var t;let{source:n,target:i,data:a}=e;const s={type:"edge",source:n,target:i,data:a};return null===(t=(0,h.A)(Xa,this).current)||void 0===t||t.addEdge(s),s}manuallyConnectNodes(e){return(0,h.A)(Xa,this).current.manuallyConnectNodes(e)}async updateCells(e,t){await(0,tn.A)(_a,this,Va).call(this);const{updated:n}=(0,h.A)(Xa,this).current.updateCells(e,{...t,defaultNodeSize:this.defaultNodeSize,canvasWidth:this.clientWidth,canvasHeight:this.clientHeight});return{updated:n}}disconnectedCallback(){super.disconnectedCallback(),Gi(this,!1)}render(){return u().createElement(ia,{host:this,ref:(0,h.A)(Xa,this),layout:this.layout,layoutOptions:this.layoutOptions,cells:this.cells,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,dragBehavior:this.dragBehavior,ctrlDragBehavior:this.ctrlDragBehavior,scaleRange:this.scaleRange,allowEdgeToArea:this.allowEdgeToArea,onActiveTargetChange:(0,h.A)(Ma,this),onSwitchActiveTarget:(0,h.A)(Ea,this),onCellMove:(0,h.A)(Ta,this),onCellsMove:(0,h.A)(Ra,this),onCellResize:(0,h.A)(Sa,this),onCellDelete:(0,h.A)(Ba,this),onCellsDelete:(0,h.A)(Pa,this),onCellContextMenu:(0,h.A)(Ha,this),onDecoratorTextChange:(0,h.A)(Ka,this),onScaleChange:(0,h.A)(Ua,this)})}}function Va(){return new Promise((e=>{const t=()=>{(0,h.A)(Xa,this).current?e():setTimeout(t,10)};t()}))}function qa(e,t){let{host:n,layout:i,layoutOptions:a,cells:s,defaultNodeSize:l,defaultNodeBricks:o,defaultEdgeLines:r,degradedThreshold:h,degradedNodeLabel:c,activeTarget:p,fadeUnrelatedCells:g,zoomable:A,scrollable:y,pannable:b,dragBehavior:k,ctrlDragBehavior:w,scaleRange:x,allowEdgeToArea:_,onActiveTargetChange:M,onSwitchActiveTarget:E,onCellMove:C,onCellResize:T,onCellDelete:W,onCellsMove:R,onCellsDelete:L,onCellContextMenu:S,onDecoratorTextChange:$,onScaleChange:z}=e;const[{cells:B,layoutKey:D},P]=(0,d.useReducer)(an.d,s,(e=>({cells:(0,cn.C)(e,{defaultNodeSize:l}),layoutKey:0}))),O=(0,d.useMemo)((()=>B.filter(sn.N).length>=(h??pn.pC)),[B,h]),H=(0,d.useRef)(null),I=(0,d.useRef)(null),K=(0,d.useRef)(null),[Y,U]=(0,d.useState)([]),{grabbing:X,transform:j,zoomer:V,scaleRange:q}=(0,gn.f)({rootRef:H,zoomable:A,scrollable:y,pannable:b,draggable:"grab"===k,ctrlDraggable:"grab"===w,scaleRange:x,onSwitchActiveTarget:E});(0,d.useEffect)((()=>{z(j.k)}),[z,j.k]);const[Z,F]=(0,d.useState)(null),[J,G]=(0,d.useState)(null),{centered:Q,setCentered:ee,getNextLayoutKey:te}=(0,yn.g)({layout:i,layoutOptions:a,rootRef:H,cells:B,zoomable:A,zoomer:V,scaleRange:q,layoutKey:D,allowEdgeToArea:_,dispatch:P});(0,d.useImperativeHandle)(t,(()=>({dropNode(e){"dagre"!==i&&"force"!==i&&ee(!0),P({type:"drop-node",payload:e})},dropDecorator(e){"dagre"!==i&&"force"!==i&&ee(!0),P({type:"drop-decorator",payload:e})},addNodes(e,t){let{defaultNodeSize:n,canvasWidth:a,canvasHeight:s}=t;const l=B.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1,o=[...B.slice(0,l),...e,...B.slice(l)],{cells:r,updated:h,shouldReCenter:c}=(0,dn.L)({cells:o,layout:i,previousCells:B,defaultNodeSize:n,canvasWidth:a,canvasHeight:s,scaleRange:q,transform:j,allowEdgeToArea:_});return c&&ee(!1),P({type:"update-cells",payload:r}),h.filter((t=>e.includes(t)))},addEdge(e){P({type:"add-edge",payload:e})},updateCells(e,t){const{shouldReCenter:n,...a}=(0,dn.L)({...t,layout:i,previousCells:B,cells:e,scaleRange:q,transform:j,allowEdgeToArea:_});return n&&ee(!1),P({type:"update-cells",payload:a.cells}),a},getTransform:()=>j,manuallyConnectNodes(e){const t=B.find((t=>(_&&(0,sn.o6)(t)||(0,sn.N)(t))&&t.id===e));if(t){const e=H.current.getBoundingClientRect();return G({source:t,from:[t.view.x+t.view.width/2,t.view.y+t.view.height/2],offset:[e.left,e.top]}),new Promise(((e,t)=>{K.current={resolve:e,reject:t}}))}return Promise.reject(null)}})),[B,i,q,ee,j,_]);const ne=(0,d.useCallback)(((e,t)=>{var n;for(let n=B.length-1;n>=0;n--){const a=B[n];if((_&&(0,sn.o6)(a)||(0,sn.N)(a))&&a.id!==e.source.id&&a.view.x<t[0]&&a.view.x+a.view.width>t[0]&&a.view.y<t[1]&&a.view.y+a.view.height>t[1]){var i;null===(i=K.current)||void 0===i||i.resolve({source:e.source,target:a});break}}null===(n=K.current)||void 0===n||n.reject(null),G(null)}),[B]);(0,d.useEffect)((()=>{Gi(n,!(!J&&!Z))}),[J,n,Z]);const ie=(0,fn.J)({cellsRef:I,activeTarget:p,onActiveTargetChange:M}),[ae,se]=(0,d.useState)([]);(0,d.useEffect)((()=>{const e=g?(0,un.Y)(B,J,ie,_):[];se((t=>0===t.length&&0===e.length?t:e))}),[ie,B,J,g,_]),(0,d.useEffect)((()=>{const e=H.current;if(!e||Y.length>0)return;const t=e=>{const t=function(e,t){let{cells:n,activeTarget:i}=t;const a=n.filter((e=>(0,on.Q)(e,i)));if(0!==a.length)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cells",cells:a}}}(e,{cells:B,activeTarget:ie});"delete-cells"===(null==t?void 0:t.action)&&(L(t.cells),1===t.cells.length&&W(t.cells[0]))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[ie,B,Y.length,W,L]);const le=`${(0,d.useMemo)((()=>`${(0,m.uniqueId)("diagram-")}-`),[])}line-arrow-`,oe=(0,d.useCallback)((e=>{P({type:"move-cells",payload:e})}),[]),re=(0,d.useCallback)((e=>{P({type:"move-cells",payload:e}),R(e),1===e.length&&C(e[0])}),[C,R]),he=(0,d.useCallback)((e=>{P({type:"resize-cell",payload:e})}),[]),ce=(0,d.useCallback)((e=>{P({type:"resize-cell",payload:e}),T(e)}),[T]),de=(0,d.useCallback)((e=>{let{id:t,editing:n}=e;U(n?e=>e.includes(t)?e:[...e,t]:e=>e.filter((e=>e!==t)))}),[]),ue=(0,d.useCallback)(((e,t)=>{const n=te();P({type:"update-node-size",payload:{id:e,size:t},layoutKey:n})}),[te]),pe=(0,d.useCallback)((e=>{V.scaleTo((0,f.A)(H.current),e/100)}),[V]),ge=(0,d.useCallback)((()=>{ee(!1)}),[ee]),[fe,Ae]=(0,mn.d)({cells:B,defaultEdgeLines:r,markerPrefix:le}),ye=(0,vn.H)({cells:B,layout:i,centered:Q});return(0,d.useEffect)((()=>{const e=H.current;if(!e||"lasso"!==k)return;const t=e.getBoundingClientRect(),n=e=>{!function(e,t){let{transform:n,offset:i,onLassoing:a,onLassoed:s}=t;if(e.ctrlKey||e.button)return;e.stopPropagation();const l=[e.clientX,e.clientY],o=(e.clientX-i[0]-n.x)/n.k,r=(e.clientY-i[1]-n.y)/n.k;let h=!1;const c=(e,t)=>{const i=function(e){return[(e.clientX-l[0])/n.k,(e.clientY-l[1])/n.k]}(e);if(h||(h=i[0]**2+i[1]**2>=9),h){let[e,n]=i,l=o,h=r;e<0&&(l=o+e,e=-e),n<0&&(h=r+n,n=-n),(t?s:a)({x:l,y:h,width:e,height:n})}},d=e=>{c(e)},u=e=>{c(e,!0),h=!1,document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",u)}(e,{transform:j,offset:[t.left,t.top],onLassoing(e){F(e)},onLassoed(e){F(null);const t=[];for(const n of B)if((0,sn.o6)(n)){const i=n.view.x,a=n.view.y;i>=e.x&&i+n.view.width<=e.x+e.width&&a>=e.y&&a+n.view.height<=e.y+e.height&&t.push(n)}null==E||E(t.length>1?{type:"multi",targets:t.map(xn.P)}:1===t.length?(0,xn.P)(t[0]):null)}})};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}}),[j,B,k,E]),u().createElement(u().Fragment,null,u().createElement("svg",{width:"100%",height:"100%",ref:H,className:v()("root",{grabbing:X,pannable:b,ready:ye}),tabIndex:-1},u().createElement("defs",null,Ae.map(((e,t)=>u().createElement(N.c,{key:t,id:`${le}${t}`,type:"arrow",strokeColor:e.strokeColor})))),u().createElement("g",{transform:`translate(${j.x} ${j.y}) scale(${j.k})`},u().createElement("g",{className:v()("cells",{allowEdgeToArea:_}),ref:I},B.map((e=>u().createElement(rn.m,{key:`${e.type}:${"edge"===e.type?`${e.source}~${e.target}`:e.id}`,layout:i,cell:e,cells:B,degraded:O,degradedNodeLabel:c,defaultNodeBricks:o,transform:j,lineConfMap:fe,activeTarget:ie,unrelatedCells:ae,onCellsMoving:oe,onCellsMoved:re,onCellResizing:he,onCellResized:ce,onSwitchActiveTarget:E,onCellContextMenu:S,onDecoratorTextChange:$,onDecoratorTextEditing:de,onNodeBrickResize:ue})))),u().createElement(hn,{connectLineState:J,transform:j,markerEnd:`${le}0`,onConnect:ne}),Z&&u().createElement("rect",{x:Z.x,y:Z.y,width:Z.width,height:Z.height,fill:"var(--palette-gray-5)",fillOpacity:.3,stroke:"var(--palette-gray-5)",strokeDasharray:2}))),u().createElement(An.Y,{shadowRoot:n.shadowRoot,scale:j.k,scaleRange:q,onZoomChange:pe,onReCenter:ge}))}bn=ja,({e:[En,Cn,Nn,Tn,Wn,Rn,Ln,Sn,$n,zn,Bn,Dn,Pn,On,Hn,In,Kn,Yn,Un,Xn,jn,Vn,qn,Zn,Fn,Jn,Gn,Qn,ei,ti,ni,ii,ai,si,li,oi,ri,hi,ci,di,ui,pi,gi,fi,Ai,yi,vi,mi,bi,ki,wi,xi,_i,Mi,Ei,Ci,Ni,Ti,Wi,Ri,Li,Si,$i,zi,Bi,Di,Pi,Oi,Hi,Ii,Ki,Yi,Ui,Xi,ji,Vi,qi,Zi,Fi,Ji,_n],c:[aa,Mn]}=(0,c.A)(bn,[Qi("eo-draw-canvas",{styleTexts:[kn.A,wn.A]})],[[ea({attribute:!1}),1,"cells"],[ea({type:String}),1,"layout"],[ea({attribute:!1}),1,"layoutOptions"],[ea({attribute:!1}),1,"defaultNodeSize"],[ea({attribute:!1}),1,"defaultNodeBricks"],[ea({type:Number}),1,"degradedThreshold"],[ea({attribute:!1}),1,"degradedNodeLabel"],[ea({attribute:!1}),1,"defaultEdgeLines"],[ea({attribute:!1}),1,"activeTarget"],[ea({type:Boolean}),1,"fadeUnrelatedCells"],[ea({type:Boolean}),1,"zoomable"],[ea({type:Boolean}),1,"scrollable"],[ea({type:Boolean}),1,"pannable"],[ea({type:Boolean}),1,"selectable"],[ea({type:Boolean}),1,"allowEdgeToArea"],[ea(),1,"dragBehavior"],[ea(),1,"ctrlDragBehavior"],[ea({attribute:!1}),1,"scaleRange"],[na({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,h.A)(xa,e),(e,t)=>(0,r.A)(xa,e,t)],[na({type:"node.move"}),1,"nodeMoveEvent",e=>(0,h.A)(Ca,e),(e,t)=>(0,r.A)(Ca,e,t)],[na({type:"cell.move"}),1,"cellMoveEvent",e=>(0,h.A)(Na,e),(e,t)=>(0,r.A)(Na,e,t)],[na({type:"cells.move"}),1,"cellsMoveEvent",e=>(0,h.A)(Wa,e),(e,t)=>(0,r.A)(Wa,e,t)],[na({type:"cell.resize"}),1,"cellResizeEvent",e=>(0,h.A)(La,e),(e,t)=>(0,r.A)(La,e,t)],[na({type:"node.delete"}),1,"nodeDelete",e=>(0,h.A)($a,e),(e,t)=>(0,r.A)($a,e,t)],[na({type:"cell.delete"}),1,"cellDelete",e=>(0,h.A)(za,e),(e,t)=>(0,r.A)(za,e,t)],[na({type:"cells.delete"}),1,"cellsDelete",e=>(0,h.A)(Da,e),(e,t)=>(0,r.A)(Da,e,t)],[na({type:"cell.contextmenu"}),1,"cellContextMenu",e=>(0,h.A)(Oa,e),(e,t)=>(0,r.A)(Oa,e,t)],[na({type:"decorator.text.change"}),1,"decoratorTextChange",e=>(0,h.A)(Ia,e),(e,t)=>(0,r.A)(Ia,e,t)],[na({type:"scale.change"}),1,"scaleChange",e=>(0,h.A)(Ya,e),(e,t)=>(0,r.A)(Ya,e,t)],[ta(),2,"dropNode"],[ta(),2,"dropDecorator"],[ta(),2,"addNodes"],[ta(),2,"addEdge"],[ta(),2,"manuallyConnectNodes"],[ta(),2,"updateCells"]],0,(e=>Xa.has((0,l.A)(e))),g.ReactNextElement)),Mn();var Za,Fa=n(497);let Ja,Ga,Qa,es,ts,ns,is,as,ss,ls,os,rs,hs,cs,ds,us,ps,gs,fs;const{defineElement:As,property:ys,event:vs}=(0,p.createDecorators)();let ms;var bs,ks=new WeakMap,ws=new WeakMap,xs=new WeakMap,_s=new WeakMap,Ms=new WeakSet,Es=new WeakMap,Cs=new WeakMap,Ns=new WeakMap,Ts=new WeakMap,Ws=new WeakMap;class Rs extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ms),(0,s.A)(this,ks,Ga(this)),(0,s.A)(this,ws,(Qa(this),es(this))),(0,s.A)(this,xs,(ts(this),ns(this))),(0,s.A)(this,_s,(is(this),as(this))),(0,s.A)(this,Es,(os(this),e=>{(0,o.A)(Ms,this,ss).emit(e)})),(0,s.A)(this,Cs,rs(this)),(0,s.A)(this,Ns,(ds(this),e=>{(0,o.A)(Ms,this,hs).emit(e)})),(0,s.A)(this,Ts,us(this)),(0,s.A)(this,Ws,(fs(this),e=>{(0,o.A)(Ms,this,ps).emit(e)}))}get usage(){return(0,h.A)(ks,this)}set usage(e){(0,r.A)(ks,this,e)}get status(){return(0,h.A)(ws,this)}set status(e){(0,r.A)(ws,this,e)}get decorator(){return(0,h.A)(xs,this)}set decorator(e){(0,r.A)(xs,this,e)}render(){return u().createElement(Ls,{usage:this.usage,onDragStart:(0,h.A)(Es,this),onDragMove:(0,h.A)(Ns,this),onDragEnd:(0,h.A)(Ws,this)})}}function Ls(e){let{usage:t,onDragStart:n,onDragMove:i,onDragEnd:a}=e;const s=(0,d.useCallback)((e=>{if("library"!==t)return;e.stopPropagation(),e.preventDefault();const s=[e.clientX,e.clientY];let l=!1;const o=e=>{l||(l=(e.clientX-s[0])**2+(e.clientY-s[1])**2>=9,l&&(null==n||n([e.clientX,e.clientY]))),l&&(null==i||i([e.clientX,e.clientY]))},r=e=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),l&&(null==a||a([e.clientX,e.clientY]))};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}),[a,i,n,t]);return u().createElement("div",{onMouseDown:s},u().createElement("slot",null))}let Ss,$s,zs,Bs,Ds,Ps,Os,Hs,Is,Ks,Ys,Us,Xs,js,Vs,qs,Zs,Fs,Js,Gs,Qs,el,tl,nl,il,al,sl,ll,ol,rl,hl,cl,dl,ul,pl,gl,fl,Al,yl,vl,ml;Za=Rs,({e:[Ga,Qa,es,ts,ns,is,as,ss,ls,os,rs,hs,cs,ds,us,ps,gs,fs],c:[ms,Ja]}=(0,c.A)(Za,[As("diagram.experimental-node",{styleTexts:[Fa.A]})],[[ys(),1,"usage"],[ys({type:String,render:!1}),1,"status"],[ys({type:String}),1,"decorator"],[vs({type:"drag.start"}),1,"dragStartEvent",e=>(0,h.A)(_s,e),(e,t)=>(0,r.A)(_s,e,t)],[vs({type:"drag.move"}),1,"dragMoveEvent",e=>(0,h.A)(Cs,e),(e,t)=>(0,r.A)(Cs,e,t)],[vs({type:"drag.end"}),1,"dragEndEvent",e=>(0,h.A)(Ts,e),(e,t)=>(0,r.A)(Ts,e,t)]],0,(e=>Ws.has((0,l.A)(e))),g.ReactNextElement)),Ja();const{defineElement:bl,property:kl,event:wl}=(0,p.createDecorators)();let xl;var _l=new WeakMap,Ml=new WeakMap,El=new WeakMap,Cl=new WeakMap,Nl=new WeakMap,Tl=new WeakMap,Wl=new WeakMap,Rl=new WeakMap,Ll=new WeakMap,Sl=new WeakMap,$l=new WeakMap,zl=new WeakMap,Bl=new WeakMap,Dl=new WeakMap,Pl=new WeakMap,Ol=new WeakSet,Hl=new WeakMap,Il=new WeakMap,Kl=new WeakMap,Yl=new WeakMap,Ul=new WeakMap,Xl=new WeakMap;class jl extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ol),(0,s.A)(this,_l,$s(this)),(0,s.A)(this,Ml,(zs(this),Bs(this))),(0,s.A)(this,El,(Ds(this),Ps(this))),(0,s.A)(this,Cl,(Os(this),Hs(this,[pn.HP,pn.HP]))),(0,s.A)(this,Nl,(Is(this),Ks(this))),(0,s.A)(this,Tl,(Ys(this),Us(this))),(0,s.A)(this,Wl,(Xs(this),js(this))),(0,s.A)(this,Rl,(Vs(this),qs(this))),(0,s.A)(this,Ll,(Zs(this),Fs(this))),(0,s.A)(this,Sl,(Js(this),Gs(this))),(0,s.A)(this,$l,(Qs(this),el(this,!0))),(0,s.A)(this,zl,(tl(this),nl(this,!0))),(0,s.A)(this,Bl,(il(this),al(this,!0))),(0,s.A)(this,Dl,(sl(this),ll(this))),(0,s.A)(this,Pl,(ol(this),rl(this))),(0,s.A)(this,Hl,(dl(this),e=>{(0,o.A)(Ol,this,hl).emit(e)})),(0,s.A)(this,Il,(e=>{(0,ln.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,Kl,ul(this)),(0,s.A)(this,Yl,(fl(this),e=>{(0,o.A)(Ol,this,pl).emit(e)})),(0,s.A)(this,Ul,Al(this)),(0,s.A)(this,Xl,(ml(this),e=>{(0,o.A)(Ol,this,yl).emit(e)}))}get cells(){return(0,h.A)(_l,this)}set cells(e){(0,r.A)(_l,this,e)}get layout(){return(0,h.A)(Ml,this)}set layout(e){(0,r.A)(Ml,this,e)}get layoutOptions(){return(0,h.A)(El,this)}set layoutOptions(e){(0,r.A)(El,this,e)}get defaultNodeSize(){return(0,h.A)(Cl,this)}set defaultNodeSize(e){(0,r.A)(Cl,this,e)}get defaultNodeBricks(){return(0,h.A)(Nl,this)}set defaultNodeBricks(e){(0,r.A)(Nl,this,e)}get degradedThreshold(){return(0,h.A)(Tl,this)}set degradedThreshold(e){(0,r.A)(Tl,this,e)}get degradedNodeLabel(){return(0,h.A)(Wl,this)}set degradedNodeLabel(e){(0,r.A)(Wl,this,e)}get defaultEdgeLines(){return(0,h.A)(Rl,this)}set defaultEdgeLines(e){(0,r.A)(Rl,this,e)}get activeTarget(){return(0,h.A)(Ll,this)}set activeTarget(e){(0,r.A)(Ll,this,e)}get fadeUnrelatedCells(){return(0,h.A)(Sl,this)}set fadeUnrelatedCells(e){(0,r.A)(Sl,this,e)}get zoomable(){return(0,h.A)($l,this)}set zoomable(e){(0,r.A)($l,this,e)}get scrollable(){return(0,h.A)(zl,this)}set scrollable(e){(0,r.A)(zl,this,e)}get pannable(){return(0,h.A)(Bl,this)}set pannable(e){(0,r.A)(Bl,this,e)}get scaleRange(){return(0,h.A)(Dl,this)}set scaleRange(e){(0,r.A)(Dl,this,e)}render(){return u().createElement(Vl,{shadowRoot:this.shadowRoot,cells:this.cells,layout:this.layout,layoutOptions:this.layoutOptions,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:(0,h.A)(Hl,this),onSwitchActiveTarget:(0,h.A)(Il,this),onCellContextMenu:(0,h.A)(Yl,this),onCellClick:(0,h.A)(Xl,this)})}}function Vl(e){let{shadowRoot:t,cells:n,layout:i,layoutOptions:a,defaultNodeSize:s,defaultNodeBricks:l,defaultEdgeLines:o,degradedThreshold:r,degradedNodeLabel:h,activeTarget:c,fadeUnrelatedCells:p,zoomable:g,scrollable:A,pannable:y,scaleRange:b,onActiveTargetChange:k,onSwitchActiveTarget:w,onCellContextMenu:x,onCellClick:_}=e;const[{cells:M,layoutKey:E},C]=(0,d.useReducer)(an.d,n,(e=>({cells:(0,cn.C)(e,{defaultNodeSize:s}),layoutKey:1}))),T=(0,d.useMemo)((()=>M.filter(sn.N).length>=(r??pn.pC)),[M,r]),W=(0,d.useRef)(null),R=(0,d.useRef)(null),{grabbing:L,transform:S,zoomer:$,scaleRange:z}=(0,gn.f)({rootRef:W,zoomable:g,scrollable:A,pannable:y,draggable:!0,scaleRange:b,onSwitchActiveTarget:w}),{centered:B,setCentered:D,getNextLayoutKey:P}=(0,yn.g)({layout:i,layoutOptions:a,rootRef:W,cells:M,zoomable:g,zoomer:$,scaleRange:z,layoutKey:E,dispatch:C}),O=(0,d.useCallback)((()=>{D(!1)}),[D]),H=(0,d.useRef)(n);(0,d.useEffect)((()=>{if(n!==H.current){H.current=n;const e=(0,dn.L)({canvasWidth:t.host.clientWidth,canvasHeight:t.host.clientHeight,defaultNodeSize:s,layout:i,previousCells:M,cells:n,scaleRange:z,transform:S});C({type:"update-cells",payload:e.cells})}}),[M,s,n,i,z,t,S]);const I=(0,fn.J)({cellsRef:R,activeTarget:c,onActiveTargetChange:k}),K=`${(0,d.useMemo)((()=>`${(0,m.uniqueId)("diagram-")}-`),[])}line-arrow-`,Y=(0,d.useCallback)(((e,t)=>{C({type:"update-node-size",payload:{id:e,size:t},layoutKey:P()})}),[P]),[U,X]=(0,d.useState)(null),j=(0,d.useCallback)((e=>{X(e)}),[]),V=(0,d.useCallback)((e=>{X((t=>t===e?null:t))}),[]),[q,Z]=(0,d.useState)([]);(0,d.useEffect)((()=>{const e=p?(0,un.Y)(M,null,U):[];Z((t=>0===t.length&&0===e.length?t:e))}),[M,p,U]);const F=(0,d.useCallback)((e=>{$.scaleTo((0,f.A)(W.current),e/100)}),[$]),[J,G]=(0,mn.d)({cells:M,defaultEdgeLines:o,markerPrefix:K}),Q=(0,vn.H)({cells:M,layout:i,centered:B});return u().createElement(u().Fragment,null,u().createElement("svg",{width:"100%",height:"100%",ref:W,className:v()("root",{grabbing:L,pannable:y,ready:Q}),tabIndex:-1},u().createElement("defs",null,G.map(((e,t)=>u().createElement(N.c,{key:t,id:`${K}${t}`,type:"arrow",strokeColor:e.strokeColor})))),u().createElement("g",{transform:`translate(${S.x} ${S.y}) scale(${S.k})`},u().createElement("g",{className:"cells",ref:R},M.map((e=>u().createElement(rn.m,{key:`${e.type}:${(0,sn.WW)(e)?`${e.source}~${e.target}`:e.id}`,layout:void 0,cell:e,cells:M,degraded:T,degradedNodeLabel:h,defaultNodeBricks:l,lineConfMap:J,transform:S,activeTarget:I,readOnly:!0,unrelatedCells:q,onSwitchActiveTarget:w,onCellContextMenu:x,onCellClick:_,onNodeBrickResize:Y,onCellMouseEnter:p&&(0,sn.N)(e)?j:void 0,onCellMouseLeave:p&&(0,sn.N)(e)?V:void 0})))))),u().createElement(An.Y,{shadowRoot:t,scale:S.k,scaleRange:z,onZoomChange:F,onReCenter:O}))}bs=jl,({e:[$s,zs,Bs,Ds,Ps,Os,Hs,Is,Ks,Ys,Us,Xs,js,Vs,qs,Zs,Fs,Js,Gs,Qs,el,tl,nl,il,al,sl,ll,ol,rl,hl,cl,dl,ul,pl,gl,fl,Al,yl,vl,ml],c:[xl,Ss]}=(0,c.A)(bs,[bl("eo-display-canvas",{styleTexts:[kn.A,wn.A]})],[[kl({attribute:!1}),1,"cells"],[kl({type:String}),1,"layout"],[kl({attribute:!1}),1,"layoutOptions"],[kl({attribute:!1}),1,"defaultNodeSize"],[kl({attribute:!1}),1,"defaultNodeBricks"],[kl({type:Number}),1,"degradedThreshold"],[kl({attribute:!1}),1,"degradedNodeLabel"],[kl({attribute:!1}),1,"defaultEdgeLines"],[kl({attribute:!1}),1,"activeTarget"],[kl({type:Boolean}),1,"fadeUnrelatedCells"],[kl({type:Boolean}),1,"zoomable"],[kl({type:Boolean}),1,"scrollable"],[kl({type:Boolean}),1,"pannable"],[kl({attribute:!1}),1,"scaleRange"],[wl({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,h.A)(Pl,e),(e,t)=>(0,r.A)(Pl,e,t)],[wl({type:"cell.contextmenu"}),1,"cellContextMenu",e=>(0,h.A)(Kl,e),(e,t)=>(0,r.A)(Kl,e,t)],[wl({type:"cell.click"}),1,"cellClick",e=>(0,h.A)(Ul,e),(e,t)=>(0,r.A)(Ul,e,t)]],0,(e=>Xl.has((0,l.A)(e))),g.ReactNextElement)),Ss()},3971:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(6758),a=n.n(i),s=n(935),l=n.n(s)()(a());l.push([e.id,':host{display:block;--local-label-line-height:inherit;--local-label-font-size:inherit;--local-label-color:inherit;--local-label-font-weight:inherit}:host([hidden]){display:none}:host([type="line"]){--local-label-line-height:18px;--local-label-font-size:11px;--local-label-color:var(--color-secondary-text);--local-label-font-weight:400}*{box-sizing:border-box}.label{max-width:168px;margin:-3px}.label-text,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:var(--local-label-line-height);font-size:var(--local-label-font-size);color:var(--local-label-color);font-weight:var(--local-label-font-weight);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;user-select:text}.label-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.label.editing .label-text,\n.label.empty:not(.editing) .label-text,\n.label:not(.editing) .label-input{display:none}',""]);const o=l.toString()},497:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(6758),a=n.n(i),s=n(935),l=n.n(s)()(a());l.push([e.id,'*{box-sizing:border-box}:host{display:block;border:1px solid var(--palette-gray-5);cursor:default;-webkit-user-select:none;user-select:none}:host([hidden]){display:none}:host([usage="dragging"]){opacity:0.75;position:fixed}:host(:not([usage="library"])){background:var(--palette-gray-3);width:60px;height:60px}:host([usage="library"]){width:180px;height:30px;margin-bottom:10px}div{width:100%;height:100%;display:flex;align-items:center;justify-content:center}:host(:not([usage="dragging"]):not([usage="library"]):hover),\n:host([status="highlighted"]){color:var(--palette-blue-5);background:var(--palette-blue-1);border-color:1px solid var(--palette-blue-4)}:host([status="faded"]){opacity:0.3}:host([decorator="area"]){width:100px;height:60px;background:rgba(119,141,195,0.1);border:none}:host([decorator="text"]){width:auto;height:auto;background:none;border:none}',""]);const o=l.toString()},6330:(e,t,n)=>{function i(e,t,n,i,a,s,l){try{var o=e[s](l),r=o.value}catch(e){return void n(e)}o.done?t(r):Promise.resolve(r).then(i,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,s){var l=e.apply(t,n);function o(e){i(l,a,s,o,r,"next",e)}function r(e){i(l,a,s,o,r,"throw",e)}o(void 0)}))}}n.d(t,{A:()=>a})},780:(e,t,n)=>{n.d(t,{_:()=>s});var i=n(6330),a=n(3496),s=function(){var e=(0,i.A)((function*(e,t,n){return(yield a.http.post("api/gateway/cmdb.instance.CreateInstance/v2/object/".concat(e,"/instance"),t,n)).data}));return function(t,n,i){return e.apply(this,arguments)}}()},8406:(e,t,n)=>{n.d(t,{y:()=>s});var i=n(6330),a=n(3496),s=function(){var e=(0,i.A)((function*(e,t,n){return(yield a.http.post("api/gateway/cmdb.instance.PostSearchV3/v3/object/".concat(e,"/instance/_search"),t,n)).data}));return function(t,n,i){return e.apply(this,arguments)}}()},6841:(e,t,n)=>{n.d(t,{x:()=>s});var i=n(6330),a=n(3496),s=function(){var e=(0,i.A)((function*(e,t,n,i){return(yield a.http.put("api/gateway/cmdb.instance.UpdateInstanceV2/v2/object/".concat(e,"/instance/").concat(t),n,i)).data}));return function(t,n,i,a){return e.apply(this,arguments)}}()},4993:(e,t,n)=>{function i(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 a(e){this._context=e}function s(e){return new a(e)}n.d(t,{Ay:()=>s}),a.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:i(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:i(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}},4643:(e,t,n)=>{n.d(t,{dJ:()=>a,kl:()=>s});class i{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 a(e){return new i(e,!0)}function s(e){return new i(e,!1)}},482:(e,t,n)=>{function i(e){this._context=e}function a(e){return new i(e)}n.d(t,{A:()=>a}),i.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)}}}},3488:(e,t,n)=>{function i(e){return e<0?-1:1}function a(e,t,n){var a=e._x1-e._x0,s=t-e._x1,l=(e._y1-e._y0)/(a||s<0&&-0),o=(n-e._y1)/(s||a<0&&-0),r=(l*s+o*a)/(a+s);return(i(l)+i(o))*Math.min(Math.abs(l),Math.abs(o),.5*Math.abs(r))||0}function s(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function l(e,t,n){var i=e._x0,a=e._y0,s=e._x1,l=e._y1,o=(s-i)/3;e._context.bezierCurveTo(i+o,a+o*t,s-o,l-o*n,s,l)}function o(e){this._context=e}function r(e){this._context=new h(e)}function h(e){this._context=e}function c(e){return new o(e)}function d(e){return new r(e)}n.d(t,{G:()=>c,N:()=>d}),o.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:l(this,this._t0,s(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,l(this,s(this,n=a(this,e,t)),n);break;default:l(this,this._t0,n=a(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(r.prototype=Object.create(o.prototype)).point=function(e,t){o.prototype.point.call(this,t,e)},h.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,i,a,s){this._context.bezierCurveTo(t,e,i,n,s,a)}}},6066:(e,t,n)=>{function i(e){this._context=e}function a(e){var t,n,i=e.length-1,a=new Array(i),s=new Array(i),l=new Array(i);for(a[0]=0,s[0]=2,l[0]=e[0]+2*e[1],t=1;t<i-1;++t)a[t]=1,s[t]=4,l[t]=4*e[t]+2*e[t+1];for(a[i-1]=2,s[i-1]=7,l[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=a[t]/s[t-1],s[t]-=n,l[t]-=n*l[t-1];for(a[i-1]=l[i-1]/s[i-1],t=i-2;t>=0;--t)a[t]=(l[t]-a[t+1])/s[t];for(s[i-1]=(e[i]+a[i-1])/2,t=0;t<i-1;++t)s[t]=2*e[t+1]-a[t+1];return[a,s]}function s(e){return new i(e)}n.d(t,{A:()=>s}),i.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 i=a(e),s=a(t),l=0,o=1;o<n;++l,++o)this._context.bezierCurveTo(i[0][l],s[0][l],i[1][l],s[1][l],e[o],t[o]);(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)}}},3269:(e,t,n)=>{function i(e){return function(){return e}}n.d(t,{A:()=>p}),Array.prototype.slice;var a=n(482);const s=Math.PI,l=2*s,o=1e-6,r=l-o;function h(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?h:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return h;const n=10**t;return function(e){this._+=e[0];for(let t=1,i=e.length;t<i;++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,i){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,t,n,i,a,s){this._append`C${+e},${+t},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(e,t,n,i,a){if(e=+e,t=+t,n=+n,i=+i,(a=+a)<0)throw new Error(`negative radius: ${a}`);let l=this._x1,r=this._y1,h=n-e,c=i-t,d=l-e,u=r-t,p=d*d+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(p>o)if(Math.abs(u*h-c*d)>o&&a){let g=n-l,f=i-r,A=h*h+c*c,y=g*g+f*f,v=Math.sqrt(A),m=Math.sqrt(p),b=a*Math.tan((s-Math.acos((A+p-y)/(2*v*m)))/2),k=b/m,w=b/v;Math.abs(k-1)>o&&this._append`L${e+k*d},${t+k*u}`,this._append`A${a},${a},0,0,${+(u*g>d*f)},${this._x1=e+w*h},${this._y1=t+w*c}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,i,a,h){if(e=+e,t=+t,h=!!h,(n=+n)<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(i),d=n*Math.sin(i),u=e+c,p=t+d,g=1^h,f=h?i-a:a-i;null===this._x1?this._append`M${u},${p}`:(Math.abs(this._x1-u)>o||Math.abs(this._y1-p)>o)&&this._append`L${u},${p}`,n&&(f<0&&(f=f%l+l),f>r?this._append`A${n},${n},0,1,${g},${e-c},${t-d}A${n},${n},0,1,${g},${this._x1=u},${this._y1=p}`:f>o&&this._append`A${n},${n},0,${+(f>=s)},${g},${this._x1=e+n*Math.cos(a)},${this._y1=t+n*Math.sin(a)}`)}rect(e,t,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function d(e){return e[0]}function u(e){return e[1]}function p(e,t){var n=i(!0),s=null,l=a.A,o=null,r=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)}(h);function h(i){var a,h,c,d=(i=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(i)).length,u=!1;for(null==s&&(o=l(c=r())),a=0;a<=d;++a)!(a<d&&n(h=i[a],a,i))===u&&((u=!u)?o.lineStart():o.lineEnd()),u&&o.point(+e(h,a,i),+t(h,a,i));if(c)return o=null,c+""||null}return e="function"==typeof e?e:void 0===e?d:i(e),t="function"==typeof t?t:void 0===t?u:i(t),h.x=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),h):e},h.y=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),h):t},h.defined=function(e){return arguments.length?(n="function"==typeof e?e:i(!!e),h):n},h.curve=function(e){return arguments.length?(l=e,null!=s&&(o=l(s)),h):l},h.context=function(e){return arguments.length?(null==e?s=o=null:o=l(s=e),h):s},h}c.prototype}}]);
3
- //# sourceMappingURL=4937.fd9c2a63.js.map
1
+ /*! For license information please see 4937.4c3a75db.js.LICENSE.txt */
2
+ "use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[4937],{6663:(e,t,n)=>{n.r(t);var i,a=n(4635),s=n(918),l=n(6902),o=n(5536),r=n(6121),h=n(829),c=n(2740),d=n(8769),u=n.n(d),p=n(5351),g=n(3340),f=(n(9583),n(7566)),A=n(1517),y=n(3373),v=n.n(y),m=n(1030),b=n(9126),k=n(8892),w=n(5157),x=n(8308),_=n(9576),M=n(9137),E=n(2547),C=n(1803),N=n(3739),T=n(9191),W=n(6671),R=n(8060),L=n(2448),S=n(8657),$=n(8069),z=n(1324),B=n(821),D=n(9741),P=n(2673),O=n(5987);let H,I,K,Y,U,X,j,V,q,Z,F,J,G,Q,ee,te,ne,ie,ae,se,le,oe,re,he,ce,de,ue,pe,ge,fe,Ae,ye,ve,me,be,ke,we,xe,_e,Me,Ee,Ce,Ne,Te,We,Re,Le,Se,$e,ze,Be,De,Pe,Oe;const{defineElement:He,property:Ie,event:Ke,method:Ye}=(0,p.createDecorators)(),Ue=(0,d.forwardRef)(wt);let Xe;var je=new WeakMap,Ve=new WeakMap,qe=new WeakMap,Ze=new WeakMap,Fe=new WeakMap,Je=new WeakMap,Ge=new WeakMap,Qe=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,it=new WeakMap,at=new WeakMap,st=new WeakMap,lt=new WeakMap,ot=new WeakSet,rt=new WeakMap,ht=new WeakMap,ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,ft=new WeakMap,At=new WeakMap,yt=new WeakMap,vt=new WeakMap,mt=new WeakMap,bt=new WeakMap;class kt extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,ot),(0,s.A)(this,je,(H(this),K(this))),(0,s.A)(this,Ve,(Y(this),U(this))),(0,s.A)(this,qe,(X(this),j(this))),(0,s.A)(this,Ze,(V(this),q(this))),(0,s.A)(this,Fe,(Z(this),F(this))),(0,s.A)(this,Je,(J(this),G(this))),(0,s.A)(this,Ge,(Q(this),ee(this))),(0,s.A)(this,Qe,(te(this),ne(this))),(0,s.A)(this,et,(ie(this),ae(this))),(0,s.A)(this,tt,(se(this),le(this))),(0,s.A)(this,nt,(oe(this),re(this,!0))),(0,s.A)(this,it,(he(this),ce(this,!0))),(0,s.A)(this,at,(de(this),ue(this,!0))),(0,s.A)(this,st,(pe(this),ge(this))),(0,s.A)(this,lt,(fe(this),Ae(this))),(0,s.A)(this,rt,(me(this),e=>{(0,o.A)(ot,this,ye).emit(e)})),(0,s.A)(this,ht,be(this)),(0,s.A)(this,ct,(xe(this),e=>{(0,o.A)(ot,this,ke).emit(e)})),(0,s.A)(this,dt,_e(this)),(0,s.A)(this,ut,(Ce(this),e=>{(0,o.A)(ot,this,Me).emit(e)})),(0,s.A)(this,pt,Ne(this)),(0,s.A)(this,gt,(Re(this),e=>{(0,o.A)(ot,this,Te).emit(e)})),(0,s.A)(this,ft,Le(this)),(0,s.A)(this,At,(ze(this),e=>{(0,o.A)(ot,this,Se).emit(e)})),(0,s.A)(this,yt,Be(this)),(0,s.A)(this,vt,(Oe(this),e=>{(0,o.A)(ot,this,De).emit(e)})),(0,s.A)(this,mt,(e=>{(0,P.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,bt,(0,d.createRef)())}get layout(){return(0,h.A)(je,this)}set layout(e){(0,r.A)(je,this,e)}get nodes(){return(0,h.A)(Ve,this)}set nodes(e){(0,r.A)(Ve,this,e)}get edges(){return(0,h.A)(qe,this)}set edges(e){(0,r.A)(qe,this,e)}get nodeBricks(){return(0,h.A)(Ze,this)}set nodeBricks(e){(0,r.A)(Ze,this,e)}get lines(){return(0,h.A)(Fe,this)}set lines(e){(0,r.A)(Fe,this,e)}get layoutOptions(){return(0,h.A)(Je,this)}set layoutOptions(e){(0,r.A)(Je,this,e)}get activeTarget(){return(0,h.A)(Ge,this)}set activeTarget(e){(0,r.A)(Ge,this,e)}get disableKeyboardAction(){return(0,h.A)(Qe,this)}set disableKeyboardAction(e){(0,r.A)(Qe,this,e)}get connectNodes(){return(0,h.A)(et,this)}set connectNodes(e){(0,r.A)(et,this,e)}get dragNodes(){return(0,h.A)(tt,this)}set dragNodes(e){(0,r.A)(tt,this,e)}get zoomable(){return(0,h.A)(nt,this)}set zoomable(e){(0,r.A)(nt,this,e)}get scrollable(){return(0,h.A)(it,this)}set scrollable(e){(0,r.A)(it,this,e)}get pannable(){return(0,h.A)(at,this)}set pannable(e){(0,r.A)(at,this,e)}get scaleRange(){return(0,h.A)(st,this)}set scaleRange(e){(0,r.A)(st,this,e)}callOnLineLabel(e,t){for(var n,i=arguments.length,a=new Array(i>2?i-2:0),s=2;s<i;s++)a[s-2]=arguments[s];null===(n=(0,h.A)(bt,this).current)||void 0===n||n.callOnLineLabel(e,t,...a)}render(){return u().createElement(Ue,{ref:(0,h.A)(bt,this),layout:this.layout,nodes:this.nodes,edges:this.edges,nodeBricks:this.nodeBricks,lines:this.lines,layoutOptions:this.layoutOptions,connectNodes:this.connectNodes,dragNodes:this.dragNodes,activeTarget:this.activeTarget,disableKeyboardAction:this.disableKeyboardAction,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:(0,h.A)(rt,this),onSwitchActiveTarget:(0,h.A)(mt,this),onNodeDelete:(0,h.A)(ct,this),onEdgeDelete:(0,h.A)(ut,this),onLineClick:(0,h.A)(gt,this),onLineDoubleClick:(0,h.A)(At,this),onNodesConnect:(0,h.A)(vt,this)})}}function wt(e,t){let{layout:n,nodes:i,edges:a,nodeBricks:s,lines:l,layoutOptions:o,connectNodes:r,dragNodes:h,activeTarget:c,disableKeyboardAction:p,zoomable:g,scrollable:y,pannable:B,scaleRange:H,onActiveTargetChange:I,onSwitchActiveTarget:K,onNodeDelete:Y,onEdgeDelete:U,onLineClick:X,onLineDoubleClick:j,onNodesConnect:V}=e;const[q,Z]=(0,d.useState)(!1),[F,J]=(0,d.useState)(0),[G,Q]=(0,d.useState)(null),[ee,te]=(0,d.useState)(!1),[ne,ie]=(0,d.useState)(0),[ae,se]=(0,d.useState)(null),[le,oe]=(0,d.useState)([]),[re,he]=(0,d.useState)(!1),[ce,de]=(0,d.useState)({k:1,x:0,y:0}),ue=(0,d.useRef)(new Map),pe=(0,d.useRef)(null),ge=(0,d.useRef)(null),[fe,Ae]=(0,d.useState)(!1),{userViewReady:ye,userViewNodesMap:ve,saveUserView:me}=(0,D._)(null==h?void 0:h.save),[be,ke]=(0,d.useState)([0,0]),[we,xe]=(0,d.useState)(null),[_e,Me]=(0,d.useState)("initial"),[Ee,Ce]=(0,d.useState)(null);(0,d.useImperativeHandle)(t,(()=>({callOnLineLabel(e,t){for(var n,i=arguments.length,a=new Array(i>2?i-2:0),s=2;s<i;s++)a[s-2]=arguments[s];null==ae||null===(n=ae.get(e))||void 0===n||null===(n=n.firstElementChild)||void 0===n||n[t](...a)}}))),(0,d.useEffect)((()=>{const e=e=>{(0,L.P)(e,{nodes:i,nodesRefRepository:G,connectNodes:r,dragNodes:h,scale:ce.k,setConnectLineState:xe,setConnectLineTo:ke,setManualLayoutStatus:Me,setNodeMovement:Ce,onSwitchActiveTarget:K,onNodesConnect:V})},t=ge.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[i,r,h,ce.k,G,V,K]);const{normalizedLines:Ne,normalizedLinesMap:Te,markers:We}=(0,d.useMemo)((()=>(0,M.t)(a,l)),[a,l]),Re=(0,d.useMemo)((()=>Ne.flatMap((e=>{let t,n,{line:{text:i,label:a,$id:s},edge:l}=e;return i||a?(a?(t="label",n=[].concat(a)):(t="text",n=[].concat(i)),n.map((e=>({[t]:e,id:`${s}-${e.placement??"center"}`,edge:l})))):[]}))),[Ne]),{nodes:Le,edges:Se}=(0,$.o)({layout:n,nodes:i,edges:a,manualLayoutStatus:_e,userViewReady:ye,userViewNodesMap:ve,nodeMovement:Ee,nodesRefRepository:G,lineLabelsRefRepository:ae,normalizedLinesMap:Te,layoutOptions:o,nodesRenderId:F,lineLabelsRenderId:ne});(0,d.useEffect)((()=>{"finished"===_e&&me(Le.map((e=>({id:e.id,x:e.x,y:e.y}))))}),[_e]);const $e=(0,d.useMemo)((()=>(0,_.R)(Se,Le,Ne)),[Ne,Le,Se]),ze=c??null,[Be,De]=(0,d.useState)(ze);(0,d.useEffect)((()=>{De((e=>(0,P.c)(e,ze)?e:ze))}),[ze]);const Pe=(0,d.useRef)(!1);(0,d.useEffect)((()=>{Pe.current?null==I||I(Be):Pe.current=!0}),[Be,I]),(0,d.useEffect)((()=>{const e=pe.current;if(!e||p)return;const t=e=>{const t=(0,w.a)(e,{renderedNodes:Le,activeTarget:Be});"delete-node"===(null==t?void 0:t.action)?null==Y||Y(t.node):"delete-edge"===(null==t?void 0:t.action)?null==U||U(t.edge):"switch-active-node"===(null==t?void 0:t.action)&&t.node&&(null==K||K({type:"node",nodeId:t.node.id}))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[Be,Le,p,K,Y,U]);const Oe=(0,d.useCallback)((e=>{e&&(J((e=>e+1)),Q(e)),Z((t=>t||!!e))}),[]),He=(0,d.useCallback)((e=>{e&&(ie((e=>e+1)),se(e)),te((t=>t||!!e))}),[]),Ie=(0,d.useMemo)((()=>H??[S.sS,S.Yt]),[H]),Ke=(0,d.useMemo)((()=>(0,A.s_)()),[]);(0,d.useEffect)((()=>{let e=!1;Ke.scaleExtent(g?Ie:[1,1]).on("start",(()=>{e=!1,he(!0)})).on("zoom",(t=>{e=!0,de(t.transform)})).on("end",(()=>{he(!1),e||null==K||K(null)}))}),[K,Ie,g,Ke]),(0,d.useEffect)((()=>{const e=pe.current;if(!e)return;const t=(0,f.A)(e),n=()=>{t.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(g||y||B)return(g||y)&&t.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),y&&(e.preventDefault(),Ke.translateBy(t,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),t.call(Ke).on("wheel",(e=>e.preventDefault())).on("dblclick.zoom",null),B||t.on("mousedown.zoom",null).on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),n;n()}),[B,y,g,Ke]),(0,d.useEffect)((()=>{const e=pe.current;if(0===Le.length||!e||fe)return;const{k:t,x:n,y:i}=(0,x.r)(Le,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:g?Ie:void 0});Ke.transform((0,f.A)(e),new A.uV(t,n,i)),Ae(!0)}),[fe,Le,Ie,g,Ke]);const Ye=(0,d.useMemo)((()=>`${(0,m.uniqueId)("diagram-")}-`),[]),Ue=`${Ye}line-arrow-`,Xe=`${Ye}mask-`,je=`${Ye}active-line-`;(0,d.useEffect)((()=>{oe((e=>(0,R.z)(e,$e,ue.current)))}),[$e]);const[Ve,qe]=u().useState(new Map);return(0,d.useEffect)((()=>{if(!ae)return;(0,z.F)(le,ae);const e=new b.A((()=>{qe((0,O.G)(le,ae))}));for(const t of ae.values())e.observe(t);return()=>{e.disconnect()}}),[ne,ae,le]),"dagre"!==n&&"force"!==n?u().createElement("div",null,`Diagram layout not supported: "${n}"`):u().createElement("div",{className:v()("diagram",{ready:q&&fe,grabbing:re,pannable:B}),tabIndex:-1,ref:pe},u().createElement("svg",{width:"100%",height:"100%",className:"lines"},u().createElement("defs",null,We.map(((e,t)=>{let{type:n,strokeColor:i}=e;return u().createElement(N.c,{key:t,id:`${Ue}${t}`,type:n,strokeColor:i})})),[...Ve].map((e=>{let[t,n]=e;return u().createElement(T.y,{key:t,lineId:t,rects:n,maskPrefix:Xe,renderedLineLabels:le})})),u().createElement("marker",{id:`${je}start`,viewBox:"0 0 8 8",refX:4,refY:4,markerWidth:8,markerHeight:8,orient:"auto"},u().createElement("path",{d:"M 0.5 0.5 H 7.5 V 7.5 H 0.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"})),u().createElement("marker",{id:`${je}end`,viewBox:"0 0 14 8",refX:3,refY:4,markerWidth:14,markerHeight:8,orient:"auto"},u().createElement("path",{d:"M 0.5 1.5 L 5.5 4 L 0.5 6.5 z",stroke:"var(--palette-blue-3)",strokeWidth:1,fill:"var(--palette-blue-3)"}),u().createElement("path",{d:"M 6.5 0.5 H 13.5 V 7.5 H 6.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"}))),u().createElement("g",{transform:`translate(${ce.x} ${ce.y}) scale(${ce.k})`},$e.map((e=>u().createElement(C.m,{key:e.line.$id,line:e,linePaths:ue.current,lineMaskRects:Ve,maskPrefix:Xe,markerPrefix:Ue,activeLineMarkerPrefix:je,active:"edge"===(null==Be?void 0:Be.type)&&Be.edge.source===e.edge.source&&Be.edge.target===e.edge.target,activeRelated:"node"===(null==Be?void 0:Be.type)&&(e.edge.source===Be.nodeId||e.edge.target===Be.nodeId),onLineClick:X,onLineDoubleClick:j}))))),u().createElement("div",{className:v()("line-labels",{ready:ee}),style:{left:ce.x,top:ce.y,transform:`scale(${ce.k})`}},u().createElement(E.d2,{labels:Re,onRendered:He})),u().createElement("div",{className:"nodes",ref:ge,style:{left:ce.x,top:ce.y,transform:`scale(${ce.k})`}},u().createElement(k.p,{nodes:i,nodeBricks:s,onRendered:Oe})),u().createElement(W.w,{connectLineState:we,connectLineTo:be,markerPrefix:Ue}))}i=kt,({e:[K,Y,U,X,j,V,q,Z,F,J,G,Q,ee,te,ne,ie,ae,se,le,oe,re,he,ce,de,ue,pe,ge,fe,Ae,ye,ve,me,be,ke,we,xe,_e,Me,Ee,Ce,Ne,Te,We,Re,Le,Se,$e,ze,Be,De,Pe,Oe,H],c:[Xe,I]}=(0,c.A)(i,[He("eo-diagram",{styleTexts:[B.A]})],[[Ie({type:String}),1,"layout"],[Ie({attribute:!1}),1,"nodes"],[Ie({attribute:!1}),1,"edges"],[Ie({attribute:!1}),1,"nodeBricks"],[Ie({attribute:!1}),1,"lines"],[Ie({attribute:!1}),1,"layoutOptions"],[Ie({attribute:!1}),1,"activeTarget"],[Ie({type:Boolean}),1,"disableKeyboardAction"],[Ie({attribute:!1}),1,"connectNodes"],[Ie({attribute:!1}),1,"dragNodes"],[Ie({type:Boolean}),1,"zoomable"],[Ie({type:Boolean}),1,"scrollable"],[Ie({type:Boolean}),1,"pannable"],[Ie({attribute:!1}),1,"scaleRange"],[Ke({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,h.A)(lt,e),(e,t)=>(0,r.A)(lt,e,t)],[Ke({type:"node.delete"}),1,"nodeDelete",e=>(0,h.A)(ht,e),(e,t)=>(0,r.A)(ht,e,t)],[Ke({type:"edge.delete"}),1,"edgeDelete",e=>(0,h.A)(dt,e),(e,t)=>(0,r.A)(dt,e,t)],[Ke({type:"line.click"}),1,"lineClick",e=>(0,h.A)(pt,e),(e,t)=>(0,r.A)(pt,e,t)],[Ke({type:"line.dblclick"}),1,"lineDoubleClick",e=>(0,h.A)(ft,e),(e,t)=>(0,r.A)(ft,e,t)],[Ke({type:"nodes.connect"}),1,"connectNodes",e=>(0,h.A)(yt,e),(e,t)=>(0,r.A)(yt,e,t)],[Ye(),2,"callOnLineLabel"]],0,(e=>bt.has((0,l.A)(e))),g.ReactNextElement)),I();var xt,_t=n(3971);let Mt,Et,Ct,Nt,Tt,Wt,Rt,Lt,St,$t,zt,Bt,Dt,Pt;const{defineElement:Ot,property:Ht,event:It,method:Kt}=(0,p.createDecorators)(),Yt=(0,d.forwardRef)(en);let Ut;var Xt=new WeakMap,jt=new WeakMap,Vt=new WeakMap,qt=new WeakSet,Zt=new WeakMap,Ft=new WeakMap,Jt=new WeakMap,Gt=new WeakMap;class Qt extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,qt),(0,s.A)(this,Xt,(Mt(this),Ct(this))),(0,s.A)(this,jt,(Nt(this),Tt(this))),(0,s.A)(this,Vt,(Wt(this),Rt(this))),(0,s.A)(this,Zt,($t(this),e=>{(0,o.A)(qt,this,Lt).emit(e)})),(0,s.A)(this,Ft,zt(this)),(0,s.A)(this,Jt,(Pt(this),e=>{(0,o.A)(qt,this,Bt).emit(e)})),(0,s.A)(this,Gt,(0,d.createRef)())}get label(){return(0,h.A)(Xt,this)}set label(e){(0,r.A)(Xt,this,e)}get type(){return(0,h.A)(jt,this)}set type(e){(0,r.A)(jt,this,e)}enableEditing(){var e;null===(e=(0,h.A)(Gt,this).current)||void 0===e||e.enableEditing()}render(){return u().createElement(Yt,{ref:(0,h.A)(Gt,this),label:this.label,onLabelEditingChange:(0,h.A)(Zt,this),onLabelChange:(0,h.A)(Jt,this)})}}function en(e,t){let{label:n,onLabelChange:i,onLabelEditingChange:a}=e;const s=n??"",[l,o]=(0,d.useState)(s),[r,h]=(0,d.useState)(!1),c=(0,d.useRef)(!1),[p,g]=(0,d.useState)(!1),f=(0,d.useRef)(null);(0,d.useImperativeHandle)(t,(()=>({enableEditing(){h(!0)}}))),(0,d.useEffect)((()=>{o(s)}),[s]);const A=(0,d.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),h(!0)}),[]);(0,d.useEffect)((()=>{var e,t;r&&(null===(e=f.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=f.current)||void 0===t||t.select())}),[r]),(0,d.useEffect)((()=>{c.current?null==a||a(r):c.current=!0}),[r,a]);const y=(0,d.useCallback)((e=>{o(e.target.value)}),[]),m=(0,d.useCallback)((e=>{const t=e.key||e.keyCode||e.which;var n;"Enter"!==t&&13!==t||null===(n=f.current)||void 0===n||n.blur()}),[]),b=(0,d.useCallback)((()=>{h(!1),g(!0)}),[]);(0,d.useEffect)((()=>{p&&(null==i||i(l),g(!1))}),[l,i,p]);const k=(0,d.useCallback)((e=>{e.stopPropagation()}),[]);return u().createElement("div",{className:v()("label",{editing:r,empty:!l}),onDoubleClick:k,onMouseDown:k},u().createElement("input",{className:"label-input",value:l,ref:f,onChange:y,onKeyDown:m,onBlur:b}),u().createElement("div",{className:"label-text",onDoubleClick:A},l))}xt=Qt,({e:[Ct,Nt,Tt,Wt,Rt,Lt,St,$t,zt,Bt,Dt,Pt,Mt],c:[Ut,Et]}=(0,c.A)(xt,[Ot("diagram.editable-label",{styleTexts:[_t.A]})],[[Ht(),1,"label"],[Ht({render:!1}),1,"type"],[It({type:"label.editing.change"}),1,"labelEditingChange",e=>(0,h.A)(Vt,e),(e,t)=>(0,r.A)(Vt,e,t)],[It({type:"label.change"}),1,"labelChange",e=>(0,h.A)(Ft,e),(e,t)=>(0,r.A)(Ft,e,t)],[Kt(),2,"enableEditing"]],0,(e=>Gt.has((0,l.A)(e))),g.ReactNextElement)),Et();var tn=n(2559),nn=n(8706),an=n(5748),sn=n(531),ln=n(8185),on=n(4197),rn=n(908);function hn(e){let{connectLineState:t,transform:n,markerEnd:i,onConnect:a}=e;const[s,l]=(0,d.useState)(null);return(0,d.useEffect)((()=>{t&&l(t.from)}),[t]),(0,d.useEffect)((()=>{if(t){const e=e=>{l([(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},i=e=>{e.stopPropagation()},s=e=>{e.stopPropagation(),o(),a(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",i,{capture:!0}),document.removeEventListener("click",s,{capture:!0}),l(null)};return document.addEventListener("mousemove",e),document.addEventListener("mousedown",i,{capture:!0}),document.addEventListener("click",s,{capture:!0}),o}}),[t,a,n]),u().createElement("path",{className:v()("connect-line",{connecting:!!t&&s&&(s[0]-t.from[0])**2+(s[1]-t.from[1])**2>25}),d:t&&s?`M${t.from.join(" ")}L${s.join(" ")}`:"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:`url(#${i})`})}var cn=n(3783),dn=n(2098),un=n(227),pn=n(3033),gn=n(8091),fn=n(1819),An=n(7099),yn=n(1484),vn=n(8197),mn=n(7531);var bn,kn=n(3012),wn=n(6237),xn=n(9386);let _n,Mn,En,Cn,Nn,Tn,Wn,Rn,Ln,Sn,$n,zn,Bn,Dn,Pn,On,Hn,In,Kn,Yn,Un,Xn,jn,Vn,qn,Zn,Fn,Jn,Gn,Qn,ei,ti,ni,ii,ai,si,li,oi,ri,hi,ci,di,ui,pi,gi,fi,Ai,yi,vi,mi,bi,ki,wi,xi,_i,Mi,Ei,Ci,Ni,Ti,Wi,Ri,Li,Si,$i,zi,Bi,Di,Pi,Oi,Hi,Ii,Ki,Yi,Ui,Xi,ji,Vi,qi,Zi,Fi,Ji;const Gi=(0,nn.unwrapProvider)("basic.lock-body-scroll"),{defineElement:Qi,property:ea,method:ta,event:na}=(0,p.createDecorators)(),ia=u().forwardRef(qa);let aa;var sa=new WeakMap,la=new WeakMap,oa=new WeakMap,ra=new WeakMap,ha=new WeakMap,ca=new WeakMap,da=new WeakMap,ua=new WeakMap,pa=new WeakMap,ga=new WeakMap,fa=new WeakMap,Aa=new WeakMap,ya=new WeakMap,va=new WeakMap,ma=new WeakMap,ba=new WeakMap,ka=new WeakMap,wa=new WeakMap,xa=new WeakMap,_a=new WeakSet,Ma=new WeakMap,Ea=new WeakMap,Ca=new WeakMap,Na=new WeakMap,Ta=new WeakMap,Wa=new WeakMap,Ra=new WeakMap,La=new WeakMap,Sa=new WeakMap,$a=new WeakMap,za=new WeakMap,Ba=new WeakMap,Da=new WeakMap,Pa=new WeakMap,Oa=new WeakMap,Ha=new WeakMap,Ia=new WeakMap,Ka=new WeakMap,Ya=new WeakMap,Ua=new WeakMap,Xa=new WeakMap;class ja extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,_a),(0,s.A)(this,sa,(_n(this),En(this))),(0,s.A)(this,la,(Cn(this),Nn(this))),(0,s.A)(this,oa,(Tn(this),Wn(this))),(0,s.A)(this,ra,(Rn(this),Ln(this,[pn.HP,pn.HP]))),(0,s.A)(this,ha,(Sn(this),$n(this))),(0,s.A)(this,ca,(zn(this),Bn(this))),(0,s.A)(this,da,(Dn(this),Pn(this))),(0,s.A)(this,ua,(On(this),Hn(this))),(0,s.A)(this,pa,(In(this),Kn(this))),(0,s.A)(this,ga,(Yn(this),Un(this))),(0,s.A)(this,fa,(Xn(this),jn(this,!0))),(0,s.A)(this,Aa,(Vn(this),qn(this,!0))),(0,s.A)(this,ya,(Zn(this),Fn(this,!0))),(0,s.A)(this,va,(Jn(this),Gn(this,!0))),(0,s.A)(this,ma,(Qn(this),ei(this,!1))),(0,s.A)(this,ba,(ti(this),ni(this))),(0,s.A)(this,ka,(ii(this),ai(this))),(0,s.A)(this,wa,(si(this),li(this))),(0,s.A)(this,xa,(oi(this),ri(this))),(0,s.A)(this,Ma,(di(this),e=>{(0,o.A)(_a,this,hi).emit(e)})),(0,s.A)(this,Ea,(e=>{(0,ln.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,Ca,ui(this)),(0,s.A)(this,Na,(fi(this),Ai(this))),(0,s.A)(this,Ta,(mi(this),e=>{(0,o.A)(_a,this,yi).emit(e),"node"===e.type&&(0,o.A)(_a,this,pi).emit(e)})),(0,s.A)(this,Wa,bi(this)),(0,s.A)(this,Ra,(xi(this),e=>{(0,o.A)(_a,this,ki).emit(e)})),(0,s.A)(this,La,_i(this)),(0,s.A)(this,Sa,(Ci(this),e=>{(0,o.A)(_a,this,Mi).emit(e)})),(0,s.A)(this,$a,Ni(this)),(0,s.A)(this,za,(Ri(this),Li(this))),(0,s.A)(this,Ba,(zi(this),e=>{(0,o.A)(_a,this,Si).emit(e),"node"===e.type&&(0,o.A)(_a,this,Ti).emit(e)})),(0,s.A)(this,Da,Bi(this)),(0,s.A)(this,Pa,(Oi(this),e=>{(0,o.A)(_a,this,Di).emit(e)})),(0,s.A)(this,Oa,Hi(this)),(0,s.A)(this,Ha,(Yi(this),e=>{(0,o.A)(_a,this,Ii).emit(e)})),(0,s.A)(this,Ia,Ui(this)),(0,s.A)(this,Ka,(Vi(this),e=>{(0,o.A)(_a,this,Xi).emit(e)})),(0,s.A)(this,Ya,qi(this)),(0,s.A)(this,Ua,(Ji(this),e=>{(0,o.A)(_a,this,Zi).emit(e)})),(0,s.A)(this,Xa,(0,d.createRef)())}get cells(){return(0,h.A)(sa,this)}set cells(e){(0,r.A)(sa,this,e)}get layout(){return(0,h.A)(la,this)}set layout(e){(0,r.A)(la,this,e)}get layoutOptions(){return(0,h.A)(oa,this)}set layoutOptions(e){(0,r.A)(oa,this,e)}get defaultNodeSize(){return(0,h.A)(ra,this)}set defaultNodeSize(e){(0,r.A)(ra,this,e)}get defaultNodeBricks(){return(0,h.A)(ha,this)}set defaultNodeBricks(e){(0,r.A)(ha,this,e)}get degradedThreshold(){return(0,h.A)(ca,this)}set degradedThreshold(e){(0,r.A)(ca,this,e)}get degradedNodeLabel(){return(0,h.A)(da,this)}set degradedNodeLabel(e){(0,r.A)(da,this,e)}get defaultEdgeLines(){return(0,h.A)(ua,this)}set defaultEdgeLines(e){(0,r.A)(ua,this,e)}get activeTarget(){return(0,h.A)(pa,this)}set activeTarget(e){(0,r.A)(pa,this,e)}get fadeUnrelatedCells(){return(0,h.A)(ga,this)}set fadeUnrelatedCells(e){(0,r.A)(ga,this,e)}get zoomable(){return(0,h.A)(fa,this)}set zoomable(e){(0,r.A)(fa,this,e)}get scrollable(){return(0,h.A)(Aa,this)}set scrollable(e){(0,r.A)(Aa,this,e)}get pannable(){return(0,h.A)(ya,this)}set pannable(e){(0,r.A)(ya,this,e)}get selectable(){return(0,h.A)(va,this)}set selectable(e){(0,r.A)(va,this,e)}get allowEdgeToArea(){return(0,h.A)(ma,this)}set allowEdgeToArea(e){(0,r.A)(ma,this,e)}get dragBehavior(){return(0,h.A)(ba,this)}set dragBehavior(e){(0,r.A)(ba,this,e)}get ctrlDragBehavior(){return(0,h.A)(ka,this)}set ctrlDragBehavior(e){(0,r.A)(ka,this,e)}get scaleRange(){return(0,h.A)(wa,this)}set scaleRange(e){(0,r.A)(wa,this,e)}async dropNode(e){var t,n;let{id:i,position:a,size:s,data:l,useBrick:o}=e;if(null===(t=(n=document).elementsFromPoint)||void 0===t||null===(t=t.call(n,a[0],a[1]))||void 0===t?void 0:t.includes(this)){var r;const e=this.getBoundingClientRect(),t=(0,h.A)(Xa,this).current.getTransform(),n={type:"node",id:i,view:{..."force"===this.layout||"dagre"===this.layout?null:{x:(a[0]-e.left-t.x)/t.k,y:(a[1]-e.top-t.y)/t.k},width:(null==s?void 0:s[0])??this.defaultNodeSize[0],height:(null==s?void 0:s[1])??this.defaultNodeSize[0]},data:l,useBrick:o};return null===(r=(0,h.A)(Xa,this).current)||void 0===r||r.dropNode(n),n}return null}async dropDecorator(e){var t,n;let{position:i,decorator:a,text:s}=e;if(null===(t=(n=document).elementsFromPoint)||void 0===t||null===(t=t.call(n,i[0],i[1]))||void 0===t?void 0:t.includes(this)){var l;const e=this.getBoundingClientRect(),t=(0,h.A)(Xa,this).current.getTransform(),n={type:"decorator",decorator:a,id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),view:{x:(i[0]-e.left-t.x)/t.k,y:(i[1]-e.top-t.y)/t.k,width:pn.N8,height:pn.w1,text:s}};return null===(l=(0,h.A)(Xa,this).current)||void 0===l||l.dropDecorator(n),n}return null}async addNodes(e){if(0===e.length)return[];const t=e.map((e=>{let{size:t,useBrick:n,id:i,data:a}=e;return{type:"node",id:i,data:a,view:{width:(null==t?void 0:t[0])??this.defaultNodeSize[0],height:(null==t?void 0:t[1])??this.defaultNodeSize[0]},useBrick:n}}));return(0,h.A)(Xa,this).current.addNodes(t,{defaultNodeSize:this.defaultNodeSize,canvasWidth:this.clientWidth,canvasHeight:this.clientHeight})}async addEdge(e){var t;let{source:n,target:i,data:a}=e;const s={type:"edge",source:n,target:i,data:a};return null===(t=(0,h.A)(Xa,this).current)||void 0===t||t.addEdge(s),s}manuallyConnectNodes(e){return(0,h.A)(Xa,this).current.manuallyConnectNodes(e)}async updateCells(e,t){await(0,tn.A)(_a,this,Va).call(this);const{updated:n}=(0,h.A)(Xa,this).current.updateCells(e,{...t,defaultNodeSize:this.defaultNodeSize,canvasWidth:this.clientWidth,canvasHeight:this.clientHeight});return{updated:n}}disconnectedCallback(){super.disconnectedCallback(),Gi(this,!1)}render(){return u().createElement(ia,{host:this,ref:(0,h.A)(Xa,this),layout:this.layout,layoutOptions:this.layoutOptions,cells:this.cells,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,dragBehavior:this.dragBehavior,ctrlDragBehavior:this.ctrlDragBehavior,scaleRange:this.scaleRange,allowEdgeToArea:this.allowEdgeToArea,onActiveTargetChange:(0,h.A)(Ma,this),onSwitchActiveTarget:(0,h.A)(Ea,this),onCellMove:(0,h.A)(Ta,this),onCellsMove:(0,h.A)(Ra,this),onCellResize:(0,h.A)(Sa,this),onCellDelete:(0,h.A)(Ba,this),onCellsDelete:(0,h.A)(Pa,this),onCellContextMenu:(0,h.A)(Ha,this),onDecoratorTextChange:(0,h.A)(Ka,this),onScaleChange:(0,h.A)(Ua,this)})}}function Va(){return new Promise((e=>{const t=()=>{(0,h.A)(Xa,this).current?e():setTimeout(t,10)};t()}))}function qa(e,t){let{host:n,layout:i,layoutOptions:a,cells:s,defaultNodeSize:l,defaultNodeBricks:o,defaultEdgeLines:r,degradedThreshold:h,degradedNodeLabel:c,activeTarget:p,fadeUnrelatedCells:g,zoomable:A,scrollable:y,pannable:b,dragBehavior:k,ctrlDragBehavior:w,scaleRange:x,allowEdgeToArea:_,onActiveTargetChange:M,onSwitchActiveTarget:E,onCellMove:C,onCellResize:T,onCellDelete:W,onCellsMove:R,onCellsDelete:L,onCellContextMenu:S,onDecoratorTextChange:$,onScaleChange:z}=e;const[{cells:B,layoutKey:D},P]=(0,d.useReducer)(an.d,s,(e=>({cells:(0,cn.C)(e,{defaultNodeSize:l}),layoutKey:0}))),O=(0,d.useMemo)((()=>B.filter(sn.N).length>=(h??pn.pC)),[B,h]),H=(0,d.useRef)(null),I=(0,d.useRef)(null),K=(0,d.useRef)(null),[Y,U]=(0,d.useState)([]),{grabbing:X,transform:j,zoomer:V,scaleRange:q}=(0,gn.f)({rootRef:H,zoomable:A,scrollable:y,pannable:b,draggable:"grab"===k,ctrlDraggable:"grab"===w,scaleRange:x,onSwitchActiveTarget:E});(0,d.useEffect)((()=>{z(j.k)}),[z,j.k]);const[Z,F]=(0,d.useState)(null),[J,G]=(0,d.useState)(null),{centered:Q,setCentered:ee,getNextLayoutKey:te}=(0,yn.g)({layout:i,layoutOptions:a,rootRef:H,cells:B,zoomable:A,zoomer:V,scaleRange:q,layoutKey:D,allowEdgeToArea:_,dispatch:P});(0,d.useImperativeHandle)(t,(()=>({dropNode(e){"dagre"!==i&&"force"!==i&&ee(!0),P({type:"drop-node",payload:e})},dropDecorator(e){"dagre"!==i&&"force"!==i&&ee(!0),P({type:"drop-decorator",payload:e})},addNodes(e,t){let{defaultNodeSize:n,canvasWidth:a,canvasHeight:s}=t;const l=B.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1,o=[...B.slice(0,l),...e,...B.slice(l)],{cells:r,updated:h,shouldReCenter:c}=(0,dn.L)({cells:o,layout:i,previousCells:B,defaultNodeSize:n,canvasWidth:a,canvasHeight:s,scaleRange:q,transform:j,allowEdgeToArea:_});return c&&ee(!1),P({type:"update-cells",payload:r}),h.filter((t=>e.includes(t)))},addEdge(e){P({type:"add-edge",payload:e})},updateCells(e,t){const{shouldReCenter:n,...a}=(0,dn.L)({...t,layout:i,previousCells:B,cells:e,scaleRange:q,transform:j,allowEdgeToArea:_});return n&&ee(!1),P({type:"update-cells",payload:a.cells}),a},getTransform:()=>j,manuallyConnectNodes(e){const t=B.find((t=>(_&&(0,sn.o6)(t)||(0,sn.N)(t))&&t.id===e));if(t){const e=H.current.getBoundingClientRect();return G({source:t,from:[t.view.x+t.view.width/2,t.view.y+t.view.height/2],offset:[e.left,e.top]}),new Promise(((e,t)=>{K.current={resolve:e,reject:t}}))}return Promise.reject(null)}})),[B,i,q,ee,j,_]);const ne=(0,d.useCallback)(((e,t)=>{var n;for(let n=B.length-1;n>=0;n--){const a=B[n];if((_&&(0,sn.o6)(a)||(0,sn.N)(a))&&a.id!==e.source.id&&a.view.x<t[0]&&a.view.x+a.view.width>t[0]&&a.view.y<t[1]&&a.view.y+a.view.height>t[1]){var i;null===(i=K.current)||void 0===i||i.resolve({source:e.source,target:a});break}}null===(n=K.current)||void 0===n||n.reject(null),G(null)}),[B]);(0,d.useEffect)((()=>{Gi(n,!(!J&&!Z))}),[J,n,Z]);const ie=(0,fn.J)({cellsRef:I,activeTarget:p,onActiveTargetChange:M}),[ae,se]=(0,d.useState)([]);(0,d.useEffect)((()=>{const e=g?(0,un.Y)(B,J,ie,_):[];se((t=>0===t.length&&0===e.length?t:e))}),[ie,B,J,g,_]),(0,d.useEffect)((()=>{const e=H.current;if(!e||Y.length>0)return;const t=e=>{const t=function(e,t){let{cells:n,activeTarget:i}=t;const a=n.filter((e=>(0,on.Q)(e,i)));if(0!==a.length)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cells",cells:a}}}(e,{cells:B,activeTarget:ie});"delete-cells"===(null==t?void 0:t.action)&&(L(t.cells),1===t.cells.length&&W(t.cells[0]))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[ie,B,Y.length,W,L]);const le=`${(0,d.useMemo)((()=>`${(0,m.uniqueId)("diagram-")}-`),[])}line-arrow-`,oe=(0,d.useCallback)((e=>{P({type:"move-cells",payload:e})}),[]),re=(0,d.useCallback)((e=>{P({type:"move-cells",payload:e}),R(e),1===e.length&&C(e[0])}),[C,R]),he=(0,d.useCallback)((e=>{P({type:"resize-cell",payload:e})}),[]),ce=(0,d.useCallback)((e=>{P({type:"resize-cell",payload:e}),T(e)}),[T]),de=(0,d.useCallback)((e=>{let{id:t,editing:n}=e;U(n?e=>e.includes(t)?e:[...e,t]:e=>e.filter((e=>e!==t)))}),[]),ue=(0,d.useCallback)(((e,t)=>{const n=te();P({type:"update-node-size",payload:{id:e,size:t},layoutKey:n})}),[te]),pe=(0,d.useCallback)((e=>{V.scaleTo((0,f.A)(H.current),e/100)}),[V]),ge=(0,d.useCallback)((()=>{ee(!1)}),[ee]),[fe,Ae]=(0,mn.d)({cells:B,defaultEdgeLines:r,markerPrefix:le}),ye=(0,vn.H)({cells:B,layout:i,centered:Q});return(0,d.useEffect)((()=>{const e=H.current;if(!e||"lasso"!==k)return;const t=e.getBoundingClientRect(),n=e=>{!function(e,t){let{transform:n,offset:i,onLassoing:a,onLassoed:s}=t;if(e.ctrlKey||e.button)return;e.stopPropagation();const l=[e.clientX,e.clientY],o=(e.clientX-i[0]-n.x)/n.k,r=(e.clientY-i[1]-n.y)/n.k;let h=!1;const c=(e,t)=>{const i=function(e){return[(e.clientX-l[0])/n.k,(e.clientY-l[1])/n.k]}(e);if(h||(h=i[0]**2+i[1]**2>=9),h){let[e,n]=i,l=o,h=r;e<0&&(l=o+e,e=-e),n<0&&(h=r+n,n=-n),(t?s:a)({x:l,y:h,width:e,height:n})}},d=e=>{c(e)},u=e=>{c(e,!0),h=!1,document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",u)}(e,{transform:j,offset:[t.left,t.top],onLassoing(e){F(e)},onLassoed(e){F(null);const t=[];for(const n of B)if((0,sn.o6)(n)){const i=n.view.x,a=n.view.y;i>=e.x&&i+n.view.width<=e.x+e.width&&a>=e.y&&a+n.view.height<=e.y+e.height&&t.push(n)}null==E||E(t.length>1?{type:"multi",targets:t.map(xn.P)}:1===t.length?(0,xn.P)(t[0]):null)}})};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}}),[j,B,k,E]),u().createElement(u().Fragment,null,u().createElement("svg",{width:"100%",height:"100%",ref:H,className:v()("root",{grabbing:X,pannable:b,ready:ye}),tabIndex:-1},u().createElement("defs",null,Ae.map(((e,t)=>u().createElement(N.c,{key:t,id:`${le}${t}`,type:"arrow",strokeColor:e.strokeColor})))),u().createElement("g",{transform:`translate(${j.x} ${j.y}) scale(${j.k})`},u().createElement("g",{className:v()("cells",{allowEdgeToArea:_}),ref:I},B.map((e=>u().createElement(rn.m,{key:`${e.type}:${"edge"===e.type?`${e.source}~${e.target}`:e.id}`,layout:i,cell:e,cells:B,degraded:O,degradedNodeLabel:c,defaultNodeBricks:o,transform:j,lineConfMap:fe,activeTarget:ie,unrelatedCells:ae,onCellsMoving:oe,onCellsMoved:re,onCellResizing:he,onCellResized:ce,onSwitchActiveTarget:E,onCellContextMenu:S,onDecoratorTextChange:$,onDecoratorTextEditing:de,onNodeBrickResize:ue})))),u().createElement(hn,{connectLineState:J,transform:j,markerEnd:`${le}0`,onConnect:ne}),Z&&u().createElement("rect",{x:Z.x,y:Z.y,width:Z.width,height:Z.height,fill:"var(--palette-gray-5)",fillOpacity:.3,stroke:"var(--palette-gray-5)",strokeDasharray:2}))),u().createElement(An.Y,{shadowRoot:n.shadowRoot,scale:j.k,scaleRange:q,onZoomChange:pe,onReCenter:ge}))}bn=ja,({e:[En,Cn,Nn,Tn,Wn,Rn,Ln,Sn,$n,zn,Bn,Dn,Pn,On,Hn,In,Kn,Yn,Un,Xn,jn,Vn,qn,Zn,Fn,Jn,Gn,Qn,ei,ti,ni,ii,ai,si,li,oi,ri,hi,ci,di,ui,pi,gi,fi,Ai,yi,vi,mi,bi,ki,wi,xi,_i,Mi,Ei,Ci,Ni,Ti,Wi,Ri,Li,Si,$i,zi,Bi,Di,Pi,Oi,Hi,Ii,Ki,Yi,Ui,Xi,ji,Vi,qi,Zi,Fi,Ji,_n],c:[aa,Mn]}=(0,c.A)(bn,[Qi("eo-draw-canvas",{styleTexts:[kn.A,wn.A]})],[[ea({attribute:!1}),1,"cells"],[ea({type:String}),1,"layout"],[ea({attribute:!1}),1,"layoutOptions"],[ea({attribute:!1}),1,"defaultNodeSize"],[ea({attribute:!1}),1,"defaultNodeBricks"],[ea({type:Number}),1,"degradedThreshold"],[ea({attribute:!1}),1,"degradedNodeLabel"],[ea({attribute:!1}),1,"defaultEdgeLines"],[ea({attribute:!1}),1,"activeTarget"],[ea({type:Boolean}),1,"fadeUnrelatedCells"],[ea({type:Boolean}),1,"zoomable"],[ea({type:Boolean}),1,"scrollable"],[ea({type:Boolean}),1,"pannable"],[ea({type:Boolean}),1,"selectable"],[ea({type:Boolean}),1,"allowEdgeToArea"],[ea(),1,"dragBehavior"],[ea(),1,"ctrlDragBehavior"],[ea({attribute:!1}),1,"scaleRange"],[na({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,h.A)(xa,e),(e,t)=>(0,r.A)(xa,e,t)],[na({type:"node.move"}),1,"nodeMoveEvent",e=>(0,h.A)(Ca,e),(e,t)=>(0,r.A)(Ca,e,t)],[na({type:"cell.move"}),1,"cellMoveEvent",e=>(0,h.A)(Na,e),(e,t)=>(0,r.A)(Na,e,t)],[na({type:"cells.move"}),1,"cellsMoveEvent",e=>(0,h.A)(Wa,e),(e,t)=>(0,r.A)(Wa,e,t)],[na({type:"cell.resize"}),1,"cellResizeEvent",e=>(0,h.A)(La,e),(e,t)=>(0,r.A)(La,e,t)],[na({type:"node.delete"}),1,"nodeDelete",e=>(0,h.A)($a,e),(e,t)=>(0,r.A)($a,e,t)],[na({type:"cell.delete"}),1,"cellDelete",e=>(0,h.A)(za,e),(e,t)=>(0,r.A)(za,e,t)],[na({type:"cells.delete"}),1,"cellsDelete",e=>(0,h.A)(Da,e),(e,t)=>(0,r.A)(Da,e,t)],[na({type:"cell.contextmenu"}),1,"cellContextMenu",e=>(0,h.A)(Oa,e),(e,t)=>(0,r.A)(Oa,e,t)],[na({type:"decorator.text.change"}),1,"decoratorTextChange",e=>(0,h.A)(Ia,e),(e,t)=>(0,r.A)(Ia,e,t)],[na({type:"scale.change"}),1,"scaleChange",e=>(0,h.A)(Ya,e),(e,t)=>(0,r.A)(Ya,e,t)],[ta(),2,"dropNode"],[ta(),2,"dropDecorator"],[ta(),2,"addNodes"],[ta(),2,"addEdge"],[ta(),2,"manuallyConnectNodes"],[ta(),2,"updateCells"]],0,(e=>Xa.has((0,l.A)(e))),g.ReactNextElement)),Mn();var Za,Fa=n(497);let Ja,Ga,Qa,es,ts,ns,is,as,ss,ls,os,rs,hs,cs,ds,us,ps,gs,fs;const{defineElement:As,property:ys,event:vs}=(0,p.createDecorators)();let ms;var bs,ks=new WeakMap,ws=new WeakMap,xs=new WeakMap,_s=new WeakMap,Ms=new WeakSet,Es=new WeakMap,Cs=new WeakMap,Ns=new WeakMap,Ts=new WeakMap,Ws=new WeakMap;class Rs extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ms),(0,s.A)(this,ks,Ga(this)),(0,s.A)(this,ws,(Qa(this),es(this))),(0,s.A)(this,xs,(ts(this),ns(this))),(0,s.A)(this,_s,(is(this),as(this))),(0,s.A)(this,Es,(os(this),e=>{(0,o.A)(Ms,this,ss).emit(e)})),(0,s.A)(this,Cs,rs(this)),(0,s.A)(this,Ns,(ds(this),e=>{(0,o.A)(Ms,this,hs).emit(e)})),(0,s.A)(this,Ts,us(this)),(0,s.A)(this,Ws,(fs(this),e=>{(0,o.A)(Ms,this,ps).emit(e)}))}get usage(){return(0,h.A)(ks,this)}set usage(e){(0,r.A)(ks,this,e)}get status(){return(0,h.A)(ws,this)}set status(e){(0,r.A)(ws,this,e)}get decorator(){return(0,h.A)(xs,this)}set decorator(e){(0,r.A)(xs,this,e)}render(){return u().createElement(Ls,{usage:this.usage,onDragStart:(0,h.A)(Es,this),onDragMove:(0,h.A)(Ns,this),onDragEnd:(0,h.A)(Ws,this)})}}function Ls(e){let{usage:t,onDragStart:n,onDragMove:i,onDragEnd:a}=e;const s=(0,d.useCallback)((e=>{if("library"!==t)return;e.stopPropagation(),e.preventDefault();const s=[e.clientX,e.clientY];let l=!1;const o=e=>{l||(l=(e.clientX-s[0])**2+(e.clientY-s[1])**2>=9,l&&(null==n||n([e.clientX,e.clientY]))),l&&(null==i||i([e.clientX,e.clientY]))},r=e=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),l&&(null==a||a([e.clientX,e.clientY]))};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}),[a,i,n,t]);return u().createElement("div",{onMouseDown:s},u().createElement("slot",null))}let Ss,$s,zs,Bs,Ds,Ps,Os,Hs,Is,Ks,Ys,Us,Xs,js,Vs,qs,Zs,Fs,Js,Gs,Qs,el,tl,nl,il,al,sl,ll,ol,rl,hl,cl,dl,ul,pl,gl,fl,Al,yl,vl,ml;Za=Rs,({e:[Ga,Qa,es,ts,ns,is,as,ss,ls,os,rs,hs,cs,ds,us,ps,gs,fs],c:[ms,Ja]}=(0,c.A)(Za,[As("diagram.experimental-node",{styleTexts:[Fa.A]})],[[ys(),1,"usage"],[ys({type:String,render:!1}),1,"status"],[ys({type:String}),1,"decorator"],[vs({type:"drag.start"}),1,"dragStartEvent",e=>(0,h.A)(_s,e),(e,t)=>(0,r.A)(_s,e,t)],[vs({type:"drag.move"}),1,"dragMoveEvent",e=>(0,h.A)(Cs,e),(e,t)=>(0,r.A)(Cs,e,t)],[vs({type:"drag.end"}),1,"dragEndEvent",e=>(0,h.A)(Ts,e),(e,t)=>(0,r.A)(Ts,e,t)]],0,(e=>Ws.has((0,l.A)(e))),g.ReactNextElement)),Ja();const{defineElement:bl,property:kl,event:wl}=(0,p.createDecorators)();let xl;var _l=new WeakMap,Ml=new WeakMap,El=new WeakMap,Cl=new WeakMap,Nl=new WeakMap,Tl=new WeakMap,Wl=new WeakMap,Rl=new WeakMap,Ll=new WeakMap,Sl=new WeakMap,$l=new WeakMap,zl=new WeakMap,Bl=new WeakMap,Dl=new WeakMap,Pl=new WeakMap,Ol=new WeakSet,Hl=new WeakMap,Il=new WeakMap,Kl=new WeakMap,Yl=new WeakMap,Ul=new WeakMap,Xl=new WeakMap;class jl extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ol),(0,s.A)(this,_l,$s(this)),(0,s.A)(this,Ml,(zs(this),Bs(this))),(0,s.A)(this,El,(Ds(this),Ps(this))),(0,s.A)(this,Cl,(Os(this),Hs(this,[pn.HP,pn.HP]))),(0,s.A)(this,Nl,(Is(this),Ks(this))),(0,s.A)(this,Tl,(Ys(this),Us(this))),(0,s.A)(this,Wl,(Xs(this),js(this))),(0,s.A)(this,Rl,(Vs(this),qs(this))),(0,s.A)(this,Ll,(Zs(this),Fs(this))),(0,s.A)(this,Sl,(Js(this),Gs(this))),(0,s.A)(this,$l,(Qs(this),el(this,!0))),(0,s.A)(this,zl,(tl(this),nl(this,!0))),(0,s.A)(this,Bl,(il(this),al(this,!0))),(0,s.A)(this,Dl,(sl(this),ll(this))),(0,s.A)(this,Pl,(ol(this),rl(this))),(0,s.A)(this,Hl,(dl(this),e=>{(0,o.A)(Ol,this,hl).emit(e)})),(0,s.A)(this,Il,(e=>{(0,ln.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,Kl,ul(this)),(0,s.A)(this,Yl,(fl(this),e=>{(0,o.A)(Ol,this,pl).emit(e)})),(0,s.A)(this,Ul,Al(this)),(0,s.A)(this,Xl,(ml(this),e=>{(0,o.A)(Ol,this,yl).emit(e)}))}get cells(){return(0,h.A)(_l,this)}set cells(e){(0,r.A)(_l,this,e)}get layout(){return(0,h.A)(Ml,this)}set layout(e){(0,r.A)(Ml,this,e)}get layoutOptions(){return(0,h.A)(El,this)}set layoutOptions(e){(0,r.A)(El,this,e)}get defaultNodeSize(){return(0,h.A)(Cl,this)}set defaultNodeSize(e){(0,r.A)(Cl,this,e)}get defaultNodeBricks(){return(0,h.A)(Nl,this)}set defaultNodeBricks(e){(0,r.A)(Nl,this,e)}get degradedThreshold(){return(0,h.A)(Tl,this)}set degradedThreshold(e){(0,r.A)(Tl,this,e)}get degradedNodeLabel(){return(0,h.A)(Wl,this)}set degradedNodeLabel(e){(0,r.A)(Wl,this,e)}get defaultEdgeLines(){return(0,h.A)(Rl,this)}set defaultEdgeLines(e){(0,r.A)(Rl,this,e)}get activeTarget(){return(0,h.A)(Ll,this)}set activeTarget(e){(0,r.A)(Ll,this,e)}get fadeUnrelatedCells(){return(0,h.A)(Sl,this)}set fadeUnrelatedCells(e){(0,r.A)(Sl,this,e)}get zoomable(){return(0,h.A)($l,this)}set zoomable(e){(0,r.A)($l,this,e)}get scrollable(){return(0,h.A)(zl,this)}set scrollable(e){(0,r.A)(zl,this,e)}get pannable(){return(0,h.A)(Bl,this)}set pannable(e){(0,r.A)(Bl,this,e)}get scaleRange(){return(0,h.A)(Dl,this)}set scaleRange(e){(0,r.A)(Dl,this,e)}render(){return u().createElement(Vl,{shadowRoot:this.shadowRoot,cells:this.cells,layout:this.layout,layoutOptions:this.layoutOptions,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:(0,h.A)(Hl,this),onSwitchActiveTarget:(0,h.A)(Il,this),onCellContextMenu:(0,h.A)(Yl,this),onCellClick:(0,h.A)(Xl,this)})}}function Vl(e){let{shadowRoot:t,cells:n,layout:i,layoutOptions:a,defaultNodeSize:s,defaultNodeBricks:l,defaultEdgeLines:o,degradedThreshold:r,degradedNodeLabel:h,activeTarget:c,fadeUnrelatedCells:p,zoomable:g,scrollable:A,pannable:y,scaleRange:b,onActiveTargetChange:k,onSwitchActiveTarget:w,onCellContextMenu:x,onCellClick:_}=e;const[{cells:M,layoutKey:E},C]=(0,d.useReducer)(an.d,n,(e=>({cells:(0,cn.C)(e,{defaultNodeSize:s}),layoutKey:1}))),T=(0,d.useMemo)((()=>M.filter(sn.N).length>=(r??pn.pC)),[M,r]),W=(0,d.useRef)(null),R=(0,d.useRef)(null),{grabbing:L,transform:S,zoomer:$,scaleRange:z}=(0,gn.f)({rootRef:W,zoomable:g,scrollable:A,pannable:y,draggable:!0,scaleRange:b,onSwitchActiveTarget:w}),{centered:B,setCentered:D,getNextLayoutKey:P}=(0,yn.g)({layout:i,layoutOptions:a,rootRef:W,cells:M,zoomable:g,zoomer:$,scaleRange:z,layoutKey:E,dispatch:C}),O=(0,d.useCallback)((()=>{D(!1)}),[D]),H=(0,d.useRef)(n);(0,d.useEffect)((()=>{if(n!==H.current){H.current=n;const e=(0,dn.L)({canvasWidth:t.host.clientWidth,canvasHeight:t.host.clientHeight,defaultNodeSize:s,layout:i,previousCells:M,cells:n,scaleRange:z,transform:S});C({type:"update-cells",payload:e.cells})}}),[M,s,n,i,z,t,S]);const I=(0,fn.J)({cellsRef:R,activeTarget:c,onActiveTargetChange:k}),K=`${(0,d.useMemo)((()=>`${(0,m.uniqueId)("diagram-")}-`),[])}line-arrow-`,Y=(0,d.useCallback)(((e,t)=>{C({type:"update-node-size",payload:{id:e,size:t},layoutKey:P()})}),[P]),[U,X]=(0,d.useState)(null),j=(0,d.useCallback)((e=>{X(e)}),[]),V=(0,d.useCallback)((e=>{X((t=>t===e?null:t))}),[]),[q,Z]=(0,d.useState)([]);(0,d.useEffect)((()=>{const e=p?(0,un.Y)(M,null,U):[];Z((t=>0===t.length&&0===e.length?t:e))}),[M,p,U]);const F=(0,d.useCallback)((e=>{$.scaleTo((0,f.A)(W.current),e/100)}),[$]),[J,G]=(0,mn.d)({cells:M,defaultEdgeLines:o,markerPrefix:K}),Q=(0,vn.H)({cells:M,layout:i,centered:B});return u().createElement(u().Fragment,null,u().createElement("svg",{width:"100%",height:"100%",ref:W,className:v()("root",{grabbing:L,pannable:y,ready:Q}),tabIndex:-1},u().createElement("defs",null,G.map(((e,t)=>u().createElement(N.c,{key:t,id:`${K}${t}`,type:"arrow",strokeColor:e.strokeColor})))),u().createElement("g",{transform:`translate(${S.x} ${S.y}) scale(${S.k})`},u().createElement("g",{className:"cells",ref:R},M.map((e=>u().createElement(rn.m,{key:`${e.type}:${(0,sn.WW)(e)?`${e.source}~${e.target}`:e.id}`,layout:void 0,cell:e,cells:M,degraded:T,degradedNodeLabel:h,defaultNodeBricks:l,lineConfMap:J,transform:S,activeTarget:I,readOnly:!0,unrelatedCells:q,onSwitchActiveTarget:w,onCellContextMenu:x,onCellClick:_,onNodeBrickResize:Y,onCellMouseEnter:p&&(0,sn.N)(e)?j:void 0,onCellMouseLeave:p&&(0,sn.N)(e)?V:void 0})))))),u().createElement(An.Y,{shadowRoot:t,scale:S.k,scaleRange:z,onZoomChange:F,onReCenter:O}))}bs=jl,({e:[$s,zs,Bs,Ds,Ps,Os,Hs,Is,Ks,Ys,Us,Xs,js,Vs,qs,Zs,Fs,Js,Gs,Qs,el,tl,nl,il,al,sl,ll,ol,rl,hl,cl,dl,ul,pl,gl,fl,Al,yl,vl,ml],c:[xl,Ss]}=(0,c.A)(bs,[bl("eo-display-canvas",{styleTexts:[kn.A,wn.A]})],[[kl({attribute:!1}),1,"cells"],[kl({type:String}),1,"layout"],[kl({attribute:!1}),1,"layoutOptions"],[kl({attribute:!1}),1,"defaultNodeSize"],[kl({attribute:!1}),1,"defaultNodeBricks"],[kl({type:Number}),1,"degradedThreshold"],[kl({attribute:!1}),1,"degradedNodeLabel"],[kl({attribute:!1}),1,"defaultEdgeLines"],[kl({attribute:!1}),1,"activeTarget"],[kl({type:Boolean}),1,"fadeUnrelatedCells"],[kl({type:Boolean}),1,"zoomable"],[kl({type:Boolean}),1,"scrollable"],[kl({type:Boolean}),1,"pannable"],[kl({attribute:!1}),1,"scaleRange"],[wl({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,h.A)(Pl,e),(e,t)=>(0,r.A)(Pl,e,t)],[wl({type:"cell.contextmenu"}),1,"cellContextMenu",e=>(0,h.A)(Kl,e),(e,t)=>(0,r.A)(Kl,e,t)],[wl({type:"cell.click"}),1,"cellClick",e=>(0,h.A)(Ul,e),(e,t)=>(0,r.A)(Ul,e,t)]],0,(e=>Xl.has((0,l.A)(e))),g.ReactNextElement)),Ss()},3971:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(6758),a=n.n(i),s=n(935),l=n.n(s)()(a());l.push([e.id,':host{display:block;--local-label-line-height:inherit;--local-label-font-size:inherit;--local-label-color:inherit;--local-label-font-weight:inherit}:host([hidden]){display:none}:host([type="line"]){--local-label-line-height:18px;--local-label-font-size:11px;--local-label-color:var(--color-secondary-text);--local-label-font-weight:400}*{box-sizing:border-box}.label{max-width:168px;margin:-3px}.label-text,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:var(--local-label-line-height);font-size:var(--local-label-font-size);color:var(--local-label-color);font-weight:var(--local-label-font-weight);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;user-select:text}.label-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.label.editing .label-text,\n.label.empty:not(.editing) .label-text,\n.label:not(.editing) .label-input{display:none}',""]);const o=l.toString()},497:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(6758),a=n.n(i),s=n(935),l=n.n(s)()(a());l.push([e.id,'*{box-sizing:border-box}:host{display:block;border:1px solid var(--palette-gray-5);cursor:default;-webkit-user-select:none;user-select:none}:host([hidden]){display:none}:host([usage="dragging"]){opacity:0.75;position:fixed}:host(:not([usage="library"])){background:var(--palette-gray-3);width:60px;height:60px}:host([usage="library"]){width:180px;height:30px;margin-bottom:10px}div{width:100%;height:100%;display:flex;align-items:center;justify-content:center}:host(:not([usage="dragging"]):not([usage="library"]):hover),\n:host([status="highlighted"]){color:var(--palette-blue-5);background:var(--palette-blue-1);border-color:1px solid var(--palette-blue-4)}:host([status="faded"]){opacity:0.3}:host([decorator="area"]){width:100px;height:60px;background:rgba(119,141,195,0.1);border:none}:host([decorator="text"]){width:auto;height:auto;background:none;border:none}',""]);const o=l.toString()},6330:(e,t,n)=>{function i(e,t,n,i,a,s,l){try{var o=e[s](l),r=o.value}catch(e){return void n(e)}o.done?t(r):Promise.resolve(r).then(i,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,s){var l=e.apply(t,n);function o(e){i(l,a,s,o,r,"next",e)}function r(e){i(l,a,s,o,r,"throw",e)}o(void 0)}))}}n.d(t,{A:()=>a})},780:(e,t,n)=>{n.d(t,{_:()=>s});var i=n(6330),a=n(3496),s=function(){var e=(0,i.A)((function*(e,t,n){return(yield a.http.post("api/gateway/cmdb.instance.CreateInstance/v2/object/".concat(e,"/instance"),t,n)).data}));return function(t,n,i){return e.apply(this,arguments)}}()},8406:(e,t,n)=>{n.d(t,{y:()=>s});var i=n(6330),a=n(3496),s=function(){var e=(0,i.A)((function*(e,t,n){return(yield a.http.post("api/gateway/cmdb.instance.PostSearchV3/v3/object/".concat(e,"/instance/_search"),t,n)).data}));return function(t,n,i){return e.apply(this,arguments)}}()},6841:(e,t,n)=>{n.d(t,{x:()=>s});var i=n(6330),a=n(3496),s=function(){var e=(0,i.A)((function*(e,t,n,i){return(yield a.http.put("api/gateway/cmdb.instance.UpdateInstanceV2/v2/object/".concat(e,"/instance/").concat(t),n,i)).data}));return function(t,n,i,a){return e.apply(this,arguments)}}()},4993:(e,t,n)=>{function i(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 a(e){this._context=e}function s(e){return new a(e)}n.d(t,{Ay:()=>s}),a.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:i(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:i(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}},4643:(e,t,n)=>{n.d(t,{dJ:()=>a,kl:()=>s});class i{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 a(e){return new i(e,!0)}function s(e){return new i(e,!1)}},482:(e,t,n)=>{function i(e){this._context=e}function a(e){return new i(e)}n.d(t,{A:()=>a}),i.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)}}}},3488:(e,t,n)=>{function i(e){return e<0?-1:1}function a(e,t,n){var a=e._x1-e._x0,s=t-e._x1,l=(e._y1-e._y0)/(a||s<0&&-0),o=(n-e._y1)/(s||a<0&&-0),r=(l*s+o*a)/(a+s);return(i(l)+i(o))*Math.min(Math.abs(l),Math.abs(o),.5*Math.abs(r))||0}function s(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function l(e,t,n){var i=e._x0,a=e._y0,s=e._x1,l=e._y1,o=(s-i)/3;e._context.bezierCurveTo(i+o,a+o*t,s-o,l-o*n,s,l)}function o(e){this._context=e}function r(e){this._context=new h(e)}function h(e){this._context=e}function c(e){return new o(e)}function d(e){return new r(e)}n.d(t,{G:()=>c,N:()=>d}),o.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:l(this,this._t0,s(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,l(this,s(this,n=a(this,e,t)),n);break;default:l(this,this._t0,n=a(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(r.prototype=Object.create(o.prototype)).point=function(e,t){o.prototype.point.call(this,t,e)},h.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,i,a,s){this._context.bezierCurveTo(t,e,i,n,s,a)}}},6066:(e,t,n)=>{function i(e){this._context=e}function a(e){var t,n,i=e.length-1,a=new Array(i),s=new Array(i),l=new Array(i);for(a[0]=0,s[0]=2,l[0]=e[0]+2*e[1],t=1;t<i-1;++t)a[t]=1,s[t]=4,l[t]=4*e[t]+2*e[t+1];for(a[i-1]=2,s[i-1]=7,l[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=a[t]/s[t-1],s[t]-=n,l[t]-=n*l[t-1];for(a[i-1]=l[i-1]/s[i-1],t=i-2;t>=0;--t)a[t]=(l[t]-a[t+1])/s[t];for(s[i-1]=(e[i]+a[i-1])/2,t=0;t<i-1;++t)s[t]=2*e[t+1]-a[t+1];return[a,s]}function s(e){return new i(e)}n.d(t,{A:()=>s}),i.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 i=a(e),s=a(t),l=0,o=1;o<n;++l,++o)this._context.bezierCurveTo(i[0][l],s[0][l],i[1][l],s[1][l],e[o],t[o]);(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)}}},3269:(e,t,n)=>{function i(e){return function(){return e}}n.d(t,{A:()=>p}),Array.prototype.slice;var a=n(482);const s=Math.PI,l=2*s,o=1e-6,r=l-o;function h(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?h:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return h;const n=10**t;return function(e){this._+=e[0];for(let t=1,i=e.length;t<i;++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,i){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,t,n,i,a,s){this._append`C${+e},${+t},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(e,t,n,i,a){if(e=+e,t=+t,n=+n,i=+i,(a=+a)<0)throw new Error(`negative radius: ${a}`);let l=this._x1,r=this._y1,h=n-e,c=i-t,d=l-e,u=r-t,p=d*d+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(p>o)if(Math.abs(u*h-c*d)>o&&a){let g=n-l,f=i-r,A=h*h+c*c,y=g*g+f*f,v=Math.sqrt(A),m=Math.sqrt(p),b=a*Math.tan((s-Math.acos((A+p-y)/(2*v*m)))/2),k=b/m,w=b/v;Math.abs(k-1)>o&&this._append`L${e+k*d},${t+k*u}`,this._append`A${a},${a},0,0,${+(u*g>d*f)},${this._x1=e+w*h},${this._y1=t+w*c}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,i,a,h){if(e=+e,t=+t,h=!!h,(n=+n)<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(i),d=n*Math.sin(i),u=e+c,p=t+d,g=1^h,f=h?i-a:a-i;null===this._x1?this._append`M${u},${p}`:(Math.abs(this._x1-u)>o||Math.abs(this._y1-p)>o)&&this._append`L${u},${p}`,n&&(f<0&&(f=f%l+l),f>r?this._append`A${n},${n},0,1,${g},${e-c},${t-d}A${n},${n},0,1,${g},${this._x1=u},${this._y1=p}`:f>o&&this._append`A${n},${n},0,${+(f>=s)},${g},${this._x1=e+n*Math.cos(a)},${this._y1=t+n*Math.sin(a)}`)}rect(e,t,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function d(e){return e[0]}function u(e){return e[1]}function p(e,t){var n=i(!0),s=null,l=a.A,o=null,r=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)}(h);function h(i){var a,h,c,d=(i=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(i)).length,u=!1;for(null==s&&(o=l(c=r())),a=0;a<=d;++a)!(a<d&&n(h=i[a],a,i))===u&&((u=!u)?o.lineStart():o.lineEnd()),u&&o.point(+e(h,a,i),+t(h,a,i));if(c)return o=null,c+""||null}return e="function"==typeof e?e:void 0===e?d:i(e),t="function"==typeof t?t:void 0===t?u:i(t),h.x=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),h):e},h.y=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),h):t},h.defined=function(e){return arguments.length?(n="function"==typeof e?e:i(!!e),h):n},h.curve=function(e){return arguments.length?(l=e,null!=s&&(o=l(s)),h):l},h.context=function(e){return arguments.length?(null==e?s=o=null:o=l(s=e),h):s},h}c.prototype}}]);
3
+ //# sourceMappingURL=4937.4c3a75db.js.map