UNPKG

@syncfusion/ej2-treemap

Version:
10 lines 136 kB
/*! * filename: ej2-treemap.min.js * version : 30.1.37 * 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. */ this.ej=this.ej||{},this.ej.treemap=function(e,t,i,l,n){"use strict";function o(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function r(e,i){var l=document.getElementById("treeMapMeasureText");return null===l&&(l=t.createElement("text",{id:"treeMapMeasureText"}),document.body.appendChild(l)),l.innerHTML=t.SanitizeHtmlHelper.sanitize(e),l.style.position="absolute",l.style.fontSize=i.size,l.style.fontWeight=i.fontWeight,l.style.fontStyle=i.fontStyle,l.style.fontFamily=i.fontFamily,l.style.visibility="hidden",l.style.top="-100",l.style.left="0",l.style.whiteSpace="nowrap",l.style.lineHeight="normal",new Ce(l.clientWidth,l.clientHeight)}function a(e,t,i){var l=t,n=r(t,i).width;if(n>e)for(var o=t.length-1;o>=0;--o)if(l=t.substring(0,o)+"...",(n=r(l,i).width)<=e||l.length<4)return l.length<4&&(l=" "),l;return l}function s(e,t,i,l){var n;switch(t){case"Near":n=e.x;break;case"Center":n="title"===l?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":n="title"===l?e.width-e.y-i.width:e.x+e.width-i.width}var o="title"===l?e.y+i.height/2:e.y+e.height/2+i.height/2;return new Te(n,o)}function d(e,t,i){var l=e.createText(t,i);return l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.style["user-select"]="none",l.style["-moz-user-select"]="none",l.style["-webkit-touch-callout"]="none",l.style["-webkit-user-select"]="none",l.style["-khtml-user-select"]="none",l.style["-ms-user-select"]="none",l.style["-o-user-select"]="none",l}function h(e,l,n,o,a){void 0===a&&(a=!1);var s,h,p,g={"font-size":l.size,"font-style":l.fontStyle,"font-family":l.fontFamily,"font-weight":l.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:l.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:n},c="string"==typeof e.text?e.text:a?e.text[e.text.length-1]:e.text[0],m=new i.SvgRenderer("");if(!t.isNullOrUndefined(c)&&!t.isNullOrUndefined(e.connectorText)&&c.includes(e.connectorText[1]))for(var u=c.split("#"),f=0;f<u.length;f++){var y=-1===u[f].search(e.connectorText)||t.isNullOrUndefined(e.connectorText)?u[f]:e.connectorText;if(g.id=e.id+"_"+f,p=d(m,g,y),f%2==0&&0!==f){y=y.replace(/\s+/g,"&nbsp")}var v=r(y,l);g.x=0!==f?g.x+v.width:g.x+v.width+5,o.appendChild(p)}else p=d(m,g,c),o.appendChild(p);if("string"!=typeof e.text&&e.text.length>1){for(var S=1,x=e.text.length;S<x;S++)h=r(e.text[S],l).height,s=m.createTSpan({x:e.x,id:e.id,y:e.y+S*h},e.text[S]),p.appendChild(s);o.appendChild(p)}return p}function p(e,i,l){var n,o=e.split("_RectPath")[0];n=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+o+"_LabelTemplate"),t.isNullOrUndefined(n)||(n.innerHTML=l)}function g(e){return document.getElementById(e)}function c(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function m(e,t,i,l){for(var n,o=!1,r="",a=l.leafItemSettings,s=0;s<e.length;s++){var d=i[n=l.levels[s]?l.levels[s].groupPath:a.labelPath?a.labelPath:l.weightValuePath]||"undefined";if(e[s]===d&&(r+=d+(s===e.length-1?"":"#"))===t){o=!0;break}}return o}function u(e){var t;if(e){var i=Object.keys(e);t={};for(var l=0;l<i.length;l++)if(e[i[l]]instanceof Array){t.values=e[i[l]],t.key=i[l];break}}return t}function f(e,t,i,l){if("Child"===i){t.push(e.levelOrderName);var n=u(e).values;if(n&&n.length>0){for(s=0;s<n.length;s++)-1===t.indexOf(n[s].levelOrderName)&&t.push(n[s].levelOrderName);for(var o=0;o<n.length;o++)f(n[o],t,i,l)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),f(e.parent,t,i,l));else if("All"===i)for(var r=e.levelOrderName.split("#")[0],a=void 0,s=0;s<l.layout.renderItems.length;s++)(a=l.layout.renderItems[s]).levelOrderName.indexOf(r)>-1&&-1===t.indexOf(a.levelOrderName)&&t.push(a.levelOrderName);else t.push(e.levelOrderName);return t}function y(e){var i=null;try{i="function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(l){i=t.compile(e)}return i}function v(e,i,l){var n=t.createElement("div",{id:i});n.style.cssText="position: absolute;pointer-events: auto;";for(var o=e.length;o>0;)n.appendChild(e[0]),o--;for(var r=n.innerHTML,a=Object.keys(l),s=0;s<a.length;s++){var d=RegExp;r=r.replace(new d("{{:"+a[s]+"}}","g"),l[a[s].toString()])}return n.innerHTML=r,n}function S(e,t,i,l,n){var o=new Te(0,0),r="Template"===l?n.areaRect.x:0,a="Template"===l?n.areaRect.y:0;return o.x=Math.abs(r-(t.indexOf("Left")>-1?e.x+5:t.indexOf("Right")>-1?e.x+e.width-i.width:e.x+(e.width/2-i.width/2)))-2,!n.enableDrillDown||"BottomLeftTopRight"!==n.renderDirection&&"BottomRightTopLeft"!==n.renderDirection?o.y=Math.abs(a-(t.indexOf("Top")>-1?"Template"===l?e.y:e.y+i.height:t.indexOf("Bottom")>-1?e.y+e.height-i.height:"Template"===l?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):o.y=Math.abs(e.y+e.height-i.height+5),o}function x(e,t){var i=new Ce(0,0);t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth;var l=document.getElementById(e.id);return l.parentNode.removeChild(l),i}function b(e){return(e.width-e.x)*(e.height-e.y)}function I(e){var t=C(e),i=t.width,l=t.height;return Math.min(i,l)}function C(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function F(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function w(e,t,i){var l=i.getBoundingClientRect(),n=i.ownerDocument.defaultView.pageXOffset,o=i.ownerDocument.defaultView.pageYOffset,r=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=l.left+n-a,d=l.top+o-r;return new Te(e-s,t-d)}function O(e,i,l){var n,o,r=[];if(t.isNullOrUndefined(i)&&t.isNullOrUndefined(l)&&isNaN(l))return null;for(var a=0;a<e.length;a++){var s=!1,d=l;t.isNullOrUndefined(e[a].from)||t.isNullOrUndefined(e[a].to)||t.isNullOrUndefined(e[a].value)?(t.isNullOrUndefined(e[a].from)||t.isNullOrUndefined(e[a].to))&&t.isNullOrUndefined(e[a].value)||(l>=e[a].from&&e[a].to>=l||e[a].value===i)&&(e[a].value===i&&(s=!0),n="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:T(e[a],d):e[a].color):l>=e[a].from&&e[a].to>=l&&e[a].value===i&&(s=!0,n="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:T(e[a],d):e[a].color),(l>=e[a].from&&l<=e[a].to||e[a].value===i)&&!t.isNullOrUndefined(e[a].minOpacity)&&!t.isNullOrUndefined(e[a].maxOpacity)&&n&&(o=L(e[a],l)),(""===n||t.isNullOrUndefined(n))&&t.isNullOrUndefined(e[a].from)&&t.isNullOrUndefined(e[a].to)&&t.isNullOrUndefined(e[a].minOpacity)&&t.isNullOrUndefined(e[a].maxOpacity)&&t.isNullOrUndefined(e[a].value)&&(n="[object Array]"===Object.prototype.toString.call(e[a].color)?e[a].color[0]:e[a].color),o=t.isNullOrUndefined(o)?"1":o,r.push(n)}for(var h=r.length-1;h>=0;h--)h=(n=r[h])?-1:h;return{fill:n,opacity:o}}function L(e,t){var i=1;return t>=e.from&&t<=e.to&&(i=(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity),i.toString()}function T(e,t){return N(e,t)}function M(e,t,i){return"#"+G(e)+G(t)+G(i)}function N(e,t){var i;return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:M((i=_(Number(t),e)).r,i.g,i.b)}function _(e,t){var i=t.from,l=t.to,n=0,o=l-i;n=(e-i)/o;var r,a;if(t.color.length<=2)r="#"===t.color[0].charAt(0)?t.color[0]:X(t.color[0]),a="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:X(t.color[t.color.length-1]);else{r="#"===t.color[0].charAt(0)?t.color[0]:X(t.color[0]),a="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:X(t.color[t.color.length-1]);for(var s=o/(t.color.length-1),d=t.color.length-1,h=[],p={},g=1;g<d;g++)p={b:i+g*s,color:t.color[g]},h.push(p);for(var c=0;c<h.length;c++)i<=e&&e<=h[c].b&&0===c?(a="#"===h[c].color.charAt(0)?h[c].color:X(h[c].color),n=e<h[c].b?1-Math.abs((e-h[c].b)/s):(e-h[c].b)/s):h[c].b<=e&&e<=l&&c===h.length-1&&(r="#"===h[c].color.charAt(0)?h[c].color:X(h[c].color),n=e<h[c].b?1-Math.abs((e-h[c].b)/s):(e-h[c].b)/s),c!==h.length-1&&c<h.length&&h[c].b<=e&&e<=h[c+1].b&&(r="#"===h[c].color.charAt(0)?h[c].color:X(h[c].color),a="#"===h[c+1].color.charAt(0)?h[c+1].color:X(h[c+1].color),n=Math.abs(e-h[c+1].b)/s)}return E(n,r,a)}function E(e,t,i){var l=i.split("#")[1],n=t.split("#")[1],o=D(e,parseInt(n.substr(0,2),16),parseInt(l.substr(0,2),16)),r=D(e,parseInt(n.substr(2,2),16),parseInt(l.substr(2,2),16)),a=D(e,parseInt(n.substr(4,2),16),parseInt(l.substr(4,2),16));return new Me(o,r,a)}function D(e,t,i){var l=i-t;return Math.round(t+l*e)}function P(e,t,i){for(var l,n=t.split(" "),o="",s=[],d=0,h=n.length;d<h;d++)l=n[d],r(o.concat(l),i).width<e?o=o.concat((""===o?"":" ")+l):""!==o?(s.push(a(e,o,i)),o=l):(s.push(a(e,l,i)),l=""),o&&d===h-1&&s.push(a(e,o,i));return s}function B(e,t,i){var l=[],n=0,o=r(t,i).width,a=t.length;if(e>=o)return l.push(t),l;for(var s=t.length;s>n;s--){var d=t.slice(n,s);if((o=r(d,i).width)<=e){if(l.push(d),n+=d.length,a===n)return l;s=a+1}}return l}function z(e,t,i,l){var n=r(i,l);return n.width>e||n.height>t?" ":i}function H(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function R(e,t,i){var l=e.levelSelection;if(l)for(var n=0;n<l.length;n++)t.getAttribute("id")===l[n]||t.children[0].id===l[n]?t.childElementCount>0&&-1===t.children[0].id.indexOf("_Group")&&(t.children[0].setAttribute("class",i),A(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function U(e,i){var l=e.legendId;if(l)for(var n=0;n<l.length;n++)if("Interactive"===e.legendSettings.mode){for(var o=0;o<i.childElementCount;o++)if(i.childNodes[o].id===l[n]||parseFloat(i.childNodes[o].id.split("Index_")[1])===parseFloat(l[n].split("Index_")[1])){var r=i.childNodes[o];r.setAttribute("fill",e.selectionSettings.fill),r.setAttribute("opacity",e.selectionSettings.opacity),-1===r.id.indexOf("Text")?(r.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),r.setAttribute("stroke",e.selectionSettings.border.color)):(r.setAttribute("stroke",null),r.setAttribute("stroke-width",null))}}else{var a=document.getElementById(l[n]);t.isNullOrUndefined(a)||(a.setAttribute("fill",e.selectionSettings.fill),a.setAttribute("opacity",e.selectionSettings.opacity),-1===a.id.indexOf("Text")?(a.setAttribute("stroke",e.selectionSettings.border.color),a.setAttribute("stroke-width",e.selectionSettings.border.width.toString())):(a.setAttribute("stroke",null),a.setAttribute("stroke-width",null)))}}function k(e,i,l){for(var n,o=0;o<e.length;o++)A(n=t.isNullOrUndefined(e[o].childNodes[0])?e[o]:e[o].childNodes[0],l.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])].options),e[o].classList.remove(i),o-=1}function A(e,i){e.setAttribute("opacity",i.opacity),t.isNullOrUndefined(i.fill)?e.setAttribute("fill","black"):e.setAttribute("fill",i.fill),e.setAttribute("stroke",i.border.color),e.setAttribute("stroke-width",i.border.width)}function W(e,i,l){if(t.isNullOrUndefined(e))return null;for(var n=0,o=Object.keys(i);n<o.length;n++){var r=o[n];e=e.split("${"+r+"}").join(j(i[r],l).toString())}return e}function j(e,t){return(t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)||""}function V(e){return"#"+G(e.r)+G(e.g)+G(e.b)}function G(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function q(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new Me(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Me(255,255,255)}function X(e){e="transparent"===e?"white":e;var t=document.getElementById("treeMapMeasureText");t.style.color=e;var i=(e=window.getComputedStyle(t).color).replace(/[()RGBrgba ]/g,"").split(",");return V(new Me(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function J(e,t,l,n,o){var r=new i.SvgRenderer(""),a=Y(e,l,t,o,n);return r["draw"+a.functionName](a.renderOption)}function Y(e,i,l,n,o){var r,a="Path",s=i.width,d=i.height,h=e.x,p=e.y,g=e.x+-s/2,c=e.y+-d/2;switch(l){case"Circle":case"Bubble":a="Ellipse",t.merge(n,{rx:s/2,ry:d/2,cx:h,cy:p});break;case"VerticalLine":r="M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),t.merge(n,{d:r});break;case"Diamond":r="M "+g+" "+p+" L "+h+" "+(p+-d/2)+" L "+(h+s/2)+" "+p+" L "+h+" "+(p+d/2)+" L "+g+" "+p+" z",t.merge(n,{d:r});break;case"Rectangle":r="M "+g+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+d/2)+" L "+g+" "+(p+d/2)+" L "+g+" "+(p+-d/2)+" z",t.merge(n,{d:r});break;case"Triangle":r="M "+g+" "+(p+d/2)+" L "+h+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+d/2)+" L "+g+" "+(p+d/2)+" z",t.merge(n,{d:r});break;case"InvertedTriangle":r="M "+(h+s/2)+" "+(p-d/2)+" L "+h+" "+(p+d/2)+" L "+(h-s/2)+" "+(p-d/2)+" L "+(h+s/2)+" "+(p-d/2)+" z",t.merge(n,{d:r});break;case"Pentagon":for(var m=void 0,u=void 0,f=0;f<=5;f++)m=s/2*Math.cos(Math.PI/180*(72*f)),u=s/2*Math.sin(Math.PI/180*(72*f)),r=0===f?"M "+(h+m)+" "+(p+u)+" ":r.concat("L "+(h+m)+" "+(p+u)+" ");r=r.concat("Z"),t.merge(n,{d:r});break;case"Star":r="M "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" L "+(e.x-i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x+i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x-i.width/3)+" "+(e.y-i.height/2)+" L "+e.x+" "+(e.y+i.height/2)+" L "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" Z",t.merge(n,{d:r});break;case"Cross":r="M "+g+" "+p+" L "+(h+s/2)+" "+p+" M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),t.merge(n,{d:r});break;case"Image":a="Image",t.merge(n,{href:o,height:d,width:s,x:g,y:c})}return{renderOption:n,functionName:a}}function Z(e,t){for(var i=!1,l=0;l<e.length;l++)if(t.levelOrderName===e[l].levelOrderName){i=!0;break}return i}function Q(e){if(e.length>0)for(var t=0;t<e.length;t++){var i=e[t];K(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function $(e,i){if(e.length>0)for(var l=0;l<e.length;l++){var n=e[l],o=parseFloat(n.legendEle.id.split("_Index_")[1]),r=n.legendEle.id.indexOf("Text")>-1?n.legendEle.id.replace("_Text",""):n.legendEle.id,a="Interactive"===i.legendSettings.mode?document.getElementById(r):document.getElementById(i.element.id+"_Legend_Shape_Index_"+o),s="Interactive"===i.legendSettings.mode?document.getElementById(r+"_Text"):document.getElementById(i.element.id+"_Legend_Text_Index_"+o);t.isNullOrUndefined(a)||K(a,n.oldFill,n.oldOpacity,"none","0px"),t.isNullOrUndefined(s)||K(s,i.legendSettings.textStyle.color||i.themeStyle.legendTextColor,n.oldOpacity,null,null);for(var d=t.isNullOrUndefined(n.ShapeCollection)?0:n.ShapeCollection.Elements.length,h=0;h<d;h++){var p=document.getElementById(n.ShapeCollection.Elements[h].id);t.isNullOrUndefined(p)||K(p,n.shapeOldFill,n.shapeOldOpacity,n.shapeOldBorderColor,n.shapeOldBorderWidth)}}}function K(e,i,l,n,o){e.setAttribute("fill",i),e.setAttribute("opacity",l),t.isNullOrUndefined(n)||e.setAttribute("stroke",n),t.isNullOrUndefined(o)||e.setAttribute("stroke-width",o)}function ee(e,t,i){$(e,i),k(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function te(e,i,l){for(var n,o=""!==l.rangeColorValuePath?l.rangeColorValuePath:null,r=!1,a=0;a<e&&!r;a++){var s=l.treeMapLegendModule.legendCollections[a].legendData.length;if(s>0){for(var d=0;d<s;d++)if(!t.isNullOrUndefined(o)&&l.leafItemSettings.colorMapping.length>0?l.treeMapLegendModule.legendCollections[a].legendData[d].data[o]===i.data[o]:l.treeMapLegendModule.legendCollections[a].legendData[d].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].legendName)>-1){n=a,r=!0;break}}else if(l.palette&&l.palette.length>0&&(l.treeMapLegendModule.legendCollections[a].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].levelOrderName)>-1)&&l.treeMapLegendModule.legendCollections[a].legendName===i.name){n=a;break}}return n}function ie(e,t,i,l,n,o,r){e.push({legendEle:l,oldFill:r[t].legendFill,oldOpacity:r[t].opacity,oldBorderColor:r[t].borderColor,oldBorderWidth:r[t].borderWidth,shapeElement:n,shapeOldFill:o[i].options.fill,shapeOldOpacity:o[i].options.opacity,shapeOldBorderColor:o[i].options.border.color,shapeOldBorderWidth:o[i].options.border.width})}function le(e,i,l,n){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:l}}).dispatchEvent(new MouseEvent(n?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function ne(e){var i=document.getElementById(e);return i?t.remove(i):null}function oe(e){var t,i;switch(e.toLowerCase()){case"materialdark":i="#303030";break;case"fabricdark":i="#201F1F";break;case"bootstrapdark":i="#1A1A1A"}switch(e.toLowerCase()){case"bootstrapdark":case"fabricdark":case"materialdark":t={backgroundColor:i,titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#DADADA",legendTextColor:"#DADADA",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:re,legendBorderColor:"#000000",legendBorderWidth:0};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",labelFontFamily:re,fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",titleFontWeight:"Normal",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",titleFontWeight:"Normal",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",titleFontWeight:"Normal",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontWeight:"Normal",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3":t={backgroundColor:"transparent",titleFontColor:"#111827",titleFontWeight:"600",subTitleFontColor:"#111827",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#111827",legendTextColor:"#111827",fontFamily:"Inter",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Inter",fontWeight:"400",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5":t={backgroundColor:"transparent",titleFontColor:"#212529",titleFontWeight:"400",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5dark":t={backgroundColor:"transparent",titleFontColor:"#DEE2E6",titleFontWeight:"400",subTitleFontColor:"#DEE2E6",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#212529",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#DEE2E6",legendTextColor:"#DEE2E6",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",titleFontWeight:"Normal",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",titleFontWeight:"Normal",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3":t={backgroundColor:"transparent",titleFontColor:"#1C1B1F",titleFontWeight:"500",subTitleFontColor:"#1C1B1F",tooltipFillColor:"#313033",tooltipFontColor:"#F4EFF4",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#1C1B1F",legendTextColor:"#49454E",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3dark":t={backgroundColor:"transparent",titleFontColor:"#E6E1E5",titleFontWeight:"500",subTitleFontColor:"#E6E1E5",tooltipFillColor:"#E6E1E5",tooltipFontColor:"#313033",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#E6E1E5",legendTextColor:"#CAC4D0",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2":t={backgroundColor:"transparent",titleFontColor:"#242424",titleFontWeight:"600",subTitleFontColor:"#242424",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#242424",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#242424",legendTextColor:"#242424",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#292929",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2highcontrast":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#FFF",legendBorderWidth:1,tooltipBorderColor:"#FFF",tooltipBorderWidth:1};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",titleFontWeight:"Normal",subTitleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#353535",legendTextColor:"#353535",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:re,legendBorderColor:"#000000",legendBorderWidth:0}}return t}var re="Roboto, Segoe UI, Noto, Sans-serif",ae=function(){var e=function(t,i){return(e=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])})(t,i)};return function(t,i){function l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),se=function(e,t,i,l){var n,o=arguments.length,r=o<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property("#808080")],i.prototype,"color",void 0),se([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),he=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(10)],i.prototype,"left",void 0),se([t.Property(10)],i.prototype,"right",void 0),se([t.Property(10)],i.prototype,"top",void 0),se([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"size",void 0),se([t.Property(null)],i.prototype,"color",void 0),se([t.Property(re)],i.prototype,"fontFamily",void 0),se([t.Property("")],i.prototype,"fontWeight",void 0),se([t.Property("Normal")],i.prototype,"fontStyle",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property("")],i.prototype,"text",void 0),se([t.Property("")],i.prototype,"description",void 0),i}(t.ChildProperty),ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Complex({fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),i}(ge),me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Complex({fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),se([t.Complex({},ce)],i.prototype,"subtitleSettings",void 0),i}(ge),ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"from",void 0),se([t.Property(null)],i.prototype,"to",void 0),se([t.Property(null)],i.prototype,"color",void 0),se([t.Property(null)],i.prototype,"label",void 0),se([t.Property(null)],i.prototype,"value",void 0),se([t.Property(null)],i.prototype,"minOpacity",void 0),se([t.Property(null)],i.prototype,"maxOpacity",void 0),se([t.Property(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"visible",void 0),se([t.Property("Default")],i.prototype,"mode",void 0),se([t.Property("transparent")],i.prototype,"background",void 0),se([t.Property("Circle")],i.prototype,"shape",void 0),se([t.Property("")],i.prototype,"width",void 0),se([t.Property("")],i.prototype,"height",void 0),se([t.Complex({size:null,fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(15)],i.prototype,"shapeWidth",void 0),se([t.Property(15)],i.prototype,"shapeHeight",void 0),se([t.Property(10)],i.prototype,"shapePadding",void 0),se([t.Property(null)],i.prototype,"imageUrl",void 0),se([t.Complex({color:null,width:null},de)],i.prototype,"border",void 0),se([t.Complex({color:"#000000",width:0},de)],i.prototype,"shapeBorder",void 0),se([t.Complex({},ge)],i.prototype,"title",void 0),se([t.Complex({size:null,fontFamily:null,fontWeight:null},pe)],i.prototype,"titleStyle",void 0),se([t.Property("Bottom")],i.prototype,"position",void 0),se([t.Property("None")],i.prototype,"orientation",void 0),se([t.Property(!1)],i.prototype,"invertedPointer",void 0),se([t.Property("After")],i.prototype,"labelPosition",void 0),se([t.Property("None")],i.prototype,"labelDisplayMode",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),se([t.Property({x:0,y:0})],i.prototype,"location",void 0),se([t.Property(null)],i.prototype,"showLegendPath",void 0),se([t.Property(null)],i.prototype,"valuePath",void 0),se([t.Property(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"groupIndex",void 0),se([t.Property(null)],i.prototype,"groupName",void 0),i}(t.ChildProperty),ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(!1)],i.prototype,"autoFill",void 0),se([t.Complex({},de)],i.prototype,"border",void 0),se([t.Property(0)],i.prototype,"gap",void 0),se([t.Property(10)],i.prototype,"padding",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(!0)],i.prototype,"showLabels",void 0),se([t.Property(null)],i.prototype,"labelPath",void 0),se([t.Property(null)],i.prototype,"labelFormat",void 0),se([t.Property("TopLeft")],i.prototype,"labelPosition",void 0),se([t.Complex({color:null,size:null,fontFamily:null},pe)],i.prototype,"labelStyle",void 0),se([t.Property(null)],i.prototype,"labelTemplate",void 0),se([t.Property("Center")],i.prototype,"templatePosition",void 0),se([t.Property("Trim")],i.prototype,"interSectAction",void 0),se([t.Collection([],ue)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),Se=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"visible",void 0),se([t.Property("")],i.prototype,"template",void 0),se([t.Property(null)],i.prototype,"format",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(.75)],i.prototype,"opacity",void 0),se([t.Property(["Circle"])],i.prototype,"markerShapes",void 0),se([t.Complex({width:null,color:null},de)],i.prototype,"border",void 0),se([t.Complex({fontFamily:null,size:null,fontWeight:null,opacity:null},pe)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),xe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"enable",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property("0.5")],i.prototype,"opacity",void 0),se([t.Complex({},de)],i.prototype,"border",void 0),se([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"enable",void 0),se([t.Property("#808080")],i.prototype,"fill",void 0),se([t.Property("0.5")],i.prototype,"opacity",void 0),se([t.Complex({},de)],i.prototype,"border",void 0),se([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),Ie=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"groupPath",void 0),se([t.Property(0)],i.prototype,"groupGap",void 0),se([t.Property(10)],i.prototype,"groupPadding",void 0),se([t.Complex({},de)],i.prototype,"border",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(!1)],i.prototype,"autoFill",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(!0)],i.prototype,"showHeader",void 0),se([t.Property(20)],i.prototype,"headerHeight",void 0),se([t.Property(null)],i.prototype,"headerTemplate",void 0),se([t.Property(null)],i.prototype,"headerFormat",void 0),se([t.Property("Near")],i.prototype,"headerAlignment",void 0),se([t.Complex({color:null,size:"13px",fontFamily:null},pe)],i.prototype,"headerStyle",void 0),se([t.Property("TopLeft")],i.prototype,"templatePosition",void 0),se([t.Collection([],ue)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),Ce=function(){function e(e,t){this.width=e,this.height=t}return e}(),Fe=function(){function e(e,t,i,l){this.x=e,this.y=t,this.width=i,this.height=l}return e}(),we=function(){function e(e,t,i,l,n,o){this.y=n.y,this.x=n.x,this.height=n.height,this.width=n.width,this.id=e,this.fill=t,this.opacity=l,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=o}return e}(),Oe=function(){function e(e,t,i,l,n,o,r){this.id=e,this.opacity=n,this.fill=t,this.stroke=l,this["stroke-width"]=i,this["stroke-dasharray"]=o,this.d=r}return e}(),Le=function(){function e(e,t,i,l,n,o,r,a){void 0===o&&(o=""),this.transform="",this.baseLine="auto",this.id=e,this.text=n,this.transform=o,this.anchor=l,this.x=t,this.y=i,this.baseLine=r,this.connectorText=a}return e}(),Te=function(){function e(e,t){this.x=e,this.y=t}return e}(),Me=function(){function e(e,t,i){this.r=e,this.g=t,this.b=i}return e}(),Ne=function(){function e(e,t,i,l,n){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=l,this.sendData=n}return e}(),_e=function(){function e(e){this.treemap=e}return e.prototype.processLayoutPanel=function(){var e,i;if(this.treemap.treemapLevelData.levelsData&&this.treemap.treemapLevelData.levelsData.length>0)if(e=t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||t.isNullOrUndefined(this.treemap.initialDrillDown.groupName)||(t.isNullOrUndefined(this.treemap.drilledItems)?!t.isNullOrUndefined(this.treemap.drilledItems):0!==this.treemap.drilledItems.length)?this.treemap.treemapLevelData.levelsData[0]:this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0],[])[0],i=t.extend({},this.treemap.areaRect,i,!1),t.isNullOrUndefined(this.treemap.treeMapLegendModule)||t.isNullOrUndefined(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(i=this.treemap.totalRect),t.isNullOrUndefined(this.treemap.currentLevel)||(t.isNullOrUndefined(this.treemap.drilledItems)?t.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length))!t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)&&(t.isNullOrUndefined(this.treemap.drilledItems)?t.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length)&&(this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex),this.calculateLayoutItems(e||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems();else{var l=this.treemap.drilledItems.length-1,n=this.treemap.drilledItems[l].data,o={};o[this.treemap.drilledItems[l].data.groupName]=[n],t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[l].data.groupIndex),this.calculateLayoutItems(o||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems()}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,l={},n=u(e).values;if(n&&n.length>0&&0===t.length){for(var o=0;o<n.length;o++)n[o].groupIndex===i.initialDrillDown.groupIndex&&n[o].name===i.initialDrillDown.groupName&&(n[o].isDrilled=!0,l[n[o].groupName]=[n[o]],t.push(l));for(var r=0;r<n.length;r++)this.getDrilldownData(n[r],t)}return t},e.prototype.calculateLayoutItems=function(e,i){this.renderItems=[],this.parentData=[],t.isNullOrUndefined(this.treemap.weightValuePath)||(this.treemap.layoutType.indexOf("SliceAndDice")>-1?this.computeSliceAndDiceDimensional(e,i):(i.height=i.height+i.y,i.width=i.width+i.x,this.computeSquarifyDimensional(e,i)))},e.prototype.computeSliceAndDiceDimensional=function(e,t){var i,l,n,o,r=this.treemap.leafItemSettings,a=this.treemap.levels,s=u(e).values;if(s&&s.length>0&&(this.sliceAndDiceProcess(s,t),this.treemap.levels.length>0))for(var d=0;d<s.length;d++)l=s[d].groupIndex,n=0===a.length||l===a.length?r.gap:a[l].groupGap,o=0===a.length?0:a[l]?a[l].showHeader?a[l].headerHeight:0:a[l-1].showHeader?a[l-1].headerHeight:0,i=s[d].rect,i=new Fe(i.x+n/2,i.y+(o+n/2),i.width-n,Math.abs(i.height-(n+o))),this.computeSliceAndDiceDimensional(s[d],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var l,n=i.height*i.width,o=this.treemap.levels,r=0,a=0;e.forEach(function(e){a+=e.weight}),e.forEach(function(e){e.weightArea=n*e.weight/a});var s="SliceAndDiceAuto"===this.treemap.layoutType?i.width>i.height:"SliceAndDiceHorizontal"===this.treemap.layoutType;e.sort(c);for(var d=0;d<e.length;d++){var h=e[d];h.isLeafItem=0===o.length||(this.treemap.isHierarchicalData||t.isNullOrUndefined(this.treemap.leafItemSettings.labelPath)?h.groupIndex===o.length-1:h.groupIndex===this.treemap.levels.length),s?(l=n/a*e[d].weight/i.height,r<=i.width&&(e[d].rect=new Fe(r+i.x,i.y,l,i.height))):(l=n/a*e[d].weight/i.width,r<=i.height&&(e[d].rect=new Fe(i.x,r+i.y,i.width,l))),r+=l,this.renderItems.push(e[d])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,l,n,o,r,a=this.treemap.leafItemSettings,s=this.treemap.levels,d=u(e).values;if(d&&d.length>0&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(d)),this.calculateChildrenLayout(e,d,t),this.treemap.levels.length>0))for(var h=0;h<d.length;h++)n=(l=d[h]).groupIndex,i=l.rect,o=(l.isLeafItem?a.padding:s[n].groupPadding)/2,r=this.treemap.isHierarchicalData?0===n&&l.isLeafItem?0:s[n]&&s[n].showHeader?s[n].headerHeight:0:0===s.length?0:s[n]&&s[n].showHeader?s[n].headerHeight:0,i=new Fe(i.x+o,i.y+(r+o),i.width-o,i.height-o),!l.isLeafItem&&l.weight>0&&this.computeSquarifyDimensional(d[h],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,b(i)),t.sort(H),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,l){var n=e.length;if(0===n){c=this.getCoordinates(t,i);return m=l.concat(c)}var o=I(i),r=e[0],a=e.slice(1,n);if(this.aspectRatio(t,r,o)){var s=t.concat(r);return this.performRowsLayout(a,s,i,l)}for(var d=t.length,h=0,p=0;p<d;p+=1)h+=t[p].itemArea;var g=this.cutArea(i,h),c=this.getCoordinates(t,i),m=l.concat(c);return this.performRowsLayout(e,[],g,m)},e.prototype.aspectRatio=function(e,t,i){if(0===e.length)return!0;var l=e.concat(t);return this.findMaxAspectRatio(e,i)>=this.findMaxAspectRatio(l,i)},e.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,l=1/0,n=-1/0,o=0,r=0;r<i;r+=1){var a=e[r].itemArea;a<l&&(l=a),a>n&&(n=a),o+=a}return Math.max(Math.pow(t,2)*n/Math.pow(o,2),Math.pow(o,2)/(Math.pow(t,2)*l))},e.prototype.cutArea=function(e,t){var i=C(e),l=i.width,n=i.height,o=i.x,r=i.y;if(l>=n){var a=t/n;return F(d={x:o+a,y:r,width:l-a,height:n})}var s=t/l,d={x:o,y:r+s,width:l,height:n-s};return F(d)},e.prototype.getCoordinates=function(e,i){for(var l,n=C(i),o=n.width,r=n.height,a=n.x,s=n.y,d=e.length,h=this.treemap.levels,p=this.treemap.leafItemSettings,g=0,c=0;c<d;c+=1)g+=e[c].itemArea;for(var m,u,f,y=g/r,v=g/o,S=a,x=s,b=[],c=0;c<d;c+=1){var I=e[c];if(l=I.groupIndex,I.isLeafItem=0===h.length||(this.treemap.isHierarchicalData?l===h.length:!t.isNullOrUndefined(p.labelPath)&&l===h.length),u=Z(this.parentData[0],I),f=u?this.treemap.areaRect:I.parent.rect,m=I.isLeafItem?p.padding:h[l].groupPadding,o>=r){var F=x+I.itemArea/y;I.rect={x:S,y:x,width:S+y,height:F},x=F}else{var w=S+I.itemArea/v;I.rect={x:S,y:x,width:w,height:x+v},S=w}I.weight>0&&(u||Math.round(i.y+m/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+m/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(I),b.push(I))}return b},e.prototype.computeTotalArea=function(e,t){for(var i=e.length,l=[],n=0;n<i;n+=1){for(var o=e.length,r=0,a=0;a<o;a+=1)r+=e[a].weight;for(var s=t/r,d=void 0,h=0;h<o;h++)(d=e[h]).itemArea=d.weight*s,l.push(d)}return l},e.prototype.onDemandProcess=function(e){var i,l={};l=e[0].parent,this.treemap.currentLevel=l.isDrilled?l.groupIndex:null;var n={};t.isNullOrUndefined(l.groupName)?n=l:n[l.groupName]=[l],i=t.extend({},this.treemap.areaRect,i,!1),t.isNullOrUndefined(this.treemap.treeMapLegendModule)||t.isNullOrUndefined(this.treemap.totalRect)||(i=this.treemap.totalRect);for(var o=this.treemap.levels.length,r=0;r<o;r++)o===e[0].groupIndex?this.treemap.levels[o]=this.treemap.levels[r]:this.treemap.levels.splice(o-1,1);this.calculateLayoutItems(n,i),this.renderLayoutItems()},e.prototype.renderLayoutItems=function(){var e,i,l,n,o=this,r=this.treemap;this.renderer=r.renderer;var a,s,d,h,p,g,c,m,f,y,v,S,x,b=r.element.id,I=r.layoutType,F=this.treemap.leafItemSettings.interSectAction,w="",O=document.getElementById(r.element.id+"_Secondary_Element"),L=r.levels;this.layoutGroup=this.renderer.createGroup({id:b+"_TreeMap_"+I+"_Layout"});var T,M,N,_=t.createElement("div",{id:r.element.id+"_Label_Template_Group",className:"template"});_.style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+r.areaRect.y+"px;left:"+r.areaRect.x+"px;height:"+r.areaRect.height+"px;width:"+r.areaRect.width+"px;";for(var E,D,P=!1,B=r.leafItemSettings,z=this,H=0;H<this.renderItems.length;H++)!function(I){if(c=z.renderItems[I],s=c.groupIndex,z.treemap.drillDownView&&t.isNullOrUndefined(z.treemap.currentLevel)&&s>0||z.treemap.drillDownView&&s>z.treemap.currentLevel+1)return"continue";h=c.rect,P=c.isLeafItem,y=b+"_Level_Index_"+s+"_Item_Index_"+I,T=z.renderer.createGroup({id:y+"_Group"}),S=(P?B.gap:L[s].groupGap)/2;var H=z.treemap.totalRect?r.legendSettings.visible?z.treemap.totalRect:C(z.treemap.totalRect):z.treemap.areaRect;"Squarified"===r.layoutType&&(h.width=Math.abs(h.x-h.width)-S,h.height=Math.abs(h.y-h.height)-S),"TopRightBottomLeft"===r.renderDirection?h.x=H.x+H.width-h.width-Math.abs(H.x-h.x):"BottomLeftTopRight"===r.renderDirection?h.y=H.y+H.height-h.height-Math.abs(H.y-h.y):"BottomRightTopLeft"===r.renderDirection&&(h.x=H.x+H.width-h.width-Math.abs(H.x-h.x),h.y=H.y+H.height-h.height-Math.abs(H.y-h.y)),l=z.getItemColor(P,c),g=l.fill,f=l.opacity,p=P?B.labelFormat:L[s].headerFormat;var U;if(i=P?B.showLabels:L[s].showHeader,s===z.treemap.currentLevel)if(z.treemap.enableBreadcrumb){D="#"+z.treemap.breadcrumbConnector+"#",U=c.levelOrderName.replace(/#/gi,D),U=0!==s?"#"+U:U}else U=c.name;else z.treemap.enableBreadcrumb&&(c.isDrilled=!1),U=c.name;m=W(p,c.data,z.treemap)||U||"undefined",E=u(c).values,m=!P&&E&&E.length>0&&z.treemap.enableDrillDown?c.isDrilled?r.enableRtl?m+" [-]":"[-] "+m:r.enableRtl?m+" [+]":"[+] "+m:m,r.enableHtmlSanitizer&&(m=t.SanitizeHtmlHelper.sanitize(m));var k=P?B.labelStyle.fontFamily:L[s].headerStyle.fontFamily;k=k||z.treemap.themeStyle.labelFontFamily;var A=P?B.labelStyle.size:L[s].headerStyle.size;A=A||z.treemap.themeStyle.labelFontSize;var j=P?B.labelStyle.fontWeight:L[s].headerStyle.fontWeight;j=j||z.treemap.themeStyle.fontWeight;var V=P?B.labelStyle.color:L[s].headerStyle.color,G=P?B.labelStyle.fontStyle:L[s].headerStyle.fontStyle,q=P?B.labelStyle.opacity:L[s].headerStyle.opacity;x={fontFamily:k,size:A,fontWeight:j,color:V,fontStyle:G,opacity:q},N=P?B.border:L[s].border,e=P?B.labelPosition:"Near"===L[s].headerAlignment?"TopLeft":"Center"===L[s].headerAlignment?"TopCenter":"TopRight",d=P?B.templatePosition:L[s].templatePosition,M=P?B.labelTemplate:L[s].headerTemplate,c.options={border:N,opacity:f,fill:g},n={cancel:!1,name:"itemRendering",treemap:z.treemap,text:m,currentItem:c,RenderItems:z.renderItems,options:c.options,textColor:x.color},z.treemap.trigger("itemRendering",n,function(l){if(!l.cancel){w=" M "+h.x+" "+h.y+" L "+(h.x+h.width)+" "+h.y+" L "+(h.x+h.width)+" "+(h.y+h.height)+" L "+h.x+" "+(h.y+h.height)+"z",a=new Oe(y+"_RectPath",g,N.width,N.color,f,null,w);var r=o.renderer.drawPath(a);T.appendChild(r),i&&(n.text!==m&&(n.text=W(n.text,c.data,o.treemap)||U),x.color=n.textColor?n.textColor:x.color,o.renderItemText(n.text.toString(),T,x,h,F,y,g,e,D)),M&&(v=o.renderTemplate(O,y,h,d,M,c,P),t.isNullOrUndefined(v)||(_.appendChild(v),o.treemap.renderReactTemplates())),T.setAttribute("aria-label",c.name),o.treemap.enableDrillDown&&!P||o.treemap.selectionSettings.enable||o.treemap.highlightSettings.enable?(T.setAttribute("role","button"),T.setAttribute("tabindex",o.treemap.tabIndex.toString()),T.style.outline="none",T.style.cursor=o.treemap.highlightSettings.enable&&!o.treemap.selectionSettings.enable&&o.treemap.enableDrillDown&&c.groupIndex===o.treemap.levels.length-1?"default":!o.treemap.highlightSettings.enable||o.treemap.selectionSettings.enable||o.treemap.enableDrillDown?"pointer":"default"):T.setAttribute("role","region"),R(o.treemap,T,"treeMapSelection"),o.layoutGroup.appendChild(T)}})}(H);_.childNodes.length>0&&O.appendChild(_),this.treemap.svgObject.appendChild(this.layoutGroup),R(this.treemap,this.layoutGroup,"treeMapSelection")},e.prototype.renderItemText=function(e,i,l,n,o,s,d,p,g){var c,m,u,f=[],y=[],v=0;if(f=-1!==e.indexOf("<br>")?e.split("<br>"):null,m=this.labelInterSectAction(n,e,l,o),c=r(f&&f[0]||m[0],l),this.treemap.enableRtl){var x=r(e,l),b=e.search("[+]")||e.search("[-]");if(n.width<x.width&&b>0){var I=e.substring(b-1,e.length),C=r("[+]",l);m[0]=a(n.width-C.width-5,m[0],l)+I}}var F=S(n,p,c,"Text",this.treemap);if(!t.isNullOrUndefined(f)){for(var w=[],O=null,L=[],T=0;T<f.length;T++)v+=(c=r(O=a(n.width-5,f[T],l),l)).height,L.push(c.width),w.push(O);m=w,c.width=Math.max.apply(null,L),c.height=v}if("WrapByWord"===o||"Wrap"===o||"Trim"===o){for(var M=0;M<m.length;M++)v+=(c=r(m[M],l)).height,n.height-5>v&&y.push(m[M]);if("Wrap"===o&&m.length!==y.length&&y.length){var N=y.length-1,_=y[N];_=_.substring(0,_.length-1)+"...",y.splice(N),"..."!==_&&y.push(_)}}else u=m,y.push(u);h(new Le(s+"_Text",F.x,F.y,"start",y,"","",g),l,l.color||this.getSaturatedColor(d),i)},e.prototype.getItemColor=function(e,i){var l=this.treemap,n=e?l.leafItemSettings.fill:l.levels[i.groupIndex].fill,o=e?l.leafItemSettings.opacity:l.levels[i.groupIndex].opacity;t.isNullOrUndefined(l.treemapLevelData.defaultLevelsData)||l.treemapLevelData.defaultLevelsData.length>0&&(l.treemapLevelData.levelsData=l.treemapLevelData.defaultLevelsData);var r=u(l.treemapLevelData.levelsData[0]).values,a=e?l.leafItemSettings.colorMapping:l.levels[i.groupIndex].colorMapping;if(a.length>0){var s=O(a,i.data[l.equalColorValuePath],i.data[l.rangeColorValuePath]);t.isNullOrUndefined(s)||(n=t.isNullOrUndefined(s.fill)?l.leafItemSettings.fill:s.fill,o=s.opacity)}else for(var d=0;d<r.length;d++)r[d].levelOrderName===i.levelOrderName.split("#")[0]&&(n=t.isNullOrUndefined(n)?t.isNullOrUndefined(l.colorValuePath)?t.isNullOrUndefined(i.options)?!t.isNullOrUndefined(l.palette)&&l.palette.length>0?l.palette[d%l.palette.length]:"#808080":i.options.fill:r[d].data[l.colorValuePath]:n);return{fill:n,opacity:o}},e.prototype.getSaturatedColor=function(e){var t=e,i=q(X(t="transparent"===t?window.getComputedStyle(document.body,null).backgroundColor:t));return Math.round((299*i.r+587*i.g+114*i.b)/1e3)>=128?"black":"white"},e.prototype.renderTemplate=function(e,i,l,n,o,r,a){var s=a?i+"_LabelTemplate":i+"_HeaderTemplate",d=a?"_LabelTemplate":"_HeaderTemplate";if(t.isNullOrUndefined(o.prototype)&&"string"==typeof o)for(var h=Object.keys(r.data),p=0;p<h.length;p++){var g=RegExp;o=o.replace(new g("{{:"+h[p]+"}}","g"),r.data[h[p].toString()])}this.treemap.enableHtmlSanitizer&&"string"==typeof o&&(o=t.SanitizeHtmlHelper.sanitize(o));var c;if(!t.isNullOrUndefined(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var m=S(l,n,x(c=v(y(o)(r.data,this.treemap,o,this.treemap.element.id+d,!1),s,r.data),e),"Template",this.treemap);c.style.left=m.x+"px",c.style.top=m.y+"px"}return c},e.prototype.labelInterSectAction=function(e,t,i,l){var n,o=e.width-10;switch(l){case"Hide":n=[z(o,e.height,t,i)];break;case"Trim":n=[a(o+3,t,i)];break;case"WrapByWord":n=P(o,t,i);break;case"Wrap":n=B(o,t,i)}return n},e.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]},e}();!function(e){e.mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"}}(e.Theme||(e.Theme={}));var Ee=function(){function e(e){}return e.prototype.print=function(e,i){var l=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no");l.moveTo(0,0),l.resizeTo(screen.availWidth,screen.availHeight);var n={cancel:!1,htmlContent:this.getHTMLContent(e,i),name:"beforePrint"};e.trigger("beforePrint",n,function(){n.cancel||t.print(n.htmlContent,l)})},e.prototype.getHTMLContent=function(e,i){var l=t.createElement("div");if(i)i instanceof Array?i.forEach(function(e){l.appendChild(g(e).cloneNode(!0))}):i instanceof Element?l.appendChild(i.cloneNode(!0)):l.appendChild(g(i).cloneNode(!0));else{var n=e.element.cloneNode(!0),o=n.getElementsByTagName("svg")[0];if(!t.isNullOrUndefined(o)&&(o