UNPKG

989 kBJavaScriptView Raw
1var __extends=this&&this.__extends||function(e,t){function i(){this.constructor=e}for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},powerbi;!function(e){var t;!function(e){var t=function(){function e(e,t){this.x=e||0,this.y=t||0}return e}();e.Point=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function e(e,t,i,a){this.left=e||0,this.top=t||0,this.width=i||0,this.height=a||0}return e}();e.Rect=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){function i(e,t,i,a,r){return void 0===a&&(a=!1),void 0===r&&(r=o.Top),t?new c(e):new s(e,r,i,a)}var a=jsCommon.CssConstants.createClassAndSelector,r=jsCommon.PixelConverter;!function(e){e[e.Box=0]="Box",e[e.Circle=1]="Circle",e[e.Line=2]="Line"}(t.LegendIcon||(t.LegendIcon={}));t.LegendIcon;!function(e){e[e.Top=0]="Top",e[e.Bottom=1]="Bottom",e[e.Right=2]="Right",e[e.Left=3]="Left",e[e.None=4]="None",e[e.TopCenter=5]="TopCenter",e[e.BottomCenter=6]="BottomCenter",e[e.RightCenter=7]="RightCenter",e[e.LeftCenter=8]="LeftCenter"}(t.LegendPosition||(t.LegendPosition={}));var o=t.LegendPosition;t.legendProps={show:"show",position:"position",titleText:"titleText",showTitle:"showTitle",labelColor:"labelColor",fontSize:"fontSize"},t.createLegend=i;var n;!function(e){function t(e){switch(e){case o.Left:case o.LeftCenter:return!0;default:return!1}}function i(e){switch(e){case o.Top:case o.TopCenter:return!0;default:return!1}}function a(t,i){var a=i.getMargins(),r=i.getOrientation();t.style({"margin-left":e.isLeft(r)?a.width+"px":null,"margin-top":e.isTop(r)?a.height+"px":null})}e.isLeft=t,e.isTop=i,e.positionChartArea=a}(n=t.Legend||(t.Legend={}));var s=function(){function i(e,i,a,r){this.legendDataStartIndex=0,this.arrowPosWindow=1,this.lastCalculatedWidth=0,this.visibleLegendWidth=0,this.visibleLegendHeight=0,this.legendFontSizeMarginDifference=0,this.legendFontSizeMarginValue=0,this.svg=d3.select(e.get(0)).append("svg").style("position","absolute"),this.svg.style("display","inherit"),this.svg.classed("legend",!0),a&&(this.clearCatcher=t.appendClearCatcher(this.svg)),this.group=this.svg.append("g").attr("id","legendGroup"),this.interactivityService=a,this.isScrollable=r,this.element=e,this.changeOrientation(i),this.parentViewport={height:0,width:0},this.calculateViewport(),this.updateLayout()}return i.prototype.updateLayout=function(){var e=this.viewport,t=this.orientation;this.svg.attr({height:e.height||(t===o.None?0:this.parentViewport.height),width:e.width||(t===o.None?0:this.parentViewport.width)});var i=t===o.Right||t===o.RightCenter,a=t===o.Bottom||t===o.BottomCenter;this.svg.style({"margin-left":i?this.parentViewport.width-e.width+"px":null,"margin-top":a?this.parentViewport.height-e.height+"px":null})},i.prototype.calculateViewport=function(){switch(this.orientation){case o.Top:case o.Bottom:case o.TopCenter:case o.BottomCenter:var e=r.fromPointToPixel(this.data&&this.data.fontSize?this.data.fontSize:i.DefaultFontSizeInPt),t=i.TopLegendHeight+(e-i.DefaultFontSizeInPt);return void(this.viewport={height:t,width:0});case o.Right:case o.Left:case o.RightCenter:case o.LeftCenter:var a=this.lastCalculatedWidth?this.lastCalculatedWidth:this.parentViewport.width*i.LegendMaxWidthFactor;return void(this.viewport={height:0,width:a});case o.None:this.viewport={height:0,width:0}}},i.prototype.getMargins=function(){return this.viewport},i.prototype.isVisible=function(){return this.orientation!==o.None},i.prototype.changeOrientation=function(e){e?this.orientation=e:this.orientation=o.Top,this.svg.attr("orientation",e)},i.prototype.getOrientation=function(){return this.orientation},i.prototype.drawLegend=function(t,i){for(var a=e.Prototype.inherit(t),r=[],o=0,n=t.dataPoints;o<n.length;o++){var s=n[o];r.push(e.Prototype.inherit(s))}a.dataPoints=r,this.setTooltipToLegendItems(a),this.drawLegendInternal(a,i,!0)},i.prototype.drawLegendInternal=function(a,n,s){this.parentViewport=n,this.data=a,this.interactivityService&&this.interactivityService.applySelectionStateToData(a.dataPoints),0===a.dataPoints.length&&this.changeOrientation(o.None),this.getOrientation()===o.None&&(a.dataPoints=[]);var l=this.element.children(".mapControl");l.length>0&&!this.isTopOrBottom(this.orientation)&&l.css("display","inline-block"),this.calculateViewport();var c=this.calculateLayout(a,s),u=c.title,h=u?[u]:[],d=this.interactivityService&&e.visuals.dataHasSelection(a.dataPoints),p=this.group;if(this.isCentered(this.orientation)){var g=0;this.isTopOrBottom(this.orientation)?(g=Math.max(0,(this.parentViewport.width-this.visibleLegendWidth)/2),p.attr("transform",t.SVGUtil.translate(g,0))):(g=Math.max((this.parentViewport.height-this.visibleLegendHeight)/2),p.attr("transform",t.SVGUtil.translate(0,g)))}else p.attr("transform",null);var m=p.selectAll(i.LegendTitle.selector).data(h);m.enter().append("text").classed(i.LegendTitle["class"],!0),m.style({fill:a.labelColor,"font-size":r.fromPoint(a.fontSize),"font-family":i.DefaultTitleFontFamily}).text(function(e){return e.text}).attr({x:function(e){return e.x},y:function(e){return e.y}}).append("title").text(a.title),m.exit().remove();var f=a.dataPoints.slice(this.legendDataStartIndex,this.legendDataStartIndex+c.numberOfItems),y=e.TextMeasurementService.estimateSvgTextHeight(i.getTextProperties(!1,"",this.data.fontSize))/i.LegendIconRadiusFactor;y=this.legendFontSizeMarginValue>i.DefaultTextMargin&&y>i.LegendIconRadius?y:i.LegendIconRadius;var v=p.selectAll(i.LegendItem.selector).data(f,function(e){return e.identity.getKey()+(null!=e.layerNumber?e.layerNumber:"")}),b=v.enter().append("g").classed(i.LegendItem["class"],!0);if(b.append("circle").classed(i.LegendIcon["class"],!0),b.append("text").classed(i.LegendText["class"],!0),b.append("title").text(function(e){return e.tooltip}),b.style({"font-family":i.DefaultFontFamily}),v.select(i.LegendIcon.selector).attr({cx:function(e,t){return e.glyphPosition.x},cy:function(e){return e.glyphPosition.y},r:y}).style({fill:function(e){return d&&!e.selected?t.LegendBehavior.dimmedLegendColor:e.color}}),v.select("title").text(function(e){return e.tooltip}),v.select(i.LegendText.selector).attr({x:function(e){return e.textPosition.x},y:function(e){return e.textPosition.y}}).text(function(e){return e.label}).style({fill:a.labelColor,"font-size":r.fromPoint(a.fontSize)}),this.interactivityService){var C=v.select(i.LegendIcon.selector),S={legendItems:v,legendIcons:C,clearCatcher:this.clearCatcher};this.interactivityService.bind(a.dataPoints,new t.LegendBehavior,S,{isLegend:!0})}v.exit().remove(),this.drawNavigationArrows(c.navigationArrows),this.updateLayout()},i.prototype.normalizePosition=function(e){this.legendDataStartIndex>=e.length&&(this.legendDataStartIndex=e.length-1),this.legendDataStartIndex<0&&(this.legendDataStartIndex=0)},i.prototype.calculateTitleLayout=function(t){var a=0,r=!_.isEmpty(t);if(r){var o=this.isTopOrBottom(this.orientation),n=void 0;if(o){var s=this.legendFontSizeMarginValue>i.DefaultTextMargin?i.TextAndIconPadding+this.legendFontSizeMarginDifference:i.TextAndIconPadding,l=i.TextAndIconPadding+i.LegendIconRadius,c=i.LegendIconRadius+s+l;n=this.parentViewport.width*i.LegendMaxWidthFactor-c-i.LegendEdgeMariginWidth}else n=this.legendFontSizeMarginValue<i.DefaultTextMargin?i.MaxTitleLength:i.MaxTitleLength+i.DefaultMaxLegendFactor*this.legendFontSizeMarginDifference;var u=i.getTextProperties(!0,t,this.data.fontSize),h=t;return a=e.TextMeasurementService.measureSvgTextWidth(u),a>n&&(h=e.TextMeasurementService.getTailoredTextOrDefault(u,n),u.text=h,a=e.TextMeasurementService.measureSvgTextWidth(u)),o?a+=i.TitlePadding:h=e.TextMeasurementService.getTailoredTextOrDefault(u,this.viewport.width),{x:0,y:0,text:h,width:a,height:e.TextMeasurementService.estimateSvgTextHeight(u)}}return null},i.prototype.calculateLayout=function(e,t){var a=e.dataPoints;if(0===e.dataPoints.length)return{startIndex:null,numberOfItems:0,title:null,navigationArrows:[]};this.legendFontSizeMarginValue=r.fromPointToPixel(this.data&&void 0!==this.data.fontSize?this.data.fontSize:i.DefaultFontSizeInPt),this.legendFontSizeMarginDifference=this.legendFontSizeMarginValue-i.DefaultTextMargin,this.normalizePosition(a),this.legendDataStartIndex<a.length&&(a=a.slice(this.legendDataStartIndex));var o,n,s=this.calculateTitleLayout(e.title);return this.isTopOrBottom(this.orientation)?(o=this.isScrollable?this.calculateHorizontalNavigationArrowsLayout(s):[],n=this.calculateHorizontalLayout(a,s,o)):(o=this.isScrollable?this.calculateVerticalNavigationArrowsLayout(s):[],n=this.calculateVerticalLayout(a,s,o,t)),{numberOfItems:n,title:s,navigationArrows:o}},i.prototype.updateNavigationArrowLayout=function(e,t,i){0===this.legendDataStartIndex&&e.shift();var a=this.arrowPosWindow;this.arrowPosWindow=i,e&&e.length>0&&this.arrowPosWindow===t&&(this.arrowPosWindow=a,e.length=e.length-1)},i.prototype.calculateHorizontalNavigationArrowsLayout=function(e){var a=i.LegendArrowHeight,r=i.LegendArrowWidth,o=this.viewport.height/2-a/2,n=[],s=e?e.x+e.width:0,l=t.SVGUtil.createArrow(r,a,180),c=t.SVGUtil.createArrow(r,a,0);return n.push({x:s,y:o,path:l.path,rotateTransform:l.transform,type:1}),n.push({x:this.parentViewport.width-r,y:o,path:c.path,rotateTransform:c.transform,type:0}),n},i.prototype.calculateVerticalNavigationArrowsLayout=function(e){var a=i.LegendArrowHeight,r=i.LegendArrowWidth,o=this.viewport.height/2,n=[],s=o+a/2,l=t.SVGUtil.createArrow(r,a,270),c=t.SVGUtil.createArrow(r,a,90),u=e?e.height:0;return n.push({x:s,y:r+u,path:l.path,rotateTransform:l.transform,type:1}),n.push({x:s,y:this.parentViewport.height-a,path:c.path,rotateTransform:c.transform,type:0}),n},i.calculateHorizontalLegendItemsWidths=function(t,a,r,o){var n=t.length,s=n>0?a/n|0:0,l=s-r;l<i.MaxTextLength&&(l=i.MaxTextLength,s=l+r),s>a&&(s=a,l=s-r);for(var c=0,u=[],h=0,d=t;h<d.length;h++){var p=d[h],g=i.getTextProperties(!1,p.label,o),m=e.TextMeasurementService.measureSvgTextWidth(g),f=m+r,y=f>s,v=y?s:f;if(c+=v,c>=a){0===u.length?(u.push({dataPoint:p,textProperties:g,desiredWidth:f,desiredOverMaxWidth:!0,width:f}),c=a):c-=v;break}u.push({dataPoint:p,textProperties:g,desiredWidth:f,desiredOverMaxWidth:y,width:f})}var b=_.filter(u,function(e){return e.desiredOverMaxWidth}),C=b.length;if(C>0)for(var S=a-c,x=0,w=b;x<w.length;x++){var P=w[x],D=S/C,L=s+D,T=void 0;P.desiredWidth<=L?(P.desiredOverMaxWidth=!1,T=P.desiredWidth-s):(P.width=L,T=L-s),S-=T,C--}return u},i.prototype.calculateHorizontalLayout=function(t,a,r){var o=4+i.LegendIconRadius,n=this.legendFontSizeMarginDifference>0,s=n?i.TextAndIconPadding+this.legendFontSizeMarginDifference:i.TextAndIconPadding,l=s/(i.LegendIconRadiusFactor/2)+o,c=0,u=2*i.LegendIconRadius+1.5*s,h=t.length,d=i.getTextProperties(!1,"",this.data.fontSize),p=this.viewport.height/2,g=p+e.TextMeasurementService.estimateSvgTextHeight(d)/2-e.TextMeasurementService.estimateSvgTextBaselineDelta(d);a&&(c+=a.width,a.y=p+a.height/2-e.TextMeasurementService.estimateSvgTextBaselineDelta(i.getTextProperties(!0,a.text,this.data.fontSize))),this.legendDataStartIndex>0&&(c+=i.LegendArrowOffset);var m=t.length,f=this.parentViewport.width-c,y=i.calculateHorizontalLegendItemsWidths(t,f,u,this.data.fontSize);h=y.length,h!==m&&(f-=i.LegendArrowOffset,y=i.calculateHorizontalLegendItemsWidths(t,f,u,this.data.fontSize),h=y.length);for(var v=0,b=y;v<b.length;v++){var C=b[v],S=C.dataPoint;if(S.glyphPosition={x:c+i.LegendIconRadius+this.legendFontSizeMarginDifference/i.LegendIconRadiusFactor,y:this.viewport.height*i.LegendIconYRatio},S.textPosition={x:c+l,y:g},C.desiredOverMaxWidth){var x=C.width-u,w=e.TextMeasurementService.getTailoredTextOrDefault(C.textProperties,x);S.label=w}c+=C.width}return this.visibleLegendWidth=c,this.updateNavigationArrowLayout(r,m,h),h},i.prototype.calculateVerticalLayout=function(t,a,r,o){var n=this,s=this.legendFontSizeMarginDifference>0,l=s?this.legendFontSizeMarginDifference:0,c=20+l,u=15+l,h=4+l,d=c,p=i.TextAndIconPadding+i.LegendIconRadius+this.legendFontSizeMarginDifference/i.LegendIconRadiusFactor,g=2*p,m=o?this.parentViewport.width*i.LegendMaxWidthFactor-g-i.LegendEdgeMariginWidth:this.lastCalculatedWidth-g-i.LegendEdgeMariginWidth,f=t.length,y=0,v=this.parentViewport.height;a&&(d+=u,a.x=i.TextAndIconPadding,a.y=u,y=a.width||0),this.legendDataStartIndex>0&&(d+=i.LegendArrowOffset);for(var b=t.length,C=0;b>C;C++){var S=t[C],x=i.getTextProperties(!1,S.label,this.data.fontSize);S.glyphPosition={x:p,y:d+h-e.TextMeasurementService.estimateSvgTextBaselineDelta(x)},S.textPosition={x:g,y:d+h};var w=e.TextMeasurementService.measureSvgTextWidth(x);if(w>y&&(y=w),w>m){var P=e.TextMeasurementService.getTailoredTextOrDefault(x,m);S.label=P}if(d+=c,d>v){f=C;break}}return o?m>y?this.lastCalculatedWidth=this.viewport.width=Math.ceil(y+g+i.LegendEdgeMariginWidth):this.lastCalculatedWidth=this.viewport.width=Math.ceil(this.parentViewport.width*i.LegendMaxWidthFactor):this.viewport.width=this.lastCalculatedWidth,this.visibleLegendHeight=d,r.forEach(function(e){return e.x=n.lastCalculatedWidth/2}),this.updateNavigationArrowLayout(r,b,f),f},i.prototype.drawNavigationArrows=function(e){var a=this,r=this.group.selectAll(i.NavigationArrow.selector).data(e);r.enter().append("g").on("click",function(e){var t=a.legendDataStartIndex;a.legendDataStartIndex=0===e.type?t+a.arrowPosWindow:t-a.arrowPosWindow,a.drawLegendInternal(a.data,a.parentViewport,!1)}).classed(i.NavigationArrow["class"],!0).append("path"),r.attr("transform",function(e){return t.SVGUtil.translate(e.x,e.y)}).select("path").attr({d:function(e){return e.path},transform:function(e){return e.rotateTransform}}),r.exit().remove()},i.prototype.isTopOrBottom=function(e){switch(e){case o.Top:case o.Bottom:case o.BottomCenter:case o.TopCenter:return!0;default:return!1}},i.prototype.isCentered=function(e){switch(e){case o.BottomCenter:case o.LeftCenter:case o.RightCenter:case o.TopCenter:return!0;default:return!1}},i.prototype.reset=function(){},i.getTextProperties=function(e,t,a){return{text:t,fontFamily:e?i.DefaultTitleFontFamily:i.DefaultFontFamily,fontSize:r.fromPoint(a||i.DefaultFontSizeInPt)}},i.prototype.setTooltipToLegendItems=function(e){for(var t=0,i=e.dataPoints;t<i.length;t++){var a=i[t];a.tooltip=a.label}},i.DefaultFontSizeInPt=8,i.LegendIconRadius=5,i.LegendIconRadiusFactor=5,i.MaxTextLength=60,i.MaxTitleLength=80,i.TextAndIconPadding=5,i.TitlePadding=15,i.LegendEdgeMariginWidth=10,i.LegendMaxWidthFactor=.3,i.TopLegendHeight=24,i.DefaultTextMargin=r.fromPointToPixel(i.DefaultFontSizeInPt),i.DefaultMaxLegendFactor=i.MaxTitleLength/i.DefaultTextMargin,i.LegendIconYRatio=.52,i.LegendArrowOffset=10,i.LegendArrowHeight=15,i.LegendArrowWidth=7.5,i.DefaultFontFamily="wf_segoe-ui_normal",i.DefaultTitleFontFamily="wf_segoe-ui_Semibold",i.LegendItem=a("legendItem"),i.LegendText=a("legendText"),i.LegendIcon=a("legendIcon"),i.LegendTitle=a("legendTitle"),i.NavigationArrow=a("navArrow"),i}();t.SVGLegend=s;var l,c=function(){function i(e){this.legendContainerParent=d3.select(e.get(0))}return i.prototype.getMargins=function(){return{height:i.LegendHeight,width:0}},i.prototype.drawLegend=function(e){var t=e.dataPoints;if(!(t.length<1)){var a=this.legendContainerParent.select(i.LegendContainerSelector);if(a.empty()){if(!t.length)return;var r=$("<div></div>").height(this.getMargins().height).addClass(i.LegendContainerClass);$(this.legendContainerParent[0]).prepend(r),a=d3.select(r.get(0))}this.legendContainerDiv=a,this.drawTitle(t),this.drawLegendItems(t)}},i.prototype.reset=function(){this.legendContainerDiv&&(this.legendContainerDiv.remove(),this.legendContainerDiv=null)},i.prototype.isVisible=function(){return!0},i.prototype.changeOrientation=function(e){},i.prototype.getOrientation=function(){return o.Top},i.prototype.drawTitle=function(e){var t=this.legendContainerDiv.selectAll("div."+i.LegendTitleClass),a=t.data([e[0]]),r=a.enter(),o=r.append("div").attr("class",i.LegendTitleClass);o.filter(function(e){return e.iconOnlyOnLabel}).append("span").attr("class",i.legendIconClass).html(i.legendPlaceSelector),o.append("span"),a.filter(function(e){return e.iconOnlyOnLabel}).select("span."+i.legendIconClass).style(i.legendColorCss,function(e){return e.color}),a.select("span:last-child").text(function(e){return e.category})},i.prototype.drawLegendItems=function(t){this.ensureLegendTableCreated();var a=i.splitArrayToOddEven(t),r=this.legendContainerDiv.select("tbody").selectAll("tr").data(a),o=r.enter(),n=o.append("tr"),s=n.selectAll("td").data(function(e){return e},function(e){return e.label}).enter().append("td").attr("class",i.LegendItem),l=s.append("span");l.filter(function(e){return!e.iconOnlyOnLabel}).append("span").html(i.legendPlaceSelector).attr("class",i.legendIconClass).attr("white-space","nowrap"),l.append("span").attr("class",i.legendItemNameClass),l.append("span").attr("class",i.legendItemMeasureClass);var c=r.selectAll("td").data(function(e){return e},function(e){return e.label});c.select("span."+i.legendItemNameClass).html(function(t){return e.visuals.TextUtil.removeBreakingSpaces(t.label)}),c.select("span."+i.legendItemMeasureClass).html(function(e){return"&nbsp;"+e.measure}),c.select("span."+i.legendIconClass).style("color",function(e){return e.color}),c.exit().remove()},i.prototype.ensureLegendTableCreated=function(){if(this.legendContainerDiv.select("div table").empty()){var e=this.legendContainerDiv.append("div").append("table");e.style("table-layout","fixed").append("tbody"),this.setPanGestureOnLegend(e)}},i.prototype.setPanGestureOnLegend=function(e){var i=$(this.legendContainerDiv.select("div:nth-child(2)")[0]).width(),a=d3.scale.linear().domain([0,i]).range([0,i]),r=d3.behavior.zoom().scaleExtent([1,1]).x(a).on("zoom",function(){if($(e[0]).width()>i){var a=r.translate(),o=a[0],n=a[1];o=Math.min(o,0),o=Math.max(o,i-$(e[0]).width()),r.translate([o,n]),e.style("-ms-transform",function(){return t.SVGUtil.translateXWithPixels(o)}),e.style("-webkit-transform",function(){return t.SVGUtil.translateXWithPixels(o)}),e.style("transform",function(){return t.SVGUtil.translateXWithPixels(o)})}});this.legendContainerDiv?this.legendContainerDiv.call(r):e.call(r)},i.splitArrayToOddEven=function(e){for(var t=[],i=[],a=0;a<e.length;++a)a%2===0?i.push(e[a]):t.push(e[a]);return[i,t]},i.LegendHeight=70,i.LegendContainerClass="interactive-legend",i.LegendContainerSelector=".interactive-legend",i.LegendTitleClass="title",i.LegendItem="item",i.legendPlaceSelector="■",i.legendIconClass="icon",i.legendColorCss="color",i.legendItemNameClass="itemName",i.legendItemMeasureClass="itemMeasure",i}();!function(e){function i(e,i){if(null==i[t.legendProps.show]&&(i[t.legendProps.show]=!0),i[t.legendProps.show]===!1&&(e.dataPoints=[]),i[t.legendProps.show]===!0&&null==i[t.legendProps.position]&&(i[t.legendProps.position]=t.legendPosition.top),void 0!==i[t.legendProps.fontSize]&&(e.fontSize=i[t.legendProps.fontSize]),void 0!==i[t.legendProps.labelColor]){var a=i[t.legendProps.labelColor];null!=a&&(e.labelColor=a.solid.color)}i[t.legendProps.showTitle]===!1?e.title="":void 0!==i[t.legendProps.titleText]&&(e.title=i[t.legendProps.titleText])}e.DefaultLegendLabelFillColor="#666666",e.update=i}(l=t.LegendData||(t.LegendData={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.linear="linear",t.log="log",t.type=e.createEnumType([{value:t.linear,displayName:function(e){return e.get("Visual_Axis_Linear")}},{value:t.log,displayName:function(e){return e.get("Visual_Axis_Log")}}])}(i=t.axisScale||(t.axisScale={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.showBoth="showBoth",t.showTitleOnly="showTitleOnly",t.showUnitOnly="showUnitOnly",t.type=e.createEnumType([{value:t.showTitleOnly,displayName:function(e){return e.get("Visual_Axis_ShowTitleOnly")}},{value:t.showUnitOnly,displayName:function(e){return e.get("Visual_Axis_ShowUnitOnly")}},{value:t.showBoth,displayName:function(e){return e.get("Visual_Axis_ShowBoth")}}])}(i=t.axisStyle||(t.axisStyle={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.scalar="Scalar",t.categorical="Categorical",t.both="Both",t.type=e.createEnumType([{value:t.scalar,displayName:function(e){return e.get("Visual_Axis_Scalar")}},{value:t.categorical,displayName:function(e){return e.get("Visual_Axis_Categorical")}}])}(i=t.axisType||(t.axisType={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.rectangle="rectangle",t.oval="oval",t.line="line",t.arrow="arrow",t.triangle="triangle",t.type=e.createEnumType([{value:t.rectangle,displayName:"rectangle"},{value:t.oval,displayName:"oval"},{value:t.line,displayName:"line"},{value:t.arrow,displayName:"arrow"},{value:t.triangle,displayName:"triangle"}])}(i=t.basicShapeType||(t.basicShapeType={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.normal="Normal",t.fit="Fit",t.fill="Fill",t.type=e.createEnumType([{value:t.normal,displayName:function(e){return e.get("Visual_ImageScalingType_Normal")}},{value:t.fit,displayName:function(e){return e.get("Visual_ImageScalingType_Fit")}},{value:t.fill,displayName:function(e){return e.get("Visual_ImageScalingType_Fill")}}])}(i=t.imageScalingType||(t.imageScalingType={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.insideEnd="InsideEnd",t.insideCenter="InsideCenter",t.outsideEnd="OutsideEnd",t.insideBase="InsideBase",t.type=e.createEnumType([{value:t.insideEnd,displayName:function(e){return e.get("Visual_LabelPosition_InsideEnd")}},{value:t.outsideEnd,displayName:function(e){return e.get("Visual_LabelPosition_OutsideEnd")}},{value:t.insideCenter,displayName:function(e){return e.get("Visual_LabelPosition_InsideCenter")}},{value:t.insideBase,displayName:function(e){return e.get("Visual_LabelPosition_InsideBase")}}])}(i=t.labelPosition||(t.labelPosition={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.category="Category",t.data="Data",t.both="Both",t.type=e.createEnumType([{value:t.category,displayName:function(e){return e.get("Visual_LabelStyle_Category")}},{value:t.data,displayName:function(e){return e.get("Visual_LabelStyle_DataValue")}},{value:t.both,displayName:function(e){return e.get("Visual_LabelStyle_Both")}}])}(i=t.labelStyle||(t.labelStyle={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.top="Top",t.bottom="Bottom",t.left="Left",t.right="Right",t.topCenter="TopCenter",t.bottomCenter="BottomCenter",t.leftCenter="LeftCenter",t.rightCenter="RightCenter",t.type=e.createEnumType([{value:t.top,displayName:function(e){return e.get("Visual_LegendPosition_Top")}},{value:t.bottom,displayName:function(e){return e.get("Visual_LegendPosition_Bottom")}},{value:t.left,displayName:function(e){return e.get("Visual_LegendPosition_Left")}},{value:t.right,displayName:function(e){return e.get("Visual_LegendPosition_Right")}},{value:t.topCenter,displayName:function(e){return e.get("Visual_LegendPosition_TopCenter")}},{value:t.bottomCenter,displayName:function(e){return e.get("Visual_LegendPosition_BottomCenter")}},{value:t.leftCenter,displayName:function(e){return e.get("Visual_LegendPosition_LeftCenter")}},{value:t.rightCenter,displayName:function(e){return e.get("Visual_LegendPosition_RightCenter")}}])}(i=t.legendPosition||(t.legendPosition={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.positive="Positive",t.negative="Negative",t.type=e.createEnumType([{value:t.positive,displayName:function(e){return e.get("Visual_KPI_Direction_Positive")}},{value:t.negative,displayName:function(e){return e.get("Visual_KPI_Direction_Negative")}}])}(i=t.kpiDirection||(t.kpiDirection={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.dashed="dashed",t.solid="solid",t.dotted="dotted",t.type=e.createEnumType([{value:t.dashed,displayName:function(e){return e.get("Visual_LineStyle_Dashed")}},{value:t.solid,displayName:function(e){return e.get("Visual_LineStyle_Solid")}},{value:t.dotted,displayName:function(e){return e.get("Visual_LineStyle_Dotted")}}])}(i=t.lineStyle||(t.lineStyle={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){function i(e){return[t.topOnly,t.topBottom,t.frame].some(function(t){return t===e})}function a(e){return[t.rightOnly,t.leftRight,t.frame].some(function(t){return t===e})}function r(e){return[t.bottomOnly,t.topBottom,t.frame].some(function(t){return t===e})}function o(e){return[t.leftOnly,t.leftRight,t.frame].some(function(t){return t===e})}t.none="None",t.bottomOnly="BottomOnly",t.topOnly="TopOnly",t.leftOnly="LeftOnly",t.rightOnly="RightOnly",t.topBottom="TopBottom",t.leftRight="LeftRight",t.frame="Frame",t.showTop=i,t.showRight=a,t.showBottom=r,t.showLeft=o,t.type=e.createEnumType([{value:t.none,displayName:function(e){return e.get("Visual_Outline_none")}},{value:t.bottomOnly,displayName:function(e){return e.get("Visual_Outline_bottom_only")}},{value:t.topOnly,displayName:function(e){return e.get("Visual_Outline_top_only")}},{value:t.leftOnly,displayName:function(e){return e.get("Visual_Outline_LeftOnly")}},{value:t.rightOnly,displayName:function(e){return e.get("Visual_Outline_RightOnly")}},{value:t.topBottom,displayName:function(e){return e.get("Visual_Outline_top_Bottom")}},{value:t.leftRight,displayName:function(e){return e.get("Visual_Outline_leftRight")}},{value:t.frame,displayName:function(e){return e.get("Visual_Outline_frame")}}])}(i=t.outline||(t.outline={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.back="back",t.front="front",t.type=e.createEnumType([{value:t.back,displayName:function(e){return e.get("Visual_Reference_Line_Behind")}},{value:t.front,displayName:function(e){return e.get("Visual_Reference_Line_InFront")}}])}(i=t.referenceLinePosition||(t.referenceLinePosition={}));var a;!function(t){t.left="left",t.right="right",t.type=e.createEnumType([{value:t.left,displayName:function(e){return e.get("Visual_Reference_Line_Data_Label_Left")}},{value:t.right,displayName:function(e){return e.get("Visual_Reference_Line_Data_Label_Right")}}])}(a=t.referenceLineDataLabelHorizontalPosition||(t.referenceLineDataLabelHorizontalPosition={}));var r;!function(t){t.above="above",t.under="under",t.type=e.createEnumType([{value:t.above,displayName:function(e){return e.get("Visual_Reference_Line_Data_Label_Above")}},{value:t.under,displayName:function(e){return e.get("Visual_Reference_Line_Data_Label_Under")}}])}(r=t.referenceLineDataLabelVerticalPosition||(t.referenceLineDataLabelVerticalPosition={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.type=e.createEnumType([{value:0,displayName:function(e){return e.get("Slicer_Orientation_Vertical")}},{value:1,displayName:function(e){return e.get("Slicer_Orientation_Horizontal")}}])}(i=t.slicerOrientation||(t.slicerOrientation={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.left="Left",t.right="Right",t.type=e.createEnumType([{value:t.left,displayName:function(e){return e.get("Visual_yAxis_Left")}},{value:t.right,displayName:function(e){return e.get("Visual_yAxis_Right")}}])}(i=t.yAxisPosition||(t.yAxisPosition={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(e,t){return t||!e?0:e.getDuration()}e.MinervaAnimationDuration=250,e.MaxDataPointsToAnimate=1e3,e.GetAnimationDuration=t}(t=e.AnimatorCommon||(e.AnimatorCommon={}));var i=function(){function e(e){e&&e.duration&&(this.animationDuration=e.duration),this.animationDuration=this.animationDuration>=0?this.animationDuration:t.MinervaAnimationDuration}return e.prototype.getDuration=function(){return this.animationDuration},e.prototype.animate=function(e){return null},e.prototype.getEasing=function(){return"cubic-in-out"},e}();e.BaseAnimator=i}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(t){function i(e){t.call(this,e)}return __extends(i,t),i.prototype.animate=function(t){var i={failed:!0,shapes:null},a=t.viewModel,r=this.previousViewModel,o=a.categories.length*a.series.length;return o>e.AnimatorCommon.MaxDataPointsToAnimate?i:(r&&(a.hasHighlights&&!r.hasHighlights?i=this.animateNormalToHighlighted(t):a.hasHighlights&&r.hasHighlights?i=this.animateHighlightedToHighlighted(t):!a.hasHighlights&&r.hasHighlights&&(i=this.animateHighlightedToNormal(t))),this.previousViewModel=a,i)},i.prototype.animateNormalToHighlighted=function(t){var i=t.viewModel,a=t.itemCS,r=t.series.selectAll(a.selector),o=r.data(function(e){return e.data},function(e){return e.key}),n=i.hasHighlights;return o.enter().append("rect").attr("class",function(e){return a["class"].concat(e.highlight?" highlight":"")}).attr(t.layout.shapeLayoutWithoutHighlights),o.style("fill",function(e){return e.color}).style("fill-opacity",function(t){return e.ColumnUtil.getFillOpacity(t.selected,t.highlight,!1,n)}).transition().duration(this.animationDuration).attr(t.layout.shapeLayout),o.exit().remove(),{failed:!1,shapes:o}},i.prototype.animateHighlightedToHighlighted=function(e){var t=this.animateDefaultShapes(e.viewModel,e.series,e.layout,e.itemCS);return{failed:!1,shapes:t}},i.prototype.animateHighlightedToNormal=function(t){var i=t.itemCS,a=t.series.selectAll(i.selector),r=a.data(function(e){return e.data},function(e){return e.key}),o=t.interactivityService&&t.interactivityService.hasSelection();return r.enter().append("rect").attr("class",function(e){return i["class"].concat(e.highlight?" highlight":"")}),r.style("fill",function(e){return e.color}).style("fill-opacity",function(t){return e.ColumnUtil.getFillOpacity(t.selected,t.highlight,t.selected,!t.selected)}).transition().duration(this.animationDuration).attr(t.layout.shapeLayout).transition().duration(0).delay(this.animationDuration).style("fill-opacity",function(t){return e.ColumnUtil.getFillOpacity(t.selected,t.highlight,o,!1)}),r.exit().transition().duration(this.animationDuration).attr(o?t.layout.zeroShapeLayout:t.layout.shapeLayoutWithoutHighlights).remove(),{failed:!1,shapes:r}},i.prototype.animateDefaultShapes=function(t,i,a,r){var o=i.selectAll(r.selector),n=o.data(function(e){return e.data},function(e){return e.key});return n.enter().append("rect").attr("class",function(e){return r["class"].concat(e.highlight?" highlight":"")}),n.style("fill",function(e){return e.color}).style("fill-opacity",function(i){return e.ColumnUtil.getFillOpacity(i.selected,i.highlight,!1,t.hasHighlights)}).transition().duration(this.animationDuration).attr(a.shapeLayout),n.exit().remove(),n},i}(e.BaseAnimator);e.WebColumnChartAnimator=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(t){function i(e){t.call(this,e)}return __extends(i,t),i.prototype.animate=function(e){var t={failed:!0,shapes:null,highlightShapes:null},i=e.viewModel,a=this.previousViewModel;return a&&(i.hasHighlights&&!a.hasHighlights?t=this.animateNormalToHighlighted(e):i.hasHighlights&&a.hasHighlights?t=this.animateHighlightedToHighlighted(e):!i.hasHighlights&&a.hasHighlights&&(t=this.animateHighlightedToNormal(e))),this.previousViewModel=i,t},i.prototype.animateNormalToHighlighted=function(t){
2var i=this.animateDefaultShapes(t),a=t.graphicsContext.select(".slices").selectAll("path.slice-highlight").data(t.viewModel.dataPoints.filter(function(e){return null!=e.data.highlightRatio}),function(e){return e.data.identity.getKey()});return a.enter().insert("path").classed("slice-highlight",!0).each(function(e){this._current=e}),e.DonutChart.isSingleColor(t.viewModel.dataPoints.filter(function(e){return null!=e.data.highlightRatio})),a.style("fill",function(e){return e.data.color?e.data.color:t.colors.getNewColorScale().getColor(e.data.identity.getKey()).value}).style("fill-opacity",function(i){return e.ColumnUtil.getFillOpacity(i.data.selected,!0,!1,t.viewModel.hasHighlights)}).style("stroke-dasharray",function(i){return e.DonutChart.drawStrokeForDonutChart(t.radius,t.innerArcRadiusRatio,i,t.sliceWidthRatio,i.data.highlightRatio)}).style("stroke-width",function(e){return e.data.strokeWidth}).attr(t.layout.shapeLayout).transition().duration(this.animationDuration).attr(t.layout.highlightShapeLayout),a.exit().remove(),e.NewDataLabelUtils.drawDefaultLabels(t.labelGraphicsContext,t.labels,!1,!0,!0),e.NewDataLabelUtils.drawLabelLeaderLines(t.labelGraphicsContext,t.labels),{failed:!1,shapes:i,highlightShapes:a}},i.prototype.animateHighlightedToHighlighted=function(t){var i=this.animateDefaultShapes(t),a=this.animateDefaultHighlightShapes(t);return e.NewDataLabelUtils.drawDefaultLabels(t.labelGraphicsContext,t.labels,!1,!0,!0),e.NewDataLabelUtils.drawLabelLeaderLines(t.labelGraphicsContext,t.labels),{failed:!1,shapes:i,highlightShapes:a}},i.prototype.animateHighlightedToNormal=function(t){var i=t.interactivityService&&t.interactivityService.hasSelection(),a=this.animationDuration,r=t.graphicsContext.select(".slices").selectAll("path.slice").data(t.viewModel.dataPoints,function(e){return e.data.identity.getKey()});r.enter().insert("path").classed("slice",!0).each(function(e){this._current=e}),e.DonutChart.isSingleColor(t.viewModel.dataPoints),r.style("fill",function(e){return e.data.color?e.data.color:t.colors.getNewColorScale().getColor(e.data.identity.getKey()).value}).style("fill-opacity",function(t){return e.ColumnUtil.getFillOpacity(t.data.selected,!1,t.data.selected,!t.data.selected)}).style("stroke-dasharray",function(i){return e.DonutChart.drawStrokeForDonutChart(t.radius,t.innerArcRadiusRatio,i,t.sliceWidthRatio)}).style("stroke-width",function(e){return e.data.strokeWidth}).transition().duration(a).attr(t.layout.shapeLayout).transition().duration(0).delay(a).style("fill-opacity",function(t){return e.ColumnUtil.getFillOpacity(t.data.selected,!1,i,!1)}),r.exit().remove();var o=t.graphicsContext.select(".slices").selectAll("path.slice-highlight").data(t.viewModel.dataPoints.filter(function(e){return null!=e.data.highlightRatio}),function(e){return e.data.identity.getKey()});return o.enter().insert("path").classed("slice-highlight",!0).each(function(e){this._current=e}),e.DonutChart.isSingleColor(t.viewModel.dataPoints.filter(function(e){return null!=e.data.highlightRatio})),o.style("fill",function(e){return e.data.color?e.data.color:t.colors.getNewColorScale().getColor(e.data.identity.getKey()).value}).style("fill-opacity",function(t){return e.ColumnUtil.getFillOpacity(!1,!0,!1,!0)}).style("stroke-dasharray",function(i){return e.DonutChart.drawStrokeForDonutChart(t.radius,t.innerArcRadiusRatio,i,t.sliceWidthRatio,i.data.highlightRatio)}).style("stroke-width",function(e){return e.data.strokeWidth}).transition().duration(a).attr(i?t.layout.zeroShapeLayout:t.layout.shapeLayout).remove(),o.exit().remove(),e.NewDataLabelUtils.drawDefaultLabels(t.labelGraphicsContext,t.labels,!1,!0,!0),e.NewDataLabelUtils.drawLabelLeaderLines(t.labelGraphicsContext,t.labels),{failed:!1,shapes:r,highlightShapes:o}},i.prototype.animateDefaultShapes=function(t){var i=t.graphicsContext.select(".slices").selectAll("path.slice").data(t.viewModel.dataPoints,function(e){return e.data.identity.getKey()});return i.enter().insert("path").classed("slice",!0).each(function(e){this._current=e}),e.DonutChart.isSingleColor(t.viewModel.dataPoints),i.style("fill",function(e){return e.data.color?e.data.color:t.colors.getNewColorScale().getColor(e.data.identity.getKey()).value}).style("fill-opacity",function(i){return e.ColumnUtil.getFillOpacity(i.data.selected,!1,!1,t.viewModel.hasHighlights)}).style("stroke-dasharray",function(i){return e.DonutChart.drawStrokeForDonutChart(t.radius,t.innerArcRadiusRatio,i,t.sliceWidthRatio)}).style("stroke-width",function(e){return e.data.strokeWidth}).transition().duration(this.animationDuration).attr(t.layout.shapeLayout),i.exit().remove(),i},i.prototype.animateDefaultHighlightShapes=function(t){var i=t.graphicsContext.select(".slices").selectAll("path.slice-highlight").data(t.viewModel.dataPoints.filter(function(e){return null!=e.data.highlightRatio}),function(e){return e.data.identity.getKey()});return i.enter().insert("path").classed("slice-highlight",!0).each(function(e){this._current=e}),e.DonutChart.isSingleColor(t.viewModel.dataPoints.filter(function(e){return null!=e.data.highlightRatio})),i.style("fill",function(e){return e.data.color?e.data.color:t.colors.getNewColorScale().getColor(e.data.identity.getKey()).value}).style("fill-opacity",function(i){return e.ColumnUtil.getFillOpacity(i.data.selected,!0,!1,t.viewModel.hasHighlights)}).style("stroke-dasharray",function(i){return e.DonutChart.drawStrokeForDonutChart(t.radius,t.innerArcRadiusRatio,i,t.sliceWidthRatio,i.data.highlightRatio)}).style("stroke-width",function(e){return e.data.strokeWidth}).transition().duration(this.animationDuration).attr(t.layout.highlightShapeLayout),i.exit().remove(),i},i}(e.BaseAnimator);e.WebDonutChartAnimator=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=function(i){function a(e){i.call(this,e)}return __extends(a,i),a.prototype.animate=function(e){var t={failed:!0,shapes:null,dataLabels:null},i=e.viewModel,a=this.previousViewModel;return a&&(i.hasHighlights&&!a.hasHighlights?t=this.animateNormalToHighlighted(e):i.hasHighlights&&a.hasHighlights?t=this.animateHighlightedToHighlighted(e):!i.hasHighlights&&a.hasHighlights&&(t=this.animateHighlightedToNormal(e))),this.previousViewModel=i,t},a.prototype.animateNormalToHighlighted=function(e){var i=e.viewModel,a=e.layout,r=!0,o=!1;this.animateDefaultAxis(e.axisGraphicsContext,e.axisOptions,e.isHidingPercentBars);var n=e.shapeGraphicsContext.selectAll(t.FunnelChart.Selectors.funnel.bars.selector).data(i.slices,function(e){return e.key});n.enter().append("rect").attr("class",function(e){return e.highlight?t.FunnelChart.FunnelBarHighlightClass:t.FunnelChart.Selectors.funnel.bars["class"]}).attr(a.shapeLayoutWithoutHighlights),n.style("fill",function(e){return e.color}).style("fill-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.selected,e.highlight,o,r)}).transition().duration(this.animationDuration).attr(a.shapeLayout),n.exit().remove(),this.animatePercentBars(e);var s=this.animateDefaultDataLabels(e);return{failed:!1,shapes:n,dataLabels:s}},a.prototype.animateHighlightedToHighlighted=function(e){var t=e.viewModel,i=e.layout;this.animateDefaultAxis(e.axisGraphicsContext,e.axisOptions,e.isHidingPercentBars);var a=this.animateDefaultShapes(t,t.slices,e.shapeGraphicsContext,i);this.animatePercentBars(e);var r=this.animateDefaultDataLabels(e);return{failed:!1,shapes:a,dataLabels:r}},a.prototype.animateHighlightedToNormal=function(e){var i=e.viewModel,a=e.layout,r=e.interactivityService?e.interactivityService.hasSelection():!1;this.animateDefaultAxis(e.axisGraphicsContext,e.axisOptions,e.isHidingPercentBars);var o=e.shapeGraphicsContext.selectAll(t.FunnelChart.Selectors.funnel.bars.selector).data(i.slices,function(e){return e.key});o.enter().append("rect").attr("class",function(e){return e.highlight?t.FunnelChart.FunnelBarHighlightClass:t.FunnelChart.Selectors.funnel.bars["class"]}),o.style("fill",function(e){return e.color}).style("fill-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.selected,e.highlight,r,!e.selected)}).transition().duration(this.animationDuration).attr(a.shapeLayoutWithoutHighlights).transition().duration(0).delay(this.animationDuration).style("fill-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.selected,e.highlight,r,!1)});var n=o.exit();n.transition().duration(this.animationDuration).attr(r?a.zeroShapeLayout:a.shapeLayoutWithoutHighlights).remove(),this.animatePercentBars(e);var s=this.animateDefaultDataLabels(e);return{failed:!1,shapes:o,dataLabels:s}},a.prototype.animateDefaultAxis=function(e,i,a){var r=d3.scale.ordinal().domain(i.categoryLabels).rangeBands([i.rangeStart,i.rangeEnd],i.barToSpaceRatio,a?i.barToSpaceRatio:t.FunnelChart.PercentBarToBarRatio),o=d3.svg.axis().scale(r).orient("right").tickPadding(t.FunnelChart.TickPadding).innerTickSize(t.FunnelChart.InnerTickSize);e.classed("axis",!0).transition().duration(this.animationDuration).attr("transform",t.SVGUtil.translate(0,i.margin.top)).call(o)},a.prototype.animateDefaultShapes=function(e,i,a,r){var o=e.hasHighlights,n=a.selectAll(t.FunnelChart.Selectors.funnel.bars.selector).data(i,function(e){return e.key});return n.enter().append("rect").attr("class",function(e){return e.highlight?t.FunnelChart.FunnelBarHighlightClass:t.FunnelChart.Selectors.funnel.bars["class"]}),n.style("fill",function(e){return e.color}).style("fill-opacity",function(e){return function(e){return t.ColumnUtil.getFillOpacity(e.selected,e.highlight,!1,o)}}).transition().duration(this.animationDuration).attr(r.shapeLayout),n.exit().remove(),n},a.prototype.animateDefaultDataLabels=function(e){var i;return e.viewModel.dataLabelsSettings.show&&e.viewModel.canShowDataLabels?i=t.dataLabelUtils.drawDefaultLabelsForFunnelChart(e.viewModel.slices,e.labelGraphicsContext,e.labelLayout,!0,this.animationDuration):t.dataLabelUtils.cleanDataLabels(e.labelGraphicsContext),i},a.prototype.animatePercentBars=function(e){var i=e.viewModel,a=e.isHidingPercentBars;if(a||!i.slices||(i.hasHighlights?i.slices.length/2:i.slices.length)<2)return void this.animatePercentBarComponents([],e);var r=[i.slices[i.hasHighlights?1:0],i.slices[i.slices.length-1]],o=t.FunnelChart.getFunnelSliceValue(r[0]);if(0>=o)return void this.animatePercentBarComponents([],e);var n=r.map(function(e,i){return{value:t.FunnelChart.getFunnelSliceValue(e),percent:0===i?1:t.FunnelChart.getFunnelSliceValue(e)/o,isTop:0===i}});this.animatePercentBarComponents(n,e)},a.prototype.animateToFunnelPercent=function(e,t,i){return e.data(t).transition().duration(this.animationDuration).attr(i)},a.prototype.animatePercentBarComponents=function(i,a){var r=a.percentGraphicsContext,o=a.layout,n=[{percent:0,value:0,isTop:!0},{percent:0,value:0,isTop:!1}],s=r.selectAll(t.FunnelChart.Selectors.percentBar.mainLine.selector).data(i);this.animateToFunnelPercent(s.exit(),n,o.percentBarLayout.mainLine).remove(),s.enter().append("line").classed(t.FunnelChart.Selectors.percentBar.mainLine["class"],!0).data(n).attr(o.percentBarLayout.mainLine),this.animateToFunnelPercent(s,i,o.percentBarLayout.mainLine);var l=r.selectAll(t.FunnelChart.Selectors.percentBar.leftTick.selector).data(i);this.animateToFunnelPercent(l.exit(),n,o.percentBarLayout.leftTick).remove(),l.enter().append("line").classed(t.FunnelChart.Selectors.percentBar.leftTick["class"],!0).data(n).attr(o.percentBarLayout.leftTick),this.animateToFunnelPercent(l,i,o.percentBarLayout.leftTick);var c=r.selectAll(t.FunnelChart.Selectors.percentBar.rightTick.selector).data(i);this.animateToFunnelPercent(c.exit(),n,o.percentBarLayout.rightTick).remove(),c.enter().append("line").classed(t.FunnelChart.Selectors.percentBar.rightTick["class"],!0).data(n).attr(o.percentBarLayout.rightTick),this.animateToFunnelPercent(c,i,o.percentBarLayout.rightTick);var u=r.selectAll(t.FunnelChart.Selectors.percentBar.text.selector).data(i);this.animateToFunnelPercent(u.exit(),n,o.percentBarLayout.text).remove(),u.enter().append("text").classed(t.FunnelChart.Selectors.percentBar.text["class"],!0).data(n).attr(o.percentBarLayout.text),this.animateToFunnelPercent(u,i,o.percentBarLayout.text).text(function(i){return e.formattingService.formatValue(i.percent,t.valueFormatter.getLocalizedString("Percentage1"))}),t.SVGUtil.flushAllD3TransitionsIfNeeded(a.visualInitOptions)},a}(t.BaseAnimator);t.WebFunnelAnimator=i}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(t){function i(e){t.call(this,e)}return __extends(i,t),i.prototype.animate=function(e){var t={failed:!0,shapes:null,highlightShapes:null,majorLabels:null,minorLabels:null},i=e.viewModel,a=this.previousViewModel;return a&&(i.hasHighlights&&!a.hasHighlights?t=this.animateNormalToHighlighted(e):i.hasHighlights&&a.hasHighlights?t=this.animateHighlightedToHighlighted(e):!i.hasHighlights&&a.hasHighlights&&(t=this.animateHighlightedToNormal(e))),this.previousViewModel=i,t},i.prototype.animateNormalToHighlighted=function(t){var i=!1,a=!0,r=this.animateDefaultShapes(t.shapeGraphicsContext,t.nodes,i,a,t.layout),o=t.shapeGraphicsContext.selectAll("."+e.Treemap.HighlightNodeClassName).data(t.highlightNodes,function(e){return e.key+"highlight"});o.enter().append("rect").attr("class",t.layout.highlightShapeClass).attr(t.layout.shapeLayout),o.style("fill",function(t){return e.Treemap.getFill(t,!0)}).style("fill-opacity",function(t){return e.Treemap.getFillOpacity(t,i,a,!0)}).transition().duration(this.animationDuration).attr(t.layout.highlightShapeLayout),o.exit().remove();var n=this.animateDefaultMajorLabels(t.labelGraphicsContext,t.majorLabeledNodes,t.labelSettings,t.layout),s=this.animateDefaultMinorLabels(t.labelGraphicsContext,t.minorLabeledNodes,t.labelSettings,t.layout);return{failed:!1,shapes:r,highlightShapes:o,majorLabels:n,minorLabels:s}},i.prototype.animateHighlightedToHighlighted=function(t){var i=!1,a=!0,r=this.animateDefaultShapes(t.shapeGraphicsContext,t.nodes,i,a,t.layout);t.shapeGraphicsContext.selectAll("."+e.Treemap.HighlightNodeClassName).data(t.highlightNodes,function(e){return e.key+"highlight"});var o=this.animateDefaultHighlightShapes(t.shapeGraphicsContext,t.highlightNodes,i,a,t.layout),n=this.animateDefaultMajorLabels(t.labelGraphicsContext,t.majorLabeledNodes,t.labelSettings,t.layout),s=this.animateDefaultMinorLabels(t.labelGraphicsContext,t.minorLabeledNodes,t.labelSettings,t.layout);return{failed:!1,shapes:r,highlightShapes:o,majorLabels:n,minorLabels:s}},i.prototype.animateHighlightedToNormal=function(t){var i=t.interactivityService?t.interactivityService.hasSelection():!1,a=t.shapeGraphicsContext.selectAll("."+e.Treemap.TreemapNodeClassName).data(t.nodes,function(e){return e.key});a.enter().append("rect").attr("class",t.layout.shapeClass),a.transition().duration(this.animationDuration).style("fill",function(t){return e.Treemap.getFill(t,!1)}).style("fill-opacity",function(t){return e.ColumnUtil.getFillOpacity(t.selected,!1,t.selected,!t.selected)}).attr(t.layout.shapeLayout).transition().duration(0).delay(this.animationDuration).style("fill-opacity",function(t){return e.ColumnUtil.getFillOpacity(t.selected,!1,i,!1)}),a.exit().remove();var r=t.shapeGraphicsContext.selectAll("."+e.Treemap.HighlightNodeClassName).data(t.nodes,function(e){return e.key+"highlight"});r.enter().append("rect").attr("class",t.layout.highlightShapeClass),r.style("fill",function(t){return e.Treemap.getFill(t,!0)}).style("fill-opacity",function(t){return e.ColumnUtil.getFillOpacity(t.selected,!0,t.selected,!t.selected)}).transition().duration(this.animationDuration).attr(i?t.layout.zeroShapeLayout:t.layout.shapeLayout).remove(),r.exit().remove();var o=this.animateDefaultMajorLabels(t.labelGraphicsContext,t.majorLabeledNodes,t.labelSettings,t.layout),n=this.animateDefaultMinorLabels(t.labelGraphicsContext,t.minorLabeledNodes,t.labelSettings,t.layout);return{failed:!1,shapes:a,highlightShapes:r,majorLabels:o,minorLabels:n}},i.prototype.animateDefaultShapes=function(t,i,a,r,o){var n=!1,s=t.selectAll("."+e.Treemap.TreemapNodeClassName).data(i,function(e){return e.key});return s.enter().append("rect").attr("class",o.shapeClass),s.transition().duration(this.animationDuration).style("fill",function(t){return e.Treemap.getFill(t,n)}).style("fill-opacity",function(t){return e.Treemap.getFillOpacity(t,a,r,n)}).attr(o.shapeLayout),s.exit().remove(),s},i.prototype.animateDefaultHighlightShapes=function(t,i,a,r,o){var n=!0,s=t.selectAll("."+e.Treemap.HighlightNodeClassName).data(i,function(e){return e.key+"highlight"});return s.enter().append("rect").attr("class",o.highlightShapeClass),s.transition().duration(this.animationDuration).style("fill",function(t){return e.Treemap.getFill(t,n)}).style("fill-opacity",function(t){return e.Treemap.getFillOpacity(t,a,r,n)}).attr(o.highlightShapeLayout),s.exit().remove(),s},i.prototype.animateDefaultMajorLabels=function(t,i,a,r){var o=t.selectAll("."+e.Treemap.MajorLabelClassName).data(i,function(e){return e.key});return o.enter().append("text").attr("class",r.majorLabelClass),o.text(r.majorLabelText).style("fill",function(){return a.labelColor}).transition().duration(this.animationDuration).attr(r.majorLabelLayout),o.exit().remove(),o},i.prototype.animateDefaultMinorLabels=function(t,i,a,r){var o=t.selectAll("."+e.Treemap.MinorLabelClassName).data(i,function(e){return e.key});return o.enter().append("text").attr("class",r.minorLabelClass),o.text(r.minorLabelText).style("fill",function(){return a.labelColor}).transition().duration(this.animationDuration).attr(r.minorLabelLayout),o.exit().remove(),o},i}(e.BaseAnimator);e.WebTreemapAnimator=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.StandardObjectProperties={axisEnd:{displayName:e.data.createDisplayNameGetter("Visual_Axis_End"),description:e.data.createDisplayNameGetter("Visual_Axis_EndDescription"),placeHolderText:e.data.createDisplayNameGetter("Visual_Precision_Auto"),type:{numeric:!0},suppressFormatPainterCopy:!0},axisScale:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Scale"),type:{enumeration:t.axisScale.type}},axisStart:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Start"),description:e.data.createDisplayNameGetter("Visual_Axis_StartDescription"),placeHolderText:e.data.createDisplayNameGetter("Visual_Precision_Auto"),type:{numeric:!0},suppressFormatPainterCopy:!0},axisStyle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Style"),type:{enumeration:t.axisStyle.type}},axisType:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Type"),type:{enumeration:t.axisType.type}},backColor:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_BackColor"),description:e.data.createDisplayNameGetter("Visual_Tablix_BackColor_Desc"),type:{fill:{solid:{color:!0}}}},dataColor:{displayName:e.data.createDisplayNameGetter("Visual_LabelsFill"),description:e.data.createDisplayNameGetter("Visual_LabelsFillDescription"),type:{fill:{solid:{color:!0}}}},dataLabelColor:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Data_Label_Color"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Data_Label_Color_Description"),type:{fill:{solid:{color:!0}}}},dataLabelDecimalPoints:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Data_Decimal_Points"),placeHolderText:e.data.createDisplayNameGetter("Visual_Precision_Auto"),type:{numeric:!0}},dataLabelDisplayUnits:{displayName:e.data.createDisplayNameGetter("Visual_DisplayUnits"),description:e.data.createDisplayNameGetter("Visual_DisplayUnitsDescription"),type:{formatting:{labelDisplayUnits:!0}},suppressFormatPainterCopy:!0},dataLabelHorizontalPosition:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Data_Horizontal_Position"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Data_Label_Horizontal_Position_Description"),type:{enumeration:t.referenceLineDataLabelHorizontalPosition.type}},dataLabelShow:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Data_Label"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Data_Label_Show_Description"),type:{bool:!0}},dataLabelVerticalPosition:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Data_Vertical_Position"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Data_Label_Vertical_Position_Description"),type:{enumeration:t.referenceLineDataLabelVerticalPosition.type}},defaultColor:{displayName:e.data.createDisplayNameGetter("Visual_DefaultColor"),type:{fill:{solid:{color:!0}}}},fill:{displayName:e.data.createDisplayNameGetter("Visual_Fill"),type:{fill:{solid:{color:!0}}}},fontColor:{displayName:e.data.createDisplayNameGetter("Visual_FontColor"),description:e.data.createDisplayNameGetter("Visual_Tablix_FontColor_Desc"),type:{fill:{solid:{color:!0}}}},fontSize:{displayName:e.data.createDisplayNameGetter("Visual_TextSize"),type:{formatting:{fontSize:!0}}},formatString:{type:{formatting:{formatString:!0}}},image:{type:{image:{}}},labelColor:{displayName:e.data.createDisplayNameGetter("Visual_LegendTitleColor"),type:{fill:{solid:{color:!0}}}},labelDisplayUnits:{displayName:e.data.createDisplayNameGetter("Visual_DisplayUnits"),description:e.data.createDisplayNameGetter("Visual_DisplayUnitsDescription"),type:{formatting:{labelDisplayUnits:!0}}},labelPrecision:{displayName:e.data.createDisplayNameGetter("Visual_Precision"),description:e.data.createDisplayNameGetter("Visual_PrecisionDescription"),placeHolderText:e.data.createDisplayNameGetter("Visual_Precision_Auto"),type:{numeric:!0}},legendPosition:{displayName:e.data.createDisplayNameGetter("Visual_LegendPosition"),description:e.data.createDisplayNameGetter("Visual_LegendPositionDescription"),type:{enumeration:t.legendPosition.type}},legendTitle:{displayName:e.data.createDisplayNameGetter("Visual_LegendName"),description:e.data.createDisplayNameGetter("Visual_LegendNameDescription"),type:{text:!0}},lineColor:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Color"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Color_Description"),type:{fill:{solid:{color:!0}}}},outline:{displayName:e.data.createDisplayNameGetter("Visual_Outline"),type:{enumeration:t.outline.type}},outlineColor:{displayName:e.data.createDisplayNameGetter("Visual_OutlineColor"),description:e.data.createDisplayNameGetter("Visual_OutlineColor_Desc"),type:{fill:{solid:{color:!0}}}},outlineWeight:{displayName:e.data.createDisplayNameGetter("Visual_OutlineWeight"),description:e.data.createDisplayNameGetter("Visual_OutlineWeight_Desc"),type:{numeric:!0}},show:{displayName:e.data.createDisplayNameGetter("Visual_Show"),type:{bool:!0}},showAllDataPoints:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint_Show_All"),type:{bool:!0}},showLegendTitle:{displayName:e.data.createDisplayNameGetter("Visual_LegendShowTitle"),description:e.data.createDisplayNameGetter("Visual_LegendShowTitleDescription"),type:{bool:!0}},referenceLinePosition:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Arrange"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Arrange_Description"),type:{enumeration:t.referenceLinePosition.type}},referenceLineStyle:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Style"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Style_Description"),type:{enumeration:t.lineStyle.type}},transparency:{displayName:e.data.createDisplayNameGetter("Visual_Background_Transparency"),description:e.data.createDisplayNameGetter("Visual_Background_TransparencyDescription"),type:{numeric:!0}},yAxisPosition:{displayName:e.data.createDisplayNameGetter("Visual_YAxis_Position"),description:e.data.createDisplayNameGetter("Visual_YAxis_PositionDescription"),type:{enumeration:t.yAxisPosition.type}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){e.animatedTextObjectDescs={general:{properties:{formatString:e.StandardObjectProperties.formatString}}},e.animatedNumberCapabilities={objects:e.animatedTextObjectDescs,dataViewMappings:[{single:{role:"Values"}}],supportsSelection:!1}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.basicShapeCapabilities={objects:{line:{displayName:e.data.createDisplayNameGetter("Visual_BasicShape_Line"),properties:{lineColor:{displayName:e.data.createDisplayNameGetter("Visual_BasicShape_LineColor"),type:{fill:{solid:{color:!0}}}},transparency:t.StandardObjectProperties.transparency,weight:{displayName:e.data.createDisplayNameGetter("Visual_BasicShape_Weight"),type:{numeric:!0}},roundEdge:{displayName:e.data.createDisplayNameGetter("Visual_BasicShape_RoundEdges"),type:{numeric:!0}}}},fill:{displayName:e.data.createDisplayNameGetter("Visual_Fill"),properties:{show:t.StandardObjectProperties.show,fillColor:{displayName:e.data.createDisplayNameGetter("Visual_BasicShape_FillColor"),type:{fill:{solid:{color:!0}}}},transparency:t.StandardObjectProperties.transparency}},rotation:{displayName:e.data.createDisplayNameGetter("Visual_BasicShape_Rotate"),properties:{angle:{displayName:e.data.createDisplayNameGetter("Visual_BasicShape_Rotate"),type:{numeric:!0}}}},general:{properties:{shapeType:{type:{text:!0},suppressFormatPainterCopy:!0}}}},suppressDefaultTitle:!0,suppressDefaultPadding:!0,canRotate:!1,supportsSelection:!1},t.basicShapeProps={general:{shapeType:{objectName:"general",propertyName:"shapeType"}},line:{transparency:{objectName:"line",propertyName:"transparency"},weight:{objectName:"line",propertyName:"weight"},roundEdge:{objectName:"line",propertyName:"roundEdge"},lineColor:{objectName:"line",propertyName:"lineColor"}},fill:{transparency:{objectName:"fill",propertyName:"transparency"},fillColor:{objectName:"fill",propertyName:"fillColor"},show:{objectName:"fill",propertyName:"show"}},rotation:{angle:{objectName:"rotation",propertyName:"angle"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){function i(i){return void 0===i&&(i=!1),{dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Axis"),description:e.data.createDisplayNameGetter("Role_DisplayName_AxisDescription"),cartesianKind:0},{name:"Series",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Legend"),description:e.data.createDisplayNameGetter("Role_DisplayName_LegendDescription")},{name:"Y",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Value"),requiredTypes:[{numeric:!0},{integer:!0}],cartesianKind:1},{name:"Gradient",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Gradient"),description:e.data.createDisplayNameGetter("Role_DisplayName_GradientDescription"),requiredTypes:[{numeric:!0},{integer:!0}]}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString}},legend:{displayName:e.data.createDisplayNameGetter("Visual_Legend"),description:e.data.createDisplayNameGetter("Visual_LegendDescription"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.legendPosition,showTitle:t.StandardObjectProperties.showLegendTitle,titleText:$.extend({},t.StandardObjectProperties.legendTitle,{suppressFormatPainterCopy:!0}),labelColor:t.StandardObjectProperties.labelColor,fontSize:t.StandardObjectProperties.fontSize}},categoryAxis:{displayName:i?e.data.createDisplayNameGetter("Visual_YAxis"):e.data.createDisplayNameGetter("Visual_XAxis"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.yAxisPosition,axisScale:t.StandardObjectProperties.axisScale,start:t.StandardObjectProperties.axisStart,end:t.StandardObjectProperties.axisEnd,axisType:t.StandardObjectProperties.axisType,showAxisTitle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Title"),description:i?e.data.createDisplayNameGetter("Visual_Axis_YTitleDescription"):e.data.createDisplayNameGetter("Visual_Axis_XTitleDescription"),type:{bool:!0}},axisStyle:t.StandardObjectProperties.axisStyle,labelColor:t.StandardObjectProperties.labelColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision}},valueAxis:{displayName:i?e.data.createDisplayNameGetter("Visual_XAxis"):e.data.createDisplayNameGetter("Visual_YAxis"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.yAxisPosition,axisScale:t.StandardObjectProperties.axisScale,start:t.StandardObjectProperties.axisStart,end:t.StandardObjectProperties.axisEnd,intersection:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Intersection"),type:{numeric:!0},placeHolderText:e.data.createDisplayNameGetter("Visual_Precision_Auto")},showAxisTitle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Title"),description:i?e.data.createDisplayNameGetter("Visual_Axis_YTitleDescription"):e.data.createDisplayNameGetter("Visual_Axis_XTitleDescription"),type:{bool:!0}},axisStyle:t.StandardObjectProperties.axisStyle,labelColor:t.StandardObjectProperties.labelColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision}},y1AxisReferenceLine:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Description"),properties:{show:t.StandardObjectProperties.show,value:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Value"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Value_Description"),type:{numeric:!0}},lineColor:t.StandardObjectProperties.lineColor,transparency:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Transparency"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Transparency_Description"),type:{numeric:!0}},style:t.StandardObjectProperties.referenceLineStyle,position:t.StandardObjectProperties.referenceLinePosition,dataLabelShow:t.StandardObjectProperties.dataLabelShow,dataLabelColor:t.StandardObjectProperties.dataLabelColor,dataLabelDecimalPoints:t.StandardObjectProperties.dataLabelDecimalPoints,dataLabelHorizontalPosition:t.StandardObjectProperties.dataLabelHorizontalPosition,dataLabelVerticalPosition:t.StandardObjectProperties.dataLabelVerticalPosition,dataLabelDisplayUnits:t.StandardObjectProperties.dataLabelDisplayUnits}},dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),description:e.data.createDisplayNameGetter("Visual_DataPointDescription"),properties:{defaultColor:t.StandardObjectProperties.defaultColor,showAllDataPoints:t.StandardObjectProperties.showAllDataPoints,fill:t.StandardObjectProperties.fill,fillRule:{displayName:e.data.createDisplayNameGetter("Visual_Gradient"),type:{fillRule:{}},rule:{inputRole:"Gradient",output:{property:"fill",selector:["Category"]}}}}},trend:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line"),properties:{show:{type:{bool:!0}},lineColor:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Color"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Color_Description"),type:{fill:{solid:{color:!0}}}},transparency:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Transparency"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Transparency_Description"),type:{numeric:!0}},style:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Style"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Style_Description"),type:{enumeration:t.lineStyle.type}},combineSeries:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Combine_Series"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Combine_Series_Description"),type:{bool:!0}},useHighlightValues:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_UseHighlightValues"),
3description:e.data.createDisplayNameGetter("Visual_Trend_Line_UseHighlightValues_Description"),type:{bool:!0}}}},labels:{displayName:e.data.createDisplayNameGetter("Visual_DataPointsLabels"),description:e.data.createDisplayNameGetter("Visual_DataPointsLabelsDescription"),properties:{show:t.StandardObjectProperties.show,showSeries:{displayName:e.data.createDisplayNameGetter("Visual_Show"),type:{bool:!0}},color:t.StandardObjectProperties.dataColor,labelDisplayUnits:t.StandardObjectProperties.dataLabelDisplayUnits,labelPrecision:$.extend({},t.StandardObjectProperties.labelPrecision,{suppressFormatPainterCopy:!0}),showAll:{displayName:e.data.createDisplayNameGetter("Visual_LabelSeriesShowAll"),type:{bool:!0}},fontSize:t.StandardObjectProperties.fontSize}},plotArea:{displayName:e.data.createDisplayNameGetter("Visual_Plot"),properties:{transparency:t.StandardObjectProperties.transparency,image:t.StandardObjectProperties.image}}},dataViewMappings:[{conditions:[{Category:{max:1},Series:{max:0},Gradient:{max:0}},{Category:{max:1},Series:{min:1,max:1},Y:{max:1},Gradient:{max:0}},{Category:{max:1},Series:{max:0},Y:{min:0,max:1},Gradient:{max:1}}],categorical:{categories:{"for":{"in":"Category"},dataReductionAlgorithm:{top:{}}},values:{group:{by:"Series",select:[{"for":{"in":"Y"}},{bind:{to:"Gradient"}}],dataReductionAlgorithm:{top:{}}}},rowCount:{preferred:{min:2},supported:{min:0}}}},{conditions:[{Category:{max:1},Series:{max:0},Gradient:{max:0}},{Category:{max:1},Series:{min:1,max:1},Y:{max:1},Gradient:{max:0}},{Category:{max:1},Series:{max:0},Y:{min:0,max:1},Gradient:{max:1}}],requiredProperties:[{objectName:"trend",propertyName:"show"}],usage:{regression:{combineSeries:{objectName:"trend",propertyName:"combineSeries"}}},categorical:{categories:{"for":{"in":"regression.X"}},values:{group:{by:"regression.Series",select:[{"for":{"in":"regression.Y"}}]}}}}],supportsHighlight:!0,sorting:{"default":{}},drilldown:{roles:["Category"]}}}t.getColumnChartCapabilities=i,t.columnChartProps={dataPoint:{defaultColor:{objectName:"dataPoint",propertyName:"defaultColor"},fill:{objectName:"dataPoint",propertyName:"fill"},showAllDataPoints:{objectName:"dataPoint",propertyName:"showAllDataPoints"}},general:{formatString:{objectName:"general",propertyName:"formatString"}},categoryAxis:{axisType:{objectName:"categoryAxis",propertyName:"axisType"}},legend:{labelColor:{objectName:"legend",propertyName:"labelColor"}},plotArea:{image:{objectName:"plotArea",propertyName:"image"},transparency:{objectName:"plotArea",propertyName:"transparency"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.comboChartCapabilities={dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_ComboChart_Category"),description:e.data.createDisplayNameGetter("Role_ComboChart_CategoryDescription"),cartesianKind:0},{name:"Series",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_ComboChart_Series")},{name:"Y",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_ComboChart_Y"),description:e.data.createDisplayNameGetter("Role_ComboChart_YDescription"),requiredTypes:[{numeric:!0},{integer:!0}],cartesianKind:1},{name:"Y2",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_ComboChart_Y2"),description:e.data.createDisplayNameGetter("Role_ComboChart_Y2Description"),requiredTypes:[{numeric:!0},{integer:!0}],cartesianKind:1}],objects:{general:{properties:{formatString:t.StandardObjectProperties.formatString,visualType1:{type:{text:!0}},visualType2:{type:{text:!0}}}},legend:{displayName:e.data.createDisplayNameGetter("Visual_Legend"),description:e.data.createDisplayNameGetter("Visual_LegendDescription"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.legendPosition,showTitle:t.StandardObjectProperties.showLegendTitle,titleText:$.extend({},t.StandardObjectProperties.legendTitle,{suppressFormatPainterCopy:!0}),labelColor:t.StandardObjectProperties.labelColor,fontSize:t.StandardObjectProperties.fontSize}},categoryAxis:{displayName:e.data.createDisplayNameGetter("Visual_XAxis"),properties:{show:t.StandardObjectProperties.show,axisScale:t.StandardObjectProperties.axisScale,start:t.StandardObjectProperties.axisStart,end:t.StandardObjectProperties.axisEnd,axisType:t.StandardObjectProperties.axisType,showAxisTitle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Title"),description:e.data.createDisplayNameGetter("Visual_Axis_XTitleDescription"),type:{bool:!0}},axisStyle:t.StandardObjectProperties.axisStyle,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision}},valueAxis:{displayName:e.data.createDisplayNameGetter("Visual_YAxis"),properties:{show:t.StandardObjectProperties.show,axisLabel:{displayName:e.data.createDisplayNameGetter("Visual_YAxis_ColumnTitle"),type:{none:!0}},position:t.StandardObjectProperties.yAxisPosition,axisScale:t.StandardObjectProperties.axisScale,start:t.StandardObjectProperties.axisStart,end:t.StandardObjectProperties.axisEnd,showAxisTitle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Title"),description:e.data.createDisplayNameGetter("Visual_Axis_YTitleDescription"),type:{bool:!0}},axisStyle:t.StandardObjectProperties.axisStyle,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision,secShow:{displayName:e.data.createDisplayNameGetter("Visual_YAxis_ShowSecondary"),type:{bool:!0}},secAxisLabel:{displayName:e.data.createDisplayNameGetter("Visual_YAxis_LineTitle"),type:{none:!0}},secPosition:{displayName:e.data.createDisplayNameGetter("Visual_YAxis_Position"),type:{enumeration:t.yAxisPosition.type}},secAxisScale:t.StandardObjectProperties.axisScale,secStart:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Start"),description:e.data.createDisplayNameGetter("Visual_Axis_StartDescription"),type:{numeric:!0}},secEnd:{displayName:e.data.createDisplayNameGetter("Visual_Axis_End"),description:e.data.createDisplayNameGetter("Visual_Axis_EndDescription"),type:{numeric:!0}},secShowAxisTitle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Title"),description:e.data.createDisplayNameGetter("Visual_Axis_YTitleDescription"),type:{bool:!0}},secAxisStyle:t.StandardObjectProperties.axisStyle,secLabelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,secLabelPrecision:t.StandardObjectProperties.labelPrecision}},dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),description:e.data.createDisplayNameGetter("Visual_DataPointDescription"),properties:{defaultColor:$.extend({},t.StandardObjectProperties.defaultColor,{displayName:e.data.createDisplayNameGetter("Visual_DefaultColumnColor")}),showAllDataPoints:t.StandardObjectProperties.showAllDataPoints,fill:t.StandardObjectProperties.fill,fillRule:{displayName:e.data.createDisplayNameGetter("Visual_Gradient"),type:{fillRule:{}},rule:{inputRole:"Gradient",output:{property:"fill",selector:["Category"]}}}}},labels:{displayName:e.data.createDisplayNameGetter("Visual_DataPointsLabels"),description:e.data.createDisplayNameGetter("Visual_DataPointsLabelsDescription"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,labelDisplayUnits:t.StandardObjectProperties.dataLabelDisplayUnits,labelPrecision:$.extend({},t.StandardObjectProperties.labelPrecision,{suppressFormatPainterCopy:!0}),fontSize:t.StandardObjectProperties.fontSize}},plotArea:{displayName:e.data.createDisplayNameGetter("Visual_Plot"),properties:{transparency:t.StandardObjectProperties.transparency,image:t.StandardObjectProperties.image}},trend:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line"),properties:{show:{type:{bool:!0}},lineColor:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Color"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Color_Description"),type:{fill:{solid:{color:!0}}}},transparency:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Transparency"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Transparency_Description"),type:{numeric:!0}},style:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Style"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Style_Description"),type:{enumeration:t.lineStyle.type}},combineSeries:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Combine_Series"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Combine_Series_Description"),type:{bool:!0}},useHighlightValues:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_UseHighlightValues"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_UseHighlightValues_Description"),type:{bool:!0}}}}},dataViewMappings:[{conditions:[{Category:{max:1},Series:{max:0}},{Category:{max:1},Series:{min:1,max:1},Y:{max:1}}],categorical:{categories:{"for":{"in":"Category"},dataReductionAlgorithm:{top:{}}},values:{group:{by:"Series",select:[{"for":{"in":"Y"}}],dataReductionAlgorithm:{top:{}}}},rowCount:{preferred:{min:2},supported:{min:0}}}},{conditions:[{Category:{max:1},Series:{max:0},Y2:{min:1}},{Category:{max:1},Series:{min:1,max:1},Y:{max:1},Y2:{min:1}}],categorical:{categories:{"for":{"in":"Category"},dataReductionAlgorithm:{top:{}}},values:{select:[{"for":{"in":"Y2"}}]},rowCount:{preferred:{min:2},supported:{min:0}}}},{conditions:[{Category:{max:1},Series:{max:0}},{Category:{max:1},Series:{min:1,max:1},Y:{max:1}}],requiredProperties:[{objectName:"trend",propertyName:"show"}],usage:{regression:{combineSeries:{objectName:"trend",propertyName:"combineSeries"}}},categorical:{categories:{"for":{"in":"regression.X"}},values:{group:{by:"regression.Series",select:[{"for":{"in":"regression.Y"}}]}}}}],supportsHighlight:!0,sorting:{"default":{}},drilldown:{roles:["Category"]}},t.comboChartProps={general:{formatString:{objectName:"general",propertyName:"formatString"}},valueAxis:{secShow:{objectName:"valueAxis",propertyName:"secShow"}},legend:{labelColor:{objectName:"legend",propertyName:"labelColor"}},dataPoint:{showAllDataPoints:{objectName:"dataPoint",propertyName:"showAllDataPoints"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.donutChartCapabilities={dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Legend"),description:e.data.createDisplayNameGetter("Role_DisplayName_LegendDescription")},{name:"Series",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Details"),description:e.data.createDisplayNameGetter("Role_DisplayName_DetailsDonutChartDescription")},{name:"Y",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Values"),description:e.data.createDisplayNameGetter("Role_DisplayName_ValuesDescription"),requiredTypes:[{numeric:!0},{integer:!0}]}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString}},legend:{displayName:e.data.createDisplayNameGetter("Visual_Legend"),description:e.data.createDisplayNameGetter("Visual_LegendDescription"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.legendPosition,showTitle:t.StandardObjectProperties.showLegendTitle,titleText:$.extend({},t.StandardObjectProperties.legendTitle,{suppressFormatPainterCopy:!0}),labelColor:t.StandardObjectProperties.labelColor,fontSize:t.StandardObjectProperties.fontSize}},dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),description:e.data.createDisplayNameGetter("Visual_DataPointDescription"),properties:{defaultColor:t.StandardObjectProperties.defaultColor,fill:t.StandardObjectProperties.fill}},labels:{displayName:e.data.createDisplayNameGetter("Visual_DetailLabels"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,labelDisplayUnits:t.StandardObjectProperties.dataLabelDisplayUnits,labelPrecision:$.extend({},t.StandardObjectProperties.labelPrecision,{suppressFormatPainterCopy:!0}),fontSize:$.extend({},t.StandardObjectProperties.fontSize,{suppressFormatPainterCopy:!0}),labelStyle:{displayName:e.data.createDisplayNameGetter("Visual_LabelStyle"),type:{enumeration:t.labelStyle.type}}}}},dataViewMappings:[{conditions:[{Category:{max:1},Series:{max:0}},{Category:{max:1},Series:{min:1,max:1},Y:{max:1}}],categorical:{categories:{"for":{"in":"Category"},dataReductionAlgorithm:{top:{}}},values:{group:{by:"Series",select:[{bind:{to:"Y"}}],dataReductionAlgorithm:{top:{}}}},rowCount:{preferred:{min:2},supported:{min:1}}}}],sorting:{"default":{}},supportsHighlight:!0,drilldown:{roles:["Category"]}},t.donutChartProps={general:{formatString:{objectName:"general",propertyName:"formatString"}},dataPoint:{defaultColor:{objectName:"dataPoint",propertyName:"defaultColor"},fill:{objectName:"dataPoint",propertyName:"fill"}},legend:{show:{objectName:"legend",propertyName:"show"},position:{objectName:"legend",propertyName:"position"},showTitle:{objectName:"legend",propertyName:"showTitle"},titleText:{objectName:"legend",propertyName:"titleText"},labelColor:{objectName:"legend",propertyName:"labelColor"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.dataDotChartCapabilities={dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Axis"),description:e.data.createDisplayNameGetter("Role_DisplayName_AxisDescription")},{name:"Y",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Value"),requiredTypes:[{numeric:!0},{integer:!0}]}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString}}},dataViewMappings:[{conditions:[{Category:{max:1},Y:{max:1}}],categorical:{categories:{"for":{"in":"Category"},dataReductionAlgorithm:{top:{}}},values:{select:[{"for":{"in":"Y"},dataReductionAlgorithm:{top:{}}}]}}}]}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.filledMapCapabilities={dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Location"),description:e.data.createDisplayNameGetter("Role_DisplayName_LocationFilledMapDescription"),preferredTypes:[{geography:{address:!0}},{geography:{city:!0}},{geography:{continent:!0}},{geography:{country:!0}},{geography:{county:!0}},{geography:{place:!0}},{geography:{postalCode:!0}},{geography:{region:!0}},{geography:{stateOrProvince:!0}}]},{name:"Series",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Legend"),description:e.data.createDisplayNameGetter("Role_DisplayName_LegendDescription")},{name:"X",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Longitude"),description:e.data.createDisplayNameGetter("Role_DisplayName_LongitudeFilledMapDescription"),preferredTypes:[{geography:{longitude:!0}}]},{name:"Y",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Latitude"),description:e.data.createDisplayNameGetter("Role_DisplayName_LatitudeFilledMapDescription"),preferredTypes:[{geography:{latitude:!0}}]},{name:"Size",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Gradient"),description:e.data.createDisplayNameGetter("Role_DisplayName_GradientDescription"),requiredTypes:[{numeric:!0},{integer:!0}]}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString}},legend:{displayName:e.data.createDisplayNameGetter("Visual_Legend"),description:e.data.createDisplayNameGetter("Visual_LegendDescription"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.legendPosition,showTitle:t.StandardObjectProperties.showLegendTitle,titleText:t.StandardObjectProperties.legendTitle,fontSize:t.StandardObjectProperties.fontSize}},dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),description:e.data.createDisplayNameGetter("Visual_DataPointDescription"),properties:{defaultColor:t.StandardObjectProperties.defaultColor,showAllDataPoints:t.StandardObjectProperties.showAllDataPoints,fill:t.StandardObjectProperties.fill,fillRule:{displayName:e.data.createDisplayNameGetter("Role_DisplayName_Values"),description:e.data.createDisplayNameGetter("Role_DisplayName_ValuesDescription"),type:{fillRule:{}},rule:{inputRole:"Size",output:{property:"fill",selector:["Category"]}}}}},labels:{displayName:e.data.createDisplayNameGetter("Visual_DataPointsLabels"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision}},categoryLabels:{displayName:e.data.createDisplayNameGetter("Visual_CategoryLabels"),properties:{show:t.StandardObjectProperties.show}}},dataViewMappings:[{conditions:[{Category:{max:1},Series:{max:1},X:{max:1},Y:{max:1},Size:{max:1}},{Category:{max:1},Series:{max:0},X:{max:1},Y:{max:1},Size:{max:1}}],categorical:{categories:{"for":{"in":"Category"},dataReductionAlgorithm:{top:{}}},values:{group:{by:"Series",select:[{bind:{to:"X"}},{bind:{to:"Y"}},{bind:{to:"Size"}}],dataReductionAlgorithm:{top:{}}}},rowCount:{preferred:{min:2}},dataVolume:4}}],sorting:{custom:{}},drilldown:{roles:["Category"]}},t.filledMapProps={general:{formatString:{objectName:"general",propertyName:"formatString"}},dataPoint:{defaultColor:{objectName:"dataPoint",propertyName:"defaultColor"},fill:{objectName:"dataPoint",propertyName:"fill"},showAllDataPoints:{objectName:"dataPoint",propertyName:"showAllDataPoints"}},legend:{show:{objectName:"legend",propertyName:"show"},position:{objectName:"legend",propertyName:"position"},showTitle:{objectName:"legend",propertyName:"showTitle"},titleText:{objectName:"legend",propertyName:"titleText"}},labels:{show:{objectName:"labels",propertyName:"show"},color:{objectName:"labels",propertyName:"color"},labelDisplayUnits:{objectName:"labels",propertyName:"labelDisplayUnits"},labelPrecision:{objectName:"labels",propertyName:"labelPrecision"}},categoryLabels:{show:{objectName:"categoryLabels",propertyName:"show"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.funnelChartCapabilities={dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Group"),description:e.data.createDisplayNameGetter("Role_DisplayName_GroupFunnelDescription")},{name:"Y",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Values"),description:e.data.createDisplayNameGetter("Role_DisplayName_ValuesDescription"),requiredTypes:[{numeric:!0},{integer:!0}]},{name:"Gradient",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Gradient"),description:e.data.createDisplayNameGetter("Role_DisplayName_GradientDescription"),requiredTypes:[{numeric:!0},{integer:!0}]}],dataViewMappings:[{conditions:[{Category:{max:0},Gradient:{max:0}},{Category:{max:1},Y:{max:1},Gradient:{max:1}}],categorical:{categories:{"for":{"in":"Category"},dataReductionAlgorithm:{top:{}}},values:{select:[{"for":{"in":"Y"}},{bind:{to:"Gradient"}}],dataReductionAlgorithm:{top:{}}},rowCount:{preferred:{min:1}}}}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString}},dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),description:e.data.createDisplayNameGetter("Visual_DataPointDescription"),properties:{defaultColor:t.StandardObjectProperties.defaultColor,fill:t.StandardObjectProperties.fill,fillRule:{displayName:e.data.createDisplayNameGetter("Visual_Gradient"),type:{fillRule:{}},rule:{inputRole:"Gradient",output:{property:"fill",selector:["Category"]}}}}},labels:{displayName:e.data.createDisplayNameGetter("Visual_DataPointsLabels"),description:e.data.createDisplayNameGetter("Visual_DataPointsLabelsDescription"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,labelPosition:{displayName:e.data.createDisplayNameGetter("Visual_Position"),type:{enumeration:t.labelPosition.type},suppressFormatPainterCopy:!0},labelDisplayUnits:t.StandardObjectProperties.dataLabelDisplayUnits,labelPrecision:$.extend({},t.StandardObjectProperties.labelPrecision,{suppressFormatPainterCopy:!0}),fontSize:t.StandardObjectProperties.fontSize}},percentBarLabel:{displayName:e.data.createDisplayNameGetter("Visual_PercentBarLabel"),description:e.data.createDisplayNameGetter("Visual_PercentBarLabelDescription"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,fontSize:t.StandardObjectProperties.fontSize}}},supportsHighlight:!0,sorting:{"default":{}},drilldown:{roles:["Category"]}},t.funnelChartProps={general:{formatString:{objectName:"general",propertyName:"formatString"}},dataPoint:{defaultColor:{objectName:"dataPoint",propertyName:"defaultColor"},fill:{objectName:"dataPoint",propertyName:"fill"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.gaugeRoleNames={y:"Y",minValue:"MinValue",maxValue:"MaxValue",targetValue:"TargetValue"},t.gaugeCapabilities={dataRoles:[{name:t.gaugeRoleNames.y,kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Value"),description:e.data.createDisplayNameGetter("Role_DisplayName_ValueDescription"),requiredTypes:[{numeric:!0},{integer:!0}]},{name:t.gaugeRoleNames.minValue,kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_MinValue"),description:e.data.createDisplayNameGetter("Role_DisplayName_MinValueDescription"),requiredTypes:[{numeric:!0},{integer:!0}]},{name:t.gaugeRoleNames.maxValue,kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_MaxValue"),description:e.data.createDisplayNameGetter("Role_DisplayName_MaxValueDescription"),requiredTypes:[{numeric:!0},{integer:!0}]},{name:t.gaugeRoleNames.targetValue,kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_TargetValue"),description:e.data.createDisplayNameGetter("Role_DisplayName_TargetValueDescription"),requiredTypes:[{numeric:!0},{integer:!0}]}],objects:{general:{properties:{formatString:t.StandardObjectProperties.formatString}},axis:{displayName:e.data.createDisplayNameGetter("Visual_Gauge_Axis"),properties:{min:{displayName:e.data.createDisplayNameGetter("Visual_Gauge_Axis_Min"),type:{numeric:!0}},max:{displayName:e.data.createDisplayNameGetter("Visual_Gauge_Axis_Max"),type:{numeric:!0}},target:{displayName:e.data.createDisplayNameGetter("Visual_Gauge_Axis_Target"),type:{numeric:!0}}}},labels:{displayName:e.data.createDisplayNameGetter("Visual_DataPointsLabels"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision,fontSize:t.StandardObjectProperties.fontSize}},calloutValue:{displayName:e.data.createDisplayNameGetter("Visual_Gauge_CalloutValue"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision}},dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),properties:{fill:t.StandardObjectProperties.fill,target:{displayName:e.data.createDisplayNameGetter("Visual_Gauge_Axis_Target"),type:{fill:{solid:{color:!0}}}}}}},dataViewMappings:[{conditions:[{Y:{max:1},MinValue:{max:1},MaxValue:{max:1},TargetValue:{max:1}}],categorical:{values:{select:[{bind:{to:"Y"}},{bind:{to:"MinValue"}},{bind:{to:"MaxValue"}},{bind:{to:"TargetValue"}}]}}}],supportsSelection:!1},t.gaugeProps={dataPoint:{fill:{objectName:"dataPoint",propertyName:"fill"},target:{objectName:"dataPoint",propertyName:"target"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.imageVisualCapabilities={objects:{general:{properties:{imageUrl:{type:{misc:{imageUrl:!0}}}}},imageScaling:{displayName:e.data.createDisplayNameGetter("Visual_Image_Scaling_Type"),properties:{imageScalingType:{displayName:e.data.createDisplayNameGetter("Visual_Image_Scaling_Type"),type:{enumeration:t.imageScalingType.type}}}}},suppressDefaultTitle:!0,supportsSelection:!1}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.scriptVisualCapabilities={dataRoles:[{name:"Values",kind:e.VisualDataRoleKind.GroupingOrMeasure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Values")}],dataViewMappings:[{scriptResult:{dataInput:{table:{rows:{"for":{"in":"Values"},dataReductionAlgorithm:{top:{}}}}},script:{source:{objectName:"script",propertyName:"source"},provider:{objectName:"script",propertyName:"provider"}}}}],objects:{script:{properties:{provider:{type:{text:!0}},source:{type:{scripting:{source:!0}}}}}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.consoleWriterCapabilities={dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Axis"),description:e.data.createDisplayNameGetter("Role_DisplayName_AxisDescription")},{name:"Y",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Y"),description:e.data.createDisplayNameGetter("Role_DisplayName_YDescription")}],dataViewMappings:[{categorical:{categories:{"for":{"in":"Category"}}}}]}}(i=t.samples||(t.samples={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){var t=function(){function e(){}return e.converter=function(e){return window.console.log("converter"),window.console.log(e),{}},e.prototype.init=function(e){var t=d3.select(e.element.get(0)).append("div");t.append("h1").text("ConsoleWriter"),t.append("p").text("This IVisual writes messages passed to it to the javscript console output. Check your console for the actual messages passed. For more information, click below");var i=t.append("a");i.attr("href","http://microsoft.github.io/PowerBI-visuals/modules/powerbi.html").text("Online help"),window.console.log("init"),window.console.log(e)},e.prototype.onResizing=function(e){},e.prototype.update=function(e){window.console.log("update"),window.console.log(e)},e}();e.ConsoleWriter=t}(t=e.samples||(e.samples={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.lineChartCapabilities={dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Axis"),description:e.data.createDisplayNameGetter("Role_DisplayName_AxisDescription"),cartesianKind:0},{name:"Series",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Legend"),description:e.data.createDisplayNameGetter("Role_DisplayName_LegendDescription")},{name:"Y",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Values"),description:e.data.createDisplayNameGetter("Role_DisplayName_ValuesDescription"),requiredTypes:[{numeric:!0},{integer:!0}],cartesianKind:1}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString}},legend:{displayName:e.data.createDisplayNameGetter("Visual_Legend"),description:e.data.createDisplayNameGetter("Visual_LegendDescription"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.legendPosition,showTitle:t.StandardObjectProperties.showLegendTitle,titleText:$.extend({},t.StandardObjectProperties.legendTitle,{suppressFormatPainterCopy:!0}),labelColor:t.StandardObjectProperties.labelColor,fontSize:t.StandardObjectProperties.fontSize}},dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),description:e.data.createDisplayNameGetter("Visual_DataPointDescription"),properties:{defaultColor:t.StandardObjectProperties.defaultColor,fill:t.StandardObjectProperties.fill}},trend:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line"),properties:{show:t.StandardObjectProperties.show,lineColor:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Color"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Color_Description"),type:{fill:{solid:{color:!0}}}},transparency:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Transparency"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Transparency_Description"),type:{numeric:!0}},style:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Style"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Style_Description"),type:{enumeration:t.lineStyle.type}},combineSeries:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Combine_Series"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Combine_Series_Description"),type:{bool:!0}},useHighlightValues:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_UseHighlightValues"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_UseHighlightValues_Description"),type:{bool:!0}}}},categoryAxis:{displayName:e.data.createDisplayNameGetter("Visual_XAxis"),properties:{show:t.StandardObjectProperties.show,axisScale:t.StandardObjectProperties.axisScale,start:t.StandardObjectProperties.axisStart,end:t.StandardObjectProperties.axisEnd,axisType:t.StandardObjectProperties.axisType,showAxisTitle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Title"),description:e.data.createDisplayNameGetter("Visual_Axis_XTitleDescription"),type:{bool:!0}},axisStyle:t.StandardObjectProperties.axisStyle,labelColor:t.StandardObjectProperties.labelColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision}},valueAxis:{displayName:e.data.createDisplayNameGetter("Visual_YAxis"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.yAxisPosition,axisScale:t.StandardObjectProperties.axisScale,start:t.StandardObjectProperties.axisStart,end:t.StandardObjectProperties.axisEnd,showAxisTitle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Title"),description:e.data.createDisplayNameGetter("Visual_Axis_YTitleDescription"),type:{bool:!0}},axisStyle:t.StandardObjectProperties.axisStyle,labelColor:t.StandardObjectProperties.labelColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision}},y1AxisReferenceLine:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Description"),properties:{show:t.StandardObjectProperties.show,value:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Value"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Value_Description"),type:{numeric:!0}},lineColor:t.StandardObjectProperties.lineColor,transparency:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Transparency"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Transparency_Description"),type:{numeric:!0
4}},style:t.StandardObjectProperties.referenceLineStyle,position:t.StandardObjectProperties.referenceLinePosition,dataLabelShow:t.StandardObjectProperties.dataLabelShow,dataLabelColor:t.StandardObjectProperties.dataLabelColor,dataLabelDecimalPoints:t.StandardObjectProperties.dataLabelDecimalPoints,dataLabelHorizontalPosition:t.StandardObjectProperties.dataLabelHorizontalPosition,dataLabelVerticalPosition:t.StandardObjectProperties.dataLabelVerticalPosition,dataLabelDisplayUnits:t.StandardObjectProperties.dataLabelDisplayUnits}},labels:{displayName:e.data.createDisplayNameGetter("Visual_DataPointsLabels"),description:e.data.createDisplayNameGetter("Visual_DataPointsLabelsDescription"),properties:{show:t.StandardObjectProperties.show,showSeries:{displayName:e.data.createDisplayNameGetter("Visual_Show"),type:{bool:!0}},color:t.StandardObjectProperties.dataColor,labelDisplayUnits:t.StandardObjectProperties.dataLabelDisplayUnits,labelPrecision:$.extend({},t.StandardObjectProperties.labelPrecision,{suppressFormatPainterCopy:!0}),showAll:{displayName:e.data.createDisplayNameGetter("Visual_LabelSeriesShowAll"),type:{bool:!0}},fontSize:t.StandardObjectProperties.fontSize,labelDensity:{displayName:e.data.createDisplayNameGetter("Visual_LabelDensity"),type:{formatting:{labelDensity:!0}}}}},plotArea:{displayName:e.data.createDisplayNameGetter("Visual_Plot"),properties:{transparency:t.StandardObjectProperties.transparency,image:t.StandardObjectProperties.image}}},dataViewMappings:[{conditions:[{Category:{max:1},Series:{max:0}},{Category:{max:1},Series:{min:1,max:1},Y:{max:1}}],categorical:{categories:{"for":{"in":"Category"},dataReductionAlgorithm:{top:{}}},values:{group:{by:"Series",select:[{"for":{"in":"Y"}}],dataReductionAlgorithm:{top:{}}}}}},{conditions:[{Category:{max:1},Series:{max:0}},{Category:{max:1},Series:{min:1,max:1},Y:{max:1}}],requiredProperties:[{objectName:"trend",propertyName:"show"}],usage:{regression:{combineSeries:{objectName:"trend",propertyName:"combineSeries"}}},categorical:{categories:{"for":{"in":"regression.X"}},values:{group:{by:"regression.Series",select:[{"for":{"in":"regression.Y"}}]}}}}],sorting:{"default":{}}},t.lineChartProps={general:{formatString:{objectName:"general",propertyName:"formatString"}},dataPoint:{defaultColor:{objectName:"dataPoint",propertyName:"defaultColor"},fill:{objectName:"dataPoint",propertyName:"fill"}},trend:{show:{objectName:"trend",propertyName:"show"}},categoryAxis:{axisType:{objectName:"categoryAxis",propertyName:"axisType"}},legend:{labelColor:{objectName:"legend",propertyName:"labelColor"}},labels:{labelDensity:{objectName:"labels",propertyName:"labelDensity"}},plotArea:{image:{objectName:"plotArea",propertyName:"image"},transparency:{objectName:"plotArea",propertyName:"transparency"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.mapCapabilities={dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Location"),description:e.data.createDisplayNameGetter("Role_DisplayName_LocationMapDescription"),preferredTypes:[{geography:{address:!0}},{geography:{city:!0}},{geography:{continent:!0}},{geography:{country:!0}},{geography:{county:!0}},{geography:{place:!0}},{geography:{postalCode:!0}},{geography:{region:!0}},{geography:{stateOrProvince:!0}}]},{name:"Series",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Legend"),description:e.data.createDisplayNameGetter("Role_DisplayName_LegendDescription")},{name:"X",kind:e.VisualDataRoleKind.GroupingOrMeasure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Longitude"),description:e.data.createDisplayNameGetter("Role_DisplayName_LongitudeMapDescription"),preferredTypes:[{geography:{longitude:!0}}]},{name:"Y",kind:e.VisualDataRoleKind.GroupingOrMeasure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Latitude"),description:e.data.createDisplayNameGetter("Role_DisplayName_LatitudeMapDescription"),preferredTypes:[{geography:{latitude:!0}}]},{name:"Size",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Size"),description:e.data.createDisplayNameGetter("Role_DisplayName_SizeDescription"),requiredTypes:[{numeric:!0},{integer:!0}]},{name:"Gradient",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Gradient"),description:e.data.createDisplayNameGetter("Role_DisplayName_GradientDescription"),requiredTypes:[{numeric:!0},{integer:!0}]}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString}},legend:{displayName:e.data.createDisplayNameGetter("Visual_Legend"),description:e.data.createDisplayNameGetter("Visual_LegendDescription"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.legendPosition,showTitle:t.StandardObjectProperties.showLegendTitle,titleText:t.StandardObjectProperties.legendTitle,fontSize:t.StandardObjectProperties.fontSize}},dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),description:e.data.createDisplayNameGetter("Visual_DataPointDescription"),properties:{defaultColor:t.StandardObjectProperties.defaultColor,showAllDataPoints:t.StandardObjectProperties.showAllDataPoints,fill:t.StandardObjectProperties.fill,fillRule:{displayName:e.data.createDisplayNameGetter("Visual_Gradient"),type:{fillRule:{}},rule:{inputRole:"Gradient",output:{property:"fill",selector:["Category"]}}}}},categoryLabels:{displayName:e.data.createDisplayNameGetter("Visual_CategoryLabels"),description:e.data.createDisplayNameGetter("Visual_CategoryLabelsDescription"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,fontSize:t.StandardObjectProperties.fontSize}}},dataViewMappings:[{conditions:[{Category:{min:1,max:1},Series:{max:1},X:{max:1,kind:e.VisualDataRoleKind.Measure},Y:{max:1,kind:e.VisualDataRoleKind.Measure},Size:{max:1},Gradient:{max:0}},{Category:{min:1,max:1},Series:{max:0},X:{max:1,kind:e.VisualDataRoleKind.Measure},Y:{max:1,kind:e.VisualDataRoleKind.Measure},Size:{max:1},Gradient:{max:1}}],categorical:{categories:{"for":{"in":"Category"},dataReductionAlgorithm:{top:{}}},values:{group:{by:"Series",select:[{bind:{to:"X"}},{bind:{to:"Y"}},{bind:{to:"Size"}},{bind:{to:"Gradient"}}],dataReductionAlgorithm:{top:{}}}},rowCount:{preferred:{min:2}},dataVolume:4}},{conditions:[{Category:{max:0},Series:{max:1},X:{max:1,kind:e.VisualDataRoleKind.Grouping},Y:{max:1,kind:e.VisualDataRoleKind.Grouping},Size:{max:1},Gradient:{max:0}},{Category:{max:0},Series:{max:0},X:{max:1,kind:e.VisualDataRoleKind.Grouping},Y:{max:1,kind:e.VisualDataRoleKind.Grouping},Size:{max:1},Gradient:{max:1}}],categorical:{categories:{select:[{bind:{to:"X"}},{bind:{to:"Y"}}],dataReductionAlgorithm:{top:{}}},values:{group:{by:"Series",select:[{bind:{to:"Size"}},{bind:{to:"Gradient"}}],dataReductionAlgorithm:{top:{}}}},rowCount:{preferred:{min:2}},dataVolume:4}}],sorting:{custom:{}},drilldown:{roles:["Category"]}},t.mapProps={general:{formatString:{objectName:"general",propertyName:"formatString"}},dataPoint:{defaultColor:{objectName:"dataPoint",propertyName:"defaultColor"},fill:{objectName:"dataPoint",propertyName:"fill"},showAllDataPoints:{objectName:"dataPoint",propertyName:"showAllDataPoints"}},legend:{show:{objectName:"legend",propertyName:"show"},position:{objectName:"legend",propertyName:"position"},showTitle:{objectName:"legend",propertyName:"showTitle"},titleText:{objectName:"legend",propertyName:"titleText"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.multiRowCardCapabilities={dataRoles:[{name:"Values",kind:e.VisualDataRoleKind.GroupingOrMeasure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Fields"),description:e.data.createDisplayNameGetter("Role_DisplayName_FieldsDescription")}],objects:{general:{properties:{formatString:t.StandardObjectProperties.formatString}},cardTitle:{displayName:e.data.createDisplayNameGetter("Visual_CardTitle"),description:e.data.createDisplayNameGetter("Visual_CardTitleDescription"),properties:{color:t.StandardObjectProperties.dataColor,fontSize:t.StandardObjectProperties.fontSize}},dataLabels:{displayName:e.data.createDisplayNameGetter("Visual_DataPointsLabels"),description:e.data.createDisplayNameGetter("Visual_DataPointsLabelsDescription"),properties:{color:t.StandardObjectProperties.dataColor,fontSize:t.StandardObjectProperties.fontSize}},categoryLabels:{displayName:e.data.createDisplayNameGetter("Visual_CategoryLabels"),description:e.data.createDisplayNameGetter("Visual_CategoryLabelsDescription"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,fontSize:t.StandardObjectProperties.fontSize}},card:{displayName:e.data.createDisplayNameGetter("Card_ToolTip"),properties:{outline:{displayName:e.data.createDisplayNameGetter("Visual_Outline"),type:{enumeration:t.outline.type}},outlineColor:{displayName:e.data.createDisplayNameGetter("Visual_OutlineColor"),description:e.data.createDisplayNameGetter("Visual_OutlineColor_Desc"),type:{fill:{solid:{color:!0}}}},outlineWeight:{displayName:e.data.createDisplayNameGetter("Visual_OutlineWeight"),description:e.data.createDisplayNameGetter("Visual_OutlineWeight_Desc"),type:{numeric:!0}},barShow:{displayName:e.data.createDisplayNameGetter("Visual_MultiRowCard_BarShow"),description:e.data.createDisplayNameGetter("Visual_MultiRowCard_BarShow_Desc"),type:{bool:!0}},barColor:{displayName:e.data.createDisplayNameGetter("Visual_MultiRowCard_BarColor"),type:{fill:{solid:{color:!0}}}},barWeight:{displayName:e.data.createDisplayNameGetter("Visual_MultiRowCard_BarWeight"),description:e.data.createDisplayNameGetter("Visual_MultiRowCard_BarWeight_Desc"),type:{numeric:!0}},cardPadding:{displayName:e.data.createDisplayNameGetter("Visual_MultiRowCard_CardPadding"),description:e.data.createDisplayNameGetter("Visual_MultiRowCard_CardBackground"),type:{numeric:!0}},cardBackground:{displayName:e.data.createDisplayNameGetter("Visual_Background"),type:{fill:{solid:{color:!0}}}}}}},dataViewMappings:[{table:{rows:{"for":{"in":"Values"},dataReductionAlgorithm:{window:{}}},rowCount:{preferred:{min:1}}}}],sorting:{"default":{}},suppressDefaultTitle:!0,supportsSelection:!1,disableVisualDetails:!0},t.multiRowCardProps={card:{outline:{objectName:"card",propertyName:"outline"},outlineColor:{objectName:"card",propertyName:"outlineColor"},outlineWeight:{objectName:"card",propertyName:"outlineWeight"},barShow:{objectName:"card",propertyName:"barShow"},barColor:{objectName:"card",propertyName:"barColor"},barWeight:{objectName:"card",propertyName:"barWeight"},cardPadding:{objectName:"card",propertyName:"cardPadding"},cardBackground:{objectName:"card",propertyName:"cardBackground"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){e.textboxCapabilities={objects:{general:{properties:{paragraphs:{type:{paragraphs:{}},suppressFormatPainterCopy:!0}}}},suppressDefaultTitle:!0,supportsSelection:!1}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.cheerMeterCapabilities={dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Axis"),description:e.data.createDisplayNameGetter("Role_DisplayName_AxisDescription")},{name:"Y",kind:e.VisualDataRoleKind.Measure,requiredTypes:[{numeric:!0},{integer:!0}],displayName:e.data.createDisplayNameGetter("Role_DisplayName_Y"),description:e.data.createDisplayNameGetter("Role_DisplayName_YDescription")}],dataViewMappings:[{categorical:{categories:{"for":{"in":"Category"}}}}],dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),description:e.data.createDisplayNameGetter("Visual_DataPointDescription"),properties:{fill:t.StandardObjectProperties.fill}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.scatterChartCapabilities={dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Details"),description:e.data.createDisplayNameGetter("Role_DisplayName_DetailsScatterChartDescription")},{name:"Series",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Legend"),description:e.data.createDisplayNameGetter("Role_DisplayName_LegendDescription")},{name:"X",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_X"),description:e.data.createDisplayNameGetter("Role_DisplayName_XScatterChartDescription"),requiredTypes:[{numeric:!0},{integer:!0}],cartesianKind:0},{name:"Y",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Y"),description:e.data.createDisplayNameGetter("Role_DisplayName_YScatterChartDescription"),requiredTypes:[{numeric:!0},{integer:!0}],cartesianKind:1},{name:"Size",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Size"),description:e.data.createDisplayNameGetter("Role_DisplayName_SizeDescription"),requiredTypes:[{numeric:!0},{integer:!0}]},{name:"Gradient",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Gradient"),description:e.data.createDisplayNameGetter("Role_DisplayName_GradientDescription"),requiredTypes:[{numeric:!0},{integer:!0}]},{name:"Play",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Play")}],objects:{dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),description:e.data.createDisplayNameGetter("Visual_DataPointDescription"),properties:{defaultColor:t.StandardObjectProperties.defaultColor,showAllDataPoints:t.StandardObjectProperties.showAllDataPoints,fill:t.StandardObjectProperties.fill,fillRule:{displayName:e.data.createDisplayNameGetter("Visual_Gradient"),type:{fillRule:{}},rule:{inputRole:"Gradient",output:{property:"fill",selector:["Category"]}}}}},general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString}},trend:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line"),properties:{show:t.StandardObjectProperties.show,lineColor:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Color"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Color_Description"),type:{fill:{solid:{color:!0}}}},transparency:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Transparency"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Transparency_Description"),type:{numeric:!0}},style:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Style"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Style_Description"),type:{enumeration:t.lineStyle.type}},combineSeries:{displayName:e.data.createDisplayNameGetter("Visual_Trend_Line_Combine_Series"),description:e.data.createDisplayNameGetter("Visual_Trend_Line_Combine_Series_Description"),type:{bool:!0}}}},categoryAxis:{displayName:e.data.createDisplayNameGetter("Visual_XAxis"),properties:{show:t.StandardObjectProperties.show,axisScale:t.StandardObjectProperties.axisScale,start:t.StandardObjectProperties.axisStart,end:t.StandardObjectProperties.axisEnd,showAxisTitle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Title"),description:e.data.createDisplayNameGetter("Visual_Axis_XTitleDescription"),type:{bool:!0}},axisStyle:t.StandardObjectProperties.axisStyle,labelColor:t.StandardObjectProperties.labelColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision}},valueAxis:{displayName:e.data.createDisplayNameGetter("Visual_YAxis"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.yAxisPosition,axisScale:t.StandardObjectProperties.axisScale,start:t.StandardObjectProperties.axisStart,end:t.StandardObjectProperties.axisEnd,showAxisTitle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Title"),description:e.data.createDisplayNameGetter("Visual_Axis_YTitleDescription"),type:{bool:!0}},axisStyle:t.StandardObjectProperties.axisStyle,labelColor:t.StandardObjectProperties.labelColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision}},xAxisReferenceLine:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_X"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Description"),properties:{show:t.StandardObjectProperties.show,value:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Value"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Value_Description"),type:{numeric:!0}},lineColor:t.StandardObjectProperties.lineColor,transparency:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Transparency"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Transparency_Description"),type:{numeric:!0}},style:t.StandardObjectProperties.referenceLineStyle,position:t.StandardObjectProperties.referenceLinePosition,dataLabelShow:t.StandardObjectProperties.dataLabelShow,dataLabelColor:t.StandardObjectProperties.dataLabelColor,dataLabelDecimalPoints:t.StandardObjectProperties.dataLabelDecimalPoints,dataLabelHorizontalPosition:t.StandardObjectProperties.dataLabelHorizontalPosition,dataLabelVerticalPosition:t.StandardObjectProperties.dataLabelVerticalPosition,dataLabelDisplayUnits:t.StandardObjectProperties.dataLabelDisplayUnits}},y1AxisReferenceLine:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Y"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Description"),properties:{show:t.StandardObjectProperties.show,value:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Value"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Value_Description"),type:{numeric:!0}},lineColor:t.StandardObjectProperties.lineColor,transparency:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Transparency"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Transparency_Description"),type:{numeric:!0}},style:t.StandardObjectProperties.referenceLineStyle,position:t.StandardObjectProperties.referenceLinePosition,dataLabelShow:t.StandardObjectProperties.dataLabelShow,dataLabelColor:t.StandardObjectProperties.dataLabelColor,dataLabelDecimalPoints:t.StandardObjectProperties.dataLabelDecimalPoints,dataLabelHorizontalPosition:t.StandardObjectProperties.dataLabelHorizontalPosition,dataLabelVerticalPosition:t.StandardObjectProperties.dataLabelVerticalPosition,dataLabelDisplayUnits:t.StandardObjectProperties.dataLabelDisplayUnits}},legend:{displayName:e.data.createDisplayNameGetter("Visual_Legend"),description:e.data.createDisplayNameGetter("Visual_LegendDescription"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.legendPosition,showTitle:t.StandardObjectProperties.showLegendTitle,titleText:$.extend({},t.StandardObjectProperties.legendTitle,{suppressFormatPainterCopy:!0}),labelColor:t.StandardObjectProperties.labelColor,fontSize:t.StandardObjectProperties.fontSize}},categoryLabels:{displayName:e.data.createDisplayNameGetter("Visual_CategoryLabels"),description:e.data.createDisplayNameGetter("Visual_CategoryLabelsDescription"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,fontSize:t.StandardObjectProperties.fontSize}},colorBorder:{displayName:e.data.createDisplayNameGetter("Visual_ColorBorder"),properties:{show:t.StandardObjectProperties.show}},fillPoint:{displayName:e.data.createDisplayNameGetter("Visual_FillPoint"),properties:{show:t.StandardObjectProperties.show}},colorByCategory:{displayName:e.data.createDisplayNameGetter("Visual_ColorByCategory"),properties:{show:t.StandardObjectProperties.show}},currentFrameIndex:{properties:{index:{type:{numeric:!0}}}},plotArea:{displayName:e.data.createDisplayNameGetter("Visual_Plot"),properties:{transparency:t.StandardObjectProperties.transparency,image:t.StandardObjectProperties.image}}},dataViewMappings:[{conditions:[{Category:{max:1},Series:{max:1},X:{max:1},Y:{max:1},Size:{max:1},Gradient:{max:0},Play:{max:0}},{Category:{max:1},Series:{max:0},X:{max:1},Y:{max:1},Size:{max:1},Gradient:{max:1},Play:{max:0}}],categorical:{categories:{"for":{"in":"Category"}},values:{group:{by:"Series",select:[{bind:{to:"X"}},{bind:{to:"Y"}},{bind:{to:"Size"}},{bind:{to:"Gradient"}}]}},rowCount:{preferred:{min:2}},dataReductionAlgorithm:{sample:{}},dataVolume:4}},{conditions:[{Category:{max:1},Series:{max:1},X:{max:1},Y:{max:1},Size:{max:1},Gradient:{max:0},Play:{min:1,max:1}},{Category:{max:1},Series:{max:0},X:{max:1},Y:{max:1},Size:{max:1},Gradient:{max:1},Play:{min:1,max:1}}],matrix:{rows:{select:[{bind:{to:"Play"}},{bind:{to:"Category"}}],dataReductionAlgorithm:{bottom:{count:5e3}}},columns:{"for":{"in":"Series"},dataReductionAlgorithm:{top:{count:60}}},values:{select:[{bind:{to:"X"}},{bind:{to:"Y"}},{bind:{to:"Size"}}]}}},{conditions:[{Category:{max:1},Series:{max:1},X:{max:1},Y:{max:1},Size:{max:0},Gradient:{max:0},Play:{max:0}},{Category:{max:1},Series:{max:0},X:{max:1},Y:{max:1},Size:{max:0},Gradient:{max:1},Play:{max:0}}],requiredProperties:[{objectName:"trend",propertyName:"show"}],usage:{regression:{combineSeries:{objectName:"trend",propertyName:"combineSeries"}}},categorical:{categories:{"for":{"in":"regression.X"}},values:{group:{by:"regression.Series",select:[{"for":{"in":"regression.Y"}}]}},dataReductionAlgorithm:{sample:{}},dataVolume:4}}],sorting:{custom:{},implicit:{clauses:[{role:"Play",direction:1}]}},drilldown:{roles:["Category"]}},t.scatterChartProps={general:{formatString:{objectName:"general",propertyName:"formatString"}},dataPoint:{defaultColor:{objectName:"dataPoint",propertyName:"defaultColor"},fill:{objectName:"dataPoint",propertyName:"fill"}},trend:{show:{objectName:"trend",propertyName:"show"}},colorBorder:{show:{objectName:"colorBorder",propertyName:"show"}},fillPoint:{show:{objectName:"fillPoint",propertyName:"show"}},colorByCategory:{show:{objectName:"colorByCategory",propertyName:"show"}},currentFrameIndex:{index:{objectName:"currentFrameIndex",propertyName:"index"}},legend:{labelColor:{objectName:"legend",propertyName:"labelColor"}},plotArea:{image:{objectName:"plotArea",propertyName:"image"},transparency:{objectName:"plotArea",propertyName:"transparency"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.slicerCapabilities={dataRoles:[{name:"Values",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Field"),description:e.data.createDisplayNameGetter("Role_DisplayName_FieldDescription")}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{filter:{type:{filter:{}}},defaultValue:{type:{expression:{defaultValue:!0}}},formatString:t.StandardObjectProperties.formatString,outlineColor:t.StandardObjectProperties.outlineColor,outlineWeight:t.StandardObjectProperties.outlineWeight,orientation:{displayName:e.data.createDisplayNameGetter("Slicer_Orientation"),type:{enumeration:t.slicerOrientation.type}},count:{type:{integer:!0}}}},selection:{displayName:e.data.createDisplayNameGetter("Visual_SelectionControls"),properties:{selectAllCheckboxEnabled:{displayName:e.data.createDisplayNameGetter("Visual_SelectAll"),type:{bool:!0}},singleSelect:{displayName:e.data.createDisplayNameGetter("Visual_SingleSelect"),type:{bool:!0}}}},header:{displayName:e.data.createDisplayNameGetter("Visual_Header"),properties:{show:t.StandardObjectProperties.show,fontColor:t.StandardObjectProperties.fontColor,background:{displayName:e.data.createDisplayNameGetter("Visual_Background"),type:{fill:{solid:{color:!0}}}},outline:t.StandardObjectProperties.outline,textSize:{displayName:e.data.createDisplayNameGetter("Visual_TextSize"),type:{numeric:!0}}}},items:{displayName:e.data.createDisplayNameGetter("Role_DisplayName_Items"),properties:{fontColor:t.StandardObjectProperties.fontColor,background:{displayName:e.data.createDisplayNameGetter("Visual_Background"),type:{fill:{solid:{color:!0}}}},outline:t.StandardObjectProperties.outline,textSize:{displayName:e.data.createDisplayNameGetter("Visual_TextSize"),type:{numeric:!0}}}}},dataViewMappings:[{conditions:[{Values:{max:1}}],categorical:{categories:{"for":{"in":"Values"},dataReductionAlgorithm:{window:{}}},includeEmptyGroups:!0}}],sorting:{"default":{}},suppressDefaultTitle:!0,disableVisualDetails:!0},t.slicerProps={general:{outlineColor:{objectName:"general",propertyName:"outlineColor"},outlineWeight:{objectName:"general",propertyName:"outlineWeight"},orientation:{objectName:"general",propertyName:"orientation"},count:{objectName:"general",propertyName:"count"}},selection:{selectAllCheckboxEnabled:{objectName:"selection",propertyName:"selectAllCheckboxEnabled"},singleSelect:{objectName:"selection",propertyName:"singleSelect"}},header:{show:{objectName:"header",propertyName:"show"},fontColor:{objectName:"header",propertyName:"fontColor"},background:{objectName:"header",propertyName:"background"},outline:{objectName:"header",propertyName:"outline"},textSize:{objectName:"header",propertyName:"textSize"}},items:{fontColor:{objectName:"items",propertyName:"fontColor"},background:{objectName:"items",propertyName:"background"},outline:{objectName:"items",propertyName:"outline"},textSize:{objectName:"items",propertyName:"textSize"}},selectedPropertyIdentifier:{objectName:"general",propertyName:"selected"},filterPropertyIdentifier:{objectName:"general",propertyName:"filter"},formatString:{objectName:"general",propertyName:"formatString"},defaultValue:{objectName:"general",propertyName:"defaultValue"}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.tableCapabilities={dataRoles:[{name:"Values",kind:e.VisualDataRoleKind.GroupingOrMeasure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Values")}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString,columnWidth:{type:{numeric:!0}},totals:{type:{bool:!0},displayName:e.data.createDisplayNameGetter("Visual_Totals"),suppressFormatPainterCopy:!0},autoSizeColumnWidth:{type:{bool:!0},displayName:e.data.createDisplayNameGetter("Visual_Adjust_Column_Width"),suppressFormatPainterCopy:!0},textSize:{displayName:e.data.createDisplayNameGetter("Visual_TextSize"),type:{numeric:!0}}}},grid:{displayName:e.data.createDisplayNameGetter("Visual_Grid"),properties:{outlineColor:t.StandardObjectProperties.outlineColor,outlineWeight:t.StandardObjectProperties.outlineWeight,gridVertical:{displayName:e.data.createDisplayNameGetter("Visual_GridVertical"),description:e.data.createDisplayNameGetter("Visual_GridVertical_Desc"),type:{bool:!0}},gridVerticalColor:{displayName:e.data.createDisplayNameGetter("Visual_GridVertical_Color"),description:e.data.createDisplayNameGetter("Visual_GridVertical_Color_Desc"),type:{fill:{solid:{color:!0}}}},gridVerticalWeight:{displayName:e.data.createDisplayNameGetter("Visual_GridVertical_Weight"),description:e.data.createDisplayNameGetter("Visual_GridVertical_Weight_Desc"),type:{numeric:!0}},gridHorizontal:{displayName:e.data.createDisplayNameGetter("Visual_GridHorizontal"),description:e.data.createDisplayNameGetter("Visual_GridHorizontal_Desc"),type:{bool:!0}},gridHorizontalColor:{displayName:e.data.createDisplayNameGetter("Visual_GridHorizontal_Color"),description:e.data.createDisplayNameGetter("Visual_GridHorizontal_Color_Desc"),type:{fill:{solid:{color:!0}}}},gridHorizontalWeight:{displayName:e.data.createDisplayNameGetter("Visual_GridHorizontal_Weight"),description:e.data.createDisplayNameGetter("Visual_GridHorizontal_Weight_Desc"),type:{numeric:!0}},rowPadding:{displayName:e.data.createDisplayNameGetter("Visual_RowPadding"),description:e.data.createDisplayNameGetter("Visual_RowPadding_Desc"),type:{numeric:!0}},imageHeight:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_ImageHeight"),description:e.data.createDisplayNameGetter("Visual_Tablix_ImageHeight_Desc"),type:{numeric:!0}}}},columnHeaders:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_ColumnHeaders"),properties:{outline:t.StandardObjectProperties.outline,fontColor:t.StandardObjectProperties.fontColor,backColor:t.StandardObjectProperties.backColor}},values:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_Values"),properties:{outline:t.StandardObjectProperties.outline,backColor:{type:{fill:{solid:{color:!0}}}},fontColorPrimary:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_FontColorPrimary"),description:e.data.createDisplayNameGetter("Visual_Tablix_FontColorPrimary_Desc"),type:{fill:{solid:{color:!0}}}},backColorPrimary:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_BackColorPrimary"),description:e.data.createDisplayNameGetter("Visual_Tablix_BackColorPrimary_Desc"),type:{fill:{solid:{color:!0}}}},fontColorSecondary:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_FontColorSecondary"),description:e.data.createDisplayNameGetter("Visual_Tablix_FontColorSecondary_Desc"),type:{fill:{solid:{color:!0}}}},backColorSecondary:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_BackColorSecondary"),description:e.data.createDisplayNameGetter("Visual_Tablix_BackColorSecondary_Desc"),type:{fill:{solid:{color:!0}}}},urlIcon:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_UrlIcon"),description:e.data.createDisplayNameGetter("Visual_Tablix_UrlIcon_Desc"),type:{bool:!0}}}},total:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_TotalGrand"),properties:{outline:t.StandardObjectProperties.outline,fontColor:t.StandardObjectProperties.fontColor,backColor:t.StandardObjectProperties.backColor}}},dataViewMappings:[{table:{rows:{"for":{"in":"Values"},dataReductionAlgorithm:{window:{count:500}}},rowCount:{preferred:{min:1}}}}],sorting:{custom:{}},suppressDefaultTitle:!0,supportsSelection:!1,disableVisualDetails:!0}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.matrixRoleNames={rows:"Rows",columns:"Columns",values:"Values"},t.matrixCapabilities={dataRoles:[{name:t.matrixRoleNames.rows,kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Rows"),description:e.data.createDisplayNameGetter("Role_DisplayName_RowsDescription")},{name:t.matrixRoleNames.columns,kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Columns"),description:e.data.createDisplayNameGetter("Role_DisplayName_ColumnsDescription")},{name:t.matrixRoleNames.values,kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Values")}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString,columnWidth:{type:{numeric:!0}},rowSubtotals:{type:{bool:!0},displayName:e.data.createDisplayNameGetter("Visual_TotalRow"),suppressFormatPainterCopy:!0},columnSubtotals:{type:{bool:!0},displayName:e.data.createDisplayNameGetter("Visual_TotalColumn"),suppressFormatPainterCopy:!0},autoSizeColumnWidth:{type:{bool:!0},displayName:e.data.createDisplayNameGetter("Visual_Adjust_Column_Width"),suppressFormatPainterCopy:!0},textSize:{displayName:e.data.createDisplayNameGetter("Visual_TextSize"),type:{numeric:!0}}}},grid:{displayName:e.data.createDisplayNameGetter("Visual_Grid"),properties:{outlineColor:t.StandardObjectProperties.outlineColor,outlineWeight:t.StandardObjectProperties.outlineWeight,gridVertical:{displayName:e.data.createDisplayNameGetter("Visual_GridVertical"),
5description:e.data.createDisplayNameGetter("Visual_GridVertical_Desc"),type:{bool:!0}},gridVerticalColor:{displayName:e.data.createDisplayNameGetter("Visual_GridVertical_Color"),description:e.data.createDisplayNameGetter("Visual_GridVertical_Color_Desc"),type:{fill:{solid:{color:!0}}}},gridVerticalWeight:{displayName:e.data.createDisplayNameGetter("Visual_GridVertical_Weight"),description:e.data.createDisplayNameGetter("Visual_GridVertical_Weight_Desc"),type:{numeric:!0}},gridHorizontal:{displayName:e.data.createDisplayNameGetter("Visual_GridHorizontal"),description:e.data.createDisplayNameGetter("Visual_GridHorizontal_Desc"),type:{bool:!0}},gridHorizontalColor:{displayName:e.data.createDisplayNameGetter("Visual_GridHorizontal_Color"),description:e.data.createDisplayNameGetter("Visual_GridHorizontal_Color_Desc"),type:{fill:{solid:{color:!0}}}},gridHorizontalWeight:{displayName:e.data.createDisplayNameGetter("Visual_GridHorizontal_Weight"),description:e.data.createDisplayNameGetter("Visual_GridHorizontal_Weight_Desc"),type:{numeric:!0}},rowPadding:{displayName:e.data.createDisplayNameGetter("Visual_RowPadding"),description:e.data.createDisplayNameGetter("Visual_RowPadding_Desc"),type:{numeric:!0}},imageHeight:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_ImageHeight"),description:e.data.createDisplayNameGetter("Visual_Tablix_ImageHeight_Desc"),type:{numeric:!0}}}},columnHeaders:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_ColumnHeaders"),properties:{outline:t.StandardObjectProperties.outline,fontColor:t.StandardObjectProperties.fontColor,backColor:t.StandardObjectProperties.backColor}},rowHeaders:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_RowHeaders"),properties:{outline:t.StandardObjectProperties.outline,fontColor:t.StandardObjectProperties.fontColor,backColor:t.StandardObjectProperties.backColor}},values:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_Values"),properties:{outline:t.StandardObjectProperties.outline,fontColorPrimary:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_FontColorPrimary"),description:e.data.createDisplayNameGetter("Visual_Tablix_FontColorPrimary_Desc"),type:{fill:{solid:{color:!0}}}},backColorPrimary:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_BackColorPrimary"),description:e.data.createDisplayNameGetter("Visual_Tablix_BackColorPrimary_Desc"),type:{fill:{solid:{color:!0}}}},fontColorSecondary:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_FontColorSecondary"),description:e.data.createDisplayNameGetter("Visual_Tablix_FontColorSecondary_Desc"),type:{fill:{solid:{color:!0}}}},backColorSecondary:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_BackColorSecondary"),description:e.data.createDisplayNameGetter("Visual_Tablix_BackColorSecondary_Desc"),type:{fill:{solid:{color:!0}}}}}},subTotals:{displayName:e.data.createDisplayNameGetter("Visual_Tablix_TotalSub"),properties:{outline:t.StandardObjectProperties.outline,fontColor:t.StandardObjectProperties.fontColor,backColor:t.StandardObjectProperties.backColor}}},dataViewMappings:[{conditions:[{Rows:{max:0},Columns:{max:0},Values:{min:1}},{Rows:{min:1},Columns:{min:0},Values:{min:0}},{Rows:{min:0},Columns:{min:1},Values:{min:0}}],matrix:{rows:{"for":{"in":"Rows"},dataReductionAlgorithm:{window:{count:500}}},columns:{"for":{"in":"Columns"},dataReductionAlgorithm:{top:{count:100}}},values:{"for":{"in":"Values"}}}}],filterMappings:{measureFilter:{targetRoles:[t.matrixRoleNames.rows]}},sorting:{custom:{}},suppressDefaultTitle:!0,supportsSelection:!1,disableVisualDetails:!0}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.treemapCapabilities={dataRoles:[{name:"Group",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Group"),description:e.data.createDisplayNameGetter("Role_DisplayName_GroupTreemapDescription")},{name:"Details",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Details")},{name:"Values",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Values"),description:e.data.createDisplayNameGetter("Role_DisplayName_ValuesDescription"),requiredTypes:[{numeric:!0},{integer:!0}]},{name:"Gradient",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Gradient"),description:e.data.createDisplayNameGetter("Role_DisplayName_GradientDescription"),requiredTypes:[{numeric:!0},{integer:!0}]}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString}},legend:{displayName:e.data.createDisplayNameGetter("Visual_Legend"),description:e.data.createDisplayNameGetter("Visual_LegendDescription"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.legendPosition,showTitle:t.StandardObjectProperties.showLegendTitle,titleText:t.StandardObjectProperties.legendTitle,labelColor:t.StandardObjectProperties.labelColor,fontSize:t.StandardObjectProperties.fontSize}},dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),description:e.data.createDisplayNameGetter("Visual_DataPointDescription"),properties:{fill:{type:{fill:{solid:{color:!0}}}},fillRule:{displayName:e.data.createDisplayNameGetter("Visual_Gradient"),type:{fillRule:{}},rule:{inputRole:"Gradient",output:{property:"fill",selector:["Group"]}}}}},labels:{displayName:e.data.createDisplayNameGetter("Visual_DataPointsLabels"),description:e.data.createDisplayNameGetter("Visual_DataPointsLabelsDescription"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision}},categoryLabels:{displayName:e.data.createDisplayNameGetter("Visual_CategoryLabels"),description:e.data.createDisplayNameGetter("Visual_CategoryLabelsDescription"),properties:{show:t.StandardObjectProperties.show}}},dataViewMappings:[{conditions:[{Group:{max:1},Details:{max:0},Gradient:{max:1}},{Group:{max:1},Details:{min:1,max:1},Values:{max:1},Gradient:{max:0}}],categorical:{categories:{"for":{"in":"Group"},dataReductionAlgorithm:{top:{}}},values:{group:{by:"Details",select:[{bind:{to:"Values"}},{bind:{to:"Gradient"}}],dataReductionAlgorithm:{top:{}}}},rowCount:{preferred:{min:2}}}}],supportsHighlight:!0,sorting:{custom:{},implicit:{clauses:[{role:"Values",direction:2}]}},drilldown:{roles:["Group"]}},t.treemapProps={general:{formatString:{objectName:"general",propertyName:"formatString"}},dataPoint:{fill:{objectName:"dataPoint",propertyName:"fill"}},legend:{show:{objectName:"legend",propertyName:"show"},position:{objectName:"legend",propertyName:"position"},showTitle:{objectName:"legend",propertyName:"showTitle"},titleText:{objectName:"legend",propertyName:"titleText"},labelColor:{objectName:"legend",propertyName:"labelColor"}},labels:{show:{objectName:"labels",propertyName:"show"},color:{objectName:"labels",propertyName:"color"},labelDisplayUnits:{objectName:"labels",propertyName:"labelDisplayUnits"},labelPrecision:{objectName:"labels",propertyName:"labelPrecision"}},categoryLabels:{show:{objectName:"categoryLabels",propertyName:"show"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.cardCapabilities={dataRoles:[{name:"Values",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Fields"),description:e.data.createDisplayNameGetter("Role_DisplayName_FieldsDescription")}],objects:{general:{properties:{formatString:t.StandardObjectProperties.formatString}},labels:{displayName:e.data.createDisplayNameGetter("Visual_DataPointLabel"),properties:{color:t.StandardObjectProperties.dataColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision,fontSize:t.StandardObjectProperties.fontSize}},categoryLabels:{displayName:e.data.createDisplayNameGetter("Visual_CategoryLabel"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,fontSize:t.StandardObjectProperties.fontSize}},wordWrap:{displayName:e.data.createDisplayNameGetter("Visual_WordWrap"),properties:{show:t.StandardObjectProperties.show}}},dataViewMappings:[{conditions:[{Values:{max:1}}],single:{role:"Values"}}],suppressDefaultTitle:!0,supportsSelection:!1},t.cardProps={categoryLabels:{show:{objectName:"categoryLabels",propertyName:"show"},color:{objectName:"categoryLabels",propertyName:"color"},fontSize:{objectName:"categoryLabels",propertyName:"fontSize"}},labels:{color:{objectName:"labels",propertyName:"color"},labelPrecision:{objectName:"labels",propertyName:"labelPrecision"},labelDisplayUnits:{objectName:"labels",propertyName:"labelDisplayUnits"},fontSize:{objectName:"labels",propertyName:"fontSize"}},wordWrap:{show:{objectName:"wordWrap",propertyName:"show"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.waterfallChartCapabilities={dataRoles:[{name:"Category",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_Category"),description:e.data.createDisplayNameGetter("Role_DisplayName_CategoryWaterfallDescription")},{name:"Y",kind:e.VisualDataRoleKind.Measure,requiredTypes:[{numeric:!0},{integer:!0}],displayName:e.data.createDisplayNameGetter("Role_DisplayName_Y")}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{formatString:t.StandardObjectProperties.formatString}},legend:{displayName:e.data.createDisplayNameGetter("Visual_Legend"),description:e.data.createDisplayNameGetter("Visual_LegendDescription"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.legendPosition,showTitle:t.StandardObjectProperties.showLegendTitle,titleText:$.extend({},t.StandardObjectProperties.legendTitle,{suppressFormatPainterCopy:!0}),labelColor:t.StandardObjectProperties.labelColor,fontSize:t.StandardObjectProperties.fontSize}},labels:{displayName:e.data.createDisplayNameGetter("Visual_DataPointsLabels"),description:e.data.createDisplayNameGetter("Visual_DataPointsLabelsDescription"),properties:{show:t.StandardObjectProperties.show,color:t.StandardObjectProperties.dataColor,labelDisplayUnits:t.StandardObjectProperties.dataLabelDisplayUnits,labelPrecision:$.extend({},t.StandardObjectProperties.labelPrecision,{suppressFormatPainterCopy:!0}),fontSize:t.StandardObjectProperties.fontSize}},sentimentColors:{displayName:e.data.createDisplayNameGetter("Waterfall_SentimentColors"),properties:{increaseFill:{displayName:e.data.createDisplayNameGetter("Waterfall_IncreaseLabel"),type:{fill:{solid:{color:!0}}}},decreaseFill:{displayName:e.data.createDisplayNameGetter("Waterfall_DecreaseLabel"),type:{fill:{solid:{color:!0}}}},totalFill:{displayName:e.data.createDisplayNameGetter("Waterfall_TotalLabel"),type:{fill:{solid:{color:!0}}}}}},categoryAxis:{displayName:e.data.createDisplayNameGetter("Visual_XAxis"),properties:{show:t.StandardObjectProperties.show,showAxisTitle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Title"),description:e.data.createDisplayNameGetter("Visual_Axis_XTitleDescription"),type:{bool:!0}},axisStyle:t.StandardObjectProperties.axisStyle,labelColor:t.StandardObjectProperties.labelColor}},valueAxis:{displayName:e.data.createDisplayNameGetter("Visual_YAxis"),properties:{show:t.StandardObjectProperties.show,position:t.StandardObjectProperties.yAxisPosition,start:t.StandardObjectProperties.axisStart,end:t.StandardObjectProperties.axisEnd,showAxisTitle:{displayName:e.data.createDisplayNameGetter("Visual_Axis_Title"),description:e.data.createDisplayNameGetter("Visual_Axis_YTitleDescription"),type:{bool:!0}},axisStyle:t.StandardObjectProperties.axisStyle,labelColor:t.StandardObjectProperties.labelColor,labelDisplayUnits:t.StandardObjectProperties.labelDisplayUnits,labelPrecision:t.StandardObjectProperties.labelPrecision}},y1AxisReferenceLine:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Description"),properties:{show:t.StandardObjectProperties.show,value:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Value"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Value_Description"),type:{numeric:!0}},lineColor:t.StandardObjectProperties.lineColor,transparency:{displayName:e.data.createDisplayNameGetter("Visual_Reference_Line_Transparency"),description:e.data.createDisplayNameGetter("Visual_Reference_Line_Transparency_Description"),type:{numeric:!0}},style:t.StandardObjectProperties.referenceLineStyle,position:t.StandardObjectProperties.referenceLinePosition,dataLabelShow:t.StandardObjectProperties.dataLabelShow,dataLabelColor:t.StandardObjectProperties.dataLabelColor,dataLabelDecimalPoints:t.StandardObjectProperties.dataLabelDecimalPoints,dataLabelHorizontalPosition:t.StandardObjectProperties.dataLabelHorizontalPosition,dataLabelVerticalPosition:t.StandardObjectProperties.dataLabelVerticalPosition,dataLabelDisplayUnits:t.StandardObjectProperties.dataLabelDisplayUnits}},plotArea:{displayName:e.data.createDisplayNameGetter("Visual_Plot"),properties:{transparency:t.StandardObjectProperties.transparency,image:t.StandardObjectProperties.image}}},dataViewMappings:[{conditions:[{Category:{max:1},Y:{max:1}}],categorical:{categories:{"for":{"in":"Category"},dataReductionAlgorithm:{top:{}}},values:{select:[{bind:{to:"Y"}}]}}}],drilldown:{roles:["Category"]}},t.waterfallChartProps={general:{formatString:{objectName:"general",propertyName:"formatString"}},sentimentColors:{increaseFill:{objectName:"sentimentColors",propertyName:"increaseFill"},decreaseFill:{objectName:"sentimentColors",propertyName:"decreaseFill"},totalFill:{objectName:"sentimentColors",propertyName:"totalFill"}},legend:{labelColor:{objectName:"legend",propertyName:"labelColor"}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.KPIStatusWithHistoryCapabilities={dataRoles:[{name:"Indicator",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_KPI_Indicator"),description:e.data.createDisplayNameGetter("Role_DisplayName_KPI_IndicatorDescription")},{name:"TrendLine",kind:e.VisualDataRoleKind.Grouping,displayName:e.data.createDisplayNameGetter("Role_DisplayName_KPI_TrendLine"),description:e.data.createDisplayNameGetter("Role_DisplayName_KPI_Trendline_Description")},{name:"Goal",kind:e.VisualDataRoleKind.Measure,displayName:e.data.createDisplayNameGetter("Role_DisplayName_KPI_Goal"),description:e.data.createDisplayNameGetter("Role_DisplayName_KPI_GoalDescription")}],dataViewMappings:[{conditions:[{Indicator:{max:1},TrendLine:{max:1},Goal:{max:2}}],categorical:{categories:{"for":{"in":"TrendLine"},dataReductionAlgorithm:{top:{}}},values:{select:[{bind:{to:"Indicator"}},{bind:{to:"Goal"}}]}}}],objects:{general:{properties:{formatString:t.StandardObjectProperties.formatString}},indicator:{displayName:e.data.createDisplayNameGetter("Role_DisplayName_KPI_Indicator"),description:e.data.createDisplayNameGetter("Role_DisplayName_KPI_IndicatorDescription"),properties:{indicatorDisplayUnits:{displayName:e.data.createDisplayNameGetter("Visual_DisplayUnits"),description:e.data.createDisplayNameGetter("Visual_DisplayUnitsDescription"),type:{formatting:{labelDisplayUnits:!0}}},indicatorPrecision:{displayName:e.data.createDisplayNameGetter("Visual_Precision"),description:e.data.createDisplayNameGetter("Visual_PrecisionDescription"),placeHolderText:e.data.createDisplayNameGetter("Visual_Precision_Auto"),type:{numeric:!0}},kpiFormat:{displayName:e.data.createDisplayNameGetter("TaskPane_Format"),type:{text:!0}}}},trendline:{displayName:e.data.createDisplayNameGetter("Role_DisplayName_KPI_TrendLine"),description:e.data.createDisplayNameGetter("Role_DisplayName_KPI_Trendline_Description"),properties:{show:t.StandardObjectProperties.show}},goals:{displayName:e.data.createDisplayNameGetter("Role_DisplayName_KPI_Goals"),description:e.data.createDisplayNameGetter("Role_DisplayName_KPI_Goals"),properties:{showGoal:{displayName:e.data.createDisplayNameGetter("Role_DisplayName_KPI_Show_Goal"),type:{bool:!0}},showDistance:{displayName:e.data.createDisplayNameGetter("Role_DisplayName_KPI_Show_Distance"),type:{bool:!0}}}},status:{displayName:e.data.createDisplayNameGetter("Role_DisplayName_KPI_Status"),description:e.data.createDisplayNameGetter("Role_DisplayName_KPI_Status"),properties:{direction:{displayName:e.data.createDisplayNameGetter("Visual_KPI_Direction"),type:{enumeration:t.kpiDirection.type}}}}}}}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){t.animatedNumber=e.visuals.animatedNumberCapabilities,t.areaChart=e.visuals.lineChartCapabilities,t.barChart=e.visuals.getColumnChartCapabilities(!0),t.card=e.visuals.cardCapabilities,t.multiRowCard=e.visuals.multiRowCardCapabilities,t.clusteredBarChart=e.visuals.getColumnChartCapabilities(!0),t.clusteredColumnChart=e.visuals.getColumnChartCapabilities(),t.columnChart=e.visuals.getColumnChartCapabilities(),t.comboChart=e.visuals.comboChartCapabilities,t.dataDotChart=e.visuals.dataDotChartCapabilities,t.dataDotClusteredColumnComboChart=e.visuals.comboChartCapabilities,t.dataDotStackedColumnComboChart=e.visuals.comboChartCapabilities,t.donutChart=e.visuals.donutChartCapabilities,t.funnel=e.visuals.funnelChartCapabilities,t.gauge=e.visuals.gaugeCapabilities,t.hundredPercentStackedBarChart=e.visuals.getColumnChartCapabilities(!0),t.hundredPercentStackedColumnChart=e.visuals.getColumnChartCapabilities(),t.image=e.visuals.imageVisualCapabilities,t.lineChart=e.visuals.lineChartCapabilities,t.lineStackedColumnComboChart=e.visuals.comboChartCapabilities,t.lineClusteredColumnComboChart=e.visuals.comboChartCapabilities,t.map=e.visuals.mapCapabilities,t.filledMap=e.visuals.filledMapCapabilities,t.treemap=e.visuals.treemapCapabilities,t.pieChart=e.visuals.donutChartCapabilities,t.scatterChart=e.visuals.scatterChartCapabilities,t.table=e.visuals.tableCapabilities,t.matrix=e.visuals.matrixCapabilities,t.slicer=e.visuals.slicerCapabilities,t.textbox=e.visuals.textboxCapabilities,t.waterfallChart=e.visuals.waterfallChartCapabilities,t.cheerMeter=e.visuals.cheerMeterCapabilities,t.scriptVisual=e.visuals.scriptVisualCapabilities,t.kpi=e.visuals.KPIStatusWithHistoryCapabilities}(i=t.capabilities||(t.capabilities={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(i,a){this.options=i;var r=i.eventGroup;r.on("click",function(){var e=t.getDatumForLastInputEvent();a.handleSelection(e,d3.event.ctrlKey)}),r.on("contextmenu",function(){if(!d3.event.ctrlKey){d3.event.preventDefault();var i=t.getDatumForLastInputEvent(),r=e.InteractivityUtils.getPositionOfLastInputEvent();a.handleContextMenu(i,r)}})},t.prototype.renderSelection=function(t){var i=this.options;i.bars.style("fill-opacity",function(a){return e.ColumnUtil.getFillOpacity(a.selected,a.highlight,!a.highlight&&t,!a.selected&&i.hasHighlights)})},t.getDatumForLastInputEvent=function(){var e=d3.event.target;return d3.select(e).datum()},t}();e.ColumnChartWebBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(t,i){var a=this.dots=t.dots,r=t.dotLabels;e.InteractivityUtils.registerStandardInteractivityHandlers(a,i),r&&e.InteractivityUtils.registerStandardInteractivityHandlers(r,i)},t.prototype.renderSelection=function(t){this.dots.style("fill-opacity",function(i){return e.ColumnUtil.getFillOpacity(i.selected,i.highlight,t,!1)})},t}();e.DataDotChartWebBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(t,i){var a=this.slices=t.slices,r=this.highlightSlices=t.highlightSlices,o=t.clearCatcher;this.hasHighlights=t.hasHighlights;var n=function(e){i.handleSelection(e.data,d3.event.ctrlKey)},s=function(t){if(!d3.event.ctrlKey){var a=e.InteractivityUtils.getPositionOfLastInputEvent();i.handleContextMenu(t.data,a),d3.event.preventDefault()}};a.on("click",n),a.on("contextmenu",s),r.on("click",n),r.on("contextmenu",s),o.on("click",function(){i.handleClearSelection()})},t.prototype.renderSelection=function(t){var i=this.hasHighlights;this.slices.style("fill-opacity",function(a){return e.ColumnUtil.getFillOpacity(a.data.selected,!1,t,i&&!a.data.selected)}),this.highlightSlices.style("fill-opacity",function(t){return e.ColumnUtil.getFillOpacity(t.data.selected,!0,!1,i)})},t}();e.DonutChartWebBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(t,i){var a=this.bars=t.bars,r=this.interactors=t.interactors,o=t.clearCatcher;this.hasHighlights=t.hasHighlights,e.InteractivityUtils.registerStandardInteractivityHandlers(a,i),e.InteractivityUtils.registerStandardInteractivityHandlers(r,i),o.on("click",function(){i.handleClearSelection()})},t.prototype.renderSelection=function(t){var i=this.hasHighlights;this.bars.style("fill-opacity",function(a){return e.ColumnUtil.getFillOpacity(a.selected,a.highlight,!a.highlight&&t,!a.selected&&i)})},t}();e.FunnelWebBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(t,i){this.lines=t.lines;var a=t.interactivityLines,r=this.dots=t.dots,o=this.areas=t.areas,n=this.tooltipOverlay=t.tooltipOverlay;e.InteractivityUtils.registerStandardInteractivityHandlers(a,i),e.InteractivityUtils.registerStandardInteractivityHandlers(r,i),o&&e.InteractivityUtils.registerStandardInteractivityHandlers(o,i),n&&n.on("click",function(){return i.handleClearSelection()})},t.prototype.renderSelection=function(t){this.lines.style("stroke-opacity",function(i){return e.ColumnUtil.getFillOpacity(i.selected,!1,t,!1)}),this.dots.style("fill-opacity",function(i){return e.ColumnUtil.getFillOpacity(i.selected,!1,t,!1)}),this.areas&&this.areas.style("fill-opacity",function(i){return t&&!i.selected?e.LineChart.DimmedAreaFillOpacity:e.LineChart.AreaFillOpacity})},t}();e.LineChartWebBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){this.mapPointerEventsDisabled=!1,this.mapPointerTimeoutSet=!1,this.viewChangedSinceLastClearMouseDown=!1,this.receivedZoomOrPanEvent=!1}return t.prototype.bindEvents=function(t,i){var a=this,r=this.bubbles=t.bubbles,o=this.slices=t.slices,n=this.shapes=t.shapes,s=t.clearCatcher,l=function(){var e=d3.event.target,t=d3.select(e).datum();r&&r.style("pointer-events","all"),n&&n.style("pointer-events","all"),i.handleSelection(t,d3.event.ctrlKey)};this.mapPointerEventsDisabled||(r&&r.style("pointer-events","all"),o&&o.style("pointer-events","all"),n&&n.style("pointer-events","all")),r&&(t.bubbleEventGroup.on("click",l),t.bubbleEventGroup.on("mousewheel",function(){a.mapPointerEventsDisabled||r.style("pointer-events","none"),a.mapPointerEventsDisabled=!0,a.mapPointerTimeoutSet||(a.mapPointerTimeoutSet=!0,setTimeout(function(){r&&r.style("pointer-events","all"),a.mapPointerEventsDisabled=!1,a.mapPointerTimeoutSet=!1},200))}),e.InteractivityUtils.registerGroupContextMenuHandler(t.bubbleEventGroup,i)),o&&(t.sliceEventGroup.on("click",function(){o.style("pointer-events","all"),a.mapPointerEventsDisabled=!1;var e=d3.event.target,t=d3.select(e).datum();i.handleSelection(t.data,d3.event.ctrlKey)}),t.sliceEventGroup.on("mousewheel",function(){a.mapPointerEventsDisabled||o.style("pointer-events","none"),a.mapPointerEventsDisabled=!0,a.mapPointerTimeoutSet||(a.mapPointerTimeoutSet=!0,setTimeout(function(){o&&o.style("pointer-events","all"),a.mapPointerEventsDisabled=!1,a.mapPointerTimeoutSet=!1},200))}),t.sliceEventGroup.on("contextmenu",function(){if(!d3.event.ctrlKey){d3.event.preventDefault();var t=e.InteractivityUtils.getPositionOfLastInputEvent(),a=d3.event.target,r=d3.select(a).datum();i.handleContextMenu(r.data,t)}})),n&&(t.shapeEventGroup.on("click",l),t.shapeEventGroup.on("mousewheel",function(){a.mapPointerEventsDisabled||n.style("pointer-events","none"),a.mapPointerEventsDisabled=!0,a.mapPointerTimeoutSet||(a.mapPointerTimeoutSet=!0,setTimeout(function(){n&&n.style("pointer-events","all"),a.mapPointerEventsDisabled=!1,a.mapPointerTimeoutSet=!1},200))}),e.InteractivityUtils.registerGroupContextMenuHandler(t.shapeEventGroup,i)),s.on("mouseup",function(){a.viewChangedSinceLastClearMouseDown||(i.handleClearSelection(),a.receivedZoomOrPanEvent=!0)}),s.on("mousedown",function(){a.viewChangedSinceLastClearMouseDown=!1}),s.on("mousewheel",function(){a.receivedZoomOrPanEvent=!0})},t.prototype.renderSelection=function(t){this.bubbles&&this.bubbles.style({"fill-opacity":function(i){return e.ColumnUtil.getFillOpacity(i.selected,!1,t,!1)},"stroke-opacity":function(i){return e.ColumnUtil.getFillOpacity(i.selected,!1,t,!1)}}),this.slices&&this.slices.style({"fill-opacity":function(i){return e.ColumnUtil.getFillOpacity(i.data.selected,!1,t,!1)},"stroke-opacity":function(i){return e.ColumnUtil.getFillOpacity(i.data.selected,!1,t,!1)}}),this.shapes&&this.shapes.style({"fill-opacity":function(i){return e.ColumnUtil.getFillOpacity(i.selected,!1,t,!1)},"stroke-opacity":function(i){return e.ColumnUtil.getFillOpacity(i.selected,!1,t,!1)}})},t.prototype.viewChanged=function(){this.viewChangedSinceLastClearMouseDown=!0},t.prototype.resetZoomPan=function(){this.receivedZoomOrPanEvent=!1},t.prototype.hasReceivedZoomOrPanEvent=function(){return this.receivedZoomOrPanEvent},t}();e.MapBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=jsCommon.CssConstants.createClassAndSelector,i=function(){function t(){}return t.prototype.bindEvents=function(t,i){var a=this.bubbles=t.dataPointsSelection,r=t.data,o=t.eventGroup;!this.playOptions||!this.playOptions.traceLineRenderer||t.playOptions&&t.playOptions.traceLineRenderer||this.playOptions.traceLineRenderer.remove(),this.playOptions=t.playOptions,this.shouldEnableFill=(!r.sizeRange||!r.sizeRange.min)&&r.fillPoint,this.colorBorder=r.colorBorder,o?e.InteractivityUtils.registerGroupInteractivityHandlers(o,i):e.InteractivityUtils.registerStandardInteractivityHandlers(a,i)},t.prototype.renderSelection=function(t){var i=this.shouldEnableFill,a=this.colorBorder;if(this.bubbles.style("fill-opacity",function(a){return e.ScatterChart.getMarkerFillOpacity(null!=a.size,i,t,a.selected)}),this.bubbles.style("stroke-opacity",function(i){return e.ScatterChart.getMarkerStrokeOpacity(null!=i.size,a,t,i.selected)}),this.playOptions&&this.bubbles){var r=this.bubbles.filter(function(e){return e.selected}).data(),o=this.playOptions.traceLineRenderer;r&&r.length>0&&null!=o?o.render(r,!0):o.remove()}},t}();e.ScatterChartWebBehavior=i;var a=function(){function i(){}return i.prototype.bindEvents=function(e,t){this.setOptions(e),e.visualInitOptions&&e.visualInitOptions.interactivity.isInteractiveLegend&&(this.makeDataPointsSelectable(e.dataPointsSelection),this.makeRootSelectable(e.root),this.makeDragable(e.root),this.disableDefaultTouchInteractions(e.root),this.selectRoot())},i.prototype.renderSelection=function(e){},i.prototype.setSelectionHandler=function(e){},i.prototype.makeDataPointsSelectable=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i-0]=arguments[i];for(var a=0,r=t.length;r>a;a++){var o=t[a];o.on("click",function(t,i){e.select(i)})}},i.prototype.makeRootSelectable=function(e){var t=this;e.on("click",function(e,i){t.selectRoot()})},i.prototype.makeDragable=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i-0]=arguments[i];for(var a=0,r=t.length;r>a;a++){var o=t[a],n=d3.behavior.drag().on("drag",function(t){e.drag(0)}).on("dragend",function(t){e.drag(1)});o.call(n)}},i.prototype.disableDefaultTouchInteractions=function(e){e.style("touch-action","none")},i.prototype.setOptions=function(e){this.data=e.data,this.mainGraphicsContext=e.plotContext,this.xAxisProperties=e.xAxisProperties,this.yAxisProperties=e.yAxisProperties,this.host=e.host},i.prototype.select=function(e){this.selectDotByIndex(e)},i.prototype.selectRoot=function(){var e=jsCommon.PerformanceUtil.create("selectRoot");this.onClick(),e.end()},i.prototype.drag=function(e){switch(e){case 0:this.onDrag();break;case 1:this.onClick()}},i.prototype.onDrag=function(){var e=this.getMouseCoordinates();this.moveCrosshairToXY(e.x,e.y);var t=this.findClosestDotIndex(e.x,e.y);this.selectDot(t),this.updateLegend(t)},i.prototype.onClick=function(){var e=this.getMouseCoordinates(),t=this.findClosestDotIndex(e.x,e.y);-1!==t&&this.selectDotByIndex(t)},i.prototype.getMouseCoordinates=function(){var e=this.mainGraphicsContext,t=0,i=parseInt(e.attr("height"),10);i=i||0;try{var a=d3.mouse(e.node());t=a[0],i=a[1]}catch(r){}return{x:t,y:i}},i.prototype.selectDotByIndex=function(e){this.selectDot(e),this.moveCrosshairToIndexDot(e),this.updateLegend(e)},i.prototype.selectDot=function(e){var t=this,a=this.mainGraphicsContext;a.selectAll(i.ScatterChartCircleTagName+i.DotClassSelector).classed({selected:!1,notSelected:!0}),a.selectAll(i.ScatterChartCircleTagName+i.DotClassSelector).filter(function(i,a){var r=t.data.dataPoints,o=r[e];return i.x===o.x&&i.y===o.y}).classed({selected:!0,notSelected:!1})},i.prototype.moveCrosshairToIndexDot=function(e){var t=this.data.dataPoints,a=this.mainGraphicsContext,r=this.xAxisProperties.scale(t[e].x),o=this.yAxisProperties.scale(t[e].y);if(null==this.crosshair){var n=+a.attr("width"),s=+a.attr("height");this.crosshair=this.drawCrosshair(a,r,o,n,s),this.crosshairHorizontal=this.crosshair.select(i.Horizontal.selector),this.crosshairVertical=this.crosshair.select(i.Vertical.selector)}else this.moveCrosshairToXY(r,o)},i.prototype.moveCrosshairToXY=function(e,t){this.crosshairHorizontal.attr({y1:t,y2:t}),this.crosshairVertical.attr({x1:e,x2:e})},i.prototype.drawCrosshair=function(e,t,a,r,o){var n=e.append("g");return n.classed(i.CrosshairClassName,!0),n.append("line").classed(i.Horizontal["class"],!0).attr({x1:0,x2:r,y1:a,y2:a}),n.append("line").classed(i.Vertical["class"],!0).attr({x1:t,x2:t,y1:o,y2:0}),n},i.prototype.findClosestDotIndex=function(e,t){var i=-1,a=Number.MAX_VALUE,r=this.data.dataPoints,o=this.xAxisProperties.scale,n=this.yAxisProperties.scale;for(var s in r){var l=r[s],c=o(l.x),u=n(l.y),h=c-e,d=u-t,p=h*h+d*d;a===Number.MAX_VALUE?(i=s,a=p):a&&a>p&&(i=s,a=p)}return i},i.prototype.updateLegend=function(e){if(null==this.lastDotIndex||this.lastDotIndex!==e){var t=this.createLegendDataPoints(e);this.host.updateLegend(t),this.lastDotIndex=e}},i.prototype.createLegendDataPoints=function(t){var i=e.scatterChartProps.general.formatString,a=[],r=this.data,o=r.dataPoints[t],n=e.valueFormatter.format(null),s=n,l=r.legendData,c=l.dataPoints,u=o.formattedCategory.getValue();return u!==n?s=u:null!=o.radius.sizeMeasure?s=e.valueFormatter.format(o.radius.sizeMeasure.source.groupName):c.length>=t&&c[t].label!==n&&(s=c[t].label),null!=r.xCol&&a.push({category:s,color:o.fill,identity:e.SelectionIdBuilder.builder().withMeasure(r.xCol.queryName).createSelectionId(),selected:o.selected,icon:e.LegendIcon.Box,label:e.valueFormatter.format(this.data.axesLabels.x),measure:e.valueFormatter.format(o.x,e.valueFormatter.getFormatString(r.xCol,i)),iconOnlyOnLabel:!0}),null!=r.yCol&&a.push({category:s,color:o.fill,identity:e.SelectionIdBuilder.builder().withMeasure(r.yCol.queryName).createSelectionId(),selected:o.selected,
6icon:e.LegendIcon.Box,label:e.valueFormatter.format(r.axesLabels.y),measure:e.valueFormatter.format(o.y,e.valueFormatter.getFormatString(r.yCol,i)),iconOnlyOnLabel:!0}),null!=r.size&&a.push({category:s,color:o.fill,identity:e.SelectionIdBuilder.builder().withMeasure(r.size.queryName).createSelectionId(),selected:o.selected,icon:e.LegendIcon.Box,label:e.valueFormatter.format(r.size.displayName),measure:e.valueFormatter.format(o.radius.sizeMeasure.values[o.radius.index],e.valueFormatter.getFormatString(r.size,i)),iconOnlyOnLabel:!0}),{dataPoints:a}},i.CrosshairClassName="crosshair",i.ScatterChartCircleTagName="circle",i.DotClassName="dot",i.DotClassSelector="."+i.DotClassName,i.Horizontal=t("horizontal"),i.Vertical=t("vertical"),i}();e.ScatterChartMobileBehavior=a}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(t,i){this.itemLabels=t.itemLabels,this.dataPoints=t.dataPoints,this.interactivityService=t.interactivityService,this.slicerSettings=t.settings,e.SlicerWebBehavior.bindSlicerEvents(t.slicerContainer,this.itemLabels,t.clear,i,this.slicerSettings,this.interactivityService)},t.prototype.renderSelection=function(t){e.SlicerWebBehavior.setSelectionOnSlicerItems(this.itemLabels,this.itemLabels,t,this.interactivityService,this.slicerSettings)},t}();e.HorizontalSlicerWebBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(t,i){var a=t.itemContainers;this.itemLabels=t.itemLabels,this.itemInputs=t.itemInputs,this.dataPoints=t.dataPoints,this.interactivityService=t.interactivityService,this.settings=t.settings,e.SlicerWebBehavior.bindSlicerEvents(t.slicerContainer,a,t.clear,i,this.settings,this.interactivityService)},t.prototype.renderSelection=function(t){e.SlicerWebBehavior.setSelectionOnSlicerItems(this.itemInputs,this.itemLabels,t,this.interactivityService,this.settings)},t}();e.VerticalSlicerWebBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(e,t){this.behavior=this.createWebBehavior(e),this.behavior.bindEvents(e.behaviorOptions,t)},t.prototype.renderSelection=function(e){this.behavior.renderSelection(e)},t.bindSlicerEvents=function(e,i,a,r,o,n){t.bindSlicerItemSelectionEvent(i,r,o,n),t.bindSlicerClearEvent(a,r),t.styleSlicerContainer(e,n)},t.setSelectionOnSlicerItems=function(e,i,a,r,o){if(a||r.isSelectionModeInverted())t.styleSlicerItems(e,a,r.isSelectionModeInverted());else{e.filter(".selected").classed("selected",!1),e.filter(".partiallySelected").classed("partiallySelected",!1);var n=e.selectAll("input");n&&n.property("checked",!1),i.style("color",o.slicerText.color)}},t.styleSlicerItems=function(e,t,i){e.each(function(e){var a=this,r=!1;e.isSelectAllDataPoint?t?(a.classList.add("partiallySelected"),r=!1):(a.classList.remove("partiallySelected"),r=i):r=jsCommon.LogicExtensions.XOR(e.selected,i),r?a.classList.add("selected"):a.classList.remove("selected");var o=a.getElementsByTagName("input")[0];o&&(o.checked=r)})},t.bindSlicerItemSelectionEvent=function(i,a,r,o){t.isTouch=!1,i.on("touchstart",function(e){t.isTouch=!0}),i.on("pointerdown",function(e){var i=d3.event;i&&"touch"===i.pointerType&&(t.isTouch=!0)}),i.on("click",function(i){d3.event.preventDefault(),i.isSelectAllDataPoint?a.toggleSelectionModeInversion():a.handleSelection(i,t.isTouch||t.isMultiSelect(d3.event,r,o)),a.persistSelectionFilter(e.slicerProps.filterPropertyIdentifier),t.isTouch=!1})},t.bindSlicerClearEvent=function(t,i){t&&t.on("click",function(t){i.handleClearSelection(),i.persistSelectionFilter(e.slicerProps.filterPropertyIdentifier)})},t.styleSlicerContainer=function(e,t){var i=t.hasSelection()&&void 0===t.isDefaultValueEnabled()||t.isDefaultValueEnabled()===!1;e.classed("hasSelection",i)},t.isMultiSelect=function(e,t,i){return i.isSelectionModeInverted()||!t.selection.singleSelect||e.ctrlKey},t.prototype.createWebBehavior=function(t){var i,a=t.orientation;switch(a){case 1:i=new e.HorizontalSlicerWebBehavior;break;case 0:default:i=new e.VerticalSlicerWebBehavior}return i},t}();e.SlicerWebBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(t,i){var a=t.legendItems;this.legendIcons=t.legendIcons;var r=t.clearCatcher;e.InteractivityUtils.registerStandardSelectionHandler(a,i),r.on("click",function(){i.handleClearSelection()})},t.prototype.renderSelection=function(e){e?this.legendIcons.style({fill:function(e){return e.selected?e.color:t.dimmedLegendColor}}):this.legendIcons.style({fill:function(e){return e.color}})},t.dimmedLegendColor="#A6A6A6",t}();e.LegendBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(t,i){var a=this.shapes=t.shapes,r=this.highlightShapes=t.highlightShapes,o=t.majorLabels,n=t.minorLabels;this.hasHighlights=t.hasHighlights,e.InteractivityUtils.registerStandardInteractivityHandlers(a,i),e.InteractivityUtils.registerStandardInteractivityHandlers(r,i),o&&e.InteractivityUtils.registerStandardInteractivityHandlers(o,i),n&&e.InteractivityUtils.registerStandardInteractivityHandlers(n,i)},t.prototype.renderSelection=function(t){var i=this.hasHighlights;this.shapes.style("fill",function(t){return e.Treemap.getFill(t,!1)}).style("fill-opacity",function(a){return e.Treemap.getFillOpacity(a,t,!a.selected&&i,!1)}),this.highlightShapes.style("fill",function(t){return e.Treemap.getFill(t,!0)}).style("fill-opacity",function(a){return e.Treemap.getFillOpacity(a,t,!a.selected&&i,!0)})},t}();e.TreemapWebBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(t,i){var a=this.bars=t.bars;a.on("click",function(e){e.isTotal||i.handleSelection(e,d3.event.ctrlKey)}),a.on("contextmenu",function(t){if(!d3.event.ctrlKey&&(d3.event.preventDefault(),!t.isTotal)){var a=e.InteractivityUtils.getPositionOfLastInputEvent();i.handleContextMenu(t,a)}})},t.prototype.renderSelection=function(t){this.bars.style("fill-opacity",function(i){return i.isTotal?e.ColumnUtil.DefaultOpacity:e.ColumnUtil.getFillOpacity(i.selected,i.highlight,t,!1)})},t}();e.WaterfallChartWebBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function t(){}return t.prototype.bindEvents=function(t,i){this.labelItems=t.labelItems,e.InteractivityUtils.registerStandardSelectionHandler(this.labelItems,i)},t.prototype.renderSelection=function(e){e?this.labelItems.style({opacity:function(e){return e.selected?t.DefaultLabelOpacity:t.DimmedLabelOpacity}}):this.labelItems.style({opacity:t.DefaultLabelOpacity})},t.DefaultLabelOpacity=1,t.DimmedLabelOpacity=.6,t}();e.LabelsBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function e(e){this.behaviors=e}return e.prototype.bindEvents=function(e,t){for(var i=this.behaviors,a=0,r=i.length;r>a;a++)i[a].bindEvents(e.layerOptions[a],t);e.clearCatcher.on("click",function(){t.handleClearSelection()})},e.prototype.renderSelection=function(e){for(var t=0,i=this.behaviors;t<i.length;t++){var a=i[t];a.renderSelection(e)}},e}();e.CartesianChartBehavior=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){t.emptyDomain=[0,0];var i;!function(i){function a(e){return 300>e?3:500>e?5:8}function r(e){return 150>e?3:300>e?5:8}function o(e,t,i,a,r){return isNaN(e)||isNaN(t)?ee:1>=a||1>=t&&e>=-1?a:e===t?r?1:ee:n(i)?a:Math.min(t-e+1,a)}function n(e){for(var t=0,i=e.length;i>t;t++){var a=e[t];if(a&&a.type&&!a.type.integer)return!0}return!1}function s(e,t,i,a,r){return!a||v(t)?l(e,t.domain()):b(i)?h(e,t.domain()):c(e,t,r)}function l(e,t){var i=[];if(0>=e)return i;var a=t.length;if(e>a)return t;for(var r=0,o=Math.ceil(a/e);a>r;r+=o)i.push(t[r]);return i}function c(e,t,i){var a=[];if(0===e)return a;var r=t;if(r.ticks){if(a=r.ticks(e),a.length>e&&e>1&&(a=r.ticks(e-1)),a.length<J&&(a=r.ticks(e+1)),a=u(a),i&&a.length>1){for(var o=a[1]-a[0];o>0&&i>o;){for(var n=1;n<a.length;n++)a.splice(n,1);o=2*o}1===a.length&&a.push(a[0]+i)}return a}return a}function u(e,t){if(void 0===t&&(t=1e-5),!e||e.length<2)return e;var i=t*Math.abs(e[1]-e[0]);return e.map(function(e){return Math.abs(e)<=i?0:e})}function h(t,i){var a=[];if(0===i[0]&&0===i[1])return[];var r=e.DateTimeSequence.calculate(new Date(i[0]),new Date(i[1]),t).sequence;return a=r.map(function(e){return e.getTime()}),a=T(a,i[0],i[1])}function d(e){return isNaN(e.min)||isNaN(e.max)?(e.min=t.emptyDomain[0],e.max=t.emptyDomain[1]):e.min===e.max?(e.min=e.min<0?1.2*e.min:.8*e.min,e.max=e.max<0?.8*e.max:1.2*e.max):Math.abs(e.min)<1e-4&&e.min/(e.max-e.min)<1e-4&&(e.min=0),e}function p(e,t,i,o){return 0===a(e-i)||0===r(t-o)?{top:0,right:i,bottom:o,left:0}:{top:20,right:30,bottom:40,left:30}}function g(e,t,i,o,n,s,l,c,u,h,d,p){var g=n.x,m=n.y1,f=n.y2,y=g.values,b=m.values,C=0,S=0,x=0,w=0,P=0,D=g.categoryThickness?g.categoryThickness/2:0,L=v(g.scale),T=0;if(void 0!==g.outerPadding?T=g.outerPadding:void 0!==g.xLabelMaxWidth&&(T=Math.max(0,(e.width-g.xLabelMaxWidth*y.length)/2)),0!==a(e.width)||0!==r(e.height)){var _=void 0;if(_=c?ae.DefaultRotationWithScrollbar:ae.DefaultRotation,d)for(var V=0,M=b.length;M>V;V++)l.text=b[V],x=Math.max(x,i(l));if(f&&p)for(var N=f.values,V=0,M=N.length;M>V;V++)l.text=N[V],w=Math.max(w,i(l));var A=o(l),O=Math.floor(s/A),I=g.scale,R=I.domain();if(h&&y.length>0){for(var V=0,M=y.length;M>V;V++){var F=void 0;l.text=y[V];var H=i(l);if(g.willLabelsWordBreak){var z=jsCommon.WordBreaker.splitByWidth(l.text,l,i,g.xLabelMaxWidth,O);F=z.length*A,H=g.xLabelMaxWidth}else!g.willLabelsFit&&L?(F=H*_.sine,H*=_.cosine):F=Z;if(0===V){if(L)C=g.willLabelsFit?H/2-D-T:H-D-T,C=Math.max(C,0);else if(R.length>1){var G=I(R[0]);C=H/2-G,C=Math.max(C,0)}}else if(V===M-1)if(L)(g.willLabelsFit||g.willLabelsWordBreak)&&(S=H/2-D-T,S=Math.max(S,0));else if(R.length>1){var G=I(R[1]);S=H/2-(e.width-G),S=Math.max(S,0)}P=Math.max(P,F)}C=Math.min(C,Q),S=Math.min(S,Q)}}var j=0,k=0,E=Math.min(Math.ceil(P),s);return u?(k=Math.min(Math.max(C,w),t),j=Math.min(Math.max(S,x),t)):(k=Math.min(Math.max(C,x),t),j=Math.min(Math.max(S,w),t)),{xMax:Math.ceil(E),yLeft:Math.ceil(k),yRight:Math.ceil(j)}}function m(e){return e&&(e.bool||e.numeric||e.text||e.dateTime)}function f(){return e.ValueType.fromDescriptor({text:!0})}function y(e){return!(!e||!e.text&&!e.bool)}function v(e){return"undefined"==typeof e.invert}function b(e){return!(!e||!e.dateTime)}function C(e,t){return v(e)?x(e,t):e.invert(t)}function S(e){return v(e)?e.rangeExtent():e.range()}function x(e,t){var i=e.range();if(i.length<2)return 0;var a,r=e.rangeBand(),o=(i[1]-i[0]-r)/2;for(a=0;t>i[a]+r+o&&a<i.length-1;a++);return e.domain()[a]}function w(e,t){var i=-1,a=Number.MAX_VALUE;for(var r in t){var o=Math.abs(e-t[r].categoryValue);a>o&&(a=o,i=parseInt(r,10))}return i}function P(e,t){var i=-1,a=Number.MAX_VALUE,r=e.domain();if(r.length<2)return 0;var o=(e(1)-e(0))/2;for(var n in r){var s=e(n),l=s+o,c=Math.abs(t-l);a>c&&(a=c,i=parseInt(n,10))}return i}function D(e,t,i){var a=e(t)-e(i);return 0===a?0:0>a?Math.min(a,-1):Math.max(a,1)}function L(e,t,i,a,r){if(i&&!y(t)){var o=void 0,n=void 0;return a&&2===a.length&&(o=a[0],n=a[1]),F(e,o,n,t,r)}return z(e)}function T(e,t,i){var a=e.filter(function(e){return e>=t&&i>=e});return a.length<2&&(a=[t,i]),a}function V(t,i){return t&&m(t.type)?t.type:i?e.ValueType.fromDescriptor({numeric:!0}):e.ValueType.fromDescriptor({text:!0})}function M(e){var a=e.pixelSpan,r=e.dataDomain,o=e.metaDataColumn,n=e.formatString,l=e.outerPadding||0,c=!!e.isCategoryAxis,u=!!e.isScalar,h=!!e.isVertical,d=!!e.useTickIntervalForDisplayUnits,p=e.getValueFn,g=e.categoryThickness,m=e.axisDisplayUnits,f=e.axisPrecision,y=!!e.is100Pct,v=i.getCategoryValueType(o,u),b=i.createScale(e),C=b.scale,S=b.bestTickCount,x=C.domain(),w=i.isLogScalePossible(r,v);if(g&&u&&r&&2===r.length){var P=r[1]-r[0],D=x[1]-x[0];P>0&&D>0&&(g=g*P/D)}var L;if(u&&1===S)L=[r[0]];else{var T=u?R(n,v,y):void 0;L=s(S,C,v,u,T)}e.scaleType&&e.scaleType===t.axisScale.log&&w&&(L=L.filter(function(e){return i.powerOfTen(e)}));var _=O(x,r,v,u,n,S,L,p,d,m,f),V=d3.svg.axis().scale(C).tickSize(6,0).orient(h?"left":"bottom").ticks(S).tickValues(L),M=[];o&&(M=I(V,L,_,v,p));var A;return!u&&g?A=Math.max(1,g-2*t.CartesianChart.TickLabelPadding):(A=L.length>1?N(C,L):a,A-=2*ie),{scale:C,axis:V,formatter:_,values:M,axisType:v,axisLabel:null,isCategoryAxis:c,xLabelMaxWidth:A,categoryThickness:g,outerPadding:l,usingDefaultDomain:b.usingDefaultDomain,isLogScaleAllowed:w,dataDomain:r}}function N(e,t){return e&&!_.isEmpty(t)?Math.abs(e(t[1])-e(t[0])):1}function A(e){var o,n=e.pixelSpan,s=e.dataDomain,l=e.metaDataColumn,c=e.outerPadding||0,u=!!e.isScalar,h=!!e.isVertical,p=e.forcedTickCount,g=e.categoryThickness,m=!!e.shouldClamp,f=i.getCategoryValueType(l,u),v=h?r(n):a(n),b=s?s.slice():null,C=v,S=!1;if(null==s||2===s.length&&null==s[0]&&null==s[1]||2!==s.length&&u)S=!0,s=f.dateTime||!y(f)?t.emptyDomain:[],o=y(f)?G(n,s,g?c/g:0):k(e.scaleType,n,s,f,c,C);else{if(u&&s.length>0){C=void 0!==p?0!==v?p:0:i.getBestNumberOfTicks(s[0],s[s.length-1],[l],v,f.dateTime);var x=d({min:s[0],max:s[s.length-1]});b=[x.min,x.max]}u&&f.numeric&&!f.dateTime?o=k(e.scaleType,n,b,f,c,C,m):u&&f.dateTime?o=W(n,b,c,null,m):(f.text||f.dateTime||f.numeric||f.bool)&&(o=G(n,b,g?c/g:0),C=0===v?0:Math.min(b.length,(n-2*c)/t.CartesianChart.MinOrdinalRectThickness))}return h&&u&&o.range(o.range().reverse()),t.ColumnUtil.normalizeInfinityInScale(o),{scale:o,bestTickCount:C,usingDefaultDomain:S}}function O(e,i,a,r,o,n,s,l,c,u,h){void 0===c&&(c=!1);var d;if(a.dateTime)if(r){var p=new Date(e[0]),g=new Date(e[1]);1===n&&(p=g=new Date(i[0])),d=t.valueFormatter.create({format:o,value:p,value2:g,tickCount:n})}else d=t.valueFormatter.createDefaultFormatter(o,!0);else if(c&&r&&s.length>1){var m=u?u:s[1]-s[0],f={format:o,value:m,value2:0,allowFormatBeautification:!0};h?f.precision=h:f.detectAxisPrecision=!0,d=t.valueFormatter.create(f)}else d=t.valueFormatter.createDefaultFormatter(o,!0);return d}function I(e,t,i,a,r){var o=[];return r||(r=function(e){return e}),i?(e.tickFormat(function(e){return i.format(r(e,a))}),o=t.map(function(e){return i.format(r(e,a))})):o=t.map(function(e){return r(e,a)}),o}function R(t,i,a){var r=t&&!e.NumberFormat.isStandardFormat(t);if(r){var o=e.NumberFormat.getCustomFormatMetadata(t,!0).precision;return t.indexOf("%")>-1&&(o+=2),Math.pow(10,-o)}return a?.01:i.integer?1:0}function F(e,t,i,a,r){if(0===e.length)return null;var o=d3.min(e,function(e){return d3.min(e.data,function(e){return e.categoryValue})}),n=d3.max(e,function(e){return d3.max(e.data,function(e){return e.categoryValue})});return K([t,i],[o,n],r)}function H(e,t){if(0===e.length)return null;var i=d3.min(e,function(e){return d3.min(e.data,function(e){return e.value})}),a=d3.max(e,function(e){return d3.max(e.data,function(e){return e.value})});return t?[Math.min(i,0),Math.max(a,0)]:[i,a]}function z(e){if(_.isEmpty(e))return[];for(var t=[],i=e[0],a=0,r=i.data;a<r.length;a++){var o=r[a];o.highlight||t.push(o.categoryIndex)}return t}function G(e,i,a){void 0===a&&(a=0);var r=d3.scale.ordinal().rangeBands([0,e],t.CartesianChart.InnerPaddingRatio,a).domain(i);return r}function j(e,t){return null==e?!1:b(t)?!1:e[0]>0&&e[1]>0||e[0]<0&&e[1]<0}function k(e,i,a,r,o,n,s){return void 0===o&&(o=0),e===t.axisScale.log&&j(a,r)?E(i,a,o,n):W(i,a,o,n,s)}function E(e,t,i,a){void 0===i&&(i=0);var r=d3.scale.log().range([i,e-i]).domain([t[0],t[1]]).clamp(!0);return a&&r.nice(a),r}function W(e,t,i,a,r){void 0===i&&(i=0);var o=d3.scale.linear().range([i,e-i]).domain([t[0],t[1]]).clamp(r);return a&&o.nice(a),o}function B(e){var t={};return e&&(t.min=null==e.min?null==e.minLocal?d3.min(e.values):e.minLocal:e.min,t.max=null==e.max?null==e.maxLocal?d3.max(e.values):e.maxLocal:e.max),t}function U(e,t){var i=[void 0,void 0];return t&&2===t.length&&(i=[t[0],t[1]]),e&&2===e.length&&(null!=e[0]&&(i[0]=e[0]),null!=e[1]&&(i[1]=e[1])),null==i[0]&&null==i[1]?t:null!=i[0]&&null!=i[1]&&i[0]>i[1]?t:i}function K(e,t,i){var a=t?[t[0],t[1]]:[];i&&((null==a[0]||i.min<a[0])&&(a[0]=i.min),(null==a[1]||i.max>a[1])&&(a[1]=i.max));var r=[a[0],a[1]];return e&&2===e.length&&(null!=e[0]&&(a[0]=e[0]),null!=e[1]&&(a[1]=e[1]),a[0]>a[1]&&(a=r)),a}function X(e,i,a,r){void 0===r&&(r=!1);var o=r?"secAxisStyle":"axisStyle";if(!e||!e[o])return i;var n;return n=e[o]===t.axisStyle.showBoth?i+" ("+a+")":e[o]===t.axisStyle.showUnitOnly?a:i}function Y(e,t){return!e||!t||e.length<2||t.length<2?!1:e[0]!==t[0]||e[1]!==t[1]}function q(e){return isNaN(e)?null:e===Number.POSITIVE_INFINITY?Number.MAX_VALUE:e===Number.NEGATIVE_INFINITY?-Number.MAX_VALUE:e}function $(e){var t=Math.abs(e),i=Math.log(t)/Math.LN10;return i=Math.ceil(i-1e-12),t/Math.pow(10,i)===1}var Q=35,Z=10,J=2,ee=3,te=10,ie=3;i.getRecommendedNumberOfTicksForXAxis=a,i.getRecommendedNumberOfTicksForYAxis=r,i.getBestNumberOfTicks=o,i.hasNonIntegerData=n,i.getRecommendedTickValues=s,i.getRecommendedTickValuesForAnOrdinalRange=l,i.getRecommendedTickValuesForAQuantitativeRange=c,i.getMargin=p,i.getTickLabelMargins=g,i.columnDataTypeHasValue=m,i.createOrdinalType=f,i.isOrdinal=y,i.isOrdinalScale=v,i.isDateTime=b,i.invertScale=C,i.extent=S,i.invertOrdinalScale=x,i.findClosestXAxisIndex=w,i.lookupOrdinalIndex=P,i.diffScaled=D,i.createDomain=L,i.ensureValuesInRange=T,i.getCategoryValueType=V,i.createAxis=M,i.createScale=A,i.createFormatter=O,i.getMinTickValueInterval=R,i.createValueDomain=H;var ae;!function(i){function a(e,t,i,a){var r=e.values;if(0===r.length)return!1;var o=void 0!==e.xLabelMaxWidth?e.xLabelMaxWidth:t/r.length;return!r.some(function(e){return a.text=e,i(a)>o})}function r(e,a,r,o,n,s,l){var c=e.values,u=void 0!==e.xLabelMaxWidth?e.xLabelMaxWidth:r/c.length,h=a.bottom/i.DefaultRotation.sine,d=n(l),p=Math.max(1,Math.floor(a.bottom/d));if(0===c.length)return!1;var g=c.some(function(e){return l.text=e,!jsCommon.WordBreaker.hasBreakers(e)&&o(l)>u});if(g)return!1;var m=c.filter(function(r,n){var c=a.left+e.outerPadding+e.categoryThickness*(n+.5)-te,d=c/i.DefaultRotation.cosine,g=Math.min(d,h),m=jsCommon.WordBreaker.splitByWidth(r,l,o,u,p,s).join(" ");l.text=r;var f=s(l,g);return t.TextUtil.removeEllipses(m).length>=t.TextUtil.removeEllipses(f).length});return m.length>=Math.floor(c.length/2)}function o(e,t,a,r,o,n,s,l,c){var u,h;h=c?i.DefaultRotationWithScrollbar:i.DefaultRotation,o&&(u=t/h.sine),e.each(function(){var e=d3.select(this),t=e.text();if(r.text=t,o){var i=s.values.indexOf(this.textContent),d=l.left+s.outerPadding+s.categoryThickness*(i+.5);c||(d-=te);var p=d/h.cosine;(c||n||u>p)&&(t=a(r,Math.min(p,u)),e.text(t)),e.style("text-anchor","end").attr({dx:"-0.5em",dy:h.dy,transform:h.transform})}else{var g=a(r,s.xLabelMaxWidth);g!==t&&e.text(g),e.style("text-anchor","middle").attr({dx:"0em",dy:"1em",transform:"rotate(0)"})}})}function n(t,i,a){var r=i.xLabelMaxWidth;t.each(function(){var t=d3.select(this);t.style("text-anchor","middle").attr({dx:"0em",dy:"1em",transform:"rotate(0)"}),e.TextMeasurementService.wordBreak(this,r,a)})}function s(e,t,i){0!==e.size()&&e.each(function(){var e=d3.select(this);i(e[0][0],t)})}i.willLabelsFit=a,i.willLabelsWordBreak=r,i.DefaultRotation={sine:Math.sin(Math.PI*(35/180)),cosine:Math.cos(Math.PI*(35/180)),tangent:Math.tan(Math.PI*(35/180)),transform:"rotate(-35)",dy:"-0.5em"},i.DefaultRotationWithScrollbar={sine:Math.sin(.5*Math.PI),cosine:Math.cos(.5*Math.PI),tangent:Math.tan(.5*Math.PI),transform:"rotate(-90)",dy:"-0.8em"},i.rotate=o,i.wordBreak=n,i.clip=s}(ae=i.LabelLayoutStrategy||(i.LabelLayoutStrategy={})),i.createOrdinalScale=G,i.isLogScalePossible=j,i.createNumericalScale=k,i.createLinearScale=W,i.getRangeForColumn=B,i.applyCustomizedDomain=U,i.combineDomain=K,i.createAxisLabel=X,i.scaleShouldClamp=Y,i.normalizeNonFiniteNumber=q,i.powerOfTen=$}(i=t.AxisHelper||(t.AxisHelper={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(e,t,i,a,r){var o=i*c.PaddingConstRatio+e.lineWeight/2,n=t*c.PaddingConstRatio+e.lineWeight/2,u=i*c.ShapeConstRatio-e.lineWeight,h=t*c.ShapeConstRatio-e.lineWeight,d={x:o,y:n,width:u,height:h,rx:e.roundEdge,ry:e.roundEdge},p=l(u,h,r);s(e,t,i,a,r,p,"rect",d)}function i(e,t,i,a,r){var o=(i/c.OvalRadiusConst).toString(),n=(t/c.OvalRadiusConst).toString(),u=i/(c.OvalRadiusConst+c.OvalRadiusConstPadding)-e.lineWeight,h=t/(c.OvalRadiusConst+c.OvalRadiusConstPadding)-e.lineWeight,d={cx:o,cy:n,rx:u,ry:h},p=l(i,t,r);s(e,t,i,a,r,p,"ellipse",d)}function a(e,t,i,a,r){var o,n,s,l,u,h=i-c.SmallPaddingConstValue-c.SmallPaddingConstValue,d=t-c.SmallPaddingConstValue-c.SmallPaddingConstValue;45>=r?(u=r/90,o=i/2+h*u,n=c.SmallPaddingConstValue,s=i/2-h*u,l=t-c.SmallPaddingConstValue):135>=r?(u=(r-45)/90,o=i-c.SmallPaddingConstValue,n=c.SmallPaddingConstValue+d*u,s=c.SmallPaddingConstValue,l=t-c.SmallPaddingConstValue-d*u):225>=r?(u=(r-135)/90,o=i-c.SmallPaddingConstValue-h*u,n=t-c.SmallPaddingConstValue,s=c.SmallPaddingConstValue+h*u,l=c.SmallPaddingConstValue):315>=r?(u=(r-225)/90,o=c.SmallPaddingConstValue,n=t-c.SmallPaddingConstValue-d*u,s=i-c.SmallPaddingConstValue,l=c.SmallPaddingConstValue+d*u):360>=r&&(u=(r-315)/90,o=c.SmallPaddingConstValue+h*u,n=c.SmallPaddingConstValue,s=i-c.SmallPaddingConstValue-h*u,l=t-c.SmallPaddingConstValue),a.append("svg").attr({width:i,height:t}).append("line").attr({x1:o,y1:n,x2:s,y2:l}).style({"vector-effect":"non-scaling-stroke","stroke-width":e.lineWeight+"px","stroke-opacity":(100-e.lineTransparency)/100,stroke:e.lineColor})}function r(e,t,i,a,r){var o=e.lineWeight,s=t-o,l=i-o,u=[{x:(l*c.ArrowLeftHeadPoint.x).toString(),y:(s*c.ArrowLeftHeadPoint.y).toString()},{x:(l*c.ArrowMiddleHeadPoint.x).toString(),y:(s*c.ArrowMiddleHeadPoint.y).toString()},{x:(l*c.ArrowRightHeadPoint.x).toString(),y:(s*c.ArrowRightHeadPoint.y).toString()},{x:(l*c.ArrowRightMiddleHeadPoint.x).toString(),y:(s*c.ArrowRightMiddleHeadPoint.y).toString()},{x:(l*c.ArrowBottomRightPoint.x).toString(),y:(s*c.ArrowBottomRightPoint.y).toString()},{x:(l*c.ArrowBottomLeftPoint.x).toString(),y:(s*c.ArrowBottomLeftPoint.y).toString()},{x:(l*c.ArrowLeftMiddleHeadPoint.x).toString(),y:(s*c.ArrowLeftMiddleHeadPoint.y).toString()}];n(e,u,a,t,i,r)}function o(e,t,i,a,r){var o=e.lineWeight;o>3&&(o-=3);var s=(i+o)*c.TrianglePaddingConstRatio,l=t-c.SmallPaddingConstValue-o<0?t-c.SmallPaddingConstValue:t-c.SmallPaddingConstValue-o,u=(t+o)*c.TrianglePaddingConstRatio,h=(i-o)*c.TriangleEndPaddingConstRatio<0?i*c.TriangleEndPaddingConstRatio:(i-o)*c.TriangleEndPaddingConstRatio,d=t-c.SmallPaddingConstValue-o<0?t-c.SmallPaddingConstValue:t-o-c.SmallPaddingConstValue,p=(s+h)/2;10>s&&(s=c.SmallPaddingConstValue),10>u&&(u=c.SmallPaddingConstValue);var g=[{x:s,y:l},{x:p,y:u},{x:h,y:d}];n(e,g,a,t,i,r)}function n(e,t,i,a,r,o){var n=d3.svg.line().x(function(e){return e.x}).y(function(e){return e.y}).interpolate("linear"),c={d:n(t)+" Z"},u=l(r,a,o);s(e,a,r,i,o,u,"path",c)}function s(e,t,i,a,r,o,n,s){a.append("div").style({transform:"rotate("+r+"deg) scale("+o+")","transform-origin":"center","-webkit-transform":"rotate("+r+"deg) scale("+o+")","-webkit-transform-origin":"center",width:i+"px",height:t+"px"}).append("svg").attr({width:i,height:t}).append(n).attr(s).style({"vector-effect":"non-scaling-stroke","stroke-width":e.lineWeight+"px",stroke:e.lineColor,"stroke-opacity":(100-e.lineTransparency)/100,fill:e.fillColor,"fill-opacity":e.showFill===!0?(100-e.shapeTransparency)/100:0})}function l(e,t,i){var a=e,r=t,o=Math.atan2(t,e),n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),s=i/180*Math.PI;return e>=t?(90>i?s+=o:180>i?s-=o:270>i?s+=o:s-=o,r/Math.abs(Math.sin(s))/n):(90>i?s-=o:180>i?s+=o:270>i?s-=o:s+=o,a/Math.abs(Math.cos(s))/n)}var c;!function(e){e.PaddingConstRatio=.01,e.TrianglePaddingConstRatio=.15,e.TriangleEndPaddingConstRatio=.85,e.ShapeConstRatio=1-2*e.PaddingConstRatio,e.SmallPaddingConstValue=10,e.OvalRadiusConst=2,e.OvalRadiusConstPadding=.2,e.ArrowLeftHeadPoint={x:.05,y:.42},e.ArrowMiddleHeadPoint={x:.5,y:.016},e.ArrowRightHeadPoint={x:.95,y:.42},e.ArrowRightMiddleHeadPoint={x:.764,y:.42},e.ArrowBottomRightPoint={x:.764,y:.993},e.ArrowBottomLeftPoint={x:.246,y:.993},e.ArrowLeftMiddleHeadPoint={x:.246,y:.42}}(c=e.ShapeFactoryConsts||(e.ShapeFactoryConsts={})),e.createRectangle=t,e.createOval=i,e.createLine=a,e.createUpArrow=r,e.createTriangle=o}(t=e.ShapeFactory||(e.ShapeFactory={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(t){function i(e,t){var i={};if(!e)return i;var a=e.objects;if(a){var r=a.categoryAxis;r&&(i={show:r.show,axisType:r.axisType,axisScale:r.axisScale,start:r.start,end:r.end,showAxisTitle:null==r.showAxisTitle?t:r.showAxisTitle,axisStyle:r.axisStyle,labelColor:r.labelColor,labelDisplayUnits:r.labelDisplayUnits,labelPrecision:r.labelPrecision,duration:r.duration})}return i}function a(e,t){var i={};if(!e)return i;var a=e.objects;if(a){var r=a.valueAxis;r&&(i={show:r.show,position:r.position,axisScale:r.axisScale,start:r.start,end:r.end,showAxisTitle:null==r.showAxisTitle?t:r.showAxisTitle,axisStyle:r.axisStyle,labelColor:r.labelColor,labelDisplayUnits:r.labelDisplayUnits,labelPrecision:r.labelPrecision,secShow:r.secShow,secPosition:r.secPosition,secAxisScale:r.secAxisScale,secStart:r.secStart,secEnd:r.secEnd,secShowAxisTitle:r.secShowAxisTitle,secAxisStyle:r.secAxisStyle,secLabelColor:r.secLabelColor,secLabelDisplayUnits:r.secLabelDisplayUnits,secLabelPrecision:r.secLabelPrecision})}return i}function r(t,i){return t&&(t=i&&i.axisType?i.axisType===e.axisType.scalar:!0),t}function o(e){return null!=e?0>e?0:e:null}function n(t,i,a,r){var o=e.AxisHelper.isDateTime(a);if(r)return o?new Date(i):i;if(a.text)return t.categories[i];if(t&&t.series&&t.series.length>0){var n=t.series[0];if(n){var s=n.data;if(s){t.hasHighlights&&(i=2*i);var l=s[i];if(l)return o&&null!=l.categoryValue?new Date(l.categoryValue):l.categoryValue}}}return i}function s(e){if(_.isEmpty(e))return 0;for(var t=0,i=0,a=e;i<a.length;i++){var r=a[i];if(!_.isEmpty(r.data)){var o=r.data[r.data.length-1].categoryIndex;t=Math.max(o,t)}}return t}t.getCategoryAxisProperties=i,t.getValueAxisProperties=a,t.isScalar=r,t.getPrecision=o,t.lookupXValue=n,t.findMaxCategoryIndex=s}(t=e.CartesianHelper||(e.CartesianHelper={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=e.data.SQExprShortSerializer,a=function(){function t(e,t,i){this.colors=e,this.fillProp=t,this.defaultDataPointColor=i,this.defaultColorScale=e.getNewColorScale()}return t.prototype.getColorForSeriesValue=function(t,i,a){return this.fillProp&&e.DataViewObjects.getFillColor(t,this.fillProp)||this.defaultDataPointColor||this.getColorScaleForSeries(i).getColor(a).value},t.prototype.getColorScaleForSeries=function(e){return this.colors.getColorScaleByKey(i.serializeArray(e||[]))},t.prototype.getColorForMeasure=function(t,i){var a=this.defaultColorScale.getColor(i).value;return this.fillProp&&e.DataViewObjects.getFillColor(t,this.fillProp)||this.defaultDataPointColor||a},t.normalizeSelector=function(e,t){return e&&(t||e.data)?{data:e.data}:e},t}();t.ColorHelper=a}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i,a="rect";!function(i){function r(e,t,a){if(e){var r=a.start,o=a.end;return i.transformDomain(t,r,o)}return t}function o(t,i,a){if(!t.categories||!t.values||0===t.categories.length||0===t.values.length)return t;if("number"!=typeof i&&"number"!=typeof a)return t;var r=t.categories[0],o=r.values,n=r.objects;if(!o||!n)return t;var s=[],l=[],c=[];if("number"!=typeof i&&(i=o[0]),"number"!=typeof a&&(a=o[o.length-1]),i>a)return t;for(var u=0,h=t.values.length;h>u;u++)l.push([]);for(var d=0,h=o.length;h>d;d++)if(o[d]>=i&&o[d]<=a&&(s.push(o[d]),n&&c.push(n[d]),t.values))for(var p=0;p<t.values.length;p++)l[p].push(t.values[p].values[d]);var g=e.Prototype.inherit(t),m=g.values=e.Prototype.inherit(g.values),f=g.categories=e.Prototype.inherit(t.categories),y=g.categories[0]=e.Prototype.inherit(f[0]);y.values=s,y.objects&&(y.objects=c);for(var d=0,h=t.values.length;h>d;d++){var v=m[d]=e.Prototype.inherit(m[d]);v.values=l[d]}return g}function n(i,a,r,o,n,s,l,c,u,h){var d=r.categoryThickness,p=r.isScalar,g=r.outerPaddingRatio,m=t.AxisHelper.createDomain(i.series,i.categoryMetadata?i.categoryMetadata.type:e.ValueType.fromDescriptor({text:!0}),p,[n,s],h),f=t.AxisHelper.createAxis({pixelSpan:a,dataDomain:m,metaDataColumn:i.categoryMetadata,formatString:t.valueFormatter.getFormatString(i.categoryMetadata,t.columnChartProps.general.formatString),outerPadding:d*g,isCategoryAxis:!0,isScalar:p,isVertical:o,categoryThickness:d,useTickIntervalForDisplayUnits:!0,getValueFn:function(e,a){return t.CartesianHelper.lookupXValue(i,e,a,p)},scaleType:l,axisDisplayUnits:c,axisPrecision:u});return r.categoryThickness=f.categoryThickness,f}function s(e,t){t&&e.attr("draggable","true").on("dragstart",t)}function l(e,t,a,r){return r&&!t||a&&!e?i.DimmedOpacity:i.DefaultOpacity}function c(e,t){for(var i=0,a=Number.MAX_VALUE,r=0,o=t.length;o>r;r++){var n=Math.abs(e-t[r]);a>n&&(a=n,i=r)}return i}function u(e,r,o,n){var s=e.selectAll(t.ColumnChart.SeriesClasses.selector),l="undefined"==typeof n;s.selectAll(a+r).filter(function(e){return e.categoryIndex!==o&&(l||e.categoryIndex===n)}).transition().style("fill-opacity",i.DimmedOpacity),s.selectAll(a+r).filter(function(e){return e.categoryIndex===o}).style("fill-opacity",i.DefaultOpacity)}function h(e,i,a){var r=i.selectAll(t.ColumnChart.SeriesClasses.selector),o=r.data(e.series,function(e){return e.key});return o.enter().append("g").classed(t.ColumnChart.SeriesClasses["class"],!0),o.style({fill:function(e){return e.color}}),o.exit().remove(),o}function d(e,t,r,o,n,s){var l;l=n?function(e){var t=_.filter(e.data,function(e){return!!e.value});return t}:function(e){return e.data};var c=t.selectAll(o.selector),u=c.data(l,function(e){return e.key});return u.enter().append(a).attr("class",function(e){return o["class"].concat(e.highlight?" highlight":"")}),u.style("fill-opacity",function(t){return i.getFillOpacity(t.selected,t.highlight,s,e.hasHighlights)}).style("fill",function(t){return t.color!==e.series[t.seriesIndex].color?t.color:null}).attr(r.shapeLayout),u.exit().remove(),u}function p(e,i,a,r,o,n){if(void 0===o&&(o=!1),e){for(var s=e.data(),l=[],c=0,u=s.length;u>c;c++)Array.prototype.push.apply(l,s[c].data);return t.dataLabelUtils.drawDefaultLabelsForDataPointChart(l,i,a,r,o,n)}t.dataLabelUtils.cleanDataLabels(i)}function g(e){for(var t=e.domain(),i=0,a=t.length;a>i;++i)t[i]===Number.POSITIVE_INFINITY?t[i]=Number.MAX_VALUE:t[i]===Number.NEGATIVE_INFINITY&&(t[i]=-Number.MAX_VALUE);e.domain(t)}function m(e,i){var a=i.xScale,r=i.yScale,o=r(0),n=a(0);switch(e.chartType){case t.ColumnChartType.stackedBar:case t.ColumnChartType.hundredPercentStackedBar:return n+Math.abs(t.AxisHelper.diffScaled(a,0,e.valueAbsolute))+t.AxisHelper.diffScaled(a,e.position-e.valueAbsolute,0)+t.dataLabelUtils.defaultColumnLabelMargin;case t.ColumnChartType.clusteredBar:return n+t.AxisHelper.diffScaled(a,Math.max(0,e.value),0)+t.dataLabelUtils.defaultColumnLabelMargin;case t.ColumnChartType.stackedColumn:case t.ColumnChartType.hundredPercentStackedColumn:return o+t.AxisHelper.diffScaled(r,e.position,0)-t.dataLabelUtils.defaultColumnLabelMargin;case t.ColumnChartType.clusteredColumn:return o+t.AxisHelper.diffScaled(r,Math.max(0,e.value),0)-t.dataLabelUtils.defaultColumnLabelMargin;
7}}i.DimmedOpacity=.4,i.DefaultOpacity=1,i.applyUserMinMax=r,i.transformDomain=o,i.getCategoryAxis=n,i.applyInteractivity=s,i.getFillOpacity=l,i.getClosestColumnIndex=c,i.setChosenColumnOpacity=u,i.drawSeries=h,i.drawDefaultShapes=d,i.drawDefaultLabels=p,i.normalizeInfinityInScale=g,i.calculatePosition=m}(i=t.ColumnUtil||(t.ColumnUtil={}));var r;!function(e){function t(e,t){var i=e.selectAll(t.selector).data([]);i.exit().remove()}e.clearColumns=t}(r=t.ClusteredUtil||(t.ClusteredUtil={}));var o;!function(i){function a(e,i,a){return void 0===a&&(a=0),t.AxisHelper.diffScaled(e,a,i)}function r(t,i){var a={min:0,max:10};if(0===t.length)return a;var r=d3.min(t,function(e){return d3.min(e.data,function(e){return e.position-e.valueAbsolute})}),o=d3.max(t,function(e){return d3.max(e.data,function(e){return e.position})});return i&&(r=e.Double.roundToPrecision(r,s),o=e.Double.roundToPrecision(o,s)),{min:r,max:o}}function o(e,i,a,r,o){for(var n=0,s=0,l=0;a>l;l++){var c=o.getValueBySeriesAndCategory(l,i);c=t.AxisHelper.normalizeNonFiniteNumber(c),c>0?n+=c:0>c&&(s-=c)}var u=n+s;return{pos:n?n/u/n:1,neg:s?s/u/s:1}}function n(e,t){var i=e.selectAll(t.selector).data([]);i.exit().remove()}var s=1e-4;i.getSize=a,i.calcValueDomain=r,i.getStackedMultiplier=o,i.clearColumns=n}(o=t.StackedUtil||(t.StackedUtil={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i,a=e.data.DataRoleHelper;!function(i){function r(e,t,i){if(e.categories&&e.categories.length>0){var r=e.categories[0];return r.source&&a.hasRole(r.source,t)&&a.hasRole(r.source,i)}return!1}function o(i,a){if(i.categories&&i.categories.length>0){var r=i.categories[0],o=r.values;return r.values.length>0?{categories:o,categoryFormatter:t.valueFormatter.create({format:t.valueFormatter.getFormatString(r.source,a),value:o[0],value2:o[o.length-1],displayUnitSystemType:e.DisplayUnitSystemType.Verbose}),categoryIdentities:r.identity,categoryObjects:r.objects}:{categories:[],categoryFormatter:{format:t.valueFormatter.format}}}return l()}function n(e){return void 0!==e.groupName?e.groupName:e.queryName}function s(e,i,a){var r=e,o=e.displayName;return void 0!==e.groupName&&(r=i.source,o=e.groupName),t.valueFormatter.format(o,t.valueFormatter.getFormatString(r,a))}function l(){return{categories:[null],categoryFormatter:{format:t.valueFormatter.format}}}function c(e,i,a,r){var o=null,n=null;if(e&&a&&a.displayName&&(o=a.displayName),i){var s=[];r&&(s=r.map(function(e){return e?e.displayName:""}).filter(function(e,t,i){return""!==e&&i.indexOf(e)===t}),n=t.valueFormatter.formatListAnd(s))}return{xAxisLabel:o,yAxisLabel:n}}function u(e){var t=d(e);return null!=t&&t.imageUrl===!0}function h(e){var t=d(e);return null!=t&&t.webUrl===!0}function d(e){return e&&e.type&&e.type.misc}function p(e){return e&&e.metadata&&!_.isEmpty(e.metadata.columns)?_.any(e.metadata.columns,function(e){return u(e)===!0}):!1}function g(e,i,a){var r=t.valueFormatter.getFormatString(i,a,!0);return!r&&i&&(r=i.format),t.valueFormatter.format(e,r)}i.categoryIsAlsoSeriesRole=r,i.getPivotedCategories=o,i.getSeriesName=n,i.getFormattedLegendLabel=s,i.createAxesLabels=c,i.isImageUrlColumn=u,i.isWebUrlColumn=h,i.hasImageUrlColumn=p,i.formatFromMetadataColumn=g}(i=t.converterHelper||(t.converterHelper={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i,a=jsCommon.CssConstants.createClassAndSelector,r=jsCommon.PixelConverter,o=t.labelStyle;!function(i){function n(e,t){e&&(void 0!==e.show&&(t.show=e.show),void 0!==e.showSeries&&(t.show=e.showSeries),void 0!==e.color&&(t.labelColor=e.color.solid.color),void 0!==e.labelDisplayUnits&&(t.displayUnits=e.labelDisplayUnits),void 0!==e.labelPrecision&&(t.precision=e.labelPrecision>=0?e.labelPrecision:i.defaultLabelPrecision),void 0!==e.fontSize&&(t.fontSize=e.fontSize),void 0!==e.showAll&&(t.showLabelPerSeries=e.showAll),void 0!==e.labelStyle&&(t.labelStyle=e.labelStyle))}function s(e,t){n(e,t),e&&void 0!==e.labelDensity&&(t.labelDensity=e.labelDensity)}function l(e,t,a){return void 0===e&&(e=!1),{show:e,position:0,displayUnits:0,precision:i.defaultLabelPrecision,labelColor:t||i.defaultLabelColor,formatterOptions:null,fontSize:a||i.DefaultFontSizeInPt}}function c(e,t,i){var a=l(!0,e,i);return a.showCategory=!0,a.categoryLabelColor=t,a}function u(){return{show:!1,displayUnits:0,precision:i.defaultLabelPrecision,labelColor:i.defaultInsideLabelColor,showCategory:!0,formatterOptions:null}}function h(){return{show:!1,labelColor:i.defaultInsideLabelColor,fontSize:i.DefaultFontSizeInPt,displayUnits:0,precision:i.defaultLabelPrecision,showCategory:!0}}function d(e){var t=l(!1,void 0);return t.position=null,t.labelColor=void 0,t}function p(){return{show:!1,position:0,displayUnits:0,precision:i.defaultLabelPrecision,labelColor:i.defaultLabelColor,formatterOptions:null,fontSize:i.DefaultFontSizeInPt}}function g(e){return{show:!1,position:0,displayUnits:0,precision:i.defaultLabelPrecision,labelColor:i.defaultLabelColor,formatterOptions:null,fontSize:i.DefaultFontSizeInPt,labelDensity:e?t.NewDataLabelUtils.LabelDensityMax:t.NewDataLabelUtils.LabelDensityMin}}function m(){return{show:!1,showCategory:!1,position:0,displayUnits:0,precision:i.defaultLabelPrecision,labelColor:i.defaultInsideLabelColor,formatterOptions:null,fontSize:i.DefaultFontSizeInPt}}function f(){var e=i.getDefaultLabelSettings(!0,i.defaultLabelColor,i.DefaultFontSizeInPt);return e.labelStyle=o.category,e}function y(){return{show:!0,displayUnits:0,precision:i.defaultLabelPrecision,labelColor:null,position:null,fontSize:i.minLabelFontSize,formatterOptions:null}}function v(){return{show:!0,position:e.visuals.labelPosition.insideCenter,displayUnits:0,precision:i.defaultLabelPrecision,labelColor:i.defaultLabelColor,formatterOptions:null,fontSize:i.DefaultFontSizeInPt}}function b(){return{show:!1,displayUnits:0,precision:i.defaultLabelPrecision,labelColor:i.defaultLabelColor,position:null,showCategory:!0,formatterOptions:null}}function C(t,a){if(t!==i.defaultLabelPrecision)return t;if("g"!==a&&"G"!==a){if(a){var r=a.split(";")[0],o=e.NumberFormat.getCustomFormatMetadata(r,!0);if(o.hasDots)return o.precision}return U}}function S(i,a,r,o,n,s,l){void 0===n&&(n=!1);var c=new e.DataLabelManager,u=c.hideCollidedLabels(o,i,r),h=n&&!!s,d=w(u,a,!1,h);return d?(h?(d.text(function(e){return e.labeltext}).transition().duration(s).style(r.style).style("opacity",l?function(e){return t.ColumnUtil.getFillOpacity(e.selected,!1,l,!1)}:1).attr({x:function(e){return e.labelX},y:function(e){return e.labelY}}),d.exit().transition().duration(s).style("opacity",0).remove()):(d.attr({x:function(e){return e.labelX},y:function(e){return e.labelY}}).text(function(e){return e.labeltext}).style(r.style),d.exit().remove()),d):void 0}function x(e,t,i,a,r){void 0===a&&(a=!1);var o=e.filter(i.filter),n=w(o,t);return n?(n.attr(i.labelLayout).text(i.labelText).style(i.style),a&&r&&n.transition().duration(r),n.exit().remove(),n):void 0}function w(e,t,i,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),0===e.length)return P(t,!0),null;t.select(K.selector).empty()&&t.append("g").classed(K["class"],!0);var r=null!=e[0].key,o=null!=e[0].identity,n=r?function(e){return e.key}:o?function(e){return e.identity.getKey()}:void 0,s=i?t.select(K.selector).selectAll(Y.selector).data(e,function(e){return e.data.identity.getKey()}):null!=n?t.select(K.selector).selectAll(Y.selector).data(e,n):t.select(K.selector).selectAll(Y.selector).data(e),l=s.enter().append("text").classed(Y["class"],!0);return a&&l.style("opacity",0),s}function P(e,t){void 0===t&&(t=!1);var i=[],a=e.selectAll(Y.selector).data(i);if(a.exit().remove(),e.selectAll(K.selector).remove(),t){var r=e.selectAll(q.selector).data(i);r.exit().remove(),e.selectAll(X.selector).remove()}}function D(e,i,a){e.selectAll(Y.selector).style("fill-opacity",function(e){var r=t.ColumnUtil.getFillOpacity(e.selected,e.highlight,!e.highlight&&i,!e.selected&&a)<1?0:1;return r})}function L(t){var a={text:t.formatter?t.formatter.format(t.label):e.formattingService.formatValue(t.label,t.format),fontFamily:i.LabelTextProperties.fontFamily,fontSize:r.fromPoint(t.fontSize),fontWeight:i.LabelTextProperties.fontWeight};return e.TextMeasurementService.getTailoredTextOrDefault(a,t.maxWidth?t.maxWidth:i.maxLabelWidth)}function T(e,t,i,a){return{x:function(i){return e.scale(i.categoryIndex)+t/2},y:function(e){return _(i.scale,e,a)}}}function _(t,a,r){var o=t(0)-t(Math.abs(a.value)),n=t(a.position),s=t(r[0]),l=t(a.position+a.value);if(a.value<0){var c={text:a.labeltext,fontFamily:i.LabelTextProperties.fontFamily,fontSize:i.LabelTextProperties.fontSize,fontWeight:i.LabelTextProperties.fontWeight},u=n+o+e.TextMeasurementService.estimateSvgTextHeight(c);if(s>u)return u}else{var h=n-o-i.labelMargin;if(h>0)return h}return a.isLabelInside=!0,V(n,l,s)}function V(e,t,i){return e=0>e?0:e,e=e>i?i:e,t=0>t?0:t,t=t>i?i:t,Math.abs(t-e)/2+Math.min(e,t)}function M(a,r,o){if(null==a||null===a.value)return!1;var n={text:o.labelText(a),fontFamily:i.LabelTextProperties.fontFamily,fontSize:i.LabelTextProperties.fontSize,fontWeight:i.LabelTextProperties.fontWeight},s=t.WaterfallChart.getRectTop(r.scale,a.position,a.value)-i.labelMargin;if(s>0)return!0;var l=e.TextMeasurementService.measureSvgTextWidth(n),c=e.TextMeasurementService.estimateSvgTextHeight(n),u=o.categoryWidth,h=Math.abs(t.AxisHelper.diffScaled(r.scale,Math.max(0,Math.abs(a.value)),0));return!(l>u||c>h)}function N(e){return{labelText:function(t){return L({label:t.labeltext,fontSize:e.fontSize})},labelLayout:{x:function(e){return e.x},y:function(t){var a=t.radius+i.labelMargin;return 0===e.position?t.y-a:t.y+a}},filter:function(e){return null!=e&&null!=e.labeltext},style:{fill:function(e){return e.labelFill},"font-size":r.fromPoint(e.fontSize)}}}function A(e,t,a,r,o,n,s,l){var c=r?i.hundredPercentFormat:null,u=k(),h=s?s.hasSelection():!1;return{labelText:function(e){var t=null!=c?c:e.labelFormatString,a=j(o,e.labelSettings),r=u.getOrCreate(t,e.labelSettings,a);return L({label:r.format(e.value),maxWidth:i.maxLabelWidth})},labelLayout:t,filter:function(t){return i.getColumnChartLabelFilter(t,h,e.hasHighlights,n,l)},style:{fill:function(e){return e.labelFill},"text-anchor":a?"middle":"start"}}}function O(a,r,o){var n,s,l=r.xScale,c=r.yScale,u=r.columnWidth,h={text:a.labeltext,fontFamily:i.LabelTextProperties.fontFamily,fontSize:i.LabelTextProperties.fontSize,fontWeight:i.LabelTextProperties.fontWeight},d=e.TextMeasurementService.measureSvgTextWidth(h),p=e.TextMeasurementService.estimateSvgTextHeight(h),g=!1,m=t.ColumnUtil.calculatePosition(a,r);switch(a.chartType){case t.ColumnChartType.stackedBar:case t.ColumnChartType.hundredPercentStackedBar:(!a.lastSeries||m+d>o||a.chartType===t.ColumnChartType.hundredPercentStackedBar)&&(n=-t.StackedUtil.getSize(l,a.valueAbsolute),s=u,g=!0);break;case t.ColumnChartType.clusteredBar:m+d>o&&(n=Math.abs(t.AxisHelper.diffScaled(l,0,a.value)),s=u,g=!0);break;case t.ColumnChartType.stackedColumn:case t.ColumnChartType.hundredPercentStackedColumn:(!a.lastSeries||0>=m||a.chartType===t.ColumnChartType.hundredPercentStackedColumn)&&(n=u,s=t.StackedUtil.getSize(c,a.valueAbsolute),g=!0);break;case t.ColumnChartType.clusteredColumn:0>=m&&(n=u,s=Math.abs(t.AxisHelper.diffScaled(c,0,a.value)),g=!0);break;default:return!0}return!g||!(d>n||p>s)}function I(e,i,a,r,o){var n=i?t.ColumnUtil.getFillOpacity(e.selected,e.highlight,!e.highlight&&i,!e.selected&&a):t.ColumnUtil.getFillOpacity(e.selected,e.highlight,i,a);return null!=e&&null!=e.value&&O(e,r,o)&&1===n}function R(e,a,r,o,n){return{labelText:function(e){return L({label:e.formattedCategory.getValue(),maxWidth:2*i.maxLabelWidth})},labelLayout:{x:function(t){return e(t.x)},y:function(e){var s=t.ScatterChart.getBubbleRadius(e.radius,n,o)+i.labelMargin;return 0===r.position?a(e.y)-s:a(e.y)+s}},filter:function(e){return null!=e&&null!=e.formattedCategory.getValue()},style:{fill:function(e){return e.labelFill}}}}function F(e,t,a,o,n){var s=k();return{labelText:function(e){var t=j(n,e.labelSettings),i=s.getOrCreate(e.labelFormatString,e.labelSettings,t);return L({label:i.format(e.value)})},labelLayout:{x:function(t){return e(o?t.categoryValue:t.categoryIndex)},y:function(e){return 0===a.position?t(e.value)-i.labelMargin:t(e.value)+i.labelMargin}},filter:function(e){return null!=e&&null!=e.value},style:{fill:function(e){return e.labelFill},"font-size":function(e){return r.fromPoint(e.labelSettings.fontSize)}}}}function H(a,o,n,s,l){var c=o.categoryScale,u=o.valueScale,h=o.margin.left,d=.7,p=o.categoryScale.rangeBand(),g=o.maxWidth/2,m=t.valueFormatter.getFormatString(a.valuesMetadata[0],t.funnelChartProps.general.formatString),f=e.TextMeasurementService.measureSvgTextWidth,y=null;if(0===s.displayUnits){var v=d3.min(a.slices,function(e){return e.value}),b=d3.max(a.slices,function(e){return e.value});y=Math.max(Math.abs(v),Math.abs(b))}var C=k();return{labelText:function(e){var i=Math.abs(c(e.value)-c(0)),a=Math.abs(c(e.value)-c(0))-2*n,r=g-i/2-n,o=null!=m?m:e.labelFormatString,l=Math.max(a,r),u=C.getOrCreate(o,s,y),h=u.format(t.FunnelChart.getFunnelSliceValue(e,!0));return L({label:h,maxWidth:l,fontSize:s.fontSize})},labelLayout:{y:function(t,a){var o={text:t.labeltext,fontFamily:i.LabelTextProperties.fontFamily,fontSize:r.fromPoint(s.fontSize),fontWeight:i.LabelTextProperties.fontWeight},n=e.TextMeasurementService.estimateSvgTextHeight(o);return c(t.categoryOrMeasureIndex)+p/2+n/2},x:function(e){var a=Math.abs(u(e.value)-u(0)),o=Math.abs(u(e.value)-u(0))-2*n,l=g-a/2-n,c=Math.max(o,l),d=null!=m?m:e.labelFormatString,p=C.getOrCreate(d,s,y),v=p.format(t.FunnelChart.getFunnelSliceValue(e,!0)),b={text:L({label:v,maxWidth:c}),fontFamily:i.LabelTextProperties.fontFamily,fontSize:r.fromPoint(s.fontSize),fontWeight:i.LabelTextProperties.fontWeight},S=f(b),x=s.position;switch(x===t.labelPosition.outsideEnd&&S>l||0===e.value?x=t.labelPosition.insideCenter:x===t.labelPosition.insideCenter&&S>o&&(x=t.labelPosition.outsideEnd),x){case t.labelPosition.outsideEnd:return h+g+a/2+n+S/2;default:return e.labelFill=0!==e.value?i.defaultInsideLabelColor:e.labelFill,h+g}},dy:"-0.15em"},filter:function(t){if(null==t||null==t.value||a.hasHighlights!==!!t.highlight)return!1;var o={text:t.labeltext,fontFamily:i.LabelTextProperties.fontFamily,fontSize:r.fromPoint(s.fontSize),fontWeight:i.LabelTextProperties.fontWeight},n=e.TextMeasurementService.estimateSvgTextHeight(o)*d;return p>n},style:{fill:function(e){return e.labelFill},"fill-opacity":function(e){return t.ColumnUtil.getFillOpacity(e.selected,!1,!1,!1)},"font-size":function(e){return r.fromPoint(s.fontSize)}}}}function z(e){if(e.dataLabelsSettings){var t={objectName:"labels",selector:e.selector,properties:{}};if(e.show&&e.selector?t.properties.showSeries=e.dataLabelsSettings.show:e.show&&(t.properties.show=e.dataLabelsSettings.show),t.properties.color=e.dataLabelsSettings.labelColor||i.defaultLabelColor,e.displayUnits&&(t.properties.labelDisplayUnits=e.dataLabelsSettings.displayUnits),e.precision){var a=e.dataLabelsSettings.precision;t.properties.labelPrecision=a===i.defaultLabelPrecision?null:a}if(e.position&&(t.properties.labelPosition=e.dataLabelsSettings.position,e.positionObject&&(t.validValues={labelPosition:e.positionObject})),e.labelStyle&&(t.properties.labelStyle=e.dataLabelsSettings.labelStyle),e.fontSize&&(t.properties.fontSize=e.dataLabelsSettings.fontSize),e.labelDensity){var r=e.dataLabelsSettings;r&&(t.properties.labelDensity=r.labelDensity)}return e.showAll&&(t.properties.showAll=e.dataLabelsSettings.showLabelPerSeries),e.enumeration.pushInstance(t)}}function G(e,t,a,r,o){void 0===r&&(r=!1);var n=t?t:p(),s={objectName:"categoryLabels",selector:null,properties:{show:r?n.showCategory:n.show,fontSize:t?t.fontSize:i.DefaultFontSizeInPt}};a&&(s.properties.color=n.categoryLabelColor?n.categoryLabelColor:n.labelColor),o&&(s.properties.fontSize=o),e.pushInstance(s)}function j(e,t){return e&&e.displayUnit&&0===t.displayUnits?e.displayUnit.value:null}function k(){return{cache:{defaultFormatter:null},getOrCreate:function(e,i,a){if(e){var r={formatString:e,displayUnits:i.displayUnits,precision:C(i.precision,e),value2:a},o=JSON.stringify(r);return this.cache[o]||(this.cache[o]=t.valueFormatter.create(E(i,e,a,r.precision))),this.cache[o]}return this.cache.defaultFormatter||(this.cache.defaultFormatter=t.valueFormatter.create(E(i,e,a,i.precision))),this.cache.defaultFormatter}}}function E(t,i,a,r){return{displayUnitSystemType:e.DisplayUnitSystemType.DataLabels,format:i,precision:r,value:t.displayUnits,value2:a,allowFormatBeautification:!0}}function W(e,t){return e>t}function B(e,t){return e>t}i.minLabelFontSize=8,i.labelMargin=8,i.maxLabelWidth=50,i.defaultColumnLabelMargin=5,i.defaultColumnHalfLabelHeight=4,i.DefaultDy="-0.15em",i.DefaultFontSizeInPt=9,i.StandardFontFamily="wf_segoe-ui_normal",i.LabelTextProperties={fontFamily:"wf_standard-font",fontSize:r.fromPoint(i.DefaultFontSizeInPt),fontWeight:"normal"},i.defaultLabelColor="#777777",i.defaultInsideLabelColor="#ffffff",i.hundredPercentFormat="0.00 %;-0.00 %;0.00 %",i.defaultLabelPrecision=void 0;var U=0,K=a("labels"),X=a("lines"),Y=a("data-labels"),q=a("line-label");i.updateLabelSettingsFromLabelsObject=n,i.updateLineChartLabelSettingsFromLabelsObject=s,i.getDefaultLabelSettings=l,i.getDefaultCardLabelSettings=c,i.getDefaultTreemapLabelSettings=u,i.getDefaultSunburstLabelSettings=h,i.getDefaultColumnLabelSettings=d,i.getDefaultPointLabelSettings=p,i.getDefaultLineChartLabelSettings=g,i.getDefaultMapLabelSettings=m,i.getDefaultDonutLabelSettings=f,i.getDefaultGaugeLabelSettings=y,i.getDefaultFunnelLabelSettings=v,i.getDefaultKpiLabelSettings=b,i.getLabelPrecision=C,i.drawDefaultLabelsForDataPointChart=S,i.drawDefaultLabelsForFunnelChart=x,i.cleanDataLabels=P,i.setHighlightedLabelsOpacity=D,i.getLabelFormattedText=L,i.getLabelLayoutXYForWaterfall=T,i.doesDataLabelFitInShape=M,i.getMapLabelLayout=N,i.getColumnChartLabelLayout=A,i.getColumnChartLabelFilter=I,i.getScatterChartLabelLayout=R,i.getLineChartLabelLayout=F,i.getFunnelChartLabelLayout=H,i.enumerateDataLabels=z,i.enumerateCategoryLabels=G,i.createColumnFormatterCacheManager=k,i.getOptionsForLabelFormatter=E,i.isTextWidthOverflows=W,i.isTextHeightOverflows=B}(i=t.dataLabelUtils||(t.dataLabelUtils={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(t){function i(t,i,a,r){void 0===r&&(r=0);var o,n,s,l=2.05;if(r){var c=r,u=i.radius*i.outerArcRadiusRatio,h=i.radius/2*i.innerArcRadiusRatio;n=[Math.cos(c)*u,Math.sin(c)*u],s=[Math.cos(c)*h,Math.sin(c)*h]}else n=i.outerArc.centroid(t),s=i.arc.centroid(t);var d=a.x,p=e.NewDataLabelUtils.maxLabelOffset/2;return d+=0>d?-p:p,o=[d,a.y],s[0]*=l,s[1]*=l,[s,n,o]}function a(e){if(e&&e.length>2){var i={width:Math.abs(e[1][0]-e[0][0]),height:Math.abs(e[1][1]-e[0][1])},a={width:Math.abs(e[2][0]-e[1][0]),height:t.LineStrokeWidth};return[i,a]}return null}function r(t){var i=0>t?-e.NewDataLabelUtils.maxLabelOffset:e.NewDataLabelUtils.maxLabelOffset;return t+=i}function o(t,i){return i.width/2-Math.abs(t)-e.NewDataLabelUtils.maxLabelOffset}t.LineStrokeWidth=1,t.DiagonalLineIndex=0,t.HorizontalLineIndex=1,t.getLabelLeaderLineForDonutChart=i,t.getLabelLeaderLinesSizeForDonutChart=a,t.getXPositionForDonutLabel=r,t.getSpaceAvailableForDonutLabels=o}(t=e.DonutLabelUtils||(e.DonutLabelUtils={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i,a=jsCommon.CssConstants.createClassAndSelector,r=jsCommon.PixelConverter;!function(i){function o(e,t,a,o,n){void 0===a&&(a=!1),void 0===o&&(o=!1),void 0===n&&(n=!1);var s=_.filter(t,function(e){return e.isVisible}),l=e.selectAll(S.selector).data(s,y);l.enter().append("text").classed(S["class"],!0);var c={x:function(e){return e.boundingBox.left+e.boundingBox.width/2},y:function(e){return e.hasBackground?e.boundingBox.top+e.boundingBox.height-i.verticalLabelBackgroundPadding:e.boundingBox.top+e.boundingBox.height},dy:"-0.15em"};a&&(c.dy=void 0),l.text(function(e){return e.text}).attr(c).style({fill:function(e){return e.fill},"font-size":function(e){return r.fromPoint(e.fontSize||i.DefaultLabelFontSizeInPt)},"text-anchor":function(e){return e.textAnchor}}),l.exit().remove();var u=_.filter(o?t:[],function(e){return e.isVisible&&!_.isEmpty(e.secondRowText)}),h=e.selectAll(x.selector).data(u,function(e,t){return e.identity?e.identity.getKeyWithoutHighlight():t});return h.enter().append("text").classed(x["class"],!0),c={x:function(e){return e.boundingBox.left+e.boundingBox.width/2},y:function(e){var t=void 0!==e.text?e.boundingBox.height/2:e.boundingBox.height;return e.hasBackground?e.boundingBox.top+t-i.verticalLabelBackgroundPadding:e.boundingBox.top+t},dy:"-0.15em"},a&&(c.dy=void 0),h.text(function(e){return e.secondRowText}).attr(c).style({fill:function(e){return e.fill},"font-size":function(e){return r.fromPoint(e.fontSize||i.DefaultLabelFontSizeInPt)},"text-anchor":function(e){return e.textAnchor}}),h.exit().remove(),n&&(l.append("title").text(function(e){return e.tooltip}),h.append("title").text(function(e){return e.tooltip}),l.style("pointer-events","all"),h.style("pointer-events","all")),l}function n(e,t,a,o,n){void 0===o&&(o=!1),void 0===n&&(n="cubic-in-out");var s=e.selectAll(S.selector).data(_.filter(t,function(e){return e.isVisible}),y);s.enter().append("text").classed(S["class"],!0).style("opacity",0);var l={x:function(e){return e.boundingBox.left+e.boundingBox.width/2},y:function(e){return e.boundingBox.top+e.boundingBox.height},dy:"-0.15em"};return o&&(l.dy=void 0),s.text(function(e){return e.text}).style({fill:function(e){return e.fill},"font-size":function(e){return r.fromPoint(e.fontSize||i.DefaultLabelFontSizeInPt)}}).transition().ease(n).duration(a).attr(l).style("opacity",1),s.exit().transition().duration(a).style("opacity",0).remove(),s}function s(e,t,a,r){var o=e.selectAll("rect").data(_.filter(t,function(e){return e.isVisible}),y);return o.enter().append("rect"),o.attr({x:function(e){return e.boundingBox.left-i.horizontalLabelBackgroundPadding},y:function(e){return e.boundingBox.top-i.verticalLabelBackgroundPadding},rx:v,ry:v,width:function(e){return e.boundingBox.width+2*i.horizontalLabelBackgroundPadding},height:function(e){return void 0===e.text&&void 0===e.secondRowText?0:e.boundingBox.height+2*i.verticalLabelBackgroundPadding}}).style("fill",a?a:"#000000").style("fill-opacity",null!=r?r:1),o.exit().remove(),o}function l(e,i,a,r){e.select(w.selector).empty()&&e.append("g").classed(w["class"],!0);var o=e.select(w.selector).selectAll("polyline").data(i,a);o.enter().append("polyline").classed(P["class"],!0),o.attr("points",function(e){return e.leaderLinePoints}).style({stroke:function(e){return r?r:e.fill},"stroke-width":t.DonutLabelUtils.LineStrokeWidth}),o.exit().remove()}function c(t,i,a){return a?a.format(t):e.formattingService.formatValue(t,i)}function u(e,t){return e&&e.displayUnit&&0===t.displayUnits?e.displayUnit.value:null}function h(t,i){if(t!==b)return t;if(i){var a=i.split(";")[0],r=e.NumberFormat.getCustomFormatMetadata(a,!0);if(r.hasDots)return r.precision}return C}function d(){return{cache:{defaultFormatter:null},getOrCreate:function(e,i,a){if(e){var r={formatString:e,displayUnits:i.displayUnits,precision:h(i.precision,e),value2:a},o=JSON.stringify(r);return this.cache[o]||(this.cache[o]=t.valueFormatter.create(p(i,e,a,r.precision))),this.cache[o]}return this.cache.defaultFormatter||(this.cache.defaultFormatter=t.valueFormatter.create(p(i,e,a,i.precision))),this.cache.defaultFormatter}}}function p(t,i,a,r){return{displayUnitSystemType:e.DisplayUnitSystemType.DataLabels,format:i,precision:r,value:t.displayUnits,value2:a,allowFormatBeautification:!0}}function g(e){for(var i=[],a={},r=function(e,i,a){return i.some(function(i){return a?t.shapes.Rect.equals(e.parentShape.rect,i.rect):t.shapes.Point.equals(e.parentShape.point,i.point)})},o=0,n=e;o<n.length;o++){var s=n[o],l=1===s.parentType,c=a[s.text];c?r(s,c,l)||(i.push(s),c.push(s.parentShape)):(i.push(s),a[s.text]=[s.parentShape])}return i}function m(e){switch(e){case 9:return{maximumOffset:t.ScatterChart.dataLabelLayoutMaximumOffset,startingOffset:t.ScatterChart.dataLabelLayoutStartingOffset,offsetIterationDelta:t.ScatterChart.dataLabelLayoutOffsetIterationDelta,allowLeaderLines:!0,attemptToMoveLabelsIntoViewport:!0};default:return{maximumOffset:i.maxLabelOffset,startingOffset:i.startingLabelOffset,attemptToMoveLabelsIntoViewport:!0}}}function f(t,a){var r=i.LabelTextProperties,o={text:t,fontFamily:r.fontFamily,fontSize:jsCommon.PixelConverter.fromPoint(a),fontWeight:r.fontWeight};return{width:e.TextMeasurementService.measureSvgTextWidth(o),height:e.TextMeasurementService.estimateSvgTextHeight(o)}}function y(e,t){return e.key?e.key:e.identity?e.identity.getKeyWithoutHighlight():t}i.DefaultLabelFontSizeInPt=9,i.MapPolylineOpacity=.5,i.LabelDensityBufferFactor=3,i.LabelDensityPadding=6,i.LabelDensityMin=0,i.LabelDensityMax=6,i.startingLabelOffset=8,i.maxLabelOffset=8,i.maxLabelWidth=50,i.hundredPercentFormat="0.00 %;-0.00 %;0.00 %",i.LabelTextProperties={fontFamily:"wf_standard-font",fontSize:r.fromPoint(i.DefaultLabelFontSizeInPt),fontWeight:"normal"},i.defaultLabelColor="#777777",i.defaultInsideLabelColor="#ffffff",i.horizontalLabelBackgroundPadding=4,i.verticalLabelBackgroundPadding=2;var v=4,b=void 0,C=0;i.labelGraphicsContextClass=a("labelGraphicsContext"),i.labelBackgroundGraphicsContextClass=a("labelBackgroundGraphicsContext");var S=a("label"),x=a("label-second-line"),w=a("leader-lines"),P=a("line-label");i.drawDefaultLabels=o,i.animateDefaultLabels=n,i.drawLabelBackground=s,i.drawLabelLeaderLines=l,i.getLabelFormattedText=c,i.getDisplayUnitValueFromAxisFormatter=u,i.createColumnFormatterCacheManager=d,i.removeDuplicates=g,i.getDataLabelLayoutOptions=m,i.getTextSize=f}(i=t.NewDataLabelUtils||(t.NewDataLabelUtils={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(e,t){var i=parseFloat(t);if(e){var a=p[e.graphic.toUpperCase()];if(a&&!isNaN(i)){var r=a.statusValues;e.normalizedFiveStateKpiRange&&5===r.length&&(i=2*i);var o=i+Math.floor(r.length/2);return[a.kpiIconClass,r[o]].join(" ").trim()}}}function i(e,t){return e?1===t?[o,n,e].join(" "):[o,e].join(" "):void 0}function a(e,a,r){var o=t(e,a);return i(o,r)}function r(e,a,r){var o=e&&e.kpi;if(o){var n=t(o,a);if(n)return{caption:n,statusGraphic:o.graphic,"class":i(n,r)}}}var o="powervisuals-glyph",n="big-kpi",s=["kpi-red","kpi-yellow","kpi-green"],l={kpiIconClass:"circle",statusValues:s},c={kpiIconClass:"",statusValues:["circle-x kpi-red","circle-exclamation kpi-yellow","circle-checkmark kpi-green"]},u={kpiIconClass:"traffic-light",statusValues:s},h={kpiIconClass:"",statusValues:["rhombus kpi-red","triangle kpi-yellow","circle kpi-green"]},d={kpiIconClass:"",statusValues:["circle-empty","circle-one-quarter","circle-half","circle-three-quarters","circle-full"]},p={"THREE CIRCLES COLORED":l,"TRAFFIC LIGHT - SINGLE":l,"THREE FLAGS COLORED":{kpiIconClass:"flag",statusValues:s},"ROAD SIGNS":c,"THREE SYMBOLS CIRCLED COLORED":c,"TRAFFIC LIGHT":u,"THREE TRAFFIC LIGHTS RIMMED COLORED":u,"THREE SYMBOLS UNCIRCLED COLORED":{kpiIconClass:"",statusValues:["x kpi-red","exclamation kpi-yellow","checkmark kpi-green"]},SHAPES:h,"SMILEY FACE":h,THERMOMETER:h,CYLINDER:h,"THREE SIGNS COLORED":h,"THREE STARS COLORED":{kpiIconClass:"star-stacked",statusValues:["star-empty","star-half-full","star-full"]},"FIVE BARS COLORED":{kpiIconClass:"bars-stacked",statusValues:["bars-zero","bars-one","bars-two","bars-three","bars-four"]},"FIVE BOXES COLORED":{kpiIconClass:"boxes-stacked",statusValues:["boxes-zero","boxes-one","boxes-two","boxes-three","boxes-four"]},"FIVE QUARTERS COLORED":d,"GAUGE - ASCENDING":d,"GAUGE - DESCENDING":{kpiIconClass:"",statusValues:["circle-full","circle-three-quarters","circle-half","circle-one-quarter","circle-empty"]},"STANDARD ARROW":{kpiIconClass:"",statusValues:["arrow-down","arrow-right-down","arrow-right","arrow-right-up","arrow-up"]},"VARIANCE ARROW":{kpiIconClass:"",statusValues:["arrow-down kpi-red","arrow-right kpi-yellow","arrow-up kpi-green"]},"STATUS ARROW - ASCENDING":{kpiIconClass:"",statusValues:["arrow-down kpi-red","arrow-right-down kpi-yellow","arrow-right kpi-yellow","arrow-right-up kpi-yellow","arrow-up kpi-green"]},"STATUS ARROW - DESCENDING":{kpiIconClass:"",statusValues:["arrow-up kpi-green","arrow-right-up kpi-yellow","arrow-right kpi-yellow","arrow-right-down kpi-yellow","arrow-down kpi-red"]}};e.getClassForKpi=a,e.getKpiImageMetadata=r}(t=e.KpiUtil||(e.KpiUtil={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(i){function a(a,r,o,n){if(_.isEmpty(r)){var s={selector:{id:"0"},properties:{show:!1,value:"",lineColor:{solid:{color:o}},transparency:50,style:t.lineStyle.dashed,position:t.referenceLinePosition.back,dataLabelShow:!1},objectName:n};return void a.pushInstance(s)}for(var l=0,c=r;l<c.length;l++){var u=c[l],h=u.object,d=e.DataViewObject.getValue(h,i.referenceLineProps.show,!1),p=e.DataViewObject.getValue(h,i.referenceLineProps.value),g=e.DataViewObject.getValue(h,i.referenceLineProps.lineColor,{solid:{color:o}}),m=e.DataViewObject.getValue(h,i.referenceLineProps.transparency,50),f=e.DataViewObject.getValue(h,i.referenceLineProps.style,t.lineStyle.dashed),y=e.DataViewObject.getValue(h,i.referenceLineProps.position,t.referenceLinePosition.back),v=e.DataViewObject.getValue(h,i.referenceLineProps.dataLabelShow,!1),s={selector:{id:u.id},properties:{show:d,value:p,lineColor:g,transparency:m,style:f,position:y,dataLabelShow:v},objectName:n};if(v){var b=e.DataViewObject.getValue(h,i.referenceLineProps.dataLabelColor,{solid:{color:o}}),C=e.DataViewObject.getValue(h,i.referenceLineProps.dataLabelHorizontalPosition,t.referenceLineDataLabelHorizontalPosition.left),S=e.DataViewObject.getValue(h,i.referenceLineProps.dataLabelVerticalPosition,t.referenceLineDataLabelVerticalPosition.above),x=e.DataViewObject.getValue(h,i.referenceLineProps.dataLabelDecimalPoints,void 0)<0?void 0:e.DataViewObject.getValue(h,i.referenceLineProps.dataLabelDecimalPoints,void 0),w=e.DataViewObject.getValue(h,i.referenceLineProps.dataLabelDisplayUnits,0);s.properties[i.referenceLineProps.dataLabelColor]=b,s.properties[i.referenceLineProps.dataLabelHorizontalPosition]=C,s.properties[i.referenceLineProps.dataLabelVerticalPosition]=S,s.properties[i.referenceLineProps.dataLabelDecimalPoints]=x,s.properties[i.referenceLineProps.dataLabelDisplayUnits]=w}a.pushInstance(s)}}function r(a){var r=a.graphicContext,o=a.axes,n=a.referenceLineProperties,s=a.isHorizontal,l=a.viewport,c=a.classAndSelector,u=o.x.scale,h=o.y1.scale,d=e.DataViewObject.getValue(n,i.referenceLineProps.value,0),p=e.DataViewObject.getValue(n,i.referenceLineProps.lineColor,{solid:{color:a.defaultColor}}),g=e.DataViewObject.getValue(n,i.referenceLineProps.transparency),m=e.DataViewObject.getValue(n,i.referenceLineProps.style,t.lineStyle.dashed),f=e.DataViewObject.getValue(n,i.referenceLineProps.position,t.referenceLinePosition.back),y=r.select(c.selector),v=$(y[0]).index(),b=v>1?t.referenceLinePosition.front:t.referenceLinePosition.back,C=-1!==v,S=b!==f;C&&S&&y.remove(),C&&!S||(y=f===t.referenceLinePosition.back?r.insert("line",":first-child"):r.append("line"));var x=s?0:u(d),w=s?h(d):0,P=s?l.width:u(d),D=s?h(d):l.height;y.attr({"class":c["class"],x1:x,y1:w,x2:P,y2:D}).style({stroke:p.solid.color}),null!=g&&y.style("stroke-opacity",(100-g)/100),m===t.lineStyle.dashed?y.style("stroke-dasharray","5, 5"):m===t.lineStyle.dotted?y.style({"stroke-dasharray":"1, 5","stroke-linecap":"round"}):m===t.lineStyle.solid&&y.style({"stroke-dasharray":null,"stroke-linecap":null})}function o(a){var r=5,o=a.axes,n=a.referenceLineProperties,s=a.isHorizontal,l=a.viewport,c=o.x.scale,u=o.y1.scale,h=e.DataViewObject.getValue(n,i.referenceLineProps.value,0),d=e.DataViewObject.getValue(n,i.referenceLineProps.dataLabelColor,{
8solid:{color:a.defaultColor}}),p=n[i.referenceLineProps.dataLabelDecimalPoints]<0?void 0:n[i.referenceLineProps.dataLabelDecimalPoints],g=n[i.referenceLineProps.dataLabelHorizontalPosition]||t.referenceLineDataLabelHorizontalPosition.left,m=n[i.referenceLineProps.dataLabelVerticalPosition]||t.referenceLineDataLabelVerticalPosition.above,f=e.DataViewObject.getValue(n,i.referenceLineProps.dataLabelDisplayUnits,0),y=s?o.y1.formatter:o.x.formatter,v=y;if(null!=y.options){var b=e.Prototype.inherit(y.options);b.precision=p,b.value=f,b.detectAxisPrecision=!1,v=t.valueFormatter.create(b)}var C,S,x=t.NewDataLabelUtils.getLabelFormattedText(v.format(h)),w={text:x,fontFamily:t.dataLabelUtils.LabelTextProperties.fontFamily,fontSize:t.dataLabelUtils.LabelTextProperties.fontSize,fontWeight:t.dataLabelUtils.LabelTextProperties.fontWeight},P=e.TextMeasurementService.measureSvgTextWidth(w),D=e.TextMeasurementService.estimateSvgTextHeight(w),L=s?0:c(h),T=s?u(h):0,_=s?l.width:c(h),V=s?u(h):l.height,M=[1];s?(C=g===t.referenceLineDataLabelHorizontalPosition.left?L+r:_-P/2-r,S=T,M=m===t.referenceLineDataLabelVerticalPosition.above?[1]:[2]):(C=L,S=m===t.referenceLineDataLabelVerticalPosition.above?T+D/2+r:V-D/2-r,M=g===t.referenceLineDataLabelHorizontalPosition.left?[4]:[8]);var N,A=e.TextMeasurementService.measureSvgTextWidth(w),O=e.TextMeasurementService.estimateSvgTextHeight(w,!0);return N={point:{x:C,y:S},radius:0,validPositions:M},{isPreferred:!0,text:x,textSize:{width:A,height:O},outsideFill:d.solid.color,insideFill:null,parentShape:N,parentType:0,fontSize:9,identity:null,secondRowText:null,key:a.key}}function n(t){var a=null;return t&&e.DataViewObject.getValue(t,i.referenceLineProps.show,!1)&&(a=e.DataViewObject.getValue(t,i.referenceLineProps.value,null)),a}i.referenceLineProps={show:"show",lineColor:"lineColor",transparency:"transparency",value:"value",style:"style",position:"position",dataLabelShow:"dataLabelShow",dataLabelColor:"dataLabelColor",dataLabelDecimalPoints:"dataLabelDecimalPoints",dataLabelHorizontalPosition:"dataLabelHorizontalPosition",dataLabelVerticalPosition:"dataLabelVerticalPosition",dataLabelDisplayUnits:"dataLabelDisplayUnits"},i.enumerateObjectInstances=a,i.render=r,i.createLabelDataPoint=o,i.extractReferenceLineValue=n}(i=t.ReferenceLineHelper||(t.ReferenceLineHelper={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(){return{x:d3.event.clientX,y:d3.event.clientY}}function i(e,t){a(e,t),r(e,t)}function a(e,t){e.on("click",function(e){return c(e,t)})}function r(e,t){e.on("contextmenu",function(e){return l(e,t)})}function o(e,t){n(e,t),s(e,t)}function n(e,t){e.on("click",function(){var e=d3.event.target,i=d3.select(e).datum();c(i,t)})}function s(e,t){e.on("contextmenu",function(){var e=d3.event.target,i=d3.select(e).datum();l(i,t)})}function l(t,i){if(!d3.event.ctrlKey){d3.event.preventDefault();var a=e.getPositionOfLastInputEvent();i.handleContextMenu(t,a)}}function c(e,t){t.handleSelection(e,d3.event.ctrlKey)}e.getPositionOfLastInputEvent=t,e.registerStandardInteractivityHandlers=i,e.registerStandardSelectionHandler=a,e.registerStandardContextMenuHandler=r,e.registerGroupInteractivityHandlers=o,e.registerGroupSelectionHandler=n,e.registerGroupContextMenuHandler=s}(t=e.InteractivityUtils||(e.InteractivityUtils={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){function t(e,t,a,r){var o=new i(t,a,r);return o.getWarningMessages(e)}e.getInvalidValueWarnings=t;var i=function(){function t(e,t,i){this.supportsNaN=e,this.supportsNegativeInfinity=t,this.supportsPositiveInfinity=i}return t.prototype.getWarningMessages=function(t){this.loadWarningStatus(t);var i=[];return this.hasNaN&&!this.supportsNaN&&i.push(new e.NaNNotSupportedWarning),(this.hasNegativeInfinity&&!this.supportsNegativeInfinity||this.hasPositiveInfinity&&!this.supportsPositiveInfinity)&&i.push(new e.InfinityValuesNotSupportedWarning),this.hasOutOfRange&&i.push(new e.ValuesOutOfRangeWarning),i},t.prototype.loadWarningStatus=function(e){this.hasNaN=!1,this.hasNegativeInfinity=!1,this.hasOutOfRange=!1,this.hasPositiveInfinity=!1;for(var t=0;t<e.length;t++){var i=e[t],a=i&&i.categorical&&i.categorical.values?i.categorical.values:null;if(!a)return;for(var r=a.length,o=0;r>o;o++){var n=a[o];if(n.values)for(var s=n.values.length,l=0;s>l;l++){var c=n.values[l];isNaN(c)?this.hasNaN=!0:c===Number.POSITIVE_INFINITY?this.hasPositiveInfinity=!0:c===Number.NEGATIVE_INFINITY?this.hasNegativeInfinity=!0:(-1e300>c||c>1e300)&&(this.hasOutOfRange=!0)}}}},t}()}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(e){return new i(e)}e.createListView=t}(t=e.ListViewFactory||(e.ListViewFactory={}));var i=function(){function t(e){var i=this;this.options=$.extend(!0,{},e),this.scrollbarInner=e.baseContainer.append("div").classed("scrollbar-inner",!0).on("scroll",function(){return i.renderImpl(i.options.rowHeight)}),this.scrollContainer=this.scrollbarInner.append("div").classed("scrollRegion",!0).on("touchstart",function(){return i.stopTouchPropagation()}).on("touchmove",function(){return i.stopTouchPropagation()}),this.visibleGroupContainer=this.scrollContainer.append("div").classed("visibleGroup",!0),$(e.baseContainer.node()).find(".scroll-element").attr("drag-resize-disabled","true"),t.SetDefaultOptions(e)}return t.SetDefaultOptions=function(e){e.rowHeight=e.rowHeight||t.defaultRowHeight},t.prototype.rowHeight=function(e){return this.options.rowHeight=Math.ceil(e),this},t.prototype.data=function(e,t,i){return void 0===i&&(i=!1),this._data=e,this.getDatumIndex=t,this.setTotalRows(),i&&$(this.scrollbarInner.node()).scrollTop(0),this.render(),this},t.prototype.viewport=function(e){return this.options.viewport=e,this.render(),this},t.prototype.empty=function(){this._data=[],this.render()},t.prototype.render=function(){var e=this;this.renderTimeoutId&&window.clearTimeout(this.renderTimeoutId),this.renderTimeoutId=window.setTimeout(function(){e.getRowHeight().then(function(t){e.renderImpl(t)}),e.renderTimeoutId=void 0},0)},t.prototype.renderImpl=function(e){var t=this.options.scrollEnabled?Math.max(0,this._totalRows*e):this.options.viewport.height;this.scrollContainer.style("height",t+"px").attr("height",t),this.scrollToFrame(!0)},t.prototype.stopTouchPropagation=function(){if(this.options.isReadMode()){if("touchstart"===d3.event.type){var e=d3.event;e.touches&&1===e.touches.length&&d3.event.stopPropagation()}"touchmove"===d3.event.type&&d3.event.stopPropagation()}},t.prototype.scrollToFrame=function(i){var a=this.options,r=this.visibleGroupContainer,o=this._totalRows,n=a.rowHeight||t.defaultRowHeight,s=this.getVisibleRows()||1,l=this.scrollbarInner.node().scrollTop,c=0===l?0:Math.floor(l/n),u=e.SVGUtil.translateWithPixels(0,c*n);r.style({transform:function(e){return u},"-webkit-transform":u});var h=Math.max(0,Math.min(c,o-s+1)),d=h+s;if(this.options.scrollEnabled){var p=l-c*n,g=.5*n;p>g&&d++}var m=r.selectAll(".row").data(this._data.slice(h,Math.min(d,o)),this.getDatumIndex);m.enter().append("div").classed("row",!0).call(function(e){return a.enter(e)}),m.order();var f=r.selectAll(".row:not(.transitioning)");f.call(function(e){return a.update(e)}),m.exit().call(function(e){return a.exit(e)}).remove(),i&&s!==o&&d>=o*t.loadMoreDataThreshold&&a.loadMoreData()},t.prototype.setTotalRows=function(){var e=this._data;this._totalRows=e?e.length:0},t.prototype.getVisibleRows=function(){var e=1,t=this.options.rowHeight,i=this.options.viewport.height;return!t||1>t?e:this.options.scrollEnabled?Math.min(Math.ceil(i/t),this._totalRows)||e:Math.min(Math.floor(i/t),this._totalRows)||e},t.prototype.getRowHeight=function(){var e=$.Deferred(),i=this,a=i.options;if(this.cancelMeasurePass&&this.cancelMeasurePass(),!(this._data&&this._data.length&&a))return i.rowHeight(t.defaultRowHeight),e.resolve(a.rowHeight).promise();this.scrollToFrame(!1);var r=window.requestAnimationFrame(function(){var t=i.visibleGroupContainer.select(".row");if(!t.empty()){var a=t.node(),o=Math.max($(a).outerHeight(!0),$(a).children().first().outerHeight(!0));i.rowHeight(o),e.resolve(o)}i.cancelMeasurePass=void 0,window.cancelAnimationFrame(r)});return this.cancelMeasurePass=function(){window.cancelAnimationFrame(r),e.reject()},e.promise()},t.loadMoreDataThreshold=.8,t.defaultRowHeight=1,t}()}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i,a=11;!function(t){function i(e,t,i){return Math.min(Math.max(e,t),i)}function a(e){return 23===e?2147483648:Math.floor(e)===e?256<<e:256*Math.pow(2,e)}function r(e,r,o){void 0===o&&(o=!1);for(var n=[],s={array:new Float64Array(e.length),arrayString:""},l=0;l<e.length;l+=2){var c=i(e[l],t.MinAllowedLatitude,t.MaxAllowedLatitude),u=i(e[l+1],t.MinAllowedLongitude,t.MaxAllowedLongitude),h=(u+180)/360,d=Math.sin(c*Math.PI/180),g=.5-Math.log((1+d)/(1-d))/(4*Math.PI),m=a(r);s.array[l]=i(h*m+.5,0,m-1),s.array[l+1]=i(g*m+.5,0,m-1),o&&(n.push(s.array[l],s.array[l+1]),n.length>=p&&(s.arrayString+=n.join(" ")+" ",n=[]))}return o&&(s.arrayString+=n.join(" ")+" "),s}function o(e){for(var t={latitude:-90,longitude:180},a={latitude:90,longitude:-180},r=0;r<e.length;r+=2)t.latitude=Math.max(e[r],t.latitude),t.longitude=Math.min(e[r+1],t.longitude),a.latitude=Math.min(e[r],a.latitude),a.longitude=Math.max(e[r+1],a.longitude);return t.longitude=i(t.longitude,-180,180),a.longitude=i(a.longitude,-180,180),Microsoft.Maps.LocationRect.fromCorners(new Microsoft.Maps.Location(t.latitude,t.longitude),new Microsoft.Maps.Location(a.latitude,a.longitude))}function n(e){for(var t=[],i=0,a=0,r=0,o=4294967296;i<e.length;){for(var n=0,s=0;;){if(i>=e.length)return null;var l=d.indexOf(e.charAt(i++));if(-1===l)return null;var c=(31&l)*Math.pow(2,s),u=c/o,h=c%o,p=n/o,g=n%o,m=(h|g)>>>0;if(n=(u|p)*o+m,s+=5,32>l)break}var f=Math.floor((Math.sqrt(8*n+5)-1)/2);n-=f*(f+1)/2;var y=Math.floor(n),v=f-y;v=v>>1^-(1&v),y=y>>1^-(1&y),a+=v,r+=y;var b=1e-5*r,C=1e-5*a;t.push(b),t.push(C)}return new Float64Array(t)}function s(e){for(var i=e.locations,a=0;a<i.length;a++){var r=i[a];r.geographic||(r.geographic=t.parseEncodedSpatialValueArray(r.nativeBing));var o=r.geographic;if(o&&!r.absolute){var n=t.latLongToPixelXYArray(o,t.DefaultLevelOfDetail,!0);r.absolute=n.array,r.absoluteString=n.arrayString;var s=t.getLocationBoundaries(o);r.absoluteBounds=t.locationRectToRectXY(s,t.DefaultLevelOfDetail)}}}function l(e,t){return u(e.latitude,e.longitude,t)}function c(t,i){var a=l(t.getNorthwest(),i),r=l(t.getSoutheast(),i);return new e.visuals.Rect(a.x,a.y,r.x-a.x,r.y-a.y)}function u(t,i,a){var o=r(new Float64Array([t,i]),a).array;return new e.visuals.Point(o[0],o[1])}function h(e,t,r){var o=a(r),n=i(e,0,o-1)/o-.5,s=.5-i(t,0,o-1)/o,l=90-360*Math.atan(Math.exp(2*-s*Math.PI))/Math.PI,c=360*n;return new Microsoft.Maps.Location(l,c)}t.Settings={MaxBingRequest:6,MaxCacheSize:3e3,MaxCacheSizeOverflow:100,BingKey:"insert your key",BingUrl:"https://dev.virtualearth.net/REST/v1/Locations",BingUrlGeodata:"https://platform.bing.com/geo/spatial/v1/public/Geodata?",UseDoubleArrayGeodataResult:!0,UseDoubleArrayDequeueTimeout:0},t.MinAllowedLatitude=-85.05112878,t.MaxAllowedLatitude=85.05112878,t.MinAllowedLongitude=-180,t.MaxAllowedLongitude=180,t.TileSize=256,t.MaxLevelOfDetail=23,t.MinLevelOfDetail=1,t.MaxAutoZoomLevel=5,t.DefaultLevelOfDetail=11,t.WorkerErrorName="___error___",t.CategoryTypes={Address:"Address",City:"City",Continent:"Continent",CountryRegion:"Country",County:"County",Longitude:"Longitude",Latitude:"Latitude",Place:"Place",PostalCode:"PostalCode",StateOrProvince:"StateOrProvince"};var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";t.clip=i,t.getMapSize=a;var p=15e3;t.latLongToPixelXYArray=r,t.getLocationBoundaries=o,t.parseEncodedSpatialValueArray=n,t.calcGeoData=s,t.locationToPixelXY=l,t.locationRectToRectXY=c,t.latLongToPixelXY=u,t.pixelXYToLocation=h;var g;!function(e){function t(e){var t='<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle fill="#FF5F00" cx="12" cy="12" r="6"/><circle fill="none" stroke="#FF5F00" stroke-width="2" cx="12" cy="12" r="10"/></svg>',i={draggable:!1,htmlContent:t,height:24,width:24};return new Microsoft.Maps.Pushpin(e,i)}e.createPushpin=t}(g=t.CurrentLocation||(t.CurrentLocation={}))}(i=t.MapUtil||(t.MapUtil={}));var r=function(){function e(){this._locationRect=new Microsoft.Maps.LocationRect(new Microsoft.Maps.Location(30,-30),60,60)}return e.prototype.reCalc=function(e,r,o){var n=[this._locationRect.getNorthwest(),this._locationRect.getSoutheast()];if(r/=2,o/=2,!this._baseRect){var s=i.locationToPixelXY(this._locationRect.getNorthwest(),a),l=i.locationToPixelXY(this._locationRect.getSoutheast(),a);this._baseRect=new t.Rect(s.x,s.y,l.x-s.x,l.y-s.y)}var c=e.tryLocationToPixel(n);this._currentRect=new t.Rect(c[0].x+r,c[0].y+o,c[1].x-c[0].x,c[1].y-c[0].y)},Object.defineProperty(e.prototype,"scale",{get:function(){return this._baseRect?this._currentRect.width/this._baseRect.width:1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transform",{get:function(){var e=this._baseRect,i=this._currentRect,a=new t.Transform;return a.translate(i.left,i.top),a.scale(i.width/e.width,i.height/e.height),a.translate(-e.left,-e.top),a},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outherTransform",{get:function(){var e=this._baseRect,i=this._currentRect,a=new t.Transform;a.translate(i.left,i.top);var r=Math.sqrt(i.width/e.width);return a.scale(r,r),a},enumerable:!0,configurable:!0}),e.prototype.setViewBox=function(e){var t=e.getBoundingClientRect(),i=this._currentRect;e.setAttribute("viewBox",[-i.left,-i.top,t.width,t.height].join(" "))},Object.defineProperty(e.prototype,"innerTransform",{get:function(){var e=this._baseRect,i=this._currentRect,a=new t.Transform,r=i.width/e.width;return a.scale(r,r),a.translate(-e.left,-e.top),a},enumerable:!0,configurable:!0}),e.prototype.transformToString=function(e){var t=e.matrix;return"matrix("+t.m00+" "+t.m10+" "+t.m01+" "+t.m11+" "+t.m02+" "+t.m12+")"},e}();t.MapPolygonInfo=r}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(i){var a=function(){function i(e){this.hostServices=e.hostServices,this.selectedIds=[]}return i.prototype.select=function(e,t){void 0===t&&(t=!1);var i=$.Deferred();return this.hostServices.shouldRetainSelection()?this.sendSelectionToHost([e]):(this.selectInternal(e,t),this.sendSelectionToHost(this.selectedIds)),i.resolve(this.selectedIds),i},i.prototype.showContextMenu=function(e,i){var a=$.Deferred();return i=i||t.InteractivityUtils.getPositionOfLastInputEvent(),this.sendContextMenuToHost(e,i),a.resolve(),a},i.prototype.hasSelection=function(){return this.selectedIds.length>0},i.prototype.clear=function(){var e=$.Deferred();return this.selectedIds=[],this.sendSelectionToHost([]),e.resolve(),e},i.prototype.getSelectionIds=function(){return this.selectedIds},i.prototype.sendSelectionToHost=function(e){var t={data:e.filter(function(e){return e.hasIdentity()}).map(function(e){return e.getSelector()})},i=this.getSelectorsByColumn(e);_.isEmpty(i)||(t.data2=i),this.hostServices.onSelect(t)},i.prototype.sendContextMenuToHost=function(e,t){var i=this.getSelectorsByColumn([e]);if(!_.isEmpty(i)){var a={data:i,position:t};this.hostServices.onContextMenu(a)}},i.prototype.getSelectorsByColumn=function(e){return _(e).filter(function(e){return e.hasIdentity}).map(function(e){return e.getSelectorsByColumn()}).compact().value()},i.prototype.selectInternal=function(t,a){i.containsSelection(this.selectedIds,t)?this.selectedIds=a?this.selectedIds.filter(function(i){return!e.data.Selector.equals(i,t)}):this.selectedIds.length>1?[t]:[]:a?this.selectedIds.push(t):this.selectedIds=[t]},i.containsSelection=function(t,i){return t.some(function(t){return e.data.Selector.equals(t.getSelector(),i.getSelector())})},i}();i.SelectionManager=a}(i=t.utility||(t.utility={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){"use strict";var i;!function(t){var i=jsCommon.Utility,a=function(){function e(e){this.polygonPoints=this.convertArrayPathToPoints(e)}return e.prototype.absoluteCentroid=function(){return null==this._absoluteCentroid&&(this._absoluteCentroid=this.calculatePolygonCentroid()),this._absoluteCentroid},e.prototype.absoluteBoundingRect=function(){return null==this._absoluteBoundingRect&&(this._absoluteBoundingRect=this.calculateBoundingRect()),this._absoluteBoundingRect},e.prototype.contains=function(e){var t={x:e.left,y:e.top},i={x:e.left+e.width,y:e.top},a={x:e.left,y:e.top+e.height},r={x:e.left+e.width,y:e.top+e.height};return this.inside(t)&&this.inside(i)&&this.inside(a)&&this.inside(r)},e.prototype.conflicts=function(e){if(!this.isConflictWithBoundingBox(e))return!1;var t={x:e.left,y:e.top},i={x:e.left+e.width/2,y:e.top},a={x:e.left+e.width,y:e.top},r={x:e.left,y:e.top+e.height},o={x:e.left+e.width/2,y:e.top+e.height},n={x:e.left+e.width,y:e.top+e.height},s={x:e.left,y:e.top+e.height/2},l={x:e.left+e.width,y:e.top+e.height/2};return this.inside(t)||this.inside(i)||this.inside(a)||this.inside(r)||this.inside(o)||this.inside(n)||this.inside(s)||this.inside(l)},e.prototype.lineIntersectionPoint=function(e,t){for(var i=0;i<this.polygonPoints.length;i++){var a=this.polygonPoints[i],r=i===this.polygonPoints.length-1?this.polygonPoints[0]:this.polygonPoints[i+1],o=this.getLineIntersection(e,t,a,r);if(null!==o)return o}return null},e.calculateAbsolutePolygonArea=function(e){var t,i=1,a=0;for(t=0;t<e.length;t++)a+=e[t].x*e[i].y-e[i].x*e[t].y,i=(i+1)%e.length;return a*=.5},e.prototype.isConflictWithBoundingBox=function(e){return n.isIntersecting(this.absoluteBoundingRect(),e)},e.prototype.calculatePolygonCentroid=function(){var t,i,a,r,o,n;for(t=e.calculateAbsolutePolygonArea(this.polygonPoints),a=r=0,n=1,o=0;o<this.polygonPoints.length;o++)i=this.polygonPoints[o].x*this.polygonPoints[n].y-this.polygonPoints[n].x*this.polygonPoints[o].y,a+=(this.polygonPoints[o].x+this.polygonPoints[n].x)*i,r+=(this.polygonPoints[o].y+this.polygonPoints[n].y)*i,n=(n+1)%this.polygonPoints.length;return a/=6*t,r/=6*t,{x:a,y:r}},e.prototype.calculateBoundingRect=function(){for(var e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,r=0;r<this.polygonPoints.length;r++)this.polygonPoints[r].x<e?e=this.polygonPoints[r].x:this.polygonPoints[r].x>i&&(i=this.polygonPoints[r].x),this.polygonPoints[r].y<t?t=this.polygonPoints[r].y:this.polygonPoints[r].y>a&&(a=this.polygonPoints[r].y);return{left:e,top:t,width:i-e,height:a-t}},e.prototype.inside=function(e){for(var t=e.x,i=e.y,a=!1,r=0,o=this.polygonPoints.length-1;r<this.polygonPoints.length;o=r++){var n=this.polygonPoints[r].x,s=this.polygonPoints[r].y,l=this.polygonPoints[o].x,c=this.polygonPoints[o].y,u=s>i!=c>i&&(l-n)*(i-s)/(c-s)+n>t;u&&(a=!a)}return a},e.prototype.getLineIntersection=function(e,t,i,a){var r=e.x,o=e.y,n=t.x,s=t.y,l=i.x,c=i.y,u=a.x,h=a.y,d=n-r,p=s-o,g=u-l,m=h-c,f=(-p*(r-l)+d*(o-c))/(-g*p+d*m),y=(g*(o-c)-m*(r-l))/(-g*p+d*m);return f>=0&&1>=f&&y>=0&&1>=y?{x:r+y*d,y:o+y*p}:null},e.prototype.convertArrayPathToPoints=function(e){for(var t=[],i=0;i<e.length;i+=2){var a=e[i],r=e[i+1],o={x:a,y:r};t.push(o)}return t},e}();t.Polygon=a;var r;!function(t){function a(e,t,i){var a=e.x+t>=0?e.x+t:0,r=e.y+i>=0?e.y+i:0;return{x:a,y:r}}function r(e,t){return void 0!==e&&null!==e&&void 0!==t&&null!==t&&e.x===t.x&&e.y===t.y}function o(e){return null!==e?{x:e.x,y:e.y}:null}function n(e){return"{x:"+e.x+", y:"+e.y+"}"}function s(e){return e.x+","+e.y}function l(e,t){if(null===e||null===t)return null;var i=t.x-e.x,a=t.y-e.y;return Math.sqrt(i*i+a*a)}function c(t,i){return t===i||void 0!==t&&void 0!==i&&e.Double.equalWithPrecision(t.x,i.x)&&e.Double.equalWithPrecision(t.y,i.y)}function u(e,t){if(null===e)return void 0===t?null:t;if(void 0===e)return void 0===t?null:t;if(2===e.length)return{x:i.parseNumber(e[0]),y:i.parseNumber(e[1])};if("string"==typeof e){var a=e.split(",");return 2!==a.length?void 0===t?null:t:{x:i.parseNumber(a[0]),y:i.parseNumber(a[1])}}return 2!==e.length&&"string"!=typeof e?void 0===t?null:t:{x:i.parseNumber(e.x),y:i.parseNumber(e.y)}}t.offset=a,t.equals=r,t.clone=o,t.toString=n,t.serialize=s,t.getDistance=l,t.equalWithPrecision=c,t.parsePoint=u}(r=t.Point||(t.Point={}));var o;!function(t){function a(e){return 0===e.width&&0===e.height}function r(e,t){return void 0!==e&&null!==e&&void 0!==t&&null!==t&&e.width===t.width&&e.height===t.height}function o(e){return null!==e?{width:e.width,height:e.height}:null}function n(e,t){var i=o(e);return t&&(i.width+=t.left+t.right,i.height+=t.top+t.bottom),i}function s(e,t){var i=o(e);return t&&(i.width=i.width-t.left-t.right,i.width<0&&(i.width=0),i.height=i.height-t.top-t.bottom,i.height<0&&(i.height=0)),i}function l(e,t){return t&&(e.width=Math.max(e.width,t.width),e.height=Math.max(e.height,t.height)),e}function c(e){return{left:0,top:0,width:e.width,height:e.height}}function u(e){return"{width:"+e.width+", height:"+e.height+"}"}function h(e,t){return e===t||void 0!==e&&void 0!==t&&e.width===t.width&&e.height===t.height}function d(t,i){return t===i||void 0!==t&&void 0!==i&&e.Double.equalWithPrecision(t.width,i.width)&&e.Double.equalWithPrecision(t.height,i.height)}function p(e,t){if(null===e)return void 0===t?null:t;if(void 0===e)return void 0===t?null:t;if(2===e.length)return{width:i.parseNumber(e[0]),height:i.parseNumber(e[1])};if("string"==typeof e){var a=e.split(",");return 2!==a.length?void 0===t?null:t:{width:i.parseNumber(a[0]),height:i.parseNumber(a[1])}}return 2!==e.length&&"string"!=typeof e?void 0===t?null:t:{width:i.parseNumber(e.width),height:i.parseNumber(e.height)}}t.isEmpty=a,t.equals=r,t.clone=o,t.inflate=n,t.deflate=s,t.combine=l,t.toRect=c,t.toString=u,t.equal=h,t.equalWithPrecision=d,t.parseSize=p}(o=t.Size||(t.Size={}));var n;!function(t){function a(e){return{x:e.left,y:e.top}}function r(e){return{width:e.width,height:e.height}}function o(e,t){e.width=t.width,e.height=t.height}function n(e){return e.left+e.width}function s(e){return e.top+e.height}function l(e){return{x:e.left,y:e.top}}function c(e){return{x:e.left+e.width,y:e.top}}function u(e){return{x:e.left,y:e.top+e.height}}function h(e){return{x:e.left+e.width,y:e.top+e.height}}function d(e,t){return void 0!==t&&null!==t&&e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function p(e){return null!==e?{left:e.left,top:e.top,width:e.width,height:e.height}:null}function g(e){return"{left:"+e.left+", top:"+e.top+", width:"+e.width+", height:"+e.height+"}"}function m(e,t,i){var a=e.left+t>=0?e.left+t:0,r=e.top+i>=0?e.top+i:0;return{left:a,top:r,width:e.width,height:e.height}}function f(e,t){var i=p(e);return t&&(i.left-=t.left,i.top-=t.top,i.width+=t.left+t.right,i.height+=t.top+t.bottom),i}function y(e,t){var i=p(e);return t&&(i.left+=t.left,i.top+=t.top,i.width-=t.left+t.right,i.height-=t.top+t.bottom),i}function v(e,t){return{left:e.left-t,top:e.top-t,width:e.width+t+t,height:e.height+t+t}}function b(e,t){return{left:e.left+t,top:e.top+t,width:e.width-t-t,height:e.height-t-t}}function C(e,t,i){return{x:Math.min(Math.max(e.left,t),e.left+e.width),y:Math.min(Math.max(e.top,i),e.top+e.height)}}function S(e,t){return e===t||void 0!==e&&void 0!==t&&e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function x(t,i){return t===i||void 0!==t&&void 0!==i&&e.Double.equalWithPrecision(t.left,i.left)&&e.Double.equalWithPrecision(t.top,i.top)&&e.Double.equalWithPrecision(t.width,i.width)&&e.Double.equalWithPrecision(t.height,i.height)}function w(e){return void 0===e||null===e||0===e.width&&0===e.height}function P(t,i){return null===t||null===i?!1:e.Double.lessOrEqualWithPrecision(t.left,i.x)&&e.Double.lessOrEqualWithPrecision(i.x,t.left+t.width)&&e.Double.lessOrEqualWithPrecision(t.top,i.y)&&e.Double.lessOrEqualWithPrecision(i.y,t.top+t.height)}function D(e,t){if(!e||!t)return!1;var i=Math.max(e.left,t.left),a=Math.min(e.left+e.width,t.left+t.width);if(i>a)return!1;var r=Math.max(e.top,t.top),o=Math.min(e.top+e.height,t.top+t.height);return o>=r}function L(e,t){if(!e)return t;if(!t)return e;var i=Math.max(e.left,t.left),a=Math.max(e.top,t.top),r=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height);return r>=i&&o>=a?{left:i,top:a,width:r-i,height:o-a}:{left:0,top:0,width:0,height:0}}function T(e,t){if(!e)return t;if(!t)return e;var i=Math.min(e.left,t.left),a=Math.min(e.top,t.top),r=Math.max(e.left+e.width,t.left+t.width),o=Math.max(e.top+e.height,t.top+t.height);return{left:i,top:a,width:r-i,height:o-a}}function _(e,t){if(null===e)return void 0===t?null:t;if(void 0===e)return void 0===t?null:t;if(4===e.length)return{left:i.parseNumber(e[0]),top:i.parseNumber(e[1]),width:i.parseNumber(e[2]),height:i.parseNumber(e[3])};if("string"==typeof e){var a=e.split(",");return 4!==a.length?void 0===t?null:t:{left:i.parseNumber(a[0]),top:i.parseNumber(a[1]),width:i.parseNumber(a[2]),height:i.parseNumber(a[3])}}return 4!==e.length&&"string"!=typeof e?void 0===t?null:t:{left:i.parseNumber(e.left),top:i.parseNumber(e.top),width:i.parseNumber(e.width),height:i.parseNumber(e.height)}}t.getOffset=a,t.getSize=r,t.setSize=o,t.right=n,t.bottom=s,t.topLeft=l,t.topRight=c,t.bottomLeft=u,t.bottomRight=h,t.equals=d,t.clone=p,t.toString=g,t.offset=m,t.inflate=f,t.deflate=y,t.inflateBy=v,t.deflateBy=b,t.getClosestPoint=C,t.equal=S,t.equalWithPrecision=x,t.isEmpty=w,t.containsPoint=P,t.isIntersecting=D,t.intersect=L,t.combine=T,t.parseRect=_}(n=t.Rect||(t.Rect={}));var s;!function(t){function a(e,t){var i=n(e);return t&&(i.left=e.left+t.left,i.right=e.right+t.right,i.bottom=e.bottom+t.bottom,i.top=e.top+t.top),i}function r(e){return e.left+e.right}function o(e){return e.top+e.bottom}function n(e){return null!==e?{left:e.left,top:e.top,right:e.right,bottom:e.bottom}:null}function s(e,t){return void 0!==e&&null!==e&&void 0!==t&&null!==t&&e.left===t.left&&e.bottom===t.bottom&&e.right===t.right&&e.top===t.top}function l(e){var t=e.right;e.right=e.left,e.left=t}function c(e){var t=e.top;e.top=e.bottom,e.bottom=t}function u(e){return"{top:"+e.top+", left:"+e.left+", right:"+e.right+", bottom:"+e.bottom+"}"}function h(e){return e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px"}function d(e){return 0===e.left&&0===e.top&&0===e.right&&0===e.bottom}function p(e,t){return e===t||void 0!==e&&void 0!==t&&e.left===t.left&&e.top===t.top&&e.right===t.right&&e.bottom===t.bottom}function g(t,i){return t===i||void 0!==t&&void 0!==i&&e.Double.equalWithPrecision(t.left,i.left)&&e.Double.equalWithPrecision(t.top,i.top)&&e.Double.equalWithPrecision(t.right,i.right)&&e.Double.equalWithPrecision(t.bottom,i.bottom)}function m(e,t,a){if(null===e)return void 0===t?null:t;if(void 0===e)return void 0===t?null:t;if(4===e.length)return{left:i.parseNumber(e[0]),top:i.parseNumber(e[1]),right:i.parseNumber(e[2]),bottom:i.parseNumber(e[3])};if("string"==typeof e){var r=e.split(",");return 4!==r.length?void 0===t?null:t:{left:i.parseNumber(r[0]),top:i.parseNumber(r[1]),right:i.parseNumber(r[2]),bottom:i.parseNumber(r[3])}}return 4!==e.length&&"string"!=typeof e?void 0===t?null:t:{left:i.parseNumber(e.left),top:i.parseNumber(e.top),right:i.parseNumber(e.right),bottom:i.parseNumber(e.bottom)}}t.inflate=a,t.getWidth=r,t.getHeight=o,t.clone=n,t.equals=s,t.flipHorizontal=l,t.flipVertical=c,t.toString=u,t.toCssString=h,t.isEmpty=d,t.equal=p,t.equalWithPrecision=g,t.parseThickness=m}(s=t.Thickness||(t.Thickness={}));var l;!function(t){function i(e){return 0===e.x&&0===e.y}function a(e,t){return void 0!==e&&null!==e&&void 0!==t&&null!==t&&e.x===t.x&&e.y===t.y}function r(e){return null!==e?{x:e.x,y:e.y}:null}function o(e){return"{x:"+e.x+", y:"+e.y+"}"}function n(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function s(e){return e.x*e.x+e.y*e.y}function l(e,t){return{x:e.x*t,y:e.y*t}}function c(e){return i(e)?e:l(e,1/n(e))}function u(e){return{x:e.y,y:-e.x}}function h(e){return{x:-e.y,y:e.x}}function d(e,t){var i=e.x*Math.cos(t)-e.y*Math.sin(t),a=e.x*Math.sin(t)+e.y*Math.cos(t);return{x:i,y:a}}function p(e,t){return e===t||void 0!==e&&void 0!==t&&e.x===t.x&&e.y===t.y}function g(t,i){return t===i||void 0!==t&&void 0!==i&&e.Double.equalWithPrecision(t.x,i.x)&&e.Double.equalWithPrecision(t.y,i.y)}function m(e,t){return e&&t?{x:e.x+t.x,y:e.y+t.y}:void 0}function f(e,t){return e&&t?{x:e.x-t.x,y:e.y-t.y}:void 0}function y(e,t){return e&&t?e.x*t.x+e.y*t.y:void 0}function v(e,t){return e&&t?{x:t.x-e.x,y:t.y-e.y}:void 0}t.isEmpty=i,t.equals=a,t.clone=r,t.toString=o,t.getLength=n,t.getLengthSqr=s,t.scale=l,t.normalize=c,t.rotate90DegCW=u,t.rotate90DegCCW=h,t.rotate=d,t.equal=p,t.equalWithPrecision=g,t.add=m,t.subtract=f,t.dotProduct=y,t.getDeltaVector=v}(l=t.Vector||(t.Vector={}))}(i=t.shapes||(t.shapes={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i,a=jsCommon.PixelConverter;!function(i){function r(t,i,a){if(!t||_.isEmpty(i))return!1;for(var r=0,o=i.length;o>r;r++){var n=i[r];if(e.DataViewScopeIdentity.equals(t,n,a))return i.splice(r,1),!0}return!1}var o;!function(e){var t=jsCommon.CssConstants.createClassAndSelector;e.HeaderContainer=t("headerContainer"),e.Header=t("slicerHeader"),e.HeaderText=t("headerText"),e.Body=t("slicerBody"),e.Label=t("slicerLabel"),e.LabelText=t("slicerText"),e.LabelImage=t("slicerImage"),e.CountText=t("slicerCountText"),e.Clear=t("clear"),e.MultiSelectEnabled=t("isMultiSelectEnabled")}(o=i.Selectors||(i.Selectors={}));var n;!function(e){e.Clear="Slicer_Clear",e.SelectAll="Slicer_SelectAll"}(n=i.DisplayNameKeys||(i.DisplayNameKeys={}));var s;!function(e){function t(e){return null!=e&&null!=e.slicerSettings}e.areSettingsDefined=t}(s=i.SettingsHelper||(i.SettingsHelper={}));var l;!function(e){function t(e){if(e){var t=e.categorical;if(t&&!_.isEmpty(t.categories))return t.categories[0].identityFields}}e.getIdentityFields=t}(l=i.DefaultValueHandler||(i.DefaultValueHandler={})),i.tryRemoveValueFromRetainedList=r;var c=function(){function i(){}return i.prototype.createSlicerHeader=function(e){var t=document.createElement("div");t.className=o.Header["class"];var i=d3.select(t);return i.append("span").classed(o.Clear["class"],!0).attr("title",e.getLocalizedString(n.Clear)),i.append("div").classed(o.HeaderText["class"],!0),t},i.prototype.getHeaderTextProperties=function(e){var t={fontFamily:"wf_segoe-ui_normal",fontSize:"10px"};return e.header.show&&(t.fontSize=a.fromPoint(e.header.textSize)),t},i.prototype.getSlicerBodyViewport=function(e,t,i){var a=t.header.show?this.getHeaderHeight(t,i):0,r=e.height-(a+t.header.borderBottomWidth);return{height:r,width:e.width}},i.prototype.updateSlicerBodyDimensions=function(e,t,i){var r=this.getSlicerBodyViewport(e,i,this.getHeaderTextProperties(i));t.style({height:a.toString(r.height),width:a.toString(r.width)})},i.prototype.getHeaderHeight=function(t,i){return e.TextMeasurementService.estimateSvgTextHeight(this.getTextProperties(t.header.textSize,i))+t.general.outlineWeight},i.prototype.getRowHeight=function(t,i){return e.TextMeasurementService.estimateSvgTextHeight(this.getTextProperties(t.slicerText.textSize,i))+this.getRowsOutlineWidth(t.slicerText.outline,t.general.outlineWeight)},i.prototype.styleSlicerHeader=function(e,t,i){if(t.header.show){e.style("display","block");var a=e.select(o.HeaderText.selector).text(i);this.setSlicerHeaderTextStyle(a,t)}else e.style("display","none")},i.prototype.setSlicerTextStyle=function(e,i){e.style({color:i.slicerText.color,"background-color":i.slicerText.background,"border-style":"solid","border-color":i.general.outlineColor,"border-width":t.VisualBorderUtil.getBorderWidth(i.slicerText.outline,i.general.outlineWeight),"font-size":a.fromPoint(i.slicerText.textSize)
9})},i.prototype.getRowsOutlineWidth=function(e,i){switch(e){case t.outline.none:case t.outline.leftRight:return 0;case t.outline.bottomOnly:case t.outline.topOnly:return i;case t.outline.topBottom:case t.outline.frame:return 2*i;default:return 0}},i.prototype.setSlicerHeaderTextStyle=function(e,i){e.style({"border-style":"solid","border-color":i.general.outlineColor,"border-width":t.VisualBorderUtil.getBorderWidth(i.header.outline,i.general.outlineWeight),color:i.header.fontColor,"background-color":i.header.background,"font-size":a.fromPoint(i.header.textSize)})},i.prototype.getTextProperties=function(e,t){return t.fontSize=a.fromPoint(e),t},i}();i.DOMHelper=c}(i=t.SlicerUtil||(t.SlicerUtil={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(e,t){if(0!==t.length){var i=e.selectAll("title"),a=i.data(function(e,i){return[t[i]]});a.enter().append("title"),a.exit().remove(),a.text(function(e){return e})}}e.tooltipUpdate=t}(t=e.tooltipUtils||(e.tooltipUtils={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(e,t){return"translate("+e+","+t+")"}function i(e){return"translateX("+e+"px)"}function a(e,t){return"translate("+e+"px,"+t+"px)"}function r(e,t,i,a,r){return"translate("+e+","+t+") rotate("+r+","+i+","+a+")"}function o(e){return"scale("+e+")"}function n(e,t,i){return"translate("+e+","+t+") scale("+i+")"}function s(e,t){return e+" "+t}function l(){var e=Date.now;Date.now=function(){return 1/0},d3.timer.flush(),Date.now=e}function c(e){if(e){var t=e,i=e;i.animation&&(t=i.animation),t&&t.transitionImmediate&&l()}}function u(e){e.getAttribute("d")||e.setAttribute("d","")}function h(e){isNaN(e.x)&&(e.x=0),isNaN(e.y)&&(e.y=0)}function d(e){if(!e||0===e.length)return{x:"0",y:"0"};var t,i=e.split(/[\s,]+/),a="0",r=i[0];if(1===i.length)t=r.substring(10,r.length-1);else{var o=i[1];a=o.substring(0,o.length-1),t=r.substring(10,r.length)}return{x:t,y:a}}function p(e,t,i){var a="rotate("+i+" "+e/2+" "+t/2+")",r="M0 0";return r+="L0 "+t,r+="L"+e+" "+t/2+" Z",{path:r,transform:a}}function g(e){if(null!=e){var t=e.getBoundingClientRect(),i=e.getBBox();if(i.height>0&&i.width>0)return{x:t.width/i.width,y:t.height/i.height}}return{x:1,y:1}}e.AlmostZero=1e-6,e.translate=t,e.translateXWithPixels=i,e.translateWithPixels=a,e.translateAndRotate=r,e.scale=o,e.translateAndScale=n,e.transformOrigin=s,e.flushAllD3Transitions=l,e.flushAllD3TransitionsIfNeeded=c,e.ensureDAttribute=u,e.ensureValidSVGPoint=h,e.parseTranslateTransform=d,e.createArrow=p,e.getTransformScaleRatios=g}(t=e.SVGUtil||(e.SVGUtil={}));var i=function(){function e(e){this.scaleDetectorElement=e.append("rect").classed("scale-detector",!0).attr({width:1,height:1,"stroke-width":"0px",fill:"none"}).node()}return e.prototype.getScale=function(){var e=this.scaleDetectorElement.getBoundingClientRect(),t=this.scaleDetectorElement.getBBox();return t.height>0&&t.width>0?{x:e.width/t.width,y:e.height/t.height}:{x:1,y:1}},e}();e.SVGScaleDetector=i}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(e){return e.toString().replace(new RegExp(" ","g"),"&nbsp")}function i(e){return e.replace(/…/g,"")}function a(e){return null!=e?e.replace(/ /g," "):void 0}e.removeBreakingSpaces=t,e.removeEllipses=i,e.replaceSpaceWithNBSP=a}(t=e.TextUtil||(e.TextUtil={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i,a=e.data.DataRoleHelper;!function(t){function i(e){if(e)for(var t in e){var i=e[t];for(var a in i.properties){var r=i.properties[a];if(r.type&&r.type[M])return r.rule.inputRole}}}function r(e){var t=!!(e&&e.query&&e.query.projections&&e.query.projections.Gradient);return t}function o(e){var t;if(e&&!$.isEmptyObject(e)){t=c();for(var i in t){var a=e.hasOwnProperty(i);if(a){var r=e[i];r&&r.solid&&r.solid.color&&(r=r.solid.color),t[i]=r}}}return t}function n(e){if(e&&e.values&&e.values.grouped){var t=e.values.grouped();return a.getMeasureIndexOfRole(t,"Gradient")}return-1}function s(e){if(null==e)return null;var i=t.getGradientMeasureIndex(e),a=-1===i?null:e.values[i];return a}function l(e){var t=n(e);return t>=0}function c(){var e=g(),t={diverging:!1,minColor:e.minColor,midColor:_,maxColor:e.maxColor,minValue:void 0,midValue:void 0,maxValue:void 0};return t}function u(){return y()}function h(t,i,a){var r,o,n=e.data.DataViewObjectDefinitions.ensure(a,V,null),s=p(a);s&&($.isNumeric(i)&&(r=void 0!==i?T["double"](+i):void 0),"minColor"!==t&&"midColor"!==t&&"maxColor"!==t||(o=C(s,t,i)),"minColor"===t?S(s,o):"midColor"===t?x(s,o):"maxColor"===t?w(s,o):"minValue"===t?P(s,r):"midValue"===t?D(s,r):"maxValue"===t?L(s,r):"diverging"===t?(s=i?v(s):y(s),n.properties[M]=s):"revertToDefault"===t&&(s=this.getDefaultFillRuleDefinition(),n.properties[M]=s))}function d(e){return e?m(e):c()}function p(t){var i=e.data.DataViewObjectDefinitions.getValue(t,{objectName:V,propertyName:M},null);return i}function g(){var t=new e.visuals.DataColorPalette,i=t.getColorByIndex(0),a=d3.scale.linear().domain([0,100]).range(["#ffffff",i.value]),r=i.value,o=a(20),n=_;return{minColor:o,midColor:n,maxColor:r}}function m(e){var t,i,a,r,o,n=_,s=void 0!==e.linearGradient3;if(e.linearGradient2){var l=e.linearGradient2.max.color,c=e.linearGradient2.min.color,u=e.linearGradient2.max.value,h=e.linearGradient2.min.value;t=l.value,i=c.value,u&&(a=u.value),h&&(o=h.value)}else if(e.linearGradient3){var l=e.linearGradient3.max.color,d=e.linearGradient3.mid.color,c=e.linearGradient3.min.color,u=e.linearGradient3.max.value,p=e.linearGradient3.mid.value,h=e.linearGradient3.min.value;t=l.value,n=d.value,i=c.value,u&&(a=u.value),p&&(r=p.value),h&&(o=h.value)}return{diverging:s,minColor:i,midColor:n,maxColor:t,minValue:o,midValue:r,maxValue:a}}function f(e){var t=[];return t.push(e.minColor),e.diverging&&t.push(e.midColor),t.push(e.maxColor),t.join(",")}function y(e){var t=d(e),i={linearGradient2:{max:{color:T.text(t.maxColor)},min:{color:T.text(t.minColor)}}};return i}function v(e){var t=d(e),i={linearGradient3:{max:{color:T.text(t.maxColor)},mid:{color:T.text(t.midColor)},min:{color:T.text(t.minColor)}}};return i}function b(e,t){var i,a;return e.linearGradient3?(a=v(),"minColor"===t?i=a.linearGradient3.min.color:"midColor"===t?i=a.linearGradient3.mid.color:"maxColor"===t&&(i=a.linearGradient3.max.color)):e.linearGradient2&&(a=y(),"minColor"===t?i=a.linearGradient2.min.color:"maxColor"===t&&(i=a.linearGradient2.max.color)),i}function C(e,t,i){var a;return a=i?T.text(i):b(e,t)}function S(e,t){e.linearGradient2?e.linearGradient2.min.color=t:e.linearGradient3&&(e.linearGradient3.min.color=t)}function x(e,t){e.linearGradient3&&(e.linearGradient3.mid.color=t)}function w(e,t){e.linearGradient2?e.linearGradient2.max.color=t:e.linearGradient3&&(e.linearGradient3.max.color=t)}function P(e,t){e.linearGradient2?e.linearGradient2.min.value=t:e.linearGradient3&&(e.linearGradient3.min.value=t)}function D(e,t){e.linearGradient3&&(e.linearGradient3.mid.value=t)}function L(e,t){e.linearGradient2?e.linearGradient2.max.value=t:e.linearGradient3&&(e.linearGradient3.max.value=t)}var T=e.data.SQExprBuilder,_="#ffffff",V="dataPoint",M="fillRule";t.getFillRuleRole=i,t.shouldShowGradient=r,t.getUpdatedGradientSettings=o,t.getGradientMeasureIndex=n,t.getGradientValueColumn=s,t.hasGradientRole=l,t.getDefaultGradientSettings=c,t.getDefaultFillRuleDefinition=u,t.updateFillRule=h,t.getGradientSettings=d,t.getFillRule=p,t.getGradientSettingsFromRule=m,t.getGradientBarColors=f}(i=t.GradientUtils||(t.GradientUtils={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(t){function i(){return"#FFF"}function a(){return 50}function r(){return!1}function o(){return{color:i(),transparency:a(),show:r()}}function n(e,t){var i=t&&t.transparency;null==i&&(i=a());var r={selector:null,properties:{transparency:i,image:t&&t.image},objectName:"plotArea"};e.pushInstance(r)}function s(t,i,a){var r=t&&t.image,o=r&&r.url,n=r&&r.scaling,s=t&&t.transparency,l=i.children(".background-image");if(!o)return void(0!==l.length&&l.remove());switch(0===l.length&&(i.prepend('<div class="background-image"></div>'),l=i.children(".background-image"),l.css("position","absolute")),l.css({width:a.width,height:a.height,"margin-left":a.left,"margin-top":a.top}),l.css({"background-image":"url("+o+")","background-repeat":"no-repeat",opacity:(100-s)/100}),n){case e.imageScalingType.normal:l.css({"background-size":"","background-position":"50% 50%"});break;case e.imageScalingType.fit:l.css({"background-size":"100% 100%","background-position":""});break;case e.imageScalingType.fill:l.css({"background-size":"100%","background-position":"50% 50%"});break;default:l.css({"background-size":"","background-position":"50% 50%"})}}t.getDefaultColor=i,t.getDefaultTransparency=a,t.getDefaultShow=r,t.getDefaultValues=o,t.enumeratePlot=n,t.renderBackgroundImage=s}(t=e.visualBackgroundHelper||(e.visualBackgroundHelper={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=e.data.Selector,a=function(){function e(){}return e.prototype.pushInstance=function(e){var t=this.instances;t||(t=this.instances=[]);var i=this.containerIdx;null!=i&&(e.containerIdx=i);for(var a=0,r=t;a<r.length;a++){var o=r[a];if(this.canMerge(o,e))return this.extend(o,e,"properties"),this.extend(o,e,"validValues"),this}return t.push(e),this},e.prototype.pushContainer=function(e){var t=this.containers;t||(t=this.containers=[]);var i=t.push(e);return this.containerIdx=i-1,this},e.prototype.popContainer=function(){return this.containerIdx=void 0,this},e.prototype.complete=function(){if(this.instances){var e={instances:this.instances},t=this.containers;return t&&(e.containers=t),e}},e.prototype.canMerge=function(e,t){return e.objectName===t.objectName&&e.containerIdx===t.containerIdx&&i.equals(e.selector,t.selector)},e.prototype.extend=function(e,t,i){var a=t[i];if(a){var r=e[i];r||(r=e[i]={});for(var o in a)r[o]||(r[o]=a[o])}},e.merge=function(t,i){var a=e.normalize(t),r=e.normalize(i);if(!a||!r)return a||r;for(var o=a.containers?a.containers.length:0,n=0,s=r.instances;n<s.length;n++){var l=s[n];a.instances.push(l),null!=l.containerIdx&&(l.containerIdx+=o)}var c=r.containers;return _.isEmpty(c)||(a.containers?Array.prototype.push.apply(a.containers,c):a.containers=c),a},e.normalize=function(e){return _.isArray(e)?{instances:e}:e},e.getContainerForInstance=function(e,t){return e.containers[t.containerIdx]},e}();t.ObjectEnumerationBuilder=a}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(t){function i(t,i){switch(t){case e.outline.none:return"0px";case e.outline.bottomOnly:return"0px 0px "+i+"px 0px";case e.outline.topOnly:return i+"px 0px 0px 0px";case e.outline.leftOnly:return"0px 0px 0px "+i+"px";case e.outline.rightOnly:return"0px "+i+"px 0px 0px";case e.outline.topBottom:return i+"px 0px";case e.outline.leftRight:return"0px "+i+"px";case e.outline.frame:return i+"px";default:return"0px"}}t.getBorderWidth=i}(t=e.VisualBorderUtil||(e.VisualBorderUtil={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){function t(e,t){return{m00:1,m01:0,m02:e,m10:0,m11:1,m12:t}}function i(e,t){return{m00:e,m01:0,m02:0,m10:0,m11:t,m12:0}}function a(e){var t=e,i=Math.sin(t),a=Math.cos(t);return{m00:a,m01:-i,m02:0,m10:i,m11:a,m12:0}}function r(e){var t=e.m00*e.m11-e.m01*e.m10,i=1/t;return{m00:e.m11*i,m01:-e.m01*i,m02:(e.m01*e.m12-e.m02*e.m11)*i,m10:-e.m10*i,m11:e.m00*i,m12:-(e.m00*e.m12-e.m10*e.m02)*i}}function o(e,t){return{m00:e.m00*t.m00+e.m01*t.m10,m01:e.m00*t.m01+e.m01*t.m11,m02:e.m00*t.m02+e.m01*t.m12+e.m02,m10:e.m10*t.m00+e.m11*t.m10,m11:e.m10*t.m01+e.m11*t.m11,m12:e.m10*t.m02+e.m11*t.m12+e.m12}}var n=function(){function e(e){this.matrix=e||{m00:1,m01:0,m02:0,m10:0,m11:1,m12:0}}return e.prototype.applyToPoint=function(e){if(!e)return e;var t=this.matrix;return{x:t.m00*e.x+t.m01*e.y+t.m02,y:t.m10*e.x+t.m11*e.y+t.m12}},e.prototype.applyToRect=function(e){if(!e)return e;var t=e.left,i=e.top,a=this.matrix,r=1!==a.m00||1!==a.m11,o=0!==a.m01||0!==a.m10;if(!o&&!r)return{left:t+a.m02,top:i+a.m12,width:e.width,height:e.height};var n,s,l,c,u=e.left+e.width,h=e.top+e.height;if(o){var d=a.m00*t+a.m01*i+a.m02,p=a.m10*t+a.m11*i+a.m12,g=a.m00*t+a.m01*h+a.m02,m=a.m10*t+a.m11*h+a.m12,f=a.m00*u+a.m01*i+a.m02,y=a.m10*u+a.m11*i+a.m12,v=a.m00*u+a.m01*h+a.m02,b=a.m10*u+a.m11*h+a.m12;n=Math.min(d,g,f,v),s=Math.max(d,g,f,v),l=Math.min(p,m,y,b),c=Math.max(p,m,y,b)}else{var d=a.m00*t+a.m02,p=a.m11*i+a.m12,v=a.m00*u+a.m02,b=a.m11*h+a.m12;n=Math.min(d,v),s=Math.max(d,v),l=Math.min(p,b),c=Math.max(p,b)}return{left:n,top:l,width:s-n,height:c-l}},e.prototype.translate=function(e,i){if(0!==e||0!==i){var a=t(e,i);this.matrix=o(this.matrix,a),this._inverse=null}},e.prototype.scale=function(e,t){if(1!==e||1!==t){var a=i(e,t);this.matrix=o(this.matrix,a),this._inverse=null}},e.prototype.rotate=function(e){if(0!==e){var t=a(e);this.matrix=o(this.matrix,t),this._inverse=null}},e.prototype.add=function(e){e&&(this.matrix=o(this.matrix,e.matrix),this._inverse=null)},e.prototype.getInverse=function(){return this._inverse||(this._inverse=new e(r(this.matrix))),this._inverse},e}();e.Transform=n,e.createTranslateMatrix=t,e.createScaleMatrix=i,e.createRotationMatrix=a,e.createInverseMatrix=r}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i,a=jsCommon.Color,r=e.data.DataRoleHelper;!function(i){function o(e,t){if(_.isEmpty(t))return void e.pushInstance({selector:null,properties:{show:!1,lineColor:i.defaults.lineColor,transparency:i.defaults.transparency,style:i.defaults.lineStyle,combineSeries:i.defaults.combineSeries},objectName:h});var a=t[0],r={};r.show=a.show,a.combineSeries&&(r.lineColor=a.lineColor),r.transparency=a.transparency,r.style=a.style,r.combineSeries=a.combineSeries,r.useHighlightValues=a.useHighlightValues,e.pushInstance({selector:null,properties:r,objectName:h})}function n(e){return r.hasRoleInDataView(e,"regression.X")}function s(a,r,o,n){if(a&&a.categorical){var s=a.categorical;if(!_.isEmpty(s.categories)&&!_.isEmpty(s.values)){var c=s.categories[0].values,d=s.values.grouped();if(c&&d){var p=e.DataViewObjects.getObject(a.metadata.objects,h,{}),g=e.DataViewObject.getValue(p,u.show,!1),m=e.DataViewObject.getValue(p,u.lineColor),f=e.DataViewObject.getValue(p,u.transparency,i.defaults.transparency),y=e.DataViewObject.getValue(p,u.style,i.defaults.lineStyle),v=e.DataViewObject.getValue(p,u.combineSeries,i.defaults.combineSeries),b=e.DataViewObject.getValue(p,u.useHighlightValues,i.defaults.useHighlightValues),C=e.DataViewObjects.getValue(s.values[0].source.objects,t.lineChartProps.dataPoint.fill);C&&(m=C);for(var S=r.metadata.objects,x=e.DataViewObjects.getFillColor(S,{objectName:"dataPoint",propertyName:"defaultColor"}),w=new t.ColorHelper(n,{objectName:"dataPoint",propertyName:"fill"},x),P=[],D=0;D<d.length;D++){for(var L=d[D],T=[],V=0;V<c.length;V++){var M=t.AxisHelper.normalizeNonFiniteNumber(c[V]),N=L.values[0],A=void 0;A=b&&N.highlights?N.highlights:N.values;var O=t.AxisHelper.normalizeNonFiniteNumber(A[V]);null!=M&&null!=O&&T.push({x:M,y:O})}var I=void 0;if(v)I=m||i.defaults.lineColor;else if(r.categorical.values.source){var R=r.categorical.values.grouped(),F=w.getColorForSeriesValue(R[D].objects,r.categorical.values.identityFields,L.name);F=l(F),I={solid:{color:F}}}else{var H=r.categorical.values[D],F=w.getColorForMeasure(H.source.objects,L.name);F=l(F),I={solid:{color:F}}}P.push({points:T,show:g,lineColor:I,transparency:f,style:y,combineSeries:v,useHighlightValues:b,y2Axis:o})}return P}}}}function l(e){var t=a.parseColorString(e);return t=a.darken(t,20),a.rgbString(t)}function c(e,i,a,r){var o=i.select(p.selector);o.empty()&&(o=i.append("svg").classed(p["class"],!0)),o.attr({height:r.height,width:r.width});var n=o.selectAll(d.selector).data(e||[]);n.enter().append("path").classed(d["class"],!0),n.attr("d",function(e){var t=a.x.scale,i=e.y2Axis&&a.y2?a.y2.scale:a.y1.scale,r=d3.svg.line().x(function(e){return t(e.x)}).y(function(e){return i(e.y)});return r(_.filter(e.points,function(e){return null!=e.x&&null!=e.y}))}),n.each(function(e){var i=d3.select(this),a={};a.stroke=e.lineColor.solid.color,null!=e.transparency&&(a["stroke-opacity"]=(100-e.transparency)/100),e.style===t.lineStyle.dashed?a["stroke-dasharray"]="5, 5":e.style===t.lineStyle.dotted?(a["stroke-dasharray"]="1, 5",a["stroke-linecap"]="round"):e.style===t.lineStyle.solid&&(a["stroke-dasharray"]=null,a["stroke-linecap"]=null),i.style(a)}),n.exit().remove()}var u={show:"show",lineColor:"lineColor",transparency:"transparency",style:"style",combineSeries:"combineSeries",useHighlightValues:"useHighlightValues"},h="trend";i.defaults={lineColor:{solid:{color:"#000"}},lineStyle:t.lineStyle.dashed,transparency:0,combineSeries:!0,useHighlightValues:!0};var d=jsCommon.CssConstants.createClassAndSelector("trend-line"),p=jsCommon.CssConstants.createClassAndSelector("trend-line-layer");i.enumerateObjectInstances=o,i.isDataViewForRegression=n,i.readDataView=s,i.darkenTrendLineColor=l,i.render=c}(i=t.TrendLineHelper||(t.TrendLineHelper={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(e){return e.is(":visible")}e.partiallyVisible=t}(t=e.visibilityHelper||(e.visibilityHelper={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t,i=e.data.Selector;!function(e){function t(e,t){return e=e||null,t=t||null,e===t?!0:!e!=!t?!1:i.equals(e.selector,t.selector)?_.isEqual(e.objects,t.objects):!1}e.equals=t}(t=e.VisualObjectRepetition||(e.VisualObjectRepetition={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i,a=e.data.SemanticFilter,r=jsCommon.UrlUtils;!function(i){function o(i,r,o,s){if(i&&i.categorical&&!_.isEmpty(i.categorical.categories)){var l=i.categorical.categories[0].identityFields;if(l){var c=i.metadata&&i.metadata.objects&&e.DataViewObjects.getValue(i.metadata.objects,t.slicerProps.filterPropertyIdentifier),u=s.analyzeFilter({dataView:i,defaultValuePropertyId:t.slicerProps.defaultValue,filter:c,fieldSQExprs:l});if(u){var h=u.filter;if(h&&!a.isSameFilter(h,c)){o.handleClearSelection();var d=t.slicerProps.filterPropertyIdentifier,p={};p[d.propertyName]=u.filter;var g={objectName:d.objectName,selector:void 0,properties:p},m={merge:[g]};s.persistProperties(m)}var f=n(u,i.metadata,i.categorical,r,o,s);return f}}}}function n(e,i,o,n,l,c){var u=l&&l.isSelectionModeInverted(),h=e.selectedIdentities,d=!_.isEmpty(h)||u===!0;!u&&e.filter&&(u=e.isNotFilter),l&&(l.setSelectionModeInverted(u),l.setDefaultValueMode(a.isDefaultFilter(e.filter)));var p=o.categories[0],g=p&&p.values?p.values.length:0,m=[],f=t.valueFormatter.getFormatString(p.source,t.slicerProps.formatString),y=0,v=o.values&&o.values[0]&&o.values[0].values;v&&_.isEmpty(v)&&(v=void 0);for(var b=i&&!_.isEmpty(i.columns)&&t.converterHelper.isImageUrlColumn(i.columns[0]),C=[],S=0;g>S;S++){var x=p.identity&&p.identity[S],w=p.values&&p.values[S],P=v&&v[S],D=d?t.SlicerUtil.tryRemoveValueFromRetainedList(x,h):!1,L=t.valueFormatter.format(w,f),T=b===!0&&r.isValidImageUrl(L),V={value:L,tooltip:L,identity:t.SelectionId.createWithId(x),selected:D,count:P,isImage:T};if(D){var M={displayName:L,identity:x};C.push(M)}m.push(V),V.selected&&y++}if(_.isEmpty(C)||c.setIdentityDisplayNames(C),d&&!_.isEmpty(h)){var N=c.getIdentityDisplayNames(h);if(!_.isEmpty(N))for(var A=0,O=N;A<O.length;A++){var I=O[A],R={value:I.displayName,tooltip:I.displayName,identity:t.SelectionId.createWithId(I.identity),selected:!0,count:null!=v?0:void 0};m.push(R),y++}}var F=s(i);if(F.selection.selectAllCheckboxEnabled){if(y>0&&!i.segment&&y===m.length){u=!u,l.setSelectionModeInverted(u);for(var H=0,z=m;H<z.length;H++){var G=z[H];G.selected=!1}d=!1,y=0}m.unshift({value:n,tooltip:n,identity:t.SelectionId.createWithMeasure(n),selected:!!u&&0===y,isSelectAllDataPoint:!0,count:void 0})}var j={categorySourceName:p.source.displayName,slicerSettings:F,slicerDataPoints:m,hasSelectionOverride:d,defaultValue:e.defaultValue};return j}function s(i){var a=t.Slicer.DefaultStyleProperties(),r=i.objects,o=i.columns&&_.some(i.columns,function(e){return e.discourageAggregationAcrossGroups});if(r){a.general.outlineColor=e.DataViewObjects.getFillColor(r,t.slicerProps.general.outlineColor,a.general.outlineColor),a.general.outlineWeight=e.DataViewObjects.getValue(r,t.slicerProps.general.outlineWeight,a.general.outlineWeight),a.general.orientation=e.DataViewObjects.getValue(r,t.slicerProps.general.orientation,a.general.orientation),a.header.show=e.DataViewObjects.getValue(r,t.slicerProps.header.show,a.header.show),a.header.fontColor=e.DataViewObjects.getFillColor(r,t.slicerProps.header.fontColor,a.header.fontColor);var n=e.DataViewObjects.getFillColor(r,t.slicerProps.header.background);n&&(a.header.background=n),a.header.outline=e.DataViewObjects.getValue(r,t.slicerProps.header.outline,a.header.outline),a.header.textSize=e.DataViewObjects.getValue(r,t.slicerProps.header.textSize,a.header.textSize),a.slicerText.color=e.DataViewObjects.getFillColor(r,t.slicerProps.items.fontColor,a.slicerText.color);var s=e.DataViewObjects.getFillColor(r,t.slicerProps.items.background);s&&(a.slicerText.background=s),a.slicerText.outline=e.DataViewObjects.getValue(r,t.slicerProps.items.outline,a.slicerText.outline),a.slicerText.textSize=e.DataViewObjects.getValue(r,t.slicerProps.items.textSize,a.slicerText.textSize),a.selection.selectAllCheckboxEnabled=!o&&e.DataViewObjects.getValue(r,t.slicerProps.selection.selectAllCheckboxEnabled,a.selection.selectAllCheckboxEnabled),a.selection.singleSelect=o||e.DataViewObjects.getValue(r,t.slicerProps.selection.singleSelect,a.selection.singleSelect)}return a}i.convert=o}(i=t.DataConversion||(t.DataConversion={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t=e.visuals.shapes;!function(e){e[e.None=0]="None",e[e.VerticalBottomTop=1]="VerticalBottomTop",e[e.VerticalTopBottom=2]="VerticalTopBottom",e[e.HorizontalLeftRight=3]="HorizontalLeftRight",e[e.HorizontalRightLeft=4]="HorizontalRightLeft"}(e.RectOrientation||(e.RectOrientation={}));var i=e.RectOrientation;!function(e){e[e.Allowed=0]="Allowed",e[e.Disallowed=1]="Disallowed",e[e.Partial=2]="Partial"}(e.OutsidePlacement||(e.OutsidePlacement={}));var a=e.OutsidePlacement,r=function(){function r(){this.movingStep=3,this.hideOverlapped=!0,this.defaultDataLabelSettings={anchorMargin:r.DefaultAnchorMargin,anchorRectOrientation:i.None,contentPosition:128,outsidePlacement:a.Disallowed,maximumMovingDistance:r.DefaultMaximumMovingDistance,minimumMovingDistance:r.DefaultMinimumMovingDistance,validContentPositions:128,opacity:1}}return Object.defineProperty(r.prototype,"defaultSettings",{get:function(){return this.defaultDataLabelSettings},enumerable:!0,configurable:!0}),r.prototype.hideCollidedLabels=function(e,t,i,a){void 0===a&&(a=!1);var n=new o(e,t,i),s=[],l={x:0,y:0};a&&(l.x=e.width/2,l.y=e.height/2);for(var c=0,u=t.length;u>c;c++)if(i.filter(t[c])){var h=this.getLabelInfo(t[c]);h.anchorPoint={x:i.labelLayout.x(t[c])+l.x,y:i.labelLayout.y(t[c])+l.y};var d=this.calculateContentPosition(h,h.contentPosition,t[c].size,h.anchorMargin);r.isValid(d)&&!this.hasCollisions(n,h,d,e)&&(t[c].labelX=d.left-l.x,t[c].labelY=d.top-l.y,n.add(h,d),s.push(t[c]))}return s},r.prototype.getLabelInfo=function(e){var t=this.defaultDataLabelSettings;return e.anchorMargin=void 0!==e.anchorMargin?e.anchorMargin:t.anchorMargin,e.anchorRectOrientation=void 0!==e.anchorRectOrientation?e.anchorRectOrientation:t.anchorRectOrientation,e.contentPosition=void 0!==e.contentPosition?e.contentPosition:t.contentPosition,e.maximumMovingDistance=void 0!==e.maximumMovingDistance?e.maximumMovingDistance:t.maximumMovingDistance,e.minimumMovingDistance=void 0!==e.minimumMovingDistance?e.minimumMovingDistance:t.minimumMovingDistance,e.outsidePlacement=void 0!==e.outsidePlacement?e.outsidePlacement:t.outsidePlacement,e.validContentPositions=void 0!==e.validContentPositions?e.validContentPositions:t.validContentPositions,e.opacity=void 0!==e.opacity?e.opacity:t.opacity,e.maximumMovingDistance+=e.anchorMargin,e},r.prototype.calculateContentPositionFromPoint=function(e,t,i,a){var r={x:0,y:0};if(e){if(void 0!==e.x&&isFinite(e.x))switch(r.x=e.x,t){case 1:case 8:case 64:r.x-=i.width/2;break;case 4:case 32:case 256:r.x+=i.width/2}if(void 0!==e.y&&isFinite(e.y))switch(r.y=e.y,t){case 8:case 16:case 32:r.y-=i.height/2;break;case 4:case 1:case 2:r.y-=i.height}if(void 0!==a&&isFinite(a))switch(t){case 1:r.x-=a,r.y-=a;break;case 8:r.x-=a;break;case 64:r.x-=a,r.y+=a;break;case 2:r.y-=a;break;case 16:break;case 128:r.y+=a;break;case 4:r.x+=a,r.y-=a;break;case 32:r.x+=a;break;case 256:r.x+=a,r.y+=a}}return{left:r.x,top:r.y,width:i.width,height:i.height}},r.prototype.calculateContentPositionFromRect=function(e,t,i,a,r){switch(i){case 512:return this.handleInsideCenterPosition(t,a,e,r);case 2048:return this.handleInsideEndPosition(t,a,e,r);case 1024:return this.handleInsideBasePosition(t,a,e,r);case 8192:return this.handleOutsideEndPosition(t,a,e,r);case 4096:return this.handleOutsideBasePosition(t,a,e,r)}return{left:0,top:0,width:-1,height:-1}},r.prototype.handleInsideCenterPosition=function(e,t,a,r){switch(e){case i.VerticalBottomTop:case i.VerticalTopBottom:return n.middleVertical(t,a,r);case i.HorizontalLeftRight:case i.HorizontalRightLeft:default:return n.middleHorizontal(t,a,r)}},r.prototype.handleInsideEndPosition=function(e,t,a,r){switch(e){case i.VerticalBottomTop:return n.topInside(t,a,r);case i.VerticalTopBottom:return n.bottomInside(t,a,r);case i.HorizontalRightLeft:return n.leftInside(t,a,r);case i.HorizontalLeftRight:default:return n.rightInside(t,a,r)}},r.prototype.handleInsideBasePosition=function(e,t,a,r){switch(e){case i.VerticalBottomTop:return n.bottomInside(t,a,r);case i.VerticalTopBottom:return n.topInside(t,a,r);case i.HorizontalRightLeft:return n.rightInside(t,a,r);case i.HorizontalLeftRight:default:return n.leftInside(t,a,r)}},r.prototype.handleOutsideEndPosition=function(e,t,a,r){switch(e){case i.VerticalBottomTop:return n.topOutside(t,a,r);case i.VerticalTopBottom:return n.bottomOutside(t,a,r);case i.HorizontalRightLeft:return n.leftOutside(t,a,r);case i.HorizontalLeftRight:default:return n.rightOutside(t,a,r)}},r.prototype.handleOutsideBasePosition=function(e,t,a,r){switch(e){case i.VerticalBottomTop:return n.bottomOutside(t,a,r);case i.VerticalTopBottom:return n.topOutside(t,a,r);case i.HorizontalRightLeft:return n.rightOutside(t,a,r);case i.HorizontalLeftRight:default:return n.leftOutside(t,a,r)}},r.prototype.calculateContentPosition=function(e,t,i,a){return 2048!==t&&512!==t&&1024!==t&&4096!==t&&8192!==t?this.calculateContentPositionFromPoint(e.anchorPoint,t,i,a):this.calculateContentPositionFromRect(e.anchorRect,e.anchorRectOrientation,t,i,a)},r.prototype.hasCollisions=function(i,o,n,s){var l=t.Rect;if(i.hasConflict(n))return!0;var c={left:0,top:n.height/2,width:s.width,height:s.height};if(c=l.inflate(c,{left:r.InflateAmount,top:0,right:r.InflateAmount,bottom:0}),c=l.intersect(c,n),l.isEmpty(c))return!0;var u=e.Double.lessWithPrecision;switch(o.outsidePlacement){case a.Disallowed:return u(c.width,n.width)||u(c.height,n.height/2);case a.Partial:return u(c.width,n.width/2)||u(c.height,n.height/4)}return!1},r.isValid=function(e){return!t.Rect.isEmpty(e)&&e.width>0&&e.height>0},r.DefaultAnchorMargin=0,r.DefaultMaximumMovingDistance=12,r.DefaultMinimumMovingDistance=3,r.InflateAmount=5,r}();e.DataLabelManager=r;var o=function(){function i(t,a,r){this.grid=[],0!==t.width&&0!==t.height||(this.cellSize=t,this.rowCount=this.colCount=0);var o={fontFamily:e.visuals.dataLabelUtils.LabelTextProperties.fontFamily,fontSize:e.visuals.dataLabelUtils.LabelTextProperties.fontSize,fontWeight:e.visuals.dataLabelUtils.LabelTextProperties.fontWeight};this.cellSize={width:0,height:0};for(var n=0,s=a.length;s>n;n++){var l=a[n];l.labeltext=r.labelText(l);var c=e.Prototype.inherit(o);c.text=l.labeltext,c.fontSize=l.data?l.data.labelFontSize:l.labelFontSize?l.labelFontSize:e.visuals.dataLabelUtils.LabelTextProperties.fontSize,l.size={width:e.TextMeasurementService.measureSvgTextWidth(c),height:e.TextMeasurementService.estimateSvgTextHeight(c)};var u=2*l.size.width,h=2*l.size.height;u>this.cellSize.width&&(this.cellSize.width=u),h>this.cellSize.height&&(this.cellSize.height=h)}0===this.cellSize.width&&(this.cellSize.width=t.width),0===this.cellSize.height&&(this.cellSize.height=t.height),this.colCount=this.getGridRowColCount(this.cellSize.width,t.width,i.ARRANGEGRID_MIN_COUNT,i.ARRANGEGRID_MAX_COUNT),this.rowCount=this.getGridRowColCount(this.cellSize.height,t.height,i.ARRANGEGRID_MIN_COUNT,i.ARRANGEGRID_MAX_COUNT),this.cellSize.width=t.width/this.colCount,this.cellSize.height=t.height/this.rowCount;for(var d=this.grid,p=0;p<this.colCount;p++){d[p]=[];for(var g=0;g<this.rowCount;g++)d[p][g]=[]}}return i.prototype.add=function(e,t){for(var i=this.getGridIndexRect(t),a=this.grid,r=i.left;r<i.right;r++)for(var o=i.top;o<i.bottom;o++)a[r][o].push({element:e,rect:t})},i.prototype.hasConflict=function(e){for(var i=this.getGridIndexRect(e),a=this.grid,r=t.Rect.isIntersecting,o=i.left;o<i.right;o++)for(var n=i.top;n<i.bottom;n++)for(var s=0;s<a[o][n].length;s++){var l=a[o][n][s];if(r(l.rect,e))return!0}return!1},i.prototype.getGridRowColCount=function(e,t,i,a){return Math.min(Math.max(Math.ceil(t/e),i),a)},i.prototype.getGridIndexRect=function(e){var t=function(e,t,i){return Math.min(Math.max(e,t),i)};return{left:t(Math.floor(e.left/this.cellSize.width),0,this.colCount),top:t(Math.floor(e.top/this.cellSize.height),0,this.rowCount),right:t(Math.ceil((e.left+e.width)/this.cellSize.width),0,this.colCount),bottom:t(Math.ceil((e.top+e.height)/this.cellSize.height),0,this.rowCount)}},i.ARRANGEGRID_MIN_COUNT=1,i.ARRANGEGRID_MAX_COUNT=100,i}();e.DataLabelArrangeGrid=o;var n;!function(e){function t(e,t,i){return{left:t.left+t.width/2-e.width/2,top:t.top+i,width:e.width,height:e.height}}function i(e,t,i){return{left:t.left+t.width/2-e.width/2,top:t.top+t.height-e.height-i,width:e.width,height:e.height}}function a(e,t,i){return{left:t.left+t.width-e.width-i,top:t.top+t.height/2-e.height/2,width:e.width,height:e.height}}function r(e,t,i){return{left:t.left+i,top:t.top+t.height/2-e.height/2,width:e.width,height:e.height}}function o(e,t,i){return{left:t.left+t.width/2-e.width/2,top:t.top-e.height-i,width:e.width,height:e.height}}function n(e,t,i){return{left:t.left+t.width/2-e.width/2,top:t.top+t.height+i,width:e.width,height:e.height}}function s(e,t,i){return{left:t.left+t.width+i,top:t.top+t.height/2-e.height/2,width:e.width,height:e.height}}function l(e,t,i){return{left:t.left-e.width-i,top:t.top+t.height/2-e.height/2,width:e.width,height:e.height}}function c(e,t,i){return{left:t.left+t.width/2-e.width/2+i,top:t.top+t.height/2-e.height/2,width:e.width,height:e.height}}function u(e,t,i){return{left:t.left+t.width/2-e.width/2,top:t.top+t.height/2-e.height/2+i,width:e.width,height:e.height}}e.topInside=t,e.bottomInside=i,e.rightInside=a,e.leftInside=r,e.topOutside=o,e.bottomOutside=n,e.rightOutside=s,e.leftOutside=l,e.middleHorizontal=c,e.middleVertical=u}(n||(n={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t=e.visuals.shapes,i=e.visuals.shapes.Rect,a=e.visuals.NewDataLabelUtils,r=function(){function e(t,i){this.viewport=i;for(var a=0,r=0,o=0,n=t;o<n.length;o++)for(var s=n[o],l=0,c=s.labelDataPoints;l<c.length;l++){var u=c[l];if(u.isPreferred){var h=u.labelSize;h.width>a&&(a=h.width),h.height>r&&(r=h.height)}}0===a&&(a=i.width),0===r&&(r=i.height);var d=this.cellSize={width:a*e.cellSizeMultiplier,height:r*e.cellSizeMultiplier
10};this.columnCount=e.getCellCount(d.width,i.width,1,100),this.rowCount=e.getCellCount(d.height,i.height,1,100);for(var p=[],g=0,m=this.columnCount;m>g;g++){p[g]=[];for(var f=0,y=this.rowCount;y>f;f++)p[g][f]=[]}this.grid=p}return e.prototype.add=function(e){for(var t=this.getContainingGridSubsection(e),i=t.xMin;i<t.xMax;i++)for(var a=t.yMin;a<t.yMax;a++)this.grid[i][a].push(e)},e.prototype.hasConflict=function(e){return this.isWithinGridViewport(e)?this.hasCollision(e):!0},e.prototype.tryPositionInViewport=function(e){return this.isCloseToGridViewport(e)?(this.isWithinGridViewport(e)||(e=this.tryMoveInsideViewport(e)),e&&!this.hasCollision(e)?e:void 0):void 0},e.prototype.hasCollision=function(e){for(var i=this.getContainingGridSubsection(e),a=this.grid,r=t.Rect.isIntersecting,o=i.xMin;o<i.xMax;o++)for(var n=i.yMin;n<i.yMax;n++)for(var s=0,l=a[o][n];s<l.length;s++){var c=l[s];if(r(c,e))return!0}return!1},e.prototype.isWithinGridViewport=function(e){return e.left>=0&&e.top>=0&&e.left+e.width<=this.viewport.width&&e.top+e.height<=this.viewport.height},e.prototype.isCloseToGridViewport=function(e){return e.left+e.width>=0-e.width&&e.top+e.height>=-e.height&&e.left<=this.viewport.width+e.width&&e.top<=this.viewport.height+e.height},e.prototype.tryMoveInsideViewport=function(e){var t=i.clone(e),a=this.viewport;return e.width>a.width||e.height>a.height?void 0:(e.left<0?t.left=0:e.left+e.width>a.width&&(t.left-=e.left+e.width-a.width),e.top<0?t.top=0:e.top+e.height>a.height&&(t.top-=e.top+e.height-a.height),t)},e.prototype.getContainingGridSubsection=function(t){return{xMin:e.bound(Math.floor(t.left/this.cellSize.width),0,this.columnCount),xMax:e.bound(Math.ceil((t.left+t.width)/this.cellSize.width),0,this.columnCount),yMin:e.bound(Math.floor(t.top/this.cellSize.height),0,this.rowCount),yMax:e.bound(Math.ceil((t.top+t.height)/this.cellSize.height),0,this.rowCount)}},e.getCellCount=function(t,i,a,r){return e.bound(Math.ceil(i/t),a,r)},e.bound=function(e,t,i){return Math.max(Math.min(e,i),t)},e.cellSizeMultiplier=2,e}();e.LabelArrangeGrid=r;var o=function(){function e(t){this.startingOffset=t.startingOffset,this.maximumOffset=t.maximumOffset,null!=t.offsetIterationDelta?this.offsetIterationDelta=t.offsetIterationDelta:this.offsetIterationDelta=e.defaultOffsetIterationDelta,null!=t.horizontalPadding?this.horizontalPadding=t.horizontalPadding:this.horizontalPadding=e.defaultHorizontalPadding,null!=t.verticalPadding?this.verticalPadding=t.verticalPadding:this.verticalPadding=e.defaultVerticalPadding,this.allowLeaderLines=!!t.allowLeaderLines,this.attemptToMoveLabelsIntoViewport=!!t.attemptToMoveLabelsIntoViewport}return e.prototype.layout=function(e,t){for(var i=0,o=e;i<o.length;i++)for(var n=o[i],s=0,l=n.labelDataPoints;s<l.length;s++){var c=l[s];c.hasBeenRendered=!1,c.hasBackground?c.labelSize={width:c.textSize.width+2*a.horizontalLabelBackgroundPadding,height:c.textSize.height+2*a.verticalLabelBackgroundPadding}:c.labelSize=c.textSize}for(var u=[],h=new r(e,t),d=0,p=e;d<p.length;d++){for(var n=p[d],g=n.maxNumberOfLabels,m=_.clone(n.labelDataPoints),f=[],y=m.length-1,v=g;y>=0&&v>0;y--){var c=m[y];c.isPreferred&&(f.unshift(m.splice(y,1)[0]),v--)}if(f.length>0){var b=this.positionDataLabels(f,t,h,g);g-=b.length,u=u.concat(b)}if(m.length>0){var C=this.positionDataLabels(m,t,h,g);u=u.concat(C)}}return u},e.prototype.positionDataLabels=function(e,t,i,a){for(var r,o=[],n=this.offsetIterationDelta,s=this.startingOffset,l=0;s<=this.maximumOffset&&a>0;){r=this.allowLeaderLines&&s>this.startingOffset;for(var c=0,u=e;c<u.length;c++){var h=u[c];if(0===a)break;if(!h.hasBeenRendered){var d=void 0;d=1===h.parentType?this.tryPositionForRectPositions(h,i,s,l):this.tryPositionForPointPositions(h,i,s,r),d&&(o.push(d),a--)}}s+=n,l+=n}return o},e.prototype.tryPositionForRectPositions=function(t,i,a,r){for(var o=this,s=function(s,l){var c=7&s;if(!c||n.canFitWithinParent(t,o.horizontalPadding,o.verticalPadding)){var u=e.tryPositionRect(i,s,t,a,r,l);if(u){if(c&&!n.isLabelWithinParent(u,t,o.horizontalPadding,o.verticalPadding))return;return i.add(u),t.hasBeenRendered=!0,{boundingBox:u,text:t.text,tooltip:t.tooltip,isVisible:!0,fill:c?t.insideFill:t.outsideFill,identity:t.identity,key:t.key,fontSize:t.fontSize,selected:!1,hasBackground:!!t.hasBackground}}}},l=0,c=t.parentShape.validPositions;l<c.length;l++){var u=c[l],h=s(u,!1);if(h)return h}if(this.attemptToMoveLabelsIntoViewport)for(var d=0,p=t.parentShape.validPositions;d<p.length;d++){var u=p[d],h=s(u,!0);if(h)return h}return null},e.tryPositionRect=function(e,t,i,a,r,o){var s=a;1&t&&(s=r);var l=n.getLabelRect(i,t,s);if(1!==t||0===i.parentShape.orientation){if(!e.hasConflict(l))return l;if(o)return e.tryPositionInViewport(l)}else{if(!e.hasConflict(l))return l;if(l=n.getLabelRect(i,t,-s),!e.hasConflict(l))return l}return null},e.prototype.tryPositionForPointPositions=function(t,i,a,r){for(var o=function(o,n,l){var c=e.tryPositionPoint(i,o,t,a,l);return c?(i.add(c),t.hasBeenRendered=!0,{boundingBox:c,text:t.text,tooltip:t.tooltip,isVisible:!0,fill:256===o?t.insideFill:t.outsideFill,isInsideParent:256===o,identity:t.identity,key:t.key,fontSize:t.fontSize,selected:!1,leaderLinePoints:r?s.getLabelLeaderLineEndingPoint(c,o,n):null,hasBackground:!!t.hasBackground}):void 0},n=t.parentShape,l=n.validPositions,c=0,u=l;c<u.length;c++){var h=u[c],d=o(h,n,!1);if(d)return d}if(this.attemptToMoveLabelsIntoViewport&&!_.isEmpty(l)){var d=o(l[0],n,!0);if(d)return d}return null},e.tryPositionPoint=function(e,t,i,a,r){var o=s.getLabelRect(i.labelSize,i.parentShape,t,a);return e.hasConflict(o)?r?e.tryPositionInViewport(o):null:o},e.defaultOffsetIterationDelta=2,e.defaultHorizontalPadding=2,e.defaultVerticalPadding=2,e}();e.LabelLayout=o;var n;!function(e){function i(t,i,a){var r=t.parentShape;if(null!=r)switch(i){case 1:switch(r.orientation){case 1:case 2:return e.middleVertical(t.labelSize,r.rect,a);case 3:case 4:return e.middleHorizontal(t.labelSize,r.rect,a);case 0:}case 2:switch(r.orientation){case 1:return e.bottomInside(t.labelSize,r.rect,a);case 2:return e.topInside(t.labelSize,r.rect,a);case 3:return e.leftInside(t.labelSize,r.rect,a);case 4:return e.rightInside(t.labelSize,r.rect,a);case 0:}case 4:switch(r.orientation){case 1:return e.topInside(t.labelSize,r.rect,a);case 2:return e.bottomInside(t.labelSize,r.rect,a);case 3:return e.rightInside(t.labelSize,r.rect,a);case 4:return e.leftInside(t.labelSize,r.rect,a);case 0:}case 8:switch(r.orientation){case 1:return e.bottomOutside(t.labelSize,r.rect,a);case 2:return e.topOutside(t.labelSize,r.rect,a);case 3:return e.leftOutside(t.labelSize,r.rect,a);case 4:return e.rightOutside(t.labelSize,r.rect,a);case 0:}case 16:switch(r.orientation){case 1:return e.topOutside(t.labelSize,r.rect,a);case 2:return e.bottomOutside(t.labelSize,r.rect,a);case 3:return e.rightOutside(t.labelSize,r.rect,a);case 4:return e.leftOutside(t.labelSize,r.rect,a);case 0:}}return null}function a(e,t,i){return e.labelSize.width+2*t<e.parentShape.rect.width||e.labelSize.height+2*i<e.parentShape.rect.height}function r(e,i,a,r){var o=i.parentShape.rect,n=t.Rect.inflate(e,{left:a,right:a,top:r,bottom:r});return t.Rect.containsPoint(o,{x:n.left,y:n.top})&&t.Rect.containsPoint(o,{x:n.left+n.width,y:n.top+n.height})}function o(e,t,i){return{left:t.left+t.width/2-e.width/2,top:t.top+i,width:e.width,height:e.height}}function n(e,t,i){return{left:t.left+t.width/2-e.width/2,top:t.top+t.height-i-e.height,width:e.width,height:e.height}}function s(e,t,i){return{left:t.left+t.width-e.width-i,top:t.top+t.height/2-e.height/2,width:e.width,height:e.height}}function l(e,t,i){return{left:t.left+i,top:t.top+t.height/2-e.height/2,width:e.width,height:e.height}}function c(e,t,i){return{left:t.left+t.width/2-e.width/2,top:t.top-e.height-i,width:e.width,height:e.height}}function u(e,t,i){return{left:t.left+t.width/2-e.width/2,top:t.top+t.height+i,width:e.width,height:e.height}}function h(e,t,i){return{left:t.left+t.width+i,top:t.top+t.height/2-e.height/2,width:e.width,height:e.height}}function d(e,t,i){return{left:t.left-e.width-i,top:t.top+t.height/2-e.height/2,width:e.width,height:e.height}}function p(e,t,i){return{left:t.left+t.width/2-e.width/2+i,top:t.top+t.height/2-e.height/2,width:e.width,height:e.height}}function g(e,t,i){return{left:t.left+t.width/2-e.width/2,top:t.top+t.height/2-e.height/2+i,width:e.width,height:e.height}}e.getLabelRect=i,e.canFitWithinParent=a,e.isLabelWithinParent=r,e.topInside=o,e.bottomInside=n,e.rightInside=s,e.leftInside=l,e.topOutside=c,e.bottomOutside=u,e.rightOutside=h,e.leftOutside=d,e.middleHorizontal=p,e.middleVertical=g}(n=e.DataLabelRectPositioner||(e.DataLabelRectPositioner={}));var s;!function(e){function t(t,i,a,r){switch(a){case 1:return e.above(t,i.point,i.radius+r);case 2:return e.below(t,i.point,i.radius+r);case 4:return e.left(t,i.point,i.radius+r);case 8:return e.right(t,i.point,i.radius+r);case 32:return e.belowLeft(t,i.point,i.radius+r);case 16:return e.belowRight(t,i.point,i.radius+r);case 128:return e.aboveLeft(t,i.point,i.radius+r);case 64:return e.aboveRight(t,i.point,i.radius+r);case 256:return e.center(t,i.point)}return null}function i(e,t,i){return{left:t.x-e.width/2,top:t.y-i-e.height,width:e.width,height:e.height}}function a(e,t,i){return{left:t.x-e.width/2,top:t.y+i,width:e.width,height:e.height}}function r(e,t,i){return{left:t.x-i-e.width,top:t.y-e.height/2,width:e.width,height:e.height}}function o(e,t,i){return{left:t.x+i,top:t.y-e.height/2,width:e.width,height:e.height}}function n(t,i,a){return{left:i.x-e.sin45*a-t.width,top:i.y+e.cos45*a,width:t.width,height:t.height}}function s(t,i,a){return{left:i.x+e.sin45*a,top:i.y+e.cos45*a,width:t.width,height:t.height}}function l(t,i,a){return{left:i.x-e.sin45*a-t.width,top:i.y-e.cos45*a-t.height,width:t.width,height:t.height}}function c(t,i,a){return{left:i.x+e.sin45*a,top:i.y-e.cos45*a-t.height,width:t.width,height:t.height}}function u(e,t){return{left:t.x-e.width/2,top:t.y-e.height/2,width:e.width,height:e.height}}function h(e,t,i){var a=e.left,r=e.top;switch(t){case 1:a+=e.width/2,r+=e.height;break;case 2:a+=e.width/2;break;case 4:a+=e.width,r+=2*e.height/3;break;case 8:r+=2*e.height/3;break;case 32:a+=e.width,r+=e.height/2;break;case 16:r+=e.height/2;break;case 128:a+=e.width,r+=e.height;break;case 64:r+=e.height}return[[i.point.x,i.point.y],[a,r]]}e.cos45=Math.cos(45),e.sin45=Math.sin(45),e.getLabelRect=t,e.above=i,e.below=a,e.left=r,e.right=o,e.belowLeft=n,e.belowRight=s,e.aboveLeft=l,e.aboveRight=c,e.center=u,e.getLabelLeaderLineEndingPoint=h}(s=e.DataLabelPointPositioner||(e.DataLabelPointPositioner={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t=e.visuals.NewDataLabelUtils,i=e.visuals.labelStyle,a=e.visuals.DonutLabelUtils,r=function(){function r(i,a){this.startingOffset=i.startingOffset,this.maximumOffset=i.maximumOffset,null!=i.offsetIterationDelta&&(this.offsetIterationDelta=i.offsetIterationDelta),this.donutChartProperties=a,this.center={x:a.viewport.width/2,y:a.viewport.height/2},this.outerRadius=this.donutChartProperties.radius*this.donutChartProperties.outerArcRadiusRatio,this.innerRadius=this.donutChartProperties.radius/2*this.donutChartProperties.innerArcRadiusRatio,this.additionalCharsWidth=e.TextMeasurementService.measureSvgTextWidth({text:" ()",fontFamily:t.LabelTextProperties.fontFamily,fontSize:jsCommon.PixelConverter.fromPoint(a.dataLabelsSettings.fontSize),fontWeight:t.LabelTextProperties.fontWeight})}return r.prototype.layout=function(t){for(var i=0,a=t;i<a.length;i++){var r=a[i];r.hasBeenRendered=!1,r.labelSize=r.textSize}for(var o=[],n=[],s=this.donutChartProperties.viewport,l={labelDataPoints:t,maxNumberOfLabels:t.length},c=new e.LabelArrangeGrid([l],s),u=t.length-1;u>=0;u--){var h=t[u];if(h.isPreferred){var d=t.splice(u,1);n=d.concat(n)}}if(n.length>0&&(o=this.positionLabels(n,c)),t.length>0){var p=this.positionLabels(t,c);o=o.concat(p)}return o},r.prototype.positionLabels=function(e,t){for(var i=[],a=this.offsetIterationDelta,r=this.startingOffset,o=0;r<=this.maximumOffset;){for(var n=0,s=e;n<s.length;n++){var l=s[n];if(!l.hasBeenRendered){var c=this.tryPositionForDonut(l,t,r);c&&i.push(c)}}r+=a,o+=a}return i},r.prototype.tryPositionForDonut=function(e,t,a){var r=e.parentShape;if(!_.isEmpty(r.validPositions)&&0!==r.validPositions[0]){var o=r.validPositions[0],n=this.tryAllPositions(e,t,o,a);if(n&&0===n.score)return this.buildLabel(n,t);if(this.donutChartProperties.dataLabelsSettings.labelStyle===i.both){var s=this.splitDonutDataPoint(e),l=this.tryAllPositions(s,t,o,a);if(l&&(!n||l.score<n.score))return this.buildLabel(l,t)}return n?this.buildLabel(n,t):void 0}},r.prototype.generateCandidate=function(e,t,i,o){var n=this.generateCandidateAngleForPosition(e.donutArcDescriptor,t),s=this.getPointPositionForAngle(n),l=s.point,c=this.score(e,l),u=a.getLabelLeaderLineForDonutChart(e.donutArcDescriptor,this.donutChartProperties,l,n),h=a.getLabelLeaderLinesSizeForDonutChart(u),d=_.clone(e);d.angle=n,d.parentShape=s,d.leaderLinePoints=u,d.linesSize=h;var p=r.tryPositionPoint(i,s.validPositions[0],d,o,this.center,this.donutChartProperties.viewport);return{angle:n,point:s,score:c,labelRects:p,labelDataPoint:d}},r.prototype.tryAllPositions=function(e,t,i,a){var o=r.tryPositionPoint(t,i,e,a,this.center,this.donutChartProperties.viewport),n=e.parentShape,s={point:n,angle:e.angle,score:this.score(e,n.point),labelRects:o,labelDataPoint:e};if(o&&o.textRect&&0===s.score)return s;var l,c=[];o&&o.textRect?(c=this.getLabelPointPositions(e,!0),l=s):c=this.getLabelPointPositions(e,!1);for(var u=0,h=c;u<h.length;u++){var d=h[u],p=this.generateCandidate(e,d,t,a);if(p.labelRects&&p.labelRects.textRect&&(null==l||p.score<l.score)&&(l=p,0===l.score))return l}return l},r.prototype.buildLabel=function(t,r){var o=t.labelRects.textRect,n=t.labelDataPoint;r.add(o),r.add(t.labelRects.horizontalLineRect),r.add(t.labelRects.diagonalLineRect),n.hasBeenRendered=!0;var s=o.left-this.center.x;0>s?s+=o.width/2:s-=o.width/2;var l,c,u,h=8===n.parentShape.validPositions[0]?"start":"end",d={left:s,top:o.top-this.center.y,height:o.height,width:o.width},p=this.donutChartProperties.dataLabelsSettings.labelStyle,g=a.getSpaceAvailableForDonutLabels(n.parentShape.point.x,this.donutChartProperties.viewport),m=e.visuals.dataLabelUtils.getLabelFormattedText,f=n.fontSize,y=p===i.both&&null==n.secondRowText;switch(y&&(n.dataLabel=" ("+n.dataLabel+")",g/=2),p!==i.both&&p!==i.data||(l=m({label:n.dataLabel,maxWidth:g,fontSize:f})),p!==i.both&&p!==i.category||(c=m({label:n.categoryLabel,maxWidth:g,fontSize:f})),p){case i.both:null==n.secondRowText?u=c+l:(u=l,n.secondRowText=c);break;case i.data:u=l;break;case i.category:u=c}return n.textSize.width=Math.min(n.textSize.width,y?2*g:g),{boundingBox:d,text:u,tooltip:n.tooltip,isVisible:!0,fill:n.outsideFill,identity:n.identity,fontSize:f,selected:!1,textAnchor:h,leaderLinePoints:n.leaderLinePoints,hasBackground:!1,secondRowText:n.secondRowText}},r.tryPositionPoint=function(t,i,r,o,n,s){var l=r.parentShape,c=_.clone(r.textSize);c.width=Math.min(c.width,a.getSpaceAvailableForDonutLabels(l.point.x,s));var u=e.DataLabelPointPositioner.getLabelRect(c,l,i,o),h={point:{x:r.leaderLinePoints[0][0],y:r.leaderLinePoints[0][1]<0?r.leaderLinePoints[1][1]:r.leaderLinePoints[0][1]},radius:0,validPositions:null},d=e.DataLabelPointPositioner.getLabelRect(r.linesSize[a.DiagonalLineIndex],h,i,o),p={point:{x:r.leaderLinePoints[1][0],y:r.leaderLinePoints[1][1]},radius:0,validPositions:null},g=e.DataLabelPointPositioner.getLabelRect(r.linesSize[a.HorizontalLineIndex],p,i,o);if(u&&d&&g){u.left+=n.x,u.top+=n.y;var m=n.x-u.width/2;return d.left+=m,d.top+=n.y,g.left+=m,g.top+=n.y,t.hasConflict(u)||t.hasConflict(d)||t.hasConflict(g)?void 0:{textRect:u,diagonalLineRect:d,horizontalLineRect:g}}},r.prototype.getLabelPointPositions=function(e,t){var i=e.parentShape,a=i.validPositions[0];return t?i.point.y<0?8===a?[64]:[128]:8===a?[16]:[32]:4===a?[128,32]:[16,64]},r.prototype.splitDonutDataPoint=function(e){var t={width:Math.max(e.categoryLabelSize.width,e.dataLabelSize.width),height:2*e.dataLabelSize.height},i=_.clone(e);return i.textSize=t,i.secondRowText=e.categoryLabel,i},r.prototype.generateCandidateAngleForPosition=function(e,t){var i=e.startAngle+(e.endAngle-e.startAngle)/2;switch(t){case 64:case 32:return(e.startAngle+i-Math.PI)/2;case 128:case 16:return(i+e.endAngle-Math.PI)/2}},r.prototype.getPointPositionForAngle=function(e){var t=a.getXPositionForDonutLabel(Math.cos(e)*this.outerRadius),i=Math.sin(e)*this.outerRadius,r=0>t?4:8,o={point:{x:t,y:i},validPositions:[r],radius:0};return o},r.prototype.score=function(e,t){var r,o=a.getSpaceAvailableForDonutLabels(t.x,this.donutChartProperties.viewport);return this.donutChartProperties.dataLabelsSettings.labelStyle===i.both&&null==e.secondRowText?(r=Math.max(e.categoryLabelSize.width,e.dataLabelSize.width+this.additionalCharsWidth),o/=2):r=e.textSize.width,Math.max(r-o,0)},r}();e.DonutLabelLayout=r}(powerbi||(powerbi={}));var powerbi;!function(e){var t=e.visuals.NewDataLabelUtils,i=5,a=10,r=60,o=5,n=function(){function n(){}return n.prototype.layout=function(i,a,r,o){if(o||void 0===this.labels){for(var n={labelDataPoints:i,maxNumberOfLabels:i.length},l=0,c=i;l<c.length;l++){var u=c[l];u.labelSize={width:u.textSize.width+2*t.horizontalLabelBackgroundPadding,height:u.textSize.height+2*t.verticalLabelBackgroundPadding}}for(var h=new e.LabelArrangeGrid([n],a),d=[],p=[],g=0,m=i;g<m.length;g++){var u=m[g],f=u.parentShape.polygon;p.push(f),f.pixelBoundingRect=r.applyToRect(f.absoluteBoundingRect())}for(var y=new s(p,a),v=0,b=i;v<b.length;v++){var u=b[v],C=this.getLabelByPolygonPositions(u,r,h,y);null!=C&&d.push(C)}this.labels=d}else this.updateLabelOffsets(r);return this.labels},n.prototype.getLabelPolygon=function(e,t,i,a){var r={width:e.textSize.width,height:e.textSize.height};return this.getLabelBoundingBox(r,t,i,a)},n.prototype.getLabelBoundingBox=function(t,i,a,r){switch(i){case 1:return e.DataLabelPointPositioner.above(t,a,r);case 2:return e.DataLabelPointPositioner.below(t,a,r);case 4:return e.DataLabelPointPositioner.left(t,a,r);case 8:return e.DataLabelPointPositioner.right(t,a,r);case 128:return e.DataLabelPointPositioner.aboveLeft(t,a,r);case 64:return e.DataLabelPointPositioner.aboveRight(t,a,r);case 32:return e.DataLabelPointPositioner.belowLeft(t,a,r);case 16:return e.DataLabelPointPositioner.belowRight(t,a,r);case 256:return e.DataLabelPointPositioner.center(t,a)}return null},n.prototype.getLabelByPolygonPositions=function(e,t,o,n){for(var s=0,l=t.getInverse(),c=0;2>c;c++){1===c&&(s=i);for(var u=0,h=e.parentShape.validPositions;u<h.length;u++){var d=h[u],p=this.tryPositionForPolygonPosition(d,e,t,s,l);if((256!==d||0===c)&&p){var g=t.applyToRect(p),m={text:e.text,secondRowText:e.secondRowText,boundingBox:g,isVisible:!0,fill:e.insideFill,identity:null,selected:!1,hasBackground:!0,textAnchor:"middle",originalPixelOffset:s,isPlacedInsidePolygon:!0,absoluteBoundingBoxCenter:{x:p.left+p.width/2,y:p.top+p.height/2}};return m}}}for(var f=6;r>=f;){for(var y=0,v=e.parentShape.validPositions;y<v.length;y++){var d=v[y];if(256!==d){var b=e.parentShape.polygon,C=t.applyToPoint(b.absoluteCentroid()),S=this.tryPlaceLabelOutsidePolygon(o,d,e,f,C,n,l);if(S){var g=t.applyToRect(S),m={text:e.text,secondRowText:e.secondRowText,boundingBox:g,isVisible:!0,fill:e.insideFill,identity:null,selected:!1,hasBackground:!0,isPlacedInsidePolygon:!1,textAnchor:"middle",originalPixelOffset:f,originalPosition:d,originalAbsoluteCentroid:b.absoluteCentroid(),absoluteBoundingBoxCenter:{x:S.left+S.width/2,y:S.top+S.height/2}},x=this.calculateStemSource(t,l,b,g,d,C);return m.leaderLinePoints=this.setLeaderLinePoints(x,this.calculateStemDestination(g,d)),m.absoluteStemSource=l.applyToPoint(x),o.add(g),m}}}f+=a}return null},n.prototype.setLeaderLinePoints=function(e,t){return[[e.x,e.y],[t.x,t.y]]},n.prototype.calculateStemSource=function(t,i,a,r,n,s){var l=a.lineIntersectionPoint(a.absoluteCentroid(),i.applyToPoint({x:r.left+r.width/2,y:r.top+r.height/2}));if(null==l)return s;var c=t.applyToPoint(l);switch(n){case 1:c.y+=o;break;case 2:c.y-=o;break;case 4:c.x+=o;break;case 8:c.x-=o;break;case 128:c.x+=o/e.DataLabelPointPositioner.cos45,c.y+=o/e.DataLabelPointPositioner.sin45;break;case 64:c.x-=o/e.DataLabelPointPositioner.cos45,c.y+=o/e.DataLabelPointPositioner.sin45;break;case 32:c.x+=o/e.DataLabelPointPositioner.cos45,c.y-=o/e.DataLabelPointPositioner.sin45;break;case 16:c.x-=o/e.DataLabelPointPositioner.cos45,c.y-=o/e.DataLabelPointPositioner.sin45;break;case 256:}return c},n.prototype.calculateStemDestination=function(e,t){var i,a;switch(t){case 1:i=e.left+e.width/2,a=e.top+e.height;break;case 2:i=e.left+e.width/2,a=e.top;break;case 4:i=e.left+e.width,a=e.top+e.height/2;break;case 8:i=e.left,a=e.top+e.height/2;break;case 128:i=e.left+e.width,a=e.top+e.height;break;case 64:i=e.left,a=e.top+e.height;break;case 32:i=e.left+e.width,a=e.top;break;case 16:i=e.left,a=e.top;break;case 256:}return{x:i,y:a}},n.prototype.tryPositionForPolygonPosition=function(e,t,i,a,r){var o=t.parentShape.polygon,n=i.applyToPoint(o.absoluteCentroid()),s=this.getLabelPolygon(t,e,n,a),l=this.getAbsoluteRectangle(r,s);return o.contains(l)?l:null},n.prototype.tryPlaceLabelOutsidePolygon=function(e,t,i,a,r,o,n){var s=a,l=this.getLabelPolygon(i,t,r,s),c=e.hasConflict(l);if(!c){var u=this.getAbsoluteRectangle(n,l);if(!o.hasConflict(u,l))return u}return null},n.prototype.updateLabelOffsets=function(e){for(var t=0,i=this.labels;t<i.length;t++){var a=i[t];if(a.isVisible)if(a.isPlacedInsidePolygon){var r=e.applyToPoint(a.absoluteBoundingBoxCenter),o=a.boundingBox.left+a.boundingBox.width/2-r.x,n=a.boundingBox.top+a.boundingBox.height/2-r.y;a.boundingBox.top-=n,a.boundingBox.left-=o}else{var s=e.applyToPoint(a.absoluteStemSource),l=e.applyToPoint(a.originalAbsoluteCentroid);a.boundingBox=this.getLabelBoundingBox({width:a.boundingBox.width,height:a.boundingBox.height},a.originalPosition,l,a.originalPixelOffset),void 0!==a.leaderLinePoints&&(a.leaderLinePoints=this.setLeaderLinePoints(s,this.calculateStemDestination(a.boundingBox,a.originalPosition)))}}},n.prototype.getAbsoluteRectangle=function(e,t){return e.applyToRect(t)},n}();e.FilledMapLabelLayout=n;var s=function(){function e(t,i){this.viewport=i;for(var a=0,r=0,o=0,n=t;o<n.length;o++){var s=n[o],l=s.pixelBoundingRect;l.width>a&&(a=l.width),l.height>r&&(r=l.height)}0===a&&(a=i.width),0===r&&(r=i.height);var c=this.cellSize={width:a*e.cellSizeMultiplier,height:r*e.cellSizeMultiplier};this.columnCount=e.getCellCount(c.width,i.width,1,100),this.rowCount=e.getCellCount(c.height,i.height,1,100);for(var u=[],h=0,d=this.columnCount;d>h;h++){u[h]=[];for(var p=0,g=this.rowCount;g>p;p++)u[h][p]=[]}this.grid=u;for(var m=0,f=t;m<f.length;m++){var s=f[m];this.add(s)}}return e.prototype.hasConflict=function(e,t){for(var i=this.getContainingGridSubsection(t),a=this.grid,r=i.xMin;r<i.xMax;r++)for(var o=i.yMin;o<i.yMax;o++)for(var n=0,s=a[r][o];n<s.length;n++){var l=s[n];if(l.conflicts(e))return!0}return!1},e.prototype.add=function(e){for(var t=this.getContainingGridSubsection(e.pixelBoundingRect),i=t.xMin;i<t.xMax;i++)for(var a=t.yMin;a<t.yMax;a++)this.grid[i][a].push(e)},e.prototype.getContainingGridSubsection=function(t){return{xMin:e.bound(Math.floor(t.left/this.cellSize.width),0,this.columnCount),xMax:e.bound(Math.ceil((t.left+t.width)/this.cellSize.width),0,this.columnCount),yMin:e.bound(Math.floor(t.top/this.cellSize.height),0,this.rowCount),yMax:e.bound(Math.ceil((t.top+t.height)/this.cellSize.height),0,this.rowCount)}},e.getCellCount=function(t,i,a,r){return e.bound(Math.ceil(i/t),a,r)},e.bound=function(e,t,i){return Math.max(Math.min(e,i),t)},e.cellSizeMultiplier=2,e}();e.LabelPolygonArrangeGrid=s}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){function t(){return new i}e.createColorAllocatorFactory=t;var i=function(){function e(){}return e.prototype.linearGradient2=function(e){return new a(e)},e.prototype.linearGradient3=function(e,t){return t?new o(e):new r(e)},e}(),a=function(){function e(e){this.options=e;var t=e.min,i=e.max;this.scale=d3.scale.linear().domain([t.value,i.value]).range([t.color,i.color]).clamp(!0)}return e.prototype.color=function(e){var t=this.options.min,i=this.options.max;return t.value===i.value?e>=i.value?i.color:t.color:this.scale(e)},e}(),r=function(){function e(e){this.options=e;var t=e.min,i=e.mid,a=e.max;this.scale=d3.scale.linear().domain([t.value,i.value,a.value]).range([t.color,i.color,a.color]).clamp(!0)}return e.prototype.color=function(e){var t=this.options.min,i=this.options.mid,a=this.options.max;return a.value===i.value||i.value===t.value||a.value===i.value&&a.value===t.value?e>=a.value?a.color:e>=i.value?i.color:t.color:this.scale(e)},e}(),o=function(){function e(e){this.options=e;var t=e.min,i=e.mid,a=e.max;this.scale1=d3.scale.linear().domain([t.value,i.value]).range([t.color,i.color]).clamp(!0),this.scale2=d3.scale.linear().domain([i.value,a.value]).range([i.color,a.color]).clamp(!0)}return e.prototype.color=function(e){var t=this.options.min,i=this.options.mid,a=this.options.max;return a.value===i.value||i.value===t.value||a.value===i.value&&a.value===t.value?e>=a.value?a.color:e>=i.value?i.color:t.color:e<=i.value?this.scale1(e):this.scale2(e)},e}()}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i={"0.00 %;-0.00 %;0.00 %":"Percentage","0.0 %;-0.0 %;0.0 %":"Percentage1"},a={NullValue:"(Blank)",BooleanTrue:"True",BooleanFalse:"False",NaNValue:"NaN",InfinityValue:"+Infinity",NegativeInfinityValue:"-Infinity",Restatement_Comma:"{0}, {1}",Restatement_CompoundAnd:"{0} and {1}",DisplayUnitSystem_EAuto_Title:"Auto",DisplayUnitSystem_E0_Title:"None",DisplayUnitSystem_E3_LabelFormat:"{0}K",DisplayUnitSystem_E3_Title:"Thousands",DisplayUnitSystem_E6_LabelFormat:"{0}M",DisplayUnitSystem_E6_Title:"Millions",DisplayUnitSystem_E9_LabelFormat:"{0}bn",DisplayUnitSystem_E9_Title:"Billions",DisplayUnitSystem_E12_LabelFormat:"{0}T",DisplayUnitSystem_E12_Title:"Trillions",Percentage:"#,0.##%",Percentage1:"#,0.#%",RichTextbox_Link_DefaultText:"Link",TableTotalLabel:"Total",Tooltip_HighlightedValueDisplayName:"Highlighted",Funnel_PercentOfFirst:"Percent of first",Funnel_PercentOfPrevious:"Percent of previous",Funnel_PercentOfFirst_Highlight:"Percent of first (highlighted)",Funnel_PercentOfPrevious_Highlight:"Percent of previous (highlighted)",GeotaggingString_Continent:"continent",GeotaggingString_Continents:"continents",GeotaggingString_Country:"country",GeotaggingString_Countries:"countries",GeotaggingString_State:"state",GeotaggingString_States:"states",GeotaggingString_City:"city",GeotaggingString_Cities:"cities",GeotaggingString_Town:"town",GeotaggingString_Towns:"towns",GeotaggingString_Province:"province",GeotaggingString_Provinces:"provinces",GeotaggingString_County:"county",GeotaggingString_Counties:"counties",GeotaggingString_Village:"village",GeotaggingString_Villages:"villages",GeotaggingString_Post:"post",GeotaggingString_Zip:"zip",GeotaggingString_Code:"code",GeotaggingString_Place:"place",GeotaggingString_Places:"places",GeotaggingString_Address:"address",GeotaggingString_Addresses:"addresses",GeotaggingString_Street:"street",GeotaggingString_Streets:"streets",GeotaggingString_Longitude:"longitude",GeotaggingString_Longitude_Short:"lon",GeotaggingString_Latitude:"latitude",GeotaggingString_Latitude_Short:"lat",GeotaggingString_PostalCode:"postal code",GeotaggingString_PostalCodes:"postal codes",GeotaggingString_ZipCode:"zip code",GeotaggingString_ZipCodes:"zip codes",GeotaggingString_Territory:"territory",GeotaggingString_Territories:"territories",Waterfall_IncreaseLabel:"Increase",Waterfall_DecreaseLabel:"Decrease",Waterfall_TotalLabel:"Total",Slicer_SelectAll:"Select All"},r=function(){function r(){}return r.initialize=function(){t.valueFormatter.setLocaleOptions(r.createLocaleOptions()),t.TooltipManager.setLocalizedStrings(r.createTooltipLocaleOptions())},r.createLocaleOptions=function(){return{"null":a.NullValue,"true":a.BooleanTrue,"false":a.BooleanFalse,NaN:a.NaNValue,infinity:a.InfinityValue,negativeInfinity:a.NegativeInfinityValue,beautify:function(e){return r.beautify(e)},describe:function(e){return r.describeUnit(e)},restatementComma:a.Restatement_Comma,restatementCompoundAnd:a.Restatement_CompoundAnd,restatementCompoundOr:a.Restatement_CompoundOr}},r.createTooltipLocaleOptions=function(){return{highlightedValueDisplayName:a.Tooltip_HighlightedValueDisplayName}},r.prototype.getLocalizedString=function(e){return a[e]},r.prototype.onDragStart=function(){},r.prototype.canSelect=function(){return!1},r.prototype.onSelect=function(){},r.prototype.onContextMenu=function(){},r.prototype.loadMoreData=function(){},r.prototype.persistProperties=function(e){},r.prototype.onCustomSort=function(e){},r.prototype.getViewMode=function(){return 0},r.prototype.setWarnings=function(e){},r.prototype.setToolbar=function(e){},r.prototype.shouldRetainSelection=function(){return!1},r.prototype.geocoder=function(){return t.services.createGeocoder()},r.prototype.geolocation=function(){return t.services.createGeolocation()},r.prototype.promiseFactory=function(){return e.createJQueryPromiseFactory()},r.prototype.analyzeFilter=function(e){return{isNotFilter:!1,selectedIdentities:[],filter:void 0,defaultValue:void 0}},r.prototype.getIdentityDisplayNames=function(e){},r.prototype.setIdentityDisplayNames=function(e){},r.beautify=function(e){var t=i[e];return t?a[t]||e:e},r.describeUnit=function(e){var t=-1===e?"Auto":e.toString(),i=a["DisplayUnitSystem_E"+t+"_Title"],r=0>=e?"{0}":a["DisplayUnitSystem_E"+t+"_LabelFormat"];return i||r?{title:i,format:r}:void 0},r}();t.DefaultVisualHostServices=r,t.defaultVisualHostServices=new r}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){function i(e){return new s(e)}function a(e){return e.append("rect").classed("clearCatcher",!0).attr({width:"100%",height:"100%"})}function r(t,i,a){return null!=i.objects&&i.objects[a]&&e.DataViewObjects.getValue(i.objects[a],t)}function o(e){for(var t=0,i=e.length;i>t;t++)if(e[t].selected)return!0;return!1}var n=jsCommon.ArrayExtensions;t.createInteractivityService=i,t.appendClearCatcher=a,t.isCategoryColumnSelected=r,t.dataHasSelection=o;var s=function(){function t(e){this.renderSelectionInVisual=_.noop,this.renderSelectionInLegend=_.noop,this.renderSelectionInLabels=_.noop,this.selectedIds=[],this.isInvertedSelectionMode=!1,this.hostService=e}return t.prototype.bind=function(e,t,i,a){var r=this;a&&a.overrideSelectionFromData&&this.takeSelectionStateFromDataPoints(e),a?(a.isLegend?(this.selectableLegendDataPoints=e,this.renderSelectionInLegend=function(){return t.renderSelection(r.legendHasSelection())}):a.isLabels?(this.selectableLabelsDataPoints=e,this.renderSelectionInLabels=function(){return t.renderSelection(r.labelsHasSelection())}):(this.selectableDataPoints=e,this.renderSelectionInVisual=function(){return t.renderSelection(r.hasSelection())}),null!=a.hasSelectionOverride&&(this.hasSelectionOverride=a.hasSelectionOverride),a.slicerDefaultValueHandler&&(this.slicerDefaultValueHandler=a.slicerDefaultValueHandler)):(this.selectableDataPoints=e,this.renderSelectionInVisual=function(){return t.renderSelection(r.hasSelection())}),this.behavior=t,t.bindEvents(i,this),this.syncSelectionState()},t.prototype.clearSelection=function(){return this.slicerDefaultValueHandler&&this.slicerDefaultValueHandler.getDefaultValue()&&this.useDefaultValue?void(this.isInvertedSelectionMode=!1):(this.hasSelectionOverride=void 0,n.clear(this.selectedIds),this.isInvertedSelectionMode=!1,this.applyToAllSelectableDataPoints(function(e){return e.selected=!1}),void this.renderAll())},t.prototype.applySelectionStateToData=function(e){for(var i=0,a=e;i<a.length;i++){var r=a[i];r.selected=t.checkDatapointAgainstSelectedIds(r,this.selectedIds)}return this.hasSelection();
11},t.prototype.hasSelection=function(){return this.selectedIds.length>0},t.prototype.legendHasSelection=function(){return this.selectableLegendDataPoints?o(this.selectableLegendDataPoints):!1},t.prototype.labelsHasSelection=function(){return this.selectableLabelsDataPoints?o(this.selectableLabelsDataPoints):!1},t.prototype.isSelectionModeInverted=function(){return this.isInvertedSelectionMode},t.prototype.setSelectionModeInverted=function(e){this.isInvertedSelectionMode=e},t.prototype.handleSelection=function(e,t){e&&(this.useDefaultValue=!1,this.select(e,t),this.sendSelectionToHost(),this.renderAll())},t.prototype.handleContextMenu=function(e,t){this.sendContextMenuToHost(e,t)},t.prototype.handleClearSelection=function(){this.useDefaultValue=!0,this.clearSelection(),this.sendSelectionToHost()},t.prototype.toggleSelectionModeInversion=function(){return this.useDefaultValue=!1,this.isInvertedSelectionMode=!this.isInvertedSelectionMode,n.clear(this.selectedIds),this.applyToAllSelectableDataPoints(function(e){return e.selected=!1}),this.sendSelectionToHost(),this.isInvertedSelectionMode?this.syncSelectionStateInverted():this.syncSelectionState(),this.renderAll(),this.isInvertedSelectionMode},t.prototype.persistSelectionFilter=function(e){this.hostService.persistProperties(this.createChangeForFilterProperty(e))},t.prototype.setDefaultValueMode=function(e){this.useDefaultValue=e},t.prototype.isDefaultValueEnabled=function(){return this.useDefaultValue},t.prototype.renderAll=function(){this.renderSelectionInVisual(),this.renderSelectionInLegend(),this.renderSelectionInLabels()},t.prototype.select=function(e,t){if(this.isInvertedSelectionMode)return this.selectInverted(e,t);e.identity.highlight&&(e=_.find(this.selectableDataPoints,function(t){return!t.identity.highlight&&e.identity.includes(t.identity,!0)}));var i=e.identity;if(i){var a=!e.selected||!t&&this.selectedIds.length>1;t&&(a?(e.selected=!0,this.selectedIds.push(i),i.hasIdentity()?this.removeSelectionIdsWithOnlyMeasures():this.removeSelectionIdsExceptOnlyMeasures()):(e.selected=!1,this.removeId(i))),t&&this.hostService.canSelect({data:this.selectedIds.map(function(e){return e.getSelector()})})||(this.clearSelection(),a&&(e.selected=!0,this.selectedIds.push(i))),this.syncSelectionState()}},t.prototype.selectInverted=function(e,t){var i=e.selected,a=e.identity;e.selected=!i,i?this.removeId(a):(this.selectedIds.push(a),a.hasIdentity()?this.removeSelectionIdsWithOnlyMeasures():this.removeSelectionIdsExceptOnlyMeasures()),this.syncSelectionStateInverted()},t.prototype.removeId=function(e){for(var t=this.selectedIds,i=t.length-1;i>-1;i--){var a=t[i];e.includes(a)&&t.splice(i,1)}},t.prototype.createChangeForFilterProperty=function(t){var i={},a=[];this.selectedIds.length>0&&(a=_.chain(this.selectedIds).filter(function(e){return e.hasIdentity()}).map(function(e){return e.getSelector()}).value());var r={objectName:t.objectName,selector:void 0,properties:i},o=e.data.Selector.filterFromSelector(a,this.isInvertedSelectionMode);return this.slicerDefaultValueHandler&&this.slicerDefaultValueHandler.getDefaultValue()&&(this.useDefaultValue===!0?o=e.data.SemanticFilter.getDefaultValueFilter(this.slicerDefaultValueHandler.getIdentityFields()):_.isEmpty(a)&&(o=e.data.SemanticFilter.getAnyValueFilter(this.slicerDefaultValueHandler.getIdentityFields()))),null==o?(i[t.propertyName]={},{remove:[r]}):(i[t.propertyName]=o,{merge:[r]})},t.prototype.sendContextMenuToHost=function(e,t){var i=this.hostService;if(i.onContextMenu){var a=this.getSelectorsByColumn([e.identity]);if(!_.isEmpty(a)){var r={data:a,position:t};i.onContextMenu(r)}}},t.prototype.sendSelectionToHost=function(){var e=this.hostService;if(e.onSelect){var t={data:this.selectedIds.filter(function(e){return e.hasIdentity()}).map(function(e){return e.getSelector()})},i=this.getSelectorsByColumn(this.selectedIds);_.isEmpty(i)||(t.data2=i),e.onSelect(t)}},t.prototype.getSelectorsByColumn=function(e){return _(e).filter(function(e){return e.hasIdentity}).map(function(e){return e.getSelectorsByColumn()}).compact().value()},t.prototype.takeSelectionStateFromDataPoints=function(e){var t=this.selectedIds;n.clear(t);for(var i=0,a=e;i<a.length;i++){var r=a[i];r.selected&&t.push(r.identity)}},t.prototype.syncSelectionState=function(){if(this.isInvertedSelectionMode)return this.syncSelectionStateInverted();var e=this.selectedIds,i=this.selectableDataPoints,a=this.selectableLegendDataPoints,r=this.selectableLabelsDataPoints,o=!1;if(i||a){if(i&&t.updateSelectableDataPointsBySelectedIds(i,e)&&(o=!0),a&&t.updateSelectableDataPointsBySelectedIds(a,e)&&(o=!0),r)for(var n,s=0,l=r.length;l>s;s++)n=r[s],e.some(function(e){return e.includes(n.identity)})?n.selected=!0:n.selected=!1;!o&&e.length>0&&(this.clearSelection(),this.sendSelectionToHost())}},t.prototype.syncSelectionStateInverted=function(){var e=this.selectedIds,t=this.selectableDataPoints;if(t)if(0===e.length)for(var i=0,a=t;i<a.length;i++){var r=a[i];r.selected=!1}else for(var o=0,n=t;o<n.length;o++){var s=n[o];e.some(function(e){return e.includes(s.identity)})?s.selected=!0:s.selected&&(s.selected=!1)}},t.prototype.applyToAllSelectableDataPoints=function(e){var t=this.selectableDataPoints,i=this.selectableLegendDataPoints,a=this.selectableLabelsDataPoints;if(t)for(var r=0,o=t;r<o.length;r++){var n=o[r];e(n)}if(i)for(var s=0,l=i;s<l.length;s++){var n=l[s];e(n)}if(a)for(var c=0,u=a;c<u.length;c++){var n=u[c];e(n)}},t.updateSelectableDataPointsBySelectedIds=function(e,i){for(var a=!1,r=0,o=e;r<o.length;r++){var n=o[r];n.selected=t.checkDatapointAgainstSelectedIds(n,i),n.selected&&(a=!0)}return a},t.checkDatapointAgainstSelectedIds=function(e,t){return t.some(function(t){return t.includes(e.identity)})},t.prototype.removeSelectionIdsWithOnlyMeasures=function(){this.selectedIds=_.filter(this.selectedIds,function(e){return e.hasIdentity()})},t.prototype.removeSelectionIdsExceptOnlyMeasures=function(){this.selectedIds=_.filter(this.selectedIds,function(e){return!e.hasIdentity()})},t}();t.InteractivityService=s}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(t){function i(){return{geocode:l,geocodeBoundary:c,geocodePoint:u,tryGeocodeImmediate:o,tryGeocodeBoundaryImmediate:n}}function a(e){return t.CategoryTypeArray.indexOf(e)>-1}function r(e){switch(e.toLowerCase()){case"fr":return"fr-FR";default:return e}}function o(e,t){var i=x?x.getCoordinates(new w(e,t).key):void 0;return i}function n(e,t,i,a,r){void 0===r&&(r=3);var o=x?x.getCoordinates(new D(e,t,i,a,r).key):void 0;return o}function s(e){var t=x?x.getCoordinates(e.key):void 0,i=$.Deferred();return t?i.resolve(t):(v.push({query:e,deferred:i}),h()),i}function l(e,t){return void 0===t&&(t=""),s(new w(e,t))}function c(e,t,i,a,r){return void 0===i&&(i=""),void 0===a&&(a=2),void 0===r&&(r=3),s(new D(e,t,i,a,r))}function u(e,t){return s(new P(e,t))}function h(e){for(void 0===e&&(e=0),b-=e;b<y.MaxBingRequest&&0!==v.length;)b++,d(v.shift())}function d(e){var i=x?x.getCoordinates(e.query.key):void 0;if(i)return setTimeout(function(){return h(1)}),void e.deferred.resolve(i);var a={type:"GET",dataType:"jsonp",jsonp:"jsonp"},r=e.query.getUrl();r||p(e,new Error("Unsupported query. "+e.query.query)),t.BingAjaxCall(r,a).then(function(t){try{if(e.query instanceof D){var i=t;if(i&&i.d&&Array.isArray(i.d.results)&&i.d.results.length>0){var a=i.d.results[0],r=a.Primitives;if(r&&r.length>0){var o={latitude:e.query.latitude,longitude:e.query.longitude,locations:[]};r.sort(function(e,t){return e.Shape.length<t.Shape.length?1:e.Shape.length>t.Shape.length?-1:0});for(var n=Math.min(r.length,e.query.maxGeoData),s=0;n>s;s++)for(var l=r[s].Shape,c=l.split(","),u=1;u<c.length;u++)o.locations.push({nativeBing:c[u]});p(e,null,o)}else p(e,new Error("Geocode result is empty."))}else p(e,new Error("Geocode result is empty."))}else if(e.query instanceof P){var h=t.resourceSets[0].resources;if(Array.isArray(h)&&h.length>0){var d=g(h,e.query),m=h[d].point.coordinates,f=h[d].address,o={latitude:parseFloat(m[0]),longitude:parseFloat(m[1]),addressLine:f.addressLine,locality:f.locality,neighborhood:f.neighborhood,adminDistrict:f.adminDistrict,adminDistrict2:f.adminDistrict2,formattedAddress:f.formattedAddress,postalCode:f.postalCode,countryRegionIso2:f.countryRegionIso2,countryRegion:f.countryRegion,landmark:f.landmark};p(e,null,o)}else p(e,new Error("Geocode result is empty."))}else{var h=t.resourceSets[0].resources;if(Array.isArray(h)&&h.length>0){var d=g(h,e.query),m=h[d].point.coordinates,o={latitude:parseFloat(m[0]),longitude:parseFloat(m[1])};p(e,null,o)}else p(e,new Error("Geocode result is empty."))}}catch(y){p(e,y)}},function(t){p(e,t)})}function p(e,t,i){void 0===i&&(i=null),L=setTimeout(function(){return h(1)},y.UseDoubleArrayGeodataResult?y.UseDoubleArrayDequeueTimeout:0),t?e.deferred.reject(t):(!x||e.query instanceof P||x.registerCoordinates(e.query.key,i),e.deferred.resolve(i))}function g(e,t){var i=t.query.toLowerCase();if(2===i.length&&t.category===f.CountryRegion)for(var a=0;a<e.length;a++){var r=e[a].address&&e[a].address.countryRegionIso2;if(r&&i===r.toLowerCase())return a}for(var o=t.getBingEntity().toLowerCase(),a=0;a<e.length;a++){var n=(e[a].entityType||"").toLowerCase();if(n===o)return a}return 0}function m(){v=[],b=0,C=null,clearTimeout(L)}var f=e.MapUtil.CategoryTypes,y=e.MapUtil.Settings;t.createGeocoder=i,t.safeCharacters="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-",t.BingAjaxCall=$.ajax,t.CategoryTypeArray=["Address","City","Continent","Country","County","Longitude","Latitude","Place","PostalCode","StateOrProvince"],t.isCategoryType=a,t.BingEntities={Continent:"Continent",Sovereign:"Sovereign",CountryRegion:"CountryRegion",AdminDivision1:"AdminDivision1",AdminDivision2:"AdminDivision2",PopulatedPlace:"PopulatedPlace",Postcode:"Postcode",Postcode1:"Postcode1",Neighborhood:"Neighborhood",Address:"Address"};var v,b,C,S,x,w=function(){function e(e,i){this.query=null!=e?e:"",this.category=null!=i?i:"",this.key=(this.query+"/"+this.category).toLowerCase(),x||(x=t.createGeocodingCache(y.MaxCacheSize,y.MaxCacheSizeOverflow))}return e.prototype.getBingEntity=function(){var e=this.category.toLowerCase();return C||(C={},C[f.Continent.toLowerCase()]=t.BingEntities.Continent,C[f.CountryRegion.toLowerCase()]=t.BingEntities.Sovereign,C[f.StateOrProvince.toLowerCase()]=t.BingEntities.AdminDivision1,C[f.County.toLowerCase()]=t.BingEntities.AdminDivision2,C[f.City.toLowerCase()]=t.BingEntities.PopulatedPlace,C[f.PostalCode.toLowerCase()]=t.BingEntities.Postcode,C[f.Address.toLowerCase()]=t.BingEntities.Address),C[e]||""},e.prototype.getUrl=function(){var e=y.BingUrl+"?key="+y.BingKey,i=this.getBingEntity(),a=!1;if(i)if(i===t.BingEntities.Postcode)e+="&includeEntityTypes=Postcode,Postcode1,Postcode2,Postcode3,Postcode4";else if(-1!==this.query.indexOf(",")||i!==t.BingEntities.AdminDivision1&&i!==t.BingEntities.AdminDivision2)e+="&includeEntityTypes="+i;else{a=!0;try{e+="&adminDistrict="+decodeURIComponent(this.query)}catch(o){return null}}if(!a)try{e+="&q="+decodeURIComponent(this.query)}catch(o){return null}var n=navigator.userLanguage||navigator.language;return n=r(n),n&&(e+="&c="+n),e+="&maxRes=20",2===this.query.length&&this.category===f.CountryRegion&&(e+="&include=ciso2"),e},e}();t.GeocodeQuery=w;var P=function(e){function i(t,i){e.call(this,[t,i].join(),"Point"),this.latitude=t,this.longitude=i}return __extends(i,e),i.prototype.getUrl=function(){var e=y.BingUrl+"/"+[this.latitude,this.longitude].join()+"?key="+y.BingKey+"&includeEntityTypes="+[t.BingEntities.Address,t.BingEntities.Neighborhood,t.BingEntities.PopulatedPlace,t.BingEntities.Postcode1,t.BingEntities.AdminDivision1,t.BingEntities.AdminDivision2,t.BingEntities.CountryRegion].join()+"&include=ciso2";return e},i}(w);t.GeocodePointQuery=P;var D=function(e){function i(t,i,a,r,o){void 0===o&&(o=3),e.call(this,[t,i,r,o].join(","),a),this.latitude=t,this.longitude=i,this.levelOfDetail=r,this.maxGeoData=o}return __extends(i,e),i.prototype.getBingEntity=function(){var e=this.category.toLowerCase();return S||(S={},S[f.CountryRegion.toLowerCase()]=t.BingEntities.CountryRegion,S[f.StateOrProvince.toLowerCase()]=t.BingEntities.AdminDivision1,S[f.County.toLowerCase()]=t.BingEntities.AdminDivision2,S[f.City.toLowerCase()]=t.BingEntities.PopulatedPlace,S[f.PostalCode.toLowerCase()]=t.BingEntities.Postcode1),S[e]||""},i.prototype.getUrl=function(){var e=y.BingUrlGeodata+"key="+y.BingKey+"&$format=json",t=this.getBingEntity();if(!t)return null;var i=navigator.userLanguage||navigator.language;i=r(i);var a=i.split("-"),o=[this.latitude,this.longitude,this.levelOfDetail,"'"+t+"'",1,0,"'"+i+"'"];return a.length>1&&o.push("'"+a[1]+"'"),e+"&SpatialFilter=GetBoundary("+o.join(", ")+")"},i}(w);t.GeocodeBoundaryQuery=D,t.geocodeCore=s,t.geocode=l,t.geocodeBoundary=c,t.geocodePoint=u;var L;t.reset=m,m()}(t=e.services||(e.services={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){function i(t,i,r){return r||(r=e.localStorageService),new a(t,i,r)}t.createGeocodingCache=i;var a=function(){function e(e,t,i){this.geocodeCache={},this.geocodeCacheCount=0,this.maxCacheSize=e,this.maxCacheSizeOverflow=t,this.localStorageService=i}return e.prototype.getCoordinates=function(e){var t=this.geocodeCache[e];return t?(++t.hitCount,t.coordinate):(t=this.localStorageService.getData(e),t?(this.registerInMemory(e,t.coordinate),t.coordinate):void 0)},e.prototype.registerCoordinates=function(e,t){this.registerInMemory(e,t),this.registerInStorage(e,t)},e.prototype.registerInMemory=function(e,t){var i=this.geocodeCache,a=this.maxCacheSize,r=a+this.maxCacheSizeOverflow;if(this.geocodeCacheCount>=r){var o=Object.keys(i),n=o.length;if(o.sort(function(e,t){var a=i[e],r=i[t],o=a?a.hitCount:0,n=r?r.hitCount:0;return n>o?1:o>n?-1:0}),2*r>n)for(var s=a;n>s;s++)i[o[s]]=void 0;else{for(var l={},s=0;a>s;++s)l[o[s]]=i[o[s]];i=this.geocodeCache=l}this.geocodeCacheCount=a}i[e]={key:e,coordinate:t,hitCount:1},++this.geocodeCacheCount},e.prototype.registerInStorage=function(e,t){this.localStorageService.setData(e,{coordinate:t})},e}()}(i=t.services||(t.services={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(){return new i}e.createGeolocation=t;var i=function(){function e(){this.webGeolocation=navigator.geolocation}return e.prototype.watchPosition=function(e,t){return this.webGeolocation.watchPosition(function(t){e(t)},function(e){null!=t&&t(e)})},e.prototype.clearWatch=function(e){this.webGeolocation.clearWatch(e)},e.prototype.getCurrentPosition=function(e,t){this.webGeolocation.getCurrentPosition(function(t){e(t)},function(e){null!=t&&t(e)})},e}()}(t=e.services||(e.services={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i,a=["play","subview","smallMultiple"];!function(i){function r(t,i,a,r){var o=e.Prototype.inherit(i);o.create=a,r&&r(o),t[i.name]=o}function o(i,a,o){var n=a.tooltipsEnabled,s=o&&o.lineChartLabelDensityEnabled;r(i,e.visuals.plugins.barChart,function(){return new t.CartesianChart({chartType:6,tooltipsEnabled:n})}),r(i,e.visuals.plugins.clusteredBarChart,function(){return new t.CartesianChart({chartType:5,tooltipsEnabled:n})}),r(i,e.visuals.plugins.clusteredColumnChart,function(){return new t.CartesianChart({chartType:3,tooltipsEnabled:n})}),r(i,e.visuals.plugins.columnChart,function(){return new t.CartesianChart({chartType:4,tooltipsEnabled:n})}),r(i,e.visuals.plugins.dataDotClusteredColumnComboChart,function(){return new t.CartesianChart({chartType:15,tooltipsEnabled:n})}),r(i,e.visuals.plugins.dataDotStackedColumnComboChart,function(){return new t.CartesianChart({chartType:16,tooltipsEnabled:n})}),r(i,e.visuals.plugins.donutChart,function(){return new t.DonutChart({tooltipsEnabled:n})}),r(i,e.visuals.plugins.funnel,function(){return new t.FunnelChart({tooltipsEnabled:n})}),r(i,e.visuals.plugins.gauge,function(){return new t.Gauge({tooltipsEnabled:n})}),r(i,e.visuals.plugins.hundredPercentStackedBarChart,function(){return new t.CartesianChart({chartType:7,tooltipsEnabled:n})}),r(i,e.visuals.plugins.hundredPercentStackedColumnChart,function(){return new t.CartesianChart({chartType:8,tooltipsEnabled:n})}),r(i,e.visuals.plugins.lineChart,function(){return new t.CartesianChart({chartType:0,tooltipsEnabled:n,lineChartLabelDensityEnabled:s})}),r(i,e.visuals.plugins.areaChart,function(){return new t.CartesianChart({chartType:1,tooltipsEnabled:n,lineChartLabelDensityEnabled:s})}),r(i,e.visuals.plugins.stackedAreaChart,function(){return new t.CartesianChart({chartType:2,tooltipsEnabled:n,lineChartLabelDensityEnabled:s})}),r(i,e.visuals.plugins.lineClusteredColumnComboChart,function(){return new t.CartesianChart({chartType:13,tooltipsEnabled:n})}),r(i,e.visuals.plugins.lineStackedColumnComboChart,function(){return new t.CartesianChart({chartType:14,tooltipsEnabled:n})}),r(i,e.visuals.plugins.pieChart,function(){return new t.DonutChart({sliceWidthRatio:0,tooltipsEnabled:n})}),r(i,e.visuals.plugins.scatterChart,function(){return new t.CartesianChart({chartType:9,tooltipsEnabled:n})}),r(i,e.visuals.plugins.treemap,function(){return new t.Treemap({isScrollable:!1,tooltipsEnabled:n})}),r(i,e.visuals.plugins.waterfallChart,function(){return new t.CartesianChart({chartType:12,tooltipsEnabled:n})}),r(i,e.visuals.plugins.map,function(){return new t.Map({tooltipsEnabled:n,disableZooming:!0,disablePanning:!0})}),r(i,e.visuals.plugins.filledMap,function(){return new t.Map({filledMap:!0,tooltipsEnabled:n,disableZooming:!0,disablePanning:!0})}),r(i,e.visuals.plugins.matrix,function(){return new t.Matrix({})}),r(i,e.visuals.plugins.table,function(){return new t.Table({isConditionalFormattingEnabled:!1})})}function n(i,a){var o=a?a.scriptVisualEnabled:!1,n=a?a.scriptVisualAuthoringEnabled:!1,s=a?a.isLabelInteractivityEnabled:!1,l=a?a.conditionalFormattingEnabled:!1,c=a?a.filledMapDataLabelsEnabled:!1,u=a?a.lineChartLabelDensityEnabled:!1;r(i,e.visuals.plugins.barChart,function(){return new t.CartesianChart({chartType:6,isScrollable:!0,animator:new t.WebColumnChartAnimator,tooltipsEnabled:!0,behavior:new t.CartesianChartBehavior([new t.ColumnChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.card,function(){return new t.Card({isScrollable:!0,animator:new t.BaseAnimator})}),r(i,e.visuals.plugins.clusteredBarChart,function(){return new t.CartesianChart({chartType:5,isScrollable:!0,tooltipsEnabled:!0,animator:new t.WebColumnChartAnimator,behavior:new t.CartesianChartBehavior([new t.ColumnChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.clusteredColumnChart,function(){return new t.CartesianChart({chartType:3,isScrollable:!0,tooltipsEnabled:!0,animator:new t.WebColumnChartAnimator,behavior:new t.CartesianChartBehavior([new t.ColumnChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.columnChart,function(){return new t.CartesianChart({chartType:4,isScrollable:!0,tooltipsEnabled:!0,animator:new t.WebColumnChartAnimator,behavior:new t.CartesianChartBehavior([new t.ColumnChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.dataDotClusteredColumnComboChart,function(){return new t.CartesianChart({chartType:15,isScrollable:!0,tooltipsEnabled:!0,animator:new t.WebColumnChartAnimator,behavior:new t.CartesianChartBehavior([new t.ColumnChartWebBehavior,new t.DataDotChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.dataDotStackedColumnComboChart,function(){return new t.CartesianChart({chartType:16,isScrollable:!0,tooltipsEnabled:!0,animator:new t.WebColumnChartAnimator,behavior:new t.CartesianChartBehavior([new t.ColumnChartWebBehavior,new t.DataDotChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.donutChart,function(){return new t.DonutChart({animator:new t.WebDonutChartAnimator,isScrollable:!0,tooltipsEnabled:!0,behavior:new t.DonutChartWebBehavior})}),r(i,e.visuals.plugins.funnel,function(){return new t.FunnelChart({animator:new t.WebFunnelAnimator,behavior:new t.FunnelWebBehavior,tooltipsEnabled:!0})}),r(i,e.visuals.plugins.gauge,function(){return new t.Gauge({animator:new t.BaseAnimator,tooltipsEnabled:!0})}),r(i,e.visuals.plugins.hundredPercentStackedBarChart,function(){return new t.CartesianChart({chartType:7,isScrollable:!0,tooltipsEnabled:!0,animator:new t.WebColumnChartAnimator,behavior:new t.CartesianChartBehavior([new t.ColumnChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.hundredPercentStackedColumnChart,function(){return new t.CartesianChart({chartType:8,isScrollable:!0,tooltipsEnabled:!0,animator:new t.WebColumnChartAnimator,behavior:new t.CartesianChartBehavior([new t.ColumnChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.lineChart,function(){return new t.CartesianChart({chartType:0,isScrollable:!0,tooltipsEnabled:!0,animator:new t.BaseAnimator,behavior:new t.CartesianChartBehavior([new t.LineChartWebBehavior]),isLabelInteractivityEnabled:s,lineChartLabelDensityEnabled:u})}),r(i,e.visuals.plugins.areaChart,function(){return new t.CartesianChart({chartType:1,isScrollable:!0,tooltipsEnabled:!0,animator:new t.BaseAnimator,behavior:new t.CartesianChartBehavior([new t.LineChartWebBehavior]),isLabelInteractivityEnabled:s,lineChartLabelDensityEnabled:u})}),r(i,e.visuals.plugins.stackedAreaChart,function(){return new t.CartesianChart({chartType:2,isScrollable:!0,tooltipsEnabled:!0,animator:new t.BaseAnimator,behavior:new t.CartesianChartBehavior([new t.LineChartWebBehavior]),lineChartLabelDensityEnabled:u})}),r(i,e.visuals.plugins.lineClusteredColumnComboChart,function(){return new t.CartesianChart({chartType:13,isScrollable:!0,tooltipsEnabled:!0,animator:new t.WebColumnChartAnimator,behavior:new t.CartesianChartBehavior([new t.ColumnChartWebBehavior,new t.LineChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.lineStackedColumnComboChart,function(){return new t.CartesianChart({chartType:14,isScrollable:!0,tooltipsEnabled:!0,animator:new t.WebColumnChartAnimator,behavior:new t.CartesianChartBehavior([new t.ColumnChartWebBehavior,new t.LineChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.pieChart,function(){return new t.DonutChart({sliceWidthRatio:0,animator:new t.WebDonutChartAnimator,isScrollable:!0,tooltipsEnabled:!0,behavior:new t.DonutChartWebBehavior})}),r(i,e.visuals.plugins.scatterChart,function(){return new t.CartesianChart({chartType:9,isScrollable:!0,tooltipsEnabled:!0,animator:new t.BaseAnimator,behavior:new t.CartesianChartBehavior([new t.ScatterChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.treemap,function(){return new t.Treemap({animator:new t.WebTreemapAnimator,isScrollable:!0,behavior:new t.TreemapWebBehavior,tooltipsEnabled:!0})}),r(i,e.visuals.plugins.waterfallChart,function(){return new t.CartesianChart({chartType:12,isScrollable:!0,tooltipsEnabled:!0,behavior:new t.CartesianChartBehavior([new t.WaterfallChartWebBehavior]),isLabelInteractivityEnabled:s})}),r(i,e.visuals.plugins.map,function(){return new t.Map({behavior:new t.MapBehavior,tooltipsEnabled:!0,isLegendScrollable:!0})}),r(i,e.visuals.plugins.filledMap,function(){return new t.Map({filledMap:!0,behavior:new t.MapBehavior,tooltipsEnabled:!0,filledMapDataLabelsEnabled:c,isLegendScrollable:!0})}),r(i,e.visuals.plugins.slicer,function(){return new t.Slicer({behavior:new t.SlicerWebBehavior})}),r(i,e.visuals.plugins.matrix,function(){return new t.Matrix({})}),r(i,e.visuals.plugins.table,function(){return new t.Table({isConditionalFormattingEnabled:l})}),o&&n&&r(i,e.visuals.plugins.scriptVisual,function(){return new t.ScriptVisual({canRefresh:!0})})}function s(){return new d(void 0)}function l(e){return new d(e)}function c(e,t){return new g(e,t)}function u(e){return new m(e)}function h(e,t){return new f(e,t)}var d=function(){function i(t){this.plugins=e.visuals.plugins,this.featureSwitches=t}return i.prototype.getVisuals=function(){var e=this.plugins,t=Object.keys(e);return t.map(function(t){return e[t]})},i.prototype.getPlugin=function(e){if(e){var t=this.plugins[e];if(t)return t}},i.prototype.capabilities=function(e){var t=this.getPlugin(e);return t?t.capabilities:void 0},i.prototype.requireSandbox=function(e){return e&&e.custom},i.prototype.removeAnyCustomVisuals=function(){var t=e.visuals.plugins;for(var i in t){var a=t[i];a.custom&&delete t[i]}},i.prototype.isCustomVisual=function(e){return e?this.plugins[e]?this.plugins[e].custom===!0:!_.include(a,e):!1},i.prototype.isScriptVisual=function(t){var i=this.capabilities(t);return!!(i&&i.dataViewMappings&&e.ScriptResultUtil.findScriptResult(i.dataViewMappings))},i.prototype.shouldDisableVisual=function(e,i){return(e===t.plugins.map.name||e===t.plugins.filledMap.name)&&i},i.prototype.isScriptVisualQueryable=function(){return void 0!==this.featureSwitches&&this.featureSwitches.scriptVisualEnabled},i.prototype.getInteractivityOptions=function(e){var t={overflow:"hidden"};return t},i}();i.VisualPluginService=d,i.createPlugin=r;var p=function(t){function i(){t.call(this,void 0),this.visualPlugins=e.visuals.plugins,n(this.visualPlugins,null)}return __extends(i,t),i.prototype.getVisuals=function(){var e=this.visualPlugins,t=Object.keys(e);return t.map(function(t){return e[t]})},i.prototype.getPlugin=function(e){if(e){var t=this.visualPlugins[e];if(t)return t}},i.prototype.capabilities=function(e){var t=this.getPlugin(e);return t?t.capabilities:void 0},i}(d);i.PlaygroundVisualPluginService=p;var g=function(e){function t(t,i){e.call(this,t),this.visualPlugins={},o(this.visualPlugins,i,this.featureSwitches)}return __extends(t,e),t.prototype.getPlugin=function(t){return this.visualPlugins[t]?this.visualPlugins[t]:e.prototype.getPlugin.call(this,t)},t.prototype.requireSandbox=function(e){return this.featureSwitches.sandboxVisualsEnabled&&(!e||e&&e.custom)},t}(d);i.DashboardPluginService=g;var m=function(i){function a(a){i.call(this,a),this.visualPlugins={},r(this.visualPlugins,e.visuals.plugins.clusteredBarChart,function(){return new t.CartesianChart({chartType:5,animator:new t.WebColumnChartAnimator,tooltipsEnabled:!0})}),r(this.visualPlugins,e.visuals.plugins.columnChart,function(){return new t.CartesianChart({chartType:4,animator:new t.WebColumnChartAnimator,tooltipsEnabled:!0})}),r(this.visualPlugins,e.visuals.plugins.donutChart,function(){return new t.DonutChart({animator:new t.WebDonutChartAnimator,tooltipsEnabled:!0})}),r(this.visualPlugins,e.visuals.plugins.hundredPercentStackedBarChart,function(){return new t.CartesianChart({chartType:7,animator:new t.WebColumnChartAnimator,tooltipsEnabled:!0})}),r(this.visualPlugins,e.visuals.plugins.hundredPercentStackedColumnChart,function(){return new t.CartesianChart({chartType:8,animator:new t.WebColumnChartAnimator,tooltipsEnabled:!0})}),r(this.visualPlugins,e.visuals.plugins.lineChart,function(){return new t.CartesianChart({chartType:0,animator:new t.BaseAnimator,tooltipsEnabled:!0})}),r(this.visualPlugins,e.visuals.plugins.areaChart,function(){return new t.CartesianChart({chartType:1,animator:new t.BaseAnimator,tooltipsEnabled:!0})}),r(this.visualPlugins,e.visuals.plugins.pieChart,function(){return new t.DonutChart({sliceWidthRatio:0,animator:new t.WebDonutChartAnimator,tooltipsEnabled:!0})}),r(this.visualPlugins,e.visuals.plugins.scatterChart,function(){return new t.CartesianChart({chartType:9,animator:new t.BaseAnimator,tooltipsEnabled:!0})},void 0)}return __extends(a,i),a.prototype.getPlugin=function(e){return this.visualPlugins[e]?this.visualPlugins[e]:i.prototype.getPlugin.call(this,e)},a.prototype.requireSandbox=function(e){return this.featureSwitches.sandboxVisualsEnabled&&(!e||e&&e.custom)},a}(d);i.InsightsPluginService=m;var f=function(i){function a(o,n){var s=this;i.call(this,n),this.smallViewPortProperties=o||{CartesianSmallViewPortProperties:{hideAxesOnSmallViewPort:!0,hideLegendOnSmallViewPort:!0,MinHeightLegendVisible:a.MinHeightLegendVisible,MinHeightAxesVisible:a.MinHeightAxesVisible},GaugeSmallViewPortProperties:{hideGaugeSideNumbersOnSmallViewPort:!0,smallGaugeMarginsOnSmallViewPort:!0,MinHeightGaugeSideNumbersVisible:a.MinHeightGaugeSideNumbersVisible,GaugeMarginsOnSmallViewPort:a.GaugeMarginsOnSmallViewPort},FunnelSmallViewPortProperties:{hideFunnelCategoryLabelsOnSmallViewPort:!0,minHeightFunnelCategoryLabelsVisible:a.MinHeightFunnelCategoryLabelsVisible},DonutSmallViewPortProperties:{maxHeightToScaleDonutLegend:a.MaxHeightToScaleDonutLegend}},t.TooltipManager.ShowTooltips=!1;var l=!1,c=this.getMapThrottleInterval();this.visualPlugins={},r(this.visualPlugins,e.visuals.plugins.areaChart,function(){return new t.CartesianChart({chartType:1,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.barChart,function(){return new t.CartesianChart({chartType:6,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.clusteredBarChart,function(){return new t.CartesianChart({chartType:5,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.clusteredColumnChart,function(){return new t.CartesianChart({chartType:3,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.columnChart,function(){return new t.CartesianChart({chartType:4,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.comboChart,function(){return new t.CartesianChart({chartType:10,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.dataDotChart,function(){return new t.CartesianChart({chartType:11,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.dataDotClusteredColumnComboChart,function(){return new t.CartesianChart({chartType:15,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.dataDotStackedColumnComboChart,function(){return new t.CartesianChart({chartType:16,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.hundredPercentStackedBarChart,function(){return new t.CartesianChart({chartType:7,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.hundredPercentStackedColumnChart,function(){return new t.CartesianChart({chartType:8,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.stackedAreaChart,function(){return new t.CartesianChart({chartType:2,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.waterfallChart,function(){return new t.CartesianChart({chartType:12,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.lineChart,function(){return new t.CartesianChart({chartType:0,cartesianSmallViewPortProperties:s.smallViewPortProperties.CartesianSmallViewPortProperties,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.lineClusteredColumnComboChart,function(){return new t.CartesianChart({chartType:13,cartesianSmallViewPortProperties:s.smallViewPortProperties.CartesianSmallViewPortProperties,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.lineStackedColumnComboChart,function(){return new t.CartesianChart({chartType:14,cartesianSmallViewPortProperties:s.smallViewPortProperties.CartesianSmallViewPortProperties,trimOrdinalDataOnOverflow:l})}),r(this.visualPlugins,e.visuals.plugins.scatterChart,function(){return new t.CartesianChart({chartType:9,cartesianSmallViewPortProperties:s.smallViewPortProperties.CartesianSmallViewPortProperties,behavior:new t.CartesianChartBehavior([new t.ScatterChartMobileBehavior])})}),r(this.visualPlugins,e.visuals.plugins.gauge,function(){return new t.Gauge({gaugeSmallViewPortProperties:s.smallViewPortProperties.GaugeSmallViewPortProperties})}),r(this.visualPlugins,e.visuals.plugins.funnel,function(){return new t.FunnelChart({animator:null,funnelSmallViewPortProperties:s.smallViewPortProperties.FunnelSmallViewPortProperties})}),r(this.visualPlugins,e.visuals.plugins.donutChart,function(){
12return new t.DonutChart({disableGeometricCulling:!0,smallViewPortProperties:s.smallViewPortProperties.DonutSmallViewPortProperties})}),r(this.visualPlugins,e.visuals.plugins.pieChart,function(){return new t.DonutChart({sliceWidthRatio:0,disableGeometricCulling:!0,smallViewPortProperties:s.smallViewPortProperties.DonutSmallViewPortProperties})}),r(this.visualPlugins,e.visuals.plugins.matrix,function(){return new t.Matrix({isTouchEnabled:!0})}),r(this.visualPlugins,e.visuals.plugins.table,function(){return new t.Table({isTouchEnabled:!0})}),r(this.visualPlugins,e.visuals.plugins.map,function(){return new t.Map({viewChangeThrottleInterval:c,enableCurrentLocation:n?n.mapCurrentLocationEnabled:!1})}),r(this.visualPlugins,e.visuals.plugins.filledMap,function(){return new t.Map({filledMap:!0,viewChangeThrottleInterval:c})})}return __extends(a,i),a.prototype.getPlugin=function(e){return this.visualPlugins[e]?this.visualPlugins[e]:i.prototype.getPlugin.call(this,e)},a.prototype.requireSandbox=function(e){return this.featureSwitches?this.featureSwitches.sandboxVisualsEnabled&&(!e||e&&e.custom):i.prototype.requireSandbox.call(this,e)},a.prototype.getMapThrottleInterval=function(){var e=100,t=navigator.userAgent.toLowerCase();return-1!==t.indexOf("windows phone")?e:void 0},a.prototype.getInteractivityOptions=function(e){var t={overflow:this.getMobileOverflowString(e),isInteractiveLegend:this.isChartSupportInteractivity(e),selection:!0};return t},a.prototype.getMobileOverflowString=function(e){switch(e){case"multiRowCard":return"visible";default:return"hidden"}},a.prototype.isChartSupportInteractivity=function(e){switch(e){case"areaChart":case"barChart":case"clusteredBarChart":case"clusteredColumnChart":case"columnChart":case"donutChart":case"hundredPercentStackedBarChart":case"hundredPercentStackedColumnChart":case"lineChart":case"pieChart":case"scatterChart":case"table":case"matrix":case"multiRowCard":return!0;default:return!1}},a.MinHeightLegendVisible=125,a.MinHeightAxesVisible=125,a.MinHeightGaugeSideNumbersVisible=80,a.GaugeMarginsOnSmallViewPort=10,a.MinHeightFunnelCategoryLabelsVisible=80,a.MaxHeightToScaleDonutLegend=300,a}(d);i.MobileVisualPluginService=f,i.create=s,i.createVisualPluginService=l,i.createDashboard=c,i.createInsights=u,i.createMobile=h}(i=t.visualPluginFactory||(t.visualPluginFactory={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(e,t){if(e)for(var i=0;i<e.length;i++){var a=e[i];a(t)}}var i="unselectable";e.fire=t;var a=function(){function t(e,t){this._owner=e,this._direction=t,this._timerHandle=void 0,this.createView();var a=this;this._element.addEventListener("mousedown",function(e){a.onMouseDown(e)}),$(this._element).addClass(i),$(this._svg).addClass(i),$(this._polygon).addClass(i)}return Object.defineProperty(t.prototype,"element",{get:function(){return this._element},enumerable:!0,configurable:!0}),t.prototype.createView=function(){var e="http://www.w3.org/2000/svg";this._polygon=document.createElementNS(e,"polygon"),this._polygon.setAttributeNS(null,"points","3,3 6,3 13,8 6,13 3,13 10,8"),this._polygon.setAttributeNS(null,"fill",t.ARROW_COLOR),this._svg=document.createElementNS(e,"svg");var i=this._svg.style;i.position="absolute",i.left="0px",i.top="0px",this._svg.appendChild(this._polygon),this._element=document.createElement("div"),this._element.className=r.arrowClassName,this._element.appendChild(this._svg),this._owner.element.appendChild(this._element)},t.prototype.onMouseDown=function(e){var t=this;if(clearTimeout(this._timerHandle),!this._mouseUpWrapper){e.cancelBubble=!0;var i=this;this._mouseUpWrapper=function(e){i.onMouseUp(e)},r.addDocumentMouseUpEvent(this._mouseUpWrapper)}this._owner._scrollSmallIncrement(this._direction),this._owner.refresh(),this._timerHandle=setTimeout(function(){t.onMouseDown(e)},100),e.preventDefault&&e.preventDefault()},t.prototype.onMouseUp=function(e){clearTimeout(this._timerHandle),r.removeDocumentMouseUpEvent(this._mouseUpWrapper),this._mouseUpWrapper=void 0},t.prototype.arrange=function(t,i,a){var r=Math.min(t,i),o=r/16,n=(t-r)/2,s=(i-r)/2;this._polygon.setAttributeNS(null,"transform","translate("+n+", "+s+") scale("+o+") rotate("+a+",8,8)"),this._svg.setAttributeNS(null,"width",t+"px"),this._svg.setAttributeNS(null,"height",i+"px"),e.HTMLElementUtils.setElementWidth(this._element,t),e.HTMLElementUtils.setElementHeight(this._element,i)},t.MIN_WIDTH=26,t.ARROW_COLOR="#404040",t}();e.ScrollbarButton=a;var r=function(){function r(e,t){this.MIN_BAR_SIZE=10,this.min=0,this.max=10,this.viewMin=0,this.viewSize=2,this.smallIncrement=1,this._onscroll=[],this._screenToOffsetScale=1,this.createView(e,t);var a=this;this._element.addEventListener("mousedown",function(e){a.onBackgroundMouseDown(e)}),this._middleBar.addEventListener("mousedown",function(e){a.onMiddleBarMouseDown(e)}),this._timerHandle=void 0,this._visible=!0,this.element.winControl=this,$(this._touchPanel).addClass(i)}return r.prototype.scrollBy=function(e){this.scrollTo(this.viewMin+e)},r.prototype.scrollUp=function(){this.scrollBy(-this.smallIncrement)},r.prototype.scrollDown=function(){this.scrollBy(this.smallIncrement)},r.prototype.scrollPageUp=function(){this.scrollBy(-this.viewSize)},r.prototype.scrollPageDown=function(){this.scrollBy(this.viewSize)},Object.defineProperty(r.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e,this._element.style.width=e,this.invalidateArrange()},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e,this._element.style.height=e,this.invalidateArrange()},enumerable:!0,configurable:!0}),r.prototype.refresh=function(){},Object.defineProperty(r.prototype,"element",{get:function(){return this._element},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"maxButton",{get:function(){return this._maxButton},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"middleBar",{get:function(){return this._middleBar},enumerable:!0,configurable:!0}),r.prototype._scrollSmallIncrement=function(e){this.scrollBy(this.smallIncrement*e)},Object.defineProperty(r.prototype,"visible",{get:function(){return this._visible},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isInMouseCapture",{get:function(){return void 0!==this._timerHandle},enumerable:!0,configurable:!0}),r.prototype.show=function(e){this._visible=e,this.element.style.visibility=e?"visible":"hidden",this.invalidateArrange()},r.prototype._getMouseOffset=function(e){return void 0!==e.offsetX?{x:e.offsetX,y:e.offsetY}:void 0!==e.layerX?{x:e.layerX,y:e.layerY}:{x:e.screenX,y:e.screenY}},r.prototype._getOffsetXDelta=function(e){return(e.screenX-this._screenPrevMousePos.x)/this._screenToOffsetScale},r.prototype._getOffsetYDelta=function(e){return(e.screenY-this._screenPrevMousePos.y)/this._screenToOffsetScale},r.prototype._getOffsetXTouchDelta=function(e){return this._getMouseOffset(e).x-this._offsetTouchPrevPos.x},r.prototype._getOffsetYTouchDelta=function(e){return this._getMouseOffset(e).y-this._offsetTouchPrevPos.y},r.prototype.initTouch=function(e,t){var i=this;this._touchPanel=e,this._allowMouseDrag=void 0===t?!0:t,"ontouchmove"in e?(e.addEventListener("touchstart",function(e){return i.onTouchStart(e)}),e.addEventListener("touchmove",function(e){return i.onTouchMove(e)}),e.addEventListener("touchend",function(e){return i.onTouchEnd(e)})):(e.addEventListener("mousedown",function(e){return i.onTouchMouseDown(e)}),e.addEventListener("mousemove",function(e){return i.onTouchMouseMove(e)}),e.addEventListener("mouseup",function(e){return i.onTouchMouseUp(e)}))},r.prototype.onTouchStart=function(e){1===e.touches.length&&this.onTouchMouseDown(e.touches[0])},r.prototype.onTouchMove=function(e){1===e.touches.length&&(e.preventDefault&&e.preventDefault(),this.onTouchMouseMove(e.touches[0]))},r.prototype.onTouchEnd=function(e){this.onTouchMouseUp(1===e.touches.length?e.touches[0]:e,!0)},r.prototype.onTouchMouseDown=function(e){(this._allowMouseDrag||e.pointerType!==MSPointerEvent.MSPOINTER_TYPE_MOUSE)&&("setCapture"in this._touchPanel&&this._touchPanel.setCapture(!0),this._offsetTouchPrevPos=this._offsetTouchStartPos=null,this._touchStarted=!0)},r.prototype._getOffsetTouchDelta=function(e){return null},r.prototype.onTouchMouseMove=function(e){if(this._touchStarted){this._offsetTouchStartPos||(this._offsetTouchPrevPos=this._offsetTouchStartPos=this._getMouseOffset(e));var t=this._getOffsetTouchDelta(e);0!==t&&(this.scrollBy(-t/this._getRunningSize(!1)*this.viewSize),this._offsetTouchPrevPos=this._getMouseOffset(e)),e.preventDefault&&e.preventDefault(),e.cancelBubble=!0}},r.prototype.onTouchMouseUp=function(e,t){if(this._touchStarted&&this._offsetTouchStartPos){var i=this._getMouseOffset(e);!t&&(Math.abs(this._offsetTouchStartPos.x-i.x)>3||Math.abs(this._offsetTouchStartPos.y-i.y)>3)&&(e.preventDefault&&e.preventDefault(),e.cancelBubble=!0)}"releaseCapture"in this._touchPanel&&this._touchPanel.releaseCapture(),this._touchStarted=!1},r.prototype.registerElementForMouseWheelScrolling=function(e){var t=this;e.addEventListener("mousewheel",function(e){t.onMouseWheel(e)}),e.addEventListener("DOMMouseScroll",function(e){t.onFireFoxMouseWheel(e)})},r.prototype.createView=function(e,t){this._element=document.createElement("div"),this._element.className=r.className,this._element.setAttribute("drag-resize-disabled","true"),0===t&&e.appendChild(this._element),this._minButton=new a(this,-1),this._maxButton=new a(this,1),this._middleBar=document.createElement("div"),this._middleBar.className=r.barClassName,this._element.appendChild(this._middleBar)},r.prototype.scrollTo=function(e){var i=Math.min(this.max-this.viewSize,Math.max(this.min,e));i!==this.viewMin&&(this.viewMin=i,t(this._onscroll,null))},r.prototype._scrollByPage=function(e){},r.prototype._getRunningSize=function(e){return null},r.prototype._getOffsetDelta=function(e){return null},r.prototype.scroll=function(e){var t=this._getOffsetDelta(e)/this._getRunningSize(!0)*(this.max-this.min);if(0>t){if(this._getScreenMousePos(e)>=this._screenMaxMousePos)return}else if(t>0&&this._getScreenMousePos(e)<=this._screenMinMousePos)return;this.scrollBy(t)},Object.defineProperty(r.prototype,"actualWidth",{get:function(){return void 0===this._actualWidth&&this.arrange(),this._actualWidth},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"actualHeight",{get:function(){return void 0===!this._actualHeight&&this.arrange(),this._actualHeight},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"actualButtonWidth",{get:function(){return void 0===!this._actualButtonWidth&&this.arrange(),this._actualButtonWidth},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"actualButtonHeight",{get:function(){return void 0===!this._actualButtonHeight&&this.arrange(),this._actualButtonHeight},enumerable:!0,configurable:!0}),r.prototype.arrange=function(){this._actualWidth||(this._actualWidth=this._element.offsetWidth,this._actualHeight=this._element.offsetHeight,this._actualButtonWidth=this._calculateButtonWidth(),this._actualButtonHeight=this._calculateButtonHeight(),this._minButton.arrange(this._actualButtonWidth,this._actualButtonHeight,this._getMinButtonAngle()),this._maxButton.arrange(this._actualButtonWidth,this._actualButtonHeight,this._getMaxButtonAngle()),this._setMaxButtonPosition())},r.prototype._calculateButtonWidth=function(){return null},r.prototype._calculateButtonHeight=function(){return null},r.prototype._getMinButtonAngle=function(){return null},r.prototype._getMaxButtonAngle=function(){return null},r.prototype._setMaxButtonPosition=function(){},r.prototype.invalidateArrange=function(){this._actualWidth=void 0,this._actualHeight=void 0,this._actualButtonWidth=void 0,this._actualButtonHeight=void 0},r.prototype.onHoldBackgroundMouseDown=function(e){var t=this,i=this._timerHandle?r.ScrollbarBackgroundMousedownHoldDelay:r.ScrollbarBackgroundFirstTimeMousedownHoldDelay;this._timerHandle=setTimeout(function(){t.onBackgroundMouseDown(e)},i)},r.prototype.onBackgroundMouseDown=function(e){var t=this;clearTimeout(this._timerHandle),this._backgroundMouseUpWrapper||(e.cancelBubble=!0,this._backgroundMouseUpWrapper=function(e){t.onBackgroundMouseUp(e)},r.addDocumentMouseUpEvent(this._backgroundMouseUpWrapper)),this._scrollByPage(e),this.refresh(),this.onHoldBackgroundMouseDown(e),e.preventDefault&&e.preventDefault()},r.prototype.onBackgroundMouseUp=function(e){clearTimeout(this._timerHandle),this._timerHandle=void 0,r.removeDocumentMouseUpEvent(this._backgroundMouseUpWrapper),this._backgroundMouseUpWrapper=void 0},r.prototype.getPinchZoomY=function(){return document.documentElement.clientHeight/window.innerHeight},r.prototype.onMiddleBarMouseDown=function(t){t.cancelBubble=!0,this._screenPrevMousePos={x:t.screenX,y:t.screenY},this._screenMinMousePos=this._getScreenMousePos(t)-(this._getScreenContextualLeft(this._middleBar)-this._getScreenContextualRight(this._minButton.element)),this._screenMaxMousePos=this._getScreenMousePos(t)+(this._getScreenContextualLeft(this._maxButton.element)-this._getScreenContextualRight(this._middleBar)),this._screenToOffsetScale=e.HTMLElementUtils.getAccumulatedScale(this.element)*this.getPinchZoomY();var i=this;this._middleBarMouseMoveWrapper=function(e){i.onMiddleBarMouseMove(e)},r.addDocumentMouseMoveEvent(this._middleBarMouseMoveWrapper),this._middleBarMouseUpWrapper=function(e){i.onMiddleBarMouseUp(e)},r.addDocumentMouseUpEvent(this._middleBarMouseUpWrapper),t.preventDefault&&t.preventDefault()},r.prototype.onMiddleBarMouseMove=function(e){this._screenPrevMousePos&&(this.scroll(e),this.refresh(),this._screenPrevMousePos={x:e.screenX,y:e.screenY})},r.prototype.onMiddleBarMouseUp=function(e){this._screenPrevMousePos=void 0,r.removeDocumentMouseMoveEvent(this._middleBarMouseMoveWrapper),this._middleBarMouseMoveWrapper=void 0,r.removeDocumentMouseUpEvent(this._middleBarMouseUpWrapper),this._middleBarMouseUpWrapper=void 0,e.preventDefault&&e.preventDefault()},r.prototype._getScreenContextualLeft=function(e){return null},r.prototype._getScreenContextualRight=function(e){return null},r.prototype.onMouseWheel=function(e){e.wheelDelta&&this.mouseWheel(e.wheelDelta),e.preventDefault()},r.prototype.onFireFoxMouseWheel=function(e){e.detail&&this.mouseWheel(-e.detail),e.preventDefault()},r.prototype.mouseWheel=function(e){this.visible&&(0>e?e=Math.min(-r.MouseWheelRange,e):e>0&&(e=Math.max(r.MouseWheelRange,e)),this.scrollBy(-e/r.MouseWheelRange*this.smallIncrement))},r.prototype._getScreenMousePos=function(e){return null},r.addDocumentMouseUpEvent=function(e){document.addEventListener("mouseup",e)},r.removeDocumentMouseUpEvent=function(e){document.removeEventListener("mouseup",e)},r.addDocumentMouseMoveEvent=function(e){document.addEventListener("mousemove",e)},r.removeDocumentMouseMoveEvent=function(e){document.removeEventListener("mousemove",e)},r.DefaultScrollbarWidth="15px",r.ScrollbarBackgroundFirstTimeMousedownHoldDelay=500,r.ScrollbarBackgroundMousedownHoldDelay=50,r.MouseWheelRange=120,r.className="scroll-bar-div",r.barClassName="scroll-bar-part-bar",r.arrowClassName="scroll-bar-part-arrow",r}();e.Scrollbar=r;var o=function(t){function i(e,i){t.call(this,e,i),this.height=r.DefaultScrollbarWidth}return __extends(i,t),i.prototype._calculateButtonWidth=function(){return Math.min(this.actualWidth/2,Math.max(this.actualHeight,a.MIN_WIDTH))},i.prototype._calculateButtonHeight=function(){return this.actualHeight},i.prototype._getMinButtonAngle=function(){return-180},i.prototype._getMaxButtonAngle=function(){return 0},i.prototype._setMaxButtonPosition=function(){e.HTMLElementUtils.setElementLeft(this.maxButton.element,this.actualWidth-this.actualButtonWidth)},i.prototype.refresh=function(){this.arrange();var t=this.actualWidth-2*this.actualButtonWidth-2,i=this.viewSize/(this.max-this.min)*t;i<this.MIN_BAR_SIZE&&(t-=this.MIN_BAR_SIZE-i,i=this.MIN_BAR_SIZE),0>t&&(t=0,i=0),i=Math.min(i,t);var a=this.viewMin/(this.max-this.min)*t;e.HTMLElementUtils.setElementWidth(this.middleBar,i),e.HTMLElementUtils.setElementHeight(this.middleBar,this.actualHeight),e.HTMLElementUtils.setElementLeft(this.middleBar,this.actualButtonWidth+1+a)},i.prototype.show=function(i){i!==this.visible&&(t.prototype.show.call(this,i),i?this.element.style.height=this.height:e.HTMLElementUtils.setElementHeight(this.element,0))},i.prototype._scrollByPage=function(e){var t=this.middleBar.offsetLeft,i=t+this.middleBar.offsetWidth,a=void 0===e.offsetX?e.layerX:e.offsetX;a>i?this.scrollPageDown():t>a&&this.scrollPageUp()},i.prototype._getRunningSize=function(e){var t=this.actualWidth;if(e){var i=this.actualButtonWidth+1;t-=2*i;var a=t*(this.viewSize/(this.max-this.min));a<this.MIN_BAR_SIZE&&(t-=this.MIN_BAR_SIZE-a)}return t},i.prototype._getOffsetDelta=function(e){return this._getOffsetXDelta(e)},i.prototype._getOffsetTouchDelta=function(e){return this._getOffsetXTouchDelta(e)},i.prototype._getScreenContextualLeft=function(e){return e.getBoundingClientRect().left},i.prototype._getScreenContextualRight=function(e){return e.getBoundingClientRect().right},i.prototype._getScreenMousePos=function(e){return e.screenX},i}(r);e.HorizontalScrollbar=o;var n=function(t){function i(e,i){t.call(this,e,i),this.width=r.DefaultScrollbarWidth}return __extends(i,t),i.prototype._calculateButtonWidth=function(){return this.actualWidth},i.prototype._calculateButtonHeight=function(){return Math.min(this.actualHeight/2,Math.max(this.actualWidth,a.MIN_WIDTH))},i.prototype._getMinButtonAngle=function(){return-90},i.prototype._getMaxButtonAngle=function(){return 90},i.prototype._setMaxButtonPosition=function(){e.HTMLElementUtils.setElementTop(this.maxButton.element,this.actualHeight-this.actualButtonHeight)},i.prototype.refresh=function(){this.arrange();var t=this.actualHeight-2*this.actualButtonHeight-2,i=this.viewSize/(this.max-this.min)*t;i<this.MIN_BAR_SIZE&&(t-=this.MIN_BAR_SIZE-i,i=this.MIN_BAR_SIZE),0>t&&(t=0,i=0);var a=this.viewMin/(this.max-this.min)*t;e.HTMLElementUtils.setElementWidth(this.middleBar,this.actualWidth),e.HTMLElementUtils.setElementHeight(this.middleBar,i),e.HTMLElementUtils.setElementTop(this.middleBar,this.actualButtonHeight+1+a)},i.prototype.show=function(i){i!==this.visible&&(t.prototype.show.call(this,i),i?this.element.style.width=this.width:e.HTMLElementUtils.setElementWidth(this.element,0))},i.prototype._scrollByPage=function(e){var t=this.middleBar.offsetTop,i=t+this.middleBar.offsetHeight,a=void 0===e.offsetY?e.layerY:e.offsetY;a>i?this.scrollPageDown():t>a&&this.scrollPageUp()},i.prototype._getRunningSize=function(e){var t=this.actualHeight;if(e){var i=this.actualButtonHeight+1;t-=2*i;var a=t*(this.viewSize/(this.max-this.min));a<this.MIN_BAR_SIZE&&(t-=this.MIN_BAR_SIZE-a)}return t},i.prototype._getOffsetDelta=function(e){return this._getOffsetYDelta(e)},i.prototype._getOffsetTouchDelta=function(e){return this._getOffsetYTouchDelta(e)},i.prototype._getScreenContextualLeft=function(e){return e.getBoundingClientRect().top},i.prototype._getScreenContextualRight=function(e){return e.getBoundingClientRect().bottom},i.prototype._getScreenMousePos=function(e){return e.screenY},i}(r);e.VerticalScrollbar=n}(t=e.controls||(e.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){var t;!function(t){var i="unselectable",a=function(){function e(e,t){this._element=e,this._handler=t,this._elementMouseDownWrapper=null,this._elementMouseMoveWrapper=null,this._elementMouseOutWrapper=null,this._documentMouseMoveWrapper=null,this._documentMouseUpWrapper=null,this._startMousePosition=null,this._originalCursor=null}return e.addDocumentMouseUpEvent=function(e){document.addEventListener("mouseup",e)},e.removeDocumentMouseUpEvent=function(e){document.removeEventListener("mouseup",e)},e.addDocumentMouseMoveEvent=function(e){document.addEventListener("mousemove",e)},e.removeDocumentMouseMoveEvent=function(e){document.removeEventListener("mousemove",e)},e.getMouseCoordinates=function(e){return{x:e.pageX,y:e.pageY}},e.getMouseCoordinateDelta=function(e,t){return{x:t.x-e.x,y:t.y-e.y}},e.prototype.initialize=function(){var e=this;this._elementMouseDownWrapper=function(t){return e.onElementMouseDown(t)},this._element.addEventListener("mousedown",this._elementMouseDownWrapper),this._elementMouseMoveWrapper=function(t){return e.onElementMouseMove(t)},this._element.addEventListener("mousemove",this._elementMouseMoveWrapper),this._elementMouseOutWrapper=function(t){return e.onElementMouseOut(t)},this._element.addEventListener("mouseout",this._elementMouseOutWrapper),this._elementMouseDoubleClickOutWrapper=function(t){return e.onElementMouseDoubleClick(t)},this._element.addEventListener("dblclick",this._elementMouseDoubleClickOutWrapper)},e.prototype.uninitialize=function(){this._element.removeEventListener("mousedown",this._elementMouseDownWrapper),this._elementMouseDownWrapper=null,this._element.removeEventListener("mousemove",this._elementMouseMoveWrapper),this._elementMouseMoveWrapper=null,this._element.removeEventListener("mouseout",this._elementMouseOutWrapper),this._elementMouseOutWrapper=null,this._element.removeEventListener("dblclick",this._elementMouseDoubleClickOutWrapper),this._elementMouseDoubleClickOutWrapper=null},Object.defineProperty(e.prototype,"cell",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._element},enumerable:!0,configurable:!0}),e.prototype._hotSpot=function(e){return!1},e.prototype.onElementMouseDown=function(t){var i=this,a=e.getMouseCoordinates(t);this._hotSpot(a)&&("setCapture"in this._element&&this._element.setCapture(),t.cancelBubble=!0,this._startMousePosition=a,this._documentMouseMoveWrapper=function(e){return i.onDocumentMouseMove(e)},e.addDocumentMouseMoveEvent(this._documentMouseMoveWrapper),this._documentMouseUpWrapper=function(e){return i.onDocumentMouseUp(e)},e.addDocumentMouseUpEvent(this._documentMouseUpWrapper),document.documentElement&&(this._originalCursor=document.documentElement.style.cursor,document.documentElement.style.cursor=e.resizeCursor),this._handler.onStartResize(this.cell,this._startMousePosition.x,this._startMousePosition.y))},e.prototype.onElementMouseMove=function(t){this._startMousePosition||(this._hotSpot(e.getMouseCoordinates(t))?null===this._originalCursor&&(this._originalCursor=this._element.style.cursor,this._element.style.cursor=e.resizeCursor):null!==this._originalCursor&&(this._element.style.cursor=this._originalCursor,this._originalCursor=null))},e.prototype.onElementMouseOut=function(e){this._startMousePosition||null!==this._originalCursor&&(this._element.style.cursor=this._originalCursor,this._originalCursor=null)},e.prototype.onElementMouseDoubleClick=function(t){this._hotSpot(e.getMouseCoordinates(t))&&this._handler.onReset(this.cell)},e.prototype.onDocumentMouseMove=function(t){if(this._startMousePosition){var i=e.getMouseCoordinateDelta(this._startMousePosition,e.getMouseCoordinates(t));this._handler.onResize(this.cell,i.x,i.y),t.preventDefault()}},e.prototype.onDocumentMouseUp=function(t){this._startMousePosition=null,"releaseCapture"in this._element&&this._element.releaseCapture(),e.removeDocumentMouseMoveEvent(this._documentMouseMoveWrapper),this._documentMouseMoveWrapper=null,e.removeDocumentMouseUpEvent(this._documentMouseUpWrapper),this._documentMouseUpWrapper=null,document.documentElement&&(document.documentElement.style.cursor=this._originalCursor),t.preventDefault&&t.preventDefault(),this._handler.onEndResize(this.cell)},e.resizeHandleSize=4,e.resizeCursor="e-resize",e}();t.TablixResizer=a;var r=function(e){function t(t,i,a){e.call(this,i,a),this._cell=t}return __extends(t,e),Object.defineProperty(t.prototype,"cell",{get:function(){return this._cell},enumerable:!0,configurable:!0}),t.prototype._hotSpot=function(e){return e.x>=this.element.getBoundingClientRect().right-a.resizeHandleSize},t}(a);t.TablixDomResizer=r;var o=function(){function i(e,i){this._tableCell=null,this._contentElement=t.TablixUtils.createDiv(),this._contentHost=t.TablixUtils.createDiv(),this.layoutKind=i,this._contentElement.appendChild(this._contentHost),this._resizer=null}return i.prototype.initialize=function(e){this._owner=e},Object.defineProperty(i.prototype,"owner",{get:function(){return this._owner},enumerable:!0,configurable:!0}),i.prototype.registerTableCell=function(e){this._tableCell=e,e.appendChild(this._contentElement)},Object.defineProperty(i.prototype,"tableCell",{get:function(){return this._tableCell},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"contentElement",{get:function(){return this._contentElement},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"contentHost",{get:function(){return this._contentHost},enumerable:!0,configurable:!0}),i.prototype.registerClickHandler=function(e){this._contentElement.onclick=e},i.prototype.unregisterClickHandler=function(){this._contentElement.onclick=null},i.prototype.onContainerWidthChanged=function(t){e.HTMLElementUtils.setElementWidth(this._contentElement,t)},i.prototype.onContinerHeightChanged=function(t){e.HTMLElementUtils.setElementHeight(this._contentElement,t)},i.prototype.onColumnSpanChanged=function(e){this._tableCell.colSpan=e},i.prototype.onRowSpanChanged=function(e){this._tableCell.rowSpan=e},i.prototype.onTextAlignChanged=function(e){this._tableCell.style.textAlign=e},i.prototype.onClear=function(){this._contentHost.className="",this._tableCell.className=""},i.prototype.onHorizontalScroll=function(t,i){e.HTMLElementUtils.setElementLeft(this._contentHost,i),e.HTMLElementUtils.setElementWidth(this._contentHost,t)},i.prototype.onVerticalScroll=function(t,i){e.HTMLElementUtils.setElementTop(this._contentHost,i),e.HTMLElementUtils.setElementHeight(this._contentHost,t)},i.prototype.onInitializeScrolling=function(){e.HTMLElementUtils.setElementLeft(this._contentHost,0),e.HTMLElementUtils.setElementTop(this._contentHost,0),e.HTMLElementUtils.setElementWidth(this._contentHost,-1),e.HTMLElementUtils.setElementHeight(this._contentHost,-1)},i.prototype.enableHorizontalResize=function(e,t){e!==(null!==this._resizer)&&(e?(this._resizer=new r(this._owner,this._tableCell,t),this._resizer.initialize()):(this._resizer.uninitialize(),this._resizer=null))},i.prototype.disableDragResize=function(){this._tableCell.setAttribute(i._dragResizeDisabledAttributeName,"true")},i._dragResizeDisabledAttributeName="drag-resize-disabled",i}();t.TablixCellPresenter=o;var n=function(){function e(e){this._tableRow=null,this._fitProportionally=e}return e.prototype.initialize=function(e){this._row=e},e.prototype.createCellPresenter=function(e){return new o(this._fitProportionally,e)},e.prototype.registerRow=function(e){this._tableRow=e},e.prototype.onAppendCell=function(e){var t=e._presenter;if(null===t.tableCell){var i=this._tableRow.insertCell(-1);t.registerTableCell(i)}else this._tableRow.appendChild(t.tableCell)},e.prototype.onInsertCellBefore=function(e,t){var i=e._presenter;if(null===i.tableCell){var a=this._tableRow.insertCell(Math.max(0,t._presenter.tableCell.cellIndex-1));i.registerTableCell(a)}else this._tableRow.insertBefore(e._presenter.tableCell,t._presenter.tableCell)},e.prototype.onRemoveCell=function(e){this._tableRow.removeChild(e._presenter.tableCell)},e.prototype.getHeight=function(){return this.getCellHeight(this._row.getTablixCell())},e.prototype.getCellHeight=function(e){return-1},e.prototype.getCellContentHeight=function(e){return-1},Object.defineProperty(e.prototype,"tableRow",{get:function(){return this._tableRow},enumerable:!0,configurable:!0}),e}();t.TablixRowPresenter=n;var s=function(e){function t(t,i){e.call(this,i),this._gridPresenter=t}return __extends(t,e),t.prototype.getCellHeight=function(e){return e.containerHeight},t.prototype.getCellContentHeight=function(e){return e.contentHeight},t}(n);t.DashboardRowPresenter=s;var l=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.getCellHeight=function(e){return e.containerHeight},t.prototype.getCellContentHeight=function(e){return e.contentHeight},t}(n);t.CanvasRowPresenter=l;var c=function(){function e(){}return e.prototype.initialize=function(e){this._column=e},e.prototype.getWidth=function(){return this.getCellWidth(this._column.getTablixCell())},e.prototype.getCellWidth=function(e){return-1},e.prototype.getCellContentWidth=function(e){return-1},e}();t.TablixColumnPresenter=c;var u=function(e){function t(t){e.call(this),this._gridPresenter=t}return __extends(t,e),t.prototype.getCellWidth=function(e){return this._gridPresenter.sizeComputationManager.cellWidth},t.prototype.getCellContentWidth=function(e){return this._gridPresenter.sizeComputationManager.contentWidth},t}(c);t.DashboardColumnPresenter=u;var h=function(t){function i(e,i){t.call(this),this._gridPresenter=e,this._columnIndex=i}return __extends(i,t),i.prototype.getCellWidth=function(t){var i=this._gridPresenter.getPersistedCellWidth(this._columnIndex);return _.isNumber(i)?i:t._presenter?e.HTMLElementUtils.getElementWidth(t._presenter.tableCell):0},i.prototype.getCellContentWidth=function(t){var i=this._gridPresenter.getPersistedCellWidth(this._columnIndex);if(_.isNumber(i))return i;if(!t._presenter)return 0;var a=e.HTMLElementUtils.getElementWidth(t._presenter.contentElement);return a>0&&1===t.colSpan&&(a+=1),a},i}(c);t.CanvasColumnPresenter=h;var d=function(){function a(e){this._table=t.TablixUtils.createTable(),this._table.className=i,this._footerTable=t.TablixUtils.createTable(),this._footerTable.className=i,this._columnWidthManager=e}return a.prototype.initialize=function(e,t,i,a){this._owner=e,t.appendChild(this._table),i.appendChild(this._footerTable)},a.prototype.getWidth=function(){return-1},a.prototype.getHeight=function(){return-1},a.prototype.getScreenToCssRatioX=function(){return 1},a.prototype.getScreenToCssRatioY=function(){return 1},a.prototype.createRowPresenter=function(){return null},a.prototype.createColumnPresenter=function(e){return null},a.prototype.onAppendRow=function(e){var t=e.presenter;if(null===t.tableRow){var i=this._table.insertRow(-1);t.registerRow(i)}else this._table.tBodies[0].appendChild(e.presenter.tableRow)},a.prototype.onInsertRowBefore=function(e,t){var i=e.presenter;if(null===i.tableRow){var a=this._table.insertRow(Math.max(0,t.presenter.tableRow.rowIndex-1));i.registerRow(a)}else this._table.tBodies[0].insertBefore(e.presenter.tableRow,t.presenter.tableRow)},a.prototype.onRemoveRow=function(e){this._table.tBodies[0].removeChild(e.presenter.tableRow)},a.prototype.onAddFooterRow=function(e){var t=e.presenter;if(null===t.tableRow){var i=this._footerTable.insertRow(-1);t.registerRow(i)}else this._footerTable.tBodies[0].appendChild(e.presenter.tableRow)},a.prototype.onClear=function(){e.HTMLElementUtils.clearChildren(this._table),e.HTMLElementUtils.clearChildren(this._footerTable)},a.prototype.onFillColumnsProportionallyChanged=function(e){e?(this._table.style.width="100%",this._footerTable.style.width="100%"):(this._table.style.width="auto",this._footerTable.style.width="auto")},a.prototype.invokeColumnResizeEndCallback=function(e,t){this._columnWidthManager&&this._columnWidthManager.onColumnWidthChanged(e,t)},a.prototype.getPersistedCellWidth=function(e){return this._columnWidthManager?this._columnWidthManager.getPersistedColumnWidth(e):void 0},a}();t.TablixGridPresenter=d;var p=function(e){function t(t){e.call(this),this._sizeComputationManager=t}return __extends(t,e),t.prototype.createRowPresenter=function(){return new s(this,this._owner.fillColumnsProportionally)},t.prototype.createColumnPresenter=function(e){return new u(this)},Object.defineProperty(t.prototype,"sizeComputationManager",{get:function(){return this._sizeComputationManager},enumerable:!0,configurable:!0
13}),t.prototype.getWidth=function(){return this._sizeComputationManager.gridWidth},t.prototype.getHeight=function(){return this._sizeComputationManager.gridHeight},t}(d);t.DashboardTablixGridPresenter=p;var g=function(t){function i(e){t.call(this,e)}return __extends(i,t),i.prototype.createRowPresenter=function(){return new l(this._owner.fillColumnsProportionally)},i.prototype.createColumnPresenter=function(e){return new h(this,e)},i.prototype.getWidth=function(){return e.HTMLElementUtils.getElementWidth(this._table)},i.prototype.getHeight=function(){return e.HTMLElementUtils.getElementHeight(this._table)},i}(d);t.CanvasTablixGridPresenter=g}(t=e.internal||(e.internal={}))}(t=e.controls||(e.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){var i;!function(t){var i=function(){function e(e){this._binder=e,this._adjustmentFactor=1}return e.prototype._getOwner=function(){return null},Object.defineProperty(e.prototype,"binder",{get:function(){return this._binder},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"adjustmentFactor",{get:function(){return this._adjustmentFactor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemsToRealizeCount",{get:function(){return this._itemsToRealizeCount},set:function(e){this._itemsToRealizeCount=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemsEstimatedContextualWidth",{get:function(){return this._itemsEstimatedContextualWidth},set:function(e){this._itemsEstimatedContextualWidth=e},enumerable:!0,configurable:!0}),e.prototype.onStartRenderingIteration=function(){var e=this._getOwner();e.measureEnabled&&!e.done&&this._getEstimatedItemsToRealizeCount(),this._realizedLeavesCount=0},e.prototype.onEndRenderingIteration=function(e,t){t||this._getOwner().allItemsRealized||(this._adjustmentFactor*=this._getSizeAdjustment(e))},e.prototype.onEndRenderingSession=function(){this._adjustmentFactor=1},e.prototype.onCornerCellRealized=function(e,t){},e.prototype.onHeaderRealized=function(e,t,i){i&&this._realizedLeavesCount++},Object.defineProperty(e.prototype,"needsToRealize",{get:function(){return this._realizedLeavesCount<this._itemsToRealizeCount},enumerable:!0,configurable:!0}),e.prototype._getEstimatedItemsToRealizeCount=function(){},e.prototype._getSizeAdjustment=function(e){return 1},e}();t.TablixDimensionRealizationManager=i;var a=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),Object.defineProperty(t.prototype,"owner",{set:function(e){this._owner=e},enumerable:!0,configurable:!0}),t.prototype._getOwner=function(){return this._owner},t.prototype._getEstimatedItemsToRealizeCount=function(){this.estimateRowsToRealizeCount()},t.prototype.estimateRowsToRealizeCount=function(){return this._owner.dimension.model?void(this._owner.alignToEnd?this.itemsToRealizeCount=this._owner.dimension.getItemsCount()-this._owner.dimension.getIntegerScrollOffset()+1:this.itemsToRealizeCount=Math.ceil(this._owner.contextualWidthToFill/(this._owner.owner.getEstimatedRowHeight()*this.adjustmentFactor)+this._owner.dimension.getFractionScrollOffset())-this._owner.otherLayoutManager.dimension.getDepth()+1):void(this.itemsToRealizeCount=0)},t.prototype.getEstimatedRowHierarchyWidth=function(){if(!this._owner.dimension.model||0===this._owner.dimension.getItemsCount())return 0;var e=new o;this.updateRowHiearchyEstimatedWidth(this._owner.dimension.model,this._owner.dimension._hierarchyNavigator.getIndex(this._owner.dimension.getFirstVisibleItem(0)),e);for(var t=e.items,i=t.length,a=0,r=0;i>r;r++){var n=t[r];a+=0!==n.maxNonLeafWidth?n.maxNonLeafWidth:n.maxLeafWidth}return a},t.prototype.updateRowHiearchyEstimatedWidth=function(e,t,i){for(var a=this._owner.owner.owner.hierarchyNavigator,r=this.binder,o=a.getCount(e),s=t;o>s;s++){if(i.leafCount===this.itemsToRealizeCount)return;var l=a.getAt(e,s),c=r.getHeaderLabel(l),u=this._owner.getEstimatedHeaderWidth(c,t),h=a.isLeaf(l),d=a.getLevel(l),p=i.items[d];p||(p=new n,i.items[d]=p),h?(p.maxLeafWidth=Math.max(p.maxLeafWidth,u),i.leafCount=i.leafCount+1):(p.maxNonLeafWidth=Math.max(p.maxNonLeafWidth,u),this.updateRowHiearchyEstimatedWidth(a.getChildren(l),this._owner.dimension.getFirstVisibleChildIndex(l),i))}},t.prototype._getSizeAdjustment=function(e){return e/((this._owner.getRealizedItemsCount()-this._owner.dimension.getFractionScrollOffset())*this._owner.owner.getEstimatedRowHeight())},t}(i);t.RowRealizationManager=a;var r=function(i){function a(){i.apply(this,arguments)}return __extends(a,i),Object.defineProperty(a.prototype,"owner",{set:function(e){this._owner=e},enumerable:!0,configurable:!0}),a.prototype._getOwner=function(){return this._owner},a.prototype._getEstimatedItemsToRealizeCount=function(){this.estimateColumnsToRealizeCount(this.getEstimatedRowHierarchyWidth())},Object.defineProperty(a.prototype,"rowRealizationManager",{get:function(){return this._owner.otherLayoutManager.realizationManager},enumerable:!0,configurable:!0}),a.prototype.getEstimatedRowHierarchyWidth=function(){return this._owner.otherLayoutManager.done?this._owner.getOtherHierarchyContextualHeight():this.rowRealizationManager.getEstimatedRowHierarchyWidth()*this.adjustmentFactor},a.prototype.estimateColumnsToRealizeCount=function(i){var a=this._owner.contextualWidthToFill-i;if(!this._owner.dimension.model||e.Double.lessOrEqualWithPrecision(a,0,t.DimensionLayoutManager._pixelPrecision))return void(this.itemsToRealizeCount=0);var r=this.binder,o=this._owner.owner.owner.hierarchyNavigator,n=this._owner.dimension.getIntegerScrollOffset(),s=this._owner.dimension.getItemsCount(),l=s-n,c=this._owner.otherLayoutManager.dimension.getIntegerScrollOffset(),u=this._owner.otherLayoutManager.dimension.getItemsCount();if(this.itemsEstimatedContextualWidth=0,this._owner.alignToEnd)return void(this.itemsToRealizeCount=l);for(var h=n;s>h;h++){if(e.Double.greaterOrEqualWithPrecision(this.itemsEstimatedContextualWidth,a,t.DimensionLayoutManager._pixelPrecision))return void(this.itemsToRealizeCount=h-n);var d=0,p=void 0;p=h===n?this._owner.getVisibleSizeRatio():1;var g=o.getLeafAt(this._owner.dimension.model,h),m=r.getHeaderLabel(g);d=Math.max(d,this._owner.getEstimatedHeaderWidth(m,h));for(var f=c;u>f;f++){var y=o.getIntersection(o.getLeafAt(this._owner.otherLayoutManager.dimension.model,f),g);m=r.getCellContent(y),d=Math.max(d,this._owner.getEstimatedBodyCellWidth(m))}this.itemsEstimatedContextualWidth+=d*p*this.adjustmentFactor}this.itemsToRealizeCount=l},a.prototype._getSizeAdjustment=function(e){return e/(this.getEstimatedRowHierarchyWidth()+this.itemsEstimatedContextualWidth)},a}(i);t.ColumnRealizationManager=r;var o=function(){function e(){this.items=[],this.leafCount=0}return e}();t.RowWidths=o;var n=function(){function e(){this.maxLeafWidth=0,this.maxNonLeafWidth=0}return e}();t.RowWidth=n}(i=t.internal||(t.internal={}))}(i=t.controls||(t.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){var t;!function(e){var t=function(){function t(t,i,a){this._scrollable=!1,this._presenter=t,this.extension=i,this._presenter.initialize(this),this._row=a,this.item=null,this.type=null,this._horizontalOffset=0,this._verticalOffset=0,this._colSpan=1,this._rowSpan=1,this._containerWidth=-1,this._containerHeight=-1,this.contentHeight=this.contentWidth=0,this.position=new e.TablixUtils.CellPosition}return t.prototype.unfixRowHeight=function(){this._row.unfixSize()},Object.defineProperty(t.prototype,"colSpan",{get:function(){return this._colSpan},set:function(e){this._colSpan!==e&&(this._presenter.onColumnSpanChanged(e),this._colSpan=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowSpan",{get:function(){return this._rowSpan},set:function(e){this._rowSpan!==e&&(this._presenter.onRowSpanChanged(e),this._rowSpan=e,this._row.unfixSize())},enumerable:!0,configurable:!0}),t.prototype.getCellSpanningHeight=function(){return this._row.getCellSpanningHeight(this)},Object.defineProperty(t.prototype,"textAlign",{get:function(){return this._textAlign},set:function(e){e!==this._textAlign&&(this._presenter.onTextAlignChanged(e),this._textAlign=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"horizontalOffset",{get:function(){return this._horizontalOffset},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"verticalOffset",{get:function(){return this._verticalOffset},enumerable:!0,configurable:!0}),t.prototype.isScrollable=function(){return this._scrollable},t.prototype.clear=function(){this.isScrollable()&&this.initializeScrolling(),this._presenter.onClear(),this.setContainerWidth(-1),this.setContainerHeight(-1),this.contentHeight=this.contentWidth=0},t.prototype.initializeScrolling=function(){this._presenter.onInitializeScrolling(),this._horizontalOffset=0,this._verticalOffset=0,1===this.colSpan&&this.setContainerWidth(-1),1===this.rowSpan&&this.setContainerHeight(-1)},t.prototype.prepare=function(e){this.isScrollable()&&this.initializeScrolling(),this._scrollable=e},t.prototype.scrollVertically=function(e,t){var i=Math.ceil(-e*t);this._verticalOffset=i,this.isScrollable()?(this._presenter.onVerticalScroll(e,i),this.setContainerHeight(e+i)):this.setContainerHeight(this._row.getCellSpanningHeight(this)+i)},t.prototype.scrollHorizontally=function(e,t){if(this.isScrollable()){var i=Math.ceil(-e*t);this._horizontalOffset=i,this._presenter.onHorizontalScroll(e,i),this.setContainerWidth(e+i)}},t.prototype.setContainerWidth=function(e){e!==this._containerWidth&&(this._containerWidth=e,this._presenter.onContainerWidthChanged(e))},Object.defineProperty(t.prototype,"containerWidth",{get:function(){return this._containerWidth},enumerable:!0,configurable:!0}),t.prototype.setContainerHeight=function(e){0>e&&(e=-1),e!==this._containerHeight&&(this._containerHeight=e,this._presenter.onContinerHeightChanged(e))},Object.defineProperty(t.prototype,"containerHeight",{get:function(){return this._containerHeight},enumerable:!0,configurable:!0}),t.prototype.applyStyle=function(e){e&&(e.applyStyle(this),this.contentHeight+=e.getExtraBottom()+e.getExtraTop(),this.contentWidth+=e.getExtraLeft()+e.getExtraRight())},t.prototype.enableHorizontalResize=function(e,t){this._presenter.enableHorizontalResize(e,t)},t}();e.TablixCell=t;var i=function(){function e(e,t){this._presenter=e,this._presenter.initialize(this),this._containerWidth=-1,this._width=-1,this._sizeFixed=!1,this._aligningWidth=-1,this._fixedToAligningWidth=!1,this._items=[],this._itemType=null,this._footerCell=null,this._columnIndex=t}return e.prototype.initialize=function(e){this._owner=e,this._realizedRowHeaders=[],this._realizedColumnHeaders=[],this._realizedCornerCells=[],this._realizedBodyCells=[]},Object.defineProperty(e.prototype,"owner",{get:function(){return this._owner},enumerable:!0,configurable:!0}),e.prototype.getType=function(){return this._realizedCornerCells.length>0?0:2},e.prototype.getColumnHeadersOrCorners=function(){return this._realizedCornerCells.length>0?this._realizedCornerCells:this._realizedColumnHeaders},e.prototype.columnHeadersOrCornersEqual=function(e,t,i){if(this._items.length!==t.length)return!1;for(var a=this._items.length,r=0;a>r;r++)if(!this.columnHeaderOrCornerEquals(this._itemType,this._items[r],e,t[r].item,i))return!1;return!0},Object.defineProperty(e.prototype,"itemType",{get:function(){return this._itemType},enumerable:!0,configurable:!0}),e.prototype.getLeafItem=function(){return 0===this._items.length?null:this._items[this._items.length-1]},e.prototype.columnHeaderOrCornerEquals=function(e,t,i,a,r){if(e!==i)return!1;if(0===e){if(!r.cornerCellItemEquals(t,a))return!1}else if(!r.headerItemEquals(t,a))return!1;return!0},e.prototype.OnLeafRealized=function(e){var t=this.getType(),i=this.getColumnHeadersOrCorners();if(this.columnHeadersOrCornersEqual(t,i,e))this.clearSpanningCellsWidth(this._realizedColumnHeaders);else{var a=i.length;this._items=[];for(var r=0;a>r;r++)this._items.push(i[r].item);this._itemType=t,this.clearSize()}},e.prototype.clearSpanningCellsWidth=function(e){for(var t=0;t<e.length;t++){var i=e[t];i.colSpan>1&&i.setContainerWidth(-1)}},e.prototype.addCornerCell=function(e){e._column=this,this._realizedCornerCells.push(e),e.setContainerWidth(this._containerWidth)},e.prototype.addRowHeader=function(e){e._column=this,this._realizedRowHeaders.push(e),e.setContainerWidth(this._containerWidth)},e.prototype.addColumnHeader=function(e,t){e._column=this,this._realizedColumnHeaders.push(e),t&&e.setContainerWidth(this._containerWidth)},e.prototype.addBodyCell=function(e){e._column=this,this._realizedBodyCells.push(e),e.setContainerWidth(this._containerWidth)},Object.defineProperty(e.prototype,"footer",{get:function(){return this._footerCell},set:function(e){this._footerCell=e,e._column=this,e.setContainerWidth(this._containerWidth)},enumerable:!0,configurable:!0}),e.prototype.onResize=function(e){e!==this.getContentContextualWidth()&&(this._containerWidth=e,this.setContainerWidth(this._containerWidth),this._sizeFixed=!0,this._fixedToAligningWidth=!1,this._aligningWidth=-1)},e.prototype.onResizeEnd=function(e){var t=this.owner._presenter;t&&t.invokeColumnResizeEndCallback(this._columnIndex,e)},e.prototype.fixSize=function(){var e=-1!==this._aligningWidth,t=e!==this._fixedToAligningWidth;(!this._sizeFixed||t||e)&&(-1===this._aligningWidth?this.setContainerWidth(this._containerWidth):this.setContainerWidth(this._aligningWidth),this._sizeFixed=!0,this._fixedToAligningWidth=-1!==this._aligningWidth)},e.prototype.clearSize=function(){this._containerWidth=-1,this.setContainerWidth(this._containerWidth),this._sizeFixed=!1},e.prototype.getContentContextualWidth=function(){return this._containerWidth},e.prototype.getCellIContentContextualWidth=function(e){return this._presenter.getCellContentWidth(e)},e.prototype.getCellSpanningWidthWithScrolling=function(e,t){var i=this.getContextualWidth()+this.getScrollingOffset();if(e.colSpan>1)for(var a=this.getIndex(t),r=t.realizedColumns,o=1;o<e.colSpan;o++)i+=r[o+a].getContextualWidth();return i},e.prototype.getScrollingOffset=function(){var e=0;return this._realizedColumnHeaders.length>0&&(e=this._realizedColumnHeaders[this._realizedColumnHeaders.length-1].horizontalOffset),e},e.prototype.getContextualWidth=function(){return-1!==this._width&&-1!==this._containerWidth||(this._width=this._presenter.getWidth()),this._width},e.prototype.calculateSize=function(){if(this._sizeFixed)return this._containerWidth;for(var e=0,t=0,i=this._realizedColumnHeaders;t<i.length;t++){var a=i[t];1===a.colSpan&&(e=Math.max(e,this._presenter.getCellContentWidth(a)))}for(var r=0,o=this._realizedRowHeaders;r<o.length;r++){var a=o[r];1===a.colSpan&&(e=Math.max(e,this._presenter.getCellContentWidth(a)))}for(var n=0,s=this._realizedCornerCells;n<s.length;n++){var a=s[n];e=Math.max(e,this._presenter.getCellContentWidth(a))}for(var l=0,c=this._realizedBodyCells;l<c.length;l++){var a=c[l];e=Math.max(e,this._presenter.getCellContentWidth(a))}return null!==this._footerCell&&1===this._footerCell.colSpan&&(e=Math.max(e,this._presenter.getCellContentWidth(this._footerCell))),this._containerWidth=e},e.prototype.setAligningContextualWidth=function(e){this._aligningWidth=e},e.prototype.getAligningContextualWidth=function(){return this._aligningWidth},e.prototype.setContainerWidth=function(e){for(var t=0,i=this._realizedColumnHeaders;t<i.length;t++){var a=i[t];1===a.colSpan&&a.setContainerWidth(e)}for(var r=0,o=this._realizedRowHeaders;r<o.length;r++){var a=o[r];1===a.colSpan&&a.setContainerWidth(e)}for(var n=0,s=this._realizedCornerCells;n<s.length;n++){var a=s[n];a.setContainerWidth(e)}for(var l=0,c=this._realizedBodyCells;l<c.length;l++){var a=c[l];a.setContainerWidth(e)}null!==this._footerCell&&1===this._footerCell.colSpan&&this._footerCell.setContainerWidth(e),this._width=e},e.prototype.getTablixCell=function(){var e=this._realizedColumnHeaders.length>0?this._realizedColumnHeaders:this._realizedCornerCells;return e[e.length-1]},e.prototype.getIndex=function(e){return e.realizedColumns.indexOf(this)},e.prototype.getHeaders=function(){return this._realizedColumnHeaders},e.prototype.getOtherDimensionHeaders=function(){return this._realizedRowHeaders},e.prototype.getCellContextualSpan=function(e){return e.colSpan},e.prototype.getOtherDimensionOwner=function(e){return e._row},e}();e.TablixColumn=i;var a=function(){function e(e){this._containerHeight=-1,this._presenter=e,this._presenter.initialize(this),this._allocatedCells=[],this._heightFixed=!1,this._containerHeight=-1,this._height=-1}return e.prototype.initialize=function(e){this._owner=e,this._realizedRowHeaders=[],this._realizedBodyCells=[],this._realizedCornerCells=[],this._realizedColumnHeaders=[],this._realizedCellsCount=0},Object.defineProperty(e.prototype,"presenter",{get:function(){return this._presenter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"owner",{get:function(){return this._owner},enumerable:!0,configurable:!0}),e.prototype.releaseUnusedCells=function(e){this.releaseCells(e,this._realizedCellsCount)},e.prototype.releaseAllCells=function(e){this.releaseCells(e,0)},e.prototype.releaseCells=function(e,t){for(var i=this._allocatedCells,a=i.length,r=t;a>r;r++){var o=i[r];e._unbindCell(o),o.clear()}},e.prototype.moveScrollableCellsToEnd=function(e){for(var t=Math.max(this._realizedRowHeaders.length,this._realizedCornerCells.length),i=t;t+e>i;i++){var a=this._allocatedCells[i];this._presenter.onRemoveCell(a),this._presenter.onAppendCell(a),this._allocatedCells.push(a)}this._allocatedCells.splice(t,e)},e.prototype.moveScrollableCellsToStart=function(e){for(var t=Math.max(this._realizedRowHeaders.length,this._realizedCornerCells.length),i=t;t+e>i;i++){var a=this._allocatedCells.pop();this._presenter.onRemoveCell(a),this._presenter.onInsertCellBefore(a,this._allocatedCells[t]),this._allocatedCells.splice(t,0,a)}},e.prototype.getOrCreateCornerCell=function(e){var t=this.getOrCreateCell();return t.prepare(!1),e.addCornerCell(t),this._realizedCornerCells.push(t),t.setContainerHeight(this._containerHeight),t},e.prototype.getOrCreateRowHeader=function(e,t,i){var a=this.getOrCreateCell();return a.prepare(t),e.addRowHeader(a),this._realizedRowHeaders.push(a),i&&a.setContainerHeight(this._containerHeight),a},e.prototype.getOrCreateColumnHeader=function(e,t,i){var a=this.getOrCreateCell();return a.prepare(t),e.addColumnHeader(a,i),this._realizedColumnHeaders.push(a),a.setContainerHeight(this._containerHeight),a},e.prototype.getOrCreateBodyCell=function(e,t){var i=this.getOrCreateCell();return i.prepare(t),e.addBodyCell(i),this._realizedBodyCells.push(i),i.setContainerHeight(this._containerHeight),i},e.prototype.getOrCreateFooterRowHeader=function(e){var t=this.getOrCreateCell();return t.prepare(!1),e.footer=t,this._realizedRowHeaders.push(t),t.setContainerHeight(this._containerHeight),t},e.prototype.getOrCreateFooterBodyCell=function(e,t){var i=this.getOrCreateCell();return i.prepare(t),e.footer=i,this._realizedBodyCells.push(i),i.setContainerHeight(this._containerHeight),i},e.prototype.getRowHeaderLeafIndex=function(){for(var e=-1,t=this._allocatedCells.length,i=0;t>i&&1===this._allocatedCells[i].type;i++)e++;return e},e.prototype.getAllocatedCellAt=function(e){return this._allocatedCells[e]},e.prototype.moveCellsBy=function(e){if(0!==this._allocatedCells.length)if(e>0)for(var t=this._allocatedCells[0],i=0;e>i;i++){var a=this.createCell(this);this._presenter.onInsertCellBefore(a,t),this._allocatedCells.unshift(a),t=a}else{e=-e;for(var i=0;e>i;i++)this._presenter.onRemoveCell(this._allocatedCells[i]);this._allocatedCells.splice(0,e)}},e.prototype.getRealizedCellCount=function(){return this._realizedCellsCount},e.prototype.getRealizedHeadersCount=function(){return this._realizedRowHeaders.length},e.prototype.getRealizedHeaderAt=function(e){return this._realizedRowHeaders[e]},e.prototype.getTablixCell=function(){var e;return e=this._realizedRowHeaders.length>0?this._realizedRowHeaders:this._realizedCornerCells.length>0?this._realizedCornerCells:this._realizedColumnHeaders,e[e.length-1]},e.prototype.getOrCreateEmptySpaceCell=function(){var e=this._allocatedCells[this._realizedCellsCount];return void 0===e&&(e=this.createCell(this),this._allocatedCells[this._realizedCellsCount]=e,this._presenter.onAppendCell(e)),e},e.prototype.createCell=function(e){var i=this._presenter.createCellPresenter(this._owner.owner.layoutManager.getLayoutKind());return new t(i,i,this)},e.prototype.getOrCreateCell=function(){var e=this._allocatedCells[this._realizedCellsCount];return void 0===e?(e=this.createCell(this),this._allocatedCells[this._realizedCellsCount]=e,this._presenter.onAppendCell(e)):(e.colSpan=1,e.rowSpan=1),this._realizedCellsCount=this._realizedCellsCount+1,e},e.prototype.onResize=function(e){e!==this.getContentContextualWidth()&&(this._containerHeight=e,this.setContentHeight(),this._heightFixed=!0,this.setAligningContextualWidth(-1))},e.prototype.onResizeEnd=function(e){},e.prototype.fixSize=function(){this.sizeFixed()||(this.setContentHeight(),this._heightFixed=!0)},e.prototype.unfixSize=function(){this._heightFixed=!1,this._height=-1},e.prototype.getContentContextualWidth=function(){return this._containerHeight},e.prototype.getCellIContentContextualWidth=function(e){return this.presenter.getCellContentHeight(e)},e.prototype.getCellSpanningHeight=function(e){var t=this.getContextualWidth();if(e.rowSpan>1)for(var i=this.getIndex(this.owner),a=this.owner.realizedRows,r=1;r<e.rowSpan;r++)t+=a[r+i].getContextualWidth();return t},e.prototype.getContextualWidth=function(){return-1!==this._height&&-1!==this._containerHeight||(this._height=this._presenter.getHeight()),this._height},e.prototype.sizeFixed=function(){return this._heightFixed},e.prototype.calculateSize=function(){if(this._heightFixed)return this._containerHeight;for(var e=0,t=this._realizedRowHeaders.length,i=0;t>i;i++){var a=this._realizedRowHeaders[i];1===a.rowSpan&&(e=Math.max(e,this._presenter.getCellContentHeight(a)))}t=this._realizedCornerCells.length;for(var i=0;t>i;i++)e=Math.max(e,this._presenter.getCellContentHeight(this._realizedCornerCells[i]));t=this._realizedColumnHeaders.length;for(var i=0;t>i;i++){var a=this._realizedColumnHeaders[i];1===a.rowSpan&&(e=Math.max(e,this._presenter.getCellContentHeight(a)))}t=this._realizedBodyCells.length;for(var i=0;t>i;i++)e=Math.max(e,this._presenter.getCellContentHeight(this._realizedBodyCells[i]));return this._containerHeight=e},e.prototype.setAligningContextualWidth=function(e){},e.prototype.getAligningContextualWidth=function(){return-1},e.prototype.setContentHeight=function(){for(var e=this._realizedRowHeaders.length,t=e-1;t>=0;t--){var i=this._realizedRowHeaders[t];i.setContainerHeight(this._containerHeight),i.rowSpan>1&&i.setContainerHeight(this.getCellSpanningHeight(i))}e=this._realizedCornerCells.length;for(var t=0;e>t;t++)this._realizedCornerCells[t].setContainerHeight(this._containerHeight);e=this._realizedColumnHeaders.length;for(var t=0;e>t;t++){var i=this._realizedColumnHeaders[t];i.setContainerHeight(this._containerHeight),i.rowSpan>1&&i.setContainerHeight(this.getCellSpanningHeight(i))}e=this._realizedBodyCells.length;for(var t=0;e>t;t++)this._realizedBodyCells[t].setContainerHeight(this._containerHeight);this._height=-1},e.prototype.getIndex=function(e){return e.realizedRows.indexOf(this)},e.prototype.getHeaders=function(){return this._realizedRowHeaders},e.prototype.getOtherDimensionHeaders=function(){return this._realizedColumnHeaders},e.prototype.getCellContextualSpan=function(e){return e.rowSpan},e.prototype.getOtherDimensionOwner=function(e){return e._column},e}();e.TablixRow=a;var r=function(){function e(e){this._presenter=e,this._footerRow=null}return e.prototype.initialize=function(e,t,i){this._owner=e,this._presenter.initialize(this,t,i,e),this.fillColumnsProportionally=!1,this._realizedRows=[],this._realizedColumns=[],this._emptySpaceHeaderCell=null,this._emptyFooterSpaceCell=null},Object.defineProperty(e.prototype,"owner",{get:function(){return this._owner},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillColumnsProportionally",{get:function(){return this._fillColumnsProportionally},set:function(e){this._fillColumnsProportionally!==e&&(this._fillColumnsProportionally=e,this._presenter.onFillColumnsProportionallyChanged(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"realizedColumns",{get:function(){return this._realizedColumns},set:function(e){this._realizedColumns=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"realizedRows",{get:function(){return this._realizedRows},set:function(e){this._realizedRows=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footerRow",{get:function(){return this._footerRow},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptySpaceHeaderCell",{get:function(){return this._emptySpaceHeaderCell},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptySpaceFooterCell",{get:function(){return this._emptyFooterSpaceCell},enumerable:!0,configurable:!0}),e.prototype.ShowEmptySpaceCells=function(e,t){0!==this._realizedRows.length&&(0===this._realizedRows.length||this._emptySpaceHeaderCell||(this._emptySpaceHeaderCell=this._realizedRows[0].getOrCreateEmptySpaceCell(),this._emptySpaceHeaderCell.rowSpan=e,this._emptySpaceHeaderCell.colSpan=1,this._emptySpaceHeaderCell.setContainerWidth(t)),this._footerRow&&null===this._emptyFooterSpaceCell&&(this._emptyFooterSpaceCell=this._footerRow.getOrCreateEmptySpaceCell(),this._emptyFooterSpaceCell.rowSpan=1,this._emptyFooterSpaceCell.colSpan=1,this._emptyFooterSpaceCell.setContainerWidth(t)))},e.prototype.HideEmptySpaceCells=function(){this._emptySpaceHeaderCell&&(this._emptySpaceHeaderCell.clear(),this._emptySpaceHeaderCell=null),this._emptyFooterSpaceCell&&(this._emptyFooterSpaceCell.clear(),this._emptyFooterSpaceCell=null)},e.prototype.onStartRenderingSession=function(e){e&&(this.clearRows(),this.clearColumns())},e.prototype.onStartRenderingIteration=function(){this.initializeRows(),this.initializeColumns()},e.prototype.onEndRenderingIteration=function(){var e=this._rows;if(void 0!==e)for(var t=e.length,i=0;t>i;i++)e[i].releaseUnusedCells(this._owner);this._footerRow&&this._footerRow.releaseUnusedCells(this._owner)},e.prototype.getOrCreateRow=function(e){var t=this._rows[e];return void 0===t&&(t=new a(this._presenter.createRowPresenter()),t.initialize(this),this._presenter.onAppendRow(t),this._rows[e]=t),void 0===this._realizedRows[e]&&(this._realizedRows[e]=t),t},e.prototype.getOrCreateFootersRow=function(){return null===this._footerRow&&(this._footerRow=new a(this._presenter.createRowPresenter()),this._footerRow.initialize(this),this._presenter.onAddFooterRow(this._footerRow)),this._footerRow},e.prototype.moveRowsToEnd=function(e,t){for(var i=0;t>i;i++){var a=this._rows[i+e];a.unfixSize(),this._presenter.onRemoveRow(a),this._presenter.onAppendRow(a),this._rows.push(a)}this._rows.splice(e,t)},e.prototype.moveRowsToStart=function(e,t){for(var i=this._rows[e],a=0;t>a;a++){var r=this._rows.pop();r.unfixSize(),this._presenter.onRemoveRow(r),this._presenter.onInsertRowBefore(r,i),this._rows.splice(e+a,0,r)}},e.prototype.moveColumnsToEnd=function(e,t){for(var i=this._rows[0]._realizedCornerCells.length,a=Math.max(this._columns[i]._realizedColumnHeaders.length-1,0),r=a;r<this._rows.length;r++)this._rows[r].moveScrollableCellsToEnd(t);for(var r=0;t>r;r++){var o=this._columns[r+e];this._columns.push(o)}this._columns.splice(e,t)},e.prototype.moveColumnsToStart=function(e,t){for(var i=this._rows[0]._realizedCornerCells.length,a=Math.max(this._columns[i]._realizedColumnHeaders.length-1,0),r=a;r<this._rows.length;r++)this._rows[r].moveScrollableCellsToStart(t);for(var r=0;t>r;r++){var o=this._columns.pop();this._columns.splice(e+r,0,o)}},e.prototype.getOrCreateColumn=function(e){var t=this._columns[e];return void 0===t&&(t=new i(this._presenter.createColumnPresenter(e),e),t.initialize(this),this._columns[e]=t),void 0===this._realizedColumns[e]&&(this._realizedColumns[e]=t),t},e.prototype.initializeColumns=function(){this._columns||(this._columns=[]);for(var e=this._columns.length,t=0;e>t;t++)this._columns[t].initialize(this);this._realizedColumns=[]},e.prototype.clearColumns=function(){this._columns=null,this._realizedColumns=null},e.prototype.initializeRows=function(){var e=this._owner.rowDimension.hasFooter()&&null!==this._footerRow;this._realizedRows=[],this._rows||(this._rows=[]);for(var t=this._rows,i=t.length,a=0;i>a;a++)t[a].initialize(this);e&&(this._footerRow||this.getOrCreateFootersRow(),this._footerRow.initialize(this))},e.prototype.clearRows=function(){var e=this._rows;if(e){for(var t=e.length,i=0;t>i;i++)e[i].releaseAllCells(this._owner);this._footerRow&&this._footerRow.releaseAllCells(this._owner),this._presenter.onClear(),this._footerRow=null,this._rows=null,this._realizedRows=null}},e.prototype.getWidth=function(){return this._presenter.getWidth()},e.prototype.getHeight=function(){return this._presenter.getHeight()},e}();e.TablixGrid=r}(t=e.internal||(e.internal={}))}(t=e.controls||(e.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){var i;!function(i){var a=jsCommon.PixelConverter,r=function(){function e(){}return Object.defineProperty(e.prototype,"visibleWidth",{get:function(){return this._viewport?this._viewport.width:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visibleHeight",{get:function(){return this._viewport?this._viewport.height:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridWidth",{get:function(){return this.visibleWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridHeight",{get:function(){return this.visibleHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowHeight",{get:function(){return this._cellHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellWidth",{get:function(){return this._cellWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellHeight",{get:function(){return this._cellHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentWidth",{get:function(){return this._cellWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentHeight",{get:function(){return this._cellHeight},enumerable:!0,configurable:!0}),e.prototype.updateColumnCount=function(e){this._columnCount=e},e.prototype.updateRowHeight=function(e){this._cellHeight=e},e.prototype.updateScalingFactor=function(e){this._scalingFactor=e,this._cellWidth=this.computeColumnWidth(this._columnCount)},e.prototype.updateViewport=function(e){this._viewport=e,this._cellWidth=this.computeColumnWidth(this._columnCount),this._cellHeight=this.computeColumnHeight()},e.prototype.computeColumnWidth=function(t){var i=this._scalingFactor;i||(i=1);var a=i*e.TablixMinimumColumnWidth,r=Math.floor(this._viewport.width/a);return this.fitToColumnCount(r,t)},e.prototype.computeColumnHeight=function(){if(!this.hasImageContent)return this._cellHeight;var e=this._viewport.width;return 250>=e?20:510>=e?51:770>=e?52:void 0},e.prototype.fitToColumnCount=function(e,t){var i=Math.min(e,t);return Math.floor(this._viewport.width/i)},e.TablixMinimumColumnWidth=75,e}();i.SizeComputationManager=r;var o=function(){function t(e,t,i){this._owner=e,this._grid=t,this._lastScrollOffset=null,this._isScrolling=!1,this._fixedSizeEnabled=!0,this._done=!1,this._realizationManager=i}return Object.defineProperty(t.prototype,"owner",{get:function(){return this._owner},set:function(e){this._owner=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"realizationManager",{get:function(){return this._realizationManager},enumerable:!0,configurable:!0
14}),Object.defineProperty(t.prototype,"fixedSizeEnabled",{get:function(){return this._fixedSizeEnabled},set:function(e){this._fixedSizeEnabled=e},enumerable:!0,configurable:!0}),t.prototype.onCornerCellRealized=function(e,t,i){this._realizationManager.onCornerCellRealized(e,t)},t.prototype.onHeaderRealized=function(e,t,i){this._realizationManager.onHeaderRealized(e,t,i)},Object.defineProperty(t.prototype,"needsToRealize",{get:function(){return this._realizationManager.needsToRealize},enumerable:!0,configurable:!0}),t.prototype.getVisibleSizeRatio=function(){return 1-this.dimension.getFractionScrollOffset()},Object.defineProperty(t.prototype,"alignToEnd",{get:function(){return this._alignToEnd},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"done",{get:function(){return this._done},enumerable:!0,configurable:!0}),t.prototype._requiresMeasure=function(){return!0},t.prototype.startScrollingSession=function(){this._isScrolling=!0},t.prototype.endScrollingSession=function(){this._isScrolling=!1},t.prototype.isScrolling=function(){return this._isScrolling},t.prototype.isResizing=function(){return!1},t.prototype.getOtherHierarchyContextualHeight=function(){var e=this.dimension.otherDimension,t=e.getDepth(),i=0,a=this._getRealizedItems();if(a.length>0)for(var r=0;t>r;r++)i+=a[r].getContextualWidth();return i},t.prototype._isAutoSized=function(){return!1},t.prototype.onStartRenderingSession=function(){this._measureEnabled=this._requiresMeasure(),this._gridOffset=this.dimension.otherDimension.getDepth()},t.prototype.onEndRenderingSession=function(){this._realizationManager.onEndRenderingSession(),this._alignToEnd=!1,this._done=!1,this._measureEnabled=!0,this._sendDimensionsToControl()},t.prototype._sendDimensionsToControl=function(){},Object.defineProperty(t.prototype,"measureEnabled",{get:function(){return this._measureEnabled},enumerable:!0,configurable:!0}),t.prototype.getFooterContextualWidth=function(){return 0},t.prototype.onStartRenderingIteration=function(e,t){this._measureEnabled&&!this._done&&(this._contextualWidthToFill=(t-this.otherScrollbarContextualWidth)*this.getGridScale()-this.getFooterContextualWidth()),this._realizationManager.onStartRenderingIteration(),e?this._lastScrollOffset=null:null!==this._lastScrollOffset&&this.swapElements()},Object.defineProperty(t.prototype,"allItemsRealized",{get:function(){return this.getRealizedItemsCount()-this._gridOffset===this.dimension.getItemsCount()||0===this.dimension.getItemsCount()},enumerable:!0,configurable:!0}),t.prototype.onEndRenderingIteration=function(){if(!this._done){if(!this._measureEnabled)return this._lastScrollOffset=this.dimension.scrollOffset,void(this._done=!0);var i,a=this.getGridContextualWidth(),r=e.Double.greaterOrEqualWithPrecision(a,this._contextualWidthToFill,t._pixelPrecision),o=this.allItemsRealized;i=r?this.scrollForwardToAlignEnd(a):this.scrollBackwardToFill(a),this._realizationManager.onEndRenderingIteration(a,r);var n=this.dimension.scrollbar.visible;this.updateScrollbar(a),this._done=(r||o)&&this.dimension.scrollbar.visible===n&&e.Double.equalWithPrecision(i,this.dimension.scrollOffset,t._scrollOffsetPrecision),this.dimension.scrollOffset=i,this._lastScrollOffset=this.dimension.scrollOffset}},t.prototype.getScrollDeltaWithinPage=function(){if(null!==this._lastScrollOffset){var e=this.dimension.getIntegerScrollOffset()-Math.floor(this._lastScrollOffset);if(Math.abs(e)<this.getRealizedItemsCount()-this.dimension.otherDimension.getDepth())return e}return null},t.prototype.swapElements=function(){var e=this.getScrollDeltaWithinPage();if(null!==e){var t=this.dimension.otherDimension.getDepth();Math.abs(e)<this.getRealizedItemsCount()-t&&(e>0?this._moveElementsToBottom(t,e):0>e&&this._moveElementsToTop(t,-e))}},t.prototype._getRealizedItems=function(){return null},t.prototype.getRealizedItemsCount=function(){var e=this._getRealizedItems();return e.length},t.prototype._moveElementsToBottom=function(e,t){},t.prototype._moveElementsToTop=function(e,t){},t.prototype.isScrollingWithinPage=function(){return null!==this.getScrollDeltaWithinPage()},t.prototype.getGridContextualWidth=function(){return 0},t.prototype.updateScrollbar=function(e){var t=this.dimension.scrollbar;t.viewMin=this.dimension.scrollOffset,t.min=0,t.max=this.dimension.getItemsCount(),t.viewSize=this.getViewSize(e),this.dimension.scrollbar.show(this.canScroll(e))},t.prototype.getViewSize=function(i){var a=this.getRealizedItemsCount();if(0===a)return 0;for(var r=this._gridOffset,o=0,n=0,s=this._contextualWidthToFill,l=s-this.getOtherHierarchyContextualHeight(),c=this.getMeaurementError(i),u=r;a>u;u++){var h=void 0;h=u===r?this.getVisibleSizeRatio():1;var d=this.getItemContextualWidthWithScrolling(u)*c;if(n+=d,o+=h,e.Double.greaterWithPrecision(n,l,t._pixelPrecision)){o-=(n-l)/d*h;break}}return o},t.prototype.isScrollableHeader=function(e,t,i){if(0!==i||0===this.dimension.getFractionScrollOffset())return!1;var a=this.dimension._hierarchyNavigator;if(a.isLeaf(e))return!0;var r=e,o=t;do{if(o=a.getChildren(r),r=this.dimension.getFirstVisibleItem(a.getLevel(r)+1),void 0===r)break;if(!a.isLastItem(r,o))return!1}while(!a.isLeaf(r));return!0},t.prototype.reachedEnd=function(){return this.dimension.getIntegerScrollOffset()+(this.getRealizedItemsCount()-this._gridOffset)>=this.dimension.getItemsCount()},t.prototype.scrollBackwardToFill=function(i){var a=this.dimension.scrollOffset;if(this.reachedEnd()){var r=this._contextualWidthToFill-i;if(this.dimension.getItemsCount()>0){var o=i/(this.getRealizedItemsCount()-this.dimension.getFractionScrollOffset());a=this.dimension.getValidScrollOffset(Math.floor(this.dimension.scrollOffset-r/o))}this._alignToEnd=!e.Double.equalWithPrecision(a,this.dimension.scrollOffset,t._scrollOffsetPrecision)}return a},t.prototype.getItemContextualWidth=function(e){var t=this._getRealizedItems();return e>=t.length?null:t[e].getContextualWidth()},t.prototype.getItemContextualWidthWithScrolling=function(e){return this.getSizeWithScrolling(this.getItemContextualWidth(e),e)},t.prototype.getSizeWithScrolling=function(e,t){var i;return i=this._gridOffset===t?this.getVisibleSizeRatio():1,e*i},t.prototype.getGridContextualWidthFromItems=function(){for(var e=this.getRealizedItemsCount(),t=0,i=0;e>i;i++)t+=this.getItemContextualWidthWithScrolling(i);return t},t.prototype.getMeaurementError=function(e){return e/this.getGridContextualWidthFromItems()},t.prototype.scrollForwardToAlignEnd=function(i){var a=this.dimension.scrollOffset;if(this._alignToEnd){var r=e.Double.equalWithPrecision(i,this._contextualWidthToFill,t._pixelPrecision);if(!r)for(var o=this.getRealizedItemsCount(),n=this._gridOffset,s=i-this._contextualWidthToFill,l=this.getMeaurementError(i),c=n;o>c;c++){var u=this.getItemContextualWidth(c)*l;if(!e.Double.lessWithPrecision(u,s,t._pixelPrecision)){var h=n===c?1-this.dimension.getFractionScrollOffset():1;a=this.dimension.getValidScrollOffset(this.dimension.scrollOffset+(c-n)+s*h/u);break}s-=u}this._alignToEnd=!r}return a},Object.defineProperty(t.prototype,"dimension",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"otherLayoutManager",{get:function(){return this.dimension.otherDimension.layoutManager},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contextualWidthToFill",{get:function(){return this._contextualWidthToFill},enumerable:!0,configurable:!0}),t.prototype.getGridScale=function(){return 0},Object.defineProperty(t.prototype,"otherScrollbarContextualWidth",{get:function(){return 0},enumerable:!0,configurable:!0}),t.prototype.getActualContextualWidth=function(e){return this._isAutoSized()&&!this.canScroll(e)?e:this._contextualWidthToFill},t.prototype.canScroll=function(e){return!1},t.prototype.calculateSizes=function(){this.fixedSizeEnabled&&(this.calculateContextualWidths(),this.calculateSpans())},t.prototype._calculateSize=function(e){return null},t.prototype.calculateContextualWidths=function(){for(var e=this._getRealizedItems(),t=e.length,i=0;t>i;i++){var a=e[i];this.measureEnabled&&a.setAligningContextualWidth(-1),this._calculateSize(a)}},t.prototype.calculateSpans=function(){this.measureEnabled&&(this.updateNonScrollableItemsSpans(),this.updateScrollableItemsSpans())},t.prototype.updateNonScrollableItemsSpans=function(){for(var e=this.otherLayoutManager._getRealizedItems(),t=e.length,i=this.dimension.getDepth(),a=i;t>a;a++){var r=e[a];this.updateSpans(r,r.getHeaders())}},t.prototype.updateScrollableItemsSpans=function(){for(var e=this.otherLayoutManager._getRealizedItems(),t=Math.min(this.dimension.getDepth(),e.length),i=0;t>i;i++){var a=e[i];this.updateSpans(a,a.getOtherDimensionHeaders())}},t.prototype.fixSizes=function(){if(this.fixedSizeEnabled)for(var e=this._getRealizedItems(),t=e.length,i=t-1;i>=0;i--)e[i].fixSize()},t.prototype.updateSpans=function(e,t){for(var i=this._getRealizedItems(),a=t.length,r=0;a>r;r++){var o=t[r],n=e.getOtherDimensionOwner(o),s=n.getCellContextualSpan(o);if(s>1)for(var l=0,c=n.getIndex(this._grid),u=0;s>u;u++){var h=i[u+c];l+=h.getContentContextualWidth(),u===s-1&&this.updateLastChildSize(o,h,l)}}},t.prototype.updateLastChildSize=function(e,t,i){var a=t.getCellIContentContextualWidth(e)-i;a>0&&t.setAligningContextualWidth(Math.max(t.getAligningContextualWidth(),a+t.getContentContextualWidth()))},t._pixelPrecision=1.0001,t._scrollOffsetPrecision=.01,t}();i.DimensionLayoutManager=o;var n=function(){function e(e,t,i){this.column=e,this.item=e.getLeafItem(),this.itemType=e.itemType,this.startColumnWidth=t,this.resizingDelta=0,this.animationFrame=null,this.scale=i}return e.prototype.getNewSize=function(){return this.startColumnWidth+this.resizingDelta},e}();i.ResizeState=n;var s=function(e){function i(t,i,a){e.call(this,t,i,a),a.owner=this,this.fillProportionally=!1,this._resizeState=null}return __extends(i,e),Object.defineProperty(i.prototype,"dimension",{get:function(){return this.owner.owner.columnDimension},enumerable:!0,configurable:!0}),i.prototype.isResizing=function(){return null!==this._resizeState},Object.defineProperty(i.prototype,"fillProportionally",{get:function(){return this._grid.fillColumnsProportionally},set:function(e){this._grid.fillColumnsProportionally=e},enumerable:!0,configurable:!0}),i.prototype.getGridScale=function(){return this._grid._presenter.getScreenToCssRatioX()},Object.defineProperty(i.prototype,"otherScrollbarContextualWidth",{get:function(){return this.dimension.otherDimension.scrollbar.visible?t.HTMLElementUtils.getElementWidth(this.dimension.otherDimension.scrollbar.element):0},enumerable:!0,configurable:!0}),i.prototype._getRealizedItems=function(){return this._grid.realizedColumns||(this._grid.realizedColumns=[]),this._grid.realizedColumns},i.prototype._moveElementsToBottom=function(e,t){this._grid.moveColumnsToEnd(e,t)},i.prototype._moveElementsToTop=function(e,t){this._grid.moveColumnsToStart(e,t)},i.prototype._requiresMeasure=function(){return!this.isScrolling()&&!this.otherLayoutManager.isScrolling()||this.isScrolling()||this.isResizing()},i.prototype.getGridContextualWidth=function(){return this._grid.getWidth()},i.prototype.getFirstVisibleColumn=function(){return this._grid.realizedColumns[this._gridOffset]},i.prototype._isAutoSized=function(){return this.owner.owner.autoSizeWidth},i.prototype.applyScrolling=function(){var e=this.dimension.getFractionScrollOffset(),t=0;if(0!==e){var i=this.getFirstVisibleColumn();void 0!==i&&(t=i.getContextualWidth(),this.scroll(i,t,e))}},i.prototype.scroll=function(e,t,i){this.scrollCells(e._realizedColumnHeaders,t,i),this.scrollBodyCells(this._grid.realizedRows,t,i),null!==e.footer&&e.footer.scrollHorizontally(t,i)},i.prototype.scrollCells=function(e,t,i){for(var a=e.length,r=0;a>r;r++)e[r].scrollHorizontally(t,i)},i.prototype.scrollBodyCells=function(e,t,i){for(var a,r,o=e.length,n=0;o>n;n++)a=e[n]._realizedBodyCells,void 0!==a&&(r=a[0],void 0!==r&&r.scrollHorizontally(t,i))},i.prototype.onStartResize=function(e,i,a){this._resizeState=new n(e._column,e._column.getContentContextualWidth(),t.HTMLElementUtils.getAccumulatedScale(this.owner.owner.container))},i.prototype.onResize=function(e,t,a){var r=this;this.isResizing()&&(this._resizeState.resizingDelta=Math.round(Math.max(t/this._resizeState.scale,i.minColumnWidth-this._resizeState.startColumnWidth)),null===this._resizeState.animationFrame&&(this._resizeState.animationFrame=requestAnimationFrame(function(){return r.performResizing()})))},i.prototype.onEndResize=function(e){this.isResizing()&&null!==this._resizeState.animationFrame&&this.performResizing(),this.endResizing(),this._resizeState=null},i.prototype.onReset=function(e){this._resizeState=new n(e._column,-1,1),e._column.clearSize(),this.endResizing(),this.owner.owner.refresh(!1),this._resizeState=null},i.prototype.updateItemToResizeState=function(e){if(null!==this._resizeState)for(var t=e.length,i=this.owner.owner.hierarchyNavigator,a=this.otherLayoutManager.dimension.getDepth(),r=a;t>r;r++){var o=e[r];if(o.columnHeaderOrCornerEquals(this._resizeState.itemType,this._resizeState.item,o.itemType,o.getLeafItem(),i)&&o!==this._resizeState.column){this._resizeState.column=o,o.onResize(this._resizeState.getNewSize());break}}},i.prototype.performResizing=function(){if(null!==this._resizeState){this._resizeState.animationFrame=null;var e=this._resizeState.getNewSize();this._resizeState.column.onResize(e),this.owner.owner.refresh(!1)}},i.prototype.endResizing=function(){if(null!==this._resizeState){var e=this._resizeState.getNewSize();this._resizeState.column.onResizeEnd(e)}},i.prototype._sendDimensionsToControl=function(){var e=this.getGridContextualWidth(),t=this.getActualContextualWidth(e),i=this.getOtherHierarchyContextualHeight(),a=this.getGridScale();this.owner.owner.updateColumnDimensions(i/a,(t-i)/a,this.getViewSize(e))},i.prototype.getEstimatedHeaderWidth=function(e,t){return-1},i.prototype.getEstimatedBodyCellWidth=function(e){return-1},i.minColumnWidth=10,i}(o);i.ColumnLayoutManager=s;var l=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.getEstimatedHeaderWidth=function(e,t){return this.ignoreColumn(t)?0:this.owner.getCellWidth(void 0)},t.prototype.getEstimatedBodyCellWidth=function(e){return this.owner.getCellWidth(void 0)},t.prototype.canScroll=function(e){return!1},t.prototype._calculateSize=function(e){var t=e.getIndex(this._grid),i=0;return this.ignoreColumn(t)||(i=this.owner.getContentWidth(void 0)),e.onResize(i),e.onResizeEnd(i),i},t.prototype.ignoreColumn=function(e){return 0===e&&!this.owner.binder.hasRowGroups()},t}(s);i.DashboardColumnLayoutManager=l;var c=function(t){function i(){t.apply(this,arguments)}return __extends(i,t),i.prototype.getEstimatedHeaderWidth=function(e,t){return this.owner.getEstimatedTextWidth(e)},i.prototype.getEstimatedBodyCellWidth=function(e){return this.owner.getEstimatedTextWidth(e)},i.prototype.calculateContextualWidths=function(){for(var e=this._getRealizedItems(),t=[],i=0,a=e;i<a.length;i++){var r=a[i];this.measureEnabled&&r.setAligningContextualWidth(-1),t.push(this._calculateSize(r))}this.owner.columnWidthsToPersist=t},i.prototype.canScroll=function(t){return!e.Double.equalWithPrecision(this.dimension.scrollOffset,0,o._scrollOffsetPrecision)||this.getRealizedItemsCount()-this._gridOffset<this.dimension.getItemsCount()&&this._contextualWidthToFill>0||e.Double.greaterWithPrecision(t,this._contextualWidthToFill,o._pixelPrecision)},i.prototype._calculateSize=function(e){return e.calculateSize()},i}(s);i.CanvasColumnLayoutManager=c;var u=function(e){function i(t,i,a){e.call(this,t,i,a),a.owner=this}return __extends(i,e),Object.defineProperty(i.prototype,"dimension",{get:function(){return this.owner.owner.rowDimension},enumerable:!0,configurable:!0}),i.prototype.getGridScale=function(){return this._grid._presenter.getScreenToCssRatioY()},Object.defineProperty(i.prototype,"otherScrollbarContextualWidth",{get:function(){return this.dimension.otherDimension.scrollbar.visible?t.HTMLElementUtils.getElementHeight(this.dimension.otherDimension.scrollbar.element):0},enumerable:!0,configurable:!0}),i.prototype.startScrollingSession=function(){e.prototype.startScrollingSession.call(this)},i.prototype._getRealizedItems=function(){return this._grid.realizedRows||(this._grid.realizedRows=[]),this._grid.realizedRows},i.prototype._moveElementsToBottom=function(e,t){this._grid.moveRowsToEnd(e,t)},i.prototype._moveElementsToTop=function(e,t){this._grid.moveRowsToStart(e,t)},i.prototype._requiresMeasure=function(){return!this.isScrolling()&&!this.otherLayoutManager.isScrolling()&&!this.otherLayoutManager.isResizing()||this.isScrolling()&&this.dimension.getIntegerScrollOffset()+(this.getRealizedItemsCount()-this._gridOffset)>=this.dimension.getItemsCount()},i.prototype.getGridContextualWidth=function(){return this._grid.getHeight()},i.prototype.getFirstVisibleRow=function(){return this._grid.realizedRows[this._gridOffset]},i.prototype._isAutoSized=function(){return this.owner.owner.autoSizeHeight},i.prototype.applyScrolling=function(){var e=this.dimension.getFractionScrollOffset(),t=0;if(0!==e){var i=this.getFirstVisibleRow();i&&(t=i.getContextualWidth(),this.scroll(i,t,e))}},i.prototype.scroll=function(e,t,i){this.scrollCells(e._realizedRowHeaders,t,i),this.scrollCells(e._realizedBodyCells,t,i)},i.prototype.scrollCells=function(e,t,i){for(var a=e.length,r=0;a>r;r++)e[r].scrollVertically(t,i)},i.prototype.getFooterContextualWidth=function(){return this.owner.owner.rowDimension.hasFooter()&&this.owner.grid.footerRow?this.owner.grid.footerRow.getContextualWidth():0},i.prototype.calculateContextualWidths=function(){if(e.prototype.calculateContextualWidths.call(this),this.fixedSizeEnabled){var t=this._grid.footerRow;t&&this._calculateSize(t)}},i.prototype.fixSizes=function(){e.prototype.fixSizes.call(this),this.fixedSizeEnabled&&this._grid.footerRow&&this._grid.footerRow.fixSize()},i.prototype._sendDimensionsToControl=function(){var e=this.getGridContextualWidth(),t=this.getActualContextualWidth(e),i=this.getOtherHierarchyContextualHeight(),a=this.getGridScale();this.owner.owner.updateRowDimensions(i/a,(t-i)/a,e/a,this.getViewSize(e),this._grid.footerRow?this._grid.footerRow.getContextualWidth()/a:0)},i.prototype.getEstimatedHeaderWidth=function(e,t){return-1},i}(o);i.RowLayoutManager=u;var h=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype.getEstimatedHeaderWidth=function(e,t){return this.getHeaderWidth(t)},t.prototype.canScroll=function(e){return!1},t.prototype._calculateSize=function(e){return e.calculateSize()},t.prototype.getHeaderWidth=function(e){return 0!==e||this.owner.binder.hasRowGroups()?this.owner.getEstimatedTextWidth(void 0):0},t}(u);i.DashboardRowLayoutManager=h;var d=function(t){function i(){t.apply(this,arguments)}return __extends(i,t),i.prototype.getEstimatedHeaderWidth=function(e,t){return this.owner.getEstimatedTextWidth(e)},i.prototype.canScroll=function(t){return!e.Double.equalWithPrecision(this.dimension.scrollOffset,0,o._scrollOffsetPrecision)||this.getRealizedItemsCount()-this._gridOffset<this.dimension.getItemsCount()&&this._contextualWidthToFill>0||e.Double.greaterWithPrecision(t,this._contextualWidthToFill,o._pixelPrecision)},i.prototype._calculateSize=function(e){return e.calculateSize()},i}(u);i.CanvasRowLayoutManager=d;var p=function(){function e(e,t,i,a){this._allowHeaderResize=!0,this._binder=e,this._grid=t,this._columnLayoutManager=i,this._rowLayoutManager=a,this._columnWidthsToPersist=[]}return e.prototype.initialize=function(e){this._owner=e,this._container=e.container,this._gridHost=e.contentHost,this._footersHost=e.footerHost,this._grid.initialize(e,this._gridHost,this._footersHost)},Object.defineProperty(e.prototype,"owner",{get:function(){return this._owner},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binder",{get:function(){return this._binder},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnWidthsToPersist",{get:function(){return this._columnWidthsToPersist},set:function(e){this._columnWidthsToPersist=e},enumerable:!0,configurable:!0}),e.prototype.getTablixClassName=function(){return null},e.prototype.getLayoutKind=function(){return null},e.prototype.getOrCreateColumnHeader=function(e,t,i,a){var r=this.owner.hierarchyNavigator,o=this._grid.getOrCreateRow(i),n=this._grid.getOrCreateColumn(a+this._columnLayoutManager._gridOffset),s=r.isLeaf(e),l=o.getOrCreateColumnHeader(n,this._columnLayoutManager.isScrollableHeader(e,t,a),s),c=r.getLevel(e);l.position.row.index=l.position.row.indexInSiblings=c,l.position.row.isFirst=0===c,l.position.row.isLast=s;var u=r.getIndex(e);return l.position.column.index=l.position.row.indexInSiblings=u,l.position.column.isFirst=r.areAllParentsFirst(e,t),l.position.column.isLast=r.areAllParentsLast(e,t),this.enableCellHorizontalResize(s,l),l},e.prototype.getOrCreateRowHeader=function(e,t,i,a){var r=this.owner.hierarchyNavigator,o=this._grid.getOrCreateRow(i+this._rowLayoutManager._gridOffset),n=this._grid.getOrCreateColumn(a),s=r.isLeaf(e),l=this._rowLayoutManager.isScrollableHeader(e,t,i);0===o.getRealizedCellCount()&&this.alignRowHeaderCells(e,o);var c=o.getOrCreateRowHeader(n,l,r.isLeaf(e)),u=r.getIndex(e);c.position.row.index=c.position.row.indexInSiblings=u,c.position.row.isFirst=r.areAllParentsFirst(e,t),c.position.row.isLast=r.areAllParentsLast(e,t);var h=r.getLevel(e);return c.position.column.index=c.position.column.indexInSiblings=h,c.position.column.isFirst=0===h,c.position.column.isLast=s,c.enableHorizontalResize(!1,this._columnLayoutManager),c},e.prototype.getOrCreateCornerCell=function(e,t,i){var a=this._grid.getOrCreateRow(i),r=this._grid.getOrCreateColumn(t),o=this._columnLayoutManager.dimension.getDepth(),n=i===o-1,s=a.getOrCreateCornerCell(r),l=i;s.position.row.index=s.position.row.indexInSiblings=l,s.position.row.isFirst=0===l,s.position.row.isLast=n;var c=t;return s.position.column.index=s.position.column.indexInSiblings=c,s.position.column.isFirst=0===c,s.position.column.isLast=c===this._rowLayoutManager.dimension.getDepth()-1,this.enableCellHorizontalResize(n,s),s},e.prototype.getOrCreateBodyCell=function(e,t,i,a,r){var o,n=this._grid.getOrCreateRow(a+this._rowLayoutManager._gridOffset),s=this._grid.getOrCreateColumn(r+this._columnLayoutManager._gridOffset);o=0===n._realizedBodyCells.length&&0!==this._owner.columnDimension.getFractionScrollOffset()?!0:this._rowLayoutManager.isScrollableHeader(t,i,a);var l=n.getOrCreateBodyCell(s,o);return l.position=e.position,l.enableHorizontalResize(!1,this._columnLayoutManager),l},e.prototype.getOrCreateFooterBodyCell=function(e,t){var i,a=this._grid.getOrCreateFootersRow(),r=this._grid.getOrCreateColumn(t+this._columnLayoutManager._gridOffset);i=0===a._realizedBodyCells.length&&0!==this._owner.columnDimension.getFractionScrollOffset();var o=a.getOrCreateFooterBodyCell(r,i);return o.position=e.position,o.enableHorizontalResize(!1,this._columnLayoutManager),o},e.prototype.getOrCreateFooterRowHeader=function(e,t){var i=this._grid.getOrCreateFootersRow(),a=this._grid.getOrCreateColumn(0),r=i.getOrCreateFooterRowHeader(a);return r.position=void 0,r.enableHorizontalResize(!1,this._columnLayoutManager),r},e.prototype.getVisibleWidth=function(){return-1},e.prototype.getVisibleHeight=function(){return-1},e.prototype.updateColumnCount=function(e,t){},e.prototype.updateViewport=function(e){},e.prototype.getEstimatedRowHeight=function(){return-1},e.prototype.getCellWidth=function(e){return-1},e.prototype.getContentWidth=function(e){return-1},e.prototype.adjustContentSize=function(e){},e.prototype.alignRowHeaderCells=function(e,t){var i=t.getRowHeaderLeafIndex();if(-1!==i){var a=this._owner.rowDimension,r=a.getFirstVisibleChildLeaf(e);this.owner.hierarchyNavigator.headerItemEquals(r,t.getAllocatedCellAt(i).item)&&t.moveCellsBy(this.owner.hierarchyNavigator.getLevel(r)-this.owner.hierarchyNavigator.getLevel(e)-i)}},Object.defineProperty(e.prototype,"grid",{get:function(){return this._grid},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowLayoutManager",{get:function(){return this._rowLayoutManager},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnLayoutManager",{get:function(){return this._columnLayoutManager},enumerable:!0,configurable:!0}),e.prototype.showEmptySpaceHeader=function(){return!1},e.prototype.onStartRenderingSession=function(e,t,i){if(this.showEmptySpaceHeader()){var a=this._grid.emptySpaceHeaderCell;a&&this._binder.unbindEmptySpaceHeaderCell(a),a=this._grid.emptySpaceFooterCell,a&&this._binder.unbindEmptySpaceFooterCell(a),this._grid.HideEmptySpaceCells()}this._scrollingDimension=e,this._scrollingDimension&&this._scrollingDimension.layoutManager.startScrollingSession(),this._rowLayoutManager.onStartRenderingSession(),this._columnLayoutManager.onStartRenderingSession(),this._grid.onStartRenderingSession(i);var r=this._columnLayoutManager.measureEnabled||this._rowLayoutManager.measureEnabled;r&&this.measureSampleText(t)},e.prototype.onEndRenderingSession=function(){if(this._rowLayoutManager.onEndRenderingSession(),this._columnLayoutManager.onEndRenderingSession(),this._scrollingDimension&&this._scrollingDimension.layoutManager.endScrollingSession(),this._scrollingDimension=null,this.showEmptySpaceHeader()){var e=this._columnLayoutManager.contextualWidthToFill-this._columnLayoutManager.getGridContextualWidth();if(e>0){this._grid.ShowEmptySpaceCells(this._owner.columnDimension.getDepth(),e);var t=this._grid.emptySpaceHeaderCell;t&&this._binder.bindEmptySpaceHeaderCell(t),t=this._grid.emptySpaceFooterCell,t&&this._binder.bindEmptySpaceFooterCell(t)}}},e.prototype.onStartRenderingIteration=function(e){this._rowLayoutManager.onStartRenderingIteration(e,this.getVisibleHeight()),this._columnLayoutManager.onStartRenderingIteration(e,this.getVisibleWidth()),this._grid.onStartRenderingIteration()},e.prototype.onEndRenderingIteration=function(){return this._grid.onEndRenderingIteration(),this._columnLayoutManager.calculateSizes(),this._rowLayoutManager.calculateSizes(),this._columnLayoutManager.fixSizes(),this._rowLayoutManager.fixSizes(),this._columnLayoutManager.updateItemToResizeState(this._grid.realizedColumns),this._columnLayoutManager.applyScrolling(),this._rowLayoutManager.applyScrolling(),this._columnLayoutManager.onEndRenderingIteration(),this._rowLayoutManager.onEndRenderingIteration(),this._columnLayoutManager.done&&this._rowLayoutManager.done},e.prototype.onCornerCellRealized=function(e,t){var i=this.owner.hierarchyNavigator.isColumnHierarchyLeaf(e),a=this.owner.hierarchyNavigator.isRowHierarchyLeaf(e);i&&t._column.OnLeafRealized(this._owner.hierarchyNavigator),this._columnLayoutManager.onCornerCellRealized(e,t,i),this._rowLayoutManager.onCornerCellRealized(e,t,a)},e.prototype.onRowHeaderRealized=function(e,t){var i=this._owner.hierarchyNavigator,a=i.isLeaf(e),r=t;r.colSpan>1&&r.setContainerWidth(-1),this._rowLayoutManager.onHeaderRealized(e,t,a)},e.prototype.onRowHeaderFooterRealized=function(e,t){},e.prototype.onColumnHeaderRealized=function(e,t){var i=this._owner.hierarchyNavigator,a=i.isLeaf(e);a&&t._column.OnLeafRealized(this._owner.hierarchyNavigator),this._columnLayoutManager.onHeaderRealized(e,t,a)},e.prototype.onBodyCellRealized=function(e,t){},e.prototype.onBodyCellFooterRealized=function(e,t){},e.prototype.setAllowHeaderResize=function(e){this._allowHeaderResize=e},e.prototype.enableCellHorizontalResize=function(e,t){var i=e&&this._allowHeaderResize;t.enableHorizontalResize(i,this._columnLayoutManager)},e.prototype.getEstimatedTextWidth=function(e){return-1},e.prototype.measureSampleText=function(e){},e}();i.TablixLayoutManager=p;var g=function(o){function n(e,t,i,a,r){var n=new l(null,i,r),s=new h(null,i,a);o.call(this,e,i,n,s),n.owner=this,s.owner=this,this._sizeComputationManager=t}return __extends(n,o),n.createLayoutManager=function(e){var t=new r;return new n(e,t,new i.TablixGrid(new i.DashboardTablixGridPresenter(t)),new i.RowRealizationManager(e),new i.ColumnRealizationManager(e))},n.prototype.getTablixClassName=function(){return"tablixDashboard"},n.prototype.getLayoutKind=function(){return 1},n.prototype.showEmptySpaceHeader=function(){return!1},n.prototype.measureSampleText=function(i){var r=e.TextMeasurementService.getSvgMeasurementProperties(i);this._characterHeight=e.TextMeasurementService.estimateSvgTextHeight(r),this._sizeComputationManager.updateRowHeight(this._characterHeight);var o=a.toPoint(parseFloat(r.fontSize)),n=o/t.TablixDefaultTextSize;this._sizeComputationManager.updateScalingFactor(e.Double.toIncrement(n,.05))},n.prototype.getVisibleWidth=function(){return this._sizeComputationManager.visibleWidth},n.prototype.getVisibleHeight=function(){return this._sizeComputationManager.visibleHeight},n.prototype.getCellWidth=function(e){return this._sizeComputationManager.cellWidth},n.prototype.getContentWidth=function(e){return this._sizeComputationManager.contentWidth},n.prototype.getEstimatedTextWidth=function(e){return this._sizeComputationManager.contentWidth},n.prototype.adjustContentSize=function(e){this._sizeComputationManager.hasImageContent=e},n.prototype.updateColumnCount=function(e,t){var i=e?e.getDepth():0,a=t?t.getItemsCount():0,r=i+a;this.binder.hasRowGroups()||r--,this._sizeComputationManager.updateColumnCount(r)},n.prototype.updateViewport=function(e){this._sizeComputationManager.updateViewport(e)},n.prototype.getEstimatedRowHeight=function(){return this._characterHeight},n}(p);i.DashboardTablixLayoutManager=g;var m=function(e){function a(t,i,a,r){var o=new c(null,i,r),n=new d(null,i,a);e.call(this,t,i,o,n),o.owner=this,n.owner=this}return __extends(a,e),a.createLayoutManager=function(e,r){return new a(e,new i.TablixGrid(new t.internal.CanvasTablixGridPresenter(r)),new i.RowRealizationManager(e),new i.ColumnRealizationManager(e))},a.prototype.getTablixClassName=function(){return"tablixCanvas"},a.prototype.getLayoutKind=function(){return 0},a.prototype.measureSampleText=function(e){var i=t.internal.TablixUtils.createDiv();i.style.cssFloat="left",i.style.whiteSpace="nowrap",i.style.overflow="hidden",i.style.lineHeight="normal",e.appendChild(i);var a=document.createTextNode("a");i.appendChild(a),this.characterWidth=t.HTMLElementUtils.getElementWidth(i),this.characterHeight=t.HTMLElementUtils.getElementHeight(i),i.removeChild(a),e.removeChild(i)},a.prototype.showEmptySpaceHeader=function(){return!this._columnLayoutManager.fillProportionally},a.prototype.getVisibleWidth=function(){return this._columnLayoutManager.measureEnabled?this._owner.autoSizeWidth&&this._owner.maxWidth?this._owner.maxWidth:t.HTMLElementUtils.getElementWidth(this._container):-1},a.prototype.getVisibleHeight=function(){return this._rowLayoutManager.measureEnabled?this._owner.autoSizeHeight&&this._owner.maxHeight?this._owner.maxHeight:t.HTMLElementUtils.getElementHeight(this._container):-1},a.prototype.getCellWidth=function(e){return t.HTMLElementUtils.getElementWidth(e._presenter.tableCell)},a.prototype.getContentWidth=function(e){return t.HTMLElementUtils.getElementWidth(e._presenter.contentElement)},a.prototype.getEstimatedTextWidth=function(e){return e?e.length*this.characterWidth:0},a.prototype.updateColumnCount=function(e,t){},a.prototype.updateViewport=function(e){},a.prototype.getEstimatedRowHeight=function(){return this.characterHeight},a}(p);i.CanvasTablixLayoutManager=m}(i=t.internal||(t.internal={}))}(i=t.controls||(t.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){var t;!function(e){function t(e){if(e)for(;e.hasChildNodes();)e.removeChild(e.firstChild)}function i(e,t){e.style.top=t+"px"}function a(e,t){e.style.left=t+"px"}function r(t,i){e.isAutoSize(i)?t.style.height="":t.style.height=i+"px"}function o(t,i){e.isAutoSize(i)?t.style.width="":t.style.width=i+"px"}function n(e){return e.offsetWidth}function s(e){return e.offsetHeight;
15}function l(e){return-1===e}function c(t){for(var i=1;t;)i*=e.getScale(t),t=t.parentElement;return i}function u(e){e=$(e);var t=e.css("-webkit-transform")||e.css("-moz-transform")||e.css("-ms-transform")||e.css("-o-transform")||e.css("transform");return t&&(t.match(/\d*\.\d*/)&&Number(t.match(/\d*\.\d*/)[0])||t.match(/\d+/)&&Number(t.match(/\d+/)[0]))||1}e.clearChildren=t,e.setElementTop=i,e.setElementLeft=a,e.setElementHeight=r,e.setElementWidth=o,e.getElementWidth=n,e.getElementHeight=s,e.isAutoSize=l,e.getAccumulatedScale=c,e.getScale=u}(t=e.HTMLElementUtils||(e.HTMLElementUtils={}))}(t=e.controls||(e.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(i){var a;!function(a){var r,o=InJs.DomFactory,n=e.data.DataViewObjectDefinitions,s=e.data.DataViewRoleWildcard;!function(t){function a(e){return e&&e.metadata?e.metadata.objects:null}function r(e,a,r){if(r===i.TablixType.Table){for(var o=S(a),n=0,l=o;n<l.length;n++){var c=l[n],u={selector:{data:[s.fromRoles(["Values"])],metadata:c.queryName},objects:(h={},h[t.ObjectValues]={formattingProperties:[t.PropValuesBackColor.propertyName]},h)};e.push(u)}var h}}function o(e,r,o,n){var s=a(o),m=!0;switch(m=n===i.TablixType.Table?C(o)&&b(s):D(o)&&P(s)||w(o)&&x(s),e.objectName){case t.ObjectGeneral:l(r,s,n,o);break;case t.ObjectGrid:c(r,s,n);break;case t.ObjectColumnHeaders:u(r,s);break;case t.ObjectRowHeaders:h(r,s);break;case t.ObjectValues:d(r,s,n);break;case t.ObjectTotal:m&&p(r,s);break;case t.ObjectSubTotals:m&&g(r,s)}}function l(e,a,r,o){var n={selector:null,objectName:t.ObjectGeneral,properties:{autoSizeColumnWidth:t.PropGeneralAutoSizeColumns.getValue(a),textSize:t.PropGeneralTextSize.getValue(a)}},s=n.properties;switch(r){case i.TablixType.Table:C(o)&&(s[t.PropGeneralTableTotals.propertyName]=b(a));break;case i.TablixType.Matrix:w(o)&&(s[t.PropGeneralMatrixRowSubtotals.propertyName]=x(a)),D(o)&&(s[t.PropGeneralMatrixColumnSubtotals.propertyName]=P(a))}e.pushInstance(n)}function c(e,a,r){var o={selector:null,objectName:t.ObjectGeneral,properties:{}},n=o.properties,s=t.PropGridVertical.getValue(a);n[t.PropGridVertical.propertyName]=s,s&&(n[t.PropGridVerticalColor.propertyName]=t.PropGridVerticalColor.getValue(a),n[t.PropGridVerticalWeight.propertyName]=t.PropGridVerticalWeight.getValue(a));var l=(r===i.TablixType.Table?t.PropGridHorizontalTable:t.PropGridHorizontalMatrix).getValue(a);n[(r===i.TablixType.Table?t.PropGridHorizontalTable:t.PropGridHorizontalMatrix).propertyName]=l,l&&(n[t.PropGridHorizontalColor.propertyName]=t.PropGridHorizontalColor.getValue(a),n[t.PropGridHorizontalWeight.propertyName]=t.PropGridHorizontalWeight.getValue(a)),n[t.PropGridRowPadding.propertyName]=t.PropGridRowPadding.getValue(a),n[t.PropGridOutlineColor.propertyName]=t.PropGridOutlineColor.getValue(a),n[t.PropGridOutlineWeight.propertyName]=t.PropGridOutlineWeight.getValue(a),n[t.PropGridImageHeight.propertyName]=t.PropGridImageHeight.getValue(a),e.pushInstance(o)}function u(e,i){e.pushInstance({selector:null,objectName:t.ObjectColumnHeaders,properties:{fontColor:t.PropColumnsFontColor.getValue(i),backColor:t.PropColumnsBackColor.getValue(i),outline:t.PropColumnsOutline.getValue(i)}})}function h(e,i){e.pushInstance({selector:null,objectName:t.ObjectRowHeaders,properties:{fontColor:t.PropRowsFontColor.getValue(i),backColor:t.PropRowsBackColor.getValue(i),outline:t.PropRowsOutline.getValue(i)}})}function d(e,a,r){var o={selector:null,objectName:t.ObjectValues,properties:{fontColorPrimary:t.PropValuesFontColorPrimary.getValue(a),backColorPrimary:t.PropValuesBackColorPrimary.getValue(a),fontColorSecondary:t.PropValuesFontColorSecondary.getValue(a),backColorSecondary:t.PropValuesBackColorSecondary.getValue(a),outline:t.PropValuesOutline.getValue(a)}};r===i.TablixType.Table&&(o.properties[t.PropValuesUrlIconProp.propertyName]=t.PropValuesUrlIconProp.getValue(a)),e.pushInstance(o)}function p(e,i){e.pushInstance({selector:null,objectName:t.ObjectTotal,properties:{fontColor:t.PropTotalFontColor.getValue(i),backColor:t.PropTotalBackColor.getValue(i),outline:t.PropTotalOutline.getValue(i)}})}function g(e,i){e.pushInstance({selector:null,objectName:t.ObjectSubTotals,properties:{fontColor:t.PropSubTotalsFontColor.getValue(i),backColor:t.PropSubTotalsBackColor.getValue(i)}})}function m(e){var i=a(e),r={general:{autoSizeColumnWidth:t.PropGeneralAutoSizeColumns.getValue(i),textSize:t.PropGeneralTextSize.getValue(i),totals:b(i)}};return r.grid={gridVertical:t.PropGridVertical.getValue(i),gridVerticalColor:t.PropGridVerticalColor.getValue(i),gridVerticalWeight:t.PropGridVerticalWeight.getValue(i),gridHorizontal:t.PropGridHorizontalTable.getValue(i),gridHorizontalColor:t.PropGridHorizontalColor.getValue(i),gridHorizontalWeight:t.PropGridHorizontalWeight.getValue(i),outlineColor:t.PropGridOutlineColor.getValue(i),outlineWeight:t.PropGridOutlineWeight.getValue(i),rowPadding:t.PropGridRowPadding.getValue(i),imageHeight:t.PropGridImageHeight.getValue(i)},r.columnHeaders={fontColor:t.PropColumnsFontColor.getValue(i),backColor:t.PropColumnsBackColor.getValue(i),outline:t.PropColumnsOutline.getValue(i)},r.values={fontColorPrimary:t.PropValuesFontColorPrimary.getValue(i),backColorPrimary:t.PropValuesBackColorPrimary.getValue(i),fontColorSecondary:t.PropValuesFontColorSecondary.getValue(i),backColorSecondary:t.PropValuesBackColorSecondary.getValue(i),outline:t.PropValuesOutline.getValue(i),urlIcon:t.PropValuesUrlIconProp.getValue(i)},r.total={fontColor:t.PropTotalFontColor.getValue(i),backColor:t.PropTotalBackColor.getValue(i),outline:t.PropTotalOutline.getValue(i)},r}function f(e){var i=a(e),r={general:{autoSizeColumnWidth:t.PropGeneralAutoSizeColumns.getValue(i),textSize:t.PropGeneralTextSize.getValue(i),rowSubtotals:x(i),columnSubtotals:P(i)}};return r.grid={gridVertical:t.PropGridVertical.getValue(i),gridVerticalColor:t.PropGridVerticalColor.getValue(i),gridVerticalWeight:t.PropGridVerticalWeight.getValue(i),gridHorizontal:t.PropGridHorizontalMatrix.getValue(i),gridHorizontalColor:t.PropGridHorizontalColor.getValue(i),gridHorizontalWeight:t.PropGridHorizontalWeight.getValue(i),outlineColor:t.PropGridOutlineColor.getValue(i),outlineWeight:t.PropGridOutlineWeight.getValue(i),rowPadding:t.PropGridRowPadding.getValue(i),imageHeight:t.PropGridImageHeight.getValue(i)},r.columnHeaders={fontColor:t.PropColumnsFontColor.getValue(i),backColor:t.PropColumnsBackColor.getValue(i),outline:t.PropColumnsOutline.getValue(i)},r.rowHeaders={fontColor:t.PropRowsFontColor.getValue(i),backColor:t.PropRowsBackColor.getValue(i),outline:t.PropRowsOutline.getValue(i)},r.values={fontColorPrimary:t.PropValuesFontColorPrimary.getValue(i),backColorPrimary:t.PropValuesBackColorPrimary.getValue(i),fontColorSecondary:t.PropValuesFontColorSecondary.getValue(i),backColorSecondary:t.PropValuesBackColorSecondary.getValue(i),outline:t.PropValuesOutline.getValue(i)},r.subtotals={fontColor:t.PropSubTotalsFontColor.getValue(i),backColor:t.PropSubTotalsBackColor.getValue(i),outline:t.PropSubTotalsOutline.getValue(i)},r}function y(e){return{general:[{selector:null,properties:{textSize:n.encodePropertyValue(12,{numeric:!0}),totals:n.encodePropertyValue(!1,{bool:!0})}}]}}function v(e){return jsCommon.PixelConverter.fromPoint(e)}function b(e){return t.PropGeneralTableTotals.getValue(e)}function C(e){if(e&&e.table&&!_.isEmpty(e.table.columns)){var t=e.table.columns;if(_.some(t,function(e){return e.discourageAggregationAcrossGroups}))return!1}return!0}function S(e){return e&&e.table&&!_.isEmpty(e.table.columns)?e.table.columns:void 0}function x(e){return t.PropGeneralMatrixRowSubtotals.getValue(e)}function w(e){return!(e&&e.matrix&&e.matrix.rows&&L(e.matrix.rows.levels))}function P(e){return t.PropGeneralMatrixColumnSubtotals.getValue(e)}function D(e){return!(e&&e.matrix&&e.matrix.columns&&L(e.matrix.columns.levels))}function L(e){var t=_.last(e);return t&&_.some(t.sources,function(e){return e.discourageAggregationAcrossGroups})}t.ObjectGeneral="general",t.ObjectGrid="grid",t.ObjectColumnHeaders="columnHeaders",t.ObjectRowHeaders="rowHeaders",t.ObjectValues="values",t.ObjectTotal="total",t.ObjectSubTotals="subTotals";var T=function(){function e(e,t,i,a){this.objectName=e,this.propertyName=t,this.defaultValue=i,this.getterFuntion=a}return e.prototype.getPropertyID=function(){return{objectName:this.objectName,propertyName:this.propertyName}},e.prototype.getValue=function(e){return this.getterFuntion(e,this.getPropertyID(),this.defaultValue)},e}();t.TablixProperty=T,t.PropColumnFormatString=new T(t.ObjectGeneral,"formatString",void 0,e.DataViewObjects.getValue),t.PropGeneralAutoSizeColumns=new T(t.ObjectGeneral,"autoSizeColumnWidth",!0,e.DataViewObjects.getValue),t.PropGeneralTextSize=new T(t.ObjectGeneral,"textSize",8,e.DataViewObjects.getValue),t.PropGeneralTableTotals=new T(t.ObjectGeneral,"totals",!0,e.DataViewObjects.getValue),t.PropGeneralMatrixRowSubtotals=new T(t.ObjectGeneral,"rowSubtotals",!0,e.DataViewObjects.getValue),t.PropGeneralMatrixColumnSubtotals=new T(t.ObjectGeneral,"columnSubtotals",!0,e.DataViewObjects.getValue),t.PropGridVertical=new T(t.ObjectGrid,"gridVertical",!1,e.DataViewObjects.getValue),t.PropGridVerticalColor=new T(t.ObjectGrid,"gridVerticalColor","#E8E8E8",e.DataViewObjects.getFillColor),t.PropGridVerticalWeight=new T(t.ObjectGrid,"gridVerticalWeight",1,e.DataViewObjects.getValue),t.PropGridHorizontalTable=new T(t.ObjectGrid,"gridHorizontal",!0,e.DataViewObjects.getValue),t.PropGridHorizontalMatrix=new T(t.ObjectGrid,"gridHorizontal",!1,e.DataViewObjects.getValue),t.PropGridHorizontalColor=new T(t.ObjectGrid,"gridHorizontalColor","#E8E8E8",e.DataViewObjects.getFillColor),t.PropGridHorizontalWeight=new T(t.ObjectGrid,"gridHorizontalWeight",1,e.DataViewObjects.getValue),t.PropGridRowPadding=new T(t.ObjectGrid,"rowPadding",0,e.DataViewObjects.getValue),t.PropGridOutlineColor=new T(t.ObjectGrid,"outlineColor","#CCC",e.DataViewObjects.getFillColor),t.PropGridOutlineWeight=new T(t.ObjectGrid,"outlineWeight",1,e.DataViewObjects.getValue),t.PropGridImageHeight=new T(t.ObjectGrid,"imageHeight",75,e.DataViewObjects.getValue),t.PropColumnsFontColor=new T(t.ObjectColumnHeaders,"fontColor","#666",e.DataViewObjects.getFillColor),t.PropColumnsBackColor=new T(t.ObjectColumnHeaders,"backColor",void 0,e.DataViewObjects.getFillColor),t.PropColumnsOutline=new T(t.ObjectColumnHeaders,"outline","BottomOnly",e.DataViewObjects.getValue),t.PropRowsFontColor=new T(t.ObjectRowHeaders,"fontColor","#666",e.DataViewObjects.getFillColor),t.PropRowsBackColor=new T(t.ObjectRowHeaders,"backColor",void 0,e.DataViewObjects.getFillColor),t.PropRowsOutline=new T(t.ObjectRowHeaders,"outline","RightOnly",e.DataViewObjects.getValue),t.PropValuesBackColor=new T(t.ObjectValues,"backColor",void 0,e.DataViewObjects.getFillColor),t.PropValuesFontColorPrimary=new T(t.ObjectValues,"fontColorPrimary","#333",e.DataViewObjects.getFillColor),t.PropValuesBackColorPrimary=new T(t.ObjectValues,"backColorPrimary",void 0,e.DataViewObjects.getFillColor),t.PropValuesFontColorSecondary=new T(t.ObjectValues,"fontColorSecondary","#333",e.DataViewObjects.getFillColor),t.PropValuesBackColorSecondary=new T(t.ObjectValues,"backColorSecondary",void 0,e.DataViewObjects.getFillColor),t.PropValuesOutline=new T(t.ObjectValues,"outline","None",e.DataViewObjects.getValue),t.PropValuesUrlIconProp=new T(t.ObjectValues,"urlIcon",!1,e.DataViewObjects.getValue),t.PropTotalFontColor=new T(t.ObjectTotal,"fontColor","#333",e.DataViewObjects.getFillColor),t.PropTotalBackColor=new T(t.ObjectTotal,"backColor",void 0,e.DataViewObjects.getFillColor),t.PropTotalOutline=new T(t.ObjectTotal,"outline","TopOnly",e.DataViewObjects.getValue),t.PropSubTotalsFontColor=new T(t.ObjectSubTotals,"fontColor","#333",e.DataViewObjects.getFillColor),t.PropSubTotalsBackColor=new T(t.ObjectSubTotals,"backColor",void 0,e.DataViewObjects.getFillColor),t.PropSubTotalsOutline=new T(t.ObjectSubTotals,"outline","TopOnly",e.DataViewObjects.getValue),t.getMetadadataObjects=a,t.enumerateObjectRepetition=r,t.enumerateObjectInstances=o,t.enumerateGeneralOptions=l,t.enumerateGridOptions=c,t.enumerateColumnHeadersOptions=u,t.enumerateRowHeadersOptions=h,t.enumerateValuesOptions=d,t.enumerateTotalOptions=p,t.enumerateSubTotalsOptions=g,t.getTableObjects=m,t.getMatrixObjects=f,t.generateTablixDefaultObjects=y,t.getTextSizeInPx=v,t.shouldShowTableTotals=b,t.shouldShowRowSubtotals=x,t.shouldShowColumnSubtotals=P,t.shouldShowColumnSubtotalsOption=D,t.isDiscourageAggregationAcrossGroups=L}(r=a.TablixObjects||(a.TablixObjects={}));var l;!function(e){function n(){return document.createElement("table")}function s(){var e=document.createElement("div");return e.className="tablixDiv",e}function l(t){t.extension.contentElement.className=e.CssClassTablixDiv+" "+e.CssClassContentElement,t.extension.contentHost.className=e.CssClassTablixDiv+" "+e.CssClassContentHost}function c(e,t){e.extension.contentHost.className+=" "+t}function u(e){e.extension.contentHost.className="",e.extension.contentHost.style.cssText=""}function h(e){e.extension.contentHost.textContent="",e.extension.contentHost.removeAttribute("title"),e.contentHeight=e.contentWidth=0,i.HTMLElementUtils.clearChildren(e.extension.contentHost)}function d(e,i){var a=t.TextUtil.replaceSpaceWithNBSP(i);e.extension.contentHost.textContent=a,e.extension.contentHost.title=a}function p(e){var t=e.target,i=e.offsetX;return i>=0&&i<t.offsetWidth-a.TablixResizer.resizeHandleSize}function g(t,i,a){var r=i.extension.contentHost,o=null;0===r.childElementCount?(o=document.createElement("a"),r.appendChild(o)):o=r.children[0],o.href=t,o.target="_blank",o.title=t,a===!0?(o.className=e.CssClassValueURLIcon,r.className=e.CssClassValueURLIconContainer):o.innerText=t}function m(t,i,a){var r=i.extension.contentHost,o=e.createDiv(),n=document.createElement("img");o.style.height=a+"px",o.style.width="100%",o.style.textAlign="center",n.src=t,n.style.maxHeight="100%",n.style.maxWidth="100%",o.appendChild(n),r.appendChild(o)}function f(e,i){var a=t.KpiUtil.getClassForKpi(e,i)||"";return o.div().addClass(a).css({display:"inline-block","vertical-align":"bottom",margin:"0"})}function y(e,i){return e&&void 0!==i?!!t.KpiUtil.getClassForKpi(e,i):!1}function v(e,t){var i=[{queryName:e,sortDirection:t}];return{sortDescriptors:i}}function b(e){return 2===e?1:2}function C(i,a){var r=e.createDiv();if(i.sort){var o=i.sort;r.appendChild(S(o,!0)),r.appendChild(S(b(o),!1))}else r.appendChild(S(2,!1));var n=e.createDiv(),s=i?t.TextUtil.replaceSpaceWithNBSP(i.displayName):"";n.textContent=s,r.appendChild(n),a.extension.contentHost.title=s,a.extension.contentHost.appendChild(r)}function S(e,t){var i=document.createElement("i");return i.className=P+" "+(t?"sorted":"future")+" "+(1===e?"powervisuals-glyph caret-up":"powervisuals-glyph caret-down"),i}function x(e){for(var t=0,i=e.extension.contentElement.childElementCount;i>t;t++){var a=e.extension.contentElement.children.item(t);if(a.classList.contains(P))return!0}return!1}function w(e){x(e)&&$(e.extension.contentElement).find("."+P).remove()}e.CssClassTablixDiv="tablixDiv",e.CssClassContentElement="tablixCellContentElement",e.CssClassContentHost="tablixCellContentHost",e.CssClassTablixHeader="tablixHeader",e.CssClassTablixColumnHeaderLeaf="tablixColumnHeaderLeaf",e.CssClassTablixValueNumeric="tablixValueNumeric",e.CssClassTablixValueTotal="tablixValueTotal",e.CssClassValueURLIcon="powervisuals-glyph url-icon tablixUrlIconGlyph",e.CssClassValueURLIconContainer="tablixValueUrlIcon",e.CssClassMatrixRowHeaderLeaf="matrixRowHeaderLeaf",e.CssClassMatrixRowHeaderSubTotal="matrixRowHeaderSubTotal",e.CssClassTableFooter="tableFooterCell",e.CssClassTableBodyCell="tableBodyCell",e.CssClassTableBodyCellBottom="tableBodyCellBottom",e.StringNonBreakingSpace="&nbsp;",e.UnitOfMeasurement="px";var P="tablixSortIconContainer";e.CellPaddingLeft=10,e.CellPaddingRight=5,e.CellPaddingLeftMatrixTotal=5,e.FontFamilyCell="'Segoe UI','wf_segoe-ui_normal', helvetica, arial, sans-serif",e.FontFamilyHeader="'Segoe UI','wf_segoe-ui_normal', helvetica, arial, sans-serif",e.FontFamilyTotal="'Segoe UI Bold','wf_segoe-ui_bold', helvetica, arial, sans-serif",e.FontColorCells="#333",e.FontColorHeaders="#666";var D=function(){function t(e,t){this.applyParams(!0,e,t)}return t.prototype.applyParams=function(e,t,i){e?(this.weight=null==t?0:t,this.color=null==i?"black":i):(this.weight=0,this.color="black")},t.prototype.getCSS=function(){var t=[];return _.isNumber(this.weight)&&(t.push(this.weight+e.UnitOfMeasurement),this.color&&t.push(this.color),t.push("solid")),t.join(" ")},t}();e.EdgeSettings=D;var L=function(){function t(){this.borders={},this.paddings={top:0,left:e.CellPaddingLeft,bottom:0,right:e.CellPaddingRight},this.fontFamily="",this.fontColor="",this.backColor="",this.hasImage=!1}return t.prototype.applyStyle=function(t){var i=t.extension.contentHost,a=i.style;a.fontFamily=this.fontFamily,a.color=this.fontColor,a.backgroundColor=this.backColor;var r=[];a.border="none",this.borders.left&&r.push("inset "+this.borders.left.weight+e.UnitOfMeasurement+" 0 0 0 "+this.borders.left.color),this.borders.right&&r.push("inset -"+this.borders.right.weight+e.UnitOfMeasurement+" 0 0 0 "+this.borders.right.color),this.borders.top&&r.push("inset 0 "+this.borders.top.weight+e.UnitOfMeasurement+" 0 0 "+this.borders.top.color),this.borders.bottom&&r.push("inset 0 -"+this.borders.bottom.weight+e.UnitOfMeasurement+" 0 0 "+this.borders.bottom.color),a.boxShadow=r.join(", "),a.paddingTop=(null==this.paddings.top?0:this.paddings.top)+(null==this.borders.top?0:this.borders.top.weight)+e.UnitOfMeasurement,a.paddingRight=(null==this.paddings.right?e.CellPaddingRight:this.paddings.right)+(null==this.borders.right?0:this.borders.right.weight)+e.UnitOfMeasurement,a.paddingBottom=(null==this.paddings.bottom?0:this.paddings.bottom)+(null==this.borders.bottom?0:this.borders.bottom.weight)+e.UnitOfMeasurement,a.paddingLeft=(null==this.paddings.left?e.CellPaddingLeft:this.paddings.left)+(null==this.borders.left?0:this.borders.left.weight)+e.UnitOfMeasurement},t.prototype.getExtraTop=function(){var e=0;return this.paddings.top&&(e+=this.paddings.top),this.borders.top&&(e+=this.borders.top.weight),e},t.prototype.getExtraBottom=function(){var e=0;return this.paddings.bottom&&(e+=this.paddings.bottom),this.borders.bottom&&(e+=this.borders.bottom.weight),e},t.prototype.getExtraRight=function(){var e=0;return this.paddings.right&&(e+=this.paddings.right),this.borders.right&&(e+=this.borders.right.weight),e},t.prototype.getExtraLeft=function(){var e=0;return this.paddings.left&&(e+=this.paddings.left),this.borders.left&&(e+=this.borders.left.weight),e},t}();e.CellStyle=L;var T=function(){function e(){}return e}();e.DimensionPosition=T;var V=function(){function e(){this.row=new T,this.column=new T}return e.prototype.isMatch=function(e){return this.column.index===e.column.index&&this.row.index===e.row.index},e}();e.CellPosition=V;var M=function(){function i(t,i,a,r){this.dataPoint=t,this.columnMetadata=a,this.formatter=r,this.isTotal=i,this.position=new e.CellPosition}return Object.defineProperty(i.prototype,"textContent",{get:function(){return null==this.dataPoint?"":this.formatter?this.formatter(this.dataPoint,this.columnMetadata,r.PropColumnFormatString.getPropertyID()):this.dataPoint},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"domContent",{get:function(){return this.columnMetadata&&y(this.columnMetadata.kpi,this.textContent)?f(this.columnMetadata.kpi,this.textContent):void 0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isNumeric",{get:function(){return this.columnMetadata?this.columnMetadata.type.numeric&&!this.columnMetadata.kpi:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isUrl",{get:function(){return this.columnMetadata?t.converterHelper.isWebUrlColumn(this.columnMetadata):void 0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isImage",{get:function(){return this.columnMetadata?t.converterHelper.isImageUrlColumn(this.columnMetadata):void 0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isValidUrl",{get:function(){return jsCommon.UrlUtils.isValidImageUrl(this.textContent)},enumerable:!0,configurable:!0}),i.prototype.isMatch=function(e){return this.position.isMatch(e.position)&&this.backColor===e.backColor},i}();e.TablixVisualCell=M,e.createTable=n,e.createDiv=s,e.resetCellCssClass=l,e.addCellCssClass=c,e.clearCellStyle=u,e.clearCellTextAndTooltip=h,e.setCellTextAndTooltip=d,e.isValidSortClick=p,e.appendATagToBodyCell=g,e.appendImgTagToBodyCell=m,e.createKpiDom=f,e.isValidStatusGraphic=y,e.getCustomSortEventArgs=v,e.reverseSort=b,e.createColumnHeaderWithSortIcon=C,e.removeSortIcons=w}(l=a.TablixUtils||(a.TablixUtils={}))}(a=i.internal||(i.internal={}))}(i=t.controls||(t.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){e.TablixDefaultTextSize=jsCommon.TextSizeDefaults.TextSizeMin;var t=function(){function t(i,a,r,o,n){var s=this;this.scrollBarElementWidth=9,this.options=n;var l=n.interactive;this.isTouchEnabled=l&&n.enableTouchSupport,this.mainDiv=e.internal.TablixUtils.createDiv(),this.mainDiv.classList.add(t.TablixTableAreaClassName),this.footerDiv=e.internal.TablixUtils.createDiv(),this.footerDiv.classList.add(t.TablixFooterClassName),this.isTouchEnabled&&this.InitializeTouchSupport(),this.gridDimensions={},this.containerElement=e.internal.TablixUtils.createDiv(),this.className=a.getTablixClassName(),this.autoSizeWidth=!1,this.autoSizeHeight=!1,this.fontFamily=e.internal.TablixUtils.FontFamilyCell,this.fontColor=e.internal.TablixUtils.FontColorCells,this.fontSize=n.fontSize,o.className=t.TablixContainerClassName,o.appendChild(this.containerElement),this.containerElement.addEventListener("mousewheel",function(e){s.onMouseWheel(e)}),this.containerElement.addEventListener("DOMMouseScroll",function(e){s.onFireFoxMouseWheel(e)}),this.containerElement.appendChild(this.mainDiv),this.containerElement.appendChild(this.footerDiv),this.isTouchEnabled&&(this.touchInterpreter.initTouch(this.mainDiv,null,!1),this.footerTouchInterpreter.initTouch(this.footerDiv,this.mainDiv,!1)),this.controlLayoutManager=a,this.controlLayoutManager.initialize(this),this.hierarchyTablixNavigator=i,this.binder=r,this.columnDim=new e.TablixColumnDimension(this),this.rowDim=new e.TablixRowDimension(this),this.columnDim._otherDimension=this.rowDimension,this.rowDim._otherDimension=this.columnDimension,this.InitializeScrollbars(),l||(this.scrollbarWidth=0),this.updateHorizontalPosition(),this.updateVerticalPosition(),this.updateFooterVisibility(),this.lastRenderingArgs={}}return t.prototype.InitializeTouchSupport=function(){this.touchManager=new e.TouchUtils.TouchManager,this.touchInterpreter=new e.TouchUtils.TouchEventInterpreter(this.touchManager),this.footerTouchInterpreter=new e.TouchUtils.TouchEventInterpreter(this.touchManager),this.columnTouchDelegate=new e.ColumnTouchDelegate(new e.TouchUtils.Rectangle),this.rowTouchDelegate=new e.RowTouchDelegate(new e.TouchUtils.Rectangle),this.bodyTouchDelegate=new e.BodyTouchDelegate(new e.TouchUtils.Rectangle),this.footerTouchDelegate=new e.ColumnTouchDelegate(new e.TouchUtils.Rectangle),this.columnTouchDelegate.setHandler(this,this.onTouchEvent),this.rowTouchDelegate.setHandler(this,this.onTouchEvent),this.bodyTouchDelegate.setHandler(this,this.onTouchEvent),this.footerTouchDelegate.setHandler(this,this.onTouchEvent),this.touchManager.addTouchRegion(this.columnTouchDelegate.dimension,this.columnTouchDelegate,this.columnTouchDelegate),this.touchManager.addTouchRegion(this.rowTouchDelegate.dimension,this.rowTouchDelegate,this.rowTouchDelegate),this.touchManager.addTouchRegion(this.bodyTouchDelegate.dimension,this.bodyTouchDelegate,this.bodyTouchDelegate),this.touchManager.addTouchRegion(this.footerTouchDelegate.dimension,this.footerTouchDelegate,this.footerTouchDelegate)},t.prototype.InitializeScrollbars=function(){this.rowDim._initializeScrollbar(this.containerElement,null,this.options.layoutKind);var e=this.rowDim.scrollbar.element.style;e.position="absolute",e.top="0"+t.UnitOfMeasurement,e.right="0"+t.UnitOfMeasurement,this.rowDim.scrollbar.width=this.scrollBarElementWidth+t.UnitOfMeasurement,this.rowDim.scrollbar.show(!0),this.columnDim._initializeScrollbar(this.containerElement,null,this.options.layoutKind);var i=this.columnDim.scrollbar.element.style;i.position="absolute",i.left="0"+t.UnitOfMeasurement,i.bottom="0"+t.UnitOfMeasurement,this.columnDim.scrollbar.height=this.scrollBarElementWidth+t.UnitOfMeasurement,this.columnDim.scrollbar.show(!1)},Object.defineProperty(t.prototype,"container",{get:function(){return this.containerElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentHost",{get:function(){return this.mainDiv},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"footerHost",{get:function(){return this.footerDiv},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{set:function(e){this.containerElement.className=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hierarchyNavigator",{get:function(){return this.hierarchyTablixNavigator},enumerable:!0,configurable:!0}),t.prototype.getBinder=function(){return this.binder},Object.defineProperty(t.prototype,"autoSizeWidth",{get:function(){return this._autoSizeWidth},set:function(e){this._autoSizeWidth=e,e||(this.containerElement.style.minWidth=this.containerElement.style.maxWidth="none")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoSizeHeight",{get:function(){return this._autoSizeHeight},set:function(e){e||(this.containerElement.style.minHeight=this.containerElement.style.maxHeight="none")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this.maximumWidth},set:function(e){this.maximumWidth=e,this.containerElement.style.maxWidth=this.maximumWidth+t.UnitOfMeasurement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"viewport",{get:function(){return this.viewPort},set:function(e){this.viewPort=e,this.containerElement.style.width=this.viewPort.width+t.UnitOfMeasurement,this.containerElement.style.height=this.viewPort.height+t.UnitOfMeasurement,this.rowDim.scrollbar.invalidateArrange(),this.columnDim.scrollbar.invalidateArrange(),this.controlLayoutManager.updateViewport(this.viewPort)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){return this.maximumHeight},set:function(e){this.maximumHeight=e,this.containerElement.style.maxHeight=this.maximumHeight+t.UnitOfMeasurement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minWidth",{get:function(){return this.minimumWidth},set:function(e){this.minimumWidth=e,this.containerElement.style.minWidth=this.minimumWidth+t.UnitOfMeasurement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){return this.minimumHeight},set:function(e){this.minimumHeight=e,this.containerElement.style.minHeight=this.minimumHeight+t.UnitOfMeasurement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.textFontSize},set:function(e){this.textFontSize=e?e:t.DefaultFontSize,this.containerElement.style.fontSize=this.textFontSize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this.textFontFamily},set:function(e){this.textFontFamily=e,this.containerElement.style.fontFamily=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontColor",{get:function(){return this.textFontColor},set:function(e){this.textFontColor=e,this.containerElement.style.color=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollbarWidth",{set:function(e){this.scrollBarElementWidth=e,this.rowDim.scrollbar.width=this.scrollBarElementWidth+t.UnitOfMeasurement,this.columnDim.scrollbar.height=this.scrollBarElementWidth+t.UnitOfMeasurement},enumerable:!0,configurable:!0}),t.prototype.updateModels=function(e,t,i){this.rowDim.model=t,this.rowDim.modelDepth=this.hierarchyNavigator.getRowHierarchyDepth(),this.columnDim.model=i,this.columnDim.modelDepth=this.hierarchyNavigator.getColumnHierarchyDepth(),e&&(this.rowDim.scrollOffset=0,this.columnDim.scrollOffset=0),this.layoutManager.updateColumnCount(this.rowDim,this.columnDim)},t.prototype.updateColumnDimensions=function(e,t,i){var a=this.gridDimensions;a.columnCount=i,a.rowHierarchyWidth=e,a.columnHierarchyWidth=t},t.prototype.updateRowDimensions=function(e,t,i,a,r){var o=this.gridDimensions;o.rowCount=a,o.rowHierarchyHeight=t,o.rowHierarchyContentHeight=i,o.columnHierarchyHeight=e,o.footerHeight=r},t.prototype.updateTouchDimensions=function(){var e=this.gridDimensions;this.columnTouchDelegate.resize(e.rowHierarchyWidth,0,e.columnHierarchyWidth,e.columnHierarchyHeight),this.columnTouchDelegate.setScrollDensity(e.columnCount/e.columnHierarchyWidth),this.rowTouchDelegate.resize(0,e.columnHierarchyHeight,e.rowHierarchyWidth,e.rowHierarchyHeight),this.rowTouchDelegate.setScrollDensity(e.rowCount/e.rowHierarchyHeight),this.bodyTouchDelegate.resize(e.rowHierarchyWidth,e.columnHierarchyHeight,e.columnHierarchyWidth,e.rowHierarchyHeight),this.bodyTouchDelegate.setScrollDensity(e.columnCount/e.columnHierarchyWidth,e.rowCount/e.rowHierarchyHeight),this.footerTouchDelegate.resize(e.rowHierarchyWidth,e.columnHierarchyHeight+e.rowHierarchyHeight,e.columnHierarchyWidth,e.footerHeight),this.footerTouchDelegate.setScrollDensity(e.columnCount/e.columnHierarchyWidth)},t.prototype.onMouseWheel=function(e){var t=this.determineDimensionToScroll();t&&t.scrollbar.onMouseWheel(e)},t.prototype.onFireFoxMouseWheel=function(e){var t=this.determineDimensionToScroll();t&&t.scrollbar.onFireFoxMouseWheel(e)},t.prototype.determineDimensionToScroll=function(){return this.rowDim.scrollbar.visible?this.rowDim:this.columnDim.scrollbar.visible?this.columnDim:null},Object.defineProperty(t.prototype,"layoutManager",{get:function(){return this.controlLayoutManager},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnDimension",{get:function(){return this.columnDim},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowDimension",{get:function(){return this.rowDim},enumerable:!0,configurable:!0}),t.prototype.refresh=function(e){this.render(e,null)},t.prototype._onScrollAsync=function(e){var t=this;requestAnimationFrame(function(){t.performPendingScroll(e)})},t.prototype.performPendingScroll=function(e){this.render(!1,e)},t.prototype.updateHorizontalPosition=function(){this.rowDim.scrollbar.visible?(this.columnDim.scrollbar.element.style.right=this.scrollBarElementWidth+t.UnitOfMeasurement,this.footerDiv.style.right=this.scrollBarElementWidth+t.UnitOfMeasurement,this.mainDiv.style.right=this.scrollBarElementWidth+t.UnitOfMeasurement):(this.columnDim.scrollbar.element.style.right="0"+t.UnitOfMeasurement,this.mainDiv.style.right="0"+t.UnitOfMeasurement,this.footerDiv.style.right="0"+t.UnitOfMeasurement)},t.prototype.updateFooterVisibility=function(){(this.rowDim.hasFooter()?"block"!==this.footerDiv.style.display:"none"!==this.footerDiv.style.display)&&(this.rowDim.hasFooter()?this.footerDiv.style.display="block":this.footerDiv.style.display="none")},t.prototype.updateVerticalPosition=function(){var e=this.rowDim.scrollbar.visible,i=1===this.controlLayoutManager.getLayoutKind(),a=e||i;if(a){var r=this.footerDiv.offsetHeight,o=0,n=0,s=this.columnDim.scrollbar.visible;s&&(r+=this.scrollBarElementWidth,o+=this.scrollBarElementWidth,n=this.scrollBarElementWidth),this.mainDiv.style.bottom=r+t.UnitOfMeasurement,this.rowDim.scrollbar.element.style.bottom=n+t.UnitOfMeasurement,this.footerDiv.style.bottom=o+t.UnitOfMeasurement,this.footerDiv.style.removeProperty("top");
16}else this.footerDiv.style.top=this.gridDimensions.rowHierarchyContentHeight+t.UnitOfMeasurement,this.footerDiv.style.removeProperty("bottom"),this.mainDiv.style.removeProperty("bottom")},t.prototype.alreadyRendered=function(e){return e===this.lastRenderingArgs.scrollingDimension&&this.rowDimension.scrollOffset===this.lastRenderingArgs.rowScrollOffset&&this.columnDimension.scrollOffset===this.lastRenderingArgs.columnScrollOffset},t.prototype.render=function(e,i){if(this.columnDim.makeScrollOffsetValid(),this.rowDim.makeScrollOffsetValid(),e||null===i)this.lastRenderingArgs={};else if(this.alreadyRendered(i))return;var a=!1;this.renderIterationCount=0,this.controlLayoutManager.onStartRenderingSession(i,this.mainDiv,e);var r=this.binder;r.onStartRenderingSession();for(var o=this.gridDimensions.footerHeight,n=this.gridDimensions.rowHierarchyHeight,s=this.gridDimensions.rowHierarchyContentHeight;!a&&this.renderIterationCount<t.MaxRenderIterationCount;){var l=this.columnDim.scrollbar.visible,c=this.rowDim.scrollbar.visible;this.columnDim._onStartRenderingIteration(),this.rowDim._onStartRenderingIteration(),this.controlLayoutManager.onStartRenderingIteration(e),this.renderCorner(),this.columnDim._render(),this.rowDim._render(),a=this.controlLayoutManager.onEndRenderingIteration(),this.columnDim._onEndRenderingIteration(),this.rowDim._onEndRenderingIteration(),l!==this.columnDim.scrollbar.visible&&this.updateVerticalPosition(),c!==this.rowDim.scrollbar.visible&&this.updateHorizontalPosition(),this.renderIterationCount++}this.controlLayoutManager.onEndRenderingSession(),r.onEndRenderingSession(),this.isTouchEnabled&&this.updateTouchDimensions(),this.lastRenderingArgs.rowScrollOffset=this.rowDimension.scrollOffset,this.lastRenderingArgs.columnScrollOffset=this.columnDimension.scrollOffset,this.updateContainerDimensions();var u=this.lastRenderingArgs;u.rowScrollOffset=this.rowDimension.scrollOffset,u.columnScrollOffset=this.columnDimension.scrollOffset,u.scrollingDimension=i,o===this.gridDimensions.footerHeight&&n===this.gridDimensions.rowHierarchyHeight&&s===this.gridDimensions.rowHierarchyContentHeight||this.updateVerticalPosition(),this.options.interactive&&(this.columnDim.scrollbar.refresh(),this.rowDim.scrollbar.refresh())},t.prototype.updateContainerDimensions=function(){var e=this.gridDimensions;if(this._autoSizeWidth){var i=this.rowDim.scrollbar.visible?this.scrollBarElementWidth:0;this.containerElement.style.width=e.rowHierarchyWidth+e.columnHierarchyWidth+i+t.UnitOfMeasurement}if(this._autoSizeHeight){var a=this.columnDim.scrollbar.visible?this.scrollBarElementWidth:0;this.containerElement.style.height=e.columnHierarchyHeight+e.rowHierarchyHeight+e.footerHeight+a+t.UnitOfMeasurement}},t.prototype.cornerCellMatch=function(e,t){var i=t.item;return 0===t.type&&i&&this.hierarchyTablixNavigator.cornerCellItemEquals(e,i)},t.prototype.renderCorner=function(){for(var e=this.columnDim.getDepth(),t=this.rowDim.getDepth(),i=0;e>i;i++)for(var a=0;t>a;a++){var r=this.hierarchyTablixNavigator.getCorner(a,i),o=this.controlLayoutManager.getOrCreateCornerCell(r,a,i),n=this.cornerCellMatch(r,o);n||(this._unbindCell(o),o.type=0,o.item=r,this.binder.bindCornerCell(r,o)),this.controlLayoutManager.onCornerCellRealized(r,o)}},t.prototype._unbindCell=function(e){switch(e.type){case 3:this.binder.unbindBodyCell(e.item,e);break;case 2:this.binder.unbindColumnHeader(e.item,e);break;case 1:this.binder.unbindRowHeader(e.item,e);break;case 0:this.binder.unbindCornerCell(e.item,e)}e.item=null,e.type=null},t.prototype.onTouchEvent=function(e){var t,i,a;e&&e.length>0&&"columnDim"in e[0]&&"rowDim"in e[0]&&(a=e[0],t=a.columnDim.scrollbar.visible?e[1]:0,i=a.rowDim.scrollbar.visible?e[2]:0,a.columnDim.scrollbar.viewMin=Math.max(0,a.columnDim.scrollbar.viewMin+t),a.columnDim.scrollOffset=Math.max(0,a.columnDim.scrollOffset+t),a.rowDim.scrollbar.viewMin=Math.max(0,a.rowDim.scrollbar.viewMin+i),a.rowDim.scrollOffset=Math.max(0,a.rowDim.scrollOffset+i),0===t?a._onScrollAsync(a.rowDim):0===i?a._onScrollAsync(a.columnDim):a._onScrollAsync(null))},t.UnitOfMeasurement="px",t.TablixContainerClassName="tablixContainer",t.TablixTableAreaClassName="tablixTableArea",t.TablixFooterClassName="tableFooterArea",t.DefaultFontSize=jsCommon.PixelConverter.fromPoint(e.TablixDefaultTextSize),t.MaxRenderIterationCount=10,t}();e.TablixControl=t}(t=e.controls||(e.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){var t=function(){function e(e){this._scrollStep=.1,this._owner=e,this._hierarchyNavigator=e.hierarchyNavigator,this._binder=e.getBinder(),this._tablixLayoutManager=e.layoutManager,this.scrollOffset=0}return e.prototype._onStartRenderingIteration=function(){this.updateScrollPosition()},e.prototype._onEndRenderingIteration=function(){},e.prototype.getValidScrollOffset=function(e){return Math.min(Math.max(e,0),Math.max(this.getItemsCount()-this._scrollStep,0))},e.prototype.makeScrollOffsetValid=function(){this.scrollOffset=this.getValidScrollOffset(this.scrollOffset)},e.prototype.getIntegerScrollOffset=function(){return Math.floor(this.scrollOffset)},e.prototype.getFractionScrollOffset=function(){return this.scrollOffset-this.getIntegerScrollOffset()},Object.defineProperty(e.prototype,"scrollbar",{get:function(){return this._scrollbar},enumerable:!0,configurable:!0}),e.prototype.getFirstVisibleItem=function(e){return this._scrollItems[e]},e.prototype.getFirstVisibleChild=function(e){return this._hierarchyNavigator.getAt(this._hierarchyNavigator.getChildren(e),this.getFirstVisibleChildIndex(e))},e.prototype.getFirstVisibleChildIndex=function(e){var t,i=this.getFirstVisibleItem(this._hierarchyNavigator.getLevel(e)+1);return t=void 0===i||void 0!==i&&this._hierarchyNavigator.getParent(i)!==e?0:this._hierarchyNavigator.getIndex(i)},e.prototype._initializeScrollbar=function(e,t,i){var a=this;this._scrollbar=this._createScrollbar(e,i),this._scrollbar._onscroll.push(function(e){return a.onScroll()}),t&&(this.scrollbar.initTouch(t,!0),t.style.setProperty("-ms-touch-action","pinch-zoom"))},e.prototype.getItemsCount=function(){return this.model?this._hierarchyNavigator.getLeafCount(this.model):0},e.prototype.getDepth=function(){return this.modelDepth},e.prototype.onScroll=function(){this.scrollOffset=this._scrollbar.viewMin,this._owner._onScrollAsync(this)},Object.defineProperty(e.prototype,"otherDimension",{get:function(){return this._otherDimension},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layoutManager",{get:function(){return this._layoutManager},enumerable:!0,configurable:!0}),e.prototype._createScrollbar=function(e,t){return null},e.prototype.updateScrollPosition=function(){if(this._scrollItems=[],this.model){var e=this.getIntegerScrollOffset(),t=this._hierarchyNavigator.getLeafAt(this.model,e);if(t){this._firstVisibleScrollIndex=e;do this._scrollItems[this._hierarchyNavigator.getLevel(t)]=t,t=this._hierarchyNavigator.getParent(t);while(null!==t)}}},e}();e.TablixDimension=t;var i=function(t){function i(e){t.call(this,e),this._layoutManager=this._tablixLayoutManager.rowLayoutManager,this._footer=null}return __extends(i,t),i.prototype.setFooter=function(e){this._footer=e,this._owner.updateFooterVisibility()},i.prototype.hasFooter=function(){return null!==this._footer},i.prototype._render=function(){var e=this.getFirstVisibleItem(0);this.hasFooter()&&(this.addFooterRowHeader(this._footer),this.addFooterBodyCells(this._footer)),void 0!==e&&this.addNodes(this.model,0,this.getDepth(),this._hierarchyNavigator.getIndex(e))},i.prototype._createScrollbar=function(t,i){return new e.VerticalScrollbar(t,i)},i.prototype.addNodes=function(e,t,i,a){for(var r=this._hierarchyNavigator.getCount(e),o=a;r>o;o++){if(!this._layoutManager.needsToRealize)return;var n=this._hierarchyNavigator.getAt(e,o),s=this.addNode(n,e,t,i);t+=s.rowSpan}},i.prototype.getFirstVisibleChildLeaf=function(e){for(var t=e;!this._hierarchyNavigator.isLeaf(t);)t=this.getFirstVisibleChild(t);return t},i.prototype.bindRowHeader=function(e,t){this._binder.bindRowHeader(e,t)},i.prototype.addNode=function(e,t,i,a){var r,o=this._tablixLayoutManager.getOrCreateRowHeader(e,t,i,this._hierarchyNavigator.getLevel(e)),n=this.rowHeaderMatch(e,o);return n||(this._owner._unbindCell(o),o.type=1,o.item=e,o.unfixRowHeight()),this._hierarchyNavigator.isLeaf(e)?(o.colSpan=a-this._hierarchyNavigator.getLevel(e),o.rowSpan=1,n||this.bindRowHeader(e,o),this._tablixLayoutManager.onRowHeaderRealized(e,o),this.addBodyCells(e,t,i)):(r=this._layoutManager.getRealizedItemsCount(),this.addNodes(this._hierarchyNavigator.getChildren(e),i,a,this.getFirstVisibleChildIndex(e)),o.colSpan=1,o.rowSpan=this._layoutManager.getRealizedItemsCount()-r+1,n||this.bindRowHeader(e,o),this._tablixLayoutManager.onRowHeaderRealized(e,o)),o},i.prototype.rowHeaderMatch=function(e,t){var i=t.item;return 1===t.type&&i&&this._hierarchyNavigator.headerItemEquals(e,i)},i.prototype.addBodyCells=function(e,t,i){for(var a=this._otherDimension.getIntegerScrollOffset(),r=this._otherDimension._layoutManager.getRealizedItemsCount()-this.getDepth(),o=this._hierarchyNavigator,n=this._otherDimension.model,s=this._tablixLayoutManager,l=0;r>l;l++){var c=o.getIntersection(e,o.getLeafAt(n,a+l)),u=s.getOrCreateBodyCell(c,e,t,i,l);this.bindBodyCell(c,u),s.onBodyCellRealized(c,u)}},i.prototype.bindBodyCell=function(e,t){var i=this.bodyCelMatch(e,t);i||(this._owner._unbindCell(t),t.type=3,t.item=e,t.unfixRowHeight(),this._binder.bindBodyCell(e,t))},i.prototype.addFooterRowHeader=function(e){var t=this._tablixLayoutManager.getOrCreateFooterRowHeader(e,this.model);t.colSpan=this.getDepth();var i=this.rowHeaderMatch(e,t);i||(this._owner._unbindCell(t),t.type=1,t.item=e,t.unfixRowHeight(),this.bindRowHeader(e,t),this._tablixLayoutManager.onRowHeaderFooterRealized(e,t))},i.prototype.addFooterBodyCells=function(e){for(var t=this._otherDimension.getIntegerScrollOffset(),i=this._otherDimension.layoutManager.getRealizedItemsCount()-this.getDepth(),a=this._tablixLayoutManager,r=0;i>r;r++){var o=this._hierarchyNavigator.getLeafAt(this._otherDimension.model,t+r),n=this._hierarchyNavigator.getIntersection(e,o),s=a.getOrCreateFooterBodyCell(n,r);this.bindBodyCell(n,s),a.onBodyCellFooterRealized(n,s)}},i.prototype.bodyCelMatch=function(e,t){var i=t.item;return 3===t.type&&i&&this._hierarchyNavigator.bodyCellItemEquals(e,i)},i}(t);e.TablixRowDimension=i;var a=function(t){function i(e){t.call(this,e),this._layoutManager=this._tablixLayoutManager.columnLayoutManager}return __extends(i,t),i.prototype._render=function(){var e=this.getFirstVisibleItem(0);void 0!==e&&this.addNodes(this.model,0,this.getDepth(),this._hierarchyNavigator.getIndex(e))},i.prototype._createScrollbar=function(t,i){var a=new e.HorizontalScrollbar(t,i);return a.smallIncrement=.2,a},i.prototype.addNodes=function(e,t,i,a){for(var r=this._hierarchyNavigator.getCount(e),o=a;r>o;o++){if(!this._layoutManager.needsToRealize)return;var n=this.addNode(this._hierarchyNavigator.getAt(e,o),e,t,i);t+=n.colSpan}},i.prototype.addNode=function(e,t,i,a){var r=this._tablixLayoutManager.getOrCreateColumnHeader(e,t,this._hierarchyNavigator.getLevel(e),i),o=this.columnHeaderMatch(e,r);if(o||(this._owner._unbindCell(r),r.type=2,r.item=e,r.unfixRowHeight()),this._hierarchyNavigator.isLeaf(e))r.rowSpan=a-this._hierarchyNavigator.getLevel(e);else{var n=this._layoutManager.getRealizedItemsCount();this.addNodes(this._hierarchyNavigator.getChildren(e),i,a,this.getFirstVisibleChildIndex(e));var s=this._hierarchyNavigator.getChildrenLevelDifference(e);s===1/0?r.rowSpan=1:r.rowSpan=s,r.colSpan=this._layoutManager.getRealizedItemsCount()-n+1}return o||this._binder.bindColumnHeader(e,r),this._tablixLayoutManager.onColumnHeaderRealized(e,r),r},i.prototype.columnHeaderMatch=function(e,t){var i=t.item;return 2===t.type&&i&&this._hierarchyNavigator.headerItemEquals(e,i)},i}(t);e.TablixColumnDimension=a}(t=e.controls||(e.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){var t=function(){function t(e){this.dim=e,this.averageSize=1,this.handlers=null,this.tablixControl=null}return Object.defineProperty(t.prototype,"dimension",{get:function(){return this.dim},enumerable:!0,configurable:!0}),t.prototype.setScrollDensity=function(e){this.averageSize=e},t.prototype.resize=function(e,t,i,a){this.dim.x=e,this.dim.y=t,this.dim.width=i,this.dim.height=a},t.prototype.getPixelToItem=function(t,i,a,r,o){return new e.TouchUtils.TouchEvent(t*this.averageSize,0,o,-a*this.averageSize,0)},t.prototype.touchEvent=function(t){var i=[];i[0]=this.tablixControl,i[1]=t.dx,i[2]=t.dy,this.handlers&&e.fire([this.handlers],i)},t.prototype.setHandler=function(e,t){this.handlers=t,this.tablixControl=e},t}();e.ColumnTouchDelegate=t;var i=function(){function t(e){this.dim=e,this.averageSize=30,this.handlers=null,this.tablixControl=null}return Object.defineProperty(t.prototype,"dimension",{get:function(){return this.dim},enumerable:!0,configurable:!0}),t.prototype.setScrollDensity=function(e){this.averageSize=e},t.prototype.resize=function(e,t,i,a){this.dim.x=e,this.dim.y=t,this.dim.width=i,this.dim.height=a},t.prototype.getPixelToItem=function(t,i,a,r,o){var n=new e.TouchUtils.TouchEvent(0,i*this.averageSize,o,0,-r*this.averageSize);return n},t.prototype.touchEvent=function(t){var i=[];i[0]=this.tablixControl,i[1]=t.dx,i[2]=t.dy,this.handlers&&e.fire([this.handlers],i)},t.prototype.setHandler=function(e,t){this.handlers=t,this.tablixControl=e},t}();e.RowTouchDelegate=i;var a=function(){function t(e){this.dim=e,this.averageSizeX=t.DefaultAverageSizeX,this.averageSizeY=t.DefaultAverageSizeY,this.handlers=null,this.tablixControl=null}return Object.defineProperty(t.prototype,"dimension",{get:function(){return this.dim},enumerable:!0,configurable:!0}),t.prototype.setScrollDensity=function(e,t){this.averageSizeX=e,this.averageSizeY=t},t.prototype.resize=function(e,t,i,a){var r=this.dim;r.x=e,r.y=t,r.width=i,r.height=a},t.prototype.getPixelToItem=function(t,i,a,r,o){return new e.TouchUtils.TouchEvent(t*this.averageSizeX,i*this.averageSizeY,o,-a*this.averageSizeX,-r*this.averageSizeY)},t.prototype.touchEvent=function(t){var i=[this.tablixControl,t.dx,t.dy];this.handlers&&e.fire([this.handlers],i)},t.prototype.setHandler=function(e,t){this.handlers=t,this.tablixControl=e},t.DefaultAverageSizeX=30,t.DefaultAverageSizeY=30,t}();e.BodyTouchDelegate=a}(t=e.controls||(e.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){var t;!function(t){var i=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.offset=function(e,t){this.x+=e,this.y+=t},e}();t.Point=i;var a=function(e){function t(t,i,a,r){e.call(this,t,i),this.width=a||0,this.height=r||0}return __extends(t,e),Object.defineProperty(t.prototype,"point",{get:function(){return new i(this.x,this.y)},enumerable:!0,configurable:!0}),t.prototype.contains=function(e){return t.contains(this,e)},t.contains=function(e,i){return i&&!t.isEmpty(e)?e.x<=i.x&&i.x<e.x+e.width&&e.y<=i.y&&i.y<e.y+e.height:!1},t.isEmpty=function(e){return!(void 0!==e&&e.width>=0&&e.height>=0)},t}(i);t.Rectangle=a,function(e){e[e.NoClick=0]="NoClick",e[e.LeftClick=1]="LeftClick",e[e.RightClick=2]="RightClick",e[e.CenterClick=3]="CenterClick"}(t.MouseButton||(t.MouseButton={}));var r=t.MouseButton,o=function(){function e(e,t,i,a,r){this._x=e,this._y=t,this.isMouseButtonDown=i,this._dx=a||0,this._dy=r||0}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dx",{get:function(){return this._dx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dy",{get:function(){return this._dy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isMouseDown",{get:function(){return this.isMouseButtonDown},enumerable:!0,configurable:!0}),e}();t.TouchEvent=o;var n=function(){function e(){this.touchList=[],this.swipeDirection=2,this.matchingDirectionCount=0,this.lockThreshold=!0,this.scrollThreshold=!0,this.lastTouchEvent=new o(0,0,!1)}return Object.defineProperty(e.prototype,"lastEvent",{get:function(){return this.lastTouchEvent},enumerable:!0,configurable:!0}),e.prototype.addTouchRegion=function(e,t,i){var a={lastPoint:new o(0,0,!1),handler:t,region:e,converter:i};this.touchList=this.touchList.concat([a])},e.prototype.upAllTouches=function(){var e,t;t=this.touchList.length;for(var i=0;t>i;i++)this.touchList[i].lastPoint.isMouseDown&&(e=this.touchList[i].converter.getPixelToItem(this.touchList[i].lastPoint.x,this.touchList[i].lastPoint.y,0,0,!1),this.touchList[i].handler.touchEvent(e)),this.touchList[i].lastPoint=new o(this.touchList[i].lastPoint.x,this.touchList[i].lastPoint.y,!1);this.lastTouchEvent=new o(0,0,!1)},e.prototype.touchEvent=function(e){var t,i,a=0,r=0,n=0,s=0,l=0,c=null;t=this._getActive(),!this.lastTouchEvent.isMouseDown&&e.isMouseDown&&(t=this._findRegions(e)),n=this.lastTouchEvent.x-e.x,s=this.lastTouchEvent.y-e.y,this.lastTouchEvent=new o(e.x,e.y,e.isMouseDown,n,s),i=t.length;for(var u=0;i>u;u++)a=e.x-t[u].region.point.x,r=e.y-t[u].region.point.y,t[u].lastPoint.isMouseDown&&e.isMouseDown?(n=a-t[u].lastPoint.x,s=r-t[u].lastPoint.y,l=Math.abs(180/Math.PI*Math.atan(s/n)),this.scrollThreshold&&(this.lockThreshold&&this.matchingDirectionCount>5?1===this.swipeDirection?s=0:0===this.swipeDirection&&(n=0):20>l?(s=0,1===this.swipeDirection?this.matchingDirectionCount++:(this.matchingDirectionCount=1,this.swipeDirection=1)):(l=Math.abs(180/Math.PI*Math.atan(n/s)),20>l?(n=0,0===this.swipeDirection?this.matchingDirectionCount++:(this.matchingDirectionCount=1,this.swipeDirection=0)):2===this.swipeDirection?this.matchingDirectionCount++:(this.swipeDirection=2,this.matchingDirectionCount=1)))):(n=0,s=0,this.swipeDirection=2,this.matchingDirectionCount=0),t[u].lastPoint=new o(a,r,e.isMouseDown,n,s),c=t[u].converter.getPixelToItem(a,r,n,s,e.isMouseDown),t[u].handler.touchEvent(c)},e.prototype._findRegions=function(e){var t,a=[];t=this.touchList.length;for(var r=0;t>r;r++)this.touchList[r].region.contains(new i(e.x,e.y))&&(a=a.concat([this.touchList[r]]));return a},e.prototype._getActive=function(){var e,t=[];e=this.touchList.length;for(var i=0;e>i;i++)this.touchList[i].lastPoint.isMouseDown&&(t=t.concat([this.touchList[i]]));return t},e}();t.TouchManager=n;var s=80,l=600,c=function(){function t(e){this.manager=e,this.allowMouseDrag=!0,this.touchPanel=null,this.scale=1,this.documentMouseMoveWrapper=null,this.documentMouseUpWrapper=null,this.sliding=!1}return t.prototype.initTouch=function(e,t,i){var a=this;e.style.setProperty("-ms-touch-action","pinch-zoom"),this.touchReferencePoint=t,this.touchPanel=e,this.allowMouseDrag=void 0===i?!0:i,"ontouchmove"in e?(e.addEventListener("touchstart",function(e){return a.onTouchStart(e)}),e.addEventListener("touchend",function(e){return a.onTouchEnd(e)})):(e.addEventListener("mousedown",function(e){return a.onTouchMouseDown(e)}),e.addEventListener("mouseup",function(e){return a.onTouchMouseUp(e)}))},t.prototype.getXYByClient=function(e,t,a){var r=a.left,o=a.top;void 0!==window.scrollX&&(r+=window.scrollX,o+=window.scrollY);var n=new i(0,0);return n.offset(e-r,t-o),n},t.prototype.onTouchStart=function(e){if(1===e.touches.length){e.cancelBubble=!0;var t=e.touches[0];this.touchStartTime=(new Date).getTime(),this.touchStartPageY=t.pageY,this.onTouchMouseDown(t)}},t.prototype.onTouchMove=function(e){if(1===e.touches.length){e.preventDefault&&e.preventDefault();var t=e.touches[0];this.touchLastPageY=t.pageY,this.touchLastPageX=t.pageX,this.sliding||this.onTouchMouseMove(t)}},t.prototype.onTouchEnd=function(e){this.clearTouchEvents();var t=this.getSwipeInfo();this.didUserSwipe(t)?this.startSlideAffect(t):this.sliding||this.upAllTouches()},t.prototype.onTouchMouseDown=function(t){var i=this;this.scale=e.HTMLElementUtils.getAccumulatedScale(this.touchPanel),document.getSelection().removeAllRanges(),this.rect=(this.touchReferencePoint?this.touchReferencePoint:this.touchPanel).getBoundingClientRect(),"ontouchmove"in this.touchPanel?(this.documentMouseMoveWrapper=function(e){return i.onTouchMove(e)},document.addEventListener("touchmove",this.documentMouseMoveWrapper),this.documentMouseUpWrapper=function(e){return i.onTouchEnd(e)},document.addEventListener("touchend",this.documentMouseUpWrapper)):(this.documentMouseMoveWrapper=function(e){return i.onTouchMouseMove(e)},document.addEventListener("mousemove",this.documentMouseMoveWrapper),this.documentMouseUpWrapper=function(e){return i.onTouchMouseUp(e)},document.addEventListener("mouseup",this.documentMouseUpWrapper)),"setCapture"in this.touchPanel&&this.touchPanel.setCapture()},t.prototype.onTouchMouseMove=function(e){var t,i,a=this.rect,n=null!==a&&e.which!==r.NoClick;n&&!this.sliding&&(i=this.getXYByClient(e.pageX,e.pageY,a),t=new o(i.x/this.scale,i.y/this.scale,n),this.manager.touchEvent(t),e.preventDefault?e.preventDefault():"returnValue"in e&&(e.returnValue=!1))},t.prototype.onTouchMouseUp=function(e,t){this.upAllTouches(),this.clearTouchEvents()},t.prototype.getSwipeInfo=function(){var e=(new Date).getTime(),t=e-this.touchStartTime,i=this.touchLastPageY-this.touchStartPageY,a=0>i?-1:1;return{direction:a,distance:i,endTime:e,time:t}},t.prototype.didUserSwipe=function(e){return e.time<l&&e.distance*e.direction>s},t.prototype.startSlideAffect=function(e){var t=this;if(!this.sliding){this.sliding=!0;var i=this.getXYByClient(this.touchLastPageX,this.touchLastPageY,this.rect);this.slide(i,300,e),requestAnimationFrame(function(){t.didUserChangeDirection(e)||t.slide(i,200,e),t.clearSlide()})}},t.prototype.didUserChangeDirection=function(e){if(this.touchStartTime<=e.endTime)return!1;var t=this.touchLastPageY-this.touchStartPageY,i=0>t?-1:1;return i!==e.direction},t.prototype.slide=function(e,t,i){var a=this.touchStartTime>i.endTime?this.touchLastPageY-this.touchStartPageY:0;e.y+=t*i.direction+a;var r=new o(e.x/this.scale,e.y/this.scale,!0);this.manager.touchEvent(r)},t.prototype.clearSlide=function(){this.sliding=!1,this.upAllTouches()},t.prototype.upAllTouches=function(){null===this.documentMouseMoveWrapper&&(this.rect=null,this.manager.upAllTouches())},t.prototype.clearTouchEvents=function(){"releaseCapture"in this.touchPanel&&this.touchPanel.releaseCapture(),null!==this.documentMouseMoveWrapper&&("ontouchmove"in this.touchPanel?(document.removeEventListener("touchmove",this.documentMouseMoveWrapper),document.removeEventListener("touchend",this.documentMouseUpWrapper)):(document.removeEventListener("mousemove",this.documentMouseMoveWrapper),document.removeEventListener("mouseup",this.documentMouseUpWrapper)),this.documentMouseMoveWrapper=null,this.documentMouseUpWrapper=null)},t}();t.TouchEventInterpreter=c}(t=e.TouchUtils||(e.TouchUtils={}))}(t=e.controls||(e.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){!function(e){e[e.Matrix=0]="Matrix",e[e.Table=1]="Table"}(e.TablixType||(e.TablixType={}));e.TablixType}(t=e.controls||(e.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(t){var i=t.internal.TablixObjects.PropGeneralAutoSizeColumns,a=t.internal.TablixObjects.getMetadadataObjects,r=function(){function t(e,t,i,a){this.columnWidthObjects=[],this.isMatrix=t,this.updateDataView(e,a),this.hostPersistCallBack=i}return t.prototype.updateDataView=function(e,t){this.previousDataView=this.currentDataView,this.previousDataView?this.previousAutoColumnSizePropertyValue=i.getValue(a(this.previousDataView)):this.previousAutoColumnSizePropertyValue=void 0,this.currentDataView=e,this.currentDataView?this.currentAutoColumnSizePropertyValue=i.getValue(a(this.currentDataView)):this.currentAutoColumnSizePropertyValue=void 0,this.matrixLeafNodes=t,this.updateColumnWidthObjects(),this.updateTablixColumnWidths()},t.prototype.updateColumnWidthObjects=function(){this.columnWidthObjects.length=0,this.isMatrix?this.updateMatrixColumnWidthObjects():this.updateTableColumnWidthObjects()},t.prototype.updateTableColumnWidthObjects=function(){if(this.currentDataView&&this.currentDataView.table)for(var e=this.currentDataView.table.columns,t=0,i=e.length;i>t;t++){var a=e[t].queryName;this.columnWidthObjects.push({queryName:a,width:void 0})}},t.prototype.updateMatrixColumnWidthObjects=function(){if(this.currentDataView&&this.currentDataView.matrix&&this.currentDataView.matrix.rows)for(var e=0,t=this.currentDataView.matrix.rows.levels.length;t>e;e++){var i=this.currentDataView.matrix.rows.levels[e];_.isEmpty(i.sources)||this.columnWidthObjects.push({queryName:i.sources[0].queryName,width:void 0})}if(this.matrixLeafNodes)for(var e=0,t=this.matrixLeafNodes.length;t>e;e++){var a=this.matrixLeafNodes[e].queryName;this.columnWidthObjects.push({queryName:a,width:void 0})}},t.prototype.updateTablixColumnWidths=function(){var e=this.currentDataView&&this.currentDataView.metadata&&this.currentDataView.metadata.columns;e&&(this.shouldClearAllColumnWidths()?this.autoSizeAllColumns():this.deserializeColumnWidths(e))},t.prototype.deserializeColumnWidths=function(i){this.columnWidthObjects.forEach(function(e){e.width=void 0});for(var a=0,r=i;a<r.length;a++){var o=r[a],n=e.DataViewObjects.getValue(o.objects,t.columnWidthProp);if(_.isNumber(n))for(var s=0,l=this.columnWidthObjects;s<l.length;s++){var c=l[s];c.queryName===o.queryName&&(c.width=n)}}},t.prototype.shouldPersistAllColumnWidths=function(){return this.previousDataView?!this.currentAutoColumnSizePropertyValue&&this.previousAutoColumnSizePropertyValue:!1},t.prototype.shouldClearAllColumnWidths=function(){return null!=this.previousDataView&&this.previousAutoColumnSizePropertyValue===!1&&null!=this.currentDataView&&this.currentAutoColumnSizePropertyValue===!0},t.prototype.getColumnWidthObjects=function(){return this.columnWidthObjects},t.prototype.getFixedColumnWidthObjects=function(){return this.columnWidthObjects.filter(function(e){return null!=e.width})},t.prototype.getPersistedColumnWidth=function(e){var t=this.isMatrix?e:e-1,i=this.columnWidthObjects[t];return i?i.width:void 0},t.prototype.callHostToPersist=function(e){e&&this.generateVisualObjectInstancesToPersist(),this.hostPersistCallBack&&this.hostPersistCallBack(this.visualObjectInstancesToPersist)},t.prototype.autoSizeAllColumns=function(){this.visualObjectInstancesToPersist={merge:[this.getAutoSizeColumnWidthObject()],remove:[]};for(var e=0,t=this.columnWidthObjects;e<t.length;e++){var i=t[e];this.visualObjectInstancesToPersist.remove.push({selector:{metadata:i.queryName},objectName:"general",properties:{columnWidth:void 0}})}this.callHostToPersist(!1)},t.prototype.onColumnAutosized=function(e){for(var t=this.currentAutoColumnSizePropertyValue?void 0:-1,i=0,a=this.columnWidthObjects;i<a.length;i++){var r=a[i];r.queryName===e&&(r.width=t)}this.currentAutoColumnSizePropertyValue&&(this.visualObjectInstancesToPersist={remove:[{selector:{metadata:e},objectName:"general",properties:{columnWidth:void 0}}]},this.callHostToPersist(!1))},t.prototype.onColumnWidthChanged=function(e,t){var i=this.isMatrix?e:e-1;if(!(_.isEmpty(this.columnWidthObjects)||0>i||i>=this.columnWidthObjects.length)){var a=this.columnWidthObjects[i].queryName;if(-1===t)this.onColumnAutosized(a);else{for(var r=0,o=this.columnWidthObjects;r<o.length;r++){var n=o[r];n.queryName===a&&(n.width=t)}this.callHostToPersist(!0)}}},t.prototype.persistAllColumnWidths=function(e){var t=this,i=this.isMatrix?e:e.slice(1,e.length);if(this.columnWidthObjects.length===i.length){var a=new Array;i.forEach(function(e,i){var r=t.columnWidthObjects[i].queryName;null==a[r]?a[r]=e:a[r]=Math.max(e,a[r])});for(var r=0,o=this.columnWidthObjects;r<o.length;r++){var n=o[r],s=a[n.queryName];null!=s&&(n.width=s)}this.callHostToPersist(!0)}},t.prototype.getAutoSizeColumnWidthObject=function(){return{selector:null,objectName:"general",properties:{autoSizeColumnWidth:this.currentAutoColumnSizePropertyValue}}},t.prototype.generateVisualObjectInstancesToPersist=function(){this.visualObjectInstancesToPersist={merge:[this.getAutoSizeColumnWidthObject()]};for(var e=new Array,t=0,i=this.columnWidthObjects;t<i.length;t++){var a=i[t];a.queryName&&_.isNumber(a.width)&&!e[a.queryName]&&(this.visualObjectInstancesToPersist.merge.push({selector:{metadata:a.queryName},objectName:"general",properties:{columnWidth:a.width}}),e[a.queryName]=!0)}},t.columnWidthProp={objectName:"general",propertyName:"columnWidth"},t}();t.TablixColumnWidthManager=r}(i=t.controls||(t.controls={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=function(){function i(e){this.mainText=jsCommon.CssConstants.createClassAndSelector("mainText"),this.name=e,this.visualConfiguration={maxFontSize:60}}return i.prototype.getMetaDataColumn=function(e){if(e&&e.metadata&&e.metadata.columns)for(var t=0,i=e.metadata.columns.length;i>t;t++){var a=e.metadata.columns[t];if(a.isMeasure){this.metaDataColumn=a;break}}},i.prototype.getAdjustedFontHeight=function(e,t,i){var a={fontFamily:null,fontSize:null,text:t},r=this.getAdjustedFontHeightCore(a,e,i,0);return r},i.prototype.getAdjustedFontHeightCore=function(t,i,a,r){if(r>10)return a;t.fontSize=jsCommon.PixelConverter.toString(a);var o=e.TextMeasurementService.measureSvgTextWidth(t);return i>o?a:this.getAdjustedFontHeightCore(t,i,.9*a,r+1)},i.prototype.clear=function(){this.svg.select(this.mainText.selector).text("")},i.prototype.doValueTransition=function(e,i,a,r,o,n,s){if(n||e!==i||null==i){e||(e=0);var l=this.svg,c=this.currentViewport,u=c.height,h=c.width,d=[i],p=this.getSeedFontHeight(h,u),g=this.getTranslateX(h),m=this.getTranslateY(p),f=this.metaDataColumn;s||(s=t.valueFormatter.create({format:this.getFormatString(f),value:i,displayUnitSystemType:a,formatSingleValues:!0,allowFormatBeautification:!0,columnType:f?f.type:void 0}));var y=s.format(e),v=s.format(i);l.attr("class",this.name);var b=l.selectAll("text").data(d);b.enter().append("text").attr("class",this.mainText["class"]);var C=this.getAdjustedFontHeight(h,v,p);m=this.getTranslateY(C+(u-C)/2);var S=b.text(y).attr({"text-anchor":this.getTextAnchor(),"font-size":C,transform:t.SVGUtil.translate(g,m)}).style({fill:this.style.titleText.color.value}).call(t.tooltipUtils.tooltipUpdate,[y]);if(null==i)S.text(v).call(t.tooltipUtils.tooltipUpdate,[v]);else if(f&&t.AxisHelper.isDateTime(f.type))S.text(v).call(t.tooltipUtils.tooltipUpdate,[v]);else{var x=e;S.transition().duration(o).tween("text",function(e){var t=d3.interpolate(x,e);return function(e){var i=t(e);this.textContent=s.format(i)}})}t.SVGUtil.flushAllD3TransitionsIfNeeded(r)}},i.prototype.setTextColor=function(e){this.style.titleText.color.value=e},i.prototype.getSeedFontHeight=function(e,t){var i=Math.floor(.75*Math.min(e,t)),a=this.visualConfiguration.maxFontSize;return a?Math.min(a,i):i},i.prototype.getTranslateX=function(e){if(this.visualConfiguration)switch(this.visualConfiguration.align){case"left":return 0;case"right":return e}return e/2},i.prototype.getTranslateY=function(e){return e},i.prototype.getTextAnchor=function(){if(this.visualConfiguration)switch(this.visualConfiguration.align){case"left":return"start";case"right":return"end"}return"middle"},i.prototype.getFormatString=function(e){return t.valueFormatter.getFormatString(e,i.formatStringProp)},i.formatStringProp={objectName:"general",propertyName:"formatString"},i}();t.AnimatedText=i}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(t){function i(e,i){t.call(this,"animatedNumber"),e&&(this.svg=e),i&&(this.animator=i)}return __extends(i,t),i.prototype.init=function(e){this.options=e;var t=e.element;
17this.svg||(this.svg=d3.select(t.get(0)).append("svg")),this.currentViewport=e.viewport,this.hostServices=e.host,this.style=e.style,this.updateViewportDependantProperties()},i.prototype.updateViewportDependantProperties=function(){var e=this.currentViewport;this.svg.attr("width",e.width).attr("height",e.height)},i.prototype.update=function(e){this.currentViewport=e.viewport;var t=this.dataViews=e.dataViews;if(t&&t[0]){var i=t[0];this.updateViewportDependantProperties(),this.getMetaDataColumn(i);var a=i&&i.single?i.single.value:0;null!=a&&this.updateInternal(a,e.suppressAnimations,!0,this.formatter)}},i.prototype.setFormatter=function(e){this.formatter=e},i.prototype.onDataChanged=function(e){this.update({dataViews:e.dataViews,suppressAnimations:e.suppressAnimations,viewport:this.currentViewport})},i.prototype.onResizing=function(e){this.update({dataViews:this.dataViews,suppressAnimations:!0,viewport:e})},i.prototype.canResizeTo=function(e){return!0},i.prototype.updateInternal=function(t,i,a,r){void 0===a&&(a=!1);var o=this.value||0,n=e.AnimatorCommon.GetAnimationDuration(this.animator,i);this.doValueTransition(o,t,null,this.options.animation,n,a,r),this.value=t},i}(e.AnimatedText);e.AnimatedNumber=t}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=function(){function i(e){}return Object.defineProperty(i.prototype,"shapeType",{get:function(){return this.data?this.data.shapeType:i.DefaultShape},set:function(e){this.data.shapeType=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lineColor",{get:function(){return this.data?this.data.lineColor:i.DefaultStrokeColor},set:function(e){this.data.lineColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lineTransparency",{get:function(){return this.data?this.data.lineTransparency:i.DefaultLineTransValue},set:function(e){this.data.lineTransparency=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lineWeight",{get:function(){return this.data?this.data.lineWeight:i.DefaultWeightValue},set:function(e){this.data.lineWeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"roundEdge",{get:function(){return this.data?this.data.roundEdge:i.DefaultRoundEdgeValue},set:function(e){this.data.roundEdge=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"showFill",{get:function(){return this.data?this.data.showFill:i.DefaultFillShowValue},set:function(e){this.data.showFill=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillColor",{get:function(){return this.data?this.data.fillColor:i.DefaultFillColor},set:function(e){this.data.fillColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"shapeTransparency",{get:function(){return this.data?this.data.shapeTransparency:i.DefaultFillTransValue},set:function(e){this.data.shapeTransparency=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"angle",{get:function(){return this.data?this.data.angle:i.DefaultAngle},set:function(e){this.data.angle=this.scaleTo360Deg(e)},enumerable:!0,configurable:!0}),i.prototype.init=function(e){this.element=e.element,this.selection=d3.select(this.element.context),this.currentViewport=e.viewport},i.prototype.update=function(e){this.currentViewport=e.viewport;var t=e.dataViews;if(!_.isEmpty(t)){var i=e.dataViews[0];if(i.metadata&&i.metadata.objects){var a=e.dataViews[0].metadata.objects;this.data=this.getDataFromDataView(a)}}this.render()},i.prototype.getDataFromDataView=function(a){return a?{shapeType:e.DataViewObjects.getValue(a,t.basicShapeProps.general.shapeType,i.DefaultShape),lineColor:this.getValueFromColor(e.DataViewObjects.getValue(a,t.basicShapeProps.line.lineColor,i.DefaultStrokeColor)),lineTransparency:e.DataViewObjects.getValue(a,t.basicShapeProps.line.transparency,i.DefaultLineTransValue),lineWeight:e.DataViewObjects.getValue(a,t.basicShapeProps.line.weight,i.DefaultWeightValue),roundEdge:e.DataViewObjects.getValue(a,t.basicShapeProps.line.roundEdge,i.DefaultRoundEdgeValue),shapeTransparency:e.DataViewObjects.getValue(a,t.basicShapeProps.fill.transparency,i.DefaultFillTransValue),fillColor:this.getValueFromColor(e.DataViewObjects.getValue(a,t.basicShapeProps.fill.fillColor,i.DefaultFillColor)),showFill:e.DataViewObjects.getValue(a,t.basicShapeProps.fill.show,i.DefaultFillShowValue),angle:this.scaleTo360Deg(e.DataViewObjects.getValue(a,t.basicShapeProps.rotation.angle,i.DefaultAngle))}:null},i.prototype.scaleTo360Deg=function(e){return 0!==e&&Math.abs(e)%360===0?e:(e%=360,e=(e+360)%360)},i.prototype.getValueFromColor=function(e){return e.solid?e.solid.color:e},i.prototype.enumerateObjectInstances=function(e){var i=[];switch(e.objectName){case"line":var a={selector:null,properties:{lineColor:this.lineColor,transparency:this.lineTransparency,weight:this.lineWeight},objectName:e.objectName};return this.data.shapeType===t.basicShapeType.rectangle&&(a.properties.roundEdge=this.roundEdge),i.push(a),i;case"fill":return this.shapeType!==t.basicShapeType.line&&i.push({selector:null,properties:{show:this.showFill,fillColor:this.fillColor,transparency:this.shapeTransparency},objectName:e.objectName}),i;case"rotation":return i.push({selector:null,properties:{angle:this.angle},objectName:e.objectName}),i}return null},i.prototype.render=function(){switch(this.selection.html(""),this.shapeType){case t.basicShapeType.rectangle:t.ShapeFactory.createRectangle(this.data,this.currentViewport.height,this.currentViewport.width,this.selection,this.angle);break;case t.basicShapeType.oval:t.ShapeFactory.createOval(this.data,this.currentViewport.height,this.currentViewport.width,this.selection,this.angle);break;case t.basicShapeType.line:t.ShapeFactory.createLine(this.data,this.currentViewport.height,this.currentViewport.width,this.selection,this.angle);break;case t.basicShapeType.arrow:t.ShapeFactory.createUpArrow(this.data,this.currentViewport.height,this.currentViewport.width,this.selection,this.angle);break;case t.basicShapeType.triangle:t.ShapeFactory.createTriangle(this.data,this.currentViewport.height,this.currentViewport.width,this.selection,this.angle)}},i.DefaultShape=t.basicShapeType.rectangle,i.DefaultStrokeColor="#00B8AA",i.DefaultFillColor="#E6E6E6",i.DefaultFillShowValue=!0,i.DefaultFillTransValue=0,i.DefaultWeightValue=3,i.DefaultLineTransValue=0,i.DefaultRoundEdgeValue=0,i.DefaultAngle=0,i}();t.BasicShapeVisual=i}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){function i(e){return _.isEmpty(e)?[]:_.filter(e,function(e){return!t.TrendLineHelper.isDataViewForRegression(e)})}function a(e){return e.length>1}function r(e,t,i){return 0===e&&!!t&&!!t.showAxisTitle||1===e&&!i&&!!t&&!!t.secShowAxisTitle}function o(e,t){var i={domain:void 0,merged:!1,tickCount:void 0};if(e.length<2)return i;var a,r,o,n,s=e[0].calculateAxesProperties(t)[1],l=e[1].calculateAxesProperties(t)[1],u=s.scale.domain(),h=l.scale.domain();if(s.values&&s.values.length>0&&l.values&&l.values.length>0&&(i.tickCount=Math.max(s.values.length,l.values.length)),a=Math.min(u[0],h[0]),r=Math.max(u[1],h[1]),t.forceMerge)return{domain:[a,r],merged:!0,tickCount:i.tickCount};if(u[0]>h[1]||u[1]<h[0])return i;n=Math.max(u[0],h[0]),o=Math.min(u[1],h[1]);var d=r-a;if(0===d)return i;var p=Math.abs((o-n)/d);return c>p?i:{domain:[a,r],merged:!0,tickCount:i.tickCount}}var n=jsCommon.EnumExtensions,s=jsCommon.CssConstants.createClassAndSelector,l=t.axisScale.linear,c=.1,u=6;t.DEFAULT_AXIS_COLOR="#777";var h=function(){function a(e){this.xRefLine=s("x-ref-line"),this.y1RefLine=s("y1-ref-line");var t=!1;this.trimOrdinalDataOnOverflow=!0,e&&(this.tooltipsEnabled=e.tooltipsEnabled,this.type=e.chartType,this.isLabelInteractivityEnabled=e.isLabelInteractivityEnabled,this.lineChartLabelDensityEnabled=e.lineChartLabelDensityEnabled,void 0!==e.trimOrdinalDataOnOverflow&&(this.trimOrdinalDataOnOverflow=e.trimOrdinalDataOnOverflow),e.isScrollable&&(t=e.isScrollable),this.animator=e.animator,e.cartesianSmallViewPortProperties&&(this.cartesianSmallViewPortProperties=e.cartesianSmallViewPortProperties),e.behavior&&(this.behavior=e.behavior)),this.axes=new m(t,p.ScrollbarWidth,this.trimOrdinalDataOnOverflow),this.svgAxes=new g(this.axes),this.svgBrush=new d(p.ScrollbarWidth),this.scrollableAxes=new p(this.axes,this.svgBrush)}return a.getAxisVisibility=function(e){switch(e){case 6:case 5:case 7:return 1;case 9:return 3;default:return 2}},a.prototype.init=function(e){this.visualInitOptions=e,this.layers=[];var i=this.element=e.element;this.currentViewport=e.viewport,this.hostServices=e.host;var r=this.chartAreaSvg=d3.select(i.get(0)).append("svg");r.classed(a.ClassName,!0),r.style("position","absolute"),this.behavior&&(this.clearCatcher=t.appendClearCatcher(r),this.interactivityService=t.createInteractivityService(this.hostServices)),null!=e.style.maxMarginFactor&&this.axes.setMaxMarginFactor(e.style.maxMarginFactor);var o=a.getAxisVisibility(this.type);this.axes.setAxisLinesVisibility(o),this.svgAxes.init(r),this.svgBrush.init(r),this.sharedColorPalette=new y(e.style.colorPalette.dataColors),this.legend=t.createLegend(i,e.interactivity&&e.interactivity.isInteractiveLegend,12!==this.type?this.interactivityService:void 0,this.axes.isScrollable),this.isMobileChart=e.interactivity&&e.interactivity.isInteractiveLegend},a.prototype.isPlayAxis=function(){if(!this.dataViews||!this.dataViews[0])return!1;var e=this.dataViews[0],t=e.categorical&&e.categorical.categories&&e.categorical.categories[0]&&e.categorical.categories[0].source&&e.categorical.categories[0].source.roles&&e.categorical.categories[0].source.roles.Play;return 9===this.type&&(this.animator||this.isMobileChart)&&null!=e.matrix&&(!e.categorical||t)},a.getIsScalar=function(i,a,r){var o=e.DataViewObjects.getValue(i,a);return i&&void 0!==o?o===t.axisType.scalar&&!t.AxisHelper.isOrdinal(r):!t.AxisHelper.isOrdinal(r)},a.getAdditionalTelemetry=function(e){var i={},a=e&&e.categorical&&_.first(e.categorical.categories);return a&&(i.axisType=t.CartesianChart.getIsScalar(e.metadata.objects,t.columnChartProps.categoryAxis.axisType,a.source.type)?"scalar":"categorical"),i},a.detectScalarMapping=function(e){if(!e||!e.categorical||!e.categorical.categories)return!1;var i=e.categorical.categories,r=i["for"]["in"].items;if(_.isEmpty(r))return!1;var o=r[0].type;if(!e.metadata)return!1;var n=e.metadata.objects;return a.getIsScalar(n,t.columnChartProps.categoryAxis.axisType,o)},a.prototype.populateObjectProperties=function(i){if(i&&i.length>0){var a=i[0].metadata;a?(this.legendObjectProperties=e.DataViewObjects.getObject(a.objects,"legend",{}),this.xAxisReferenceLines=e.DataViewObjects.getUserDefinedObjects(a.objects,"xAxisReferenceLine"),this.y1AxisReferenceLines=e.DataViewObjects.getUserDefinedObjects(a.objects,"y1AxisReferenceLine")):this.legendObjectProperties={},this.categoryAxisProperties=t.CartesianHelper.getCategoryAxisProperties(a),this.valueAxisProperties=t.CartesianHelper.getValueAxisProperties(a)}},a.prototype.updateInternal=function(a,r){var o=this.dataViews=a.dataViews;if(this.currentViewport=a.viewport,o){if(0===this.layers.length){var n=this.extractMetadataObjects(o);this.layers=this.createAndInitLayers(n)}var s=this.layers;if(r){if(!_.isEmpty(o)){this.populateObjectProperties(o),this.axes.update(o),this.svgAxes.update(this.categoryAxisProperties,this.valueAxisProperties);var l=o[0];l.metadata&&(this.background={image:e.DataViewObjects.getValue(l.metadata.objects,t.scatterChartProps.plotArea.image),transparency:e.DataViewObjects.getValue(l.metadata.objects,t.scatterChartProps.plotArea.transparency,t.visualBackgroundHelper.getDefaultTransparency())})}this.sharedColorPalette.clearPreferredScale();var c=i(o),u=_.filter(o,function(e){return t.TrendLineHelper.isDataViewForRegression(e)});this.trendLines=[];for(var h=0,d=s.length;d>h;h++){var p=c[h];if(s[h].setData(p?[p]:[]),this.supportsTrendLines(h)){var g=u[h];if(g){var m=h>0,f=t.TrendLineHelper.readDataView(g,p,m,this.sharedColorPalette);(v=this.trendLines).push.apply(v,f)}}d>1&&this.sharedColorPalette.rotateScale()}}if(this.render(!this.hasSetData||a.suppressAnimations,a.resizeMode),this.hasSetData=this.hasSetData||o&&o.length>0,o&&o.length>0){var y=t.getInvalidValueWarnings(o,!1,!1,!1);this.axes.addWarnings(y),y&&y.length>0&&this.hostServices.setWarnings(y)}var v}},a.prototype.onDataChanged=function(e){this.updateInternal({dataViews:e.dataViews,suppressAnimations:e.suppressAnimations,viewport:this.currentViewport},!0)},a.prototype.onResizing=function(e,t){this.updateInternal({dataViews:this.dataViews,suppressAnimations:!0,viewport:e,resizeMode:t},!1)},a.prototype.scrollTo=function(e){this.scrollableAxes.scrollTo(e)},a.prototype.enumerateObjectInstances=function(i){var a=new t.ObjectEnumerationBuilder,r=this.layers?this.layers.length:0;if("legend"===i.objectName){if(!this.shouldShowLegendCard())return;var o=e.DataViewObject.getValue(this.legendObjectProperties,t.legendProps.show,this.legend.isVisible()),n=e.DataViewObject.getValue(this.legendObjectProperties,t.legendProps.showTitle,!0),s=e.DataViewObject.getValue(this.legendObjectProperties,t.legendProps.titleText,this.layerLegendData?this.layerLegendData.title:""),l=e.DataViewObject.getValue(this.legendObjectProperties,t.legendProps.labelColor,t.LegendData.DefaultLegendLabelFillColor),c=e.DataViewObject.getValue(this.legendObjectProperties,t.legendProps.fontSize,this.layerLegendData&&this.layerLegendData.fontSize?this.layerLegendData.fontSize:t.SVGLegend.DefaultFontSizeInPt);a.pushInstance({selector:null,properties:{show:o,position:t.LegendPosition[this.legend.getOrientation()],showTitle:n,titleText:s,labelColor:l,fontSize:c},objectName:i.objectName})}else if("categoryAxis"===i.objectName&&this.axes.hasCategoryAxis())this.getCategoryAxisValues(a);else if("valueAxis"===i.objectName)this.getValueAxisValues(a);else if("y1AxisReferenceLine"===i.objectName){var u=this.sharedColorPalette.getColorByIndex(0).value;t.ReferenceLineHelper.enumerateObjectInstances(a,this.y1AxisReferenceLines,u,i.objectName)}else if("xAxisReferenceLine"===i.objectName){var u=this.sharedColorPalette.getColorByIndex(0).value;t.ReferenceLineHelper.enumerateObjectInstances(a,this.xAxisReferenceLines,u,i.objectName)}else"trend"===i.objectName?this.supportsTrendLines()&&t.TrendLineHelper.enumerateObjectInstances(a,this.trendLines):"plotArea"===i.objectName&&t.visualBackgroundHelper.enumeratePlot(a,this.background);if("dataPoint"===i.objectName&&t.ComboChart.isComboChart(this.type))t.ComboChart.enumerateDataPoints(a,i,this.layers);else for(var h=0,d=r;d>h;h++){var p=this.layers[h];p.enumerateObjectInstances&&p.enumerateObjectInstances(a,i)}return a.complete()},a.prototype.supportsTrendLines=function(e){var t=i(this.dataViews);if(_.isEmpty(this.layers))return!1;var a=null==e?this.layers:[this.layers[e]];return _.all(a,function(e,i){return t[i]?e.supportsTrendLine&&e.supportsTrendLine():!0})},a.prototype.shouldShowLegendCard=function(){var e=this.layers,t=this.dataViews;if(e&&t)for(var i=e.length,a=0,r=0;i>r;r++){if(e[r].hasLegend())return!0;var o=t[r];if(o&&o.categorical&&o.categorical.values&&o.categorical.values.length>0&&(a++,a>1))return!0}return!1},a.prototype.getAxisScaleOptions=function(e){var i=[l];return this.axes.isLogScaleAllowed(e)&&i.push(t.axisScale.log),i},a.prototype.getCategoryAxisValues=function(e){if(this.categoryAxisProperties){var i=t.axisType.both,a=!1,r=this.getAxisScaleOptions(0);this.layers&&this.layers[0].getSupportedCategoryAxisType&&(i=this.layers[0].getSupportedCategoryAxisType(),a=i===t.axisType.scalar?!0:t.CartesianHelper.isScalar(i===t.axisType.both,this.categoryAxisProperties)),a||(this.categoryAxisProperties.start=null,this.categoryAxisProperties.end=null);var o={selector:null,properties:{},objectName:"categoryAxis",validValues:{axisScale:r,axisStyle:this.axes.categoryAxisHasUnitType?[t.axisStyle.showTitleOnly,t.axisStyle.showUnitOnly,t.axisStyle.showBoth]:[t.axisStyle.showTitleOnly]}};if(o.properties.show=null!=this.categoryAxisProperties.show?this.categoryAxisProperties.show:!0,this.axes.isYAxisCategorical()&&(o.properties.position=this.valueAxisProperties&&null!=this.valueAxisProperties.position?this.valueAxisProperties.position:t.yAxisPosition.left),i===t.axisType.both&&(o.properties.axisType=a?t.axisType.scalar:t.axisType.categorical),a&&(o.properties.axisScale=this.categoryAxisProperties.axisScale||l,o.properties.start=this.categoryAxisProperties.start,o.properties.end=this.categoryAxisProperties.end),o.properties.showAxisTitle=null!=this.categoryAxisProperties.showAxisTitle?this.categoryAxisProperties.showAxisTitle:!1,o.properties.axisStyle=this.categoryAxisProperties.axisStyle?this.categoryAxisProperties.axisStyle:t.axisStyle.showTitleOnly,o.properties.labelColor=this.categoryAxisProperties.labelColor||t.DEFAULT_AXIS_COLOR,a){o.properties.labelDisplayUnits=this.categoryAxisProperties.labelDisplayUnits?this.categoryAxisProperties.labelDisplayUnits:0;var n=this.categoryAxisProperties.labelPrecision;o.properties.labelPrecision=void 0===n||0>n?t.dataLabelUtils.defaultLabelPrecision:n}e.pushInstance(o)}},a.prototype.getValueAxisValues=function(i){if(this.valueAxisProperties){var a=this.getAxisScaleOptions(1),r=this.getAxisScaleOptions(2),o={selector:null,properties:{},objectName:"valueAxis",validValues:{axisScale:a,secAxisScale:r,axisStyle:this.axes.valueAxisHasUnitType?[t.axisStyle.showTitleOnly,t.axisStyle.showUnitOnly,t.axisStyle.showBoth]:[t.axisStyle.showTitleOnly]}};if(o.properties.show=null!=this.valueAxisProperties.show?this.valueAxisProperties.show:!0,this.axes.isYAxisCategorical()||(o.properties.position=null!=this.valueAxisProperties.position?this.valueAxisProperties.position:t.yAxisPosition.left),o.properties.axisScale=this.valueAxisProperties.axisScale||l,o.properties.start=this.valueAxisProperties.start,o.properties.end=this.valueAxisProperties.end,o.properties.showAxisTitle=null!=this.valueAxisProperties.showAxisTitle?this.valueAxisProperties.showAxisTitle:!1,o.properties.axisStyle=null!=this.valueAxisProperties.axisStyle?this.valueAxisProperties.axisStyle:t.axisStyle.showTitleOnly,o.properties.labelColor=this.valueAxisProperties.labelColor||t.DEFAULT_AXIS_COLOR,7!==this.type&&8!==this.type){o.properties.labelDisplayUnits=this.valueAxisProperties.labelDisplayUnits?this.valueAxisProperties.labelDisplayUnits:0;var n=this.valueAxisProperties.labelPrecision;o.properties.labelPrecision=void 0===n||0>n?t.dataLabelUtils.defaultLabelPrecision:n}if(i.pushInstance(o),2===this.layers.length&&(o.properties.secShow=null!=this.valueAxisProperties.secShow?this.valueAxisProperties.secShow:this.axes.hasY2Axis(),o.properties.secShow&&(o.properties.axisLabel="")),this.axes.hasY2Axis()&&o.properties.secShow){i.pushContainer({displayName:e.data.createDisplayNameGetter("Visual_YAxis_ShowSecondary")});var s={selector:null,properties:{},objectName:"valueAxis"};s.properties.secAxisLabel="",s.properties.secPosition=null!=this.valueAxisProperties.secPosition?this.valueAxisProperties.secPosition:t.yAxisPosition.right,s.properties.secAxisScale=this.valueAxisProperties.secAxisScale||l,s.properties.secStart=this.valueAxisProperties.secStart,s.properties.secEnd=this.valueAxisProperties.secEnd,s.properties.secShowAxisTitle=null!=this.valueAxisProperties.secShowAxisTitle?this.valueAxisProperties.secShowAxisTitle:!1,i.pushInstance(s).pushInstance({selector:null,properties:{secAxisStyle:this.valueAxisProperties.secAxisStyle?this.valueAxisProperties.secAxisStyle:t.axisStyle.showTitleOnly,labelColor:this.valueAxisProperties.secLabelColor,secLabelDisplayUnits:this.valueAxisProperties.secLabelDisplayUnits?this.valueAxisProperties.secLabelDisplayUnits:0,secLabelPrecision:this.valueAxisProperties.secLabelPrecision<0?0:this.valueAxisProperties.secLabelPrecision},objectName:"valueAxis",validValues:{secAxisStyle:this.axes.secondaryValueAxisHasUnitType?[t.axisStyle.showTitleOnly,t.axisStyle.showUnitOnly,t.axisStyle.showBoth]:[t.axisStyle.showTitleOnly],axisScale:a}}),i.popContainer()}}},a.prototype.onClearSelection=function(){if(this.hasSetData)for(var e=0,t=this.layers.length;t>e;e++){var i=this.layers[e];i.onClearSelection(),i.render(!0)}},a.prototype.extractMetadataObjects=function(e){var t;if(e&&e.length>0){var i=e[0].metadata;i&&(t=i.objects)}return t},a.prototype.createAndInitLayers=function(t){var i=this,a=f.createLayers(this.type,t,this.interactivityService,this.animator,this.axes.isScrollable,this.tooltipsEnabled,this.lineChartLabelDensityEnabled),r=e.Prototype.inherit(this.visualInitOptions);r.svg=this.svgAxes.getScrollableRegion(),r.labelsContext=this.svgAxes.getLabelsRegion(),r.cartesianHost={updateLegend:function(e){return i.legend.drawLegend(e,i.currentViewport)},getSharedColors:function(){return i.sharedColorPalette},triggerRender:function(e){return i.render(e)}},r.chartType=this.type;for(var o=0,n=a.length;n>o;o++)a[o].init(r);return a},a.prototype.renderLegend=function(){for(var e=this.layers,i={title:"",dataPoints:[]},a=function(a,o){r.layerLegendData=e[a].calculateLegend(),r.layerLegendData&&(i.title=0===a?r.layerLegendData.title||"":i.title,i.labelColor=r.layerLegendData.labelColor,_.isEmpty(r.layerLegendData.dataPoints)||r.layerLegendData.dataPoints.forEach(function(e){return e.layerNumber=a}),i.dataPoints=i.dataPoints.concat(r.layerLegendData.dataPoints||[]),i.fontSize=r.layerLegendData.fontSize||t.SVGLegend.DefaultFontSizeInPt,r.layerLegendData.grouped&&(i.grouped=!0))},r=this,o=0,n=e.length;n>o;o++)a(o,n);var s=this.legendObjectProperties;if(s){t.LegendData.update(i,s);var l=s[t.legendProps.position];l&&this.legend.changeOrientation(t.LegendPosition[l])}else this.legend.changeOrientation(t.LegendPosition.Top);(1===i.dataPoints.length&&!i.grouped||this.hideLegends())&&(i.dataPoints=[]),this.legend.drawLegend(i,this.currentViewport)},a.prototype.hideLegends=function(){return!!(this.cartesianSmallViewPortProperties&&this.cartesianSmallViewPortProperties.hideLegendOnSmallViewPort&&this.currentViewport.height<this.cartesianSmallViewPortProperties.MinHeightLegendVisible)},a.prototype.render=function(i,r){var o=this;this.visualInitOptions.interactivity&&this.visualInitOptions.interactivity.isInteractiveLegend||this.renderLegend();var n,s=this.legendMargins=this.legend.getMargins(),l=this.legend.getOrientation(),c=this.hideAxisLabels(s),u={height:this.currentViewport.height-s.height,width:this.currentViewport.width-s.width},h=e.Prototype.inherit(g.AxisPadding);this.isPlayAxis()&&(u.height-=a.PlayAxisBottomMargin,n={left:t.Legend.isLeft(l)?s.width:0,top:t.Legend.isTop(l)?s.height+u.height:u.height,height:a.PlayAxisBottomMargin,width:u.width}),this.chartAreaSvg.attr({width:u.width,height:u.height}),t.Legend.positionChartArea(this.chartAreaSvg,this.legend);var d=this.calculateInteractivityRightMargin(),p=this.getMinimumDomainExtents(),m=p[0],f=p[1],y=this.axes.negotiateAxes(this.layers,u,h,n,c,a.AxisTextProperties,d,m,f),v=!this.renderedPlotArea||this.renderedPlotArea.height!==y.plotArea.height||this.renderedPlotArea.width!==y.plotArea.width;i=i||v,this.scrollableAxes.render(y,this.layers,i,function(e,t,i){return o.renderPlotArea(e,t,i,s,r)}),this.chartAreaSvg.on("wheel",function(){if(o.axes.isXScrollBarVisible||o.axes.isYScrollBarVisible){t.TooltipManager.ToolTipInstance.hide();var e=d3.event,i=e.deltaY;o.scrollableAxes.scrollDelta(i)}}),this.renderedPlotArea=y.plotArea},a.prototype.getMinimumDomainExtents=function(){var e=[],i=[];if(!_.isEmpty(this.xAxisReferenceLines)){var a=this.xAxisReferenceLines[0].object,r=t.ReferenceLineHelper.extractReferenceLineValue(a);e.push(r)}if(!_.isEmpty(this.y1AxisReferenceLines)){var o=this.y1AxisReferenceLines[0].object,r=t.ReferenceLineHelper.extractReferenceLineValue(o);i.push(r)}var n={min:d3.min(e),max:d3.max(e)},s={min:d3.min(i),max:d3.max(i)};return[n,s]},a.prototype.getPlotAreaRect=function(e,i){var a={left:e.margin.left,top:e.margin.top,width:e.plotArea.width,height:e.plotArea.height};if(this.legend){var r=this.legend.getOrientation();t.Legend.isTop(r)?a.top+=i.height:t.Legend.isLeft(r)&&(a.left+=i.width)}return a},a.prototype.renderBackgroundImage=function(e){t.visualBackgroundHelper.renderBackgroundImage(this.background,this.element,e)},a.prototype.hideAxisLabels=function(e){return!(!(this.cartesianSmallViewPortProperties&&this.cartesianSmallViewPortProperties.hideAxesOnSmallViewPort&&this.currentViewport.height<this.cartesianSmallViewPortProperties.MinHeightAxesVisible)||this.visualInitOptions.interactivity.isInteractiveLegend)},a.prototype.calculateInteractivityRightMargin=function(){return this.visualInitOptions.interactivity&&this.visualInitOptions.interactivity.isInteractiveLegend&&!this.trimOrdinalDataOnOverflow?u:0},a.prototype.renderPlotArea=function(e,i,a,r,o){var n=i.axes,s=i.plotArea,l=this.getPlotAreaRect(i,r),c=t.AnimatorCommon.GetAnimationDuration(this.animator,a),u=this.animator&&this.animator.getEasing();this.renderBackgroundImage(l),_.isEmpty(u)?this.svgAxes.renderAxes(i,c):this.svgAxes.renderAxes(i,c,u),this.renderReferenceLines(i),this.renderLayers(e,s,n,a,o),this.renderTrendLines(i)},a.prototype.renderTrendLines=function(e){var i=this.svgAxes.getScrollableRegion();t.TrendLineHelper.render(this.trendLines,i,e.axes,e.plotArea)},a.prototype.renderReferenceLines=function(e){var i=e.axes,a=e.plotArea,r=this.svgAxes.getScrollableRegion(),o=this.sharedColorPalette.getColorByIndex(0).value,n=!1;if(this.y1AxisReferenceLines)for(var s=0,l=this.y1AxisReferenceLines;s<l.length;s++){var c=l[s],u=c.object;if(u[t.ReferenceLineHelper.referenceLineProps.show]){var h=!i.y1.isCategoryAxis,d={graphicContext:r,referenceLineProperties:u,axes:i,viewport:a,classAndSelector:this.y1RefLine,defaultColor:o,isHorizontal:h};t.ReferenceLineHelper.render(d),n=!0}}n||r.selectAll(this.y1RefLine.selector).remove();var p=!1;if(this.xAxisReferenceLines)for(var g=0,m=this.xAxisReferenceLines;g<m.length;g++){var c=m[g],u=c.object;if(u[t.ReferenceLineHelper.referenceLineProps.show]){var h=!1,f={graphicContext:r,referenceLineProperties:u,axes:i,viewport:a,classAndSelector:this.xRefLine,defaultColor:o,isHorizontal:h};t.ReferenceLineHelper.render(f),p=!0}}p||r.selectAll(this.xRefLine.selector).remove()},a.prototype.getReferenceLineLabels=function(e,i){var a=this.sharedColorPalette.getColorByIndex(0).value,r=[];if(this.y1AxisReferenceLines)for(var o=0,n=this.y1AxisReferenceLines;o<n.length;o++){var s=n[o],l=s.object;if(l[t.ReferenceLineHelper.referenceLineProps.show]&&l[t.ReferenceLineHelper.referenceLineProps.dataLabelShow]){var c=!e.y1.isCategoryAxis,u={referenceLineProperties:l,axes:e,viewport:i,defaultColor:a,isHorizontal:c,key:JSON.stringify({type:"y1AxisReferenceLine",id:s.id})};r.push(t.ReferenceLineHelper.createLabelDataPoint(u))}}if(this.xAxisReferenceLines)for(var h=0,d=this.xAxisReferenceLines;h<d.length;h++){var s=d[h],l=s.object;if(l[t.ReferenceLineHelper.referenceLineProps.show]&&l[t.ReferenceLineHelper.referenceLineProps.dataLabelShow]){var c=!1,p={referenceLineProperties:l,axes:e,viewport:i,defaultColor:a,isHorizontal:c,key:JSON.stringify({type:"xAxisReferenceLine",id:s.id})};r.push(t.ReferenceLineHelper.createLabelDataPoint(p))}}return r},a.prototype.renderDataLabels=function(i,a,r,o,n){var s=this.svgAxes.getLabelBackground(),l=this.svgAxes.getLabelsRegion();if(this.behavior){var c=t.NewDataLabelUtils.getDataLabelLayoutOptions(this.type),u=new e.LabelLayout(c),h=u.layout(i,r);n&&t.NewDataLabelUtils.drawLabelBackground(s,h,"#FFFFFF",.7);var d=void 0,p=this.animator;if(p&&!o){var g=this.isPlayAxis(),m=g?t.PlayChart.FrameAnimationDuration:p.getDuration();d=t.NewDataLabelUtils.animateDefaultLabels(l,h,m,a,g?"linear":p.getEasing())}else d=t.NewDataLabelUtils.drawDefaultLabels(l,h,a);if(c.allowLeaderLines){var f=_.filter(h,function(e){return null!=e.leaderLinePoints&&!_.isEmpty(e.leaderLinePoints)&&null!=e.identity});t.NewDataLabelUtils.drawLabelLeaderLines(l,f,function(e){return e.identity.getKey()})}if(this.interactivityService&&this.isLabelInteractivityEnabled){var y={labelItems:d};this.interactivityService.bind(h,new t.LabelsBehavior,y,{isLabels:!0})}}else{var u=new e.LabelLayout({maximumOffset:t.NewDataLabelUtils.maxLabelOffset,startingOffset:t.NewDataLabelUtils.startingLabelOffset,attemptToMoveLabelsIntoViewport:!0}),h=u.layout(i,r);n&&t.NewDataLabelUtils.drawLabelBackground(s,h,"#FFFFFF",.7),t.NewDataLabelUtils.drawDefaultLabels(l,h,a)}},a.prototype.renderLayers=function(e,i,a,r,o){for(var n=[],s=[],l=[],c=!0,u=0,h=e.length;h>u;u++){var d=e[u].render(r,o);if(d){if(this.behavior&&(s=s.concat(d.dataPoints),l.push(d.behaviorOptions)),d.labelDataPointGroups)for(var p=d.labelDataPointGroups,g=0,m=p;g<m.length;g++){var f=m[g];f&&n.push({labelDataPoints:t.NewDataLabelUtils.removeDuplicates(f.labelDataPoints||[]),maxNumberOfLabels:f.maxNumberOfLabels})}else{var y=d.labelDataPoints||[];n.push({labelDataPoints:t.NewDataLabelUtils.removeDuplicates(y),maxNumberOfLabels:y.length})}c=c&&d.labelsAreNumeric}}var v=this.getReferenceLineLabels(a,i);if(_.isEmpty(v)||n.unshift({labelDataPoints:v,maxNumberOfLabels:v.length}),this.renderDataLabels(n,c,i,r,t.ComboChart.isComboChart(this.type)),this.interactivityService){var b={layerOptions:l,clearCatcher:this.clearCatcher};this.interactivityService.bind(s,this.behavior,b)}},a.getPreferredPlotArea=function(e,t,i,r,o,n,s){n||(n={top:0,right:0,bottom:0,left:0});var l={height:i.height-n.top-n.bottom,width:i.width-n.left-n.right};if(!o&&r){var c=a.getPreferredCategorySpan(e,t,s);l.width=Math.max(c,l.width)}return l},a.getPreferredCategorySpan=function(e,t,i){var r=t*e;return i?r:r+t*a.OuterPaddingRatio*2},a.getLayout=function(t,i){var r=i.categoryCount,o=i.availableWidth,n=i.domain,s=i.trimOrdinalDataOnOverflow,l=!!i.isScalar,c=!!i.isScrollable,u=a.getCategoryThickness(t?t.series:null,r,o,n,l,s),h=u*a.OuterPaddingRatio*2,d=e.Double.floorWithPrecision((o-h)/u),p=Math.min(d,r),g=r>p&&c,m=a.OuterPaddingRatio;if(!l&&!g){var f=(o-u*p)/2;m=f/u}return!l&&c&&(p=r),{categoryCount:p,categoryThickness:u,outerPaddingRatio:m,isScalar:l}},a.getCategoryThickness=function(e,t,i,r,o,n){var s;if(2>t)s=i*(1-a.OuterPaddingRatio);else if(o&&r&&r.length>1){var l=a.getMinInterval(e),c=r[r.length-1]-r[0],u=l/(c+l*a.OuterPaddingRatio*2);s=i*u,s=Math.max(s,a.MinScalarRectThickness)}else s=i/(t+2*a.OuterPaddingRatio),n&&(s=Math.max(s,a.MinOrdinalRectThickness));var h=i/(3+2*a.OuterPaddingRatio);return s=Math.min(s,h),!o&&t>=3&&n?Math.max(s,a.MinOrdinalRectThickness):s},a.getMinInterval=function(e){var t=Number.MAX_VALUE;if(e.length>0)for(var i=e[0].data.filter(function(e){return!e.highlight}),a=0,r=i.length-1;r>a;a++)t=Math.min(t,Math.abs(i[a+1].categoryValue-i[a].categoryValue));return t},a.MinOrdinalRectThickness=20,a.MinScalarRectThickness=2,a.OuterPaddingRatio=.4,a.InnerPaddingRatio=.2,a.TickLabelPadding=2,a.ClassName="cartesianChart",a.PlayAxisBottomMargin=80,a.FontSize=11,a.FontSizeString=jsCommon.PixelConverter.toString(a.FontSize),a.AxisTextProperties={fontFamily:"wf_segoe-ui_normal",fontSize:a.FontSizeString},a}();t.CartesianChart=h;var d=function(){function e(e){this.brush=d3.svg.brush(),this.brushWidth=e}return e.prototype.init=function(e){this.element=e},e.prototype.remove=function(){this.element.selectAll(e.Brush.selector).remove(),this.brushGraphicsContext=void 0},e.prototype.getExtent=function(){return this.brush.extent()},e.prototype.setExtent=function(e){this.brush.extent(e)},e.prototype.setScale=function(e){this.isHorizontal?this.brush.x(e):this.brush.y(e)},e.prototype.setOrientation=function(e){this.isHorizontal=e},e.prototype.renderBrush=function(i,a,r,o){var n=this;this.brushGraphicsContext||(this.brushGraphicsContext=this.element.append("g").classed(e.Brush["class"],!0)),this.scrollCallback=o,this.brush.on("brushstart",function(){return n.brushStartExtent=n.brush.extent()}).on("brush",function(){window.requestAnimationFrame(o)}).on("brushend",function(){n.resizeExtent(i),n.updateExtentPosition(i),n.brushStartExtent=null;
18});var s=this.brushGraphicsContext.attr({transform:t.SVGUtil.translate(a,r),"drag-resize-disabled":"true"}).call(this.brush);s.selectAll(".resize").remove(),this.isHorizontal?s.selectAll("rect").attr("height",this.brushWidth):s.selectAll("rect").attr("width",this.brushWidth)},e.prototype.scroll=function(e){this.updateExtentPosition(e),this.scrollCallback()},e.prototype.updateExtentPosition=function(e){var t=this.brush.extent(),i=t[0],a=e/2;if(t[0]===t[1]&&(i-=a),t[1]-t[0]>e){var r=(t[1]-t[0])/2;i=t[0]<this.brushStartExtent[0]?t[0]+r-a:t[1]-r-a}this.isHorizontal?this.brushGraphicsContext.select(".extent").attr("x",i):this.brushGraphicsContext.select(".extent").attr("y",i)},e.prototype.resizeExtent=function(e){this.isHorizontal?this.brushGraphicsContext.select(".extent").attr("width",e):this.brushGraphicsContext.select(".extent").attr("height",e)},e.Brush=s("brush"),e}(),p=function(){function i(e,t){this.axes=e,this.brush=t}return i.prototype.filterDataToViewport=function(e,i,a,r,o,n){if(r){var s=void 0,l=[],c=t.AxisHelper.lookupOrdinalIndex(r,o[0]),u=c+n,h=r.domain();if(s=h.slice(c,u),s&&s.length>0){for(var d=0;d<i.length;d++)l[d]=i[d].setFilteredData(s[0],s[s.length-1]+1);e.domain(s);var p=void 0;p=this.axes.isXScrollBarVisible?a.x:a.y1,p.axis.scale(e),p.scale(e),p.axis.ticks(s.length),p.axis.tickValues(s);var g=p.axis.tickFormat();p.values=_.map(s,function(e){return g(e)})}}},i.prototype.render=function(t,i,a,r){var o=this,n=t.plotArea;if(!(n.width<1||n.height<1)){this.axisScale=null;var s,l,c,u,d,p;if(this.axes.isXScrollBarVisible){this.axisScale=t.axes.x.scale,s=t.margin.left,l=t.viewport.height,d=t.axes.x.categoryThickness;var g=t.axes.x.outerPadding;u=e.Double.floorWithPrecision((n.width-2*g)/d),c=(u+1)*d,p=n.width}else{if(!this.axes.isYScrollBarVisible)return this.brush.remove(),void r(i,t,a);this.axisScale=t.axes.y1.scale,s=t.viewport.width,l=t.margin.top,d=t.axes.y1.categoryThickness;var g=t.axes.y1.outerPadding;u=e.Double.floorWithPrecision((n.height-2*g)/d),c=(u+1)*d,p=n.height}if(!(1>u)){this.scrollScale=this.axisScale.copy(),this.scrollScale.rangeBands([0,c]),this.brushMinExtent=this.scrollScale(u-1),this.axisScale.rangeBands([0,p],h.InnerPaddingRatio,h.OuterPaddingRatio),this.brush.setOrientation(this.axes.isXScrollBarVisible),this.brush.setScale(this.scrollScale),this.brush.setExtent([0,this.brushMinExtent]);var m=function(e,a){o.filterDataToViewport(o.axisScale,i,t.axes,o.scrollScale,e,u),r(i,t,a)},f=function(){return o.onBrushed(c,m)};this.brush.renderBrush(this.brushMinExtent,s,l,f),m(this.brush.getExtent(),a)}}},i.prototype.scrollDelta=function(e){if(this.axisScale&&!_.isEmpty(this.axisScale.domain())){var t=this.axisScale.domain()[0],i=t+Math.round(e/h.MinOrdinalRectThickness);this.scrollTo(i)}},i.prototype.scrollTo=function(e){var t=_.last(this.scrollScale.domain());e=Math.max(0,Math.min(e,t));var a=this.brush.getExtent(),r=a[1]-a[0],o=(this.scrollScale(1)-this.scrollScale(0))/2;a[0]=this.scrollScale(e)+o,a[1]=a[0]+r+o,this.brush.setExtent(a);var n=this.scrollScale.rangeExtent()[1];i.clampBrushExtent(this.brush,n,this.brushMinExtent),this.brush.scroll(n)},i.prototype.onBrushed=function(e,t){var a=this.brush;i.clampBrushExtent(this.brush,e,this.brushMinExtent);var r=a.getExtent();t(r,!0)},i.clampBrushExtent=function(e,t,i){var a=e.getExtent(),r=a[1]-a[0];if(!(r===i&&a[1]<=t&&a[0]>=0)){if(r>i){var o=(r-i)/2;a[0]+=o,a[1]-=o}else if(i>r){var o=(i-r)/2;a[0]-=o,a[1]+=o}a[0]<0?(a[0]=0,a[1]=i):a[0]>t-i&&(a[0]=t-i,a[1]=t),e.setExtent(a)}},i.ScrollbarWidth=10,i}(),g=function(){function i(e){this.axes=e}return i.prototype.getScrollableRegion=function(){return this.axisGraphicsContextScrollable},i.prototype.getLabelsRegion=function(){return this.labelRegion},i.prototype.getLabelBackground=function(){return this.labelBackgroundRegion},i.prototype.getXAxis=function(){return this.xAxisGraphicsContext},i.prototype.getY1Axis=function(){return this.y1AxisGraphicsContext},i.prototype.getY2Axis=function(){return this.y2AxisGraphicsContext},i.prototype.update=function(e,t){this.categoryAxisProperties=e,this.valueAxisProperties=t},i.prototype.init=function(e){var a=this.axisGraphicsContext=e.append("g").classed(i.AxisGraphicsContext["class"],!0);this.svgScrollable=e.append("svg").classed("svgScrollable",!0).style("overflow","hidden");var r=this.axisGraphicsContextScrollable=this.svgScrollable.append("g").classed(i.AxisGraphicsContext["class"],!0);this.labelBackgroundRegion=this.svgScrollable.append("g").classed(t.NewDataLabelUtils.labelBackgroundGraphicsContextClass["class"],!0),this.labelRegion=this.svgScrollable.append("g").classed(t.NewDataLabelUtils.labelGraphicsContextClass["class"],!0);var o=this.axes.showLinesOnX,n=this.axes.showLinesOnY,s=n,l=!s;l?(this.y1AxisGraphicsContext=r.append("g").attr("class","y axis"),this.y2AxisGraphicsContext=r.append("g").attr("class","y axis")):(this.y1AxisGraphicsContext=a.append("g").attr("class","y axis"),this.y2AxisGraphicsContext=a.append("g").attr("class","y axis")),s?this.xAxisGraphicsContext=r.append("g").attr("class","x axis"):this.xAxisGraphicsContext=a.append("g").attr("class","x axis"),this.xAxisGraphicsContext.classed("showLinesOnAxis",o),this.y1AxisGraphicsContext.classed("showLinesOnAxis",n),this.y2AxisGraphicsContext.classed("showLinesOnAxis",n),this.xAxisGraphicsContext.classed("hideLinesOnAxis",!o),this.y1AxisGraphicsContext.classed("hideLinesOnAxis",!n),this.y2AxisGraphicsContext.classed("hideLinesOnAxis",!n)},i.updateAnimatedTickTooltips=function(e,t){e.each("end",function(){d3.select(this).selectAll("text").append("title").text(function(e,i){return t[i]})})},i.updateTickTooltips=function(e,t){e.selectAll("text").append("title").text(function(e,i){return t[i]})},i.prototype.renderAxes=function(a,r,o){void 0===o&&(o="cubic-in-out");var n,s,l,c=a.marginLimits,u=a.plotArea,d=a.viewport,p=a.margin,g=a.axes,m=a.tickLabelMargins,f=c.bottom,y=c.left;if(this.axes.shouldRenderAxis(g.x)){n=g.x.isCategoryAxis?this.categoryAxisProperties&&this.categoryAxisProperties.labelColor?this.categoryAxisProperties.labelColor:null:this.valueAxisProperties&&this.valueAxisProperties.labelColor?this.valueAxisProperties.labelColor:null,g.x.axis.orient("bottom"),!g.x.willLabelsFit&&t.AxisHelper.isOrdinalScale(g.x.scale)&&g.x.axis.tickPadding(i.TickPaddingRotatedX);var v=this.xAxisGraphicsContext;r?v.transition().duration(r).ease(o).call(g.x.axis).call(i.updateAnimatedTickTooltips,g.x.values):v.call(g.x.axis),v.call(i.darkenZeroLine).call(i.setAxisLabelColor,n);var b=v.selectAll("text");g.x.willLabelsWordBreak?b.call(t.AxisHelper.LabelLayoutStrategy.wordBreak,g.x,f):b.call(t.AxisHelper.LabelLayoutStrategy.rotate,f,e.TextMeasurementService.getTailoredTextOrDefault,h.AxisTextProperties,!g.x.willLabelsFit&&t.AxisHelper.isOrdinalScale(g.x.scale),f===m.xMax,g.x,p,this.axes.isXScrollBarVisible||this.axes.isYScrollBarVisible),r||i.updateTickTooltips(v,g.x.values)}else this.xAxisGraphicsContext.selectAll("*").remove();if(this.axes.shouldRenderAxis(g.y1)){s=g.y1.isCategoryAxis?this.categoryAxisProperties&&this.categoryAxisProperties.labelColor?this.categoryAxisProperties.labelColor:null:this.valueAxisProperties&&this.valueAxisProperties.labelColor?this.valueAxisProperties.labelColor:null;var C=this.axes.shouldShowY1OnRight(),S=C?a.tickPadding.right:a.tickPadding.left;g.y1.axis.tickSize(-u.width).tickPadding(S).orient(this.axes.getYAxisOrientation().toLowerCase());var x=this.y1AxisGraphicsContext;if(r?x.transition().duration(r).ease(o).call(g.y1.axis).call(i.updateAnimatedTickTooltips,g.y1.values):x.call(g.y1.axis),x.call(i.darkenZeroLine).call(i.setAxisLabelColor,s),m.yLeft>=y&&x.selectAll("text").call(t.AxisHelper.LabelLayoutStrategy.clip,y-S,e.TextMeasurementService.svgEllipsis),r||i.updateTickTooltips(x,g.y1.values),!g.y2||this.valueAxisProperties&&null!=this.valueAxisProperties.secShow&&!this.valueAxisProperties.secShow)this.y2AxisGraphicsContext.selectAll("*").remove();else{l=this.valueAxisProperties&&this.valueAxisProperties.secLabelColor?this.valueAxisProperties.secLabelColor:null;var w=C?a.tickPadding.left:a.tickPadding.right;g.y2.axis.tickSize(i.Y2TickSize).tickPadding(w).orient(C?t.yAxisPosition.left.toLowerCase():t.yAxisPosition.right.toLowerCase());var P=this.y2AxisGraphicsContext;r?P.transition().duration(r).ease(o).call(g.y2.axis).call(i.updateAnimatedTickTooltips,g.y2.values):P.call(g.y2.axis),P.call(i.darkenZeroLine).call(i.setAxisLabelColor,l),m.yRight>=y&&P.selectAll("text").call(t.AxisHelper.LabelLayoutStrategy.clip,y-w,e.TextMeasurementService.svgEllipsis),r||i.updateTickTooltips(P,g.y2.values)}}else this.y1AxisGraphicsContext.selectAll("*").remove(),this.y2AxisGraphicsContext.selectAll("*").remove();var D=a.axisLabels,L=null!=D.x||null!=D.y||null!=D.y2;if(L){var T=!this.axes.shouldRenderAxisTitle(g.x,!0,!1),_=!this.axes.shouldRenderAxisTitle(g.y1,!0,!1),V=!this.axes.shouldRenderAxisTitle(g.y2,!1,!0),M={axisLabels:D,viewport:d,margin:p,hideXAxisTitle:T,hideYAxisTitle:_,hideY2AxisTitle:V,xLabelColor:n,yLabelColor:s,y2LabelColor:l,fontSize:i.AxisLabelFontSize};this.renderAxesLabels(M)}else this.axisGraphicsContext.selectAll(".xAxisLabel").remove(),this.axisGraphicsContext.selectAll(".yAxisLabel").remove();this.translateAxes(d,p)},i.prototype.renderAxesLabels=function(i){this.axisGraphicsContext.selectAll(".xAxisLabel").remove(),this.axisGraphicsContext.selectAll(".yAxisLabel").remove();var a=i.margin,r=i.viewport.width-(a.left+a.right),o=i.viewport.height,n=i.fontSize,s=n,l=this.axes.shouldShowY1OnRight();if(!i.hideXAxisTitle){var c=this.axisGraphicsContext.append("text").style("text-anchor","middle").text(i.axisLabels.x).call(function(e){e.each(function(){var e=d3.select(this);e.attr({"class":"xAxisLabel",transform:t.SVGUtil.translate(r/2,o-s)})})});c.style("fill",i.xLabelColor?i.xLabelColor.solid.color:null),c.call(t.AxisHelper.LabelLayoutStrategy.clip,r,e.TextMeasurementService.svgEllipsis).call(t.tooltipUtils.tooltipUpdate,[i.axisLabels.x])}if(!i.hideYAxisTitle){var u=this.axisGraphicsContext.append("text").style("text-anchor","middle").text(i.axisLabels.y).call(function(e){e.each(function(){var e=d3.select(this);e.attr({"class":"yAxisLabel",transform:"rotate(-90)",y:l?r+a.right-n:-a.left,x:-((o-a.top-a.bottom)/2),dy:"1em"})})});u.style("fill",i.yLabelColor?i.yLabelColor.solid.color:null),u.call(t.AxisHelper.LabelLayoutStrategy.clip,o-(a.bottom+a.top),e.TextMeasurementService.svgEllipsis).call(t.tooltipUtils.tooltipUpdate,[i.axisLabels.y])}if(!i.hideY2AxisTitle&&i.axisLabels.y2){var h=this.axisGraphicsContext.append("text").style("text-anchor","middle").text(i.axisLabels.y2).call(function(e){e.each(function(){var e=d3.select(this);e.attr({"class":"yAxisLabel",transform:"rotate(-90)",y:l?-a.left:r+a.right-n,x:-((o-a.top-a.bottom)/2),dy:"1em"})})});h.style("fill",i.y2LabelColor?i.y2LabelColor.solid.color:null),h.call(t.AxisHelper.LabelLayoutStrategy.clip,o-(a.bottom+a.top),e.TextMeasurementService.svgEllipsis).call(t.tooltipUtils.tooltipUpdate,[i.axisLabels.y2])}},i.prototype.translateAxes=function(e,i){var a=e.width-(i.left+i.right),r=e.height-(i.top+i.bottom),o=this.axes.shouldShowY1OnRight();this.xAxisGraphicsContext.attr("transform",t.SVGUtil.translate(0,r)),this.y1AxisGraphicsContext.attr("transform",t.SVGUtil.translate(o?a:0,0)),this.y2AxisGraphicsContext.attr("transform",t.SVGUtil.translate(o?0:a,0)),this.svgScrollable.attr({x:0,width:e.width,height:e.height}),this.axisGraphicsContext.attr("transform",t.SVGUtil.translate(i.left,i.top)),this.axisGraphicsContextScrollable.attr("transform",t.SVGUtil.translate(i.left,i.top)),this.labelRegion.attr("transform",t.SVGUtil.translate(i.left,i.top)),this.labelBackgroundRegion.attr("transform",t.SVGUtil.translate(i.left,i.top)),this.axes.isXScrollBarVisible?(this.svgScrollable.attr({x:i.left}),this.axisGraphicsContextScrollable.attr("transform",t.SVGUtil.translate(0,i.top)),this.labelRegion.attr("transform",t.SVGUtil.translate(0,i.top)),this.labelBackgroundRegion.attr("transform",t.SVGUtil.translate(0,i.top)),this.svgScrollable.attr("width",a)):this.axes.isYScrollBarVisible&&this.svgScrollable.attr("height",r+i.top)},i.darkenZeroLine=function(e){e.selectAll("g.tick line").classed("zero-line",!1);var t=e.selectAll("g.tick").filter(function(e){return 0===e}).node();t&&d3.select(t).select("line").classed("zero-line",!0)},i.setAxisLabelColor=function(e,t){e.selectAll("g.tick text").style("fill",t?t.solid.color:null)},i.AxisPadding={left:10,right:10,top:0,bottom:13},i.AxisGraphicsContext=s("axisGraphicsContext"),i.TickPaddingRotatedX=5,i.AxisLabelFontSize=11,i.Y2TickSize=-6,i}();t.SvgCartesianAxes=g;var m=function(){function i(e,a,r){this.scrollbarWidth=a,this.isScrollable=e,this.maxMarginFactor=i.MaxMarginFactor,this.yAxisOrientation=t.yAxisPosition.left,this.trimOrdinalDataOnOverflow=r}return i.prototype.shouldShowY1OnRight=function(){return this.yAxisOrientation===t.yAxisPosition.right},i.prototype.isYAxisCategorical=function(){return this.layout&&this.layout.axes.y1.isCategoryAxis},i.prototype.hasCategoryAxis=function(){var e=this.layout&&this.layout.axes;return e?this.isYAxisCategorical()?e.y1&&null!=e.y1.axis:e.x&&null!=e.x.axis:!1},i.prototype.hasY2Axis=function(){return this.layout&&null!=this.layout.axes.y2},i.prototype.getYAxisOrientation=function(){return this.yAxisOrientation},i.prototype.setAxisLinesVisibility=function(e){this.showLinesOnX=n.hasFlag(e,3)||n.hasFlag(e,1),this.showLinesOnY=n.hasFlag(e,3)||n.hasFlag(e,2)},i.prototype.setMaxMarginFactor=function(e){this.maxMarginFactor=e},i.prototype.update=function(e){if(e&&e.length>0){var i=e[0].metadata;this.categoryAxisProperties=t.CartesianHelper.getCategoryAxisProperties(i),this.valueAxisProperties=t.CartesianHelper.getValueAxisProperties(i)}var a=this.valueAxisProperties.position;this.yAxisOrientation=a?a.toString():t.yAxisPosition.left},i.prototype.addWarnings=function(e){var i=this.layout&&this.layout.axes;(i&&i.x&&i.x.hasDisallowedZeroInDomain||i.y1&&i.y1.hasDisallowedZeroInDomain||i.y2&&i.y2.hasDisallowedZeroInDomain)&&e.unshift(new t.ZeroValueWarning)},i.prototype.calculateAxes=function(i,n,s,c,u,h,d,p,g,m){var f,y={viewport:n,margin:s,forcedXDomain:[this.categoryAxisProperties?this.categoryAxisProperties.start:null,this.categoryAxisProperties?this.categoryAxisProperties.end:null],forceMerge:this.valueAxisProperties&&this.valueAxisProperties.secShow===!1,showCategoryAxisLabel:!1,showValueAxisLabel:!1,trimOrdinalDataOnOverflow:this.trimOrdinalDataOnOverflow,categoryAxisScaleType:this.categoryAxisProperties&&null!=this.categoryAxisProperties.axisScale?this.categoryAxisProperties.axisScale:l,valueAxisScaleType:this.valueAxisProperties&&null!=this.valueAxisProperties.axisScale?this.valueAxisProperties.axisScale:l,categoryAxisDisplayUnits:this.categoryAxisProperties&&null!=this.categoryAxisProperties.labelDisplayUnits?this.categoryAxisProperties.labelDisplayUnits:0,valueAxisDisplayUnits:this.valueAxisProperties&&null!=this.valueAxisProperties.labelDisplayUnits?this.valueAxisProperties.labelDisplayUnits:0,categoryAxisPrecision:this.categoryAxisProperties?t.CartesianHelper.getPrecision(this.categoryAxisProperties.labelPrecision):null,valueAxisPrecision:this.valueAxisProperties?t.CartesianHelper.getPrecision(this.valueAxisProperties.labelPrecision):null,playAxisControlLayout:c,ensureXDomain:g,ensureYDomain:m},v=this.valueAxisProperties&&this.valueAxisProperties.secShow===!0,b=!1;a(i)&&!v&&(f=o(i,y),b=f.merged,b?y.forcedYDomain=f.domain:y.forcedTickCount=f.tickCount),this.valueAxisProperties&&(y.forcedYDomain=t.AxisHelper.applyCustomizedDomain([this.valueAxisProperties.start,this.valueAxisProperties.end],y.forcedYDomain));for(var C,S=0,x=i.length;x>S;S++){var w=i[S];1!==S||b||(y.forcedYDomain=this.valueAxisProperties?[this.valueAxisProperties.secStart,this.valueAxisProperties.secEnd]:null,y.valueAxisScaleType=this.valueAxisProperties&&null!=this.valueAxisProperties.secAxisScale?this.valueAxisProperties.secAxisScale:l,y.valueAxisDisplayUnits=this.valueAxisProperties&&null!=this.valueAxisProperties.secLabelDisplayUnits?this.valueAxisProperties.secLabelDisplayUnits:0,y.valueAxisPrecision=this.valueAxisProperties?t.CartesianHelper.getPrecision(this.valueAxisProperties.secLabelPrecision):null),y.showCategoryAxisLabel=!!this.categoryAxisProperties&&!!this.categoryAxisProperties.showAxisTitle,y.showValueAxisLabel=r(S,this.valueAxisProperties,b);var P=w.calculateAxesProperties(y);if(0===S)C={x:P[0],y1:P[1]};else if(P&&!C.y2)if(C.x.usingDefaultDomain||_.isEmpty(C.x.dataDomain)){y.showValueAxisLabel=!!this.valueAxisProperties&&!!this.valueAxisProperties.showAxisTitle;var D=w.calculateAxesProperties(y);C.x=D[0],C.y1=D[1]}else w.overrideXScale(C.x),b||P[1].usingDefaultDomain||(C.y2=P[1]);if(d&&d.x)C.x.willLabelsFit=d.x.willLabelsFit,C.x.willLabelsWordBreak=d.x.willLabelsWordBreak;else{var L=n.width-(s.left+s.right);C.x.willLabelsFit=t.AxisHelper.LabelLayoutStrategy.willLabelsFit(C.x,L,e.TextMeasurementService.measureSvgTextWidth,u),C.x.willLabelsWordBreak=!C.x.willLabelsFit&&!h&&t.AxisHelper.LabelLayoutStrategy.willLabelsWordBreak(C.x,s,L,e.TextMeasurementService.measureSvgTextWidth,e.TextMeasurementService.estimateSvgTextHeight,e.TextMeasurementService.getTailoredTextOrDefault,u)}}return p&&(C.x.axisLabel=null,C.y1.axisLabel=null,C.y2&&(C.y2.axisLabel=null)),this.addUnitTypeToAxisLabels(C),C},i.prototype.negotiateAxes=function(a,r,o,n,s,l,c,u,h){var d=e.Prototype.inherit(i.MinimumMargin),p=e.Prototype.inherit(r),g=p.width*this.maxMarginFactor,m=Math.max(i.MinimumMargin.bottom,Math.ceil(p.height*this.maxMarginFactor)),f={left:g,right:g,top:0,bottom:m},y=this.calculateAxes(a,p,d,n,l,!1,null,s,u,h),v=this.shouldRenderAxis(y.x),b=this.shouldRenderAxis(y.y1),C=this.shouldRenderAxis(y.y2,!0),S=this.shouldShowY1OnRight(),x={width:p.width-(d.left+d.right),height:p.height-(d.top+d.bottom)},w=!1;_.isEmpty(a)||a[0].getVisualCategoryAxisIsScalar&&(w=a[0].getVisualCategoryAxisIsScalar());var P=void 0;P=t.AxisHelper.getTickLabelMargins(x,f.left,e.TextMeasurementService.measureSvgTextWidth,e.TextMeasurementService.estimateSvgTextHeight,y,f.bottom,l,!1,S,v,b,C),d=this.updateAxisMargins(y,P,o,S,b,C,w?0:c);var D=y.y1&&y.y1.values.length,L=y.y2&&y.y2.values.length,T=y.x&&y.x.willLabelsFit,V=y.x&&y.x.willLabelsWordBreak;y=this.calculateAxes(a,p,d,n,l,!1,null,s,u,h),x.width=p.width-(d.left+d.right),x.height=p.height-(d.top+d.bottom);var M=this.getPreferredPlotArea(y,a,w),N=!this.willAllCategoriesFitInPlotArea(x,M),A=!(y.y1&&y.y1.values.length!==D||y.y2&&y.y2.values.length!==L||y.x&&y.x.willLabelsFit!==T||y.x&&y.x.willLabelsWordBreak!==V||N);if(this.isXScrollBarVisible=!1,this.isYScrollBarVisible=!1,!A){P=t.AxisHelper.getTickLabelMargins(x,f.left,e.TextMeasurementService.measureSvgTextWidth,e.TextMeasurementService.estimateSvgTextHeight,y,f.bottom,l,N,S,v,b,C),d=this.updateAxisMargins(y,P,o,S,b,C,w?0:c),y=this.calculateAxes(a,p,d,n,l,N,y,s,u,h),x.width=p.width-(d.left+d.right),x.height=p.height-(d.top+d.bottom),M=this.getPreferredPlotArea(y,a,w);var O=!this.willAllCategoriesFitInPlotArea(x,M);O&&(this.showLinesOnY&&(this.isXScrollBarVisible=!0,x.height-=this.scrollbarWidth,p.height-=this.scrollbarWidth),this.showLinesOnX&&(this.isYScrollBarVisible=!0,x.width-=this.scrollbarWidth,p.width-=this.scrollbarWidth),y=this.calculateAxes(a,p,d,n,l,!0,y,s,u,h))}var I=s?{x:null,y:null,y2:null}:{x:y.x.axisLabel,y:y.y1.axisLabel,y2:y.y2?y.y2.axisLabel:null};return this.layout={axes:y,axisLabels:I,margin:d,marginLimits:f,viewport:p,plotArea:x,preferredPlotArea:M,tickLabelMargins:P,tickPadding:o,rotateXTickLabels90:N},this.layout},i.prototype.getPreferredPlotArea=function(e,t,i){var a;if(!i&&this.isScrollable&&!_.isEmpty(t)&&t[0].getPreferredPlotArea){var r=this.showLinesOnY?e.x.categoryThickness:e.y1.categoryThickness,o=this.showLinesOnY?e.x.dataDomain.length:e.y1.dataDomain.length;a=t[0].getPreferredPlotArea(i,o,r)}return a},i.prototype.willAllCategoriesFitInPlotArea=function(t,i){return this.showLinesOnY&&i&&e.Double.greaterWithPrecision(i.width,t.width)?!1:!(this.showLinesOnX&&i&&e.Double.greaterWithPrecision(i.height,t.height))},i.prototype.updateAxisMargins=function(t,a,r,o,n,s,l){var c=o?a.yRight:a.yLeft,u=o?a.yLeft:a.yRight,h=a.xMax;c+=r.left,(s&&!o||o&&n)&&(u+=r.right),h+=r.bottom;var d={x:t.x.axisLabel,y:t.y1.axisLabel,y2:t.y2?t.y2.axisLabel:null};null!=d.x&&(h+=i.XAxisLabelPadding),null!=d.y&&(c+=i.YAxisLabelPadding),null!=d.y2&&(u+=i.YAxisLabelPadding);var p=e.Prototype.inherit(i.MinimumMargin);return p.left=o?u:c,p.right=o?c:u,p.right+=l,p.bottom=h,p},i.prototype.isLogScaleAllowed=function(e){var t=this.layout&&this.layout.axes;if(!t)return!1;switch(e){case 0:return t.x.isLogScaleAllowed;case 1:return t.y1.isLogScaleAllowed;case 2:return t.y2&&t.y2.isLogScaleAllowed}},i.prototype.axesHaveTicks=function(e){if(!this.layout)return!1;var i=this.layout.margin,a=e.width-(i.left+i.right),r=e.height-(i.top+i.bottom);return 0!==t.AxisHelper.getRecommendedNumberOfTicksForXAxis(a)||0!==t.AxisHelper.getRecommendedNumberOfTicksForYAxis(r)},i.prototype.shouldRenderAxisTitle=function(e,t,i){var a=i?"secShowAxisTitle":"showAxisTitle";return!!this.getAxisProperty(e,a,t)},i.prototype.shouldRenderAxis=function(e,t){if(void 0===t&&(t=!1),!e)return!1;var i=t?"secShow":"show";return this.getAxisProperty(e,i,!0)&&e.values&&e.values.length>0},i.prototype.getAxisProperty=function(e,t,i){if(!e)return i;var a=e.isCategoryAxis?this.categoryAxisProperties:this.valueAxisProperties;return a&&null!=a[t]?a[t]:i},i.prototype.addUnitTypeToAxisLabels=function(e){var a=i.getUnitType(e.x.formatter);if(e.x.isCategoryAxis?this.categoryAxisHasUnitType=null!=a:this.valueAxisHasUnitType=null!=a,e.x.axisLabel&&a&&(e.x.isCategoryAxis?e.x.axisLabel=t.AxisHelper.createAxisLabel(this.categoryAxisProperties,e.x.axisLabel,a):e.x.axisLabel=t.AxisHelper.createAxisLabel(this.valueAxisProperties,e.x.axisLabel,a)),a=i.getUnitType(e.y1.formatter),e.y1.isCategoryAxis?this.categoryAxisHasUnitType=null!=a:this.valueAxisHasUnitType=null!=a,e.y1.axisLabel&&a&&(e.y1.isCategoryAxis?e.y1.axisLabel=t.AxisHelper.createAxisLabel(this.categoryAxisProperties,e.y1.axisLabel,a):e.y1.axisLabel=t.AxisHelper.createAxisLabel(this.valueAxisProperties,e.y1.axisLabel,a)),e.y2){var r=i.getUnitType(e.y2.formatter);this.secondaryValueAxisHasUnitType=null!=r,e.y2.axisLabel&&r&&(e.y2.axisLabel=t.AxisHelper.createAxisLabel(this.valueAxisProperties,e.y2.axisLabel,r,!0))}},i.getUnitType=function(e){return e&&e.displayUnit&&e.displayUnit.value>1?e.displayUnit.title:void 0},i.YAxisLabelPadding=20,i.XAxisLabelPadding=18,i.MaxMarginFactor=.25,i.MinimumMargin={left:1,right:1,top:8,bottom:25},i}();t.CartesianAxes=m;var f;!function(e){function i(e,i,c,u,h,d,p){void 0===h&&(h=!1);var g=[],m={isScrollable:h,animator:u,interactivityService:c,tooltipsEnabled:d,lineChartLabelDensityEnabled:p};switch(e){case 1:g.push(a(2,!1,m));break;case 0:g.push(a(1,!1,m));break;case 2:g.push(a(16,!1,m));break;case 9:g.push(r(m));break;case 12:g.push(o(m));break;case 11:g.push(n(m));break;case 4:g.push(s(t.ColumnChartType.stackedColumn,m));break;case 3:g.push(s(t.ColumnChartType.clusteredColumn,m));break;case 8:g.push(s(t.ColumnChartType.hundredPercentStackedColumn,m));break;case 6:g.push(s(t.ColumnChartType.stackedBar,m));break;case 5:g.push(s(t.ColumnChartType.clusteredBar,m));break;case 7:g.push(s(t.ColumnChartType.hundredPercentStackedBar,m));break;case 10:var f=l();g.push(s(f,m)),g.push(a(1,!0,m));break;case 13:g.push(s(t.ColumnChartType.clusteredColumn,m)),g.push(a(1,!0,m));break;case 14:g.push(s(t.ColumnChartType.stackedColumn,m)),g.push(a(1,!0,m));break;case 15:g.push(s(t.ColumnChartType.clusteredColumn,m)),g.push(n(m));break;case 16:g.push(s(t.ColumnChartType.stackedColumn,m)),g.push(n(m))}return g}function a(e,i,a,r){var o={animator:a.animator,interactivityService:a.interactivityService,isScrollable:a.isScrollable,tooltipsEnabled:!r&&a.tooltipsEnabled,chartType:e,lineChartLabelDensityEnabled:a.lineChartLabelDensityEnabled,isTrendLayer:r};return i&&(o.chartType=8|o.chartType),new t.LineChart(o)}function r(e){return e.isScrollable=!1,new t.ScatterChart(e)}function o(e){return new t.WaterfallChart(e)}function n(e){return new t.DataDotChart(e)}function s(e,i){var a={animator:i.animator,interactivityService:i.interactivityService,isScrollable:i.isScrollable,tooltipsEnabled:i.tooltipsEnabled,chartType:e};return new t.ColumnChart(a)}function l(e){var i=t.ColumnChartType.clusteredColumn;if(e){var a=e.general;if(a){switch(a.visualType1){case"Column":i=t.ColumnChartType.clusteredColumn;break;case"ColumnStacked":i=t.ColumnChartType.stackedColumn}a.visualType2}}return i}e.createLayers=i}(f||(f={}));var y=function(){function e(e){this.palette=e,this.clearPreferredScale()}return e.prototype.getColorScaleByKey=function(e){return this.setPreferredScale(e),this.preferredScale},e.prototype.getNewColorScale=function(){return this.preferredScale},e.prototype.getColorByIndex=function(e){return this.palette.getColorByIndex(e)},e.prototype.getSentimentColors=function(){return this.palette.getSentimentColors()},e.prototype.getBasePickerColors=function(){return this.palette.getBasePickerColors()},e.prototype.clearPreferredScale=function(){this.preferredScale=this.palette.getNewColorScale(),this.rotated=!1},e.prototype.rotateScale=function(){this.preferredScale=this.preferredScale.clone(),this.preferredScale.clearAndRotateScale(),this.rotated=!0},e.prototype.setPreferredScale=function(e){this.rotated||(this.preferredScale=this.palette.getColorScaleByKey(e))},e}();t.SharedColorPalette=y}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.EnumExtensions,a=e.data.DataRoleHelper,r=2,o=4,n=8,s=16,l=32|s;!function(e){e[e.clusteredBar=r|n]="clusteredBar",e[e.clusteredColumn=o|n]="clusteredColumn",e[e.hundredPercentStackedBar=r|l]="hundredPercentStackedBar",e[e.hundredPercentStackedColumn=o|l]="hundredPercentStackedColumn",e[e.stackedBar=r|s]="stackedBar",e[e.stackedColumn=o|s]="stackedColumn"}(t.ColumnChartType||(t.ColumnChartType={}));var c=t.ColumnChartType,u={category:"Category",series:"Series",y:"Y"},h=function(){function h(e){var t=e.chartType;this.chartType=t,this.categoryAxisType=null,this.animator=e.animator,this.isScrollable=e.isScrollable,this.tooltipsEnabled=e.tooltipsEnabled,this.interactivityService=e.interactivityService}return h.customizeQuery=function(e){var i=e.dataViewMappings[0];if(i&&i.categorical&&i.categorical.categories&&(i.categorical.dataVolume=4,t.CartesianChart.detectScalarMapping(i))){var a=i.categorical.categories;a.dataReductionAlgorithm={sample:{}}}},h.getSortableRoles=function(e){var i=e.dataViewMappings[0];if(!i||!i.categorical||!i.categorical.categories)return null;var a=i.categorical.categories,r=a["for"]["in"].items;if(!_.isEmpty(r)){var o=r[0].type,n=void 0;if(i.metadata&&(n=i.metadata.objects),!t.CartesianChart.getIsScalar(n,t.columnChartProps.categoryAxis.axisType,o))return["Category","Y"]}return null},h.prototype.updateVisualMetadata=function(e,t,i){this.xAxisProperties=e,this.yAxisProperties=t,this.margin=i},h.prototype.init=function(e){this.svg=e.svg,this.svg.classed(h.ColumnChartClassName,!0),this.unclippedGraphicsContext=this.svg.append("g").classed("columnChartUnclippedGraphicsContext",!0),this.mainGraphicsContext=this.unclippedGraphicsContext.append("svg").classed("columnChartMainGraphicsContext",!0),this.style=e.style,this.currentViewport=e.viewport,this.hostService=e.host,this.interactivity=e.interactivity,this.colors=this.style.colorPalette.dataColors,this.cartesianVisualHost=e.cartesianHost,this.options=e,this.isComboChart=t.ComboChart.isComboChart(e.chartType),this.element=e.element},h.prototype.getCategoryLayout=function(e,i){var a;a=h.isBar(this.chartType)?this.currentViewport.height-(this.margin.top+this.margin.bottom):this.currentViewport.width-(this.margin.left+this.margin.right);var r=this.data?this.data.categoryMetadata:void 0,o=t.AxisHelper.getCategoryValueType(r),n=this.data?this.data.scalarCategoryAxis:!1,s=t.AxisHelper.createDomain(this.data.series,o,n,i.forcedXDomain,i.ensureXDomain);return t.CartesianChart.getLayout(this.data,{availableWidth:a,categoryCount:e,domain:s,isScalar:n,isScrollable:this.isScrollable,trimOrdinalDataOnOverflow:i.trimOrdinalDataOnOverflow})},h.converter=function(i,a,r,o,n,s,l,c){void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===n&&(n=null),void 0===c&&(c=!0);var p=t.CartesianHelper.getCategoryAxisProperties(n),g=t.CartesianHelper.getValueAxisProperties(n);o=t.CartesianHelper.isScalar(o,p);var m=t.ColumnUtil.applyUserMinMax(o,i.categorical,p),f=new d(i),y=t.converterHelper.getPivotedCategories(m,t.columnChartProps.general.formatString),v=y.categories,b=y.categoryFormatter,C=y.categoryIdentities,S=m&&m.categories&&m.categories.length>0?m.categories[0].source:void 0,x=t.dataLabelUtils.getDefaultColumnLabelSettings(r||h.isStacked(s)),w=t.LegendData.DefaultLegendLabelFillColor,P=void 0,D=void 0;if(n&&n.objects){var L=n.objects;P=e.DataViewObjects.getFillColor(L,t.columnChartProps.dataPoint.defaultColor),D=e.DataViewObjects.getValue(L,t.columnChartProps.dataPoint.showAllDataPoints),w=e.DataViewObjects.getFillColor(L,t.columnChartProps.legend.labelColor,t.LegendData.DefaultLegendLabelFillColor);var T=L.labels;t.dataLabelUtils.updateLabelSettingsFromLabelsObject(T,x)}for(var _=f.getLegend(a,w,P),V=_.legend.dataPoints,M=_.seriesSources,N=h.createDataPoints(i,v,C,V,_.seriesObjects,f,x,r,o,t.converterHelper.categoryIsAlsoSeriesRole(i,u.series,u.category),y.categoryObjects,P,s,S,c),A=N.series,O=[],I=0,R=V.length;R>I;I++)O.push(M[I]);var F=t.converterHelper.createAxesLabels(p,g,S,O);if(!h.isColumn(s)){var H=F.xAxisLabel;F.xAxisLabel=F.yAxisLabel,F.yAxisLabel=H}if(l){for(var z=0,G=A;z<G.length;z++){var j=G[z];l.applySelectionStateToData(j.data)}l.applySelectionStateToData(_.legend.dataPoints)}return{categories:v,categoryFormatter:b,series:A,valuesMetadata:O,legendData:_.legend,hasHighlights:N.hasHighlights,categoryMetadata:S,scalarCategoryAxis:o,labelSettings:x,axesLabels:{x:F.xAxisLabel,y:F.yAxisLabel},hasDynamicSeries:N.hasDynamicSeries,isMultiMeasure:N.isMultiMeasure,defaultDataPointColor:P,showAllDataPoints:D}},h.canSupportOverflow=function(e,t){return!h.isStacked(e)||1===t},h.createDataPoints=function(i,r,o,n,s,l,c,u,d,p,g,m,f,y,v){void 0===u&&(u=!1),void 0===d&&(d=!1);var b=i.categorical,C=b&&b.values?b.values.grouped():void 0,S=r.length,x=n.length,w=[];if(1>x||1>S)return{series:w,hasHighlights:!1,hasDynamicSeries:!1,isMultiMeasure:!1};var P=b.categories;y=_.isEmpty(P)?null:P[0].source;for(var D=t.AxisHelper.getCategoryValueType(y),L=t.AxisHelper.isDateTime(D),T=[],V=[],M=[],N=[],A=!(!b.values||!b.values.source),O=!A&&x>1,I=!1,R=l.hasHighlightValues(0),F=0;x>F;F++){for(var H=[],z=[],G=0;S>G;G++){var j=l.getValueBySeriesAndCategory(F,G);if(H[G]=j,R){var k=l.getHighlightBySeriesAndCategory(F,G);z[G]=k,j>=0&&k>=0&&j>=k||0>=j&&0>=k&&k>=j||(I=!0)}}M.push(H),R&&N.push(z)}I&&!h.canSupportOverflow(f,x)&&(I=!1,R=!1,M=N);for(var E=g,W=t.columnChartProps.general.formatString,F=0;x>F;F++){var B=[],U=n[F],K=void 0;if(!A){var X=!_.isEmpty(C)&&C[0].values?C[0].values[F]:null,Y=X&&X.source&&X.source.objects?X.source.objects.labels:null;Y&&(K=e.Prototype.inherit(c),t.dataLabelUtils.updateLabelSettingsFromLabelsObject(Y,K))}w.push({displayName:U.label,key:"series"+F,index:F,data:B,identity:U.identity,color:U.color,labelSettings:K}),x>1&&(E=s[F]);for(var q=b.values[F].source,$=t.GradientUtils.getGradientMeasureIndex(b),Q=t.GradientUtils.getGradientValueColumn(b),Z=a.getMeasureIndexOfRole(C,"Y"),J=t.valueFormatter.getLocalizedString("Percentage"),G=0;S>G;G++){0===F&&(T.push(0),V.push(0));var j=t.AxisHelper.normalizeNonFiniteNumber(M[F][G]);if(!(null==j&&F>0)){var ee=j,te=r[G];if((!L||null==te||te instanceof Date)&&(L&&te&&(te=te.getTime()),!d||null!=te&&!isNaN(te))){var ie=void 0;u&&(ie=t.StackedUtil.getStackedMultiplier(b,G,x,S,l));var ae=j,re=0>j;ie&&(j*=re?ie.neg:ie.pos);var oe=Math.abs(j),ne=void 0;
19re?(ne=V[G],isNaN(oe)||(V[G]-=oe)):(isNaN(oe)||(T[G]+=oe),ne=T[G]);var se=C&&C.length>F&&C[F].values?C[F].values[Z]:null,le=_.isEmpty(b.categories)?null:b.categories[0],ce=t.SelectionIdBuilder.builder().withCategory(le,G).withSeries(b.values,se).withMeasure(l.getMeasureNameByIndex(F)).createSelectionId(),ue=r[G],he=h.getDataPointColor(U,G,E),de=0===$?null:Q,pe=void 0;if(v){if(pe=[],le&&pe.push({displayName:le.source.displayName,value:t.converterHelper.formatFromMetadataColumn(ue,le.source,W)}),A&&(le&&le.source===b.values.source||pe.push({displayName:b.values.source.displayName,value:t.converterHelper.formatFromMetadataColumn(C[F].name,b.values.source,W)})),null!=ee){var ge=void 0,me=t.converterHelper.formatFromMetadataColumn(ee,q,W);if(u){var fe=t.valueFormatter.format(oe,J);ge=me+" ("+fe+")"}else ge=me;pe.push({displayName:q.displayName,value:ge})}de&&null!=de.values[G]&&pe.push({displayName:de.source.displayName,value:t.converterHelper.formatFromMetadataColumn(de.values[G],de.source,W)})}var ye=w[F],ve=ye.labelSettings?ye.labelSettings:c,be=ve.labelColor,Ce=void 0;h.isStacked(f)&&(Ce=this.getStackedLabelColor(re,F,x,G,M),be=Ce||F===x-1&&!re?be:t.dataLabelUtils.defaultInsideLabelColor);var Se={categoryValue:te,value:j,position:ne,valueAbsolute:oe,valueOriginal:ae,seriesIndex:F,labelSettings:ve,categoryIndex:G,color:he,selected:!1,originalValue:j,originalPosition:ne,originalValueAbsolute:oe,identity:ce,key:ce.getKey(),tooltipInfo:pe,labelFill:be,labelFormatString:q.format,lastSeries:Ce,chartType:f};if(B.push(Se),R){var xe=N[F][G],we=xe,Pe=!0;null===xe&&(xe=0,Pe=!1),u&&(xe*=ie.pos);var De=Math.abs(xe),Le=ne;xe>0?Le-=oe-De:0===xe&&j>0&&(Le-=oe);var Te=t.SelectionId.createWithHighlight(ce),_e=void 0,Ve=void 0;if(Pe&&null!=we&&null!=xe){var Me=t.valueFormatter.format(xe,J);Ve=t.converterHelper.formatFromMetadataColumn(we,q,W),_e=Ve+" ("+Me+")"}if(v){var k=void 0;k=u?_e:Ve,null!=k&&pe.push({displayName:t.ToolTipComponent.localizationOptions.highlightedValueDisplayName,value:k})}Pe&&(Se.tooltipInfo=pe);var Ne={categoryValue:te,value:xe,position:Le,valueAbsolute:De,valueOriginal:we,seriesIndex:F,labelSettings:ve,categoryIndex:G,color:he,selected:!1,highlight:!0,originalValue:j,originalPosition:ne,originalValueAbsolute:oe,drawThinner:I,identity:Te,key:Te.getKey(),tooltipInfo:pe,labelFormatString:q.format,labelFill:be,lastSeries:Ce,chartType:f};B.push(Ne)}}}}}return{series:w,hasHighlights:R,hasDynamicSeries:A,isMultiMeasure:O}},h.getDataPointColor=function(i,a,r){if(r){var o=e.DataViewObjects.getFillColor(r[a],t.columnChartProps.dataPoint.fill);if(o)return o}return i.color},h.getStackedLabelColor=function(e,i,a,r,o){for(var n=!(e&&i===a-1&&1!==a),s=i+1;a>s;s++){var l=t.AxisHelper.normalizeNonFiniteNumber(o[s][r]);if(null!==l&&((!e||e&&0===i)&&l>0||e&&0!==i)){n=!1;break}}return n},h.sliceSeries=function(t,i,a){void 0===a&&(a=0);var r=[];if(t&&t.length>0)for(var o=0,n=t.length;n>o;o++){var s=r[o]=e.Prototype.inherit(t[o]);s.data=t[o].data.filter(function(e){return e.categoryIndex>=a&&e.categoryIndex<i})}return r},h.getInteractiveColumnChartDomElement=function(e){return e.children("svg").get(0)},h.prototype.setData=function(e){var i=h.isStacked100(this.chartType);if(this.data={categories:[],categoryFormatter:null,series:[],valuesMetadata:[],legendData:null,hasHighlights:!1,categoryMetadata:null,scalarCategoryAxis:!1,labelSettings:t.dataLabelUtils.getDefaultColumnLabelSettings(i||h.isStacked(this.chartType)),axesLabels:{x:null,y:null},hasDynamicSeries:!1,defaultDataPointColor:null,isMultiMeasure:!1},e.length>0){var a=this.dataView=e[0];if(a&&a.categorical){var r=a.categorical.categories,o=r&&r.length>0?r[0].source:null,n=t.AxisHelper.getCategoryValueType(o);this.data=h.converter(a,this.cartesianVisualHost.getSharedColors(),i,t.CartesianChart.getIsScalar(a.metadata?a.metadata.objects:null,t.columnChartProps.categoryAxis.axisType,n),a.metadata,this.chartType,this.interactivityService,this.tooltipsEnabled)}}this.setChartStrategy()},h.prototype.setChartStrategy=function(){switch(this.chartType){case c.clusteredBar:this.columnChart=new t.ClusteredBarChartStrategy;break;case c.clusteredColumn:this.columnChart=new t.ClusteredColumnChartStrategy;break;case c.stackedBar:case c.hundredPercentStackedBar:this.columnChart=new t.StackedBarChartStrategy;break;case c.stackedColumn:case c.hundredPercentStackedColumn:default:this.columnChart=new t.StackedColumnChartStrategy}if(h.isStacked(this.chartType)&&1===this.data.series.length)switch(this.chartType){case c.stackedBar:this.columnChart=new t.ClusteredBarChartStrategy;break;case c.stackedColumn:this.columnChart=new t.ClusteredColumnChartStrategy}},h.prototype.calculateLegend=function(){if(this.interactivity&&this.interactivity.isInteractiveLegend)return this.createInteractiveLegendDataPoints(0);var e=this.data?this.data.legendData:null,t=e?e.dataPoints:[];return _.isEmpty(t)?null:e},h.prototype.hasLegend=function(){return this.data&&(this.data.hasDynamicSeries||this.data.series&&this.data.series.length>1)},h.prototype.enumerateObjectInstances=function(e,i){switch(i.objectName){case"dataPoint":this.dataView&&!t.GradientUtils.hasGradientRole(this.dataView.categorical)&&this.enumerateDataPoints(e);break;case"labels":this.enumerateDataLabels(e)}},h.prototype.enumerateDataLabels=function(e){var i=this.data,a=this.data.labelSettings,r=i.series.length,o=!i.hasDynamicSeries&&(r>1||!i.categoryMetadata);if(t.dataLabelUtils.enumerateDataLabels(this.getLabelSettingsOptions(e,a,null,o)),0!==r&&o&&a.showLabelPerSeries)for(var n=0;r>n;n++){var s=i.series[n],l=s.labelSettings?s.labelSettings:this.data.labelSettings;e.pushContainer({displayName:s.displayName}),t.dataLabelUtils.enumerateDataLabels(this.getLabelSettingsOptions(e,l,s)),e.popContainer()}},h.prototype.getLabelSettingsOptions=function(e,t,i,a){return{enumeration:e,dataLabelsSettings:t,show:!0,displayUnits:!h.isStacked100(this.chartType),precision:!0,selector:i&&i.identity?i.identity.getSelector():null,showAll:a,fontSize:!0}},h.prototype.enumerateDataPoints=function(e){var i=this.data;if(i){var a=i.series.length;if(0!==a)if(i.hasDynamicSeries||a>1||!i.categoryMetadata)for(var r=0;a>r;r++){var o=i.series[r];e.pushInstance({objectName:"dataPoint",displayName:o.displayName,selector:t.ColorHelper.normalizeSelector(o.identity.getSelector()),properties:{fill:{solid:{color:o.color}}}})}else{var n=i.series[0].data,s=i.categoryFormatter;if(e.pushInstance({objectName:"dataPoint",selector:null,properties:{defaultColor:{solid:{color:i.defaultDataPointColor||this.colors.getColorByIndex(0).value}}}}).pushInstance({objectName:"dataPoint",selector:null,properties:{showAllDataPoints:!!i.showAllDataPoints}}),i.showAllDataPoints)for(var r=0;r<n.length;r++){var l=n[r],c=i.categories[r];e.pushInstance({objectName:"dataPoint",displayName:s?s.format(c):c,selector:t.ColorHelper.normalizeSelector(l.identity.getSelector(),!0),properties:{fill:{solid:{color:l.color}}}})}}}},h.prototype.calculateAxesProperties=function(i){var a=this.data;this.currentViewport=i.viewport;var r=this.margin=i.margin,o=a&&a.categories?a.categories.length:0,n=a?this.getCategoryLayout(o,i):{categoryCount:0,categoryThickness:t.CartesianChart.MinOrdinalRectThickness,outerPaddingRatio:t.CartesianChart.OuterPaddingRatio,isScalar:!1};if(this.categoryAxisType=n.isScalar?t.axisType.scalar:null,a&&!n.isScalar&&!this.isScrollable&&i.trimOrdinalDataOnOverflow){var s=Math.min(o,n.categoryCount);s!==o&&(a=e.Prototype.inherit(a),a.series=h.sliceSeries(a.series,s),a.categories=a.categories.slice(0,s))}this.columnChart.setData(a);var l=this.getPreferredPlotArea(n.isScalar,n.categoryCount,n.categoryThickness),c=h.isStacked100(this.chartType),u={height:l.height,width:l.width,duration:0,hostService:this.hostService,unclippedGraphicsContext:this.unclippedGraphicsContext,mainGraphicsContext:this.mainGraphicsContext,margin:this.margin,layout:n,animator:this.animator,interactivityService:this.interactivityService,viewportHeight:this.currentViewport.height-(r.top+r.bottom),viewportWidth:this.currentViewport.width-(r.left+r.right),is100Pct:c,isComboChart:this.isComboChart};this.ApplyInteractivity(u),this.columnChart.setupVisualProps(u);var d,p,g=h.isBar(this.chartType);if(g){var m=i.forcedXDomain;i.forcedXDomain=i.forcedYDomain,i.forcedYDomain=m,d=i.ensureYDomain}else p=i.ensureYDomain;return this.xAxisProperties=this.columnChart.setXScale(c,i.forcedTickCount,i.forcedXDomain,g?i.valueAxisScaleType:i.categoryAxisScaleType,g?i.valueAxisDisplayUnits:i.categoryAxisDisplayUnits,g?i.valueAxisPrecision:i.categoryAxisPrecision,d),this.yAxisProperties=this.columnChart.setYScale(c,i.forcedTickCount,i.forcedYDomain,g?i.categoryAxisScaleType:i.valueAxisScaleType,g?i.categoryAxisDisplayUnits:i.valueAxisDisplayUnits,g?i.categoryAxisPrecision:i.valueAxisPrecision,p),i.showCategoryAxisLabel&&this.xAxisProperties.isCategoryAxis||i.showValueAxisLabel&&!this.xAxisProperties.isCategoryAxis?this.xAxisProperties.axisLabel=a.axesLabels.x:this.xAxisProperties.axisLabel=null,i.showValueAxisLabel&&!this.yAxisProperties.isCategoryAxis||i.showCategoryAxisLabel&&this.yAxisProperties.isCategoryAxis?this.yAxisProperties.axisLabel=a.axesLabels.y:this.yAxisProperties.axisLabel=null,[this.xAxisProperties,this.yAxisProperties]},h.prototype.getPreferredPlotArea=function(e,i,a){var r={height:this.currentViewport.height-this.margin.top-this.margin.bottom,width:this.currentViewport.width-this.margin.left-this.margin.right};if(this.isScrollable&&!e){var o=t.CartesianChart.getPreferredCategorySpan(i,a);h.isBar(this.chartType)?r.height=Math.max(o,r.height):r.width=Math.max(o,r.width)}return r},h.prototype.ApplyInteractivity=function(e){var t=this,i=this.interactivity;if(i&&(i.dragDataPoint&&(e.onDragStart=function(e){e.identity&&t.hostService.onDragStart({event:d3.event,data:{data:e.identity.getSelector()}})}),i.isInteractiveLegend)){var a=function(){var e=d3.mouse(t.mainGraphicsContext[0][0]),i=e[0],a=e[1],r=t.columnChart.getClosestColumnIndex(i,a);t.selectColumn(r)},r=h.getInteractiveColumnChartDomElement(this.element);this.svg.on("click",a),d3.select(r).on("click",a).style("touch-action","none");var o=d3.behavior.drag().origin(Object).on("drag",a);this.svg.call(o),d3.select(r).call(o)}},h.prototype.selectColumn=function(e,t){if(void 0===t&&(t=!1),t||this.lastInteractiveSelectedColumnIndex!==e){var i=this.createInteractiveLegendDataPoints(e),a=i.dataPoints;this.cartesianVisualHost.updateLegend(i),a.length>0&&this.columnChart.selectColumn(e,this.lastInteractiveSelectedColumnIndex),this.lastInteractiveSelectedColumnIndex=e}},h.prototype.createInteractiveLegendDataPoints=function(e){var i=this.data;if(!i||_.isEmpty(i.series))return{dataPoints:[]};for(var a=t.columnChartProps.general.formatString,r=[],o=i.categories&&i.categories[e],n=i.series,s=i.legendData&&i.legendData.dataPoints,l=new d(this.dataView),c=0,u=n.length;u>c;c++){var h=l.getValueBySeriesAndCategory(c,e),p=i.valuesMetadata[c],g=t.converterHelper.getFormattedLegendLabel(p,this.dataView.categorical.values,a),m=void 0;if(1===n.length){var f=n[0];m=f.data.length>e&&f.data[e].color}else m=s.length>c&&s[c].color;r.push({color:m,icon:t.LegendIcon.Box,label:g,category:i.categoryFormatter?i.categoryFormatter.format(o):o,measure:t.valueFormatter.format(h,t.valueFormatter.getFormatString(p,a)),identity:t.SelectionId.createNull(),selected:!1})}return{dataPoints:r}},h.prototype.overrideXScale=function(e){this.xAxisProperties=e},h.prototype.render=function(e){var i=this.columnChart.drawColumns(!e),a=this.data,r=this.margin,o=this.currentViewport,n=o.height-(r.top+r.bottom),s=o.width-(r.left+r.right);this.mainGraphicsContext.attr("height",n).attr("width",s),this.tooltipsEnabled&&t.TooltipManager.addTooltip(i.eventGroup,function(e){return e.data.tooltipInfo});var l=[],c=void 0;if(this.interactivityService){for(var u=0,h=a.series.length;h>u;u++)l=l.concat(a.series[u].data);c={datapoints:l,eventGroup:i.eventGroup,bars:i.shapesSelection,hasHighlights:a.hasHighlights,mainGraphicsContext:this.mainGraphicsContext,viewport:i.viewport,axisOptions:i.axisOptions,showLabel:a.labelSettings.show}}return this.interactivity&&this.interactivity.isInteractiveLegend&&this.data.series.length>0&&this.selectColumn(t.CartesianHelper.findMaxCategoryIndex(this.data.series),!0),t.SVGUtil.flushAllD3TransitionsIfNeeded(this.options),{dataPoints:l,behaviorOptions:c,labelDataPoints:i.labelDataPoints,labelsAreNumeric:!0}},h.prototype.onClearSelection=function(){this.interactivityService&&this.interactivityService.clearSelection()},h.prototype.getVisualCategoryAxisIsScalar=function(){return this.data?this.data.scalarCategoryAxis:!1},h.prototype.getSupportedCategoryAxisType=function(){var e=this.data?this.data.categoryMetadata:void 0,i=t.AxisHelper.getCategoryValueType(e),a=t.AxisHelper.isOrdinal(i);return a?t.axisType.categorical:t.axisType.both},h.prototype.setFilteredData=function(t,i){var a=e.Prototype.inherit(this.data);return a.series=h.sliceSeries(a.series,i,t),a.categories=a.categories.slice(t,i),this.columnChart.setData(a),a},h.getLabelFill=function(e,i,a){return e?e:i&&!a?t.NewDataLabelUtils.defaultInsideLabelColor:t.NewDataLabelUtils.defaultLabelColor},h.prototype.supportsTrendLine=function(){var e=this.data?this.data.scalarCategoryAxis:!1;return this.chartType===c.clusteredColumn&&e},h.isBar=function(e){return i.hasFlag(e,r)},h.isColumn=function(e){return i.hasFlag(e,o)},h.isClustered=function(e){return i.hasFlag(e,n)},h.isStacked=function(e){return i.hasFlag(e,s)},h.isStacked100=function(e){return i.hasFlag(e,l)},h.ColumnChartClassName="columnChart",h.clusteredValidLabelPositions=[16,4,1,2],h.stackedValidLabelPositions=[1,4,2],h.SeriesClasses=jsCommon.CssConstants.createClassAndSelector("series"),h}();t.ColumnChart=h;var d=function(){function i(t){this.dataView=t&&t.categorical,this.reader=e.data.createIDataViewCategoricalReader(t)}return i.prototype.getLegend=function(e,i,r){var o=[],n=[],s=[],l=!1,c=new t.ColorHelper(e,t.columnChartProps.dataPoint.fill,r),u=void 0;if(this.dataView&&this.dataView.values){for(var h=this.dataView.values,d=h.grouped(),p=!(!h||!h.source),g=t.columnChartProps.general.formatString,m=0,f=d.length;f>m;m++)for(var y=d[m],v=y.objects,b=y.values,C=0,S=b.length;S>C;C++){var x=b[C],w=x.source;if(!a.hasRole(w,"Gradient")||a.hasRole(w,"Y")){n.push(w),s.push(x.objects);var P=x.identity?t.SelectionId.createWithIdAndMeasure(x.identity,w.queryName):t.SelectionId.createWithMeasure(this.getMeasureNameByIndex(C)),D=t.converterHelper.getFormattedLegendLabel(w,h,g),L=p?c.getColorForSeriesValue(v,h.identityFields,w.groupName):c.getColorForMeasure(w.objects,w.queryName);o.push({icon:t.LegendIcon.Box,color:L,label:D,identity:P,selected:!1}),x.identity&&void 0!==w.groupName&&(l=!0)}}var T=this.dataView.values;u=T&&T.source?T.source.displayName:""}var _={title:u,dataPoints:o,grouped:l,labelColor:i};return{legend:_,seriesSources:n,seriesObjects:s}},i.prototype.getValueBySeriesAndCategory=function(e,t){if(this.reader.hasDynamicSeries()){var i=this.dataView.values.grouped();return i[e].values[0].values[t]}return this.reader.getValue("Y",t,e)},i.prototype.getMeasureNameByIndex=function(e){return this.dataView.values[e].source.queryName},i.prototype.hasHighlightValues=function(e){var t=this.dataView&&this.dataView.values?this.dataView.values[e]:void 0;return t&&!!t.highlights},i.prototype.getHighlightBySeriesAndCategory=function(e,t){return this.dataView.values[e].highlights[t]},i}()}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.PixelConverter,a=function(){function a(){}return a.prototype.setupVisualProps=function(e){this.graphicsContext=e,this.margin=e.margin,this.width=this.graphicsContext.width,this.height=this.graphicsContext.height,this.categoryLayout=e.layout,this.animator=e.animator,this.interactivityService=e.interactivityService,this.viewportHeight=e.viewportHeight,this.viewportWidth=e.viewportWidth,this.isComboChart=e.isComboChart},a.prototype.setData=function(e){this.data=e},a.prototype.setXScale=function(e,i,a,r,o,n,s){var l,c,u=this.width;a&&2===a.length&&(l=a[0],c=a[1]);var h=this.xProps=t.ColumnUtil.getCategoryAxis(this.data,u,this.categoryLayout,!1,l,c,r,o,n,s),d=this.data.series.length,p=this.categoryLayout.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio)/d;return this.seriesOffsetScale=d3.scale.ordinal().domain(this.data.series.map(function(e){return e.index})).rangeBands([0,d*p]),h},a.prototype.setYScale=function(e,i,a,r,o,n,s){var l=this.viewportHeight,c=t.AxisHelper.createValueDomain(this.data.series,!0)||t.emptyDomain,u=t.AxisHelper.combineDomain(a,c,s),h=t.AxisHelper.scaleShouldClamp(u,c);return this.yProps=t.AxisHelper.createAxis({pixelSpan:l,dataDomain:u,metaDataColumn:this.data.valuesMetadata[0],formatString:t.valueFormatter.getFormatString(this.data.valuesMetadata[0],t.columnChartProps.general.formatString),outerPadding:0,isScalar:!0,isVertical:!0,forcedTickCount:i,useTickIntervalForDisplayUnits:!0,isCategoryAxis:!1,scaleType:r,axisDisplayUnits:o,axisPrecision:n,shouldClamp:h}),this.yProps},a.prototype.drawColumns=function(e){var i=this.data;this.columnsCenters=null;var r=this.categoryLayout.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio),o=r/i.series.length,n={columnWidth:o,categoryWidth:r,xScale:this.xProps.scale,yScale:this.yProps.scale,seriesOffsetScale:this.seriesOffsetScale,isScalar:this.categoryLayout.isScalar,margin:this.margin},s=this.layout=a.getLayout(i,n),l=i.labelSettings,c=[];l&&l.show&&(c=this.createLabelDataPoints());var u,h,d=t.ColumnUtil.drawSeries(i,this.graphicsContext.mainGraphicsContext,n);return this.animator&&e&&(u=this.animator.animate({viewModel:i,series:d,layout:s,itemCS:a.classes.item,interactivityService:this.interactivityService,mainGraphicsContext:this.graphicsContext.mainGraphicsContext,viewPort:{height:this.height,width:this.width}}),h=u.shapes),this.animator&&e&&!u.failed||(h=t.ColumnUtil.drawDefaultShapes(i,d,s,a.classes.item,!this.animator,this.interactivityService&&this.interactivityService.hasSelection())),t.ColumnUtil.applyInteractivity(h,this.graphicsContext.onDragStart),{eventGroup:this.graphicsContext.mainGraphicsContext,shapesSelection:h,viewport:{height:this.height,width:this.width},axisOptions:n,labelDataPoints:c}},a.prototype.selectColumn=function(e,i){t.ColumnUtil.setChosenColumnOpacity(this.graphicsContext.mainGraphicsContext,a.classes.item.selector,e,i),this.moveHandle(e)},a.prototype.getClosestColumnIndex=function(e,i){return t.ColumnUtil.getClosestColumnIndex(e,this.getColumnsCenters())},a.prototype.getColumnsCenters=function(){var e=this;if(!this.columnsCenters){var i=this.categoryLayout.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio);if(this.data.series.length>0){var a=0;this.categoryLayout.isScalar||(a=i/2);var r=this.data.series[0];this.columnsCenters=r.data.map(function(t){return e.xProps.scale(e.categoryLayout.isScalar?t.categoryValue:t.categoryIndex)+a})}}return this.columnsCenters},a.prototype.moveHandle=function(e){var t=this.getColumnsCenters(),i=t[e],a=d3.select(".interactive-hover-line");if(a.empty()||this.columnSelectionLineHandle||(this.columnSelectionLineHandle=d3.select(a.node().parentNode)),this.columnSelectionLineHandle){var r=this.columnSelectionLineHandle;r.select("line").attr({x1:i,x2:i}),r.select("circle").attr({cx:i})}else{var r=this.columnSelectionLineHandle=this.graphicsContext.unclippedGraphicsContext.append("g");r.append("line").classed("interactive-hover-line",!0).attr({x1:i,x2:i,y1:0,y2:this.height}),r.append("circle").attr({cx:i,cy:this.height,r:"6px"}).classed("drag-handle",!0)}},a.getLayout=function(e,i){var a=i.columnWidth,r=.5*a,o=r/2,n=i.isScalar,s=i.xScale,l=i.yScale,c=i.seriesOffsetScale,u=l(0),h=0;return n&&(h=i.categoryWidth/2),{shapeLayout:{width:function(e){return e.drawThinner?r:a},x:function(e){return s(n?e.categoryValue:e.categoryIndex)+c(e.seriesIndex)-h+(e.drawThinner?o:0)},y:function(e){return u+t.AxisHelper.diffScaled(l,Math.max(0,e.value),0)},height:function(e){return Math.abs(t.AxisHelper.diffScaled(l,0,e.value))}},shapeLayoutWithoutHighlights:{width:function(e){return a},x:function(e){return s(n?e.categoryValue:e.categoryIndex)+c(e.seriesIndex)-h},y:function(e){return u+t.AxisHelper.diffScaled(l,Math.max(0,e.originalValue),0)},height:function(e){return Math.abs(t.AxisHelper.diffScaled(l,0,e.originalValue))}},zeroShapeLayout:{width:function(e){return e.drawThinner?r:a},x:function(e){return s(n?e.categoryValue:e.categoryIndex)+c(e.seriesIndex)-h+(e.drawThinner?o:0)},y:function(e){return u},height:function(e){return 0}}}},a.prototype.createLabelDataPoints=function(){for(var a=[],r=this.data,o=r.series,n=t.NewDataLabelUtils.createColumnFormatterCacheManager(),s=this.layout.shapeLayout,l=0,c=o;l<c.length;l++){var u=c[l],h=u.labelSettings?u.labelSettings:r.labelSettings;if(h.show)for(var d=t.NewDataLabelUtils.getDisplayUnitValueFromAxisFormatter(this.yProps.formatter,h),p=0,g=u.data;p<g.length;p++){var m=g[p];if((!r.hasHighlights||m.highlight)&&null!=m.value){var f={left:s.x(m),top:s.y(m),width:s.width(m),height:s.height(m)},y=m.labelFormatString,v=n.getOrCreate(y,h,d),b=t.NewDataLabelUtils.getLabelFormattedText(v.format(m.value)),C={text:b,fontFamily:t.NewDataLabelUtils.LabelTextProperties.fontFamily,fontSize:i.fromPoint(h.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt),fontWeight:t.NewDataLabelUtils.LabelTextProperties.fontWeight},S=e.TextMeasurementService.measureSvgTextWidth(C),x=e.TextMeasurementService.estimateSvgTextHeight(C,!0);a.push({isPreferred:!0,text:b,textSize:{width:S,height:x},outsideFill:t.ColumnChart.getLabelFill(h.labelColor,!1,this.isComboChart),insideFill:t.ColumnChart.getLabelFill(h.labelColor,!0,this.isComboChart),parentType:1,parentShape:{rect:f,orientation:m.value>=0?1:2,validPositions:t.ColumnChart.clusteredValidLabelPositions},identity:m.identity,fontSize:h.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt})}}}return a},a.classes={item:{"class":"column",selector:".column"}},a}();t.ClusteredColumnChartStrategy=a;var r=function(){function a(){}return a.prototype.setupVisualProps=function(e){this.graphicsContext=e,this.margin=e.margin,this.width=this.graphicsContext.width,this.height=this.graphicsContext.height,this.categoryLayout=e.layout,this.animator=e.animator,this.interactivityService=e.interactivityService,this.viewportHeight=e.viewportHeight,this.viewportWidth=e.viewportWidth,this.isComboChart=e.isComboChart},a.prototype.setData=function(e){this.data=e},a.prototype.setYScale=function(e,i,a,r,o,n,s){var l,c,u=this.height;a&&2===a.length&&(l=a[0],c=a[1]);var h=this.yProps=t.ColumnUtil.getCategoryAxis(this.data,u,this.categoryLayout,!0,l,c,r,o,n,s),d=this.data.series.length,p=this.categoryLayout.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio)/d;return this.seriesOffsetScale=d3.scale.ordinal().domain(this.data.series.map(function(e){return e.index})).rangeBands([0,d*p]),h},a.prototype.setXScale=function(e,i,a,r,o,n,s){var l=this.width,c=t.AxisHelper.createValueDomain(this.data.series,!0)||t.emptyDomain,u=t.AxisHelper.combineDomain(a,c,s),h=t.AxisHelper.scaleShouldClamp(u,c);return this.xProps=t.AxisHelper.createAxis({pixelSpan:l,dataDomain:u,metaDataColumn:this.data.valuesMetadata[0],formatString:t.valueFormatter.getFormatString(this.data.valuesMetadata[0],t.columnChartProps.general.formatString),outerPadding:0,isScalar:!0,isVertical:!1,forcedTickCount:i,useTickIntervalForDisplayUnits:!0,isCategoryAxis:!1,scaleType:r,axisDisplayUnits:o,axisPrecision:n,shouldClamp:h}),this.xProps.axis.tickSize(-this.viewportHeight,0),this.xProps},a.prototype.drawColumns=function(e){var i=this.data;this.barsCenters=null;var r=this.categoryLayout.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio),o=r/i.series.length,n={columnWidth:o,categoryWidth:r,xScale:this.xProps.scale,yScale:this.yProps.scale,seriesOffsetScale:this.seriesOffsetScale,isScalar:this.categoryLayout.isScalar,margin:this.margin},s=this.layout=a.getLayout(i,n),l=i.labelSettings,c=[];l&&l.show&&(c=this.createLabelDataPoints());var u,h,d=t.ColumnUtil.drawSeries(i,this.graphicsContext.mainGraphicsContext,n);return this.animator&&e&&(u=this.animator.animate({viewModel:i,series:d,layout:s,itemCS:a.classes.item,interactivityService:this.interactivityService,mainGraphicsContext:this.graphicsContext.mainGraphicsContext,viewPort:{height:this.height,width:this.width}}),h=u.shapes),this.animator&&e&&!u.failed||(h=t.ColumnUtil.drawDefaultShapes(i,d,s,a.classes.item,!this.animator,this.interactivityService&&this.interactivityService.hasSelection())),t.ColumnUtil.applyInteractivity(h,this.graphicsContext.onDragStart),{eventGroup:this.graphicsContext.mainGraphicsContext,shapesSelection:h,viewport:{height:this.height,width:this.width},axisOptions:n,labelDataPoints:c}},a.prototype.selectColumn=function(e,i){t.ColumnUtil.setChosenColumnOpacity(this.graphicsContext.mainGraphicsContext,a.classes.item.selector,e,i),this.moveHandle(e)},a.prototype.getClosestColumnIndex=function(e,i){return t.ColumnUtil.getClosestColumnIndex(i,this.getBarsCenters())},a.prototype.getBarsCenters=function(){var e=this;if(!this.barsCenters){var i=this.categoryLayout.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio);if(this.data.series.length>0){var a=0;this.categoryLayout.isScalar||(a=i/2);var r=this.data.series[0];this.barsCenters=r.data.map(function(t){return e.yProps.scale(e.categoryLayout.isScalar?t.categoryValue:t.categoryIndex)+a})}}return this.barsCenters},a.prototype.moveHandle=function(e){var t=this.getBarsCenters(),i=t[e],a=d3.select(".interactive-hover-line");if(a.empty()||this.columnSelectionLineHandle||(this.columnSelectionLineHandle=d3.select(a.node().parentNode)),this.columnSelectionLineHandle){var r=this.columnSelectionLineHandle;r.select("line").attr({y1:i,y2:i}),r.select("circle").attr({cy:i})}else{var r=this.columnSelectionLineHandle=this.graphicsContext.unclippedGraphicsContext.append("g");r.append("line").classed("interactive-hover-line",!0).attr({x1:0,x2:this.width,y1:i,y2:i}),r.append("circle").attr({cx:0,cy:i,r:"6px"}).classed("drag-handle",!0)}},a.getLayout=function(e,i){var a=i.columnWidth,r=.5*a,o=r/2,n=i.isScalar,s=i.xScale,l=i.yScale,c=i.seriesOffsetScale,u=s(0),h=0;return n&&(h=i.categoryWidth/2),{shapeLayout:{width:function(e){return Math.abs(t.AxisHelper.diffScaled(s,0,e.value))},x:function(e){return u+t.AxisHelper.diffScaled(s,Math.min(0,e.value),0)},y:function(e){return l(n?e.categoryValue:e.categoryIndex)+c(e.seriesIndex)-h+(e.drawThinner?o:0)},height:function(e){return e.drawThinner?r:a}},shapeLayoutWithoutHighlights:{width:function(e){return Math.abs(t.AxisHelper.diffScaled(s,0,e.originalValue))},x:function(e){return u+t.AxisHelper.diffScaled(s,Math.min(0,e.originalValue),0)},y:function(e){return l(n?e.categoryValue:e.categoryIndex)+c(e.seriesIndex)-h},height:function(e){return a}},zeroShapeLayout:{width:function(e){return 0},x:function(e){return u+t.AxisHelper.diffScaled(s,Math.min(0,e.value),0)},y:function(e){return l(n?e.categoryValue:e.categoryIndex)+c(e.seriesIndex)-h+(e.drawThinner?o:0)},height:function(e){return e.drawThinner?r:a}}}},a.prototype.createLabelDataPoints=function(){for(var a=[],r=this.data,o=r.series,n=t.NewDataLabelUtils.createColumnFormatterCacheManager(),s=this.layout.shapeLayout,l=0,c=o;l<c.length;l++){var u=c[l],h=u.labelSettings?u.labelSettings:r.labelSettings;if(h.show)for(var d=t.NewDataLabelUtils.getDisplayUnitValueFromAxisFormatter(this.yProps.formatter,h),p=0,g=u.data;p<g.length;p++){var m=g[p];if(!(this.interactivityService&&this.interactivityService.hasSelection()&&!m.selected||r.hasHighlights&&!m.highlight||null==m.value)){var f=m.labelFormatString,y=n.getOrCreate(f,h,d),v=t.NewDataLabelUtils.getLabelFormattedText(y.format(m.value)),b={text:v,fontFamily:t.NewDataLabelUtils.LabelTextProperties.fontFamily,fontSize:i.fromPoint(h.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt),fontWeight:t.NewDataLabelUtils.LabelTextProperties.fontWeight},C=e.TextMeasurementService.measureSvgTextWidth(b),S=e.TextMeasurementService.estimateSvgTextHeight(b,!0),x={left:s.x(m),top:s.y(m),width:s.width(m),height:s.height(m)};a.push({isPreferred:!0,text:v,textSize:{width:C,height:S},outsideFill:t.ColumnChart.getLabelFill(h.labelColor,!1,this.isComboChart),insideFill:t.ColumnChart.getLabelFill(h.labelColor,!0,this.isComboChart),parentType:1,parentShape:{rect:x,orientation:m.value>=0?3:4,validPositions:t.ColumnChart.clusteredValidLabelPositions},identity:m.identity,fontSize:h.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt})}}}return a},a.classes={item:{"class":"bar",selector:".bar"}},a}();t.ClusteredBarChartStrategy=r}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.PixelConverter,a=function(){function a(){}return a.prototype.setupVisualProps=function(e){this.graphicsContext=e,this.margin=e.margin,this.width=this.graphicsContext.width,this.height=this.graphicsContext.height,this.categoryLayout=e.layout,this.animator=e.animator,this.interactivityService=e.interactivityService,this.viewportHeight=e.viewportHeight,this.viewportWidth=e.viewportWidth,this.isComboChart=e.isComboChart},a.prototype.setData=function(e){this.data=e},a.prototype.setXScale=function(e,i,a,r,o,n,s){var l,c,u=this.width;a&&2===a.length&&(l=a[0],c=a[1]);var h=this.xProps=t.ColumnUtil.getCategoryAxis(this.data,u,this.categoryLayout,!1,l,c,r,o,n,s);return h},a.prototype.setYScale=function(e,i,a,r,o,n,s){var l=this.viewportHeight,c=t.StackedUtil.calcValueDomain(this.data.series,e),u=[c.min,c.max],h=t.AxisHelper.combineDomain(a,u,s),d=t.AxisHelper.scaleShouldClamp(h,u),p=this.data.valuesMetadata[0],g=e?this.graphicsContext.hostService.getLocalizedString("Percentage"):t.valueFormatter.getFormatString(p,t.columnChartProps.general.formatString);return this.yProps=t.AxisHelper.createAxis({pixelSpan:l,dataDomain:h,metaDataColumn:p,formatString:g,outerPadding:0,isScalar:!0,isVertical:!0,forcedTickCount:i,useTickIntervalForDisplayUnits:!0,isCategoryAxis:!1,scaleType:r,axisDisplayUnits:o,axisPrecision:n,is100Pct:e,shouldClamp:d}),this.yProps},a.prototype.drawColumns=function(e){var i=this.data;this.columnsCenters=null;var r={columnWidth:this.categoryLayout.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio),xScale:this.xProps.scale,yScale:this.yProps.scale,isScalar:this.categoryLayout.isScalar,margin:this.margin},o=this.layout=a.getLayout(i,r),n=i.labelSettings,s=[];n&&n.show&&(s=this.createLabelDataPoints());var l,c,u=t.ColumnUtil.drawSeries(i,this.graphicsContext.mainGraphicsContext,r);return this.animator&&e&&(l=this.animator.animate({viewModel:i,series:u,layout:o,itemCS:a.classes.item,interactivityService:this.interactivityService,mainGraphicsContext:this.graphicsContext.mainGraphicsContext,viewPort:{height:this.height,width:this.width}}),c=l.shapes),this.animator&&e&&!l.failed||(c=t.ColumnUtil.drawDefaultShapes(i,u,o,a.classes.item,!this.animator,this.interactivityService&&this.interactivityService.hasSelection())),t.ColumnUtil.applyInteractivity(c,this.graphicsContext.onDragStart),{eventGroup:this.graphicsContext.mainGraphicsContext,shapesSelection:c,viewport:{height:this.height,width:this.width},axisOptions:r,labelDataPoints:s}},a.prototype.selectColumn=function(e,i){t.ColumnUtil.setChosenColumnOpacity(this.graphicsContext.mainGraphicsContext,a.classes.item.selector,e,i),this.moveHandle(e)},a.prototype.getClosestColumnIndex=function(e,i){return t.ColumnUtil.getClosestColumnIndex(e,this.getColumnsCenters())},a.prototype.getColumnsCenters=function(){var e=this;if(!this.columnsCenters){var i=this.categoryLayout.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio);if(this.data.series.length>0){var a=0;this.categoryLayout.isScalar||(a=i/2);var r=this.data.series[0];this.columnsCenters=r.data.map(function(t){return e.xProps.scale(e.categoryLayout.isScalar?t.categoryValue:t.categoryIndex)+a})}}return this.columnsCenters},a.prototype.moveHandle=function(e){
20var t=this.getColumnsCenters(),i=t[e],a=d3.select(".interactive-hover-line");if(a.empty()||this.columnSelectionLineHandle||(this.columnSelectionLineHandle=d3.select(a.node().parentNode)),this.columnSelectionLineHandle){var r=this.columnSelectionLineHandle;r.select("line").attr({x1:i,x2:i}),r.select("circle").attr({cx:i})}else{var r=this.columnSelectionLineHandle=this.graphicsContext.unclippedGraphicsContext.append("g");r.append("line").classed("interactive-hover-line",!0).attr({x1:i,x2:i,y1:0,y2:this.height}),r.append("circle").attr({cx:i,cy:this.height,r:"6px"}).classed("drag-handle",!0)}},a.getLayout=function(e,t){var i=t.columnWidth,a=t.isScalar,r=t.xScale,o=t.yScale,n=0;return a&&(n=i/2),{shapeLayout:{width:function(e){return i},x:function(e){return r(a?e.categoryValue:e.categoryIndex)-n},y:function(e){return o(e.position)},height:function(e){return o(e.position-e.valueAbsolute)-o(e.position)}},shapeLayoutWithoutHighlights:{width:function(e){return i},x:function(e){return r(a?e.categoryValue:e.categoryIndex)-n},y:function(e){return o(e.originalPosition)},height:function(e){return o(e.originalPosition-e.originalValueAbsolute)-o(e.originalPosition)}},zeroShapeLayout:{width:function(e){return i},x:function(e){return r(a?e.categoryValue:e.categoryIndex)-n},y:function(e){return o(e.value>=0?e.position-e.valueAbsolute:e.position)},height:function(e){return 0}}}},a.prototype.createLabelDataPoints=function(){for(var a=[],r=this.data,o=r.series,n=t.NewDataLabelUtils.createColumnFormatterCacheManager(),s=this.layout.shapeLayout,l=0,c=o;l<c.length;l++){var u=c[l],h=u.labelSettings?u.labelSettings:r.labelSettings;if(h.show)for(var d=t.NewDataLabelUtils.getDisplayUnitValueFromAxisFormatter(this.yProps.formatter,h),p=0,g=u.data;p<g.length;p++){var m=g[p];if((!r.hasHighlights||m.highlight)&&null!=m.value){var f={left:s.x(m),top:s.y(m),width:s.width(m),height:s.height(m)},y="";y=this.graphicsContext.is100Pct?t.NewDataLabelUtils.hundredPercentFormat:m.labelFormatString;var v=n.getOrCreate(y,h,d),b=t.NewDataLabelUtils.getLabelFormattedText(v.format(m.value)),C={text:b,fontFamily:t.NewDataLabelUtils.LabelTextProperties.fontFamily,fontSize:i.fromPoint(h.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt),fontWeight:t.NewDataLabelUtils.LabelTextProperties.fontWeight},S=e.TextMeasurementService.measureSvgTextWidth(C),x=e.TextMeasurementService.estimateSvgTextHeight(C,!0);a.push({isPreferred:!0,text:b,textSize:{width:S,height:x},outsideFill:t.ColumnChart.getLabelFill(h.labelColor,!1,this.isComboChart),insideFill:t.ColumnChart.getLabelFill(h.labelColor,!0,this.isComboChart),parentType:1,parentShape:{rect:f,orientation:m.value>=0?1:2,validPositions:t.ColumnChart.stackedValidLabelPositions},identity:m.identity,fontSize:h.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt})}}}return a},a.classes={item:{"class":"column",selector:".column"},highlightItem:{"class":"highlightColumn",selector:".highlightColumn"}},a}();t.StackedColumnChartStrategy=a;var r=function(){function a(){}return a.prototype.setupVisualProps=function(e){this.graphicsContext=e,this.margin=e.margin,this.width=this.graphicsContext.width,this.height=this.graphicsContext.height,this.categoryLayout=e.layout,this.animator=e.animator,this.interactivityService=e.interactivityService,this.viewportHeight=e.viewportHeight,this.viewportWidth=e.viewportWidth,this.isComboChart=e.isComboChart},a.prototype.setData=function(e){this.data=e},a.prototype.setYScale=function(e,i,a,r,o,n,s){var l,c,u=this.height;a&&2===a.length&&(l=a[0],c=a[1]);var h=this.yProps=t.ColumnUtil.getCategoryAxis(this.data,u,this.categoryLayout,!0,l,c,r,o,n,s);return h},a.prototype.setXScale=function(e,i,a,r,o,n,s){var l=this.width,c=t.StackedUtil.calcValueDomain(this.data.series,e),u=[c.min,c.max],h=t.AxisHelper.combineDomain(a,u,s),d=t.AxisHelper.scaleShouldClamp(h,u),p=this.data.valuesMetadata[0],g=e?this.graphicsContext.hostService.getLocalizedString("Percentage"):t.valueFormatter.getFormatString(p,t.columnChartProps.general.formatString);return this.xProps=t.AxisHelper.createAxis({pixelSpan:l,dataDomain:h,metaDataColumn:p,formatString:g,outerPadding:0,isScalar:!0,isVertical:!1,forcedTickCount:i,useTickIntervalForDisplayUnits:!0,isCategoryAxis:!1,scaleType:r,axisDisplayUnits:o,axisPrecision:n,is100Pct:e,shouldClamp:d}),this.xProps.axis.tickSize(-this.viewportHeight,0),this.xProps},a.prototype.drawColumns=function(e){var i=this.data;this.barsCenters=null;var r={columnWidth:this.categoryLayout.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio),xScale:this.xProps.scale,yScale:this.yProps.scale,isScalar:this.categoryLayout.isScalar,margin:this.margin},o=this.layout=a.getLayout(i,r),n=i.labelSettings,s=[];n&&n.show&&(s=this.createLabelDataPoints());var l,c,u=t.ColumnUtil.drawSeries(i,this.graphicsContext.mainGraphicsContext,r);return this.animator&&e&&(l=this.animator.animate({viewModel:i,series:u,layout:o,itemCS:a.classes.item,interactivityService:this.interactivityService,mainGraphicsContext:this.graphicsContext.mainGraphicsContext,viewPort:{height:this.height,width:this.width}}),c=l.shapes),this.animator&&e&&!l.failed||(c=t.ColumnUtil.drawDefaultShapes(i,u,o,a.classes.item,!this.animator,this.interactivityService&&this.interactivityService.hasSelection())),t.ColumnUtil.applyInteractivity(c,this.graphicsContext.onDragStart),{eventGroup:this.graphicsContext.mainGraphicsContext,shapesSelection:c,viewport:{height:this.height,width:this.width},axisOptions:r,labelDataPoints:s}},a.prototype.selectColumn=function(e,i){t.ColumnUtil.setChosenColumnOpacity(this.graphicsContext.mainGraphicsContext,a.classes.item.selector,e,i),this.moveHandle(e)},a.prototype.getClosestColumnIndex=function(e,i){return t.ColumnUtil.getClosestColumnIndex(i,this.getBarsCenters())},a.prototype.getBarsCenters=function(){var e=this;if(!this.barsCenters){var i=this.categoryLayout.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio);if(this.data.series.length>0){var a=0;this.categoryLayout.isScalar||(a=i/2);var r=this.data.series[0];this.barsCenters=r.data.map(function(t){return e.yProps.scale(e.categoryLayout.isScalar?t.categoryValue:t.categoryIndex)+a})}}return this.barsCenters},a.prototype.moveHandle=function(e){var t=this.getBarsCenters(),i=t[e],a=d3.select(".interactive-hover-line");if(a.empty()||this.columnSelectionLineHandle||(this.columnSelectionLineHandle=d3.select(a.node().parentNode)),this.columnSelectionLineHandle){var r=this.columnSelectionLineHandle;r.select("line").attr({y1:i,y2:i}),r.select("circle").attr({cy:i})}else{var r=this.columnSelectionLineHandle=this.graphicsContext.unclippedGraphicsContext.append("g");r.append("line").classed("interactive-hover-line",!0).attr({x1:0,x2:this.width,y1:i,y2:i}),r.append("circle").classed("drag-handle",!0).attr({cx:0,cy:i,r:"6px"})}},a.getLayout=function(e,t){var i=t.columnWidth,a=t.isScalar,r=t.xScale,o=t.yScale,n=0;return a&&(n=i/2),{shapeLayout:{width:function(e){return r(e.position)-r(e.position-e.valueAbsolute)},x:function(e){return r(e.position-e.valueAbsolute)},y:function(e){return o(a?e.categoryValue:e.categoryIndex)-n},height:function(e){return i}},shapeLayoutWithoutHighlights:{width:function(e){return r(e.originalPosition)-r(e.originalPosition-e.originalValueAbsolute)},x:function(e){return r(e.originalPosition-e.originalValueAbsolute)},y:function(e){return o(a?e.categoryValue:e.categoryIndex)-n},height:function(e){return i}},zeroShapeLayout:{width:function(e){return 0},x:function(e){return r(e.value>=0?e.position-e.valueAbsolute:e.position)},y:function(e){return o(a?e.categoryValue:e.categoryIndex)-n},height:function(e){return i}}}},a.prototype.createLabelDataPoints=function(){for(var a=[],r=this.data,o=r.series,n=t.NewDataLabelUtils.createColumnFormatterCacheManager(),s=this.layout.shapeLayout,l=0,c=o;l<c.length;l++){var u=c[l],h=u.labelSettings?u.labelSettings:r.labelSettings;if(h.show)for(var d=t.NewDataLabelUtils.getDisplayUnitValueFromAxisFormatter(this.yProps.formatter,h),p=0,g=u.data;p<g.length;p++){var m=g[p];if(!(this.interactivityService&&this.interactivityService.hasSelection()&&!m.selected||r.hasHighlights&&!m.highlight||null==m.value)){var f=void 0;f=this.graphicsContext.is100Pct?t.NewDataLabelUtils.hundredPercentFormat:m.labelFormatString;var y=n.getOrCreate(f,h,d),v=t.NewDataLabelUtils.getLabelFormattedText(y.format(m.value)),b={text:v,fontFamily:t.NewDataLabelUtils.LabelTextProperties.fontFamily,fontSize:i.fromPoint(h.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt),fontWeight:t.NewDataLabelUtils.LabelTextProperties.fontWeight},C=e.TextMeasurementService.measureSvgTextWidth(b),S=e.TextMeasurementService.estimateSvgTextHeight(b,!0),x={left:s.x(m),top:s.y(m),width:s.width(m),height:s.height(m)};a.push({isPreferred:!0,text:v,textSize:{width:C,height:S},outsideFill:t.ColumnChart.getLabelFill(h.labelColor,!1,this.isComboChart),insideFill:t.ColumnChart.getLabelFill(h.labelColor,!0,this.isComboChart),parentType:1,parentShape:{rect:x,orientation:m.value>=0?3:4,validPositions:t.ColumnChart.stackedValidLabelPositions},identity:m.identity,fontSize:h.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt})}}}return a},a.classes={item:{"class":"bar",selector:".bar"},highlightItem:{"class":"highlightBar",selector:".highlightBar"}},a}();t.StackedBarChartStrategy=r}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(i){var a=t.utility.SelectionManager,r=function(){function i(){}return i.converter=function(e){var a={size:i.getSize(e),color:i.getFill(e).solid.color,text:i.DefaultText,toolTipInfo:[{displayName:"Test",value:"1...2....3... can you see me? I am sending random strings to the tooltip"}],selector:t.SelectionId.createNull()},r=e.table;return r?(a.text=r.rows[0][0],e.categorical&&(a.selector=e.categorical.categories[0].identity?t.SelectionId.createWithId(e.categorical.categories[0].identity[0]):t.SelectionId.createNull()),a):a},i.prototype.init=function(e){this.root=d3.select(e.element.get(0)).append("svg").classed("hello",!0),this.svgText=this.root.append("text").style("cursor","pointer").style("stroke","green").style("stroke-width","0px").attr("text-anchor","middle"),this.selectiionManager=new a({hostServices:e.host})},i.prototype.update=function(a){if(a.dataViews||a.dataViews[0]){var r=this.dataView=a.dataViews[0],o=a.viewport,n=i.converter(r);this.root.attr({height:o.height,width:o.width});var s={fontFamily:"tahoma",fontSize:n.size+"px",text:n.text},l=e.TextMeasurementService.estimateSvgTextHeight(s),c=this.selectiionManager;this.svgText.style({fill:n.color,"font-size":s.fontSize,"font-family":s.fontFamily}).attr({y:o.height/2+l/3+"px",x:o.width/2}).text(n.text).on("click",function(){var e=this;c.select(n.selector).then(function(t){return d3.select(e).style("stroke-width",t.length>0?"2px":"0px")})}).data([n]),t.TooltipManager.addTooltip(this.svgText,function(e){return e.data.toolTipInfo})}},i.getFill=function(e){if(e){var t=e.metadata.objects;if(t){var i=t.general;if(i){var a=i.fill;if(a)return a}}}return{solid:{color:"red"}}},i.getSize=function(e){if(e){var t=e.metadata.objects;if(t){var i=t.general;if(i){var a=i.size;if(a)return a}}}return 100},i.prototype.enumerateObjectInstances=function(e){var t=[],a=this.dataView;switch(e.objectName){case"general":var r={objectName:"general",displayName:"General",selector:null,properties:{fill:i.getFill(a),size:i.getSize(a)}};t.push(r)}return t},i.prototype.destroy=function(){this.root=null},i.capabilities={dataRoles:[{displayName:"Values",name:"Values",kind:e.VisualDataRoleKind.GroupingOrMeasure}],dataViewMappings:[{table:{rows:{"for":{"in":"Values"},dataReductionAlgorithm:{window:{count:100}}},rowCount:{preferred:{min:1}}}}],objects:{general:{displayName:e.data.createDisplayNameGetter("Visual_General"),properties:{fill:{type:{fill:{solid:{color:!0}}},displayName:"Fill"},size:{type:{numeric:!0},displayName:"Size"}}}}},i.DefaultText="Invalid DV",i}();i.HelloIVisual=r}(i=t.samples||(t.samples={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(t){function i(t,i,a){if(a){for(var r,o=a.length,n=0;o>n;n++){var s=a[n];if(s.enumerateObjectInstances){if(s instanceof e.ColumnChart){r=n;continue}s.enumerateObjectInstances(t,i)}}void 0!==r&&a[r].enumerateObjectInstances(t,i)}}function a(e){var t=!_.isEmpty(e.dataViewMappings)&&e.dataViewMappings[0];if(t){var i=t.categorical&&t.categorical.values,a=i.group&&!_.isEmpty(i.group.select)&&i.group.select[0];_.isEmpty(a["for"]["in"].items)&&(i.group.by.items=void 0)}t&&t.categorical&&(t.categorical.dataVolume=4);var r=e.dataViewMappings.length>1&&e.dataViewMappings[1];r&&r.categorical&&(r.categorical.dataVolume=4)}function r(t){if(t&&t.dataViewMappings.length>0){var i=t.dataViewMappings[0];if(!e.CartesianChart.detectScalarMapping(i))return["Category","Y","Y2"]}return null}function o(e){return 10===e||13===e||14===e||15===e||16===e}t.capabilities=e.comboChartCapabilities,t.enumerateDataPoints=i,t.customizeQuery=a,t.getSortableRoles=r,t.isComboChart=o}(t=e.ComboChart||(e.ComboChart={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=jsCommon.ArrayExtensions,i=function(){function e(e,t){this.basePickerColors=[{value:"#FFFFFF"},{value:"#000000"},{value:"#00B8AA"},{value:"#374649"},{value:"#FD625E"},{value:"#F2C811"},{value:"#5F6B6D"},{value:"#8AD4EB"},{value:"#FE9666"},{value:"#A66999"}],this.colors=e||r.getDefaultTheme(),this.sentimentColors=t||r.defaultSentimentColors,this.scales={}}return e.prototype.getColorScaleByKey=function(e){var t=this.scales[e];return void 0===t&&(t=this.createScale(),this.scales[e]=t),t},e.prototype.getNewColorScale=function(){return this.createScale()},e.prototype.getColorByIndex=function(e){return this.colors[e]},e.prototype.getSentimentColors=function(){return this.sentimentColors},e.prototype.getBasePickerColors=function(){return this.basePickerColors},e.prototype.getAllColors=function(){return this.colors},e.prototype.createScale=function(){return a.createFromColors(this.colors)},e}();e.DataColorPalette=i;var a=function(){function e(e){this.scale=e}return e.prototype.getColor=function(e){return this.scale(e)},e.prototype.clearAndRotateScale=function(){var e=this.scale.domain().length,i=t.rotate(this.scale.range(),e);this.scale=d3.scale.ordinal().range(i)},e.prototype.clone=function(){return new e(this.scale.copy())},e.prototype.getDomain=function(){return this.scale.domain()},e.createFromColors=function(t){return new e(d3.scale.ordinal().range(t))},e}();e.D3ColorScale=a;var r=function(){function e(){}return e.getDefaultTheme=function(){if(!e.defaultTheme){e.defaultTheme=[];for(var t=e.defaultBaseColors,i=0;i<e.colorSectorCount;++i)for(var a=0,r=t.length;r>a;++a)e.defaultTheme.push({value:jsCommon.Color.rotate(t[a].value,i/e.colorSectorCount)})}return e.defaultTheme},e.colorSectorCount=12,e.defaultBaseColors=[{value:"#01B8AA"},{value:"#374649"},{value:"#FD625E"},{value:"#F2C80F"},{value:"#5F6B6D"},{value:"#8AD4EB"},{value:"#FE9666"},{value:"#A66999"},{value:"#3599B8"},{value:"#DFBFBF"},{value:"#4AC5BB"},{value:"#5F6B6D"},{value:"#FB8281"},{value:"#F4D25A"},{value:"#7F898A"},{value:"#A4DDEE"},{value:"#FDAB89"},{value:"#B687AC"},{value:"#28738A"},{value:"#A78F8F"},{value:"#168980"},{value:"#293537"},{value:"#BB4A4A"},{value:"#B59525"},{value:"#475052"},{value:"#6A9FB0"},{value:"#BD7150"},{value:"#7B4F71"},{value:"#1B4D5C"},{value:"#706060"},{value:"#0F5C55"},{value:"#1C2325"},{value:"#7D3231"},{value:"#796419"},{value:"#303637"},{value:"#476A75"},{value:"#7E4B36"},{value:"#52354C"},{value:"#0D262E"},{value:"#544848"}],e.defaultSentimentColors=[{value:"#C0433A"},{value:"#E8D62E"},{value:"#79C75B"}],e}()}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=function(){function i(e){this.isScrollable=e.isScrollable,this.interactivityService=e.interactivityService}return i.prototype.init=function(e){this.options=e,this.svg=e.svg,this.svg.classed(i.ClassName,!0),this.mainGraphicsG=this.svg.append("g").classed("dataDotChartMainGraphicsContext",!0),this.mainGraphicsContext=this.mainGraphicsG.append("svg"),this.currentViewport=e.viewport,this.hostService=e.host,this.cartesianVisualHost=e.cartesianHost,this.style=e.style,this.colors=this.style.colorPalette.dataColors,this.interactivity=e.interactivity,this.element=e.element},i.prototype.setData=function(a){if(this.data={series:{data:[]},hasHighlights:!1,hasDynamicSeries:!1},a.length>0){var r=a[0];if(r&&r.categorical){var o=this.dataViewCategorical=r.categorical,n=o.categories,s=e.ValueType.fromDescriptor({text:!0});n&&n.length>0&&n[0].source&&n[0].source.type&&(s=n[0].source.type),this.data=i.converter(r,t.valueFormatter.format(null),this.interactivityService)}}},i.prototype.setFilteredData=function(t,i){var a=this.clippedData=e.Prototype.inherit(this.data);return a&&a.series&&a.series.data&&(a.series={data:a.series.data.slice(t,i),xCol:a.series.xCol,yCol:a.series.yCol}),a},i.prototype.calculateAxesProperties=function(a){var r=this;this.currentViewport=a.viewport,this.margin=a.margin;var o=this.clippedData=this.data,n=this.currentViewport,s=this.margin,l=o?o.series:null,c=l&&l.data&&l.data.length>0?[l]:[],u=l&&l.data?l.data.length:0;o.hasHighlights&&(u/=2);var h,d,p=n.width-(s.left+s.right),g=n.height-(s.top+s.bottom);i.hasDataPoint(l)&&(h=l.xCol,d=l.yCol);var m=t.CartesianChart.getLayout(null,{availableWidth:p,categoryCount:u,domain:null,isScalar:!1,isScrollable:this.isScrollable,trimOrdinalDataOnOverflow:a.trimOrdinalDataOnOverflow}),f=m.categoryThickness*t.CartesianChart.OuterPaddingRatio;this.isScrollable||(this.clippedData=i.createClippedDataIfOverflowed(o,m.categoryCount));var y=t.AxisHelper.createValueDomain(c,!0)||t.emptyDomain,v=t.AxisHelper.combineDomain(a.forcedYDomain,y,a.ensureYDomain);this.yAxisProperties=t.AxisHelper.createAxis({pixelSpan:g,dataDomain:v,metaDataColumn:d,formatString:t.valueFormatter.getFormatString(d,i.formatStringProp),outerPadding:0,isScalar:!0,isVertical:!0,forcedTickCount:a.forcedTickCount,useTickIntervalForDisplayUnits:!0,isCategoryAxis:!1});var b=this.xAxisProperties?this.xAxisProperties.axisType:e.ValueType.fromDescriptor({text:!0}),C=t.AxisHelper.createDomain(c,b,!1,a.forcedXDomain,a.ensureXDomain);return this.xAxisProperties=t.AxisHelper.createAxis({pixelSpan:p,dataDomain:C,metaDataColumn:h,formatString:t.valueFormatter.getFormatString(h,i.formatStringProp),outerPadding:f,isScalar:!1,isVertical:!1,forcedTickCount:a.forcedTickCount,useTickIntervalForDisplayUnits:!0,categoryThickness:m.categoryThickness,getValueFn:function(e,t){return r.lookupXValue(e,t)},isCategoryAxis:!0}),[this.xAxisProperties,this.yAxisProperties]},i.createClippedDataIfOverflowed=function(t,i){var a=t.hasHighlights?Math.min(t.series.data.length,2*i):Math.min(t.series.data.length,i);if(a>=t.series.data.length)return t;var r=e.Prototype.inherit(t);return r.series=e.Prototype.inherit(t.series),r.series.data=r.series.data.slice(0,a),r},i.hasDataPoint=function(e){return e&&e.data&&e.data.length>0},i.prototype.lookupXValue=function(e,i){var a=this.data,r=t.AxisHelper.isDateTime(i);if(r)return new Date(e);if(a&&a.series){var o=a.series.data;if(o){var n=o[e];if(n)return n.categoryValue}}return e},i.prototype.overrideXScale=function(e){this.xAxisProperties=e},i.prototype.render=function(a){var r=this;if(this.clippedData){var o=this.clippedData,n=o.series.data,s=o.hasHighlights,l=this.margin,c=this.currentViewport,u=c.width-(l.left+l.right),h=c.height-(l.top+l.bottom),d=this.xAxisProperties.scale,p=this.yAxisProperties.scale,g=this.xAxisProperties.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio),m=g/2,f=this.cartesianVisualHost.getSharedColors().getNewColorScale().getColor(i.DotColorKey),y=this.interactivityService?this.interactivityService.hasSelection():!1;this.mainGraphicsContext.attr("width",u).attr("height",h);var v=this.mainGraphicsContext.selectAll(i.DotClassSelector).data(n,function(e){return e.identity.getKey()});v.enter().append("circle").classed(i.DotClassName,!0),v.style({fill:f.value}).style("fill-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.selected,e.highlight,y,s)}).classed("null-value",function(e){return null===e.value}).attr({r:function(e){return m},cx:function(e){return d(e.categoryIndex)+m},cy:function(e){return p(e.value)}}),v.exit().remove();var b=this.mainGraphicsContext.selectAll(i.DotLabelClassSelector).data(n,function(e){return e.identity.getKey()});b.enter().append("text").classed(i.DotLabelClassName,!0).attr({"text-anchor":i.DotLabelTextAnchor,dy:i.DotLabelVerticalOffset}),b.classed("null-value",function(e){return null===e.value}).classed("overflowed",!1).attr({x:function(e){return d(e.categoryIndex)+m},y:function(e){return p(e.value)}}).text(function(e){return r.yAxisProperties.formatter.format(e.value)});var C=!1;b.each(function(){if(!C&&!$("<div>").addClass($(this).attr("class")).hasClass("null-value")){var t=e.TextMeasurementService.measureSvgTextElementWidth(this);t>g&&(b.classed("overflowed",!0),C=!0)}}),b.exit().remove();var S=void 0;return this.interactivityService&&(S={dots:v,dotLabels:b,datapoints:n}),t.SVGUtil.flushAllD3TransitionsIfNeeded(this.options),{dataPoints:n,behaviorOptions:S,labelDataPoints:[],labelsAreNumeric:!0}}},i.prototype.calculateLegend=function(){return this.createLegendDataPoints(0)},i.prototype.hasLegend=function(){return this.data&&this.data.hasDynamicSeries},i.prototype.createLegendDataPoints=function(a){var r=this.data;if(!r)return null;var o,n=r.series,s=n.data,l=[],c=this.xAxisProperties?this.xAxisProperties.axisType:e.ValueType.fromDescriptor({text:!0});if(r.series&&r.series.data){var u=r.series.data[0];o=u&&this.lookupXValue(u.categoryValue,c)}if(n.yCol){var h=i.formatStringProp,d=s[a],p=d&&d.value,g=t.converterHelper.getFormattedLegendLabel(n.yCol,this.dataViewCategorical.values,h),m=this.cartesianVisualHost.getSharedColors().getNewColorScale().getColor(i.DotColorKey),f=this.dataViewCategorical.values,y=f&&f.length>a?t.SelectionId.createWithIdAndMeasure(f[a].identity,f[a].source.queryName):t.SelectionId.createWithMeasure(f.source.queryName);l.push({color:m.value,icon:t.LegendIcon.Line,label:g,category:t.valueFormatter.format(o,t.valueFormatter.getFormatString(n.xCol,h)),measure:t.valueFormatter.format(p,t.valueFormatter.getFormatString(n.yCol,h)),identity:y,selected:!1})}return{dataPoints:l}},i.prototype.onClearSelection=function(){this.interactivityService&&this.interactivityService.clearSelection()},i.converter=function(e,i,a){var r=e.categorical,o=r.categories&&r.categories.length>0?r.categories[0]:{source:void 0,values:[i],identity:void 0},n=t.AxisHelper.getCategoryValueType(o.source),s=t.AxisHelper.isDateTime(n),l=o.values;if(!_.isEmpty(r.values)){for(var c=r.values[0],u=!!c.highlights,h=[],d=0,p=c.values.length;p>d;d++){var g=o.identity?t.SelectionId.createWithIdAndMeasure(o.identity[d],c.source.queryName):t.SelectionId.createWithMeasure(c.source.queryName),m=l[d];if((!s||null==m||m instanceof Date)&&(h.push({categoryValue:s&&m?m.getTime():m,value:c.values[d],categoryIndex:d,seriesIndex:0,selected:!1,identity:g,highlight:!1}),u)){var f=t.SelectionId.createWithHighlight(g),y=c.highlights[d];h.push({categoryValue:s&&m?m.getTime():m,value:y,categoryIndex:d,seriesIndex:0,selected:!1,identity:f,highlight:!0})}}return a&&a.applySelectionStateToData(h),{series:{xCol:o.source,yCol:c.source,data:h},hasHighlights:u,hasDynamicSeries:!0}}return{series:{data:[]},hasHighlights:!1,hasDynamicSeries:!1}},i.formatStringProp={objectName:"general",propertyName:"formatString"},i.ClassName="dataDotChart",i.DotClassName="dot",i.DotClassSelector=".dot",i.DotColorKey="dataDot",i.DotLabelClassName="label",i.DotLabelClassSelector=".label",i.DotLabelVerticalOffset="0.4em",i.DotLabelTextAnchor="middle",i}();t.DataDotChart=i}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.CssConstants.createClassAndSelector,a=jsCommon.PixelConverter,r=e.data.DataRoleHelper,o=function(){function o(e){this.labelPositionObjects=[t.labelPosition.outsideEnd,t.labelPosition.insideCenter],e&&(this.tooltipsEnabled=e.tooltipsEnabled,e.funnelSmallViewPortProperties&&(this.funnelSmallViewPortProperties=e.funnelSmallViewPortProperties),e.animator&&(this.animator=e.animator),e.behavior&&(this.behavior=e.behavior))}return o.isValidValueColumn=function(e){return r.hasRole(e.source,"Y")},o.getFirstValidValueColumn=function(e){for(var t=0,i=e;t<i.length;t++){var a=i[t];if(o.isValidValueColumn(a))return a}},o.converter=function(e,i,a,r,n){void 0===n&&(n=!0);var s=[],l=t.funnelChartProps.general.formatString,c=e.categorical,u=c.categories||[],h=c.values,d=[];h&&(d=_.map(h,function(e){return e.source}));var p,g,m,f,y=h&&h.length>0&&h[0]&&!!h[0].highlights,v=!1,b=!1,C=!1,S=[],x=t.dataLabelUtils.getDefaultFunnelLabelSettings(),w=t.dataLabelUtils.getDefaultLabelSettings(!0),P=new t.ColorHelper(i,t.funnelChartProps.dataPoint.fill,r),D=t.GradientUtils.getGradientValueColumn(c);if(e&&e.metadata&&e.metadata.objects){var L=e.metadata.objects.labels;L&&t.dataLabelUtils.updateLabelSettingsFromLabelsObject(L,x);var T=e.metadata.objects.percentBarLabel;T&&t.dataLabelUtils.updateLabelSettingsFromLabelsObject(T,w)}var V=!_.isEmpty(h)&&o.getFirstValidValueColumn(h);if(!V)return{slices:s,categoryLabels:S,valuesMetadata:d,hasHighlights:y,highlightsOverflow:v,canShowDataLabels:!0,dataLabelsSettings:x,hasNegativeValues:b,allValuesAreNegative:C,percentBarLabelSettings:w};p=V.values[0],y&&(g=V.highlights[0]);var M=t.valueFormatter.getLocalizedString("Percentage");if(1===u.length)for(var N=u[0],A=N.values,O=0,I=A.length;I>O;O++){var R=V.source.queryName,F=t.SelectionIdBuilder.builder().withCategory(N,O).withMeasure(R).createSelectionId(),H=V.values[O],z=t.converterHelper.formatFromMetadataColumn(A[O],N.source,l),G=void 0;if(n){G=[],G.push({displayName:N.source.displayName,value:z}),null!=H&&G.push({displayName:V.source.displayName,value:t.converterHelper.formatFromMetadataColumn(H,V.source,l)});var j=void 0;y&&(j=V.highlights[O],null!=j&&G.push({displayName:t.ToolTipComponent.localizationOptions.highlightedValueDisplayName,value:t.converterHelper.formatFromMetadataColumn(j,V.source,l)}));var k=D?D.source:void 0;k&&k!==V.source&&null!=D.values[O]&&G.push({displayName:k.displayName,value:t.converterHelper.formatFromMetadataColumn(D.values[O],k,l)}),y?o.addFunnelPercentsToTooltip(M,G,a,g?j/g:null,f?j/f:null,!0):o.addFunnelPercentsToTooltip(M,G,a,p?H/p:null,m?H/m:null)}var E=P.getColorForMeasure(N.objects&&N.objects[O],"");if(s.push({label:z,value:H,originalValue:H,categoryOrMeasureIndex:O,identity:F,selected:!1,key:F.getKey(),tooltipInfo:G,color:E,labelFill:x.labelColor}),y){var W=t.SelectionId.createWithHighlight(F),j=V.highlights[O];s.push({label:z,value:H,originalValue:H,categoryOrMeasureIndex:O,identity:W,selected:!1,key:W.getKey(),highlight:!0,highlightValue:j,originalHighlightValue:j,tooltipInfo:G,color:E}),f=j}m=H}else if(d.length>0&&h&&h.length>0)for(var O=0,B=h.length;B>O;O++){var U=h[O];if(o.isValidValueColumn(U)){var H=U.values[0],F=t.SelectionId.createWithMeasure(U.source.queryName),G=void 0,E=P.getColorForMeasure(U.source.objects,"");if(n)if(G=[],null!=H&&G.push({displayName:U.source.displayName,value:t.converterHelper.formatFromMetadataColumn(H,U.source,l)}),y){var j=U.highlights[0];null!=j&&G.push({displayName:t.ToolTipComponent.localizationOptions.highlightedValueDisplayName,value:t.converterHelper.formatFromMetadataColumn(j,U.source,l)}),o.addFunnelPercentsToTooltip(M,G,a,g?j/g:null,f?j/f:null,!0)}else o.addFunnelPercentsToTooltip(M,G,a,p?H/p:null,m?H/m:null);if(s.push({label:d[O].displayName,value:H,originalValue:H,categoryOrMeasureIndex:O,identity:F,selected:!1,key:F.getKey(),tooltipInfo:G,color:E,labelFill:x.labelColor}),y){var W=t.SelectionId.createWithHighlight(F),K=U.highlights[0];s.push({label:d[O].displayName,value:H,originalValue:H,categoryOrMeasureIndex:O,identity:W,key:W.getKey(),selected:!1,highlight:!0,originalHighlightValue:K,highlightValue:K,tooltipInfo:G,color:E}),f=K}m=H}}for(var O=0;O<s.length;O+=y?2:1){var X=s[O];S.push(X.label)}C=s.length>0&&_.every(s,function(e){return(e.highlight?e.highlightValue<=0:!0)&&e.value<0});for(var Y=0,q=s;Y<q.length;Y++){var X=q[Y];if(C)X.value=Math.abs(X.value),X.highlight&&(X.highlightValue=Math.abs(X.highlightValue));else{var H=X.value,$=0>H;$&&(X.value=0);var Q=!1;if(X.highlight){var j=X.highlightValue;Q=0>j,X.highlightValue=Q?0:j}b||(b=$||Q)}X.highlightValue>X.value&&(v=!0)}return{slices:s,categoryLabels:S,valuesMetadata:d,hasHighlights:y,highlightsOverflow:v,canShowDataLabels:!0,dataLabelsSettings:x,hasNegativeValues:b,allValuesAreNegative:C,percentBarLabelSettings:w}},o.prototype.enumerateObjectInstances=function(e){var i=new t.ObjectEnumerationBuilder;switch(e.objectName){case"dataPoint":var a=this.dataViews&&this.dataViews.length>0&&this.dataViews[0]&&this.dataViews[0].categorical,r=t.GradientUtils.hasGradientRole(a);r||this.enumerateDataPoints(i);break;case"labels":var n=o.getLabelSettingsOptions(i,this.data.dataLabelsSettings,!0,this.labelPositionObjects);t.dataLabelUtils.enumerateDataLabels(n);break;case"percentBarLabel":var s=o.getLabelSettingsOptions(i,this.data.percentBarLabelSettings,!1);t.dataLabelUtils.enumerateDataLabels(s)}return i.complete()},o.getLabelSettingsOptions=function(e,t,i,a){return{enumeration:e,dataLabelsSettings:t,show:!0,displayUnits:i,precision:i,position:i,positionObject:a,fontSize:!0}},o.prototype.enumerateDataPoints=function(e){var i=this.data;if(i){var a=i.slices;e.pushInstance({objectName:"dataPoint",selector:null,properties:{defaultColor:{solid:{color:this.defaultDataPointColor||this.colors.getColorByIndex(0).value}}}});for(var r=0;r<a.length;r++){var o=a[r];if(!o.highlight){var n=o.color,s=o.identity.getSelector(),l=!!s.data;e.pushInstance({objectName:"dataPoint",displayName:o.label,selector:t.ColorHelper.normalizeSelector(s,l),properties:{fill:{solid:{color:n}}}})}}}},o.prototype.init=function(e){this.options=e;var i=e.element,a=this.svg=d3.select(i.get(0)).append("svg").classed(o.VisualClassName,!0);this.behavior&&(this.clearCatcher=t.appendClearCatcher(this.svg)),this.currentViewport=e.viewport,this.margin={left:5,right:5,top:0,bottom:0};var r=e.style;this.colors=r.colorPalette.dataColors,this.hostServices=e.host,this.behavior&&(this.interactivityService=t.createInteractivityService(this.hostServices)),this.percentGraphicsContext=a.append("g").classed(o.Selectors.percentBar.root["class"],!0),this.funnelGraphicsContext=a.append("g"),this.axisGraphicsContext=a.append("g"),this.updateViewportProperties()},o.prototype.updateViewportProperties=function(){var e=this.currentViewport;this.svg.attr("width",e.width).attr("height",e.height)},o.prototype.update=function(i){this.data={slices:[],categoryLabels:[],valuesMetadata:[],hasHighlights:!1,highlightsOverflow:!1,canShowDataLabels:!0,dataLabelsSettings:t.dataLabelUtils.getDefaultFunnelLabelSettings(),hasNegativeValues:!1,allValuesAreNegative:!1,percentBarLabelSettings:t.dataLabelUtils.getDefaultLabelSettings(!0)};var a=this.dataViews=i.dataViews;if(this.currentViewport=i.viewport,a&&a.length>0){var r=a[0];if(r.metadata&&r.metadata.objects){var n=e.DataViewObjects.getFillColor(r.metadata.objects,t.funnelChartProps.dataPoint.defaultColor);n&&(this.defaultDataPointColor=n)}r.categorical&&(this.data=o.converter(r,this.colors,this.hostServices,this.defaultDataPointColor,this.tooltipsEnabled),this.interactivityService&&this.interactivityService.applySelectionStateToData(this.data.slices));var s=t.getInvalidValueWarnings(a,!1,!1,!1);this.data.allValuesAreNegative?s.unshift(new t.AllNegativeValuesWarning):this.data.hasNegativeValues&&s.unshift(new t.NegativeValuesNotSupportedWarning),this.hostServices.setWarnings(s)}this.updateViewportProperties(),this.updateInternal(i.suppressAnimations)},o.prototype.onDataChanged=function(e){this.update({
21dataViews:e.dataViews,suppressAnimations:e.suppressAnimations,viewport:this.currentViewport})},o.prototype.onResizing=function(e){this.currentViewport=e,this.update({dataViews:this.dataViews,suppressAnimations:!0,viewport:this.currentViewport})},o.prototype.getMaxLabelLength=function(t,i){for(var a=0,r=e.TextMeasurementService.measureSvgTextWidth,n=0,s=t.length;s>n;n++)i.text=t[n],a=Math.max(a,r(i));return a+o.LabelFunnelPadding},o.prototype.updateInternal=function(e){if(null!=this.data){var i=this.data,a=i.slices,r=a.filter(function(e){return!e.highlight}),n=this.isHidingPercentBars(),s=this.setUpAxis(),l=s.margin,c=this.funnelGraphicsContext.attr("transform",t.SVGUtil.translate(l.left,l.top));this.percentGraphicsContext.attr("transform",t.SVGUtil.translate(l.left,l.top)),this.svg.style("font-family",t.dataLabelUtils.StandardFontFamily);var u,h,d,p=o.getLayout(i,s),g=t.dataLabelUtils.getFunnelChartLabelLayout(i,s,o.InnerTextMinimumPadding,i.dataLabelsSettings,this.currentViewport);if(this.animator&&!e){var m={viewModel:i,interactivityService:this.interactivityService,layout:p,axisGraphicsContext:this.axisGraphicsContext,shapeGraphicsContext:c,percentGraphicsContext:this.percentGraphicsContext,labelGraphicsContext:this.svg,axisOptions:s,slicesWithoutHighlights:r,labelLayout:g,isHidingPercentBars:n,visualInitOptions:this.options};u=this.animator.animate(m),h=u.shapes,d=u.dataLabels}if((!this.animator||e||u.failed)&&(o.drawDefaultAxis(this.axisGraphicsContext,s,n),h=o.drawDefaultShapes(i,a,c,p,this.interactivityService&&this.interactivityService.hasSelection()),o.drawPercentBars(i,this.percentGraphicsContext,p,n),i.dataLabelsSettings.show&&i.canShowDataLabels?d=t.dataLabelUtils.drawDefaultLabelsForFunnelChart(i.slices,this.svg,g):t.dataLabelUtils.cleanDataLabels(this.svg)),this.interactivityService){var f=o.drawInteractorShapes(a,c,p),y={bars:h,interactors:f,clearCatcher:this.clearCatcher,hasHighlights:i.hasHighlights};this.interactivityService.bind(a,this.behavior,y),this.tooltipsEnabled&&t.TooltipManager.addTooltip(f,function(e){return e.data.tooltipInfo})}this.tooltipsEnabled&&t.TooltipManager.addTooltip(h,function(e){return e.data.tooltipInfo}),t.SVGUtil.flushAllD3TransitionsIfNeeded(this.options)}},o.prototype.getUsableVerticalSpace=function(){var e=this.data.categoryLabels,t=this.margin,i=this.currentViewport.height-(t.top+t.bottom);return i-o.MinBarThickness*e.length},o.prototype.isHidingPercentBars=function(){var e=this.data;if(e.percentBarLabelSettings.show){var t=this.getPercentBarTextHeight(),i=this.getUsableVerticalSpace()-2*o.MinBarThickness*o.PercentBarToBarRatio-2*t;return 0>=i}return!0},o.prototype.isSparklines=function(){return this.getUsableVerticalSpace()<=0},o.prototype.setUpAxis=function(){var e=this.data,t=e.slices,i=e.categoryLabels,a=this.currentViewport,r=this.margin,n=this.isSparklines(),s=this.isHidingPercentBars(),l=s?0:this.getPercentBarTextHeight(),c=a.height-(r.top+r.bottom)-2*l,u=o.MaxMarginFactor;if(i.length>0&&n)i=[],e.canShowDataLabels=!1;else if(this.showCategoryLabels()){var h=o.getTextProperties(),d=this.getMaxLabelLength(i,h),p=a.width*u,g=Math.min(d,p);r.left=g+o.YAxisPadding}else i=[];var m=a.width-(r.left+r.right),f=o.BarToSpaceRatio,y=d3.max(t.map(function(e){return e.value}));if(e.hasHighlights){var v=d3.max(t.map(function(e){return e.highlightValue}));y=d3.max([y,v])}var b,C=0,S=0,x=c;b=s?c-i.length*o.MaxBarHeight:c-i.length*o.MaxBarHeight-2*o.MaxBarHeight*o.PercentBarToBarRatio,i.length>0&&b>0&&(S=Math.ceil(b/2),x=Math.ceil(c-b/2)),s||(S+=l,x+=l);var w=d3.scale.linear().domain([C,y]).range([m,0]),P=d3.scale.ordinal().domain(d3.range(0,e.categoryLabels.length)).rangeBands([S,x],f,s?f:o.PercentBarToBarRatio);return{margin:r,valueScale:w,categoryScale:P,maxScore:y,maxWidth:m,rangeStart:S,rangeEnd:x,barToSpaceRatio:f,categoryLabels:i}},o.prototype.getPercentBarTextHeight=function(){var t=o.getTextProperties(this.data.percentBarLabelSettings.fontSize);return e.TextMeasurementService.estimateSvgTextHeight(t)},o.prototype.onClearSelection=function(){this.interactivityService&&this.interactivityService.clearSelection()},o.getLayout=function(i,r){var n=i.highlightsOverflow,s=r.categoryScale,l=r.valueScale,c=r.maxScore,u=s.rangeBand(),h=Math.ceil(u/2),d=u*o.OverflowingHighlightWidthRatio,p=d/2,g=r.categoryLabels.length-1,m=Math.abs(l(c)-l(0)),f=function(e){return(m-Math.abs(l(e)-l(0)))/2},y=function(e){return Math.max(o.MinimumInteractorSize,Math.abs(l(e)-l(0)))},v=a.fromPoint(i.percentBarLabelSettings.fontSize),b=o.getTextProperties(i.percentBarLabelSettings.fontSize),C=e.TextMeasurementService.estimateSvgTextBaselineDelta(b),S=e.TextMeasurementService.estimateSvgTextHeight(b)-C;return{percentBarLayout:{mainLine:{x2:function(e){return Math.abs(l(e.value)-l(0))},transform:function(e){var i=l(e.value)-f(e.value),a=e.isTop?s(0)-h:s(g)+u+h;return t.SVGUtil.translate(i,a)}},leftTick:{y2:function(e){return h},transform:function(e){var i=l(e.value)-f(e.value),a=e.isTop?s(0)-h-h/2:s(g)+u+h-h/2;return t.SVGUtil.translate(i,a)}},rightTick:{y2:function(e){return h},transform:function(e){var i=l(e.value)-f(e.value),a=Math.abs(l(e.value)-l(0)),r=i+a,o=e.isTop?s(0)-h-h/2:s(g)+u+h-h/2;return t.SVGUtil.translate(r,o)}},text:{x:function(e){return Math.ceil(Math.abs(l(c)-l(0))/2)},y:function(e){return e.isTop?-h/2-C:S+h/2},style:function(){return"font-size: "+v+";"},transform:function(e){var i=e.isTop?s(0)-h:s(g)+u+h;return t.SVGUtil.translate(0,i)},fill:i.percentBarLabelSettings.labelColor,maxWidth:m}},shapeLayout:{height:function(e){return e.highlight&&n?d:u},width:function(e){return Math.abs(l(o.getFunnelSliceValue(e))-l(0))},y:function(e){return s(e.categoryOrMeasureIndex)+(e.highlight&&n?p:0)},x:function(e){var t=o.getFunnelSliceValue(e);return l(t)-f(t)}},shapeLayoutWithoutHighlights:{height:function(e){return u},width:function(e){return Math.abs(l(e.value)-l(0))},y:function(e){return s(e.categoryOrMeasureIndex)+0},x:function(e){return l(e.value)-f(e.value)}},zeroShapeLayout:{height:function(e){return e.highlight&&n?d:u},width:function(e){return 0},y:function(e){return s(e.categoryOrMeasureIndex)+(e.highlight&&n?p:0)},x:function(e){return l((l.domain()[0]+l.domain()[1])/2)}},interactorLayout:{height:function(e){return e.highlight&&n?d:u},width:function(e){return y(o.getFunnelSliceValue(e))},y:function(e){return s(e.categoryOrMeasureIndex)+(e.highlight&&n?p:0)},x:function(e){var t=y(o.getFunnelSliceValue(e));return(m-t)/2}}}},o.drawDefaultAxis=function(i,a,r){var n=d3.range(0,a.categoryLabels.length),s=d3.scale.ordinal().domain(n).rangeBands([a.rangeStart,a.rangeEnd],a.barToSpaceRatio,r?a.barToSpaceRatio:o.PercentBarToBarRatio),l=d3.svg.axis().scale(s).orient("right").tickPadding(o.TickPadding).innerTickSize(o.InnerTickSize).ticks(n.length).tickValues(n).tickFormat(function(e){return a.categoryLabels[e]});i.attr("class","axis hideLinesOnAxis").attr("transform",t.SVGUtil.translate(0,a.margin.top)).call(l),i.selectAll(".tick").call(t.tooltipUtils.tooltipUpdate,a.categoryLabels);var c=a.margin.left-o.LabelFunnelPadding;i.selectAll(".tick text").call(t.AxisHelper.LabelLayoutStrategy.clip,c,e.TextMeasurementService.svgEllipsis)},o.drawDefaultShapes=function(e,i,a,r,n){var s=e.hasHighlights,l=a.selectAll(o.Selectors.funnel.bars.selector).data(i,function(e){return e.key});return l.enter().append("rect").attr("class",function(e){return e.highlight?o.FunnelBarHighlightClass:o.Selectors.funnel.bars["class"]}),l.style("fill",function(e){return e.color}).style("fill-opacity",function(e){return function(e){return t.ColumnUtil.getFillOpacity(e.selected,e.highlight,n,s)}}).attr(r.shapeLayout),l.exit().remove(),l},o.getFunnelSliceValue=function(e,t){return void 0===t&&(t=!1),t?e.highlight?e.originalHighlightValue:e.originalValue:e.highlight?e.highlightValue:e.value},o.drawInteractorShapes=function(e,t,i){var a=e.filter(function(e){return!e.highlight&&i.interactorLayout.width(e)===o.MinimumInteractorSize}),r=t.selectAll(o.Selectors.funnel.interactors.selector).data(a,function(e){return e.key});return r.enter().append("rect").attr("class",o.Selectors.funnel.interactors["class"]),r.style("fill-opacity",0).attr(i.interactorLayout),r.exit().remove(),r},o.drawPercentBarComponents=function(i,a,r,n){var s=i.selectAll(o.Selectors.percentBar.mainLine.selector).data(a);s.exit().remove(),s.enter().append("line").classed(o.Selectors.percentBar.mainLine["class"],!0),s.attr(r.percentBarLayout.mainLine);var l=i.selectAll(o.Selectors.percentBar.leftTick.selector).data(a);l.exit().remove(),l.enter().append("line").classed(o.Selectors.percentBar.leftTick["class"],!0),l.attr(r.percentBarLayout.leftTick);var c=i.selectAll(o.Selectors.percentBar.rightTick.selector).data(a);c.exit().remove(),c.enter().append("line").classed(o.Selectors.percentBar.rightTick["class"],!0),c.attr(r.percentBarLayout.rightTick);var u=i.selectAll(o.Selectors.percentBar.text.selector).data(a),h=t.valueFormatter.getLocalizedString("Percentage1");u.exit().remove(),u.enter().append("text").classed(o.Selectors.percentBar.text["class"],!0),u.attr(r.percentBarLayout.text).text(function(e){return t.dataLabelUtils.getLabelFormattedText({label:e.percent,format:h,fontSize:n.fontSize,maxWidth:r.percentBarLayout.text.maxWidth})}).append("title").text(function(t){return e.formattingService.formatValue(t.percent,h)})},o.drawPercentBars=function(e,t,i,a){if(a||!e.slices||(e.hasHighlights?e.slices.length/2:e.slices.length)<2)return void o.drawPercentBarComponents(t,[],i,e.percentBarLabelSettings);var r=[e.slices[e.hasHighlights?1:0],e.slices[e.slices.length-1]],n=o.getFunnelSliceValue(r[0]);if(0>=n)return void o.drawPercentBarComponents(t,[],i,e.percentBarLabelSettings);var s=[{value:o.getFunnelSliceValue(r[0]),percent:1,isTop:!0},{value:o.getFunnelSliceValue(r[1]),percent:o.getFunnelSliceValue(r[1])/n,isTop:!1}];o.drawPercentBarComponents(t,s,i,e.percentBarLabelSettings)},o.prototype.showCategoryLabels=function(){return!(this.funnelSmallViewPortProperties&&this.funnelSmallViewPortProperties.hideFunnelCategoryLabelsOnSmallViewPort&&this.currentViewport.height<this.funnelSmallViewPortProperties.minHeightFunnelCategoryLabelsVisible)},o.addFunnelPercentsToTooltip=function(e,i,a,r,o,n){null!=r&&i.push({displayName:a.getLocalizedString("Funnel_PercentOfFirst"+(n?"_Highlight":"")),value:t.valueFormatter.format(r,e)}),null!=o&&i.push({displayName:a.getLocalizedString("Funnel_PercentOfPrevious"+(n?"_Highlight":"")),value:t.valueFormatter.format(o,e)})},o.getTextProperties=function(e){return{fontSize:a.fromPoint(e||t.dataLabelUtils.DefaultFontSizeInPt),fontFamily:o.DefaultFontFamily}},o.DefaultBarOpacity=1,o.DimmedBarOpacity=.4,o.PercentBarToBarRatio=.75,o.TickPadding=0,o.InnerTickSize=0,o.MinimumInteractorSize=15,o.InnerTextClassName="labelSeries",o.Selectors={funnel:{bars:i("funnelBar"),highlights:i("highlight"),interactors:i("funnelBarInteractor")},percentBar:{root:i("percentBars"),mainLine:i("mainLine"),leftTick:i("leftTick"),rightTick:i("rightTick"),text:i("value")}},o.FunnelBarHighlightClass=[o.Selectors.funnel.bars["class"],o.Selectors.funnel.highlights["class"]].join(" "),o.YAxisPadding=10,o.VisualClassName="funnelChart",o.DefaultFontFamily="wf_standard-font",o.BarToSpaceRatio=.1,o.MaxBarHeight=40,o.MinBarThickness=12,o.LabelFunnelPadding=6,o.InnerTextMinimumPadding=10,o.OverflowingHighlightWidthRatio=.5,o.MaxMarginFactor=.25,o}();t.FunnelChart=o}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.CssConstants.createClassAndSelector,a=jsCommon.PixelConverter,r=e.data.DataRoleHelper,o=function(){function o(e){this.lastAngle=-Math.PI/2,e&&(e.gaugeSmallViewPortProperties&&(this.gaugeSmallViewPortProperties=e.gaugeSmallViewPortProperties),this.animator=e.animator,this.tooltipsEnabled=e.tooltipsEnabled)}return o.prototype.enumerateObjectInstances=function(e){var i=new t.ObjectEnumerationBuilder;switch(e.objectName){case"axis":this.enumerateAxis(i);break;case"labels":var a=this.data?this.data.dataLabelsSettings:t.dataLabelUtils.getDefaultGaugeLabelSettings();t.dataLabelUtils.enumerateDataLabels(this.getDataLabelSettingsOptions(i,a));break;case"calloutValue":var a=this.data?this.data.calloutValueLabelsSettings:t.dataLabelUtils.getDefaultGaugeLabelSettings();t.dataLabelUtils.enumerateDataLabels(this.getDataLabelSettingsOptions(i,a));break;case"dataPoint":this.enumerateDataPoint(i)}return i.complete()},o.prototype.getDataLabelSettingsOptions=function(e,t){return{dataLabelsSettings:t,show:!0,precision:!0,displayUnits:!0,fontSize:!0,enumeration:e}},o.prototype.enumerateAxis=function(e){var t=this.dataViews[0];if(t&&t.metadata){var i=o.getGaugeObjectsProperties(t);e.pushInstance({selector:null,objectName:"axis",properties:i})}},o.prototype.enumerateDataPoint=function(e){var i=this.data?this.data.dataPointSettings:o.DefaultDataPointSettings,a={};a.fill={solid:{color:i.fillColor}},null!=i.targetColor&&(a.target={solid:{color:i.targetColor}}),e.pushInstance({selector:null,objectName:t.gaugeProps.dataPoint.target.objectName,properties:a})},o.getGaugeObjectsProperties=function(e){var i={},a=e.metadata.objects,o=!!a&&!!a.axis;return r.hasRoleInDataView(e,t.gaugeRoleNames.minValue)||(i.min=o?a.axis.min:void 0),r.hasRoleInDataView(e,t.gaugeRoleNames.maxValue)||(i.max=o?a.axis.max:void 0),r.hasRoleInDataView(e,t.gaugeRoleNames.targetValue)||(i.target=o?a.axis.target:void 0),i},o.prototype.init=function(e){this.element=e.element,this.currentViewport=e.viewport,this.style=e.style,this.options=e,this.settings=o.DefaultStyleProperties,this.targetSettings=o.DefaultTargetSettings,this.setMargins(),this.color=d3.scale.ordinal().range(this.style.colorPalette.dataColors.getSentimentColors().map(function(e){return e.value})),this.hostService=e.host;var i=this.svg=d3.select(this.element.get(0)).append("svg");i.classed(o.VisualClassName,!0);var a=this.mainGraphicsContext=i.append("g");a.attr("class",o.MainGaugeGroupClassName),this.initKpiBands();var r=this.backgroundArc=d3.svg.arc().innerRadius(0).outerRadius(0).startAngle(-Math.PI/2).endAngle(Math.PI/2),n=this.foregroundArc=d3.svg.arc().innerRadius(0).outerRadius(0).startAngle(-Math.PI/2);this.backgroundArcPath=a.append("path").classed("backgroundArc",!0).attr("d",r),this.foregroundArcPath=a.append("path").datum({endAngle:-Math.PI/2}).classed("foregroundArc",!0).attr("d",n);var s=this.animatedNumberGrapicsContext=i.append("g");this.animatedNumber=new t.AnimatedNumber(s),this.animatedNumber.init(e);var l=this.gaugeVisualProperties=this.getGaugeVisualProperties(),c=this.getAnimatedNumberProperties(l.radius,l.innerRadiusFactor,l.top,l.left);this.animatedNumberGrapicsContext.attr("transform",c.transformString),this.animatedNumber.onResizing(c.viewport)},o.prototype.update=function(e){this.currentViewport=e.viewport;var i=this.dataViews=e.dataViews;if(i&&i[0]){this.data=o.converter(i[0],this.tooltipsEnabled),this.targetSettings=this.data.targetSettings,i[0]&&(i[0].single={value:this.data.total}),this.showTargetLabel=null!=this.targetSettings.target&&(this.currentViewport.width>o.MinWidthForTargetLabel||!this.showMinMaxLabelsOnBottom())&&this.showSideNumbersLabelText()&&this.data.dataLabelsSettings.show,this.setMargins(),this.gaugeVisualProperties=this.getGaugeVisualProperties(),this.drawViewPort(this.gaugeVisualProperties),this.updateInternal(e.suppressAnimations),this.updateCalloutValue(e.suppressAnimations);var a=t.getInvalidValueWarnings(i,!1,!1,!1);this.hostService.setWarnings(a)}},o.prototype.updateCalloutValue=function(e){if(this.data.calloutValueLabelsSettings.show){var t=this.getAnimatedNumberProperties(this.gaugeVisualProperties.radius,this.gaugeVisualProperties.innerRadiusFactor,this.gaugeVisualProperties.top,this.gaugeVisualProperties.left);this.animatedNumberGrapicsContext.attr("transform",t.transformString),this.animatedNumber.setTextColor(this.data.calloutValueLabelsSettings.labelColor);var i=this.data?this.data.total:null,a=this.getFormatter(this.data.calloutValueLabelsSettings,i);this.animatedNumber.setFormatter(a),this.animatedNumber.update({viewport:t.viewport,dataViews:this.dataViews,suppressAnimations:e}),this.animatedNumberGrapicsContext.selectAll("title").remove(),this.animatedNumberGrapicsContext.append("title").text([a.format(i)])}else this.animatedNumber.clear(),this.animatedNumberGrapicsContext.selectAll("title").remove()},o.prototype.onDataChanged=function(e){this.update({dataViews:e.dataViews,suppressAnimations:e.suppressAnimations,viewport:this.currentViewport})},o.prototype.onResizing=function(e){this.update({dataViews:this.dataViews,suppressAnimations:!0,viewMode:0,viewport:e})},o.getValidSettings=function(e){var t=e.max===o.MAX_VALUE?o.DEFAULT_MAX:e.max,i=e.min===o.MIN_VALUE?o.DEFAULT_MIN:e.min,a=e.target;return{min:i,max:t,target:a}},o.getGaugeData=function(e){var i={max:o.MAX_VALUE,min:o.MIN_VALUE,target:void 0,total:0,tooltipItems:[]};if(e&&e.categorical&&e.categorical.values&&e.metadata&&e.metadata.columns){for(var a=e.categorical.values,r=e.metadata.columns,n=0;n<a.length;n++){var s=r[n],l=a[n].values[0]||0;s&&s.roles&&(s.roles[t.gaugeRoleNames.y]?(i.total=l,l&&i.tooltipItems.push({displayName:a[n].source.displayName,value:t.converterHelper.formatFromMetadataColumn(l,a[n].source,o.formatStringProp)})):s.roles[t.gaugeRoleNames.minValue]?i.min=l:s.roles[t.gaugeRoleNames.maxValue]?i.max=l:s.roles[t.gaugeRoleNames.targetValue]&&(i.target=l,l&&i.tooltipItems.push({displayName:a[n].source.displayName,value:t.converterHelper.formatFromMetadataColumn(l,a[n].source,o.formatStringProp)})))}var c=o.getGaugeObjectsProperties(e);c&&!$.isEmptyObject(c)&&o.overrideGaugeSettings(i,c)}else i.tooltipItems=void 0;return i},o.overrideGaugeSettings=function(e,t){$.isNumeric(t.min)&&(e.min=t.min),$.isNumeric(t.max)&&(e.max=t.max),$.isNumeric(t.target)&&(e.target=t.target)},o.converter=function(e,i){void 0===i&&(i=!0);var a=o.getGaugeData(e),r=a.total,n=null,s=!1;e.metadata&&!_.isEmpty(e.metadata.columns)&&(n=t.valueFormatter.getFormatString(e.metadata.columns[0],o.formatStringProp,!0),null!=n&&(s=t.valueFormatter.getFormatMetadata(n).hasPercent)),r>0&&a.max===o.MAX_VALUE&&(a.max=s?o.DEFAULT_MAX:2*r);var l=o.getValidSettings(a),c=Math.max(r,l.min);c=Math.min(c,l.max);var u,h=l.min!==l.max?(c-l.min)/(l.max-l.min):0;return i&&e&&null!=a.tooltipItems&&(u=a.tooltipItems),{percent:h,adjustedTotal:c,total:r,metadataColumn:o.getMetaDataColumn(e),targetSettings:l,tooltipInfo:u,dataLabelsSettings:o.convertDataLabelSettings(e,"labels"),calloutValueLabelsSettings:o.convertDataLabelSettings(e,"calloutValue"),dataPointSettings:o.convertDataPointSettings(e,l)}},o.convertDataLabelSettings=function(e,i){var a=e.metadata,r=t.dataLabelUtils.getDefaultGaugeLabelSettings();if(a){var o=a.objects;if(o){var n=o[i];t.dataLabelUtils.updateLabelSettingsFromLabelsObject(n,r)}}return r},o.convertDataPointSettings=function(i,a){var r,n=o.DefaultDataPointSettings.fillColor;if(i&&i.metadata&&i.metadata.objects){var s=i.metadata.objects;n=e.DataViewObjects.getFillColor(s,t.gaugeProps.dataPoint.fill,o.DefaultDataPointSettings.fillColor),a&&null!=a.target&&(r=e.DataViewObjects.getFillColor(s,t.gaugeProps.dataPoint.target,o.DefaultDataPointSettings.targetColor))}else a&&null!=a.target&&(r=o.DefaultDataPointSettings.targetColor);return{fillColor:n,targetColor:r}},o.getMetaDataColumn=function(e){if(e&&e.metadata&&e.metadata.columns)for(var t=0,i=e.metadata.columns.length;i>t;t++){var a=e.metadata.columns[t];if(a.isMeasure)return a}return null},o.prototype.initKpiBands=function(){if(this.settings.kpiBands.show)for(var e=this.kpiArcs=[],t=this.kpiArcPaths=[],i=this.mainGraphicsContext,a=0;3>a;a++){var r=d3.svg.arc().innerRadius(0).outerRadius(0).startAngle(0).endAngle(0);e.push(r);var o=i.append("path").attr("d",r);t.push(o)}},o.prototype.updateKpiBands=function(e,t,i,a){if(this.settings.kpiBands.show)for(var r=0;r<a.length;r++)this.kpiArcs[r].innerRadius(e*t-(o.KpiBandDistanceFromMainArc+this.settings.kpiBands.thickness)).outerRadius(e*t-o.KpiBandDistanceFromMainArc).startAngle(a[r].start).endAngle(a[r].end),this.kpiArcPaths[r].attr("fill",a[r].fill).attr("d",this.kpiArcs[r]).attr("transform",i)},o.prototype.removeTargetElements=function(){this.targetLine&&(this.targetLine.remove(),this.targetText.remove(),this.targetConnector.remove(),this.targetLine=this.targetConnector=this.targetText=null)},o.prototype.getTargetRatio=function(){var e=this.targetSettings,t=e.max-e.min;return 0!==t?(e.target-e.min)/t:0},o.prototype.updateTargetLine=function(e,t,i,a){this.targetLine||(this.targetLine=this.mainGraphicsContext.append("line"));var r=this.getTargetRatio()*Math.PI,o=a-e*Math.sin(r),n=i-e*Math.cos(r),s=a-t*Math.sin(r),l=i-t*Math.cos(r);this.targetLine.attr({x1:l,y1:s,x2:n,y2:o})},o.prototype.getAnimatedNumberProperties=function(e,i,a,r){var n=Math.PI/4,s=1,l=e*i,c=l-(this.settings.kpiBands.show?o.KpiBandDistanceFromMainArc+this.settings.kpiBands.thickness:0),u=c*Math.cos(n),h=c*Math.sin(n),d=a-h,p=r-u;d*=s,p*=s;var g=2*u,m={transformString:t.SVGUtil.translate(p,d),viewport:{height:h,width:g}};return m},o.prototype.getGaugeVisualProperties=function(){var e=this.currentViewport,i=this.margin,a=e.width-i.right-i.left,r=a/2,n=e.height-i.top-i.bottom,s=Math.min(r,n),l=o.InnerRadiusFactor,c=i.left+r,u=s+(n-s)/2+i.top,h=t.SVGUtil.translate(c,u),d=s*l,p={radius:s,innerRadiusOfArc:d,left:c,top:u,height:n,width:a,margin:i,transformString:h,innerRadiusFactor:l};return p},o.prototype.drawViewPort=function(e){var t=this.settings.kpiBands.separationRadians,i=o.InnerRadiusFactor,a=this.backgroundArc,r=this.color,n=[{fill:r(0),start:-Math.PI/2,end:-Math.PI/2+Math.PI/4-t},{fill:r(1),start:-Math.PI/2+1*Math.PI/4+t,end:-Math.PI/2+3*Math.PI/4-t},{fill:r(2),start:-Math.PI/2+3*Math.PI/4+t,end:Math.PI/2}],s=e.radius,l=e.transformString;this.updateKpiBands(s,i,l,n),a.innerRadius(s*i).outerRadius(s).startAngle(-Math.PI/2).endAngle(Math.PI/2),this.backgroundArcPath.attr("d",a).attr("transform",l);var c=this.foregroundArc;c.innerRadius(s*i).outerRadius(s).startAngle(-Math.PI/2),this.foregroundArcPath.datum({endAngle:this.lastAngle}).attr("transform",l).attr("d",c);var u=e.innerRadiusOfArc,h=e.left,d=e.top,p=e.margin,g=e.height,m=this.targetSettings;this.settings.targetLine.show&&null!=m.target?m.min>m.target||m.max<m.target?this.removeTargetElements():(this.updateTargetLine(s,u,h,d),this.appendTargetTextAlongArc(s,g,e.width,p)):this.removeTargetElements(),this.svg.attr("height",this.currentViewport.height).attr("width",this.currentViewport.width)},o.prototype.createTicks=function(){for(var e=this.settings,t=this.targetSettings,i=t.max-t.min,a=e.labels.count,r=i/a,o=[],n=this.getFormatter(this.data.dataLabelsSettings,t.max),s=0;a+1>s;s++)o.push(n.format(t.min+s*r));return o},o.prototype.updateInternal=function(e){var i=this.gaugeVisualProperties.height,a=this.gaugeVisualProperties.width,r=this.gaugeVisualProperties.radius,o=this.margin,n=t.AnimatorCommon.GetAnimationDuration(this.animator,e),s=this.data,l=this.lastAngle=-Math.PI/2+Math.PI*s.percent,c=this.createTicks();this.foregroundArcPath.transition().ease(this.settings.transition.ease).duration(n).call(this.arcTween,[l,this.foregroundArc]),this.appendTextAlongArc(c,r,i,a,o),this.updateVisualConfigurations(),this.updateVisualStyles(),this.tooltipsEnabled&&(t.TooltipManager.addTooltip(this.foregroundArcPath,function(e){return s.tooltipInfo}),t.TooltipManager.addTooltip(this.backgroundArcPath,function(e){return s.tooltipInfo}))},o.prototype.updateVisualStyles=function(){var e=this.data.dataLabelsSettings.labelColor||this.style.labelText.color.value;this.mainGraphicsContext.selectAll("text").style({fill:e})},o.prototype.updateVisualConfigurations=function(){var e=this.settings,t=this.data.dataPointSettings;this.mainGraphicsContext.select("line").attr({stroke:t.targetColor,"stroke-width":e.targetLine.thickness}),this.backgroundArcPath.style("fill",e.arcColors.background),this.foregroundArcPath.style("fill",t.fillColor)},o.prototype.appendTextAlongArc=function(i,r,n,s,l){if(this.svg.selectAll(o.LabelText.selector).remove(),this.data.dataLabelsSettings.show)for(var c=i.length,u=c-1,h=r+(n-r)/2+l.top,d=this.showMinMaxLabelsOnBottom(),p=a.fromPoint(this.data.dataLabelsSettings.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt),g=this.settings.labels.padding,m=0;c>m;m++){var f={text:i[m],fontFamily:t.dataLabelUtils.LabelTextProperties.fontFamily,fontSize:t.dataLabelUtils.LabelTextProperties.fontSize,fontWeight:t.dataLabelUtils.LabelTextProperties.fontWeight};if(Math.floor(c/2)!==m&&this.showSideNumbersLabelText()){var y=l.left+s/2-r*Math.cos(Math.PI*m/u),v=h-r*Math.sin(Math.PI*m/u),b=void 0,C=2*m>c,S=!1;!d||0!==m&&m!==c-1?(b=C?"start":"end",y+=g*(C?1:-1)):(S=!0,v+=g/2,b=C?"end":"start",f.text=e.TextMeasurementService.getTailoredTextOrDefault(f,r));var x=this.mainGraphicsContext.append("text").attr({x:y,y:v,dy:S?p:0,"class":o.LabelText["class"]}).style({"text-anchor":b,"font-size":p}).text(f.text).append("title").text(f.text);S||this.truncateTextIfNeeded(x,y,C)}}},o.prototype.truncateTextIfNeeded=function(i,a,r){var o=r?this.currentViewport.width-a:a;i.call(t.AxisHelper.LabelLayoutStrategy.clip,o,e.TextMeasurementService.svgEllipsis)},o.prototype.getFormatter=function(e,i){var a=0===e.displayUnits?i:null,r=t.valueFormatter.getFormatString(this.data.metadataColumn,o.formatStringProp),n=t.dataLabelUtils.getLabelPrecision(e.precision,r),s=t.dataLabelUtils.getOptionsForLabelFormatter(e,r,a,n);return s.formatSingleValues=!(e.displayUnits>0),t.valueFormatter.create(s)},o.prototype.appendTargetTextAlongArc=function(e,i,a,r){var n=this.targetSettings,s=n.target,l=this.getTargetRatio(),c=e+(i-e)/2+r.top,u=l>.5,h=this.settings.labels.padding,d=u?"start":"end",p=this.getFormatter(this.data.dataLabelsSettings,n.max),g=Math.asin(o.MinDistanceFromBottom/e)/Math.PI,m=g>l||l>1-g?u?1-g:g:l,f=r.left+a/2-(e+h)*Math.cos(Math.PI*m),y=c-(e+h)*Math.sin(Math.PI*m);this.targetText||(this.targetText=this.mainGraphicsContext.append("text").classed(o.TargetText["class"],!0)),this.targetText.attr({x:f,y:y}).style({"text-anchor":d,display:this.showTargetLabel?"":"none","font-size":this.style.labelText.fontSize}).text(p.format(s)),this.truncateTextIfNeeded(this.targetText,f,u),this.targetText.call(t.tooltipUtils.tooltipUpdate,[p.format(s)]),this.targetConnector||(this.targetConnector=this.mainGraphicsContext.append("line").classed(o.TargetConnector["class"],!0)),l===m?this.targetConnector.style("display","none"):this.targetConnector.attr({x1:r.left+a/2-e*Math.cos(Math.PI*l),y1:c-e*Math.sin(Math.PI*l),x2:f,y2:y}).style({"stroke-width":this.settings.targetLine.thickness,stroke:this.settings.targetLine.color,display:""})},o.prototype.arcTween=function(e,t){e.attrTween("d",function(e){var i=d3.interpolate(e.endAngle,t[0]);return function(a){return e.endAngle=i(a),t[1](e)}})},o.prototype.showMinMaxLabelsOnBottom=function(){if(this.currentViewport.height>this.currentViewport.width)return!0;if(this.data&&this.gaugeVisualProperties){var i=this.createTicks(),r=(this.currentViewport.width-2*this.gaugeVisualProperties.radius)/2,o=r-this.settings.labels.padding,n=e.TextMeasurementService.getMeasurementProperties($(this.svg.node()));n.fontSize=a.fromPoint(this.data.dataLabelsSettings.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt);for(var s=void 0,l=0,c=[i[0],i[i.length-1]];l<c.length;l++){var u=c[l];if(n.text=u,s=e.TextMeasurementService.measureSvgTextWidth(n),s>o)return!0}}return!1},o.prototype.setMargins=function(){if(this.gaugeSmallViewPortProperties&&this.gaugeSmallViewPortProperties.smallGaugeMarginsOnSmallViewPort&&this.currentViewport.height<this.gaugeSmallViewPortProperties.MinHeightGaugeSideNumbersVisible){var e=this.gaugeSmallViewPortProperties.GaugeMarginsOnSmallViewPort;return void(this.margin={top:e,bottom:e,left:e,right:e})}if(this.margin={top:o.DefaultTopBottomMargin,bottom:o.DefaultTopBottomMargin,left:o.DefaultLeftRightMargin,right:o.DefaultLeftRightMargin},!this.showSideNumbersLabelText()||this.showMinMaxLabelsOnBottom()){var i=this.targetSettings;if(this.showTargetLabel){var r=(i.target-i.min)/(i.max-i.min);r>.5?this.margin.left=o.ReducedLeftRightMargin:this.margin.right=o.ReducedLeftRightMargin}else this.margin.left=this.margin.right=o.ReducedLeftRightMargin}var n=0;this.data&&this.data.dataLabelsSettings&&this.data.dataLabelsSettings.fontSize&&this.data.dataLabelsSettings.fontSize>=t.NewDataLabelUtils.DefaultLabelFontSizeInPt&&(n=a.fromPointToPixel(this.data.dataLabelsSettings.fontSize-t.NewDataLabelUtils.DefaultLabelFontSizeInPt)),0!==n&&(this.margin.bottom+=n,this.margin.left+=n,this.margin.right+=n)},o.prototype.showSideNumbersLabelText=function(){return!(this.gaugeSmallViewPortProperties&&this.gaugeSmallViewPortProperties.hideGaugeSideNumbersOnSmallViewPort&&this.currentViewport.height<this.gaugeSmallViewPortProperties.MinHeightGaugeSideNumbersVisible)},o.MIN_VALUE=-(1/0),o.MAX_VALUE=+(1/0),o.MinDistanceFromBottom=10,o.MinWidthForTargetLabel=150,o.DefaultTopBottomMargin=20,o.DefaultLeftRightMargin=45,o.ReducedLeftRightMargin=15,o.DEFAULT_MAX=1,o.DEFAULT_MIN=0,o.VisualClassName="gauge",o.DefaultStyleProperties={transition:{ease:"bounce"},arcColors:{background:"#e9e9e9",foreground:"#00B8AA"},targetLine:{show:!0,color:"#666666",thickness:2},labels:{count:2,padding:5,fontSize:t.NewDataLabelUtils.DefaultLabelFontSizeInPt},kpiBands:{show:!1,separationRadians:Math.PI/128,thickness:5}},o.DefaultTargetSettings={min:0,max:1,target:void 0},o.DefaultDataPointSettings={fillColor:o.DefaultStyleProperties.arcColors.foreground,targetColor:o.DefaultStyleProperties.targetLine.color},o.InnerRadiusFactor=.7,o.KpiBandDistanceFromMainArc=2,o.MainGaugeGroupClassName="mainGroup",o.LabelText=i("labelText"),o.TargetConnector=i("targetConnector"),o.TargetText=i("targetText"),o.formatStringProp={objectName:"general",propertyName:"formatString"},o}();t.Gauge=o}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=jsCommon.Utility,i=function(){function i(){this.scalingType=e.imageScalingType.normal}return i.prototype.init=function(e){this.element=e.element},i.prototype.enumerateObjectInstances=function(e){switch(e.objectName){case"imageScaling":return this.enumerateImageScaling()}return null},i.prototype.enumerateImageScaling=function(){return[{selector:null,objectName:"imageScaling",properties:{imageScalingType:this.scalingType}}]},i.prototype.update=function(i){var a=i.dataViews;if(a&&0!==a.length){var r=a[0].metadata.objects;if(r&&r.general){var o=this.imageBackgroundElement;o||(o=$("<div class='imageBackground' />"),this.imageBackgroundElement=o,this.imageBackgroundElement.appendTo(this.element));var n=i.viewport;o.css("height",n.height),r.imageScaling?this.scalingType=r.imageScaling.imageScalingType.toString():this.scalingType=e.imageScalingType.normal;var s=r.general.imageUrl;t.isLocalUrl(s)&&o.css("backgroundImage","url("+s+")"),this.scalingType===e.imageScalingType.fit?o.css("background-size","100% 100%"):this.scalingType===e.imageScalingType.fill?o.css("background-size","cover"):o.css("background-size","contain")}}},i}();e.ImageVisual=i}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){function i(e,i,a){if(!i||0===i.length)return s.status.NOGOAL;var r,o;if(2===i.length){if(r=Math.max.apply(Math,i),o=Math.min.apply(Math,i),e>=o&&r>=e)return s.status.IN_BETWEEN}else r=i[0],o=i[0];switch(a){case t.kpiDirection.positive:if(o>e)return s.status.DROP;break;case t.kpiDirection.negative:if(e>r)return s.status.DROP}return s.status.INCREASE}function a(e,i,a){if(!i||1!==i.length||0===i[0])return"";var r,o="+",n=i[0];switch(r=Math.abs(e-n),a){case t.kpiDirection.positive:n>e&&(o="-");break;case t.kpiDirection.negative:e>n&&(o="-")}var s=Number((100*r/n).toFixed(2));return"("+o+s+"%)"}function r(e){switch(e){case s.status.NOGOAL:return s.kpiTextGreyClass;case s.status.INCREASE:return s.kpiGreenClass;case s.status.IN_BETWEEN:
22return s.kpiYellowClass;case s.status.DROP:return s.kpiRedClass}}function o(e){switch(e){case s.status.NOGOAL:return s.kpiGraphGreyClass;case s.status.INCREASE:return s.kpiGreenClass;case s.status.IN_BETWEEN:return s.kpiYellowClass;case s.status.DROP:return s.kpiRedClass}}var n=e.data.DataRoleHelper,s=function(){function s(){}return s.prototype.init=function(e){s.getLocalizedString=e.host.getLocalizedString,this.rootElement=d3.select(e.element.get(0)).append("div").attr("text-align","center").classed("kpiVisual",!0),this.svg=this.rootElement.append("svg");var t=this.mainGroupElement=this.svg.append("g");this.areaFill=t.append("path"),this.textContainer=this.rootElement.append("div").classed("textContainer",!0),this.indicatorTextContainer=this.textContainer.append("div").classed("indicatorText",!0),this.absoluteGoalDistanceText=this.textContainer.append("div").classed("goalText",!0),this.kpiActualText=this.indicatorTextContainer.append("div").attr("id","indicatorText"),this.initIcons(),this.host=e.host},s.prototype.update=function(e){if(e.dataViews&&e.dataViews[0]){var t=this.dataView=e.dataViews[0],i=e.viewport;if((!t.categorical||!t.categorical.values||t.categorical.values.length<1)&&(!t.categorical||!t.categorical.categories||t.categorical.categories.length<1))return this.svg.attr("visibility","hidden"),void this.textContainer.attr("style","display:none");this.svg.attr("visibility","visible");var a=s.converter(t,i,s.getProp_KPIDirection(t));this.render(a,i)}},s.prototype.initIcons=function(){this.successMarkIcon=this.indicatorTextContainer.append("div").classed("powervisuals-glyph checkmark kpi-visual-green",!0),this.betweenIcon=this.indicatorTextContainer.append("div").classed("powervisuals-glyph circle-small kpi-visual-yellow",!0),this.exclamationMarkIcon=this.indicatorTextContainer.append("div").classed("powervisuals-glyph exclamation kpi-visual-red",!0),this.successMarkIcon.attr("style","display:none"),this.betweenIcon.attr("style","display:none"),this.exclamationMarkIcon.attr("style","display:none")},s.prototype.render=function(e,t){if(this.setShowDataMissingWarning(!(e.indicatorExists&&e.trendExists)),0===e.dataPoints.length||!e.indicatorExists||!e.trendExists)return this.areaFill.attr("visibility","hidden"),this.svg.attr("visibility","hidden"),void this.textContainer.attr("style","display:none");this.svg.attr({height:t.height,width:t.width});var n=s.status.NOGOAL;e.targetExists&&e.indicatorExists&&e.trendExists&&(n=i(e.actual,e.goals,e.directionType));var l=e.formattedValue,c=s.indicatorTextSizeInPx;this.textContainer.attr("style","width:"+t.width+"px;top:"+(t.height-c)/2+"px"),this.kpiActualText.classed(s.allColorClasses,!1).classed(r(n),!0).attr("text-anchor","middle").text(l);var u=null;switch(n){case s.status.INCREASE:u=this.successMarkIcon,this.exclamationMarkIcon.attr("style","display:none"),this.betweenIcon.attr("style","display:none");break;case s.status.IN_BETWEEN:u=this.betweenIcon,this.exclamationMarkIcon.attr("style","display:none"),this.successMarkIcon.attr("style","display:none");break;case s.status.DROP:u=this.exclamationMarkIcon,this.successMarkIcon.attr("style","display:none"),this.betweenIcon.attr("style","display:none");break;default:this.exclamationMarkIcon.attr("style","display:none"),this.successMarkIcon.attr("style","display:none"),this.betweenIcon.attr("style","display:none")}u&&u.attr("style","font-size:12px");var h=e.showGoal?e.formattedGoalString+" ":"",d=e.showDistanceFromGoal?a(e.actual,e.goals,e.directionType):"";if(this.absoluteGoalDistanceText.attr("text-anchor","middle").text(h+d),e.showTrendLine&&e.historyExists){var p=d3.svg.area().x(function(e){return e.x}).y0(t.height).y1(function(e){return e.y});this.areaFill.classed(s.allColorClasses,!1).classed(o(n),!0).attr("d",p(e.dataPoints)).attr("stroke","none").attr("visibility","visible").attr("fill-opacity",.2)}else this.areaFill.attr("visibility","hidden")},s.prototype.setShowDataMissingWarning=function(e){this.host.setWarnings(e?[new t.VisualKPIDataMissingWarning]:[])},s.getDefaultFormatSettings=function(){return{labelSettings:t.dataLabelUtils.getDefaultLabelSettings(!0,t.Card.DefaultStyle.value.color),textSize:27,wordWrap:!1}},s.getFormatString=function(e){return t.valueFormatter.getFormatString(e,t.AnimatedText.formatStringProp)},s.getProp_Show_KPIGoal=function(t){return t&&t.metadata?e.DataViewObjects.getValue(t.metadata.objects,s.showKPIGoal,!0):!0},s.getProp_Show_KPITrendLine=function(t){return t&&t.metadata?e.DataViewObjects.getValue(t.metadata.objects,s.showKPITrendLine,!0):!0},s.getProp_Show_KPIDistance=function(t){return t&&t.metadata?e.DataViewObjects.getValue(t.metadata.objects,s.showKPIDistance,!0):!0},s.getProp_KPIDirection=function(i){return i&&i.metadata?e.DataViewObjects.getValue(i.metadata.objects,s.directionTypeStringProp,t.kpiDirection.positive):t.kpiDirection.positive},s.getProp_Indicator_DisplayUnits=function(t){return s.initDefaultLabelSettings(),t&&t.metadata?e.DataViewObjects.getValue(t.metadata.objects,s.indicatorDisplayUnitsProp,s.defaultLabelSettings.displayUnits):s.defaultLabelSettings.displayUnits},s.getProp_Indicator_Precision=function(t){return s.initDefaultLabelSettings(),t&&t.metadata?e.DataViewObjects.getValue(t.metadata.objects,s.indicatorPrecisionProp,s.defaultLabelSettings.precision):s.defaultLabelSettings.precision},s.initDefaultLabelSettings=function(){s.defaultCardFormatSetting||(s.defaultCardFormatSetting=s.getDefaultFormatSettings(),s.defaultLabelSettings=s.defaultCardFormatSetting.labelSettings)},s.getFormattedValue=function(i,a,r,o,n){void 0===n&&(n=e.DisplayUnitSystemType.WholeUnits);var l=0===o,c=t.valueFormatter.create({format:s.getFormatString(i),value:o,precision:r,displayUnitSystemType:n,formatSingleValues:!!l,allowFormatBeautification:!0,columnType:i?i.type:void 0});return c.format(a)},s.getFormattedGoalString=function(e,t,i,a){if(!t||0===t.length)return"";var r=s.getLocalizedString("Visual_KPI_Goal_Title")+": "+s.getFormattedValue(e,t[0],i,a);return 2===t.length&&(r+=", "+s.getFormattedValue(e,t[1],i,a)),r},s.converter=function(i,a,r){var o=[],l=i.categorical,c=null,u=null,h="",d="",p=!1,g=!1,m=!1,f=!0;i.categorical.categories||(f=!1);for(var y=l.values,v=i.metadata.columns,b=0,C=v;b<C.length;b++){var S=C[b];n.hasRole(S,"Indicator")&&(g=!0,c=S),n.hasRole(S,"TrendLine")&&(m=!0),n.hasRole(S,"Goal")&&(p=!0,u=S)}if(!(g&&m&&y&&0!==y.length&&y[0].values&&i.categorical.values))return{dataPoints:o,directionType:r,actual:0,goals:[],formattedGoalString:h,targetExists:p,historyExists:f,indicatorExists:g,trendExists:m,formattedValue:d,showGoal:!1,showDistanceFromGoal:!1,showTrendLine:!1};var x,w;f&&(x=l.categories[0],w=x.values);for(var P,D=[],L=[],T=s.getColumnsByRole(y,"Indicator"),_=s.getColumnsByRole(y,"Goal"),V=0,M=y[0].values.length;M>V;V++){P=T[0].values[V];for(var N=[],A=0;A<_.length;A++)N.push(_[A].values[V]);L.push(N),D.push(P)}for(var O=Math.max.apply(Math,D),I=Math.min.apply(Math,D),R=a.height*s.trendAreaFilePercentage,F=s.getProp_Indicator_Precision(i),H=s.getProp_Indicator_DisplayUnits(i),V=0;V<D.length;V++){var z=R*(D[V]-I)/(O-I),G=null;f&&(G=t.SelectionId.createWithId(x.identity[V]).getSelector()),o.push({x:V*a.width/(D.length-1),y:a.height-z,actual:D[V],goals:L[V]})}var j,k;o.length>0&&(j=o[o.length-1].actual,k=o[o.length-1].goals),1===o.length&&(f=!1),d=s.getFormattedValue(c,j,F,H,e.DisplayUnitSystemType.DataLabels),h=s.getFormattedGoalString(u,k,F,H);var E=s.getProp_Show_KPIGoal(i),W=s.getProp_Show_KPIDistance(i),B=s.getProp_Show_KPITrendLine(i);return{dataPoints:o,directionType:r,actual:j,goals:k,formattedGoalString:h,targetExists:p,historyExists:f,indicatorExists:g,trendExists:m,formattedValue:d,showGoal:E,showDistanceFromGoal:W,showTrendLine:B}},s.getColumnsByRole=function(e,t){for(var i=[],a=0;a<e.length;a++)n.hasRole(e[a].source,t)&&i.push(e[a]);return i},s.prototype.enumerateObjectInstances=function(e){var t=[],i=this.dataView;switch(e.objectName){case"indicator":t.push({selector:null,objectName:"indicator",properties:{indicatorDisplayUnits:s.getProp_Indicator_DisplayUnits(i),indicatorPrecision:s.getProp_Indicator_Precision(i)}});case"trendline":t.push({selector:null,objectName:"trendline",properties:{show:s.getProp_Show_KPITrendLine(i)}});case"goals":t.push({selector:null,objectName:"goals",properties:{showGoal:s.getProp_Show_KPIGoal(i),showDistance:s.getProp_Show_KPIDistance(i)}});case"status":t.push({selector:null,objectName:"status",properties:{direction:s.getProp_KPIDirection(i)}})}return t},s.prototype.destroy=function(){this.svg=null},s.directionTypeStringProp={objectName:"status",propertyName:"direction"},s.showKPIGoal={objectName:"goals",propertyName:"showGoal"},s.showKPIDistance={objectName:"goals",propertyName:"showDistance"},s.showKPITrendLine={objectName:"trendline",propertyName:"show"},s.indicatorDisplayUnitsProp={objectName:"indicator",propertyName:"indicatorDisplayUnits"},s.indicatorPrecisionProp={objectName:"indicator",propertyName:"indicatorPrecision"},s.status={INCREASE:"increase",DROP:"drop",IN_BETWEEN:"in-between",NOGOAL:"no-goal"},s.statusBandingType={Below:"BELOW",Above:"ABOVE"},s.actualTextConsts={VERTICAL_OFFSET_FROM_HALF_HEIGHT:20,FONT_WIDTH_FACTOR:14,RIGHT_MARGIN:10},s.kpiRedClass="kpi-visual-red",s.kpiYellowClass="kpi-visual-yellow",s.kpiGreenClass="kpi-visual-green",s.kpiTextGreyClass="kpi-visual-text-grey",s.kpiGraphGreyClass="kpi-visual-graph-grey",s.allColorClasses=s.kpiRedClass+" "+s.kpiYellowClass+" "+s.kpiGreenClass+" "+s.kpiTextGreyClass+" "+s.kpiGraphGreyClass,s.trendAreaFilePercentage=1,s.estimatedIconHeightInPx=9,s.indicatorTextSizeInPx=60,s}();t.KPIStatusWithHistory=s}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.EnumExtensions,a=jsCommon.CssConstants.createClassAndSelector,r=jsCommon.PixelConverter,o=function(){function o(e){var t=this;this.deferDragMoveOperation=jsCommon.DeferUtility.deferUntilNextFrame(function(){if(t.lastDragMoveXPosition){var e=t.findIndex(t.lastDragMoveXPosition-t.margin.left);t.selectColumn(e),t.lastDragMoveXPosition=void 0}}),this.isScrollable=e.isScrollable?e.isScrollable:!1,this.tooltipsEnabled=e.tooltipsEnabled,this.lineType=e.chartType?e.chartType:1,this.interactivityService=e.interactivityService,this.animator=e.animator,this.lineChartLabelDensityEnabled=e.lineChartLabelDensityEnabled,this.lineClassAndSelector=o.LineClassSelector}return o.customizeQuery=function(e){var i=e.dataViewMappings[0];if(i&&i.categorical&&i.categorical.categories&&(i.categorical.dataVolume=4,t.CartesianChart.detectScalarMapping(i))){var a=i.categorical.categories;a.dataReductionAlgorithm={sample:{}}}},o.getSortableRoles=function(e){var i=e.dataViewMappings[0];if(!i||!i.categorical||!i.categorical.categories)return null;var a=i.categorical.categories,r=a["for"]["in"].items;if(!_.isEmpty(r)){var o=r[0].type,n=void 0;if(i.metadata&&(n=i.metadata.objects),!t.CartesianChart.getIsScalar(n,t.lineChartProps.categoryAxis.axisType,o))return["Category","Y"]}return null},o.converter=function(i,a,r,o,n,s,l,c){void 0===c&&(c=!0);var u=e.data.createIDataViewCategoricalReader(i),h=l?"Y2":"Y",d=i.categorical,p=d.categories&&d.categories.length>0?d.categories[0]:{source:void 0,values:[a],identity:void 0},g=t.CartesianHelper.getCategoryAxisProperties(i.metadata);o=t.CartesianHelper.isScalar(o,g),d=t.ColumnUtil.applyUserMinMax(o,d,g);var m,f=t.lineChartProps.general.formatString,y=t.AxisHelper.getCategoryValueType(p.source,o),v=t.AxisHelper.isDateTime(y),b=p.values,C=[],S=[],x=d.values?d.values.length:0,w=!(!d.values||!d.values.source),P=d.values,D=t.dataLabelUtils.getDefaultLineChartLabelSettings(l);if(i.metadata&&i.metadata.objects){var L=i.metadata.objects;m=l?void 0:e.DataViewObjects.getFillColor(L,t.lineChartProps.dataPoint.defaultColor);var T=L.labels;t.dataLabelUtils.updateLineChartLabelSettingsFromLabelsObject(T,D)}var V,M=new t.ColorHelper(r,t.lineChartProps.dataPoint.fill,m);i.categorical.values&&(V=i.categorical.values.grouped());var N;s&&(N=d.values&&d.values.length>0?_.times(d.values[0].values.length,function(){return 0}):[]);for(var A=0;x>A;A++){var O=d.values[A],I=O.source,R=[],F=V[A],H=w&&F?t.SelectionId.createWithIdAndMeasure(F.identity,O.source.queryName):t.SelectionId.createWithMeasure(O.source.queryName),z=H.getKey(),G=this.getColor(M,w,P,V,A,F),j=void 0;if(!w){var k=V&&V.length>0&&V[0].values?V[0].values[A]:null,E=k&&k.source&&k.source.objects?k.source.objects.labels:null;E&&(j=e.Prototype.inherit(D),t.dataLabelUtils.updateLineChartLabelSettingsFromLabelsObject(E,j))}for(var W=j?j:D,B=O.highlights&&O.highlights.length>0,U=u.hasCategories()?u.getCategoryCount():1,K=0;U>K;K++){var X=b[K],Y=t.AxisHelper.normalizeNonFiniteNumber(B?u.getHighlight(h,K,A):u.getValue(h,K,A));if((!o||null!=X&&null!=Y)&&(!v||null==X||X instanceof Date)){var q=i.categorical,$=void 0;c&&($=[],p.source&&$.push({displayName:p.source.displayName,value:t.converterHelper.formatFromMetadataColumn(X,p.source,f)}),w&&(p.source&&p.source===q.values.source||$.push({displayName:q.values.source.displayName,value:t.converterHelper.formatFromMetadataColumn(V[A].name,q.values.source,f)})),null!=Y&&$.push({displayName:I.displayName,value:t.converterHelper.formatFromMetadataColumn(Y,I,f)}));var Q=p&&!_.isEmpty(p.identity)&&p.identity[K]?p.identity[K].key:K,Z={categoryValue:v&&X?X.getTime():X,value:Y,categoryIndex:K,seriesIndex:A,tooltipInfo:$,selected:!1,identity:H,key:JSON.stringify({series:z,category:Q}),labelFill:W.labelColor,labelFormatString:I.format,labelSettings:W};s&&(N[K]+=Y,Z.stackedValue=N[K]),p.objects&&p.objects[K]&&(Z.pointColor=e.DataViewObjects.getFillColor(p.objects[K],t.lineChartProps.dataPoint.fill)),R.push(Z),C[K]||(C[K]=Z)}}n&&n.applySelectionStateToData(R),R.length>0&&S.push({displayName:I.displayName,key:z,lineIndex:A,color:G,xCol:p.source,yCol:O.source,data:R,identity:H,selected:!1,labelSettings:j})}g=t.CartesianHelper.getCategoryAxisProperties(i.metadata);var J=t.CartesianHelper.getValueAxisProperties(i.metadata),ee=[];if(P)for(var te=0;te<P.length;te++)P[te]&&P[te].source&&P[te].source.displayName&&ee.push({displayName:P[te].source.displayName});var ie=t.converterHelper.createAxesLabels(g,J,p.source,ee);return n&&n.applySelectionStateToData(S),{series:S,isScalar:o,dataLabelsSettings:D,axesLabels:{x:ie.xAxisLabel,y:ie.yAxisLabel},hasDynamicSeries:w,categoryMetadata:p.source,categories:b,categoryData:C}},o.getInteractiveLineChartDomElement=function(e){return e.children("svg").get(0)},o.getColor=function(e,t,i,a,r,o){var n;return t?a&&a[r]&&(n=a[r].objects):i[r]&&(n=i[r].source.objects),t&&o?e.getColorForSeriesValue(n,i.identityFields,o.name):e.getColorForMeasure(n,i[r].source.queryName)},o.createStackedValueDomain=function(e){if(0===e.length)return null;var t=d3.min(e,function(e){return d3.min(e.data,function(e){return e.stackedValue})}),i=d3.max(e,function(e){return d3.max(e.data,function(e){return e.stackedValue})});return[t,i]},o.prototype.init=function(e){var i=this;this.options=e,this.element=e.element,this.cartesainSVG=e.svg,this.host=e.host,this.currentViewport=e.viewport,this.colors=e.style.colorPalette.dataColors,this.isInteractiveChart=e.interactivity&&e.interactivity.isInteractiveLegend,this.cartesianVisualHost=e.cartesianHost,this.scaleDetector=new t.SVGScaleDetector(this.cartesainSVG);var a=e.chartType;this.isComboChart=10===a||13===a||14===a;var r=e.svg;r.classed(o.ClassName,!0);var n=this.mainGraphicsSVG=r.append("svg").classed("lineChartSVG",!0);this.isComboChart||this.isInteractiveChart||(this.overlayRect=n.append(o.RectOverlayName).style("opacity",t.SVGUtil.AlmostZero)),this.mainGraphicsContext=n.append("g").classed(o.MainGraphicsContextClassName,!0),this.hoverLineContext=r.append("g").classed("hover-line",!0),this.hoverLineContext.append(o.LineElementName).attr("x1",0).attr("x2",0).attr("y1",0).attr("y2",0);var s=this.hoverLine=this.hoverLineContext.select(o.LineElementName);if(this.isInteractiveChart&&s.classed("interactive",!0),s.style("opacity",t.SVGUtil.AlmostZero),this.selectionCircles=[],this.xAxisProperties={axis:null,scale:null,isScalar:null,axisType:null,formatter:null,graphicsContext:null,values:null,axisLabel:null,isCategoryAxis:!0},this.isInteractiveChart){var l=o.getInteractiveLineChartDomElement(this.element),c=function(){i.lastDragMoveXPosition=d3.mouse(l)[0],i.deferDragMoveOperation()},u=d3.behavior.drag().origin(Object).on("drag",c);d3.select(l).style("touch-action","none").call(u).on("click",c)}this.shouldAdjustMouseCoordsOnPathsForStroke=!jsCommon.BrowserUtils.isChrome()},o.prototype.setData=function(a){if(this.data={series:[],dataLabelsSettings:t.dataLabelUtils.getDefaultLineChartLabelSettings(this.isComboChart),axesLabels:{x:null,y:null},hasDynamicSeries:!1,categories:[],categoryMetadata:void 0,categoryData:[]},a.length>0){var r=a[0];if(r&&r.categorical){var n=this.dataViewCat=r.categorical,s=n.categories,l=e.ValueType.fromDescriptor({text:!0});s&&s.length>0&&s[0].source&&s[0].source.type&&(l=s[0].source.type);var c=o.converter(r,t.valueFormatter.format(null),this.cartesianVisualHost.getSharedColors(),t.CartesianChart.getIsScalar(r.metadata?r.metadata.objects:null,t.lineChartProps.categoryAxis.axisType,l),this.interactivityService,i.hasFlag(this.lineType,16),this.isComboChart);this.data=c}}},o.prototype.calculateLegend=function(){return this.createLegendDataPoints(0)},o.prototype.hasLegend=function(){return this.data&&(this.data.hasDynamicSeries||this.data.series&&this.data.series.length>1)},o.prototype.setFilteredData=function(t,i){var a=i-t,r=this.clippedData=e.Prototype.inherit(this.data);return r.series=o.sliceSeries(r.series,a,t),r.categories=r.categories.slice(t,i),r},o.prototype.calculateAxesProperties=function(a){var r=this,n=this.data,s=a.viewport,l=a.margin;this.currentViewport=s,this.margin=l;var c=n.series&&n.series.length>0?n.series[0].data.length:0,u=t.CartesianChart.MinOrdinalRectThickness,h=this.data.isScalar,d=a.trimOrdinalDataOnOverflow,p=this.getPreferredPlotArea(h,c,u);if(this.clippedData=void 0,n&&!h&&!this.isScrollable&&d){var g=this.getCategoryCount(c),m=Math.min(c,g);m!==c&&(n=this.clippedData=e.Prototype.inherit(n),this.clippedData.series=o.sliceSeries(n.series,m))}var f,y;n.series&&n.series.length>0&&(f=n.series[0].xCol,y=n.series[0].yCol);var v=i.hasFlag(this.lineType,16)?o.createStackedValueDomain(n.series):t.AxisHelper.createValueDomain(n.series,!1),b=a.valueAxisScaleType===t.axisScale.log&&!t.AxisHelper.isLogScalePossible(v),C=t.AxisHelper.combineDomain(a.forcedYDomain,v,a.ensureYDomain);this.yAxisProperties=t.AxisHelper.createAxis({pixelSpan:p.height,dataDomain:C,metaDataColumn:y,formatString:t.valueFormatter.getFormatString(y,t.lineChartProps.general.formatString),outerPadding:0,isScalar:!0,isVertical:!0,forcedTickCount:a.forcedTickCount,useTickIntervalForDisplayUnits:!0,isCategoryAxis:!1,scaleType:a.valueAxisScaleType,axisDisplayUnits:a.valueAxisDisplayUnits,axisPrecision:a.valueAxisPrecision,shouldClamp:!1});var S=this.data?this.data.categoryMetadata:void 0,x=t.AxisHelper.getCategoryValueType(S),w=t.AxisHelper.createDomain(n.series,x,this.data.isScalar,a.forcedXDomain,a.ensureXDomain),P=a.categoryAxisScaleType===t.axisScale.log&&!t.AxisHelper.isLogScalePossible(w);return this.xAxisProperties=t.AxisHelper.createAxis({pixelSpan:p.width,dataDomain:w,metaDataColumn:f,formatString:t.valueFormatter.getFormatString(f,t.lineChartProps.general.formatString),outerPadding:this.data.isScalar?o.ScalarOuterPadding:0,isScalar:this.data.isScalar,isVertical:!1,forcedTickCount:a.forcedTickCount,useTickIntervalForDisplayUnits:!0,getValueFn:function(e,i){return t.CartesianHelper.lookupXValue(r.data,e,i,r.data.isScalar)},categoryThickness:t.CartesianChart.getCategoryThickness(n.series,c,this.getAvailableWidth(),w,h,d),isCategoryAxis:!0,scaleType:a.categoryAxisScaleType,axisDisplayUnits:a.categoryAxisDisplayUnits,axisPrecision:a.categoryAxisPrecision}),this.xAxisProperties.axisLabel=a.showCategoryAxisLabel?n.axesLabels.x:null,this.yAxisProperties.axisLabel=a.showValueAxisLabel?n.axesLabels.y:null,this.xAxisProperties.hasDisallowedZeroInDomain=P,this.yAxisProperties.hasDisallowedZeroInDomain=b,[this.xAxisProperties,this.yAxisProperties]},o.prototype.enumerateObjectInstances=function(e,t){switch(t.objectName){case"dataPoint":this.enumerateDataPoints(e);break;case"labels":this.enumerateDataLabels(e)}},o.prototype.enumerateDataPoints=function(e){var i=this.data;if(i&&i.series&&0!==i.series.length)for(var a=t.lineChartProps.general.formatString,r=i.series,o=r.length,n=0;o>n;n++){var s=t.ColorHelper.normalizeSelector(r[n].identity.getSelector()),l=t.converterHelper.getFormattedLegendLabel(r[n].yCol,this.dataViewCat.values,a);e.pushInstance({objectName:"dataPoint",displayName:l,selector:s,properties:{fill:{solid:{color:i.defaultSeriesColor||r[n].color}}}})}},o.prototype.enumerateDataLabels=function(e){var i=this.data,a=this.data.dataLabelsSettings,r=i.series.length,o=this.showLabelPerSeries();if(t.dataLabelUtils.enumerateDataLabels(this.getLabelSettingsOptions(e,a,null,o)),0!==r&&o&&a.showLabelPerSeries)for(var n=0;r>n;n++){var s=i.series[n],l=s.labelSettings?s.labelSettings:this.data.dataLabelsSettings;e.pushContainer({displayName:s.displayName}),t.dataLabelUtils.enumerateDataLabels(this.getLabelSettingsOptions(e,l,s)),e.popContainer()}},o.prototype.supportsTrendLine=function(){var e=this.data?this.data.isScalar:!1;return!i.hasFlag(this.lineType,16)&&e},o.prototype.getLabelSettingsOptions=function(e,t,i,a){return{enumeration:e,dataLabelsSettings:t,show:!0,displayUnits:!0,precision:!0,selector:i&&i.identity?i.identity.getSelector():null,showAll:a,fontSize:!0,labelDensity:this.lineChartLabelDensityEnabled}},o.prototype.overrideXScale=function(e){this.xAxisProperties=e},o.prototype.onClearSelection=function(){this.interactivityService&&this.interactivityService.clearSelection()},o.prototype.render=function(e){var i=t.AnimatorCommon.GetAnimationDuration(this.animator,e);this.data.categoryData.length!==this.previousCategoryCount&&(i=0),this.previousCategoryCount=this.data.categoryData.length;var a;return a=this.isInteractiveChart?this.renderOld(i):this.renderNew(i),t.SVGUtil.flushAllD3TransitionsIfNeeded(this.options),a},o.prototype.renderNew=function(e){var a=this,r=this.clippedData?this.clippedData:this.data;if(r){var n=r.categories.length*r.series.length;n>t.AnimatorCommon.MaxDataPointsToAnimate&&(e=0);var s,l,c=i.hasFlag(this.lineType,16),u=this.margin,h=this.currentViewport,d=h.height-(u.top+u.bottom),p=h.width-(u.left+u.right),g=this.xAxisProperties.scale,m=this.yAxisProperties.scale,f=this.getXOfFirstCategory(),y=this.interactivityService&&this.interactivityService.hasSelection(),v=i.hasFlag(this.lineType,2)||i.hasFlag(this.lineType,16),b=function(e){return g(a.getXValue(e))+f};c?(s=function(e){return m(e.stackedValue-e.value)},l=function(e){return m(e.stackedValue)}):(s=m(0),l=function(e){return m(e.value)});var C;v&&(C=d3.svg.area().x(b).y0(s).y1(l).defined(function(e){return null!==e.value}));var S=d3.svg.line().x(b).y(l).defined(function(e){return null!==e.value});i.hasFlag(this.lineType,4)&&(S.interpolate("basis"),C&&C.interpolate("basis")),this.mainGraphicsSVG.attr("height",d).attr("width",p);var x=void 0;v&&(x=this.mainGraphicsContext.selectAll(o.CategoryAreaSelector.selector).data(r.series,function(e){return e.identity.getKey()}),x.enter().append(o.PathElementName).classed(o.CategoryAreaSelector["class"],!0),x.style("fill",function(e){return e.color}).style("fill-opacity",function(e){return y&&!e.selected?o.DimmedAreaFillOpacity:o.AreaFillOpacity}).transition().ease("linear").duration(e).attr("d",function(e){return C(e.data)}),x.exit().remove());var w=this.mainGraphicsContext.selectAll(this.lineClassAndSelector.selector).data(r.series,function(e){return e.identity.getKey()});w.enter().append(o.PathElementName).classed(this.lineClassAndSelector["class"],!0),w.style("stroke",function(e){return e.color}).style("stroke-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.selected,!1,y,!1)}).transition().ease("linear").duration(e).attr("d",function(e){return S(e.data)}),w.exit().remove();var P;this.interactivityService&&(P=this.mainGraphicsContext.selectAll(".interactivity-line").data(r.series,function(e){return e.identity.getKey()}),P.enter().append(o.PathElementName).classed("interactivity-line",!0).style("stroke-width",o.interactivityStrokeWidth),P.attr("d",function(e){return S(e.data)}),P.exit().remove());var D=this.mainGraphicsContext.selectAll(o.CategorySelector.selector).data(r.series,function(e){return e.identity.getKey()});D.enter().append("g").classed(o.CategorySelector["class"],!0),D.exit().remove();var L=D.selectAll(o.CategoryValuePoint.selector).data(function(e){return e.data.filter(function(t,i){return a.shouldDrawCircle(e,i)})},function(e){return e.key});L.enter().append(o.CircleElementName).classed(o.CategoryValuePoint["class"],!0),L.style("fill",function(){var e=d3.select(this.parentNode).datum();return e.color}).style("fill-opacity",function(){var e=d3.select(this.parentNode).datum();return t.ColumnUtil.getFillOpacity(e.selected,!1,y,!1)}).transition().duration(e).attr({cx:function(e,t){return g(a.getXValue(e))+f},cy:function(e,t){return m(c?e.stackedValue:e.value)},r:o.CircleRadius}),L.exit().remove();var T;this.isComboChart||(T=D.selectAll(o.CategoryPointSelector.selector).data(function(e){return _.filter(e.data,function(e){return null!=e.pointColor})},function(e){return e.key}),T.enter().append(o.CircleElementName).classed(o.CategoryPointSelector["class"],!0),T.style("fill",function(e){return e.pointColor}).transition().duration(e).attr({cx:function(e){return g(a.getXValue(e))},cy:function(e){return m(c?e.stackedValue:e.value)},r:o.PointRadius}),T.exit().remove());var V;if(r.dataLabelsSettings.show&&(V=this.createLabelDataPoints()),this.tooltipsEnabled)if(this.isComboChart){var M=function(e){var t=e.elementCoordinates[0];return a.getTooltipInfoForCombo(e,t)};P&&t.TooltipManager.addTooltip(P,M,!0),t.TooltipManager.addTooltip(L,function(e){return e.data.tooltipInfo},!0),T&&t.TooltipManager.addTooltip(T,function(e){return e.data.tooltipInfo},!0)}else{this.overlayRect.attr({x:0,width:p,height:d});var M=function(e){var t=e.elementCoordinates[0],i=a.getCategoryIndexFromTooltipEvent(e,t),r=a.selectColumnForTooltip(i);return a.getSeriesTooltipInfo(r)},N=function(){a.hoverLine.style("opacity",t.SVGUtil.AlmostZero),a.hoverLineContext.selectAll(o.HoverLineCircleDot.selector).remove()};t.TooltipManager.addTooltip(this.mainGraphicsSVG,M,!0,N)}var A=void 0,O=void 0;if(this.interactivityService){A=r.series.slice();for(var I=0,R=r.series.length;R>I;I++)A=A.concat(r.series[I].data);O={lines:w,interactivityLines:P,dots:L,areas:x,tooltipOverlay:this.overlayRect}}return{dataPoints:A,behaviorOptions:O,labelDataPoints:[],labelsAreNumeric:!0,labelDataPointGroups:V}}},o.prototype.renderOld=function(e){var a=this,r=this.clippedData?this.clippedData:this.data;if(r){var n,s=this.margin,l=this.currentViewport,c=l.height-(s.top+s.bottom),u=this.xAxisProperties.scale,h=this.yAxisProperties.scale,d=this.interactivityService&&this.interactivityService.hasSelection();i.hasFlag(this.lineType,2)&&(n=d3.svg.area().x(function(e){return u(a.getXValue(e))}).y0(c).y1(function(e){return h(e.value)}).defined(function(e){return null!==e.value}));var p=d3.svg.line().x(function(e){return u(a.getXValue(e))}).y(function(e){return h(e.value)}).defined(function(e){return null!==e.value});i.hasFlag(this.lineType,4)&&(p.interpolate("basis"),n&&n.interpolate("basis"));var g=this.getXOfFirstCategory();if(this.mainGraphicsContext.attr("transform",t.SVGUtil.translate(g,0)),this.mainGraphicsSVG.attr("height",this.getAvailableHeight()).attr("width",this.getAvailableWidth()),this.hoverLineContext.attr("transform",t.SVGUtil.translate(g,0)),i.hasFlag(this.lineType,2)){var m=this.mainGraphicsContext.selectAll(o.CategoryAreaSelector.selector).data(r.series,function(e){return e.identity.getKey()}),f=m.enter().append("g").classed(o.CategoryAreaSelector["class"],!0);f.append(o.PathElementName);var y=this.mainGraphicsContext.selectAll(o.CategoryAreaSelector.selector);y.select(o.PathElementName).transition().ease("linear").duration(e).attr("d",function(e){return n(e.data)}).style("fill",function(e){return e.color}).style("fill-opacity",function(e){return d&&!e.selected?o.DimmedAreaFillOpacity:o.AreaFillOpacity}),m.exit().remove()}var v=this.mainGraphicsContext.selectAll(o.CategorySelector.selector).data(r.series,function(e){return e.identity.getKey()}),b=v.enter().append("g").classed(o.CategorySelector["class"],!0);if(b.append(o.PathElementName),b.selectAll(o.CategoryValuePoint.selector).data(function(e){return e.data}).enter().append(o.CircleElementName).classed(o.CategoryValuePoint["class"],!0),v.exit().remove(),this.isInteractiveChart&&!this.dragHandle){var C=this.getAvailableHeight();this.dragHandle=this.hoverLineContext.append("circle").attr("cx",0).attr("cy",C).attr("r","6px").classed("drag-handle",!0)}for(var S=v.data().length;this.selectionCircles.length<S;){var x=this.hoverLineContext.append(o.CircleElementName).classed(o.CircleClassName,!0).attr("r",o.CircleRadius).style("opacity",0);this.selectionCircles.push(x)}for(;this.selectionCircles.length>S;)this.selectionCircles.pop().remove();var w=this.mainGraphicsContext.selectAll(o.CategorySelector.selector),P=w.select(o.PathElementName).classed(this.lineClassAndSelector["class"],!0).style("stroke",function(e){return e.color}).style("stroke-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.selected,!1,d,!1)});P.transition().ease("linear").duration(e).attr("d",function(e){return p(e.data)});var D=this,L=w.selectAll(o.CategoryValuePoint.selector),T=L.style("fill",function(){var e=d3.select(this.parentNode).datum();return e.color}).style("fill-opacity",function(){var e=d3.select(this.parentNode).datum();return t.ColumnUtil.getFillOpacity(e.selected,!1,d,!1)}).transition().duration(e).attr({cx:function(e,t){var i=d3.select(this.parentNode).datum(),a=D.shouldDrawCircle(i,t);return a?u(D.getXValue(e)):0},cy:function(e,t){var i=d3.select(this.parentNode).datum(),a=D.shouldDrawCircle(i,t);return a?h(e.value):0},r:function(e,t){var i=d3.select(this.parentNode).datum(),a=D.shouldDrawCircle(i,t);return a?o.CircleRadius:0}});if(this.isInteractiveChart&&this.hasDataPoint(r.series)){var _=L.size(),V=0;T.each("end",function(){V++,V===_&&a.selectColumn(t.CartesianHelper.findMaxCategoryIndex(r.series),!0)})}var M=null;if(r.dataLabelsSettings.show){M=[];for(var N=0,A=r.series.length;A>N;N++)Array.prototype.push.apply(M,r.series[N].data)}v.exit().remove();var O;return r.dataLabelsSettings.show&&(O=this.createLabelDataPoints()),null==M?null:{dataPoints:M,behaviorOptions:null,labelDataPoints:null,labelsAreNumeric:null,labelDataPointGroups:O}}},o.prototype.getSeriesTooltipInfo=function(e){for(var t=[],i=10,a=0,r=0,o=e;r<o.length;r++){var n=o[r];if(a>=i)break;null!=n.value&&(t.push({header:n.category,color:n.color,displayName:n.label,value:n.measure}),a++)}return 0===t.length?null:t},o.prototype.getTooltipInfoForCombo=function(e,t){var i,a=this.getCategoryIndexFromTooltipEvent(e,t),r=e.data;return r&&r.data&&r.data.length&&(i=_.find(r.data,function(e){return e.categoryIndex===a})),i?i.tooltipInfo:void 0},o.prototype.getCategoryIndexFromTooltipEvent=function(e,t){if(e.data&&null!=e.data.categoryIndex)return e.data.categoryIndex;var i=e.data,a=0;if(i&&!_.isEmpty(i.data)&&this.xAxisProperties){t=this.adjustPathXCoordinate(t);var r=_.find(i.data,function(e,t,i){var a=i[t+1];return null!=e.value&&a&&null!=a.value});a=this.xAxisProperties.scale(this.getXValue(r))+this.getXOfFirstCategory()}return this.findIndex(t,a)},o.prototype.getVisualCategoryAxisIsScalar=function(){return this.data?this.data.isScalar:!1},o.prototype.getSupportedCategoryAxisType=function(){var i=this.dataViewCat?this.dataViewCat.categories:void 0,a=e.ValueType.fromDescriptor({text:!0});i&&i.length>0&&i[0].source&&i[0].source.type&&(a=i[0].source.type);
23var r=t.AxisHelper.isOrdinal(a);return r?t.axisType.categorical:t.axisType.both},o.prototype.getPreferredPlotArea=function(e,i,a){return t.CartesianChart.getPreferredPlotArea(i,a,this.currentViewport,this.isScrollable,e,this.margin,!0)},o.prototype.getCategoryCount=function(e){var i=this.getAvailableWidth(),a=t.CartesianChart.MinOrdinalRectThickness;return Math.min(Math.round((i-a*t.CartesianChart.OuterPaddingRatio*2)/a),e)},o.prototype.getAvailableWidth=function(){return this.currentViewport.width-(this.margin.left+this.margin.right)},o.prototype.getAvailableHeight=function(){return this.currentViewport.height-(this.margin.top+this.margin.bottom)},o.sliceSeries=function(t,i,a){void 0===a&&(a=0);var r=[];if(t&&t.length>0)for(var o=0,n=t.length;n>o;o++)r[o]=e.Prototype.inherit(t[o]),r[o].data=t[o].data.slice(a,a+i);return r},o.prototype.getXOfFirstCategory=function(){if(!this.data.isScalar){var e=this.xAxisProperties.scale;if(e.rangeBand)return e.rangeBand()/2}return 0},o.prototype.hasDataPoint=function(e){if(0===e.length)return!1;for(var t=0,i=e.length;i>t;t++)if(e[t].data.length>0)return!0;return!1},o.prototype.getXValue=function(e){return this.data.isScalar?e.categoryValue:e.categoryIndex},o.prototype.shouldDrawCircle=function(e,t){var i=e.data.length,a=t===i-1,r=0===t;return t>i-1||null===e.data[t]||null===e.data[t].value?!1:r&&a?!0:r&&i>1&&null===e.data[t+1].value?!0:!r&&a&&null===e.data[t-1].value?!0:!r&&!a&&null===e.data[t-1].value&&null===e.data[t+1].value},o.prototype.selectColumnForTooltip=function(e,t){void 0===t&&(t=!1);var i=this.getChartX(e)+this.getXOfFirstCategory(),a=this.createTooltipDataPoints(e);return a.length>0&&this.setHoverLineForTooltip(i),this.setDotsForTooltip(i,a),a},o.prototype.setHoverLineForTooltip=function(e){e=e||0,this.hoverLine.attr("x1",e).attr("x2",e).attr("y1",0).attr("y2",this.getAvailableHeight()).style("opacity",1)},o.prototype.setDotsForTooltip=function(e,t){var a=this,r=i.hasFlag(this.lineType,16),n=r?function(e){return a.yAxisProperties.scale(e.stackedValue)}:function(e){return a.yAxisProperties.scale(e.value)},s=this.hoverLineContext.selectAll(o.HoverLineCircleDot.selector).data(t);s.enter().append(o.CircleElementName).classed(o.HoverLineCircleDot["class"],!0),s.filter(function(e){return e.value}).attr("fill",function(e){return e.color}).attr("r",3).attr("cx",e).attr("cy",n),s.exit().remove()},o.prototype.selectColumn=function(e,t){if(void 0===t&&(t=!1),t||this.lastInteractiveSelectedColumnIndex!==e){this.lastInteractiveSelectedColumnIndex=e;var i=this.getChartX(e);this.setHoverLine(i,e);var a=this.createLegendDataPoints(e);a&&this.options.cartesianHost.updateLegend(a)}},o.prototype.setHoverLine=function(e,t){this.hoverLine.attr("x1",e).attr("x2",e).attr("y1",0).attr("y2",this.getAvailableHeight()).style("opacity",1);var i=this;this.mainGraphicsContext.selectAll(o.CategorySelector.selector).selectAll(o.PathElementName).each(function(a){var r=this,o=a.color,n=i.selectionCircles[a.lineIndex];n.attr({cx:e,cy:function(){var t=d3.select(r).node(),a=i.getPosition(e,t);return a.y}}).style({opacity:function(){return _.some(a.data,function(e){return e.categoryIndex===t})?1:0},fill:o}),i.dragHandle&&i.dragHandle.attr("cx",e)})},o.prototype.getChartX=function(t){var i=0;this.data.isScalar?t>=0&&t<this.data.categoryData.length&&(i=Math.max(0,this.xAxisProperties.scale(this.data.categoryData[t].categoryValue))):i=Math.max(0,this.xAxisProperties.scale(t));var a=e.visuals.AxisHelper.extent(this.xAxisProperties.scale)[1];return i=Math.min(i,a),isNaN(i)?0:i},o.prototype.findIndex=function(i,a){var r=this.scaleDetector.getScale().x;e.Double.equalWithPrecision(r,1,1e-5)||(i/=r),a&&(i+=a);var o=e.visuals.AxisHelper.invertScale(this.xAxisProperties.scale,i);return this.data.isScalar&&(o=t.AxisHelper.findClosestXAxisIndex(o,this.data.categoryData)),o},o.prototype.getPosition=function(e,i){for(var a,r,o=i.getTotalLength(),n=0,s=o;;){if(r=Math.floor((n+s)/2),a=i.getPointAtLength(r),t.SVGUtil.ensureValidSVGPoint(a),(r===s||r===n)&&a.x!==e)break;if(a.x>e)s=r;else{if(!(a.x<e))break;n=r}}return a},o.prototype.createTooltipDataPoints=function(e){var i=this.data;if(!i||0===i.series.length||!i.categoryData)return[];var a,r=[],o=i.categoryData[e];this.data.isScalar?o&&(a=t.AxisHelper.isDateTime(this.xAxisProperties.axisType)?t.CartesianHelper.lookupXValue(this.data,o.categoryValue,this.xAxisProperties.axisType,this.data.isScalar):o.categoryValue):a=t.CartesianHelper.lookupXValue(this.data,e,this.xAxisProperties.axisType,this.data.isScalar);for(var n=t.lineChartProps.general.formatString,s=0,l=i.series;s<l.length;s++){var c=l[s],u=c.data,h=void 0;this.data.isScalar?o&&(h=u.filter(function(e){return e.categoryValue===o.categoryValue})[0]):h=u[e];var d=h&&h.value;if(null!=d){var p=t.converterHelper.getFormattedLegendLabel(c.yCol,this.dataViewCat.values,n);r.push({color:c.color,label:p,category:t.valueFormatter.format(a,t.valueFormatter.getFormatString(c.xCol,n)),measure:t.valueFormatter.format(d,t.valueFormatter.getFormatString(c.yCol,n)),value:d,stackedValue:h.stackedValue})}}return r},o.prototype.createLegendDataPoints=function(e){var i=this.data;if(i&&i.series&&!(i.series.length<1)){var a,r=[],o=i.categoryData[e];this.isInteractiveChart&&o&&(this.data.isScalar?(a=o.categoryValue,t.AxisHelper.isDateTime(this.xAxisProperties.axisType)&&(a=new Date(a))):a=t.CartesianHelper.lookupXValue(this.data,e,this.xAxisProperties.axisType,this.data.isScalar));for(var n=t.lineChartProps.general.formatString,s=null,l=0,c=i.series.length;c>l;l++){var u=i.series[l],h=u.data,d=void 0;if(this.isInteractiveChart){var p=void 0;if(this.data.isScalar){if(o)for(var g=o.categoryValue,m=0;m<h.length;m++)if(h[m].categoryValue===g){p=h[m];break}}else p=h[e];d=p&&p.value}var f=t.converterHelper.getFormattedLegendLabel(u.yCol,this.dataViewCat.values,n);s=u.yCol,r.push({color:u.color,icon:t.LegendIcon.Line,label:f,category:t.valueFormatter.format(a,t.valueFormatter.getFormatString(u.xCol,n)),measure:t.valueFormatter.format(d,t.valueFormatter.getFormatString(u.yCol,n)),identity:u.identity,selected:u.selected})}var y=this.dataViewCat?this.dataViewCat.values:null,v=y&&y.source?y.source.displayName:"";return{title:v,dataPoints:r}}},o.prototype.createLabelDataPoints=function(){var a,n,s,l,c,u,h=this,d=this.xAxisProperties.scale,p=this.yAxisProperties.scale,g=this.getXOfFirstCategory(),m=this.data,f=m.series,y=t.NewDataLabelUtils.createColumnFormatterCacheManager(),v=m.dataLabelsSettings,b=i.hasFlag(this.lineType,16),C=[];for(c=0,u=f.length;u>c;c++){var S=f[c];if(a=S.labelSettings?S.labelSettings:v,a.show){n=t.NewDataLabelUtils.getDisplayUnitValueFromAxisFormatter(this.yAxisProperties.formatter,a);var x=S.data;s=[],l=[];var w=function(i){if(null==i.value)return null;var s="";s=i.labelFormatString;var l,c=y.getOrCreate(s,a,n),u=t.NewDataLabelUtils.getLabelFormattedText(c.format(i.value)),m={text:u,fontFamily:t.NewDataLabelUtils.LabelTextProperties.fontFamily,fontSize:r.fromPoint(a.fontSize),fontWeight:t.NewDataLabelUtils.LabelTextProperties.fontWeight},f=e.TextMeasurementService.measureSvgTextWidth(m)+t.NewDataLabelUtils.LabelDensityPadding,v=e.TextMeasurementService.estimateSvgTextHeight(m,!0),C=!1;if(b){var S=Math.max(i.stackedValue-i.value,p.domain()[0]),x=h.currentViewport.width;l={rect:{left:d(h.getXValue(i))-x/2,top:p(Math.max(i.stackedValue,i.stackedValue-i.value)),width:x,height:Math.abs(p(i.stackedValue)-p(S))},orientation:i.value>=0?1:2,validPositions:o.validStackedLabelPositions},C=!0}else l={point:{x:d(h.getXValue(i))+g,y:p(i.value)},radius:0,validPositions:h.lineChartLabelDensityEnabled?o.validLabelPositions:[1]};var w={isPreferred:!1,text:u,textSize:{width:f,height:v},outsideFill:a.labelColor?a.labelColor:t.NewDataLabelUtils.defaultLabelColor,insideFill:a.labelColor&&b?a.labelColor:t.NewDataLabelUtils.defaultInsideLabelColor,parentType:C?1:0,parentShape:l,fontSize:a.fontSize,identity:i.identity,key:i.key};return w};if(!_.isEmpty(x)){var P=x.length,D=x[P-1],L=w(D,c);L&&s.push(L);for(var T=0;P-1>T;T++){var V=w(x[T],c);V&&s.push(V)}}var M=x.length;C[c]={labelDataPoints:s,maxNumberOfLabels:M}}}return C},o.prototype.adjustPathXCoordinate=function(t){if(this.shouldAdjustMouseCoordsOnPathsForStroke){var i=this.scaleDetector.getScale().x;t-=e.Double.equalWithPrecision(i,1,1e-5)?o.pathXAdjustment:o.pathXAdjustment*i}return t},o.prototype.showLabelPerSeries=function(){var e=this.data;return!e.hasDynamicSeries&&(e.series.length>1||!e.categoryMetadata)},o.ClassName="lineChart",o.MainGraphicsContextClassName="mainGraphicsContext",o.CategorySelector=a("cat"),o.CategoryValuePoint=a("dot"),o.CategoryPointSelector=a("point"),o.CategoryAreaSelector=a("catArea"),o.HoverLineCircleDot=a("circle-item"),o.LineClassSelector=a("line"),o.PointRadius=5,o.CircleRadius=4,o.PathElementName="path",o.CircleElementName="circle",o.CircleClassName="selection-circle",o.LineElementName="line",o.RectOverlayName="rect",o.ScalarOuterPadding=10,o.interactivityStrokeWidth=10,o.pathXAdjustment=5,o.AreaFillOpacity=.4,o.DimmedAreaFillOpacity=.2,o.validLabelPositions=[1,2,8,4,64,128,16,32],o.validStackedLabelPositions=[1,4,2],o}();t.LineChart=o}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.Color,a=jsCommon.PixelConverter,r=t.shapes.Polygon,o=e.data.DataRoleHelper;t.MaxLevelOfDetail=23,t.MinLevelOfDetail=1,t.DefaultFillOpacity=.5,t.DefaultBackgroundColor="#000000",t.LeaderLineColor="#000000";var n=function(){function i(e){this.tooltipsEnabled=e}return i.prototype.init=function(e,i,a){this.mapControl=e,this.root=i;var r=d3.select(i[0]);r.attr("drag-resize-disabled","true");var o=this.svg=r.append("svg").style("position","absolute").style("pointer-events","none");if(a){var n=this.clearSvg=d3.select(this.mapControl.getRootElement()).append("svg").style("position","absolute");this.clearCatcher=t.appendClearCatcher(n)}this.bubbleGraphicsContext=o.append("g").classed("mapBubbles",!0),this.sliceGraphicsContext=o.append("g").classed("mapSlices",!0),this.labelBackgroundGraphicsContext=o.append("g").classed(t.NewDataLabelUtils.labelBackgroundGraphicsContextClass["class"],!0),this.labelGraphicsContext=o.append("g").classed(t.NewDataLabelUtils.labelGraphicsContextClass["class"],!0),this.sliceLayout=d3.layout.pie().sort(null).value(function(e){return e.value}),this.arc=d3.svg.arc(),this.clearMaxDataPointRadius(),this.dataLabelsSettings=t.dataLabelUtils.getDefaultMapLabelSettings()},i.prototype.setData=function(e){this.mapData=e},i.prototype.clearDataPoints=function(){this.mapData={dataPoints:[],geocodingCategory:null,hasDynamicSeries:!1,hasSize:!1}},i.prototype.getDataPointCount=function(){return this.mapData?_.filter(this.mapData.dataPoints,function(e){return!!e.location}).length:0},i.prototype.getDataPointPadding=function(){return 2*this.maxDataPointRadius},i.prototype.clearMaxDataPointRadius=function(){this.maxDataPointRadius=0},i.prototype.setMaxDataPointRadius=function(e){this.maxDataPointRadius=Math.max(e,this.maxDataPointRadius)},i.prototype.getDefaultMap=function(e,t){this.clearDataPoints()},i.prototype.converter=function(e,t,i,a,r){void 0===r&&(r=!0);var n=this.mapControl,s=e.width/2,l=e.height/2,c=1;this.dataLabelsSettings=i;var u=Math.min(e.width,e.height)/384;this.clearMaxDataPointRadius();var h,d,p=[],g=[],m=t?t.categorical:null,f=-1;m&&m.values&&(h=m.values.grouped(),f=o.getMeasureIndexOfRole(h,"Size"),d=m.values.source);for(var y=this.mapData?this.mapData.dataPoints:[],v=this.mapData.hasSize,b=0,C=y.length;C>b;b++){var S=y[b],x=S.categoryValue,w=S.location;if(w){var P=n.tryLocationToPixel(new Microsoft.Maps.Location(w.latitude,w.longitude)),D=P.x+s,L=P.y+l,T=S.radius*u;this.setMaxDataPointRadius(T);var _=S.subDataPoints,V=_.length;if(1===V){var M=_[0];p.push({x:D,y:L,labeltext:x,radius:T,fill:M.fill,stroke:M.stroke,strokeWidth:c,tooltipInfo:M.tooltipInfo,identity:M.identity,selected:!1,labelFill:i.labelColor})}else{for(var N=[],A=0;V>A;A++){var M=_[A],O=v?M.value:1;N.push({x:D,y:L,labeltext:x,radius:T,fill:M.fill,stroke:M.stroke,strokeWidth:c,value:O,tooltipInfo:M.tooltipInfo,identity:M.identity,selected:!1,labelFill:i.labelColor})}a&&a.applySelectionStateToData(N),g.push(N)}}}return a&&a.applySelectionStateToData(p),{bubbleData:p,sliceData:g}},i.prototype.updateInternal=function(e,i,a,r,o){c.removeTransform3d(this.root),this.mapRendererData=e,this.svg&&this.svg.style("width",i.width.toString()+"px").style("height",i.height.toString()+"px"),this.clearSvg&&this.clearSvg.style("width",i.width.toString()+"px").style("height",i.height.toString()+"px");var n=this.arc,s=r&&r.hasSelection(),l=this.bubbleGraphicsContext.selectAll(".bubble").data(e.bubbleData,function(e){return e.identity.getKey()});l.enter().append("circle").classed("bubble",!0),l.attr("cx",function(e){return e.x}).attr("cy",function(e){return e.y}).attr("r",function(e){return e.radius}).style("fill",function(e){return e.fill}).style("stroke",function(e){return e.stroke}).style("fill-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.selected,!1,s,!1)}).style("strokeWidth",function(e){return e.strokeWidth}).style("stroke-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.selected,!1,s,!1)}).style("cursor","default"),l.exit().remove(),this.tooltipsEnabled&&(t.TooltipManager.addTooltip(this.bubbleGraphicsContext,function(e){return e.data.tooltipInfo}),l.style("pointer-events","all"));var u=e.sliceData,h=this.sliceGraphicsContext.selectAll(".sliceContainer").data(u);h.enter().append("g").classed("sliceContainer",!0),h.exit().remove();var d=this.sliceLayout,p=h.selectAll(".slice").data(function(e){return d(e)},function(e){return e.data.identity.getKey()});p.enter().append("path").classed("slice",!0),p.style("fill",function(e){return e.data.fill}).style("fill-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.data.selected,!1,s,!1)}).style("stroke",function(e){return e.data.stroke}).style("strokeWidth",function(e){return e.data.strokeWidth}).style("stroke-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.data.selected,!1,s,!1)}).style("cursor","default").attr("transform",function(e){return t.SVGUtil.translate(e.data.x,e.data.y)}).attr("d",function(e){return n.innerRadius(0).outerRadius(function(e){return e.data.radius})(e)}),p.exit().remove(),this.updateInternalDataLabels(i,o),this.tooltipsEnabled&&(t.TooltipManager.addTooltip(this.sliceGraphicsContext,function(e){return e.data.data.tooltipInfo}),p.style("pointer-events","all"));for(var g=e.bubbleData.slice(),m=0,f=u.length;f>m;m++)g.push.apply(g,u[m]);var y={bubbleEventGroup:this.bubbleGraphicsContext,sliceEventGroup:this.sliceGraphicsContext,bubbles:l,slices:p,clearCatcher:this.clearCatcher,dataPoints:g};return y},i.prototype.updateInternalDataLabels=function(i,a){var r=this.dataLabelsSettings,o=[];if(r&&(r.show||r.showCategory)){var n=this.createLabelDataPoints(),s=new e.LabelLayout({maximumOffset:t.NewDataLabelUtils.maxLabelOffset,startingOffset:t.NewDataLabelUtils.startingLabelOffset}),l={labelDataPoints:n,maxNumberOfLabels:n.length};o=s.layout([l],{width:i.width,height:i.height})}t.NewDataLabelUtils.drawLabelBackground(this.labelGraphicsContext,o,e.visuals.DefaultBackgroundColor,e.visuals.DefaultFillOpacity),t.NewDataLabelUtils.drawDefaultLabels(this.labelGraphicsContext,o,!1)},i.prototype.createLabelDataPoints=function(){var r=this.mapRendererData,o=[],n=r.bubbleData;n=n.concat(_.map(r.sliceData,function(e){return e[0]}));for(var s=this.dataLabelsSettings,l=0,c=n;l<c.length;l++){var u=c[l],h=u.labeltext,d={text:h,fontFamily:t.NewDataLabelUtils.LabelTextProperties.fontFamily,fontSize:a.fromPoint(s.fontSize),fontWeight:t.NewDataLabelUtils.LabelTextProperties.fontWeight},p=e.TextMeasurementService.measureSvgTextWidth(d),g=e.TextMeasurementService.estimateSvgTextHeight(d);o.push({isPreferred:!0,text:h,textSize:{width:p,height:g},outsideFill:s.labelColor?s.labelColor:t.NewDataLabelUtils.defaultInsideLabelColor,insideFill:t.NewDataLabelUtils.defaultInsideLabelColor,parentType:0,parentShape:{point:{x:u.x,y:u.y},radius:u.radius,validPositions:i.validLabelPositions},fontSize:s.fontSize,identity:void 0,hasBackground:!0})}return o},i.validLabelPositions=[1,2,4,8],i}();t.MapBubbleDataPointRenderer=n;var s=function(){function i(e,t){this.filledMapDataLabelsEnabled=e,this.tooltipsEnabled=t}return i.getFilledMapParams=function(e,i){switch(e){case t.MapUtil.CategoryTypes.Continent:case t.MapUtil.CategoryTypes.CountryRegion:return 10>i?{level:1,maxPolygons:50,strokeWidth:0}:30>i?{level:1,maxPolygons:20,strokeWidth:0}:{level:1,maxPolygons:5,strokeWidth:0};default:return 100>i?{level:1,maxPolygons:5,strokeWidth:6}:200>i?{level:0,maxPolygons:5,strokeWidth:6}:{level:0,maxPolygons:5,strokeWidth:0}}},i.buildPaths=function(e){for(var t=[],i=0;i<e.length;i++){var a=e[i],r=a.geographic;r.length>2&&t.push(a)}return t},i.prototype.init=function(e,i,a){this.mapControl=e,this.polygonInfo=new t.MapPolygonInfo,this.root=i;var r=d3.select(i[0]);r.attr("drag-resize-disabled","true");var o=this.svg=r.append("svg").style("position","absolute").style("pointer-events","none");if(a){var n=this.clearSvg=d3.select(this.mapControl.getRootElement()).append("svg").style("position","absolute");this.clearCatcher=t.appendClearCatcher(n)}this.shapeGraphicsContext=o.append("g").classed("mapShapes",!0),this.labelBackgroundGraphicsContext=o.append("g").classed(t.NewDataLabelUtils.labelBackgroundGraphicsContextClass["class"],!0),this.labelGraphicsContext=o.append("g").classed(t.NewDataLabelUtils.labelGraphicsContextClass["class"],!0),this.clearMaxShapeDimension(),this.dataLabelsSettings=t.dataLabelUtils.getDefaultMapLabelSettings()},i.prototype.setData=function(e){this.mapData=e},i.prototype.clearDataPoints=function(){this.mapData={dataPoints:[],geocodingCategory:null,hasDynamicSeries:!1,hasSize:!1}},i.prototype.getDataPointCount=function(){return this.mapData?_.filter(this.mapData.dataPoints,function(e){return!!e.paths}).length:0},i.prototype.converter=function(e,a,r,n){this.clearMaxShapeDimension(),this.dataLabelsSettings=r;for(var s=1,l=[],c=this.mapData?this.mapData.dataPoints:[],u=0,h=c.length;h>u;u++){var d=a?a.categorical:null,p=c[u],g=p.subDataPoints[0],m=p.paths,f=void 0,y=-1,v=void 0;if(d&&d.values&&(f=d.values.grouped(),y=o.getMeasureIndexOfRole(f,"Size"),v=d.values.source),m)for(var b=p.value,C=p.categoryValue,S=g.identity,x=S.getKey(),w=t.NewDataLabelUtils.createColumnFormatterCacheManager(),P=i.getIndexOfLargestShape(m),D=0,L=m.length;L>D;D++){var T=m[D],V=a&&a.categorical&&!_.isEmpty(a.categorical.values)?t.valueFormatter.getFormatString(a.categorical.values[0].source,t.filledMapProps.general.formatString):void 0;this.setMaxShapeDimension(T.absoluteBounds.width,T.absoluteBounds.height);var M=w.getOrCreate(V,r);l.push({absolutePointArray:T.absolute,path:T.absoluteString,fill:g.fill,stroke:g.stroke,strokeWidth:s,tooltipInfo:g.tooltipInfo,identity:S,selected:!1,key:JSON.stringify({id:x,pIdx:D}),displayLabel:D===P,labeltext:C,catagoryLabeltext:null!=b?t.NewDataLabelUtils.getLabelFormattedText(M.format(b)):void 0,labelFormatString:V})}}return n&&n.applySelectionStateToData(l),{shapeData:l}},i.prototype.updateInternal=function(e,i,a,r,o){c.removeTransform3d(this.root),this.mapRendererData=e,this.svg&&this.svg.style("width",i.width.toString()+"px").style("height",i.height.toString()+"px"),this.clearSvg&&this.clearSvg.style("width",i.width.toString()+"px").style("height",i.height.toString()+"px"),this.polygonInfo.reCalc(this.mapControl,i.width,i.height),this.shapeGraphicsContext.attr("transform",this.polygonInfo.transformToString(this.polygonInfo.transform));var n=r&&r.hasSelection(),s=this.shapeGraphicsContext.selectAll("polygon").data(e.shapeData,function(e){return e.key});s.enter().append("polygon").classed("shape",!0).attr("points",function(e){return e.path}),s.style("fill",function(e){return e.fill}).style("fill-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.selected,!1,n,!1)}).style("cursor","default"),a&&s.attr("points",function(e){return e.path}),s.exit().remove(),this.updateInternalDataLabels(i,o),this.tooltipsEnabled&&(t.TooltipManager.addTooltip(this.shapeGraphicsContext,function(e){return e.data.tooltipInfo}),s.style("pointer-events","all"));var l={shapeEventGroup:this.shapeGraphicsContext,shapes:s,clearCatcher:this.clearCatcher,dataPoints:e.shapeData};return l},i.prototype.getDataPointPadding=function(){return 12},i.getIndexOfLargestShape=function(e){for(var t=0,i=0,a=0,o=e.length;o>a;a++){var n=e[a],s=new r(n.absolute),l=Math.abs(r.calculateAbsolutePolygonArea(s.polygonPoints));l>i&&(t=a,i=l)}return t},i.prototype.updateInternalDataLabels=function(i,a){var r,o=this.dataLabelsSettings;if(o&&(o.show||o.showCategory)){var n=this.createLabelDataPoints();void 0===this.labelLayout&&(this.labelLayout=new e.FilledMapLabelLayout),r=this.labelLayout.layout(n,{width:i.width,height:i.height},this.polygonInfo.transform,a)}this.drawLabelStems(this.labelGraphicsContext,r,o.show,o.showCategory),t.NewDataLabelUtils.drawLabelBackground(this.labelGraphicsContext,r,e.visuals.DefaultBackgroundColor,e.visuals.DefaultFillOpacity),t.NewDataLabelUtils.drawDefaultLabels(this.labelGraphicsContext,r,!1,o.show&&o.showCategory)},i.prototype.clearMaxShapeDimension=function(){this.maxShapeDimension=0},i.prototype.setMaxShapeDimension=function(e,t){this.maxShapeDimension=Math.max(e,this.maxShapeDimension),this.maxShapeDimension=Math.max(t,this.maxShapeDimension)},i.prototype.createLabelDataPoints=function(){var a=this.mapRendererData,o=[];if(this.filledMapDataLabelsEnabled)for(var n=a.shapeData,s=this.dataLabelsSettings,l=0,c=n;l<c.length;l++){var u=c[l];if(u.displayLabel){var h=void 0,d=void 0,p=0,g=!1;if(this.dataLabelsSettings.show&&!this.dataLabelsSettings.showCategory){if(h=u.catagoryLabeltext,void 0===h)continue}else if(this.dataLabelsSettings.showCategory&&!this.dataLabelsSettings.show){if(h=u.labeltext,void 0===h)continue}else if(this.dataLabelsSettings.showCategory&&this.dataLabelsSettings.show){if(h=u.catagoryLabeltext,d=u.labeltext,void 0===h&&void 0===d)continue;g=!0}if(g){var m={text:d,fontFamily:t.NewDataLabelUtils.LabelTextProperties.fontFamily,fontSize:t.NewDataLabelUtils.LabelTextProperties.fontSize,fontWeight:t.NewDataLabelUtils.LabelTextProperties.fontWeight};p=e.TextMeasurementService.measureSvgTextWidth(m)}var f={text:h,fontFamily:t.NewDataLabelUtils.LabelTextProperties.fontFamily,fontSize:t.NewDataLabelUtils.LabelTextProperties.fontSize,fontWeight:t.NewDataLabelUtils.LabelTextProperties.fontWeight},y=e.TextMeasurementService.measureSvgTextWidth(f),v=e.TextMeasurementService.estimateSvgTextHeight(f);d&&void 0!==u.labeltext&&void 0!==u.catagoryLabeltext&&(v=2*v);var b={parentType:2,parentShape:{polygon:new r(u.absolutePointArray),validPositions:i.validLabelPolygonPositions},text:h,secondRowText:d,textSize:{width:Math.max(y,p),height:v},insideFill:s.labelColor,outsideFill:s.labelColor?s.labelColor:t.NewDataLabelUtils.defaultInsideLabelColor,isPreferred:!1,identity:void 0,hasBackground:!0};o.push(b)}}return o},i.prototype.drawLabelStems=function(e,i,a,r){var o=_.filter(i,function(e){return e.isVisible}),n=function(e,t){return e.identity?e.identity.getKeyWithoutHighlight():t};t.NewDataLabelUtils.drawLabelLeaderLines(e,o,n,t.LeaderLineColor)},i.validLabelPolygonPositions=[256,2,1,8,4,16,32,64,128],i}();t.MapShapeDataPointRenderer=s;var l=11,c=function(){function a(e){e.filledMap?(this.dataPointRenderer=new s(e.filledMapDataLabelsEnabled,e.tooltipsEnabled),this.filledMapDataLabelsEnabled=e.filledMapDataLabelsEnabled,this.isFilledMap=!0):(this.dataPointRenderer=new n(e.tooltipsEnabled),this.isFilledMap=!1),this.mapControlFactory=e.mapControlFactory?e.mapControlFactory:this.getDefaultMapControlFactory(),this.behavior=e.behavior,this.tooltipsEnabled=e.tooltipsEnabled,this.disableZooming=e.disableZooming,this.disablePanning=e.disablePanning,this.isLegendScrollable=!!e.behavior,this.viewChangeThrottleInterval=e.viewChangeThrottleInterval,this.enableCurrentLocation=e.enableCurrentLocation,this.boundsHaveBeenUpdated=!1}return a.prototype.init=function(i){var r=this,o=this.element=$("<div>");o.appendTo(i.element),this.pendingGeocodingRender=!1,this.currentViewport=i.viewport,this.style=i.style,this.colors=this.style.colorPalette.dataColors,this.behavior&&(this.interactivityService=t.createInteractivityService(i.host)),this.dataLabelsSettings=t.dataLabelUtils.getDefaultMapLabelSettings(),this.legend=e.visuals.createLegend(o,i.interactivity&&i.interactivity.isInteractiveLegend,this.interactivityService,this.isLegendScrollable),this.legendHeight=0,this.legendData={dataPoints:[]},this.geoTaggingAnalyzerService=e.createGeoTaggingAnalyzerService(i.host.getLocalizedString),this.host=i.host,i.host.locale&&(this.locale=i.host.locale()),this.geocoder=i.host.geocoder(),this.resetBounds(),this.mapControlFactory.ensureMap(this.locale,function(){a.removeHillShading(),Microsoft.Maps.loadModule("Microsoft.Maps.Overlays.Style",{callback:function(){r.initialize(o[0]),r.enableCurrentLocation&&r.createCurrentLocation(o)}})})},a.prototype.createCurrentLocation=function(e){var i,a=this,r=InJs.DomFactory.div().addClass("mapCurrentLocation").appendTo(e);r.on("click",function(){a.isCurrentLocation?(i&&a.mapControl.entities.remove(i),a.updateInternal(!1,!1),a.isCurrentLocation=!1):a.host.geolocation().getCurrentPosition(function(e){var r=new Microsoft.Maps.Location(e.coords.latitude,e.coords.longitude);i&&a.mapControl.entities.remove(i),i=t.MapUtil.CurrentLocation.createPushpin(r),a.mapControl.entities.push(i),a.updateMapView(r,l),a.isCurrentLocation=!0})})},a.prototype.addDataPoint=function(e){var t=e.location;this.updateBounds(t.latitude,t.longitude),this.scheduleRedraw()},a.prototype.scheduleRedraw=function(){var e=this;!this.pendingGeocodingRender&&this.mapControl&&(this.pendingGeocodingRender=!0,setTimeout(function(){e.updateInternal(!0,!0),e.pendingGeocodingRender=!1},3e3))},a.prototype.enqueueGeoCode=function(e){var t=this,i=this.geocoder.tryGeocodeImmediate(e.geocodingQuery,this.geocodingCategory);if(i)this.completeGeoCode(e,i);else{var a=this.geocodingContext;this.geocoder.geocode(e.geocodingQuery,this.geocodingCategory).then(function(i){i&&a===t.geocodingContext&&t.completeGeoCode(e,i)})}},a.prototype.completeGeoCode=function(e,t){e.location=t,this.addDataPoint(e)},a.prototype.enqueueGeoCodeAndGeoShape=function(e,t){var i=this,a=this.geocoder.tryGeocodeImmediate(e.geocodingQuery,this.geocodingCategory);if(a)this.completeGeoCodeAndGeoShape(e,t,a);else{var r=this.geocodingContext;this.geocoder.geocode(e.geocodingQuery,this.geocodingCategory).then(function(a){a&&r===i.geocodingContext&&i.completeGeoCodeAndGeoShape(e,t,a)})}},a.prototype.completeGeoCodeAndGeoShape=function(e,t,i){e.location=i,this.enqueueGeoShape(e,t)},a.prototype.enqueueGeoShape=function(e,t){var i=this,a=this.geocoder.tryGeocodeBoundaryImmediate(e.location.latitude,e.location.longitude,this.geocodingCategory,t.level,t.maxPolygons);if(a)this.completeGeoShape(e,t,a);else{var r=this.geocodingContext;this.geocoder.geocodeBoundary(e.location.latitude,e.location.longitude,this.geocodingCategory,t.level,t.maxPolygons).then(function(a){r===i.geocodingContext&&i.completeGeoShape(e,t,a)})}},a.prototype.completeGeoShape=function(e,i,a){var r;0===a.locations.length||a.locations[0].geographic?r=s.buildPaths(a.locations):(t.MapUtil.calcGeoData(a),r=s.buildPaths(a.locations)),e.paths=r,this.addDataPoint(e)},a.prototype.getOptimumLevelOfDetail=function(e,i){var a=this.dataPointRenderer.getDataPointCount();if(0===a)return t.MapUtil.MinLevelOfDetail;for(var r=this.dataPointRenderer.getDataPointPadding(),o=t.MapUtil.MaxLevelOfDetail;o>=t.MapUtil.MinLevelOfDetail;o--){var n=t.MapUtil.latLongToPixelXY(this.minLatitude,this.minLongitude,o),s=t.MapUtil.latLongToPixelXY(this.maxLatitude,this.maxLongitude,o);if(s.x-n.x+r<=e&&n.y-s.y+r<=i)return 2>a&&(o=Math.min(t.MapUtil.MaxAutoZoomLevel,o)),o}return t.MapUtil.MinLevelOfDetail},a.prototype.getViewCenter=function(e){var i=t.MapUtil.latLongToPixelXY(this.minLatitude,this.minLongitude,e),a=t.MapUtil.latLongToPixelXY(this.maxLatitude,this.maxLongitude,e);return t.MapUtil.pixelXYToLocation((i.x+a.x)/2,(a.y+i.y)/2,e)},a.prototype.resetBounds=function(){this.boundsHaveBeenUpdated=!1,this.minLongitude=t.MapUtil.MaxAllowedLongitude,this.maxLongitude=t.MapUtil.MinAllowedLongitude,this.minLatitude=t.MapUtil.MaxAllowedLatitude,this.maxLatitude=t.MapUtil.MinAllowedLatitude},a.prototype.updateBounds=function(e,t){this.boundsHaveBeenUpdated=!0,t<this.minLongitude&&(this.minLongitude=t),t>this.maxLongitude&&(this.maxLongitude=t),e<this.minLatitude&&(this.minLatitude=e),e>this.maxLatitude&&(this.maxLatitude=e)},a.legendObject=function(e){return e&&e.metadata&&e.metadata.objects&&e.metadata.objects.legend},a.isLegendHidden=function(e){var i=a.legendObject(e);return null!=i&&i[t.legendProps.show]===!1},a.legendPosition=function(e){var i=a.legendObject(e);return i&&t.LegendPosition[i[t.legendProps.position]]},a.getLegendFontSize=function(e){var i=a.legendObject(e);return i&&i[t.legendProps.fontSize]||t.SVGLegend.DefaultFontSizeInPt},a.isShowLegendTitle=function(e){var i=a.legendObject(e);return i&&i[t.legendProps.showTitle]},a.prototype.legendTitle=function(){var e=a.legendObject(this.dataView);return e&&e[t.legendProps.titleText]||this.legendData.title},a.prototype.renderLegend=function(e){var i=a.isLegendHidden(this.dataView),r=a.isShowLegendTitle(this.dataView),o=this.legendTitle(),n={dataPoints:i?[]:e.dataPoints,grouped:e.grouped,title:r?o:"",fontSize:a.getLegendFontSize(this.dataView)},s=a.legendPosition(this.dataView);void 0!==s?this.legend.changeOrientation(s):this.legend.changeOrientation(t.LegendPosition.Top),this.legend.drawLegend(n,this.currentViewport)},a.calculateGroupSizes=function(e,t,i,a,r){for(var o=e.values[0].values.length,n=t.length,s=0,l=o;l>s;++s){var c=null;if(a>=0)for(var u=0;n>u;++u){var h=t[u].values[a].values[s];h&&(null===c?c=h:c+=h)}i.push(c),c&&(r?(r.min=Math.min(r.min,c),r.max=Math.max(r.max,c)):r={min:c,max:c})}return r},a.calculateRadius=function(e,t){var i=e?e.max-e.min:0,a=6;return null!=e&&null!=t&&0!==i&&(a=14*((t-e.min)/i)+6),a},a.getGeocodingCategory=function(e,t){if(e&&e.categories&&e.categories.length>0&&e.categories[0].source){var i=e.categories[0].source.type;if(i&&i.categoryString)return t.getFieldType(i.categoryString);var a=e.categories[0].source.displayName,r=t.getFieldType(a);if(r)return r;var o=e.categories[0].source.roles;if(o)for(var n=Object.keys(o),s=0,l=n.length;l>s;++s){var c=t.getFieldType(n[s]);if(c)return c}}},a.hasSizeField=function(e,t){if(_.isEmpty(e))return!1;for(var i=0,a=e.length;a>i;i++){var r=e[i].source.roles;if(!r&&i===t&&e[i].source.type.numeric)return!0;if(r)for(var o=Object.keys(r),n=0,s=o.length;s>n;n++){var l=o[n];if("Size"===l)return!0}}return!1},a.shouldEnumerateDataPoints=function(e,t){var i=o.hasRoleInDataView(e,"Series"),a=t?"Size":"Gradient",r=o.hasRoleInDataView(e,a);return i||!r},a.shouldEnumerateCategoryLabels=function(e,t){return!e||t},a.prototype.enumerateObjectInstances=function(e){var i=new t.ObjectEnumerationBuilder;switch(e.objectName){case"dataPoint":if(a.shouldEnumerateDataPoints(this.dataView,this.isFilledMap)){var r=[],o=this.hasDynamicSeries;if(!o){var n=this.dataPointRenderer.converter(this.getMapViewPort(),this.dataView,this.dataLabelsSettings,this.interactivityService,this.tooltipsEnabled);r=n.bubbleData}a.enumerateDataPoints(i,this.dataPointsToEnumerate,this.colors,o,this.defaultDataPointColor,this.showAllDataPoints,r)}break;case"categoryLabels":a.shouldEnumerateCategoryLabels(this.isFilledMap,this.filledMapDataLabelsEnabled)&&t.dataLabelUtils.enumerateCategoryLabels(i,this.dataLabelsSettings,!0,!0);break;case"legend":this.hasDynamicSeries&&a.enumerateLegend(i,this.dataView,this.legend,this.legendTitle());break;case"labels":if(this.filledMapDataLabelsEnabled){this.dataLabelsSettings=this.dataLabelsSettings?this.dataLabelsSettings:t.dataLabelUtils.getDefaultMapLabelSettings();
24var s={enumeration:i,dataLabelsSettings:this.dataLabelsSettings,show:!0,displayUnits:!0,precision:!0};t.dataLabelUtils.enumerateDataLabels(s)}}return i.complete()},a.enumerateDataPoints=function(e,a,r,o,n,s,l){var c=a&&a.length;if(o)for(var u=0;c>u;u++){var h=a[u];e.pushInstance({objectName:"dataPoint",displayName:h.label,selector:t.ColorHelper.normalizeSelector(h.identity.getSelector()),properties:{fill:{solid:{color:h.color}}}})}else if(e.pushInstance({objectName:"dataPoint",selector:null,properties:{defaultColor:{solid:{color:n||r.getColorByIndex(0).value}}}}).pushInstance({objectName:"dataPoint",selector:null,properties:{showAllDataPoints:!!s}}),l)for(var u=0;u<l.length;u++){var d=l[u];e.pushInstance({objectName:"dataPoint",displayName:d.labeltext,selector:t.ColorHelper.normalizeSelector(d.identity.getSelector()),properties:{fill:{solid:{color:i.normalizeToHexString(d.fill)}}}})}},a.enumerateLegend=function(e,i,r,o){e.pushInstance({selector:null,properties:{show:!a.isLegendHidden(i),position:t.LegendPosition[r.getOrientation()],showTitle:a.isShowLegendTitle(i),titleText:o,fontSize:a.getLegendFontSize(i)},objectName:"legend"})},a.prototype.onDataChanged=function(i){var r=this;this.resetBounds(),this.geocodingContext={},this.behavior&&this.behavior.resetZoomPan(),this.dataLabelsSettings=t.dataLabelUtils.getDefaultMapLabelSettings(),this.defaultDataPointColor=null,this.showAllDataPoints=null;var o=this.dataView=i.dataViews[0],n=this.isFilledMap,l=[],c={dataPoints:[],geocodingCategory:null,hasDynamicSeries:!1,hasSize:!1};if(o){if(o.metadata&&o.metadata.objects){var u=o.metadata.objects;if(this.defaultDataPointColor=e.DataViewObjects.getFillColor(u,t.mapProps.dataPoint.defaultColor),this.showAllDataPoints=e.DataViewObjects.getValue(u,t.mapProps.dataPoint.showAllDataPoints),this.dataLabelsSettings.showCategory=e.DataViewObjects.getValue(u,t.filledMapProps.categoryLabels.show,this.dataLabelsSettings.showCategory),n){this.dataLabelsSettings.precision=e.DataViewObjects.getValue(u,t.filledMapProps.labels.labelPrecision,this.dataLabelsSettings.precision),this.dataLabelsSettings.precision=this.dataLabelsSettings.precision!==t.dataLabelUtils.defaultLabelPrecision&&this.dataLabelsSettings.precision<0?0:this.dataLabelsSettings.precision,this.dataLabelsSettings.displayUnits=e.DataViewObjects.getValue(u,t.filledMapProps.labels.labelDisplayUnits,this.dataLabelsSettings.displayUnits);var h=u.labels;h&&(this.dataLabelsSettings.show=void 0!==h.show?h.show:this.dataLabelsSettings.show,void 0!==h.color&&(this.dataLabelsSettings.labelColor=h.color.solid.color))}else{var d=u.categoryLabels;d&&t.dataLabelUtils.updateLabelSettingsFromLabelsObject(d,this.dataLabelsSettings)}}var p=new t.ColorHelper(this.colors,t.mapProps.dataPoint.fill,this.defaultDataPointColor);c=a.converter(o,p,this.geoTaggingAnalyzerService,n),this.hasDynamicSeries=c.hasDynamicSeries,this.legendData=a.createLegendData(o,p),this.dataPointsToEnumerate=this.legendData.dataPoints,this.renderLegend(this.legendData),null!=c?(this.geocodingCategory=c.geocodingCategory,this.mapControlFactory.ensureMap(this.locale,function(){a.removeHillShading();var e;n&&(e=s.getFilledMapParams(r.geocodingCategory,c.dataPoints.length));for(var t=0,i=c.dataPoints;t<i.length;t++){var o=i[t];o.location?n&&!o.paths?r.enqueueGeoShape(o,e):r.addDataPoint(o):_.isEmpty(o.categoryValue)||(n?r.enqueueGeoCodeAndGeoShape(o,e):r.enqueueGeoCode(o))}})):this.clearDataPoints(),n&&(this.geocodingCategory&&this.geoTaggingAnalyzerService.isGeoshapable(this.geocodingCategory)||l.push(new t.FilledMapWithoutValidGeotagCategoryWarning))}else this.clearDataPoints(),this.renderLegend({dataPoints:[],title:void 0}),this.dataPointsToEnumerate=[];_.isEmpty(l)||this.host.setWarnings(l),this.dataPointRenderer.setData(c),this.updateInternal(!0,!0)},a.converter=function(r,o,n,s){var l=e.data.createIDataViewCategoricalReader(r),c=[],u=l.hasDynamicSeries(),h=l.getSeriesColumnIdentityFields(),d=l.getMeasureQueryName("Size");null==d&&(d="");var p=l.hasValues("Size"),g=null,m=t.mapProps.general.formatString;if(l.hasCategories()){var f=[],y=void 0;if(p){for(var v=void 0,b=void 0,C=0,S=l.getCategoryCount();S>C;C++){for(var x=void 0,w=0,P=l.getSeriesCount();P>w;w++){var D=l.getValue("Size",C,w);null==x&&null!=D&&(x=0),null!=x&&(x+=D)}f.push(x),null!=x&&((void 0===v||v>x)&&(v=x),(void 0===b||x>b)&&(b=x))}y=void 0!==v&&void 0!==b?{max:b,min:v}:void 0}var L=l.hasCompositeCategories()&&l.hasCategoryWithRole("X")&&l.hasCategoryWithRole("Y"),T=l.hasCategoryWithRole("Category");if(g=a.getGeocodingCategory(r.categorical,n),L||T)for(var C=0,S=l.getCategoryCount();S>C;C++){var _=void 0,V=T?l.getCategoryObjects("Category",C):l.getCategoryObjects("Y",C),M=void 0,N=void 0,A=void 0,O=void 0,I=void 0,R=void 0,F=void 0;if(T){if(_=l.getCategoryValue("Category",C),N={displayName:l.getCategoryDisplayName("Category"),value:t.converterHelper.formatFromMetadataColumn(_,l.getCategoryMetadataColumn("Category"),m)},l.hasValues("Y")&&l.hasValues("X")){var H=l.getFirstNonNullValueForCategory("Y",C),z=l.getFirstNonNullValueForCategory("X",C);null!=H&&null!=z&&(M={latitude:H,longitude:z}),A={displayName:l.getValueDisplayName("Y"),value:t.converterHelper.formatFromMetadataColumn(H,l.getValueMetadataColumn("Y"),m)},O={displayName:l.getValueDisplayName("X"),value:t.converterHelper.formatFromMetadataColumn(z,l.getValueMetadataColumn("X"),m)}}}else{var H=l.getCategoryValue("Y",C),z=l.getCategoryValue("X",C);null!=H&&null!=z&&(_=H+", "+z,M={latitude:H,longitude:z},A={displayName:l.getCategoryDisplayName("Y"),value:t.converterHelper.formatFromMetadataColumn(H,l.getCategoryMetadataColumn("Y"),m)},O={displayName:l.getCategoryDisplayName("X"),value:t.converterHelper.formatFromMetadataColumn(z,l.getCategoryMetadataColumn("X"),m)})}var G=p?f[C]:void 0,j=[],P=l.getSeriesCount();p||u||(P=1);for(var w=0;P>w;w++){var k=void 0;k=u?o.getColorForSeriesValue(l.getSeriesObjects(w),h,l.getSeriesName(w)):l.hasCategoryWithRole("Series")?o.getColorForSeriesValue(l.getCategoryObjects("Series",C),l.getCategoryColumnIdentityFields("Series"),_):o.getColorForMeasure(V,d);var E=i.parseColorString(k),W=i.hexString(i.darken(E,a.StrokeDarkenColorValue));E.A=.6;var B=i.rgbString(E),U=(new t.SelectionIdBuilder).withCategory(l.getCategoryColumn(T?"Category":"Y"),C).withMeasure(d);u&&(U=U.withSeries(l.getSeriesValueColumns(),l.getSeriesValueColumnGroup(w))),u&&(I={displayName:l.getSeriesDisplayName(),value:t.converterHelper.formatFromMetadataColumn(l.getSeriesName(w),l.getSeriesMetadataColumn(),m)});var K=void 0;p&&(K=l.getValue("Size",C,w),R={displayName:l.getValueDisplayName("Size"),value:t.converterHelper.formatFromMetadataColumn(K,l.getValueMetadataColumn("Size",w),m)}),l.hasValues("Gradient")&&(F={displayName:l.getValueDisplayName("Gradient"),value:t.converterHelper.formatFromMetadataColumn(l.getValue("Gradient",C,w),l.getValueMetadataColumn("Gradient",w),m)});var X=[];N&&X.push(N),I&&X.push(I),A&&X.push(A),O&&X.push(O),R&&X.push(R),F&&X.push(F),(K||!p||0===K&&s)&&j.push({value:K,fill:B,stroke:W,identity:U.createSelectionId(),tooltipInfo:X})}(G||!p||0===G&&s)&&c.push({geocodingQuery:_,value:G,categoryValue:_,subDataPoints:j,radius:a.calculateRadius(y,G),location:M})}}var Y={dataPoints:c,geocodingCategory:g,hasDynamicSeries:u,hasSize:p};return Y},a.createLegendData=function(i,a){var r,o=e.data.createIDataViewCategoricalReader(i),n=[];if(o.hasDynamicSeries()){r=o.getSeriesDisplayName();for(var s=o.getSeriesColumnIdentityFields(),l=0,c=o.getSeriesCount();c>l;l++){var u=a.getColorForSeriesValue(o.getSeriesObjects(l),s,o.getSeriesName(l)),h=(new t.SelectionIdBuilder).withSeries(o.getSeriesValueColumns(),o.getSeriesValueColumnGroup(l)).createSelectionId();n.push({color:u,label:t.valueFormatter.format(o.getSeriesName(l)),icon:t.LegendIcon.Circle,identity:h,selected:!1})}}var d={dataPoints:n,title:r};return d},a.prototype.swapLogoContainerChildElement=function(){var e=this.element.find(".LogoContainer");if(e){var t=e.find("a");if(null==t)return;var i=$("<div>");t.children().clone().appendTo(i),t.remove(),i.appendTo(e)}},a.prototype.onResizing=function(e){this.currentViewport.width===e.width&&this.currentViewport.height===e.height||(this.currentViewport=e,this.renderLegend(this.legendData),this.updateInternal(!1,!1))},a.prototype.initialize=function(e){var i=this,r={credentials:t.MapUtil.Settings.BingKey,showMapTypeSelector:!1,enableClickableLogo:!1,enableSearchLogo:!1,mapTypeId:Microsoft.Maps.MapTypeId.road,customizeOverlays:!0,showDashboard:!1,showScalebar:!1,disableKeyboardInput:!0,disableZooming:this.disableZooming,disablePanning:this.disablePanning},o=this.root=InJs.DomFactory.div().addClass(a.MapContainer.cssClass).appendTo(e);this.mapControl=this.mapControlFactory.createMapControl(o[0],r),void 0!==this.viewChangeThrottleInterval?Microsoft.Maps.Events.addThrottledHandler(this.mapControl,"viewchange",function(){i.onViewChanged()},this.viewChangeThrottleInterval):Microsoft.Maps.Events.addHandler(this.mapControl,"viewchange",function(){i.onViewChanged()}),Microsoft.Maps.Events.addHandler(this.mapControl,"viewchangeend",function(){i.onViewChangeEnded()}),this.dataPointRenderer.init(this.mapControl,o,!!this.behavior),this.pendingGeocodingRender||this.updateInternal(!0,!0)},a.prototype.onViewChanged=function(){this.updateOffsets(!1,!1),this.behavior&&this.behavior.viewChanged(),this.swapLogoContainerChildElement()},a.prototype.onViewChangeEnded=function(){this.dataPointRenderer.updateInternalDataLabels(this.currentViewport,!0)},a.prototype.getMapViewPort=function(){var e=this.currentViewport,t=this.legend.getMargins(),i={width:e.width-t.width,height:e.height-t.height};return i},a.removeTransform3d=function(e){var t=window.navigator.userAgent.toLowerCase();if(e&&-1===t.indexOf("applewebkit")){var i=e.find("img");i.css("transform","")}},a.prototype.updateInternal=function(e,t){if(this.mapControl){var i=this.legend.isVisible();i||(this.legendData={dataPoints:[]});var r=this.element.children(a.MapContainer.selector),o=this.getMapViewPort();if(r.height(o.height),r.width(o.width),this.updateOffsets(e,t),this.boundsHaveBeenUpdated&&(!this.behavior||!this.behavior.hasReceivedZoomOrPanEvent())){var n=this.getOptimumLevelOfDetail(o.width,o.height),s=this.getViewCenter(n);this.updateMapView(s,n)}}},a.prototype.updateMapView=function(e,t){this.mapControl.setView({center:e,zoom:t,animate:!0})},a.prototype.updateOffsets=function(e,i){var a,r=this.dataView,o=this.getMapViewPort();a=r&&r.categorical?this.dataPointRenderer.converter(o,this.dataView,this.dataLabelsSettings,this.interactivityService,this.tooltipsEnabled):{bubbleData:[],shapeData:[],sliceData:[]};var n=this.dataPointRenderer.updateInternal(a,o,e,this.interactivityService,i);t.Legend.positionChartArea(d3.select(this.root[0]),this.legend),this.interactivityService&&n&&this.interactivityService.bind(n.dataPoints,this.behavior,n)},a.prototype.onClearSelection=function(){this.interactivityService.clearSelection(),this.updateOffsets(!1,!1)},a.prototype.clearDataPoints=function(){this.dataPointRenderer.clearDataPoints(),this.legend.drawLegend({dataPoints:[]},this.currentViewport)},a.prototype.getDefaultMapControlFactory=function(){return{createMapControl:function(e,t){return new Microsoft.Maps.Map(e,t)},ensureMap:jsCommon.ensureMap}},a.removeHillShading=function(){Microsoft.Maps.Globals.roadUriFormat=Microsoft.Maps.Globals.roadUriFormat.replace("&shading=hill","")},a.MapContainer={cssClass:"mapControl",selector:".mapControl"},a.StrokeDarkenColorValue=63.75,a}();t.Map=c}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){function i(e){e.append("div").classed("imgCon",!0).append("img")}function a(e,t){e.selectAll(".imgCon").style({height:r(t.maxHeight)}).selectAll("img").style({"max-height":r(t.maxHeight),"max-width":r(t.maxWidth)})}function r(e){return e+"px"}var o=e.visuals.KpiUtil.getKpiImageMetadata,n=jsCommon.CssConstants.createClassAndSelector,s=jsCommon.PixelConverter,l=jsCommon.UrlUtils,c=e.visuals.controls.internal.TablixUtils.EdgeSettings,u="wf_segoe-ui_semibold",h="wf_segoe-ui_normal",d=10,p=13,g=9,m="#767676",f="#333333",y="#ACACAC",v=t.outline.none,b="#E8E8E8",C=1,S=!0,x="#A6A6A6",w=t.outline.leftOnly,P=3,D=function(){function D(){this.isInteractivityOverflowHidden=!1}return D.prototype.init=function(e){this.options=e,this.style=e.style;var t=this.currentViewport=e.viewport,i=this.interactivity=e.interactivity;i&&"hidden"===i.overflow&&(this.isInteractivityOverflowHidden=!0);var a=this.element=$("<div/>").addClass(D.MultiRowCardRoot["class"]).css({height:r(t.height)});e.element.append(a),this.initializeCardRowSelection()},D.prototype.onDataChanged=function(i){var a=i.dataViews;if(a&&a.length>0){var r=this.dataView=a[0],o=r.table.columns,n=r.table.rows,s=i.operationKind!==e.VisualDataChangeOperationKind.Append,l=this.data=D.converter(r,o.length,n.length,this.isInteractivityOverflowHidden);this.setCardDimensions(),this.listView.data(l.dataModel,function(e){return l.dataModel.indexOf(e)},s)}else this.data={dataModel:[],dataColumnCount:0,cardTitleSettings:t.dataLabelUtils.getDefaultLabelSettings(!0,m,p),categoryLabelsSettings:t.dataLabelUtils.getDefaultLabelSettings(!0,y,g),dataLabelsSettings:t.dataLabelUtils.getDefaultLabelSettings(!0,f,d),cardSettings:D.getCardSettings(null)};this.waitingForData=!1},D.getCardSettings=function(i){var a=i&&i.metadata&&i.metadata.objects?i.metadata.objects:null,r={outline:e.DataViewObjects.getValue(a,t.multiRowCardProps.card.outline,v),color:e.DataViewObjects.getFillColor(a,t.multiRowCardProps.card.outlineColor,b),weight:e.DataViewObjects.getValue(a,t.multiRowCardProps.card.outlineWeight,C)},o=e.DataViewObjects.getValue(a,t.multiRowCardProps.card.barShow,S),n={outline:o?w:t.outline.none,color:e.DataViewObjects.getFillColor(a,t.multiRowCardProps.card.barColor,x),weight:e.DataViewObjects.getValue(a,t.multiRowCardProps.card.barWeight,P)},s=e.DataViewObjects.getValue(a,t.multiRowCardProps.card.cardPadding,D.DefaultStyle.row.marginBottom),l=e.DataViewObjects.getFillColor(a,t.multiRowCardProps.card.cardBackground,D.DefaultStyle.row.background);return{outlineSettings:r,barSettings:n,cardPadding:s,cardBackground:l}},D.prototype.onResizing=function(e){var t=this.currentViewport.height===e.height;if(this.currentViewport=e,this.element.css("height",r(e.height)),this.dataView){var i=this.maxColPerRow;this.maxColPerRow=this.getMaxColPerRow();var a=i===this.maxColPerRow;t&&a||this.listView.viewport(e)}},D.converter=function(i,a,r,n){void 0===n&&(n=!1);var s,c,u,h=[],v=i.table.rows,b=i.table.columns;if(s=t.dataLabelUtils.getDefaultLabelSettings(!0,m,p),c=t.dataLabelUtils.getDefaultLabelSettings(!0,f,d),u=t.dataLabelUtils.getDefaultLabelSettings(!0,y,g),i.metadata&&i.metadata.objects){var C=e.DataViewObjects.getObject(i.metadata.objects,"cardTitle");t.dataLabelUtils.updateLabelSettingsFromLabelsObject(C,s);var S=e.DataViewObjects.getObject(i.metadata.objects,"dataLabels");t.dataLabelUtils.updateLabelSettingsFromLabelsObject(S,c);var x=e.DataViewObjects.getObject(i.metadata.objects,"categoryLabels");t.dataLabelUtils.updateLabelSettingsFromLabelsObject(x,u)}for(var w=0,P=r;P>w;w++){for(var L=v[w],T=void 0,_=void 0,V=!1,M=!1,N=!1,A=[],O=0;a>O;O++){var I=b[O],R=o(I,L[O]),F=void 0,H=void 0;R&&(F=R["class"],H=R.statusGraphic),F||(F=t.valueFormatter.format(L[O],t.valueFormatter.getFormatString(I,D.formatStringProp)));var z=void 0!==R&&void 0!==R.caption,G=b[O].displayName;n||I.type.numeric||(void 0===T?(T=!0,_=F,V=t.converterHelper.isWebUrlColumn(I)&&l.isValidUrl(_),M=t.converterHelper.isImageUrlColumn(I)&&l.isValidImageUrl(F),N=z):T&&(T=!1)),A.push({caption:F,details:G,showURL:t.converterHelper.isWebUrlColumn(I)&&l.isValidUrl(F),showImage:t.converterHelper.isImageUrlColumn(I)&&l.isValidImageUrl(F),showKPI:z,columnIndex:O})}h.push({title:T?_:void 0,showTitleAsURL:V,showTitleAsImage:M,showTitleAsKPI:N,cardItemsData:T?A.filter(function(e){return e.caption!==_}):A})}return{dataModel:h,dataColumnCount:h[0]?h[0].cardItemsData.length:0,cardTitleSettings:s,categoryLabelsSettings:u,dataLabelsSettings:c,cardSettings:D.getCardSettings(i)}},D.getSortableRoles=function(e){if(e&&e.dataViewMappings&&!_.isEmpty(e.dataViewMappings))for(var t=0,i=e.dataViewMappings;t<i.length;t++){var a=i[t];if(a.table){var r=a.table.rows;if(r&&r["for"]&&r["for"]["in"]&&r["for"]["in"].items)return[D.ValuesRole]}}},D.prototype.initializeCardRowSelection=function(){var o=this,n=this.isInteractivityOverflowHidden,l=function(e){var t=e.append("div").classed(D.Card["class"],!0);n?t.classed("mrtile",!0):o.cardHasTitle&&t.append("div").classed(D.Title["class"],!0).each(function(e){e.showTitleAsImage?i(d3.select(this)):e.showTitleAsURL?d3.select(this).append("a"):e.showTitleAsKPI&&d3.select(this).append("div").classed(D.KPITitle["class"],!0).classed(e.title,!0).style({display:"inline-block",verticalAlign:"sub"})});var a=t.selectAll(D.CardItemContainer.selector).data(function(e){return e.cardItemsData}).enter().append("div").classed(D.CardItemContainer["class"],!0);a.append("div").classed(D.Caption["class"],!0).each(function(e){e.showURL?d3.select(this).append("a"):e.showImage?i(d3.select(this)):e.showKPI&&d3.select(this).append("div").classed(e.caption,!0).style({display:"inline-block",verticalAlign:"sub"})}),a.append("div").classed(D.Details["class"],!0)},c=function(t){var i=o.getStyle(),l=e.TextMeasurementService.estimateSvgTextHeight(D.getTextProperties(!1,i.caption.fontSize)),c=e.TextMeasurementService.estimateSvgTextHeight(D.getTextProperties(!1,i.details.fontSize)),u=e.TextMeasurementService.estimateSvgTextHeight(D.getTextProperties(!0,i.title.fontSize)),h=o.getBorderStyles(i.row.border);t.style(h).style({"margin-bottom":n?"0px":o.isSingleRowCard?"0px":r(i.row.marginBottom),background:i.row.background}),!n&&o.cardHasTitle&&(t.selectAll(D.Title.selector).filter(function(e){return!e.showTitleAsImage&&!e.showTitleAsKPI}).style({"font-size":s.fromPoint(i.title.fontSize),"line-height":s.toString(u),color:i.title.color}),t.selectAll(D.Title.selector).filter(function(e){return!e.showTitleAsURL&&!e.showTitleAsImage&&!e.showTitleAsKPI}).text(function(e){return e.title}).attr("title",function(e){return e.title}),t.selectAll(D.TitleUrlSelector).text(function(e){return e.title}).attr({href:function(e){return e.title},target:"_blank"}),t.selectAll(D.TitleImageSelector).attr("src",function(e){return e.title}),a(t.selectAll(D.Title.selector),i.imageTitle),t.selectAll(D.KPITitle.selector).each(function(e){var t=d3.select(this);t.classed(e.title)}));var d=t.selectAll(D.Card.selector),p=o.getBorderStyles(i.card.border);d.style(p),d.selectAll(D.Caption.selector).filter(function(e){return!e.showImage}).style({"line-height":s.toString(l),"font-size":s.fromPoint(i.caption.fontSize)}).filter(function(e){return!e.showKPI}).style({color:i.caption.color}).filter(function(e){return!e.showURL}).text(function(e){return e.caption}).attr("title",function(e){return e.caption}),d.selectAll(D.CaptionImageSelector).attr("src",function(e){return e.caption}).style(i.imageCaption),d.selectAll(D.CardItemContainer.selector).style({"padding-right":function(e){return o.isLastRowItem(e.columnIndex,o.dataView.metadata.columns.length)?"0px":r(i.cardItemContainer.paddingRight)},width:function(e){return o.getColumnWidth(e.columnIndex,o.data.dataColumnCount)},display:function(e){return o.hideColumn(e.columnIndex)?"none":"inline-block"}}),a(d.selectAll(D.Caption.selector),i.imageCaption),d.selectAll(D.CaptionUrlSelector).attr({href:function(e){return e.caption},target:"_blank"}).text(function(e){return e.caption}),i.details.isVisible&&d.selectAll(D.Details.selector).text(function(e){return e.details}).style({"font-size":s.fromPoint(i.details.fontSize),"line-height":s.toString(c),color:i.details.color}).attr("title",function(e){return e.details})},u=function(e){e.remove()},h={rowHeight:void 0,enter:l,exit:u,update:c,loadMoreData:function(){return o.onLoadMoreData()},viewport:this.currentViewport,baseContainer:d3.select(this.element.get(0)),scrollEnabled:!this.isInteractivityOverflowHidden,isReadMode:function(){return 1!==o.options.host.getViewMode()}};this.listView=t.ListViewFactory.createListView(h)},D.prototype.getBorderStyles=function(e){return{"border-top":e&&e.top?e.top.getCSS():"","border-right":e&&e.right?e.right.getCSS():"","border-bottom":e&&e.bottom?e.bottom.getCSS():"","border-left":e&&e.left?e.left.getCSS():""}},D.prototype.getMaxColPerRow=function(){var e=this.currentViewport.width,t=this.getStyle().cardItemContainer.minWidth,i=this.data.dataColumnCount,a=Math.floor(e/t)||1;return Math.min(i,a)},D.prototype.getRowIndex=function(e){return Math.floor(1*e/this.getMaxColPerRow())},D.prototype.getStyle=function(){var e=D.DefaultStyle,t=this.getCustomStyles();if(!this.isInteractivityOverflowHidden)return $.extend(!0,{},e,t);for(var i=this.currentViewport.width,a={},r=0,o=D.tileMediaQueries;r<o.length;r++){var n=o[r];if(i<=n.maxWidth){a=n.style;break}}return $.extend(!0,{},e,t,a)},D.prototype.getSurroundSettings=function(e){var i=new c(e.weight,e.color),a=e.outline;return{top:t.outline.showTop(a)?i:null,right:t.outline.showRight(a)?i:null,bottom:t.outline.showBottom(a)?i:null,left:t.outline.showLeft(a)?i:null}},D.prototype.getCustomStyles=function(){var e=this.data.dataLabelsSettings,t=this.data.categoryLabelsSettings,i=this.data.cardTitleSettings,a=this.data.cardSettings,r={row:{border:this.getSurroundSettings(a.outlineSettings),marginBottom:a.cardPadding,background:a.cardBackground},card:{border:this.getSurroundSettings(a.barSettings)},details:{fontSize:t.fontSize,color:t.labelColor,isVisible:t.show},caption:{fontSize:e.fontSize,color:e.labelColor},title:{fontSize:i.fontSize,color:i.labelColor}};return r},D.getTextProperties=function(e,t){return{fontFamily:e?u:h,fontSize:s.fromPoint(t)}},D.prototype.hideColumn=function(e){var t=this.getRowIndex(e),i=this.getStyle().card.maxRows;return i&&t>=i},D.prototype.getColumnWidth=function(e,t){var i=this.getMaxColPerRow();if(i>=t)return 100/t+"%";var a=this.getRowIndex(e),r=Math.ceil(1*t/i),o=t%i;return r>a||0===o?100/i+"%":100/o+"%"},D.prototype.isLastRowItem=function(e,t){if(e+1===t)return!0;var i=this.getMaxColPerRow();return i-e%i===1},D.prototype.setCardDimensions=function(){this.cardHasTitle=!1;var e=this.data.dataModel;!this.isInteractivityOverflowHidden&&e&&e.length>0&&(this.cardHasTitle=void 0!==e[0].title,this.isSingleRowCard=1===e.length)},D.prototype.onLoadMoreData=function(){!this.waitingForData&&this.dataView.metadata&&this.dataView.metadata.segment&&(this.options.host.loadMoreData(),this.waitingForData=!0)},D.getDataLabelSettingsOptions=function(e,t,i){return void 0===i&&(i=!1),{enumeration:e,dataLabelsSettings:t,show:i,fontSize:!0}},D.prototype.enumerateObjectInstances=function(e){var i=new t.ObjectEnumerationBuilder,a=this.data.cardTitleSettings,r=this.data.dataLabelsSettings,o=this.data.categoryLabelsSettings;switch(e.objectName){case"cardTitle":!this.isInteractivityOverflowHidden&&this.cardHasTitle&&t.dataLabelUtils.enumerateDataLabels(D.getDataLabelSettingsOptions(i,a));break;case"dataLabels":t.dataLabelUtils.enumerateDataLabels(D.getDataLabelSettingsOptions(i,r));break;case"categoryLabels":t.dataLabelUtils.enumerateDataLabels(D.getDataLabelSettingsOptions(i,o,!0));break;case t.multiRowCardProps.card.outline.objectName:this.enumerateCard(i)}return i.complete()},D.prototype.enumerateCard=function(e){var i=this.data.cardSettings,a=t.multiRowCardProps.card,r={},o=i.outlineSettings;r[a.outline.propertyName]=o.outline,o.outline!==t.outline.none&&(r[a.outlineColor.propertyName]=o.color,r[a.outlineWeight.propertyName]=o.weight);var n=i.barSettings,s=n.outline!==t.outline.none;r[a.barShow.propertyName]=s,s&&(r[a.barColor.propertyName]=n.color,r[a.barWeight.propertyName]=n.weight),r[a.cardPadding.propertyName]=i.cardPadding,r[a.cardBackground.propertyName]=i.cardBackground,e.pushInstance({selector:null,objectName:a.outline.objectName,properties:r})},D.formatStringProp={objectName:"general",propertyName:"formatString"},D.MultiRowCardRoot=n("multiRowCard"),D.Card=n("card"),D.Title=n("title"),D.CardItemContainer=n("cardItemContainer"),D.Caption=n("caption"),D.Details=n("details"),D.TitleUrlSelector=D.Title.selector+" a",D.CaptionUrlSelector=D.Caption.selector+" a",D.TitleImageSelector=D.Title.selector+" img",D.CaptionImageSelector=D.Caption.selector+" img",D.KPITitle=n("kpiTitle"),D.ValuesRole="Values",D.DefaultStyle={row:{border:null,marginBottom:20,background:void 0},card:{border:null},cardItemContainer:{paddingRight:20,minWidth:120},imageCaption:{maxHeight:75,maxWidth:100},imageTitle:{maxHeight:75,maxWidth:100}},D.tileMediaQueries=[{maxWidth:250,style:{card:{maxRows:2},cardItemContainer:{minWidth:110},imageCaption:{maxHeight:45}}},{maxWidth:490,style:{card:{maxRows:2},cardItemContainer:{minWidth:130},imageCaption:{maxHeight:52}}},{maxWidth:750,style:{card:{maxRows:1},cardItemContainer:{minWidth:120},imageCaption:{maxHeight:53}}}],D}();t.MultiRowCard=D}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.CssConstants.createClassAndSelector,a=jsCommon.KeyUtils,r=jsCommon.StringExtensions,o=jsCommon.UrlUtils,n=function(){function e(){}return e.prototype.init=function(e){this.element=e.element,this.host=e.host,this.viewport=e.viewport,this.readOnly=0===this.host.getViewMode(),this.paragraphs=[],this.refreshView()},e.prototype.onResizing=function(e){this.viewport=e,this.updateSize()},e.prototype.onDataChanged=function(e){var t=e.dataViews;if(this.paragraphs=[],t&&t.length>0){var i=t[0].metadata.objects;i&&i.general&&(this.paragraphs=i.general.paragraphs)}this.refreshView()},e.prototype.destroy=function(){},e.prototype.focus=function(){return this.editor?(this.editor.focus(),!0):void 0},e.prototype.onViewModeChanged=function(e){this.readOnly=0===e,this.refreshView()},e.prototype.setSelection=function(e,t){this.editor&&this.editor.setSelection(e,t)},e.prototype.refreshView=function(){var t=this;if(this.readOnly){this.editor&&(this.saveContents(),this.editor.destroy(),this.editor=null),this.element.empty();var i=s.convertParagraphsToHtml(this.paragraphs);i.addClass(e.ClassName),i.css({"font-family":l.defaultFont,"font-size":l.defaultFontSize}),this.element.append(i)}else{if(!this.editor){this.editor=new l.QuillWrapper(this.readOnly,this.host),this.editor.textChanged=function(e,i){return t.saveContents()},this.element.empty();var a=this.editor.getElement();a.addClass(e.ClassName),a.css({"font-family":l.defaultFont,"font-size":l.defaultFontSize}),this.element.append(a)}this.editor.setContents(s.convertParagraphsToOps(this.paragraphs))}this.updateSize()},e.prototype.saveContents=function(){if(this.editor){var e=this.editor.getContents();this.paragraphs=s.convertDeltaToParagraphs(e);var t=[{objectName:"general",properties:{paragraphs:this.paragraphs},selector:null}];this.host.persistProperties(t)}},e.prototype.updateSize=function(){this.editor&&this.editor.resize(this.viewport)},e.ClassName="textbox",e}();t.Textbox=n;var s;!function(e){function t(e){for(var t=[],i={textRuns:[]},a=0,r=e.ops.length;r>a;a++){var s=e.ops[a];if("string"==typeof s.insert){var l=s.insert,c=s.attributes;c&&c.align&&(i.horizontalTextAlignment=c.align);var u=0,h=0,d=void 0;do{if(h=l.indexOf("\n",u),0>h?(d=!1,h=l.length):d=!0,h-u>0){var p=l.substring(u,h),g={value:p};if(c){void 0!==c.link&&o.isValidUrl(c.link)&&(g.url=c.link);var m=n(c);m&&(g.textStyle=m)}i.textRuns.push(g)}d&&(0===i.textRuns.length&&i.textRuns.push({value:""}),t.push(i),i={textRuns:[]}),u=h+1}while(u<l.length)}}return i.textRuns.length>0&&i.textRuns[0].value.length>0&&t.push(i),t}function i(e){for(var t=$(),i=0,a=e.length;a>i;++i){var r=e[i],n=!0,c=$("<div>");r.horizontalTextAlignment&&c.css("text-align",r.horizontalTextAlignment);for(var u=0,h=r.textRuns.length;h>u;++u){var d=r.textRuns[u],p=$("<span>"),g=d.textStyle;if(g){var m={};g.fontFamily&&(m["font-family"]=l.getCssFontFamily(s(g.fontFamily))),g.fontSize&&(m["font-size"]=g.fontSize),g.fontStyle&&(m["font-style"]=g.fontStyle),g.fontWeight&&(m["font-weight"]=g.fontWeight),g.textDecoration&&(m["text-decoration"]=g.textDecoration),p.css(m)}var f=d.value;if(_.isEmpty(f)||(n=!1),void 0!==d.url){var y=void 0;y=o.isValidUrl(d.url)?$("<a>").attr("href",d.url).attr("target","_blank").text(f):$("<span>").text(f),p.append(y)}else p.text(f);c.append(p)}n&&c.append($("<br>")),t=t.add(c)}return t}function a(e){for(var t=[],i=0,a=e.length;a>i;++i)for(var n=e[i],c=0,u=n.textRuns.length;u>c;++c){var h=n.textRuns[c],d={};n.horizontalTextAlignment&&(d.align=n.horizontalTextAlignment);var p=h.textStyle;p&&(p.fontFamily&&(d.font=l.getCssFontFamily(s(p.fontFamily))),p.fontSize&&(d.size=p.fontSize),d.italic="italic"===p.fontStyle,d.bold="bold"===p.fontWeight,d.underline="underline"===p.textDecoration);var g=h.value;h.url&&o.isValidUrl(h.url)&&(d.link=h.url);var m={insert:g,attributes:d};t.push(m),c!==u-1||r.endsWith(g,"\n")||t.push({insert:"\n",attributes:d})}return t}function n(e){var t={};if(e.bold&&(t.fontWeight="bold"),e.font){var i=s(e.font);i=l.getFontFamilyForBuiltInFont(i),t.fontFamily=i}return e.italic&&(t.fontStyle="italic"),e.size&&(t.fontSize=e.size),e.underline&&(t.textDecoration="underline"),t}function s(e){return r.startsWith(e,"'")?e.slice(1,e.length-1):e}e.convertDeltaToParagraphs=t,e.convertParagraphsToHtml=i,e.convertParagraphsToOps=a}(s||(s={}));var l;!function(t){function r(e){var t=n[e];return null==t&&(t=e),t}function o(e){var t=_.findKey(n,function(t){return t===e});return t||e}var n={"Segoe (Bold)":"wf_segoe-ui_bold","Segoe UI":"wf_segoe-ui_normal","Segoe UI Light":"wf_segoe-ui_light",Heading:"wf_segoe-ui_light",Body:"wf_segoe-ui_normal"},s=["Arial","Arial Black","Arial Unicode MS","Calibri","Cambria","Cambria Math","Candara","Comic Sans MS","Consolas","Constantia","Corbel","Courier New","Georgia","Lucida Sans Unicode","Segoe (Bold)","Segoe UI","Segoe UI Light","Symbol","Tahoma","Times New Roman","Trebuchet MS","Verdana","Wingdings"].map(function(e){return{label:e,value:r(e)}});t.defaultFont=r("Segoe UI Light");var l=["8","9","10","10.5","11","12","14","16","18","20","24","28","32","36","40","42","44","54","60","66","72","80","88","96"].map(function(e){return{label:e,value:e+"px"}});t.defaultFontSize="14px";var c=["Left","Center","Right"].map(function(e){return{label:e,value:e.toLowerCase()}});t.getCssFontFamily=r,t.getFontFamilyForBuiltInFont=o;var u=function(){function i(e,t){var a=this;this.QuillPackage={javaScriptFiles:i.quillJsFiles,cssFiles:i.quillCssFiles},this.textChanged=function(e,t){},this.host=t,this.$container=$("<div>"),this.readOnly=e,this.localizationProvider={get:function(e){return a.host.getLocalizedString(e)},getOptional:function(e){return a.host.getLocalizedString(e)}},this.dependenciesLoaded=$.Deferred(),i.loadQuillResources?(this.initialized=!1,this.dependenciesLoaded.done(function(){a.rebuildQuillEditor(),a.initialized=!0}),jsCommon.requires(this.QuillPackage,function(){return a.dependenciesLoaded.resolve()})):(this.rebuildQuillEditor(),this.initialized=!0,this.dependenciesLoaded.resolve())}return i.prototype.addModule=function(e,t){return this.editor?this.editor.addModule(e,t):void 0},i.prototype.getElement=function(){return this.$container},i.prototype.getContents=function(){return this.initialized?this.editor.getContents():void 0},i.prototype.setContents=function(e){var t=this;return this.initialized?(this.editor.setHTML("","api"),void(e&&this.editor.setContents(e,"api"))):void this.dependenciesLoaded.done(function(){return t.setContents(e)})},i.prototype.resize=function(e){this.$container.width(e.width),this.$container.height(e.height)},i.prototype.setReadOnly=function(e){var t=e!==this.readOnly;this.readOnly=e,this.initialized&&t&&this.rebuildQuillEditor()},i.prototype.setSelection=function(e,t){this.editor&&this.editor.setSelection(e,t,"api")},i.prototype.getSelection=function(){return this.editor?this.editor.getSelection():void 0;
25},i.prototype.focus=function(){this.editor&&0===$(document.activeElement).closest(this.$container).length&&this.editor.focus()},i.prototype.destroy=function(){this.host.setToolbar(null),this.$container.remove(),this.$container=null,this.$toolbarDiv=null,this.$editorDiv=null,this.editor=null},i.prototype.getSelectionAtCursor=function(){var e=this.getTextWithoutTrailingBreak();this.editor.focus();var t=this.getSelection();return t&&t.start===t.end?jsCommon.WordBreaker.find(t.start,e):t},i.prototype.getWord=function(){var e=this.getSelectionAtCursor();return this.getTextWithoutTrailingBreak().slice(e.start,e.end)},i.prototype.insertLinkAtCursor=function(e,t){var i=t+e.length;return this.editor.insertText(t,e,"api"),this.editor.formatText(t,i,"link",e,"api"),this.setSelection(t,i),this.onTextChanged(null,null),i},i.prototype.getEditorContainer=function(){return this.editor?$(this.editor.container):void 0},i.prototype.getTextWithoutTrailingBreak=function(){return this.editor.getText().slice(0,-1)},i.prototype.rebuildQuillEditor=function(){var e=this,r=null;this.editor&&(this.editor.removeAllListeners(),r=this.editor.getContents()),this.$container.empty(),this.$container.keydown(function(e){e.ctrlKey&&_.contains(i.preventDefaultKeys,e.which)&&e.stopPropagation(),a.isArrowKey(e.which)&&e.stopPropagation()});var o=this.$editorDiv=$("<div>");o.css("font-family",t.defaultFont),o.css("font-size",t.defaultFontSize);var n={readOnly:this.readOnly,formats:["bold","italic","underline","font","size","link","align"],styles:!1};if(this.editor=new Quill(o.get(0),n),!this.readOnly){var s=this.$toolbarDiv;s||(this.$toolbarDiv=s=h.buildToolbar(this,this.localizationProvider)),s.addClass("unselectable"),this.host.setToolbar(s),this.editor.addModule("toolbar",{container:s.get(0)}),o.attr("drag-resize-disabled","true")}this.$container.append(o),r&&this.setContents(r);var l=new jsCommon.ThrottleUtility(i.textChangeThrottle);this.editor.on("text-change",function(t,i){"api"!==i&&l.run(function(){return e.onTextChanged(t,i)})}),this.editor.root.addEventListener("blur",function(t){var i=t.relatedTarget||document.activeElement;i&&"SELECT"===i.tagName||"INPUT"===i.tagName||i.getAttribute("contentEditable")||e.setSelection(null,null)},!1)},i.prototype.onTextChanged=function(e,t){this.textChanged(e,t)},i.textChangeThrottle=200,i.preventDefaultKeys=[jsCommon.DOMConstants.aKeyCode,jsCommon.DOMConstants.cKeyCode,jsCommon.DOMConstants.xKeyCode,jsCommon.DOMConstants.vKeyCode],i.loadQuillResources=!0,i.quillJsFiles=[e.build+"/externals/quill.min.js"],i.quillCssFiles=[e.build+"/externals/quill.base.css"],i}();t.QuillWrapper=u;var h;!function(e){function a(e,i){var a=n(i);e.addModule("link-tooltip",{template:a});var r=C(e,v("Link",i),i.get("RichTextbox_Link_DefaultText")),o=m(v("Font",i),s,"font",t.defaultFont,function(e,t){return e.css("font-family",t.value),e}),p=d().addClass("toolbar ql-toolbar").append(u().append(h(i.get("RichTextbox_Font_Label"))).append(o).append(m(v("Size",i),l,"size",t.defaultFontSize))).append(u().append(y(v("Bold",i),"bold")).append(y(v("Italic",i),"italic")).append(y(v("Underline",i),"underline"))).append(u().append(g("Text Alignment",c,"align","Left",i))).append(r);return p.on("mousedown",function(e){var t=e.target||document.activeElement;"INPUT"!==t.tagName&&"SELECT"!==t.tagName&&e.preventDefault()}),p}function r(e,t){e.val(t);var i=document.createEvent("UIEvent");i.initUIEvent("change",!1,!1,null,0),e.get(0).dispatchEvent(i)}function o(e,t){return $('\n <a href="#" class="url" target="_blank"></a>\n <input class="input" type="text">\n <span class="bar">&nbsp;|&nbsp;</span>\n <a class="change"></a>\n <a class="remove">'+e+'</a>\n <a class="done">'+t+"</a>\n ")}function n(e){var t=d(),i=e.get("RichTextbox_Link_Done"),a=e.get("RichTextbox_Link_Remove");return t.append(o(a,i)),t.html()}function u(){return p().addClass("ql-format-group").attr("drag-resize-disabled","true")}function h(e){return $("<label>").text(e)}function d(){return $("<div>")}function p(){return $("<span>")}function g(e,t,i,a,o){var n=v(e,o),s=p().attr("title",n).addClass("ql-toggle-group"),l=f(n,t,a).addClass("ql-picker ql-"+i).css("display","none"),c=t.map(function(e){var t=y(v(e.label,o),"align"+e.value).attr("data-value",e.value).click(function(t){return r(l,e.value)});return t});return l.change(function(e){for(var t=l.val(),i=0;i<c.length;i++)c[i].toggleClass("ql-active",c[i].attr("data-value")===t)}),s.append(l),s.append(c),s}function m(e,t,i,a,r){var o=f(e,t,a,r).addClass("ql-picker ql-"+i);return o}function f(e,t,i,a){for(var r=$("<select>").attr("title",e),o=0;o<t.length;o++){var n=t[o],s=$("<option>").attr("value",n.value).text(n.label);n.value===i&&s.attr("selected","selected"),void 0!==a&&(s=a(s,n)),r.append(s)}return r}function y(e,t){var i=p().addClass("ql-format-button");return null!=e&&i.attr("title",e),null!=t&&(i.addClass("ql-"+t),i.addClass("powervisuals-glyph "+t)),i}function v(e,t){return t.get("RichTextbox_"+e+"_ToolTip")}function b(e){e.removeClass("editing"),e.removeClass("blank-editing"),e.find(".input").val(S)}function C(t,i,a){var r=t.getEditorContainer().find(e.selectors.linkTooltip.selector),o=u().addClass(e.selectors.toolbarUrlInput["class"]).append(y(i,"link").append("<div>")).append(r);return o.on("keydown mousedown",function(e){if(e.keyCode===jsCommon.DOMConstants.enterKeyCode||e.target.classList.contains("done")){if(!r.hasClass("blank-editing"))return!0;var i=o.find(".input").val(),a=t.getSelectionAtCursor(),n=t.getWord();if(!n){var s=t.insertLinkAtCursor(i,a.start);return b(r),t.setSelection(s,s),!1}}}),o.find(".input").blur(function(e){var t=e.relatedTarget;(null===t||t&&!t.classList.contains("done"))&&b(r)}),o.find(".ql-link div").click(function(e){var i=e.target.parentElement;if(i&&i.classList.contains("ql-active"))return o.find(".change")[0].click(),!1;var a=t.getWord();if(!a){r.addClass("editing blank-editing");var n=o.find(".input").get(0);return n.value=S,n.selectionStart=n.selectionEnd=S.length,n.focus(),!1}}).mousedown(function(e){var i=e.target.parentElement;if(i&&!i.classList.contains("ql-active")){var a=t.getSelectionAtCursor();t.setSelection(a.start,a.end)}}),o}var S="http://";e.selectors={linkTooltip:i("ql-link-tooltip"),toolbarUrlInput:i("toolbar-url-input")},e.buildToolbar=a,e.setSelectValue=r}(h||(h={}))}(l=t.RichText||(t.RichText={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=t.utility.SelectionManager;t.cheerMeterProps={dataPoint:{defaultColor:{objectName:"dataPoint",propertyName:"defaultColor"},fill:{objectName:"dataPoint",propertyName:"fill"}}};var a=function(){function a(){this.isFirstTime=!0}return a.converter=function(i){if(!i.categorical||!i.categorical.categories)return null;var r=i.categorical.categories[0];if(!r)return null;var o=r.values;if(!o||_.isEmpty(i.categorical.values))return null;var n=i.categorical.values[0].values,s=i.categorical.categories[0].objects,l=s&&s.length>0?s[0]:void 0,c=s&&s.length>1?s[1]:void 0,u=i.metadata.objects,h=a.DefaultBackgroundColor;if(u){var d=u.general;if(d){var p=d.fill;p&&(h=p.solid.color)}}var g=e.DataViewObjects.getFillColor(l,t.cheerMeterProps.dataPoint.fill,a.DefaultFontColor),m=e.DataViewObjects.getFillColor(c,t.cheerMeterProps.dataPoint.fill,a.DefaultFontColor),f=t.SelectionIdBuilder.builder().withCategory(r,0).createSelectionId(),y=t.SelectionIdBuilder.builder().withCategory(r,1).createSelectionId(),v={teamA:{name:o[0],value:n[0],color:g,identity:f},teamB:{name:o[1],value:n[1],color:m,identity:y},background:h};return v},a.prototype.init=function(e){this.selectionManager=new i({hostServices:e.host});var t=this.svg=d3.select(e.element.get(0)).append("svg");this.textOne=t.append("text").style("font-family",a.DefaultFontFamily),this.textTwo=t.append("text").style("font-family",a.DefaultFontFamily)},a.prototype.update=function(e){if(e.dataViews[0]){var i=this.data=a.converter(e.dataViews[0]);if(i){var r=e.suppressAnimations?0:t.AnimatorCommon.MinervaAnimationDuration;this.draw(i,r,e.viewport)}}},a.prototype.getRecomendedFontProperties=function(t,i,r){for(var o,n={fontSize:"",fontFamily:a.DefaultFontFamily,text:t+i},s=1,l=1e3,c=r.width,u=0;l>=s;)if(o=(s+l)/2|0,n.fontSize=o+"px",u=e.TextMeasurementService.measureSvgTextWidth(n),c>u)s=o+1;else{if(!(u>c))break;l=o-1}return n.fontSize=o+"px",u=e.TextMeasurementService.measureSvgTextWidth(n),u>c&&(o--,n.fontSize=o+"px"),n},a.prototype.calculateLayout=function(t,i){var r=t.teamA.name,o=t.teamB.name,n={height:i.height,width:i.width-a.PaddingBetweenText},s=this.getRecomendedFontProperties(r,o,n);s.text=r;var l=0|e.TextMeasurementService.measureSvgTextWidth(s);s.text=o;var c=0|e.TextMeasurementService.measureSvgTextWidth(s),u=(i.width-l-c-a.PaddingBetweenText)/2|0;s.text=r+o;var h=0|e.TextMeasurementService.measureSvgTextHeight(s),d=t.teamA.value+t.teamB.value,p=i.height-h,g=(d-t.teamA.value)/d*p+h/2|0,m=(d-t.teamB.value)/d*p+h/2|0;return{x1:u,x2:u+l+a.PaddingBetweenText,y1:g,y2:m,fontSize:s.fontSize}},a.prototype.ensureStartState=function(e,t){if(this.isFirstTime){this.isFirstTime=!1;var i=t.height/2;this.textOne.attr({x:e.x1,y:i}),this.textTwo.attr({x:e.x2,y:i})}},a.prototype.clearSelection=function(){var e=this;this.selectionManager.clear().then(function(){e.clearSelectionUI()})},a.prototype.clearSelectionUI=function(){this.textOne.style("stroke","#FFF").style("stroke-width",0),this.textTwo.style("stroke","#FFF").style("stroke-width",0)},a.prototype.updateSelectionUI=function(e){this.textOne.style("stroke","#FFF").style("stroke-width",i.containsSelection(e,this.data.teamA.identity)?"2px":"0px"),this.textTwo.style("stroke","#FFF").style("stroke-width",i.containsSelection(e,this.data.teamB.identity)?"2px":"0px")},a.prototype.draw=function(e,t,i){var a=this,r="back",o=this.textOne,n=this.textTwo;this.svg.attr({height:i.height,width:i.width}).on("click",function(){a.clearSelection()}).style("background-color",e.background);var s=this.calculateLayout(e,i);this.ensureStartState(s,i),o.style("font-size",s.fontSize).style("fill",e.teamA.color).on("click",function(){a.selectionManager.select(e.teamA.identity,d3.event.ctrlKey).then(function(e){a.updateSelectionUI(e)}),d3.event.stopPropagation()}).text(e.teamA.name),n.style("font-size",s.fontSize).style("fill",e.teamB.color).on("click",function(){a.selectionManager.select(e.teamB.identity,d3.event.ctrlKey).then(function(e){a.updateSelectionUI(e)}),d3.event.stopPropagation()}).text(e.teamB.name),o.transition().duration(t).ease(r).attr({y:s.y1,x:s.x1}),n.transition().duration(t).ease(r).attr({y:s.y2,x:s.x2})},a.prototype.destroy=function(){this.svg=null,this.textOne=this.textTwo=null},a.prototype.enumerateObjectInstances=function(e){var t=[],i=this.data;switch(e.objectName){case"dataPoint":if(i)for(var r=[i.teamA,i.teamB],o=0;o<r.length;o++){var n=r[o],s=n.color,l=n.identity,c={objectName:"dataPoint",displayName:n.name,selector:l,properties:{fill:{solid:{color:s}}}};t.push(c)}break;case"general":var u={objectName:"general",displayName:"General",selector:null,properties:{fill:{solid:{color:i?i.background:a.DefaultBackgroundColor}}}};t.push(u)}return t},a.capabilities={dataRoles:[{displayName:"Category",name:"Category",kind:e.VisualDataRoleKind.Grouping},{displayName:"Noise Measure",name:"Y",kind:e.VisualDataRoleKind.Measure}],dataViewMappings:[{categorical:{categories:{"for":{"in":"Category"}},values:{select:[{bind:{to:"Y"}}]}}}],objects:{dataPoint:{displayName:e.data.createDisplayNameGetter("Visual_DataPoint"),description:e.data.createDisplayNameGetter("Visual_DataPointDescription"),properties:{fill:{displayName:e.data.createDisplayNameGetter("Visual_Fill"),type:{fill:{solid:{color:!0}}}},width:{displayName:"",type:{numeric:!0}}}},general:{displayName:"General",properties:{fill:{displayName:"Background color",type:{fill:{solid:{color:!0}}}}}}}},a.DefaultFontFamily="cursive",a.DefaultFontColor="rgb(165, 172, 175)",a.DefaultBackgroundColor="#243C18",a.PaddingBetweenText=15,a}();t.CheerMeter=a}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.Color,a=jsCommon.CssConstants.createClassAndSelector,r=jsCommon.PixelConverter,o=e.data.DataRoleHelper,n=function(){function a(e){e&&(this.tooltipsEnabled=e.tooltipsEnabled,this.interactivityService=e.interactivityService,this.animator=e.animator),this.renderer=new l}return a.prototype.init=function(e){this.options=e,this.element=e.element,this.currentViewport=e.viewport,this.style=e.style,this.host=e.host,this.colors=this.style.colorPalette.dataColors,this.interactivity=e.interactivity,this.cartesianVisualHost=e.cartesianHost,this.isMobileChart=e.interactivity&&e.interactivity.isInteractiveLegend;var i=this.svg=e.svg;i.classed(a.ClassName+" "+t.PlayChart.ClassName,!0),this.renderer.init(i,e.labelsContext,this.isMobileChart,this.tooltipsEnabled)},a.getAdditionalTelemetry=function(e){var t={hasSize:o.hasRoleInDataView(e,"Size"),hasPlayAxis:o.hasRoleInDataView(e,"Play")};return t},a.getObjectProperties=function(i,a){var r;r=i&&i.metadata&&i.metadata.objects?i.metadata.objects:{};var o={};o.defaultDataPointColor=e.DataViewObjects.getFillColor(r,t.columnChartProps.dataPoint.defaultColor),o.showAllDataPoints=e.DataViewObjects.getValue(r,t.columnChartProps.dataPoint.showAllDataPoints,!1);var n=r.categoryLabels;n&&a&&t.dataLabelUtils.updateLabelSettingsFromLabelsObject(n,a);var s=i&&t.GradientUtils.hasGradientRole(i.categorical);return o.fillPoint=e.DataViewObjects.getValue(r,t.scatterChartProps.fillPoint.show,s),o.colorBorder=e.DataViewObjects.getValue(r,t.scatterChartProps.colorBorder.show,!1),o.colorByCategory=e.DataViewObjects.getValue(r,t.scatterChartProps.colorByCategory.show,!1),o},a.converter=function(i,r,o,n){void 0===n&&(n=!0);var s,l,c,u,h,d=e.data.createIDataViewCategoricalReader(i),p=r.viewport,g=r.colors,m=r.interactivityService,f=r.categoryAxisProperties,y=r.valueAxisProperties,v=i.categorical,b=t.GradientUtils.getGradientValueColumn(v);v.categories&&v.categories.length>0?(s=v.categories[0].values,l=t.valueFormatter.create({format:t.valueFormatter.getFormatString(v.categories[0].source,t.scatterChartProps.general.formatString),value:s[0],value2:s[s.length-1]}),u=v.categories[0].identity,c=v.categories[0].objects,h=v.categories[0].source.queryName):(s=[null],l=t.valueFormatter.createDefaultFormatter(null));var C=v.categories,S=v.values,x=!!S.source,w=S.grouped(),P=S.source,D=a.getMetadata(w,P),L=t.dataLabelUtils.getDefaultPointLabelSettings(),T=a.getSizeRangeForGroups(w,D.idx.size),V=a.getObjectProperties(i,L),M=a.createDataPointSeries(d,S,D,C,s,l,u,c,g,p,x,L,b,V.defaultDataPointColor,h,V.colorByCategory,o,n),N=_.reduce(M,function(e,t){return e.concat(t.dataPoints)},[]),A=x?a.createSeriesLegend(S,g,S,t.valueFormatter.getFormatString(P,t.scatterChartProps.general.formatString),V.defaultDataPointColor):[],O=S&&P?P.displayName:"";return O||(O=C&&C.length>0&&C[0].source.displayName?C[0].source.displayName:""),f&&null!==f.showAxisTitle&&f.showAxisTitle===!1&&(D.axesLabels.x=null),y&&null!==y.showAxisTitle&&y.showAxisTitle===!1&&(D.axesLabels.y=null),m&&(m.applySelectionStateToData(N),m.applySelectionStateToData(A)),{xCol:D.cols.x,yCol:D.cols.y,dataPoints:N,dataPointSeries:M,legendData:{title:O,dataPoints:A},axesLabels:D.axesLabels,size:D.cols.size,sizeRange:T,dataLabelsSettings:L,defaultDataPointColor:V.defaultDataPointColor,hasDynamicSeries:x,showAllDataPoints:V.showAllDataPoints,fillPoint:V.fillPoint,colorBorder:V.colorBorder,colorByCategory:V.colorByCategory}},a.getSizeRangeForGroups=function(e,i){var r={};return e&&e.forEach(function(e){var o=a.getMeasureValue(i,e.values),n=t.AxisHelper.getRangeForColumn(o);(null==r.min||r.min>n.min)&&(r.min=n.min),(null==r.max||r.max<n.max)&&(r.max=n.max)}),r},a.createDataPointSeries=function(e,i,r,o,n,s,l,c,u,h,d,p,g,m,f,y,v,b){var C=e.hasValues("X"),S=e.hasValues("Y");if(!C&&!S)return[];for(var x=[],w=r.idx,P=t.scatterChartProps.general.formatString,D=i.source,L=i.grouped(),T=new t.ColorHelper(u,t.scatterChartProps.dataPoint.fill,m),V=0,M=L.length;M>V;V++){var N=L[V],A=N.values,O=a.getMeasureValue(w.x,A),I=a.getMeasureValue(w.y,A),R=a.getMeasureValue(w.size,A),F=void 0;if(d)F=T.getColorForSeriesValue(N.objects,i.identityFields,N.name);else if(!y&&!c){var H=null!=R?R.source.queryName:"";F=T.getColorForMeasure(null,H)}var z={identityKey:N&&N.identity&&N.identity.key||"",dataPoints:[],hasSize:!(!R||!R.values),fill:F};x.push(z);for(var G=0,j=n.length;j>G;G++){var k=n[G],E=C?t.AxisHelper.normalizeNonFiniteNumber(e.getValue("X",G,V)):0,W=S?t.AxisHelper.normalizeNonFiniteNumber(e.getValue("Y",G,V)):0,B=t.AxisHelper.normalizeNonFiniteNumber(e.getValue("Size",G,V));if(null!=E&&null!=W){var U=void 0;if(d)U=T.getColorForSeriesValue(N.objects,i.identityFields,N.name);else if(y)U=T.getColorForSeriesValue(c&&c[G],i.identityFields,k);else{var H=null!=R?R.source.queryName:"";U=T.getColorForMeasure(c&&c[G],H)}var K=_.isEmpty(o)?null:o[0],X=t.SelectionIdBuilder.builder().withCategory(K,G).withSeries(i,N).createSelectionId(),Y=void 0;b&&(Y=[],K&&Y.push({displayName:K.source.displayName,value:t.converterHelper.formatFromMetadataColumn(k,K.source,P)}),d&&(K&&K.source===D||Y.push({displayName:D.displayName,value:t.converterHelper.formatFromMetadataColumn(N.name,D,P)})),O&&null!=E&&Y.push({displayName:O.source.displayName,value:t.converterHelper.formatFromMetadataColumn(E,O.source,P)}),I&&null!=W&&Y.push({displayName:I.source.displayName,value:t.converterHelper.formatFromMetadataColumn(W,I.source,P)}),R&&null!=R.values[G]&&Y.push({displayName:R.source.displayName,value:t.converterHelper.formatFromMetadataColumn(R.values[G],R.source,P)}),g&&null!=g.values[G]&&Y.push({displayName:g.source.displayName,value:t.converterHelper.formatFromMetadataColumn(g.values[G],g.source,P)}),v&&Y.push({displayName:v.column.displayName,value:t.converterHelper.formatFromMetadataColumn(v.label,v.column,P)}));var q={x:E,y:W,size:B,radius:{sizeMeasure:R,index:G},fill:U,formattedCategory:a.createLazyFormattedCategory(s,null!=o?k:N.name),selected:!1,identity:X,tooltipInfo:Y,labelFill:p.labelColor};z.dataPoints.push(q)}}}return x},a.createLazyFormattedCategory=function(e,t){return new jsCommon.Lazy(function(){return e.format(t)})},a.createSeriesLegend=function(e,i,a,r,o){for(var n=e.grouped(),s=new t.ColorHelper(i,t.scatterChartProps.dataPoint.fill,o),l=[],c=0,u=n.length;u>c;c++){var h=n[c],d=s.getColorForSeriesValue(h.objects,e.identityFields,h.name);l.push({color:d,icon:t.LegendIcon.Circle,label:t.valueFormatter.format(h.name,r),identity:h.identity?t.SelectionId.createWithId(h.identity):t.SelectionId.createNull(),selected:!1})}return l},a.getBubbleRadius=function(e,t,i){var r=null,o=null,n=e.sizeMeasure;if(!n)return a.BubbleRadius;var s=t.min?t.min:0,l=t.max?t.max:0,c=Math.min(s,0),u=Math.max(l,0);if(r={minRange:c,maxRange:u,delta:u-c},o=a.getBubblePixelAreaSizeRange(i,a.MinSizeRange,a.MaxSizeRange),n.values){var h=n.values[e.index];if(null!=h)return a.projectSizeToPixels(h,r,o)/2}return a.BubbleRadius},a.getMeasureValue=function(e,t){return e>=0?t[e]:null},a.getMetadata=function(e,t){var i,a,r,n=o.getMeasureIndexOfRole(e,"X"),s=o.getMeasureIndexOfRole(e,"Y"),l=o.getMeasureIndexOfRole(e,"Size"),c="",u="";if(e&&e.length){var h=e[0];n>=0&&(i=h.values[n].source,c=h.values[n].source.displayName),s>=0&&(a=h.values[s].source,u=h.values[s].source.displayName),l>=0&&(r=h.values[l].source)}return{idx:{x:n,y:s,size:l},cols:{x:i,y:a,size:r},axesLabels:{x:c,y:u}}},a.getDefaultData=function(){return{xCol:void 0,yCol:void 0,dataPoints:[],dataPointSeries:[],legendData:{dataPoints:[]},axesLabels:{x:"",y:""},sizeRange:[],dataLabelsSettings:t.dataLabelUtils.getDefaultPointLabelSettings(),defaultDataPointColor:null,hasDynamicSeries:!1}},a.prototype.renderAtFrame=function(e){this.data=e,this.cartesianVisualHost.triggerRender(!1)},a.prototype.setData=function(e){var i=this;if(this.data=a.getDefaultData(),e.length>0){var r=e[0]||e[1];if(r){this.categoryAxisProperties=t.CartesianHelper.getCategoryAxisProperties(r.metadata,!0),this.valueAxisProperties=t.CartesianHelper.getValueAxisProperties(r.metadata,!0),this.dataView=r;var o={viewport:this.currentViewport,colors:this.colors,interactivityService:this.interactivityService,categoryAxisProperties:this.categoryAxisProperties,valueAxisProperties:this.valueAxisProperties};if(t.PlayChart.isDataViewPlayable(r)){this.playAxis||(this.playAxis=new t.PlayAxis({animator:this.animator,interactivityService:this.interactivityService,isScrollable:!1}),this.playAxis.init(this.options));var n=this.playAxis.setData(r,function(e,t){return a.converter(e,o,t,i.tooltipsEnabled)});this.mergeSizeRanges(n),this.data=n.currentViewModel,this.playAxis.setRenderFunction(function(e){return i.renderAtFrame(e)})}else this.playAxis&&(this.playAxis.remove(),this.playAxis=null),r.categorical&&r.categorical.values&&(this.data=a.converter(r,o,void 0,this.tooltipsEnabled))}}else this.playAxis&&(this.playAxis.remove(),this.playAxis=null)},a.prototype.mergeSizeRanges=function(e){if(e&&e.currentViewModel){for(var t=e.currentViewModel.sizeRange,i=0,a=e.allViewModels;i<a.length;i++){var r=a[i],o=r.sizeRange;null!=o.min&&(t.min=Math.min(t.min,o.min)),null!=o.max&&(t.max=Math.max(t.max,o.max))}for(var n=0,s=e.allViewModels;n<s.length;n++){var l=s[n];l.sizeRange=t}}},a.prototype.calculateLegend=function(){return this.data&&this.data.legendData},a.prototype.hasLegend=function(){return this.data&&this.data.hasDynamicSeries},a.prototype.enumerateObjectInstances=function(e,i){switch(i.objectName){case"colorByCategory":this.data&&(this.data.hasDynamicSeries||e.pushInstance({objectName:"colorByCategory",selector:null,properties:{show:this.data.colorByCategory}}));break;case"dataPoint":if(!this.playAxis){var a=this.dataView&&this.dataView.categorical?this.dataView.categorical:null;if(!t.GradientUtils.hasGradientRole(a))return this.enumerateDataPoints(e)}break;case"categoryAxis":e.pushInstance({selector:null,properties:{showAxisTitle:this.categoryAxisProperties&&null!=this.categoryAxisProperties.showAxisTitle?this.categoryAxisProperties.showAxisTitle:!0},objectName:"categoryAxis"});break;case"valueAxis":e.pushInstance({selector:null,properties:{showAxisTitle:this.valueAxisProperties&&null!=this.valueAxisProperties.showAxisTitle?this.valueAxisProperties.showAxisTitle:!0},objectName:"valueAxis"});break;case"categoryLabels":this.data?t.dataLabelUtils.enumerateCategoryLabels(e,this.data.dataLabelsSettings,!0):t.dataLabelUtils.enumerateCategoryLabels(e,null,!0);break;case"fillPoint":if(this.hasSizeMeasure())return;e.pushInstance({objectName:"fillPoint",selector:null,properties:{show:this.data.fillPoint}});break;case"colorBorder":this.hasSizeMeasure()&&e.pushInstance({objectName:"colorBorder",selector:null,properties:{show:this.data.colorBorder}})}},a.prototype.hasSizeMeasure=function(){var e=this.data.sizeRange;return e&&void 0!==e.min},a.prototype.enumerateDataPoints=function(e){var i=this.data;if(i){var a=i.dataPoints.length;if(i.hasDynamicSeries)for(var r=i.legendData.dataPoints.length,o=0;r>o;o++){var n=i.legendData.dataPoints[o];e.pushInstance({objectName:"dataPoint",displayName:n.label,selector:t.ColorHelper.normalizeSelector(n.identity.getSelector()),properties:{fill:{solid:{color:n.color}}}})}else{e.pushInstance({objectName:"dataPoint",selector:null,properties:{defaultColor:{solid:{color:i.defaultDataPointColor||this.colors.getColorByIndex(0).value}}}}).pushInstance({objectName:"dataPoint",selector:null,properties:{showAllDataPoints:!!i.showAllDataPoints}});for(var o=0;a>o;o++){var s=i.dataPoints[o];e.pushInstance({objectName:"dataPoint",displayName:s.formattedCategory.getValue(),selector:t.ColorHelper.normalizeSelector(s.identity.getSelector(),!0),properties:{fill:{solid:{color:s.fill}}}})}}}},a.prototype.supportsTrendLine=function(){var e=this.data;return e?!this.hasSizeMeasure()&&e.dataPointSeries.length>0:!1},a.getExtents=function(e){var t=e.dataPoints;return _.isEmpty(t)?{minY:0,maxY:0,minX:0,maxX:0}:{minY:d3.min(t,function(e){return e.y}),maxY:d3.max(t,function(e){return e.y}),minX:d3.min(t,function(e){return e.x}),maxX:d3.max(t,function(e){return e.x})}},a.prototype.calculateAxesProperties=function(e){var i=this.data,r=this.currentViewport=e.viewport,o=e.margin;this.currentViewport=r,this.margin=o;var n=r.width-(o.left+o.right),s=r.height-(o.top+o.bottom),l={minY:0,maxY:10,minX:0,maxX:10};this.playAxis?(l=this.playAxis.getCartesianExtents(l,a.getExtents),this.playAxis.setPlayControlPosition(e.playAxisControlLayout)):_.isEmpty(i.dataPoints)||(l=a.getExtents(i));var c=[l.minX,l.maxX],u=t.AxisHelper.combineDomain(e.forcedXDomain,c,e.ensureXDomain);this.xAxisProperties=t.AxisHelper.createAxis({pixelSpan:n,dataDomain:u,metaDataColumn:i.xCol,formatString:t.valueFormatter.getFormatString(i.xCol,t.scatterChartProps.general.formatString),outerPadding:0,isScalar:!0,isVertical:!1,forcedTickCount:e.forcedTickCount,useTickIntervalForDisplayUnits:!0,isCategoryAxis:!0,scaleType:e.categoryAxisScaleType,axisDisplayUnits:e.categoryAxisDisplayUnits,axisPrecision:e.categoryAxisPrecision}),this.xAxisProperties.axis.tickSize(-s,0),this.xAxisProperties.axisLabel=this.data.axesLabels.x;var h=t.AxisHelper.combineDomain(e.forcedYDomain,[l.minY,l.maxY],e.ensureYDomain);return this.yAxisProperties=t.AxisHelper.createAxis({pixelSpan:s,dataDomain:h,metaDataColumn:i.yCol,formatString:t.valueFormatter.getFormatString(i.yCol,t.scatterChartProps.general.formatString),outerPadding:0,isScalar:!0,isVertical:!0,forcedTickCount:e.forcedTickCount,useTickIntervalForDisplayUnits:!0,isCategoryAxis:!1,scaleType:e.valueAxisScaleType,axisDisplayUnits:e.valueAxisDisplayUnits,axisPrecision:e.valueAxisPrecision}),this.yAxisProperties.axisLabel=this.data.axesLabels.y,[this.xAxisProperties,this.yAxisProperties]},a.prototype.overrideXScale=function(e){this.xAxisProperties=e},a.prototype.render=function(i,r){if(this.data){var o=this.data,n=this.margin,l=this.currentViewport,c=this.interactivityService&&this.interactivityService.hasSelection(),u={width:l.width-(n.left+n.right),height:l.height-(n.top+n.bottom)},h=t.AnimatorCommon.GetAnimationDuration(this.animator,i);this.playAxis&&this.playAxis.isCurrentlyPlaying()&&(this.isMobileChart||h>0)&&(h=t.PlayChart.FrameAnimationDuration);var d=this.playAxis?"linear":"cubic-in-out",p=(!o.sizeRange||!o.sizeRange.min)&&o.fillPoint,g=this.hasSizeMeasure(),m=1===r&&o.dataPoints&&o.dataPoints.length>a.NoRenderResizeThreshold,f={data:o,drawBubbles:g,isPlay:!!this.playAxis,xAxisProperties:this.xAxisProperties,yAxisProperties:this.yAxisProperties,viewport:u,hasSelection:c,animationDuration:h,animationOptions:this.options.animation,fillMarkers:p,easeType:d,suppressDataPointRendering:m};if(g){var y=o.dataPoints.sort(a.sortBubbles);f.data=e.Prototype.inherit(f.data),f.data.dataPoints=y}var v=[];(o.dataLabelsSettings&&o.dataLabelsSettings.show||o.dataLabelsSettings.showCategory)&&(v=s.createLabelDataPoints(f));var b=this.renderer.render(f,this.interactivityService);this.isMobileChart&&(b={data:b.data,dataPointsSelection:b.dataPointsSelection,eventGroup:b.eventGroup,plotContext:b.plotContext,host:this.cartesianVisualHost,root:this.svg,visualInitOptions:this.options,xAxisProperties:this.xAxisProperties,yAxisProperties:this.yAxisProperties,background:d3.select(this.element.get(0))});var C;if(this.playAxis&&(C=this.playAxis.render(i,f,l,n),this.interactivityService)){var S={traceLineRenderer:this.renderer.createTraceLineRenderer(C.viewModel)};c&&t.PlayChart.renderTraceLines(C.allDataPoints,S.traceLineRenderer,!i),b.playOptions=S}return{dataPoints:C?C.allDataPoints:o.dataPoints,behaviorOptions:b,labelDataPoints:v,labelsAreNumeric:!1}}},a.getStrokeFill=function(e,t){if(null!=e.size&&t){var r=i.parseColorString(e.fill);return i.hexString(i.darken(r,a.StrokeDarkenColorValue))}return e.fill},a.getBubblePixelAreaSizeRange=function(e,t,i){var r=1;if(e.height>0&&e.width>0){var o=Math.min(e.height,e.width);r=o*o/a.AreaOf300By300Chart}var n=Math.round(t*r),s=Math.round(i*r);return{minRange:n,maxRange:s,delta:s-n}},a.project=function(e,t,i){if(0===t.delta||0===i.delta)return a.rangeContains(t,e)?i.minRange:null;var r=(e-t.minRange)/t.delta;return i.minRange+r*i.delta},a.projectSizeToPixels=function(e,t,i){var r=0;if(t){if(r=i.maxRange,0!==t.delta){var o=Math.min(Math.max(e,t.minRange),t.maxRange);r=a.project(o,t,i)}r=2*Math.sqrt(r/Math.PI)}return Math.round(r)},a.rangeContains=function(e,t){return e.minRange<=t&&t<=e.maxRange},a.getMarkerFillOpacity=function(e,t,i,r){return e||t?i&&!r?a.DimmedBubbleOpacity:a.DefaultBubbleOpacity:0},a.getMarkerStrokeOpacity=function(e,t,i,r){return e&&t?1:i&&!r?a.DimmedBubbleOpacity:a.DefaultBubbleOpacity},a.getMarkerStrokeFill=function(e,t,r){if(e&&t){var o=i.parseColorString(r);return i.hexString(i.darken(o,a.StrokeDarkenColorValue))}return r},a.getMarkerStyle=function(e,t,i,r){return{"stroke-opacity":a.getMarkerStrokeOpacity(null!=e.size,t,i,e.selected),stroke:a.getMarkerStrokeFill(null!=e.size,t,e.fill),fill:e.fill,"fill-opacity":a.getMarkerFillOpacity(null!=e.size,r,i,e.selected)}},a.getSeriesStyle=function(e,t,i,r,o){return{"stroke-opacity":a.getMarkerStrokeOpacity(e,t,i,!1),stroke:a.getMarkerStrokeFill(e,t,o),fill:o,"fill-opacity":a.getMarkerFillOpacity(e,r,i,!1)}},a.getBubbleOpacity=function(e,t){return t&&!e.selected?a.DimmedBubbleOpacity:a.DefaultBubbleOpacity},a.prototype.onClearSelection=function(){this.interactivityService&&this.interactivityService.clearSelection()},a.prototype.getSupportedCategoryAxisType=function(){return t.axisType.scalar},a.sortBubbles=function(e,t){var i=t.radius.sizeMeasure.values[t.radius.index]-e.radius.sizeMeasure.values[e.radius.index];return 0!==i?i:t.identity.getKey().localeCompare(e.identity.getKey())},a.BubbleRadius=6,a.DefaultBubbleOpacity=.85,a.DimmedBubbleOpacity=.4,a.StrokeDarkenColorValue=63.75,a.dataLabelLayoutStartingOffset=2,a.dataLabelLayoutOffsetIterationDelta=6,a.dataLabelLayoutMaximumOffset=a.dataLabelLayoutStartingOffset+2*a.dataLabelLayoutOffsetIterationDelta,a.AreaOf300By300Chart=9e4,a.MinSizeRange=200,a.MaxSizeRange=3e3,a.ClassName="scatterChart",a.NoAnimationThreshold=1e3,a.NoRenderResizeThreshold=1e3,a}();t.ScatterChart=n;var s,l=function(){function e(){}return e.prototype.init=function(t,i,a,r){this.mainGraphicsG=t.append("g").classed(e.MainGraphicsContext["class"],!0),this.isMobileChart=a,a&&(this.mainGraphicsBackgroundRect=this.mainGraphicsG.append("rect").classed("backgroundRect",!0).attr({width:"100%",height:"100%"})),this.mainGraphicsContext=this.mainGraphicsG.append("svg"),this.labelGraphicsContext=i,this.tooltipsEnabled=r,this.mainGraphicsContext.attr("stroke-width","1")},e.prototype.render=function(e,i){var a=e.viewport;this.mainGraphicsContext.attr({width:a.width,height:a.height});var r;return r=e.suppressDataPointRendering?this.removeScatterMarkers():e.animationDuration>0&&e.data.dataPoints.length<=n.NoAnimationThreshold?this.drawScatterMarkers(e):this.drawScatterMarkersNoAnimation(e,e.drawBubbles),e.drawBubbles&&r.order(),this.tooltipsEnabled&&t.TooltipManager.addTooltip(this.mainGraphicsContext,function(e){return e.data.tooltipInfo}),t.SVGUtil.flushAllD3TransitionsIfNeeded(e.animationOptions),{dataPointsSelection:r,eventGroup:this.mainGraphicsG,data:e.data,plotContext:this.mainGraphicsContext}},e.prototype.createTraceLineRenderer=function(e){return new c(e,this.mainGraphicsContext,this.tooltipsEnabled)},e.prototype.removeScatterMarkers=function(){return this.mainGraphicsContext.selectAll(e.ScatterMarkerSeriesGroup.selector).remove(),this.mainGraphicsContext.selectAll(e.DotClass.selector)},e.prototype.drawScatterMarkers=function(t){var i=t.data,a=t.xAxisProperties.scale,r=t.yAxisProperties.scale,o=[{identityKey:"",dataPoints:i.dataPoints}],s=this.mainGraphicsContext.selectAll(e.ScatterMarkerSeriesGroup.selector).data(o,function(e){
26return e.identityKey});s.enter().append("g").classed(e.ScatterMarkerSeriesGroup["class"],!0),s.exit().remove();var l=s.selectAll(e.DotClass.selector).data(function(e){return e.dataPoints},function(e){return e.identity.getKey()});return l.enter().append("circle").classed(e.DotClass["class"],!0).style("opacity",0).attr("r",0),l.style({"stroke-opacity":function(e){return n.getMarkerStrokeOpacity(null!=e.size,i.colorBorder,t.hasSelection,e.selected)},stroke:function(e){return n.getStrokeFill(e,i.colorBorder)},fill:function(e){return e.fill},"fill-opacity":function(e){return n.getMarkerFillOpacity(null!=e.size,t.fillMarkers,t.hasSelection,e.selected)}}).transition().ease(t.easeType).duration(t.animationDuration).style("opacity",1).attr({r:function(e){return n.getBubbleRadius(e.radius,i.sizeRange,t.viewport)},cx:function(e){return a(e.x)},cy:function(e){return r(e.y)}}),l.exit().transition().ease(t.easeType).duration(t.animationDuration).style("opacity",0).attr("r",0).remove(),l},e.prototype.drawScatterMarkersNoAnimation=function(t,i){var a,r=t.data,o=t.xAxisProperties.scale,s=t.yAxisProperties.scale;if(i){var l=[{identityKey:"",dataPoints:r.dataPoints}];a=this.mainGraphicsContext.selectAll(e.ScatterMarkerSeriesGroup.selector).data(l,function(e){return e.identityKey})}else a=this.mainGraphicsContext.selectAll(e.ScatterMarkerSeriesGroup.selector).data(r.dataPointSeries,function(e){return e.identityKey});return a.enter().append("g").classed(e.ScatterMarkerSeriesGroup["class"],!0),a.exit().remove(),a.each(function(i){var a=n.getSeriesStyle(i.hasSize,r.colorBorder,t.hasSelection,t.fillMarkers,i.fill),l=d3.select(this);e.applyStyle(this,a);var c=l.selectAll(e.DotClass.selector).data(i.dataPoints,function(e){return e.identity.getKey()});c.enter().append("circle").classed(e.DotClass["class"],!0),c.exit().remove(),c.each(function(i){var o=n.getMarkerStyle(i,r.colorBorder,t.hasSelection,t.fillMarkers);e.styleException(o,a),e.applyStyle(this,o)}),c.attr({r:function(e){return n.getBubbleRadius(e.radius,r.sizeRange,t.viewport)},cx:function(e){return o(e.x)},cy:function(e){return s(e.y)}})}),this.mainGraphicsContext.selectAll(e.DotClass.selector)},e.styleException=function(e,t){if(t)for(var i in e)e[i]===t[i]&&(e[i]=null)},e.applyStyle=function(e,t){for(var i in t){var a=e.style[i],r=t[i];if(null==r){if(""===a)continue}else if(r=r.toString(),r===a)continue;e.style[i]=r}},e.DotClass=a("dot"),e.MainGraphicsContext=a("mainGraphicsContext"),e.ScatterMarkerSeriesGroup=a("scatterMarkerSeriesGroup"),e}();!function(i){function a(i){for(var a=i.xAxisProperties.scale,s=i.yAxisProperties.scale,l=i.data.sizeRange,c=[],u=i.data.dataPoints,p=i.data.dataLabelsSettings,g=o(i),m=0,f=u;m<f.length;m++){var y=f[m],v=y.formattedCategory.getValue(),b={text:v,fontFamily:t.NewDataLabelUtils.LabelTextProperties.fontFamily,fontSize:r.fromPoint(p.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt),fontWeight:t.NewDataLabelUtils.LabelTextProperties.fontWeight},C=e.TextMeasurementService.measureSvgTextWidth(b),S=e.TextMeasurementService.estimateSvgTextHeight(b);c.push({isPreferred:g?h(y.identity.getKey(),g):!1,text:v,textSize:{width:C,height:S},outsideFill:p.labelColor?p.labelColor:t.NewDataLabelUtils.defaultLabelColor,insideFill:t.NewDataLabelUtils.defaultInsideLabelColor,parentType:0,parentShape:{point:{x:a(y.x),y:s(y.y)},radius:n.getBubbleRadius(y.radius,l,i.viewport),validPositions:d},identity:y.identity,fontSize:p.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt})}return c}function o(e){var i=e.viewport.width,a=e.viewport.height,r=new t.Point(i/2,a/2),o=s(i,a);return l(r,o,e)}function s(e,i){var a=[],r=e/4,o=i/4;return a.push(new t.Point(r,o)),a.push(new t.Point(3*r,o)),a.push(new t.Point(r,3*o)),a.push(new t.Point(3*r,3*o)),a}function l(e,t,i){for(var a,r=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],o=[],n=i.xAxisProperties.scale,s=i.yAxisProperties.scale,l=0,h=i.data.dataPoints;l<h.length;l++){var d=h[l],p=n(d.x),g=s(d.y),m=c(p,g,e);i.drawBubbles?o[m]||(o[m]=d.identity):(a=u(t[m].x,t[m].y,p,g),a<r[m]&&(o[m]=d.identity,r[m]=a))}for(var f=[],y=0,v=o;y<v.length;y++){var b=v[y];b&&f.push(b.getKey())}return f}function c(e,t,i){return e>i.x&&t<=i.y?0:e<=i.x&&t<=i.y?1:e<=i.x&&t>i.y?2:3}function u(e,t,i,a){return Math.sqrt((e-i)*(e-i)+(t-a)*(t-a))}function h(e,t){for(var i=0,a=t;i<a.length;i++){var r=a[i];if(0===e.localeCompare(r))return!0}return!1}var d=[2,1,8,4,16,32,64,128];i.createLabelDataPoints=a}(s||(s={}));var c=function(){function e(e,t,i){this.viewModel=e,this.element=t,this.tooltipsEnabled=i}return e.prototype.remove=function(){this.element.selectAll(e.TraceLine.selector).remove(),this.element.selectAll(e.TraceBubble.selector).remove()},e.prototype.render=function(i,a){var r=this.viewModel,o=r.viewModel,s=[];if(_.isEmpty(i)||o.suppressDataPointRendering)this.remove();else{for(var l=r.data.currentFrameIndex,c=[],u=0,h=i.length;h>u;u++){s[u]=[],c[u]=!1;for(var d=0,p=r.data.allViewModels.length;p>d&&l>=d;d++){var g=_.find(r.data.allViewModels[d].dataPoints,function(e,t){return e.identity.getKey()===i[u].identity.getKey()});null!=g&&(g.frameIndex=d,s[u].push(g),d===l&&(c[u]=!0))}}var m=o.xAxisProperties.scale,f=o.yAxisProperties.scale,y=d3.svg.line().x(function(e){return m(e.x)}).y(function(e){return f(e.y)}).defined(function(e){return null!==e.x&&null!==e.y}),v=this.element.selectAll(e.TraceLine.selector).data(i,function(e){return e.identity.getKey()});v.enter().append("path").classed(e.TraceLine["class"],!0);var b=[],C=[],S=!1;v.each(function(e,t){var i=this,a=i.hasAttribute("d")?i.getTotalLength():0;b.push(a);var r=$("<svg><path></path></svg>"),o=$("path",r);o.attr("d",y(s[t]));var n=s[t].length>0?o.get()[0].getTotalLength():0;C.push(n),S=S||a>n}),S?a?v.transition().ease("linear").duration(t.PlayChart.FrameAnimationDuration).attr("stroke-dashoffset",function(e,t){return b[t]-C[t]}).transition().ease("linear").duration(1).delay(t.PlayChart.FrameAnimationDuration).style("stroke",function(e){return n.getStrokeFill(e,!0)}).attr({d:function(e,t){return y(s[t])},"stroke-dasharray":function(e,t){return C[t]+" "+C[t]},"stroke-dashoffset":0}):v.style("stroke",function(e){return n.getStrokeFill(e,!0)}).attr({d:function(e,t){return y(s[t])},"stroke-dasharray":function(e,t){return C[t]+" "+C[t]},"stroke-dashoffset":0}):(v.style("stroke",function(e){return n.getStrokeFill(e,!0)}).attr({d:function(e,t){return y(s[t])},"stroke-dasharray":function(e,t){return C[t]+" "+C[t]},"stroke-dashoffset":function(e,t){return C[t]-b[t]}}),a?v.transition().ease("linear").duration(t.PlayChart.FrameAnimationDuration).attr("stroke-dashoffset",0):v.attr("stroke-dashoffset",0)),v.exit().remove();for(var x=[],w=0;w<s.length;w++){var P=s[w],D=c[w]?P.slice(0,P.length-1):P;x=x.concat(D)}var L=this.element.selectAll(e.TraceBubble.selector).data(x,function(e){return e.identity.getKey()+e.x+e.y+e.size});L.enter().append("circle").style("opacity",0).classed(e.TraceBubble["class"],!0),L.attr("cx",function(e){return m(e.x)}).attr("cy",function(e){return f(e.y)}).attr("r",function(e){return n.getBubbleRadius(e.radius,r.data.currentViewModel.sizeRange,r.viewport)}).style({"stroke-opacity":function(e){return n.getBubbleOpacity(e,!0)},stroke:function(e){return n.getStrokeFill(e,r.data.currentViewModel.colorBorder)},fill:function(e){return e.fill},"fill-opacity":function(e){return null!=e.size?.2+e.frameIndex/l*.6:0}}).transition().ease("linear").duration(t.PlayChart.FrameAnimationDuration).style("opacity",1),L.exit().transition().ease("linear").duration(t.PlayChart.FrameAnimationDuration).style("opacity",0).remove(),this.tooltipsEnabled&&t.TooltipManager.addTooltip(L,function(e){return e.data.tooltipInfo}),L.sort(function(e,t){return t.size-e.size})}},e.TraceLine=a("traceLine"),e.TraceBubble=a("traceBubble"),e}()}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.CssConstants.createClassAndSelector,a=e.data.createDataViewScopeIdentity,r=e.data.DataViewConcatenateCategoricalColumns,o=e.data.utils.DataViewMatrixUtils,n=e.data.SQExprBuilder,s=function(){function t(e){e&&(this.interactivityService=e.interactivityService)}return t.prototype.init=function(e){var t=this;this.element=e.element,this.svg=e.svg,this.host=e.host,this.isMobileChart=e.interactivity&&e.interactivity.isInteractiveLegend,this.interactivityService&&(this.playControl=new c(this.element,function(e){return t.moveToFrameAndRender(e)},this.isMobileChart),this.playControl.onPlay(function(){return t.play()}))},t.prototype.setData=function(e,t){if(e){if(this.ridiculousFlagForPersistProperties&&e.metadata)return this.ridiculousFlagForPersistProperties=!1,this.playData;e.matrix||e.categorical?this.playData=l.converter(e,t):this.playData=l.getDefaultPlayData()}else this.playData=l.getDefaultPlayData();return this.lastViewport=void 0,this.playData},t.prototype.render=function(e,t,i,a){var r=this.playData,o=!this.lastViewport||this.lastViewport.height!==i.height||this.lastViewport.width!==i.width;if(this.lastViewport=i,o&&this.stop(),r){var n={data:this.playData,viewModel:t,viewport:i},s=!1;if(this.interactivityService){var l=r.currentViewModel;this.interactivityService.applySelectionStateToData(l.dataPoints),s=this.interactivityService.hasSelection()}this.updateCallout(i,a),this.playControl&&o&&this.playControl.rebuild(r,i);var c=r.allViewModels.map(function(e){return e.dataPoints}),u=_.flatten(c);return{allDataPoints:u,viewModel:n}}},t.prototype.updateCallout=function(i,a){var r=this.playData,o=r.frameData,n=r.currentFrameIndex,s=i.height,l=s-a.top-a.bottom,c=i.width,u=c-a.left-a.right,h=Math.min(s,1.3*c),d=Math.max(12,Math.round(h/7));d=Math.min(d,70);var p={fontSize:jsCommon.PixelConverter.toString(d),text:o[n].text||"",fontFamily:"wf_segoe-ui_normal"},g=e.TextMeasurementService.estimateSvgTextHeight(p)-e.TextMeasurementService.estimateSvgTextBaselineDelta(p),m=[];if(n<o.length&&n>=0&&l>g){var f=u-2*t.calloutOffsetMultiplier*g,y=e.TextMeasurementService.getTailoredTextOrDefault(p,f);m=[y]}var v=this.svg.selectAll(t.PlayCallout.selector).data(m);v.enter().append("text").classed(t.PlayCallout["class"],!0),v.text(function(e){return e}).attr({x:u-t.calloutOffsetMultiplier*g,y:function(){return g}}).style({"font-size":d+"px","text-anchor":"end"}),v.exit().remove()},t.prototype.play=function(){var e=this.playData;if(this.isPlaying)this.stop();else if(this.playControl){this.isPlaying=!0,this.playControl.play();var t=Math.round(this.playControl.getCurrentIndex());t>=e.allViewModels.length-1?e.currentFrameIndex=-1:e.currentFrameIndex=t-1,this.playNextFrame(e)}},t.prototype.playNextFrame=function(e,t,i){var a=this;if(!this.isPlaying)return void this.stop();var r=e.currentFrameIndex+1;null!=t&&null!=i&&(r=Math.abs(i-t+1),t=r),r<e.allViewModels.length&&r>-1?(e.currentFrameIndex=r,e.currentViewModel=e.allViewModels[r],this.renderDelegate(e.currentViewModel),this.playControl.setFrame(r),r<e.allViewModels.length&&window.setTimeout(function(){a.playNextFrame(e,t,i)},l.FrameStepDuration)):this.stop()},t.prototype.stop=function(){this.playControl&&this.playControl.pause(),this.isPlaying=!1},t.prototype.remove=function(){this.playControl&&this.playControl.remove(),d3.selectAll(t.PlayCallout.selector).remove()},t.prototype.setRenderFunction=function(e){this.renderDelegate=e},t.prototype.getCartesianExtents=function(e,t){return this.playData&&this.playData.allViewModels&&this.playData.allViewModels.length>0?l.getMinMaxForAllFrames(this.playData,t):e},t.prototype.setPlayControlPosition=function(e){if(this.playControl){var t=this.playControl.getContainer();t.css("left",e.left?e.left+"px":""),t.css("top",e.top?e.top+"px":"")}},t.prototype.moveToFrameAndRender=function(e){var t=this.playData;if(this.isPlaying=!1,t&&e>=0&&e<t.allViewModels.length&&e!==t.currentFrameIndex){t.currentFrameIndex=e;var i=t.allViewModels[e];t.currentViewModel=i,this.renderDelegate(i)}},t.prototype.isCurrentlyPlaying=function(){return this.isPlaying},t.PlayCallout=i("play-callout"),t.calloutOffsetMultiplier=.3,t}();t.PlayAxis=s;var l,c=function(){function e(e,t,i){this.isMobileChart=i,this.createSliderDOM(e),this.renderDelegate=t}return e.prototype.getContainer=function(){return this.playAxisContainer},e.prototype.remove=function(){this.playAxisContainer&&this.playAxisContainer.remove()},e.prototype.pause=function(){this.playButton.removeClass("pause").addClass("play")},e.prototype.play=function(){this.playButton.removeClass("play").addClass("pause")},e.prototype.getCurrentIndex=function(){return Math.round(this.noUiSlider.get())},e.prototype.onPlay=function(e){this.playButtonCircle.off("click"),this.playButtonCircle.on("click",e)},e.prototype.setFrame=function(e){this.noUiSlider.set([e])},e.prototype.rebuild=function(t,i){var a=this,r=this.slider;this.noUiSlider&&this.noUiSlider.destroy();var o=t.labelData,n=e.calucalateSliderSize(o,i.width),s=this.getContainer();n.marginLeft>e.SliderMarginLeft&&(s.css("padding-left",n.marginLeft-e.SliderMarginLeft+"px"),s.css("box-sizing","border-box"));var l=this.updateSliderControl(t,n.width),c=e.adjustWidthRegardingLastItem(o,l,n.width);this.slider.css("width",c+"px"),this.noUiSlider.on("slide",function(){var e=a.getCurrentIndex();a.renderDelegate(e)});var u=0;$(".noUi-value",r).each(function(e,t){var i=o.labelInfo[u].labelWidth;$(t).width(i),$(t).css("margin-left",-i/2+"px"),u+=l})},e.prototype.updateSliderControl=function(t,i){var a=t.labelData,r=this.slider.get(0),o=t.frameData.length,n={start:0===o?0:t.currentFrameIndex,step:1,range:{min:0,max:0===o?0:o-1}},s=null,l=0;if(o>0){var c=e.createPipsFilterFn(t,i,a);l=c.skipStep,s={mode:"steps",density:Math.ceil(100/o),format:{to:function(e){return t.frameData[e].escapedText},from:function(e){return t.frameData.indexOf(e)}},filter:c.filter}}return n.pips=s,noUiSlider.create(r,n),this.noUiSlider=r.noUiSlider,l},e.createPipsFilterFn=function(e,t,i){var a=_.max(_.map(i.labelInfo,function(e){return e.labelWidth})),r=1,o=1,n=e.frameData.length>1?t/(e.frameData.length-1):t,s=a/n;s>1.25?(o=Math.ceil(s),r=2):(s>1||i.anyWordBreaks)&&(r=2);var l=function(e,t){return e%o===0?r:0};return{filter:l,skipStep:o}},e.adjustWidthRegardingLastItem=function(t,i,a){var r=t.labelInfo.length,o=Math.floor((r-1)/i)*i,n=a+e.SliderMarginRight-a/r*(o+1),s=t.labelInfo[o].labelWidth,l=s/2-n;if(l>0){var c=e.SliderMaxMargin-e.SliderMarginRight;return l=l>c?c:l,a-l}return a},e.prototype.createSliderDOM=function(t){this.playAxisContainer=$('<div class="play-axis-container"></div>').appendTo(t).css("height",e.PlayControlHeight+"px"),this.playButtonCircle=$('<div class="button-container"></div>').appendTo(this.playAxisContainer),this.isMobileChart&&this.playButtonCircle.addClass("mobile-button-container"),this.playButton=$('<div class="play"></div>').appendTo(this.playButtonCircle),this.slider=$('<div class="sliders"></div>').appendTo(this.playAxisContainer)},e.calucalateSliderSize=function(t,i){var a=0;_.isEmpty(t.labelInfo)||(a=_.first(t.labelInfo).labelWidth/2);var r=Math.max(a,e.SliderMarginLeft);r=Math.min(e.SliderMaxMargin,r);var o=Math.max(i-r-e.SliderMarginRight,1);return{width:o,marginLeft:r}},e.SliderMarginLeft=44,e.SliderMarginRight=20,e.SliderMaxMargin=100,e.PlayControlHeight=80,e}();!function(i){function s(i,a){var n=i.matrix,s={categories:[],values:e.data.DataViewTransform.createValueColumns()};if(_.isEmpty(n.columns.levels)||n.rows.levels.length<2&&n.columns.levels.length<2)return{metadata:i.metadata,categorical:s};for(var c=1,u=[],h=c,d=n.rows.levels.length;d>h;h++){var p=n.rows.levels[h].sources[0];u.push({source:p,values:[],identity:[],objects:void 0})}var g=!_.isEmpty(n.rows.root.children),m=!_.isEmpty(n.columns.root.children),f=n.columns.levels.length>1&&m,y=n.rows.levels.length>1&&g;if(f&&!y){s.categories=void 0;var v=n.columns.root;s.values.source=n.columns.levels[0].sources[0];for(var b=n.valueSources.length,C=0,S=v.children.length;S>C;C++)for(var x=v.children[C],w=0;b>w;w++){var P=_.create(n.valueSources[w],{groupName:void 0===x.value?null:x.value}),D={identity:x.identity,values:[],source:P};s.values.push(D)}for(var L=n.rows.root.children[a],T=L.values,V=0,M=v.children.length;M>V;V++)for(var w=0;b>w;w++)s.values[V*b+w].values.push(T[V*b+w].value)}else if(f&&g){var L=n.rows.root.children[a];o.forEachLeafNode(L.children,function(e,t,i){l(i,u)}),s.categories=u,s.values.source=n.columns.levels[0].sources[0];for(var N=[],x=n.columns.root,A=-1;x;){if(x.children&&x.children[0].children)for(var w=0,O=x.children.length;O>w;w++)N.push(x.children[w]);else if(x.children&&L.children){for(var I=x.children.length,w=0;I>w;w++){var P=_.create(n.valueSources[w],{groupName:x.value}),D={identity:x.identity,values:[],source:P};s.values.push(D)}o.forEachLeafNode(L.children,function(e){for(var t=0;I>t;t++)s.values[A*I+t].values.push(e.values[A*I+t].value)})}N.length>0?(x=N[0],N=N.splice(1),A++):x=void 0}}else if(y){for(var L=n.rows.root.children[a],R=n.valueSources.length,w=0;R>w;w++){var D={identity:void 0,values:[],source:n.valueSources[w]};s.values.push(D)}o.forEachLeafNode(L.children,function(e,t,i){l(i,u);for(var a=0;R>a;a++)s.values[a].values.push(e.values[a].value)}),s.categories=u}return r.applyToPlayChartCategorical(i.metadata,t.scatterChartCapabilities.objects,"Category",s)}function l(e,t){var i=e[0].identity;if(e.length>1){for(var r=i.expr,o=1,s=e.length;s>o;o++){var l=e[o].identity.expr;r=n.and(r,l)}i=a(r)}for(var c=0,u=t.length;u>c;c++){t[c].identity.push(i);var h=e[c];t[c].values.push(h.value)}}function c(i,a){var r={};if(i&&i.objects){var o=i.objects;r.currentFrameIndex=e.DataViewObjects.getValue(o,t.scatterChartProps.currentFrameIndex.index,null)}return r}function u(e,i){var a,r=e.metadata,o=t.dataLabelUtils.getDefaultPointLabelSettings(),n=c(r,o),l=[],u=[],h=void 0,d=e.matrix.rows,g=d.root.children?d.root.children.length:0;if(e.matrix&&g>0&&!_.isEmpty(d.levels)&&!_.isEmpty(d.levels[0].sources)){a=d.levels[0].sources[0];var m=t.valueFormatter.getFormatString(a,t.scatterChartProps.general.formatString),f=void 0;if(a.type.numeric){var y=Math.abs(d.root.children[g-1].value-d.root.children[0].value);f=t.valueFormatter.create({format:m,value:y,value2:0})}else f=t.valueFormatter.createDefaultFormatter(m,!0);for(var v=0,b=g;b>v;v++){var C=d.root.children[v],S=f.format(C.value),x=$("<div/>").text(S).html();u.push({escapedText:x,text:S});var w=s(e,v),P={label:x,column:a};h=i(w,P),l.push(h)}}else{var w=s(e,0);h=i(w),l.push(h)}return n.currentFrameIndex=u.length-1,{allViewModels:l,currentViewModel:h,frameData:u,currentFrameIndex:n.currentFrameIndex,labelData:p(u,a)}}function h(){var e={frameData:[],allViewModels:[],currentFrameIndex:0,currentViewModel:void 0,labelData:{anyWordBreaks:!1,labelInfo:[]}};return e}function d(e,t){var i={minY:0,maxY:10,minX:0,maxX:10};if(e.allViewModels&&e.allViewModels.length>0){i.minY=i.minX=Number.MAX_VALUE,i.maxY=i.maxX=Number.MIN_VALUE;for(var a=0,r=e.allViewModels.length;r>a;a++){var o=e.allViewModels[a],n=t(o);i={minY:d3.min([n.minY,i.minY]),maxY:d3.max([n.maxY,i.maxY]),minX:d3.min([n.minX,i.minX]),maxX:d3.max([n.maxX,i.maxX])}}}return i}function p(t,i){for(var a={fontFamily:"wf_segoe-ui_normal",fontSize:jsCommon.PixelConverter.toString(14)},r=[],o=!1,n=0,s=t;n<s.length;n++){var l=s[n],c=jsCommon.WordBreaker.getMaxWordWidth(l.escapedText,e.TextMeasurementService.measureSvgTextWidth,a);o=o||jsCommon.WordBreaker.hasBreakers(l.escapedText)||l.escapedText.indexOf("-")>-1,r.push({label:l.escapedText,labelWidth:c})}return{labelInfo:r,anyWordBreaks:o,labelFieldName:i&&i.displayName}}function g(e,t){void 0===t&&(t="Play");var i=e.matrix&&e.matrix.rows&&e.matrix.rows.levels&&e.matrix.rows.levels[0]&&e.matrix.rows.levels[0].sources&&e.matrix.rows.levels[0].sources[0]&&e.matrix.rows.levels[0].sources[0].roles;return i&&i[t]}function m(e,t,i){var a=_.filter(e,function(e){return e.selected});a=_.uniq(a,function(e){return e.identity.getKey()}),t.render(a,i)}i.FrameStepDuration=800,i.FrameAnimationDuration=750,i.ClassName="playChart",i.convertMatrixToCategorical=s,i.converter=u,i.getDefaultPlayData=h,i.getMinMaxForAllFrames=d,i.isDataViewPlayable=g,i.renderTraceLines=m}(l=t.PlayChart||(t.PlayChart={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=jsCommon.PixelConverter,i=function(){function i(e){this.textProperties={fontFamily:"wf_segoe-ui_normal, helvetica, arial, sans-serif",fontSize:"14px"},e&&(this.behavior=e.behavior),this.domHelper=e.domHelper}return i.prototype.getDefaultValue=function(){return this.data&&this.data.defaultValue?this.data.defaultValue.value:void 0},i.prototype.getIdentityFields=function(){return e.SlicerUtil.DefaultValueHandler.getIdentityFields(this.dataView)},i.prototype.init=function(i){var r=this;this.element=i.visualInitOptions.element,this.currentViewport=i.visualInitOptions.viewport;var o,n=this.hostServices=i.visualInitOptions.host,s=this.settings=e.Slicer.DefaultStyleProperties(),l=this.domHelper,c=l.getSlicerBodyViewport(this.currentViewport,s,this.textProperties);this.behavior&&(o=e.createInteractivityService(n));var u=document.createElement("div");u.className=a.Container["class"];var h=this.container=d3.select(u),d=l.createSlicerHeader(n);u.appendChild(d),this.header=d3.select(d),this.body=h.append("div").classed(e.SlicerUtil.Selectors.Body["class"],!0).style({height:t.toString(c.height),width:t.toString(c.width)});var p=function(e){r.onEnterSelection(e)},g=function(e){r.onUpdateSelection(e,o)},m=function(e){e.remove()},f={rowHeight:l.getRowHeight(s,this.textProperties),enter:p,exit:m,update:g,loadMoreData:function(){return i.loadMoreData()},scrollEnabled:!0,viewport:l.getSlicerBodyViewport(this.currentViewport,s,this.textProperties),baseContainer:this.body,isReadMode:function(){return 1!==r.hostServices.getViewMode()}};return this.listView=e.ListViewFactory.createListView(f),this.element.get(0).appendChild(u),o},i.prototype.render=function(e){var t=this.data=e.data;this.currentViewport=e.viewport;var i=e.dataView;if(!i||!t)return void this.listView.empty();this.dataView=i;var a=this.settings=t.slicerSettings,r=this.domHelper;r.updateSlicerBodyDimensions(this.currentViewport,this.body,a),this.updateSelectionStyle(),this.listView.viewport(r.getSlicerBodyViewport(this.currentViewport,a,this.textProperties)).rowHeight(r.getRowHeight(a,this.textProperties)).data(t.slicerDataPoints,function(e){return $.inArray(e,t.slicerDataPoints)},e.resetScrollbarPosition)},i.prototype.updateSelectionStyle=function(){var e=this.settings;this.container.classed("isMultiSelectEnabled",e&&e.selection&&!e.selection.singleSelect)},i.prototype.onEnterSelection=function(i){var r=this.settings,o=i.append("li").classed(a.ItemContainer["class"],!0),n=o.append("div").classed(a.Input["class"],!0);n.append("input").attr("type","checkbox"),n.append("span").classed(a.Checkbox["class"],!0),o.each(function(i,a){var o=d3.select(this);i.isImage?o.append("img").classed(e.SlicerUtil.Selectors.LabelImage["class"],!0):o.append("span").classed(e.SlicerUtil.Selectors.LabelText["class"],!0),null!=i.count&&o.append("span").classed(e.SlicerUtil.Selectors.CountText["class"],!0).style("font-size",t.fromPoint(r.slicerText.textSize))})},i.prototype.onUpdateSelection=function(t,i){var r=this.settings,o=this.data;if(o&&r){var n=this.domHelper;n.styleSlicerHeader(this.header,r,o.categorySourceName),this.header.attr("title",o.categorySourceName);var s=t.selectAll(e.SlicerUtil.Selectors.LabelText.selector);s.text(function(e){return e.value}).attr("title",function(e){return e.tooltip}),n.setSlicerTextStyle(s,r);var l=t.selectAll(e.SlicerUtil.Selectors.LabelImage.selector);l.empty()||l.attr("src",function(e){return e.value});var c=t.selectAll(e.SlicerUtil.Selectors.CountText.selector);if(c.empty()||(c.text(function(e){return e.count}),n.setSlicerTextStyle(c,r)),i&&this.body){var u=this.body.attr("width",this.currentViewport.width),h=u.selectAll(a.ItemContainer.selector),d=u.selectAll(e.SlicerUtil.Selectors.LabelText.selector),p=u.selectAll(a.Input.selector),g=this.header.select(e.SlicerUtil.Selectors.Clear.selector),m={dataPoints:o.slicerDataPoints,slicerContainer:this.container,itemContainers:h,itemLabels:d,itemInputs:p,clear:g,interactivityService:i,settings:o.slicerSettings},f={behaviorOptions:m,orientation:0};i.bind(o.slicerDataPoints,this.behavior,f,{overrideSelectionFromData:!0,hasSelectionOverride:o.hasSelectionOverride,slicerDefaultValueHandler:this}),e.SlicerWebBehavior.styleSlicerItems(t.select(a.Input.selector),o.hasSelectionOverride,i.isSelectionModeInverted())}else e.SlicerWebBehavior.styleSlicerItems(t.select(a.Input.selector),!1,!1)}},i}();e.VerticalSlicerRenderer=i;var a;!function(e){var t=jsCommon.CssConstants.createClassAndSelector;e.Container=t("slicerContainer"),e.ItemContainer=t("slicerItemContainer"),e.Input=t("slicerCheckbox"),e.Checkbox=t("checkbox")}(a||(a={}));var r;!function(e){e.MinimumSize=8,e.Size=13,e.SizeRange=e.Size-e.MinimumSize}(r||(r={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.PixelConverter,a=50,r=80,o=.8,n={labelText:{marginRight:2,paddingLeft:8,paddingRight:8}},s=function(){function s(e){this.textProperties={fontFamily:"wf_segoe-ui_normal",fontSize:"14px"},e&&(this.behavior=e.behavior),this.domHelper=e.domHelper,this.dataStartIndex=0}return s.prototype.getDefaultValue=function(){return this.data&&this.data.defaultValue?this.data.defaultValue.value:void 0},s.prototype.getIdentityFields=function(){return t.SlicerUtil.DefaultValueHandler.getIdentityFields(this.dataView)},s.prototype.init=function(e){this.element=e.visualInitOptions.element,this.currentViewport=e.visualInitOptions.viewport;var i=this.hostServices=e.visualInitOptions.host;this.behavior&&(this.interactivityService=t.createInteractivityService(i)),this.loadMoreData=function(){return e.loadMoreData()};var a=document.createElement("div");a.className=l.container["class"];var r=this.container=d3.select(a),o=this.domHelper.createSlicerHeader(this.hostServices);a.appendChild(o),this.header=d3.select(o);var n=this.body=r.append("div").classed(t.SlicerUtil.Selectors.Body["class"]+" "+l.FlexDisplay["class"],!0);return this.leftNavigationArrow=n.append("button").classed(l.NavigationArrow["class"]+" "+l.LeftNavigationArrow["class"],!0),this.itemsContainer=n.append("div").classed(l.ItemsContainer["class"]+" "+l.FlexDisplay["class"],!0),this.rightNavigationArrow=n.append("button").classed(l.NavigationArrow["class"]+" "+l.RightNavigationArrow["class"],!0),this.element.get(0).appendChild(a),this.bindNavigationEvents(),this.interactivityService},s.prototype.render=function(e){var t=e.data,i=e.dataView;if(!i||!t)return void this.itemsContainer.selectAll("*").remove();this.data=t,this.dataView=i;var a=this.currentViewport&&e.viewport&&(this.currentViewport.height!==e.viewport.height||this.currentViewport.width!==e.viewport.width);this.isMaxWidthCalculated()&&a||(this.calculateAndSetMaxItemWidth(),this.calculateAndSetTotalItemWidth()),this.currentViewport=e.viewport,this.updateStyle();var r=this.element.find(l.ItemsContainer.selector).width();this.itemsToDisplay=this.getNumberOfItemsToDisplay(r),0!==this.itemsToDisplay&&this.renderCore()},s.prototype.renderCore=function(){var e=this.data;if(e&&e.slicerDataPoints){this.normalizePosition(e.slicerDataPoints);var t=this.itemsToDisplay,i=this.dataStartIndex;this.container.classed(l.CanScrollRight["class"],i+this.itemsToDisplay<=e.slicerDataPoints.length-1),this.container.classed(l.CanScrollLeft["class"],i>0),this.renderItems(e.slicerSettings),this.bindInteractivityService(),i+t>=e.slicerDataPoints.length*o&&this.loadMoreData()}},s.prototype.updateStyle=function(){var e=this.currentViewport,t=this.data,a=t.slicerSettings,r=this.domHelper;this.container.classed(l.MultiSelectEnabled["class"],!a.selection.singleSelect).style({width:i.toString(e.width),height:i.toString(e.height)}),r.styleSlicerHeader(this.header,a,t.categorySourceName);var o=r.getHeaderTextProperties(a);this.header.attr("title",t.categorySourceName);var n=this.bodyViewport=r.getSlicerBodyViewport(e,a,o);this.body.style({height:i.toString(n.height),width:i.toString(n.width)})},s.prototype.renderItems=function(a){var r=this,o=this.itemsToDisplay,s=this.dataStartIndex,c=this.data.slicerDataPoints.slice(s,s+o),u=this.itemsContainer.selectAll(t.SlicerUtil.Selectors.LabelText.selector).data(c,function(e){return _.indexOf(r.data.slicerDataPoints,e)});u.enter().append("div").classed(t.SlicerUtil.Selectors.LabelText["class"]+" "+l.FlexDisplay["class"],!0),u.order(),u.style({"font-family":this.textProperties.fontFamily,"padding-left":i.toString(n.labelText.paddingLeft),"padding-right":i.toString(n.labelText.paddingRight),"margin-right":function(e,t){return r.isLastRowItem(t,o)?"0px":i.toString(n.labelText.marginRight)}}),this.domHelper.setSlicerTextStyle(u,a),u.exit().remove(),window.setTimeout(function(){u.attr("title",function(e){return e.tooltip}).text(function(e){return e.value});var i=r.element.find(t.SlicerUtil.Selectors.LabelText.selector),a=i.first(),o=a.width(),n=a.height();i.each(function(t,i){e.TextMeasurementService.wordBreakOverflowingText(i,o,n)})})},s.prototype.bindInteractivityService=function(){if(this.interactivityService&&this.body){var e=this.body,i=e.selectAll(l.ItemsContainer.selector),a=e.selectAll(t.SlicerUtil.Selectors.LabelText.selector),r=this.header.select(t.SlicerUtil.Selectors.Clear.selector),o=this.data,n={dataPoints:o.slicerDataPoints,slicerContainer:this.container,itemsContainer:i,itemLabels:a,clear:r,interactivityService:this.interactivityService,settings:o.slicerSettings},s={behaviorOptions:n,orientation:1};this.interactivityService.bind(o.slicerDataPoints,this.behavior,s,{overrideSelectionFromData:!0,hasSelectionOverride:o.hasSelectionOverride}),t.SlicerWebBehavior.styleSlicerItems(this.itemsContainer.selectAll(t.SlicerUtil.Selectors.LabelText.selector),this.interactivityService.hasSelection(),this.interactivityService.isSelectionModeInverted())}else t.SlicerWebBehavior.styleSlicerItems(this.itemsContainer.selectAll(t.SlicerUtil.Selectors.LabelText.selector),!1,!1)},s.prototype.normalizePosition=function(e){var t=this.dataStartIndex;t=Math.min(t,e.length-1),this.dataStartIndex=Math.max(t,0)},s.prototype.bindNavigationEvents=function(){this.registerMouseWheelScrollEvents(),this.registerMouseClickEvents()},s.prototype.registerMouseClickEvents=function(){var e=this,t=this.container.selectAll(l.RightNavigationArrow.selector),i=this.container.selectAll(l.LeftNavigationArrow.selector);t.on("click",function(){e.scrollRight()}),i.on("click",function(){e.scrollLeft()})},s.prototype.registerMouseWheelScrollEvents=function(){var e=this,t=this.body.node();t.addEventListener("mousewheel",function(t){e.onMouseWheel(t.wheelDelta)}),t.addEventListener("DOMMouseScroll",function(t){e.onMouseWheel(t.detail)})},s.prototype.onMouseWheel=function(e){0>e?this.scrollRight():e>0&&this.scrollLeft()},s.prototype.scrollRight=function(){var e=this.itemsToDisplay,t=this.dataStartIndex,i=this.data.slicerDataPoints.length,a=i-1;e+t>a||(t+=1===e?e:e-1,e+t>a&&(t=a-e+1),this.dataStartIndex=t,this.renderCore())},s.prototype.scrollLeft=function(){var e=this.itemsToDisplay,t=this.dataStartIndex,i=0;0!==t&&(1===e&&(t-=e),t=i>t-e?i:t-e+1,this.dataStartIndex=t,this.renderCore())},s.prototype.isLastRowItem=function(e,t){return e===t-1},s.prototype.getScaledTextWidth=function(e){return e/jsCommon.TextSizeDefaults.TextSizeMin*r},s.prototype.isMaxWidthCalculated=function(){return void 0!==this.maxItemWidth},s.prototype.calculateAndSetMaxItemWidth=function(){var t=this.getDataPointsCount(),r=0;if(0===t)return void(this.maxItemWidth=r);var o=this.data,n=o.slicerDataPoints,s=Math.min(t,a),l=jQuery.extend(!0,{},this.textProperties),c=o.slicerSettings.slicerText.textSize;l.fontSize=i.fromPoint(c);for(var u=jsCommon.WordBreaker.getMaxWordWidth,h=0;s>h;h++){var d=n[h].value;l.text=d,r=Math.max(r,u(d,e.TextMeasurementService.measureSvgTextWidth,l));
27}this.maxItemWidth=Math.min(r,this.getScaledTextWidth(c))},s.prototype.calculateAndSetTotalItemWidth=function(){var e=this.data,t=n.labelText.paddingLeft+n.labelText.paddingRight+n.labelText.marginRight,i=this.domHelper.getRowsOutlineWidth(e.slicerSettings.slicerText.outline,e.slicerSettings.general.outlineWeight);this.totalItemWidth=this.maxItemWidth+t+i},s.prototype.getNumberOfItemsToDisplay=function(e){var t=this.totalItemWidth;if(0===t)return 0;var i=this.getDataPointsCount(),a=Math.min(i,Math.round(e/t));return Math.max(a,1)},s.prototype.getDataPointsCount=function(){return _.size(this.data.slicerDataPoints)},s}();t.HorizontalSlicerRenderer=s;var l;!function(e){var t=jsCommon.CssConstants.createClassAndSelector;e.container=t("horizontalSlicerContainer"),e.ItemsContainer=t("slicerItemsContainer"),e.NavigationArrow=t("navigationArrow"),e.LeftNavigationArrow=t("left"),e.RightNavigationArrow=t("right"),e.MultiSelectEnabled=t("isMultiSelectEnabled"),e.FlexDisplay=t("flexDisplay"),e.CanScrollRight=t("canScrollRight"),e.CanScrollLeft=t("canScrollLeft")}(l||(l={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=t.SlicerUtil.DisplayNameKeys,a=t.SlicerUtil.DOMHelper,r=t.SlicerUtil.SettingsHelper,o=function(){function o(e){e&&(this.behavior=e.behavior),this.domHelper=new a}return o.DefaultStyleProperties=function(){return{general:{outlineColor:"#808080",outlineWeight:1,orientation:0},header:{borderBottomWidth:1,show:!0,outline:t.outline.bottomOnly,fontColor:"#000000",textSize:10},slicerText:{color:"#666666",outline:t.outline.none,textSize:10},selection:{selectAllCheckboxEnabled:!1,singleSelect:!0}}},o.prototype.init=function(e){this.initOptions=e,this.element=e.element,this.currentViewport=e.viewport,this.hostServices=e.host;var t=this.settings=o.DefaultStyleProperties();this.slicerOrientation=t.general.orientation,this.waitingForData=!1,this.initializeSlicerRenderer(this.slicerOrientation)},o.prototype.onDataChanged=function(t){var i=t.dataViews;if(!_.isEmpty(i)){var a=this.dataView;this.dataView=i[0];var r=t.operationKind!==e.VisualDataChangeOperationKind.Append&&!e.DataViewAnalysis.hasSameCategoryIdentity(a,this.dataView);this.render(r,!0)}},o.prototype.onResizing=function(e){this.currentViewport=e,this.render(!1)},o.prototype.enumerateObjectInstances=function(e){return n.enumerateObjectInstances(e,this.slicerData,this.settings,this.dataView)},o.prototype.loadMoreData=function(){var e=this.dataView;if(e){var t=e.metadata;!this.waitingForData&&t&&t.segment&&(this.hostServices.loadMoreData(),this.waitingForData=!0)}},o.prototype.onClearSelection=function(){this.interactivityService&&(this.interactivityService.clearSelection(),this.render(!1))},o.prototype.render=function(e,a){var n=this.hostServices.getLocalizedString(i.SelectAll);if(this.slicerData=t.DataConversion.convert(this.dataView,n,this.interactivityService,this.hostServices),this.slicerData){this.slicerData.slicerSettings.general.outlineWeight=Math.max(this.slicerData.slicerSettings.general.outlineWeight,0),this.settings=this.slicerData.slicerSettings;var s=r.areSettingsDefined(this.slicerData)&&this.slicerData.slicerSettings.general&&this.slicerData.slicerSettings.general.orientation?this.slicerData.slicerSettings.general.orientation:o.DefaultStyleProperties().general.orientation,l=this.orientationHasChanged(s);l&&(this.slicerOrientation=s,this.element.empty(),this.initializeSlicerRenderer(s))}this.slicerRenderer.render({dataView:this.dataView,data:this.slicerData,viewport:this.currentViewport,resetScrollbarPosition:e}),a&&(this.waitingForData=!1)},o.prototype.orientationHasChanged=function(e){return this.slicerOrientation!==e},o.prototype.initializeSlicerRenderer=function(e){switch(e){case 1:this.initializeHorizontalSlicer();break;case 0:this.initializeVerticalSlicer()}},o.prototype.initializeVerticalSlicer=function(){var e=this.slicerRenderer=new t.VerticalSlicerRenderer({domHelper:this.domHelper,behavior:this.behavior}),i=this.createInitOptions();this.interactivityService=e.init(i)},o.prototype.initializeHorizontalSlicer=function(){var e=this.slicerRenderer=new t.HorizontalSlicerRenderer({domHelper:this.domHelper,behavior:this.behavior}),i=this.createInitOptions();this.interactivityService=e.init(i)},o.prototype.createInitOptions=function(){var e=this;return{visualInitOptions:this.initOptions,loadMoreData:function(){return e.loadMoreData()}}},o}();t.Slicer=o;var n;!function(e){function t(e,t,r,l){if(t)switch(e.objectName){case"items":return n(t,r);case"header":return o(t,r);case"general":return s(t,r);case"selection":if(i(l))return a(t,r)}}function i(e){return!(e&&e.metadata&&e.metadata.columns&&_.some(e.metadata.columns,function(e){return e.discourageAggregationAcrossGroups}))}function a(e,t){var i=t,a=r.areSettingsDefined(e)&&e.slicerSettings.selection,o=a&&e.slicerSettings.selection.selectAllCheckboxEnabled?e.slicerSettings.selection.selectAllCheckboxEnabled:i.selection.selectAllCheckboxEnabled,n=e&&e.slicerSettings&&e.slicerSettings.selection&&void 0!==e.slicerSettings.selection.singleSelect?e.slicerSettings.selection.singleSelect:i.selection.singleSelect;return[{selector:null,objectName:"selection",properties:{selectAllCheckboxEnabled:o,singleSelect:n}}]}function o(e,t){var i=t,a=r.areSettingsDefined(e)&&e.slicerSettings.header,o=a&&e.slicerSettings.header.fontColor?e.slicerSettings.header.fontColor:i.header.fontColor,n=a&&e.slicerSettings.header.background?e.slicerSettings.header.background:i.header.background;return[{selector:null,objectName:"header",properties:{show:i.header.show,fontColor:o,background:n,outline:i.header.outline,textSize:i.header.textSize}}]}function n(e,t){var i=t,a=r.areSettingsDefined(e)&&e.slicerSettings.slicerText,o=a&&e.slicerSettings.slicerText.color?e.slicerSettings.slicerText.color:i.slicerText.color,n=a&&e.slicerSettings.slicerText.background?e.slicerSettings.slicerText.background:i.slicerText.background;return[{selector:null,objectName:"items",properties:{fontColor:o,background:n,outline:i.slicerText.outline,textSize:i.slicerText.textSize}}]}function s(e,t){var i=t,a=r.areSettingsDefined(e)&&null!=e.slicerSettings.general,o=a&&e.slicerSettings.general.outlineColor?e.slicerSettings.general.outlineColor:i.general.outlineColor,n=a&&e.slicerSettings.general.outlineWeight?e.slicerSettings.general.outlineWeight:i.general.outlineWeight,s=a&&null!=e.slicerSettings.general.orientation?e.slicerSettings.general.orientation:i.general.orientation;return[{selector:null,objectName:"general",properties:{outlineColor:o,outlineWeight:n,orientation:s}}]}e.enumerateObjectInstances=t}(n||(n={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=t.controls.internal.TablixUtils,a=t.controls.internal.TablixObjects,r=function(){function t(e,t){this.tableDataView=e,this.formatter=t}return t.prototype.getColumnHierarchyDepth=function(){return 1},t.prototype.getRowHierarchyDepth=function(){return 1},t.prototype.getLeafCount=function(e){return e.length},t.prototype.getLeafAt=function(e,t){return e[t]},t.prototype.getParent=function(e){return null},t.prototype.getIndex=function(e){return e?this.isRow(e)?e.index:this.getColumnIndex(e):-1},t.prototype.isRow=function(e){if(!e)return!1;var t=e;return void 0!==t.index&&void 0!==t.values},t.prototype.getColumnIndex=function(e){return t.getIndex(this.tableDataView.columns,e)},t.prototype.isLeaf=function(e){return!0},t.prototype.isRowHierarchyLeaf=function(e){return!1},t.prototype.isColumnHierarchyLeaf=function(e){return!0},t.prototype.isFirstItem=function(e,t){return e===t[0]},t.prototype.areAllParentsFirst=function(e,t){return this.isFirstItem(e,t)},t.prototype.isLastItem=function(e,t){return t[t.length-1]===e},t.prototype.areAllParentsLast=function(e,t){return this.isLastItem(e,t)},t.prototype.getChildren=function(e){return null},t.prototype.getChildrenLevelDifference=function(e){return 1/0},t.prototype.getCount=function(e){return e.length},t.prototype.getAt=function(e,t){return e[t]},t.prototype.getLevel=function(e){return 0},t.prototype.getIntersection=function(e,r){var o,n=!1,s=new i.CellPosition,l=t.getIndex(this.tableDataView.columns,r);s.column.index=l,s.column.isFirst=0===l,s.column.isLast=l===this.tableDataView.columns.length-1;var c=e;if(null!=c.totalCells)n=!0,o=c.totalCells[l];else{var u=e,h=u.index;s.row.index=h,s.row.isFirst=0===h,s.row.isLast=h===this.tableDataView.rows.length-1,o=u.values[l]}var d=new i.TablixVisualCell(o,n,r,this.formatter);d.position=s;var p=e;if(p&&p.values){var g=p.values.objects;if(g){var m=g[l];m&&(d.backColor=a.PropValuesBackColor.getValue(m))}}return d},t.prototype.getCorner=function(e,t){return null},t.prototype.headerItemEquals=function(t,i){if(t===i)return!0;if(t.displayName&&i.displayName){var a=t,r=i;return e.DataViewAnalysis.areMetadataColumnsEquivalent(a,r)}return this.isRow(t)&&this.isRow(i)?t.index===i.index:!1},t.prototype.bodyCellItemEquals=function(e,t){return e.isMatch(t)},t.prototype.cornerCellItemEquals=function(e,t){return!0},t.prototype.update=function(e){this.tableDataView=e},t.getIndex=function(e,t){for(var i=0,a=e.length;a>i;i++){var r=e[i];if(null!=r.index&&null!=t.index&&r.index===t.index)return i;if(t===e[i])return i}return-1},t}();t.TableHierarchyNavigator=r;var o=function(){function r(e){this.options=e}return r.prototype.onDataViewChanged=function(e){this.tableDataView=e,this.formattingProperties=e.formattingProperties,this.updateTextHeights()},r.prototype.updateTextHeights=function(){var t={fontFamily:"",fontSize:a.getTextSizeInPx(this.formattingProperties.general.textSize),text:"a"};t.fontFamily=i.FontFamilyHeader,this.textHeightHeader=Math.ceil(e.TextMeasurementService.measureSvgTextHeight(t)),t.fontFamily=i.FontFamilyCell,this.textHeightValue=Math.ceil(e.TextMeasurementService.measureSvgTextHeight(t)),t.fontFamily=i.FontFamilyTotal,this.textHeightTotal=Math.ceil(e.TextMeasurementService.measureSvgTextHeight(t))},r.prototype.onStartRenderingSession=function(){},r.prototype.onEndRenderingSession=function(){},r.prototype.bindRowHeader=function(e,t){t.contentHeight=this.textHeightValue,i.clearCellStyle(t),this.options.onBindRowHeader&&this.options.onBindRowHeader(e)},r.prototype.unbindRowHeader=function(e,t){},r.prototype.bindColumnHeader=function(e,t){var r=this;t.extension.disableDragResize(),i.resetCellCssClass(t),i.addCellCssClass(t,i.CssClassTablixHeader),i.addCellCssClass(t,i.CssClassTablixColumnHeaderLeaf);var o=new i.CellStyle;if(o.fontFamily=i.FontFamilyHeader,o.fontColor=i.FontColorHeaders,o.borders.bottom=new i.EdgeSettings(a.PropGridOutlineWeight.defaultValue,a.PropGridOutlineColor.defaultValue),t.contentHeight=this.textHeightHeader,this.sortIconsEnabled()?i.createColumnHeaderWithSortIcon(e,t):i.setCellTextAndTooltip(t,e.displayName),this.options.onColumnHeaderClick){var n=function(t){if(i.isValidSortClick(t)){var a=i.reverseSort(e.sort);r.options.onColumnHeaderClick(e.queryName?e.queryName:e.displayName,a)}};t.extension.registerClickHandler(n)}this.setColumnHeaderStyle(t,o),t.applyStyle(o)},r.prototype.setColumnHeaderStyle=function(e,a){var r=this.formattingProperties.grid,o=this.formattingProperties.columnHeaders,n=this.formattingProperties.total,s=this.formattingProperties.values;a.borders.top=new i.EdgeSettings,a.borders.top.applyParams(t.outline.showTop(o.outline),r.outlineWeight,r.outlineColor),a.borders.bottom=new i.EdgeSettings,a.borders.bottom.applyParams(t.outline.showBottom(o.outline),r.outlineWeight,r.outlineColor),a.borders.left=new i.EdgeSettings,e.position.column.isFirst&&(a.borders.left.applyParams(t.outline.showLeft(o.outline),r.outlineWeight,r.outlineColor),t.outline.showLeft(o.outline)||!t.outline.showLeft(n.outline)&&!t.outline.showLeft(s.outline)||(a.paddings.left+=r.outlineWeight)),a.borders.right=new i.EdgeSettings,e.position.column.isLast?(a.borders.right.applyParams(t.outline.showRight(o.outline),r.outlineWeight,r.outlineColor),t.outline.showRight(o.outline)||!t.outline.showRight(n.outline)&&!t.outline.showRight(s.outline)||(a.paddings.right+=r.outlineWeight)):a.borders.right.applyParams(r.gridVertical,r.gridVerticalWeight,r.gridVerticalColor),a.fontColor=o.fontColor,a.backColor=o.backColor,a.paddings.top=a.paddings.bottom=r.rowPadding},r.prototype.unbindColumnHeader=function(e,t){i.clearCellStyle(t),i.clearCellTextAndTooltip(t),this.sortIconsEnabled()&&i.removeSortIcons(t),this.options.onColumnHeaderClick&&t.extension.unregisterClickHandler()},r.prototype.bindBodyCell=function(e,t){i.resetCellCssClass(t);var r;r=this.formattingProperties.grid.imageHeight;var o=new i.CellStyle;e.isImage?t.contentHeight=r:t.contentHeight=this.textHeightValue,e.isUrl&&e.isValidUrl?i.appendATagToBodyCell(e.textContent,t,this.formattingProperties.values.urlIcon):e.isImage&&e.isValidUrl?(i.appendImgTagToBodyCell(e.textContent,t,r),o.hasImage=!0):e.domContent?$(t.extension.contentHost).append(e.domContent):e.textContent?i.setCellTextAndTooltip(t,e.textContent):i.setCellTextAndTooltip(t," "),e.isTotal?(i.addCellCssClass(t,i.CssClassTablixValueTotal),i.addCellCssClass(t,i.CssClassTableFooter),o.fontFamily=i.FontFamilyTotal,o.borders.top=new i.EdgeSettings(a.PropGridOutlineWeight.defaultValue,a.PropGridOutlineColor.defaultValue),t.contentHeight=this.textHeightTotal):e.position.row.isLast?i.addCellCssClass(t,i.CssClassTableBodyCellBottom):(i.addCellCssClass(t,i.CssClassTableBodyCell),o.borders.bottom=new i.EdgeSettings(a.PropGridHorizontalWeight.defaultValue,a.PropGridHorizontalColor.defaultValue)),e.isNumeric&&i.addCellCssClass(t,i.CssClassTablixValueNumeric),e.isTotal?this.setFooterStyle(t,o):this.setBodyStyle(e,t,o),t.applyStyle(o)},r.prototype.setBodyStyle=function(e,a,r){var o=this.formattingProperties.grid,n=this.formattingProperties.values,s=this.formattingProperties.total,l=this.formattingProperties.columnHeaders;r.borders.top=new i.EdgeSettings,a.position.row.isFirst&&r.borders.top.applyParams(t.outline.showTop(n.outline),o.outlineWeight,o.outlineColor),r.borders.bottom=new i.EdgeSettings,a.position.row.isLast?r.borders.bottom.applyParams(t.outline.showBottom(n.outline),o.outlineWeight,o.outlineColor):r.borders.bottom.applyParams(o.gridHorizontal,o.gridHorizontalWeight,o.gridHorizontalColor),r.borders.left=new i.EdgeSettings,a.position.column.isFirst&&(r.borders.left.applyParams(t.outline.showLeft(n.outline),o.outlineWeight,o.outlineColor),t.outline.showLeft(n.outline)||!t.outline.showLeft(s.outline)&&!t.outline.showLeft(l.outline)||(r.paddings.left+=o.outlineWeight)),r.borders.right=new i.EdgeSettings,a.position.column.isLast?(r.borders.right.applyParams(t.outline.showRight(n.outline),o.outlineWeight,o.outlineColor),t.outline.showRight(n.outline)||!t.outline.showRight(s.outline)&&!t.outline.showRight(l.outline)||(r.paddings.right+=o.outlineWeight)):r.borders.right.applyParams(o.gridVertical,o.gridVerticalWeight,o.gridVerticalColor),r.fontColor=a.position.row.index%2===0?n.fontColorPrimary:n.fontColorSecondary,e.backColor?r.backColor=e.backColor:r.backColor=a.position.row.index%2===0?n.backColorPrimary:n.backColorSecondary,r.paddings.top=r.paddings.bottom=o.rowPadding},r.prototype.setFooterStyle=function(e,a){var r=this.formattingProperties.total,o=this.formattingProperties.grid,n=this.formattingProperties.values,s=this.formattingProperties.columnHeaders;a.borders.top=new i.EdgeSettings,a.borders.top.applyParams(t.outline.showTop(r.outline),o.outlineWeight,o.outlineColor),a.borders.bottom=new i.EdgeSettings,a.borders.bottom.applyParams(t.outline.showBottom(r.outline),o.outlineWeight,o.outlineColor),a.borders.left=new i.EdgeSettings,e.position.column.isFirst&&(a.borders.left.applyParams(t.outline.showLeft(r.outline),o.outlineWeight,o.outlineColor),t.outline.showLeft(r.outline)||!t.outline.showLeft(n.outline)&&!t.outline.showLeft(s.outline)||(a.paddings.left+=o.outlineWeight)),a.borders.right=new i.EdgeSettings,e.position.column.isLast?(a.borders.right.applyParams(t.outline.showRight(r.outline),o.outlineWeight,o.outlineColor),t.outline.showRight(r.outline)||!t.outline.showRight(n.outline)&&!t.outline.showRight(s.outline)||(a.paddings.right+=o.outlineWeight)):a.borders.right.applyParams(o.gridVertical,o.gridVerticalWeight,o.gridVerticalColor),a.fontColor=r.fontColor,a.backColor=r.backColor,a.paddings.top=a.paddings.bottom=o.rowPadding},r.prototype.unbindBodyCell=function(e,t){i.clearCellStyle(t),i.clearCellTextAndTooltip(t)},r.prototype.bindCornerCell=function(e,t){},r.prototype.unbindCornerCell=function(e,t){},r.prototype.bindEmptySpaceHeaderCell=function(e){},r.prototype.unbindEmptySpaceHeaderCell=function(e){},r.prototype.bindEmptySpaceFooterCell=function(e){},r.prototype.unbindEmptySpaceFooterCell=function(e){},r.prototype.getHeaderLabel=function(e){return e.displayName},r.prototype.getCellContent=function(e){return e},r.prototype.hasRowGroups=function(){return!1},r.prototype.sortIconsEnabled=function(){return 0===this.options.layoutKind},r}();t.TableBinder=o;var n=function(){function n(e){e&&(this.isConditionalFormattingEnabled=e.isConditionalFormattingEnabled,this.isTouchEnabled=e.isTouchEnabled)}return n.customizeQuery=function(e){var t=e.dataViewMappings[0];if(t&&t.table&&t.metadata){var i=t.table.rows,r=t.metadata.objects;i["for"]["in"].subtotalType=a.shouldShowTableTotals(r)?1:0}},n.getSortableRoles=function(){return["Values"]},n.prototype.init=function(e){this.element=e.element,this.style=e.style,this.updateViewport(e.viewport),this.formatter=t.valueFormatter.formatValueColumn,this.isInteractive=e.interactivity&&null!=e.interactivity.selection,this.getLocalizedString=e.host.getLocalizedString,this.hostServices=e.host,this.persistingObjects=!1,this.waitingForData=!1,this.lastAllowHeaderResize=!0,this.waitingForSort=!1},n.converter=function(t){var i=t.table,r=e.Prototype.inherit(i);r.visualRows=[];for(var o=0;o<i.rows.length;o++){var n={index:o,values:i.rows[o]};r.visualRows.push(n)}return r.formattingProperties=a.getTableObjects(t),r},n.prototype.onResizing=function(e){this.updateViewport(e)},n.prototype.getColumnWidthManager=function(){return this.columnWidthManager},n.prototype.onDataChanged=function(t){var i=t.dataViews;if(i&&i.length>0){var a=this.dataView;if(this.dataView=i[0],this.persistingObjects)return void(this.persistingObjects=!1);var r=n.converter(this.dataView),o=r.formattingProperties.general.textSize;if(t.operationKind===e.VisualDataChangeOperationKind.Append)this.hierarchyNavigator.update(r),this.tablixControl.updateModels(!1,r.visualRows,r.columns),this.refreshControl(!1);else{this.createOrUpdateHierarchyNavigator(r),this.createColumnWidthManager(),this.createTablixControl(o);var s=this.tablixControl.getBinder();s.onDataViewChanged(r),this.updateInternal(o,a,r)}}this.waitingForData=!1,this.waitingForSort=!1},n.prototype.createColumnWidthManager=function(){var e=this;this.columnWidthManager?this.columnWidthManager.updateDataView(this.dataView):this.columnWidthManager=new t.controls.TablixColumnWidthManager(this.dataView,!1,function(t){return e.persistColumnWidths(t)})},n.prototype.persistColumnWidths=function(e){this.persistingObjects=!0,this.hostServices.persistProperties(e)},n.prototype.updateViewport=function(e){this.currentViewport=e,this.tablixControl&&(this.tablixControl.viewport=this.currentViewport,this.verifyHeaderResize(),this.refreshControl(!1))},n.prototype.refreshControl=function(e){(t.visibilityHelper.partiallyVisible(this.element)||1===this.getLayoutKind())&&this.tablixControl.refresh(e)},n.prototype.getLayoutKind=function(){return this.isInteractive?0:1},n.prototype.createOrUpdateHierarchyNavigator=function(e){if(this.tablixControl)this.hierarchyNavigator.update(e);else{var t=new r(e,this.formatter);this.hierarchyNavigator=t}},n.prototype.createTablixControl=function(e){this.tablixControl||(this.tablixControl=this.createControl(this.hierarchyNavigator,e))},n.prototype.createControl=function(e,i){var r=this,n=this.getLayoutKind(),s={onBindRowHeader:function(e){return r.onBindRowHeader(e)},onColumnHeaderClick:function(e,t){return r.onColumnHeaderClick(e,t)},layoutKind:n},l=new o(s),c=1===n?t.controls.internal.DashboardTablixLayoutManager.createLayoutManager(l):t.controls.internal.CanvasTablixLayoutManager.createLayoutManager(l,this.columnWidthManager),u=document.createElement("div");this.element.append(u);var h={interactive:this.isInteractive,enableTouchSupport:this.isTouchEnabled,layoutKind:n,fontSize:a.getTextSizeInPx(i)};return new t.controls.TablixControl(e,c,l,u,h)},n.prototype.updateInternal=function(e,i,r){var o=this;1===this.getLayoutKind()&&this.tablixControl.layoutManager.adjustContentSize(t.converterHelper.hasImageUrlColumn(this.dataView)),this.tablixControl.fontSize=a.getTextSizeInPx(e),this.verifyHeaderResize(),this.tablixControl.updateModels(!0,r.visualRows,r.columns);var n=this.createTotalsRow(this.dataView);this.tablixControl.rowDimension.setFooter(n),this.tablixControl.viewport=this.currentViewport;var s=this.shouldClearControl(i,this.dataView);setTimeout(function(){o.refreshControl(s),o.columnWidthManager.shouldPersistAllColumnWidths()&&o.columnWidthManager.persistAllColumnWidths(o.tablixControl.layoutManager.columnWidthsToPersist)},0)},n.prototype.shouldClearControl=function(t,i){return this.waitingForSort&&t&&i?!e.DataViewAnalysis.isMetadataEquivalent(t.metadata,i.metadata):!0},n.prototype.createTotalsRow=function(e){if(!a.shouldShowTableTotals(e.metadata.objects))return null;var t=e.table.totals;if(!t||0===t.length)return null;for(var i=[],r=e.table.columns,o=0,n=r.length;n>o;++o){var s=r[o],l=t[s.index];null!=l?i.push(l):i.push(0===o?this.getLocalizedString("TableTotalLabel"):"")}return{totalCells:i}},n.prototype.onBindRowHeader=function(e){this.needsMoreData(e)&&(this.hostServices.loadMoreData(),this.waitingForData=!0)},n.prototype.onColumnHeaderClick=function(e,t){this.waitingForSort=!0,this.hostServices.onCustomSort(i.getCustomSortEventArgs(e,t))},n.prototype.needsMoreData=function(e){if(this.waitingForData||!this.dataView.metadata||!this.dataView.metadata.segment)return!1;var t=this.tablixControl.rowDimension.getItemsCount(),i=t*n.preferredLoadMoreThreshold;return this.hierarchyNavigator.getIndex(e)>=i},n.prototype.enumerateObjectInstances=function(e){var i=new t.ObjectEnumerationBuilder;return this.dataView&&a.enumerateObjectInstances(e,i,this.dataView,t.controls.TablixType.Table),i.complete()},n.prototype.enumerateObjectRepetition=function(){var e=[];return this.isConditionalFormattingEnabled&&this.dataView&&a.enumerateObjectRepetition(e,this.dataView,t.controls.TablixType.Table),e},n.prototype.shouldAllowHeaderResize=function(){return 1===this.hostServices.getViewMode()},n.prototype.onViewModeChanged=function(e){this.updateViewport(this.currentViewport)},n.prototype.verifyHeaderResize=function(){var e=this.shouldAllowHeaderResize();e!==this.lastAllowHeaderResize&&(this.lastAllowHeaderResize=e,this.tablixControl.layoutManager.setAllowHeaderResize(e))},n.preferredLoadMoreThreshold=.8,n}();t.Table=n}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){function i(e,t){return new s(e,t)}var a=t.controls.internal.TablixUtils,r=t.controls.internal.TablixObjects,o=jsCommon.UrlUtils,n=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),Object.defineProperty(t.prototype,"isMeasure",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isValidUrl",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isValidImage",{get:function(){return!1},enumerable:!0,configurable:!0}),t}(a.TablixVisualCell);t.MatrixVisualBodyItem=n,t.createMatrixHierarchyNavigator=i;var s=function(){function i(e,t){this.matrix=e,this.rowHierarchy=i.wrapMatrixHierarchy(e.rows),this.columnHierarchy=i.wrapMatrixHierarchy(e.columns),this.formatter=t,this.update()}return i.prototype.getDataViewMatrix=function(){return this.matrix},i.prototype.getColumnHierarchyDepth=function(){return Math.max(this.columnHierarchy.levels.length,1)},i.prototype.getRowHierarchyDepth=function(){return Math.max(this.rowHierarchy.levels.length,1)},i.prototype.getLeafCount=function(e){var t=this.getMatrixHierarchy(e);return t?t.leafNodes.length:0},i.prototype.getLeafAt=function(e,t){var i=this.getMatrixHierarchy(e);return i?i.leafNodes[t]:null},i.prototype.getLeafIndex=function(e){return e.leafIndex},i.prototype.getParent=function(e){return 0===e.level?null:e.parent},i.prototype.getIndex=function(e){return e.index},i.prototype.isLeaf=function(e){return!e.children||0===e.children.length},i.prototype.isRowHierarchyLeaf=function(e){return!0},i.prototype.isColumnHierarchyLeaf=function(e){return!1},i.prototype.isFirstItem=function(e,t){return e===_.first(t)},i.prototype.areAllParentsFirst=function(e,t){if(!e)return!1;var i=this.getParent(e);return i?this.isFirstItem(e,e.siblings)&&this.areAllParentsFirst(i,i.siblings):this.isFirstItem(e,e.siblings)},i.prototype.isLastItem=function(e,t){return e===_.last(t)},i.prototype.areAllParentsLast=function(e,t){if(!e)return!1;var i=this.getParent(e);return i?this.isLastItem(e,e.siblings)&&this.areAllParentsLast(i,i.siblings):this.isLastItem(e,e.siblings)},i.prototype.getChildren=function(e){return e.children},i.prototype.getChildrenLevelDifference=function(e){for(var t=1/0,i=this.getChildren(e),a=0,r=i.length;r>a;a++)t=Math.min(t,i[a].level-e.level);return t},i.prototype.getCount=function(e){return e.length},i.prototype.getAt=function(e,t){return e[t]},i.prototype.getLevel=function(e){return e.level},i.prototype.getIntersection=function(e,t){var i,a,r,o=e.isSubtotal===!0||t.isSubtotal===!0,s=e.leafIndex,l=t.leafIndex;return i=e.values?e.values[t.leafIndex]:void 0,i?(a=this.matrix.valueSources[i.valueSourceIndex||0],r=new n(i.value,o,a,this.formatter)):r=new n(void 0,o,void 0,this.formatter),r.position.row.index=s,r.position.row.indexInSiblings=e.siblings.indexOf(e),r.position.row.isFirst=0===s,r.position.row.isLast=s===this.rowHierarchy.leafNodes.length-1,r.position.column.index=l,r.position.column.indexInSiblings=t.siblings.indexOf(t),r.position.column.isFirst=0===l,r.position.column.isLast=l===this.columnHierarchy.leafNodes.length-1,r},i.prototype.getCorner=function(e,t){var i=this.columnHierarchy.levels,a=this.rowHierarchy.levels;if(t===i.length-1||0===i.length){var r=a[e];if(r)return{metadata:r.sources[0],isColumnHeaderLeaf:!0,isRowHeaderLeaf:e===a.length-1}}if(e===a.length-1){var r=i[t];if(r)return{metadata:r.sources[0],isColumnHeaderLeaf:!1,isRowHeaderLeaf:!0}}return{metadata:null,isColumnHeaderLeaf:!1,isRowHeaderLeaf:!1}},i.prototype.headerItemEquals=function(e,t){return e&&t?e===t:!1},i.prototype.bodyCellItemEquals=function(e,t){return e.position.isMatch(t.position)},i.prototype.cornerCellItemEquals=function(e,t){return e===t},i.prototype.getMatrixColumnHierarchy=function(){return this.columnHierarchy},i.prototype.getMatrixRowHierarchy=function(){return this.rowHierarchy},i.prototype.update=function(e,t){void 0===t&&(t=!0),e&&(this.matrix=e,this.rowHierarchy=i.wrapMatrixHierarchy(e.rows),t&&(this.columnHierarchy=i.wrapMatrixHierarchy(e.columns))),this.updateHierarchy(this.rowHierarchy),t&&(this.updateHierarchy(this.columnHierarchy),i.updateStaticColumnHeaders(this.columnHierarchy))},i.wrapMatrixHierarchy=function(t){var i=e.Prototype.inherit(t);return i.leafNodes=[],i},i.prototype.updateHierarchy=function(e){e.leafNodes.length>0&&(e.leafNodes.length=0),e.root.children&&this.updateRecursive(e,e.root.children,null,e.leafNodes)},i.prototype.updateRecursive=function(e,i,a,o){for(var n,s=0,l=i.length;l>s;s++){var c=i[s];if(c.siblings=i,a&&(c.parent=a),n||(n=e.levels[c.level]),n){var u=n.sources[c.levelSourceIndex?c.levelSourceIndex:0],h=t.valueFormatter.getFormatString(u,r.PropColumnFormatString.getPropertyID());h&&(c.name=this.formatter(c.value,u,r.PropColumnFormatString.getPropertyID())),c.queryName=u.queryName}c.index=s,c.children&&c.children.length>0?this.updateRecursive(e,c.children,c,o):(c.leafIndex=o.length,o.push(c))}},i.updateStaticColumnHeaders=function(e){var t=e.leafNodes;if(t&&t.length>0)for(var i=e.levels[t[0].level].sources,a=0,r=t.length;r>a;a++){var o=t[a];if(!o.identity&&void 0===o.value){var n=i[o.levelSourceIndex?o.levelSourceIndex:0];n&&(o.name=n.displayName)}}},i.prototype.getMatrixHierarchy=function(e){var t=this.rowHierarchy.root.children;if(t&&e===t)return this.rowHierarchy;var i=this.columnHierarchy.root.children;return i&&e===i?this.columnHierarchy:null},i}(),l=function(){function i(e,t){this.hierarchyNavigator=e,this.options=t}return i.prototype.onDataViewChanged=function(e){this.formattingProperties=e,this.updateTextHeights()},i.prototype.updateTextHeights=function(){var t={fontFamily:"",fontSize:r.getTextSizeInPx(this.formattingProperties.general.textSize),text:"a"};t.fontFamily=a.FontFamilyHeader,this.textHeightHeader=Math.ceil(e.TextMeasurementService.measureSvgTextHeight(t)),t.fontFamily=a.FontFamilyCell,this.textHeightValue=Math.ceil(e.TextMeasurementService.measureSvgTextHeight(t)),t.fontFamily=a.FontFamilyTotal,this.textHeightTotal=Math.ceil(e.TextMeasurementService.measureSvgTextHeight(t))},i.prototype.onStartRenderingSession=function(){},i.prototype.onEndRenderingSession=function(){},i.prototype.bindRowHeader=function(e,t){a.resetCellCssClass(t);var i=new a.CellStyle,o=this.hierarchyNavigator&&this.hierarchyNavigator.isLeaf(e);o&&(a.addCellCssClass(t,a.CssClassMatrixRowHeaderLeaf),i.borders.right=new a.EdgeSettings(r.PropGridOutlineWeight.defaultValue,r.PropGridOutlineColor.defaultValue)),e.isSubtotal&&(i.paddings.left=a.CellPaddingLeftMatrixTotal),this.bindHeader(e,t,this.getRowHeaderMetadata(e),i),this.options.onBindRowHeader&&this.options.onBindRowHeader(e),this.setRowHeaderStyle(t,i),t.applyStyle(i)},i.prototype.setRowHeaderStyle=function(e,i){var r=this.formattingProperties.grid,o=this.formattingProperties.rowHeaders,n=this.formattingProperties.values,s=this.formattingProperties.columnHeaders;i.borders.top=new a.EdgeSettings,e.position.row.isFirst&&(i.borders.top.applyParams(t.outline.showTop(o.outline),r.outlineWeight,r.outlineColor),!t.outline.showTop(o.outline)&&t.outline.showTop(n.outline)&&(i.paddings.top+=r.outlineWeight)),i.borders.bottom=new a.EdgeSettings,e.position.row.isLast?(i.borders.bottom.applyParams(t.outline.showBottom(o.outline),r.outlineWeight,r.outlineColor),!t.outline.showBottom(o.outline)&&t.outline.showBottom(n.outline)&&(i.paddings.bottom+=r.outlineWeight)):i.borders.bottom.applyParams(r.gridHorizontal,r.gridHorizontalWeight,r.gridHorizontalColor),i.borders.left=new a.EdgeSettings,e.position.column.isFirst&&(i.borders.left.applyParams(t.outline.showLeft(o.outline),r.outlineWeight,r.outlineColor),!t.outline.showLeft(o.outline)&&t.outline.showLeft(s.outline)&&(i.paddings.left+=r.outlineWeight)),i.borders.right=new a.EdgeSettings,e.position.column.isLast?i.borders.right.applyParams(t.outline.showRight(o.outline),r.outlineWeight,r.outlineColor):i.borders.right.applyParams(r.gridVertical,r.gridVerticalWeight,r.gridVerticalColor),i.fontColor=o.fontColor,i.backColor=o.backColor,i.paddings.top=i.paddings.bottom=r.rowPadding},i.prototype.unbindRowHeader=function(e,t){a.clearCellStyle(t),a.clearCellTextAndTooltip(t)},i.prototype.bindColumnHeader=function(e,t){a.resetCellCssClass(t);var i=new a.CellStyle,o=!1,n=this.hierarchyNavigator&&this.hierarchyNavigator.isLeaf(e);if(n){i.borders.bottom=new a.EdgeSettings(r.PropGridOutlineWeight.defaultValue,r.PropGridOutlineColor.defaultValue),a.addCellCssClass(t,a.CssClassTablixColumnHeaderLeaf),a.addCellCssClass(t,a.CssClassTablixValueNumeric);var s=this.getSortableHeaderColumnMetadata(e);s&&this.options.showSortIcons&&(this.registerColumnHeaderClickHandler(s,t),a.createColumnHeaderWithSortIcon(s,t)),e.isSubtotal&&e.parent&&e.parent.children.length>1&&e.parent.children[0].isSubtotal&&(o=!0)}t.extension.disableDragResize(),this.bindHeader(e,t,this.getColumnHeaderMetadata(e),i,o),this.setColumnHeaderStyle(t,i),t.applyStyle(i);
28},i.prototype.setColumnHeaderStyle=function(e,i){var r=this.formattingProperties.grid,o=this.formattingProperties.columnHeaders,n=this.formattingProperties.values;i.fontColor=o.fontColor,i.backColor=o.backColor,i.paddings.top=i.paddings.bottom=r.rowPadding,i.borders.top=new a.EdgeSettings,e.position.row.isFirst&&i.borders.top.applyParams(t.outline.showTop(o.outline),r.outlineWeight,r.outlineColor),i.borders.bottom=new a.EdgeSettings,e.position.row.isLast?i.borders.bottom.applyParams(t.outline.showBottom(o.outline),r.outlineWeight,r.outlineColor):i.borders.bottom.applyParams(r.gridHorizontal,r.gridHorizontalWeight,r.gridHorizontalColor),i.borders.left=new a.EdgeSettings,e.position.column.isFirst&&!t.outline.showLeft(o.outline)&&t.outline.showLeft(n.outline)&&(i.paddings.left+=r.outlineWeight),i.borders.right=new a.EdgeSettings,e.position.column.isLast?(i.borders.right.applyParams(t.outline.showRight(o.outline),r.outlineWeight,r.outlineColor),!t.outline.showRight(o.outline)&&t.outline.showRight(n.outline)&&(i.paddings.right+=r.outlineWeight)):i.borders.right.applyParams(r.gridVertical,r.gridVerticalWeight,r.gridVerticalColor)},i.prototype.unbindColumnHeader=function(e,t){a.clearCellStyle(t),a.clearCellTextAndTooltip(t);var i=this.getSortableHeaderColumnMetadata(e);i&&this.unregisterColumnHeaderClickHandler(t),this.options.showSortIcons&&a.removeSortIcons(t)},i.prototype.bindHeader=function(e,r,n,s,l){a.addCellCssClass(r,a.CssClassTablixHeader),s.fontFamily=a.FontFamilyHeader,s.fontColor=a.FontColorHeaders;var c=this.formattingProperties.grid.imageHeight;if(t.converterHelper.isImageUrlColumn(n)?r.contentHeight=c:e.isSubtotal?r.contentHeight=this.textHeightTotal:r.contentHeight=this.textHeightValue,e.isSubtotal&&(a.addCellCssClass(r,a.CssClassTablixValueTotal),s.fontFamily=a.FontFamilyTotal,!l))return void a.setCellTextAndTooltip(r,this.options.totalLabel);var u=i.getNodeLabel(e);u?t.converterHelper.isWebUrlColumn(n)&&o.isValidUrl(u)?a.appendATagToBodyCell(e.value,r):t.converterHelper.isImageUrlColumn(n)?(s.hasImage=!0,o.isValidImageUrl(u)?a.appendImgTagToBodyCell(e.value,r,c):a.setCellTextAndTooltip(r,u)):a.setCellTextAndTooltip(r,u):r.extension.contentHost.innerHTML=a.StringNonBreakingSpace},i.prototype.registerColumnHeaderClickHandler=function(e,t){var i=this;if(this.options.onColumnHeaderClick){var r=function(t){if(a.isValidSortClick(t)){var r=a.reverseSort(e.sort);i.options.onColumnHeaderClick(e.queryName?e.queryName:e.displayName,r)}};t.extension.registerClickHandler(r)}},i.prototype.unregisterColumnHeaderClickHandler=function(e){this.options.onColumnHeaderClick&&e.extension.unregisterClickHandler()},i.prototype.bindBodyCell=function(e,t){a.resetCellCssClass(t);var i=new a.CellStyle;t.contentHeight=this.textHeightValue,e.domContent?$(t.extension.contentHost).append(e.domContent):(a.addCellCssClass(t,a.CssClassTablixValueNumeric),e.isTotal&&(a.addCellCssClass(t,a.CssClassTablixValueTotal),i.fontFamily=a.FontFamilyTotal,t.contentHeight=this.textHeightTotal),e.textContent&&a.setCellTextAndTooltip(t,e.textContent)),this.setBodyCellStyle(t,e,i),t.applyStyle(i)},i.prototype.setBodyCellStyle=function(e,i,r){var o=this.formattingProperties.grid,n=this.formattingProperties.values,s=this.formattingProperties.subtotals,l=this.formattingProperties.rowHeaders,c=this.formattingProperties.columnHeaders;r.paddings.top=r.paddings.bottom=o.rowPadding,r.borders.top=new a.EdgeSettings,e.position.row.isFirst&&(r.borders.top.applyParams(t.outline.showTop(n.outline),o.outlineWeight,o.outlineColor),!t.outline.showTop(n.outline)&&t.outline.showTop(l.outline)&&(r.paddings.top+=o.outlineWeight)),r.borders.bottom=new a.EdgeSettings,e.position.row.isLast?(r.borders.bottom.applyParams(t.outline.showBottom(n.outline),o.outlineWeight,o.outlineColor),!t.outline.showBottom(n.outline)&&t.outline.showBottom(l.outline)&&(r.paddings.bottom+=o.outlineWeight)):r.borders.bottom.applyParams(o.gridHorizontal,o.gridHorizontalWeight,o.gridHorizontalColor),r.borders.left=new a.EdgeSettings,e.position.column.isFirst&&r.borders.left.applyParams(t.outline.showLeft(n.outline),o.outlineWeight,o.outlineColor),r.borders.right=new a.EdgeSettings,e.position.column.isLast?(r.borders.right.applyParams(t.outline.showRight(n.outline),o.outlineWeight,o.outlineColor),!t.outline.showRight(n.outline)&&t.outline.showRight(c.outline)&&(r.paddings.right+=o.outlineWeight)):r.borders.right.applyParams(o.gridVertical,o.gridVerticalWeight,o.gridVerticalColor);var u;u=this.formattingProperties.general.rowSubtotals&&s.backColor?i.position.row.indexInSiblings:i.position.row.index,i.isTotal&&s.fontColor?r.fontColor=s.fontColor:r.fontColor=u%2===0?n.fontColorPrimary:n.fontColorSecondary,i.isTotal&&s.backColor?r.backColor=s.backColor:r.backColor=u%2===0?n.backColorPrimary:n.backColorSecondary},i.prototype.unbindBodyCell=function(e,t){a.clearCellStyle(t),a.clearCellTextAndTooltip(t)},i.prototype.bindCornerCell=function(e,t){a.resetCellCssClass(t);var i=new a.CellStyle;if(i.fontFamily=a.FontFamilyHeader,i.fontColor=a.FontColorHeaders,t.contentHeight=this.textHeightHeader,e.isColumnHeaderLeaf){a.addCellCssClass(t,a.CssClassTablixColumnHeaderLeaf),i.borders.bottom=new a.EdgeSettings(r.PropGridOutlineWeight.defaultValue,r.PropGridOutlineColor.defaultValue);var o=this.getSortableCornerColumnMetadata(e);o&&this.registerColumnHeaderClickHandler(o,t),this.options.showSortIcons?a.createColumnHeaderWithSortIcon(o,t):a.setCellTextAndTooltip(t,o.displayName)}else{var n=e.metadata?e.metadata.displayName:"";a.setCellTextAndTooltip(t,n)}e.isRowHeaderLeaf&&a.addCellCssClass(t,a.CssClassMatrixRowHeaderLeaf),a.addCellCssClass(t,a.CssClassTablixHeader),this.setCornerCellsStyle(t,i),t.applyStyle(i),t.extension.disableDragResize()},i.prototype.setCornerCellsStyle=function(e,i){var r=this.formattingProperties.grid,o=this.formattingProperties.columnHeaders,n=this.formattingProperties.rowHeaders;i.fontColor=o.fontColor||n.fontColor,i.backColor=o.backColor||n.backColor,i.paddings.top=i.paddings.bottom=r.rowPadding,i.borders.top=new a.EdgeSettings,e.position.row.isFirst&&i.borders.top.applyParams(t.outline.showTop(o.outline),r.outlineWeight,r.outlineColor),i.borders.bottom=new a.EdgeSettings,e.position.row.isLast?i.borders.bottom.applyParams(t.outline.showBottom(o.outline),r.outlineWeight,r.outlineColor):i.borders.bottom.applyParams(r.gridHorizontal,r.gridHorizontalWeight,r.gridHorizontalColor),i.borders.left=new a.EdgeSettings,e.position.column.isFirst&&(i.borders.left.applyParams(t.outline.showLeft(o.outline),r.outlineWeight,r.outlineColor),!t.outline.showLeft(o.outline)&&t.outline.showLeft(n.outline)&&(i.paddings.left+=r.outlineWeight)),i.borders.right=new a.EdgeSettings,i.borders.right.applyParams(r.gridVertical,r.gridVerticalWeight,r.gridVerticalColor)},i.prototype.unbindCornerCell=function(e,t){a.clearCellStyle(t),a.clearCellTextAndTooltip(t),this.options.showSortIcons&&a.removeSortIcons(t),e.isColumnHeaderLeaf&&this.unregisterColumnHeaderClickHandler(t)},i.prototype.bindEmptySpaceHeaderCell=function(e){},i.prototype.unbindEmptySpaceHeaderCell=function(e){},i.prototype.bindEmptySpaceFooterCell=function(e){},i.prototype.unbindEmptySpaceFooterCell=function(e){},i.prototype.getHeaderLabel=function(e){return i.getNodeLabel(e)},i.prototype.getCellContent=function(e){return e.textContent||""},i.prototype.hasRowGroups=function(){var e=this.hierarchyNavigator.getDataViewMatrix();return!!(e&&e.rows&&e.rows.levels&&0!==e.rows.levels.length)},i.getNodeLabel=function(e){return e.name?e.name:null!=e.value?e.value.toString():""},i.prototype.getSortableCornerColumnMetadata=function(e){return e.isColumnHeaderLeaf?e.metadata:void 0},i.prototype.getRowHeaderMetadata=function(e){if(this.hierarchyNavigator&&e){var t=this.hierarchyNavigator.getDataViewMatrix();if(t&&t.rows)return this.getHierarchyMetadata(t.rows,e.level)}},i.prototype.getColumnHeaderMetadata=function(e){if(this.hierarchyNavigator&&e){var t=this.hierarchyNavigator.getDataViewMatrix();if(t&&t.columns)return this.getHierarchyMetadata(t.columns,e.level)}},i.prototype.getHierarchyMetadata=function(e,t){if(e&&e.levels&&!(e.levels.length<t)){var i=e.levels[t];if(i&&i.sources&&0!==i.sources.length)return i.sources[0]}},i.prototype.getSortableHeaderColumnMetadata=function(e){var t=this.hierarchyNavigator.getDataViewMatrix();if(!t.rows||!t.rows.levels||0===t.rows.levels.length)return null;var i=t.valueSources&&t.valueSources.length>1,a=t.columns?t.columns.levels.length:0;i?a--:1===a&&t.columns.levels[0]&&t.columns.levels[0].sources&&t.columns.levels[0].sources[0]&&t.columns.levels[0].sources[0].roles&&t.columns.levels[0].sources[0].roles.Values&&(a=0);var r=-1;return 0===a?r=e.levelSourceIndex:e.isSubtotal&&(i?e.parent&&0===e.parent.level&&(r=e.levelSourceIndex):0===e.level&&(r=e.levelSourceIndex)),-1!==r?(r=r?r:0,t.valueSources[r]):null},i}();t.MatrixBinder=l;var c=function(){function o(e){e&&(this.isTouchEnabled=e.isTouchEnabled)}return o.customizeQuery=function(e){var t=e.dataViewMappings[0];if(t&&t.matrix&&t.metadata){var i=t.matrix;_.isEmpty(i.columns["for"]["in"].items)||(i.rows.dataReductionAlgorithm.window.count=100);var a=t.metadata.objects;i.rows["for"]["in"].subtotalType=r.shouldShowRowSubtotals(a)?2:0,i.columns["for"]["in"].subtotalType=r.shouldShowColumnSubtotals(a)?2:0}},o.getSortableRoles=function(){return["Rows","Values"]},o.prototype.init=function(e){this.element=e.element,this.style=e.style,this.updateViewport(e.viewport),this.formatter=t.valueFormatter.formatValueColumn,this.isInteractive=e.interactivity&&null!=e.interactivity.selection,this.hostServices=e.host,this.persistingObjects=!1,this.waitingForData=!1,this.lastAllowHeaderResize=!0,this.waitingForSort=!1},o.converter=function(e){return r.getMatrixObjects(e)},o.prototype.onResizing=function(e){this.updateViewport(e)},o.prototype.getColumnWidthManager=function(){return this.columnWidthManager},o.prototype.onDataChanged=function(t){var i=t.dataViews;if(i&&i.length>0){var a=this.dataView;this.dataView=i[0];var r=o.converter(this.dataView),n=r.general.textSize;if(t.operationKind===e.VisualDataChangeOperationKind.Append){var s=a.matrix.rows.root!==this.dataView.matrix.rows.root;this.hierarchyNavigator.update(this.dataView.matrix,s),s&&this.tablixControl.updateModels(!1,this.dataView.matrix.rows.root.children,this.dataView.matrix.columns.root.children),this.refreshControl(!1)}else{this.createOrUpdateHierarchyNavigator(),this.createColumnWidthManager(),this.createTablixControl(n);var l=this.tablixControl.getBinder();l.onDataViewChanged(r),this.updateInternal(n,a)}}this.waitingForData=!1,this.waitingForSort=!1},o.prototype.createColumnWidthManager=function(){var e=this,i=this.hierarchyNavigator.getMatrixColumnHierarchy();this.columnWidthManager?this.persistingObjects||this.columnWidthManager.updateDataView(this.dataView,i.leafNodes):this.columnWidthManager=new t.controls.TablixColumnWidthManager(this.dataView,!0,function(t){return e.persistColumnWidths(t)},i.leafNodes)},o.prototype.persistColumnWidths=function(e){this.persistingObjects=!0,this.hostServices.persistProperties(e)},o.prototype.updateViewport=function(e){this.currentViewport=e,this.tablixControl&&(this.tablixControl.viewport=this.currentViewport,this.verifyHeaderResize(),this.refreshControl(!1))},o.prototype.refreshControl=function(e){(t.visibilityHelper.partiallyVisible(this.element)||1===this.getLayoutKind())&&this.tablixControl.refresh(e)},o.prototype.getLayoutKind=function(){return this.isInteractive?0:1},o.prototype.createOrUpdateHierarchyNavigator=function(){if(this.tablixControl)this.hierarchyNavigator.update(this.dataView.matrix);else{var e=i(this.dataView.matrix,this.formatter);this.hierarchyNavigator=e}},o.prototype.createTablixControl=function(e){this.tablixControl||(this.tablixControl=this.createControl(this.hierarchyNavigator,e))},o.prototype.createControl=function(e,i){var a=this,n=this.getLayoutKind(),s={onBindRowHeader:function(e){a.onBindRowHeader(e)},totalLabel:this.hostServices.getLocalizedString(o.TotalLabel),onColumnHeaderClick:function(e,t){return a.onColumnHeaderClick(e,t)},showSortIcons:0===n},c=new l(this.hierarchyNavigator,s),u=1===n?t.controls.internal.DashboardTablixLayoutManager.createLayoutManager(c):t.controls.internal.CanvasTablixLayoutManager.createLayoutManager(c,this.columnWidthManager),h=document.createElement("div");this.element.append(h);var d={interactive:this.isInteractive,enableTouchSupport:this.isTouchEnabled,layoutKind:n,fontSize:r.getTextSizeInPx(i)};return new t.controls.TablixControl(e,u,c,h,d)},o.prototype.updateInternal=function(e,i){var a=this;1===this.getLayoutKind()&&this.tablixControl.layoutManager.adjustContentSize(t.converterHelper.hasImageUrlColumn(this.dataView)),this.tablixControl.fontSize=r.getTextSizeInPx(e),this.verifyHeaderResize(),this.tablixControl.updateModels(!this.persistingObjects,this.dataView.matrix.rows.root.children,this.dataView.matrix.columns.root.children),this.tablixControl.viewport=this.currentViewport;var o=this.shouldClearControl(i,this.dataView);setTimeout(function(){return a.refreshControl(o),a.persistingObjects?void(a.persistingObjects=!1):void(a.columnWidthManager.shouldPersistAllColumnWidths()&&a.columnWidthManager.persistAllColumnWidths(a.tablixControl.layoutManager.columnWidthsToPersist))},0)},o.prototype.shouldClearControl=function(t,i){return this.waitingForSort&&t&&i?!e.DataViewAnalysis.isMetadataEquivalent(t.metadata,i.metadata):!0},o.prototype.onBindRowHeader=function(e){this.needsMoreData(e)&&(this.hostServices.loadMoreData(),this.waitingForData=!0)},o.prototype.onColumnHeaderClick=function(e,t){this.waitingForSort=!0,this.hostServices.onCustomSort(a.getCustomSortEventArgs(e,t))},o.prototype.needsMoreData=function(e){if(this.waitingForData||!this.hierarchyNavigator.isLeaf(e)||!this.dataView.metadata||!this.dataView.metadata.segment)return!1;var t=this.tablixControl.rowDimension.getItemsCount(),i=t*o.preferredLoadMoreThreshold;return this.hierarchyNavigator.getLeafIndex(e)>=i},o.prototype.enumerateObjectInstances=function(e){var i=new t.ObjectEnumerationBuilder;return this.dataView&&r.enumerateObjectInstances(e,i,this.dataView,t.controls.TablixType.Matrix),i.complete()},o.prototype.shouldAllowHeaderResize=function(){return 1===this.hostServices.getViewMode()},o.prototype.onViewModeChanged=function(e){this.updateViewport(this.currentViewport)},o.prototype.verifyHeaderResize=function(){var e=this.shouldAllowHeaderResize();e!==this.lastAllowHeaderResize&&(this.lastAllowHeaderResize=e,this.tablixControl.layoutManager.setAllowHeaderResize(e))},o.preferredLoadMoreThreshold=.8,o.TotalLabel="TableTotalLabel",o}();t.Matrix=c}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.CssConstants,a=function(){function a(e){this.tooltipsEnabled=e&&e.tooltipsEnabled,e&&e.animator&&(this.animator=e.animator,this.isScrollable=e.isScrollable?e.isScrollable:!1,this.behavior=e.behavior)}return a.getLayout=function(e,i){var r=t.dataLabelUtils.createColumnFormatterCacheManager(),o=e.showCategory,n=e.show||e.showCategory;return{shapeClass:function(e){return a.getNodeClass(e,!1)},shapeLayout:a.createTreemapShapeLayout(!1),highlightShapeClass:function(e){return a.getNodeClass(e,!0)},highlightShapeLayout:a.createTreemapShapeLayout(!0),zeroShapeLayout:a.createTreemapZeroShapeLayout(),majorLabelClass:function(e){return a.MajorLabelClassName},majorLabelLayout:{x:function(e){return e.x+a.TextMargin},y:function(e){return e.y+a.TextMargin+a.MajorLabelTextSize}},majorLabelText:function(t){return a.createMajorLabelText(t,e,i,r)},minorLabelClass:function(e){return a.MinorLabelClassName},minorLabelLayout:{x:function(e){return e.x+a.TextMargin},y:function(e){return e.y+e.dy-a.TextMargin}},minorLabelText:function(t){return a.createMinorLabelText(t,e,i,r)},areMajorLabelsEnabled:function(){return o},areMinorLabelsEnabled:function(){return n}}},a.prototype.init=function(e){this.options=e;var i=e.element;i.empty(),this.svg=d3.select(i.get(0)).append("svg").style("position","absolute").classed(a.ClassName,!0),this.shapeGraphicsContext=this.svg.append("g").classed(a.ShapesClassName,!0),this.labelGraphicsContext=this.svg.append("g").classed(a.LabelsGroupClassName,!0),this.element=i,this.currentViewport={height:e.viewport.height,width:e.viewport.width},this.style=e.style,this.treemap=d3.layout.treemap().sticky(!1).sort(function(e,t){return e.size-t.size}).value(function(e){return e.size}).round(!1),this.behavior&&(this.interactivityService=t.createInteractivityService(e.host)),this.legend=t.createLegend(i,e.interactivity&&e.interactivity.isInteractiveLegend,this.interactivityService,this.isScrollable),this.colors=this.style.colorPalette.dataColors,this.hostService=e.host},a.converter=function(i,r,o,n,s,l,c){void 0===c&&(c=!0);var u,h=e.data.createIDataViewCategoricalReader(i),d={key:"root",name:"root",children:[],selected:!1,highlightMultiplier:0,identity:t.SelectionId.createNull(),color:void 0},p=[],g=[],m="",f=new t.ColorHelper(r,t.treemapProps.dataPoint.fill),y=void 0;if(i&&i.metadata&&i.metadata.objects){var v=i.metadata.objects;o.show=e.DataViewObjects.getValue(v,t.treemapProps.labels.show,o.show),o.labelColor=e.DataViewObjects.getFillColor(v,t.treemapProps.labels.color,o.labelColor),o.displayUnits=e.DataViewObjects.getValue(v,t.treemapProps.labels.labelDisplayUnits,o.displayUnits),o.precision=e.DataViewObjects.getValue(v,t.treemapProps.labels.labelPrecision,o.precision),o.showCategory=e.DataViewObjects.getValue(v,t.treemapProps.categoryLabels.show,o.showCategory)}if(i&&i.categorical&&i.categorical.values){var b=i.categorical,C=b.values;u=!!(C.length>0&&C[0].highlights);var S=t.treemapProps.general.formatString,x=a.getValuesFromCategoricalDataView(b,u),w=x.values,P=x.highlights,D=x.totalValue;x.highlightsOverflow&&(u=!1,w=P);var L=a.getCullableValue(D,s),T=C.grouped(),V=T&&T.length>0&&T[0].values&&T[0].values.length>1,M=!!C.source;y=!1;var N=void 0,A=t.GradientUtils.getGradientValueColumn(b);if(null!=b.categories||_.isEmpty(w)){if(b.categories&&b.categories.length>0){var O=_.filter(C,function(e){return e.source&&e.source.roles&&e.source.roles[a.ValuesRoleName]===!0}).length,I=1===O&&null==C[0].source.groupName,R=b.categories[0];m=R.source.displayName;for(var F=t.valueFormatter.getFormatString(R.source,S),H=0,z=w.length;z>H;H++){var v=R.objects&&R.objects[H],G=f.getColorForSeriesValue(v,R.identityFields,R.values[H]),j=t.valueFormatter.format(R.values[H],F),k=w[H],E=e.data.DataRoleHelper.getMeasureIndexOfRole(T,a.ValuesRoleName),W=k[E],B=u&&P?P[H][E]:void 0,U=void 0,K=void 0;if(c){U=[],K={displayName:R.source.displayName,value:j},U.push(K);var X=void 0;null!=W&&(X=C[E].source,U.push({displayName:X.displayName,value:t.converterHelper.formatFromMetadataColumn(W,X,S)})),null!=B&&U.push({displayName:t.ToolTipComponent.localizationOptions.highlightedValueDisplayName,value:t.converterHelper.formatFromMetadataColumn(B,X,S)});var Y=A?A.source:void 0;I&&Y&&Y!==X&&null!=A.values[H]&&U.push({displayName:Y.displayName,value:t.converterHelper.formatFromMetadataColumn(A.values[H],Y,S)})}var q=t.SelectionIdBuilder.builder().withCategory(R,H).withMeasure(I?C[E].source.queryName:void 0).createSelectionId(),$=JSON.stringify({nodeKey:q.getKey(),depth:1}),Q={key:$,name:j,color:G,selected:!1,identity:q,tooltipInfo:U,highlightedTooltipInfo:U,labelFormatString:1===O?t.valueFormatter.getFormatString(C[E].source,S):F};u&&(Q.highlightMultiplier=0!==W?B/W:0,Q.highlightValue=B),g.push({label:j,color:G,icon:t.LegendIcon.Box,identity:q,selected:!1});for(var Z=0,J=0,ee=0,te=k.length;te>ee;ee++){var ie=C[ee];if(e.data.DataRoleHelper.hasRoleInValueColumn(ie,a.ValuesRoleName)){var ae=k[ee],re=void 0;if(N=L>ae,a.checkValueForShape(ae)&&!N){if(Z+=ae,u&&(re=P[H][ee],J+=re),!I){var oe=null;oe=V?ie.source.displayName:ie.source.groupName;var ne=b?b.values:null,se=ie.source.queryName,le=t.SelectionIdBuilder.builder().withCategory(R,H).withSeries(ne,ie).withMeasure(se).createSelectionId(),ce=JSON.stringify({nodeKey:le.getKey(),depth:2}),ue=u&&0!==re?re:void 0,he=void 0;c&&(he=[],he.push(K),M&&(R&&R.source===ne.source||he.push({displayName:ne.source.displayName,value:t.converterHelper.formatFromMetadataColumn(T[ee].name,ne.source,S)})),null!=ae&&he.push({displayName:ie.source.displayName,value:t.converterHelper.formatFromMetadataColumn(ae,ie.source,S)}),null!=B&&he.push({displayName:t.ToolTipComponent.localizationOptions.highlightedValueDisplayName,value:t.converterHelper.formatFromMetadataColumn(ue,ie.source,S)}));var de={key:ce,name:oe,size:ae,color:G,selected:!1,identity:le,tooltipInfo:he,highlightedTooltipInfo:he,labelFormatString:t.valueFormatter.getFormatString(ie.source,S)};u&&(de.highlightMultiplier=0!==ae?re/ae:0,de.highlightValue=re),null==Q.children&&(Q.children=[]),Q.children.push(de),p.push(de)}}else y=y||N}}a.checkValueForShape(Z)&&(Q.size=Z,d.children.push(Q),p.push(Q)),u&&(Q.highlightMultiplier=Z?J/Z:0)}}}else for(var pe=0,ge=w[0].length;ge>pe;pe++){var ie=C[pe];if(e.data.DataRoleHelper.hasRoleInValueColumn(ie,a.ValuesRoleName)){var W=w[0][pe];if(a.checkValueForShape(W))if(L>W)y=y||N;else{var me=M?h.getSeriesValueColumnGroup(pe).name:t.converterHelper.formatFromMetadataColumn(h.getValueDisplayName("Values",pe),ie.source,S),q=(new t.SelectionIdBuilder).withSeries(C,M?C[pe]:void 0).withMeasure(C[pe].source.queryName).createSelectionId(),$=q.getKey(),G=M?f.getColorForSeriesValue(T[pe]&&T[pe].objects,b.values.identityFields,t.converterHelper.getSeriesName(ie.source)):f.getColorForMeasure(ie.source.objects,ie.source.queryName),ue=u?P[0][pe]:void 0,U=void 0;if(c){if(U=[],M){var fe=h.getSeriesMetadataColumn(),ye=h.getSeriesValueColumnGroup(pe).name;U.push({displayName:fe.displayName,value:t.converterHelper.formatFromMetadataColumn(ye,fe,S)})}null!=W&&U.push({displayName:ie.source.displayName,value:t.converterHelper.formatFromMetadataColumn(W,ie.source,S)}),null!=ue&&U.push({displayName:t.ToolTipComponent.localizationOptions.highlightedValueDisplayName,value:t.converterHelper.formatFromMetadataColumn(ue,ie.source,S)})}var Q={key:$,name:me,size:W,color:G,selected:!1,identity:q,tooltipInfo:U,highlightedTooltipInfo:U,labelFormatString:t.valueFormatter.getFormatString(ie.source,S)};u&&P&&(Q.highlightMultiplier=0!==W?P[0][pe]/W:0,Q.highlightValue=P[0][pe]),d.children.push(Q),p.push(Q),g.push({label:me,color:G,icon:t.LegendIcon.Box,identity:q,selected:!1})}}}}return n&&(n.applySelectionStateToData(p),n.applySelectionStateToData(g)),{root:d,hasHighlights:u,legendData:{title:m,dataPoints:g,fontSize:t.SVGLegend.DefaultFontSizeInPt},dataLabelsSettings:o,legendObjectProperties:l,dataWasCulled:y}},a.getValuesFromCategoricalDataView=function(e,t){var i,a=e.values;a&&null==e.categories?i=1:a&&e.categories&&e.categories.length>0&&(i=e.categories[0].values.length);for(var r=[],o=[],n=0,s=0;i>s;s++)r.push([]),t&&o.push([]);for(var l,c=0;c<a.length;c++)for(var u=a[c],s=0;i>s;s++){var h=u.values[s];if(r[s].push(h),n+=isNaN(h)?0:h,t){var d=u.highlights[s];d||(d=0),o[s].push(d),d>h&&(l=!0)}}return{values:r,highlights:t?o:void 0,highlightsOverflow:t?l:void 0,totalValue:n}},a.getCullableValue=function(e,t){var i=t.width*t.height,r=a.CullableArea/i;return r*e},a.prototype.update=function(e){var i=this.dataViews=e.dataViews;this.currentViewport=e.viewport;var r=i&&i.length>0&&i[0].categorical?i[0].categorical:void 0,o=t.dataLabelUtils.getDefaultTreemapLabelSettings(),n=null;if(r){var s=i[0],l=s.metadata,c=void 0;l&&(c=l.objects),c&&(n=c.legend),this.data=a.converter(s,this.colors,o,this.interactivityService,this.currentViewport,n,this.tooltipsEnabled)}else{var u={key:"root",name:"root",children:[],selected:!1,highlightMultiplier:0,identity:t.SelectionId.createNull(),color:void 0},h={title:"",dataPoints:[]},d={root:u,hasHighlights:!1,legendData:h,dataLabelsSettings:o,dataWasCulled:!1};this.data=d}if(this.updateInternal(e.suppressAnimations),i){var p=t.getInvalidValueWarnings(i,!1,!1,!1);this.hostService.setWarnings(p)}},a.prototype.onDataChanged=function(e){this.update({suppressAnimations:e.suppressAnimations,dataViews:e.dataViews,viewport:this.currentViewport})},a.prototype.onResizing=function(e){this.update({suppressAnimations:!0,dataViews:this.dataViews,viewport:e})},a.prototype.onClearSelection=function(){this.interactivityService&&this.interactivityService.clearSelection()},a.prototype.enumerateObjectInstances=function(e){var i=this.data;if(i){var a=e.objectName,r=new t.ObjectEnumerationBuilder,o=this.data.dataLabelsSettings?this.data.dataLabelsSettings:t.dataLabelUtils.getDefaultTreemapLabelSettings();switch(a){case"dataPoint":var n=this.dataViews&&this.dataViews.length>0&&this.dataViews[0]&&this.dataViews[0].categorical,s=t.GradientUtils.hasGradientRole(n);s||this.enumerateDataPoints(r,i);break;case"legend":return this.enumerateLegend(i);case"labels":var l={enumeration:r,dataLabelsSettings:o,show:!0,displayUnits:!0,precision:!0};t.dataLabelUtils.enumerateDataLabels(l);break;case"categoryLabels":t.dataLabelUtils.enumerateCategoryLabels(r,o,!1,!0)}return r.complete()}},a.prototype.enumerateDataPoints=function(e,i){var a=i.root.children;if(!_.isEmpty(a))for(var r=0;r<a.length;r++){var o=a[r];e.pushInstance({displayName:o.name,selector:t.ColorHelper.normalizeSelector(o.identity.getSelector()),properties:{fill:{solid:{color:o.color}}},objectName:"dataPoint"})}},a.prototype.enumerateLegend=function(i){var a={legend:i.legendObjectProperties},r=e.DataViewObjects.getValue(a,t.treemapProps.legend.show,this.legend.isVisible()),o=e.DataViewObjects.getValue(a,t.treemapProps.legend.showTitle,!0),n=e.DataViewObjects.getValue(a,t.treemapProps.legend.titleText,this.data.legendData.title),s=e.DataViewObject.getValue(a,t.legendProps.labelColor,this.data.legendData?this.data.legendData.labelColor:t.LegendData.DefaultLegendLabelFillColor),l=e.DataViewObject.getValue(a,t.legendProps.fontSize,this.data.legendData&&this.data.legendData.fontSize?this.data.legendData.fontSize:t.SVGLegend.DefaultFontSizeInPt);return[{selector:null,objectName:"legend",properties:{show:r,position:t.LegendPosition[this.legend.getOrientation()],showTitle:o,titleText:n,labelColor:s,fontSize:l}}]},a.checkValueForShape=function(e){return e?e>0:!1},a.prototype.calculateTreemapSize=function(){var e=this.legend.getMargins();return{height:this.currentViewport.height-e.height,width:this.currentViewport.width-e.width}},a.prototype.initViewportDependantProperties=function(e){void 0===e&&(e=0);var i=this.calculateTreemapSize();this.svg.attr({width:i.width,height:i.height}),t.Legend.positionChartArea(this.svg,this.legend),t.SVGUtil.flushAllD3TransitionsIfNeeded(this.options)},a.hasChildrenWithIdentity=function(e){var t=e.children;if(!t)return!1;var i=t.length;if(0===i)return!1;for(var a=i-1;a>=0;a--)if(t[a].identity.hasIdentity())return!0;return!1},a.canDisplayMajorLabel=function(e){if(1!==e.depth)return!1;if(_.isEmpty(e.name))return!1;var t=e.dx-2*a.TextMargin;if(t<a.MinTextWidthForMajorLabel)return!1;var i=a.MajorLabelTextSize+2*a.TextMargin;return!(e.dy<i)},a.canDisplayMinorLabel=function(e,t){if(e.depth<1||e.depth>2)return!1;if(1===e.depth&&(e.children||!t.show))return!1;if(_.isEmpty(e.name))return!1;var i=e.dx-2*a.TextMargin;if(i<a.MinTextWidthForMinorLabel)return!1;var r=a.MinorLabelTextSize+2*a.TextMargin;if(e.dy<r)return!1;if(1===e.depth){var o=e.y+a.MajorLabelTextSize+2*a.TextMargin;if(e.y+e.dy-o<r)return!1}else if(2===e.depth){var n=e.parent,o=Math.max(n.y+a.MajorLabelTextSize+2*a.TextMargin,e.y);if(e.y+e.dy-o<r)return!1}return!0},a.createMajorLabelText=function(t,i,r,o){var n=t.dx-2*a.TextMargin,s=a.MajorLabelTextProperties,l={text:t.name,fontFamily:s.fontFamily,fontSize:s.fontSize};return e.TextMeasurementService.getTailoredTextOrDefault(l,n)},a.createMinorLabelText=function(e,i,r,o){var n=e.dx-2*a.TextMargin,s=e.name;if(i.show){var l=o.getOrCreate(e.labelFormatString,i,r);s=t.dataLabelUtils.getLabelFormattedText({label:null!=e.highlightValue?e.highlightValue:e.value,maxWidth:n,formatter:l}),i.showCategory&&2===e.depth&&(s=t.dataLabelUtils.getLabelFormattedText({label:e.name,maxWidth:n})+" "+s)}return t.dataLabelUtils.getLabelFormattedText({label:s,maxWidth:n,fontSize:i.fontSize})},a.getFill=function(e,t){return e.depth>1&&!e.identity.hasIdentity()&&!t?i.noneValue:a.hasChildrenWithIdentity(e)?i.noneValue:e.color},a.getFillOpacity=function(e,t,i,r){return i?r?null:a.DimmedShapeOpacity.toString():!t||e.selected?null:e.depth>1&&e.parent.selected?null:a.hasChildrenWithIdentity(e)?null:a.DimmedShapeOpacity.toString()},a.prototype.updateInternal=function(e){var i=this.data,r=i&&i.hasHighlights,o=i?i.dataLabelsSettings:null,n=t.AnimatorCommon.GetAnimationDuration(this.animator,e);this.options.interactivity&&this.options.interactivity.isInteractiveLegend||!this.data||this.renderLegend(),this.initViewportDependantProperties(n);var s=this.calculateTreemapSize();this.treemap.size([s.width,s.height]);var l=i&&i.root?this.treemap.nodes(i.root):[],c=l.filter(function(e){return null!=e.highlightMultiplier&&(!e.children||0===e.children.length)}),u=[],h=[],d=null;o.showCategory&&(u=l.filter(function(e){return a.canDisplayMajorLabel(e)})),(o.show||o.showCategory)&&(h=l.filter(function(e){return a.canDisplayMinorLabel(e,o)}),0===o.displayUnits&&(d=d3.max(h,function(e){return Math.abs(e.value)})));var p,g,m,f,y,v=a.getLayout(o,d);if(this.animator&&!e){var b={viewModel:i,nodes:l,highlightNodes:c,majorLabeledNodes:u,minorLabeledNodes:h,shapeGraphicsContext:this.shapeGraphicsContext,labelGraphicsContext:this.labelGraphicsContext,interactivityService:this.interactivityService,layout:v,labelSettings:o};y=this.animator.animate(b),p=y.shapes,g=y.highlightShapes,m=y.majorLabels,f=y.minorLabels}if(!this.animator||e||y.failed){var C=this.interactivityService&&this.interactivityService.hasSelection(),S=this.shapeGraphicsContext;p=a.drawDefaultShapes(S,l,C,r,v),g=a.drawDefaultHighlightShapes(S,c,C,r,v);var x=this.labelGraphicsContext;m=a.drawDefaultMajorLabels(x,u,o,v),f=a.drawDefaultMinorLabels(x,h,o,v)}if(this.interactivityService){var w={shapes:p,highlightShapes:g,majorLabels:m,minorLabels:f,nodes:l,hasHighlights:i.hasHighlights};this.interactivityService.bind(l,this.behavior,w)}this.tooltipsEnabled&&(t.TooltipManager.addTooltip(p,function(e){return e.data.highlightedTooltipInfo?e.data.highlightedTooltipInfo:e.data.tooltipInfo}),t.TooltipManager.addTooltip(g,function(e){return e.data.highlightedTooltipInfo})),t.SVGUtil.flushAllD3TransitionsIfNeeded(this.options)},a.prototype.renderLegend=function(){var e=this.data.legendObjectProperties;if(e){var i=this.data.legendData;t.LegendData.update(i,e);var a=e[t.legendProps.position];a&&this.legend.changeOrientation(t.LegendPosition[a]),this.legend.drawLegend(i,this.currentViewport)}else this.legend.changeOrientation(t.LegendPosition.Top),this.legend.drawLegend({dataPoints:[]},this.currentViewport)},a.getNodeClass=function(e,t){var i;switch(e.depth){case 1:i=a.ParentGroupClassName;break;case 2:i=a.NodeGroupClassName;break;case 0:i=a.RootNodeClassName}return i+=" "+(t?a.HighlightNodeClassName:a.TreemapNodeClassName)},a.createTreemapShapeLayout=function(e){return void 0===e&&(e=!1),{x:function(e){return e.x},y:function(t){return t.y+(e?t.dy*(1-t.highlightMultiplier):0)},width:function(e){return Math.max(0,e.dx)},height:function(t){return Math.max(0,t.dy*(e?t.highlightMultiplier:1))}}},a.createTreemapZeroShapeLayout=function(){return{x:function(e){return e.x},y:function(e){return e.y+e.dy},width:function(e){return Math.max(0,e.dx)},height:function(e){return 0}}},a.drawDefaultShapes=function(e,t,i,r,o){var n=!1,s=e.selectAll("."+a.TreemapNodeClassName).data(t,function(e){return e.key});return s.enter().append("rect").attr("class",o.shapeClass),s.style("fill",function(e){return a.getFill(e,n)}).style("fill-opacity",function(e){return a.getFillOpacity(e,i,r,n)}).attr(o.shapeLayout),s.exit().remove(),s},a.drawDefaultHighlightShapes=function(e,t,i,r,o){var n=!0,s=e.selectAll("."+a.HighlightNodeClassName).data(t,function(e){
29return e.key+"highlight"});return s.enter().append("rect").attr("class",o.highlightShapeClass),s.style("fill",function(e){return a.getFill(e,n)}).style("fill-opacity",function(e){return a.getFillOpacity(e,i,r,n)}).attr(o.highlightShapeLayout),s.exit().remove(),s},a.drawDefaultMajorLabels=function(e,t,i,r){var o=e.selectAll("."+a.MajorLabelClassName).data(t,function(e){return e.key});return o.enter().append("text").attr("class",r.majorLabelClass),o.attr(r.majorLabelLayout).text(r.majorLabelText).style("fill",function(){return i.labelColor}),o.exit().remove(),o},a.drawDefaultMinorLabels=function(e,t,i,r){var o=e.selectAll("."+a.MinorLabelClassName).data(t,function(e){return e.key});return o.enter().append("text").attr("class",r.minorLabelClass),o.attr(r.minorLabelLayout).text(r.minorLabelText).style("fill",function(){return i.labelColor}),o.exit().remove(),o},a.cleanMinorLabels=function(e){var t=[],i=e.selectAll("."+a.LabelsGroupClassName).selectAll("."+a.MinorLabelClassName).data(t);i.exit().remove()},a.DimmedShapeOpacity=.4,a.ClassName="treemap",a.LabelsGroupClassName="labels",a.MajorLabelClassName="majorLabel",a.MinorLabelClassName="minorLabel",a.ShapesClassName="shapes",a.TreemapNodeClassName="treemapNode",a.RootNodeClassName="rootNode",a.ParentGroupClassName="parentGroup",a.NodeGroupClassName="nodeGroup",a.HighlightNodeClassName="treemapNodeHighlight",a.TextMargin=5,a.MinorLabelTextSize=10,a.MinTextWidthForMinorLabel=18,a.MajorLabelTextSize=12,a.MinTextWidthForMajorLabel=22,a.MajorLabelTextProperties={fontFamily:"wf_segoe-ui_normal",fontSize:a.MajorLabelTextSize+"px"},a.ValuesRoleName="Values",a.CullableArea=9,a}();t.Treemap=a}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=e.visuals.KpiUtil.getKpiImageMetadata,a=jsCommon.CssConstants.createClassAndSelector,r=function(r){function o(t){r.call(this,o.cardClassName),this.isScrollable=!1,this.displayUnitSystemType=e.DisplayUnitSystemType.WholeUnits,t&&(this.isScrollable=!!t.isScrollable,t.animator&&(this.animator=t.animator),null!=t.displayUnitSystemType&&(this.displayUnitSystemType=t.displayUnitSystemType))}return __extends(o,r),o.prototype.init=function(e){this.animationOptions=e.animation;var t=e.element;this.kpiImage=d3.select(t.get(0)).append("div").classed(o.KPIImage["class"],!0);var i=this.svg=d3.select(t.get(0)).append("svg");this.graphicsContext=i.append("g"),this.currentViewport=e.viewport,this.hostServices=e.host,this.style=e.style,this.updateViewportProperties(),this.isScrollable&&(i.attr("class",o.cardClassName),this.labelContext=i.append("g"))},o.prototype.onDataChanged=function(i){var a,r=i.dataViews[0];if(r){this.getMetaDataColumn(r),r.single&&(a=r.single.value),this.cardFormatSetting=this.getDefaultFormatSettings();var o=r.metadata;if(o){var n=o.objects;if(n){var s=this.cardFormatSetting.labelSettings;s.labelColor=e.DataViewObjects.getFillColor(n,t.cardProps.labels.color,s.labelColor),s.precision=e.DataViewObjects.getValue(n,t.cardProps.labels.labelPrecision,s.precision),s.fontSize=e.DataViewObjects.getValue(n,t.cardProps.labels.fontSize,s.fontSize),s.precision!==t.dataLabelUtils.defaultLabelPrecision&&s.precision<0&&(s.precision=0),s.displayUnits=e.DataViewObjects.getValue(n,t.cardProps.labels.labelDisplayUnits,s.displayUnits),s.showCategory=e.DataViewObjects.getValue(n,t.cardProps.categoryLabels.show,s.showCategory),s.categoryLabelColor=e.DataViewObjects.getFillColor(n,t.cardProps.categoryLabels.color,s.categoryLabelColor),this.cardFormatSetting.wordWrap=e.DataViewObjects.getValue(n,t.cardProps.wordWrap.show,this.cardFormatSetting.wordWrap),this.cardFormatSetting.textSize=e.DataViewObjects.getValue(n,t.cardProps.categoryLabels.fontSize,this.cardFormatSetting.textSize)}}}this.updateInternal(a,!0,!0)},o.prototype.onResizing=function(e){this.currentViewport=e,this.updateViewportProperties(),this.updateInternal(this.value,!0,!0)},o.prototype.updateViewportProperties=function(){var e=this.currentViewport;this.svg.attr("width",e.width).attr("height",e.height)},o.prototype.setTextProperties=function(e,t){o.cardTextProperties.fontSize=jsCommon.PixelConverter.fromPoint(t),o.cardTextProperties.text=e},o.prototype.getCardFormatTextSize=function(){return this.cardFormatSetting.textSize},o.prototype.getAdjustedFontHeight=function(e,t,i){var a=r.prototype.getAdjustedFontHeight.call(this,e,t,i);return Math.min(a,o.DefaultStyle.card.maxFontSize)},o.prototype.clear=function(e){void 0===e&&(e=!1),this.svg.select(o.Value.selector).text(""),e||this.svg.select(o.Label.selector).text(""),r.prototype.clear.call(this)},o.prototype.updateInternal=function(a,r,n){void 0===n&&(n=!1);var s=this.value,l=t.AnimatorCommon.GetAnimationDuration(this.animator,r);if(void 0===a)return void(void 0!==s&&this.clear());var c=this.metaDataColumn,u=this.cardFormatSetting.labelSettings,h=0===u.displayUnits,d=this.getFormatString(c),p=t.valueFormatter.create({format:d,value:h?a:u.displayUnits,precision:t.dataLabelUtils.getLabelPrecision(u.precision,d),displayUnitSystemType:h&&u.precision===t.dataLabelUtils.defaultLabelPrecision?this.displayUnitSystemType:e.DisplayUnitSystemType.WholeUnits,formatSingleValues:!!h,allowFormatBeautification:!0,columnType:c?c.type:void 0}),g=this.cardFormatSetting,m=jsCommon.PixelConverter.fromPointToPixel(u.fontSize),f=o.DefaultStyle.value;this.setTextProperties(a,this.getCardFormatTextSize());var y=e.TextMeasurementService.estimateSvgTextHeight(o.cardTextProperties),v=y+o.DefaultStyle.label.paddingTop,b=this.currentViewport.width,C=this.currentViewport.height,S=this.getTranslateX(b),x=(C-v-m)/2,w=i(c,a,1);if(this.isScrollable){if(!n&&s===a)return;s===a||!_.isEmpty(a)&&"string"==typeof a||(a=p.format(a));var P=c?c.displayName:void 0,D=u.showCategory?[P]:[],L=this.getTranslateY(m+v+x),T=this.labelContext.attr("transform",t.SVGUtil.translate(S,L)).selectAll("text").data(D);T.enter().append("text").attr("class",o.Label["class"]),T.text(function(e){return e}).style({"font-size":jsCommon.PixelConverter.fromPoint(this.getCardFormatTextSize()),fill:u.categoryLabelColor,"text-anchor":this.getTextAnchor()});var V=T.node();if(V&&(g.wordWrap?e.TextMeasurementService.wordBreak(V,b/2,C-L):T.call(t.AxisHelper.LabelLayoutStrategy.clip,b,e.TextMeasurementService.svgEllipsis)),T.append("title").text(function(e){return e}),T.exit().remove(),w)this.graphicsContext.selectAll("text").remove(),this.displayStatusGraphic(w,S,x,m);else{this.kpiImage.selectAll("div").remove();var M=this.graphicsContext.attr("transform",t.SVGUtil.translate(S,this.getTranslateY(m+x))).selectAll("text").data([a]);M.enter().append("text").attr("class",o.Value["class"]),M.text(function(e){return e}).style({"font-size":jsCommon.PixelConverter.fromPoint(u.fontSize),fill:u.labelColor,"font-family":f.fontFamily,"text-anchor":this.getTextAnchor()}),M.call(t.AxisHelper.LabelLayoutStrategy.clip,b,e.TextMeasurementService.svgEllipsis),M.append("title").text(function(e){return e}),M.exit().remove()}}else w?(this.graphicsContext.selectAll("text").remove(),this.displayStatusGraphic(w,S,x,m)):(this.kpiImage.selectAll("div").remove(),this.doValueTransition(s,a,this.displayUnitSystemType,this.animationOptions,l,n,p),this.graphicsContext.call(t.tooltipUtils.tooltipUpdate,[a]));this.value=a},o.prototype.displayStatusGraphic=function(e,i,a,r){this.graphicsContext.selectAll("text").remove();var o=this.kpiImage.select("div");o&&!o.empty()||(o=this.kpiImage.append("div")),o.attr("class",e["class"]).style("position","absolute").style("font-size",r+"px");var n=o.node().offsetWidth,s=o.node().offsetHeight;o.style("transform",t.SVGUtil.translateWithPixels(i-n/2,this.getTranslateY(r+a)-s))},o.prototype.getDefaultFormatSettings=function(){return{labelSettings:t.dataLabelUtils.getDefaultCardLabelSettings(o.DefaultStyle.value.color,o.DefaultStyle.label.color,o.DefaultStyle.value.textSize),wordWrap:!1,textSize:o.DefaultStyle.label.textSize}},o.prototype.enumerateObjectInstances=function(e){this.cardFormatSetting||(this.cardFormatSetting=this.getDefaultFormatSettings());var i=this.cardFormatSetting,a=new t.ObjectEnumerationBuilder;switch(e.objectName){case"categoryLabels":t.dataLabelUtils.enumerateCategoryLabels(a,i.labelSettings,!0,!0,i.textSize);break;case"labels":var r={enumeration:a,dataLabelsSettings:i.labelSettings,show:!0,displayUnits:!0,precision:!0,fontSize:!0};t.dataLabelUtils.enumerateDataLabels(r);break;case"wordWrap":a.pushInstance({objectName:"wordWrap",selector:null,properties:{show:i.wordWrap}})}return a.complete()},o.cardClassName="card",o.Label=a("label"),o.Value=a("value"),o.KPIImage=a("caption"),o.cardTextProperties={fontSize:null,text:null,fontFamily:t.dataLabelUtils.LabelTextProperties.fontFamily},o.DefaultStyle={card:{maxFontSize:200},label:{textSize:12,color:"#a6a6a6",paddingTop:8},value:{textSize:27,color:"#333333",fontFamily:"wf_standard-font"}},o}(t.AnimatedText);t.Card=r}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i;!function(e){e[e.Sad=0]="Sad",e[e.Meh=1]="Meh",e[e.Happy=2]="Happy"}(i||(i={}));var a=function(){function a(){}return a.converter=function(e){return{}},a.getGaugeData=function(e){var i={max:100,min:0,target:void 0,total:0,tooltipItems:[]};if(e&&e.categorical&&e.categorical.values&&e.metadata&&e.metadata.columns)for(var a=e.categorical.values,r=e.metadata.columns,o=0;o<a.length;o++){var n=r[o],s=a[o].values[0]||0;n&&n.roles&&(n.roles[t.gaugeRoleNames.y]?(i.total=s,s&&i.tooltipItems.push({displayName:a[o].source.displayName,value:t.converterHelper.formatFromMetadataColumn(s,a[o].source,t.Gauge.formatStringProp)})):n.roles[t.gaugeRoleNames.minValue]?i.min=s:n.roles[t.gaugeRoleNames.maxValue]?i.max=s:n.roles[t.gaugeRoleNames.targetValue]&&(i.target=s,s&&i.tooltipItems.push({displayName:a[o].source.displayName,value:t.converterHelper.formatFromMetadataColumn(s,a[o].source,t.Gauge.formatStringProp)})))}return i},a.prototype.init=function(e){var t=this;this.rootElem=e.element,this.rootElem.addClass("owlGaugeVisual"),this.svgTailElem=$(a.owlTailSvg),this.svgBgElem=$(a.visualBgSvg),this.svgBodyElem=$(a.owlBodySvg),this.rootElem.append(this.svgBgElem).append(this.svgTailElem).append(this.svgBodyElem),a.OwlDemoMode&&window.setInterval(function(){var e=100*Math.random()+1;t.updateGauge(e)},2e3),this.updateViewportSize(e.viewport.width,e.viewport.height)},a.prototype.update=function(e){this.updateViewportSize(e.viewport.width,e.viewport.height);var t=e.dataViews.length>0?e.dataViews[0]:null;if(t){var i=a.getGaugeData(e.dataViews[0]),r=(i.total-i.min)/(i.max-i.min);this.updateGauge(100*r|0)}else this.updateGauge(0)},a.prototype.updateGauge=function(e){if(e>=0&&100>=e){var t=-180+180*e/100;this.svgBgElem.css({transform:"rotate("+t+"deg)"}),e>=66?this.happinessLevel=i.Happy:e>=33?this.happinessLevel=i.Meh:this.happinessLevel=i.Sad}},Object.defineProperty(a.prototype,"happinessLevel",{set:function(e){switch(this.rootElem.removeClass("sad").removeClass("meh").removeClass("happy"),e){case i.Sad:this.rootElem.addClass("sad");break;case i.Meh:this.rootElem.addClass("meh");break;case i.Happy:this.rootElem.addClass("happy")}},enumerable:!0,configurable:!0}),a.prototype.updateViewportSize=function(e,t){var i=this,r=window.setImmediate||window.requestAnimationFrame;r(function(){i.rootElem.css({height:t,width:e}),i.svgBodyElem.height(i.svgBodyElem.width()*a.owlBodyHeightMultiplier),i.svgBgElem.height(i.svgBgElem.width()*a.visualBgHeightMultiplier),i.svgTailElem.height(i.svgTailElem.width()*a.owlTailHeightMultiplier)})},a.owlBodySvg='<svg version="1.1" class="owlGaugeBody" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 267.7 291.2" style="enable-background:new 0 0 267.7 291.2;" xml:space="preserve"> <style type="text/css"> .owlGaugeBody .st0{fill:#A87D50;} .owlGaugeBody .st1{fill:#C2B59B;} .owlGaugeBody .st2{fill:#EB2227;} .owlGaugeBody .st3{fill:#FFFFFF;} .owlGaugeBody .st4{fill:#F9D018;} .owlGaugeBody .st5{fill:none;} .owlGaugeBody .st6{fill:#83381B;} .owlGaugeBody .st7{fill:#231F20;} </style> <g id="XMLID_31_"> <g id="XMLID_34_"> <ellipse id="XMLID_21_" transform="matrix(0.9998 1.947640e-02 -1.947640e-02 0.9998 2.8614 -2.5802)" class="st0" cx="133.9" cy="145.6" rx="133.9" ry="145.6"/> <polygon id="XMLID_20_" class="st0" points="199.2,32.8 184,11.3 209,9.7 "/> <polygon id="XMLID_19_" class="st0" points="73.9,31.2 62.1,7.7 87.1,9.8 "/> <circle id="XMLID_18_" class="st1" cx="134.8" cy="189.2" r="89.8"/> <path id="XMLID_17_" class="st2" d="M140.1,88c-2.7,3.8-7.9,4.7-11.7,2c-2.7-1.9-3.9-5.1-3.4-8.1c0,0,9.6-41.8,9.6-41.8l6.9,40.8 C142,83.2,141.6,85.8,140.1,88z"/> <path id="XMLID_16_" class="st3" d="M164.6,16.2c-14.2,0-26.3,9.2-30.6,21.9c-4.1-13.1-16.3-22.6-30.8-22.6 C85.4,15.6,71,30,71,47.8s14.4,32.3,32.3,32.3c14.2,0,26.3-9.2,30.6-21.9c4.1,13.1,16.3,22.6,30.8,22.6 c17.8,0,32.3-14.4,32.3-32.3S182.4,16.2,164.6,16.2z"/> <path id="XMLID_15_" class="st4" d="M122,58.7l23.3-0.1c0,0-9,14.8-10.2,16.6c-1.2,1.9-2.2,0.1-2.2,0.1L122,58.7z"/> <rect id="XMLID_14_" x="-11.4" y="-68.8" class="st5" width="288.3" height="259.7"/> <g id="XMLID_37_"> <path id="XMLID_13_" class="st6" d="M121.6,125.5c0,3.7-3.5,6.6-7.7,6.6c-4.2,0-7.7-3-7.7-6.6"/> <path id="XMLID_12_" class="st6" d="M160.1,126.5c0,3.7-3.5,6.6-7.7,6.6s-7.7-3-7.7-6.6"/> <path id="XMLID_11_" class="st6" d="M142.4,148.1c0,3.7-3.5,6.6-7.7,6.6c-4.2,0-7.7-3-7.7-6.6"/> <path id="XMLID_10_" class="st6" d="M183.1,148.8c0,3.7-3.5,6.6-7.7,6.6c-4.2,0-7.7-3-7.7-6.6"/> <path id="XMLID_9_" class="st6" d="M160.9,177.4c0,3.7-3.5,6.6-7.7,6.6s-7.7-3-7.7-6.6"/> <path id="XMLID_8_" class="st6" d="M201.6,178c0,3.7-3.5,6.6-7.7,6.6s-7.7-3-7.7-6.6"/> <path id="XMLID_7_" class="st6" d="M76.4,177.4c0,3.7-3.5,6.6-7.7,6.6c-4.2,0-7.7-3-7.7-6.6"/> <path id="XMLID_6_" class="st6" d="M117,178c0,3.7-3.5,6.6-7.7,6.6s-7.7-3-7.7-6.6"/> <path id="XMLID_5_" class="st6" d="M98.6,148.1c0,3.7-3.5,6.6-7.7,6.6c-4.2,0-7.7-3-7.7-6.6"/> </g> <circle id="XMLID_4_" class="st7" cx="164.1" cy="49" r="6.4"/> <circle id="XMLID_3_" class="st7" cx="102.7" cy="47.7" r="6.4"/> </g> <path id="XMLID_2_" class="st0" d="M160.1,140.9c11.1-8.4,55.6-36,55.6-36l4.7,0.8l10.2,38.8c0,0-3,3-9.2,3.1 c-5.1,0.1-45.9-2.6-60.2-3.5C158.1,143.9,157.7,142.7,160.1,140.9z"/> <path id="XMLID_1_" class="st0" d="M110.6,140.8c-11.1-8.4-55.6-36-55.6-36l-4.7,0.8L40,144.4c0,0,3,3,9.2,3.1 c5.1,0.1,45.9-2.6,60.2-3.5C112.5,143.8,113,142.6,110.6,140.8z"/> </g> </svg>',a.owlTailSvg='<svg version="1.1" class="owlGaugeTail" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 587.8 295.5" style="enable-background:new 0 0 587.8 295.5;" xml:space="preserve"> <style type="text/css"> .owlGaugeTail .st0{fill:#3B2416;} .owlGaugeTail .st1{fill:#5B4B43;} .owlGaugeTail .st2{fill:#603A17;} .owlGaugeTail .st3{fill:#726659;} </style> <g id="XMLID_55_"> <path id="XMLID_29_" class="st0" d="M85.2,106.2c-27.1,0-49.2,22-49.2,49.2c0,19.1,10.9,35.7,26.9,43.8c0,0,231.2,95.9,231.2,95.9 l-171-171C114.1,113.2,100.5,106.2,85.2,106.2z"/> <g id="XMLID_56_"> <path id="XMLID_28_" class="st1" d="M482.5,86.4c0-27.1-22-49.2-49.2-49.2c-19.1,0-35.7,10.9-43.8,26.9c0,0-95.9,231.2-95.9,231.2 l171-171C475.5,115.3,482.5,101.7,482.5,86.4z"/> <path id="XMLID_27_" class="st2" d="M573.5,281.3c19.2-19.2,19.2-50.3,0-69.5c-13.5-13.5-33-17.5-50-12c0,0-231.3,95.7-231.3,95.7 l241.8,0C548,296.9,562.6,292.1,573.5,281.3z"/> <path id="XMLID_26_" class="st3" d="M279.9,14.4c-19.2-19.2-50.3-19.2-69.5,0c-13.5,13.5-17.5,33-12,50c0,0,95.7,231.3,95.7,231.3 L294,54C295.4,39.8,290.7,25.2,279.9,14.4z"/> <path id="XMLID_25_" class="st2" d="M105.3,86.4c0-27.1,22-49.2,49.2-49.2c19.1,0,35.7,10.9,43.8,26.9c0,0,95.9,231.2,95.9,231.2 l-171-171C112.3,115.3,105.3,101.7,105.3,86.4z"/> <path id="XMLID_24_" class="st2" d="M14.4,281.4c-19.2-19.2-19.2-50.3,0-69.5c13.5-13.5,33-17.5,50-12c0,0,231.3,95.7,231.3,95.7 l-241.8,0C39.8,297,25.2,292.3,14.4,281.4z"/> <path id="XMLID_23_" class="st2" d="M308.2,14c19.2-19.2,50.3-19.2,69.5,0c13.5,13.5,17.5,33,12,50c0,0-95.7,231.3-95.7,231.3 l0-241.8C292.6,39.4,297.4,24.8,308.2,14z"/> <path id="XMLID_22_" class="st0" d="M503.2,106c27.1,0,49.2,22,49.2,49.2c0,19.1-10.9,35.7-26.9,43.8c0,0-231.2,95.9-231.2,95.9 l171-171C474.2,113,487.8,106,503.2,106z"/> </g> </g> </svg>',a.visualBgSvg='<svg version="1.1" class="owlGaugeBg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="123.8 94.9 349.1 175.3" style="enable-background:new 123.8 94.9 349.1 175.3;" xml:space="preserve"> <style type="text/css"> .owlGaugeBg .st0{fill:#EF4137;} .owlGaugeBg .st1{fill:#FAAF42;} .owlGaugeBg .st2{fill:#F15B2A;} .owlGaugeBg .st3{fill:#F69321;} </style> <g id="XMLID_10_"> <path id="XMLID_8_" class="st0" d="M174.3,158c-16.1,0-29.2,13.1-29.2,29.2c0,11.4,6.5,21.2,16,26.1l137.3,57L196.9,168.7 C191.5,162.2,183.4,158,174.3,158z"/> <g id="XMLID_11_"> <path id="XMLID_7_" class="st1" d="M410.2,146.3c0-16.1-13.1-29.2-29.2-29.2c-11.4,0-21.2,6.5-26,16l-57,137.5L399.5,169 C406.1,163.5,410.2,155.4,410.2,146.3z"/> <path id="XMLID_6_" class="st0" d="M464.3,262.2c11.4-11.4,11.4-29.9,0-41.3c-8-8-19.6-10.4-29.7-7.1l-137.4,56.9h143.6 C449.2,271.4,457.9,268.6,464.3,262.2z"/> <path id="XMLID_5_" class="st2" d="M290,103.5c-11.4-11.4-29.9-11.4-41.3,0c-8,8-10.4,19.6-7.1,29.7l56.8,137.5V127 C299.2,118.6,296.4,109.9,290,103.5z"/> <path id="XMLID_4_" class="st3" d="M186.3,146.3c0-16.1,13.1-29.2,29.2-29.2c11.4,0,21.2,6.5,26,16l57,137.5L197,168.8 C190.5,163.5,186.3,155.4,186.3,146.3z"/> <path id="XMLID_3_" class="st2" d="M132.3,262.2c-11.4-11.4-11.4-29.9,0-41.3c8-8,19.6-10.4,29.7-7.1l137.4,56.9H155.8 C147.4,271.5,138.7,268.7,132.3,262.2z"/> <path id="XMLID_2_" class="st3" d="M306.8,103.2c11.4-11.4,29.9-11.4,41.3,0c8,8,10.4,19.6,7.1,29.7l-56.8,137.5V126.7 C297.5,118.3,300.3,109.7,306.8,103.2z"/> <path id="XMLID_1_" class="st2" d="M422.5,157.9c16.1,0,29.2,13.1,29.2,29.2c0,11.4-6.5,21.2-16,26.1l-137.3,57L400,168.6 C405.3,162.1,413.4,157.9,422.5,157.9z"/> </g> </g> </svg>',a.owlBodyHeightMultiplier=291.2/267.7,a.owlTailHeightMultiplier=295.5/587.8,a.visualBgHeightMultiplier=295.5/587.8,a.OwlDemoMode=!1,a.capabilities={dataRoles:[{displayName:"Category",name:"Category",kind:e.VisualDataRoleKind.Grouping},{displayName:"Y Axis",name:"Y",kind:e.VisualDataRoleKind.Measure}],dataViewMappings:[{categories:{"for":{"in":"Category"},dataReductionAlgorithm:{top:{}}},values:{select:[{bind:{to:"Y"}}]}}]},a}();t.OwlGauge=a}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=function(){function e(){}return Object.defineProperty(e.prototype,"code",{get:function(){return"NoMapLocation"},enumerable:!0,configurable:!0}),e.prototype.getMessages=function(e){var t="NoMapLocationMessage",i="NoMapLocationKey",a="NoMapLocationValue",r={message:e.get(t),title:e.get(i),detail:e.get(a)};return r},e}();e.NoMapLocationWarning=t;var i=function(){function e(){}return Object.defineProperty(e.prototype,"code",{get:function(){return"NoValidGeotaggedCategory"},enumerable:!0,configurable:!0}),e.prototype.getMessages=function(e){var t="NoValidGeotaggedCategoryMessage",i="NoValidGeotaggedCategoryKey",a="NoValidGeotaggedCategoryValue",r={message:e.get(t),title:e.get(i),detail:e.get(a)};return r},e}();e.FilledMapWithoutValidGeotagCategoryWarning=i;var a=function(){function e(){}return Object.defineProperty(e.prototype,"code",{get:function(){return"GeometryCulledWarning"},enumerable:!0,configurable:!0}),e.prototype.getMessages=function(e){var t="GeometryCulledWarningMessage",i="GeometryCulledWarningKey",a="GeometryCulledWarningVal",r={message:e.get(t),title:e.get(i),detail:e.get(a)};return r},e}();e.GeometryCulledWarning=a;var r=function(){function e(){}return Object.defineProperty(e.prototype,"code",{get:function(){return"NegativeValuesNotSupported"},enumerable:!0,configurable:!0}),e.prototype.getMessages=function(e){var t="VisualWarning_NegativeValues",i={message:e.get(t),title:"",detail:""};return i},e}();e.NegativeValuesNotSupportedWarning=r;var o=function(){function e(){}return Object.defineProperty(e.prototype,"code",{get:function(){return"AllNegativeValuesNotSupported"},enumerable:!0,configurable:!0}),e.prototype.getMessages=function(e){var t="VisualWarning_AllNegativeValues",i={message:e.get(t),title:"",detail:""};return i},e}();e.AllNegativeValuesWarning=o;var n=function(){function e(){}return Object.defineProperty(e.prototype,"code",{get:function(){return"NaNNotSupported"},enumerable:!0,configurable:!0}),e.prototype.getMessages=function(e){var t="VisualWarning_NanValues",i={message:e.get(t),title:"",detail:""};return i},e}();e.NaNNotSupportedWarning=n;var s=function(){function e(){}return Object.defineProperty(e.prototype,"code",{get:function(){return"InfinityValuesNotSupported"},enumerable:!0,configurable:!0}),e.prototype.getMessages=function(e){var t="VisualWarning_InfinityValues",i={message:e.get(t),title:"",detail:""};return i},e}();e.InfinityValuesNotSupportedWarning=s;var l=function(){function e(){}return Object.defineProperty(e.prototype,"code",{get:function(){return"ValuesOutOfRange"},enumerable:!0,configurable:!0}),e.prototype.getMessages=function(e){var t="VisualWarning_VisualizationOutOfRange",i={message:e.get(t),title:"",detail:""};return i},e}();e.ValuesOutOfRangeWarning=l;var c=function(){function e(){}return Object.defineProperty(e.prototype,"code",{get:function(){return"ZeroValuesNotSupported"},enumerable:!0,configurable:!0}),e.prototype.getMessages=function(e){var t="VisualWarning_ZeroValues",i={message:e.get(t),title:"",detail:""};return i},e}();e.ZeroValueWarning=c;var u=function(){function e(){}return Object.defineProperty(e.prototype,"code",{get:function(){return"VisualKPIDataMissing"},enumerable:!0,configurable:!0}),e.prototype.getMessages=function(e){var t="Visual_KPI_DataMissing",i={message:e.get(t),title:"",detail:""};return i},e}();e.VisualKPIDataMissingWarning=u;var h=function(){function e(){}return Object.defineProperty(e.prototype,"code",{get:function(){return"ScriptVisualNotRefreshed"},enumerable:!0,configurable:!0}),e.prototype.getMessages=function(e){var t="ScriptVisualRefreshWarningMessage",i="ScriptVisualRefreshWarningValue",a={message:e.get(t),title:e.get(t),detail:e.get(i)};return a},e}();e.ScriptVisualRefreshWarning=h}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.PixelConverter,a=jsCommon.CssConstants.createClassAndSelector,r=function(){function r(e){this.isScrollable=e.isScrollable,this.tooltipsEnabled=e.tooltipsEnabled,this.interactivityService=e.interactivityService}return r.prototype.init=function(e){this.svg=e.svg,this.svg.classed(r.WaterfallClassName,!0),this.style=e.style,this.currentViewport=e.viewport,this.hostServices=e.host,this.interactivity=e.interactivity,this.cartesianVisualHost=e.cartesianHost,this.options=e,this.element=e.element,this.colors=this.style.colorPalette.dataColors,this.mainGraphicsSVG=this.svg.append("svg"),this.mainGraphicsContext=this.mainGraphicsSVG.append("g").classed(r.MainGraphicsContextClassName,!0),this.labelGraphicsContext=this.mainGraphicsSVG.append("g").classed(t.NewDataLabelUtils.labelGraphicsContextClass["class"],!0)},r.converter=function(i,a,o,n,s,l,c){void 0===c&&(c=!0);var u,h=e.data.createIDataViewCategoricalReader(i),d=r.formatStringProp,p=i.categorical.categories||[],g=s.increaseFill.solid.color,m=s.decreaseFill.solid.color,f=s.totalFill.solid.color,y=o.getLocalizedString(r.TotalLabel),v=o.getLocalizedString(r.IncreaseLabel),b=o.getLocalizedString(r.DecreaseLabel),C=[{label:v,color:g,icon:t.LegendIcon.Box,identity:t.SelectionIdBuilder.builder().withMeasure("increase").createSelectionId(),selected:!1},{label:b,color:m,icon:t.LegendIcon.Box,identity:t.SelectionIdBuilder.builder().withMeasure("decrease").createSelectionId(),selected:!1},{label:y,color:f,icon:t.LegendIcon.Box,identity:t.SelectionIdBuilder.builder().withMeasure("total").createSelectionId(),selected:!1}],S=0,x=0,w=0,P=[],D=[],L=void 0;if(h.hasValues("Y")){L=h.getValueMetadataColumn("Y");var T=L.format;if(_.isEmpty(p))S=w=h.getValue("Y",0),x=0;else{var V=p[0];u=V.source,D=V.values.slice(),D.push(y);for(var M=0,N=h.getCategoryCount();N>M;M++){var A=D[M],O=h.getValue("Y",M)||0,I=t.SelectionIdBuilder.builder().withCategory(V,M).withMeasure(L.queryName).createSelectionId(),R=void 0;c&&(R=[],R.push({displayName:u.displayName,value:t.converterHelper.formatFromMetadataColumn(A,u,d)}),null!=O&&R.push({displayName:L.displayName,value:t.converterHelper.formatFromMetadataColumn(O,L,d)}));var F=O>0?g:m;P.push({value:O,position:S,color:F,categoryValue:A,categoryIndex:M,seriesIndex:0,selected:!1,identity:I,highlight:!1,key:I.getKey(),tooltipInfo:R,labelFill:n.labelColor,labelFormatString:T}),S+=O,S>w&&(w=S),x>S&&(x=S)}}var H=void 0;c&&(H=[],u&&H.push({displayName:u.displayName,value:y}),null!=S&&H.push({displayName:L.displayName,value:t.converterHelper.formatFromMetadataColumn(S,L,d)}));var z=t.SelectionId.createNull();P.push({value:S,position:0,color:f,categoryValue:y,categoryIndex:M,identity:z,seriesIndex:0,selected:!1,highlight:!1,key:z.getKey(),tooltipInfo:H,labelFill:n.labelColor,labelFormatString:T,isTotal:!0})}l&&l.applySelectionStateToData(P);var G=t.CartesianHelper.getCategoryAxisProperties(i.metadata),j=t.CartesianHelper.getValueAxisProperties(i.metadata),k=t.converterHelper.createAxesLabels(G,j,u,[L]);return{series:[{data:P}],categories:D,categoryMetadata:u,valuesMetadata:L,legend:{dataPoints:C},hasHighlights:!1,positionMin:x,positionMax:w,dataLabelsSettings:n,sentimentColors:s,axesLabels:{x:k.xAxisLabel,y:k.yAxisLabel}}},r.prototype.setData=function(e){var i=this.getSentimentColorsFromObjects(null),a=e.length>0?e[0]:void 0;if(this.data={series:[{data:[]}],categories:[],valuesMetadata:null,legend:{dataPoints:[]},hasHighlights:!1,categoryMetadata:null,scalarCategoryAxis:!1,positionMax:0,positionMin:0,dataLabelsSettings:t.dataLabelUtils.getDefaultLabelSettings(!1,void 0),sentimentColors:i,axesLabels:{x:null,y:null}},a){if(a.metadata&&a.metadata.objects){var o=a.metadata.objects,n=o.labels;n&&t.dataLabelUtils.updateLabelSettingsFromLabelsObject(n,this.data.dataLabelsSettings),i=this.getSentimentColorsFromObjects(o)}a.categorical&&(this.data=r.converter(a,this.colors,this.hostServices,this.data.dataLabelsSettings,i,this.interactivityService,this.tooltipsEnabled))}},r.prototype.enumerateObjectInstances=function(e,i){switch(i.objectName){case"sentimentColors":this.enumerateSentimentColors(e);break;case"labels":var a={enumeration:e,dataLabelsSettings:this.data.dataLabelsSettings,show:!0,displayUnits:!0,precision:!0,fontSize:!0};t.dataLabelUtils.enumerateDataLabels(a)}},r.prototype.enumerateSentimentColors=function(e){var t=this.data.sentimentColors;e.pushInstance({selector:null,properties:{increaseFill:t.increaseFill,decreaseFill:t.decreaseFill,totalFill:t.totalFill},objectName:"sentimentColors"})},r.prototype.calculateLegend=function(){return this.data.legend},r.prototype.hasLegend=function(){return!0},r.createClippedDataIfOverflowed=function(t,i){var a=t,r=t.series[0].data;return t&&i<r.length&&(a=e.Prototype.inherit(t),a.series=[{data:r.slice(0,i)}],a.categories=t.categories.slice(0,i)),a},r.prototype.calculateAxesProperties=function(e){var i=this;this.currentViewport=e.viewport,this.margin=e.margin;var a=this.clippedData=this.data,o=a.categories.length,n=this.getPreferredPlotArea(!1,o,t.CartesianChart.MinOrdinalRectThickness),s=t.CartesianChart.getLayout(null,{availableWidth:n.width,categoryCount:o,domain:null,isScalar:!1,isScrollable:this.isScrollable,trimOrdinalDataOnOverflow:e.trimOrdinalDataOnOverflow});this.isScrollable||(a=this.clippedData=r.createClippedDataIfOverflowed(a,s.categoryCount));var l=r.getXAxisCreationOptions(a,n.width,s,e),c=r.getYAxisCreationOptions(a,n.height,e),u=this.xAxisProperties=t.AxisHelper.createAxis(l),h=this.yAxisProperties=t.AxisHelper.createAxis(c),d=this.xAxisProperties.categoryThickness*(1-t.CartesianChart.InnerPaddingRatio),p=t.dataLabelUtils.createColumnFormatterCacheManager(),g=a.dataLabelsSettings,m=r.getDisplayUnitValueFromAxisFormatter(h,g);return this.layout={categoryCount:s.categoryCount,categoryThickness:s.categoryThickness,isScalar:s.isScalar,outerPaddingRatio:s.outerPaddingRatio,categoryWidth:d,labelText:function(e){var i=p.getOrCreate(e.labelFormatString,g,m);return t.dataLabelUtils.getLabelFormattedText({label:i.format(e.value)})},labelLayout:t.dataLabelUtils.getLabelLayoutXYForWaterfall(u,d,h,c.dataDomain),filter:function(e){return t.dataLabelUtils.doesDataLabelFitInShape(e,h,i.layout)},style:{fill:function(e){return e.isLabelInside?t.dataLabelUtils.defaultInsideLabelColor:e.labelFill}}},this.xAxisProperties.axisLabel=e.showCategoryAxisLabel?a.axesLabels.x:null,this.yAxisProperties.axisLabel=e.showValueAxisLabel?a.axesLabels.y:null,[u,h]},r.getDisplayUnitValueFromAxisFormatter=function(e,t){return e.formatter&&e.formatter.displayUnit&&0===t.displayUnits?e.formatter.displayUnit.value:null},r.lookupXValue=function(e,i,a){var r=e.series[0].data;return i===r.length-1?r[i].categoryValue:t.CartesianHelper.lookupXValue(e,i,a,!1)},r.getXAxisCreationOptions=function(e,i,a,o){var n=t.AxisHelper.getCategoryValueType(e.categoryMetadata),s=t.AxisHelper.createDomain(e.series,n,!1,o.forcedXDomain,o.ensureXDomain),l=a.categoryThickness,c=l*a.outerPaddingRatio;return{pixelSpan:i,dataDomain:s,metaDataColumn:e.categoryMetadata,formatString:t.valueFormatter.getFormatString(e.categoryMetadata,r.formatStringProp),isScalar:!1,outerPadding:c,categoryThickness:l,getValueFn:function(t,i){return r.lookupXValue(e,t,i)},forcedTickCount:o.forcedTickCount,isCategoryAxis:!0,axisDisplayUnits:o.categoryAxisDisplayUnits,axisPrecision:o.categoryAxisPrecision}},r.getYAxisCreationOptions=function(e,i,a){var o=t.AxisHelper.combineDomain(a.forcedYDomain,[e.positionMin,e.positionMax],a.ensureYDomain);return{pixelSpan:i,dataDomain:o,isScalar:!0,isVertical:!0,metaDataColumn:e.valuesMetadata,formatString:t.valueFormatter.getFormatString(e.valuesMetadata,r.formatStringProp),outerPadding:0,forcedTickCount:a.forcedTickCount,useTickIntervalForDisplayUnits:!0,isCategoryAxis:!1,axisDisplayUnits:a.valueAxisDisplayUnits,axisPrecision:a.valueAxisPrecision}},r.prototype.getPreferredPlotArea=function(e,i,a){return t.CartesianChart.getPreferredPlotArea(i,a,this.currentViewport,this.isScrollable,e,this.margin)},r.prototype.getVisualCategoryAxisIsScalar=function(){return!1},r.prototype.overrideXScale=function(e){this.xAxisProperties=e},r.prototype.setFilteredData=function(t,i){var a=this.clippedData=e.Prototype.inherit(this.data);return a.series=[{data:a.series[0].data.slice(t,i)}],a.categories=a.categories.slice(t,i),a},r.prototype.createRects=function(e){var t=this.mainGraphicsContext,i=t.selectAll(r.CategoryValueClasses.selector),a=i.data(e,function(e){return e.key});return a.enter().append("rect").attr("class",function(e){return r.CategoryValueClasses["class"].concat(e.highlight?"highlight":"")}),a.exit().remove(),a},r.prototype.createConnectors=function(e){var t=this.mainGraphicsContext,i=t.selectAll(r.WaterfallConnectorClasses.selector),a=i.data(e.slice(0,e.length-1),function(e){return e.key});return a.enter().append("line").classed(r.WaterfallConnectorClasses["class"],!0),a.exit().remove(),a},r.prototype.render=function(e){var i=this,a=this.clippedData.series[0].data,o=this.createRects(a),n=this.createConnectors(a);this.tooltipsEnabled&&t.TooltipManager.addTooltip(o,function(e){return e.data.tooltipInfo});var s=this.interactivityService&&this.interactivityService.hasSelection(),l=this.xAxisProperties.scale,c=this.yAxisProperties.scale,u=c(0);this.mainGraphicsSVG.attr("height",this.getAvailableHeight()).attr("width",this.getAvailableWidth()),o.style("fill",function(e){return e.color}).style("fill-opacity",function(e){return e.isTotal?t.ColumnUtil.DefaultOpacity:t.ColumnUtil.getFillOpacity(e.selected,e.highlight,s,i.data.hasHighlights)}).attr("width",this.layout.categoryWidth).attr("x",function(e){
30return l(e.categoryIndex)}).attr("y",function(e){return r.getRectTop(c,e.position,e.value)}).attr("height",function(e){return u-c(Math.abs(e.value))}),n.attr({x1:function(e){return l(e.categoryIndex)},y1:function(e){return c(e.position+e.value)},x2:function(e){return l(e.categoryIndex+1)+i.layout.categoryWidth},y2:function(e){return c(e.position+e.value)}});var h=this.data.dataLabelsSettings,d=[];(h&&h.show||h.showCategory)&&(d=this.createLabelDataPoints());var p=void 0;return this.interactivityService&&(p={bars:o,datapoints:a}),t.SVGUtil.flushAllD3TransitionsIfNeeded(this.options),{dataPoints:a,behaviorOptions:p,labelDataPoints:d,labelsAreNumeric:!0}},r.prototype.onClearSelection=function(){this.interactivityService&&this.interactivityService.clearSelection()},r.prototype.getSupportedCategoryAxisType=function(){return t.axisType.categorical},r.getRectTop=function(e,t,i){return 0>i?e(t):e(t)-(e(0)-e(i))},r.prototype.getAvailableWidth=function(){return this.currentViewport.width-(this.margin.left+this.margin.right)},r.prototype.getAvailableHeight=function(){return this.currentViewport.height-(this.margin.top+this.margin.bottom)},r.prototype.getSentimentColorsFromObjects=function(i){var a=this.colors.getSentimentColors(),o=e.DataViewObjects.getFillColor(i,t.waterfallChartProps.sentimentColors.increaseFill,a[2].value),n=e.DataViewObjects.getFillColor(i,t.waterfallChartProps.sentimentColors.decreaseFill,a[0].value),s=e.DataViewObjects.getFillColor(i,t.waterfallChartProps.sentimentColors.totalFill,r.defaultTotalColor);return{increaseFill:{solid:{color:o}},decreaseFill:{solid:{color:n}},totalFill:{solid:{color:s}}}},r.prototype.createLabelDataPoints=function(){for(var a=[],o=this.data,n=this.xAxisProperties.scale,s=this.yAxisProperties.scale,l=s(0),c=o.series,u=t.NewDataLabelUtils.createColumnFormatterCacheManager(),h=t.NewDataLabelUtils.getDisplayUnitValueFromAxisFormatter(this.yAxisProperties.formatter,o.dataLabelsSettings),d=this.data.dataLabelsSettings,p=0,g=c;p<g.length;p++)for(var m=g[p],f=0,y=m.data;f<y.length;f++){var v=y[f],b={left:n(v.categoryIndex),top:r.getRectTop(s,v.position,v.value),width:this.layout.categoryWidth,height:l-s(Math.abs(v.value))},C=v.labelFormatString,S=u.getOrCreate(C,this.data.dataLabelsSettings,h),x=t.NewDataLabelUtils.getLabelFormattedText(S.format(v.value)),w={text:x,fontFamily:t.NewDataLabelUtils.LabelTextProperties.fontFamily,fontSize:i.fromPoint(d.fontSize||t.NewDataLabelUtils.DefaultLabelFontSizeInPt),fontWeight:t.NewDataLabelUtils.LabelTextProperties.fontWeight},P=e.TextMeasurementService.measureSvgTextWidth(w),D=e.TextMeasurementService.estimateSvgTextHeight(w,!0);a.push({isPreferred:!0,text:x,textSize:{width:P,height:D},outsideFill:d.labelColor?d.labelColor:t.NewDataLabelUtils.defaultLabelColor,insideFill:t.NewDataLabelUtils.defaultInsideLabelColor,parentType:1,parentShape:{rect:b,orientation:v.value>=0?1:2,validPositions:0===v.value?r.validZeroLabelPosition:r.validLabelPositions},fontSize:d.fontSize,identity:void 0})}return a},r.formatStringProp={objectName:"general",propertyName:"formatString"},r.WaterfallClassName="waterfallChart",r.MainGraphicsContextClassName="mainGraphicsContext",r.IncreaseLabel="Waterfall_IncreaseLabel",r.DecreaseLabel="Waterfall_DecreaseLabel",r.TotalLabel="Waterfall_TotalLabel",r.CategoryValueClasses=a("column"),r.WaterfallConnectorClasses=a("waterfall-connector"),r.defaultTotalColor="#00b8aa",r.validLabelPositions=[16,4],r.validZeroLabelPosition=[16,8],r}();t.WaterfallChart=r}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=e.visuals.controls.TouchUtils,a=jsCommon.CssConstants.createClassAndSelector,r=a("tooltip-container"),o=a("tooltip-content-container"),n=a("arrow"),s=a("tooltip-header"),l=a("tooltip-row"),c=a("tooltip-color-cell"),u=a("tooltip-title-cell"),h=a("tooltip-value-cell"),d=function(){function e(t){this.tooltipOptions=t,this.isTooltipVisible=!1,t||(this.tooltipOptions=e.DefaultTooltipOptions)}return e.prototype.isTooltipComponentVisible=function(){return this.isTooltipVisible},e.prototype.setTestScreenSize=function(e,t){this.customScreenWidth=e,this.customScreenHeight=t},e.prototype.show=function(e,t){this.isTooltipVisible=!0,this.tooltipContainer||(this.tooltipContainer=this.createTooltipContainer()),this.setTooltipContent(e),this.tooltipContainer.style("visibility","visible").transition().duration(0).style("opacity",this.tooltipOptions.opacity),this.setPosition(t)},e.prototype.move=function(e,t){this.isTooltipVisible&&(e&&this.setTooltipContent(e),this.setPosition(t))},e.prototype.hide=function(){this.isTooltipVisible&&(this.isTooltipVisible=!1,this.tooltipContainer.transition().duration(this.tooltipOptions.animationDuration).style("opacity",0).each("end",function(){this.style.visibility="hidden"}))},e.prototype.createTooltipContainer=function(){var t=d3.select(e.parentContainerSelector).append("div").attr("class",r["class"]);return t.append("div").attr("class",n["class"]),t.append("div").attr("class",o["class"]),t},e.prototype.setTooltipContent=function(e){if(!_.isEqual(e,this.currentTooltipData)){this.currentTooltipData=e;var t=l.selector,i=this.tooltipContainer.select(o.selector);if(i.selectAll(s.selector).remove(),i.selectAll(l.selector).remove(),0!==e.length){e[0].header&&i.append("div").attr("class",s["class"]).text(e[0].header);var a=i.selectAll(t).data(e),r=a.enter().append("div").attr("class",l["class"]);if(e[0].color){var n=r.append("div").attr("class",c["class"]);n.append("svg").attr({width:"100%",height:"15px"}).append("circle").attr({cx:"5",cy:"8",r:"5"}).style({fill:function(e){return e.color}})}var d=r.append("div").attr("class",u["class"]),p=r.append("div").attr("class",h["class"]);d.text(function(e){return e.displayName}),p.text(function(e){return e.value})}}},e.prototype.getTooltipPosition=function(e,t){var a=this.tooltipContainer.node().getBoundingClientRect(),r=Math.floor(e.width/2),o=0,n=0,s=new i.Point(e.x+r,e.y+r),l=7;return 0===t?(o+=3*l+r,n-=2*l+r):1===t?(o-=2*l+a.width+r,n-=2*l+r):3===t?(o+=3*l+r,n-=a.height-2*l+r):2===t&&(o-=2*l+a.width+r,n-=a.height-2*l+r),s.offset(o,n),s},e.prototype.setPosition=function(e){var t=this.getClickedScreenArea(e),i=this.getTooltipPosition(e,t);this.tooltipContainer.style({left:i.x+"px",top:i.y+"px"}),this.setArrowPosition(e,t)},e.prototype.setArrowPosition=function(e,t){var i,a=this.getArrowElement();0===t?i="top left":1===t?i="top right":3===t?i="bottom left":2===t&&(i="bottom right"),a.attr("class","arrow").classed(i,!0)},e.prototype.getArrowElement=function(){return this.tooltipContainer.select(n.selector)},e.prototype.getClickedScreenArea=function(e){var t=this.customScreenWidth||window.innerWidth,a=this.customScreenHeight||window.innerHeight,r=e.width/2,o=new i.Point(e.x+r,e.y+r),n=t/2,s=a/2;return o.x<n&&o.y<s?0:o.x>=n&&o.y<s?1:o.x<n&&o.y>=s?3:o.x>=n&&o.y>=s?2:void 0},e.DefaultTooltipOptions={opacity:1,animationDuration:250,offsetX:10,offsetY:10},e.parentContainerSelector="body",e.highlightedValueDisplayNameResorceKey="Tooltip_HighlightedValueDisplayName",e}();t.ToolTipComponent=d;var p;!function(e){function t(t,i,o,n){if(e.ShowTooltips){var f=d3.select(d.parentContainerSelector).node();t.on("mouseover",function(){var t=d3.event.target,r=d3.select(t).datum();if(!D&&u(d3.event)){v=g(f,!0);var o=g(t,!0),n={data:r,coordinates:v,elementCoordinates:o,context:t,isTouchEvent:!1};c();var s=e.ToolTipInstance.isTooltipComponentVisible()?16:S;y=a(n,i,s)}}),t.on("mouseout",function(){D||(c(),y=r(x)),n&&n()}),t.on("mousemove",function(){var e=d3.event.target,t=d3.select(e).datum();if(!D&&u(d3.event)){v=g(f,!0);var a=g(e,!0),r={data:t,coordinates:v,elementCoordinates:a,context:e,isTouchEvent:!1};s(r,i,o)}});var b=h(),L=p(),T="pointerdown"===b||"MSPointerDown"===b;C||(m(b),C=!0),t.on(b,function(){var e=d3.event.target,t=d3.select(e).datum();l();var r=g(f,T),o=g(e,T),n={data:t,coordinates:r,elementCoordinates:o,context:e,isTouchEvent:!0};c(),y=a(n,i,w)}),t.on(L,function(){c(),D&&clearTimeout(D),D=setTimeout(function(){D=0},P)})}}function a(e,t,i){return setTimeout(function(){return n(e,t)},i)}function r(e){return setTimeout(function(){return l()},e)}function o(e){d.localizationOptions=e}function n(t,i){var a=b||i(t);if(!_.isEmpty(a)){var r=v||t.coordinates,o=f(r[0],r[1],t.isTouchEvent);e.ToolTipInstance.show(a,o)}}function s(t,i,a){b=void 0,a&&(b=i(t));var r=f(t.coordinates[0],t.coordinates[1],t.isTouchEvent);e.ToolTipInstance.move(b,r)}function l(){e.ToolTipInstance.hide()}function c(){y&&clearTimeout(y)}function u(e){var t=!0,i=e;if(void 0!==i.buttons){var a=0!==i.buttons;t=!a}return t}function h(){var e="touchstart";return window.PointerEvent?e="pointerdown":window.MSPointerEvent&&(e="MSPointerDown"),e}function p(){var e="touchend";return window.PointerEvent?e="pointerup":window.MSPointerEvent&&(e="MSPointerUp"),e}function g(e,t){var i;if(t){for(var a=d3.event,r=void 0;r=a.sourceEvent;)a=r;var o=e.getBoundingClientRect();i=[a.clientX-o.left-e.clientLeft,a.clientY-o.top-e.clientTop]}else{var n=d3.touches(e);n&&n.length>0&&(i=n[0])}return i}function m(t){d3.select(d.parentContainerSelector).on(t,function(t,i){e.ToolTipInstance.hide()})}function f(e,t,a){var r=0,o=e,n=t;if(a){r=12;var s=r/2;o=Math.max(e-s,0),n=Math.max(t-s,0)}return new i.Rectangle(o,n,r,r)}e.ShowTooltips=!0,e.ToolTipInstance=new d;var y,v,b,C=!1,S=350,x=500,w=350,P=1e3,D=0;e.addTooltip=t,e.showDelayedTooltip=a,e.hideDelayedTooltip=r,e.setLocalizedStrings=o}(p=t.TooltipManager||(t.TooltipManager={}));var g;!function(e){function i(e,t,i,o,n,s,l,c,u,h){var d,p=[],g=void 0;l=0|l;var m=t?t.categories:n;if(m&&m.length>0)if(m.length>1){for(var f=[],y=0,v=m.length;v>y;y++)f.push(m[y].source);d={value:i,metadata:f}}else d={value:i,metadata:[m[0].source]};if(t&&t.values){if(d&&d.metadata[0]===t.values.source||(g=t.values.source),t.values.length>0){var b=t.values[l],C=!!(b&&b.source&&b.source.isAutoGeneratedColumn);C||p.push({value:o,highlightedValue:u,metadata:b})}var S=a(h,c);null!=S&&p.push(S)}if(s)for(var y=0,x=s.length;x>y;y++){var w=s[y];d&&d.metadata[0]===w.metadata.source||p.push({value:w.value,metadata:w.metadata})}var P=r(e,d,g,p);return P}function a(e,t){return e?{value:e.values[t],metadata:{source:e.source,values:[]}}:null}function r(e,t,i,a){var r=[];if(t)if(t.metadata.length>1){for(var n="",s=0,l=t.metadata.length;l>s;s++)0!==s&&(n+="/"),n+=t.metadata[s].displayName;var c=o(t.metadata[0],e,t.value);r.push({displayName:n,value:c})}else{var c=o(t.metadata[0],e,t.value);r.push({displayName:t.metadata[0].displayName,value:c})}if(i){var u=void 0;if(a.length>0){var h=a[0].metadata.source;u=o(i,e,h.groupName)}r.push({displayName:i.displayName,value:u})}for(var s=0;s<a.length;s++){var p=a[s];if(p&&p.metadata){var g=p.metadata.source,m=p.value,f=p.highlightedValue;if(m||0===m){var y=o(g,e,m);r.push({displayName:g.displayName,value:y})}if(f||0===f){var v=o(g,e,f),n=d.localizationOptions.highlightedValueDisplayName;r.push({displayName:n,value:v})}}}return r}function o(e,i,a){var r=n(e,i);return t.valueFormatter.format(a,r)}function n(e,i){if(e){var a=t.valueFormatter.getFormatString(e,i,!0);return a||e.format}return null}e.createTooltipInfo=i,e.createGradientToolTipData=a}(g=t.TooltipBuilder||(t.TooltipBuilder={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(t){function i(t){return void 0===t&&(t=new e.DataColorPalette),{titleText:{color:{value:"rgba(51,51,51,1)"}},subTitleText:{color:{value:"rgba(145,145,145,1)"}},colorPalette:{dataColors:t},labelText:{color:{value:"rgba(51,51,51,1)"},fontSize:"11px"},isHighContrast:!1}}t.create=i}(t=e.visualStyles||(e.visualStyles={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(t){var i=jsCommon.CssConstants.createClassAndSelector,a=function(){function a(e){e&&(this.sliceWidthRatio=e.sliceWidthRatio,this.animator=e.animator,this.isScrollable=e.isScrollable?e.isScrollable:!1,this.disableGeometricCulling=e.disableGeometricCulling?e.disableGeometricCulling:!1,this.behavior=e.behavior,this.tooltipsEnabled=e.tooltipsEnabled,e.smallViewPortProperties&&(this.maxHeightToScaleDonutLegend=e.smallViewPortProperties.maxHeightToScaleDonutLegend)),null==this.sliceWidthRatio&&(this.sliceWidthRatio=a.defaultSliceWidthRatio)}return a.converter=function(e,t,i,o,n,s,l){void 0===l&&(l=!0);var c=new r.DonutChartConverter(e,t,i,l);c.convert();var u=d3.layout.pie().sort(null).value(function(e){return e.percentage});s&&(s.applySelectionStateToData(c.dataPoints),s.applySelectionStateToData(c.legendData.dataPoints));var h=!n&&o?a.cullDataByViewport(c.dataPoints,c.maxValue,o):c.dataPoints;return{dataPointsToDeprecate:h,dataPoints:u(h),unCulledDataPoints:c.dataPoints,dataPointsToEnumerate:c.legendData.dataPoints,legendData:c.legendData,hasHighlights:c.hasHighlights,dataLabelsSettings:c.dataLabelsSettings,legendObjectProperties:c.legendObjectProperties,maxValue:c.maxValue,visibleGeometryCulled:c.dataPoints.length!==h.length}},a.prototype.init=function(e){this.options=e;var i=e.element;i.empty(),this.parentViewport=e.viewport,this.currentViewport={height:e.viewport.height,width:e.viewport.width},this.formatter=t.valueFormatter.format,this.data={dataPointsToDeprecate:[],dataPointsToEnumerate:[],dataPoints:[],unCulledDataPoints:[],legendData:{title:"",dataPoints:[],fontSize:t.SVGLegend.DefaultFontSizeInPt},hasHighlights:!1,dataLabelsSettings:t.dataLabelUtils.getDefaultDonutLabelSettings()},this.drilled=!1,this.allowDrilldown=!1,this.style=e.style,this.colors=this.style.colorPalette.dataColors,this.radius=0,this.isInteractive=e.interactivity&&e.interactivity.isInteractiveLegend;var r=this.settings;if(this.behavior&&(this.interactivityService=t.createInteractivityService(e.host)),this.legend=t.createLegend(i,e.interactivity&&e.interactivity.isInteractiveLegend,this.interactivityService,this.isScrollable),this.hostService=e.host,this.isInteractive){this.chartRotationAnimationDuration=r&&r.chartRotationAnimationDuration?r.chartRotationAnimationDuration:0;var n=this.legendContainer=d3.select(i.get(0)).append("div").classed(a.InteractiveLegendClassName,!0);this.interactivityState={interactiveLegend:new o(this,n,this.colors,e,this.settings),valueToAngleFactor:0,sliceAngles:[],currentRotate:0,interactiveChosenSliceFinishedSetting:!1,lastChosenInteractiveSliceIndex:0,totalDragAngleDifference:0,currentIndexDrag:0,previousIndexDrag:0,previousDragAngle:0,donutCenter:{x:0,y:0}}}this.svg=d3.select(i.get(0)).append("svg").style("position","absolute").classed(a.ClassName,!0),this.behavior&&(this.clearCatcher=t.appendClearCatcher(this.svg)),this.mainGraphicsContext=this.svg.append("g"),this.mainGraphicsContext.append("g").classed("slices",!0),this.labelGraphicsContext=this.svg.append("g").classed(t.NewDataLabelUtils.labelGraphicsContextClass["class"],!0),this.pie=d3.layout.pie().sort(null).value(function(e){return e.percentage})},a.prototype.update=function(i){var r=i.viewport;this.parentViewport=r;var o=this.dataViews=i.dataViews;if(o&&o.length>0&&o[0].categorical){var n=o[0].metadata,s=void 0;if(n){var l=n.objects;l&&(s=e.DataViewObjects.getFillColor(l,t.donutChartProps.dataPoint.defaultColor))}this.data=a.converter(o[0],this.colors,s,this.currentViewport,this.disableGeometricCulling,this.interactivityService,this.tooltipsEnabled),this.data.defaultDataPointColor=s,this.options.interactivity&&this.options.interactivity.isInteractiveLegend||this.renderLegend()}else this.data={dataPointsToDeprecate:[],dataPointsToEnumerate:[],dataPoints:[],unCulledDataPoints:[],legendData:{title:"",dataPoints:[]},hasHighlights:!1,dataLabelsSettings:t.dataLabelUtils.getDefaultDonutLabelSettings()};if(this.initViewportDependantProperties(),this.initDonutProperties(),this.updateInternal(this.data,i.suppressAnimations),this.hasSetData=!0,o){var c=t.getInvalidValueWarnings(o,!1,!1,!1);this.hostService.setWarnings(c)}},a.prototype.onDataChanged=function(e){this.update({dataViews:e.dataViews,suppressAnimations:e.suppressAnimations,viewport:this.currentViewport})},a.prototype.onResizing=function(e){this.update({dataViews:this.dataViews,suppressAnimations:!0,viewport:e})},a.prototype.enumerateObjectInstances=function(e){var i=new t.ObjectEnumerationBuilder,a=this.data&&this.data.dataLabelsSettings?this.data.dataLabelsSettings:t.dataLabelUtils.getDefaultDonutLabelSettings();switch(e.objectName){case"legend":this.enumerateLegend(i);break;case"dataPoint":this.enumerateDataPoints(i);break;case"labels":var r={enumeration:i,dataLabelsSettings:a,show:!0,displayUnits:!0,precision:!0,fontSize:!0,labelStyle:!0};t.dataLabelUtils.enumerateDataLabels(r)}return i.complete()},a.prototype.enumerateDataPoints=function(e){var i=this.data;if(i)for(var a=i.dataPointsToEnumerate,r=a.length,o=0;r>o;o++){var n=a[o];e.pushInstance({objectName:"dataPoint",displayName:n.label,selector:t.ColorHelper.normalizeSelector(n.identity.getSelector()),properties:{fill:{solid:{color:n.color}}}})}},a.prototype.enumerateLegend=function(i){var a=this.data;if(a){var r={legend:a.legendObjectProperties},o=e.DataViewObjects.getValue(r,t.donutChartProps.legend.show,this.legend.isVisible()),n=e.DataViewObjects.getValue(r,t.donutChartProps.legend.showTitle,!0),s=e.DataViewObjects.getValue(r,t.donutChartProps.legend.titleText,this.data.legendData.title),l=e.DataViewObject.getValue(r,t.legendProps.labelColor,this.data.legendData.labelColor),c=e.DataViewObject.getValue(r,t.legendProps.fontSize,this.data.legendData.fontSize);i.pushInstance({selector:null,objectName:"legend",properties:{show:o,position:t.LegendPosition[this.legend.getOrientation()],showTitle:n,titleText:s,labelColor:l,fontSize:c}})}},a.prototype.setInteractiveChosenSlice=function(e){var i=this;if(0!==this.interactivityState.sliceAngles.length){this.interactivityState.lastChosenInteractiveSliceIndex=e,this.interactivityState.interactiveChosenSliceFinishedSetting=!1;var a=this.currentViewport,r=e%this.data.dataPoints.length,o=this.interactivityState.sliceAngles[r];this.svg.select("g").transition().duration(this.chartRotationAnimationDuration).ease("elastic").attr("transform",t.SVGUtil.translateAndRotate(a.width/2,a.height/2,0,0,o)).each("end",function(){i.interactivityState.interactiveChosenSliceFinishedSetting=!0}),this.interactivityState.currentRotate=o,this.interactivityState.interactiveLegend.updateLegend(r),this.svg.selectAll(".slice").attr("opacity",function(e,t){return t===r?1:.6}),t.SVGUtil.flushAllD3TransitionsIfNeeded(this.options)}},a.prototype.calculateRadius=function(){var e=this.currentViewport;if(!this.isInteractive&&this.data&&this.data.dataLabelsSettings.show){var t=e.height/e.width,i=2+1/(1+Math.exp(-5*(t-1)));return Math.min(e.height,e.width)/i}return Math.min(e.height,e.width)/2},a.prototype.getScaleForLegendArrow=function(){var e=1;return this.maxHeightToScaleDonutLegend&&this.currentViewport.height<this.maxHeightToScaleDonutLegend&&(e=this.currentViewport.height/this.maxHeightToScaleDonutLegend),e},a.prototype.initViewportDependantProperties=function(e){void 0===e&&(e=0),this.currentViewport.height=this.parentViewport.height,this.currentViewport.width=this.parentViewport.width;var i=this.currentViewport;if(this.isInteractive)i.height-=a.InteractiveLegendContainerHeight;else{var r=this.legend.getMargins();i.height-=r.height,i.width-=r.width}this.svg.attr({width:i.width,height:i.height}),this.isInteractive?(this.legendContainer.style({width:"100%",height:a.InteractiveLegendContainerHeight+"px",overflow:"hidden",top:0}),this.svg.style("top",a.InteractiveLegendContainerHeight)):t.Legend.positionChartArea(this.svg,this.legend),this.previousRadius=this.radius;var o=this.radius=this.calculateRadius(),n=i.width/2,s=i.height/2;this.arc=d3.svg.arc(),this.outerArc=d3.svg.arc().innerRadius(o*a.OuterArcRadiusRatio).outerRadius(o*a.OuterArcRadiusRatio),this.isInteractive?(this.mainGraphicsContext.attr("transform",t.SVGUtil.translate(n,s)),this.labelGraphicsContext.attr("transform",t.SVGUtil.translate(n,s))):(this.mainGraphicsContext.transition().duration(e).attr("transform",t.SVGUtil.translate(n,s)),this.labelGraphicsContext.transition().duration(e).attr("transform",t.SVGUtil.translate(n,s))),t.SVGUtil.flushAllD3TransitionsIfNeeded(this.options)},a.prototype.initDonutProperties=function(){this.donutProperties={viewport:this.currentViewport,radius:this.radius,arc:this.arc.innerRadius(0).outerRadius(this.radius*a.InnerArcRadiusRatio),outerArc:this.outerArc,innerArcRadiusRatio:a.InnerArcRadiusRatio,outerArcRadiusRatio:a.OuterArcRadiusRatio,dataLabelsSettings:this.data.dataLabelsSettings}},a.prototype.mergeDatasets=function(t,i){var a=d3.set();i.forEach(function(e){a.add(e.identity?e.identity.getKey():e.data.identity.getKey())});var r=t.filter(function(e){return!a.has(e.identity?e.identity.getKey():e.data.identity.getKey())}).map(function(t){var i=e.Prototype.inherit(t);return void 0===i.percentage?i.data.percentage=0:i.percentage=0,i});return d3.merge([i,r])},a.prototype.updateInternal=function(e,i,r){void 0===r&&(r=0);var o=this.currentViewport;if(r=r||t.AnimatorCommon.GetAnimationDuration(this.animator,i),this.animator){var n,s=a.getLayout(this.radius,this.sliceWidthRatio,o),l=void 0,c=void 0,u=e.dataLabelsSettings,h=[];if(u&&u.show&&(h=this.createLabels()),!i){var d={viewModel:e,colors:this.colors,graphicsContext:this.mainGraphicsContext,labelGraphicsContext:this.labelGraphicsContext,interactivityService:this.interactivityService,layout:s,radius:this.radius,sliceWidthRatio:this.sliceWidthRatio,viewport:o,labels:h,innerArcRadiusRatio:a.InnerArcRadiusRatio};l=this.animator.animate(d),n=l.shapes,c=l.highlightShapes}(i||l.failed)&&(n=a.drawDefaultShapes(this.svg,e,s,this.colors,this.radius,this.interactivityService&&this.interactivityService.hasSelection(),this.sliceWidthRatio,this.data.defaultDataPointColor),c=a.drawDefaultHighlightShapes(this.svg,e,s,this.colors,this.radius,this.sliceWidthRatio),t.NewDataLabelUtils.drawDefaultLabels(this.labelGraphicsContext,h,!1,!0,!0),t.NewDataLabelUtils.drawLabelLeaderLines(this.labelGraphicsContext,h)),this.assignInteractions(n,c,e),this.tooltipsEnabled&&(t.TooltipManager.addTooltip(n,function(e){return e.data.data.tooltipInfo}),t.TooltipManager.addTooltip(c,function(e){return e.data.data.tooltipInfo}))}else this.updateInternalToMove(e,r);t.SVGUtil.flushAllD3TransitionsIfNeeded(this.options)},a.prototype.createLabels=function(){var i=new e.DonutLabelLayout({maximumOffset:t.NewDataLabelUtils.maxLabelOffset,startingOffset:t.NewDataLabelUtils.startingLabelOffset},this.donutProperties),a=this.createLabelDataPoints();return i.layout(a)},a.prototype.createLabelDataPoints=function(){var e=this.data,i=[],a=t.dataLabelUtils.createColumnFormatterCacheManager(),r=null;0===e.dataLabelsSettings.displayUnits&&(r=d3.max(e.dataPoints,function(e){return Math.abs(e.data.measure)}));for(var o=0;o<this.data.dataPoints.length;o++){var n=this.createLabelDataPoint(e.dataPoints[o],r,a);i.push(n)}return i},a.prototype.createLabelDataPoint=function(e,i,a){var r,o,n,s,l,c=this.outerArc.centroid(e),u=t.DonutLabelUtils.getXPositionForDonutLabel(c[0]),h=c[1],d=this.data.dataLabelsSettings,p=a.getOrCreate(e.data.labelFormatString,d,i),g=0>u?4:8,m={point:{x:u,y:h},validPositions:[g],radius:0},f=d.labelColor?d.labelColor:t.NewDataLabelUtils.defaultLabelColor,y=d.labelStyle,v=d.fontSize,b="";switch(y!==t.labelStyle.both&&y!==t.labelStyle.data||(r=p.format(null!=e.data.highlightValue?e.data.highlightValue:e.data.measure),o=t.NewDataLabelUtils.getTextSize(r,v)),y!==t.labelStyle.both&&y!==t.labelStyle.category||(n=e.data.label,s=t.NewDataLabelUtils.getTextSize(n,v)),y){case t.labelStyle.both:var C=n+" ("+r+")";b=C,l=t.NewDataLabelUtils.getTextSize(C,v);break;case t.labelStyle.category:l=_.clone(s),b=n;break;case t.labelStyle.data:l=_.clone(o),b=r}var S=t.DonutLabelUtils.getLabelLeaderLineForDonutChart(e,this.donutProperties,m.point),x=t.DonutLabelUtils.getLabelLeaderLinesSizeForDonutChart(S);return{isPreferred:!0,text:"",tooltip:b,textSize:l,outsideFill:f,fontSize:v,identity:e.data.identity,parentShape:m,insideFill:t.NewDataLabelUtils.defaultInsideLabelColor,parentType:0,alternativeScale:i,donutArcDescriptor:e,angle:(e.startAngle+e.endAngle)/2-Math.PI/2,dataLabel:r,dataLabelSize:o,categoryLabel:n,categoryLabelSize:s,leaderLinePoints:S,linesSize:x}},a.prototype.renderLegend=function(){if(!this.isInteractive){var e=this.data.legendObjectProperties;if(e){var i=this.data.legendData;t.LegendData.update(i,e);var a=e[t.legendProps.position];a&&this.legend.changeOrientation(t.LegendPosition[a]),this.legend.drawLegend(i,this.parentViewport)}else this.legend.changeOrientation(t.LegendPosition.Top),this.legend.drawLegend({dataPoints:[]},this.parentViewport)}},a.prototype.addInteractiveLegendArrow=function(){if(this.data&&this.data.dataPoints&&0!==this.data.dataPoints.length){var e=11,i=16.5;if(!this.interactiveLegendArrow){var r=this.svg.append("g");r.append("path").classed(a.InteractiveLegendArrowClassName,!0).attr("d","M1.5,2.6C0.65,1.15,1.85,0,3,0l27,0c1.65,0,2.35,1.15,1.5,2.6L18,26.45c-0.8,1.45-2.15,1.45-2.95,0L1.95,2.6z"),this.interactiveLegendArrow=r}var o=this.currentViewport,n=this.getScaleForLegendArrow(),s=(o.height-2*this.radius)/2+e*n,l=o.width/2-i*n;this.interactiveLegendArrow.attr("transform",t.SVGUtil.translateAndScale(l,s,n))}},a.prototype.calculateSliceAngles=function(){var e=[],t=this.data.dataPoints;if(0===t.length)return this.interactivityState.valueToAngleFactor=0,void(this.interactivityState.sliceAngles=[]);for(var i=0,a=0,r=t.length;r>a;a++)i+=t[a].data.percentage;this.interactivityState.valueToAngleFactor=360/i;for(var o=0,a=0,r=t.length;r>a;a++){var n=t[a].data.percentage*this.interactivityState.valueToAngleFactor;o+=n,e.push(n/2-o)}this.interactivityState.sliceAngles=e},a.prototype.assignInteractions=function(e,t,i){if(this.isInteractive)this.assignInteractiveChartInteractions(e);else if(this.interactivityService){var a=i.dataPoints.map(function(e){return e.data}),r={clearCatcher:this.clearCatcher,slices:e,highlightSlices:t,allowDrilldown:this.allowDrilldown,visual:this,hasHighlights:i.hasHighlights,svg:this.svg};this.interactivityService.bind(a,this.behavior,r)}},a.prototype.setDrilldown=function(e){if(e){var i=d3.layout.pie().sort(null).value(function(e){return e.percentage}),r=[{label:e.label,color:e.color,icon:t.LegendIcon.Box,identity:e.identity,selected:e.selected}],o={title:"",dataPoints:r},n=i(e.internalDataPoints);this.updateInternal({dataPointsToDeprecate:e.internalDataPoints,dataPoints:n,unCulledDataPoints:n.map(function(e){return e.data}),legendData:o,hasHighlights:!1,dataLabelsSettings:this.data.dataLabelsSettings},!1,a.DrillDownAnimationDuration)}else this.updateInternal(this.data,!1,a.DrillDownAnimationDuration)},a.prototype.assignInteractiveChartInteractions=function(e){var t=this,i=this.svg;this.interactivityState.interactiveChosenSliceFinishedSetting=!0;var a=i.node().getBoundingClientRect();this.interactivityState.donutCenter={x:a.left+a.width/2,y:a.top+a.height/2},this.interactivityState.totalDragAngleDifference=0,this.interactivityState.currentRotate=0,this.calculateSliceAngles(),e.on("click",function(e,i){d3.event.defaultPrevented||t.setInteractiveChosenSlice(i)});var r=d3.behavior.drag().origin(Object).on("dragstart",function(){return t.interactiveDragStart()}).on("drag",function(){return t.interactiveDragMove()}).on("dragend",function(){return t.interactiveDragEnd()});i.style("touch-action","none").call(r)},a.prototype.getAngleFromDragEvent=function(){var e,t,i=this.interactivityState,a=d3.event.sourceEvent;if(-1!==a.type.toLowerCase().indexOf("touch")){if(1!==a.touches.length)return null;var r=a.touches[0];e=r.pageX,t=r.pageY}else e=a.pageX,t=a.pageY;var o={x:e-i.donutCenter.x,y:-t+i.donutCenter.y},n=180*Math.atan2(o.y,o.x)/Math.PI;return n},a.prototype.interactiveDragStart=function(){this.interactivityState.totalDragAngleDifference=0,this.interactivityState.previousDragAngle=this.getAngleFromDragEvent()},a.prototype.interactiveDragMove=function(){var e=this.data.dataPoints,i=this.currentViewport,r=this.interactivityState;if(r.interactiveChosenSliceFinishedSetting===!0){var o=this.getAngleFromDragEvent();if(!o)return;var n=r.previousDragAngle-o;r.totalDragAngleDifference+=n,r.previousDragAngle=o,r.currentRotate+=n,this.svg.select("g").attr("transform",t.SVGUtil.translateAndRotate(i.width/2,i.height/2,0,0,this.interactivityState.currentRotate));var s=e[0].data.percentage*r.valueToAngleFactor,l=r.currentRotate<=0?-1*r.currentRotate%360:360-r.currentRotate%360;r.currentIndexDrag=0;for(var c=e.length;r.currentIndexDrag<c&&l>s;)r.currentIndexDrag<c-1&&(s+=e[r.currentIndexDrag+1].data.percentage*r.valueToAngleFactor),r.currentIndexDrag++;r.currentIndexDrag!==r.previousIndexDrag&&(r.interactiveLegend.updateLegend(r.currentIndexDrag),this.svg.selectAll(".slice").attr("opacity",function(e,t){return t===r.currentIndexDrag?a.OpaqueOpacity:a.SemiTransparentOpacity}),r.previousIndexDrag=r.currentIndexDrag)}},a.prototype.interactiveDragEnd=function(){0!==this.interactivityState.totalDragAngleDifference&&(this.setInteractiveChosenSlice(this.interactivityState.currentIndexDrag),d3.event.sourceEvent.stopPropagation())},a.prototype.updateInternalToMove=function(e,i){void 0===i&&(i=0);var r=this.svg,o=this.pie,n=this.key,s=this.arc,l=this.radius,c=this.previousRadius,u=this.sliceWidthRatio,h=this.svg.select(".slices").selectAll("path"+a.sliceClass.selector).data().map(function(e){return e.data});0===h.length&&(h=e.dataPointsToDeprecate);var d=this.mergeDatasets(h,e.dataPointsToDeprecate),p=r.select(".slices").selectAll("path"+a.sliceClass.selector).data(o(e.dataPointsToDeprecate),n);p.enter().insert("path").classed(a.sliceClass["class"],!0).each(function(e){this._current=e}),p=r.select(".slices").selectAll("path"+a.sliceClass.selector).data(o(d),n);var g=l*u;if(a.isSingleColor(e.dataPoints),p.style("fill",function(e){return e.data.color}).style("fill-opacity",function(i){return t.ColumnUtil.getFillOpacity(i.data.selected,!1,!1,e.hasHighlights)}).style("stroke","white").style("stroke-dasharray",function(e){return a.drawStrokeForDonutChart(l,a.InnerArcRadiusRatio,e,u)}).style("stroke-width",function(e){return e.data.strokeWidth}).transition().duration(i).attrTween("d",function(e){var t=d3.interpolate(this._current,e),i=d3.interpolate(c*a.InnerArcRadiusRatio,l*a.InnerArcRadiusRatio);return this._current=t(0),function(e){return s.innerRadius(g).outerRadius(i(e))(t(e))}}),p=r.select(".slices").selectAll("path"+a.sliceClass.selector).data(o(e.dataPointsToDeprecate),n),p.exit().transition().delay(i).duration(0).remove(),!this.isInteractive){var m=e.dataLabelsSettings,f=[];m&&m.show&&(f=this.createLabels()),t.NewDataLabelUtils.drawDefaultLabels(this.labelGraphicsContext,f,!1,!0),t.NewDataLabelUtils.drawLabelLeaderLines(this.labelGraphicsContext,f)}var y=void 0;e.hasHighlights?(y=r.select(".slices").selectAll("path"+a.sliceHighlightClass.selector).data(o(e.dataPointsToDeprecate),n),y.enter().insert("path").classed(a.sliceHighlightClass["class"],!0).each(function(e){this._current=e}),a.isSingleColor(e.dataPoints),y.style("fill",function(e){return e.data.color}).style("fill-opacity",1).style("stroke","white").style("stroke-dasharray",function(e){return a.drawStrokeForDonutChart(l,a.InnerArcRadiusRatio,e,u,e.data.highlightRatio)}).style("stroke-width",function(e){return 0===e.data.highlightRatio?0:e.data.strokeWidth}).transition().duration(i).attrTween("d",function(e){var t=d3.interpolate(this._current,e),i=d3.interpolate(c*a.InnerArcRadiusRatio,a.getHighlightRadius(l,u,e.data.highlightRatio));return this._current=t(0),function(e){return s.innerRadius(g).outerRadius(i(e))(t(e))}}),y.exit().transition().delay(i).duration(0).remove()):r.selectAll("path"+a.sliceHighlightClass.selector).transition().delay(i).duration(0).remove(),this.assignInteractions(p,y,e),this.tooltipsEnabled&&(t.TooltipManager.addTooltip(p,function(e){return e.data.data.tooltipInfo;
31}),e.hasHighlights&&t.TooltipManager.addTooltip(y,function(e){return e.data.data.tooltipInfo})),t.SVGUtil.flushAllD3TransitionsIfNeeded(this.options),this.isInteractive&&(this.addInteractiveLegendArrow(),this.interactivityState.interactiveLegend.drawLegend(this.data.dataPointsToDeprecate),this.setInteractiveChosenSlice(this.interactivityState.lastChosenInteractiveSliceIndex?this.interactivityState.lastChosenInteractiveSliceIndex:0))},a.drawDefaultShapes=function(e,i,r,o,n,s,l,c){var u=e.select(".slices").selectAll("path"+a.sliceClass.selector).data(i.dataPoints,function(e){return e.data.identity.getKey()});return u.enter().insert("path").classed(a.sliceClass["class"],!0),a.isSingleColor(i.dataPoints),u.style("fill",function(e){return e.data.color}).style("fill-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.data.selected,!1,s,i.hasHighlights)}).style("stroke-dasharray",function(e){return a.drawStrokeForDonutChart(n,a.InnerArcRadiusRatio,e,l)}).style("stroke-width",function(e){return e.data.strokeWidth}).attr(r.shapeLayout),u.exit().remove(),u},a.drawDefaultHighlightShapes=function(e,i,r,o,n,s){var l=e.select(".slices").selectAll("path"+a.sliceHighlightClass.selector).data(i.dataPoints.filter(function(e){return null!=e.data.highlightRatio}),function(e){return e.data.identity.getKey()});return l.enter().insert("path").classed(a.sliceHighlightClass["class"],!0).each(function(e){this._current=e}),a.isSingleColor(i.dataPoints),l.style("fill",function(e){return e.data.color}).style("fill-opacity",function(e){return t.ColumnUtil.getFillOpacity(e.data.selected,!0,!1,i.hasHighlights)}).style("stroke","white").style("stroke-dasharray",function(e){return a.drawStrokeForDonutChart(n,a.InnerArcRadiusRatio,e,s,e.data.highlightRatio)}).style("stroke-width",function(e){return 0===e.data.highlightRatio?0:e.data.strokeWidth}).attr(r.highlightShapeLayout),l.exit().remove(),l},a.isSingleColor=function(e){if(e.length>1){var t=e.length-1;e[t].data.isLastInDonut=e[t].data.color===e[0].data.color}},a.drawStrokeForDonutChart=function(e,t,i,r,o){void 0===o&&(o=1);var n,s,l=e*t*o,c=(i.endAngle-i.startAngle)*l;if(r){var u=e*r,h=o*e*(a.InnerArcRadiusRatio-r),d=(i.endAngle-i.startAngle)*u;if(i.data.highlightRatio&&(c=(i.endAngle-i.startAngle)*(h+u)),i.data.isLastInDonut)return"0 "+c+" "+h+" "+d+" "+h;n=c+h+d,s=h}else i.data.isLastInDonut?(n=c,s=2*l):(n=c+l,s=l);return"0 "+n+" "+s},a.prototype.onClearSelection=function(){this.interactivityService&&this.interactivityService.clearSelection()},a.getLayout=function(e,t,i){var r=e*t,o=d3.svg.arc().innerRadius(r),n=o.outerRadius(e*a.InnerArcRadiusRatio);return{shapeLayout:{d:function(e){return n(e)}},highlightShapeLayout:{d:function(i){var r=o.outerRadius(a.getHighlightRadius(e,t,i.data.highlightRatio));return r(i)}},zeroShapeLayout:{d:function(e){var t=o.outerRadius(r||a.EffectiveZeroValue);return t(e)}}}},a.getHighlightRadius=function(e,t,i){var r=e*t;return r+i*e*(a.InnerArcRadiusRatio-t)},a.cullDataByViewport=function(e,t,i){for(var r,o=Math.min(i.width,i.height)/2,n=this.invisibleArcLengthInPixels/(o*a.twoPi),s=n*t,l=[],c=0,u=e;c<u.length;c++){var h=u[c];h.measure>=s&&(h.strokeWidth=r===h.color?1:0,r=h.color,l.push(h))}return l},a.ClassName="donutChart",a.InteractiveLegendClassName="donutLegend",a.InteractiveLegendArrowClassName="donutLegendArrow",a.DrillDownAnimationDuration=1e3,a.OuterArcRadiusRatio=.9,a.InnerArcRadiusRatio=.8,a.OpaqueOpacity=1,a.SemiTransparentOpacity=.6,a.defaultSliceWidthRatio=.48,a.invisibleArcLengthInPixels=3,a.sliceClass=i("slice"),a.sliceHighlightClass=i("slice-highlight"),a.twoPi=2*Math.PI,a.InteractiveLegendContainerHeight=70,a.EffectiveZeroValue=1e-9,a.PolylineOpacity=.5,a}();t.DonutChart=a;var r,o=function(){function e(e,t,i,a,r){this.legendContainerParent=t,this.colors=i,this.donutChart=e,this.visualInitOptions=a,this.legendItemsPositions=[],this.legendTransitionAnimationDuration=r&&r.legendTransitionAnimationDuration?r.legendTransitionAnimationDuration:0}return e.prototype.drawLegend=function(i){var a=this;this.data=i,this.currentNumberOfLegendItems=i.length,this.currentIndex=0,this.leftMostIndex=0,this.rightMostIndex=i.length-1,this.legendContainerParent.select(e.LegendContainerSelector).empty()&&(this.legendContainer=this.legendContainerParent.append("div").classed(e.LegendContainerClassName,!0));var r=this.legendContainer.selectAll(e.LegendItemSelector).data(i),o=this.legendContainerWidth=this.legendContainer.node().getBoundingClientRect().width,n=o/2-.4*o/2+e.ItemMargin,s=n;this.currentXOffset=n;var l=function(i,r){i.attr("data-legend-index",r.index).css({position:"absolute",left:s});var o=t.valueFormatter.format(r.label),n=t.valueFormatter.format(r.measure,r.measureFormat),l=t.valueFormatter.format(r.percentage,"0.00 %;-0.00 %;0.00 %"),c=r.color,u=e.createBasicLegendItemSpan(e.LegendItemValueClassName,n,11),h=e.createBasicLegendItemSpan(e.LegendItemCategoryClassName,o,11),d=e.createBasicLegendItemSpan(e.LegendItemPercentageClassName,l,20),p=e.spanWidth(u),g=e.spanWidth(h),m=e.spanWidth(d),f=e.legendBoxSize(p,g,m);i.css("width",f);var y=function(e){return f-e>0?(f-e)/2:0},v=y(p),b=y(g),C=y(m);e.createLegendItemSpan(h,b),e.createLegendItemSpan(u,v),e.createLegendItemSpan(d,C).css("color",c),i.append(h),i.append(d),i.append(u),a.legendItemsPositions.push({startX:s,boxWidth:f}),s+=f+e.ItemMargin};r.enter().insert("div").classed(e.LegendItemClassName,!0).each(function(e){l($(this),e)}),r.exit().remove(),this.assignInteractions()},e.prototype.updateLegend=function(e){var i=this,a=this.legendContainerWidth;this.currentIndex=e,this.updateLabelBlocks(e);var r=this.legendTransitionAnimationDuration,o=-1*(this.legendItemsPositions[e].startX+this.legendItemsPositions[e].boxWidth/2-a/2);this.legendContainer.transition().styleTween("-webkit-transform",function(e,a,r){return d3.interpolate(t.SVGUtil.translateWithPixels(i.currentXOffset,0),t.SVGUtil.translateWithPixels(o,0))}).styleTween("transform",function(e,a,r){return d3.interpolate(t.SVGUtil.translateWithPixels(i.currentXOffset,0),t.SVGUtil.translateWithPixels(o,0))}).duration(r).ease("bounce").each("end",function(){i.currentXOffset=o}),t.SVGUtil.flushAllD3TransitionsIfNeeded(this.visualInitOptions)},e.prototype.assignInteractions=function(){var t=this,i=0,a=!1,r=function(){i=0,a=!1},o=function(){if(i+=d3.event.dx,!(a||Math.abs(i)<e.MinimumSwipeDX)){var r=0>i;t.dragLegend(r),a=!0}},n=d3.behavior.drag().origin(Object).on("drag",o).on("dragstart",r);this.legendContainer.style({"touch-action":"none",cursor:"pointer"}).call(n)},e.prototype.dragLegend=function(t){this.currentNumberOfLegendItems>e.MinimumItemsInLegendForCycled-1?this.currentIndex=this.getCyclingCurrentIndex(t):this.shouldChangeIndexInNonCycling(t)&&(t?this.currentIndex++:this.currentIndex--),this.donutChart.setInteractiveChosenSlice(this.currentIndex)},e.prototype.shouldChangeIndexInNonCycling=function(e){return!(0===this.currentIndex&&!e||this.currentIndex===this.currentNumberOfLegendItems-1&&e)},e.prototype.getCyclingCurrentIndex=function(e){var t=this.data.length,i=e?1:-1,a=(this.currentIndex+i)%(t||1);return 0>a?a+t:a},e.prototype.updateLegendItemsBlocks=function(t,i){var a=$(this.legendContainer[0]);if(t){var r=a.find("[data-legend-index="+this.leftMostIndex+"]");r.remove().insertAfter(a.find("[data-legend-index="+this.rightMostIndex+"]"));var o=this.legendItemsPositions[this.rightMostIndex].startX+this.legendItemsPositions[this.rightMostIndex].boxWidth+e.ItemMargin;this.legendItemsPositions[this.leftMostIndex].startX=o,r.css("left",o),this.rightMostIndex=this.leftMostIndex,this.leftMostIndex=(this.leftMostIndex+1)%this.data.length}else{var n=a.find("[data-legend-index="+this.rightMostIndex+"]");n.remove().insertBefore(a.find("[data-legend-index="+this.leftMostIndex+"]"));var o=this.legendItemsPositions[this.leftMostIndex].startX-this.legendItemsPositions[this.rightMostIndex].boxWidth-e.ItemMargin;this.legendItemsPositions[this.rightMostIndex].startX=o,n.css("left",o),this.leftMostIndex=this.rightMostIndex,this.rightMostIndex=this.rightMostIndex-1===-1?this.legendItemsPositions.length-1:this.rightMostIndex-1}i-1!==0&&this.updateLegendItemsBlocks(t,i-1)},e.prototype.updateLabelBlocks=function(t){this.currentNumberOfLegendItems>e.MinimumItemsInLegendForCycled?(this.rightMostIndex===t&&this.updateLegendItemsBlocks(!0,2),this.leftMostIndex===t&&this.updateLegendItemsBlocks(!1,2),(this.rightMostIndex===t+1||0===this.rightMostIndex&&t===this.currentNumberOfLegendItems-1)&&this.updateLegendItemsBlocks(!0,1),(this.leftMostIndex===t-1||this.leftMostIndex===this.currentNumberOfLegendItems-1&&0===t)&&this.updateLegendItemsBlocks(!1,1)):this.currentNumberOfLegendItems===e.MinimumItemsInLegendForCycled&&(this.rightMostIndex===t&&this.updateLegendItemsBlocks(!0,1),this.leftMostIndex===t&&this.updateLegendItemsBlocks(!1,1))},e.createBasicLegendItemSpan=function(e,t,i){return $("<span/>").addClass(e).css({"white-space":"nowrap","font-size":i+"px"}).text(t)},e.createLegendItemSpan=function(e,t){return e.css({overflow:"hidden","text-overflow":"ellipsis",display:"inline-block",width:"100%","margin-left":t}),e},e.legendBoxSize=function(t,i,a){var r=t>i?t:i;return r=r>a?r:a,r=r>e.MaxLegendItemBoxSize?e.MaxLegendItemBoxSize:r+2},e.spanWidth=function(e){return this.FakeElementSpan||(this.FakeElementSpan=$("<span>").hide().appendTo(document.body)),this.FakeElementSpan.empty(),this.FakeElementSpan.append(e),this.FakeElementSpan.width()},e.LegendContainerClassName="legend-container",e.LegendContainerSelector=".legend-container",e.LegendItemClassName="legend-item",e.LegendItemSelector=".legend-item",e.LegendItemCategoryClassName="category",e.LegendItemPercentageClassName="percentage",e.LegendItemValueClassName="value",e.MaxLegendItemBoxSize=160,e.ItemMargin=30,e.MinimumSwipeDX=15,e.MinimumItemsInLegendForCycled=3,e}();!function(i){var r=function(){function i(i,a,r,o){void 0===o&&(o=!0);var n=this.reader=e.data.createIDataViewCategoricalReader(i),s=i.categorical;if(this.dataViewCategorical=s,this.dataViewMetadata=i.metadata,this.tooltipsEnabled=o,this.colorHelper=new t.ColorHelper(a,t.donutChartProps.dataPoint.fill,r),this.maxValue=0,s.categories&&s.categories.length>0){var l=s.categories[0];this.categoryIdentities=l.identity,this.categoryValues=l.values,this.allCategoryObjects=l.objects,this.categoryColumnRef=l.identityFields,this.categoryFormatString=t.valueFormatter.getFormatString(l.source,t.donutChartProps.general.formatString)}var c=this.grouped=s&&s.values?s.values.grouped():void 0;if(this.isMultiMeasure=c&&c.length>0&&c[0].values&&c[0].values.length>1,this.isSingleMeasure=c&&1===c.length&&c[0].values&&1===c[0].values.length,this.isDynamicSeries=!(!s.values||!s.values.source),this.highlightsOverflow=!1,this.total=0,this.highlightTotal=0,this.dataPoints=[],this.legendDataPoints=[],this.dataLabelsSettings=null,n.hasValues("Y")){var u=this.seriesCount=n.getSeriesCount("Y");this.hasHighlights=this.seriesCount>0&&!_.isEmpty(s.values)&&!!s.values[0].highlights;for(var h=0,d=n.getCategoryCount()||1;d>h;h++)for(var p=0;u>p;p++)this.total+=Math.abs(n.getValue("Y",h,p)),this.highlightTotal+=this.hasHighlights?Math.abs(n.getHighlight("Y",h,p)):0}this.total=t.AxisHelper.normalizeNonFiniteNumber(this.total),this.highlightTotal=t.AxisHelper.normalizeNonFiniteNumber(this.highlightTotal)}return i.normalizedMeasureAndValue=function(e){var i=$.extend(!0,{},e);return i.measure=t.AxisHelper.normalizeNonFiniteNumber(i.measure),i.value=t.AxisHelper.normalizeNonFiniteNumber(i.value),i},i.prototype.convert=function(){var e,r=this.reader;e=0!==this.total?this.categoryValues?this.convertCategoricalWithSlicing():this.isDynamicSeries?this.convertSeries():this.convertMeasures():[];for(var o=!1,n=0,s=e.length;s>n&&!o;n++){var l=e[n];Math.abs(l.highlightMeasureValue.measure)>Math.abs(l.measureValue.measure)&&(o=!0)}this.dataLabelsSettings=this.convertDataLabelSettings();var c=this.dataViewMetadata;if(c){var u=c.objects;u&&(this.legendObjectProperties=u.legend)}var h=_.isEmpty(this.dataViewCategorical.categories)?null:this.dataViewCategorical.categories[0];this.dataPoints=[];for(var d,p=t.donutChartProps.general.formatString,g=t.valueFormatter.getLocalizedString("Percentage"),n=0,s=e.length;s>n;n++){var l=e[n],m=i.normalizedMeasureAndValue(l.highlightMeasureValue),f=i.normalizedMeasureAndValue(l.measureValue),y=f.measure,v=this.total>0?f.value/this.total:0,b=void 0,C=void 0;f.value>this.maxValue&&(this.maxValue=f.value),m.value>this.maxValue&&(this.maxValue=m.value),this.hasHighlights&&(o?(y=m.measure,v=this.highlightTotal>0?m.value/this.highlightTotal:0,b=1):b=0!==f.value?m.value/f.value:0,b||(b=a.EffectiveZeroValue),C=v*b);var S=l.categoryLabel,x=this.dataViewCategorical,w=void 0;w=null!=l.seriesIndex?l.seriesIndex:n;var P=r.getValueMetadataColumn("Y",w),D=this.hasHighlights&&o?l.highlightMeasureValue.measure:l.measureValue.measure,L=this.hasHighlights&&!o?l.highlightMeasureValue.measure:void 0,T=t.valueFormatter.getFormatString(P,p),V=t.valueFormatter.format(v,g),M=void 0;M=t.valueFormatter.format(D,T)+" ("+V+")";var N=void 0;if(this.hasHighlights&&null!=L&&null!=C){var A=t.valueFormatter.format(C,g);N=t.valueFormatter.format(L,T)+" ("+A+")"}var O=void 0;this.tooltipsEnabled&&(O=[],h&&O.push({displayName:h.source.displayName,value:S}),this.isDynamicSeries&&(h&&h.source===x.values.source||O.push({displayName:x.values.source.displayName,value:l.label})),null!=M&&O.push({displayName:P.displayName,value:M}),null!=N&&O.push({displayName:t.ToolTipComponent.localizationOptions.highlightedValueDisplayName,value:N}));var I=d===l.color&&D&&D>0?1:0;d=D&&D>0?l.color:d,this.dataPoints.push({identity:l.identity,measure:y,measureFormat:l.measureFormat,percentage:v,index:l.index,label:l.label,highlightRatio:b,highlightValue:L,selected:!1,tooltipInfo:O,color:l.color,strokeWidth:I,labelFormatString:P.format})}this.legendData=this.convertLegendData()},i.prototype.getLegendTitle=function(){if(0!==this.total){var e=this.dataViewCategorical.values&&this.dataViewCategorical.values.source?this.dataViewCategorical.values.source.displayName:"",t=this.dataViewCategorical.categories&&this.dataViewCategorical.categories.length>0&&this.dataViewCategorical.categories[0].source?this.dataViewCategorical.categories[0].source.displayName:"";return this.categoryValues?t:e}return""},i.prototype.convertCategoricalWithSlicing=function(){for(var e=this.reader,i=this.dataViewCategorical,a=t.donutChartProps.general.formatString,r=[],o=0,n=this.categoryValues.length;n>o;o++){for(var s=this.categoryValues[o],l=this.allCategoryObjects?this.allCategoryObjects[o]:void 0,c=t.SelectionId.createWithId(this.categoryIdentities[o]),u=this.colorHelper.getColorForSeriesValue(l,this.categoryColumnRef,s),h=t.valueFormatter.format(s,this.categoryFormatString),d=0;d<this.seriesCount;d++){var p=e.getValueColumn("Y",d),g=this.isSingleMeasure?h:t.converterHelper.getFormattedLegendLabel(p.source,i.values,a),m=e.getValue("Y",o,d)||0,f=void 0;this.hasHighlights&&(f=e.getHighlight("Y",o,d));var y=p.source.queryName,v=t.SelectionIdBuilder.builder().withCategory(i.categories[0],o).withSeries(i.values,this.isDynamicSeries?p:void 0).withMeasure(y).createSelectionId(),b={identity:v,measureFormat:t.valueFormatter.getFormatString(p.source,a,!0),measureValue:{measure:m,value:Math.abs(m)},highlightMeasureValue:{measure:f,value:null!=f?Math.abs(f):null},index:o*this.seriesCount+d,label:g,categoryLabel:h,color:u,seriesIndex:d};r.push(b)}this.legendDataPoints.push({label:h,color:u,icon:t.LegendIcon.Box,identity:c,selected:!1})}return r},i.prototype.convertMeasures=function(){for(var e=this.reader,i=[],a=t.donutChartProps.general.formatString,r=0;r<this.seriesCount;r++){var o=e.getValueColumn("Y",r),n=t.valueFormatter.getFormatString(o.source,a,!0),s=o.source.displayName,l=t.SelectionId.createWithMeasure(o.source.queryName),c=e.getValue("Y",0,r)||0,u=this.hasHighlights?e.getHighlight("Y",0,r):0,h=this.colorHelper.getColorForMeasure(o.source.objects,o.source.queryName),d={identity:l,measureFormat:n,measureValue:{measure:c,value:Math.abs(c)},highlightMeasureValue:{measure:u,value:Math.abs(u)},index:r,label:s,categoryLabel:s,color:h};i.push(d),this.legendDataPoints.push({label:d.label,color:d.color,icon:t.LegendIcon.Box,identity:d.identity,selected:!1})}return i},i.prototype.convertSeries=function(){for(var e=this.reader,i=this.dataViewCategorical,a=[],r=t.donutChartProps.general.formatString,o=0;o<this.seriesCount;o++){var n=e.getValueColumn("Y",o),s=t.valueFormatter.getFormatString(n.source,r,!0),l=t.converterHelper.getFormattedLegendLabel(n.source,i.values,r),c=(new t.SelectionIdBuilder).withSeries(i.values,n).withMeasure(n.source.queryName).createSelectionId(),u=t.converterHelper.getSeriesName(n.source),h=this.grouped&&this.grouped[o]&&this.grouped[o].objects,d=e.getValue("Y",0,o)||0,p=this.hasHighlights?e.getHighlight("Y",0,o)||0:0,g=this.colorHelper.getColorForSeriesValue(h,i.values.identityFields,u),m={identity:c,measureFormat:s,measureValue:{measure:d,value:Math.abs(d)},highlightMeasureValue:{measure:p,value:Math.abs(p)},index:o,label:l,categoryLabel:l,color:g,seriesIndex:o};a.push(m),this.legendDataPoints.push({label:m.label,color:m.color,icon:t.LegendIcon.Box,identity:m.identity,selected:!1})}return a},i.prototype.convertDataLabelSettings=function(){var e=this.dataViewMetadata,i=t.dataLabelUtils.getDefaultDonutLabelSettings();if(e){var a=e.objects;if(a){var r=a.labels;r&&t.dataLabelUtils.updateLabelSettingsFromLabelsObject(r,i)}}return i},i.prototype.convertLegendData=function(){return{dataPoints:this.legendDataPoints,labelColor:t.LegendData.DefaultLegendLabelFillColor,title:this.getLegendTitle(),fontSize:t.SVGLegend.DefaultFontSizeInPt}},i}();i.DonutChartConverter=r}(r||(r={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t=jsCommon.Utility,i=function(){function i(e){this.canRefresh=e.canRefresh}return i.prototype.init=function(t){this.element=t.element,this.hostServices=t.host,this.canRefresh||this.hostServices.setWarnings([new e.ScriptVisualRefreshWarning])},i.prototype.update=function(e){var i=e.dataViews;if(i&&0!==i.length){var a=i[0];if(a&&a.metadata){var r=this.getImageUrl(a),o=this.ensureHtmlElement();if(r&&t.isValidImageDataUrl(r)){var n=e.viewport;o.css({height:n.height,width:n.width,backgroundImage:"url("+r+")"})}else o.css({backgroundImage:"none"})}}},i.prototype.onResizing=function(e){var t=this.ensureHtmlElement();t.css({height:e.height,width:e.width})},i.prototype.getImageUrl=function(e){return e.scriptResult&&e.scriptResult.imageBase64?"data:image/png;base64,"+e.scriptResult.imageBase64:null},i.prototype.ensureHtmlElement=function(){var e=this.imageBackgroundElement;return e||(e=$("<div class='imageBackground' />"),this.imageBackgroundElement=e,this.imageBackgroundElement.appendTo(this.element)),e},i}();e.ScriptVisual=i}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(t){t.animatedNumber={name:"animatedNumber",capabilities:e.capabilities.animatedNumber,create:function(){return new e.AnimatedNumber}},t.areaChart={name:"areaChart",watermarkKey:"area",capabilities:e.capabilities.lineChart,create:function(){return new e.CartesianChart({chartType:1})},customizeQuery:e.LineChart.customizeQuery,getSortableRoles:function(t){return e.ColumnChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.barChart={name:"barChart",watermarkKey:"bar",capabilities:e.capabilities.barChart,create:function(){return new e.CartesianChart({chartType:6})},customizeQuery:e.ColumnChart.customizeQuery,getSortableRoles:function(t){return e.ColumnChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.basicShape={name:"basicShape",capabilities:e.basicShapeCapabilities,create:function(){return new e.BasicShapeVisual}},t.card={name:"card",watermarkKey:"card",capabilities:e.capabilities.card,create:function(){return new e.Card}},t.multiRowCard={name:"multiRowCard",watermarkKey:"multiRowCard",capabilities:e.capabilities.multiRowCard,create:function(){return new e.MultiRowCard},getSortableRoles:function(t){return e.MultiRowCard.getSortableRoles(t)}},t.clusteredBarChart={name:"clusteredBarChart",watermarkKey:"clusteredBar",capabilities:e.capabilities.clusteredBarChart,create:function(){return new e.CartesianChart({chartType:5})},customizeQuery:e.ColumnChart.customizeQuery,getSortableRoles:function(t){return e.ColumnChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.clusteredColumnChart={name:"clusteredColumnChart",watermarkKey:"clusteredColumn",capabilities:e.capabilities.clusteredColumnChart,create:function(){return new e.CartesianChart({chartType:3})},customizeQuery:e.ColumnChart.customizeQuery,getSortableRoles:function(t){return e.ColumnChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.columnChart={name:"columnChart",watermarkKey:"column",capabilities:e.capabilities.columnChart,create:function(){return new e.CartesianChart({chartType:4})},customizeQuery:e.ColumnChart.customizeQuery,getSortableRoles:function(t){return e.ColumnChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.comboChart={name:"comboChart",watermarkKey:"combo",capabilities:e.capabilities.comboChart,customizeQuery:e.ComboChart.customizeQuery,create:function(){return new e.CartesianChart({chartType:10})},getSortableRoles:function(t){return e.ComboChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.dataDotChart={name:"dataDotChart",capabilities:e.capabilities.dataDotChart,create:function(){return new e.CartesianChart({chartType:11})},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.dataDotClusteredColumnComboChart={name:"dataDotClusteredColumnComboChart",watermarkKey:"combo",capabilities:e.capabilities.dataDotClusteredColumnComboChart,customizeQuery:e.ComboChart.customizeQuery,create:function(){return new e.CartesianChart({chartType:15})},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.dataDotStackedColumnComboChart={name:"dataDotStackedColumnComboChart",watermarkKey:"combo",capabilities:e.capabilities.dataDotStackedColumnComboChart,customizeQuery:e.ComboChart.customizeQuery,create:function(){return new e.CartesianChart({chartType:16})},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.donutChart={name:"donutChart",watermarkKey:"donut",capabilities:e.capabilities.donutChart,create:function(){return new e.DonutChart}},t.funnel={name:"funnel",watermarkKey:"funnel",capabilities:e.capabilities.funnel,create:function(){return new e.FunnelChart}},t.gauge={name:"gauge",watermarkKey:"gauge",capabilities:e.capabilities.gauge,create:function(){return new e.Gauge}},t.hundredPercentStackedBarChart={name:"hundredPercentStackedBarChart",watermarkKey:"100stackedbar",capabilities:e.capabilities.hundredPercentStackedBarChart,create:function(){return new e.CartesianChart({chartType:7})},customizeQuery:e.ColumnChart.customizeQuery,getSortableRoles:function(t){return e.ColumnChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.hundredPercentStackedColumnChart={name:"hundredPercentStackedColumnChart",watermarkKey:"100stackedcolumn",capabilities:e.capabilities.hundredPercentStackedColumnChart,create:function(){return new e.CartesianChart({chartType:8})},customizeQuery:e.ColumnChart.customizeQuery,getSortableRoles:function(t){return e.ColumnChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.image={name:"image",capabilities:e.capabilities.image,create:function(){return new e.ImageVisual}},t.lineChart={name:"lineChart",watermarkKey:"line",capabilities:e.capabilities.lineChart,create:function(){return new e.CartesianChart({chartType:0})},customizeQuery:e.LineChart.customizeQuery,getSortableRoles:function(t){return e.LineChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.lineStackedColumnComboChart={name:"lineStackedColumnComboChart",watermarkKey:"combo",capabilities:e.capabilities.lineStackedColumnComboChart,customizeQuery:e.ComboChart.customizeQuery,create:function(){return new e.CartesianChart({chartType:14})},getSortableRoles:function(t){return e.ComboChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.lineClusteredColumnComboChart={name:"lineClusteredColumnComboChart",watermarkKey:"combo",capabilities:e.capabilities.lineClusteredColumnComboChart,customizeQuery:e.ComboChart.customizeQuery,create:function(){return new e.CartesianChart({chartType:13})},getSortableRoles:function(t){return e.ComboChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.map={name:"map",watermarkKey:"map",capabilities:e.capabilities.map,create:function(){return new e.Map({filledMap:!1})}},t.filledMap={name:"filledMap",watermarkKey:"filledMap",capabilities:e.capabilities.filledMap,create:function(){return new e.Map({filledMap:!0})}},t.treemap={name:"treemap",watermarkKey:"tree",capabilities:e.capabilities.treemap,create:function(){return new e.Treemap}},t.pieChart={name:"pieChart",watermarkKey:"pie",capabilities:e.capabilities.donutChart,create:function(){return new e.DonutChart({sliceWidthRatio:0})}},t.scatterChart={name:"scatterChart",watermarkKey:"scatterplot",capabilities:e.capabilities.scatterChart,create:function(){return new e.CartesianChart({chartType:9})},getAdditionalTelemetry:function(t){return e.ScatterChart.getAdditionalTelemetry(t)}},t.stackedAreaChart={name:"stackedAreaChart",watermarkKey:"stackedarea",capabilities:e.capabilities.lineChart,create:function(){return new e.CartesianChart({chartType:2})},customizeQuery:e.LineChart.customizeQuery,getSortableRoles:function(t){return e.ColumnChart.getSortableRoles(t)},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.table={name:"table",watermarkKey:"table",capabilities:e.capabilities.table,create:function(){return new e.Table},customizeQuery:e.Table.customizeQuery,getSortableRoles:function(t){return e.Table.getSortableRoles()}},t.matrix={name:"matrix",watermarkKey:"matrix",capabilities:e.capabilities.matrix,create:function(){return new e.Matrix},customizeQuery:e.Matrix.customizeQuery,getSortableRoles:function(t){return e.Matrix.getSortableRoles()}},t.slicer={name:"slicer",watermarkKey:"slicer",capabilities:e.capabilities.slicer,create:function(){return new e.Slicer}},t.textbox={name:"textbox",capabilities:e.capabilities.textbox,create:function(){return new e.Textbox}},t.waterfallChart={name:"waterfallChart",watermarkKey:"waterfall",capabilities:e.capabilities.waterfallChart,create:function(){return new e.CartesianChart({chartType:12})},getAdditionalTelemetry:function(t){return e.CartesianChart.getAdditionalTelemetry(t)}},t.cheerMeter={name:"cheerMeter",capabilities:e.CheerMeter.capabilities,create:function(){return new e.CheerMeter}},t.consoleWriter={name:"consoleWriter",capabilities:e.samples.consoleWriterCapabilities,create:function(){return new e.samples.ConsoleWriter}},t.helloIVisual={name:"helloIVisual",capabilities:e.samples.HelloIVisual.capabilities,create:function(){return new e.samples.HelloIVisual}},t.owlGauge={name:"owlGauge",watermarkKey:"gauge",capabilities:e.OwlGauge.capabilities,create:function(){return new e.OwlGauge}},t.scriptVisual={name:"scriptVisual",watermarkKey:"scriptvisual",capabilities:e.capabilities.scriptVisual,create:function(){return new e.ScriptVisual({canRefresh:!1})}},t.kpi={name:"kpi",watermarkKey:"kpi",capabilities:e.capabilities.kpi,create:function(){return new e.KPIStatusWithHistory}}}(t=e.plugins||(e.plugins={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));var powerbi;!function(e){var t;!function(e){var t;!function(e){function t(){return"#FFFFFF"}function i(){return{color:t()}}e.getDefaultColor=t,e.getDefaultValues=i}(t=e.CanvasBackgroundHelper||(e.CanvasBackgroundHelper={}))}(t=e.visuals||(e.visuals={}))}(powerbi||(powerbi={}));
32//# sourceMappingURL=Visuals.min.js.map