UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

1 lines 19 kB
export const __rspack_esm_id=88156;export const __rspack_esm_ids=[88156];export const __webpack_modules__={56434(t,e,a){a.d(e,{e:()=>o});var n=a(81977);function o(t,e,a){return(0,n.P)(t,12*e,a)}},6116(t,e,a){a.d(e,{o:()=>i});var n=a(6439),o=a(83339);function i(t,e,a){const i=(0,o.b)(t,e)/6e4;return(0,n.u)(a?.roundingMethod)(i)}},77652(t,e,a){a.d(e,{A:()=>d,n:()=>s});var n=a(62826),o=a(5990),i=a(54202),r=a(99904),l=a(16890),u=a(16418),s="sankey",c=function(t){function e(){var a=null!==t&&t.apply(this,arguments)||this;return a.type=e.type,a}return(0,n.C6)(e,t),e.prototype.getInitialData=function(t,e){var a=t.edges||t.links||[],n=t.data||t.nodes||[],o=t.levels||[];this.levelModels=[];for(var l=this.levelModels,u=0;u<o.length;u++)null!=o[u].depth&&o[u].depth>=0&&(l[o[u].depth]=new r.A(o[u],this,e));return(0,i.A)(n,a,this,!0,function(t,e){t.wrapMethod("getItemModel",function(t,e){var a=t.parentModel,n=a.getData().getItemLayout(e);if(n){var o=n.depth,i=a.levelModels[o];i&&(t.parentModel=i)}return t}),e.wrapMethod("getItemModel",function(t,e){var a=t.parentModel,n=a.getGraph().getEdgeByIndex(e).node1.getLayout();if(n){var o=n.depth,i=a.levelModels[o];i&&(t.parentModel=i)}return t})}).data},e.prototype.setNodePosition=function(t,e){var a=(this.option.data||this.option.nodes)[t];a.localX=e[0],a.localY=e[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,e,a){function n(t){return isNaN(t)||null==t}if("edge"===a){var o=this.getDataParams(t,a),i=o.data,r=o.value,u=i.source+" -- "+i.target;return(0,l.Qx)("nameValue",{name:u,value:r,noValue:n(r)})}var s=this.getGraph().getNodeByIndex(t).getLayout().value,c=this.getDataParams(t,a).data.name;return(0,l.Qx)("nameValue",{name:null!=c?c+"":null,value:s,noValue:n(s)})},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(e,a){var n=t.prototype.getDataParams.call(this,e,a);if(null==n.value&&"node"===a){var o=this.getGraph().getNodeByIndex(e).getLayout().value;n.value=o}return n},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+s,e.layoutMode="box",e.defaultOption={z:2,coordinateSystemUsage:"box",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,roam:!1,roamTrigger:"global",center:null,zoom:1,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:u.A.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:u.A.color.primary}},animationEasing:"linear",animationDuration:1e3},e}(o.A);const d=c},30052(t,e,a){a.d(e,{A:()=>b});a(46058);var n=a(62826),o=a(79231),i=a(22785),r=a(4017),l=a(67665),u=a(52557),s=a(9078),c=a(77652),d=a(27275),g=a(79825),y=a(90057),p=a(52577),h=a(16329),f=a(66834),v=a(42605),x=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},m=function(t){function e(e){return t.call(this,e)||this}return(0,n.C6)(e,t),e.prototype.getDefaultShape=function(){return new x},e.prototype.buildPath=function(t,e){var a=e.extent;t.moveTo(e.x1,e.y1),t.bezierCurveTo(e.cpx1,e.cpy1,e.cpx2,e.cpy2,e.x2,e.y2),"vertical"===e.orient?(t.lineTo(e.x2+a,e.y2),t.bezierCurveTo(e.cpx2+a,e.cpy2,e.cpx1+a,e.cpy1,e.x1+a,e.y1)):(t.lineTo(e.x2,e.y2+a),t.bezierCurveTo(e.cpx2,e.cpy2+a,e.cpx1,e.cpy1+a,e.x1,e.y1+a)),t.closePath()},e.prototype.highlight=function(){(0,s.HY)(this)},e.prototype.downplay=function(){(0,s.SD)(this)},e}(o.Ay),L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=c.n,e._mainGroup=new i.A,e}return(0,n.C6)(e,t),e.prototype.init=function(t,e){this._controller=new h.A(e.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},e.prototype.render=function(t,e,a){var n=t.getGraph(),o=this._mainGroup,i=t.layoutInfo,l=i.width,c=i.height,d=t.getData(),h=t.getData("edge"),f=t.get("orient");o.removeAll(),o.x=i.x,o.y=i.y,this._updateViewCoordSys(t,a),(0,v.jg)(t,a,this._controller,(0,v.QB)(o),null),n.eachEdge(function(e){var a=new m,n=(0,y.z)(a);n.dataIndex=e.dataIndex,n.seriesIndex=t.seriesIndex,n.dataType="edge";var i,r,u,d,v,x,L,b,_=e.getModel(),w=_.getModel("lineStyle"),I=w.get("curveness"),S=e.node1.getLayout(),M=e.node1.getModel(),T=M.get("localX"),E=M.get("localY"),A=e.node2.getLayout(),D=e.node2.getModel(),z=D.get("localX"),C=D.get("localY"),O=e.getLayout();a.shape.extent=Math.max(1,O.dy),a.shape.orient=f,"vertical"===f?(i=(null!=T?T*l:S.x)+O.sy,r=(null!=E?E*c:S.y)+S.dy,u=(null!=z?z*l:A.x)+O.ty,v=i,x=r*(1-I)+(d=null!=C?C*c:A.y)*I,L=u,b=r*I+d*(1-I)):(i=(null!=T?T*l:S.x)+S.dx,r=(null!=E?E*c:S.y)+O.sy,v=i*(1-I)+(u=null!=z?z*l:A.x)*I,x=r,L=i*I+u*(1-I),b=d=(null!=C?C*c:A.y)+O.ty),a.setShape({x1:i,y1:r,x2:u,y2:d,cpx1:v,cpy1:x,cpx2:L,cpy2:b}),a.useStyle(w.getItemStyle()),V(a.style,f,e);var G=""+_.get("value"),N=(0,g.lx)(_,"edgeLabel");(0,g.qM)(a,N,{labelFetcher:{getFormattedLabel:function(e,a,n,o,i,r){return t.getFormattedLabel(e,a,"edge",o,(0,p.retrieve3)(i,N.normal&&N.normal.get("formatter"),G),r)}},labelDataIndex:e.dataIndex,defaultText:G}),a.setTextConfig({position:"inside"});var P=_.getModel("emphasis");(0,s.Mx)(a,_,"lineStyle",function(t){var a=t.getItemStyle();return V(a,f,e),a}),o.add(a),h.setItemGraphicEl(e.dataIndex,a);var j=P.get("focus");(0,s.Lm)(a,"adjacency"===j?e.getAdjacentDataIndices():"trajectory"===j?e.getTrajectoryDataIndices():j,P.get("blurScope"),P.get("disabled"))}),n.eachNode(function(e){var a=e.getLayout(),n=e.getModel(),i=n.get("localX"),u=n.get("localY"),p=n.getModel("emphasis"),h=n.get(["itemStyle","borderRadius"])||0,f=new r.A({shape:{x:null!=i?i*l:a.x,y:null!=u?u*c:a.y,width:a.dx,height:a.dy,r:h},style:n.getModel("itemStyle").getItemStyle(),z2:10});(0,g.qM)(f,(0,g.lx)(n),{labelFetcher:{getFormattedLabel:function(e,a){return t.getFormattedLabel(e,a,"node")}},labelDataIndex:e.dataIndex,defaultText:e.id}),f.disableLabelAnimation=!0,f.setStyle("fill",e.getVisual("color")),f.setStyle("decal",e.getVisual("style").decal),(0,s.Mx)(f,n),o.add(f),d.setItemGraphicEl(e.dataIndex,f),(0,y.z)(f).dataType="node";var v=p.get("focus");(0,s.Lm)(f,"adjacency"===v?e.getAdjacentDataIndices():"trajectory"===v?e.getTrajectoryDataIndices():v,p.get("blurScope"),p.get("disabled"))}),d.eachItemGraphicEl(function(e,n){d.getItemModel(n).get("draggable")&&(e.drift=function(e,o){this.shape.x+=e,this.shape.y+=o,this.dirty(),a.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:d.getRawIndex(n),localX:this.shape.x/l,localY:this.shape.y/c})},e.draggable=!0,e.cursor="move")}),!this._data&&t.isAnimationEnabled()&&o.setClipPath(function(t,e,a){var n=new r.A({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return u.LW(n,{shape:{width:t.width+20}},e,a),n}(o.getBoundingRect(),t,function(){o.removeClipPath()})),this._data=t.getData(),this._firstRender=!1},e.prototype.__updateOnOwnRoam=function(t,e,a){(0,f.nT)(this.group,f.ZD,e.coordinateSystem,null)},e.prototype.dispose=function(){this._controller&&this._controller.dispose()},e.prototype._updateViewCoordSys=function(t,e){var a=t.layoutInfo,n=t.coordinateSystem=(0,v.ao)(t,e,a.x,a.y,a.width,a.height);(0,f.nT)(this.group,f.ZD,n,this._firstRender?null:t)},e.type=c.n,e}(d.A);function V(t,e,a){switch(t.fill){case"source":t.fill=a.node1.getVisual("color"),t.decal=a.node1.getVisual("style").decal;break;case"target":t.fill=a.node2.getVisual("color"),t.decal=a.node2.getVisual("style").decal;break;case"gradient":var n=a.node1.getVisual("color"),o=a.node2.getVisual("color");(0,p.isString)(n)&&(0,p.isString)(o)&&(t.fill=new l.A(0,0,+("horizontal"===e),+("vertical"===e),[{color:n,offset:0},{color:o,offset:1}]))}}const b=L},47685(t,e,a){a.d(e,{a:()=>I});var n=a(30052),o=a(77652),i=a(11975),r=a(42605),l=(a(44114),a(52577)),u=a(6471),s=a(83354),c=a(88877),d=(0,u.O9)(o.n,function(t,e){t.eachSeriesByType(o.n,function(t){var a=t.get("nodeWidth"),n=t.get("nodeGap"),o=(0,s.Lj)(t,e).refContainer,i=(0,s.dV)(t.getBoxLayoutParams(),o);t.layoutInfo=i;var r=i.width,d=i.height,h=t.getGraph(),f=h.nodes,v=h.edges;!function(t){l.each(t,function(t){var e=V(t.outEdges,L),a=V(t.inEdges,L),n=t.getValue()||0,o=Math.max(e,a,n);t.setLayout({value:o},!0)})}(f),function(t,e,a,n,o,i,r,s,d){(function(t,e,a,n,o,i,r){for(var u=[],s=[],c=[],d=[],y=0,p=0;p<e.length;p++)u[p]=1;for(p=0;p<t.length;p++)s[p]=t[p].inEdges.length,0===s[p]&&c.push(t[p]);var h=-1;for(;c.length;){for(var f=0;f<c.length;f++){var v=c[f],x=v.hostGraph.data.getRawDataItem(v.dataIndex),m=null!=x.depth&&x.depth>=0;m&&x.depth>h&&(h=x.depth),v.setLayout({depth:m?x.depth:y},!0),"vertical"===i?v.setLayout({dy:a},!0):v.setLayout({dx:a},!0);for(var L=0;L<v.outEdges.length;L++){var V=v.outEdges[L];u[l.indexOf(e,V)]=0;var b=V.node2;0===--s[l.indexOf(t,b)]&&l.indexOf(d,b)<0&&d.push(b)}}++y,c=d,d=[]}for(p=0;p<u.length;p++)if(1===u[p])throw new Error("Sankey is a DAG, the original data has cycle!");var _=h>y-1?h:y-1;r&&"left"!==r&&function(t,e,a,n){if("right"===e){for(var o=[],i=t,r=0;i.length;){for(var u=0;u<i.length;u++){var s=i[u];s.setLayout({skNodeHeight:r},!0);for(var c=0;c<s.inEdges.length;c++){var d=s.inEdges[c];l.indexOf(o,d.node1)<0&&o.push(d.node1)}}i=o,o=[],++r}l.each(t,function(t){g(t)||t.setLayout({depth:Math.max(0,n-t.getLayout().skNodeHeight)},!0)})}else"justify"===e&&function(t,e){l.each(t,function(t){g(t)||t.outEdges.length||t.setLayout({depth:e},!0)})}(t,n)}(t,r,0,_);var w="vertical"===i?(o-a)/_:(n-a)/_;!function(t,e,a){l.each(t,function(t){var n=t.getLayout().depth*e;"vertical"===a?t.setLayout({y:n},!0):t.setLayout({x:n},!0)})}(t,w,i)})(t,e,a,o,i,s,d),function(t,e,a,n,o,i,r){var s=function(t,e){var a=[],n="vertical"===e?"y":"x",o=(0,u.Sq)(t,function(t){return t.getLayout()[n]});return(0,c.Y6)(o.keys),l.each(o.keys,function(t){a.push(o.buckets.get(t))}),a}(t,r);(function(t,e,a,n,o,i){var r=1/0;l.each(t,function(t){var e=t.length,u=0;l.each(t,function(t){u+=t.getLayout().value});var s="vertical"===i?(n-(e-1)*o)/u:(a-(e-1)*o)/u;s<r&&(r=s)}),l.each(t,function(t){l.each(t,function(t,e){var a=t.getLayout().value*r;"vertical"===i?(t.setLayout({x:e},!0),t.setLayout({dx:a},!0)):(t.setLayout({y:e},!0),t.setLayout({dy:a},!0))})}),l.each(e,function(t){var e=+t.getValue()*r;t.setLayout({dy:e},!0)})})(s,e,a,n,o,r),y(s,o,a,n,r);for(var d=1;i>0;i--)p(s,d*=.99,r),y(s,o,a,n,r),b(s,d,r),y(s,o,a,n,r)}(t,e,i,o,n,r,s),function(t,e){var a="vertical"===e?"x":"y";l.each(t,function(t){t.outEdges.sort(function(t,e){return t.node2.getLayout()[a]-e.node2.getLayout()[a]}),t.inEdges.sort(function(t,e){return t.node1.getLayout()[a]-e.node1.getLayout()[a]})}),l.each(t,function(t){var e=0,a=0;l.each(t.outEdges,function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy}),l.each(t.inEdges,function(t){t.setLayout({ty:a},!0),a+=t.getLayout().dy})})}(t,s)}(f,v,a,n,r,d,0!==l.filter(f,function(t){return 0===t.getLayout().value}).length?0:t.get("layoutIterations"),t.get("orient"),t.get("nodeAlign"))})});function g(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&e.depth>=0}function y(t,e,a,n,o){var i="vertical"===o?"x":"y";l.each(t,function(t){var r,l,u;t.sort(function(t,e){return t.getLayout()[i]-e.getLayout()[i]});for(var s=0,c=t.length,d="vertical"===o?"dx":"dy",g=0;g<c;g++)(u=s-(l=t[g]).getLayout()[i])>0&&(r=l.getLayout()[i]+u,"vertical"===o?l.setLayout({x:r},!0):l.setLayout({y:r},!0)),s=l.getLayout()[i]+l.getLayout()[d]+e;if((u=s-e-("vertical"===o?n:a))>0){r=l.getLayout()[i]-u,"vertical"===o?l.setLayout({x:r},!0):l.setLayout({y:r},!0),s=r;for(g=c-2;g>=0;--g)(u=(l=t[g]).getLayout()[i]+l.getLayout()[d]+e-s)>0&&(r=l.getLayout()[i]-u,"vertical"===o?l.setLayout({x:r},!0):l.setLayout({y:r},!0)),s=l.getLayout()[i]}})}function p(t,e,a){l.each(t.slice().reverse(),function(t){l.each(t,function(t){if(t.outEdges.length){var n=V(t.outEdges,h,a)/V(t.outEdges,L);if(isNaN(n)){var o=t.outEdges.length;n=o?V(t.outEdges,f,a)/o:0}if("vertical"===a){var i=t.getLayout().x+(n-m(t,a))*e;t.setLayout({x:i},!0)}else{var r=t.getLayout().y+(n-m(t,a))*e;t.setLayout({y:r},!0)}}})})}function h(t,e){return m(t.node2,e)*t.getValue()}function f(t,e){return m(t.node2,e)}function v(t,e){return m(t.node1,e)*t.getValue()}function x(t,e){return m(t.node1,e)}function m(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function L(t){return t.getValue()}function V(t,e,a){for(var n=0,o=t.length,i=-1;++i<o;){var r=+e(t[i],a);isNaN(r)||(n+=r)}return n}function b(t,e,a){l.each(t,function(t){l.each(t,function(t){if(t.inEdges.length){var n=V(t.inEdges,v,a)/V(t.inEdges,L);if(isNaN(n)){var o=t.inEdges.length;n=o?V(t.inEdges,x,a)/o:0}if("vertical"===a){var i=t.getLayout().x+(n-m(t,a))*e;t.setLayout({x:i},!0)}else{var r=t.getLayout().y+(n-m(t,a))*e;t.setLayout({y:r},!0)}}})})}var _=a(16928),w=(0,u.O9)(o.n,function(t){t.eachSeriesByType(o.n,function(t){var e=t.getGraph(),a=e.nodes,n=e.edges;if(a.length){var o=1/0,i=-1/0;l.each(a,function(t){var e=t.getLayout().value;e<o&&(o=e),e>i&&(i=e)}),l.each(a,function(e){var a=new _.A({type:"color",mappingMethod:"linear",dataExtent:[o,i],visual:t.get("color")}).mapValueToVisual(e.getLayout().value),n=e.getModel().get(["itemStyle","color"]);null!=n?(e.setVisual("color",n),e.setVisual("style",{fill:n})):(e.setVisual("color",a),e.setVisual("style",{fill:a}))})}n.length&&l.each(n,function(t){var e=t.getModel().get("lineStyle");t.setVisual("style",e)})})});function I(t){t.registerChartView(n.A),t.registerSeriesModel(o.A),t.registerLayout(d),t.registerVisual(w),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(t,e){e.eachComponent({mainType:i.t7,subType:o.n,query:t},function(e){e.setNodePosition(t.dataIndex,[t.localX,t.localY])})}),(0,r.Bs)(t,i.t7,o.n)}},16928(t,e,a){a.d(e,{A:()=>V});a(44114);var n=a(52577),o=a(85767),i=a(88877),r=n.each,l=n.isObject,u=-1,s=function(){function t(e){var a=e.mappingMethod,o=e.type,i=this.option=n.clone(e);this.type=o,this.mappingMethod=a,this._normalizeData=m[a];var l=t.visualHandlers[o];this.applyVisual=l.applyVisual,this.getColorMapper=l.getColorMapper,this._normalizedToVisual=l._normalizedToVisual[a],"piecewise"===a?(c(i),function(t){var e=t.pieceList;t.hasSpecialVisual=!1,n.each(e,function(e,a){e.originIndex=a,null!=e.visual&&(t.hasSpecialVisual=!0)})}(i)):"category"===a?i.categories?function(t){var e=t.categories,a=t.categoryMap={},o=t.visual;if(r(e,function(t,e){a[t]=e}),!n.isArray(o)){var i=[];n.isObject(o)?r(o,function(t,e){var n=a[e];i[null!=n?n:u]=t}):i[-1]=o,o=x(t,i)}for(var l=e.length-1;l>=0;l--)null==o[l]&&(delete a[e[l]],e.pop())}(i):c(i,!0):(n.assert("linear"!==a||i.dataExtent),c(i))}return t.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},t.prototype.getNormalizer=function(){return n.bind(this._normalizeData,this)},t.listVisualTypes=function(){return n.keys(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(t,e,a){n.isObject(t)?n.each(t,e,a):e.call(a,t)},t.mapVisual=function(e,a,o){var i,r=n.isArray(e)?[]:n.isObject(e)?{}:(i=!0,null);return t.eachVisual(e,function(t,e){var n=a.call(o,t,e);i?r=n:r[e]=n}),r},t.retrieveVisuals=function(e){var a,n={};return e&&r(t.visualHandlers,function(t,o){e.hasOwnProperty(o)&&(n[o]=e[o],a=!0)}),a?n:null},t.prepareVisualTypes=function(t){if(n.isArray(t))t=t.slice();else{if(!l(t))return[];var e=[];r(t,function(t,a){e.push(a)}),t=e}return t.sort(function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1}),t},t.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},t.findPieceIndex=function(t,e,a){for(var o,i=1/0,r=0,l=e.length;r<l;r++){var u=e[r].value;if(null!=u){if(u===t||n.isString(u)&&u===t+"")return r;a&&g(u,r)}}for(r=0,l=e.length;r<l;r++){var s=e[r],c=s.interval,d=s.close;if(c){if(c[0]===-1/0){if(L(d[1],t,c[1]))return r}else if(c[1]===1/0){if(L(d[0],c[0],t))return r}else if(L(d[0],c[0],t)&&L(d[1],t,c[1]))return r;a&&g(c[0],r),a&&g(c[1],r)}}if(a)return t===1/0?e.length-1:t===-1/0?0:o;function g(e,a){var n=Math.abs(e-t);n<i&&(i=n,o=a)}},t.visualHandlers={color:{applyVisual:y("color"),getColorMapper:function(){var t=this.option;return n.bind("category"===t.mappingMethod?function(t,e){return!e&&(t=this._normalizeData(t)),p.call(this,t)}:function(e,a,n){var i=!!n;return!a&&(e=this._normalizeData(e)),n=o.fastLerp(e,t.parsedVisual,n),i?n:o.stringify(n,"rgba")},this)},_normalizedToVisual:{linear:function(t){return o.stringify(o.fastLerp(t,this.option.parsedVisual),"rgba")},category:p,piecewise:function(t,e){var a=v.call(this,e);return null==a&&(a=o.stringify(o.fastLerp(t,this.option.parsedVisual),"rgba")),a},fixed:h}},colorHue:d(function(t,e){return o.modifyHSL(t,e)}),colorSaturation:d(function(t,e){return o.modifyHSL(t,null,e)}),colorLightness:d(function(t,e){return o.modifyHSL(t,null,null,e)}),colorAlpha:d(function(t,e){return o.modifyAlpha(t,e)}),decal:{applyVisual:y("decal"),_normalizedToVisual:{linear:null,category:p,piecewise:null,fixed:null}},opacity:{applyVisual:y("opacity"),_normalizedToVisual:f([0,1])},liftZ:{applyVisual:y("liftZ"),_normalizedToVisual:{linear:h,category:h,piecewise:h,fixed:h}},symbol:{applyVisual:function(t,e,a){a("symbol",this.mapValueToVisual(t))},_normalizedToVisual:{linear:g,category:p,piecewise:function(t,e){var a=v.call(this,e);return null==a&&(a=g.call(this,t)),a},fixed:h}},symbolSize:{applyVisual:y("symbolSize"),_normalizedToVisual:f([0,1])}},t}();function c(t,e){var a=t.visual,o=[];n.isObject(a)?r(a,function(t){o.push(t)}):null!=a&&o.push(a);e||1!==o.length||{color:1,symbol:1}.hasOwnProperty(t.type)||(o[1]=o[0]),x(t,o)}function d(t){return{applyVisual:function(e,a,n){var o=this.mapValueToVisual(e);n("color",t(a("color"),o))},_normalizedToVisual:f([0,1])}}function g(t){var e=this.option.visual;return e[Math.round((0,i.Cb)(t,[0,1],[0,e.length-1],!0))]||{}}function y(t){return function(e,a,n){n(t,this.mapValueToVisual(e))}}function p(t){var e=this.option.visual;return e[this.option.loop&&t!==u?t%e.length:t]}function h(){return this.option.visual[0]}function f(t){return{linear:function(e){return(0,i.Cb)(e,t,this.option.visual,!0)},category:p,piecewise:function(e,a){var n=v.call(this,a);return null==n&&(n=(0,i.Cb)(e,t,this.option.visual,!0)),n},fixed:h}}function v(t){var e=this.option,a=e.pieceList;if(e.hasSpecialVisual){var n=a[s.findPieceIndex(t,a)];if(n&&n.visual)return n.visual[this.type]}}function x(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=n.map(e,function(t){var e=o.parse(t);return e||[0,0,0,1]})),e}var m={linear:function(t){return(0,i.Cb)(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,a=s.findPieceIndex(t,e,!0);if(null!=a)return(0,i.Cb)(a,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?u:e},fixed:n.noop};function L(t,e,a){return t?e<=a:e<a}const V=s}};