UNPKG

@syncfusion/ej2-heatmap

Version:

Feature rich data visulization control used to visualize the matrix data where the individual values are represented as colors

12 lines 220 kB
/*!
*  filename: ej2-heatmap.umd.min.js
*  version : 30.1.42
*  Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
*  Use of this code is subject to the terms of our license.
*  A copy of the current license can be obtained at any time by e-mailing
*  licensing@syncfusion.com. Any infringement will be prosecuted under
*  applicable laws. 
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-svg-base","@syncfusion/ej2-data","@syncfusion/ej2-pdf-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2SvgBase,e.ej2Data,e.ej2PdfExport)}(this,function(e,P,O,_,B){"use strict";var t;(i=t=t||{}).heatMapTitleFont={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},i.titleFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},i.axisTitleFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},i.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},i.legendLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},i.rectLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},i.tooltipFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"};N=function(e,t){return(N=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var N,H,i=function(e,t){function i(){this.constructor=e}N(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},l=function(e,t,i,l){var a,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;0<=s;s--)(a=e[s])&&(o=(n<3?a(o):3<n?a(t,i,o):a(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},k=(H=P.ChildProperty,i(a,H),l([P.Property("16px")],a.prototype,"size",void 0),l([P.Property("")],a.prototype,"color",void 0),l([P.Property("Segoe UI")],a.prototype,"fontFamily",void 0),l([P.Property("Normal")],a.prototype,"fontWeight",void 0),l([P.Property("Normal")],a.prototype,"fontStyle",void 0),l([P.Property("Center")],a.prototype,"textAlignment",void 0),l([P.Property("Trim")],a.prototype,"textOverflow",void 0),a);function a(){return null!==H&&H.apply(this,arguments)||this}G=P.ChildProperty,i(W,G),l([P.Property(10)],W.prototype,"left",void 0),l([P.Property(10)],W.prototype,"right",void 0),l([P.Property(10)],W.prototype,"top",void 0),l([P.Property(10)],W.prototype,"bottom",void 0);var G,U=W;function W(){return null!==G&&G.apply(this,arguments)||this}j=P.ChildProperty,i(X,j),l([P.Property("")],X.prototype,"color",void 0),l([P.Property(1)],X.prototype,"width",void 0),l([P.Property("")],X.prototype,"radius",void 0);var j,Y=X;function X(){return null!==j&&j.apply(this,arguments)||this}J=P.ChildProperty,i(q,J),l([P.Property("")],q.prototype,"color",void 0),l([P.Property(0)],q.prototype,"width",void 0);var J,K=q;function q(){return null!==J&&J.apply(this,arguments)||this}Z=P.ChildProperty,i(Q,Z),l([P.Property(null)],Q.prototype,"size",void 0),l([P.Property(null)],Q.prototype,"color",void 0);var Z,$=Q;function Q(){return null!==Z&&Z.apply(this,arguments)||this}ee=P.ChildProperty,i(ie,ee),l([P.Property("")],ie.prototype,"text",void 0),l([P.Complex({},k)],ie.prototype,"textStyle",void 0);var ee,te=ie;function ie(){return null!==ee&&ee.apply(this,arguments)||this}le=P.ChildProperty,i(ne,le),l([P.Property("#eeeeee")],ne.prototype,"minColor",void 0),l([P.Property("#eeeeee")],ne.prototype,"maxColor",void 0);var le,ae=ne;function ne(){return null!==le&&le.apply(this,arguments)||this}oe=P.ChildProperty,i(n,oe),l([P.Property(null)],n.prototype,"value",void 0),l([P.Property(null)],n.prototype,"color",void 0),l([P.Property(null)],n.prototype,"label",void 0),l([P.Property(null)],n.prototype,"startValue",void 0),l([P.Property(null)],n.prototype,"endValue",void 0),l([P.Property(null)],n.prototype,"minColor",void 0),l([P.Property(null)],n.prototype,"maxColor",void 0);var oe,se=n;function n(){return null!==oe&&oe.apply(this,arguments)||this}re=P.ChildProperty,i(de,re),l([P.Property("#b5b5b5")],de.prototype,"color",void 0),l([P.Property(1)],de.prototype,"width",void 0),l([P.Property("Rectangle")],de.prototype,"type",void 0);var re,he=de;function de(){return null!==re&&re.apply(this,arguments)||this}pe=P.ChildProperty,i(ce,pe),l([P.Property("0%")],ce.prototype,"minimum",void 0),l([P.Property("100%")],ce.prototype,"maximum",void 0);var pe,ge=ce;function ce(){return null!==pe&&pe.apply(this,arguments)||this}ue=P.ChildProperty,i(ye,ue),l([P.Property(null)],ye.prototype,"start",void 0),l([P.Property(null)],ye.prototype,"end",void 0),l([P.Property("")],ye.prototype,"text",void 0),l([P.Property(null)],ye.prototype,"maximumTextWidth",void 0);var ue,me=ye;function ye(){return null!==ue&&ue.apply(this,arguments)||this}xe=P.ChildProperty,i(be,xe),l([P.Property("Center")],be.prototype,"alignment",void 0),l([P.Property("Wrap")],be.prototype,"overflow",void 0),l([P.Complex(t.axisLabelFont,k)],be.prototype,"textStyle",void 0),l([P.Complex({color:"#b5b5b5",width:1,type:"Rectangle"},he)],be.prototype,"border",void 0),l([P.Collection([],me)],be.prototype,"categories",void 0);var xe,i=be;function be(){return null!==xe&&xe.apply(this,arguments)||this}var ve,Se,Ce=function(e,t,i,l,a,n,o){this.value=e,this.color=t,this.label=i,this.startValue=l,this.endValue=a,this.minColor=n,this.maxColor=o},fe=function(e,t,i){this.mappingName=e,this.bubbleData=t,this.valueType=i},Me=function(e,t,i,l,a,n,o,s){this.value=e,this.color=t,this.label=i,this.startValue=l,this.endValue=a,this.minColor=n,this.maxColor=o,this.isHidden=s},we=function(e,t,i,l,a){this.index=1,this.row=1,this.start=e,this.end=t,this.index=i,this.label=l,this.row=a},l=(ve=function(e,t){return(ve=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)},function(e,t){function i(){this.constructor=e}ve(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=function(e,t,i,l){var a,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;0<=s;s--)(a=e[s])&&(o=(n<3?a(o):3<n?a(t,i,o):a(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},l=(Se=P.ChildProperty,l(Le,Se),o([P.Collection([{}],se)],Le.prototype,"palette",void 0),o([P.Property("Gradient")],Le.prototype,"type",void 0),o([P.Property("")],Le.prototype,"emptyPointColor",void 0),o([P.Property("Table")],Le.prototype,"colorGradientMode",void 0),o([P.Complex({},ae)],Le.prototype,"fillColor",void 0),Le);function Le(){return null!==Se&&Se.apply(this,arguments)||this}var Te=function(e,t,i){this.R=e,this.G=t,this.B=i},Re=(s.prototype.convertToRGB=function(e,t){var i,l,a,n=this.heatMap.isColorRange?t[0].startValue:t[0].value,o=0,s=0;if(this.heatMap.isColorRange&&"Gradient"===this.heatMap.paletteSettings.type)for(s=0;s<t.length;s++)if(e<=(a=Number(t[s].endValue))&&e>=Number(t[s].startValue))o=a,i=this.heatMap.colorCollection[s].minColor,l=this.heatMap.colorCollection[s].maxColor;else{if(t[0].startValue!==this.heatMap.dataSourceMinValue&&e<t[0].startValue){o=t[0].startValue,n=this.heatMap.dataSourceMinValue,i=this.heatMap.paletteSettings.fillColor.minColor,l=this.heatMap.paletteSettings.fillColor.maxColor;break}if(a<e&&e<=(s===t.length-1?this.heatMap.dataSourceMaxValue:t[s+1].startValue)){o=s===t.length-1?this.heatMap.dataSourceMaxValue:t[s+1].startValue,n=a,i=this.heatMap.paletteSettings.fillColor.minColor,l=this.heatMap.paletteSettings.fillColor.maxColor;break}n=o=a}else for(s=1;s<t.length;s++){if(e<=(a=Number(t[s].value))){o=a,i=this.getEqualColor(t,n),l=this.getEqualColor(t,o);break}n=o=a}var r=(e-n)/(o-n);return r=isNaN(r)||!isFinite(r)?0:r,this.getPercentageColor(r,i,l)},s.prototype.rgbToHex=function(e,t,i){return"#"+this.componentToHex(e)+this.componentToHex(t)+this.componentToHex(i)},s.prototype.componentToHex=function(e){e=e.toString(16);return 1===e.length?"0"+e:e},s.prototype.getEqualColor=function(e,t){for(var i,l=0;l<e.length;l++)if(Number(e[l].value)===t)return i=e[l].color,P.isNullOrUndefined(i)?i="#FFFFFF":-1!==i.indexOf("rgb")?i=this.convertToHex(i):-1===i.indexOf("#")&&(i="#FFFFFF"),i;return"#00000"},s.prototype.convertToHex=function(e){var e=e.substr(3),t=(e=e.split("(")[1].split(")")[0]).split(",");return e=this.rgbToHex(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))},s.prototype.getPercentageColor=function(e,t,i){var i=i.split("#")[1],t=t.split("#")[1],l=this.getPercentage(e,parseInt(t.substr(0,2),16),parseInt(i.substr(0,2),16)),a=this.getPercentage(e,parseInt(t.substr(2,2),16),parseInt(i.substr(2,2),16)),e=this.getPercentage(e,parseInt(t.substr(4,2),16),parseInt(i.substr(4,2),16));return new Te(l,a,e)},s.prototype.getPercentage=function(e,t,i){return Math.round(t+(i-t)*e)},s.prototype.getColorCollection=function(){var e,t=this.heatMap;t.colorCollection=[],t.legendColorCollection=[];for(var i=0;i<this.heatMap.paletteSettings.palette.length;i++){if(null===this.heatMap.paletteSettings.palette[i].startValue||null===this.heatMap.paletteSettings.palette[i].endValue){this.heatMap.isColorRange=!1;break}this.heatMap.isColorRange=!0}var l=t.bubbleSizeWithColor?t.minColorValue:t.dataSourceMinValue,a=t.bubbleSizeWithColor?t.maxColorValue:t.dataSourceMaxValue,n=(t.emptyPointColor=t.paletteSettings.emptyPointColor||t.themeStyle.emptyCellColor,this.orderbyOffset((this.heatMap.isColorRange||t.paletteSettings.palette&&1<t.paletteSettings.palette.length?t.paletteSettings:t.themeStyle).palette));if(n.isCompact)t.colorCollection=n.offsets,t.legendColorCollection=P.extend([],n.offsets,null,!0);else if(e="Gradient"===t.paletteSettings.type?(a-l)/(n.offsets.length-1):(a-l)/n.offsets.length,2<=n.offsets.length)for(var o=0;o<n.offsets.length;o++)t.colorCollection.push(new Ce(Math.round(100*(l+o*e))/100,n.offsets[o].color,n.offsets[o].label,n.offsets[o].startValue,n.offsets[o].endValue,n.offsets[o].minColor,n.offsets[o].maxColor)),t.legendColorCollection.push(new Me(Math.round(100*(l+o*e))/100,n.offsets[o].color,n.offsets[o].label,n.offsets[o].startValue,n.offsets[o].endValue,n.offsets[o].minColor,n.offsets[o].maxColor,!1));this.heatMap.isColorRange||this.updateLegendColorCollection(l,a,n)},s.prototype.updateLegendColorCollection=function(e,t,i){"Fixed"===this.heatMap.paletteSettings.type&&(i.isCompact||i.isLabel)||(Math.round(100*e)/100<this.heatMap.legendColorCollection[0].value&&this.heatMap.legendColorCollection.unshift(new Me(Math.round(100*e)/100,this.heatMap.legendColorCollection[0].color,this.heatMap.legendColorCollection[0].label,this.heatMap.legendColorCollection[0].startValue,this.heatMap.legendColorCollection[0].endValue,this.heatMap.legendColorCollection[0].minColor,this.heatMap.legendColorCollection[0].maxColor,!0)),Math.round(100*t)/100>this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].value&&this.heatMap.legendColorCollection.push(new Me(Math.round(100*t)/100,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].color,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].label,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].startValue,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].endValue,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].minColor,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].maxColor,!0)))},s.prototype.orderbyOffset=function(e){var i=new mt,l=this.heatMap.isColorRange?"to":"value";return i.isCompact=!0,i.isLabel=!0,i.offsets=e.sort(function(e,t){return P.isNullOrUndefined(e.label)&&P.isNullOrUndefined(t.label)&&(i.isLabel=!1),P.isNullOrUndefined(e[l])||P.isNullOrUndefined(t[l])?(i.isCompact=!1,e):e[l]-t[l]}),i.isCompact||(i.offsets=(this.heatMap.paletteSettings.palette&&1<this.heatMap.paletteSettings.palette.length?this.heatMap.paletteSettings:this.heatMap.themeStyle).palette),i},s.prototype.getColorByValue=function(e){var t,i="";if(""!==e.toString())if("Bubble"!==this.heatMap.cellSettings.tileType||"Size"!==this.heatMap.cellSettings.bubbleType&&"Sector"!==this.heatMap.cellSettings.bubbleType)if("Fixed"===this.heatMap.paletteSettings.type)for(var l=0;l<this.heatMap.colorCollection.length;l++){var a=this.heatMap.isColorRange?this.heatMap.paletteSettings.palette[l].startValue:(this.heatMap.colorCollection[l+1]||this.heatMap.colorCollection[l]).value,n=this.heatMap.dataSourceMinValue===this.heatMap.dataSourceMaxValue;if(this.heatMap.isColorRange){var o=void 0;e<=this.heatMap.colorCollection[l].endValue&&e>=this.heatMap.colorCollection[l].startValue?(this.heatMap.legendVisibilityByCellType&&(o=this.heatMap.legendModule.legendRange),i=this.heatMap.legendVisibilityByCellType&&o[l]&&!o[l].visible?this.heatMap.themeStyle.toggledColor:this.heatMap.colorCollection[l].minColor):""===i&&(i=this.heatMap.paletteSettings.fillColor.minColor)}else if(e<=a&&n&&0===l||e<a||a<=e&&l===this.heatMap.colorCollection.length-1){o=void 0;this.heatMap.legendVisibilityByCellType&&(o=this.heatMap.legendModule.legendRange),i=this.heatMap.legendVisibilityByCellType&&o[l]&&!o[l].visible?this.heatMap.themeStyle.toggledColor:this.heatMap.colorCollection[l].color;break}}else"Table"!==this.heatMap.paletteSettings.colorGradientMode&&this.getColorCollection(),i=e<this.heatMap.colorCollection[0].value&&!this.heatMap.isColorRange?this.heatMap.colorCollection[0].color:e>this.heatMap.colorCollection[this.heatMap.colorCollection.length-1].value&&!this.heatMap.isColorRange?this.heatMap.colorCollection[this.heatMap.colorCollection.length-1].color:(t=this.convertToRGB(e,this.heatMap.colorCollection),this.rgbToHex(t.R,t.G,t.B));else i=this.heatMap.isColorRange?this.heatMap.colorCollection[0].minColor:this.heatMap.colorCollection[0].color;else i=this.heatMap.emptyPointColor;return i},s.prototype.destroy=function(){this.heatMap=null},s);function s(e){this.heatMap=e}Oe=function(e,t){return(Oe=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Oe,o=function(e,t){function i(){this.constructor=e}Oe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)};function p(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function D(e,t){var i=e||"",l=document.getElementById("heatmapmeasuretext");if(null===l&&(l=P.createElement("text",{id:"heatmapmeasuretext"}),document.body.appendChild(l)),"string"==typeof e&&(-1<e.indexOf("<")||-1<e.indexOf(">"))){for(var a=e.split(" "),n=0;n<a.length;n++)-1===a[n].indexOf("<br/>")&&(a[n]=a[n].replace(/[<>]/g,"&"));e=a.join(" ")}return l.innerText=-1<i.indexOf("<br>")||-1<i.indexOf("<br/>")?i:e,l.style.position="absolute",l.style.visibility="hidden",l.style.fontSize=-1!==t.size.indexOf("px")?t.size:t.size+"px",l.style.fontWeight=t.fontWeight,l.style.fontStyle=t.fontStyle,l.style.fontFamily=t.fontFamily,l.style.top="-100",l.style.left="0",l.style.whiteSpace="nowrap",l.style.lineHeight="normal",new A(l.clientWidth,l.clientHeight)}function ze(e,t){this["font-size"]=e.size,this["font-style"]=e.fontStyle.toLowerCase(),this["font-family"]=e.fontFamily,this["font-weight"]=e.fontWeight.toLowerCase(),this.fill=t||""}function Pe(e,t,i,l){l="Near"===l.textAlignment?t:"Center"===l.textAlignment?t+e/2:e+t;return l}function De(e){this.id=e}var Ae,A=function(e,t){this.width=e,this.height=t},g=(o(Fe,Ae=De),Fe);function Fe(e,t,i,l,a,n,o){e=Ae.call(this,e)||this;return e.opacity=a,e.fill=t,e.stroke=l||"",e["stroke-width"]=parseFloat(i.toString()),e["stroke-dasharray"]=n,e.d=o,e}function Ve(e,i,t,l,a,n,o){var s,r,e=Ie(e=i.enableHtmlSanitizer&&"string"==typeof e?P.SanitizeHtmlHelper.sanitize(e):e,i),h=null,d=i.dataSource;if(!i.dataSourceSettings.isJsonData||"Cell"!==i.dataSourceSettings.adaptorType&&"Table"!==i.dataSourceSettings.adaptorType?h={value:l.value,xLabel:a[l.xIndex],yLabel:n[l.yIndex]}:(s="Numeric"===i.yAxis.valueType?i.yAxis.labels:n,r="Numeric"===i.xAxis.valueType?i.xAxis.labels:a,d.forEach(function(t){var e="Cell"===i.dataSourceSettings.adaptorType?Object.keys(t).some(function(e){return t[e]===s[l.yIndex]}):Object.prototype.hasOwnProperty.call(t,s[l.yIndex]);Object.keys(t).some(function(e){return t[e]===r[l.xIndex]})&&e&&(h=t)})),!P.isNullOrUndefined(e)){var p=Ee(e(h,i,e,i.element.id+"_Template"+o,!1),i.element.id+"_LabelTemplate_"+o);p.style.cssText="opacity: 1; display: flex; align-items: center; justify-content: center; z-index: 2; position: absolute;top:"+l.y+"px;left:"+l.x+"px;height:"+l.height+"px;width:"+l.width+"px;";for(var g=0;g<p.children.length;g++)p.children[g].style.pointerEvents="none";t.appendChild(p)}return t}function Ie(t,e){var i=null;try{"function"!=typeof t&&document.querySelectorAll(t).length?i=P.compile(document.querySelector(t).innerHTML.trim()):(e.isVue||e.isVue3||"function"==typeof t)&&(i=P.compile(t))}catch(e){i=P.compile(t)}return i}function Ee(e,t){for(var i=P.createElement("div",{id:t}),l=(i.style.cssText="position: absolute;pointer-events: auto;",e.length);0<l;)i.appendChild(e[0]),l--;return i}var _e,Be=function(e,t,i,l,a,n,o,s,r,h,d,p,g,c){this.x=e,this.y=t,this.width=i,this.height=l,this.value=a,this.id=n,this.xIndex=o,this.yIndex=s,this.xValue=r,this.yValue=h,this.visible=d,this.displayText=p,this.textId=g,this.allowCollection=c},Ne=function(e,t,i,l,a,n,o,s,r,h,d,p){this.value=e,this.xLabel=t,this.yLabel=i,this.xValue=l,this.yValue=a,this.cellElement=n,this.xPosition=o,this.yPosition=s,this.width=r,this.height=h,this.x=d,this.y=p},b=(o(He,_e=g),He);function He(e,t,i,l,a,n,o,s,r,h){e=_e.call(this,e,t,i.width,n,l,h)||this;return e.y=a.y,e.x=a.x,e.height=0<a.height?a.height:0,e.width=0<a.width?a.width:0,e.rx=o||0,e.ry=s||0,e.transform=r||"",e}o(Ue,ke=g);var ke,Ge=Ue;function Ue(e,t,i,l,a,n,o,s){e=ke.call(this,e,t,i.width,a,l)||this;return e.cx=n||0,e.cy=o||0,e.r=s||0,e}var We,z=function(e,t,i,l){this.x=e,this.y=t,this.width=i,this.height=l},F=(o(je,We=ze),je);function je(e,t,i,l){i=We.call(this,i,l)||this;return i.transform="",i["dominant-baseline"]="auto",i.role="region",i.labelRotation=0,i.baseline="auto",i.id=e,i.x=t.x,i.y=t.y,i["text-anchor"]=t["text-anchor"],i.text=t.text,i["aria-label"]=t.text,i.transform=t.transform,i.labelRotation=t.labelRotation,i["dominant-baseline"]=t["dominant-baseline"],i.baseline=t.baseline,i.dy=t.dy,i}var Ye,V=function(e,t,i,l,a,n,o,s){this.transform="",this["dominant-baseline"]="auto",this.labelRotation=0,this.baseline="auto",this.x=e||0,this.y=t||0,this["text-anchor"]=i||"start",this.text=l||"",this["aria-label"]=l,this.transform=n||"",this.labelRotation=a,this["dominant-baseline"]=o||"auto",this.baseline=o||"",this.dy=s||""},Xe=function(e,t,i,l){this.x1=e,this.y1=t,this.x2=i,this.y2=l},Je=(o(Ke,Ye=g),Ke);function Ke(e,t,i,l,a,n){e=Ye.call(this,e,null,l,i,a,n,null)||this;return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}o($e,qe=g);var qe,Ze=$e;function $e(e,t,i,l,a,n,o){e=qe.call(this,e,i,a,o,n,null)||this;return e.d=t.d,e.x=t.x,e.y=t.y,e}var Qe=function(e,t,i,l,a,n,o,s,r,h,d,p){this.d=e,this.innerR=t,this.cx=o,this.cy=s,this.x=i,this.y=l,this.x1=a,this.y1=n,this.start=r,this.end=h,this.radius=d,this.counterClockWise=p};function c(e){for(var t=0,i=0,l=e;i<l.length;i++)t+=l[i];return t}function et(e,t,i,l){i="Near"===l.textAlignment?e.height-i:"Center"===l.textAlignment?e.height/2:t;return i}function tt(e,t,i){var l,a,n=new O.SvgRenderer("heatmapMeasureRotateText"),o=n.createSvg({id:"heatmapMeasureRotateText_svg",width:100,height:100}),i={"font-size":e.size,"font-style":e.fontStyle.toLowerCase(),"font-family":e.fontFamily,"font-weight":e.fontWeight.toLowerCase(),transform:"rotate("+i+", 0, 0)","text-anchor":"middle"},s=n.createText(i,t[0]);if("string"!=typeof t&&1<t.length)for(var r=1,h=t.length;r<h;r++)a=D(t[r],e).height,l=t[r],a=n.createTSpan({x:0,id:"heatmapMeasureRotateText_"+r,y:0+r*a},l),s.appendChild(a);o.appendChild(s),document.body.appendChild(o);i=s.getBoundingClientRect();return P.remove(o),new A(i.right-i.left,i.bottom-i.top)}r.prototype.drawRectangle=function(e,t,i){this.heatMap.enableCanvasRendering?this.drawCanvasRectangle(this.heatMap.canvasRenderer,e,i):(delete e.d,-1===(i=t.appendChild(this.heatMap.renderer.drawRectangle(e))).id.indexOf("Rect")?(i.setAttribute("title","Rect Element"),i.setAttribute("role","img"),i.setAttribute("aria-hidden","false")):(t=this.heatMap.cellSettings.enableCellHighlighting||this.heatMap.allowSelection?0:-1,i.setAttribute("tabindex",t.toString()),i.style.outline="none"))},r.prototype.drawCircle=function(e,t){this.heatMap.enableCanvasRendering?this.drawCanvasCircle(this.heatMap.canvasRenderer,e):(delete e.d,t=t.appendChild(this.heatMap.renderer.drawCircle(e)),e=this.heatMap.cellSettings.enableCellHighlighting?0:-1,t.setAttribute("tabindex",e.toString()),t.style.outline="none")},r.prototype.drawPath=function(e,t,i){this.heatMap.enableCanvasRendering?this.drawCanvasPath(this.heatMap.canvasRenderer,e,t):(delete e.x,delete e.y,i.appendChild(this.heatMap.renderer.drawPath(e)))},r.prototype.createText=function(e,t,i){this.heatMap.enableCanvasRendering?this.canvasDrawText(e,i):(delete e.labelRotation,delete e.baseline,delete e.text,t.appendChild(this.heatMap.renderer.createText(e,i)),e.text=i)},r.prototype.createWrapText=function(e,t,i){var l,a,n={id:e.id,x:e.x,y:e.y,fill:e.fill,"font-size":t.size,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight.toLowerCase(),"text-anchor":e["text-anchor"],transform:e.transform,"dominant-baseline":e["dominant-baseline"],"aria-label":e.text[0]},o=e.text[0];if(this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.createText(e,o):l=this.heatMap.renderer.createText(n,o),"string"!=typeof e.text&&1<e.text.length)for(var s=1,r=e.text.length;s<r;s++)a=D(e.text[s],t).height,this.heatMap.enableCanvasRendering?(e.id=e.id+s,e.y+=a,this.heatMap.canvasRenderer.createText(e,e.text[s])):(a=this.heatMap.renderer.createTSpan({x:e.x,id:e.id+s,y:e.y+s*a},e.text[s]),l.appendChild(a));this.heatMap.enableCanvasRendering||i.appendChild(l)},r.prototype.drawLine=function(e,t){this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawLine(e):(delete e.d,t.appendChild(this.heatMap.renderer.drawLine(e)))},r.prototype.canvasDrawText=function(e,t,i,l,a,n,o){var s=this.heatMap.canvasRenderer.ctx,r=(i=i||e.x,l=l||e.y,this.getOptionValue(e,"font-weight")),h=(P.isNullOrUndefined(r)||"regular"!==r.toLowerCase()||(r="normal"),this.getOptionValue(e,"font-family")),d=-1===e["font-size"].toString().indexOf("px")?e["font-size"]+"px":e["font-size"],p=this.getOptionValue(e,"text-anchor"),r=this.getOptionValue(e,"font-style").toLowerCase()+" "+r+" "+d+" "+h;if("middle"===p&&(p="center"),s.save(),s.fillStyle=e.fill,s.font=r,s.textAlign=p,e.baseline&&(s.textBaseline=e.baseline),s.translate(i,l),s.rotate(e.labelRotation*Math.PI/180),o)for(var g=0;g<a.length;g++)e.y=0!==g?e.y+n:e.y,s.fillText(a[g],e.x-i,e.y-l);else s.fillText(t,e.x-i,e.y-l);s.restore()},r.prototype.getOptionValue=function(e,t){return e[t]},r.prototype.setAttributes=function(e,t){e.ctx.lineWidth=t["stroke-width"];var i=t["stroke-dasharray"];P.isNullOrUndefined(i)||(i=i.split(","),e.ctx.setLineDash([parseInt(i[0],10),parseInt(i[1],10)])),e.ctx.strokeStyle=t.stroke},r.prototype.drawCanvasRectangle=function(e,t,i){var l=e.ctx;e.ctx.save(),e.ctx.beginPath(),e.ctx.globalAlpha=t.opacity,this.setAttributes(e,t),this.drawCornerRadius(e,t),(t["stroke-width"]&&0!==t["stroke-width"]||i)&&e.ctx.stroke(),e.ctx.restore(),e.ctx=l},r.prototype.drawCornerRadius=function(e,t){var i=t.rx,l=t.x,a=t.y,n=t.width,o=t.height;"none"===t.fill&&(t.fill="transparent"),e.ctx.fillStyle=t.fill,o<2*(i=n<2*i?n/2:i)&&(i=o/2),e.ctx.beginPath(),e.ctx.moveTo(l+n-i,a),e.ctx.arcTo(l+n,a,l+n,a+o,i),e.ctx.arcTo(l+n,a+o,l,a+o,i),e.ctx.arcTo(l,a+o,l,a,i),e.ctx.arcTo(l,a,l+n,a,i),e.ctx.closePath(),e.ctx.fill()},r.prototype.drawCanvasCircle=function(e,t){e.ctx.save(),e.ctx.beginPath(),e.ctx.arc(t.cx,t.cy,t.r,0,2*Math.PI),e.ctx.fillStyle=t.fill,e.ctx.globalAlpha=t.opacity,e.ctx.fill(),this.setAttributes(e,t),t["stroke-width"]&&0!==t["stroke-width"]&&e.ctx.stroke(),e.ctx.restore()},r.prototype.drawCanvasPath=function(e,t,i){var l=t.d.split(" ");e.ctx.save(),e.ctx.beginPath(),e.ctx.globalAlpha=t.opacity,e.ctx.fillStyle=t.fill,this.setAttributes(e,t);for(var a=0;a<l.length;a+=3){var n=parseFloat(l[a+1]),o=parseFloat(l[a+2]);switch(l[a]){case"M":e.ctx.moveTo(n,o);break;case"L":e.ctx.lineTo(n,o);break;case"A":case"a":e.ctx.arc(i.x,i.y,i.radius,.0174533*i.start,.0174533*i.end,!1),a="a"===l[a]?a+13:a+5;break;case"Z":e.ctx.closePath()}}e.ctx.fill(),t["stroke-width"]&&0!==t["stroke-width"]&&e.ctx.stroke(),e.ctx.restore()};var it=r;function r(e){this.heatMap=e}function lt(e,t,i){var l=[];switch(t.textOverflow){case"Wrap":l=ot(e,i,t);break;case"Trim":l.push(I(i,e,t));break;default:l.push(st(i,e,t))}return l}function at(e,t){if(t)for(var i=0;i<e.length;i++)e[i]=P.SanitizeHtmlHelper.sanitize(e[i]);return e}function nt(e){for(var t=!1,i=0;i<e.length;i++)if(-1!==e[i].indexOf("<br>")||-1!==e[i].indexOf("<br/>")){t=!0;break}return t}function ot(e,t,i,l){for(var a,n=e.split(" "),o="",s=[],r=0,h=n.length;r<h;r++)a=n[r],D(o.concat(a),i).width<t?o=o.concat((""===o?"":" ")+a):""!==o?(o=l?o.concat((""===o?"":" ")+a):o,s.push(I(t,o,i)),o=l?"":a):s.push(I(t,a,i)),o&&r===h-1&&s.push(I(t,o,i));return s}function I(e,t,i){var l=t;if(e<D(t,i).width)for(var a=t.length-1;0<=a;--a)if(D(l=t.substring(0,a)+"...",i).width<=e)return l;return l}function st(e,t,i){var l=t;if(e<D(t,i).width)for(var a=t.length-1;0<=a;--a)if(D(l=t.substring(0,a),i).width<=e)return l;return l}var rt=function(e,t,i,l,a){this.id=e,this.x1=t,this.x2=i,this.y1=l,this.y2=a},ht=function(e,t){this.color=e,this.colorStop=t};function dt(e,t,i,l,a,n,o,s){var r=document.getElementById(a),h=D(e,{fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"Regular"}),d=h.width+5;t=(t=l<t+d?t-d:t)<0?5:t,r?(r.innerText=e,r.style.top=(i+15).toString()+"px",r.style.left=(t+15).toString()+"px"):((r=P.createElement("div",{id:a})).style.cssText="top:"+(i+15).toString()+"px;left:"+(t+15).toString()+"px;background-color: rgb(255, 255, 255) !important; color:black !important; position:absolute;border:1px solid rgb(112, 112, 112); padding-left : 3px; padding-right : 2px;padding-bottom : 2px; padding-top : 2px; font-size:12px; font-family: Segoe UI",r.innerText=e,n.appendChild(r)),e===s.titleSettings.text?r.style.width=t+15+h.width+7>s.availableSize.width?(s.availableSize.width-(t+15)).toString()+"px":"":(r.style.left=t+15+h.width+7>s.availableSize.width?(s.availableSize.width-(h.width+7)).toString()+"px":t.toString()+"px",r.style.top=i+15+h.height+6>s.availableSize.height?(i-(h.height+6)-10).toString()+"px":r.style.top),o&&(P.isNullOrUndefined(s.tooltipTimer)||window.clearTimeout(s.tooltipTimer),s.tooltipTimer=setTimeout(function(){C(a)},1500))}function C(e){e=gt(e);e&&(P.remove(e),pt())}function pt(){C("heatmapmeasuretext")}function gt(e){return document.getElementById(e)}function ct(e,t,i,l){var a=new Date(e);switch(t=Math.ceil(t*l),i){case"Years":a.setFullYear(a.getFullYear()+t);break;case"Months":a.setMonth(a.getMonth()+t);break;case"Days":a.setDate(a.getDate()+t);break;case"Hours":a.setHours(a.getHours()+t);break;case"Minutes":a.setMinutes(a.getMinutes()+t)}return a}var E=function(e,t){this.region=new z(0,0,0,0),this.text=e,this.region=t};function ut(e,t,i){for(var l,a,n,o=e.length,s=0;s<o;s++)if(t>=(a=(l=e[s]).region).x&&t<=a.x+a.width&&i>=a.y&&i<=a.y+a.height){n=l.text;break}return n}var mt=function(){},yt=function(e,t,i,l,a,n){this.pathX1=e,this.pathY1=t,this.pathX2=i,this.pathY2=l,this.pathX3=a,this.pathY3=n},xt=function(e,t,i,l,a,n){this.x=e,this.y=t,this.width=i,this.height=l,this.label=a,this.id=n},bt=function(e,t,i,l,a,n,o){this.x=e,this.y=t,this.width=i,this.height=l,this.value=a,this.visible=n,this.currentPage=o},vt=function(e,t,i,l){this.visible=e,this.value=t,this.startValue=i,this.endValue=l};function St(e){e="transparent"===e?"white":e;var t=document.getElementById("heatmapmeasuretext"),t=(t.style.color=e,(e=window.getComputedStyle(t).color).replace(/[()RGBrgba ]/g,"").split(","));return Ct(new Te(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)))}function Ct(e){return"#"+ft(e.R)+ft(e.G)+ft(e.B)}function ft(e){e=e.toString(16);return 1===e.length?"0"+e:e}function Mt(e){e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?new Te(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):new Te(255,255,255)}function wt(e,t,i,l){return e?t.replace("{value}",l(i)):l(i)}var Lt,Tt,Rt=function(e,t){this.x=e,this.y=t},o=(Lt=function(e,t){return(Lt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)},function(e,t){function i(){this.constructor=e}Lt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),h=function(e,t,i,l){var a,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;0<=s;s--)(a=e[s])&&(o=(n<3?a(o):3<n?a(t,i,o):a(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},o=(Tt=P.ChildProperty,o(d,Tt),d.prototype.computeSize=function(e,t,i){var l;new A(0,0);this.titleSize=e.getTitleSize(e,10),this.maxLabelSize=e.getMaxLabelSize(e,t),this.getMultilevelLabelsHeight(e,i,t);for(var a=0;a<this.multiLevelLabels.length;a++)l=e.multiLevelLabelSize(10,a),this.multiLevelSize.push(l)},d.prototype.multiPosition=function(e,t){var i,l,a="Horizontal"===e.orientation?10:20,n=new Rt(0,0);return"Horizontal"===e.orientation?(i=e.maxLabelSize.height+a+(0===e.angle||180===e.angle||360===e.angle?0:a),l=this.xAxisMultiLabelHeight[t-1],n.x=e.isInversed?e.rect.x+e.rect.width:e.rect.x,n.y=0===t?e.rect.y+(e.opposedPosition?-i:i):e.multiLevelPosition[t-1].y+(e.opposedPosition?-l:l)):(i=e.maxLabelSize.width+a,l=0!==t&&this.multiLevelSize[t-1].width,n.x=0===t?e.rect.x-(e.opposedPosition?-i:i):e.multiLevelPosition[t-1].x-(e.opposedPosition?-(l+a):l+a),n.y=e.isInversed?e.rect.y:e.rect.y+e.rect.height),n},d.prototype.multiLevelLabelSize=function(e,t){for(var i=new A(0,0),l=this.multiLevelLabels,a=l[t].categories,n=0;n<a.length;n++){var o=D(a[n].text,l[t].textStyle);i.width=(i.width>o.width?i:o).width,i.height=(i.height>o.height?i:o).height}var s=("Horizontal"===this.orientation?this.xAxisMultiLabelHeight:this.yAxisMultiLabelHeight)[t];return(this.opposedPosition?this.farSizes:this.nearSizes).push(s),i},d.prototype.getMultilevelLabelsHeight=function(l,a,n){var o,s,r,h,d=[],p="Vertical"===l.orientation,g="Vertical"===l.orientation?20:10;this.multiLevelLabels.map(function(t,i){t.categories.map(function(e){r="number"==typeof e.start?e.start:Number(new Date(e.start)),h="number"==typeof e.end?e.end:Number(new Date(e.end)),""!==e.text&&null!==e.start&&null!==e.end&&(o=D(e.text,t.textStyle),s=p?o.width:o.height,r=n.heatMapAxis.calculateLeftPosition(l,r,e.start,a),h=n.heatMapAxis.calculateWidth(l,e.end,h,a),o=D(e.text,t.textStyle),h=null===e.maximumTextWidth?Math.abs(h-r):e.maximumTextWidth,o.width>h-g&&"Wrap"===t.overflow&&!p&&(s*=ot(e.text,h-g,t.textStyle).length),d[i]=!d[i]||d[i]<s?s+g:d[i])})}),p?this.yAxisMultiLabelHeight=d:this.xAxisMultiLabelHeight=d},d.prototype.getTitleSize=function(e,t){var i=new A(0,0);return this.title.text&&((i=D(this.title.text,this.title.textStyle)).height+=t),(e.opposedPosition?this.farSizes:this.nearSizes).push(i.height),i},d.prototype.getMaxLabelSize=function(e,t){var i=new A(0,0),l=this.axisLabels,a=0<e.border.width||0<e.multiLevelLabels.length?10:0,n=1,o="DateTime"===e.valueType&&"None"!==e.showLabelOn||"Wrap"===e.textStyle.textOverflow||"Trim"===e.textStyle.textOverflow?t.initialClipRect.width/e.axisLabelSize:t.initialClipRect.width/e.axisLabels.length,s=(e.angle=e.labelRotation,e.isIntersect=!1,nt(l));if(("Horizontal"===e.orientation&&("Rotate45"===e.labelIntersectAction||e.labelRotation%180==0&&"Trim"===e.labelIntersectAction||e.enableTrim)||"MultipleRows"===e.labelIntersectAction)&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow){var r=t.initialClipRect.x+(e.isInversed?t.initialClipRect.width:0),h=void 0,d=void 0;this.clearMultipleRow();for(var p=0,g=l.length;p<g;p++){var c=D(v=l[p],e.textStyle),u="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[p]*o:o,m=r+(e.isInversed?-(o+c.width)/2:(o-c.width)/2),c=(m=m<t.initialClipRect.x?t.initialClipRect.x:m)+c.width;if(e.isInversed){if(P.isNullOrUndefined(d))d=m;else if(d<c&&"MultipleRows"!==e.labelIntersectAction){"Rotate45"!==e.labelIntersectAction||s||e.enableTrim?e.isIntersect=!0:e.angle=45;break}d=m}else{if(P.isNullOrUndefined(h))h=c;else if(m<h&&"MultipleRows"!==e.labelIntersectAction){"Rotate45"!==e.labelIntersectAction||s||e.enableTrim?e.isIntersect=!0:e.angle=45;break}h=c}r+=e.isInversed?-u:u,"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&0===e.labelRotation&&this.multipleRow.push(new we(m,c,n,v,1))}"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&e.isInversed&&(this.multipleRow=this.multipleRow.reverse())}for(var y=1,p=0;p<l.length;p++){var x,b=this.multipleRow,v=void 0,S=(v=e.enableTrim||"Trim"===e.textStyle.textOverflow&&-1===l[p].indexOf("<br>")&&-1===l[p].indexOf("<br/>")?I("Trim"===e.textStyle.textOverflow&&"Horizontal"===e.orientation?o:e.maxLabelLength,l[p],e.textStyle):l[p],[]);if("Wrap"!==e.textStyle.textOverflow&&!s||e.enableTrim)s&&e.enableTrim&&(S=v.split(/<br\s*\/?>/,-1),x=I(e.maxLabelLength,S[0],e.textStyle),v=-1===v.indexOf("<br>")&&-1===v.indexOf("<br/>")||-1!==x.indexOf("...")?x:x+"...",S=[]),S.push(v);else{var C="Horizontal"===e.orientation?o:e.maxLabelLength;if(s)for(var S=v.split(/<br\s*\/?>/,-1),f=0;f<S.length;f++)S[f]=I(C,S[f],e.textStyle);else S=ot(v,C,e.textStyle);if(y=S.length>y&&!e.enableTrim?S.length:y,"Vertical"===e.orientation||"Horizontal"===e.orientation&&e.angle%180!=0)for(var M=0,w=0;w<S.length;w++){var L=D(S[w],e.textStyle);L.width>M&&(M=L.width,v=S[w])}if("Vertical"===e.orientation)for(var T=t.initialClipRect.height/(e.axisLabelSize/e.axisLabelInterval),w=0;w<S.length;w++)D(v,e.textStyle).height*S.length>T-10&&0<S.length&&90!==e.angle&&270!==e.angle&&(S.pop(),0<S.length)&&(S[S.length-1]=S[S.length-1]+"...",S[S.length-1]=I(e.maxLabelLength,S[S.length-1],e.textStyle))}var R=e.angle%180==0?D(v,e.textStyle):tt(e.textStyle,S,e.angle);if(i.width=(i.width>R.width?i:R).width,"MultipleRows"===e.labelIntersectAction&&"Horizontal"===e.orientation&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow&&0<p&&0===e.labelRotation){b[p].end>=t.initialClipRect.width&&p<l.length-1&&(b[p].row=b[p].row+1);for(var O=1;O<=e.multilevel.length;O++)if(b[p].start<b[p-1].end){if(e.multilevel[O]<b[p].start){n=O;break}if(O===e.multilevel.length-1){n=e.multilevel.length;break}}else if(R.width<o)for(var z=1;z<=e.multilevel.length;z++)if(e.multilevel[z]<b[p].start){b[n=z].row=n;break}i.height=i.height>R.height*n+.5*R.height/2*(n-1)?i.height:R.height*n+.5*R.height/2*n,this.multipleRow[p].index=n,e.multilevel[n]=b[p].end}else"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&0===p&&0===e.labelRotation&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow&&(e.multilevel[1]=b[p].end),i.height=(i.height>R.height?i:R).height}return i.height=e.angle%180==0?i.height*y:i.height,20<=t.cellSettings.border.width&&"Horizontal"!==e.orientation&&(i.width=i.width+t.cellSettings.border.width/4),(e.opposedPosition?this.farSizes:this.nearSizes).push("Horizontal"===e.orientation?i.height:i.width+a),i},d.prototype.calculateNumericAxisLabels=function(e){var t,i,l=0,a=0,n=this.interval||1,o=(e.adaptorModule&&e.isCellData&&(i=("Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax:e.adaptorModule.adaptiveYMinMax).min,t=("Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax:e.adaptorModule.adaptiveYMinMax).max),l=P.isNullOrUndefined(this.minimum)?i||0:this.minimum,a=P.isNullOrUndefined(this.maximum)?t||this.maxLength*this.increment:this.maximum,this.minimum&&this.maximum&&a<l&&(i=l,l=a,a=i),a=P.isNullOrUndefined(this.maximum)?t||a+l:a,P.isNullOrUndefined(this.labelFormat)?"":this.labelFormat),s=null!==o.match("{value}");this.format=e.intl.getNumberFormat({format:s?"":o});for(var r=l;r<=a;r+=n*this.increment){var h=wt(s,o,r,this.format);this.axisLabels.push(h)}this.min=0,this.axisLabelSize=Math.floor((a-l)/this.increment+1),this.max=this.axisLabelSize-1,this.axisLabelInterval=n;for(r=l;r<=a;r+=this.increment){h=wt(s,o,r,this.format);this.tooltipLabels.push(h),this.labelValue.push(r)}this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},d.prototype.calculateCategoryAxisLabels=function(){var e,t=0<(t=this.labels||[]).length?t:this.jsonCellLabel,i=P.isNullOrUndefined(this.minimum)||this.minimum instanceof Date?0:this.minimum,l=P.isNullOrUndefined(this.maximum)||this.maximum instanceof Date?this.maxLength:this.maximum,a=this.interval||1,n=P.isNullOrUndefined(this.labelFormat)?"":this.labelFormat,o=null!==n.match("{value}");if(!P.isNullOrUndefined(this.minimum)&&!P.isNullOrUndefined(this.maximum)&&l<i&&(e=i,i=l,l=e),t&&0<t.length)for(var s=i;s<=l;s+=a){var r=P.isNullOrUndefined(t[s])?o?n.replace("{value}",s.toString()):s.toString():o?n.replace("{value}",t[s].toString()):t[s].toString();this.axisLabels.push(r)}else for(s=i;s<=l;s+=a){r=o?n.replace("{value}",s.toString()):s.toString();this.axisLabels.push(r)}for(s=i;s<=l;s++)this.tooltipLabels.push(P.isNullOrUndefined(t[s])?o?n.replace("{value}",s.toString()):s.toString():o?n.replace("{value}",t[s].toString()):t[s].toString()),this.labelValue.push((P.isNullOrUndefined(t[s])?s:t[s]).toString());this.min=i,this.max=l,this.axisLabelSize=l-i+1,this.axisLabelInterval=a,this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},d.prototype.calculateDateTimeAxisLabel=function(e){var t=this.interval||1,i={skeleton:"full",type:"dateTime"},l=e.intl.getDateParser(i),i=e.intl.getDateFormat(i),a=null,n=null,a=(e.adaptorModule&&e.isCellData&&(a=("Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax:e.adaptorModule.adaptiveYMinMax).min,n=("Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax:e.adaptorModule.adaptiveYMinMax).max),this.minimum||a||null),n=this.maximum||n||null;if(null===a&&null===n){for(var o=0,s=this.maxLength*this.increment,r=o;r<=s;r+=t*this.increment)this.axisLabels.push(r.toString()),this.tooltipLabels.push(r.toString()),this.labelValue.push(r.toString());this.min=0,this.max=this.maxLength,this.axisLabelSize=(s-o)/this.increment+1,this.axisLabelInterval=t}else{null!==a&&null===n?s=ct(o=Date.parse(l(i(new Date(_.DataUtil.parse.parseJson({val:a}).val)))),this.maxLength,this.intervalType,this.increment).getTime():null===a&&null!==n?o=ct(s=Date.parse(l(i(new Date(_.DataUtil.parse.parseJson({val:n}).val)))),-this.maxLength,this.intervalType,this.increment).getTime():(o=Date.parse(l(i(new Date(_.DataUtil.parse.parseJson({val:a}).val)))),s=Date.parse(l(i(new Date(_.DataUtil.parse.parseJson({val:n}).val))))),this.format=e.intl.getDateFormat({format:this.labelFormat,skeleton:this.getSkeleton()});for(var h=o;h<=s;){var d=this.format(new Date(h));this.axisLabels.push(d),"None"!==this.showLabelOn&&(t=this.calculateLabelInterval(h),this.dateTimeAxisLabelInterval.push(t)),h=ct(h,t,this.intervalType,this.increment).getTime()}for(this.min=0,this.axisLabelInterval=t,this.axisLabelSize=this.getTotalLabelLength(o,s),this.max=this.axisLabelSize-1,h=o;h<=s;){d=this.format(new Date(h));this.tooltipLabels.push(d),this.labelValue.push(new Date(h)),h=ct(h,1,this.intervalType,this.increment).getTime()}}this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},d.prototype.calculateLabelInterval=function(e){var t=new Date(e).getFullYear(),i=new Date(e).getMonth()+1,l=new Date(e).getDate();return"Years"===this.showLabelOn||"Months"===this.showLabelOn?"Years"===this.showLabelOn&&"Months"===this.intervalType?Math.ceil(12/this.increment):(t="Years"===this.showLabelOn?t%4==0?366:365:new Date(t,i,0).getDate(),t+=1-l,"Days"===this.intervalType?Math.ceil(t/this.increment):"Hours"===this.intervalType?Math.ceil(24*t/this.increment):"Minutes"===this.intervalType?Math.ceil(24*t*60/this.increment):1):"Days"===this.showLabelOn?"Hours"===this.intervalType?Math.ceil(24/this.increment):"Minutes"===this.intervalType?Math.ceil(1440/this.increment):1:"Hours"===this.showLabelOn&&(i=new Date(e).getMinutes(),"Minutes"===this.intervalType)?Math.ceil((60-i)/this.increment):1},d.prototype.getSkeleton=function(){var e="Years"===this.intervalType?"yMMM":"Months"===this.intervalType?"MMMd":"Days"===this.intervalType?"yMd":"Hours"===this.intervalType?"EHm":(this.intervalType,"Hms");return e},d.prototype.getTotalLabelLength=function(e,t){var i=0,l=new Date(e),a=new Date(t);switch(this.intervalType){case"Years":var n=(a.getFullYear()-l.getFullYear())/this.increment+1,i=Math.floor(n);break;case"Months":var n=12*(a.getFullYear()-l.getFullYear());i=(n=(n-=l.getMonth())+a.getMonth())<=0?1:Math.floor(n/this.increment+1);break;case"Days":o=Math.abs(l.getTime()-a.getTime()),n=Math.floor(o/864e5),i=Math.floor(n/this.increment+1);break;case"Hours":var o=Math.abs(l.getTime()-a.getTime()),n=Math.floor(o/36e5);i=Math.floor(n/this.increment)+1;break;case"Minutes":o=Math.abs(l.getTime()-a.getTime());n=Math.floor(o/6e4);i=Math.floor(n/this.increment)+1}return i},d.prototype.clearAxisLabel=function(){this.axisLabels=[],this.tooltipLabels=[],this.dateTimeAxisLabelInterval=[],this.labelValue=[]},d.prototype.clearMultipleRow=function(){this.multipleRow=[],this.multilevel=[]},d.prototype.destroy=function(){this.axisLabels=null,this.multipleRow=null,this.rect=null,this.nearSizes=null,this.farSizes=null,this.maxLabelSize=null,this.titleSize=null,this.labelValue=null,this.format=null,this.multilevel=[],this.tooltipLabels=[],this.dateTimeAxisLabelInterval=[],this.jsonCellLabel=[],this.multiLevelSize=[],this.xAxisMultiLabelHeight=[],this.yAxisMultiLabelHeight=[],this.multiLevelPosition=[]},h([P.Complex({text:"",textStyle:t.axisTitleFont},te)],d.prototype,"title",void 0),h([P.Property(!1)],d.prototype,"opposedPosition",void 0),h([P.Property(null)],d.prototype,"labels",void 0),h([P.Complex(t.axisLabelFont,k)],d.prototype,"textStyle",void 0),h([P.Property(0)],d.prototype,"labelRotation",void 0),h([P.Property(!1)],d.prototype,"isInversed",void 0),h([P.Property("Category")],d.prototype,"valueType",void 0),h([P.Property(1)],d.prototype,"increment",void 0),h([P.Property("None")],d.prototype,"showLabelOn",void 0),h([P.Property(null)],d.prototype,"minimum",void 0),h([P.Property(null)],d.prototype,"maximum",void 0),h([P.Property(null)],d.prototype,"interval",void 0),h([P.Property("")],d.prototype,"labelFormat",void 0),h([P.Property("Days")],d.prototype,"intervalType",void 0),h([P.Property("Trim")],d.prototype,"labelIntersectAction",void 0),h([P.Property(!1)],d.prototype,"enableTrim",void 0),h([P.Property(35)],d.prototype,"maxLabelLength",void 0),h([P.Complex({color:"#b5b5b5",width:0,type:"Rectangle"},he)],d.prototype,"border",void 0),h([P.Collection([],i)],d.prototype,"multiLevelLabels",void 0),d);function d(){var e=null!==Tt&&Tt.apply(this,arguments)||this;return e.multipleRow=[],e.rect=new z(void 0,void 0,0,0),e.nearSizes=[],e.farSizes=[],e.maxLabelSize=new A(0,0),e.titleSize=new A(0,0),e.multilevel=[],e.axisLabels=[],e.tooltipLabels=[],e.labelValue=[],e.axisLabelSize=0,e.axisLabelInterval=0,e.dateTimeAxisLabelInterval=[],e.maxLength=0,e.min=0,e.max=0,e.isIntersect=!1,e.jsonCellLabel=[],e.multiLevelSize=[],e.xAxisMultiLabelHeight=[],e.yAxisMultiLabelHeight=[],e.multiLevelPosition=[],e}u.prototype.renderAxes=function(){this.initialClipRect=this.heatMap.initialClipRect;for(var e,t,i=this.heatMap,l=(i.enableCanvasRendering||(e=this.heatMap.renderer.createGroup({id:i.element.id+"AxisCollection"})),this.heatMap.axisCollections),a=0,n=l.length;a<n;a++){var o=l[a];"Horizontal"===o.orientation?(i.enableCanvasRendering||(t=this.heatMap.renderer.createGroup({id:i.element.id+"XAxisGroup"})),this.drawXAxisLine(t,o),this.drawXAxisTitle(o,t,o.rect),this.drawXAxisLabels(o,t,o.rect)):(t=i.renderer.createGroup({id:i.element.id+"YAxisGroup"}),this.drawYAxisLine(t,o),this.drawYAxisTitle(o,t,o.rect),this.drawYAxisLabels(o,t,o.rect)),0<o.multiLevelLabels.length&&this.drawMultiLevels(t,o),i.enableCanvasRendering||e.appendChild(t)}i.enableCanvasRendering||this.heatMap.svgObject.appendChild(e)},u.prototype.drawXAxisLine=function(e,t){t=this.initialClipRect.y+(t.opposedPosition?0:this.initialClipRect.height),t=new Je(this.heatMap.element.id+"_XAxisLine",new Xe(this.initialClipRect.x,t,this.initialClipRect.x+this.initialClipRect.width,t),"transparent",0);this.drawSvgCanvas.drawLine(t,e)},u.prototype.drawYAxisLine=function(e,t){t=this.initialClipRect.x+(t.opposedPosition?this.initialClipRect.width:0),t=new Je(this.heatMap.element.id+"_YAxisLine",new Xe(t,this.initialClipRect.y,t,this.initialClipRect.height+this.initialClipRect.y),"transparent",0);this.drawSvgCanvas.drawLine(t,e)},u.prototype.drawXAxisTitle=function(e,t,i){var l,a,n,o,s,r,h="0px"===e.textStyle.size?0:10,h=i.y+(e.opposedPosition?-(e.maxLabelSize.height+h+c(e.xAxisMultiLabelHeight)):e.maxLabelSize.height+h+c(e.xAxisMultiLabelHeight));e.title.text&&(l=this.heatMap,a=e.title,o=D(n=this.heatMap.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(a.text):a.text,a.textStyle),r=this.padding,s="Near"===a.textStyle.textAlignment?"start":"Far"===a.textStyle.textAlignment?"end":"middle",r=e.opposedPosition?-(r+o.height/4):r+3*o.height/4,e=new F(l.element.id+"_XAxisTitle",new V(i.x+Pe(i.width,0,0,a.textStyle),h+r,s,n),a.textStyle,a.textStyle.color||l.themeStyle.axisTitle),this.drawSvgCanvas.createText(e,t,n))},u.prototype.drawYAxisTitle=function(e,t,i){var l,a,n,o,s;e.title.text&&(l=e.title,a=this.heatMap,n=e.opposedPosition?90:-90,s="Near"===l.textStyle.textAlignment?"start":"Far"===l.textStyle.textAlignment?"end":"middle",o=10,o=e.opposedPosition?10:-10,o="0px"===e.textStyle.size?0:o,o=i.x+o+(e.opposedPosition?e.maxLabelSize.width+c(e.yAxisMultiLabelHeight):-(e.maxLabelSize.width+c(e.yAxisMultiLabelHeight))),i=i.y+et(i,0,0,l.textStyle)+(e.opposedPosition?this.padding:-this.padding),e=this.heatMap.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(l.text):l.text,s=new F(a.element.id+"_YAxisTitle",new V(o,i-this.padding,s,e,n,"rotate("+n+","+o+","+i+")","auto"),l.textStyle,l.textStyle.color||a.themeStyle.axisTitle),this.heatMap.enableCanvasRendering?this.drawSvgCanvas.canvasDrawText(s,e,o,i):this.drawSvgCanvas.createText(s,t,e))},u.prototype.calculateVisibleLabels=function(){for(var e,t=this.heatMap.axisCollections,i=this.heatMap.dataSourceSettings,l=!(i&&i.isJsonData&&"Cell"===i.adaptorType),a=0,n=t.length;a<n;a++)"Numeric"===(e=t[a]).valueType&&l?(e.clearAxisLabel(),e.calculateNumericAxisLabels(this.heatMap)):"DateTime"===e.valueType&&l?(e.clearAxisLabel(),e.calculateDateTimeAxisLabel(this.heatMap)):"Category"===e.valueType&&(e.clearAxisLabel(),e.calculateCategoryAxisLabels()),e.tooltipLabels=e.isInversed?e.tooltipLabels.reverse():e.tooltipLabels},u.prototype.measureAxis=function(e){for(var t=this.heatMap,i=t.axisCollections,l=i.length-1;0<=l;l--){var a,n="0px"===(a=i[l]).textStyle.size?0:this.padding;a.nearSizes=[],a.farSizes=[],a.computeSize(a,t,e),a.opposedPosition?"Horizontal"===a.orientation?(e.y+=c(a.farSizes)+n,e.height-=c(a.farSizes)+n):e.width-=c(a.farSizes)+n:"Horizontal"===a.orientation?e.height-=c(a.nearSizes)+n:(e.x+=c(a.nearSizes)+n,e.width-=c(a.nearSizes)+n)}},u.prototype.calculateAxisSize=function(e){for(var t=this.heatMap.axisCollections,i=0,l=t.length;i<l;i++){var a=t[i];a.rect=P.extend({},e,null,!0),"Horizontal"===a.orientation&&0!==a.multiLevelLabels.length&&(a.opposedPosition&&(a.rect.y+=0===a.angle||180===a.angle||360===a.angle?0:this.padding,this.heatMap.initialClipRect.y+=0===a.angle||180===a.angle||360===a.angle?0:this.padding),e.height-=0===a.angle||180===a.angle||360===a.angle?0:this.padding),"Horizontal"!==a.orientation||a.opposedPosition||(a.rect.y=e.y+e.height,a.rect.height=0),"Vertical"===a.orientation&&a.opposedPosition&&(a.rect.x=e.x+e.width,a.rect.width=0),a.multiLevelPosition=[];for(var n=0;n<a.multiLevelLabels.length;n++){var o=a.multiPosition(a,n);a.multiLevelPosition.push(o)}}},u.prototype.drawXAxisLabels=function(e,t,i){var l=this.heatMap,a=e.axisLabels,n=5<this.heatMap.cellSettings.border.width?this.heatMap.cellSettings.border.width/2:0,o=(i.width-n)/e.axisLabelSize,s=0,r=e.interval||1,h=i.width/(e.axisLabelSize/e.axisLabelInterval),d=e.axisLabelInterval;if(0<h)for(;h<parseInt(e.textStyle.size,10);)h=i.width/(e.axisLabelSize/(d+=1));else d=e.tooltipLabels.length;e.axisLabelInterval<d&&(s=d,a=e.tooltipLabels,r=d);var p,g,c=i.x+(e.isInversed?i.width:0),u=e.angle,m=this.padding;l.enableCanvasRendering||(p=this.heatMap.renderer.createGroup({id:l.element.id+"XAxisLabels"}),g=this.heatMap.renderer.createGroup({id:l.element.id+"XAxisLabelBorder"})),e.isInversed&&"MultipleRows"===e.labelIntersectAction&&e.multipleRow.reverse();for(var y=nt(a),x=0,b=a.length;x<b;x++){var v,S=new z(c,i.y,o,i.height),C=D(a[x],e.textStyle),f="Wrap"!==e.textStyle.textOverflow&&!y&&"Trim"!==e.textStyle.textOverflow&&"Trim"===e.labelIntersectAction&&(e.isIntersect||C.width>o)?"DateTime"!==e.valueType||"None"===e.showLabelOn?I(o*r,a[x],e.textStyle):I(e.dateTimeAxisLabelInterval[x]*o,a[x],e.textStyle):a[x],M=(f=!e.enableTrim&&"Trim"!==e.textStyle.textOverflow||y?f:I("Trim"===e.textStyle.textOverflow?o-e.border.width/2:e.maxLabelLength,a[x],e.textStyle),f=l.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(f):f),w=[],L=new A(0,0),T=("Wrap"!==e.textStyle.textOverflow&&!y||e.enableTrim?(y&&e.enableTrim&&(w=this.getLabels(M,o-e.border.width/2,e,y),M=I(e.maxLabelLength,w[0],e.textStyle),M=-1===f.indexOf("<br>")&&-1===f.indexOf("<br/>")||-1!==M.indexOf("...")?M:M+"...",w=[]),w.push(M)):(w=this.getLabels(M,o-e.border.width/2,e,y),M=this.getMaxLabel(w,e)),C=D(M,e.textStyle),void 0),R=e.opposedPosition?-m:m+(u%360==0?C.height/2:0),O=(C.width=e.isInversed&&C.width>o?o:C.width,S.x+(e.isInversed?-(S.width/2+C.width/2):S.width/2-C.width/2)),R=("Near"===e.textStyle.textAlignment?O=S.x-(e.isInversed?S.width:0):"Far"===e.textStyle.textAlignment&&(O=S.x+(e.isInversed?-C.width:S.width-C.width)),"Trim"===e.labelIntersectAction?O=e.isInversed?c-o<O?O:c-o:O>=S.x?O:S.x:u%180==0&&(O=(O=O<i.x?i.x:O)+C.width>i.x+i.width?i.x+i.width-C.width:O),"Wrap"!==e.textStyle.textOverflow&&!y||e.isInversed||(O=O<S.x?S.x:O),v="MultipleRows"===e.labelIntersectAction&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow&&0===e.labelRotation?(v=e.opposedPosition?-(e.multipleRow[x].index-1):e.multipleRow[x].index-1,1<e.multipleRow[x].index?i.y+R+C.height*v+(e.opposedPosition?-(.5*C.height/2*e.multipleRow[x].index):.5*C.height/2*e.multipleRow[x].index):i.y+R+(e.opposedPosition?-.5*C.height/2:.5*C.height/2)):i.y+(("Wrap"===e.textStyle.textOverflow||y)&&e.opposedPosition&&u%360==0?-(1<=e.farSizes.length?e.farSizes[1]:0)+m:R),this.drawXAxisBorder(e,g,e.rect,O,C.width,x),O="Center"===e.textStyle.textAlignment&&1<w.length?O+C.width/2:"Near"===e.textStyle.textAlignment?O+m/2:"Far"===e.textStyle.textAlignment?O-m/2:O,u%360!=0&&(L=tt(e.textStyle,w,u=360<u?u%360:u),O=S.x+(e.isInversed?-S.width/2:S.width/2)+(90===u?C.height*((w.length-1)/2):270===u?-(C.height*(w.length-1))/2:0),v+=e.opposedPosition?("Wrap"!==e.textStyle.textOverflow&&!y||e.enableTrim?-L.height/2:(u%360==180?m:0)+L.height/2-(1<=e.farSizes.length?e.farSizes[1]:0))+e.border.width/2:u%360==0?0:u%360==180?L.height/2-e.border.width+m:L.height/2-e.border.width,1<w.length&&(v-=0<u&&u<80||300<u&&u<360?C.height*((w.length-1)/2):120<u&&u<240&&180!==u&&2<w.length?-(C.height*((w.length-2)/2)):0,O+=0<u&&u<70?C.height*((w.length-1)/2):0),T="rotate("+u+","+O+","+v+")"),5<this.heatMap.cellSettings.border.width&&e.opposedPosition&&(v-=this.heatMap.cellSettings.border.width/2),this.heatMap.yAxis.opposedPosition&&5<this.heatMap.cellSettings.border.width&&(O+=this.heatMap.cellSettings.border.width/2),this.heatMap.xAxis.isInversed&&5<this.heatMap.cellSettings.border.width&&(O-=this.heatMap.cellSettings.border.width/2),C.width>=o&&(O=e.border.width?O+e.border.width/2:O),O="Near"===e.textStyle.textAlignment?O+e.border.width/2:"Far"===e.textStyle.textAlignment?O-e.border.width/2:O,O=u%360==0&&"Center"===e.textStyle.textAlignment&&C.width>o?S.x+(e.isInversed?-C.width/2:C.width/2):O,new F(l.element.id+"_XAxis_Label"+x,new V(O,v,u%360!=0||"Center"===e.textStyle.textAlignment&&1<w.length?"middle":"start",f,u,T),e.textStyle,e.textStyle.color||l.themeStyle.axisLabel));R.text=y?w:lt(R.text,e.textStyle,S.width-e.border.width/2),0!==u&&this.heatMap.enableCanvasRendering?this.drawSvgCanvas.canvasDrawText(R,null,null,null,w,C.height,!0):"Wrap"===e.textStyle.textOverflow||y?this.drawSvgCanvas.createWrapText(R,e.textStyle,p):this.drawSvgCanvas.createText(R,p,f),0===s?(T="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[x]:e.axisLabelInterval,c+=e.isInversed?-T*o:T*o):c+=e.isInversed?-s*o:s*o,-1!==M.indexOf("...")&&(S=e.angle%360!=0?O-L.width/2:"Center"===e.textStyle.textAlignment?O-C.width/2:O,R=v-(e.angle%360!=0?L.height/2:C.height),f=-1!==a[x].indexOf("<br>")||-1!==a[x].indexOf("<br/>")?a[x].replace(/<br\s*\/?>/g," "):a[x],this.heatMap.tooltipCollection.push(new E(f,new z(S,R,(e.angle%360!=0?L:C).width,e.angle%360!=0?L.height:C.height*w.length)))),0!==s&&(x+=s-1)}l.enableCanvasRendering||(t.appendChild(p),t.appendChild(g))},u.prototype.getWrappedLabels=function(e,t,i){for(var l=e.split(/<br\s*\/?>/,-1),a=0;a<l.length;a++){var n=l[a];l[a]=I(t,n,i.textStyle)}return l},u.prototype.getMaxLabel=function(e,t){for(var i,l="",a=0,n=(new A(0,0),0);n<e.length;n++)(i=D(e[n],t.textStyle)).width>a&&(a=i.width,l=e[n]);return l},u.prototype.getLabels=function(e,t,i,l){return l?this.getWrappedLabels(e,t,i):ot(e,t,i.textStyle)},u.prototype.drawYAxisLabels=function(e,t,i){var l=this.heatMap,a=e.axisLabels,n=i.height/e.axisLabelSize,o=0,s=i.height/(e.axisLabelSize/e.axisLabelInterval),r=e.axisLabelInterval;if(0<s)for(;s<parseInt(e.textStyle.size,10);)s=i.height/(e.axisLabelSize/(r+=1));else r=e.tooltipLabels.length;e.axisLabelInterval<r&&(o=r,a=e.tooltipLabels);var h,d,p=i.y+(e.isInversed?0:i.height),g=e.opposedPosition?"start":"end",c=e.opposedPosition?10:-10;l.enableCanvasRendering||(h=this.heatMap.renderer.createGroup({id:l.element.id+"YAxisLabels"}),d=this.heatMap.renderer.createGroup({id:l.element.id+"YAxisLabelBorder"}));for(var u=nt(a),m=0,y=a.length;m<y;m++){var x=new z(i.x,p,i.width,n),b=e.isInversed?x.height/2:-x.height/2,v=20<=this.heatMap.cellSettings.border.width?this.heatMap.cellSettings.border.width/2:0,S=5<this.heatMap.cellSettings.border.width?this.heatMap.cellSettings.border.width/2/y*(e.isInversed?m:y-m):0,C=(T=!e.enableTrim&&"Trim"!==e.textStyle.textOverflow||u?a[m]:I(e.maxLabelLength,a[m],e.textStyle),D(T=l.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(T):T,e.textStyle)),f=1,M=[],w=new A(0,0);if("Wrap"!==e.textStyle.textOverflow&&!u||e.enableTrim)u&&e.enableTrim&&(M=this.getLabels(T,e.maxLabelLength,e,u),O=I(e.maxLabelLength,M[0],e.textStyle),T=-1===T.indexOf("<br>")&&-1===T.indexOf("<br/>")||-1!==O.indexOf("...")?O:O+"...",M=[]),M.push(T);else{for(var M=this.getLabels(T,e.maxLabelLength,e,u),L=0;L<M.length;L++)C.height*M.length>s+5&&0<M.length&&90!==e.angle&&270!==e.angle&&(M.pop(),0<M.length)&&(M[M.length-1]=M[M.length-1]+"...",M[M.length-1]=I(e.maxLabelLength,M[M.length-1],e.textStyle));if(!u)for(var T=0!==M.length?"":T,R=0;R<M.length;R++)T=P.isNullOrUndefined(T)?M[R]:T+" "+M[R];f=M.length}var O=x.x+c+(e.opposedPosition?("Wrap"===e.textStyle.textOverflow&&e.angle%360!=0?f*(C.height/2):0)+v:-v),v=("Far"===e.textStyle.textAlignment&&e.angle%360==0?b=e.isInversed?x.height-(1<f?C.height*f-C.height/2:C.height/2):-(1<f?C.height*f-C.height/2:C.height/2):"Near"===e.textStyle.textAlignment&&e.angle%360==0&&(b=(e.isInversed?C.height/2:C.height/2-x.height)+e.border.width/2),x.y-S+b-(1<f&&"Center"===e.textStyle.textAlignment||e.angle%360!=0&&e.opposedPosition?C.height*f/2-C.height/2:0)),b=(e.angle%360!=0&&(g="middle",e.angle=360<e.angle?e.angle%360:e.angle,w=tt(e.textStyle,M,e.angle),O=x.x+(e.opposedPosition?w.width/2+c:-(w.width/2-c))+(90===e.angle?C.height*((M.length-1)/2):270===e.angle?-(C.height*(M.length-1))/2:0),v=x.y+(e.isInversed?x.height/2:-x.height/2)+(180===e.angle?C.height*((M.length-1)/2):0),1<M.length)&&(S=C.height*((M.length-1)/2),v-=0<e.angle&&e.angle<60||290<e.angle&&e.angle<360?S:115<e.angle&&e.angle<240&&180!==e.angle?-S:0,O+=20<e.angle&&e.angle<160&&90!==e.angle?S:200<e.angle&&e.angle<330&&270!==e.angle?-S-(200<e.angle&&e.angle<240&&!e.opposedPosition&&2<M.length?-(C.height*((M.length-2)/2)):0):330<=e.angle&&e.angle<350?-S/2:0),new F(l.element.id+"_YAxis_Label"+m,new V(O,v,g,T,e.angle,"rotate("+e.angle+","+O+","+v+")","middle"),e.textStyle,e.textStyle.color||l.themeStyle.axisLabel));P.Browser.isIE&&!l.enableCanvasRendering&&(b.dy="1ex"),b.text=u?M:lt(b.text,e.textStyle,e.maxLabelLength),0!==e.angle&&this.heatMap.enableCanvasRendering?this.drawSvgCanvas.canvasDrawText(b,null,null,null,M,C.height,!0):"Wrap"===e.textStyle.textOverflow||u?this.drawSvgCanvas.createWrapText(b,e.textStyle,h):this.drawSvgCanvas.createText(b,h,T),-1!==(T=this.getMaxLabel(M,e)).indexOf("...")&&(f=e.opposedPosition?O:O-(e.angle%360!=0?w.width/2:C.width),x=v-(e.angle%360!=0?w.height/2:C.height),T=-1!==a[m].indexOf("<br>")||-1!==a[m].indexOf("<br/>")?a[m].replace(/<br\s*\/?>/g," "):a[m],this.heatMap.tooltipCollection.push(new E(T,new z(f,x,(e.angle%360!=0?w:C).width,e.angle%360!=0?w.height:C.height*M.length)))),0===o?(S="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[m]:e.axisLabelInterval,p+=e.isInversed?S*n:-S*n):(p+=e.isInversed?o*n:-o*n,m+=o-1),this.drawYAxisBorder(e,d,e.rect,v,C.height,m)}l.enableCanvasRendering||(t.appendChild(h),t.appendChild(d))},u.prototype.drawXAxisBorder=function(e,t,i,l,a,n){var o=i.width/e.axisLabelSize,s="",r=e.interval||1,h=e.isInversed?i.x+i.width-o*n*r:i.x+o*n*r,d=i.y,p=d+(e.opposedPosition?-(e.maxLabelSize.height+10):e.maxLabelSize.height+10),g=e.isInversed?h-o:h+o,c=e.isInversed?l+a+10:l-10,u=e.isInversed?l-10:l+a+10,u="Near"===e.textStyle.textAlignment&&e.isInversed?u+10:"Far"!==e.textStyle.textAlignment||e.isInversed?u:u-10,c="Far"===e.textStyle.textAlignment&&e.isInversed?c-10:"Near"!==e.textStyle.textAlignment||e.isInversed?c:c+10;switch(e.border.type){case"Rectangle":s="M "+h+" "+d+" L "+h+" "+p+" L "+g+" "+p+" L "+g+" "+d+" L "+h+" "+d;break;case"WithoutTopBorder":s="M "+h+" "+d+" L "+h+" "+p+" L "+g+" "+p+" L "+g+" "+d+" ";break;case"WithoutBottomBorder":s="M "+h+" "+p+" L "+h+" "+d+" L "+g+" "+d+" L "+g+" "+p+" ";break;case"WithoutTopandBottomBorder":s="M "+h+" "+d+" L "+h+" "+p+" M "+g+" "+d+" L "+g+" "+p+" ";break;case"Brace":s="M "+h+" "+d+" L "+h+" "+(p=d+(p-d)/2+(e.opposedPosition?0:5))+" L "+c+" "+p+" M "+u+" "+p+" L "+g+" "+p+" L "+g+" "+d+" "}0<e.border.width&&"WithoutBorder"!==e.border.type&&this.createAxisBorderElement(e,s,t,n)},u.prototype.drawYAxisBorder=function(e,t,i,l,a,n){var o=i.height/e.axisLabelSize,s="",r=e.interval||1,h=i.x,d=e.isInversed?i.y+o*n*r:i.y+i.height-o*n*r,p=h+(e.opposedPosition?e.maxLabelSize.width+20:-(e.maxLabelSize.width+20)),g=e.isInversed?d+o:d-o,c=e.isInversed?l-a/2:l+a/2,u=e.isInversed?l+a/2:l-a/2;switch(e.border.type){case"Rectangle":s="M "+h+" "+d+" L "+h+" "+g+" L "+p+" "+g+" L "+p+" "+d+" L "+h+" "+d;break;case"WithoutTopBorder":s="M "+h+" "+d+" L "+p+" "+d+" L "+p+" "+g+" L "+h+" "+g+" ";break;case"WithoutBottomBorder":s="M "+p+" "+d+" L "+h+" "+d+" L "+h+" "+g+" L "+p+" "+g+" ";break;case"WithoutTopandBottomBorder":s="M "+h+" "+d+" L "+p+" "+d+" M "+p+" "+g+" L "+h+" "+g+" ";break;case"Brace":s="M "+h+" "+d+" L "+(p=h-(h-p)/2)+" "+d+" L "+p+" "+c+" M "+p+" "+u+" L "+p+" "+g+" L "+h+" "+g}0<e.border.width&&"WithoutBorder"!==e.border.type&&this.createAxisBorderElement(e,s,t,n)},u.prototype.createAxisBorderElement=function(e,t,i,l){var a="Horizontal"===e.orientation?"_XAxis_Label_Border":"_YAxis_Label_Border",a=new g(this.heatMap.element.id+a+l,"transparent",e.border.width,e.border.color,1,"none",t);this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawPath(a,void 0):(l=this.heatMap.renderer.drawPath(a),i.appendChild(l))},u.prototype.drawMultiLevels=function(e,t){var i;this.heatMap.enableCanvasRendering||(i=this.heatMap.renderer.createGroup({id:this.heatMap.element.id+"_"+t.orientation+"_MultiLevelLabel"})),"Horizontal"===t.orientation?this.renderXAxisMultiLevelLabels(t,i):this.renderYAxisMultiLevelLabels(t,i),this.heatMap.enableCanvasRendering||e.appendChild(i)},u.prototype.renderXAxisMultiLevelLabels=function(r,h){var d,p,g,c,u,m,y,x,b,v,S=this,C=0,f=r.isInversed,M=r.opposedPosition,w="",L=(f?r.rect.width:0)+r.rect.x;r.multiLevelLabels.map(function(o,s){x=S.heatMap.renderer.createGroup({id:S.heatMap.element.id+"_XAxisMultiLevelLabel"+s}),o.categories.map(function(e,t){if(!P.isNullOrUndefined(e.start)&&!P.isNullOrUndefined(e.end)){"Tailwind"!==S.heatMap.theme&&"TailwindDark"!==S.heatMap.theme||o.setProperties({textStyle:{fontFamily:"Inter"}},!0),"Tailwind3"!==S.heatMap.theme&&"Tailwind3Dark"!==S.heatMap.theme||o.setProperties({textStyle:{color:S.heatMap.themeStyle.axisLabel,fontFamily:"Inter",fontWeight:"400"}},!0),"Material3"!==S.heatMap.theme&&"Material3Dark"!==S.heatMap.theme||o.setProperties({textStyle:{fontFamily:"Roboto"}},!0),"Fluent"!==S.heatMap.theme&&"FluentDark"!==S.heatMap.theme||o.setProperties({textStyle:{fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif'}},!0),"Fluent2"===S.heatMap.theme&&o.setProperties({textStyle:{color:"#242424",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Fluent2Dark"!==S.heatMap.theme&&"Fluent2HighContrast"!==S.heatMap.theme||o.setProperties({textStyle:{color:"#FFFFFF",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Bootstrap5"===S.heatMap.theme&&o.setProperties({textStyle:{color:"#212529",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Bootstrap5Dark"===S.heatMap.theme&&o.setProperties({textStyle:{color:"#DEE2E6",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),g=!1,c="number"==typeof e.start?e.start:Number(new Date(e.start)),u="number"==typeof e.end?e.end:Number(new Date(e.end)),c=L+S.calculateLeftPosition(r,c,e.start,r.rect),p=r.multiLevelPosition[s].y,u=L+S.calculateWidth(r,e.end,u,r.rect);var i=S.heatMap.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(e.text):e.text,l=(m=D(i,o.textStyle),b=(null===e.maximumTextWidth?Math.abs(u-c):e.maximumTextWidth)-10,d=p+(M?-(r.xAxisMultiLabelHeight[s]-m.height):m.height),C=f?c-b:c+10,"Center"===o.alignment?(C=(u-c)/2+c,C-=(m.width>b?b:m.width)/2):"Far"===o.alignment?(C=f?c-10:u-10,C-=m.width>b?b:m.width):C=f?u+10:c+10,"None"===o.overflow&&m.width>Math.abs(u-c)&&(C=f?c-m.width-10:c+10,y="start"),new V(C,d,y,i,0,"translate(0,0)")),a=new F(S.heatMap.element.id+"_XAxis_MultiLevel"+s+"_Text"+t,l,o.textStyle,o.textStyle.color||S.heatMap.themeStyle.axisLabel);if("Wrap"===o.overflow?(a.text=ot(i,b,o.textStyle),v=a.text.length):"Trim"===o.overflow&&(a.text=I(b,i,o.textStyle),v=1),"Wrap"===o.overflow&&1<a.text.length){S.drawSvgCanvas.createWrapText(a,o.textStyle,x);for(var n=0;n<a.text.length;n++)if(-1!==a.text[n].indexOf("...")){g=!0;break}}else S.drawSvgCanvas.createText(a,x,a.text);S.heatMap.enableCanvasRendering||h.appendChild(x),-1===a.text.indexOf("...")&&-1===a.text[0].indexOf("...")&&!g||S.heatMap.tooltipCollection.push(new E(e.text,new z(C,d-m.height,b,m.height*v))),0<o.border.width&&"WithoutBorder"!==o.border.type&&(w=S.renderXAxisLabelBorder(s,r,c,p,u,w,s,m,b,C))}}),""!==w&&(S.createBorderElement(s,r,w,h),w="")}),this.heatMap.enableCanvasRendering||h.appendChild(x)},u.prototype.renderXAxisLabelBorder=function(e,t,i,l,a,n,o,s,r,h){var d=l+(t.opposedPosition?-t.xAxisMultiLabelHeight[e]:t.xAxisMultiLabelHeight[e]);switch(t.multiLevelLabels[o].border.type){case"Rectangle":n+="M "+i+" "+l+" L "+i+" "+d+" L "+a+" "+d+" L "+a+" "+l+" L "+i+" "+l+" ";break;case"WithoutTopBorder":n+="M "+i+" "+l+" L "+i+" "+d+" L "+a+" "+d+" L "+a+" "+l+" ";break;case"WithoutBottomBorder":n+="M "+i+" "+d+" L "+i+" "+l+" L "+a+" "+l+" L "+a+" "+d+" ";break;case"WithoutTopandBottomBorder":n+="M "+i+" "+l+" L "+i+" "+d+" M "+a+" "+l+" L "+a+" "+d+" ";break;case"Brace":n+="M "+i+" "+l+" L "+i+" "+(l+(d-l)/2)+" L "+(t.isInversed?(s.width>r?r:s.width)+h+3:h-3)+" "+(l+(d-l)/2)+" M "+(t.isInversed?h-3:(s.width>r?r:s.width)+h+3)+" "+(l+(d-l)/2)+" L "+a+" "+(l+(d-l)/2)+" L "+a+" "+l+" "}return n},u.prototype.renderYAxisMultiLevelLabels=function(o,s){var r,h,d,p,g,c,u,m,y,x=this,b=o.isInversed,v="",S=(b?0:o.rect.height)+o.rect.y;o.multiLevelLabels.map(function(a,n){o.multiLevelPosition[n].y,u=x.heatMap.renderer.createGroup({id:x.heatMap.element.id+"_YAxisMultiLevelLabel"+n}),a.categories.map(function(e,t){"Tailwind"!==x.heatMap.theme&&"TailwindDark"!==x.heatMap.theme||a.setProperties({textStyle:{fontFamily:"Inter"}},!0),"Tailwind3"!==x.heatMap.theme&&"Tailwind3Dark"!==x.heatMap.theme||a.setProperties({textStyle:{color:x.heatMap.themeStyle.axisLabel,fontFamily:"Inter",fontWeight:"400"}},!0),"Material3"!==x.heatMap.theme&&"Material3Dark"!==x.heatMap.theme||a.setProperties({textStyle:{fontFamily:"Roboto"}},!0),"Bootstrap5"!==x.heatMap.theme&&"Bootstrap5Dark"!==x.heatMap.theme||a.setProperties({textStyle:{fontFamily:"Segoe UI"}},!0),"Fluent2"===x.heatMap.theme&&a.setProperties({textStyle:{color:"#242424",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Fluent2Dark"!==x.heatMap.theme&&"Fluent2HighContrast"!==x.heatMap.theme||a.setProperties({textStyle:{color:"#FFFFFF",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),p="number"==typeof e.start?e.start:Number(new Date(e.start)),g="number"==typeof e.end?e.end:Number(new Date(e.end)),p=S+x.calculateLeftPosition(o,p,e.start,o.rect),d=o.multiLevelPosition[n].x,g=S+x.calculateWidth(o,e.start,g,o.rect);var i=x.heatMap.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(e.text):e.text,l=(c=D(i,a.textStyle),m=(null===e.maximumTextWidth?Math.abs(d):e.maximumTextWidth)-10,Math.abs(d-(d-o.multiLevelSize[n].width-20))/2-c.width/2),l=(r=(o.opposedPosition?d:d-o.multiLevelSize[n].width-20)+l,h=p+10,"None"!==a.overflow&&(y="Wrap"===a.overflow?ot(i,m,a.textStyle):I(m,i,a.textStyle)),"Center"===a.alignment?h+=(g-p)/2-y.length*c.height/2:h="Far"===a.alignment?b?g-c.height/2:h-c.height:b?h+c.height/2:g+c.height,0<a.border.width&&"WithoutBorder"!==a.border.type&&(v=x.renderYAxisLabelBorder(n,o,d,p,g,v,n,c,m,h)),new V(r,h,"start",x.heatMap.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(e.text):e.text,0,"translate(0,0)")),i=new F(x.heatMap.element.id+"_YAxis_MultiLevel"+n+"_Text"+t,l,a.textStyle,a.textStyle.color||x.heatMap.themeStyle.axisLabel);i.text=y,x.drawSvgCanvas.createText(i,u,i.text),-1!==i.text.indexOf("...")&&x.heatMap.tooltipCollection.push(new E(e.text,new z(r,h-c.height,m,c.height))),x.heatMap.enableCanvasRendering||s.appendChild(u)}),""!==v&&(x.createBorderElement(n,o,v,s),v="")}),this.heatMap.enableCanvasRendering||s.appendChild(u)},u.prototype.renderYAxisLabelBorder=function(e,t,i,l,a,n,o,s,r,h){var d=i-(t.opposedPosition?-(t.multiLevelSize[e].width+20):t.multiLevelSize[e].width+20);switch(t.multiLevelLabels[o].border.type){case"Rectangle":n+="M "+i+" "+l+" L "+d+" "+l+" L "+d+" "+a+" L "+i+" "+a+" L "+i+" "+l+" ";break;case"WithoutTopBorder":n+="M "+i+" "+l+" L "+d+" "+l+" L "+d+" "+a+" L "+i+" "+a+" ";break;case"WithoutBottomBorder":n+="M "+d+" "+l+" L "+i+" "+l+" L "+i+" "+a+" L "+d+" "+a+" ";break;case"WithoutTopandBottomBorder":n+="M "+i+" "+l+" L "+d+" "+l+" M "+i+" "+a+" L "+d+" "+a+" ";break;case"Brace":n+="M "+i+" "+l+" L "+(i+(d-i)/2)+" "+l+" L "+(i+(d-i)/2)+" "+(t.isInversed?h-10-5:h+s.height-10)+" M "+(i+(d-i)/2)+" "+(t.isInversed?h+s.height-10:h-10-5)+" L "+(i+(d-i)/2)+" "+a+" L "+i+" "+a+" "}return n},u.prototype.createBorderElement=function(e,t,i,l){var a="Horizontal"===t.orientation?"XAxis":"YAxis",a=new g(this.heatMap.element.id+"_"+a+"_MultiLevel_Rect_"+e,"Transparent",t.multiLevelLabels[e].border.width,t.multiLevelLabels[e].border.color,1,"",i),t=this.heatMap.renderer.drawPath(a);this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawPath(a,void 0):l.appendChild(t)},u.prototype.calculateLeftPosition=function(e,t,i,l){var a;return i="number"==typeof i?("Numeric"===e.valueType&&(e.minimum||e.maximum)&&(t-=e.minimum||0),a=("Horizontal"===e.orientation?l.width:l.height)/(e.axisLabelSize*e.increment),(e.isInversed?-1:1)*t*a):(a=this.calculateNumberOfDays(t,e,!0,l),e.isInversed?-a:a),i="Horizontal"===e.orientation?i:-i},u.prototype.calculateWidth=function(e,t,i,l){var a,n;return n="number"==typeof t?("Numeric"===e.valueType&&(e.minimum||e.maximum)&&(i-=e.minimum||0),a=("Horizontal"===e.orientation?l.width:l.height)/(e.axisLabelSize*e.increment),(e.isInversed?-1:1)*(i+1)*a):(n=a=this.calculateNumberOfDays(i,e,!1,l),e.isInversed?-n:n),n="Horizontal"===e.orientation?n:-n},u.prototype.calculateNumberOfDays=function(e,t,i,l){for(var a=t.labelValue,n=("Horizontal"===t.orientation?l.width:l.height)/t.axisLabelSize,o=new Date(Number(e)),s=0,r=0;r<t.axisLabelSize;r++){var h,d=new Date(Number(a[r]));if(h=t.isInversed?new Date(Number(a[r-1])):new Date(Number(a[r+1])),r===(t.isInversed?0:t.axisLabelSize-1)&&(h=new Date(Number(a[r])),h="Hours"===t.intervalType?new Date(Number(h.setHours(h.getHours()+1))):"Minutes"===t.intervalType?new Date(Number(h.setMinutes(h.getMinutes()+1))):"Days"===t.intervalType?new Date(Number(h.setDate(h.getDate()+1))):(g="Months"===t.intervalType?new Date(h.getFullYear(),h.getMonth()+1,0).getDate():h.getFullYear()%4==0?366:365,new Date(Number(h.setDate(h.getDate()+g))))),Number(d)<=e&&Number(h)>=e){if("Minutes"===t.intervalType||"Hours"===t.intervalType){var s=n/Math.round(Math.abs((d.getTime()-h.getTime())/6e4))*Math.abs((d.getTime()-o.getTime())/6e4),p=(r=t.isInversed?t.axisLabelSize-1-r:r)*n+s;break}var g=Math.round(Math.abs((d.getTime()-h.getTime())/864e5));i?o.getDate():o.setDate(o.getDate()+1),0!==g&&(s=n/g*Math.abs((d.getTime()-o.getTime())/864e5)),p=(r=t.isInversed?t.axisLabelSize-1-r:r)*n+s;break}}return p},u.prototype.destroy=function(){this.drawSvgCanvas=null,this.element=null,this.htmlObject=null,this.initialClipRect=null,this.heatMap=null};var Ot=u;function u(e){this.heatMap=e,this.padding=10,this.drawSvgCanvas=new it(e)}zt=function(e,t){return(zt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var zt,Pt,h=function(e,t){function i(){this.constructor=e}zt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},m=function(e,t,i,l){var a,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;0<=s;s--)(a=e[s])&&(o=(n<3?a(o):3<n?a(t,i,o):a(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},h=(Pt=P.ChildProperty,h(y,Pt),m([P.Property("")],y.prototype,"labelTemplate",void 0),m([P.Property(!0)],y.prototype,"showLabel",void 0),m([P.Property("")],y.prototype,"format",void 0),m([P.Property(!0)],y.prototype,"enableCellHighlighting",void 0),m([P.Complex({},ge)],y.prototype,"bubbleSize",void 0),m([P.Complex({},Y)],y.prototype,"border",void 0),m([P.Complex(t.rectLabelFont,k)],y.prototype,"textStyle",void 0),m([P.Property("Rect")],y.prototype,"tileType",void 0),m([P.Property("Color")],y.prototype,"bubbleType",void 0),m([P.Property(!1)],y.prototype,"isInversedBubbleSize",void 0),y);function y(){return null!==Pt&&Pt.apply(this,arguments)||this}x.prototype.renderRectSeries=function(){this.createSeriesGroup();for(var e,t,i=this.heatMap,l=!1,a=(i.xLength=i.axisCollections[0].axisLabelSize,i.yLength=i.axisCollections[1].axisLabelSize,Math.round(100*i.initialClipRect.x)/100),n=Math.round(100*i.initialClipRect.y)/100,o=0,s=0,r=i.cellSettings,h=Math.round((i.initialClipRect.width-r.border.width/2)/i.xLength*100)/100,d=Math.round((i.initialClipRect.height-r.border.width/2)/i.yLength*100)/100,p=0,g=[],c=r.border,u=null,m=(this.rectPositionCollection=[],this.color="",this.bubbleColorValue=[],i.yAxis.opposedPosition&&(a=Math.round(100*(i.initialClipRect.x+parseFloat(c.width.toString())/2))/100),P.isNullOrUndefined(this.heatMap.cellSettings.labelTemplate)||""===this.heatMap.cellSettings.labelTemplate||(document.getElementById(this.heatMap.element.id+"_LabelTemplate_Group")&&C(this.heatMap.element.id+"_LabelTemplate_Group"),u=P.createElement("div",{id:i.element.id+"_LabelTemplate_Group"})),this.getBubbleRadius(h,d)),y=0;y<i.xLength*i.yLength;y++){"Column"===i.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type?(this.heatMap.dataSourceMinValue=this.heatMap.dataMin[s],this.heatMap.dataSourceMaxValue=this.heatMap.dataMax[s]):"Row"===i.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type&&(this.heatMap.dataSourceMinValue=this.heatMap.dataMin[o],this.heatMap.dataSourceMaxValue=this.heatMap.dataMax[o]),this.setTextAndColor(o,s);var x,b,v=new Be(0,0,0,0,0,"",0,0,0,0,!0,"","",!0),S=c.color;this.heatMap.bubbleSizeWithColor?this.updateRectDetails(v,a,n,h,d,P.extend("",this.bubbleColorValue,null,!0),y,s,o):this.updateRectDetails(v,a,n,h,d,this.text,y,s,o),r.showLabel?P.isNullOrUndefined(this.heatMap.cellSettings.labelTemplate)||""===this.heatMap.cellSettings.labelTemplate?e=this.getFormatedText(this.text,r.format):"number"==typeof(x=i.dataSourceSettings.bubbleDataMapping&&i.dataSourceSettings.isJsonData&&"Cell"===i.dataSourceSettings.adaptorType&&!P.isNullOrUndefined(v.value[0])?v.value[0].bubbleData:v.value)&&"#ffffff"!==this.cellColor.getColorByValue(x)&&Ve(this.heatMap.cellSettings.labelTemplate,i,u,v,i.axisCollections[0].axisLabels,i.axisCollections[1].axisLabels.slice().reverse(),y):e="",v.displayText=e,i.enableHtmlSanitizer&&(e=P.SanitizeHtmlHelper.sanitize(e)),P.isNullOrUndefined(this.heatMap.cellRender)||(e=this.cellRendering(v,e)),("Canvas"===i.renderingMode&&0===parseFloat(c.width.toString())||!S&&"Bubble"===r.tileType&&"Sector"===r.bubbleType)&&(S=this.color),"Rect"===r.tileType?(this.renderTileCell(v,c,y,this.color,S),this.updateLabelVisibleStatus(h,d,e)):"Color"===r.bubbleType?(this.renderBubbleCell(v,c,y,this.color,S,m),this.updateLabelVisibleStatus(2*m-12,2*m-6,e)):P.isNullOrUndefined(this.text)||"Size"!==r.bubbleType&&"SizeAndColor"!==r.bubbleType||""===this.text.toString()?"Sector"!==r.bubbleType||P.isNullOrUndefined(this.text)||""===this.text.toString()||(this.renderSectorCell(v,c,y.toString(),this.color,S,m,this.text),this.checkLabelXDisplay=!1,this.checkLabelYDisplay=!1):("Table"!==this.heatMap.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type&&(this.heatMap.minColorValue=isFinite(this.heatMap.minColorValue)?this.heatMap.minColorValue:this.heatMap.dataSourceMinValue,this.heatMap.maxColorValue=isFinite(this.heatMap.maxColorValue)?this.heatMap.maxColorValue:this.heatMap.dataSourceMaxValue),t=this.getRadiusBypercentage(parseFloat(this.text.toString()),i.dataSourceMinValue,i.dataSourceMaxValue,m),this.renderBubbleCell(v,c,y,this.color,S,t),this.updateLabelVisibleStatus(2*t-12,2*t-6,e)),g.push(v),i.rangeSelection&&"Fixed"===i.paletteSettings.type&&(l=this.isCellValueInRange(o,s),v.visible=l),r.showLabel&&this.checkLabelYDisplay&&this.checkLabelXDisplay&&(x=r.textStyle,S=new F(i.element.id+"_HeatMapRectLabels_"+y,new V(Math.round(100*(a+h/2))/100,Math.round(100*(n+d/2))/100,"middle",e,null,null,"middle"),x,x.color||this.getSaturatedColor(this.color)),v.textId=S.id,i.rangeSelection&&"Fixed"===i.paletteSettings.type&&(S.fill=l?S.fill:this.heatMap.themeStyle.toggledColor),P.Browser.isIE&&!i.enableCanvasRendering&&(S.dy="Bubble"===this.heatMap.cellSettings.tileType?"0.5ex":"1ex"),"Wrap"===this.heatMap.cellSettings.textStyle.textOverflow?(v="Bubble"===r.tileType?"Size"===r.bubbleType||"SizeAndColor"===r.bubbleType?2*t-12:"Color"===r.bubbleType?2*m-12:h:h,b="Bubble"===r.tileType?"Size"===r.bubbleType||"SizeAndColor"===r.bubbleType?2*t-6:"Color"===r.bubbleType?2*m-6:d:d,S.text=ot(e,v,this.heatMap.cellSettings.textStyle,!0),this.updateLabelText(b,v,S),b=parseInt(this.heatMap.cellSettings.textStyle.size,10)*(S.text.length-1),S.y=1<S.text.length?Math.round(n+(d-b)/2):S.y,this.drawSvgCanvas.createWrapText(S,r.textStyle,this.containerTextObject)):this.drawSvgCanvas.createText(S,this.containerTextObject,e)),p===i.xLength-1?(n=Math.round(100*(n+d))/100,s=p=0,a=i.yAxis.opposedPosition?Math.round(100*(i.initialClipRect.x+parseFloat(c.width.toString())/2))/100:Math.round(100*i.initialClipRect.x)/100,this.rectPositionCollection.push(g),g=[],o++):(a=Math.round(100*(a+h))/100,p++,s++)}P.isNullOrUndefined(u)||document.getElementById(this.heatMap.element.id+"_Secondary_Element").appendChild(u),i.enableCanvasRendering||(i.svgObject.appendChild(this.containerRectObject),!r.showLabel)||"Bubble"===r.tileType&&"Sector"===r.bubbleType||i.svgObject.appendChild(this.containerTextObject)},x.prototype.isCellValueInRange=function(e,t){for(var i=!1,l=0;l<this.heatMap.toggleValue.length;l++){var a=void 0,n=0!==l||this.heatMap.isColorRange?this.heatMap.isColorRange?this.heatMap.toggleValue[l].startValue:this.heatMap.toggleValue[l].value:this.heatMap.dataSourceMinValue,a="Bubble"===this.heatMap.cellSettings.tileType&&"SizeAndColor"===this.heatMap.cellSettings.bubbleType?l===this.heatMap.toggleValue.length-1?this.heatMap.maxColorValue:this.heatMap.toggleValue[l+1].value-.01:l!==this.heatMap.toggleValue.length-1||this.heatMap.isColorRange?this.heatMap.isColorRange?this.heatMap.toggleValue[l].endValue:this.heatMap.toggleValue[l+1].value-.01:this.heatMap.dataSourceMaxValue,o=this.heatMap.clonedDataSource,o=P.isNullOrUndefined(o[e][t][1])||""===o[e][t][1].toString()?"":o[e][t][1],o=parseFloat(("Bubble"===this.heatMap.cellSettings.tileType&&"SizeAndColor"===this.heatMap.cellSettings.bubbleType?o:this.text).toString());if(isNaN(o))i=!0;else{if(!isNaN(o)&&n<=o&&o<=a){if(this.heatMap.toggleValue[l].visible){i=!0;break}i=!1;break}if(this.heatMap.isColorRange&&a>=this.heatMap.toggleValue[l].endValue&&l===this.heatMap.toggleValue.length-1){i=!0;break}}}return i},x.prototype.cellRendering=function(e,t){var i=this.heatMap.axisCollections[0],l=this.heatMap.axisCollections[1],a=i.tooltipLabels,n=l.tooltipLabels.slice().reverse(),l=l.labelValue.slice().reverse(),a={heatmap:this.heatMap,cancel:!1,name:"cellRender",value:e.value,xLabel:a[e.xIndex].toString(),yLabel:n[e.yIndex].toString(),displayText:t,xValue:i.labelValue[e.xIndex],yValue:l[e.yIndex],cellColor:this.color};return this.heatMap.trigger("cellRender",a),this.color=a.cellColor,a.displayText},x.prototype.setTextAndColor=function(e,t){this.bubbleColorValue=[];var i,l=this.heatMap.dataSourceSettings,a=this.heatMap.clonedDataSource;this.heatMap.bubbleSizeWithColor?(this.text=P.isNullOrUndefined(a[e][t][0])||""===a[e][t][0].toString()?"":a[e][t][0],this.color=P.isNullOrUndefined(a[e][t][1])||""===a[e][t][1].toString()?this.heatMap.isColorValueExist?this.heatMap.emptyPointColor:this.cellColor.getColorByValue(this.text):this.cellColor.getColorByValue(a[e][t][1]),i=new fe(l.isJsonData&&"Cell"===l.adaptorType?l.bubbleDataMapping.size:null,this.text,"Size"),this.bubbleColorValue.push(i),this.bubbleColorValue.push({mappingName:l.isJsonData&&"Cell"===l.adaptorType?l.bubbleDataMapping.color:null,bubbleData:P.isNullOrUndefined(a[e][t][1])||""===a[e][t][1].toString()?"":a[e][t][1],valueType:"Color"})):(this.text=a[e][t],this.color=this.cellColor.getColorByValue(this.text))},x.prototype.createSeriesGroup=function(){this.heatMap.enableCanvasRendering||(this.containerRectObject=this.heatMap.renderer.createGroup({id:this.heatMap.element.id+"_Container_RectGroup"}),!this.heatMap.cellSettings.showLabel)||"Bubble"===this.heatMap.cellSettings.tileType&&"Sector"===this.heatMap.cellSettings.bubbleType||(this.containerTextObject=this.heatMap.renderer.createGroup({id:this.heatMap.element.id+"_Container_TextGroup",transform:"translate( 0, 0)"}))},x.prototype.updateRectDetails=function(e,t,i,l,a,n,o,s,r){e.x=t,e.y=i,e.width=l,e.height=a,e.value=n,e.id=this.heatMap.element.id+"_HeatMapRect_"+o,e.xIndex=s,e.yIndex=r},x.prototype.renderTileCell=function(e,t,i,l,a){i=new b(this.heatMap.element.id+"_HeatMapRect_"+i,l,t,1,new z(e.x,e.y,e.width,e.height),a||this.heatMap.themeStyle.cellBorder,t.radius,t.radius);this.drawSvgCanvas.drawRectangle(i,this.containerRectObject,!0)},x.prototype.getBubbleRadius=function(e,t){t=t/2<e/2?t/2-2:e/2-2;return t<0?0:t},x.prototype.renderSectorCell=function(e,t,i,l,a,n,o){for(var s,r,h,d,p,g,c,u,m=Math.round(100*(e.x+e.width/2))/100,y=Math.round(100*(e.y+e.height/2))/100,x=l,b=this.getRadiusBypercentage(o,this.heatMap.dataSourceMinValue,this.heatMap.dataSourceMaxValue,360),v=0;v<2;v++){u=parseFloat(t.width.toString()),0===v?(s=180<=b?1:0,r=-90,h=0===b?270:b-90,d=Math.round(100*(m+n*Math.cos((b-90)*(Math.PI/180))))/100,p=Math.round(100*(y+n*Math.sin((b-90)*(Math.PI/180))))/100,g=Math.round(100*m)/100,c=Math.round(100*(y-n))/100,0===b&&(x=this.heatMap.emptyPointColor)):(s=180<=b?0:1,r=h,h=270,x=this.heatMap.emptyPointColor,i+="_Unfilled",S=d,C=p,d=g,p=c,g=S,c=C,0===b&&(u=1,a=l));var S=new Qe("",!1,m,y,g,c,d,p,r,h,n,!0),C=new Ze(this.heatMap.element.id+"_HeatMapRect_"+i,S,x,t,u,1,a);if(this.calculateShapes(C,S,b,s),this.drawSvgCanvas.drawPath(C,S,this.containerRectObject),360===b)break}},x.prototype.calculateShapes=function(e,t,i,l){var a;switch(i){case 360:case 0:a=0===i&&t.start===t.end?"M "+e.x+" "+e.y+" L "+t.x+" "+(t.y-t.radius):(a=this.heatMap.enableCanvasRendering?"":"M "+e.x+" "+e.y+" ")+"m "+-t.radius+" 0 a "+t.radius+" "+t.radius+" 0 1 0 "+2*t.radius+" 0 a "+t.radius+" "+t.radius+" 0 1 0 "+-2*t.radius+" 0 ",P.merge(e,{d:a});break;default:a="M "+e.x+" "+e.y+" L "+t.x1+" "+t.y1+" A "+t.radius+" "+t.radius+" 0 "+l+" 1 "+t.cx+" "+t.cy+" Z",P.merge(e,{d:a})}},x.prototype.renderBubbleCell=function(e,t,i,l,a,n){i=new Ge(this.heatMap.element.id+"_HeatMapRect_"+i,l,t,1,a||this.heatMap.themeStyle.cellBorder,Math.round(100*(e.x+e.width/2))/100,Math.round(100*(e.y+e.height/2))/100,n);this.drawSvgCanvas.drawCircle(i,this.containerRectObject)},x.prototype.updateLabelText=function(e,t,i){for(var l=0;l<i.text.length;l++)if(e<parseInt(this.heatMap.cellSettings.textStyle.size,10)*(l+1)+10){if(i.text=i.text.slice(0,l),0<l&&"..."!==i.text[l-1].slice(-3)){var a=i.text.slice(0,l-1),n=I(t,i.text[l-1]+"...",this.heatMap.cellSettings.textStyle);a.push(n),i.text=a;break}break}},x.prototype.updateLabelVisibleStatus=function(e,t,i){this.heatMap.cellSettings.showLabel&&(P.isNullOrUndefined(this.heatMap.cellSettings.labelTemplate)||""===this.heatMap.cellSettings.labelTemplate)&&(this.checkLabelYDisplay=t>parseInt(this.heatMap.cellSettings.textStyle.size,10),this.checkLabelXDisplay=e>i.length*(parseInt(this.heatMap.cellSettings.textStyle.size,10)/2)||"Wrap"===this.heatMap.cellSettings.textStyle.textOverflow)},x.prototype.getRadiusBypercentage=function(e,t,i,l){var a=parseInt(this.heatMap.cellSettings.bubbleSize.minimum,10),n=parseInt(this.heatMap.cellSettings.bubbleSize.maximum,10),e=((a<0||100<a||isNaN(a))&&(a=0),(n<0||100<n||isNaN(n))&&(n=100),(e-t)/(i-t)*100),e=isNaN(e)?100:e;return l*=(e=this.heatMap.bubbleSizeWithColor||"Bubble"===this.heatMap.cellSettings.tileType&&"Size"===this.heatMap.cellSettings.bubbleType?(e=this.heatMap.cellSettings.isInversedBubbleSize?100-e:e)*(n-a)/100+a:e)/100,Math.round(100*l)/100<0?0:Math.round(100*l)/100},x.prototype.getSaturatedColor=function(e){var t=e,e=Mt(St("transparent"===e?window.getComputedStyle(document.body,null).backgroundColor:t));return 128<=Math.round((299*e.R+587*e.G+114*e.B)/1e3)?"black":"white"},x.prototype.highlightSvgRect=function(e){var t,i;-1===e.indexOf("Celltooltip")&&(-1!==e.indexOf("_HeatMapRect")?(-1!==e.indexOf("_HeatMapRectLabels_")&&(t=e.indexOf("_HeatMapRectLabels_")+19,e=this.heatMap.element.id+"_HeatMapRect_"+e.slice(t)),t=document.getElementById(e),this.heatMap.tempRectHoverClass!==e&&(this.heatMap.cellSettings.enableCellHighlighting&&(i=void 0,(i=this.heatMap.tempRectHoverClass?document.getElementById(this.heatMap.tempRectHoverClass):i)&&!this.heatMap.rectSelected&&i.setAttribute("opacity","1"),t)&&!this.heatMap.rectSelected&&t.setAttribute("opacity","0.65"),this.heatMap.tempRectHoverClass=e)):this.heatMap.cellSettings.enableCellHighlighting&&(i=void 0,i=this.heatMap.tempRectHoverClass?document.getElementById(this.heatMap.tempRectHoverClass):i)&&!this.heatMap.rectSelected&&(i.setAttribute("opacity","1"),this.heatMap.tempRectHoverClass=""))},x.prototype.getFormatedText=function(e,t){var i=null!==t.match("{value}"),l=(this.format=this.heatMap.intl.getNumberFormat({format:i?"":t}),"");return l=""!==e.toString()?wt(i,t,e,this.format):l},x.prototype.getCurrentRect=function(e,t){var i=[],e=(i.push(this.heatMap.heatMapSeries.rectPositionCollection[0][0]),Math.ceil((e-i[0].x)/i[0].width)<this.heatMap.axisCollections[0].axisLabelSize?Math.ceil((e-i[0].x)/i[0].width):this.heatMap.axisCollections[0].axisLabelSize),t=Math.floor((t-i[0].y)/i[0].height)<this.heatMap.axisCollections[1].axisLabelSize?Math.floor((t-i[0].y)/i[0].height):this.heatMap.axisCollections[1].axisLabelSize-1,i=this.heatMap.heatMapSeries.rectPositionCollection[t][(e=0===e?1:e)-1];return this.hoverXAxisLabel=this.heatMap.axisCollections[0].tooltipLabels[e-1],this.hoverXAxisValue=this.heatMap.axisCollections[0].labelValue[e-1],this.hoverYAxisLabel=this.heatMap.axisCollections[1].tooltipLabels[this.heatMap.axisCollections[1].tooltipLabels.length-1-t],this.hoverYAxisValue=this.heatMap.axisCollections[1].labelValue[this.heatMap.axisCollections[1].labelValue.length-1-t],i},x.prototype.destroy=function(){P.isNullOrUndefined(this.cellColor)||this.cellColor.destroy(),this.cellColor=null,this.bubbleColorValue=null,this.containerRectObject=null,this.containerTextObject=null,this.drawSvgCanvas=null,this.format=null,this.hoverXAxisValue=null,this.hoverYAxisValue=null,this.rectPositionCollection=null,this.heatMap=null};var Dt=x;function x(e){this.heatMap=e,this.drawSvgCanvas=new it(this.heatMap),this.cellColor=new Re(this.heatMap)}At=function(e,t){return(At=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var At,Ft,m=function(e,t){function i(){this.constructor=e}At(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Vt=function(e,t,i,l){var a,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;0<=s;s--)(a=e[s])&&(o=(n<3?a(o):3<n?a(t,i,o):a(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},m=(Ft=P.ChildProperty,m(It,Ft),Vt([P.Property("")],It.prototype,"template",void 0),Vt([P.Property("")],It.prototype,"fill",void 0),Vt([P.Complex({},K)],It.prototype,"border",void 0),Vt([P.Complex(t.tooltipFont,k)],It.prototype,"textStyle",void 0),It);function It(){return null!==Ft&&Ft.apply(this,arguments)||this}v.prototype.getModuleName=function(){return"Tooltip"},v.prototype.showHideTooltip=function(e,t){var i;P.isNullOrUndefined(this.heatMap)||(i=document.getElementById(this.heatMap.element.id+"Celltooltipcontainer"),e?i.style.visibility="visible":(P.isNullOrUndefined(i)||"hidden"===i.style.visibility||(!P.isNullOrUndefined(this.tooltipObject)&&t&&this.heatMap.isRectBoundary?this.tooltipObject.fadeOut():P.isNullOrUndefined(this.tooltipObject)||P.isNullOrUndefined(this.tooltipObject.element)||this.tooltipObject.element.firstChild.setAttribute("opacity","0"),i.style.visibility="hidden"),this.isFadeout=!0))},v.prototype.destroy=function(){P.isNullOrUndefined(this.tooltipObject)||(this.tooltipObject.destroy(),this.tooltipObject.controlInstance=null,C(this.heatMap.element.id+"Celltooltipcontainer")),this.tooltipObject=null,this.heatMap=null},v.prototype.createTooltip=function(e,t,i,l){var a=null,n=P.select("#"+this.heatMap.element.id+"Celltooltipcontainer");this.heatMap.cellSettings.showLabel&&this.heatMap.heatMapSeries.checkLabelXDisplay&&this.heatMap.heatMapSeries.checkLabelYDisplay&&(a=parseInt(this.heatMap.cellSettings.textStyle.size,10)/2),"Tailwind"!==this.heatMap.theme&&"Tailwind3"!==this.heatMap.theme||this.heatMap.setProperties({tooltipSettings:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}}},!0),"TailwindDark"!==this.heatMap.theme&&"Tailwind3Dark"!==this.heatMap.theme||this.heatMap.setProperties({tooltipSettings:{fill:"#F9FAFB",textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500",color:"#1F2937"}}},!0),"Bootstrap5"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#000000",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#FFFFFF"}}},!0),"Bootstrap5Dark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#FFFFFF",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#212529"}}},!0),"Fluent"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{textStyle:{size:"12px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif',fontWeight:"500"}}},!0),"FluentDark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#252423",textStyle:{size:"12px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif',fontWeight:"500",color:"#F3F2F1"}}},!0),"Material3"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#313033",textStyle:{size:"14px",fontFamily:"Roboto",fontWeight:"400",color:"#F4EFF4"}}},!0),"Material3Dark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#E6E1E5",textStyle:{size:"14px",fontFamily:"Roboto",fontWeight:"400",color:"#313033"}}},!0),"Fluent2"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#FFFFFF",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#242424"}}},!0),"Fluent2Dark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#292929",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#FFFFFF"}}},!0),"Fluent2HighContrast"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#000000",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#FFFFFF"},border:{width:1,color:"#FFF"}}},!0),this.tooltipObject=new O.Tooltip({opacity:"Tailwind"===this.heatMap.theme||"Tailwind3"===this.heatMap.theme||"TailwindDark"===this.heatMap.theme||"Tailwind3Dark"===this.heatMap.theme||"Bootstrap5"===this.heatMap.theme||"Bootstrap5Dark"===this.heatMap.theme||"Fluent"===this.heatMap.theme||"FluentDark"===this.heatMap.theme||"Fluent2"===this.heatMap.theme||"Fluent2Dark"===this.heatMap.theme||"Fluent2HighContrast"===this.heatMap.theme?1:.75,enableAnimation:!1,offset:a,location:{x:t,y:i},availableSize:this.heatMap.availableSize,data:{xValue:this.heatMap.heatMapSeries.hoverXAxisValue,yValue:this.heatMap.heatMapSeries.hoverYAxisValue,value:e.value,xLabel:this.heatMap.heatMapSeries.hoverXAxisLabel?this.heatMap.heatMapSeries.hoverXAxisLabel.toString():null,yLabel:this.heatMap.heatMapSeries.hoverYAxisLabel?this.heatMap.heatMapSeries.hoverYAxisLabel.toString():null},theme:this.heatMap.theme,content:l,fill:this.heatMap.tooltipSettings.fill,enableShadow:!0,template:""===this.heatMap.tooltipSettings.template?null:this.heatMap.tooltipSettings.template,border:{width:this.heatMap.tooltipSettings.border.width,color:this.heatMap.tooltipSettings.border.color},textStyle:{size:this.heatMap.tooltipSettings.textStyle.size,fontWeight:this.heatMap.tooltipSettings.textStyle.fontWeight.toLowerCase(),color:this.heatMap.tooltipSettings.textStyle.color,fontStyle:this.heatMap.tooltipSettings.textStyle.fontStyle.toLowerCase(),fontFamily:this.heatMap.tooltipSettings.textStyle.fontFamily},areaBounds:{height:this.heatMap.initialClipRect.height+this.heatMap.initialClipRect.y,width:this.heatMap.initialClipRect.width,x:this.heatMap.initialClipRect.x}},n)},v.prototype.createTooltipDiv=function(e){var e=e.enableCanvasRendering&&e.allowSelection?e.availableSize.height:0,t=P.createElement("div",{id:this.heatMap.element.id+"Celltooltipcontainer"}),e=(t.style.cssText="position:absolute; z-index: 3;top:-"+e+"px",P.createElement("div",{id:this.heatMap.element.id+"Celltooltipparent"}));e.style.position="relative",e.appendChild(t),this.heatMap.element.appendChild(e)},v.prototype.getTooltipContent=function(e,t){var i,l,a,n=this.heatMap,o=this.heatMap.dataSourceSettings;return at(n.bubbleSizeWithColor?(i=n.xAxis.title&&""!==n.xAxis.title.text?n.xAxis.title.text:"X-Axis",n=n.yAxis.title&&""!==n.yAxis.title.text?n.yAxis.title.text:"Y-Axis",l=o.isJsonData&&"Cell"===o.adaptorType?o.bubbleDataMapping.size:"Value 1",o=o.isJsonData&&"Cell"===o.adaptorType?o.bubbleDataMapping.color:"Value 2",a=t.getFormatedText(e.value[0].bubbleData,this.heatMap.cellSettings.format),[i+" : "+t.hoverXAxisLabel+"<br/>"+n+" : "+t.hoverYAxisLabel+"<br/>"+l+" : "+a+"<br/>"+o+" : "+t.getFormatedText(e.value[1].bubbleData,this.heatMap.cellSettings.format)]):(a=e.value,[t.hoverXAxisLabel+" | "+t.hoverYAxisLabel+" : "+t.getFormatedText(a,this.heatMap.cellSettings.format)]),this.heatMap.enableHtmlSanitizer)},v.prototype.renderTooltip=function(t){var i=this,e=this.heatMap.heatMapSeries,l=[""];(this.heatMap.bubbleSizeWithColor?!P.isNullOrUndefined(t.value)&&!P.isNullOrUndefined(t.value[0].bubbleData)&&""!==t.value[0].bubbleData.toString():!(P.isNullOrUndefined(t.value)||!P.isNullOrUndefined(t.value)&&""===t.value.toString()))?P.isNullOrUndefined(this.heatMap.tooltipRender)?(l=this.getTooltipContent(t,e),this.tooltipCallback(t,l)):(e=this.getTooltipContent(t,e),e={heatmap:this.heatMap,cancel:!1,name:"tooltipRender",value:t.value,xValue:this.heatMap.heatMapSeries.hoverXAxisValue,yValue:this.heatMap.heatMapSeries.hoverYAxisValue,xLabel:this.heatMap.heatMapSeries.hoverXAxisLabel?this.heatMap.heatMapSeries.hoverXAxisLabel.toString():null,yLabel:this.heatMap.heatMapSeries.hoverYAxisLabel?this.heatMap.heatMapSeries.hoverYAxisLabel.toString():null,content:e},this.heatMap.trigger("tooltipRender",e,function(e){e.cancel?i.tooltipObject&&i.showHideTooltip(!1):(l=e.content,i.tooltipCallback(t,l))})):(this.showHideTooltip(!1,!1),t.visible||this.showHideTooltip(!1,!1))},v.prototype.tooltipCallback=function(e,t){this.tooltipObject?(this.tooltipObject.content=t,this.tooltipObject.data={xValue:this.heatMap.heatMapSeries.hoverXAxisValue,yValue:this.heatMap.heatMapSeries.hoverYAxisValue,xLabel:this.heatMap.heatMapSeries.hoverXAxisLabel?this.heatMap.heatMapSeries.hoverXAxisLabel.toString():null,yLabel:this.heatMap.heatMapSeries.hoverYAxisLabel?this.heatMap.heatMapSeries.hoverYAxisLabel.toString():null,value:e.value}):this.createTooltip(e,e.x+e.width/2,e.y+e.height/2,t),(this.heatMap.isVue||this.heatMap.isVue3)&&(this.tooltipObject.controlInstance=this.heatMap),this.showHideTooltip(!0),this.tooltipObject.enableAnimation=!this.isFirst&&!this.isFadeout,this.isFirst=this.isFirst&&!1,this.isFadeout=this.isFadeout&&!1,this.tooltipObject.location.x=e.x+e.width/2,this.tooltipObject.location.y=e.y+e.height/2,e.visible||this.showHideTooltip(!1,!1)};Vt=v;function v(e){this.isFirst=!0,this.isFadeout=!1,this.heatMap=e}_t.prototype.processDataSource=function(e){var t,i,l=P.extend([],e,null,!0),a=(this.heatMap.clonedDataSource=[],this.completeDataSource=[],this.heatMap.axisCollections),e=a[0].maxLength+1,n=a[0].axisLabelSize+(0<a[0].min?a[0].min:0),o=n<e?e:n,e=a[1].maxLength+1,s=(n=a[1].axisLabelSize+(0<a[1].min?a[1].min:0))<e?e:n,r=0,h=[];this.tempSizeArray=[],this.tempColorArray=[],this.heatMap.minColorValue=null,this.heatMap.maxColorValue=null,this.heatMap.dataMax=[],this.heatMap.dataMin=[],"Column"===this.heatMap.paletteSettings.colorGradientMode&&o<s&&(o=s);for(var d="Category"===a[1].valueType?a[1].min:0;d<("Column"===this.heatMap.paletteSettings.colorGradientMode?o:s);d++){var p="Category"===a[0].valueType?a[0].min:0;for(this.completeDataSource.push([]);p<o;)p>=a[0].min&&p<=a[0].max&&this.processDataArray(l,p,d,r),p++;if("Column"===this.heatMap.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type)for(var g=P.extend([],l[r],null,!0),c=0;c<g.length;c++)"object"==typeof g[c]&&null!==g[c]&&(g[c]=g[c][0]);else g=P.extend([],this.completeDataSource[r],null,!0);var u=this.getMinMaxValue(t,i,g);"Column"!==this.heatMap.paletteSettings.colorGradientMode&&"Row"!==this.heatMap.paletteSettings.colorGradientMode||"Gradient"!==this.heatMap.paletteSettings.type||(this.heatMap.dataMax[d]=u[1],this.heatMap.dataMin[d]=u[0]),t=u[0],i=u[1],this.heatMap.xAxis.isInversed&&(this.completeDataSource[r]=this.completeDataSource[r].reverse()),d>=this.heatMap.axisCollections[1].min&&d<=this.heatMap.axisCollections[1].max&&h.push(this.completeDataSource[r]),r++}"Row"!==this.heatMap.paletteSettings.colorGradientMode||this.heatMap.yAxis.isInversed||"Gradient"!==this.heatMap.paletteSettings.type||(this.heatMap.dataMax=this.heatMap.dataMax.reverse(),this.heatMap.dataMin=this.heatMap.dataMin.reverse()),"Column"===this.heatMap.paletteSettings.colorGradientMode&&this.heatMap.xAxis.isInversed&&"Gradient"===this.heatMap.paletteSettings.type&&(this.heatMap.dataMax=this.heatMap.dataMax.reverse(),this.heatMap.dataMin=this.heatMap.dataMin.reverse()),this.heatMap.yAxis.isInversed||(this.completeDataSource.reverse(),h.reverse()),this.heatMap.clonedDataSource=h,this.heatMap.dataSourceMinValue=P.isNullOrUndefined(t)?0:parseFloat(t.toString()),this.heatMap.dataSourceMaxValue=P.isNullOrUndefined(i)?0:parseFloat(i.toString()),this.heatMap.isColorValueExist=!P.isNullOrUndefined(this.heatMap.minColorValue),this.heatMap.minColorValue=P.isNullOrUndefined(this.heatMap.minColorValue)?this.heatMap.dataSourceMinValue:parseFloat(this.heatMap.minColorValue.toString()),this.heatMap.maxColorValue=P.isNullOrUndefined(this.heatMap.maxColorValue)?this.heatMap.dataSourceMaxValue:parseFloat(this.heatMap.maxColorValue.toString())},_t.prototype.processDataArray=function(e,t,i,l){if(this.heatMap.bubbleSizeWithColor)if(e[t]&&!P.isNullOrUndefined(e[t][i])&&"object"==typeof e[t][i]){for(var a=e[t][i],n=0;n<a.length;n++)if((P.isNullOrUndefined(a[n])||isNaN(a[n]))&&(a[n]=""),0===n)this.tempSizeArray.push(a[n]);else if(1===n){this.tempColorArray.push(a[n]);break}this.completeDataSource[l].push(a)}else!P.isNullOrUndefined(e[t])&&(e[t][i]||0===e[t][i]&&""!==e[t][i].toString())?(this.completeDataSource[l].push([e[t][i]]),this.tempSizeArray.push(e[t][i])):this.completeDataSource[l].push("");else e[t]&&(e[t][i]||0===e[t][i]&&""!==e[t][i].toString())?"object"==typeof e[t][i]?0<e[t][i].length&&!P.isNullOrUndefined(e[t][i][0])?this.completeDataSource[l].push(e[t][i][0]):this.completeDataSource[l].push(""):this.completeDataSource[l].push(e[t][i]):this.completeDataSource[l].push("")},_t.prototype.getMinMaxValue=function(e,t,i){var l=[];return this.heatMap.bubbleSizeWithColor?("Column"===this.heatMap.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type&&(this.tempSizeArray=i),l.push(this.getMinValue(e,this.tempSizeArray)),l.push(this.getMaxValue(t,this.tempSizeArray)),this.heatMap.minColorValue=this.getMinValue(this.heatMap.minColorValue,this.tempColorArray),this.heatMap.maxColorValue=this.getMaxValue(this.heatMap.maxColorValue,this.tempColorArray)):(l.push(this.getMinValue(e,i)),l.push(this.getMaxValue(t,i))),l},_t.prototype.getMinValue=function(e,t){return(P.isNullOrUndefined(e)||this.performSort(t)<e||("Row"===this.heatMap.paletteSettings.colorGradientMode||"Column"===this.heatMap.paletteSettings.colorGradientMode)&&"Gradient"===this.heatMap.paletteSettings.type)&&(e=this.performSort(t)),P.isNullOrUndefined(e)?e:parseFloat(e.toString())},_t.prototype.getMaxValue=function(e,t){return(P.isNullOrUndefined(e)&&0<t.length||Math.max.apply(Math,t)>e||("Row"===this.heatMap.paletteSettings.colorGradientMode||"Column"===this.heatMap.paletteSettings.colorGradientMode)&&"Gradient"===this.heatMap.paletteSettings.type)&&(e=Math.max.apply(Math,t)),P.isNullOrUndefined(e)?e:parseFloat(e.toString())},_t.prototype.performSort=function(e){return e.sort(function(e,t){return e-t}).filter(this.checkmin)[0]},_t.prototype.checkmin=function(e){return!P.isNullOrUndefined(e)&&""!==e.toString()},_t.prototype.destroy=function(){this.completeDataSource=null,this.tempColorArray=null,this.tempSizeArray=null,this.heatMap=null};var Et=_t;function _t(e){this.heatMap=e}Bt=function(e,t){return(Bt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Bt,Nt,Ht=function(e,t){function i(){this.constructor=e}Bt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},S=function(e,t,i,l){var a,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;0<=s;s--)(a=e[s])&&(o=(n<3?a(o):3<n?a(t,i,o):a(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},Ht=(Nt=P.ChildProperty,Ht(f,Nt),S([P.Property("")],f.prototype,"height",void 0),S([P.Property("")],f.prototype,"width",void 0),S([P.Complex({text:"",textStyle:t.titleFont},te)],f.prototype,"title",void 0),S([P.Property("Right")],f.prototype,"position",void 0),S([P.Property(!0)],f.prototype,"visible",void 0),S([P.Property("Center")],f.prototype,"alignment",void 0),S([P.Property(!0)],f.prototype,"showLabel",void 0),S([P.Property(!0)],f.prototype,"showGradientPointer",void 0),S([P.Property(!1)],f.prototype,"enableSmartLegend",void 0),S([P.Property("All")],f.prototype,"labelDisplayType",void 0),S([P.Complex(t.legendLabelFont,k)],f.prototype,"textStyle",void 0),S([P.Property("")],f.prototype,"labelFormat",void 0),S([P.Property(!0)],f.prototype,"toggleVisibility",void 0),f);function f(){return null!==Nt&&Nt.apply(this,arguments)||this}M.prototype.getModuleName=function(){return"Legend"},M.prototype.destroy=function(){P.isNullOrUndefined(this.tooltipObject)||this.tooltipObject.destroy(),this.tooltipObject=null,this.drawSvgCanvas=null,this.format=null,this.gradientPointer=null,this.labelCollection=null,this.labelCollections=null,this.lastList=null,this.legend=null,this.legendGroup=null,this.legendRect=null,this.legendRectPositionCollection=null,this.legendRectScale=null,this.legendScale=null,this.legendXCollections=null,this.legendYCollections=null,this.maxLegendLabelSize=null,this.navigationCollections=null,this.pagingRect=null,this.paginggroup=null,this.segmentCollections=null,this.segmentCollectionsLabels=null,this.textWrapCollections=null,this.translategroup=null,this.visibilityCollections=null,this.fillRect=null,this.legendLabelTooltip=null,this.legendRange=[],this.legendTextRange=[],this.legendTitleTooltip=null,this.previousOptions=null,this.heatMap=null},M.prototype.renderLegendItems=function(){var e=this.heatMap,t=(e.toggleValue=[],{color:"transparent",width:0}),i=(this.legend=e.renderer.createGroup({id:e.element.id+"_Heatmap_Legend"}),new b(e.element.id+"_LegendBound","none",t,1,this.legendGroup)),i=(this.drawSvgCanvas.drawRectangle(i,this.legend),this.legendRectScale),l=e.canvasRenderer.ctx,a=new z(i.x,i.y,i.width,i.height);if("Fixed"===e.paletteSettings.type){var n=e.legendSettings.enableSmartLegend?e.legendColorCollection:e.colorCollection;this.legendRange=e.resizing||!e.legendOnLoad&&e.rendering?[]:this.legendRange,this.legendTextRange=e.resizing||!e.legendOnLoad&&e.rendering?[]:this.legendTextRange,e.enableCanvasRendering&&(l.save(),l.clip());for(var o=0;o<n.length;o++){var s=!!P.isNullOrUndefined(this.visibilityCollections[o])||this.visibilityCollections[o];e.toggleValue.push(new vt(s,n[o].value,n[o].startValue,n[o].endValue))}}if("Gradient"===e.paletteSettings.type||"Fixed"===e.paletteSettings.type&&!0===e.legendSettings.enableSmartLegend){if("Gradient"===e.paletteSettings.type){if(e.enableCanvasRendering){var r=void 0,h=e.canvasRenderer.ctx,r=e.horizontalGradient?h.createLinearGradient(i.x,0,i.x+i.width,0):h.createLinearGradient(0,i.y,0,i.y+i.height);e.legendSettings.title.text&&h.clip();for(o=0;o<e.legendColorCollection.length;o++){var d=((this.heatMap.isColorRange?e.legendColorCollection[o].startValue:e.legendColorCollection[o].value)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),d=isNaN(d)?0:d;this.heatMap.isColorRange&&"Gradient"===this.heatMap.paletteSettings.type?this.calculateCanvasColorRange(o,r):r.addColorStop(d,e.legendColorCollection[o].color)}h=(h.fillStyle=r).toString()}else{for(var p,i=void 0,g=void 0,c=[],o=0;o<e.legendColorCollection.length;o++)if(this.heatMap.isColorRange&&"Gradient"===this.heatMap.paletteSettings.type?this.calculateColorRange(o,c):(p=(e.legendColorCollection[o].value-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,p=isNaN(p)?0:p,g=new ht(e.legendColorCollection[o].color,p+"%"),c.push(g)),this.legendMaxValue===this.legendMinValue)break;i=e.horizontalGradient?new rt(e.element.id+"_lineargradient","0%","100%","0%","0%"):new rt(e.element.id+"_lineargradient","0%","0%","0%","100%"),i=e.renderer.drawGradient("linearGradient",i,c);this.legend.appendChild(i),h="url(#"+e.element.id+"_lineargradient)"}i=new b(e.element.id+"_Gradient_Legend",h,t,1,a);this.drawSvgCanvas.drawRectangle(i,this.legend),this.renderElements(a)}else this.renderSmartLegend(),this.renderTitle(a);e.enableCanvasRendering||e.svgObject.appendChild(this.legend),e.enableCanvasRendering&&l.restore(),this.renderLegendLabel(a)}else{this.legendScale=e.renderer.createGroup({id:e.element.id+"Heatmap_GradientScale"});h=new b(e.element.id+"_Gradient_Scale","none",t,1,this.legendRectScale);this.drawSvgCanvas.drawRectangle(h,this.legendScale),this.renderTitle(a),e.enableCanvasRendering||this.legend.appendChild(this.legendScale),this.translategroup=e.renderer.createGroup({id:e.element.id+"_translate"}),this.calculateListPerPage(a),1<this.numberOfPages&&(this.paginggroup=e.renderer.createGroup({id:e.element.id+"_navigation"})),this.renderListLegendMode(a,!0),e.enableCanvasRendering&&l.restore()}},M.prototype.renderElements=function(e){this.renderTitle(e),this.renderColorAxisGrid(e)},M.prototype.calculateCanvasColorRange=function(e,t){var i=this.heatMap,l=((i.legendColorCollection[e].startValue<i.dataSourceMinValue&&i.legendColorCollection[e].endValue>i.dataSourceMinValue?i.dataSourceMinValue:i.legendColorCollection[e].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),l=isNaN(l)?0:l,a=((i.legendColorCollection[e].endValue>=this.heatMap.dataSourceMaxValue?this.heatMap.dataSourceMaxValue:i.legendColorCollection[e].endValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue);this.heatMap.legendColorCollection[0].startValue!==this.heatMap.dataSourceMinValue&&0===e&&this.heatMap.legendColorCollection[0].startValue>this.heatMap.dataSourceMinValue&&(l=(this.heatMap.legendColorCollection[0].startValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),t.addColorStop(l/2,this.heatMap.paletteSettings.fillColor.minColor),t.addColorStop(l,this.heatMap.paletteSettings.fillColor.maxColor)),t.addColorStop(l,i.legendColorCollection[e].minColor),t.addColorStop(a,i.legendColorCollection[e].maxColor),this.heatMap.legendColorCollection[e].endValue!==(e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:this.heatMap.legendColorCollection[e+1].startValue)&&this.heatMap.legendColorCollection[e].endValue<this.heatMap.dataSourceMaxValue&&(l=(i.legendColorCollection[e].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),t.addColorStop(l,this.heatMap.paletteSettings.fillColor.minColor),l=((e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:i.legendColorCollection[e+1].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),t.addColorStop(l,this.heatMap.paletteSettings.fillColor.maxColor))},M.prototype.calculateColorRange=function(e,t){void 0===t&&(t=[]);var i,l=this.heatMap,a=(l.toggleValue=[],this.heatMap.legendColorCollection[0].startValue>this.heatMap.dataSourceMinValue&&0===e&&(i=(this.heatMap.dataSourceMinValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,i=isNaN(i)?0:i,a=new ht(l.paletteSettings.fillColor.minColor,i+"%"),t.push(a),i=(l.legendColorCollection[0].startValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,a=new ht(l.paletteSettings.fillColor.maxColor,i+"%"),t.push(a)),i=(l.legendColorCollection[e].startValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,i=isNaN(i)?0:i,a=new ht(l.legendColorCollection[e].minColor,i+"%"),t.push(a),i=(l.legendColorCollection[e].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,new ht(l.legendColorCollection[e].maxColor,i+"%"));t.push(a),this.heatMap.legendColorCollection[e].endValue!==(e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:this.heatMap.legendColorCollection[e+1].startValue)&&(i=(l.legendColorCollection[e].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,a=new ht(this.heatMap.paletteSettings.fillColor.minColor,i+"%"),t.push(a),i=((e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:l.legendColorCollection[e+1].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,a=new ht(this.heatMap.paletteSettings.fillColor.maxColor,i+"%"),t.push(a))},M.prototype.renderTitle=function(e){var t,i,l,a,n,o,s,r,h,d,p=this.heatMap;p.legendSettings.title.text&&(t=p.legendSettings.title,l=D(i=this.heatMap.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(t.text):t.text,t.textStyle),a=p.legendSettings.showLabel?this.labelPadding:p.horizontalGradient?10:6,h="start",s=t.textStyle.textAlignment,r=d=o=n=void 0,"Trim"===p.legendSettings.title.textStyle.textOverflow&&(i=I(o=p.horizontalGradient?e.width-10:this.width-10,i,t.textStyle)),d=p.horizontalGradient?(n=e.y+("Top"===p.legendSettings.position?0:-(10+l.height+a)),a="Top"===p.legendSettings.position?-(a+l.height/4):a+3*l.height/4,r="Bottom"===p.legendSettings.position?n:n-l.height,0!==i.length&&p.enableCanvasRendering&&this.legendTitleTooltip.push(new E(t.text,new z(e.x,r,o,l.height))),l.width=(e.width<l.width?e:l).width,r=e.x,r=-1!==i.indexOf("...")&&"Far"===s?r+e.width/2-l.width/2:"Near"===s?r:"Far"===s?e.width+r:r+e.width/2-l.width/2,h="Far"===s&&-1===i.indexOf("...")?"end":"start",new F(p.element.id+"_legendTitle",new V(r,n+a,h,i,0,"translate(0,0)",void 0),t.textStyle,t.textStyle.color||p.themeStyle.heatMapTitle)):(a=-(a+l.height/4),0!==i.length&&p.enableCanvasRendering&&this.legendTitleTooltip.push(new E(t.text,new z(e.x,e.y-l.height,o,l.height))),new F(p.element.id+"_legendTitle",new V(e.x,e.y+a,"start",i,0,"translate(0,0)",void 0),t.textStyle,t.textStyle.color||p.themeStyle.heatMapTitle)),this.drawSvgCanvas.createText(d,this.legend,i))},M.prototype.renderSmartLegend=function(){var e,t,i,l,a=this.heatMap,n=a.colorCollection,o={color:"transparent",width:0},s=this.legendRectScale,r=s.width/n.length,h=s.height/n.length;this.legendRectPositionCollection=[],this.legendRange=[];for(var d=0;d<a.legendColorCollection.length;d++){var p=new xt(0,0,0,0,"",""),g=(a.horizontalGradient?(e=s.x+d*r,t=s.y,i=r,l=s.height,this.segmentCollections.push("Edge"!==a.legendSettings.labelDisplayType||d!==a.legendColorCollection.length-1||a.legendColorCollection[d].isHidden?e:e+r)):(e=s.x,t=s.y+d*h,i=s.width,l=h,this.segmentCollections.push("Edge"!==a.legendSettings.labelDisplayType||d!==a.legendColorCollection.length-1||a.legendColorCollection[d].isHidden?t:t+h)),this.heatMap.renderer.createGroup({id:a.element.id+"_Smart_Legend_Group_"+d})),c=this.heatMap.legendSettings.toggleVisibility?0:-1,u=(g.setAttribute("tabindex",c.toString()),g.style.outline="none",c=new z(e,t,i,l),new bt(0,0,0,0,0,!0,0));u.x=e,u.y=t,u.width=i,u.height=l,u.value=this.heatMap.isColorRange?a.legendColorCollection[d].endValue:a.legendColorCollection[d].value,u.currentPage=this.currentPage,n.length!==a.legendColorCollection.length&&d===a.legendColorCollection.length-1&&(a.horizontalGradient?u.width=0:u.height=0,this.visibilityCollections[d]=this.visibilityCollections[d-1]),u.visible=!!P.isNullOrUndefined(this.visibilityCollections[d])||this.visibilityCollections[d],this.legendRange.push(u),a.legendColorCollection[d].isHidden||(u=a.legendOnLoad||this.legendRange[d].visible?this.heatMap.isColorRange?n[d].minColor:n[d].color:this.heatMap.themeStyle.toggledColor||"#D3D3D3",u=new b(a.element.id+"_Smart_Legend"+d,u,o,1,c),this.drawSvgCanvas.drawRectangle(u,g),this.legend.appendChild(g),p.x=e,p.y=t,p.width=i,p.height=l,p.label=this.labelCollections[d],p.id=a.element.id+"_Smart_Legend"+d,this.legendRectPositionCollection.push(p),0!==lt(this.labelCollections[d],a.legendSettings.textStyle,this.textWrapCollections[d]).length&&a.enableCanvasRendering&&(c=D(this.labelCollections[d],a.legendSettings.textStyle),this.legendLabelTooltip.push(new E(this.labelCollections[d],new z(p.x,p.y,c.width,c.height)))))}},M.prototype.colorRangeLegendPosition=function(e,t){if(this.segmentCollections.length!==this.segmentCollectionsLabels.length){for(var i=0;i<this.segmentCollections.length;i++)if(this.segmentCollectionsLabels[e]===this.segmentCollections[i]){t=this.segmentCollectionsLabels[e]+((i===this.segmentCollections.length-1?this.heatMap.horizontalGradient?this.width:this.height:this.segmentCollections[i+1])-this.segmentCollections[i])/2;break}}else t=this.segmentCollectionsLabels[e]+((e===this.segmentCollectionsLabels.length-1?this.heatMap.horizontalGradient?this.width:this.height:this.segmentCollectionsLabels[e+1])-this.segmentCollectionsLabels[e])/2;this.labelPosition=t},M.prototype.renderLegendLabel=function(e){var t=this.heatMap;if(this.legendTextRange=[],t.legendSettings.showLabel&&("Gradient"===t.paletteSettings.type||"Fixed"===t.paletteSettings.type&&"None"!==t.legendSettings.labelDisplayType)){for(var i,l,a="start",n=void 0,o=void 0,s=void 0,r=(this.legendLabelTooltip=[],t.isColorRange),h=t.legendColorCollection,d=(t.enableCanvasRendering?((i=t.canvasRenderer.ctx).rect(this.legendGroup.x,this.legendGroup.y,this.legendGroup.width,this.legendGroup.height),i.save(),i.clip(),i.restore()):o=t.renderer.createGroup({id:t.element.id+"_Heatmap_LegendLabel"}),void 0),p=void 0,g=0;g<h.length;g++){var c,u,m=(h[g].value-Math.round(100*this.legendMinValue)/100)/(Math.round(100*this.legendMaxValue)/100-Math.round(100*this.legendMinValue)/100)*100,y=h[g].isHidden?g-1:g,y=this.legend.querySelector("#"+t.element.id+"_Smart_Legend_Group_"+y),n=t.horizontalGradient?(d=this.heatMap.isColorRange&&"Gradient"===t.paletteSettings.type?(this.colorRangeLegendPosition(g,d),this.labelPosition):this.heatMap.legendSettings.enableSmartLegend&&this.heatMap.isColorRange&&"Fixed"===t.paletteSettings.type?this.segmentCollections[g]+e.width/h.length/2:this.segmentCollections[g],p=e.y+e.height+this.labelPadding,a=Math.round(100*m)/100==0&&!r||"Fixed"===t.paletteSettings.type&&0===g?"start":Math.round(100*m)/100==100&&"Gradient"===t.paletteSettings.type&&!r||Math.round(100*t.dataSourceMaxValue)/100===h[g].value&&t.legendSettings.enableSmartLegend||t.legendSettings.enableSmartLegend&&"Fixed"===t.paletteSettings.type&&"Edge"===t.legendSettings.labelDisplayType?"end":"middle","hanging"):(d=e.x+e.width+this.labelPadding,p=this.heatMap.isColorRange&&"Gradient"===t.paletteSettings.type?(this.colorRangeLegendPosition(g,p),this.labelPosition):this.heatMap.legendSettings.enableSmartLegend&&this.heatMap.isColorRange&&"Fixed"===t.paletteSettings.type?this.segmentCollections[g]+e.height/h.length/2:this.segmentCollections[g],Math.round(100*m)/100==0&&!r||0===g&&"Fixed"===t.paletteSettings.type?"hanging":Math.round(100*m)/100==100&&!r&&"Gradient"===t.paletteSettings.type||Math.round(100*t.dataSourceMaxValue)/100===h[g].value&&t.legendSettings.enableSmartLegend||t.legendSettings.enableSmartLegend&&"Edge"===t.legendSettings.labelDisplayType&&"Fixed"===t.paletteSettings.type?"auto":"middle"),m=t.horizontalGradient?("None"===t.legendSettings.textStyle.textOverflow?this.segmentCollections:this.textWrapCollections)[g]:this.width-(this.legendRectScale.width+this.labelPadding+this.legendRectPadding),m=D((s=lt(this.labelCollections[g],t.legendSettings.textStyle,m))[0],t.legendSettings.textStyle);if("Fixed"===t.paletteSettings.type&&(c="hanging"===n?p:"middle"===n?p-m.height/2:p-m.height,u="end"===a?d-m.width:"middle"===a?d-m.width/2:d,(u=new bt(u,c,m.width,m.height,h[g].value,!0,this.currentPage)).visible=!!P.isNullOrUndefined(this.visibilityCollections[g])||this.visibilityCollections[g],this.legendTextRange.push(u)),""!==this.labelCollections[g]&&(0!==s.length&&-1!==s[0].indexOf("...")&&t.enableCanvasRendering&&this.legendLabelTooltip.push(new E(this.labelCollections[g],new z(d,p,m.width,m.height))),s=at(s,this.heatMap.enableHtmlSanitizer),c=new V(d,p,a,s,0,"translate(0,0)",n),(u=new F(t.element.id+"_Legend_Label"+g,c,t.legendSettings.textStyle,t.legendSettings.textStyle.color||t.themeStyle.legendLabel)).fill=t.legendOnLoad||"Fixed"!==t.paletteSettings.type||this.legendRange[g].visible?u.fill:"#D3D3D3",m="Fixed"===t.paletteSettings.type?y:o,1<s.length?this.drawSvgCanvas.createWrapText(u,t.legendSettings.textStyle,o):this.drawSvgCanvas.createText(u,m,s[0]),P.Browser.isIE)&&!t.enableCanvasRendering&&("middle"===n?m.lastChild.setAttribute("dy","0.6ex"):"hanging"===n&&m.lastChild.setAttribute("dy","1.5ex")),this.legendMaxValue===this.legendMinValue&&"Gradient"===t.paletteSettings.type)break}t.enableCanvasRendering||(this.legendGroup.height=0<this.legendGroup.height?this.legendGroup.height:0,this.legendGroup.width=0<this.legendGroup.width?this.legendGroup.width:0,"Gradient"===t.paletteSettings.type&&this.legend.appendChild(o),i=t.renderer.createClipPath({id:t.element.id+"_clipPath"}),l=t.renderer.drawRectangle(this.legendGroup),i.appendChild(l),t.svgObject.appendChild(i),this.legend.style.cssText="clip-path:url(#"+i.id+")")}},M.prototype.renderGradientPointer=function(e,t,i){var l,a,n,o,s,r,h,d=this.heatMap,t=d.heatMapSeries.getCurrentRect(t,i),i=d.bubbleSizeWithColor?""!==t.value[0].bubbleData.toString()?(this.heatMap.isColorValueExist?t.value[1]:t.value[0]).bubbleData.toString():"":t.value.toString(),t=this.legendRectScale;""!==i.toString()?(d.horizontalGradient?(l=t.width/100*((Number(i)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue))*100,l=isNaN(l)?0:l,a=t.x+l,n=t.y+t.height,o=t.x-5+l,s=h=t.y+t.height+8,r=t.x+5+l):(l=t.height/100*((Number(i)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue))*100,l=isNaN(l)?0:l,a=t.x-1,n=t.y+l,o=r=t.x-8,s=t.y-5+l,h=t.y+5+l),i=new g(d.element.id+"_Gradient_Pointer","gray",.01,"#A0A0A0",1,"0,0","M "+a+" "+n+" L "+o+" "+s+" L "+r+" "+h+" Z"),d.enableCanvasRendering?(this.removeGradientPointer(),d.canvasRenderer.drawPath(i,void 0),P.isNullOrUndefined(this.previousOptions)||(this.previousOptions.pathX1=a,this.previousOptions.pathY1=n,this.previousOptions.pathX2=o,this.previousOptions.pathY2=s,this.previousOptions.pathX3=r,this.previousOptions.pathY3=h)):(this.gradientPointer=d.renderer.drawPath(i),this.gradientPointer.style.visibility="visible",this.legend.appendChild(this.gradientPointer))):this.removeGradientPointer()},M.prototype.removeGradientPointer=function(){var e=this.heatMap;P.isNullOrUndefined(e)||(this.gradientPointer&&!e.enableCanvasRendering?this.gradientPointer.style.visibility="hidden":e.enableCanvasRendering&&(P.isNullOrUndefined(this.fillRect)||P.isNullOrUndefined(this.previousOptions)||0===Object.keys(this.previousOptions).length||(e.horizontalGradient?(this.fillRect.x=this.previousOptions.pathX2-1,this.fillRect.y=this.previousOptions.pathY1,this.fillRect.width=this.previousOptions.pathX3-this.previousOptions.pathX2+2,this.fillRect.height=this.previousOptions.pathY2+1-this.previousOptions.pathY1):(this.fillRect.x=this.previousOptions.pathX2-1,this.fillRect.y=this.previousOptions.pathY2-1,this.fillRect.width=this.previousOptions.pathX1-this.previousOptions.pathX2+1,this.fillRect.height=this.previousOptions.pathY3-this.previousOptions.pathY2+2)),e.canvasRenderer.ctx.fillStyle=e.themeStyle.background,P.isNullOrUndefined(this.fillRect)||e.canvasRenderer.ctx.clearRect(this.fillRect.x,this.fillRect.y,this.fillRect.width,this.fillRect.height)))},M.prototype.calculateLegendBounds=function(e){var t=this.heatMap,i=t.legendSettings,l=(this.labelCollection=[],this.labelCollections=[],t.legendColorCollection),a=("Bottom"!==i.position&&"Top"!==i.position&&"Right"!==i.position&&"Left"!==i.position&&(i.position="Right"),t.legendSettings.title),a=D(this.heatMap.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(a.text):a.text,a.textStyle),n=(t.horizontalGradient="Bottom"===i.position||"Top"===i.position,this.legendRectPadding=t.horizontalGradient?t.legendSettings.title.text?a.height+16:16:10,this.labelPadding=i.showLabel?this.heatMap.horizontalGradient?10:6:0,this.legendHeight=i.height,this.legendWidth=i.width,t.legendSettings.labelFormat),o=null!==n.match("{value}");if(this.format=t.intl.getNumberFormat({format:o?"":n}),"Fixed"===t.paletteSettings.type)for(var s=0;s<l.length;s++){var r={cancel:!1,text:h=l[s].label||(this.heatMap.isColorRange?l[s].startValue.toString()+"-"+l[s].endValue.toString():wt(o,n,l[s].value,this.format).toString()),name:"legendRender"};this.labelCollection.push(h),this.heatMap.trigger("legendRender",r),t.legendRender?t.legendSettings.enableSmartLegend&&"Edge"===t.legendSettings.labelDisplayType&&0<s&&s<l.length-1||r.cancel?this.labelCollections.push(""):this.labelCollections.push(r.text):t.legendSettings.enableSmartLegend&&"Edge"===t.legendSettings.labelDisplayType&&0<s&&s<l.length-1?this.labelCollections.push(""):this.labelCollections.push(h)}else for(s=0;s<l.length;s++){var h,r={cancel:!1,text:h=l[s].isHidden?"":l[s].label||(this.heatMap.isColorRange?l[s].startValue.toString()+"-"+l[s].endValue.toString():wt(o,n,l[s].value,this.format).toString()),name:"legendRender"};l[s].isHidden||this.heatMap.trigger("legendRender",r),t.legendRender?r.cancel||0<s&&s<l.length-1&&"Edge"===t.legendSettings.labelDisplayType||r.cancel?this.labelCollections.push(""):this.labelCollections.push(r.text):0<s&&s<l.length-1&&"Edge"===t.legendSettings.labelDisplayType?this.labelCollections.push(""):this.labelCollections.push(h)}"Gradient"===t.paletteSettings.type||"Fixed"===t.paletteSettings.type&&t.legendSettings.enableSmartLegend?(this.maxLegendLabelSize=this.getMaxLabelSize(),t.horizontalGradient&&""===i.height?this.legendHeight=(2*this.legendRectPadding+this.legendSize+this.maxLegendLabelSize.height).toString():!t.horizontalGradient&&""===i.width&&("None"===i.textStyle.textOverflow||"Fixed"===t.paletteSettings.type&&t.legendSettings.enableSmartLegend&&"None"===t.legendSettings.labelDisplayType)&&(this.legendWidth=(2*this.legendRectPadding+this.legendSize+this.maxLegendLabelSize.width).toString()),this.calculateTitleBounds()):this.calculateListLegendBounds(e),this.legendHeight=this.legendHeight||(t.horizontalGradient?"50":"100%"),this.legendWidth=this.legendWidth||(t.horizontalGradient?"100%":"Fixed"!==t.paletteSettings.type||t.legendSettings.enableSmartLegend?"50":"70"),this.height=p(this.legendHeight,e.height),this.width=p(this.legendWidth,e.width),t.horizontalGradient?(this.height=("Gradient"===t.paletteSettings.type||t.legendSettings.enableSmartLegend)&&this.height<50?50:this.height,"Top"===i.position&&(e.y+=this.height),e.height-=this.height):(this.width=("Gradient"===t.paletteSettings.type||t.legendSettings.enableSmartLegend)&&this.width<50?50:this.width,"Left"===i.position&&(e.x+=this.width),e.width-=this.width)},M.prototype.calculateTitleBounds=function(){var e=this.heatMap,t=e.legendSettings.title,t=D(this.heatMap.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(t.text):t.text,t.textStyle);e.legendSettings.title.text&&("Top"!==e.legendSettings.position&&"Bottom"!==e.legendSettings.position||""!==e.legendSettings.height||(this.legendHeight=(2*this.legendRectPadding-t.height+this.legendSize+this.maxLegendLabelSize.height).toString()),""===e.legendSettings.width)&&("None"===e.legendSettings.textStyle.textOverflow||"Fixed"===e.paletteSettings.type&&e.legendSettings.enableSmartLegend&&"None"===e.legendSettings.labelDisplayType)&&("Right"===e.legendSettings.position?this.legendWidth=(2*this.legendRectPadding+t.width+this.legendSize+this.maxLegendLabelSize.width).toString():"Left"===e.legendSettings.position&&(t.width=(t.width>this.maxLegendLabelSize.width?t:this.maxLegendLabelSize).width,this.legendWidth=(2*this.legendRectPadding+t.width+this.legendSize).toString()))},M.prototype.calculateListLegendBounds=function(e){var t=this.heatMap,i=(this.listWidth=0,this.listHeight=0,this.currentPage=1,t.legendSettings.title),i=D(this.heatMap.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(i.text):i.text,i.textStyle),l=(i.height+50).toString();if(t.horizontalGradient){for(var a=0;a<t.colorCollection.length;a++){var n=0,o=(t.legendSettings.showLabel&&(o=this.labelCollections[a],n=D(this.heatMap.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(o):o,t.legendSettings.textStyle).width),this.legendSize+this.labelPadding+n+this.listInterval);this.listWidth+=o}this.listWidth+=this.listInterval+10,""===this.legendWidth&&(this.legendWidth=(this.listWidth>e.width?e.width:this.listWidth).toString()),""===this.legendHeight&&(this.numberOfRows=Math.ceil(this.listWidth/p(this.legendWidth,e.width)),this.numberOfRows=3<this.numberOfRows?3:this.numberOfRows,this.legendHeight=((this.listWidth>e.width||this.listWidth>p(this.legendWidth,e.width))&&3<this.numberOfRows?(this.legendSize+this.listInterval)*this.numberOfRows+this.legendRectPadding+parseInt(t.legendSettings.textStyle.size,10)+10:(this.legendSize+this.listInterval)*this.numberOfRows+this.legendRectPadding).toString())}else this.listHeight=(this.legendSize+this.listInterval)*t.colorCollection.length+this.listInterval+(t.legendSettings.title.text?i.height:0),""===this.legendHeight&&(this.legendHeight=(this.listHeight>e.height?e.height:this.listHeight).toString()),""===this.legendWidth&&"Trim"!==t.legendSettings.textStyle.textOverflow&&(this.maxLegendLabelSize=this.getMaxLabelSize(),this.maxLegendLabelSize.width=(i.width>this.maxLegendLabelSize.width?i:this.maxLegendLabelSize).width,this.legendWidth=(2*this.legendRectPadding+this.legendSize+this.labelPadding+this.maxLegendLabelSize.width).toString());p(this.legendHeight,e.height)<50&&(this.legendHeight=l),p(this.legendWidth,e.width)<70&&(this.legendWidth="70")},M.prototype.getMaxLabelSize=function(){var e=this.heatMap;if(this.maxLegendLabelSize=new A(0,0),!e.legendSettings.showLabel||e.horizontalGradient&&"Fixed"===e.paletteSettings.type&&!e.legendSettings.enableSmartLegend||"Fixed"===e.paletteSettings.type&&"None"===e.legendSettings.labelDisplayType)return this.maxLegendLabelSize;for(var t=this.maxLegendLabelSize,i=0;i<e.legendColorCollection.length;i++){var l=D(e.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(this.labelCollections[i]):this.labelCollections[i],e.legendSettings.textStyle);t.width=(t.width>l.width?t:l).width,t.height=(t.height>l.height?t:l).height}return t},M.prototype.calculateLegendSize=function(e,t){var i,l,a=this.heatMap,n=a.legendSettings,o=n.alignment,s=p(this.legendHeight,e.height),r=a.legendSettings.title.text?this.width:p(this.legendWidth,e.width),h=a.axisCollections,d=0;a.horizontalGradient?(r=r>e.width?e.width:r,s="Gradient"===a.paletteSettings.type||a.legendSettings.enableSmartLegend?50<s?s:50:this.height,l="Near"===o?e.x:"Far"===o?e.x+e.width-r:e.x+e.width/2-r/2,""!==a.xAxis.title.text&&(d=D(a.xAxis.title.text,a.xAxis.textStyle).height+10),i=h[0].opposedPosition?0:c(h[0].xAxisMultiLabelHeight)+h[0].maxLabelSize.height+d+10,i="Top"===n.position?a.titleSettings.text?t:a.margin.top:e.y+e.height+i):(s=s>e.height?e.height:s,r="Gradient"!==a.paletteSettings.type&&!a.legendSettings.enableSmartLegend||50<r?r:50,i="Near"===o?e.y:"Far"===o?e.y+e.height-s:e.y+e.height/2-s/2,""!==a.yAxis.title.text&&(d=D(a.yAxis.title.text,a.yAxis.textStyle).height+10),t=h[1].opposedPosition?c(h[1].yAxisMultiLabelHeight)+h[1].maxLabelSize.width+d+20:0,l="Right"===n.position?e.x+e.width+t:a.margin.left),this.legendGroup=new z(l,i,r,s),this.calculateGradientScale(this.legendGroup)},M.prototype.measureListLegendBound=function(e){var t,i=this.heatMap,l=i.legendSettings.title,l=(this.numberOfPages=1,D(i.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(l.text):l.text,l.textStyle));i.horizontalGradient?this.listWidth>this.width?(this.numberOfRows=Math.ceil(this.listWidth/this.width),this.listHeight=(this.legendSize+this.listInterval)*this.numberOfRows,this.listPerPage=this.numberOfRows<=3?this.numberOfRows:Math.ceil((this.height-15-parseInt(i.legendSettings.textStyle.size,10)-this.legendRectPadding)/(this.legendSize+this.listInterval)),this.numberOfPages=Math.ceil(this.numberOfRows/this.listPerPage)):this.listPerPage=1:this.listHeight>e.height||this.listHeight>this.height?(t=(t=p(this.legendHeight,e.height))>e.height?e.height:t,t=i.legendSettings.title.text?t-l.height:t,this.listPerPage=Math.floor(t/(this.legendSize+this.listInterval)-1),this.numberOfPages=Math.max(1,Math.ceil(i.colorCollection.length/this.listPerPage))):(this.listPerPage=i.colorCollection.length,this.legendHeight=this.listHeight.toString())},M.prototype.renderPagingElements=function(){var e,t,i,l,a,n,o=this.heatMap;1<this.numberOfPages&&(this.navigationCollections=[],this.legend.appendChild(this.paginggroup),a=this.legendGroup.x+this.legendGroup.width-10,l=this.legendGroup.y+this.legendGroup.height-10,t=a-(n=D(e=this.currentPage+"/"+this.numberOfPages,o.legendSettings.textStyle)).width-15,i=new V(t,l,"start",e,0,"translate(0,0)","middle"),i=new F(o.element.id+"_paging",i,o.legendSettings.textStyle,o.legendSettings.textStyle.color||o.themeStyle.legendLabel),this.drawSvgCanvas.createText(i,this.paginggroup,e),P.Browser.isIE&&!o.enableCanvasRendering&&this.paginggroup.lastChild.setAttribute("dy","0.6ex"),this.pagingRect=new z(t,l-n.height/2,n.width,n.height),i=new b(o.element.id+"_pagingText","none",{color:"transparent",width:0},1,this.pagingRect),this.drawSvgCanvas.drawRectangle(i,this.paginggroup),e=new b(o.element.id+"_rightArrow","none",{color:"transparent",width:0},1,new z(a-10,l-5,10,10)),this.drawSvgCanvas.drawRectangle(e,this.paginggroup),n="M "+a+" "+l+" L "+(a-10)+" "+(l-5)+" L "+(a-10)+" "+(5+l)+"Z",a="M "+(i=t-15)+" "+l+" L "+(10+i)+" "+(l-5)+" L "+(10+i)+" "+(5+l)+"Z",t=new b(o.element.id+"_leftArrow","none",{color:"transparent",width:0},1,new z(5+i,l-5,10,10)),this.drawSvgCanvas.drawRectangle(t,this.paginggroup),i=new g(o.element.id+"_Legend_leftarrow","gray",.01,"#A0A0A0",1,"0,0",a),l=new g(o.element.id+"_Legend_rightarrow","gray",.01,"#A0A0A0",1,"0,0",n),this.navigationCollections.push(e),this.navigationCollections.push(t),o.enableCanvasRendering?(o.canvasRenderer.clearRect(t),o.canvasRenderer.clearRect(e),o.canvasRenderer.drawPath(i,void 0),o.canvasRenderer.drawPath(l,void 0)):((a=o.renderer.drawPath(i)).setAttribute("tabindex","0"),a.style.outline="none",(n=o.renderer.drawPath(l)).setAttribute("tabindex","0"),n.style.outline="none",this.paginggroup.appendChild(a),this.paginggroup.appendChild(n)))},M.prototype.calculateGradientScale=function(e){var t,i,l,a=this.heatMap,n=a.legendSettings.title,n=D(a.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(n.text):n.text,n.textStyle),n=a.legendSettings.title.text?n.height:0;"Fixed"!==a.paletteSettings.type||a.legendSettings.enableSmartLegend||this.measureListLegendBound(a.initialClipRect),e=a.horizontalGradient?(t=e.x+10,i=e.y+this.legendRectPadding,l="Fixed"!==a.paletteSettings.type||a.legendSettings.enableSmartLegend?e.width-20:e.width-2*this.listInterval,"Fixed"!==a.paletteSettings.type||a.legendSettings.enableSmartLegend?this.gradientScaleSize:(this.legendSize+this.listInterval)*this.listPerPage-this.listInterval):(t=e.x+this.legendRectPadding,i=e.y+10+n,l="Fixed"!==a.paletteSettings.type||a.legendSettings.enableSmartLegend?this.gradientScaleSize:e.width-10,"Fixed"!==a.paletteSettings.type||a.legendSettings.enableSmartLegend?e.height-20-n:(this.legendSize+this.listInterval)*this.listPerPage-this.listInterval),this.legendRectScale=new z(t,i,l,e),("Gradient"===a.paletteSettings.type||"Fixed"===a.paletteSettings.type&&a.legendSettings.enableSmartLegend)&&this.calculateColorAxisGrid(this.legendRectScale)},M.prototype.calculateColorAxisGrid=function(e){var t,i,l,a=this.heatMap,n=this.legendRectScale,o=0,s=(this.segmentCollectionsLabels=[],this.segmentCollections=[],this.textWrapCollections=[],"Gradient"===a.paletteSettings.type?a.legendColorCollection:a.colorCollection),r=a.bubbleSizeWithColor?a.minColorValue:a.dataSourceMinValue,h=a.bubbleSizeWithColor?a.maxColorValue:a.dataSourceMaxValue;if(this.legendMinValue=this.heatMap.isColorRange?s[0].startValue>a.dataSourceMinValue?a.dataSourceMinValue:s[0].startValue:s[0].value>r?r:s[0].value,this.legendMaxValue=this.heatMap.isColorRange?s[s.length-1].endValue<a.dataSourceMaxValue?a.dataSourceMaxValue:s[s.length-1].endValue:s[s.length-1].value<h?h:s[s.length-1].value,"Gradient"===a.paletteSettings.type)for(var d=0;d<s.length;d++){var p=void 0,g=(this.heatMap.isColorRange&&a.horizontalGradient?n.width:n.height)/100;this.heatMap.isColorRange?(s[0].startValue!==this.heatMap.dataSourceMinValue&&0===d&&s[0].startValue>this.heatMap.dataSourceMinValue&&(p=(this.heatMap.dataSourceMinValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,l=(a.horizontalGradient?e.x:e.y)+g*p,this.segmentCollections.push(l)),p=((s[d].startValue<a.dataSourceMinValue&&s[d].endValue>a.dataSourceMaxValue?a.dataSourceMinValue:s[d].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,p=isNaN(p)?0:p,l=(a.horizontalGradient?e.x:e.y)+g*p,this.segmentCollections.push(l),this.segmentCollectionsLabels.push(l),s[d].endValue!==(d===s.length-1?this.heatMap.dataSourceMaxValue:s[d+1].startValue)&&this.heatMap.legendColorCollection[d].endValue<this.heatMap.dataSourceMaxValue&&(d===s.length-1&&(p=(s[d].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,l=(a.horizontalGradient?e.x:e.y)+g*p,this.segmentCollections.push(l)),p=((d===s.length-1?this.heatMap.dataSourceMaxValue:s[d].endValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,l=(a.horizontalGradient?e.x:e.y)+g*p,this.segmentCollections.push(l))):(p=(s[d].value-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,p=isNaN(p)?0:p,a.horizontalGradient?(g=n.width/100,i=e.x+g*p,this.segmentCollections.push(i)):(g=n.height/100,l=e.y+g*p,this.segmentCollections.push(l)))}if(a.horizontalGradient){for(var c,u,m=this.heatMap.isColorRange?this.segmentCollectionsLabels:this.segmentCollections,y=0;y<s.length;y++)c="Gradient"===a.paletteSettings.type?(u=(m[y]-m[y-1])/2,c=(m[y+1]-m[y])/2,y===s.length-1?this.heatMap.isColorRange?(e.width-m[y-1])/2:u:0!==y&&u<c&&!this.heatMap.isColorRange?u:c):(u=this.legendRectScale.width/a.colorCollection.length,"Edge"===a.legendSettings.labelDisplayType?u:u/2),this.textWrapCollections.push(c),o=(t=lt(this.labelCollections[y],a.legendSettings.textStyle,c)).length>o?t.length:o;"Bottom"===a.legendSettings.position?(a.initialClipRect.height-=this.maxLegendLabelSize.height*(o-1),this.legendGroup.y-=this.maxLegendLabelSize.height*(o-1)):(a.initialClipRect.y+=this.maxLegendLabelSize.height*(o-1),a.initialClipRect.height-=this.maxLegendLabelSize.height*(o-1)),this.legendRectScale.y=this.legendGroup.y+this.legendRectPadding,this.legendGroup.height=parseInt(this.legendHeight,10)+this.maxLegendLabelSize.height*(o-1)}},M.prototype.renderColorAxisGrid=function(e){var t,i,l,a,n,o=this.heatMap;o.enableCanvasRendering||(t=this.heatMap.renderer.createGroup({id:o.element.id+"_ColorAxis_Grid"}));for(var s=0;s<(o.isColorRange?this.segmentCollections:o.legendColorCollection).length;s++){o.horizontalGradient?(i=a=this.segmentCollections[s],l=e.y,n=e.y+e.height):(i=e.x,l=n=this.segmentCollections[s],a=e.x+e.width);var r=new Xe(i,l,a,n),r=new Je(this.heatMap.element.id+"_ColorAxis_Grid"+s,r,"#EEEEEE",1);this.drawSvgCanvas.drawLine(r,t),o.enableCanvasRendering||this.legend.appendChild(t)}},M.prototype.renderLegendTitleTooltip=function(e,t,i){-1!==e.target.id.indexOf("_legendTitle")&&-1<e.target.textContent.indexOf("...")?(dt(this.heatMap.legendSettings.title.text,t,i,this.heatMap.element.offsetWidth,this.heatMap.element.id+"_legendTitle_Tooltip",gt(this.heatMap.element.id+"_Secondary_Element"),null,this.heatMap),document.getElementById(this.heatMap.element.id+"_legendTitle_Tooltip").style.visibility="visible"):C(this.heatMap.element.id+"_legendTitle_Tooltip")},M.prototype.renderLegendLabelTooltip=function(e,t,i){var l;-1!==e.target.id.indexOf("_Legend_Label")&&-1<e.target.textContent.indexOf("...")?2===(e=e.target.id.split(this.heatMap.element.id+"_Legend_Label")).length&&(l=void 0,l=1===e[1].length||"Trim"===this.heatMap.legendSettings.textStyle.textOverflow?parseInt(e[1],10):parseInt(e[1].substring(0,e[1].length-1),10),dt(this.labelCollections[l],t,i,this.heatMap.element.offsetWidth,this.heatMap.element.id+"_LegendLabel_Tooltip",gt(this.heatMap.element.id+"_Secondary_Element"),null,this.heatMap),document.getElementById(this.heatMap.element.id+"_LegendLabel_Tooltip").style.visibility="visible"):C(this.heatMap.element.id+"_LegendLabel_Tooltip")},M.prototype.calculateListPerPage=function(e){var t=this.heatMap;if(t.horizontalGradient){this.lastList=[];var i=e.x,l=e.y,a=0,n=0,o=0,s=0,r=void 0;for(this.labelXCollections=[],this.labelYCollections=[],this.legendXCollections=[],this.legendYCollections=[],r=0;r<t.colorCollection.length;r++){t.legendSettings.showLabel&&(h=this.labelCollections[r],a=D(t.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(h):h,t.legendSettings.textStyle).width),o=i+10+5,s=l+5;var h=t.legendSettings.showLabel?o+a:i+this.legendSize+this.listInterval;0!==r&&h>this.legendGroup.width+this.legendGroup.x-this.listInterval&&(n+=1,o=(i=e.x)+10+5,s=(l=e.y+20*n)+5,n%this.listPerPage==0)&&(this.lastList.push(r),s=(l=e.y)+5,n=0),this.labelXCollections.push(o),this.labelYCollections.push(s),this.legendXCollections.push(i),this.legendYCollections.push(l),i=i+this.legendSize+this.labelPadding+a+this.listInterval}this.lastList.push(r),this.numberOfPages=this.lastList.length}},M.prototype.renderListLegendMode=function(e,t){for(var i,l=this.heatMap,a={color:"transparent",width:0},n=(this.legendLabelTooltip=[],new A(0,0)),o=0,s=0,r=e.x,h=e.y,d=(t&&this.renderPagingElements(),l.legendSettings.title.text?this.width-2*(this.legendSize+this.labelPadding):this.legendGroup.width-(this.legendSize+this.legendRectPadding+this.labelPadding)),p=l.horizontalGradient?(i=1===this.currentPage?0:this.lastList[this.currentPage-2],this.lastList[this.currentPage-1]):(p=(i=this.currentPage*this.listPerPage-this.listPerPage)+this.listPerPage)<l.colorCollection.length?p:l.colorCollection.length,g=i;g<p;g++){l.legendSettings.showLabel&&(m=this.labelCollections[g],n=D(this.heatMap.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(m):m,l.legendSettings.textStyle));var c,u,m,y=this.heatMap.renderer.createGroup({id:l.element.id+"_Legend_Index_"+g}),x={cancel:!1,text:this.labelCollection[g],name:"legendRender"},x=(l.horizontalGradient&&(r=this.legendXCollections[g],h=this.legendYCollections[g],o=this.labelXCollections[g],s=this.labelYCollections[g]),o=r+this.legendSize+this.labelPadding,s=h+5,this.heatMap.trigger("legendRender",x),t&&l.rendering&&this.legendRange.length<l.colorCollection.length&&((u=new bt(r,h,10,10,l.colorCollection[g].value,!0,this.currentPage)).visible=!!P.isNullOrUndefined(this.visibilityCollections[g])||this.visibilityCollections[g],x.cancel?(c=new bt(r,h,0,0,l.colorCollection[g].value,!0,this.currentPage),this.legendRange.push(c)):this.legendRange.push(u),l.legendSettings.showLabel)&&((c=new bt(o,s-n.height/2,n.width,n.height,l.colorCollection[g].value,!0,this.currentPage)).visible=!!P.isNullOrUndefined(this.visibilityCollections[g])||this.visibilityCollections[g],this.legendTextRange.push(c)),x.cancel||(u=new z(r,h,10,10),x=l.legendOnLoad||this.legendRange[g].visible?this.heatMap.isColorRange?l.colorCollection[g].minColor:l.colorCollection[g].color:"#D3D3D3",x=new b(l.element.id+"_legend_list"+g,x,a,1,u),this.drawSvgCanvas.drawRectangle(x,y),l.legendSettings.showLabel&&(-1!==(m=lt(this.labelCollections[g],l.legendSettings.textStyle,d))[0].indexOf("...")&&l.enableCanvasRendering&&this.legendLabelTooltip.push(new E(this.labelCollections[g],new z(o,s,n.width,n.height))),x=new V(o,s,"start",m,0,"translate(0,0)","middle"),(x=new F(l.element.id+"_Legend_Label"+g,x,l.legendSettings.textStyle,l.legendSettings.textStyle.color||l.themeStyle.legendLabel)).fill=l.legendOnLoad||this.legendRange[g].visible?x.fill:"#D3D3D3",this.drawSvgCanvas.createText(x,y,m[0]),P.Browser.isIE)&&!l.enableCanvasRendering&&y.lastChild.setAttribute("dy","0.6ex"),l.horizontalGradient?r=r+this.legendSize+this.labelPadding+n.width+this.listInterval:h+=this.legendSize+this.listInterval),this.heatMap.legendSettings.toggleVisibility?0:-1);y.setAttribute("tabindex",x.toString()),y.style.outline="none",this.translategroup.appendChild(y)}l.enableCanvasRendering||(this.legendGroup.height=0<this.legendGroup.height?this.legendGroup.height:0,this.legendGroup.width=0<this.legendGroup.width?this.legendGroup.width:0,e=l.renderer.createClipPath({id:l.element.id+"_LegendScale_ClipPath"}),i=l.renderer.drawRectangle(this.legendGroup),e.appendChild(i),this.translategroup.appendChild(e),this.legend.style.cssText="clip-path:url(#"+e.id+")",this.legendScale.appendChild(this.translategroup),l.svgObject.appendChild(this.legend))},M.prototype.translatePage=function(e,t,i){var l,a,n,o;if(i&&1<=t&&t<this.numberOfPages||!i&&1<t&&t<=this.numberOfPages){if(i?(this.currentPage+=1,this.legendRect.y+=this.legendRect.height):(--this.currentPage,this.legendRect.y-=this.legendRect.height),e.enableCanvasRendering)for(var s=0,r=[e.canvasRenderer.ctx,e.secondaryCanvasRenderer.ctx];s<r.length;s++){var h=r[s];P.isNullOrUndefined(h)||(h.clearRect(this.legendRectScale.x-5,this.legendRectScale.y-5,this.legendRectScale.width+5,this.legendRectScale.height+10),h.clearRect(this.pagingRect.x,this.pagingRect.y,this.pagingRect.width,this.pagingRect.height))}else for(this.paginggroup.removeChild(this.paginggroup.firstChild);this.translategroup.childNodes.length;)this.translategroup.removeChild(this.translategroup.firstChild);this.renderListLegendMode(this.legendRectScale,!0)}e.enableCanvasRendering&&e.allowSelection&&e.rectSelected&&(t=e.secondaryCanvasRenderer.ctx,i=e.legendSettings.position,o=e.initialClipRect,l="Right"===i?o.x+o.width:0,a="Bottom"===i?o.y+o.height:0,n="Right"===i?e.availableSize.width-(o.x+o.width):"Left"===i?o.x:e.availableSize.width,i="Top"===i?o.y:"Bottom"===i?e.availableSize.height-(o.y+o.height):e.availableSize.height,t.save(),t.clearRect(l,a,n,i),t.restore(),o=document.getElementById(e.element.id+"_canvas"),t=document.getElementById(e.element.id+"_secondary_canvas"),e=o.getContext("2d").getImageData(l,a,n,i),t.getContext("2d").putImageData(e,l,a),o.style.opacity="0.3")},M.prototype.createTooltipDiv=function(){var e=P.createElement("div",{id:this.heatMap.element.id+"legendLabelTooltipContainer"});e.style.cssText="position: absolute; pointer-events: none;",this.heatMap.element.appendChild(e)},M.prototype.renderTooltip=function(e){var t=this.heatMap,i=[e.label],l=parseInt(t.legendSettings.textStyle.size,10)/2;this.tooltipObject=new O.Tooltip({offset:l,theme:t.theme,content:i,location:{x:e.x+e.width/2,y:e.y+e.height/2},inverted:!t.horizontalGradient,areaBounds:{height:this.legendGroup.height+this.legendGroup.y,width:this.legendGroup.width+this.legendGroup.x,x:"Right"===t.legendSettings.position?0:this.legendGroup.x,y:"Top"===t.legendSettings.position?""===t.titleSettings.text?this.legendGroup.height-this.legendGroup.y:this.legendGroup.y:0}},"#"+this.heatMap.element.id+"legendLabelTooltipContainer"),this.tooltipObject.element.style.visibility="visible"},M.prototype.createTooltip=function(e,t){for(var i,l=0;l<this.heatMap.colorCollection.length;l++){var a=this.legendRectPositionCollection[l];if(a&&e>a.x&&e<a.width+a.x&&t>a.y&&t<a.height+a.y){i=this.legendRectPositionCollection[l];break}}var n=document.getElementById(this.heatMap.element.id+"legendLabelTooltipContainer");n&&"visible"===n.style.visibility&&this.tooltipObject&&!this.heatMap.isTouch&&(this.tooltipObject.fadeOut(),n.style.visibility="hidden"),i&&this.renderTooltip(i)},M.prototype.legendRangeSelection=function(e){var t=this.heatMap,i=this.legendRange,l=t.horizontalGradient?10:0,a=this.legendRectScale,n=t.canvasRenderer.ctx,o=t.secondaryCanvasRenderer.ctx;if(t.rangeSelection=!0,t.enableCanvasRendering)t.legendSettings.enableSmartLegend?(P.isNullOrUndefined(n)||n.clearRect(a.x-5,a.y-5,a.width+this.labelPadding+this.maxLegendLabelSize.width+5,a.height+2*(5+l)),P.isNullOrUndefined(o)||o.clearRect(a.x-5,a.y-5,a.width+this.labelPadding+this.maxLegendLabelSize.width+5,a.height+2*(5+l))):(P.isNullOrUndefined(n)||n.clearRect(a.x-5,a.y-5,a.width+5,a.height+10),P.isNullOrUndefined(o)||o.clearRect(a.x-5,a.y-5,a.width+5,a.height+10));else{if(t.legendSettings.enableSmartLegend)for(;this.legend&&this.legend.childNodes.length;)this.legend.removeChild(this.legend.firstChild);else for(;this.translategroup&&this.translategroup.childNodes.length;)this.translategroup.removeChild(this.translategroup.firstChild);C(t.heatMapSeries.containerRectObject.id),t.cellSettings.showLabel&&C(t.heatMapSeries.containerTextObject.id)}t.legendSettings.enableSmartLegend&&t.colorCollection.length!==t.legendColorCollection.length&&(e===t.legendColorCollection.length-1?t.toggleValue[e-1].visible=this.visibilityCollections[e-1]=i[e-1].visible=!i[e].visible:e===t.colorCollection.length-1&&(t.toggleValue[e+1].visible=this.visibilityCollections[e+1]=i[e+1].visible=!i[e].visible)),t.toggleValue[e].visible=this.visibilityCollections[e]=i[e].visible=!i[e].visible,t.legendOnLoad=!1,t.legendSettings.enableSmartLegend?(this.renderSmartLegend(),l=new z(a.x,a.y,a.width,a.height),this.renderLegendLabel(l),t.enableCanvasRendering&&(n.save(),n.clip()),"SVG"===t.renderingMode&&this.renderTitle(l)):this.renderListLegendMode(this.legendRectScale,!1),t.enableCanvasRendering&&n.restore(),t.heatMapSeries.renderRectSeries(),t.clearSelection(),t.enableCanvasRendering&&t.allowSelection},M.prototype.updateLegendRangeCollections=function(){var e=this.heatMap;e.rangeSelection=!e.legendOnLoad,this.visibilityCollections=e.legendOnLoad?[]:this.visibilityCollections,e.toggleValue=e.legendOnLoad?[]:e.toggleValue,this.legendRange=e.legendOnLoad?[]:this.legendRange,this.legendTextRange=e.legendOnLoad?[]:this.legendTextRange};S=M;function M(e){this.maxLegendLabelSize=new A(0,0),this.gradientScaleSize=10,this.segmentCollections=[],this.segmentCollectionsLabels=[],this.textWrapCollections=[],this.labelCollections=[],this.labelCollection=[],this.legendSize=10,this.previousOptions=new yt(0,0,0,0,0,0),this.listPerPage=0,this.numberOfPages=1,this.listWidth=0,this.fillRect=new z(0,0,0,0),this.legendRect=new z(0,0,0,0),this.currentPage=1,this.lastList=[],this.navigationCollections=[],this.pagingRect=new z(0,0,0,0),this.listInterval=10,this.legendLabelTooltip=[],this.legendTitleTooltip=[],this.labelXCollections=[],this.labelYCollections=[],this.legendXCollections=[],this.legendYCollections=[],this.legendRectPositionCollection=[],this.legendRange=[],this.legendTextRange=[],this.visibilityCollections=[],this.heatMap=e,this.drawSvgCanvas=new it(e)}kt=function(e,t){return(kt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var kt,Gt,Ut=function(e,t){function i(){this.constructor=e}kt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Wt=function(e,t,i,l){var a,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;0<=s;s--)(a=e[s])&&(o=(n<3?a(o):3<n?a(t,i,o):a(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},Ut=(Gt=P.ChildProperty,Ut(jt,Gt),Wt([P.Property(!1)],jt.prototype,"isJsonData",void 0),Wt([P.Property("None")],jt.prototype,"adaptorType",void 0),Wt([P.Property("")],jt.prototype,"xDataMapping",void 0),Wt([P.Property("")],jt.prototype,"yDataMapping",void 0),Wt([P.Property("")],jt.prototype,"valueMapping",void 0),Wt([P.Complex({},$)],jt.prototype,"bubbleDataMapping",void 0),jt);function jt(){return null!==Gt&&Gt.apply(this,arguments)||this}var Yt=function(){},Wt=(w.prototype.constructDatasource=function(e,t){var i,l;"Cell"===t.adaptorType&&(i=this.heatMap.xAxis,l=this.heatMap.yAxis,this.adaptiveXMinMax.min=i.minimum,this.adaptiveXMinMax.max=i.maximum,this.adaptiveYMinMax.min=l.minimum,this.adaptiveYMinMax.max=l.maximum,("Numeric"!==i.valueType&&"DateTime"!==i.valueType||!P.isNullOrUndefined(i.minimum)&&!P.isNullOrUndefined(i.maximum))&&("Numeric"!==l.valueType&&"DateTime"!==l.valueType||!P.isNullOrUndefined(l.minimum)&&!P.isNullOrUndefined(l.maximum))||this.getMinMaxValue(e,t,i,l),this.heatMap.isCellData=!0),"None"!==t.adaptorType&&(t.isJsonData||"Table"!==t.adaptorType)?t.isJsonData&&"Table"===t.adaptorType?this.heatMap.completeAdaptDataSource=this.processJsonTableData(e,t):t.isJsonData&&"Cell"===t.adaptorType?this.heatMap.completeAdaptDataSource=this.processJsonCellData(e,t):t.isJsonData||"Cell"!==t.adaptorType||(this.constructAdaptiveAxis(),this.heatMap.completeAdaptDataSource=this.processCellData(e),this.heatMap.isCellData=!0):this.heatMap.completeAdaptDataSource=e},w.prototype.constructAdaptiveAxis=function(){var e=this.heatMap.xAxis,t=this.heatMap.yAxis;"Numeric"===e.valueType&&(this.reconstructedXAxis=this.getNumericAxisCollection(this.adaptiveXMinMax.min,this.adaptiveXMinMax.max,e.increment)),"Numeric"===t.valueType&&(this.reconstructedYAxis=this.getNumericAxisCollection(this.adaptiveYMinMax.min,this.adaptiveYMinMax.max,t.increment)),"DateTime"===e.valueType&&(this.reconstructedXAxis=this.getDateAxisCollection(this.adaptiveXMinMax.min,this.adaptiveXMinMax.max,e.intervalType,e.increment)),"DateTime"===t.valueType&&(this.reconstructedYAxis=this.getDateAxisCollection(this.adaptiveYMinMax.min,this.adaptiveYMinMax.max,t.intervalType,t.increment))},w.prototype.getNumericAxisCollection=function(e,t,i){for(var l=e,a=[];l<=t;)a.push(l.toString()),l+=i;return a},w.prototype.getDateAxisCollection=function(e,t,i,l){for(var a={skeleton:"full",type:"dateTime"},n=this.heatMap.intl.getDateParser(a),a=this.heatMap.intl.getDateFormat(a),o=e=Date.parse(n(a(new Date(_.DataUtil.parse.parseJson({val:e}).val)))),s=[];o<=t;)s.push(new Date(o).toString()),o=ct(o,1,i,l).getTime();return s},w.prototype.getMinMaxValue=function(e,t,i,l){var a=e,n=Object.keys(a[0]);0<a.length&&(this.adaptiveXMinMax.min=P.isNullOrUndefined(i.minimum)?t.isJsonData?a[0][n[0]]:a[0][0]:i.minimum,this.adaptiveYMinMax.min=P.isNullOrUndefined(l.minimum)?t.isJsonData?a[0][n[1]]:a[0][1]:l.minimum,this.adaptiveXMinMax.max=P.isNullOrUndefined(i.maximum)?t.isJsonData?a[0][n[0]]:a[0][0]:i.maximum,this.adaptiveYMinMax.max=P.isNullOrUndefined(l.maximum)?t.isJsonData?a[0][n[1]]:a[0][1]:l.maximum);for(var o=0;o<a.length;o++){var s=t.isJsonData?a[o][n[0]]:a[o][0],r=t.isJsonData?a[o][n[1]]:a[o][1];s<this.adaptiveXMinMax.min&&P.isNullOrUndefined(i.minimum)&&(this.adaptiveXMinMax.min=s),s>this.adaptiveXMinMax.max&&P.isNullOrUndefined(i.maximum)&&(this.adaptiveXMinMax.max=s),r<this.adaptiveYMinMax.min&&P.isNullOrUndefined(l.minimum)&&(this.adaptiveYMinMax.min=r),r>this.adaptiveYMinMax.max&&P.isNullOrUndefined(l.maximum)&&(this.adaptiveYMinMax.max=r)}},w.prototype.processCellData=function(e){var t=e,i=this.reconstructedXAxis,l=this.reconstructedYAxis,a=0,n=0;if(this.reconstructData=[],t&&t.length)for(var o=0;o<t.length;o++)if(-1<(a="Category"===this.heatMap.xAxis.valueType?t[o][0]:i.indexOf(t[o][0].toString()))){for(;!this.reconstructData[a];)this.reconstructData.push([]);if(-1!==(n="Category"===this.heatMap.yAxis.valueType?t[o][1]:l.indexOf(t[o][1].toString()))){for(;""!==this.reconstructData[a][n];)this.reconstructData[a].push("");this.reconstructData[a][n]=P.isNullOrUndefined(t[o][2])?"":t[o][2]}}return this.reconstructData},w.prototype.processJsonCellData=function(e,t){var i,l,a=e,n=this.heatMap.xAxis.labels||[],o=this.heatMap.yAxis.labels||[],s=this.heatMap.axisCollections,r=(0!==n.length&&0!==o.length||this.generateAxisLabels(e,t),"Category"===this.heatMap.xAxis.valueType?0<n.length?this.heatMap.xAxis.labels:s[0].jsonCellLabel:s[0].labelValue),h="Category"===this.heatMap.yAxis.valueType?0<o.length?this.heatMap.yAxis.labels:s[1].jsonCellLabel:s[1].labelValue;if(a.length){this.reconstructData=[];for(var d=0;d<a.length;d++)if(-1!==(i=this.getSplitDataValue(a[d],t,r,P.isNullOrUndefined(t.xDataMapping)?null:t.xDataMapping.split("."),this.heatMap.xAxis.valueType))){for(;!this.reconstructData[i];)this.reconstructData.push([]);if(-1!==(l=this.getSplitDataValue(a[d],t,h,P.isNullOrUndefined(t.yDataMapping)?null:t.yDataMapping.split("."),this.heatMap.yAxis.valueType))){for(;P.isNullOrUndefined(this.reconstructData[i][l]);)this.reconstructData[i].push("");this.heatMap.bubbleSizeWithColor?this.reconstructData[i][l]=[this.getSplitDataValue(a[d],t,null,t.bubbleDataMapping.size.split("."),""),this.getSplitDataValue(a[d],t,null,t.bubbleDataMapping.color.split("."),"")]:this.reconstructData[i][l]=this.getSplitDataValue(a[d],t,null,P.isNullOrUndefined(t.valueMapping)?null:t.valueMapping.split("."),"")}}}return this.reconstructData},w.prototype.generateAxisLabels=function(e,t){for(var i=e,e=this.heatMap.xAxis.labels||[],l=this.heatMap.yAxis.labels||[],a=0<e.length,n=0<l.length,o=this.heatMap.axisCollections,s=0;s<o.length;s++){var r=o[s].valueType,h=o[s];if("Category"===r){var d=void 0,p=void 0,g=void 0,p="Horizontal"===h.orientation?(d=a,t.xDataMapping):(d=n,t.yDataMapping);if(h.jsonCellLabel=g=[],!d)for(var c,u=0;u<i.length;u++)p in i[u]&&(c=i[u][p].toString(),-1===g.indexOf(c.toString()))&&g.push(c)}else"DateTime"===r?(h.clearAxisLabel(),h.calculateDateTimeAxisLabel(this.heatMap)):(h.clearAxisLabel(),h.calculateNumericAxisLabels(this.heatMap))}},w.prototype.getSplitDataValue=function(e,t,i,l,a){var n=-1,o={skeleton:"full",type:"dateTime"},s=this.heatMap.intl.getDateParser(o),r=this.heatMap.intl.getDateFormat(o);this.tempSplitDataCollection=e;for(var h=0;h<(P.isNullOrUndefined(l)?0:l.length)&&(n=P.isNullOrUndefined(i)?null:"DateTime"!==a?i.indexOf(this.tempSplitDataCollection[l[h]]):"string"==typeof this.tempSplitDataCollection[l[h]]||"object"==typeof this.tempSplitDataCollection[l[h]]?i.map(Number).indexOf(Date.parse(s(r(new Date(_.DataUtil.parse.parseJson({val:this.tempSplitDataCollection[l[h]]}).val))))):i.map(Number).indexOf(+new Date(this.tempSplitDataCollection[l[h]]).setHours(0,0,0,0)),P.isNullOrUndefined(this.tempSplitDataCollection)||(this.tempSplitDataCollection=-1===n||P.isNullOrUndefined(i)?this.tempSplitDataCollection[l[h]]:this.tempSplitDataCollection),!P.isNullOrUndefined(this.tempSplitDataCollection));h++);return n=P.isNullOrUndefined(i)?P.isNullOrUndefined(this.tempSplitDataCollection)||""===this.tempSplitDataCollection.toString()?"":parseFloat(this.tempSplitDataCollection.toString()):n},w.prototype.processJsonTableData=function(e,t){var i,l,a,n=e,o=this.heatMap.xAxis.labels||[],s=this.heatMap.yAxis.labels||[];if(n.length){this.reconstructData=[];for(var r=0;r<n.length;r++)if(-1!==(i=this.getSplitDataValue(n[r],t,o,P.isNullOrUndefined(t.xDataMapping)?null:t.xDataMapping.split("."),this.heatMap.xAxis.valueType))){for(;!this.reconstructData[i];)this.reconstructData.push([]);for(var h=0;h<Object.keys(this.tempSplitDataCollection).length;h++)if(-1!==(l=(a=Object.keys(this.tempSplitDataCollection)[h])!==t.xDataMapping?s.indexOf(a):-1)){for(;P.isNullOrUndefined(this.reconstructData[i][l]);)this.reconstructData[i].push("");this.reconstructData[i][l]=P.isNullOrUndefined(this.tempSplitDataCollection[a])?"":this.tempSplitDataCollection[a]}}}return this.reconstructData},w.prototype.destroy=function(){this.reconstructData=null,this.reconstructedXAxis=null,this.reconstructedYAxis=null,this.adaptiveXMinMax=null,this.adaptiveYMinMax=null,this.tempSplitDataCollection=null,this.heatMap=null},w.prototype.getModuleName=function(){return"Adaptor"},w);function w(e){this.reconstructedXAxis=[],this.reconstructedYAxis=[],this.adaptiveXMinMax=new Yt,this.adaptiveYMinMax=new Yt,this.heatMap=e}L.prototype.export=function(e,t,i){var l,a,n,o,s,r,h=this,d=this.getControlsValue(),p=d.width,g=d.height,c=this.control.svgObject,u=this.control.enableCanvasRendering,m=(u||(c=P.createElement("canvas",{id:"ej2-canvas",attrs:{width:p.toString(),height:g.toString()}})),!(-1<P.Browser.userAgent.toString().indexOf("HeadlessChrome"))),y=(i=P.isNullOrUndefined(i)?B.PdfPageOrientation.Landscape:i,'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+d.svg.outerHTML+"</svg>"),x=u?c.toDataURL("image/png"):(a=(n=(l=this.control.svgObject.cloneNode(!0)).childNodes[0]).getAttribute("fill"),"Tailwind"!==this.control.theme&&"Tailwind3"!==this.control.theme&&"Bootstrap5"!==this.control.theme&&"Fluent"!==this.control.theme&&"Material3"!==this.control.theme&&"Fluent2"!==this.control.theme||"rgba(255,255,255, 0.0)"!==a&&"transparent"!==a?"TailwindDark"!==this.control.theme&&"Tailwind3Dark"!==this.control.theme&&"Bootstrap5Dark"!==this.control.theme&&"FluentDark"!==this.control.theme&&"Material3Dark"!==this.control.theme&&"Fluent2Dark"!==this.control.theme&&"Fluent2HighContrast"!==this.control.theme||"rgba(255,255,255, 0.0)"!==a&&"transparent"!==a||n.setAttribute("fill","rgba(0, 0, 0, 1)"):n.setAttribute("fill","rgba(255,255,255, 1)"),window.URL.createObjectURL(new Blob("SVG"===e?[y]:[(new XMLSerializer).serializeToString(l)],{type:"image/svg+xml"})));"SVG"===e?"msie"===P.Browser.info.name?(a=new Blob([(new XMLSerializer).serializeToString(d.svg)],{type:"application/octet-stream"}),P.isNullOrUndefined(window.navigator.msSaveOrOpenBlob)||window.navigator.msSaveOrOpenBlob(a,t+"."+e.toLocaleLowerCase())):this.triggerDownload(t,e,x,m):"msie"===P.Browser.info.name?(n=c,y=(n=u?c:this.createCanvas()).toDataURL(e),"PDF"===e?this.exportPdf(n,i,p,g,m,t):this.doExport(e,y,t)):(o=new Image,s=c.getContext("2d"),r=s.shadowColor,o.onload=function(){"Tailwind"!==h.control.theme&&"Tailwind3"!==h.control.theme&&"Bootstrap5"!==h.control.theme&&"Fluent"!==h.control.theme&&"Material3"!==h.control.theme&&"Fluent2"!==h.control.theme||"rgba(0, 0, 0, 0)"!==r&&"transparent"!==r?"TailwindDark"!==h.control.theme&&"Tailwind3Dark"!==h.control.theme&&"Bootstrap5Dark"!==h.control.theme&&"FluentDark"!==h.control.theme&&"Material3Dark"!==h.control.theme&&"Fluent2Dark"!==h.control.theme&&"Fluent2HighContrast"!==h.control.theme||"rgba(0, 0, 0, 0)"!==r&&"transparent"!==r||(s.fillStyle="rgba(0, 0, 0, 1)"):s.fillStyle="rgba(255,255,255, 1)",s.fillRect(0,0,c.width,c.height),s.drawImage(o,0,0),window.URL.revokeObjectURL(x),"PDF"===e?h.exportPdf(c,i,p,g,m,t):window.navigator.msSaveOrOpenBlob?window.navigator.msSaveOrOpenBlob(c.msToBlob(),t+"."+e.toLocaleLowerCase()):h.triggerDownload(t,e,c.toDataURL("image/png").replace("image/png","image/octet-stream"),m)},o.src=x),u||C(document.getElementById(this.control.element.id)+"_canvas")},L.prototype.triggerDownload=function(e,t,i,l){P.createElement("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(l?"click":"move",{view:window,bubbles:!1,cancelable:!0}))},L.prototype.getControlsValue=function(){var e,t=this.control.enableCanvasRendering,i=new O.SvgRenderer("").createSvg({id:"Svg_Export_Element",width:200,height:200}),l=this.control.svgObject.cloneNode(!0),a=this.control.renderer.createGroup({});return a.style.cssText="transform: translateY(0px)",t||a.appendChild(l),l=Math.max(this.control.availableSize.width,0),e=0+this.control.availableSize.height,t||i.appendChild(a),t||(i.setAttribute("width",l+""),i.setAttribute("height",e+"")),{width:l,height:e,svg:i}},L.prototype.createCanvas=function(){var e=this.control,t=e.renderingMode,i=(e.renderingMode="Canvas",e.refresh(),e.svgObject);return e.renderingMode=t,e.refresh(),i},L.prototype.exportPdf=function(e,t,i,l,a,n){var o=new B.PdfDocument,s=o.pageSettings.margins,r=o.pageSettings.width,h=o.pageSettings.height,e=e.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream"),t=(o.pageSettings.orientation=t,r<i?i+s.left+s.right:r),r=h<l?l+s.top+s.bottom:h;o.pageSettings.size=new B.SizeF(t,r),e=e.slice(e.indexOf(",")+1),o.pages.add().graphics.drawImage(new B.PdfBitmap(e),0,0,i,l),a&&(o.save(n+".pdf"),o.destroy())},L.prototype.doExport=function(e,t,i){this.exportImage([t],i,e||"JPG",t)},L.prototype.exportImage=function(e,t,i,l){for(var a=[],n=e instanceof HTMLElement?0:e.length,o=0;o<n;o++){for(var s=e[o].replace(/^data:[a-z]*;,/,"").split(","),r=atob(s[1]),s=new ArrayBuffer(r.length),h=new Uint8Array(s),d=0;d<r.length;d++)h[d]=r.charCodeAt(d);a.push(s)}for(var p=0;p<a.length;p++){var g=new Blob([a[p]],{type:"application/octet-stream"});"msie"!==P.Browser.info.name||P.isNullOrUndefined(window.navigator.msSaveOrOpenBlob)||window.navigator.msSaveOrOpenBlob(g,t+"."+i.toLocaleLowerCase())}},L.prototype.print=function(){var e,t,i,l;this.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWindow.moveTo(0,0),this.printWindow.resizeTo(screen.availWidth,screen.availHeight),"SVG"===this.control.renderingMode?P.print(this.getHTMLContent(),this.printWindow):(t=(e=this.control.svgObject).toDataURL(),i=new Image,l=e.getContext("2d"),i.onload=function(){l.drawImage(i,0,0)},i.src=t,P.print(i,this.printWindow))},L.prototype.getHTMLContent=function(){var e=P.createElement("div");return e.appendChild(this.control.element.cloneNode(!0)),e};var Xt=L;function L(e){this.control=e}Jt=function(e,t){return(Jt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Jt,Kt,qt=function(e,t){function i(){this.constructor=e}Jt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},T=function(e,t,i,l){var a,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;0<=s;s--)(a=e[s])&&(o=(n<3?a(o):3<n?a(t,i,o):a(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},qt=(Kt=P.Component,qt(R,Kt),R.prototype.preRender=function(){this.initPrivateVariable(),this.unWireEvents(),this.wireEvents()},R.prototype.export=function(e,t,i){new Xt(this).export(e,t,i)},R.prototype.initPrivateVariable=function(){this.renderer=new O.SvgRenderer(this.element.id),this.canvasRenderer=new O.CanvasRenderer(this.element.id),this.secondaryCanvasRenderer=new O.CanvasRenderer(this.element.id+"_secondary"),this.heatMapAxis=new Ot(this),this.heatMapSeries=new Dt(this),this.drawSvgCanvas=new it(this),this.twoDimensional=new Et(this),this.cellColor=new Re(this),this.tempRectHoverClass="",this.tempTooltipRectId="",this.setCulture()},R.prototype.setCulture=function(){this.intl=new P.Internationalization},R.prototype.render=function(){var e;this.horizontalGradient="Bottom"===this.legendSettings.position||"Top"===this.legendSettings.position,this.updateBubbleHelperProperty(),this.trigger("load",{heatmap:this}),"TailwindDark"!==this.theme&&"Tailwind"!==this.theme||(e={title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter"}},this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Inter"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:"Inter"}}},!0)),"Tailwind3Dark"!==this.theme&&"Tailwind3"!==this.theme||(e={title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Inter",fontWeight:"600"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:{title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"400"}}},!0),this.setProperties({yAxis:{title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"400"}}},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:"Inter",fontWeight:"400"}}},!0)),"Material3"!==this.theme&&"Material3Dark"!==this.theme||(e={title:{textStyle:{size:"14px",fontFamily:"Roboto",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Roboto",fontWeight:"400"}},this.setProperties({titleSettings:{textStyle:{size:"16px",fontFamily:"Roboto"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:"Roboto",fontWeight:"400"}}},!0)),"Bootstrap5"!==this.theme&&"Bootstrap5Dark"!==this.theme||(e={title:{textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}},textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}},this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Segoe UI",fontWeight:"400"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{size:"10px",fontWeight:"400",fontFamily:"Segoe UI"}}},!0)),"Fluent"!==this.theme&&"FluentDark"!==this.theme||(e={title:{textStyle:{size:"12px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif',fontWeight:"500"}},textStyle:{size:"12px",fontFamily:'system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"'}},this.setProperties({titleSettings:{textStyle:{size:"16px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif'}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif'}}},!0)),"Fluent2"!==this.theme&&"Fluent2Dark"!==this.theme&&"Fluent2HighContrast"!==this.theme||(e={title:{textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}},textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}},this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Segoe UI",fontWeight:"600"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{size:"10px",fontWeight:"400",fontFamily:"Segoe UI"}}},!0)),this.initAxis(),this.processInitData(),this.setTheme(),this.calculateMaxLength(),this.heatMapAxis.calculateVisibleLabels(),this.twoDimensional.processDataSource(this.completeAdaptDataSource),this.createSvg(),this.cellColor.getColorCollection(),this.calculateBounds(),this.renderElements(),this.appendSvgObject(),this.tooltipModule&&this.tooltipModule.showHideTooltip(!1),this.renderComplete()},R.prototype.reRenderDatasource=function(){this.dataSourceMinValue=null,this.dataSourceMaxValue=null,this.processInitData(),this.calculateMaxLength(),this.heatMapAxis.calculateVisibleLabels(),this.twoDimensional.processDataSource(this.completeAdaptDataSource),this.cellColor.getColorCollection(),this.calculateBounds()},R.prototype.processInitData=function(){this.adaptorModule?this.adaptorModule.constructDatasource(this.dataSource,this.dataSourceSettings):this.completeAdaptDataSource=this.dataSource},R.prototype.setRenderMode=function(){"Canvas"===this.renderingMode||"Auto"===this.renderingMode&&1e4<=this.axisCollections[0].axisLabelSize*this.axisCollections[1].axisLabelSize?this.enableCanvasRendering=!0:this.enableCanvasRendering=!1},R.prototype.updateBubbleHelperProperty=function(){P.isNullOrUndefined(this.legendModule)||"Bubble"===this.cellSettings.tileType&&("Size"===this.cellSettings.bubbleType||"Sector"===this.cellSettings.bubbleType)?this.legendVisibilityByCellType=!1:this.legendModule&&this.legendSettings.visible&&(this.legendVisibilityByCellType=!0),"Bubble"===this.cellSettings.tileType&&"SizeAndColor"===this.cellSettings.bubbleType?this.bubbleSizeWithColor=!0:this.bubbleSizeWithColor=!1},R.prototype.renderElements=function(){this.tooltipCollection=[],this.renderSecondaryElement(),this.renderBorder(),this.renderTitle(),this.heatMapAxis.renderAxes(),this.tooltipModule&&this.showTooltip&&(this.tooltipModule.tooltipObject=null,this.tooltipModule.createTooltipDiv(this)),this.heatMapSeries.renderRectSeries(),this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&(this.legendModule.renderLegendItems(),"Fixed"===this.paletteSettings.type)&&this.legendSettings.enableSmartLegend&&"None"===this.legendSettings.labelDisplayType&&this.legendModule.createTooltipDiv(),pt()},R.prototype.getModuleName=function(){return"heatmap"},R.prototype.getPersistData=function(){return""},R.prototype.onPropertyChanged=function(e,t){for(var i=!1,l=!1,a=!0,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"renderingMode":i=!(a=this.rendering=!1);break;case"cellSettings":this.updateBubbleHelperProperty(),!this.legendModule||e.cellSettings.tileType===(void 0!==t.cellSettings&&t.cellSettings.tileType)&&e.cellSettings.bubbleType===t.cellSettings.bubbleType||(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections()),"Bubble"===this.cellSettings.tileType&&(a=!1),this.reRenderDatasource(),l=!0;break;case"showTooltip":l=!0;break;case"dataSource":case"dataSourceSettings":this.isCellData=!1,this.paletteCellSelectionUpdation(),this.reRenderDatasource(),i=!(a=!1);break;case"titleSettings":case"width":case"height":case"margin":case"backgroundColor":l=!0;break;case"legendSettings":this.updateBubbleHelperProperty(),this.legendModule&&this.legendVisibilityByCellType&&(e.legendSettings.visible!==(void 0!==t.legendSettings&&t.legendSettings.visible)||e.legendSettings.enableSmartLegend!==t.legendSettings.enableSmartLegend)?(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections()):this.legendOnLoad=!1,l=!0;break;case"yAxis":case"xAxis":this.paletteCellSelectionUpdation(),this.reRenderDatasource(),l=!(a=!1);break;case"paletteSettings":this.paletteCellSelectionUpdation(),this.twoDimensional.processDataSource(this.completeAdaptDataSource),this.cellColor.getColorCollection(),this.calculateBounds(),i=!0;break;case"theme":this.setTheme(),i=!0;break;case"tooltipSettings":this.tooltipModule&&(this.tooltipModule.tooltipObject.fill=this.tooltipSettings.fill,this.tooltipModule.tooltipObject.border=this.tooltipSettings.border,this.tooltipModule.tooltipObject.textStyle=this.tooltipSettings.textStyle,this.tooltipModule.tooltipObject.template=this.tooltipSettings.template,this.tooltipModule.tooltipObject.refresh())}!l&&i?(this.createSvg(),this.renderElements(),this.appendSvgObject(),this.trigger("created"),a||this.clearSelection()):l&&(this.createSvg(),this.refreshBound(),this.appendSvgObject(),this.trigger("created")),this.allowSelection&&this.rectSelected&&(a?this.updateCellSelection():this.clearSelection()),this.rendering=!0},R.prototype.paletteCellSelectionUpdation=function(){this.updateBubbleHelperProperty(),this.legendModule&&this.legendVisibilityByCellType&&(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections())},R.prototype.createSvg=function(){this.removeSvg(),this.setRenderMode(),this.calculateSize(),this.enableCanvasRendering?(this.svgObject=this.canvasRenderer.createCanvas({id:this.element.id+"_canvas",width:this.availableSize.width,height:this.availableSize.height}),this.allowSelection&&this.createMultiCellDiv(!0)):(this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height}),"0"===this.cellSettings.border.width.toString()&&"Rect"===this.cellSettings.tileType&&this.svgObject.setAttribute("shape-rendering","crispEdges"))},R.prototype.removeSvg=function(){if((document.getElementById(this.element.id+"_Secondary_Element")&&P.remove(document.getElementById(this.element.id+"_Secondary_Element")),document.getElementById(this.element.id+"Celltooltipcontainer")&&P.remove(document.getElementById(this.element.id+"Celltooltipcontainer")),document.getElementById(this.element.id+"legendLabelTooltipContainer")&&P.remove(document.getElementById(this.element.id+"legendLabelTooltipContainer")),document.getElementById(this.element.id+"_Multi_CellSelection_Canvas")&&P.remove(document.getElementById(this.element.id+"_Multi_CellSelection_Canvas")),document.getElementById(this.element.id+"_CellSelection_Container")&&P.remove(document.getElementById(this.element.id+"_CellSelection_Container")),document.getElementById(this.element.id+"_secondary_canvas")&&P.remove(document.getElementById(this.element.id+"_secondary_canvas")),this.svgObject)&&document.getElementById(this.svgObject.id)){for(;this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);P.remove(this.svgObject)}},R.prototype.renderSecondaryElement=function(){var e=this.createElement("div"),e=(e.id=this.element.id+"_Secondary_Element",this.element.appendChild(e),this.createElement("div",{id:this.element.id+"_CellSelection_Container"}));e.style.cssText="position:absolute; z-index: 2 ; top:"+this.initialClipRect.y+"px; left:"+this.initialClipRect.x+"px",this.element.appendChild(e)},R.prototype.requiredModules=function(){var e=[];return this.showTooltip&&e.push({member:"Tooltip",args:[this],name:"Tooltip"}),this.legendSettings.visible&&e.push({member:"Legend",args:[this],name:"Legend"}),!P.isNullOrUndefined(this.dataSourceSettings)&&("Table"===this.dataSourceSettings.adaptorType&&this.dataSourceSettings.isJsonData||"Cell"===this.dataSourceSettings.adaptorType)&&e.push({member:"Adaptor",args:[this],name:"Adaptor"}),e},R.prototype.destroy=function(){this.unWireEvents(),this.touchInstance.destroy(),this.touchInstance=null;for(var e=0;e<this.axisCollections.length;e++)this.axisCollections[e].destroy();this.axisCollections=null,P.isNullOrUndefined(this.heatMapSeries)||this.heatMapSeries.destroy(),this.heatMapSeries=null,P.isNullOrUndefined(this.heatMapAxis)||this.heatMapAxis.destroy(),this.heatMapAxis=null,Kt.prototype.destroy.call(this),pt(),P.isNullOrUndefined(this.twoDimensional)||this.twoDimensional.destroy(),this.twoDimensional=null,this.element.innerHTML="",this.availableSize=null,this.elementSize=null,this.initialClipRect=null,this.element.classList.remove("e-heatmap"),this.drawSvgCanvas=null,this.cellColor=null,this.colorCollection=null,this.legendColorCollection=null,this.clonedDataSource=null,this.completeAdaptDataSource=null,this.currentRect=null,this.dataMax=null,this.dataMin=null,this.previousRect=null,this.selectedCellsRect=null,this.canvasSelectedCells=null,this.titleRect=null,this.tooltipCollection=null,this.border=null,this.intl=null,this.titleCollection=null,this.themeStyle=null,this.renderer=null,this.canvasRenderer=null,this.secondaryCanvasRenderer=null,this.svgObject=null,this.resizeEvent=null,this.toggleValue=[],this.previousSelectedCellsRect=[],this.selectedMultiCellCollection=[],this.tempMultiCellCollection=[]},R.prototype.refresh=function(){Kt.prototype.refresh.call(this),this.element.classList.add("e-heatmap")},R.prototype.appendSvgObject=function(){this.element.appendChild(this.svgObject),this.enableCanvasRendering&&this.allowSelection&&this.createMultiCellDiv(!1)},R.prototype.renderBorder=function(){this.border={width:0};var e=P.isNullOrUndefined(this.backgroundColor)?this.themeStyle.background:this.backgroundColor,e=new b(this.element.id+"_HeatmapBorder",e,this.border,1,new z(0,0,+this.availableSize.width,+this.availableSize.height));this.drawSvgCanvas.drawRectangle(e,this.svgObject)},R.prototype.calculateSize=function(){for(var e=p(this.width,this.element.offsetWidth)||this.element.offsetWidth||600,t=p(this.height,this.element.offsetHeight)||this.element.offsetHeight||450,i=(this.availableSize=new A(e,t),this.element);i.parentNode&&"BODY"!==i.tagName;){if("center"===i.align){var l=this.availableSize.width.toString();this.element.style.width=l+"px",this.element.style.margin="0 auto";break}i=i.parentElement}},R.prototype.renderTitle=function(){var e,t;this.titleSettings.text&&(t="Near"===(e=this.titleSettings.textStyle).textAlignment?"start":"Far"===e.textAlignment?"end":"middle",this.elementSize=D(this.titleCollection[0],e),t=new F(this.element.id+"_HeatmapTitle",new V(Pe(this.availableSize.width-this.margin.left-this.margin.right,this.margin.left,this.margin.right,e),this.margin.top+3*this.elementSize.height/4,t,this.titleCollection),e,e.color||this.themeStyle.heatMapTitle),1<this.titleCollection.length?this.drawSvgCanvas.createWrapText(t,e,this.svgObject):(this.drawSvgCanvas.createText(t,this.svgObject,this.titleCollection[0]),-1!==this.titleCollection[0].indexOf("...")&&this.enableCanvasRendering&&this.tooltipCollection.push(new E(this.titleSettings.text,new z(this.margin.left,this.margin.top,this.elementSize.width,this.elementSize.height)))))},R.prototype.titleTooltip=function(e,t,i,l){e.target.id===this.element.id+"_HeatmapTitle"&&-1<e.target.textContent.indexOf("...")?dt(this.titleSettings.text,t,i,this.element.offsetWidth,this.element.id+"_Title_Tooltip",gt(this.element.id+"_Secondary_Element"),l,this):C(this.element.id+"_Title_Tooltip")},R.prototype.axisTooltip=function(e,t,i,l){var e=e.target.id;(-1!==e.indexOf(this.element.id+"_XAxis_Label")||-1!==e.indexOf(this.element.id+"_YAxis_Label")||-1!==e.indexOf(this.element.id+"_XAxis_MultiLevel")||-1!==e.indexOf(this.element.id+"_YAxis_MultiLevel"))&&(e=ut(this.tooltipCollection,t,i))?dt(e,t,i,this.element.offsetWidth,this.element.id+"_axis_Tooltip",gt(this.element.id+"_Secondary_Element"),this.isTouch,this):C(this.element.id+"_axis_Tooltip")},R.prototype.isHeatmapRect=function(e,t){var i,l,a,n,o,s=[],r=[];return 0<this.heatMapSeries.rectPositionCollection.length&&(s.push(this.heatMapSeries.rectPositionCollection[0][0]),r.push(this.heatMapSeries.rectPositionCollection[this.yLength-1][this.xLength-1])),0<s.length&&0<r.length&&(5<this.cellSettings.border.width&&e>=s[0].x&&t>=s[0].y&&e<=r[0].x+r[0].width&&t<=r[0].y+r[0].height&&"Rect"===this.cellSettings.tileType?(l=this.heatMapSeries.getCurrentRect(e,t),a=r[0].height,n=r[0].width,o=this.cellSettings.border.width/2,e>=l.x+o&&t>=l.y+o&&e<=l.x+(n-o)&&t<=l.y+(a-o)?this.isRectBoundary=i=!0:this.isRectBoundary=i=!1):(i=e>=s[0].x&&t>=s[0].y&&e<=r[0].x+r[0].width&&t<=r[0].y+r[0].height,this.isRectBoundary=i)),i},R.prototype.setTheme=function(){this.themeStyle=function(e){var t;switch(e.toLowerCase()){case"highcontrastlight":case"highcontrast":t={heatMapTitle:"#ffffff",axisTitle:"#ffffff",axisLabel:"#ffffff",cellBorder:"#EEEEEE",background:"#000000",cellTextColor:"#000000",toggledColor:"#000000",emptyCellColor:"#EEEEEE",legendLabel:"#ffffff",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;case"materialdark":case"fabricdark":case"bootstrapdark":t={heatMapTitle:"#ffffff",axisTitle:"#ffffff",axisLabel:"#DADADA",cellBorder:"#EEEEEE",background:"#000000",cellTextColor:"#000000",toggledColor:"#000000",emptyCellColor:"#EEEEEE",legendLabel:"#ffffff",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;case"bootstrap4":t={heatMapTitle:"#212529",axisTitle:"#212529",axisLabel:"#212529",cellBorder:"#E9ECEF",background:"#FFFFFF",cellTextColor:"#212529",toggledColor:"#ffffff",emptyCellColor:"#E9ECEF",legendLabel:"#212529",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;case"tailwind":t={heatMapTitle:"#374151",axisTitle:"#374151",axisLabel:"#6B7280",cellBorder:"#E5E7EB",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#E5E7EB",legendLabel:"#374151",palette:[{color:"#5A61F6"},{color:"#65A30D"},{color:"#14B8A6"}]};break;case"tailwinddark":t={heatMapTitle:"#D1D5DB",axisTitle:"#D1D5DB",axisLabel:"#9CA3AF",cellBorder:"#4B5563",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#374151",legendLabel:"#D1D5DB",palette:[{color:"#8B5CF6"},{color:"#22D3EE"},{color:"#F87171"}]};break;case"tailwind3":t={heatMapTitle:"#111827",axisTitle:"#111827",axisLabel:"#4B5563",cellBorder:"#E5E7EB",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#E5E7EB",legendLabel:"#4B5563",palette:[{color:"#2F4074"},{color:"#03B4B4"},{color:"#0D72DE"}]};break;case"tailwind3dark":t={heatMapTitle:"#FFFFFF",axisTitle:"#FFFFFF",axisLabel:"#D1D5DB",cellBorder:"#282F3C",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#282F3C",legendLabel:"#D1D5DB",palette:[{color:"#8029F1"},{color:"#1ABC9C"},{color:"#0D72DE"}]};break;case"bootstrap5":t={heatMapTitle:"#212529",axisTitle:"#212529",axisLabel:"#212529",cellBorder:"transparent",background:"transparent",toggledColor:"#E9ECEF",emptyCellColor:"#E9ECEF",legendLabel:"#212529",palette:[{color:"#DC3545"},{color:"#FFC107"},{color:"#D63384"}]};break;case"bootstrap5dark":t={heatMapTitle:"#DEE2E6",axisTitle:"#DEE2E6",axisLabel:"#DEE2E6",cellBorder:"transparent",background:"transparent",toggledColor:"#343A40",emptyCellColor:"#343A40",legendLabel:"#DEE2E6",palette:[{color:"#DC3545"},{color:"#FFC107"},{color:"#D63384"}]};break;case"fluent":t={heatMapTitle:"#201F1E",axisTitle:"#201F1E",axisLabel:"#201F1E",cellBorder:"#EDEBE9",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#EDEBE9",legendLabel:"#201F1E",palette:[{color:"#EDEBE9"},{color:"#614570"},{color:"#4C6FB1"}]};break;case"fluentdark":t={heatMapTitle:"#F3F2F1",axisTitle:"#F3F2F1",axisLabel:"#F3F2F1",cellBorder:"#EDEBE9",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#292827",legendLabel:"#F3F2F1",palette:[{color:"#292827"},{color:"#2A72D5"},{color:"#43B786"}]};break;case"material3":t={heatMapTitle:"#1C1B1F",axisTitle:"#1C1B1F",axisLabel:"#1C1B1F",cellBorder:"#C4C7C5",background:"transparent",cellTextColor:"#1C1B1F",toggledColor:"#F6F0FB",emptyCellColor:"#F6F0FB",legendLabel:"#49454E",palette:[{color:"#6200EE"},{color:"#E77A16"},{color:"#82C100"}]};break;case"material3dark":t={heatMapTitle:"#E6E1E5",axisTitle:"#E6E1E5",axisLabel:"#E6E1E5",cellBorder:"#444746",background:"transparent",cellTextColor:"#E6E1E5",toggledColor:"#49454F",emptyCellColor:"#49454E",legendLabel:"#CAC4D0",palette:[{color:"#4EAAFF"},{color:"#FA4EAB"},{color:"#FFF500"}]};break;case"fluent2":t={heatMapTitle:"#242424",axisTitle:"#242424",axisLabel:"#242424",cellBorder:"transparent",background:"transparent",cellTextColor:"#242424",toggledColor:"#EDEBE9",emptyCellColor:"#EDEBE9",legendLabel:"#242424",palette:[{color:"#6200EE"},{color:"#09AF74"},{color:"#0076E5"}]};break;case"fluent2dark":case"fluent2highcontrast":t={heatMapTitle:"#FFFFFF",axisTitle:"#FFFFFF",axisLabel:"#FFFFFF",cellBorder:"transparent",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"#292827",emptyCellColor:"#292827",legendLabel:"#FFFFFF",palette:[{color:"#9BB449"},{color:"#2A72D5"},{color:"#43B786"}]};break;default:t={heatMapTitle:"#424242",axisTitle:"#424242",axisLabel:"#686868",cellBorder:"#EEEEEE",cellTextColor:"#000000",toggledColor:"#ffffff",background:"#FFFFFF",emptyCellColor:"#EEEEEE",legendLabel:"#353535",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]}}return t}(this.theme)},R.prototype.calculateBounds=function(){var e=this.margin,t=0,i=this.legendModule&&"Top"===this.legendSettings.position&&this.legendVisibilityByCellType||"0px"===this.titleSettings.textStyle.size?0:16,l=e.left,a=this.availableSize.width-l-e.right;if(("Column"===this.paletteSettings.colorGradientMode||"Row"===this.paletteSettings.colorGradientMode)&&"Gradient"===this.paletteSettings.type)if(0===this.paletteSettings.palette.length)this.legendVisibilityByCellType=!1;else for(var n=0;n<this.paletteSettings.palette.length;n++)if(null!==this.paletteSettings.palette[n].value)this.legendVisibilityByCellType=!0;else if(null===this.paletteSettings.palette[n].value){this.legendVisibilityByCellType=!1;break}this.titleSettings.text&&(o=this.enableHtmlSanitizer?P.SanitizeHtmlHelper.sanitize(this.titleSettings.text):this.titleSettings.text,this.titleCollection=lt(o,this.titleSettings.textStyle,a),t=D(o,this.titleSettings.textStyle).height*this.titleCollection.length+i);var o=e.top+t,i=(this.titleRect=new z(e.left,e.top,this.availableSize.width-e.left-e.right,t),this.availableSize.height-o-e.bottom),t=(this.initialClipRect=new z(l,o,a,i),this.initialClipRect.y);this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.calculateLegendBounds(this.initialClipRect),this.heatMapAxis.measureAxis(this.initialClipRect),this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.calculateLegendSize(this.initialClipRect,t),this.heatMapAxis.calculateAxisSize(this.initialClipRect)},R.prototype.refreshBound=function(){this.updateBubbleHelperProperty(),this.calculateBounds(),this.renderElements()},R.prototype.initAxis=function(){var e,t=[this.xAxis,this.yAxis];this.axisCollections=[];for(var i=0,l=t.length;i<l;i++)(e=t[i]).orientation=0===i?"Horizontal":"Vertical",e.jsonCellLabel=[],this.axisCollections.push(e)},R.prototype.wireEvents=function(){var o=this,e=P.Browser.isPointer,t=P.Browser.touchStartEvent,i=P.Browser.touchEndEvent,l=P.Browser.touchMoveEvent,e=e?"pointerleave":"mouseleave",s=(P.EventHandler.add(this.element,P.Browser.isDevice?t:"click",this.heatMapMouseClick,this),P.EventHandler.add(this.element,"contextmenu",this.heatMapMouseRightClick,this),P.EventHandler.add(this.element,"dblclick",this.heatMapMouseDoubleClick,this),P.EventHandler.add(this.element,t,this.heatMapMouseMove,this),P.EventHandler.add(this.element,i,this.heatMapMouseLeave,this),P.EventHandler.add(this.element,l,this.heatMapMouseMove,this),P.EventHandler.add(this.element,e,this.heatMapMouseLeave,this),P.EventHandler.add(this.element,"keyup",this.heatMapKeyUp,this),P.EventHandler.add(this.element,"keydown",this.heatMapKeyDown,this),this.resizeEvent=this.heatMapResize.bind(this),window.addEventListener(P.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent),this);this.touchInstance=new P.Touch(this.element,{tapHold:function(e){var t=e.originalEvent.target.id;if((-1!==t.indexOf(o.element.id+"_HeatMapRect_")||-1!==t.indexOf(o.element.id+"_HeatMapRectLabels_"))&&o.allowSelection){s.isCellTapHold=!0;for(var i=[],l=0;l<o.multiCellCollection.length;l++)i.push(o.multiCellCollection[l]);e.originalEvent.ctrlKey&&o.enableMultiSelect||(o.multiCellCollection=[]),s.getDataCollection();t={heatmap:s,cancel:!1,name:"cellSelected",data:s.multiCellCollection};s.trigger("cellSelected",t),t.cancel?(o.multiCellCollection=i,(0<o.multiCellCollection.length||!1===e.ctrlKey||!o.enableMultiSelect)&&o.removeSelectedCellsBorder(!0)):(!1!==e.ctrlKey&&o.enableMultiSelect||o.removeSelectedCellsBorder(!1),s.currentRect.allowCollection=!1),s.setCellOpacity(),window.clearTimeout(o.tooltipTimer),s.tooltipOnMouseMove(null,s.currentRect,s.isCellTapHold)}},tap:function(e){var t,i,l,a,n=e.originalEvent.target.id;-1===n.indexOf(o.element.id+"_HeatMapRect_")&&-1===n.indexOf(o.element.id+"_HeatMapRectLabels_")&&-1===n.indexOf(o.element.id+"_CellSelection_Container_")||(n=!1,t=void(s.isCellTapHold||(n=!0)),a=l=void 0,i=o.element.getBoundingClientRect(),l=("touchend"===e.originalEvent.type||"touchstart"===e.originalEvent.type?(o.isTouch=!0,t=(a=e.originalEvent).changedTouches[0].clientX,a.changedTouches[0]):(o.isTouch=!1,t=e.originalEvent.clientX,e.originalEvent)).clientY,t-=i.left,l-=i.top,a=o.heatMapSeries.getCurrentRect(t,l),window.clearTimeout(o.tooltipTimer),s.tooltipOnMouseMove(null,a,n))}}),this.setStyle(this.element)},R.prototype.setStyle=function(e){e.style.touchAction="element",e.style.touchAction="element",e.style.zoom="none",e.style.userSelect="none",e.style.webkitUserSelect="none",e.style.position="relative",e.style.display="block"},R.prototype.print=function(){new Xt(this).print()},R.prototype.unWireEvents=function(){var e=P.Browser.isPointer,t=P.Browser.touchStartEvent,i=P.Browser.touchEndEvent,l=P.Browser.touchMoveEvent,e=e?"pointerleave":"mouseleave";P.EventHandler.remove(this.element,P.Browser.isDevice?t:"click",this.heatMapMouseClick),P.EventHandler.remove(this.element,"contextmenu",this.heatMapMouseRightClick),P.EventHandler.remove(this.element,"dblclick",this.heatMapMouseDoubleClick),P.EventHandler.remove(this.element,t,this.heatMapMouseMove),P.EventHandler.remove(this.element,i,this.heatMapMouseLeave),P.EventHandler.remove(this.element,l,this.heatMapMouseMove),P.EventHandler.remove(this.element,e,this.heatMapMouseLeave),P.EventHandler.remove(this.element,"keyup",this.heatMapKeyUp),P.EventHandler.remove(this.element,"keydown",this.heatMapKeyDown),window.removeEventListener(P.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent)},R.prototype.heatMapResize=function(e){var t=this,i=(this.resizing=!0,{heatmap:this,cancel:!1,name:"resized",currentSize:new A(0,0),previousSize:new A(this.availableSize.width,this.availableSize.height)});return this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(function(){t.isDestroyed?clearTimeout(t.resizeTimer):(t.createSvg(),i.currentSize=t.availableSize,t.trigger("resized",i),t.refreshBound(),t.appendSvgObject(),t.allowSelection&&t.updateCellSelection(),t.trigger("loaded",{heatmap:t}),t.resizing=!1)},500),!1},R.prototype.updateCellSelection=function(){var e=this.initialClipRect.width/this.axisCollections[0].axisLabelSize,t=this.initialClipRect.height/this.axisCollections[1].axisLabelSize,i=this.initialClipRect.x,l=this.initialClipRect.y;if(this.enableCanvasRendering){if(this.enableCanvasRendering){for(var a=this.multiCellCollection,n=document.getElementById(this.element.id+"_canvas"),o=document.getElementById(this.element.id+"_secondary_canvas"),s=this.initialClipRect,r=s.y+s.height,h=s.x+s.width,d=0;d<this.multiCellCollection.length;d++){this.multiCellCollection[d].width=a[d].width=e,this.multiCellCollection[d].height=a[d].height=t,this.multiCellCollection[d].x=a[d].x=i+e*this.multiCellCollection[d].xPosition,this.multiCellCollection[d].y=a[d].y=l+t*this.multiCellCollection[d].yPosition;var p=n.getContext("2d").getImageData(a[d].x,a[d].y,a[d].width,a[d].height);o.getContext("2d").putImageData(p,a[d].x,a[d].y),n.style.opacity="0.3"}var g=n.getContext("2d").getImageData(0,0,this.availableSize.width,s.y),g=(o.getContext("2d").putImageData(g,0,0),n.getContext("2d").getImageData(0,r,this.availableSize.width,this.availableSize.height-r)),r=(o.getContext("2d").putImageData(g,0,s.y+s.height),n.getContext("2d").getImageData(h,0,this.availableSize.width-h,this.availableSize.height)),g=(o.getContext("2d").putImageData(r,h,0),n.getContext("2d").getImageData(0,0,s.x,this.availableSize.height));o.getContext("2d").putImageData(g,0,0),C(this.element.id+"_selectedCells")}}else if(0!==this.multiCellCollection.length){for(var c=document.getElementById(this.element.id+"_Container_RectGroup"),u=document.getElementById(this.element.id+"_Container_TextGroup"),d=0;d<c.childNodes.length;d++)c.childNodes[d].setAttribute("opacity","0.3"),this.cellSettings.showLabel&&u.childNodes[d]&&u.childNodes[d].setAttribute("opacity","0.3");for(d=0;d<this.multiCellCollection.length;d++){var m,y=this.multiCellCollection[d].cellElement.id.replace(this.element.id+"_HeatMapRect_",""),y=parseInt(y,10);c.childNodes[y].setAttribute("opacity","1"),this.cellSettings.showLabel&&u.childNodes[d]&&((m=document.getElementById(this.element.id+"_HeatMapRectLabels_"+y))&&m.setAttribute("opacity","1"),this.addSvgClass(c.childNodes[y]))}}},R.prototype.clearSVGSelection=function(){for(var e=document.getElementById(this.element.id+"_Container_RectGroup"),t=document.getElementById(this.element.id+"_Container_TextGroup"),i=0;i<e.childNodes.length;i++){var l=e.childNodes[i].getAttribute("class");l===this.element.id+"_selected"&&this.removeSvgClass(e.childNodes[i],l),e.childNodes[i].setAttribute("opacity","1"),this.cellSettings.showLabel&&t.childNodes[i]&&t.childNodes[i].setAttribute("opacity","1")}},R.prototype.calculateMaxLength=function(){var e=this.completeAdaptDataSource;if(e&&0<e.length){for(var t=e.length-1,i=0,l=0;l<=t;l++)var a=e[l].length,i=a<i?i:a;this.axisCollections[0].maxLength=t,this.axisCollections[1].maxLength=i-1}else this.axisCollections[0].maxLength=0,this.axisCollections[1].maxLength=0},R.prototype.setMouseXY=function(e,t){var i=this.element.getBoundingClientRect(),l=(this.enableCanvasRendering?document.getElementById(this.element.id+"_canvas"):document.getElementById(this.element.id+"_svg")).getBoundingClientRect();this.mouseX=e-i.left-Math.max(l.left-i.left,0),this.mouseY=t-i.top-Math.max(l.top-i.top,0)},R.prototype.triggerClickEvent=function(e,t,i){var l,a=this.element.getBoundingClientRect(),n=("touchstart"===e.type?(t||(this.isTouch=!0),l=e.changedTouches[0].clientY,e.changedTouches[0]):(t||(this.isTouch=!1),l=e.clientY,e)).clientX;return n-=a.left,l-=a.top,this.isHeatmapRect(n,l)&&(a=this.heatMapSeries.getCurrentRect(n,l),this.trigger(t?"cellDoubleClick":"cellClick",{heatmap:this,value:a.value,x:a.x,y:a.y,xLabel:this.heatMapSeries.hoverXAxisLabel,yLabel:this.heatMapSeries.hoverYAxisLabel,xValue:this.heatMapSeries.hoverXAxisValue,yValue:this.heatMapSeries.hoverYAxisValue,cellElement:this.enableCanvasRendering?null:document.getElementById(a.id),hasRightClicked:i,event:e})),{x:n,y:l}},R.prototype.heatMapMouseRightClick=function(e){this.triggerClickEvent(e,!1,!0)},R.prototype.heatMapMouseDoubleClick=function(e){this.triggerClickEvent(e,!0,!1)},R.prototype.heatMapMouseClick=function(e){var t=this.triggerClickEvent(e,!1,!1),i=t.x,l=t.y;if(this.notify("click",e),this.isHeatmapRect(i,l)&&this.currentRect&&(t=document.getElementById(this.currentRect.id),P.isNullOrUndefined(t)||t.focus()),"Gradient"!==this.paletteSettings.type&&this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType)for(var e=this.legendModule.navigationCollections,a=(e.length&&i>e[0].x&&i<e[0].x+e[0].width&&l>e[0].y&&l<e[0].y+e[0].height?this.legendModule.translatePage(this,this.legendModule.currentPage,!0):e.length&&i>e[1].x&&i<e[1].x+e[1].width&&l>e[1].y&&l<e[1].y+e[1].height&&this.legendModule.translatePage(this,this.legendModule.currentPage,!1),this.legendModule.legendRange),n=this.legendModule.legendTextRange,o=!0,s=0;s<a.length;s++)this.legendModule&&this.legendSettings.toggleVisibility&&this.legendModule.currentPage===a[s].currentPage&&(o&&i>=a[s].x&&i<=a[s].width+a[s].x&&l>=a[s].y&&l<=a[s].y+a[s].height||this.legendSettings.showLabel&&"None"!==this.legendSettings.labelDisplayType&&i>=n[s].x&&i<=n[s].width+n[s].x&&l>=n[s].y&&l<=n[s].y+n[s].height)&&(this.legendModule.legendRangeSelection(s),o=!1);return!1},R.prototype.heatMapMouseMove=function(e){var t,i,l=this.element.getBoundingClientRect(),a=("touchmove"===e.type||"touchstart"===e.type?(this.isTouch=!0,t=(i=e).changedTouches[0].clientX,i.changedTouches[0]):(this.isTouch=!1,t=e.clientX,e)).clientY;return this.removeFocus("none"),t-=l.left,a-=l.top,this.setMouseXY(t,a),this.mouseAction(e,t,a,i,l),!0},R.prototype.mouseAction=function(e,t,i,l,a){var n,o,s;return e.target&&e.target.id&&(n=this.isHeatmapRect(t,i),s=void(this.legendModule&&(n?"Gradient"===this.paletteSettings.type&&this.legendSettings.showGradientPointer&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.renderGradientPointer(e,t,i):this.legendModule.removeGradientPointer(),this.renderMousePointer(t,i))),o=void 0,s=!(!this.showTooltip||!this.tooltipModule)&&n,n&&(o=this.heatMapSeries.getCurrentRect(t,i),2!==e.which)&&3!==e.which&&(s=this.cellSelectionOnMouseMove(e,o,t,i,s)),this.tooltipOnMouseMove(e,o,s,n),this.legendModule&&this.legendSettings.visible&&"Fixed"===this.paletteSettings.type&&this.legendSettings.enableSmartLegend&&"None"===this.legendSettings.labelDisplayType&&this.legendModule.createTooltip(t,i),this.enableCanvasRendering?(this.element.getBoundingClientRect(),o="Fixed"!==this.paletteSettings.type||!this.legendSettings.enableSmartLegend||"None"!==this.legendSettings.labelDisplayType,(s=ut(this.tooltipCollection,t,i)||this.legendModule&&o&&(!P.isNullOrUndefined(this.legendModule.legendLabelTooltip)&&ut(this.legendModule.legendLabelTooltip,t,i)||!P.isNullOrUndefined(this.legendModule.legendTitleTooltip)&&ut(this.legendModule.legendTitleTooltip,t,i)))?dt(s,t,i,this.element.offsetWidth,this.element.id+"_canvas_Tooltip",gt(this.element.id+"_Secondary_Element"),this.isTouch,this):C(this.element.id+"_canvas_Tooltip")):(this.titleSettings.text&&"Trim"===this.titleSettings.textStyle.textOverflow&&this.titleTooltip(e,t,i,this.isTouch),this.axisTooltip(e,t,i,this.isTouch),this.legendModule&&this.legendSettings.visible&&this.legendSettings.showLabel&&this.legendVisibilityByCellType&&this.legendModule.renderLegendLabelTooltip(e,t,i),this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.renderLegendTitleTooltip(e,t,i))),!0},R.prototype.cellSelectionOnMouseMove=function(e,t,i,l,a){return("Rect"===this.cellSettings.tileType&&"mousedown"===e.type||"touchstart"===e.type||"pointerdown"===e.type)&&this.allowSelection&&(this.previousRect=t,this.multiSelection=!0,this.rectSelected=!0,this.initialCellX=i,this.initialCellY=l,e.preventDefault()),"Rect"===this.cellSettings.tileType&&this.multiSelection&&t&&(a=!1,this.highlightSelectedCells(this.previousRect,t,i,l,e)),a},R.prototype.tooltipOnMouseMove=function(e,t,i,l){var a,n=this;i&&t?this.tempTooltipRectId!==t.id&&(this.showTooltip&&((this.cellSettings.enableCellHighlighting||this.tooltipModule&&this.showTooltip)&&!this.enableCanvasRendering&&this.heatMapSeries.highlightSvgRect(t.id),!this.tooltipTimer||P.isNullOrUndefined(e)||"touchstart"!==e.type&&"touchmove"!==e.type||(window.clearTimeout(this.tooltipTimer),this.tooltipTimer=null),this.tooltipModule.renderTooltip(t),a=this.tooltipModule.tooltipObject,this.isTouch)&&(this.tooltipTimer=setTimeout(function(){P.isNullOrUndefined(a)||P.isNullOrUndefined(document.getElementById(a.element.id))||P.isNullOrUndefined(document.getElementById(a.element.id).firstChild)||a.fadeOut(),n.tooltipModule.isFadeout=!0,window.clearTimeout(n.tooltipTimer),n.tooltipTimer=null},1500),e)&&"touchmove"===e.type&&e.cancelable&&e.preventDefault(),this.tempTooltipRectId=t.id):(null!==e&&(l?!this.showTooltip&&5<this.cellSettings.border.width&&this.heatMapSeries.highlightSvgRect(e.target.id):((this.cellSettings.enableCellHighlighting||this.showTooltip)&&!this.enableCanvasRendering&&this.cellSettings.border.width<5&&this.heatMapSeries.highlightSvgRect(e.target.id),this.tooltipModule&&this.showTooltip&&this.tooltipModule.showHideTooltip(!1,!0))),this.tempTooltipRectId="")},R.prototype.highlightSelectedCells=function(e,t,i,l,a){var n=e.xIndex,o=e.yIndex,s=t.xIndex,r=t.yIndex,s=(this.currentRect=t,this.selectedCellsRect=new z(0,0,0,0),this.selectedCellsRect.x=(e.x>t.x?t:e).x,this.selectedCellsRect.y=(e.y>t.y?t:e).y,this.selectedCellsRect.width=(1+(e.x>t.x?n-s:s-n))*t.width,this.selectedCellsRect.height=(1+(e.y>t.y?o-r:r-o))*t.height,"touchstart"!==a.type||0!==this.multiCellCollection.length||this.isCellTapHold?this.isCellTapHold=!1:this.isCellTapHold=!0,a.preventDefault(),this.initialCellX>i?i:this.initialCellX),n=this.initialCellY>l?l:this.initialCellY,e=new z(s-this.initialClipRect.x,n-this.initialClipRect.y,Math.abs(i-this.initialCellX),Math.abs(l-this.initialCellY)),o=(0<e.width&&this.enableMultiSelect&&!1===a.ctrlKey&&(this.removeSelectedCellsBorder(!1),r=document.getElementById(this.element.id+"Celltooltipcontainer_svg"))&&(this.tooltipModule.tooltipObject=null,r.setAttribute("opacity","0")),document.getElementById(this.element.id+"_CellSelection_Container")),t=this.renderer.createSvg({id:this.element.id+"_CellSelection_Container_svg",width:this.initialClipRect.width,height:this.initialClipRect.height}),s=(o.appendChild(t),document.getElementById(this.element.id+"_CellSelection_Container_svg"));this.enableMultiSelect&&(n=new b(this.element.id+"_selectedCells","#87ceeb",{color:"transparent",width:1},1,e,"#0000ff"),s.appendChild(this.renderer.drawRectangle(n)),document.getElementById(this.element.id+"_selectedCells").style.opacity="0.5")},R.prototype.getDataCollection=function(){var e,t,i,l,a,n,o,s,r,h;P.isNullOrUndefined(this.previousRect)||P.isNullOrUndefined(this.currentRect)||(n=this.previousRect.xIndex,e=this.previousRect.yIndex,l=this.currentRect.xIndex,t=this.currentRect.yIndex,r=this.previousRect.x,h=this.previousRect.y,this.getCellCollection(this.currentRect,this.previousRect,!0,o=i=n<l?n:l,s=a=e<t?e:t,l=n<l?l:n,n=e<t?t:e,i,r,h),o=i,s=a,r=this.previousRect.x,h=this.previousRect.y,this.checkSelectedCells(),this.getCellCollection(this.currentRect,this.previousRect,!1,o,s,l,n,i,r,h),this.selectedMultiCellCollection=[],this.canvasSelectedCells=new z(0,0,0,0),this.selectedCellCount=0)},R.prototype.getCellCollection=function(e,t,i,l,a,n,o,s,r,h){for(var d=Math.abs(e.xIndex===t.xIndex?0:e.xIndex-t.xIndex)+1,p=Math.abs(e.yIndex===t.yIndex?0:e.yIndex-t.yIndex)+1,g=0;g<d*p;g++)i?this.getSelectedCellData(r,h,!0):this.getSelectedCellData(r,h,!1),l<n?(r+=e.xIndex>t.xIndex?e.width:-e.width,l++):a<o&&(h+=e.yIndex>t.yIndex?e.height:-e.height,r=t.x,l=s)},R.prototype.removeSelectedCellsBorder=function(e){if(this.enableCanvasRendering){for(var t=this.secondaryCanvasRenderer.ctx,i=0;i<this.previousSelectedCellsRect.length;i++){var l=this.previousSelectedCellsRect[i];t.save(),t.clearRect(l.x-1,l.y-1,l.width+2,l.height+2),t.restore()}for(i=0;i<this.multiCellCollection.length;i++){var a=this.multiCellCollection[i];0<this.multiCellCollection.length&&(t.save(),t.clearRect(a.x-1,a.y-1,a.width+2,a.height+2))}}else for(var n=document.getElementById(this.element.id+"_Container_RectGroup"),o=document.getElementById(this.element.id+"_Container_TextGroup"),i=0;i<n.childNodes.length;i++){var s=n.childNodes[i].getAttribute("class");e?(n.childNodes[i].setAttribute("opacity","1"),this.cellSettings.showLabel&&o.childNodes[i]&&(o.childNodes[i].setAttribute("opacity","1"),this.removeSvgClass(n.childNodes[i],s))):(n.childNodes[i].setAttribute("opacity","0.3"),this.cellSettings.showLabel&&o.childNodes[i]&&(o.childNodes[i].setAttribute("opacity","0.3"),this.removeSvgClass(n.childNodes[i],s)))}},R.prototype.highlightSelectedAreaInCanvas=function(e){var t,i,l,a;e.x&&(t=document.getElementById(this.element.id+"_canvas"),i=document.getElementById(this.element.id+"_secondary_canvas"),l=this.initialClipRect,a=t.getContext("2d").getImageData(e.x,e.y,e.width,e.height),i.getContext("2d").putImageData(a,e.x,e.y),t.style.opacity="0.3",a=t.getContext("2d").getImageData(0,0,this.availableSize.width,l.y),i.getContext("2d").putImageData(a,0,0),e=t.getContext("2d").getImageData(0,l.y+l.height,this.availableSize.width,this.availableSize.height-(l.y+l.height)),i.getContext("2d").putImageData(e,0,l.y+l.height),a=t.getContext("2d").getImageData(l.x+l.width,0,this.availableSize.width-(l.x+l.width),this.availableSize.height),i.getContext("2d").putImageData(a,l.x+l.width,0),e=t.getContext("2d").getImageData(0,0,l.x,this.availableSize.height),i.getContext("2d").putImageData(e,0,0))},R.prototype.getSelectedCellData=function(e,t,i){var l=this.axisCollections[0],a=this.axisCollections[1],n=l.tooltipLabels,o=a.tooltipLabels.slice().reverse(),e=this.heatMapSeries.getCurrentRect(e+1,t+1),t=document.getElementById(e.id),s=new Ne(null,"","",0,0,null,0,0,0,0,0,0);if(s.value=e.value,s.xLabel=n[e.xIndex].toString(),s.yLabel=o[e.yIndex].toString(),s.xValue=l.labelValue[e.xIndex],s.yValue=a.labelValue.slice().reverse()[e.yIndex],s.cellElement=this.enableCanvasRendering?null:t,s.xPosition=e.xIndex,s.yPosition=e.yIndex,s.width=this.currentRect.width,s.height=this.currentRect.height,s.x=this.currentRect.x,s.y=this.currentRect.y,this.currentRect.allowCollection=!0,this.addSvgClass(t),i)this.selectedMultiCellCollection.push(s),this.currentRect.allowCollection=!1;else for(var r=0;r<this.multiCellCollection.length;r++)if(this.multiCellCollection[r].xPosition===s.xPosition&&this.multiCellCollection[r].yPosition===s.yPosition&&(this.currentRect.allowCollection=!1,this.selectedCellCount===this.selectedMultiCellCollection.length)){if(this.currentRect.allowCollection=!1,this.enableCanvasRendering){var h=this.secondaryCanvasRenderer.ctx,d=this.canvasSelectedCells;h.save(),h.clearRect(d.x-1,d.y-1,d.width+2,d.height+2),h.restore(),this.selectedCellsRect=new z(0,0,0,0)}else for(var p=0;p<this.selectedMultiCellCollection.length;p++){var g,c,u=this.selectedMultiCellCollection[p].cellElement;u&&(c=u.id.replace(this.element.id+"_HeatMapRect_",""),document.getElementById(this.element.id+"_Container_TextGroup"),g=u.getAttribute("class"),u.setAttribute("opacity","0.3"),(c=document.getElementById(this.element.id+"_HeatMapRectLabels_"+c))&&c.setAttribute("opacity","0.3"),this.removeSvgClass(u,g))}this.multiCellCollection.splice(r,1)}e.visible&&!P.isNullOrUndefined(e.value)&&!0===this.currentRect.allowCollection&&this.multiCellCollection.push(s)},R.prototype.addSvgClass=function(e){var t;this.enableCanvasRendering||(t=this.element.id+"_selected",e.classList.add(t))},R.prototype.removeSvgClass=function(e,t){t&&e.setAttribute("class",t.replace(t,""))},R.prototype.clearSelection=function(){if(!this.enableCanvasRendering&&this.allowSelection&&this.clearSVGSelection(),this.enableCanvasRendering){for(var e=this.secondaryCanvasRenderer.ctx,t=0;t<this.previousSelectedCellsRect.length;t++)e.save(),e.clearRect(this.previousSelectedCellsRect[t].x-1,this.previousSelectedCellsRect[t].y-1,this.previousSelectedCellsRect[t].width+2,this.previousSelectedCellsRect[t].height+2),e.restore();for(t=0;t<this.multiCellCollection.length;t++){var i=this.multiCellCollection[t];0<this.multiCellCollection.length&&(e.save(),e.clearRect(i.x-1,i.y-1,i.width+2,i.height+2))}document.getElementById(this.element.id+"_canvas").style.opacity="1"}this.tempMultiCellCollection=[],this.multiCellCollection=[],this.rectSelected=!1},R.prototype.renderMousePointer=function(e,t){for(var i,l=this.legendModule.legendRange,a=this.legendModule.legendTextRange,n=!0,o=0;o<l.length;o++)this.legendSettings.toggleVisibility&&this.legendModule.currentPage===l[o].currentPage&&(n&&e>=l[o].x&&e<=l[o].width+l[o].x&&t>=l[o].y&&t<=l[o].y+l[o].height||this.legendSettings.showLabel&&"None"!==this.legendSettings.labelDisplayType&&e>=a[o].x&&e<=a[o].width+a[o].x&&t>=a[o].y&&t<=a[o].y+a[o].height?(this.enableCanvasRendering?document.getElementById(this.element.id+"_canvas").style.cursor="Pointer":(document.getElementById(this.element.id+"_svg").style.cursor="Pointer",i=document.getElementById(this.element.id+"legendLabelTooltipContainer"),P.isNullOrUndefined(i)||(i.style.cursor="Pointer")),n=!1):n&&(this.enableCanvasRendering?document.getElementById(this.element.id+"_canvas").style.cursor="":document.getElementById(this.element.id+"_svg").style.cursor=""))},R.prototype.heatMapMouseLeave=function(e){var t,i=this;if(e.target&&e.target.id&&(this.cellSettings.enableCellHighlighting||this.tooltipModule&&this.showTooltip)&&!this.enableCanvasRendering&&this.heatMapSeries.highlightSvgRect(this.tempTooltipRectId),this.allowSelection&&this.multiSelection&&(this.multiSelection=!1,"mouseup"===e.type||"mouseleave"===e.type||"touchend"===e.type||"pointerup"===e.type)&&2!==e.which&&3!==e.which)if(!1===this.isCellTapHold){var l,a,n,o=document.getElementById(this.element.id+"_selectedCells");if(!(0<(P.isNullOrUndefined(o)?(l=a=void 0,n=this.element.getBoundingClientRect(),a=("touchend"===e.type?(this.isTouch=!0,l=e.changedTouches[0].clientY,e.changedTouches[0]):(this.isTouch=!1,l=e.clientY,e)).clientX,a-=n.left,l-=n.top,n=this.initialCellX>a?a:this.initialCellX,h=this.initialCellY>l?l:this.initialCellY,new z(n-this.initialClipRect.x,h-this.initialClipRect.y,0!==Math.abs(a-this.initialCellX)?Math.abs(a-this.initialCellX):Math.abs(l-this.initialCellY),Math.abs(l-this.initialCellY))):(n=o.getClientRects()[0],new z(n.left,n.top,n.width,n.height))).width)||this.enableMultiSelect){for(var s=[],r=0;r<this.multiCellCollection.length;r++)s.push(this.multiCellCollection[r]);!1!==e.ctrlKey&&this.enableMultiSelect||(this.multiCellCollection=[]),this.getDataCollection();var h={heatmap:this,cancel:!1,name:"cellSelected",data:this.multiCellCollection};this.trigger("cellSelected",h),h.cancel?(this.multiCellCollection=s,(0<this.multiCellCollection.length||!1===e.ctrlKey||!this.enableMultiSelect)&&this.removeSelectedCellsBorder(!0)):(!1!==e.ctrlKey&&this.enableMultiSelect||this.removeSelectedCellsBorder(!1),this.currentRect.allowCollection=!1),this.setCellOpacity(),"touchend"===e.type&&(window.clearTimeout(this.tooltipTimer),this.tooltipOnMouseMove(null,this.currentRect,!0))}}else this.isCellTapHold=!1;return this.tooltipModule&&this.showTooltip&&"mouseleave"===e.type&&this.tooltipModule.showHideTooltip(!1),this.tempTooltipRectId="",this.legendModule&&this.legendSettings.visible&&this.legendModule.tooltipObject&&this.legendModule.tooltipObject.element&&(t=this.legendModule.tooltipObject.element.firstChild,"mouseleave"===e.type?t.setAttribute("opacity","0"):(this.legendTooltipTimer&&window.clearTimeout(this.legendTooltipTimer),this.legendTooltipTimer=setTimeout(function(){t.setAttribute("opacity","0")},1500))),"Gradient"===this.paletteSettings.type&&this.legendModule&&this.legendSettings.showGradientPointer&&this.legendSettings.visible&&this.legendVisibilityByCellType&&("mouseleave"===e.type?this.legendModule.removeGradientPointer():(this.gradientTimer&&window.clearTimeout(this.gradientTimer),this.gradientTimer=setTimeout(function(){i.legendModule.removeGradientPointer()},1500))),this.enableCanvasRendering&&(a=document.getElementById(this.element.id+"_hoverRect_canvas"))&&(a.style.visibility="hidden",this.tempRectHoverClass=""),this.titleSettings.text&&-1!==this.titleCollection[0].indexOf("...")&&(e.cancelable&&e.preventDefault(),this.isTouch||(this.enableCanvasRendering?C(this.element.id+"_canvas_Tooltip"):C(this.element.id+"_Title_Tooltip"))),!0},R.prototype.heatMapKeyUp=function(e){var t,i;"Tab"===e.code&&(this.removeFocus("none"),this.tooltipModule&&this.tooltipModule.showHideTooltip(!1),t=-1<(e=e.target).id.indexOf("HeatMapRect"),i=-1<e.id.indexOf("Legend"),!this.cellSettings.enableCellHighlighting||i||this.rectSelected?(t&&this.allowSelection||i&&this.legendSettings.toggleVisibility||-1<e.id.indexOf("arrow"))&&(e.style.outline="2px solid black",e.classList.add("keyboard-focused")):this.heatMapSeries.highlightSvgRect(e.id))},R.prototype.heatMapKeyDown=function(e){var t;"Enter"===e.code&&(e.ctrlKey||(this.multiCellCollection=[]),this.removeFocus("none"),e=e.target,this.allowSelection&&-1<e.id.indexOf("HeatMapRect")&&"Rect"===this.cellSettings.tileType?(this.previousRect=this.currentRect=this.getRectElement(e.id),this.removeSelectedCellsBorder(!1),this.getDataCollection(),this.setCellOpacity(),this.rectSelected=!0):this.legendModule&&this.legendSettings.visible&&(t=this.calculateLegendIndex(e),P.isNullOrUndefined(t)||this.legendModule.legendRangeSelection(t),e=document.getElementById(e.id),this.handleArrowNavigation(e),e.setAttribute("tabindex","0"),e.focus()))},R.prototype.calculateLegendIndex=function(e){if(this.legendSettings.toggleVisibility){if(-1<e.id.indexOf("Legend_Index"))return parseFloat(e.id.split("Legend_Index_")[1]);if(-1<e.id.indexOf("_Smart_Legend_Group_"))return parseFloat(e.id.split("_Smart_Legend_Group_")[1])}return null},R.prototype.handleArrowNavigation=function(e){var t,i;-1<e.id.indexOf("arrow")&&((t=this.legendModule.currentPage)<(i=this.legendColorCollection.length/this.legendModule.listPerPage)&&-1<e.id.indexOf("rightarrow")?this.legendModule.translatePage(this,t,!0):t<=i&&-1<e.id.indexOf("leftarrow")&&this.legendModule.translatePage(this,t,!1))},R.prototype.getRectElement=function(e){for(var t=this.heatMapSeries.rectPositionCollection,i=0;i<t.length;i++)for(var l=0;l<t[i].length;l++)if(t[i][l].id===e)return t[i][l];return null},R.prototype.removeFocus=function(e){var t=document.querySelector(".keyboard-focused");t&&(t.style.outline=e,t.classList.remove("keyboard-focused"))},R.prototype.checkSelectedCells=function(){if(this.enableCanvasRendering){this.canvasSelectedCells=new z(0,0,0,0),this.canvasSelectedCells.x=this.selectedCellsRect.x,this.canvasSelectedCells.y=this.selectedCellsRect.y,this.canvasSelectedCells.width=this.selectedCellsRect.width,this.canvasSelectedCells.height=this.selectedCellsRect.height;for(e=0;e<this.multiCellCollection.length;e++)for(t=0;t<this.selectedMultiCellCollection.length;t++)this.selectedMultiCellCollection[t].xPosition===this.multiCellCollection[e].xPosition&&this.selectedMultiCellCollection[t].yPosition===this.multiCellCollection[e].yPosition&&this.selectedCellCount++;this.legendModule&&this.rectSelected&&"Gradient"===this.paletteSettings.type&&this.legendModule.removeGradientPointer()}else for(var e=0;e<this.multiCellCollection.length;e++)for(var t=0;t<this.selectedMultiCellCollection.length;t++)this.selectedMultiCellCollection[t].cellElement.getAttribute("id")===this.multiCellCollection[e].cellElement.getAttribute("id")&&this.selectedCellCount++},R.prototype.removeOpacity=function(e,t){for(var i=0;i<e.childNodes.length;i++)e.childNodes[i].setAttribute("opacity","0.3"),this.cellSettings.showLabel&&t.childNodes[i]&&t.childNodes[i].setAttribute("opacity","0.3")},R.prototype.setCellOpacity=function(){if(this.enableCanvasRendering)this.previousSelectedCellsRect.push(this.selectedCellsRect),this.highlightSelectedAreaInCanvas(this.selectedCellsRect);else if(0!==this.multiCellCollection.length){this.tempMultiCellCollection.push(this.multiCellCollection);var e=document.getElementById(this.element.id+"_Container_RectGroup"),t=document.getElementById(this.element.id+"_Container_TextGroup");this.removeOpacity(e,t);for(var i=0;i<this.multiCellCollection.length;i++){var l=this.multiCellCollection[i].cellElement,l=parseInt(l.id.replace(this.element.id+"_HeatMapRect_",""),10);e.childNodes[l].setAttribute("opacity","1"),e.childNodes[l].setAttribute("tabindex","0"),this.cellSettings.showLabel&&(l=document.getElementById(this.element.id+"_HeatMapRectLabels_"+l))&&l.setAttribute("opacity","1")}}C(this.element.id+"_selectedCells")},R.prototype.createMultiCellDiv=function(e){e?((e=this.createElement("div",{id:this.element.id+"_Multi_CellSelection_Canvas"})).style.position="relative",this.element.appendChild(e),this.svgObject.style.position="absolute",this.svgObject.style.left="0px",this.svgObject.style.top="0px",this.svgObject.style.zIndex="0"):(e=void 0,e=document.getElementById(this.element.id+"_secondary_canvas"),(e=P.isNullOrUndefined(e)?this.secondaryCanvasRenderer.createCanvas({width:this.availableSize.width,height:this.availableSize.height,x:0,y:0}):e).style.cssText="position: relative; z-index: 1",this.element.appendChild(e))},T([P.Property(null)],R.prototype,"width",void 0),T([P.Property(null)],R.prototype,"height",void 0),T([P.Property(!0)],R.prototype,"showTooltip",void 0),T([P.Event()],R.prototype,"tooltipRender",void 0),T([P.Event()],R.prototype,"resized",void 0),T([P.Event()],R.prototype,"loaded",void 0),T([P.Event()],R.prototype,"cellRender",void 0),T([P.Event()],R.prototype,"cellSelected",void 0),T([P.Property("SVG")],R.prototype,"renderingMode",void 0),T([P.Property(null)],R.prototype,"dataSource",void 0),T([P.Complex({},Ut)],R.prototype,"dataSourceSettings",void 0),T([P.Property(null)],R.prototype,"backgroundColor",void 0),T([P.Property("Material")],R.prototype,"theme",void 0),T([P.Property(!1)],R.prototype,"allowSelection",void 0),T([P.Property(!0)],R.prototype,"enableMultiSelect",void 0),T([P.Property(!1)],R.prototype,"enableHtmlSanitizer",void 0),T([P.Complex({},U)],R.prototype,"margin",void 0),T([P.Complex({text:"",textStyle:t.heatMapTitleFont},te)],R.prototype,"titleSettings",void 0),T([P.Complex({},o)],R.prototype,"xAxis",void 0),T([P.Complex({position:"Right"},Ht)],R.prototype,"legendSettings",void 0),T([P.Complex({},l)],R.prototype,"paletteSettings",void 0),T([P.Complex({},m)],R.prototype,"tooltipSettings",void 0),T([P.Complex({},o)],R.prototype,"yAxis",void 0),T([P.Complex({},h)],R.prototype,"cellSettings",void 0),T([P.Event()],R.prototype,"created",void 0),T([P.Event()],R.prototype,"load",void 0),T([P.Event()],R.prototype,"cellClick",void 0),T([P.Event()],R.prototype,"cellDoubleClick",void 0),T([P.Event()],R.prototype,"legendRender",void 0),T([P.NotifyPropertyChanges],R));function R(){var e=null!==Kt&&Kt.apply(this,arguments)||this;return e.enableCanvasRendering=!1,e.isColorRange=!1,e.isCellTapHold=!1,e.selectedCellCount=0,e.toggleValue=[],e.legendOnLoad=!0,e.resizing=!1,e.rendering=!0,e.multiSelection=!1,e.rectSelected=!1,e.previousSelectedCellsRect=[],e.multiCellCollection=[],e.selectedMultiCellCollection=[],e.tempMultiCellCollection=[],e.tooltipCollection=[],e.isCellData=!1,e}e.AdaptiveMinMax=Yt,e.Adaptor=Wt,e.Axis=o,e.AxisHelper=Ot,e.AxisLabelBorder=he,e.Border=Y,e.BubbleData=$,e.BubbleSize=ge,e.BubbleTooltipData=fe,e.CanvasTooltip=E,e.CellColor=Re,e.CellSettings=h,e.CircleOption=Ge,e.ColorCollection=Ce,e.CurrentLegendRect=xt,e.CurrentRect=Be,e.CustomizeOption=De,e.Data=Ut,e.DrawSvgCanvas=it,e.ExportUtils=Xt,e.FillColor=ae,e.Font=k,e.Gradient=rt,e.GradientColor=ht,e.GradientPointer=yt,e.HeatMap=qt,e.Legend=S,e.LegendColorCollection=Me,e.LegendRange=bt,e.LegendSettings=Ht,e.Line=Xe,e.LineOption=Je,e.Margin=U,e.MultiLevelCategories=me,e.MultiLevelLabels=i,e.MultiLevelPosition=Rt,e.MultipleRow=we,e.PaletteCollection=se,e.PaletteSettings=l,e.PaletterColor=mt,e.Path=Qe,e.PathAttributes=Ze,e.PathOption=g,e.Rect=z,e.RectOption=b,e.RgbColor=Te,e.SelectedCellDetails=Ne,e.Series=Dt,e.Size=A,e.TextBasic=V,e.TextElement=ze,e.TextOption=F,e.Title=te,e.ToggleVisibility=vt,e.Tooltip=Vt,e.TooltipBorder=K,e.TooltipSettings=m,e.TwoDimensional=Et,e.colorNameToHex=St,e.componentToHex=ft,e.convertElement=Ee,e.convertHexToColor=Mt,e.convertToHexCode=Ct,e.createLabelTemplate=Ve,e.formatValue=wt,e.getElement=gt,e.getIsLineBreakLabel=nt,e.getSanitizedTexts=at,e.getTemplateFunction=Ie,e.getTitle=lt,e.getTooltipText=ut,e.increaseDateTimeInterval=ct,e.measureText=D,e.removeElement=C,e.removeMeasureElement=pt,e.rotateTextSize=tt,e.showTooltip=dt,e.stringToNumber=p,e.sum=c,e.textNone=st,e.textTrim=I,e.textWrap=ot,e.titlePositionX=Pe,e.titlePositionY=et,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ej2-heatmap.umd.min.js.map