iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 29.6 kB
JavaScript
export const __rspack_esm_id=40965;export const __rspack_esm_ids=[40965];export const __webpack_modules__={77957(e,t,a){var i=a(76080),o=a(79504),n=a(47055),r=a(48981),s=a(56969),l=a(26198),u=a(2360),c=a(35370),d=Array,p=o([].push);e.exports=function(e,t,a,o){for(var g,y,h,f=r(e),v=n(f),m=i(t,a),_=u(null),S=l(v),b=0;S>b;b++)h=v[b],(y=s(m(h,b,f)))in _?p(_[y],h):_[y]=[h];if(o&&(g=o(f))!==d)for(y in _)_[y]=c(g,_[y]);return _}},46058(e,t,a){var i=a(46518),o=a(77957),n=a(6469);i({target:"Array",proto:!0},{group:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n("group")},52164(e,t,a){a.r(t),a.d(t,{install:()=>Oe});var i=a(6471),o=(a(44114),a(62826)),n=a(56145),r=a(52577),s=a(99904),l=a(54202),u=a(4088),c=a(5990),d=a(16890),p=a(62876),g="--\x3e",y=function(e){return e.get("autoCurveness")||null},h=function(e,t){var a=y(e),i=20,o=[];if(r.isNumber(a))i=a;else if(r.isArray(a))return void(e.__curvenessList=a);t>i&&(i=t);var n=i%2?i+2:i+3;o=[];for(var s=0;s<n;s++)o.push((s%2?s+1:s)/10*(s%2?-1:1));e.__curvenessList=o},f=function(e,t,a){var i=[e.id,e.dataIndex].join("."),o=[t.id,t.dataIndex].join(".");return[a.uid,i,o].join(g)},v=function(e){var t=e.split(g);return[t[0],t[2],t[1]].join(g)},m=function(e,t){var a=t.__edgeMap;return a[e]?a[e].length:0};function _(e,t,a,i){var o=y(t),n=r.isArray(o);if(!o)return null;var s=function(e,t){var a=f(e.node1,e.node2,t);return t.__edgeMap[a]}(e,t);if(!s)return null;for(var l=-1,u=0;u<s.length;u++)if(s[u]===a){l=u;break}var c=function(e,t){return m(f(e.node1,e.node2,t),t)+m(f(e.node2,e.node1,t),t)}(e,t);h(t,c),e.lineStyle=e.lineStyle||{};var d=f(e.node1,e.node2,t),p=t.__curvenessList,g=n||c%2?0:1;if(s.isForward)return p[g+l];var _=v(d),S=m(_,t),b=p[l+S+g];return i?n?o&&0===o[0]?(S+g)%2?b:-b:((S%2?0:1)+g)%2?b:-b:(S+g)%2?b:-b:p[l+S+g]}var S=a(16418),b=a(66834),L="graph",x=function(e){function t(){var a=null!==e&&e.apply(this,arguments)||this;return a.type=t.type,a.hasSymbolVisual=!0,a}return(0,o.C6)(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments);var a=this;function i(){return a._categoriesData}this.legendVisualProvider=new u.A(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(t){e.prototype.mergeDefaultAndTheme.apply(this,arguments),(0,i.M5)(t,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,t){var a,i=e.edges||e.links||[],o=e.data||e.nodes||[],n=this;if(o&&i){y(a=this)&&(a.__curvenessList=[],a.__edgeMap={},h(a));var u=(0,l.A)(o,i,this,!0,function(e,t){e.wrapMethod("getItemModel",function(e){var t=n._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e});var a=s.A.prototype.getModel;function i(e,t){var i=a.call(this,e,t);return i.resolveParentPath=o,i}function o(e){if(e&&("label"===e[0]||"label"===e[1])){var t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}t.wrapMethod("getItemModel",function(e){return e.resolveParentPath=o,e.getModel=i,e})});return r.each(u.edges,function(e){!function(e,t,a,i){if(y(a)){var o=f(e,t,a),n=a.__edgeMap,r=n[v(o)];n[o]&&!r?n[o].isForward=!0:r&&n[o]&&(r.isForward=!0,n[o].isForward=!1),n[o]=n[o]||[],n[o].push(i)}}(e.node1,e.node2,this,e.dataIndex)},this),u.data}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,t,a){if("edge"===a){var i=this.getData(),o=this.getDataParams(e,a),n=i.graph.getEdgeByIndex(e),r=i.getName(n.node1.dataIndex),s=i.getName(n.node2.dataIndex),l=[];return null!=r&&l.push(r),null!=s&&l.push(s),(0,d.Qx)("nameValue",{name:l.join(" > "),value:o.value,noValue:null==o.value})}return(0,p.J)({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=r.map(this.option.categories||[],function(e){return null!=e.value?e:r.extend({value:0},e)}),t=new n.A(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray(function(e){return t.getItemModel(e)})},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},t.prototype.__ownRoamView=function(){var e=this.coordinateSystem;return(0,b.yD)(e)&&e},t.type="series."+L,t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:S.A.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:S.A.color.primary}}},t}(c.A);const I=x;function A(e){return e instanceof Array||(e=[e,e]),e}var w=(0,i.O9)(L,function(e){e.eachSeriesByType(L,function(e){var t=e.getGraph(),a=e.getEdgeData(),i=A(e.get("edgeSymbol")),o=A(e.get("edgeSymbolSize"));a.setVisual("fromSymbol",i&&i[0]),a.setVisual("toSymbol",i&&i[1]),a.setVisual("fromSymbolSize",o&&o[0]),a.setVisual("toSymbolSize",o&&o[1]),a.setVisual("style",e.getModel("lineStyle").getLineStyle()),a.each(function(e){var i=a.getItemModel(e),o=t.getEdgeByIndex(e),n=A(i.getShallow("symbol",!0)),s=A(i.getShallow("symbolSize",!0)),l=i.getModel("lineStyle").getLineStyle(),u=a.ensureUniqueItemVisual(e,"style");switch((0,r.extend)(u,l),u.stroke){case"source":var c=o.node1.getVisual("style");u.stroke=c&&c.fill;break;case"target":c=o.node2.getVisual("style");u.stroke=c&&c.fill}n[0]&&o.setVisual("fromSymbol",n[0]),n[1]&&o.setVisual("toSymbol",n[1]),s[0]&&o.setVisual("fromSymbolSize",s[0]),s[1]&&o.setVisual("toSymbolSize",s[1])})})});var N=a(81658);function M(e){var t=e.coordinateSystem;if(!t||"view"===t.type){var a=e.getGraph();a.eachNode(function(e){var t=e.getModel();e.setLayout([+t.get("x"),+t.get("y")])}),D(a,e)}}function D(e,t){e.eachEdge(function(e,a){var i=r.retrieve3(e.getModel().get(["lineStyle","curveness"]),-_(e,t,a,!0),0),o=N.clone(e.node1.getLayout()),n=N.clone(e.node2.getLayout()),s=[o,n];+i&&s.push([(o[0]+n[0])/2-(o[1]-n[1])*i,(o[1]+n[1])/2-(n[0]-o[0])*i]),e.setLayout(s)})}var V=(0,i.O9)(L,function(e,t){e.eachSeriesByType(L,function(e){var t=e.get("layout"),a=e.coordinateSystem;if(a&&"view"!==a.type){var i=e.getData(),o=[];(0,r.each)(a.dimensions,function(e){o=o.concat(i.mapDimensionsAll(e))});for(var n=0;n<i.count();n++){for(var s=[],l=!1,u=0;u<o.length;u++){var c=i.get(o[u],n);isNaN(c)||(l=!0),s.push(c)}l?i.setItemLayout(n,a.dataToPoint(s)):i.setItemLayout(n,[NaN,NaN])}D(i.graph,e)}else t&&"none"!==t||M(e)})});function T(e){var t=e.coordinateSystem;return(0,b.yD)(t)?(0,b.YP)(t,e):1}function E(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var C=Math.PI,P=[];function k(e,t,a,i){var o=e.coordinateSystem;if(!o||"view"===o.type){var n=o.getBoundingRect(),s=e.getData(),l=s.graph,u=n.width/2+n.x,c=n.height/2+n.y,d=Math.min(n.width,n.height)/2,p=s.count();if(s.setLayout({cx:u,cy:c}),p){if(a){var g=o.pointToData(i),y=g[0],h=g[1],f=[y-u,h-c];N.normalize(f,f),N.scale(f,f,d),a.setLayout([u+f[0],c+f[1]],!0),z(a,e.get(["circular","rotateLabel"]),u,c)}O[t](e,l,s,d,u,c,p),l.eachEdge(function(t,a){var i,o=r.retrieve3(t.getModel().get(["lineStyle","curveness"]),_(t,e,a),0),n=N.clone(t.node1.getLayout()),s=N.clone(t.node2.getLayout()),l=(n[0]+s[0])/2,d=(n[1]+s[1])/2;+o&&(i=[u*(o*=3)+l*(1-o),c*o+d*(1-o)]),t.setLayout([n,s,i])})}}}var O={value:function(e,t,a,i,o,n,r){var s=0,l=a.getSum("value"),u=2*Math.PI/(l||r);t.eachNode(function(e){var t=e.getValue("value"),a=u*(l?t:1)/2;s+=a,e.setLayout([i*Math.cos(s)+o,i*Math.sin(s)+n]),s+=a})},symbolSize:function(e,t,a,i,o,n,r){var s=0;P.length=r;var l=T(e);t.eachNode(function(e){var t=E(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=l;var a=Math.asin(t/2/i);isNaN(a)&&(a=C/2),P[e.dataIndex]=a,s+=2*a});var u=(2*C-s)/r/2,c=0;t.eachNode(function(e){var t=u+P[e.dataIndex];c+=t,(!e.getLayout()||!e.getLayout().fixed)&&e.setLayout([i*Math.cos(c)+o,i*Math.sin(c)+n]),c+=t})}};function z(e,t,a,i){var o=e.getGraphicEl();if(o){var n=e.getModel().get(["label","rotate"])||0,s=o.getSymbolPath();if(t){var l=e.getLayout(),u=Math.atan2(l[1]-i,l[0]-a);u<0&&(u=2*Math.PI+u);var c=l[0]<a;c&&(u-=Math.PI);var d=c?"left":"right";s.setTextConfig({rotation:-u,position:d,origin:"center"});var p=s.ensureState("emphasis");r.extend(p.textConfig||(p.textConfig={}),{position:d})}else s.setTextConfig({rotation:n*=Math.PI/180})}}var R=(0,i.O9)(L,function(e){e.eachSeriesByType("graph",function(e){"circular"===e.get("layout")&&k(e,"symbolSize")})});var B=N.scaleAndAdd;var G=a(88877),F=(0,i.O9)(L,function(e){e.eachSeriesByType(L,function(e){var t=e.coordinateSystem;if(!t||"view"===t.type)if("force"===e.get("layout")){var a=e.preservedPoints||{},i=e.getGraph(),o=i.data,n=i.edgeData,s=e.getModel("force"),l=s.get("initLayout");e.preservedPoints?o.each(function(e){var t=o.getId(e);o.setItemLayout(e,a[t]||[NaN,NaN])}):l&&"none"!==l?"circular"===l&&k(e,"value"):M(e);var u=o.getDataExtent("value"),c=n.getDataExtent("value"),d=s.get("repulsion"),p=s.get("edgeLength"),g=r.isArray(d)?d:[d,d],y=r.isArray(p)?p:[p,p];y=[y[1],y[0]];var h=o.mapArray("value",function(e,t){var a=o.getItemLayout(t),i=(0,G.Cb)(e,u,g);return isNaN(i)&&(i=(g[0]+g[1])/2),{w:i,rep:i,fixed:o.getItemModel(t).get("fixed"),p:!a||isNaN(a[0])||isNaN(a[1])?null:a}}),f=n.mapArray("value",function(t,a){var o=i.getEdgeByIndex(a),n=(0,G.Cb)(t,c,y);isNaN(n)&&(n=(y[0]+y[1])/2);var s=o.getModel(),l=r.retrieve3(o.getModel().get(["lineStyle","curveness"]),-_(o,e,a,!0),0);return{n1:h[o.node1.dataIndex],n2:h[o.node2.dataIndex],d:n,curveness:l,ignoreForceLayout:s.get("ignoreForceLayout")}}),v=t.getBoundingRect(),m=function(e,t,a){for(var i=e,o=t,n=a.rect,r=n.width,s=n.height,l=[n.x+r/2,n.y+s/2],u=null==a.gravity?.1:a.gravity,c=0;c<i.length;c++){var d=i[c];d.p||(d.p=N.create(r*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),d.pp=N.clone(d.p),d.edges=null}var p,g,y=null==a.friction?.6:a.friction,h=y;return{warmUp:function(){h=.8*y},setFixed:function(e){i[e].fixed=!0},setUnfixed:function(e){i[e].fixed=!1},beforeStep:function(e){p=e},afterStep:function(e){g=e},step:function(e){p&&p(i,o);for(var t=[],a=i.length,n=0;n<o.length;n++){var r=o[n];if(!r.ignoreForceLayout){var s=r.n1,c=r.n2;N.sub(t,c.p,s.p);var d=N.len(t)-r.d,y=c.w/(s.w+c.w);isNaN(y)&&(y=0),N.normalize(t,t),!s.fixed&&B(s.p,s.p,t,y*d*h),!c.fixed&&B(c.p,c.p,t,-(1-y)*d*h)}}for(n=0;n<a;n++)(_=i[n]).fixed||(N.sub(t,l,_.p),B(_.p,_.p,t,u*h));for(n=0;n<a;n++){s=i[n];for(var f=n+1;f<a;f++){c=i[f],N.sub(t,c.p,s.p),0===(d=N.len(t))&&(N.set(t,Math.random()-.5,Math.random()-.5),d=1);var v=(s.rep+c.rep)/d/d;!s.fixed&&B(s.pp,s.pp,t,v),!c.fixed&&B(c.pp,c.pp,t,-v)}}var m=[];for(n=0;n<a;n++){var _;(_=i[n]).fixed||(N.sub(m,_.p,_.pp),B(_.p,_.p,m,h),N.copy(_.pp,_.p))}var S=(h*=.992)<.01;g&&g(i,o,S),e&&e(S)}}}(h,f,{rect:v,gravity:s.get("gravity"),friction:s.get("friction")});m.beforeStep(function(e,t){for(var a=0,o=e.length;a<o;a++)e[a].fixed&&N.copy(e[a].p,i.getNodeByIndex(a).getLayout())}),m.afterStep(function(e,t,n){for(var r=0,s=e.length;r<s;r++)e[r].fixed||i.getNodeByIndex(r).setLayout(e[r].p),a[o.getId(r)]=e[r].p;for(r=0,s=t.length;r<s;r++){var l=t[r],u=i.getEdgeByIndex(r),c=l.n1.p,d=l.n2.p,p=u.getLayout();(p=p?p.slice():[])[0]=p[0]||[],p[1]=p[1]||[],N.copy(p[0],c),N.copy(p[1],d),+l.curveness&&(p[2]=[(c[0]+d[0])/2-(c[1]-d[1])*l.curveness,(c[1]+d[1])/2-(d[0]-c[0])*l.curveness]),u.setLayout(p)}}),e.forceLayout=m,e.preservedPoints=a,m.step()}else e.forceLayout=null})});var j=a(83354),U=a(51474),Y=a(71034),X=a(42605);function W(e,t){var a=[];return e.eachSeriesByType("graph",function(e){(0,Y.m7)({targetModel:e,coordSysType:"view",coordSysProvider:function(){var i=e.getData(),o=i.mapArray(function(e){var t=i.getItemModel(e);return[+t.get("x"),+t.get("y")]}),n=[],s=[];U.Cr(o,n,s),s[0]-n[0]===0&&(s[0]+=1,n[0]-=1);s[1]-n[1]===0&&(s[1]+=1,n[1]-=1);var l=(s[0]-n[0])/(s[1]-n[1]),u=function(e,t,a){var i=(0,j.Lj)(e,t),o=(0,r.extend)(e.getBoxLayoutParams(),{aspect:a}),n=(0,j.dV)(o,i.refContainer);return(0,j.FJ)(e,n,a)}(e,t,l);isNaN(l)&&(n=[u.x,u.y],s=[u.x+u.width,u.y+u.height]);var c=s[0]-n[0],d=s[1]-n[1],p=(0,X.ao)(e,t,n[0],n[1],c,d,u);return a.push(p),p},isDefaultDataCoordSys:!0})}),a}a(46058);var q=a(59689),H=a(22785),K=a(26322),Z=a(41144),J=a(46700),Q=a(61618),$=a(79231),ee=J.A.prototype,te=Q.A.prototype,ae=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}(0,o.C6)(t,e)}(ae);function ie(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}const oe=function(e){function t(t){var a=e.call(this,t)||this;return a.type="ec-line",a}return(0,o.C6)(t,e),t.prototype.getDefaultStyle=function(){return{stroke:S.A.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new ae},t.prototype.buildPath=function(e,t){ie(t)?ee.buildPath.call(this,e,t):te.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return ie(this.shape)?ee.pointAt.call(this,e):te.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,a=ie(t)?[t.x2-t.x1,t.y2-t.y1]:te.tangentAt.call(this,e);return N.normalize(a,a)},t}($.Ay);var ne=a(52557),re=a(9078),se=a(79825),le=["fromSymbol","toSymbol"];function ue(e){return"_"+e+"Type"}function ce(e,t,a){var i=t.getItemVisual(a,e);if(!i||"none"===i)return i;var o=t.getItemVisual(a,e+"Size"),n=t.getItemVisual(a,e+"Rotate"),r=t.getItemVisual(a,e+"Offset"),s=t.getItemVisual(a,e+"KeepAspect"),l=Z.xU(o);return i+l+Z.hV(r||0,l)+(n||"")+(s||"")}function de(e,t,a){var i=t.getItemVisual(a,e);if(i&&"none"!==i){var o=t.getItemVisual(a,e+"Size"),n=t.getItemVisual(a,e+"Rotate"),r=t.getItemVisual(a,e+"Offset"),s=t.getItemVisual(a,e+"KeepAspect"),l=Z.xU(o),u=Z.hV(r||0,l),c=Z.v5(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=null==n||isNaN(n)?void 0:+n*Math.PI/180||0,c.name=e,c}}function pe(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var a=t[2];a?(e.cpx1=a[0],e.cpy1=a[1]):(e.cpx1=NaN,e.cpy1=NaN)}const ge=function(e){function t(t,a,i){var o=e.call(this)||this;return o._createLine(t,a,i),o}return(0,o.C6)(t,e),t.prototype._createLine=function(e,t,a){var i=e.hostModel,o=e.getItemLayout(t),n=e.getItemVisual(t,"z2"),s=function(e){var t=new oe({name:"line",subPixelOptimize:!0});return pe(t.shape,e),t}(o);s.shape.percent=0,ne.LW(s,{z2:(0,r.retrieve2)(n,0),shape:{percent:1}},i,t),this.add(s),(0,r.each)(le,function(a){var i=de(a,e,t);this.add(i),this[ue(a)]=ce(a,e,t)},this),this._updateCommonStl(e,t,a)},t.prototype.updateData=function(e,t,a){var i=e.hostModel,o=this.childOfName("line"),n=e.getItemLayout(t),s={shape:{}};pe(s.shape,n),ne.oi(o,s,i,t),(0,r.each)(le,function(a){var i=ce(a,e,t),o=ue(a);if(this[o]!==i){this.remove(this.childOfName(a));var n=de(a,e,t);this.add(n)}this[o]=i},this),this._updateCommonStl(e,t,a)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,a){var i=e.hostModel,o=this.childOfName("line"),n=a&&a.emphasisLineStyle,s=a&&a.blurLineStyle,l=a&&a.selectLineStyle,u=a&&a.labelStatesModels,c=a&&a.emphasisDisabled,d=a&&a.focus,p=a&&a.blurScope;if(!a||e.hasItemOption){var g=e.getItemModel(t),y=g.getModel("emphasis");n=y.getModel("lineStyle").getLineStyle(),s=g.getModel(["blur","lineStyle"]).getLineStyle(),l=g.getModel(["select","lineStyle"]).getLineStyle(),c=y.get("disabled"),d=y.get("focus"),p=y.get("blurScope"),u=(0,se.lx)(g)}var h=e.getItemVisual(t,"style"),f=h.stroke;o.useStyle(h),o.style.fill=null,o.style.strokeNoScale=!0,o.ensureState("emphasis").style=n,o.ensureState("blur").style=s,o.ensureState("select").style=l,(0,r.each)(le,function(e){var t=this.childOfName(e);if(t){t.setColor(f),t.style.opacity=h.opacity;for(var a=0;a<re.BV.length;a++){var i=re.BV[a],n=o.getState(i);if(n){var r=n.style||{},s=t.ensureState(i),l=s.style||(s.style={});null!=r.stroke&&(l[t.__isEmptyBrush?"stroke":"fill"]=r.stroke),null!=r.opacity&&(l.opacity=r.opacity)}}t.markRedraw()}},this);var v=i.getRawValue(t);(0,se.qM)(this,u,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,a){return i.getFormattedLabel(t,a,e.dataType)}},inheritColor:f||S.A.color.neutral99,defaultOpacity:h.opacity,defaultText:(null==v?e.getName(t):isFinite(v)?(0,G.LI)(v,10):v)+""});var m=this.getTextContent();if(m){var _=u.normal;m.__align=m.style.align,m.__verticalAlign=m.style.verticalAlign,m.__position=_.get("position")||"middle";var b=_.get("distance");(0,r.isArray)(b)||(b=[b,b]),m.__labelDistance=b}this.setTextConfig({position:null,local:!0,inside:!1}),(0,re.Lm)(this,d,p,c)},t.prototype.highlight=function(){(0,re.HY)(this)},t.prototype.downplay=function(){(0,re.SD)(this)},t.prototype.updateLayout=function(e,t){this.childOfName("line").stopAnimation(),this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");pe(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this,t=e.childOfName("fromSymbol"),a=e.childOfName("toSymbol"),i=e.getTextContent();if(t||a||i&&!i.ignore){for(var o=1,n=this.parent;n;)n.scaleX&&(o/=n.scaleX),n=n.parent;var r=e.childOfName("line");if(this.__dirty||r.__dirty){var s=r.shape.percent,l=r.pointAt(0),u=r.pointAt(s),c=N.sub([],u,l);if(N.normalize(c,c),t&&(t.setPosition(l),x(t,0),t.scaleX=t.scaleY=o*s,t.markRedraw()),a&&(a.setPosition(u),x(a,1),a.scaleX=a.scaleY=o*s,a.markRedraw()),i&&!i.ignore){i.x=i.y=0,i.originX=i.originY=0;var d=void 0,p=void 0,g=i.__labelDistance,y=g[0]*o,h=g[1]*o,f=s/2,v=r.tangentAt(f),m=[v[1],-v[0]],_=r.pointAt(f);m[1]>0&&(m[0]=-m[0],m[1]=-m[1]);var S=v[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var b=-Math.atan2(v[1],v[0]);u[0]<l[0]&&(b=Math.PI+b),i.rotation=b}var L=void 0;switch(i.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":L=-h,p="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":L=h,p="top";break;default:L=0,p="middle"}switch(i.__position){case"end":i.x=c[0]*y+u[0],i.y=c[1]*h+u[1],d=c[0]>.8?"left":c[0]<-.8?"right":"center",p=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":i.x=-c[0]*y+l[0],i.y=-c[1]*h+l[1],d=c[0]>.8?"right":c[0]<-.8?"left":"center",p=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=y*S+l[0],i.y=l[1]+L,d=v[0]<0?"right":"left",i.originX=-y*S,i.originY=-L;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=_[0],i.y=_[1]+L,d="center",i.originY=-L;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-y*S+u[0],i.y=u[1]+L,d=v[0]>=0?"right":"left",i.originX=y*S,i.originY=-L}i.scaleX=i.scaleY=o,i.setStyle({verticalAlign:i.__verticalAlign||p,align:i.__align||d})}}}function x(e,t){var a=e.__specifiedRotation;if(null==a){var i=r.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else e.attr("rotation",a)}},t}(H.A);function ye(e){var t=e.hostModel,a=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:a.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:a.get("disabled"),blurScope:a.get("blurScope"),focus:a.get("focus"),labelStatesModels:(0,se.lx)(t)}}function he(e){return isNaN(e[0])||isNaN(e[1])}function fe(e){return e&&!he(e[0])&&!he(e[1])}const ve=function(){function e(e){this.group=new H.A,this._LineCtor=e||ge}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var a=this,i=a.group,o=a._lineData;a._lineData=e,o||i.removeAll();var n=ye(e);e.diff(o).add(function(a){t._doAdd(e,a,n)}).update(function(a,i){t._doUpdate(o,e,i,a,n)}).remove(function(e){i.remove(o.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,a){t.updateLayout(e,a)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=ye(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,a){function i(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=a,e.ensureState("emphasis").hoverLayer=K.HOVER_LAYER_FOR_INCREMENTAL)}this._progressiveEls=[];for(var o=e.start;o<e.end;o++){if(fe(t.getItemLayout(o))){var n=new this._LineCtor(t,o,this._seriesScope);n.traverse(i),this.group.add(n),t.setItemGraphicEl(o,n),this._progressiveEls.push(n)}}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){K.traverseElements(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,a){if(fe(e.getItemLayout(t))){var i=new this._LineCtor(e,t,a);e.setItemGraphicEl(t,i),this.group.add(i)}},e.prototype._doUpdate=function(e,t,a,i,o){var n=e.getItemGraphicEl(a);fe(t.getItemLayout(i))?(n?n.updateData(t,i,o):n=new this._LineCtor(t,i,o),t.setItemGraphicEl(i,n),this.group.add(n)):this.group.remove(n)},e}();var me=a(16329),_e=a(11054),Se=[],be=[],Le=[],xe=_e.k3,Ie=N.distSquare,Ae=Math.abs;function we(e,t,a){for(var i,o=e[0],n=e[1],r=e[2],s=1/0,l=a*a,u=.1,c=.1;c<=.9;c+=.1){Se[0]=xe(o[0],n[0],r[0],c),Se[1]=xe(o[1],n[1],r[1],c),(g=Ae(Ie(Se,t)-l))<s&&(s=g,i=c)}for(var d=0;d<32;d++){var p=i+u;be[0]=xe(o[0],n[0],r[0],i),be[1]=xe(o[1],n[1],r[1],i),Le[0]=xe(o[0],n[0],r[0],p),Le[1]=xe(o[1],n[1],r[1],p);var g=Ie(be,t)-l;if(Ae(g)<.01)break;var y=Ie(Le,t)-l;u/=2,g<0?y>=0?i+=u:i-=u:y>=0?i-=u:i+=u}return i}function Ne(e,t){var a=[],i=_e.kx,o=[[],[],[]],n=[[],[]],r=[];t/=2,e.eachEdge(function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),c=e.getVisual("toSymbol");l.__original||(l.__original=[N.clone(l[0]),N.clone(l[1])],l[2]&&l.__original.push(N.clone(l[2])));var d=l.__original;if(null!=l[2]){if(N.copy(o[0],d[0]),N.copy(o[1],d[2]),N.copy(o[2],d[1]),u&&"none"!==u){var p=E(e.node1),g=we(o,d[0],p*t);i(o[0][0],o[1][0],o[2][0],g,a),o[0][0]=a[3],o[1][0]=a[4],i(o[0][1],o[1][1],o[2][1],g,a),o[0][1]=a[3],o[1][1]=a[4]}if(c&&"none"!==c){p=E(e.node2),g=we(o,d[1],p*t);i(o[0][0],o[1][0],o[2][0],g,a),o[1][0]=a[1],o[2][0]=a[2],i(o[0][1],o[1][1],o[2][1],g,a),o[1][1]=a[1],o[2][1]=a[2]}N.copy(l[0],o[0]),N.copy(l[1],o[2]),N.copy(l[2],o[1])}else{if(N.copy(n[0],d[0]),N.copy(n[1],d[1]),N.sub(r,n[1],n[0]),N.normalize(r,r),u&&"none"!==u){p=E(e.node1);N.scaleAndAdd(n[0],n[0],r,p*t)}if(c&&"none"!==c){p=E(e.node2);N.scaleAndAdd(n[1],n[1],r,-p*t)}N.copy(l[0],n[0]),N.copy(l[1],n[1])}})}var Me=a(27275),De=a(90057),Ve=(0,i.$r)();var Te=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=L,t}return(0,o.C6)(t,e),t.prototype.init=function(e,t){var a=new q.A,i=new ve,o=this.group,n=new H.A;this._controller=new me.A(t.getZr()),n.add(a.group),n.add(i.group),o.add(n),this._symbolDraw=a,this._lineDraw=i,this._mainGroup=n,this._firstRender=!0},t.prototype.render=function(e,t,a){var i=this,o=(0,b.Nl)(e),n=!1;this._model=e,this._api=a,this._active=!0;var r=this._mainGroup,s=this._getThumbnailInfo();s&&s.bridge.reset(a);var l=this._symbolDraw,u=this._lineDraw;o&&(0,b.nT)(r,b.ZD,o,this._firstRender?null:e),Ne(e.getGraph(),T(e));var c=e.getData();l.updateData(c);var d=e.getEdgeData();u.updateData(d),this._updateNodeAndLinkScale(),o&&(0,X.jg)(e,a,this._controller,function(t,a,i){return e.coordinateSystem.containPoint([a,i])},null),clearTimeout(this._layoutTimeout);var p=e.forceLayout,g=e.get(["force","layoutAnimation"]);p&&(n=!0,this._startForceLayoutIteration(p,a,g));var y=e.get("layout");c.graph.eachNode(function(t){var o=t.dataIndex,n=t.getGraphicEl(),r=t.getModel();if(n){n.off("drag").off("dragend");var s=r.get("draggable");s&&n.on("drag",function(r){switch(y){case"force":p.warmUp(),!i._layouting&&i._startForceLayoutIteration(p,a,g),p.setFixed(o),c.setItemLayout(o,[n.x,n.y]);break;case"circular":c.setItemLayout(o,[n.x,n.y]),t.setLayout({fixed:!0},!0),k(e,"symbolSize",t,[r.offsetX,r.offsetY]),i.updateLayout(e);break;default:c.setItemLayout(o,[n.x,n.y]),D(e.getGraph(),e),i.updateLayout(e)}}).on("dragend",function(){p&&p.setUnfixed(o)}),n.setDraggable(s,!!r.get("cursor")),"adjacency"===r.get(["emphasis","focus"])&&((0,De.z)(n).focus=t.getAdjacentDataIndices())}}),c.graph.eachEdge(function(e){var t=e.getGraphicEl(),a=e.getModel().get(["emphasis","focus"]);t&&"adjacency"===a&&((0,De.z)(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})});var h="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),f=c.getLayout("cx"),v=c.getLayout("cy");c.graph.eachNode(function(e){z(e,h,f,v)}),this._firstRender=!1,n||this._renderThumbnail(e,a,this._symbolDraw,this._lineDraw)},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose()},t.prototype._startForceLayoutIteration=function(e,t,a){var i=this,o=!1;!function n(){e.step(function(e){i.updateLayout(i._model),!e&&o||(o=!0,i._renderThumbnail(i._model,t,i._symbolDraw,i._lineDraw)),(i._layouting=!e)&&(a?i._layoutTimeout=setTimeout(n,16):n())})}()},t.prototype.__updateOnOwnRoam=function(e,t,a){var i=(0,b.Nl)(t);this._active&&i&&((0,b.nT)(this._mainGroup,b.ZD,i,null),(0,X.LZ)(e)&&(this._updateNodeAndLinkScale(),Ne(t.getGraph(),T(t)),this._lineDraw.updateLayout(),a.updateLabelLayout()),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),a=T(e);t.eachItemGraphicEl(function(e,t){e&&e.setSymbolScale(a)})},t.prototype.updateLayout=function(e){this._active&&(Ne(e.getGraph(),T(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},t.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},t.prototype._getThumbnailInfo=function(){var e=this._model,t=e.coordinateSystem;if("view"===t.type){var a=function(e){if(e)return Ve(e).bridge}(e);if(a)return{bridge:a,coordSys:t}}},t.prototype._updateThumbnailWindow=function(){var e=this._getThumbnailInfo();e&&e.bridge.updateWindow((0,b.rj)(null,e.coordSys),this._api)},t.prototype._renderThumbnail=function(e,t,a,i){var o=this._getThumbnailInfo();if(o){var n=new H.A,s=a.group.children(),l=i.group.children(),u=new H.A,c=new H.A;n.add(c),n.add(u);for(var d=0;d<s.length;d++){var p=(_=s[d]).children()[0],g=_.x,y=_.y,h=(0,r.clone)(p.shape),f=(0,r.extend)(h,{width:p.scaleX,height:p.scaleY,x:g-p.scaleX/2,y:y-p.scaleY/2}),v=(0,r.clone)(p.style),m=new p.constructor({shape:f,style:v,z2:151});c.add(m)}for(d=0;d<l.length;d++){var _,S=(_=l[d]).children()[0],L=(v=(0,r.clone)(S.style),f=(0,r.clone)(S.shape),new oe({style:v,shape:f,z2:151}));u.add(L)}o.bridge.renderContent({api:t,roamType:e.get("roam"),viewportRect:null,group:n,targetTrans:(0,b.rj)(null,o.coordSys)})}},t.type=L,t}(Me.A);const Ee=Te;var Ce=(0,i.O9)(L,function(e){var t=e.findComponents({mainType:"legend"});if(!t||!t.length)return;e.eachSeriesByType(L,function(e){var a=e.getCategoriesData(),i=e.getGraph().data,o=a.mapArray(a.getName);i.filterSelf(function(e){var a=i.getItemModel(e).getShallow("category");if(null!=a){(0,r.isNumber)(a)&&(a=o[a]);for(var n=0;n<t.length;n++)if(!t[n].isSelected(a))return!1}return!0})})});var Pe=(0,i.O9)(L,function(e){var t={};e.eachSeriesByType(L,function(e){var a=e.getCategoriesData(),i=e.getData(),o={};a.each(function(i){var n=a.getName(i);o["ec-"+n]=i;var r=a.getItemModel(i),s=r.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(n,t)),a.setItemVisual(i,"style",s);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var c=r.getShallow(l[u],!0);null!=c&&a.setItemVisual(i,l[u],c)}}),a.count()&&i.each(function(e){var t=i.getItemModel(e).getShallow("category");if(null!=t){(0,r.isString)(t)&&(t=o["ec-"+t]);var n=a.getItemVisual(t,"style"),s=i.ensureUniqueItemVisual(e,"style");(0,r.extend)(s,n);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++)i.setItemVisual(e,l[u],a.getItemVisual(t,l[u]))}})})});var ke=a(11975);function Oe(e){e.registerChartView(Ee),e.registerSeriesModel(I),e.registerProcessor(Ce),e.registerVisual(Pe),e.registerVisual(w),e.registerLayout(V),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,R),e.registerLayout(F),e.registerCoordinateSystem("graphView",{dimensions:b.Ay.dimensions,create:W}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},r.noop),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},r.noop),(0,X.Bs)(e,ke.t7,L)}},4088(e,t,a){a.d(t,{A:()=>i});const i=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}()}};