@eclipse-scout/chart 24.1.3 → 24.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/d.ts/chart/AbstractChartRenderer.d.ts +10 -2
- package/dist/d.ts/chart/AbstractChartRenderer.d.ts.map +1 -1
- package/dist/d.ts/chart/Chart.d.ts.map +1 -1
- package/dist/d.ts/chart/ChartJsRenderer.d.ts +3 -1
- package/dist/d.ts/chart/ChartJsRenderer.d.ts.map +1 -1
- package/dist/d.ts/chart/VennChartRenderer.d.ts.map +1 -1
- package/dist/eclipse-scout-chart-3ba6b8f30d5806cac8ae.min.js +3 -0
- package/dist/eclipse-scout-chart-3ba6b8f30d5806cac8ae.min.js.map +1 -0
- package/dist/eclipse-scout-chart-theme-dark.css.map +1 -1
- package/dist/eclipse-scout-chart-theme.css.map +1 -1
- package/dist/eclipse-scout-chart.esm-8d9db200429e545abcae.min.js +3 -0
- package/dist/eclipse-scout-chart.esm-8d9db200429e545abcae.min.js.map +1 -0
- package/dist/eclipse-scout-chart.esm.js +93 -36
- package/dist/eclipse-scout-chart.esm.js.map +1 -1
- package/dist/eclipse-scout-chart.js +93 -36
- package/dist/eclipse-scout-chart.js.map +1 -1
- package/dist/file-list +4 -4
- package/package.json +3 -3
- package/src/chart/AbstractChartRenderer.ts +40 -6
- package/src/chart/Chart.ts +9 -2
- package/src/chart/ChartJsRenderer.ts +31 -11
- package/src/chart/VennChartRenderer.ts +6 -1
- package/dist/eclipse-scout-chart-1a81682e3fb823b0ca01.min.js +0 -3
- package/dist/eclipse-scout-chart-1a81682e3fb823b0ca01.min.js.map +0 -1
- package/dist/eclipse-scout-chart.esm-063bb266266e01e3ccd0.min.js +0 -3
- package/dist/eclipse-scout-chart.esm-063bb266266e01e3ccd0.min.js.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import*as R from"@eclipse-scout/core";import*as Et from"chart.js";import"chart.js/auto";import*as Ut from"chartjs-plugin-datalabels";var D={};D.n=o=>{var t=o&&o.__esModule?()=>o.default:()=>o;return D.d(t,{a:t}),t},D.d=(o,t)=>{for(var e in t)D.o(t,e)&&!D.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:t[e]})},D.o=(o,t)=>Object.prototype.hasOwnProperty.call(o,t),D.r=o=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var S={};D.r(S),D.d(S,{AbstractChartRenderer:()=>ct,AbstractSvgChartRenderer:()=>M,Chart:()=>u,ChartAdapter:()=>Dt,ChartField:()=>wt,ChartFieldAdapter:()=>Ht,ChartFieldTile:()=>Nt,ChartFieldTileAdapter:()=>Ft,ChartJsRenderer:()=>Q,ChartLayout:()=>Tt,ChartTableControl:()=>nt,ChartTableControlAdapter:()=>Gt,ChartTableControlLayout:()=>Pt,ChartTableUserFilter:()=>Z,FulfillmentChartRenderer:()=>Bt,SalesfunnelChartRenderer:()=>Lt,SpeedoChartRenderer:()=>v,VennAsync3Calculator:()=>kt,VennChartRenderer:()=>Ot,VennCircle:()=>K,VennCircleHelper:()=>St,chartJsDateAdapter:()=>At,default:()=>Vt});var ut={};D.r(ut),D.d(ut,{AbstractChartRenderer:()=>ct,AbstractSvgChartRenderer:()=>M,Chart:()=>u,ChartAdapter:()=>Dt,ChartField:()=>wt,ChartFieldAdapter:()=>Ht,ChartFieldTile:()=>Nt,ChartFieldTileAdapter:()=>Ft,ChartJsRenderer:()=>Q,ChartLayout:()=>Tt,ChartTableControl:()=>nt,ChartTableControlAdapter:()=>Gt,ChartTableControlLayout:()=>Pt,ChartTableUserFilter:()=>Z,FulfillmentChartRenderer:()=>Bt,SalesfunnelChartRenderer:()=>Lt,SpeedoChartRenderer:()=>v,VennAsync3Calculator:()=>kt,VennChartRenderer:()=>Ot,VennCircle:()=>K,VennCircleHelper:()=>St,chartJsDateAdapter:()=>At,default:()=>Vt});var Wt=o=>{var t={};return D.d(t,o),t},nr=o=>()=>o;const l=Wt({AbstractLayout:()=>R.AbstractLayout,DateColumn:()=>R.DateColumn,DateFormat:()=>R.DateFormat,FormField:()=>R.FormField,FormFieldAdapter:()=>R.FormFieldAdapter,FormFieldTile:()=>R.FormFieldTile,FormFieldTileAdapter:()=>R.FormFieldTileAdapter,HtmlComponent:()=>R.HtmlComponent,Icon:()=>R.Icon,ModelAdapter:()=>R.ModelAdapter,NumberColumn:()=>R.NumberColumn,ObjectFactory:()=>R.ObjectFactory,Point:()=>R.Point,PropertyEventEmitter:()=>R.PropertyEventEmitter,RoundingMode:()=>R.RoundingMode,TableControl:()=>R.TableControl,TableControlAdapter:()=>R.TableControlAdapter,TableMatrix:()=>R.TableMatrix,TableUserFilter:()=>R.TableUserFilter,Tooltip:()=>R.Tooltip,Widget:()=>R.Widget,aria:()=>R.aria,arrays:()=>R.arrays,colorSchemes:()=>R.colorSchemes,dates:()=>R.dates,graphics:()=>R.graphics,icons:()=>R.icons,numbers:()=>R.numbers,objects:()=>R.objects,scout:()=>R.scout,scrollbars:()=>R.scrollbars,strings:()=>R.strings,styles:()=>R.styles,tooltips:()=>R.tooltips}),zt=require("jquery");var y=D.n(zt);function w(o,t,e){return t=Xt(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Xt(o){var t=Yt(o,"string");return typeof t=="symbol"?t:t+""}function Yt(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class u extends l.Widget{constructor(){super(),w(this,"data",void 0),w(this,"config",void 0),w(this,"checkedItems",void 0),w(this,"chartRenderer",void 0),w(this,"_updatedOnce",void 0),w(this,"_updateChartTimeoutId",void 0),w(this,"_updateChartOpts",void 0),w(this,"_updateChartOptsWhileNotAttached",void 0),this.$container=null,this.data=null,this.config=null,this.checkedItems=[],this.chartRenderer=null,this._updateChartTimeoutId=null,this._updateChartOpts=null,this._updateChartOptsWhileNotAttached=[],this._updatedOnce=!1}_init(t){super._init(t),this.setConfig(this.config),this._setData(this.data)}_render(){this.$container=this.$parent.appendDiv("chart"),l.aria.role(this.$container,"none"),this.htmlComp=l.HtmlComponent.install(this.$container,this.session),this.htmlComp.setLayout(new Tt(this))}_renderProperties(){super._renderProperties(),this._renderClickable(),this._renderCheckable(),this._renderChartType(),this._renderColorScheme(),this.updateChart({requestAnimation:!0,debounce:u.DEFAULT_DEBOUNCE_TIMEOUT})}_renderOnAttach(){var t;super._renderOnAttach();const e=this._updateChartOptsWhileNotAttached.splice(0);(t=this.chartRenderer)!==null&&t!==void 0&&t.isDetachSupported()||(this._updateChartRenderer(),e.forEach(r=>delete r.requestAnimation),e.push({requestAnimation:!1})),e.forEach(r=>this.updateChart(y().extend(!0,{},r,{debounce:!0})))}_remove(){this.chartRenderer&&this.chartRenderer.remove(!1),this.$container.remove(),this.$container=null}setData(t){this.setProperty("data",t),this.setCheckedItems(this.checkedItems)}_setData(t){t&&(t=y().extend({axes:[]},t)),this._setProperty("data",t)}_renderData(){this.updateChart({requestAnimation:!0,debounce:u.DEFAULT_DEBOUNCE_TIMEOUT,onlyUpdateData:!0})}setConfig(t){let e={type:u.Type.PIE,options:{autoColor:!0,colorScheme:l.colorSchemes.ColorSchemeId.DEFAULT,transparent:!1,maxSegments:5,adjustGridMaxMin:!0,clickable:!1,checkable:!1,animation:{duration:u.DEFAULT_ANIMATION_DURATION},plugins:{datalabels:{display:!1},tooltip:{enabled:!0},legend:{display:!0,clickable:!1,position:u.Position.RIGHT}}}};if(t=y().extend(!0,{},e,t),t.options.colorScheme=l.colorSchemes.ensureColorScheme(t.options.colorScheme),l.objects.equalsRecursive(this.config,t))return;let r=y().extend(!0,{},this.config);t.data?r.data=t.data:delete r.data;let a=(i,s,n)=>{if(!(!i||!s||!n)){if(!i.options||!i.options[n]){s.options&&delete s.options[n],s.options&&l.objects.isEmpty(s.options.scales)&&!(i.options&&i.options.scales)&&delete s.options.scales,l.objects.isEmpty(s.options)&&!i.options&&delete s.options;return}s.options[n]=i.options[n]}};if(a(t,r,"xLabelMap"),a(t,r,"yLabelMap"),l.objects.equalsRecursive(r,t)){this._setProperty("config",t),this.rendered&&this._renderConfig(!0),this.setCheckedItems(this.checkedItems);return}this.rendered&&this.config&&this.config.type&&this.$container.removeClass(this.config.type+"-chart"),this.setProperty("config",t),this.setCheckedItems(this.checkedItems),this._updateChartRenderer()}_renderConfig(t){this._renderClickable(),this._renderCheckable(),this._renderChartType(),this._renderColorScheme(),this.updateChart({requestAnimation:!0,debounce:u.DEFAULT_DEBOUNCE_TIMEOUT,onlyUpdateData:t})}setCheckedItems(t){this.setProperty("checkedItems",l.arrays.ensure(this._filterCheckedItems(t)))}_filterCheckedItems(t){if(!Array.isArray(t))return t;let e=[];this.data&&this.data.chartValueGroups?this.data.chartValueGroups.forEach(a=>e.push(a.values.length)):this.config&&this.config.data&&this.config.data.datasets.forEach(a=>e.push(a.data.length));let r=t.filter(a=>e[a.datasetIndex]&&a.dataIndex<e[a.datasetIndex]);return r.length<t.length?r:t}_renderCheckedItems(){this.chartRenderer&&this.chartRenderer.renderCheckedItems()}_renderEnabled(){this.updateChart()}_renderClickable(){this.$container.toggleClass("clickable",this.config.options.clickable)}_renderCheckable(){this.$container.toggleClass("checkable",this.config.options.checkable)}_renderChartType(){this.$container.addClass(this.config.type+"-chart")}_renderColorScheme(){l.colorSchemes.toggleColorSchemeClasses(this.$container,this.config.options.colorScheme)}updateChart(t){t=t||{},t.onlyUpdateData=t.onlyUpdateData&&this.chartRenderer&&this.chartRenderer.isDataUpdatable(),t.enforceRerender=!t.onlyUpdateData&&!t.onlyRefresh,this._updateChartTimeoutId&&(clearTimeout(this._updateChartTimeoutId),this._updateChartOpts&&(t.requestAnimation=t.requestAnimation||this._updateChartOpts.requestAnimation,t.onlyUpdateData=t.onlyUpdateData||this._updateChartOpts.onlyUpdateData,t.onlyRefresh=t.onlyRefresh||this._updateChartOpts.onlyRefresh,t.enforceRerender=t.enforceRerender||this._updateChartOpts.enforceRerender),this._updateChartTimeoutId=null,this._updateChartOpts=null);let e=a.bind(this);t.debounce===!0||typeof t.debounce=="number"?(this._updateChartOpts=t,typeof t.debounce=="number"?this._updateChartTimeoutId=setTimeout(e,t.debounce):this._updateChartTimeoutId=setTimeout(e)):e();function a(){if(this._updateChartTimeoutId=null,this._updateChartOpts=null,!this.$container||!this.$container.isAttached()){this._updateChartOptsWhileNotAttached.push(t);return}this._updatedOnce=!0,this.chartRenderer&&(t.enforceRerender?this.chartRenderer.remove(this.chartRenderer.shouldAnimateRemoveOnUpdate(t),i=>{this.removing||i||(this.chartRenderer.render(t.requestAnimation),this.trigger("chartRender"))}):t.onlyUpdateData?this.chartRenderer.updateData(t.requestAnimation):t.onlyRefresh&&this.chartRenderer.refresh())}}_resolveChartRenderer(){switch(this.config.type){case u.Type.FULFILLMENT:return new Bt(this);case u.Type.SPEEDO:return new v(this);case u.Type.SALESFUNNEL:return new Lt(this);case u.Type.VENN:return new Ot(this);case u.Type.BAR:case u.Type.BAR_HORIZONTAL:case u.Type.LINE:case u.Type.COMBO_BAR_LINE:case u.Type.PIE:case u.Type.DOUGHNUT:case u.Type.POLAR_AREA:case u.Type.RADAR:case u.Type.BUBBLE:case u.Type.SCATTER:return new Q(this)}return null}_updateChartRenderer(){this.chartRenderer&&this.chartRenderer.remove(),this.setProperty("chartRenderer",this._resolveChartRenderer())}handleValueClick(t,e){if(this.config.options.checkable){let r=[...this.checkedItems],a=r.filter(i=>i.datasetIndex===t.datasetIndex&&i.dataIndex===t.dataIndex)[0];a?l.arrays.remove(r,a):r.push(t),this.setCheckedItems(r)}this.trigger("valueClick",{data:t,originalEvent:e})}}w(u,"Type",{PIE:"pie",LINE:"line",BAR:"bar",BAR_HORIZONTAL:"horizontalBar",COMBO_BAR_LINE:"comboBarLine",FULFILLMENT:"fulfillment",SPEEDO:"speedo",SALESFUNNEL:"salesfunnel",VENN:"venn",DOUGHNUT:"doughnut",POLAR_AREA:"polarArea",RADAR:"radar",BUBBLE:"bubble",SCATTER:"scatter"}),w(u,"Position",{TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right",CENTER:"center"}),w(u,"DEFAULT_ANIMATION_DURATION",600),w(u,"DEFAULT_DEBOUNCE_TIMEOUT",100);class Dt extends l.ModelAdapter{_onWidgetValueClick(t){this._send("valueClick",t.data)}_onWidgetEvent(t){t.type==="valueClick"?this._onWidgetValueClick(t):super._onWidgetEvent(t)}}function Jt(o,t,e){return t=qt(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function qt(o){var t=Kt(o,"string");return typeof t=="symbol"?t:t+""}function Kt(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class Tt extends l.AbstractLayout{constructor(t){super(),Jt(this,"chart",void 0),this.chart=t}layout(t){let e={requestAnimation:!0,debounce:u.DEFAULT_DEBOUNCE_TIMEOUT,onlyUpdateData:!0};(!this.chart.session.ready||this.chart._updatedOnce)&&(e.requestAnimation=!1),this.chart.session.ready||(e.debounce=!1),this.chart.updateChart(e)}}function ot(o,t,e){return t=Zt(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Zt(o){var t=Qt(o,"string");return typeof t=="symbol"?t:t+""}function Qt(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class ct extends l.PropertyEventEmitter{constructor(t){super(),ot(this,"chart",void 0),ot(this,"session",void 0),ot(this,"rendering",void 0),ot(this,"rendered",void 0),ot(this,"animationDuration",void 0),ot(this,"firstOpaqueBackgroundColor",void 0),this.chart=t,this.session=t.session,this.rendering=!1,this.rendered=!1,this.animationDuration=0,this.firstOpaqueBackgroundColor=""}validate(){return this._validateChartData()?this._validate():!1}_validateChartData(){let t=this.chart&&this.chart.data;if(!t||!t.chartValueGroups||t.chartValueGroups.length===0)return!1;let e,r=0;for(e=0;e<t.chartValueGroups.length;e++){let a=t.chartValueGroups[e];if(!a.values)return!1;if(e===0)r=a.values.length;else if(a.values.length!==r)return!1;if(!this.chart.config.options.autoColor&&!l.arrays.ensure(a.colorHexValue).length&&!a.cssClass)return!1}for(e=0;e<t.axes.length;e++)if(t.axes[e].length!==r)return!1;return!0}_validate(){return!0}render(t){if(!this.validate()||!this.chart.rendered)return;const e=this.chart.config.options.animation.duration;this.setAnimationDuration(t?e:0),this.rendering=!0,this._render(),this.rendering=!1,this.rendered=!0,this.setAnimationDuration(e)}_render(){}renderCheckedItems(){this.rendered&&this._renderCheckedItems()}_renderCheckedItems(){}updateData(t){if(!this.rendered){this.render(t);return}if(!this.validate()||!this.isDataUpdatable())return;const e=this.chart.config.options.animation.duration;this.setAnimationDuration(t?e:0),this._updateData(),this.setAnimationDuration(e)}_updateData(){}isDataUpdatable(){return!1}isDetachSupported(){return!0}refresh(){this.rendered&&this.remove(!1),this.render(!1)}setAnimationDuration(t){this.setProperty("animationDuration",t)&&this.rendered&&this._renderAnimationDuration()}_setAnimationDuration(t){this._setProperty("animationDuration",t)}_renderAnimationDuration(){}remove(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=arguments.length>1?arguments[1]:void 0;const r=this.chart.config.options.animation.duration;this.setAnimationDuration(t&&r),this.animationDuration&&this.rendered?this._removeAnimated(e):this._remove(e),this.setAnimationDuration(r)}_remove(t){this.rendered=!1,t&&t()}_removeAnimated(t){this._remove(t)}shouldAnimateRemoveOnUpdate(t){return t.requestAnimation}}function H(o,t,e){return t=te(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function te(o){var t=ee(o,"string");return typeof t=="symbol"?t:t+""}function ee(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class M extends ct{constructor(t){super(t),H(this,"chartBox",void 0),H(this,"clipId",void 0),H(this,"maskId",void 0),H(this,"suppressLegendBox",void 0),H(this,"height",void 0),H(this,"width",void 0),H(this,"chartAnimationStopping",void 0),H(this,"$svg",void 0),this.chartBox=null,this.clipId="Clip-"+l.ObjectFactory.get().createUniqueId(),this.maskId="Mask-"+l.ObjectFactory.get().createUniqueId(),this.suppressLegendBox=!1}_render(){this.$svg||(this.$svg=this.chart.$container.appendSVG("svg","chart-svg"),l.aria.role(this.$svg,"img"),this.linkChartWithFieldLabel(this.$svg)),this.firstOpaqueBackgroundColor=l.styles.getFirstOpaqueBackgroundColor(this.$svg),this.height=this.$svg.height(),this.width=this.$svg.width(),this._initChartBox(),this._useFontSizeBig()?this.$svg.addClass(M.FONT_SIZE_BIG):this._useFontSizeMiddle()?this.$svg.addClass(M.FONT_SIZE_MIDDLE):this._useFontSizeSmall()?this.$svg.addClass(M.FONT_SIZE_SMALL):this._useFontSizeSmallest()&&this.$svg.addClass(M.FONT_SIZE_SMALLEST),this.$svg.isAttached()&&this._renderInternal()}linkChartWithFieldLabel(t){if(!t)return;let e=t.parents(".chart-field");if(e.length>0){let r=e.eq(0).children("label");r.length>0&&l.aria.linkElementWithLabel(t,r.eq(0))}}_renderInternal(){}_useFontSizeBig(){return!1}_useFontSizeMiddle(){return!1}_useFontSizeSmall(){return!1}_useFontSizeSmallest(){return!1}remove(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=arguments.length>1?arguments[1]:void 0;this.rendered&&!this.chartAnimationStopping&&(this.chartAnimationStopping=!0,this.$svg.children().stop(!0,!1),this.chartAnimationStopping=!1),super.remove(t,e)}_remove(t){this.rendered&&(this.$svg.children().stop(!0,!1),this.rendered&&(this.$svg.remove(),this.$svg=null)),this.rendered=!1,t&&t(this.chartAnimationStopping)}_createClickObject(t,e){return{xIndex:t,dataIndex:t,datasetIndex:e}}_measureText(t,e){let r=this.$svg.appendSVG("text",e).attr("x",0).attr("y",0).attr("visibility","hidden").text(t),a;try{a=r[0].getBBox()}catch{return{height:0,width:0}}return r.remove(),a}_renderLine(t,e,r,a,i){let s=this.$svg.appendSVG("line",i).attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",a);return this.animationDuration&&s.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0),s}_renderLineLabel(t,e,r,a,i){let s=this.$svg.appendSVG("text",a||"line-label").attr("x",t).attr("y",e).text(r);if(i){s.attr("mask","url(#"+this.maskId+")");let n=this.$svg.appendSVG("text",a?a+" background":"line-label-background").attr("x",t).attr("y",e).attr("clip-path","url(#"+this.clipId+")").text(r);s.data("$background",n),this.animationDuration&&n.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0)}return this.animationDuration&&s.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0),s}_initChartBox(){this.chartBox={width:this.width,height:this.height,xOffset:0,yOffset:0,mX:function(){return this.xOffset+this.width/2},mY:function(){return this.yOffset+this.height/2}}}_createAnimationObjectWithTabIndexRemoval(t,e){return{step:function(r,a){try{t.bind(this)(r,a)}catch(i){throw y()(this).stop(!0,!1),i}},duration:e||u.DEFAULT_ANIMATION_DURATION,complete:function(){y()(this).removeAttr("tabindex")}}}_addClipping(t){let e=this.$svg.appendSVG("clipPath");e[0].id=this.clipId;let r=this.$svg.appendSVG("mask");r.appendSVG("rect").attr("x",0).attr("y",0).attr("width","100%").attr("height","100%").attr("fill","white"),r[0].id=this.maskId,this.chart.$container.find("."+t).each(function(a){this.id="ClipMask-"+l.ObjectFactory.get().createUniqueId(),e.appendSVG("use").attrXLINK("href","#"+this.id),r.appendSVG("use").attrXLINK("href","#"+this.id)})}_renderWireLegend(t,e,r,a){if(!this.chart.config.options.plugins.tooltip.enabled)return{detachFunc:()=>{},attachFunc:()=>{},removeFunc:()=>{}};let i={},s=5,n,d=0,h=17,c=h;a&&(n=this.$svg.appendSVG("rect","wire-legend-background-box").attr("opacity","1"));let p=e,f,_=0,g=0;if(p.h===-1?g=p.x2-2*s:g=this.width-p.x2-2*s,Array.isArray(t))for(let m=0;m<t.length;m++){let T=t.length-m-1,x=p.y2+p.v*s-h*T-s*T,B=this._renderLineLabel(p.x2+s,x,l.strings.truncateText(t[m],g,this._measureText.bind(this)),"",a);B.addClass(r),_=Math.max(_,B[0].getComputedTextLength()),m===0?f=B:f.data("lines")?f.data("lines").push(B):f.data("lines",[B])}else f=this._renderLineLabel(p.x2+s,p.y2+p.v*s,l.strings.truncateText(t,g,this._measureText.bind(this)),"",a),f.addClass(r),_=f[0].getComputedTextLength();if(d=_+2*s,e.autoPosition&&(p=e.posFunc.call(this,d,c),f.attr("x",p.x2+s),f.attr("y",p.y2+p.v*s)),p.h===-1?(f.attr("x",p.x2-s-_),f.css("text-anchor","left"),f.data("lines")&&f.data("lines").forEach(m=>{m.attr("x",p.x2-s-_),m.css("text-anchor","left")})):(f.attr("x",p.x2+s),f.css("text-anchor","right"),f.data("lines")&&f.data("lines").forEach(m=>{m.attr("x",p.x2+s),m.css("text-anchor","right")})),p.v===1)f.data("lines")&&f.data("lines").forEach((m,T)=>{m.attr("y",p.x2-s-_);let x=1+T;m.attr("y",p.y2+p.v*s+h*x+s*(x+1))}),f.attr("dy","0.7em");else if(f.data("lines")){let m=f.data("lines").length;f.attr("y",p.y2+p.v*s-h*m-s*m),f.data("lines").forEach((T,x)=>{m=f.data("lines").length-1-x,T.attr("y",p.y2+p.v*s-h*m-s*m)})}f.add(f.data("lines")).each((m,T)=>{let x=y()(T),B=x.data("$background");B&&(B.attr("x",x.attr("x")),B.attr("y",x.attr("y")),B.css("text-anchor",x.css("text-anchor")),B.attr("dy",x.attr("dy")))});let b=[];p.x1>0&&p.y1>0&&(b.push(this._renderLine(p.x1,p.y1,p.x2,p.y2,"label-line")),b.push(this._renderLine(p.x2,p.y2,p.x2+p.h*(_+2*s),p.y2,"label-line"))),f.data("wires",b);let C=this.$svg;return i.detachFunc=()=>{f.data("wires").forEach(m=>{m.detach()}),f.data("lines")&&f.data("lines").forEach(m=>{m.data("$background")&&C.append(m.data("$background")),m.detach()}),f.data("$background")&&f.data("$background").remove(),f.detach()},i.attachFunc=()=>{C.append(f),f.data("$background")&&C.append(f.data("$background")),C.append(f.data("wires")),f.data("lines")&&f.data("lines").forEach(m=>{C.append(m),m.data("$background")&&C.append(m.data("$background"))})},i.removeFunc=()=>{f.data("wires").forEach(m=>{m.remove()}),f.data("lines")&&f.data("lines").forEach(m=>{m.data("$background")&&m.data("$background").remove(),m().remove()}),f.data("$background")&&f.data("$background").remove(),f.remove()},i.$field=f,i}}H(M,"FONT_SIZE_SMALLEST","smallestFont"),H(M,"FONT_SIZE_SMALL","smallFont"),H(M,"FONT_SIZE_MIDDLE","middleFont"),H(M,"FONT_SIZE_BIG","bigFont");const At={getAdapter(o){return{formats:()=>re(o.locale),parse:(t,e)=>l.objects.isNullOrUndefined(t)?null:t instanceof Date?t.getTime():l.objects.isString(t)?l.objects.isString(e)&&l.strings.hasText(e)?(t=new l.DateFormat(o.locale,e).parse(t),t instanceof Date?t.getTime():null):(t=l.dates.parseJsonDate(t),t instanceof Date?t.getTime():null):null,format:(t,e)=>{if(e==="quarter")throw new Error('The time unit "quarter" is not supported for formatting.');return l.dates.format(new Date(t),o.locale,e)},add:(t,e,r)=>{let a=new Date(t);switch(r){case"millisecond":return l.dates.shiftTime(a,0,0,0,e).getTime();case"second":return l.dates.shiftTime(a,0,0,e,0).getTime();case"minute":return l.dates.shiftTime(a,0,e,0,0).getTime();case"hour":return l.dates.shiftTime(a,e,0,0,0).getTime();case"day":return l.dates.shift(a,0,0,e).getTime();case"week":return l.dates.shift(a,0,0,e*7).getTime();case"month":return l.dates.shift(a,0,e,0).getTime();case"quarter":return l.dates.shift(a,0,e*3,0).getTime();case"year":return l.dates.shift(a,e,0,0).getTime();default:return t}},diff:(t,e,r)=>{switch(r){case"millisecond":return t-e;case"second":return(t-e)/1e3;case"minute":return(t-e)/1e3/60;case"hour":return(t-e)/1e3/60/60;case"day":return l.dates.compareDays(new Date(t),new Date(e));case"week":return l.dates.compareDays(new Date(t),new Date(e))/7;case"month":return l.dates.compareMonths(new Date(t),new Date(e));case"quarter":return l.dates.compareMonths(new Date(t),new Date(e))/3;case"year":return new Date(t).getFullYear()-new Date(e).getFullYear();default:return 0}},startOf:(t,e,r)=>{let a=new Date(t);switch(e){case"second":return a.setMilliseconds(0);case"minute":return a.setSeconds(0,0);case"hour":return a.setMinutes(0,0,0);case"day":return a.setHours(0,0,0,0);case"week":return l.dates.firstDayOfWeek(a,0).getTime();case"isoWeek":return l.dates.firstDayOfWeek(a,r).getTime();case"month":return l.dates.trunc(a).setDate(0);case"quarter":return l.dates.trunc(a).setMonth(a.getMonth()%4,1);case"year":return l.dates.trunc(a).setMonth(0,1);default:return t}},endOf:(t,e)=>{let r=new Date(t);switch(e){case"second":return r.setMilliseconds(999);case"minute":return r.setSeconds(59,999);case"hour":return r.setMinutes(59,59,999);case"day":return r.setHours(23,59,59,999);case"week":{r.setHours(23,59,59,999);let a=l.dates.firstDayOfWeek(r,0);return a.setDate(a.getDate()+7)}case"month":return r.setHours(23,59,59,999),r.setDate(Mt(r.getMonth(),r.getFullYear()));case"quarter":{r.setHours(23,59,59,999);let a=r.getMonth()%4+2;return r.setMonth(a,Mt(a,r.getFullYear()))}case"year":return r.setHours(23,59,59,999),r.setMonth(11,31);default:return t}}}}};function re(o){return{datetime:o.dateFormatPatternDefault+" "+o.timeFormatPatternDefault,millisecond:"HH:mm:ss.SSS",second:"HH:mm:ss",minute:o.timeFormatPatternDefault,hour:o.timeFormatPatternDefault,day:o.dateFormatPatternDefault,week:"ww",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"}}function Mt(o,t){return o in[3,5,8,10]?30:o===1?l.dates.isLeapYear(t)?29:28:31}var ae=o=>{var t={};return D.d(t,o),t},lr=o=>()=>o;const L=ae({Chart:()=>Et.Chart,_adapters:()=>Et._adapters});var ie=o=>{var t={};return D.d(t,o),t},or=o=>()=>o;const hr=ie({});var se=o=>{var t={};return D.d(t,o),t},dr=o=>()=>o;const vt=se({default:()=>Ut.default});function A(o,t,e){return t=ne(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function ne(o){var t=le(o,"string");return typeof t=="symbol"?t:t+""}function le(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}L.Chart.register(vt.default),y().extend(!0,L.Chart.defaults,{maintainAspectRatio:!1,elements:{line:{borderWidth:2},point:{radius:0,hitRadius:10,hoverRadius:7,hoverBorderWidth:2},arc:{borderWidth:1},bar:{borderWidth:1,borderSkipped:""}},plugins:{legend:{labels:{usePointStyle:!0,boxHeight:7}}}}),y().extend(!0,L.Chart.overrides,{line:{elements:{point:{borderWidth:2}}},scatter:{elements:{point:{radius:3}}}});let It=!1;const oe=(1+Math.sqrt(5))/2;class Q extends ct{constructor(t){super(t),A(this,"chartJs",void 0),A(this,"onlyIntegers",void 0),A(this,"maxXAxesTicksHeight",void 0),A(this,"numSupportedColors",void 0),A(this,"colorSchemeCssClass",void 0),A(this,"minRadialChartDatalabelSpace",void 0),A(this,"resetDatasetAfterHover",void 0),A(this,"legendHoverDatasets",void 0),A(this,"removing",void 0),A(this,"$canvas",void 0),A(this,"_labelFormatter",void 0),A(this,"_xLabelFormatter",void 0),A(this,"_yLabelFormatter",void 0),A(this,"_xAxisFitter",void 0),A(this,"_yAxisFitter",void 0),A(this,"_radialChartDatalabelsDisplayHandler",void 0),A(this,"_radialChartDatalabelsFormatter",void 0),A(this,"_datalabelsFormatter",void 0),A(this,"_datalabelBackgroundColorHandler",void 0),A(this,"_legendLabelGenerator",void 0),A(this,"_clickHandler",void 0),A(this,"_hoverHandler",void 0),A(this,"_pointerHoverHandler",void 0),A(this,"_legendClickHandler",void 0),A(this,"_legendHoverHandler",void 0),A(this,"_legendPointerHoverHandler",void 0),A(this,"_legendLeaveHandler",void 0),A(this,"_legendPointerLeaveHandler",void 0),A(this,"_resizeHandler",void 0),A(this,"_tooltipTitleGenerator",void 0),A(this,"_tooltipItemsGenerator",void 0),A(this,"_tooltipLabelGenerator",void 0),A(this,"_tooltipLabelValueGenerator",void 0),A(this,"_tooltipLabelColorGenerator",void 0),A(this,"_tooltipRenderer",void 0),A(this,"_tooltip",void 0),A(this,"_tooltipTimeoutId",void 0),A(this,"_updatingDatalabels",void 0),this.chartJs=null,this.onlyIntegers=!0,this.maxXAxesTicksHeight=75,this.numSupportedColors=6,this.colorSchemeCssClass="",this.minRadialChartDatalabelSpace=25,this._labelFormatter=this._formatLabel.bind(this),this._xLabelFormatter=this._formatXLabel.bind(this),this._yLabelFormatter=this._formatYLabel.bind(this),this._xAxisFitter=this._fitXAxis.bind(this),this._yAxisFitter=this._fitYAxis.bind(this),this._radialChartDatalabelsDisplayHandler=this._displayDatalabelsOnRadialChart.bind(this),this._radialChartDatalabelsFormatter=this._formatDatalabelsOnRadialChart.bind(this),this._datalabelsFormatter=this._formatDatalabels.bind(this),this._datalabelBackgroundColorHandler=this._getBackgroundColorOfDataset.bind(this),this._legendLabelGenerator=this._generateLegendLabels.bind(this),this.resetDatasetAfterHover=!1,this._clickHandler=this._onClick.bind(this),this._hoverHandler=this._onHover.bind(this),this._pointerHoverHandler=this._onHoverPointer.bind(this),this.legendHoverDatasets=[],this._legendClickHandler=this._onLegendClick.bind(this),this._legendHoverHandler=this._onLegendHover.bind(this),this._legendPointerHoverHandler=this._onLegendHoverPointer.bind(this),this._legendLeaveHandler=this._onLegendLeave.bind(this),this._legendPointerLeaveHandler=this._onLegendLeavePointer.bind(this),this._resizeHandler=this._onResize.bind(this),this._tooltipTitleGenerator=this._generateTooltipTitle.bind(this),this._tooltipItemsGenerator=this._generateTooltipItems.bind(this),this._tooltipLabelGenerator=this._generateTooltipLabel.bind(this),this._tooltipLabelValueGenerator=this._generateTooltipLabelValue.bind(this),this._tooltipLabelColorGenerator=this._generateTooltipLabelColor.bind(this),this._tooltipRenderer=this._renderTooltip.bind(this),this._tooltip=null,this._tooltipTimeoutId=null}_validateChartData(){let t=!0,e=this.chart&&this.chart.data;if((!e||!e.chartValueGroups||e.chartValueGroups.length===0||!e.axes)&&(t=!1),t&&l.scout.isOneOf(this.chart.config.type,u.Type.POLAR_AREA,u.Type.RADAR)){let i,s=0;for(i=0;i<e.chartValueGroups.length;i++){let n=e.chartValueGroups[i];n.values||(t=!1),i===0?s=n.values.length:n.values.length!==s&&(t=!1)}for(i=0;i<e.axes.length;i++)e.axes[i].length!==s&&(t=!1)}if(t)return!0;let r=!0,a=this.chart&&this.chart.config;if((!a||!a.data||!a.data.datasets||a.data.datasets.length===0)&&(r=!1),r&&l.scout.isOneOf(a.type,u.Type.POLAR_AREA,u.Type.RADAR)){let i,s=0;for(i=0;i<a.data.datasets.length;i++){let n=a.data.datasets[i];n.data||(r=!1),i===0?s=n.data.length:n.data.length!==s&&(r=!1)}}return r}_render(){this.$canvas||(this.$canvas=this.chart.$container.appendElement("<canvas>"),l.aria.hidden(this.$canvas,!0)),this.firstOpaqueBackgroundColor=l.styles.getFirstOpaqueBackgroundColor(this.$canvas),It||(L.Chart.defaults.font.family=this.$canvas.css("font-family"),L._adapters._date.override(At.getAdapter(this.chart.session)),It=!0);let t=y().extend(!0,{},this.chart.config);this._adjustConfig(t),this._renderChart(t)}_renderChart(t){this.chartJs&&this.chartJs.destroy(),t=y().extend(!0,{},t,{options:{animation:{}}},t),t.options.animation.duration=this.animationDuration,this.chartJs=new L.Chart(this.$canvas[0].getContext("2d"),t),this._adjustSize(this.chartJs.config,this.chartJs.chartArea),this.refresh()}_updateData(){if(!this.chartJs)return;let t=y().extend(!0,{},this.chart.config);this._adjustConfig(t);let e=this.chartJs.config.data,r=t.data,a=(h,c,p,f)=>{if(!h||!c||!p)return;if(!c[p]){let b=h[p];(b||f)&&(c[p]=b);return}if(!h[p]){if(f){c[p]=void 0;return}if(Array.isArray(c[p])){c[p].splice(0,c[p].length);return}c[p]=void 0;return}if(!Array.isArray(h[p])||!Array.isArray(c[p])){c[p]=h[p];return}for(let b=0;b<Math.min(h[p].length,c[p].length);b++)c[p][b]=h[p][b];let _=c[p].length,g=h[p].length;_>g?c[p].splice(g,_-g):_<g&&c[p].push(...h[p].splice(_))},i=(h,c)=>l.arrays.find(h,p=>p.datasetId===c),s=(h,c)=>l.arrays.findIndex(h,p=>p.datasetId===c);if(e&&r){a(r,e,"labels"),e.datasets||(e.datasets=[]),r.datasets||(r.datasets=[]),r.datasets.every(h=>l.objects.isNullOrUndefined(h.datasetId))&&(r.datasets.forEach((h,c)=>{h.datasetId=""+c}),e.datasets.forEach((h,c)=>{h.datasetId=""+c})),e.datasets.forEach(h=>{let c=i(r.datasets,h.datasetId);c&&(h.label=c.label,h.type=c.type,a(c,h,"data"),a(c,h,"backgroundColor",!0),a(c,h,"borderColor",!0),a(c,h,"hoverBackgroundColor",!0),a(c,h,"hoverBorderColor",!0),a(c,h,"legendColor",!0),a(c,h,"pointBackgroundColor",!0),a(c,h,"pointHoverBackgroundColor",!0),a(c,h,"pointBorderColor",!0),a(c,h,"pointHoverBorderColor",!0),a(c,h,"uncheckedBackgroundColor",!0),a(c,h,"uncheckedHoverBackgroundColor",!0),a(c,h,"checkedBackgroundColor",!0),a(c,h,"checkedHoverBackgroundColor",!0),a(c,h,"uncheckedPointBackgroundColor",!0),a(c,h,"uncheckedPointHoverBackgroundColor",!0),a(c,h,"checkedPointBackgroundColor",!0),a(c,h,"checkedPointHoverBackgroundColor",!0),a(c,h,"lineTension",!0),a(c,h,"pointRadius",!0),a(c,h,"uncheckedPointRadius",!0),a(c,h,"checkedPointRadius",!0),this._adjustDatasetBorderWidths(h))});for(let h=e.datasets.length-1;h>=0;h--){let c=e.datasets[h].datasetId;(l.objects.isNullOrUndefined(c)||s(r.datasets,c)===-1)&&e.datasets.splice(h,1)}e.datasets.sort((h,c)=>s(r.datasets,h.datasetId)-s(r.datasets,c.datasetId)),r.datasets.forEach((h,c)=>{let p=e.datasets[c];p&&p.datasetId&&h.datasetId===p.datasetId||e.datasets.splice(c,0,h)})}else this.chartJs.config.data=r;a(t.options,this.chartJs.config.options,"xLabelMap",!0),a(t.options,this.chartJs.config.options,"yLabelMap",!0),y().extend(!0,this.chartJs.config,{options:{animation:{duration:this.animationDuration}}});let n=this.chartJs.config.options.scales||{};[n.x||{},n.y||{},n.yDiffType||{},n.r||{}].forEach(h=>{(h.ticks||{}).stepSize=void 0}),this.refresh(),this._adjustSize(this.chartJs.config,this.chartJs.chartArea),this.refresh()}isDataUpdatable(){return!0}isDetachSupported(){return!1}refresh(){this.chartJs?this.chartJs.update():super.refresh()}_renderAnimationDuration(){this.chartJs&&(y().extend(!0,this.chartJs.config,{options:{animation:{duration:this.animationDuration}}}),this.refresh())}_renderCheckedItems(){this.chartJs&&this._checkItems(this.chartJs.config)&&this.refresh()}_checkItems(t){if(!t||!t.data)return!1;let e=(a,i,s)=>{if(Array.isArray(a)&&Array.isArray(i)){let n=0;return l.arrays.ensure(s).filter(d=>!isNaN(d)&&d<Math.min(a.length,i.length)).forEach(d=>{a[d]!==i[d]&&(a[d]=i[d],n++)}),n}return 0},r=0;return t.data.datasets.forEach((a,i)=>{let s=this.chart.checkedItems.filter(d=>d.datasetIndex===i).map(d=>d.dataIndex),n=l.arrays.init(a.data.length,null).map((d,h)=>h);l.arrays.removeAll(n,s),r=r+e(a.backgroundColor,a.checkedBackgroundColor,s)+e(a.hoverBackgroundColor,a.checkedHoverBackgroundColor,s)+e(a.pointBackgroundColor,a.checkedPointBackgroundColor,s)+e(a.pointHoverBackgroundColor,a.checkedPointHoverBackgroundColor,s)+e(a.pointRadius,a.checkedPointRadius,s)+e(a.backgroundColor,a.uncheckedBackgroundColor,n)+e(a.hoverBackgroundColor,a.uncheckedHoverBackgroundColor,n)+e(a.pointBackgroundColor,a.uncheckedPointBackgroundColor,n)+e(a.pointHoverBackgroundColor,a.uncheckedPointHoverBackgroundColor,n)+e(a.pointRadius,a.uncheckedPointRadius,n),this._adjustDatasetBorderWidths(a)}),0<r}stopAnimations(){this.chartJs&&this.chartJs.stop()}_adjustConfig(t){!t||!t.type||(this._adjustType(t),this.chart.data&&this._computeDatasets(this.chart.data,t),this._adjustData(t),this._adjustTooltip(t),this._adjustGrid(t),this._adjustPlugins(t),this._adjustColors(t),this._adjustClickHandler(t),this._adjustResizeHandler(t))}_adjustType(t){if(t.type===u.Type.COMBO_BAR_LINE){t.type=u.Type.BAR;let e=(t.options||{}).scaleLabelByTypeMap;e&&(e[u.Type.BAR]=e[u.Type.COMBO_BAR_LINE])}else this._isHorizontalBar(t)&&(t.type=u.Type.BAR,t.options=y().extend(!0,{},t.options,{indexAxis:"y"}))}_computeDatasets(t,e){let r=[],a=[],i=(n,d)=>{y().isEmptyObject(d)||(e.options[n]=d)};(t.axes[0]||[]).forEach(n=>r.push(n.label));let s=this._isHorizontalBar(e);i(s?"yLabelMap":"xLabelMap",this._computeLabelMap(t.axes[0])),i(s?"xLabelMap":"yLabelMap",this._computeLabelMap(t.axes[1])),t.chartValueGroups.forEach(n=>a.push({type:n.type,label:n.groupName,data:y().extend(!0,[],n.values)})),e.data={labels:r,datasets:a}}_isHorizontalBar(t){return t&&(t.type===u.Type.BAR_HORIZONTAL||t.type===u.Type.BAR&&t.options&&t.options.indexAxis==="y")}_computeLabelMap(t){let e={};return(t||[]).forEach((r,a)=>{e[a]=r.label}),e}_adjustData(t){!t||!t.data||!t.type||(this._adjustBarBorderWidth(t),this._adjustMaxSegments(t),this._adjustBubbleRadii(t),this._adjustOnlyIntegers(t))}_adjustBarBorderWidth(t){!t||!t.data||!t.type||!l.scout.isOneOf(t.type,u.Type.BAR)||t.data.datasets.forEach(e=>{(e.type||u.Type.BAR)===u.Type.BAR&&(e.borderWidth=e.borderWidth||1,e.hoverBorderWidth=e.hoverBorderWidth||2,this._adjustDatasetBorderWidths(e))})}_adjustDatasetBorderWidths(t){this._adjustDatasetBorderWidth(t),this._adjustDatasetBorderWidth(t,!0)}_adjustDatasetBorderWidth(t,e){if(!t)return;let r=e?"hoverBorderWidth":"borderWidth",a=e?"hoverBorderWidthBackup":"borderWidthBackup",i=e?"hoverBackgroundColor":"backgroundColor",s=e?"hoverBorderColor":"borderColor";if(t[a]&&(t[r]=t[a],delete t[a]),!t[r]||l.objects.isFunction(t[r]))return;let n=Array.isArray(t[r]),d=Array.isArray(t[i]),h=Array.isArray(t[s]);if(!(n||d||h)&&t[i]===t[s]){t[a]=t[r],t[r]=0;return}let p=(t.data||[]).length;n?t[r].length<p&&t[r].push(...l.arrays.init(p-t[r].length,t[r][0])):t[r]=l.arrays.init(p,t[r]);let f=t[r],_=f.length,g=l.arrays.init(_,null);for(let b=0;b<_;b++){let C=d?t[i][b]:t[i],m=h?t[s][b]:t[s];g[b]=f[b],C===m&&(f[b]=0)}l.arrays.equals(f,g)||(t[a]=g)}_adjustMaxSegments(t){if(!t||!t.data||!t.type||!l.scout.isOneOf(t.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA,u.Type.RADAR))return;let e=t.options.maxSegments;if(!(e&&t.data.datasets.length&&e<t.data.datasets[0].data.length))return;t.data.datasets.forEach(a=>{let i=a.data.slice(0,e);i[e-1]=a.data.slice(e-1,a.data.length).reduce((s,n)=>s+n,0),a.data=i});let r=t.data.labels.slice(0,e);r[e-1]=this.chart.session.text("ui.OtherValues"),t.data.labels=r,t.data.maxSegmentsExceeded=!0}_isMaxSegmentsExceeded(t,e){return!l.scout.isOneOf(t.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA,u.Type.RADAR)||t.options.otherSegmentClickable||!t.data.maxSegmentsExceeded||!t.options.maxSegments?!1:t.options.maxSegments-1<=e}_adjustBubbleRadii(t){!t||!t.data||!t.type||t.type!==u.Type.BUBBLE||t.data.datasets.forEach(e=>e.data.forEach(r=>{isNaN(r.r)||(r.z=Math.pow(r.r,2)),r.r=1}))}_adjustOnlyIntegers(t){this.onlyIntegers=!0,!(!t||!t.data||!t.type)&&(l.scout.isOneOf(t.type,u.Type.BUBBLE,u.Type.SCATTER)?this.onlyIntegers=t.data.datasets.every(e=>e.data.every(r=>l.numbers.isInteger(r.x)&&l.numbers.isInteger(r.y))):this.onlyIntegers=t.data.datasets.every(e=>e.data.every(r=>l.numbers.isInteger(r))))}_adjustTooltip(t){if(!t)return;t.options=y().extend(!0,{},{plugins:{tooltip:{callbacks:{title:this._tooltipTitleGenerator,items:this._tooltipItemsGenerator,label:this._tooltipLabelGenerator,labelValue:this._tooltipLabelValueGenerator,labelColor:this._tooltipLabelColorGenerator}}}},t.options);let e=t.options.plugins.tooltip;e.enabled&&(e.enabled=!1,e.external=this._tooltipRenderer)}_generateTooltipTitle(t){if(!t||!t.length)return"";let e=t[0],r=e.chart,a=r.config,i=e.dataset,s=[];if(l.scout.isOneOf(a.type,u.Type.BUBBLE)){let n=a.options.scales.x,d=a.options.scales.y,h=this._getAxisLabels(a),c=n.ticks.callback(i.data[e.dataIndex].x,null,null);c&&s.push(this._createTooltipAttribute(h.x,l.strings.encode(c),!0));let p=d.ticks.callback(i.data[e.dataIndex].y,null,null);p&&s.push(this._createTooltipAttribute(h.y,l.strings.encode(p),!0))}else if(!l.scout.isOneOf(a.type,u.Type.SCATTER)){let n=r.data.labels[e.dataIndex];s.push(this._createTooltipAttribute(a.options.reformatLabels?this._formatLabel(n):n,"",!0))}return s}_getAxisLabels(t){let e=t.options.scales.x.title.text,r=t.options.scales.y.title.text;return e=this._resolveAxisLabel(e,Q.ARROW_LEFT_RIGHT),r=this._resolveAxisLabel(r," "+Q.ARROW_UP_DOWN+" "),{x:e,y:r}}_resolveAxisLabel(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return l.objects.isFunction(t)&&(t=t(),t=l.objects.isString(t)?t:""),t?l.strings.encode(t):e}_generateTooltipItems(t,e,r,a){if(!t||!t.length)return"";let i=t[0],s=i.chart,n=s.config,d=!1,h=!1,c="";if(t.forEach(p=>{let{label:f,labelValue:_,labelColor:g}=this._getItemDetails(p,e,r,a);if(l.scout.isOneOf(n.type,u.Type.SCATTER)){let{x:b,y:C}=_;d||(d=l.objects.isString(b)),h||(h=l.objects.isString(C)),c+=this._createTooltipScatterAttribute(f,b,C,!1,g)}else c+=this._createTooltipAttribute(f,_,!1,g)}),l.scout.isOneOf(n.type,u.Type.SCATTER)){let p="<table><tbody>",f=this._getAxisLabels(n);p+=this._createTooltipScatterAttribute("",d?f.x:"",h?f.y:"",!0);let _="</tbody></table>";c=l.strings.box(p,c,_)}return c}_getItemDetails(t,e,r,a){let i,s,n;return l.objects.isFunction(e)&&(i=e(t),i=l.objects.isString(i)?i:""),l.objects.isFunction(r)&&(s=r(t),s=l.objects.isString(s)||l.objects.isPlainObject(s)?s:""),l.objects.isFunction(a)&&(n=a(t),n=l.objects.isPlainObject(n)&&n.backgroundColor||""),{label:i,labelValue:s,labelColor:n}}_generateTooltipLabel(t){return l.strings.encode(t.dataset.label)}_generateTooltipLabelValue(t){let e=t.chart.config,r=t.dataset;return e.type===u.Type.BUBBLE?l.strings.encode(this._formatLabel(r.data[t.dataIndex].z)):e.type===u.Type.SCATTER?{x:l.strings.encode(this._formatLabel(r.data[t.dataIndex].x)),y:l.strings.encode(this._formatLabel(r.data[t.dataIndex].y))}:l.strings.encode(this._formatLabel(r.data[t.dataIndex]))}_generateTooltipLabelColor(t){let e=t.chart.config,r=t.dataset,a,i,s,n;l.scout.isOneOf(r.type||e.type,u.Type.LINE,u.Type.BAR,u.Type.BAR_HORIZONTAL,u.Type.RADAR,u.Type.BUBBLE,u.Type.SCATTER)&&(s=r.borderColor,a=Array.isArray(r.legendColor)?r.legendColor[t.dataIndex]:r.legendColor,n=t.datasetIndex),l.scout.isOneOf(e.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(a=Array.isArray(r.legendColor)?r.legendColor[t.dataIndex]:r.legendColor,i=Array.isArray(r.backgroundColor)?r.backgroundColor[t.dataIndex]:r.backgroundColor,i=this._adjustColorOpacity(i,1),n=t.dataIndex),l.objects.isFunction(a)&&(a=a.call(t.chart,n));let d=a||i||s;if(!d||l.objects.isFunction(d)){let h;L.Chart.overrides[e.type]&&L.Chart.overrides[e.type].plugins&&L.Chart.overrides[e.type].plugins.tooltip&&L.Chart.overrides[e.type].plugins.tooltip.callbacks&&(h=L.Chart.overrides[e.type].plugins.tooltip.callbacks.labelColor),d=(h||L.Chart.defaults.plugins.tooltip.callbacks.labelColor).call(t.chart,t).backgroundColor}return{backgroundColor:d}}_createTooltipAttribute(t,e,r,a){return'<div class="'+(r?"attribute title":"attribute")+'">'+(a?'<div class="color" style="background-color:'+a+'"></div>':"")+(t?"<label>"+t+"</label>":"")+(e?'<div class="value">'+e+"</div>":"")+"</div>"}_createTooltipScatterAttribute(t,e,r,a,i){return'<tr class="'+(a?"attribute title":"attribute")+'"><td class="color-cell">'+(i?'<div class="color" style="background-color:'+i+'"></div>':"")+'</td><td class="label">'+t+"</td>"+(e?'<td class="value">'+e+"</td>":"")+(r?'<td class="value">'+r+"</td>":"")+"</tr>"}_renderTooltip(t){if(t.tooltip.opacity===0||t.tooltip.dataPoints.length<1){this._tooltipTimeoutId&&(clearTimeout(this._tooltipTimeoutId),this._tooltipTimeoutId=void 0),this._tooltip&&(this._tooltip.destroy(),this._tooltip=null);return}!!this._tooltip?this._renderTooltipLater(t):(clearTimeout(this._tooltipTimeoutId),this._tooltipTimeoutId=setTimeout(()=>this._renderTooltipLater(t),l.tooltips.DEFAULT_TOOLTIP_DELAY))}_renderTooltipLater(t){if(!this.rendered||this.removing)return;let e=t.tooltip,r=e.dataPoints;if(r.length<1)return;let a=r[0];if(!a.chart.getDatasetMeta(a.datasetIndex).data[a.dataIndex])return;this._tooltip&&(this._tooltip.destroy(),this._tooltip=null);let s=e.options||{},n=s.callbacks||{},d=n.title,h=n.items,c=n.label,p=n.labelValue,f=n.labelColor,_="";l.objects.isFunction(d)&&(_+=l.arrays.ensure(d(r)).join("")),l.objects.isFunction(h)&&(_+=l.arrays.ensure(h(r,c,p,f)).join(""));let g=this._computeTooltipPositionAndOffset(a),b=new l.Point(e.caretX+g.offsetX,e.caretY+g.offsetY);this._tooltip=l.scout.create({objectType:l.Tooltip,parent:this.chart,$anchor:this.$canvas,text:_,htmlEnabled:!0,cssClass:l.strings.join(" ","chart-tooltip",s.cssClass),tooltipPosition:g.tooltipPosition,tooltipDirection:g.tooltipDirection,originProducer:x=>{const B=l.graphics.offsetBounds(x);return B.height=g.height,B},offsetProducer:x=>b}),this._tooltip.render(),this._tooltip.$container.css("pointer-events","none");let C=!1,m=(s.titleFont||{}).family;m&&(this._tooltip.$container.css("--chart-tooltip-font-family",m),C=!0);let T=0;this._tooltip.$container.find("label").each((x,B)=>{T=Math.max(T,l.graphics.prefSize(y()(B)).width)}),T>0&&(this._tooltip.$container.css("--chart-tooltip-label-width",Math.min(T,120)+"px"),C=!0),C&&this._tooltip.position()}_computeTooltipPositionAndOffset(t){let e="top",r="right",a=0,i=0,s=0,n=t.chart,d=t.datasetIndex,h=t.dataIndex,c=n.config,p=c.data.datasets,f=p[d],_=f.data[h];if(this._isHorizontalBar(c))l.objects.isPlainObject(_)&&l.objects.isArray(_.x)&&_.x.length===2?r=(_.x[0]+_.x[1])/2<0?"left":"right":r=_<0?"left":"right";else if((f.type||c.type)===u.Type.BAR)e=_<0?"bottom":"top";else if(l.scout.isOneOf(c.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)){let g=n.getDatasetMeta(d).data[h].getProps(["startAngle","endAngle"]),b=g.startAngle,C=g.endAngle,m=(b+C)/2;e=0<=m&&m<Math.PI?"bottom":"top",r=-Math.PI/2<=m&&m<Math.PI/2?"right":"left"}else if(c.type===u.Type.RADAR){let b=n.getDatasetMeta(d).data[h].getProps(["angle"]).angle;e=0<=b&&b<Math.PI?"bottom":"top",r=-Math.PI/2<=b&&b<Math.PI/2?"right":"left"}else if(l.scout.isOneOf(c.type,u.Type.BUBBLE,u.Type.SCATTER)){let g=n.getDatasetMeta(d).data[h],b=n.chartArea,C=b.left+b.width/2;r=g.x<C?"left":"right"}if(this._isHorizontalBar(c)){let g=n.getDatasetMeta(d).data[h].getProps(["height","width"]);s=g.height;let b=g.width,C=b/(oe+1);i=-s/2,a=r==="left"?C:-C}else if(l.scout.isOneOf(c.type,u.Type.LINE,u.Type.BUBBLE,u.Type.SCATTER,u.Type.RADAR)||f.type===u.Type.LINE){let b=n.getDatasetMeta(d).data[h].options,C=b.hoverRadius+b.hoverBorderWidth;c.type===u.Type.BUBBLE&&(C+=_.r),s=2*C,i=-C}else if(l.scout.isOneOf(c.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)){let g=n.getDatasetMeta(d).data[h].getProps(["startAngle","endAngle","innerRadius","outerRadius"]),b=g.startAngle,C=g.endAngle,m=(b+C)/2,T=g.innerRadius,x=g.outerRadius,B=(x-T)/2;a=B*Math.cos(m),i=B*Math.sin(m)}return{tooltipPosition:e,tooltipDirection:r,offsetX:a,offsetY:i,height:s}}_adjustGrid(t){t&&(t.options=y().extend(!0,{},t.options),this._adjustScalesR(t),this._adjustScalesXY(t))}_adjustScalesR(t){if(!t||!t.type||!t.options)return;l.scout.isOneOf(t.type,u.Type.POLAR_AREA,u.Type.RADAR)&&(t.options=y().extend(!0,{},{scales:{r:{}}},t.options));let e=t.options,r=e?e.scales:{};r&&r.r&&(r.r=y().extend(!0,{},{minSpaceBetweenTicks:35,beginAtZero:!0,angleLines:{display:!1},ticks:{callback:this._labelFormatter},pointLabels:{font:{size:L.Chart.defaults.font.size}}},r.r))}_adjustScalesXY(t){!t||!t.type||!t.options||(l.scout.isOneOf(t.type,u.Type.BAR,u.Type.LINE,u.Type.BUBBLE)?t.options=y().extend(!0,{},{scales:{x:{minSpaceBetweenTicks:150},y:{minSpaceBetweenTicks:35}}},t.options):l.scout.isOneOf(t.type,u.Type.SCATTER)&&(t.options=y().extend(!0,{},{scales:{x:{minSpaceBetweenTicks:35,ticks:{padding:10}},y:{minSpaceBetweenTicks:35,ticks:{padding:10}}}},t.options)),this._adjustXAxis(t),this._adjustYAxis(t))}_adjustXAxis(t){if(!t||!t.type||!t.options||!t.options.scales||!t.options.scales.x)return;let e=t.type,r=t.options.scales;this._isHorizontalBar(t)||l.scout.isOneOf(e,u.Type.BUBBLE,u.Type.SCATTER)?r.x=y().extend(!0,{},{beginAtZero:this._isHorizontalBar(t),offset:e===u.Type.BUBBLE,grid:{drawTicks:!1},border:{display:!1},ticks:{padding:5}},r.x):r.x=y().extend(!0,{},{offset:!0,grid:{display:!1},border:{display:!1}},r.x),(this._isHorizontalBar(t)||l.scout.isOneOf(e,u.Type.BUBBLE,u.Type.SCATTER)||t.options.reformatLabels)&&(r.x=y().extend(!0,{},{ticks:{callback:this._xLabelFormatter}},r.x)),r.x.afterCalculateLabelRotation=this._xAxisFitter}_adjustYAxis(t){if(!t||!t.type||!t.options||!t.options.scales||!t.options.scales.y)return;let e=t.type,r=t.options.scales;this._isHorizontalBar(t)?r.y=y().extend(!0,{},{grid:{display:!1},border:{display:!1}},r.y):r.y=y().extend(!0,{},{beginAtZero:!l.scout.isOneOf(e,u.Type.BUBBLE,u.Type.SCATTER),grid:{drawTicks:!1},border:{display:!1},ticks:{padding:5}},r.y),(!this._isHorizontalBar(t)||t.options.reformatLabels)&&(r.y=y().extend(!0,{},{ticks:{callback:this._yLabelFormatter}},r.y)),r.y.afterFit=this._yAxisFitter}_adjustPlugins(t){this._adjustPluginsDatalabels(t)}_adjustPluginsDatalabels(t){if(!t||!t.type||!t.options||!t.options.plugins||!t.options.plugins.datalabels||!t.options.plugins.datalabels.display)return;let e=t.options.plugins;if(l.scout.isOneOf(t.type,u.Type.PIE,u.Type.DOUGHNUT)){e.datalabels=y().extend(!0,{},{formatter:this._radialChartDatalabelsFormatter},e.datalabels),e.datalabels.display=this._radialChartDatalabelsDisplayHandler,this._updatingDatalabels=!1;let r=t.options.animation||{},a=r.onProgress,i=r.onComplete,s=d=>{if(this._updatingDatalabels)return;this._updatingDatalabels=!0;let h=d.chart,c=h.getSortedVisibleDatasetMetas(),p=[...h.getActiveElements()],f=[];c.forEach((_,g)=>{_.data.forEach((b,C)=>{let m=l.arrays.findIndex(p,T=>T.datasetIndex===g&&T.index===C);m>0?p.splice(m,1):f.push({datasetIndex:g,index:C,element:b})})}),h["$"+vt.default.id]._actives=f,vt.default.afterEvent(h,null,null),this._updatingDatalabels=!1},n=(d,h)=>{s(d),h&&h(d)};t.options.animation=y().extend(!0,{},t.options.animation,{onProgress:d=>n(d,a),onComplete:d=>n(d,i)})}else l.scout.isOneOf(t.type,u.Type.BAR,u.Type.LINE,u.Type.POLAR_AREA,u.Type.RADAR,u.Type.BUBBLE)?(e.datalabels=y().extend(!0,{},{backgroundColor:this._datalabelBackgroundColorHandler,borderRadius:3},e.datalabels),e.datalabels.display="auto"):l.scout.isOneOf(t.type,u.Type.SCATTER)&&(e.datalabels=y().extend(!0,{},{backgroundColor:this._datalabelBackgroundColorHandler,borderRadius:3,anchor:"end",align:"top",offset:3},e.datalabels),e.datalabels.display="auto");if(t.options.reformatLabels){let r=a=>(i,s)=>{let n=a.call(s.chart,i,s);return this._formatLabel(n)};t.data&&t.data.datasets.forEach(i=>{i.datalabels&&i.datalabels.formatter&&(i.datalabels.formatter=r(i.datalabels.formatter))}),e.datalabels.formatter&&(e.datalabels.formatter=r(e.datalabels.formatter))}e.datalabels=y().extend(!0,{},{formatter:this._datalabelsFormatter},e.datalabels)}_formatLabel(t){return this._formatLabelMap(t,null,this._getNumberFormatter())}_getNumberFormatter(){if(this.chartJs&&this.chartJs.config&&this.chartJs.config.options)return this.chartJs.config.options.numberFormatter}_formatXLabel(t){return this._formatLabelMap(t,this._getXLabelMap(),this._getNumberFormatter())}_formatYLabel(t){return this._formatLabelMap(t,this._getYLabelMap(),this._getNumberFormatter())}_getXLabelMap(){return this._getLabelMap("xLabelMap")}_getYLabelMap(){return this._getLabelMap("yLabelMap")}_getLabelMap(t){if(this.chartJs&&this.chartJs.config&&this.chartJs.config.options)return this.chartJs.config.options[t]}_formatLabelMap(t,e,r){return e?e[t]:isNaN(t)||typeof t=="string"?""+t:r?r(t,this._formatNumberLabel.bind(this)):this._formatNumberLabel(t)}_formatNumberLabel(t){if(isNaN(t))return""+t;let e=Math.abs(t),r="";if(e>=1e6){e=e/1e6,r=" "+this.chart.session.text("ui.Mio");let a=[this.chart.session.text("ui.Mrd"),this.chart.session.text("ui.Bio"),this.chart.session.text("ui.Brd"),this.chart.session.text("ui.Tri"),this.chart.session.text("ui.Trd")];for(let i=0;i<a.length&&e>=1e3;i++)e=e/1e3,r=" "+a[i]}return this.session.locale.decimalFormat.format(Math.sign(t)*e)+r}_fitXAxis(t){if(!t||t.labelRotation===0)return;let e=this.maxXAxesTicksHeight,r=L.Chart.defaults.font,a=L.Chart.defaults.scale.ticks,i=a.font||{},s,n;if(this.chartJs){let f=this.chartJs.chartArea,_=Math.abs(f.top-f.bottom);e=Math.min(e,_/3)}t.options&&t.options.ticks&&(n=t.options.ticks.maxRotation,s=(t.options.ticks.font||{}).size),n=n||a.maxRotation,s=s||i.size||r.size,isNaN(t.labelRotation)&&(t.labelRotation=n),t.height=isNaN(t.height)?e:Math.min(t.height,e);let d=t.labelRotation,h=(e-s*Math.sin((90-d)/180*Math.PI))/Math.sin(d/180*Math.PI);if(((t._labelSizes||{}).widest||{}).width>h){let f=t.ctx.measureText.bind(t.ctx);t.ticks.forEach(_=>{_.label=l.strings.truncateText(_.label,h,f)}),t._labelSizes=void 0}}_fitYAxis(t){if(!t)return;let e=0,r=0;if(t.options&&t.options.ticks&&(e=t.options.ticks.padding||0),t.options&&t.options.grid&&(r=t.options.grid.tickLength||0),((t._labelSizes||{}).widest||{}).width>t.maxWidth-e){let s=t.maxWidth-e-r,n=t.ctx.measureText.bind(t.ctx);t.ticks.forEach(d=>{d.label=l.strings.truncateText(d.label,s,n)})}}_displayDatalabelsOnRadialChart(t){let e=t.chart.getDatasetMeta(t.datasetIndex).data[t.dataIndex].getProps(["startAngle","endAngle","innerRadius","outerRadius"]),r=(e.outerRadius+e.innerRadius)/2,a=Math.min(e.endAngle-e.startAngle,Math.PI)/2,i=Math.abs(Math.sin(a))*r,s=i*2,n=e.outerRadius-e.innerRadius;return Math.min(s,n)>this.minRadialChartDatalabelSpace}_formatDatalabelsOnRadialChart(t,e){let r=this._computeSumOfVisibleElements(e),a=e.dataset,i=0,s=[];for(let n=0;n<e.dataIndex+1;n++){let d=a.data[n]/r*100-i,h=Math.round(d);i=h-d,s.push(h+"%")}return s[e.dataIndex]}_computeSumOfVisibleElements(t){let e=t.dataset,r=t.chart,a=0;for(let i=0;i<e.data.length;i++)r.getDataVisibility(i)&&(a+=e.data[i]);return a}_formatDatalabels(t,e){let r=e.chart.config;return r.type===u.Type.BUBBLE?this._formatLabel(t.z):r.type===u.Type.SCATTER?l.strings.join(" / ",this._formatLabel(t.x),this._formatLabel(t.y)):this._formatLabel(t)}_getBackgroundColorOfDataset(t){return t.dataset.backgroundColor}_adjustColors(t){this._adjustColorSchemeCssClass(t),this._adjustDatasetColors(t),this._adjustLegendColors(t),this._adjustScalesRColors(t),this._adjustScalesXYColors(t),this._adjustPluginColors(t)}_adjustColorSchemeCssClass(t){!t||!t.options||(this.colorSchemeCssClass=l.colorSchemes.getCssClasses(t.options.colorScheme).join(" "))}_adjustDatasetColors(t){if(!t||!t.data||!t.type)return;let e=t.data,r=t.type,a=t.options&&t.options.autoColor,i=t.options&&t.options.checkable,s=a&&l.scout.isOneOf(r,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA),n={backgroundColors:[],borderColors:[],hoverBackgroundColors:[],hoverBorderColors:[],checkedBackgroundColors:[],checkedHoverBackgroundColors:[],legendColors:[],pointHoverColors:[]};n=y().extend(!0,n,this._computeDatasetColors(t,s)),e.datasets.forEach((d,h)=>{const c=T=>{let x=T[h];return s&&!Array.isArray(x)&&(x=T),x};let p=c(n.backgroundColors),f=c(n.borderColors),_=c(n.hoverBackgroundColors),g=c(n.hoverBorderColors),b=c(n.legendColors),C=c(n.pointHoverColors),m=(T,x)=>{typeof d[T]!="function"&&x&&x.length&&(d[T]=Array.isArray(x)?[...x]:x)};if(m("backgroundColor",p),m("borderColor",f),m("hoverBackgroundColor",_),m("hoverBorderColor",g),m("legendColor",b),(l.scout.isOneOf(r,u.Type.LINE,u.Type.RADAR)||r===u.Type.BAR&&d.type===u.Type.LINE)&&(m("pointHoverBackgroundColor",C),m("pointBorderColor",this.firstOpaqueBackgroundColor),m("pointHoverBorderColor",this.firstOpaqueBackgroundColor)),i){const T=d.data.length,x=B=>Array.isArray(B)?B:l.arrays.init(T,B);if(l.scout.isOneOf(r,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA,u.Type.BUBBLE,u.Type.SCATTER)||r===u.Type.BAR&&(d.type||u.Type.BAR)===u.Type.BAR){let B=x(p),j=x(_),U=x(c(n.checkedBackgroundColors)),W=x(c(n.checkedHoverBackgroundColors));m("uncheckedBackgroundColor",B),m("uncheckedHoverBackgroundColor",j),m("checkedBackgroundColor",U),m("checkedHoverBackgroundColor",W),m("backgroundColor",d.uncheckedBackgroundColor),m("hoverBackgroundColor",d.uncheckedHoverBackgroundColor)}else if(l.scout.isOneOf(r,u.Type.LINE,u.Type.RADAR)||r===u.Type.BAR&&d.type===u.Type.LINE){let B=x(C),j=x(C),U=x(f),W=x(g||f);m("uncheckedPointBackgroundColor",B),m("uncheckedPointHoverBackgroundColor",j),m("checkedPointBackgroundColor",U),m("checkedPointHoverBackgroundColor",W),m("pointBackgroundColor",d.uncheckedPointBackgroundColor),m("pointHoverBackgroundColor",d.uncheckedPointHoverBackgroundColor);let Y=l.arrays.init(T,((t.options.elements||{}).point||{}).radius||L.Chart.defaults.elements.point.radius),F=l.arrays.init(T,(((t.options.elements||{}).point||{}).hoverRadius||L.Chart.defaults.elements.point.hoverRadius)-1);m("uncheckedPointRadius",Y),m("checkedPointRadius",F),m("pointRadius",d.uncheckedPointRadius)}}this._adjustDatasetBorderWidths(d)}),i&&this._checkItems(t)}_computeDatasetColors(t,e){if(!t||!t.data||!t.type)return{};let r=t.data,a=t.type,i={};if(t.options&&t.options.autoColor)i=this._computeDatasetColorsAutoColor(t,e);else if(i=this._computeDatasetColorsChartValueGroups(t,e),l.scout.isOneOf(a,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)){let s=this._computeBorderColor(a,0);i.borderColors=l.arrays.init(r.datasets.length,s),i.hoverBorderColors=i.borderColors}return i}_computeDatasetColorsAutoColor(t,e){if(!t||!t.data||!t.type||!t.options||!t.options.autoColor)return{};let r=t.data,a=t.type,i=t.options&&t.options.checkable,s=t.options&&t.options.transparent,n={backgroundColors:[],borderColors:[],hoverBackgroundColors:[],hoverBorderColors:[],checkedBackgroundColors:[],checkedHoverBackgroundColors:[],legendColors:[],pointHoverColors:[]},d=[];return e?d=l.arrays.init(r.datasets.length&&r.datasets[0].data.length||0,a):r.datasets.forEach(h=>d.push(h.type||a)),d.forEach((h,c)=>{n.backgroundColors.push(this._computeBackgroundColor(h,c,i||s)),n.borderColors.push(this._computeBorderColor(h,c)),n.hoverBackgroundColors.push(this._computeHoverBackgroundColor(h,c,i||s)),n.hoverBorderColors.push(this._computeHoverBorderColor(h,c)),n.checkedBackgroundColors.push(this._computeCheckedBackgroundColor(h,c,i)),n.checkedHoverBackgroundColors.push(this._computeCheckedHoverBackgroundColor(h,c,i)),n.legendColors.push(this._computeLegendColor(h,c)),n.pointHoverColors.push(this._computePointHoverColor(h,c))}),n}_computeBackgroundColor(t,e,r){return l.styles.get([this.colorSchemeCssClass,t+"-chart"+(r?" checkable":""),"elements","color"+e%this.numSupportedColors],"fill").fill}_computeBorderColor(t,e){let r;return l.scout.isOneOf(t,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(r={stroke:this.firstOpaqueBackgroundColor}),l.styles.get([this.colorSchemeCssClass,t+"-chart","elements","stroke-color"+e%this.numSupportedColors],"stroke",r).stroke}_computeHoverBackgroundColor(t,e,r){return l.styles.get([this.colorSchemeCssClass,t+"-chart"+(r?" checkable":""),"elements","color"+e%this.numSupportedColors+" hover"],"fill").fill}_computeHoverBorderColor(t,e){let r;return l.scout.isOneOf(t,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(r={stroke:this.firstOpaqueBackgroundColor}),l.styles.get([this.colorSchemeCssClass,t+"-chart","elements","stroke-color"+e%this.numSupportedColors+" hover"],"stroke",r).stroke}_computeCheckedBackgroundColor(t,e,r){return l.styles.get([this.colorSchemeCssClass,t+"-chart"+(r?" checkable":""),"elements","color"+e%this.numSupportedColors+" checked"],"fill").fill}_computeCheckedHoverBackgroundColor(t,e,r){return l.styles.get([this.colorSchemeCssClass,t+"-chart"+(r?" checkable":""),"elements","color"+e%this.numSupportedColors+" hover checked"],"fill").fill}_computeLegendColor(t,e){return l.styles.get([this.colorSchemeCssClass,t+"-chart","elements","color"+e%this.numSupportedColors+" legend"],"fill").fill}_computePointHoverColor(t,e){return l.styles.get([this.colorSchemeCssClass,t+"-chart","elements","color"+e%this.numSupportedColors+" point hover"],"fill").fill}_computeDatasetColorsChartValueGroups(t,e){if(!t||!t.type||!this.chart.data)return{};let r=t.type,a=t.options&&t.options.checkable,i=t.options&&t.options.transparent,s={backgroundColors:[],borderColors:[],hoverBackgroundColors:[],hoverBorderColors:[],checkedBackgroundColors:[],checkedHoverBackgroundColors:[],legendColors:[],pointHoverColors:[]};return this.chart.data.chartValueGroups.forEach(n=>{let d=1,h=1,c=.1,p=.1,f=.2,_=.35,g=1,b=0,C=1,m=.1;l.scout.isOneOf(r,u.Type.PIE,u.Type.DOUGHNUT)?(f=.7,_=.85,b=.1,m=0):r===u.Type.POLAR_AREA?(d=.7,h=.85,f=.7,_=.85,b=.1,m=0):l.scout.isOneOf(n.type||r,u.Type.LINE,u.Type.RADAR)?(d=.2,h=.35,c=0,p=0,g=.2,C=.35,m=0):l.scout.isOneOf(r,u.Type.BUBBLE,u.Type.SCATTER)&&(d=.2,h=.35,c=0);const T=[],x=[],B=[],j=[],U=[],W=[],Y=[],F=[];let G=l.arrays.ensure(n.colorHexValue);const tt=l.arrays.length(n.values);G.length&&G.length<tt&&(G=l.arrays.init(tt,null).map((I,lt)=>G[lt%G.length])),G.forEach(I=>{const lt=l.styles.hexToRgb(I),V=(ht,dt)=>this._adjustColorOpacity(l.styles.darkerColor(lt,dt),ht);T.push(V(a||i?f:d,0)),x.push(V(1,0)),B.push(V(a||i?_:h,a||i?0:c)),j.push(V(1,p)),U.push(V(g,b)),W.push(V(C,m)),Y.push(V(1,0)),F.push(V(1,0))}),s.backgroundColors.push(T),s.borderColors.push(x),s.hoverBackgroundColors.push(B),s.hoverBorderColors.push(j),s.checkedBackgroundColors.push(U),s.checkedHoverBackgroundColors.push(W),s.legendColors.push(Y),s.pointHoverColors.push(F)}),s.datalabelColor=this._computeDatalabelColor(r),s}_adjustColorOpacity(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return!t||typeof t=="function"?t:t.indexOf("rgb")===0?this._adjustRgbColorOpacity(t,e):t.indexOf("#")===0?this._adjustHexColorOpacity(t,e):t}_adjustRgbColorOpacity(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;if(!t||t.indexOf("rgb")!==0)return t;let r=l.styles.rgb(t);return r.alpha=e,"rgba("+r.red+", "+r.green+", "+r.blue+", "+r.alpha+")"}_adjustHexColorOpacity(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return!t||t.indexOf("#")!==0||!(t.length===4||t.length===5||t.length===7||t.length===9)?t:this._adjustRgbColorOpacity(l.styles.hexToRgb(t),e)}_adjustLegendColors(t){!t||!t.type||!t.options||(t.options=y().extend(!0,{},t.options,{plugins:{legend:{labels:{color:this._computeLabelColor(t.type),generateLabels:this._legendLabelGenerator}}}}))}_computeLabelColor(t){return l.styles.get([this.colorSchemeCssClass,t+"-chart","elements","label"],"fill").fill}_generateLegendLabels(t){let e=t.config,r;L.Chart.overrides[e.type]&&L.Chart.overrides[e.type].plugins&&L.Chart.overrides[e.type].plugins.legend&&L.Chart.overrides[e.type].plugins.legend.labels&&(r=L.Chart.overrides[e.type].plugins.legend.labels.generateLabels);let i=(r||L.Chart.defaults.plugins.legend.labels.generateLabels).call(t,t);if(this.removing)return i;let s=e.data,n=t.ctx.measureText.bind(t.ctx),d=t.legend,h=d.getProps(["width","maxWidth"]),c=((d||{}).options||{}).labels||{},p=c.boxWidth||0,f=c.padding||0,_;return l.scout.isOneOf(e.options.plugins.legend.position,u.Position.LEFT,u.Position.RIGHT)?((h.maxWidth||d.width)&&(_=Math.max((h.maxWidth||d.width)-p-2*f,0)),_=Math.min(250,_||0,this.$canvas.cssWidth()/3)):_=Math.min(250,this.$canvas.cssWidth()*2/3),i.forEach((g,b)=>{g.text=l.strings.truncateText(g.text,_,n);let C=s.datasets[b],m,T,x;C&&l.scout.isOneOf(C.type||e.type,u.Type.LINE,u.Type.BAR,u.Type.RADAR,u.Type.BUBBLE,u.Type.SCATTER)?(m=l.arrays.ensure(C.legendColor)[0],T=this._adjustColorOpacity(C.borderColor,1)):s.datasets.length&&l.scout.isOneOf(e.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(C=s.datasets[0],m=Array.isArray(C.legendColor)?C.legendColor[b]:C.legendColor,x=Array.isArray(C.backgroundColor)?C.backgroundColor[b]:C.backgroundColor,x=this._adjustColorOpacity(x,1)),l.objects.isFunction(m)&&(m=m.call(t,b));let B=m||x||T;l.objects.isFunction(B)||(g.fillStyle=B,g.strokeStyle=B)}),i}_adjustScalesRColors(t){if(!t||!t.type||!t.options||!t.options.scales||!t.options.scales.r)return;let e=this._computeLabelColor(t.type),r=this._computeLabelBackdropColor(t.type),a=this._computeGridColor(t.type),i=this._computeScaleTicksColor(t.type);t.options.scales.r.ticks=y().extend(!0,{},t.options.scales.r.ticks,{color:i,backdropColor:r}),t.options.scales.r.pointLabels=y().extend(!0,{},t.options.scales.r.pointLabels,{color:e}),t.options.scales.r.grid=y().extend(!0,{},t.options.scales.r.grid,{color:a})}_computeLabelBackdropColor(t){return l.styles.get([this.colorSchemeCssClass,t+"-chart","elements","label-backdrop"],"fill",{fill:this.firstOpaqueBackgroundColor}).fill}_computeGridColor(t){return l.styles.get([this.colorSchemeCssClass,t+"-chart","elements","grid"],"fill").fill}_computeScaleTicksColor(t){return l.styles.get([this.colorSchemeCssClass,t+"-chart","elements","scale-ticks"],"fill").fill}_adjustScalesXYColors(t){if(!t||!t.type||!t.options||!t.options.scales)return;let e=[];if(t.options.scales.x&&e.push(t.options.scales.x),t.options.scales.y&&e.push(t.options.scales.y),!e.length)return;let r=this._computeLabelColor(t.type),a=this._computeGridColor(t.type),i=this._computeAxisLabelColor(t.type);e.forEach(s=>{s.grid=y().extend(!0,{},s.grid,{color:a}),s.ticks=y().extend(!0,{},s.ticks,{color:r}),s.title=y().extend(!0,{},s.title,{color:i})})}_computeAxisLabelColor(t){return l.styles.get([this.colorSchemeCssClass,t+"-chart","elements","axis-label"],"fill").fill}_adjustPluginColors(t){!t||!t.type||!t.options||!t.options.plugins||this._adjustPluginsDatalabelColors(t)}_adjustPluginsDatalabelColors(t){!t||!t.type||!t.options||!t.options.plugins||!t.options.plugins.datalabels||(t.options.plugins.datalabels=y().extend(!0,{},t.options.plugins.datalabels,{color:this._computeDatalabelColor(t.type)}))}_computeDatalabelColor(t){return l.styles.get([this.colorSchemeCssClass,t+"-chart","elements","datalabel"],"fill").fill}_adjustClickHandler(t){if(!t||!t.options||(t.options.clickable?(t.options.onClick=this._clickHandler,t.options.onHover=this._pointerHoverHandler):t.options.onHover=this._hoverHandler,!t.options.plugins||!t.options.plugins.legend))return;let e=t.options.plugins.legend;e.clickable?(e.onClick=this._legendClickHandler,e.onHover=this._legendPointerHoverHandler,e.onLeave=this._legendPointerLeaveHandler):(e.onClick=r=>r.native.stopPropagation(),e.onHover=this._legendHoverHandler,e.onLeave=this._legendLeaveHandler)}_onClick(t,e){if(!e.length)return;let r=this._selectRelevantItem(e);if(this._isMaxSegmentsExceeded(this.chartJs.config,r.index))return;let a=r.index,i=r.datasetIndex,s={datasetIndex:i,dataIndex:a};if(l.scout.isOneOf(this.chartJs.config.type,u.Type.BUBBLE,u.Type.SCATTER)){let n=this.chartJs.config.data.datasets[i].data[a];s.xIndex=n.x,s.yIndex=n.y}else s.xIndex=a;this.chart.handleValueClick(s,t.native)}_selectRelevantItem(t){let e=this.chartJs.config.data.datasets,r=t[0];return this.chartJs.config.type===u.Type.BUBBLE&&t.forEach(a=>{e[a.datasetIndex].data[a.index].z<=e[r.datasetIndex].data[r.index].z&&(r=a)}),r}_onHover(t,e){if(!this.chartJs.config||!this.chartJs.config.type)return;let r=this.chartJs.config,a=r.type;if(!l.scout.isOneOf(a,u.Type.LINE,u.Type.BAR,u.Type.RADAR))return;let i=!1;this.resetDatasetAfterHover&&(this._restoreBackgroundColor(),this.resetDatasetAfterHover=!1,i=!0),e.forEach(s=>{let n=r.data.datasets[s.datasetIndex];l.scout.isOneOf(n.type||a,u.Type.LINE,u.Type.RADAR)&&(this._setHoverBackgroundColor(n),this.resetDatasetAfterHover=!0,i=!0)}),i&&this.refresh()}_onHoverPointer(t,e){this._onHover(t,e),!(!this.rendered||this.removing)&&(e.length&&!this._isMaxSegmentsExceeded(this.chartJs.config,e[0].index)?this.$canvas.css("cursor","pointer"):this.$canvas.css("cursor","default"))}_onLegendClick(t,e,r){if(!this.chartJs.config||!this.chartJs.config.type)return;let a=this.chartJs.config.type,i;L.Chart.overrides[a]&&L.Chart.overrides[a].plugins&&L.Chart.overrides[a].plugins.legend&&(i=L.Chart.overrides[a].plugins.legend.onClick),(i||L.Chart.defaults.plugins.legend.onClick).call(this.chartJs,t,e,r),this._onLegendLeave(t,e,r),this._onLegendHoverPointer(t,e,r)}_onLegendHover(t,e,r){let a=e.datasetIndex,i=this.chartJs.config,s=i.type;if(l.scout.isOneOf(s,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(a=e.index),this.legendHoverDatasets.indexOf(a)>-1)return;let n=i.data.datasets[a];((n?n.type:null)||s)===u.Type.LINE&&(this._setHoverBackgroundColor(n),this.refresh()),this._updateHoverStyle(a,!0),this.chartJs.render(),this.legendHoverDatasets.push(a)}_onLegendHoverPointer(t,e,r){this._onLegendHover(t,e,r),!(!this.rendered||this.removing)&&this.$canvas.css("cursor","pointer")}_onLegendLeave(t,e,r){let a=e.datasetIndex,i=this.chartJs.config,s=i.type;if(l.scout.isOneOf(s,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(a=e.index),this.legendHoverDatasets.indexOf(a)<0)return;let n=i.data.datasets[a];((n?n.type:null)||s)===u.Type.LINE&&(this._restoreBackgroundColor(n),this.refresh()),this._updateHoverStyle(a,!1),this.chartJs.render(),this.legendHoverDatasets.splice(this.legendHoverDatasets.indexOf(a),1)}_setHoverBackgroundColor(t){t&&(t.backgroundColorBackup=t.backgroundColor,t.backgroundColor=t.hoverBackgroundColor,this._adjustDatasetBorderWidths(t))}_restoreBackgroundColor(t){t?(t.backgroundColor=t.backgroundColorBackup||t.backgroundColor,delete t.backgroundColorBackup,this._adjustDatasetBorderWidths(t)):this.chartJs.config.data.datasets.forEach(e=>this._restoreBackgroundColor(e))}_onLegendLeavePointer(t,e,r){this._onLegendLeave(t,e,r),!(!this.rendered||this.removing)&&this.$canvas.css("cursor","default")}_updateHoverStyle(t,e){let r=this.chartJs.config,a=r.type,i,s=[],n=r.data.datasets,d=n?n[t]:null,h=d?d.type:null;l.scout.isOneOf(a,u.Type.LINE,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA,u.Type.SCATTER)||h===u.Type.LINE?i="point":i="dataset",l.scout.isOneOf(a,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)?this.chartJs.getSortedVisibleDatasetMetas().forEach((c,p)=>s.push({element:c.data[t],datasetIndex:p,index:t})):this.chartJs.getDatasetMeta(t).data.forEach((c,p)=>s.push({element:c,datasetIndex:t,index:p})),s&&s.length&&this.chartJs.updateHoverStyle(s,i,e)}_adjustResizeHandler(t){!t||!t.options||t.options.handleResize&&(t.options.onResize=this._resizeHandler)}_onResize(t,e){t.update(),this._adjustSize(t.config,t.chartArea)}_adjustSize(t,e){this._adjustBubbleSizes(t,e),this._adjustGridMaxMin(t,e)}_adjustBubbleSizes(t,e){if(t.type!==u.Type.BUBBLE)return;let r=t.data.datasets;r.forEach(p=>p.data.forEach(f=>{isNaN(f.z)||(f.r=Math.sqrt(f.z))}));let a=this._computeMaxMinValue(t,r,"r",!0),i=a.maxValue,s=a.minValue,n=1,d=0,h=(t.options||{}).bubble?t.options.bubble.sizeOfLargestBubble:0,c=(t.options||{}).bubble?t.options.bubble.minBubbleSize:0;if(h){let p=Math.abs(e.right-e.left),f=Math.abs(e.top-e.bottom);h=Math.min(h,Math.floor(Math.min(p,f)/6)),i===0?d=h:c&&h>c&&s/i<c/h?(n=(h-c)/(i-s),d=c-n*s):n=h/i}else c&&c>s&&(s===0?d=c:n=c/s);r.forEach(p=>p.data.forEach(f=>{l.objects.isNullOrUndefined(f.r)||(f.r=f.r*n+d)}))}_computeMaxMinValue(t,e,r,a,i,s,n){if(!e)return;let d,h;if(t.type===u.Type.SCATTER&&r==="r")d=0,h=0;else for(let _=0;_<e.length;_++)for(let g=0;g<e[_].data.length;g++){let b;r?b=e[_].data[g][r]:b=e[_].data[g],isNaN(d)?d=b:d=Math.max(b,d),isNaN(h)?h=b:h=Math.min(b,h)}isNaN(d)&&(d=0),isNaN(h)&&(h=0);let c=0,p=d,f=h;if(a||(i&&Math.sign(h)===Math.sign(d)&&(c=Math.floor(h)),p=this._calculateBoundary(d-c,Math.ceil,Math.floor),f=this._calculateBoundary(h-c,Math.floor,Math.ceil)),s&&n&&n>2*s){let _=(d-h)/(n-2*s),g=_*s;p=Math.max(p,d-c+g),f=Math.min(f,h-c-g)}return a?{maxValue:p,minValue:f}:{maxValue:p+c,minValue:f+c}}_calculateBoundary(t,e,r){let a=e,i=!1;return t<0&&(i=!0,t=t*-1,a=r),t=this._calculateBoundaryPositive(t,a),i&&(t=t*-1),t}_calculateBoundaryPositive(t,e){if(!(t>0)||!e)return t;let r=Math.floor(Math.log(t)/Math.LN10);return r<0?t=e(t*Math.pow(10,Math.abs(r))/5)*5/Math.pow(10,Math.abs(r)):t=e(t/(5*Math.pow(10,r-1)))*5*Math.pow(10,r-1),t}_adjustGridMaxMin(t,e){if(!t||!t.type||!t.options||!t.options.adjustGridMaxMin||!t.options.scales||!e)return;let r=t.type;if(!l.scout.isOneOf(r,u.Type.BAR,u.Type.LINE,u.Type.POLAR_AREA,u.Type.RADAR,u.Type.BUBBLE,u.Type.SCATTER))return;let a=t.options.scales,i=a.x,s=a.y,n=a.r,d=i?i.minSpaceBetweenTicks:1,h=s?s.minSpaceBetweenTicks:1;n&&(d=n.minSpaceBetweenTicks,h=n.minSpaceBetweenTicks);let c=Math.abs(e.right-e.left),p=Math.abs(e.top-e.bottom),f=Math.max(Math.floor(c/d)+1,3),_=Math.max(Math.floor(p/h)+1,3),g=this._computeYBoundaries(t,p),b=g.yBoundary,C=g.yBoundaryDiffType;if(n){this._adjustAxisMaxMin(n,Math.ceil(Math.min(f,_)/2),b);return}if(C?(this._adjustAxisMaxMin(s,_,b),this._adjustAxisMaxMin(a.yDiffType,_,C)):this._isHorizontalBar(t)?this._adjustAxisMaxMin(i,f,b):this._adjustAxisMaxMin(s,_,b),!l.scout.isOneOf(r,u.Type.BUBBLE,u.Type.SCATTER))return;let m=this._computeXBoundaryPointElement(t,c);this._adjustAxisMaxMin(i,f,m)}_computeBoundaryPointElement(t,e,r){if(!t||!t.type||!l.scout.isOneOf(t.type,u.Type.BUBBLE,u.Type.SCATTER)||!t.data||!t.options||!t.options.scales||!(e==="x"||e==="y")||!r)return;let a=t.data.datasets,i=t.options.scales[e],s=i&&i.offset,n=t.options[e+"LabelMap"],d,h=this._computeMaxMinValue(t,a,"r",!0).maxValue,c=h;return t.options.elements&&t.options.elements.point&&t.options.elements.point.hoverRadius&&(c=c+t.options.elements.point.hoverRadius),s?d=this._computeMaxMinValue(t,a,e,n,!0):d=this._computeMaxMinValue(t,a,e,n,!0,c,r),n&&(d.maxValue=Math.ceil(d.maxValue),d.minValue=Math.floor(d.minValue)),d}_computeXBoundaryPointElement(t,e){return this._computeBoundaryPointElement(t,"x",e)}_computeYBoundaryPointElement(t,e){return this._computeBoundaryPointElement(t,"y",e)}_computeYBoundaries(t,e){if(!t||!t.type)return{};let r=t.type,a,i;if(l.scout.isOneOf(r,u.Type.BUBBLE,u.Type.SCATTER))a=this._computeYBoundaryPointElement(t,e);else{let s=[],n=[];if(t.data&&t.data.datasets&&t.data.datasets.forEach(d=>{d.type&&d.type!==r?n.push(d):s.push(d)}),a=this._computeMaxMinValue(t,s),s.length&&n.length){i=this._computeMaxMinValue(t,n);let d=a.maxValue-a.minValue,h=i.maxValue-i.minValue;d&&h&&(d/h>10||h/d>10)&&this._adjustYAxisDiffType(t,s,n)}}return{yBoundary:a,yBoundaryDiffType:i}}_adjustYAxisDiffType(t,e,r){if(!t||!t.type||!e||!e.length||!r||!r.length||!t.options||!t.options.scales||!t.options.scales.y||t.options.scales.yDiffType)return;let a=t.type,i=t.options,s=i.scales,n=s.y,d=y().extend(!0,{},n);s.yDiffType=d,t.data&&t.data.datasets&&t.data.datasets.length&&t.data.datasets[0].type&&t.data.datasets[0].type!==a?(d.position=u.Position.LEFT,n.position=u.Position.RIGHT,n.grid.drawOnChartArea=!1):(n.position=u.Position.LEFT,d.position=u.Position.RIGHT,d.grid.drawOnChartArea=!1),n.border.display=!0,n.grid.drawTicks=!0,d.border.display=!0,d.grid.drawTicks=!0;let h=e[0].type||a,c=r[0].type||a,p=this.chart.session.text("ui."+h),f=this.chart.session.text("ui."+c),_=i.scaleLabelByTypeMap?i.scaleLabelByTypeMap[h]:null,g=i.scaleLabelByTypeMap?i.scaleLabelByTypeMap[c]:null;n.title.display=!0,n.title.text=_?_+" ("+p+")":p,d.title.display=!0,d.title.text=g?g+" ("+f+")":f,e.forEach(b=>{b.yAxisID="y"}),r.forEach(b=>{b.yAxisID="yDiffType"})}_adjustAxisMaxMin(t,e,r){if(!t)return;let a=1;t.ticks=y().extend(!0,{},t.ticks,{maxTicksLimit:e}),r&&(t.suggestedMax=r.maxValue,t.suggestedMin=r.minValue,a=(r.maxValue-r.minValue)/(e-1)),t.ticks.stepSize=this.onlyIntegers&&a<1?1:void 0}_remove(t){this.rendered&&!this.removing&&(this.removing=!0,this.chartJs.destroy(),this.chartJs=null,this.$canvas.remove(),this.$canvas=null),super._remove(t),this.removing=!1}}A(Q,"ARROW_LEFT_RIGHT","↔"),A(Q,"ARROW_UP_DOWN","↕");function pt(o,t,e){return t=he(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function he(o){var t=de(o,"string");return typeof t=="symbol"?t:t+""}function de(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class Bt extends M{constructor(t){super(t),pt(this,"animationTriggered",void 0),pt(this,"segmentSelectorForAnimation",void 0),pt(this,"r",void 0),pt(this,"fullR",void 0),this.animationTriggered=!1,this.segmentSelectorForAnimation=".fulfillment-chart",this.suppressLegendBox=!0;let e={options:{fulfillment:{startValue:void 0}}};t.config=y().extend(!0,{},e,t.config)}_validate(){let t=this.chart.data.chartValueGroups;return!(t.length!==2||t[0].values.length!==1||t[1].values.length!==1)}_renderInternal(){let t=this.chart.data,e=t.chartValueGroups[0].values[0],r=t.chartValueGroups[1].values[0];this.fullR=Math.min(this.chartBox.height,this.chartBox.width)/2-2,this._renderInnerCircle(),this._renderPercentage(e,r)}_renderPercentage(t,e){let r="fulfillment-chart",a=l.arrays.ensure(this.chart.data.chartValueGroups[0].colorHexValue)[0],i=this.chart.data.chartValueGroups[0].cssClass;this.chart.config.options.autoColor?r+=" auto-color":i&&(r+=" "+i);let s=l.scout.nvl(this.chart.config.options.fulfillment.startValue,0),n=0,d=0;e&&(n=Math.min(t/e,.999999),d=Math.min(s/e,.999999)),this.r=this.fullR;let h=this,c=function(C,m){let T=y()(this),x=T.data("animation-start"),B=T.data("animation-end");T.attr("d",h.pathSegment(x*m.pos,d+(B-d)*m.pos))},p=this.$svg.appendSVG("path",r).data("animation-start",0).data("animation-end",n),f=this.fullR/8*6.7;this._renderCirclePath("fulfillment-chart-inner-circle-transparent","InnerCircle3",f).css("fill",this.firstOpaqueBackgroundColor);let g=e?Math.round(t/e*100):0,b=this.$svg.appendSVG("text","fulfillment-chart-label ").attr("x",this.chartBox.mX()).attr("y",this.chartBox.mY()).css("font-size",this.fullR/2+"px").attr("dy","0.3em").attrXLINK("href","#InnerCircle").text(g+"%");this.chart.config.options.clickable&&p.on("click",this._createClickObject(null,null),C=>this.chart.handleValueClick(C.data)),!this.chart.config.options.autoColor&&!i&&p.attr("fill",a),this.animationDuration?(p.attr("d",this.pathSegment(0,d)).animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(c,this.animationDuration)),b.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0)):p.attr("d",this.pathSegment(0,n)),l.aria.description(this.$svg,this.session.text("ui.FulfillmentChartAriaDescription",g))}pathSegment(t,e){let r=t*2*Math.PI,a=e*2*Math.PI,i="";return i+="M"+(this.chartBox.mX()+this.r*Math.sin(r))+","+(this.chartBox.mY()-this.r*Math.cos(r)),i+="A"+this.r+", "+this.r,i+=e-t<.5?" 0 0,1 ":" 0 1,1 ",i+=this.chartBox.mX()+this.r*Math.sin(a)+","+(this.chartBox.mY()-this.r*Math.cos(a)),i+="L"+this.chartBox.mX()+","+this.chartBox.mY()+"Z",i}_renderCirclePath(t,e,r){let a=this.chart.data.chartValueGroups[0].cssClass,i=l.arrays.ensure(this.chart.data.chartValueGroups[1].colorHexValue)[0];this.chart.config.options.autoColor?t+=" auto-color":a&&(t+=" "+a);let s=r*2,n=this.$svg.appendSVG("path",t).attr("id",e).attr("d","M "+this.chartBox.mX()+" "+this.chartBox.mY()+" m 0, "+-r+" a "+r+","+r+" 0 1, 1 0,"+s+" a "+r+","+r+" 0 1, 1 0,"+-s);return!this.chart.config.options.autoColor&&!a&&n.attr("fill",i).attr("stroke",i),n}_renderInnerCircle(){let t=this.fullR/8*7.5,e=this.fullR/8*7.2;this._renderCirclePath("fulfillment-chart-inner-circle","InnerCircle",t),this._renderCirclePath("fulfillment-chart-inner-circle-transparent","InnerCircle2",e).css("fill",this.firstOpaqueBackgroundColor)}shouldAnimateRemoveOnUpdate(t){let e=l.objects.optProperty(this.chart,"config","options","fulfillment","startValue");return l.objects.isNullOrUndefined(e)?super.shouldAnimateRemoveOnUpdate(t):!1}_removeAnimated(t){if(this.animationTriggered)return;let e=this,r=function(a,i){let s=y()(this),n=s.data("animation-start"),d=s.data("animation-end");s.attr("d",e.pathSegment(n*(1-i.pos),d*(1-i.pos)))};this.animationTriggered=!0,this.$svg.children(this.segmentSelectorForAnimation).animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(r)).promise().done(()=>{this._remove(t),this.animationTriggered=!1})}}var Rt;function O(o,t,e){return t=ue(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function ue(o){var t=ce(o,"string");return typeof t=="symbol"?t:t+""}function ce(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class v extends M{constructor(t){super(t),O(this,"segmentSelectorForAnimation",void 0),O(this,"r",void 0),O(this,"scaleWeight",void 0),O(this,"my",void 0),O(this,"parts",void 0),O(this,"numSegmentsPerPart",void 0),O(this,"segmentWidth",void 0),O(this,"widthOfSegmentWithGap",void 0),O(this,"animationTriggered",void 0),O(this,"$filledParts",void 0),O(this,"$pointer",void 0),this.segmentSelectorForAnimation=".pointer",this.suppressLegendBox=!0;let e={options:{speedo:{greenAreaPosition:void 0}}};t.config=$.extend(!0,{},e,t.config)}_validate(){let t=this.chart.data,e=this.chart.config;return!(!t||!e||t.axes.length>0||t.chartValueGroups.length!==1||t.chartValueGroups[0].values.length!==3||e.options.speedo.greenAreaPosition===void 0)}_renderInternal(){let t=this.chart.data,e=t.chartValueGroups[0].values[0],r=t.chartValueGroups[0].values[2],a=t.chartValueGroups[0].values[1];this.r=Math.min(this.chartBox.height,this.chartBox.width/2)*.7,this.scaleWeight=this.r*.27,this.my=this.chartBox.yOffset+this.chartBox.height-(this.chartBox.height-this.r*1.12)/2,this.parts=this.chart.config.options.speedo.greenAreaPosition===v.Position.CENTER?v.NUM_PARTS_GREEN_CENTER:v.NUM_PARTS_GREEN_EDGE,this.numSegmentsPerPart=this.parts===v.NUM_PARTS_GREEN_CENTER?5:8,this.$filledParts=[];let i=this.parts*this.numSegmentsPerPart,s=i-1;this.segmentWidth=(v.ARC_RANGE-s*v.SEGMENT_GAP)/i,this.widthOfSegmentWithGap=this.segmentWidth+v.SEGMENT_GAP;let n=this._getValuePercentage(a,e,r),d=this._getSegmentToPointAt(n,i),h=this._getPercentageValueOfSegment(d%this.numSegmentsPerPart,this._getPartForValue(n));for(let c=0;c<this.parts;c++)this._renderCirclePart(c);this._renderPointer(h),this._renderLegend(e,a,r,t.chartValueGroups[0].groupName),this.$svg.addClass("speedo-chart-svg"),this.chart.config.options.clickable&&this.$svg.on("click",this._createClickObject(null,null),c=>this.chart.handleValueClick(c.data))}_getValuePercentage(t,e,r){return this._limitValue((t-e)/(r-e),1)}_getSegmentToPointAt(t,e){return this._limitValue(Math.floor(t*e),e-1)}_limitValue(t,e){return t=Math.max(t,0),t=Math.min(t,e),t}_getPercentageValueOfSegment(t,e){let r=this._calcSegmentPos(t,e),a=r.from-v.ARC_MIN+(r.to-r.from)/2;return this._limitValue(a/v.ARC_RANGE,1)}_renderPointer(t){if(this.$pointer=this.$svg.appendSVG("path","pointer").attr("d",this._pathPointer(0)).attr("data-end",t).attr("stroke-width",this.scaleWeight/6+"px").attr("fill","none"),this.animationDuration){let e=this,r=function(a,i){let s=this.getAttribute("data-end")*i.pos;e._updatePointer(s),e._updatePartsFill(s)};this.$pointer.animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(r,this.animationDuration))}else this._updatePointer(t),this._updatePartsFill(t)}_renderSegment(t,e,r){return this.$svg.appendSVG("path","speedo-chart-arc "+r).attr("id","ArcAxisWide"+this.chart.id).attr("fill","none").attr("stroke-width",this.scaleWeight+"px").attr("d",this._pathSegment(t,e))}_renderCirclePart(t){let e=this._getColorForPart(t);for(let r=0;r<this.numSegmentsPerPart;r++){let a=this._calcSegmentPos(r,t);this._renderSegment(a.from,a.to,e)}this.$filledParts.push(this._renderSegment(v.ARC_MIN,v.ARC_MIN,e))}_renderLegend(t,e,r,a){let i=this.scaleWeight*.8,s=5,n=this.my+s,d=n+i*.8,h={x1:null,x2:this.chartBox.mX()-s,y1:null,y2:n,v:-1,h:1},c=t?this._formatValue(t):0,p=e?this._formatValue(e):"0",f=r?this._formatValue(r):0;if(this.chart.config.options.plugins.tooltip.enabled){let _=this.$svg.appendSVG("text","line-label line-chart-wire-label").attr("x",this.chartBox.mX()-this.r).attr("y",d).text(c).attr("style","font-size: "+i+"px; text-anchor: middle"),g=this.$svg.appendSVG("text","line-label line-chart-wire-label").attr("x",this.chartBox.mX()+this.r).attr("y",d).text(f).attr("style","font-size: "+i+"px; text-anchor: middle"),b=(function(){this.$svg.append(_),this.$svg.append(g)}).bind(this),C=()=>{_.detach(),g.detach()};C(),this.$svg.on("mouseenter",b).on("mouseleave",C)}this.chart.config.options.plugins.legend.display&&this._renderLineLabel(h.x2+s,h.y2+h.v*s,p,"",!1).addClass("speedo-chart-label").attr("style","font-size: "+this.scaleWeight*1.55+"px;"),l.aria.description(this.$svg,this.session.text("ui.SpeedoChartAriaDescription",p,c,f))}_getPartForValue(t){let e=Math.floor(t*this.parts);return this._limitValue(e,this.parts-1)}_formatValue(t){if(t<v.TEN_THOUSAND)return this.session.locale.decimalFormat.format(t);if(t<v.ONE_MILLION)return Math.floor(t/v.ONE_THOUSAND)+"k";let e=t/v.ONE_MILLION;return e=l.numbers.round(e,l.RoundingMode.HALF_UP,2),this.session.locale.decimalFormat.format(e)+"M"}_updatePointer(t){this.$pointer.attr("d",this._pathPointer(t)).removeClass("red yellow light-green dark-green").addClass(this._getColorForPart(this._getPartForValue(t)))}_updatePartsFill(t){let e,r;for(let a=0;a<this.$filledParts.length;a++)e=this._calcSegmentPos(0,a).from,(a+1)/this.parts<t?r=this._calcSegmentPos(this.numSegmentsPerPart-1,a).to:a/this.parts>t?(e=v.ARC_MIN,r=v.ARC_MIN):r=v.ARC_RANGE*t-v.ARC_MAX,this.$filledParts[a].attr("d",this._pathSegment(e,r))}_calcSegmentPos(t,e){let r={from:0,to:0},a=t+e*this.numSegmentsPerPart;return r.from=a*this.widthOfSegmentWithGap-v.ARC_MAX,r.to=r.from+this.segmentWidth,r}_getColorForPart(t){switch(this.chart.config.options.speedo.greenAreaPosition){case v.Position.LEFT:if(t===0)return"dark-green";if(t===1)return"light-green";if(t===2)return"yellow";if(t===3)return"red";break;case v.Position.RIGHT:if(t===0)return"red";if(t===1)return"yellow";if(t===2)return"light-green";if(t===3)return"dark-green";break;case v.Position.CENTER:if(t===0)return"red";if(t===1)return"yellow";if(t===2)return"light-green";if(t===3)return"dark-green";if(t===4)return"light-green";if(t===5)return"yellow";if(t===6)return"red";break;default:break}}_pathSegment(t,e){let r=t*2*Math.PI,a=e*2*Math.PI,i="";return i+="M "+(this.chartBox.mX()+this.r*Math.sin(r))+" "+(this.my-this.r*Math.cos(r))+" ",i+="A "+this.r+" "+this.r+" ",i+="0 "+(e-t<.5?"0":"1")+" 1 ",i+=this.chartBox.mX()+this.r*Math.sin(a)+" "+(this.my-this.r*Math.cos(a)),i}_pathPointer(t){let r=(v.ARC_RANGE*t-v.ARC_MAX)*2*Math.PI,a=this.r-1.4*this.scaleWeight,i=this.r+1.37*this.scaleWeight,s="";return s+="M "+(this.chartBox.mX()+i*Math.sin(r))+" "+(this.my-i*Math.cos(r))+" ",s+="L "+(this.chartBox.mX()+a*Math.sin(r))+" "+(this.my-a*Math.cos(r))+" ",s+="Z",s}_removeAnimated(t){if(this.animationTriggered)return;let e=this,r=function(a,i){let s=this.getAttribute("data-end")*(1-i.pos);e._updatePointer(s),e._updatePartsFill(s)};this.animationTriggered=!0,this.$svg.children(this.segmentSelectorForAnimation).animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(r)).promise().done(()=>{this._remove(t),this.animationTriggered=!1})}}Rt=v,O(v,"Position",{LEFT:"left",CENTER:"center",RIGHT:"right"}),O(v,"NUM_PARTS_GREEN_CENTER",7),O(v,"NUM_PARTS_GREEN_EDGE",4),O(v,"ONE_THOUSAND",1e3),O(v,"TEN_THOUSAND",1e4),O(v,"ONE_MILLION",1e6),O(v,"ARC_MIN",-.25),O(v,"ARC_MAX",.25),O(v,"ARC_RANGE",Rt.ARC_MAX-Rt.ARC_MIN),O(v,"SEGMENT_GAP",.0103);function N(o,t,e){return t=pe(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function pe(o){var t=fe(o,"string");return typeof t=="symbol"?t:t+""}function fe(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class Lt extends M{constructor(t){super(t),N(this,"segmentSelectorForAnimation",void 0),N(this,"widthThresholdMedium",void 0),N(this,"widthThresholdSmall",void 0),N(this,"barDeltaPercentage",void 0),N(this,"lastBarAdditionalPercentage",void 0),N(this,"lastBarMinWidthPercentage",void 0),N(this,"paddingBetweenLabel",void 0),N(this,"dataAnalyzeResult",void 0),N(this,"barHeight",void 0),N(this,"barAreaWidth",void 0),N(this,"centerX",void 0),N(this,"animationTriggered",void 0),this.segmentSelectorForAnimation=".salesfunnel-chart-bar",this.widthThresholdMedium=400,this.widthThresholdSmall=200,this.barDeltaPercentage=.95,this.lastBarAdditionalPercentage=.7,this.lastBarMinWidthPercentage=.4,this.suppressLegendBox=!0;let e={options:{salesfunnel:{normalized:void 0,calcConversionRate:void 0}}};t.config=y().extend(!0,{},e,t.config)}_validate(){let t=this.chart.data,e=this.chart.config;return!(!t||!e||t.axes.length!==t.chartValueGroups.length||t.chartValueGroups.length===0||t.chartValueGroups[0].values.length===0||e.options.salesfunnel.normalized===void 0||e.options.salesfunnel.calcConversionRate===void 0)}_renderInternal(){let t=this.chart.data,e=t.chartValueGroups.length,r=this._dynamicConversionRateWidth();this.paddingBetweenLabel=20,this.dataAnalyzeResult=this._analyzeData(t.chartValueGroups),this.barHeight=this.chartBox.height/e,this.barAreaWidth=this.chartBox.width-this.dataAnalyzeResult.maxLengthFirstValueRow-this.paddingBetweenLabel*this.dataAnalyzeResult.labelCount-this.dataAnalyzeResult.maxLengthSecondValueRow-r,this.centerX=this.barAreaWidth/2,this.chart.config.options.salesfunnel.normalized?this._renderBarsNormalized(t.chartValueGroups):this._renderBarsAccordingToValues(t.chartValueGroups),this._addClipping("salesfunnel-chart-bar")}_renderBarsNormalized(t){let e=t.length,r=this.barAreaWidth+this.dataAnalyzeResult.maxLengthFirstValueRow+this.dataAnalyzeResult.maxLengthSecondValueRow+this.paddingBetweenLabel*(this.dataAnalyzeResult.labelCount+1),a=this.barAreaWidth*(1-this.barDeltaPercentage),s=this.barAreaWidth*this.lastBarMinWidthPercentage/this.lastBarAdditionalPercentage;a=Math.min(a,(this.barAreaWidth-s)/(e-1));for(let n=0;n<e;n++){let d=this.barAreaWidth-n*a,h=t[n].groupName,c=this.barAreaWidth-(n+1)*a,p=n*this.barHeight,f={xStart:this.centerX,yStart:p,rect:!0,width:d,widthBottom:c,cssClass:"salesfunnel-chart-bar",fill:l.arrays.ensure(t[n].colorHexValue)[0],label:t[n].groupName,clickObject:this._createClickObject(null,n)};this.chart.config.options.autoColor?f.cssClass+=" auto-color color0":this.chart.data.chartValueGroups[n].cssClass&&(f.cssClass+=" "+this.chart.data.chartValueGroups[n].cssClass),n===e-1&&(f.width=f.width*this.lastBarAdditionalPercentage,f.widthBottom=f.widthBottom*this.lastBarAdditionalPercentage),this._renderPolygon(f),this._renderLabel(t[n].values[0],!1,n),this._renderBarLabel(h,n,f.widthBottom);let _=this.dataAnalyzeResult.maxLengthFirstValueRow+this.paddingBetweenLabel;t[n].values.length>1&&(this._renderLabel(t[n].values[1],!0,n),_+=this.dataAnalyzeResult.maxLengthSecondValueRow+this.paddingBetweenLabel),n>0&&(this._renderLabelSeparatorLine(p,_),this.chart.config.options.salesfunnel.calcConversionRate&&this._renderConversionRate(n,r,this._calcConversionRate(t[n-1].values[0],t[n].values[0])))}}_renderLabel(t,e,r){if(t===null)return;let a=r*this.barHeight+this.barHeight/2,i=this.dataAnalyzeResult.maxLengthFirstValueRow+(e?this.dataAnalyzeResult.maxLengthSecondValueRow:0),s=e?2:1,n=this.barAreaWidth+i+s*this.paddingBetweenLabel,d=this._dynamicCssClass("salesfunnel-label"),h=this.$svg.appendSVG("text",d).attr("x",n).attr("y",a).text(this.session.locale.decimalFormat.format(t));if(this.animationDuration&&h.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0),this.chart.config.options.plugins.tooltip.enabled&&this.chart.data.axes.length>0){let c=this.chart.data.axes[r][e?1:0].label,p=this._measureText(""+t,d);this._renderWireLabels(c,h,n-p.width/2,a-p.height)}}_renderWireLabels(t,e,r,a){let i={x1:r,x2:r-10,y1:a,y2:a-10,v:-1,h:-1},s=(c,p)=>(i.y2-p<0&&(i.v=1,i.y1=i.y1+p*1.5,i.y2=i.y1+10),i);i.autoPosition=!0,i.posFunc=s;let n=this._renderWireLegend(t,i,"line-chart-wire-label",!0),d=n.attachFunc.bind(n),h=n.detachFunc.bind(n);n.detachFunc(),e.on("mouseenter",d).on("mouseleave",h)}_renderBarLabel(t,e,r){let a=e*this.barHeight+this.barHeight/2,i=this.centerX,s=this._dynamicCssClass("salesfunnel-bar-label");this._renderLineLabel(i,a,t,s,!0)}_renderConversionRate(t,e,r){if(r===void 0)return;let a=t*this.barHeight,i=this._dynamicCssClass("salesfunnel-conversionrate-label"),s=this.$svg.appendSVG("text",i).attr("x",e).attr("y",a).text("↓ "+r+"%");this.animationDuration&&s.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0)}_renderPolygon(t){let e=this,r=this._calcPolygonPoints(!0,this.animationDuration?0:1,t.xStart,t.yStart,t.width,t.widthBottom,this.barHeight-1),a=this.$svg.appendSVG("polygon",t.cssClass,"",t.id).attr("points",r).data("xStart",t.xStart).data("yStart",t.yStart).data("widthBar",t.width).data("widthBottom",t.widthBottom).data("heightBar",this.barHeight);!this.chart.config.options.autoColor&&t.fill&&a.attr("fill",t.fill),a.css("stroke",this.firstOpaqueBackgroundColor);let i=function(s,n){let d=y()(this),h=d.data("xStart"),c=d.data("yStart"),p=d.data("widthBar"),f=d.data("heightBar"),_=d.data("widthBottom");d.attr("points",e._calcPolygonPoints(!0,n.pos,h,c,p,_,f))};return this.animationDuration&&a.animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(i,this.animationDuration)),this.chart.config.options.clickable&&a.on("click",t.clickObject,s=>this.chart.handleValueClick(s.data)),t.fill&&a.attr("fill",t.fill),a}_calcPolygonPoints(t,e,r,a,i,s,n){let d=0,h=0;return t?(d=i/2*e,h=s/2*e):(d=i/2-i/2*e,h=s/2-s/2*e),l.strings.join(" ",r-d+","+a,r+d+","+a,r+h+","+(a+n),r-h+","+(a+n))}_renderBarsAccordingToValues(t){let e=this.dataAnalyzeResult.maxValue?this.barAreaWidth*.8/this.dataAnalyzeResult.maxValue:0,r=this.barAreaWidth+this.dataAnalyzeResult.maxLengthFirstValueRow+this.dataAnalyzeResult.maxLengthSecondValueRow+this.paddingBetweenLabel*this.dataAnalyzeResult.labelCount+2*this.paddingBetweenLabel,a=t.length;for(let i=0;i<a;i++){let s=t[i].values[0]*e+this.barAreaWidth*.2,n=t[i].groupName,d=i*this.barHeight,h={xStart:this.centerX,yStart:d,rect:!0,width:s,widthBottom:s,cssClass:"salesfunnel-chart-bar",fill:l.arrays.ensure(t[i].colorHexValue)[0],label:t[i].groupName,clickObject:this._createClickObject(null,i)};this.chart.config.options.autoColor?h.cssClass+=" auto-color color0":this.chart.data.chartValueGroups[i].cssClass&&(h.cssClass+=" "+this.chart.data.chartValueGroups[i].cssClass),this._renderPolygon(h),this._renderLabel(t[i].values[0],!1,i),this._renderBarLabel(n,i,h.widthBottom);let c=this.dataAnalyzeResult.maxLengthFirstValueRow+this.paddingBetweenLabel;t[i].values.length>1&&(this._renderLabel(t[i].values[1],!0,i),c+=this.dataAnalyzeResult.maxLengthSecondValueRow+this.paddingBetweenLabel),i>0&&(this._renderLabelSeparatorLine(d,c),this.chart.config.options.salesfunnel.calcConversionRate&&this._renderConversionRate(i,r,this._calcConversionRate(t[i-1].values[0],t[i].values[0])))}}_renderLabelSeparatorLine(t,e){let r=this.$svg.appendSVG("line","label-separator").attr("x1",this.barAreaWidth+this.paddingBetweenLabel).attr("y1",t).attr("x2",this.barAreaWidth+e).attr("y2",t);this.animationDuration&&r.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0)}_calcConversionRate(t,e){if(!(l.objects.isNullOrUndefined(t)||l.objects.isNullOrUndefined(e)||t===0))return Math.round(e/t*100)}_analyzeData(t){let e={labelCount:0,maxValue:null,maxLengthFirstValueRow:0,maxLengthSecondValueRow:0},r=this._dynamicCssClass("salesfunnel-label");for(let a=0;a<t.length;a++){let i=t[a];e.labelCount=Math.max(e.labelCount,i.values.length),i.values.length>0&&i.values[0]&&(e.maxValue===null?e.maxValue=i.values[0]:e.maxValue=Math.max(e.maxValue,i.values[0]),e.maxLengthFirstValueRow=Math.max(e.maxLengthFirstValueRow,this._measureText(this.session.locale.decimalFormat.format(i.values[0]),r).width)),i.values.length>1&&i.values[1]&&(e.maxLengthSecondValueRow=Math.max(e.maxLengthSecondValueRow,this._measureText(this.session.locale.decimalFormat.format(i.values[1]),r).width))}return e}_removeAnimated(t){if(this.animationTriggered)return;this.animationTriggered=!0;let e=this,r=function(a,i){let s=y()(this),n=s.data("xStart"),d=s.data("yStart"),h=s.data("widthBar"),c=s.data("heightBar"),p=s.data("widthBottom");s.attr("points",e._calcPolygonPoints(!1,i.pos,n,d,h,p,c))};this.$svg.children(this.segmentSelectorForAnimation).animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(r)).promise().done(()=>{this._remove(t),this.animationTriggered=!1})}_dynamicCssClass(t){let e="";return this.chartBox.width<=this.widthThresholdSmall?e="small":this.chartBox.width<=this.widthThresholdMedium&&(e="medium"),l.strings.join(" ",t,e)}_dynamicConversionRateWidth(){return this.chart.config.options.salesfunnel.calcConversionRate?this.chartBox.width<=this.widthThresholdSmall?60:this.chartBox.width<=this.widthThresholdMedium?80:100:0}}function P(o,t,e){return t=me(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function me(o){var t=_e(o,"string");return typeof t=="symbol"?t:t+""}function _e(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class kt{constructor(t,e,r,a,i,s,n,d,h,c,p,f,_,g){P(this,"helper",void 0),P(this,"venn1",void 0),P(this,"venn2",void 0),P(this,"venn3",void 0),P(this,"u",void 0),P(this,"v",void 0),P(this,"w",void 0),P(this,"uv",void 0),P(this,"uw",void 0),P(this,"vw",void 0),P(this,"uvw",void 0),P(this,"maxD",void 0),P(this,"dStep",void 0),P(this,"rStep",void 0),P(this,"alphaStep",void 0),P(this,"alphaBest",void 0),P(this,"dBest",void 0),P(this,"rBest",void 0),P(this,"errorBest",void 0),P(this,"callback",void 0),P(this,"cancelled",void 0),i===0&&d===0&&h===0&&p===0&&(i=1),s===0&&d===0&&c===0&&p===0&&(s=1),n===0&&h===0&&c===0&&p===0&&(n=1),this.helper=t,this.venn1=e,this.venn2=r,this.venn3=a,this.u=i,this.v=s,this.w=n,this.uv=d,this.uw=h,this.vw=c,this.uvw=p,this.maxD=this.venn1.r+2*this.venn2.r+2*this.venn1.r+this.helper.distR,this.dStep=this.maxD/30,this.rStep=a.r/4,this.alphaStep=Math.PI/30,this.alphaBest=0,this.dBest=0,this.rBest=0,this.errorBest=0,this.callback=null,this.cancelled=!1}start(t){this.callback=t,setTimeout(this._next.bind(this,0))}cancel(){this.cancelled=!0}_end(){this.venn3.x=this.venn1.x+this.dBest*Math.cos(this.alphaBest),this.venn3.y=this.venn1.y-this.dBest*Math.sin(this.alphaBest),this.venn3.r=this.rBest,this.callback()}_next(t){this.cancelled||this._iteration(t),!this.cancelled&&(t+=this.alphaStep,t<Math.PI?setTimeout(this._next.bind(this,t)):this._end())}_iteration(t){let e=this.maxD,r=this.dStep,a=this.helper.minR,i=this.rStep,s=this.helper.total,n=this.venn1.x,d=this.venn1.y,h=this.venn1.r,c=this.venn2.x,p=this.venn2.y,f=this.venn2.r,_=this.venn3.r,g=this.u,b=this.v,C=this.w,m=this.uv,T=this.uw,x=this.vw,B=this.uvw,j=this.alphaBest,U=this.dBest,W=this.rBest,Y=this.errorBest;for(let F=0;F<e;F+=r){let G=n+F*Math.cos(t),tt=d-F*Math.sin(t);for(let I=Math.max(a,_*.75);I<=_*1.25;I+=i){let lt=Math.min(n-h,c-f,G-I),V=Math.max(n+h,c+f,G+I),ht=Math.min(d-h,p-f,tt-I),dt=Math.max(d+h,p+f,tt+I),$t=(V-lt)/100,jt=(dt-ht)/100,mt=0,_t=0,gt=0,bt=0,yt=0,Ct=0,xt=0;for(let J=lt;J<V;J+=$t)for(let q=ht;q<dt;q+=jt){let rt=(J-n)*(J-n)+(q-d)*(q-d)<h*h,at=(J-c)*(J-c)+(q-p)*(q-p)<f*f,it=(J-G)*(J-G)+(q-tt)*(q-tt)<I*I;rt&&at&&it?xt++:rt&&at&&!it?bt++:rt&&!at&&!it?mt++:!rt&&at&&!it?_t++:rt&&!at&&it?yt++:!rt&&at&&it?Ct++:!rt&&!at&&it&>++}let et=mt+_t+gt+bt+yt+Ct+xt,z=F/e;z+=this._error(B,s,xt,et),z+=this._error(m,s,bt,et),z+=this._error(T,s,yt,et),z+=this._error(x,s,Ct,et),z+=this._error(g,s,mt,et),z+=this._error(b,s,_t,et),z+=this._error(C,s,gt,et),(t===0||z<Y)&&(j=t,U=F,W=I,Y=z)}}this.alphaBest=j,this.dBest=U,this.rBest=W,this.errorBest=Y}_error(t,e,r,a){return t===0&&r!==0||t!==0&&r===0?1e3:Math.abs(t/e-r/a)*100}}function ft(o,t,e){return t=ge(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function ge(o){var t=be(o,"string");return typeof t=="symbol"?t:t+""}function be(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class St{constructor(t,e,r,a){ft(this,"distR",void 0),ft(this,"maxR",void 0),ft(this,"minR",void 0),ft(this,"total",void 0),this.distR=t,this.maxR=e,this.minR=r,this.total=a}findBalance2(t,e){let r=(t.r*t.x+e.r*e.x)/(t.r+e.r),a=(t.r*t.y+e.r*e.y)/(t.r+e.r);t.x=t.x-r,e.x=e.x-r,t.y=t.y-a,e.y=e.y-a}findBalance3(t,e,r){let a=(t.r*t.x+e.r*e.x+r.r*r.x)/(t.r+e.r+r.r),i=(t.r*t.y+e.r*e.y+r.r*r.y)/(t.r+e.r+r.r);t.x=t.x-a,e.x=e.x-a,r.x=r.x-a,t.y=t.y-i,e.y=e.y-i,r.y=r.y-i}calcR(t,e){return t===-1?this.maxR*e:Math.max(this.minR,Math.sqrt(t/this.total)*this.maxR*e)}calcD(t,e,r,a,i,s){let n;if(i===0)n=t.r+e.r+this.distR*2;else if(r===0&&a===0)n=0;else if(r===0)n=Math.max(0,e.r-t.r-this.distR),n<1.5*this.distR&&s&&(n=1.5*this.distR,t.r=e.r-n);else if(a===0)n=Math.max(0,t.r-e.r-this.distR),n<1.5*this.distR&&s&&(n=1.5*this.distR,e.r=t.r-n);else{let d=Math.min(t.r,e.r),h=Math.max(t.r,e.r);n=2*(Math.min(r,a)/(Math.min(r,a)+i))*d-d+h,n=Math.max(3*this.distR,n),n=Math.min(d+h-3*this.distR,n),n=Math.max(h-d+3*this.distR,n)}return n}}function E(o,t,e){return t=ye(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function ye(o){var t=Ce(o,"string");return typeof t=="symbol"?t:t+""}function Ce(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class Ot extends M{constructor(t){super(t),E(this,"animationTriggered",void 0),E(this,"data",void 0),E(this,"centerX",void 0),E(this,"centerY",void 0),E(this,"numberOfCircles",void 0),E(this,"readyToDraw",void 0),E(this,"wasCircle",void 0),E(this,"vennCircleHelper",void 0),E(this,"async3Calculator",void 0),E(this,"vennNumber1",void 0),E(this,"vennReal1",void 0),E(this,"vennNumber2",void 0),E(this,"vennReal2",void 0),E(this,"vennNumber3",void 0),E(this,"vennReal3",void 0),E(this,"$v1",void 0),E(this,"$v2",void 0),E(this,"$v3",void 0),this.animationTriggered=!1,this.suppressLegendBox=!0;let e={options:{venn:{numberOfCircles:void 0}}};t.config=y().extend(!0,{},e,t.config)}_validate(){let t=this.chart.data;return!(!t||t.axes.length!==0||t.chartValueGroups.length===0||t.chartValueGroups[0].values.length===0)}_renderInternal(){if(this.centerX=this.width/2,this.centerY=this.height/2,this.centerX===0||this.centerY===0)return;this.data=this.chart.data.chartValueGroups,this.numberOfCircles=this.chart.config.options.venn.numberOfCircles;let t=10,e=Math.min(this.centerX,this.centerY),r=e/15,a=this.data.reduce((n,d)=>n+d.values[0],1);this.vennCircleHelper=new St(t,e,r,a),this.numberOfCircles>0&&(this.$v1=this._createCircle(0,l.arrays.ensure(this.data[0].colorHexValue)[0],this.data[0].cssClass),this.vennNumber1=new K(this.$v1),this.vennReal1=new K(this.$v1)),this.numberOfCircles>1&&(this.$v2=this._createCircle(1,l.arrays.ensure(this.data[1].colorHexValue)[0],this.data[1].cssClass),this.vennNumber2=new K(this.$v2),this.vennReal2=new K(this.$v2)),this.numberOfCircles>2&&(this.$v3=this._createCircle(2,l.arrays.ensure(this.data[2].colorHexValue)[0],this.data[2].cssClass),this.vennNumber3=new K(this.$v3),this.vennReal3=new K(this.$v3));const i=this.animationDuration;let s=(function(){if(this.readyToDraw=!0,!this.$svg.isAttached())return;this.readyToDraw=!1;const n=this.animationDuration;this.setAnimationDuration(i),this._draw(!0,!0),this.setAnimationDuration(n)}).bind(this);this.readyToDraw=!1,this.numberOfCircles===1?(this._calc1(this.vennNumber1),this._calc1(this.vennReal1),s()):this.numberOfCircles===2?(this._calc2(this.vennNumber1,this.vennNumber2,!1),this._calc2(this.vennReal1,this.vennReal2,!0),s()):this.numberOfCircles===3&&this._calc3(this.vennNumber1,this.vennNumber2,this.vennNumber3,!1,()=>{(this.rendering||this.rendered)&&this._calc3(this.vennReal1,this.vennReal2,this.vennReal3,!0,s)})}remove(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=arguments.length>1?arguments[1]:void 0;this._cancelAsync3Calculator(),super.remove(t,e)}_calc1(t){let e=this.data[0].values[0];e>0?t.r=this.vennCircleHelper.calcR(e,.8):t.r=this.vennCircleHelper.calcR(e,0),t.x=0,t.y=0,t.setLegend(this.data[0].groupName,1,-1),t.addLabel(e,t.x,t.y)}_calc2(t,e,r){let a=this.data[0].values[0],i=this.data[1].values[0],s=this.data[2].values[0],n;r?(t.r=this.vennCircleHelper.calcR(a+s,.8),e.r=this.vennCircleHelper.calcR(i+s,.8),n=this.vennCircleHelper.calcD(t,e,a,i,s,!0),t.x=0,e.x=n):(t.r=e.r=this.vennCircleHelper.calcR(-1,.7),t.x=-t.r*.6,e.x=e.r*.6),t.y=0,e.y=0,this.vennCircleHelper.findBalance2(t,e),t.setLegend(this.data[0].groupName,-1,-1),e.setLegend(this.data[1].groupName,1,-1),r?s===0?(t.addLabel(a,t.x,t.y),e.addLabel(i,e.x,e.y)):a===0&&i===0?t.addLabel(s,t.x,t.y):a===0?(e.addLabel(s,t.x,t.y),e.addLabel(i,e.x-(n-e.r-t.r)/2,e.y),t.legendR=e.r-n):i===0?(t.addLabel(s,e.x,e.y),t.addLabel(a,t.x+(n-e.r-t.r)/2,t.y),e.legendR=t.r-n):(t.addLabel(a,t.x+(n-e.r-t.r)/2,t.y),t.addLabel(i,e.x-(n-e.r-t.r)/2,e.y),e.addLabel(s,t.x+t.r+(n-e.r-t.r)/2,t.y)):(t.addLabel(a,-t.r*.9,0),t.addLabel(i,t.r*.9,0),e.addLabel(s,0,0))}_calc3(t,e,r,a,i){let s=this.data[0].values[0],n=this.data[1].values[0],d=this.data[2].values[0],h=this.data[3].values[0],c=this.data[4].values[0],p=this.data[5].values[0],f=this.data[6].values[0],_,g,b;a?(t.r=this.vennCircleHelper.calcR(s+h+c+f,.55),e.r=this.vennCircleHelper.calcR(n+h+p+f,.55),r.r=this.vennCircleHelper.calcR(d+c+p+f,.55),_=this.vennCircleHelper.calcD(t,e,s+c,n+p,h+f,!0),g=this.vennCircleHelper.calcD(t,r,s+h,d+p,h+f,!1),b=this.vennCircleHelper.calcD(e,r,n+h,d+c,h+f,!1),t.x=0,e.x=_,r.x=g,t.y=0,e.y=0,r.y=0,this._cancelAsync3Calculator(),this.async3Calculator=new kt(this.vennCircleHelper,t,e,r,s,n,d,h,c,p,f,_,g,b),this.async3Calculator.start(()=>{this.async3Calculator=null,this.vennCircleHelper.findBalance3(t,e,r),t.setLegend(this.data[0].groupName,-1,1),e.setLegend(this.data[1].groupName,1,1),r.setLegend(this.data[2].groupName,1,-1),i()})):(t.r=e.r=r.r=this.vennCircleHelper.calcR(-1,.55),t.x=-t.r*.73,e.x=e.r*.73,r.x=0,t.y=t.r*.58,e.y=e.r*.58,r.y=-r.r*.58,t.setLegend(this.data[0].groupName,-1,1),e.setLegend(this.data[1].groupName,1,1),r.setLegend(this.data[2].groupName,1,-1),t.addLabel(s,-t.r,t.r*.76),e.addLabel(n,t.r,t.r*.76),r.addLabel(d,0,-t.r*.82),t.addLabel(h,0,t.r*.76),t.addLabel(c,-t.r*.49,-t.r*.05),e.addLabel(p,t.r*.49,-t.r*.05),t.addLabel(f,0,t.r*.22),i())}_cancelAsync3Calculator(){this.async3Calculator&&(this.async3Calculator.cancel(),this.async3Calculator=null)}_draw(t,e){if(!this.rendered&&!this.rendering||this.animationTriggered)return;this.animationTriggered=!0;let r=this;this.$svg.children(".venn-legend, .venn-label, .venn-axis-white, .label-line").stop().animateSVG("opacity",1,0,null,!0).promise().done(function(){this.remove(),r.animationTriggered=!1});let a=[];this.numberOfCircles>0&&a.push(e?this.vennReal1:this.vennNumber1),this.numberOfCircles>1&&a.push(e?this.vennReal2:this.vennNumber2),this.numberOfCircles>2&&a.push(e?this.vennReal3:this.vennNumber3);for(let i=0;i<a.length;i++){let s=a[i];this._updateVenn(s,t);for(let n=0;n<s.labels.length;n++){let d=s.labels[n];this._drawLabel(d.text,d.x,d.y,t)}}}_createCircle(t,e,r){let a=this.$svg.appendSVG("circle","venn-circle").attr("cx",this.centerX).attr("cy",this.centerY).attr("r",0).on("mouseenter",{showReal:!1},this._show.bind(this)).on("mouseleave",{showReal:!0},this._show.bind(this));return this.chart.config.options.autoColor?a.addClass("auto-color color0"):r?a.addClass(r):a.attr("fill",e),this.chart.config.options.clickable&&a.on("click",this._createClickObject(null,t),i=>this.chart.handleValueClick(i.data)),a}_updateVenn(t,e){t.$circle.animateSVG("cx",this.centerX+t.x,e?this.animationDuration:0,null,!0).animateSVG("cy",this.centerY+t.y,e?this.animationDuration:0,null,!0).animateSVG("r",t.r,e?this.animationDuration:0,null,!0);let r=this.vennCircleHelper.minR,a=this.centerX+t.x+t.legendH*Math.sin(Math.PI/5)*t.r,i=this.centerY+t.y+t.legendV*Math.cos(Math.PI/5)*t.r,s=this.centerX+t.x+t.legendH*Math.sin(Math.PI/5)*(t.legendR+r*1.5),n=this.centerY+t.y+t.legendV*Math.cos(Math.PI/5)*(t.legendR+r*1.5),d={x1:a,x2:s,y1:i,y2:n,v:t.legendV,h:t.legendH};this._renderWireLegend(t.legend,d,"venn-legend")}_drawLabel(t,e,r,a){let i=this.$svg.appendSVG("text","venn-label").attr("x",this.centerX+e).attr("y",this.centerY+r).text(t);a&&this.animationDuration&&i.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0)}_show(t){if(this.numberOfCircles===1)return;let e=t.type==="mouseenter"?t.target:t.relatedTarget,r=e&&y()(e).hasClass("venn-circle");this.wasCircle&&r||(this.wasCircle=r,this._draw(!0,t.data.showReal))}}function X(o,t,e){return t=xe(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function xe(o){var t=Te(o,"string");return typeof t=="symbol"?t:t+""}function Te(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class K{constructor(t){X(this,"labels",void 0),X(this,"$circle",void 0),X(this,"x",void 0),X(this,"y",void 0),X(this,"r",void 0),X(this,"legend",void 0),X(this,"legendR",void 0),X(this,"legendH",void 0),X(this,"legendV",void 0),this.$circle=t,this.labels=[]}setLegend(t,e,r,a){this.legend=t,this.legendH=e,this.legendV=r,this.legendR=a||this.r}addLabel(t,e,r){this.labels.push({text:t,x:e,y:r})}}function Ae(o,t,e){return t=ve(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function ve(o){var t=Be(o,"string");return typeof t=="symbol"?t:t+""}function Be(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class wt extends l.FormField{constructor(){super(),Ae(this,"chart",void 0),this._addWidgetProperties(["chart"]),this.chart=null}_render(){this.addContainer(this.$parent,"chart-field"),this.addLabel(),this.addMandatoryIndicator(),this.addStatus(),this._renderChart()}_renderChart(){this.chart&&(this.chart.render(),this.addField(this.chart.$container))}_removeChart(){this.chart.remove(),this._removeField()}_linkWithLabel(t){}}class Ht extends l.FormFieldAdapter{}function Re(o,t,e){return t=Le(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Le(o){var t=ke(o,"string");return typeof t=="symbol"?t:t+""}function ke(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class Nt extends l.FormFieldTile{constructor(){super(),Re(this,"_chartConfigChangeHandler",void 0),this._chartConfigChangeHandler=this._onChartConfigChange.bind(this)}_renderColorScheme(){super._renderColorScheme(),this._updateChartColorScheme()}_updateChartColorScheme(){let t=$.extend(!0,{},this.tileWidget.chart.config,{options:{colorScheme:this.colorScheme}});this.tileWidget.chart.setConfig(t)}_onChartConfigChange(t){this._updateChartColorScheme()}_setTileWidget(t){this.tileWidget&&this.tileWidget.chart.off("propertyChange:config",this._chartConfigChangeHandler),super._setTileWidget(t),this.tileWidget.chart.on("propertyChange:config",this._chartConfigChangeHandler)}}class Ft extends l.FormFieldTileAdapter{}function k(o,t,e){return t=Se(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Se(o){var t=Oe(o,"string");return typeof t=="symbol"?t:t+""}function Oe(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class nt extends l.TableControl{constructor(){super(),k(this,"chartAggregation",void 0),k(this,"chartGroup1",void 0),k(this,"chartGroup2",void 0),k(this,"chartType",void 0),k(this,"oldChartType",void 0),k(this,"chart",void 0),k(this,"chartColorScheme",void 0),k(this,"xAxis",void 0),k(this,"yAxis",void 0),k(this,"dateGroup",void 0),k(this,"$chartSelect",void 0),k(this,"$axisSelectContainer",void 0),k(this,"$xAxisSelect",void 0),k(this,"$yAxisSelect",void 0),k(this,"$dataSelect",void 0),k(this,"_chartTypeMap",void 0),k(this,"_aggregationMap",void 0),k(this,"_chartGroup1Map",void 0),k(this,"_chartGroup2Map",void 0),k(this,"_tableUpdatedHandler",void 0),k(this,"_tableColumnStructureChangedHandler",void 0),k(this,"_chartValueClickedHandler",void 0),k(this,"_filterResetListener",void 0),k(this,"_tableUpdatedTimeOutId",void 0),this.iconId=l.icons.CHART,this.tooltipText="${textKey:ui.Chart}",this.chartAggregation={modifier:l.TableMatrix.NumberGroup.COUNT},this.chartType=u.Type.BAR,this.oldChartType=null,this.chart=null,this.chartColorScheme="chart-table-control",this.$chartSelect=null,this.$xAxisSelect=null,this.$yAxisSelect=null,this.$dataSelect=null,this.xAxis=null,this.yAxis=null,this.dateGroup=null,this._tableUpdatedHandler=this._onTableUpdated.bind(this),this._tableColumnStructureChangedHandler=this._onTableColumnStructureChanged.bind(this),this._chartValueClickedHandler=this._onChartValueClick.bind(this)}_init(t){super._init(t),this.table.on("columnStructureChanged",this._tableColumnStructureChangedHandler),this.chart=l.scout.create(u,{parent:this})}_destroy(){this.table.off("columnStructureChanged",this._tableColumnStructureChangedHandler),super._destroy()}_computeEnabled(t,e){return!this._hasColumns()&&!this.selected?!1:super._computeEnabled(t,e)}_renderChart(){this.chart&&(this.chart.render(this.$contentContainer),this.chart.$container.addClass(this.denseClass))}_createLayout(){return new Pt(this)}_renderChartType(){this._selectChartType(),this.$yAxisSelect.toggleClass("hide",this.chartType!==u.Type.BUBBLE),this.$yAxisSelect.toggleClass("animated",l.scout.isOneOf(u.Type.BUBBLE,this.chartType,this.oldChartType)&&!!this.oldChartType),this.$yAxisSelect.data("scroll-shadow").setVisible(!1),this.$yAxisSelect.oneAnimationEnd(()=>{l.scrollbars.update(this.$yAxisSelect),this.$yAxisSelect.data("scroll-shadow").setVisible(!0),this.$yAxisSelect.removeClass("animated")}),this.contentRendered&&this.chart.$container.animateAVCSD("opacity",0,()=>{this.chart.$container.css("opacity",1),this._drawChart()})}_selectChartType(){l.objects.values(this._chartTypeMap).forEach(t=>{t.removeClass("selected")}),this._chartTypeMap[this.chartType].addClass("selected")}_renderChartGroup1(){this._renderChartGroup(1)}_renderChartGroup2(){this._renderChartGroup(2)}_renderChartGroup(t){if(!this._hasColumns())return;let e="chartGroup"+t,r="_"+e+"Map",a=this[e];if(a){let i=this[r][a.id];if(i.siblings(".select-axis").animateAVCSD("height",30),i.selectOne("selected"),a.modifier>0){let s=a.modifier^nt.DATE_GROUP_FLAG;i.animateAVCSD("height",42),i.children(".select-axis-group").text(this.dateGroup[s][1])}this.contentRendered&&this._drawChart()}}_renderChartAggregation(){let t=this._aggregationMap[this.chartAggregation.id||"all"];t&&(t.selectOne(),t.removeClass("data-sum").removeClass("data-avg"),t.addClass(this._getAggregationCssClass()),this.contentRendered&&this._drawChart())}_getAggregationCssClass(){switch(this.chartAggregation.modifier){case l.TableMatrix.NumberGroup.COUNT:return"data-count";case l.TableMatrix.NumberGroup.SUM:return"data-sum";case l.TableMatrix.NumberGroup.AVG:return"data-avg";default:return null}}_renderChartSelect(t,e,r){let a=l.scout.create(l.Icon,{parent:this,iconDesc:r,cssClass:t});a.render(this.$chartSelect),this.$contentContainer.one("remove",()=>a.destroy());let i=a.$container;i.toggleClass("disabled",!this.enabledComputed||!this._hasColumns()).data("chartType",e),this.enabledComputed&&this._hasColumns()&&i.on("click",this._onClickChartType.bind(this)),this._chartTypeMap[e]=i}_renderChartSelectContainer(){this.$chartSelect=this.$contentContainer.appendDiv("chart-select"),this._chartTypeMap={};let t=this._getSupportedChartTypes();l.scout.isOneOf(u.Type.BAR,t)&&this._renderChartSelect("chart-bar",u.Type.BAR,l.icons.DIAGRAM_BARS_VERTICAL),l.scout.isOneOf(u.Type.BAR_HORIZONTAL,t)&&this._renderChartSelect("chart-stacked",u.Type.BAR_HORIZONTAL,l.icons.DIAGRAM_BARS_HORIZONTAL),l.scout.isOneOf(u.Type.LINE,t)&&this._renderChartSelect("chart-line",u.Type.LINE,l.icons.DIAGRAM_LINE),l.scout.isOneOf(u.Type.PIE,t)&&this._renderChartSelect("chart-pie",u.Type.PIE,l.icons.DIAGRAM_PIE),l.scout.isOneOf(u.Type.BUBBLE,t)&&this._renderChartSelect("chart-bubble",u.Type.BUBBLE,l.icons.DIAGRAM_SCATTER)}_getSupportedChartTypes(){return[u.Type.BAR,u.Type.BAR_HORIZONTAL,u.Type.LINE,u.Type.PIE,u.Type.BUBBLE]}_onClickChartType(t){let e=y()(t.currentTarget),r=e.data("chartType");this.setChartType(r)}_onClickChartGroup(t){let e=y()(t.currentTarget),r=e.parent().data("groupId"),a=e.data("column"),i=e.data("modifier");if(!e.isEnabled())return;let s=e.isSelected()?this._nextDateModifier(i):i;e.data("modifier",s);let n={id:a?a.id:null,modifier:s};this._setChartGroup(r,n)}_onClickAggregation(t){let e=y()(t.currentTarget),r=e.data("modifier"),a=e.isSelected()?this._nextModifier(r):r;e.data("modifier",a);let i=e.data("column"),s={id:i?i.id:null,modifier:a};this._setChartAggregation(s)}_nextDateModifier(t){switch(t){case l.TableMatrix.DateGroup.DATE:return l.TableMatrix.DateGroup.MONTH;case l.TableMatrix.DateGroup.MONTH:return l.TableMatrix.DateGroup.WEEKDAY;case l.TableMatrix.DateGroup.WEEKDAY:return l.TableMatrix.DateGroup.YEAR;case l.TableMatrix.DateGroup.YEAR:return l.TableMatrix.DateGroup.DATE;default:return t}}_nextModifier(t){switch(t){case l.TableMatrix.NumberGroup.SUM:return l.TableMatrix.NumberGroup.AVG;case l.TableMatrix.NumberGroup.AVG:return l.TableMatrix.NumberGroup.SUM;default:return t}}_setChartAggregation(t){t!==this.chartAggregation&&(this._setProperty("chartAggregation",t),this.contentRendered&&this._renderChartAggregation())}_setChartGroup1(t){this._setChartGroup(1,t)}_setChartGroup2(t){this._setChartGroup(2,t)}_setChartGroup(t,e){let r="chartGroup"+t;this._changeProperty(r,e)}_changeProperty(t,e){e!==this[t]&&(this._setProperty(t,e),this.contentRendered&&this["_render"+t.charAt(0).toUpperCase()+t.slice(1)]())}setChartType(t){this.oldChartType=this.chartType,this.setProperty("chartType",t)}_hasColumns(){return this._columns().length>0}_columns(){return new l.TableMatrix(this.table,this.session).columns()}_axisCount(t,e){let r;for(let a=0;a<t.length;a++)if(r=t[a][0],r===e)return t[a][1];return 0}_plainAxisText(t,e){return t.headerHtmlEnabled?l.strings.plainText(e).replace(/\n/g," "):e}_renderContent(t){this.$contentContainer=t.appendDiv("chart-container"),this._installScrollbars(),this._renderChartSelectContainer(),this.dateGroup=[[l.TableMatrix.DateGroup.YEAR,this.session.text("ui.groupedByYear")],[l.TableMatrix.DateGroup.MONTH,this.session.text("ui.groupedByMonth")],[l.TableMatrix.DateGroup.WEEKDAY,this.session.text("ui.groupedByWeekday")],[l.TableMatrix.DateGroup.DATE,this.session.text("ui.groupedByDate")]],this._filterResetListener=this.table.on("filterReset",r=>{this.chart&&this.chart.setCheckedItems([])}),this._addListeners(),this._renderAxisSelectorsContainer();let e=this._renderAxisSelectors();this._renderChart(),this._initializeSelection(e),this._renderChartParts(),this._drawChart()}_addListeners(){this.table.on("rowsInserted",this._tableUpdatedHandler),this.table.on("rowsDeleted",this._tableUpdatedHandler),this.table.on("allRowsDeleted",this._tableUpdatedHandler),this.chart.on("valueClick",this._chartValueClickedHandler)}_renderAxisSelectorsContainer(){this.$axisSelectContainer=this.$contentContainer.appendDiv("axis-select-container")}_renderAxisSelectors(){this.$xAxisSelect=this.$axisSelectContainer.appendDiv("xaxis-select").data("groupId",1),l.scrollbars.install(this.$xAxisSelect,{parent:this,session:this.session,axis:"y"}),this.$yAxisSelect=this.$axisSelectContainer.appendDiv("yaxis-select").data("groupId",2),l.scrollbars.install(this.$yAxisSelect,{parent:this,session:this.session,axis:"y"}),this._chartGroup1Map={},this._chartGroup2Map={};let t=new l.TableMatrix(this.table,this.session),e=t.columnCount(!1);e.sort((n,d)=>Math.abs(n[1]-8)-Math.abs(d[1]-8));let r,a,i=0,s=t.columns(!1);for(let n=0;n<s.length;n++){let d,h,c,p=s[n];p instanceof l.DateColumn?a=!0:(r=this._axisCount(e,p),a=r<=nt.MAX_AXIS_COUNT),d=this._axisContentForColumn(p),h=this.$contentContainer.makeDiv("select-axis",this._plainAxisText(p,d.text)).data("column",p).setEnabled(a),a||(this.chartGroup1&&this.chartGroup1.id===p.id&&(this.chartGroup1=null,this.chartGroup2=null),this.chartGroup2&&this.chartGroup2.id===p.id&&(this.chartGroup2=null)),d.icon&&h.addClass(d.icon.appendCssClass("font-icon")),p instanceof l.DateColumn&&h.data("modifier",l.TableMatrix.DateGroup.YEAR).appendDiv("select-axis-group",this.dateGroup[0][1]),a?(h.on("click",this._onClickChartGroup.bind(this)),l.tooltips.installForEllipsis(h,{parent:this})):l.tooltips.install(h,{parent:this,text:this.session.text("ui.TooMuchData")}),i++,c=h.clone(!0),this._chartGroup1Map[p.id]=h,this._chartGroup2Map[p.id]=c,this.$xAxisSelect.append(h),this.$yAxisSelect.append(c)}if(this._aggregationMap={},this._hasColumns()){this.$dataSelect=this.$axisSelectContainer.appendDiv("data-select"),l.scrollbars.install(this.$dataSelect,{parent:this,session:this.session,axis:"y"});let n=this.session.text("ui.Count");this._aggregationMap.all=this.$dataSelect.appendDiv("select-data data-count",n).data("column",null).data("modifier",l.TableMatrix.NumberGroup.COUNT);for(let d=0;d<s.length;d++){let h=s[d],c=d+1;if(h instanceof l.NumberColumn){let p;l.strings.hasText(h.text)?p=this._plainAxisText(h,h.text):l.strings.hasText(h.headerTooltipText)?p=h.headerTooltipText:p="["+c+"]",this._aggregationMap[h.id]=this.$dataSelect.appendDiv("select-data data-sum",p).data("column",h).data("modifier",l.TableMatrix.NumberGroup.SUM)}}y()(".select-data",this.$contentContainer).on("click",this._onClickAggregation.bind(this))}return e}_initializeSelection(t){let e;this.chartType||this.setChartType(u.Type.BAR),(!this.chartAggregation||!this._aggregationMap[this.chartAggregation.id])&&this._setChartAggregation({id:null,modifier:l.TableMatrix.NumberGroup.COUNT}),(!this.chartGroup1||!this.chartGroup1.id||!this._chartGroup1Map[this.chartGroup1.id])&&(e=this.$xAxisSelect.children(":not(.disabled)"),this._setDefaultSelectionForGroup(1,t,e,0)),(!this.chartGroup2||!this.chartGroup2.id||!this._chartGroup2Map[this.chartGroup2.id])&&(e=this.$yAxisSelect.children(":not(.disabled)"),this._setDefaultSelectionForGroup(2,t,e,1))}_setDefaultSelectionForGroup(t,e,r,a){let i=this._getDefaultSelectedColumn(e,r,a);i&&this._setChartGroup(t,this._getDefaultChartGroup(i))}_getDefaultSelectedColumn(t,e,r){let a=0,i,s;for(let n=0;n<t.length&&a<=r;n++)i=t[n][0],this._existsInAxisColumns(e,i)&&(s=i,a++);return s}_existsInAxisColumns(t,e){for(let r=0;r<t.length;r++)if(t.eq(r).data("column")===e)return!0;return!1}_getDefaultChartGroup(t){let e;return t instanceof l.DateColumn&&(e=256),{id:t.id,modifier:e}}_renderChartParts(){this._renderChartType(),this._renderChartAggregation(),this._renderChartGroup1(),this._renderChartGroup2()}_drawChart(){if(!this._hasColumns()){this._hideChart();return}let t=this._calculateValues();if(t&&t.length)this.chart.setVisible(!0);else{this._hideChart();return}let e={type:this.chartType,options:{handleResize:!0,colorScheme:this.chartColorScheme,maxSegments:5,plugins:{legend:{display:!1}}}},r=[];e.data=this._computeData(r,t),this._adjustFont(e,r),this._adjustConfig(e),this.chart.setConfig(e);let a=this._computeCheckedItems(e.data.datasets[0].deterministicKeys);this.chart.setCheckedItems(a)}_hideChart(){this.chart.setConfig({type:this.chartType}),this.chart.setVisible(!1)}_getDatasetLabel(){let t=this._aggregationMap[this.chartAggregation.id||"all"];return(t?t.text():null)||this.session.text("ui.Value")}_calculateValues(){let t=new l.TableMatrix(this.table,this.session),e=this.chartAggregation.id?this._aggregationMap[this.chartAggregation.id].data("column"):-1;if(t.addData(e,this.chartAggregation.modifier),this.chartGroup1){let r=this._chartGroup1Map[this.chartGroup1.id].data("column");this.xAxis=t.addAxis(r,this.chartGroup1.modifier)}if(this.chartType===u.Type.BUBBLE&&this.chartGroup2){let r=this._chartGroup2Map[this.chartGroup2.id].data("column");this.yAxis=t.addAxis(r,this.chartGroup2.modifier)}else this.yAxis=null;if(!(t.isEmpty()||!t.isMatrixValid()))return t.calculate()}_getXAxis(){return this.xAxis}_getYAxis(){return this.yAxis}_computeData(t,e){let r={datasets:[{label:this._getDatasetLabel()}]};if(!e)return r;t=t||[];let a=[];if(this.chartType===u.Type.BUBBLE)a=this._computeBubbleData(t,e);else{let n=this._getXAxis();for(let d=0;d<n.length;d++){let h,c=n[d];n.column instanceof l.NumberColumn?h=c:h=this._handleIconLabel(n.format(c),n,t),a.push({value:e.getValue([c])[0],label:h,deterministicKey:n.keyToDeterministicKey(c)})}}let i=r.datasets[0],s=[];return i.data=[],i.deterministicKeys=[],a.forEach(n=>{i.data.push(n.value),i.deterministicKeys.push(n.deterministicKey),l.objects.isNullOrUndefined(n.label)||s.push(n.label)}),s.length&&(r.labels=s),r}_computeBubbleData(t,e){if(!e)return[];t=t||[];let r=this._getXAxis(),a=this._getYAxis(),i=[];for(let s=0;s<r.length;s++){let n=r[s],d=n;this._handleIconLabel(r.format(n),r,t),!(r.column instanceof l.NumberColumn)&&d===null&&(d=r.max),r.column instanceof l.DateColumn&&(d=d-r.min);for(let h=0;h<a.length;h++){let c=a[h],p=c,f=e.getValue([n,c]);this._handleIconLabel(a.format(c),a,t),f&&f.length&&(!(a.column instanceof l.NumberColumn)&&p===null&&(p=a.max),a.column instanceof l.DateColumn&&(p=p-a.min),i.push({value:{x:d,y:p,z:f[0]},deterministicKey:[r.keyToDeterministicKey(n),a.keyToDeterministicKey(c)]}))}}return i}_handleIconLabel(t,e,r){if(e&&e.isIcon){let a=l.icons.parseIconId(t);if(a&&a.isFontIcon())return r.push(...a.appendCssClass("font-icon").split(" ")),a.iconCharacter}return t}_adjustFont(t,e){if(!(!t||!e)&&(e=e.filter((r,a,i)=>i.indexOf(r)===a),e.length)){let r=l.styles.get(e,"font-family").fontFamily;this.chartType!==u.Type.PIE&&(t.options=y().extend(!0,{},t.options,{scales:{x:{ticks:{font:{family:r}}},y:{ticks:{font:{family:r}}}}})),t.options=y().extend(!0,{},t.options,{plugins:{tooltip:{titleFont:{family:r}}}}),t.options=y().extend(!0,{},t.options,{plugins:{datalabels:{font:{family:r}}}})}}_adjustLabels(t){if(!t)return;let e=this._getXAxis(),r=this._getYAxis();this.chartType===u.Type.BUBBLE?(e.column instanceof l.NumberColumn||(t.options=y().extend(!0,{},t.options,{scales:{x:{ticks:{callback:a=>this._formatLabel(a,e)}}}})),r.column instanceof l.NumberColumn||(t.options=y().extend(!0,{},t.options,{scales:{y:{ticks:{callback:a=>this._formatLabel(a,r)}}}}))):e.column instanceof l.NumberColumn&&(t.options=y().extend(!0,{},t.options,{reformatLabels:!0}))}_formatLabel(t,e){if(!e)return""+t;if(e.column instanceof l.DateColumn&&(t=t+e.min,t!==parseInt(""+t)||e.length<2&&(t<e.min||t>e.max)))return null;if(e.indexOf(null)!==-1){if(t===e.max)t=null;else if(t>e.max)return null}let r=e.format(t);if(e.isIcon){let a=l.icons.parseIconId(r);a&&a.isFontIcon()&&(r=a.iconCharacter)}return r}_adjustConfig(t){t&&(this._adjustLabels(t),this._adjustClickable(t),this.chartType===u.Type.BUBBLE?this._adjustBubble(t):this.chartType===u.Type.PIE?this._adjustPie(t):this._adjustScales(t))}_adjustClickable(t){t&&this._isChartClickable()&&(t.options=y().extend(!0,{},t.options,{clickable:!0,checkable:!0,otherSegmentClickable:!0}))}_isChartClickable(){return!0}_adjustBubble(t){!t||this.chartType!==u.Type.BUBBLE||(t.options.bubble=y().extend(!0,{},t.options.bubble,{sizeOfLargestBubble:25,minBubbleSize:5}))}_adjustPie(t){if(!t||this.chartType!==u.Type.PIE)return;t.data.datasets[0].datalabels={labels:{index:{display:"auto",color:l.styles.get([this.chartColorScheme,this.chartType+"-chart","elements","label"],"fill").fill,formatter:(r,a)=>a.chart.data.labels[a.dataIndex],anchor:"end",align:"end",clamp:!0,offset:10,padding:4},labels:{}}},t.options=y().extend(!0,{},t.options,{plugins:{datalabels:{display:!0}}});let e=this.chart.$container.cssMarginTop()-this.chart.$container.cssMarginBottom();t.options=y().extend(!0,{},t.options,{layout:{padding:{top:30+(Math.sign(e)<0?Math.abs(e):0),bottom:30+(Math.sign(e)>0?e:0)}}})}_adjustScales(t){t&&(t.options=y().extend(!0,{},t.options,{scales:{x:{beginAtZero:!0},y:{beginAtZero:!0}}}))}_computeCheckedItems(t){if(!t)return[];let e=this._getXAxis(),r=this._getYAxis(),a=this.table.getFilter(Z.TYPE),i=[],s=[];a&&(a.xAxis||{}).column===(e||{}).column&&(a.yAxis||{}).column===(r||{}).column&&(i=a.filters),t.forEach((h,c)=>{i.filter(p=>Array.isArray(p.deterministicKey)&&Array.isArray(h)?l.arrays.equals(p.deterministicKey,h):p.deterministicKey===h).length&&s.push(c)});let n=0;if(this.chartType===u.Type.PIE){let h=this.chart.config.options.maxSegments,c=l.arrays.init(t.length-h,null).map((p,f)=>f+h);l.arrays.containsAll(s,c)||l.arrays.remove(s,h-1),l.arrays.removeAll(s,c),n=1}let d=[];return s.length&&s.forEach(h=>{d.push({datasetIndex:n,dataIndex:h})}),d}_onChartValueClick(){let t=[];if(this.chart&&this.chart.config.data){let e=this.chart.config.options.maxSegments,r=this.chart.config.data.datasets[0],a=s=>({deterministicKey:r.deterministicKeys[s]});this.chartType===u.Type.PIE&&(a=s=>(s=parseInt(""+s),e&&e===s+1?l.arrays.init(r.deterministicKeys.length-s,null).map((n,d)=>({deterministicKey:r.deterministicKeys[d+s]})):{deterministicKey:r.deterministicKeys[s]})),this.chart.checkedItems.filter(s=>s.datasetIndex===0).map(s=>s.dataIndex).forEach(s=>{l.arrays.pushAll(t,a(s))})}if(t.length){let e=l.scout.create(Z,{session:this.session,table:this.table,text:this.tooltipText,xAxis:this._getXAxis(),yAxis:this._getYAxis(),filters:t});this.table.addFilter(e)}else this.table.removeFilterByKey(Z.TYPE)}_axisContentForColumn(t){let e=t.text;if(l.strings.hasText(e))return{text:e};if(t.headerIconId){let r=l.icons.parseIconId(t.headerIconId);if(r.isFontIcon())return{text:r.iconCharacter,icon:r}}return t.headerTooltipText?{text:t.headerTooltipText}:{text:"["+(this._columns().indexOf(t)+1)+"]"}}_removeContent(){this._removeScrollbars(),this.$contentContainer.remove(),this.chart.remove(),this.table.events.removeListener(this._filterResetListener),this._removeListeners(),this.oldChartType=null,this.recomputeEnabled()}_removeScrollbars(){this.$xAxisSelect.each((t,e)=>{l.tooltips.uninstall(y()(e))}),l.scrollbars.uninstall(this.$xAxisSelect,this.session),this.$yAxisSelect.each((t,e)=>{l.tooltips.uninstall(y()(e))}),l.scrollbars.uninstall(this.$yAxisSelect,this.session),l.scrollbars.uninstall(this.$dataSelect,this.session),this._uninstallScrollbars()}_removeListeners(){this.table.off("rowsInserted",this._tableUpdatedHandler),this.table.off("rowsDeleted",this._tableUpdatedHandler),this.table.off("allRowsDeleted",this._tableUpdatedHandler),this.chart.off("valueClick",this._chartValueClickedHandler)}_onTableUpdated(t){this._tableUpdatedTimeOutId||(this._tableUpdatedTimeOutId=setTimeout(()=>{this._tableUpdatedTimeOutId=null,this.rendered&&(this._setChartGroup1(null),this._setChartGroup2(null),this.removeContent(),this.renderContent())}))}_onTableColumnStructureChanged(){this.recomputeEnabled(),this.contentRendered&&this.selected&&this._onTableUpdated()}}k(nt,"DATE_GROUP_FLAG",256),k(nt,"MAX_AXIS_COUNT",100);function st(o,t,e){return t=Pe(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Pe(o){var t=Ee(o,"string");return typeof t=="symbol"?t:t+""}function Ee(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class Z extends l.TableUserFilter{constructor(){super(),st(this,"text",void 0),st(this,"xAxis",void 0),st(this,"yAxis",void 0),st(this,"filters",void 0),st(this,"columnIdX",void 0),st(this,"columnIdY",void 0),this.filterType=Z.TYPE,this.text=null,this.xAxis=null,this.yAxis=null,this.filters=[],this.columnIdX=null,this.columnIdY=null}createLabel(){return this.text}createFilterAddedEventData(){let t=super.createFilterAddedEventData();return t.text=this.text,t.filters=this.filters,t.columnIdX=this.xAxis&&this.xAxis.column?this.xAxis.column.id:null,t.columnIdY=this.yAxis&&this.yAxis.column?this.yAxis.column.id:null,t}calculate(){let t=new l.TableMatrix(this.table,this.session),e=this.table.columnById(this.columnIdX),r=e.createFilter().axisGroup();if(this.xAxis=t.addAxis(e,r),this.columnIdY){let a=this.table.columnById(this.columnIdY),i=a.createFilter().axisGroup();this.yAxis=t.addAxis(a,i)}t.calculate()}accept(t){this.xAxis||this.calculate();let e=this.xAxis.column.cellValueOrTextForCalculation(t),r=this.xAxis.normDeterministic(e);if(!this.yAxis)return this.filters.filter(i=>i.deterministicKey===r).length>0;e=this.yAxis.column.cellValueOrTextForCalculation(t);let a=this.yAxis.normDeterministic(e);return this.filters.filter(i=>l.arrays.equals(i.deterministicKey,[r,a])).length>0}}st(Z,"TYPE","CHART");class Gt extends l.TableControlAdapter{constructor(){super(),this._addRemoteProperties(["chartType","chartAggregation","chartGroup1","chartGroup2"])}}function De(o,t,e){return t=Me(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Me(o){var t=Ie(o,"string");return typeof t=="symbol"?t:t+""}function Ie(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}class Pt extends l.AbstractLayout{constructor(t){super(),De(this,"control",void 0),this.control=t}layout(t){this.control.contentRendered&&(l.scrollbars.update(this.control.$contentContainer),l.scrollbars.update(this.control.$xAxisSelect),l.scrollbars.update(this.control.$yAxisSelect),l.scrollbars.update(this.control.$dataSelect))}}const Vt=ut;l.ObjectFactory.get().registerNamespace("scout",ut);var we=S.AbstractChartRenderer,He=S.AbstractSvgChartRenderer,Ne=S.Chart,Fe=S.ChartAdapter,Ge=S.ChartField,Ve=S.ChartFieldAdapter,$e=S.ChartFieldTile,je=S.ChartFieldTileAdapter,Ue=S.ChartJsRenderer,We=S.ChartLayout,ze=S.ChartTableControl,Xe=S.ChartTableControlAdapter,Ye=S.ChartTableControlLayout,Je=S.ChartTableUserFilter,qe=S.FulfillmentChartRenderer,Ke=S.SalesfunnelChartRenderer,Ze=S.SpeedoChartRenderer,Qe=S.VennAsync3Calculator,tr=S.VennChartRenderer,er=S.VennCircle,rr=S.VennCircleHelper,ar=S.chartJsDateAdapter,ir=S.default;export{we as AbstractChartRenderer,He as AbstractSvgChartRenderer,Ne as Chart,Fe as ChartAdapter,Ge as ChartField,Ve as ChartFieldAdapter,$e as ChartFieldTile,je as ChartFieldTileAdapter,Ue as ChartJsRenderer,We as ChartLayout,ze as ChartTableControl,Xe as ChartTableControlAdapter,Ye as ChartTableControlLayout,Je as ChartTableUserFilter,qe as FulfillmentChartRenderer,Ke as SalesfunnelChartRenderer,Ze as SpeedoChartRenderer,Qe as VennAsync3Calculator,tr as VennChartRenderer,er as VennCircle,rr as VennCircleHelper,ar as chartJsDateAdapter,ir as default};
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=eclipse-scout-chart.esm-8d9db200429e545abcae.min.js.map
|