@syncfusion/ej2-treemap 27.1.50 → 27.1.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  /*!
2
2
  * filename: ej2-treemap.min.js
3
- * version : 27.1.50
3
+ * version : 27.1.55
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
8
8
  * applicable laws.
9
9
  */
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionSvgBase"),require("SyncfusionData"),require("SyncfusionPdfExport")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionSvgBase","SyncfusionData","SyncfusionPdfExport"],t):"object"==typeof exports?exports.SyncfusionTreemap=t(require("SyncfusionBase"),require("SyncfusionSvgBase"),require("SyncfusionData"),require("SyncfusionPdfExport")):e.SyncfusionTreemap=t(e.SyncfusionBase,e.SyncfusionSvgBase,e.SyncfusionData,e.SyncfusionPdfExport)}(self,((e,t,i,r)=>(()=>{"use strict";var o={766:t=>{t.exports=e},74:e=>{e.exports=i},461:e=>{e.exports=r},727:e=>{e.exports=t}},l={};function n(e){var t=l[e];if(void 0!==t)return t.exports;var i=l[e]={exports:{}};return o[e](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{n.r(a),n.d(a,{Border:()=>O,ColorMapping:()=>M,ColorValue:()=>Ee,CommonTitleSettings:()=>N,Font:()=>T,HighlightSettings:()=>U,ImageExport:()=>Ke,InitialDrillSettings:()=>_,LayoutPanel:()=>Ye,LeafItemSettings:()=>B,LegendSettings:()=>P,LevelSettings:()=>k,LevelsData:()=>lt,Location:()=>J,Margin:()=>L,PathOption:()=>G,PdfExport:()=>tt,Print:()=>$e,Rect:()=>W,RectOption:()=>j,SelectionSettings:()=>z,Size:()=>A,SubTitleSettings:()=>D,TextOption:()=>q,Theme:()=>Je,TitleSettings:()=>E,TooltipSettings:()=>R,TreeMap:()=>ot,TreeMapAjax:()=>ke,TreeMapHighlight:()=>at,TreeMapLegend:()=>nt,TreeMapSelection:()=>st,TreeMapTooltip:()=>dt,applyOptions:()=>Te,beforePrint:()=>l,click:()=>f,colorCollections:()=>me,colorMap:()=>ce,colorNameToHex:()=>Be,componentToHex:()=>Pe,convertElement:()=>le,convertHexToColor:()=>_e,convertToContainer:()=>de,convertToHexCode:()=>Me,convertToRect:()=>pe,createTextStyle:()=>Z,deSaturationColor:()=>ue,defaultFont:()=>F,doubleClick:()=>y,drawSymbol:()=>Re,drillEnd:()=>d,drillStart:()=>h,findChildren:()=>ie,findHightLightItems:()=>re,findLabelLocation:()=>ne,findPosition:()=>Y,formatValue:()=>De,getArea:()=>se,getColorByValue:()=>ye,getElement:()=>K,getGradientColor:()=>ve,getLegendIndex:()=>Ge,getMousePosition:()=>ge,getPercentage:()=>Se,getPercentageColor:()=>be,getShortestEdge:()=>he,getTemplateFunction:()=>oe,getThemeStyle:()=>Qe,hide:()=>Fe,isContainsData:()=>te,isParentItem:()=>Ue,itemClick:()=>u,itemHighlight:()=>g,itemMove:()=>m,itemRendering:()=>s,itemSelected:()=>p,itemsToOrder:()=>ee,legendItemRendering:()=>S,legendMaintain:()=>Oe,legendRendering:()=>x,load:()=>r,loaded:()=>o,maintainSelection:()=>Ie,measureElement:()=>ae,measureText:()=>V,mouseMove:()=>b,orderByArea:()=>Ce,pushCollection:()=>Ve,removeClassNames:()=>Le,removeElement:()=>Xe,removeLegend:()=>He,removeSelectionWithHighlight:()=>je,removeShape:()=>Ae,renderLegendShape:()=>ze,renderTextElement:()=>Q,resize:()=>w,rgbToHex:()=>fe,rightClick:()=>v,setColor:()=>We,setItemTemplateContent:()=>$,stringToNumber:()=>H,textFormatter:()=>Ne,textTrim:()=>X,textWrap:()=>we,tooltipRendering:()=>c,triggerDownload:()=>qe,wordWrap:()=>xe});var e,t=n(766),i=n(727),r="load",o="loaded",l="beforePrint",s="itemRendering",h="drillStart",d="drillEnd",p="itemSelected",g="itemHighlight",c="tooltipRendering",u="itemClick",m="itemMove",f="click",y="doubleClick",v="rightClick",b="mouseMove",S="legendItemRendering",x="legendRendering",w="resize",F="Roboto, Segoe UI, Noto, Sans-serif",C=(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])},e(t,i)},function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}),I=function(e,t,i,r){var o,l=arguments.length,n=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(l<3?o(n):l>3?o(t,i,n):o(t,i))||n);return l>3&&n&&Object.defineProperty(t,i,n),n},O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)("#808080")],i.prototype,"color",void 0),I([(0,t.Property)(0)],i.prototype,"width",void 0),i}(t.ChildProperty),L=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(10)],i.prototype,"left",void 0),I([(0,t.Property)(10)],i.prototype,"right",void 0),I([(0,t.Property)(10)],i.prototype,"top",void 0),I([(0,t.Property)(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),T=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(null)],i.prototype,"size",void 0),I([(0,t.Property)(null)],i.prototype,"color",void 0),I([(0,t.Property)(F)],i.prototype,"fontFamily",void 0),I([(0,t.Property)("")],i.prototype,"fontWeight",void 0),I([(0,t.Property)("Normal")],i.prototype,"fontStyle",void 0),I([(0,t.Property)(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)("")],i.prototype,"text",void 0),I([(0,t.Property)("")],i.prototype,"description",void 0),i}(t.ChildProperty),D=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Complex)({fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),I([(0,t.Property)("Center")],i.prototype,"alignment",void 0),i}(N),E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Complex)({fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),I([(0,t.Property)("Center")],i.prototype,"alignment",void 0),I([(0,t.Complex)({},D)],i.prototype,"subtitleSettings",void 0),i}(N),M=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(null)],i.prototype,"from",void 0),I([(0,t.Property)(null)],i.prototype,"to",void 0),I([(0,t.Property)(null)],i.prototype,"color",void 0),I([(0,t.Property)(null)],i.prototype,"label",void 0),I([(0,t.Property)(null)],i.prototype,"value",void 0),I([(0,t.Property)(null)],i.prototype,"minOpacity",void 0),I([(0,t.Property)(null)],i.prototype,"maxOpacity",void 0),I([(0,t.Property)(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),P=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(!1)],i.prototype,"visible",void 0),I([(0,t.Property)("Default")],i.prototype,"mode",void 0),I([(0,t.Property)("transparent")],i.prototype,"background",void 0),I([(0,t.Property)("Circle")],i.prototype,"shape",void 0),I([(0,t.Property)("")],i.prototype,"width",void 0),I([(0,t.Property)("")],i.prototype,"height",void 0),I([(0,t.Complex)({size:null,fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),I([(0,t.Property)(null)],i.prototype,"fill",void 0),I([(0,t.Property)(1)],i.prototype,"opacity",void 0),I([(0,t.Property)(15)],i.prototype,"shapeWidth",void 0),I([(0,t.Property)(15)],i.prototype,"shapeHeight",void 0),I([(0,t.Property)(10)],i.prototype,"shapePadding",void 0),I([(0,t.Property)(null)],i.prototype,"imageUrl",void 0),I([(0,t.Complex)({color:null,width:null},O)],i.prototype,"border",void 0),I([(0,t.Complex)({color:"#000000",width:0},O)],i.prototype,"shapeBorder",void 0),I([(0,t.Complex)({},N)],i.prototype,"title",void 0),I([(0,t.Complex)({size:null,fontFamily:null,fontWeight:null},T)],i.prototype,"titleStyle",void 0),I([(0,t.Property)("Bottom")],i.prototype,"position",void 0),I([(0,t.Property)("None")],i.prototype,"orientation",void 0),I([(0,t.Property)(!1)],i.prototype,"invertedPointer",void 0),I([(0,t.Property)("After")],i.prototype,"labelPosition",void 0),I([(0,t.Property)("None")],i.prototype,"labelDisplayMode",void 0),I([(0,t.Property)("Center")],i.prototype,"alignment",void 0),I([(0,t.Property)({x:0,y:0})],i.prototype,"location",void 0),I([(0,t.Property)(null)],i.prototype,"showLegendPath",void 0),I([(0,t.Property)(null)],i.prototype,"valuePath",void 0),I([(0,t.Property)(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(null)],i.prototype,"groupIndex",void 0),I([(0,t.Property)(null)],i.prototype,"groupName",void 0),i}(t.ChildProperty),B=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(null)],i.prototype,"fill",void 0),I([(0,t.Property)(!1)],i.prototype,"autoFill",void 0),I([(0,t.Complex)({},O)],i.prototype,"border",void 0),I([(0,t.Property)(0)],i.prototype,"gap",void 0),I([(0,t.Property)(10)],i.prototype,"padding",void 0),I([(0,t.Property)(1)],i.prototype,"opacity",void 0),I([(0,t.Property)(!0)],i.prototype,"showLabels",void 0),I([(0,t.Property)(null)],i.prototype,"labelPath",void 0),I([(0,t.Property)(null)],i.prototype,"labelFormat",void 0),I([(0,t.Property)("TopLeft")],i.prototype,"labelPosition",void 0),I([(0,t.Complex)({color:null,size:null},T)],i.prototype,"labelStyle",void 0),I([(0,t.Property)(null)],i.prototype,"labelTemplate",void 0),I([(0,t.Property)("Center")],i.prototype,"templatePosition",void 0),I([(0,t.Property)("Trim")],i.prototype,"interSectAction",void 0),I([(0,t.Collection)([],M)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),R=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(!1)],i.prototype,"visible",void 0),I([(0,t.Property)("")],i.prototype,"template",void 0),I([(0,t.Property)(null)],i.prototype,"format",void 0),I([(0,t.Property)(null)],i.prototype,"fill",void 0),I([(0,t.Property)(.75)],i.prototype,"opacity",void 0),I([(0,t.Property)(["Circle"])],i.prototype,"markerShapes",void 0),I([(0,t.Complex)({width:null,color:null},O)],i.prototype,"border",void 0),I([(0,t.Complex)({fontFamily:null,size:null,fontWeight:null,opacity:null},T)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(!1)],i.prototype,"enable",void 0),I([(0,t.Property)(null)],i.prototype,"fill",void 0),I([(0,t.Property)("0.5")],i.prototype,"opacity",void 0),I([(0,t.Complex)({},O)],i.prototype,"border",void 0),I([(0,t.Property)("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),U=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(!1)],i.prototype,"enable",void 0),I([(0,t.Property)("#808080")],i.prototype,"fill",void 0),I([(0,t.Property)("0.5")],i.prototype,"opacity",void 0),I([(0,t.Complex)({},O)],i.prototype,"border",void 0),I([(0,t.Property)("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),k=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(null)],i.prototype,"groupPath",void 0),I([(0,t.Property)(0)],i.prototype,"groupGap",void 0),I([(0,t.Property)(10)],i.prototype,"groupPadding",void 0),I([(0,t.Complex)({},O)],i.prototype,"border",void 0),I([(0,t.Property)(null)],i.prototype,"fill",void 0),I([(0,t.Property)(!1)],i.prototype,"autoFill",void 0),I([(0,t.Property)(1)],i.prototype,"opacity",void 0),I([(0,t.Property)(!0)],i.prototype,"showHeader",void 0),I([(0,t.Property)(20)],i.prototype,"headerHeight",void 0),I([(0,t.Property)(null)],i.prototype,"headerTemplate",void 0),I([(0,t.Property)(null)],i.prototype,"headerFormat",void 0),I([(0,t.Property)("Near")],i.prototype,"headerAlignment",void 0),I([(0,t.Complex)({color:null,size:"13px"},T)],i.prototype,"headerStyle",void 0),I([(0,t.Property)("TopLeft")],i.prototype,"templatePosition",void 0),I([(0,t.Collection)([],M)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),A=function(e,t){this.width=e,this.height=t};function H(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}var W=function(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r},j=function(e,t,i,r,o,l){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=r,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=l},G=function(e,t,i,r,o,l,n){this.id=e,this.opacity=o,this.fill=t,this.stroke=r,this["stroke-width"]=i,this["stroke-dasharray"]=l,this.d=n};function V(e,i){var r=document.getElementById("treeMapMeasureText");return null===r&&(r=(0,t.createElement)("text",{id:"treeMapMeasureText"}),document.body.appendChild(r)),r.innerHTML=t.SanitizeHtmlHelper.sanitize(e),r.style.position="absolute",r.style.fontSize=i.size,r.style.fontWeight=i.fontWeight,r.style.fontStyle=i.fontStyle,r.style.fontFamily=i.fontFamily,r.style.visibility="hidden",r.style.top="-100",r.style.left="0",r.style.whiteSpace="nowrap",r.style.lineHeight="normal",new A(r.clientWidth,r.clientHeight)}var q=function(e,t,i,r,o,l,n,a){void 0===l&&(l=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=l,this.anchor=r,this.x=t,this.y=i,this.baseLine=n,this.connectorText=a};function X(e,t,i){var r=t,o=V(t,i).width;if(o>e)for(var l=t.length-1;l>=0;--l)if((o=V(r=t.substring(0,l)+"...",i).width)<=e||r.length<4)return r.length<4&&(r=" "),r;return r}var J=function(e,t){this.x=e,this.y=t};function Y(e,t,i,r){var o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===r?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===r?e.width-e.y-i.width:e.x+e.width-i.width}var l="title"===r?e.y+i.height/2:e.y+e.height/2+i.height/2;return new J(o,l)}function Z(e,t,i){var r=e.createText(t,i);return r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.style["user-select"]="none",r.style["-moz-user-select"]="none",r.style["-webkit-touch-callout"]="none",r.style["-webkit-user-select"]="none",r.style["-khtml-user-select"]="none",r.style["-ms-user-select"]="none",r.style["-o-user-select"]="none",r}function Q(e,r,o,l,n){void 0===n&&(n=!1);var a,s,h,d={"font-size":r.size,"font-style":r.fontStyle,"font-family":r.fontFamily,"font-weight":r.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:r.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:o},p="string"==typeof e.text?e.text:n?e.text[e.text.length-1]:e.text[0],g=new i.SvgRenderer("");if(!(0,t.isNullOrUndefined)(p)&&!(0,t.isNullOrUndefined)(e.connectorText)&&p.search(e.connectorText[1])>=0)for(var c=p.split("#"),u=0;u<c.length;u++){var m=-1===c[u].search(e.connectorText)||(0,t.isNullOrUndefined)(e.connectorText)?c[u]:e.connectorText;if(d.id=e.id+"_"+u,h=Z(g,d,m),u%2==0&&0!==u){m=m.replace(/\s+/g,"&nbsp")}var f=V(m,r);d.x=0!==u?d.x+f.width:d.x+f.width+5,l.appendChild(h)}else h=Z(g,d,p),l.appendChild(h);if("string"!=typeof e.text&&e.text.length>1){for(var y=1,v=e.text.length;y<v;y++)s=V(e.text[y],r).height,a=g.createTSpan({x:e.x,id:e.id,y:e.y+y*s},e.text[y]),h.appendChild(a);l.appendChild(h)}return h}function $(e,i,r){var o,l=e.split("_RectPath")[0];o=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+l+"_LabelTemplate"),(0,t.isNullOrUndefined)(o)||(o.innerHTML=r)}function K(e){return document.getElementById(e)}function ee(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function te(e,t,i,r){for(var o=!1,l="",n=r.leafItemSettings,a=0;a<e.length;a++){var s=i[r.levels[a]?r.levels[a].groupPath:n.labelPath?n.labelPath:r.weightValuePath]||"undefined";if(e[a]===s&&(l+=s+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}function ie(e){var t;if(e){var i=Object.keys(e);t={};for(var r=0;r<i.length;r++)if(e[i[r]]instanceof Array){t.values=e[i[r]],t.key=i[r];break}}return t}function re(e,t,i,r){if("Child"===i){t.push(e.levelOrderName);var o=ie(e).values;if(o&&o.length>0){for(var l=0;l<o.length;l++)-1===t.indexOf(o[l].levelOrderName)&&t.push(o[l].levelOrderName);for(var n=0;n<o.length;n++)re(o[n],t,i,r)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),re(e.parent,t,i,r));else if("All"===i){var a=e.levelOrderName.split("#")[0],s=void 0;for(l=0;l<r.layout.renderItems.length;l++)(s=r.layout.renderItems[l]).levelOrderName.indexOf(a)>-1&&-1===t.indexOf(s.levelOrderName)&&t.push(s.levelOrderName)}else t.push(e.levelOrderName);return t}function oe(e){var i=null;try{i="function"!=typeof e&&document.querySelectorAll(e).length?(0,t.compile)(document.querySelector(e).innerHTML.trim()):(0,t.compile)(e)}catch(r){i=(0,t.compile)(e)}return i}function le(e,i,r){var o=(0,t.createElement)("div",{id:i});o.style.cssText="position: absolute;pointer-events: auto;";for(var l=e.length;l>0;)o.appendChild(e[0]),l--;for(var n=o.innerHTML,a=Object.keys(r),s=0;s<a.length;s++){var h=RegExp;n=n.replace(new h("{{:"+a[s]+"}}","g"),r[a[s].toString()])}return o.innerHTML=n,o}function ne(e,t,i,r,o){var l=new J(0,0),n="Template"===r?o.areaRect.x:0,a="Template"===r?o.areaRect.y:0;return l.x=Math.abs(n-(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,!o.enableDrillDown||"BottomLeftTopRight"!==o.renderDirection&&"BottomRightTopLeft"!==o.renderDirection?l.y=Math.abs(a-(t.indexOf("Top")>-1?"Template"===r?e.y:e.y+i.height:t.indexOf("Bottom")>-1?e.y+e.height-i.height:"Template"===r?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):l.y=Math.abs(e.y+e.height-i.height+5),l}function ae(e,t){var i=new A(0,0);t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth;var r=document.getElementById(e.id);return r.parentNode.removeChild(r),i}function se(e){return(e.width-e.x)*(e.height-e.y)}function he(e){var t=de(e),i=t.width,r=t.height;return Math.min(i,r)}function de(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function pe(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function ge(e,t,i){var r=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,l=i.ownerDocument.defaultView.pageYOffset,n=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=r.left+o-a,h=r.top+l-n;return new J(e-s,t-h)}function ce(e,i,r){var o,l,n=[];if((0,t.isNullOrUndefined)(i)&&(0,t.isNullOrUndefined)(r)&&isNaN(r))return null;for(var a=0;a<e.length;a++){var s=!1,h=r;(0,t.isNullOrUndefined)(e[a].from)||(0,t.isNullOrUndefined)(e[a].to)||(0,t.isNullOrUndefined)(e[a].value)?((0,t.isNullOrUndefined)(e[a].from)||(0,t.isNullOrUndefined)(e[a].to))&&(0,t.isNullOrUndefined)(e[a].value)||(r>=e[a].from&&e[a].to>=r||e[a].value===i)&&(e[a].value===i&&(s=!0),o="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:me(e[a],h):e[a].color):r>=e[a].from&&e[a].to>=r&&e[a].value===i&&(s=!0,o="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:me(e[a],h):e[a].color),(r>=e[a].from&&r<=e[a].to||e[a].value===i)&&!(0,t.isNullOrUndefined)(e[a].minOpacity)&&!(0,t.isNullOrUndefined)(e[a].maxOpacity)&&o&&(l=ue(e[a],r)),(""===o||(0,t.isNullOrUndefined)(o))&&(0,t.isNullOrUndefined)(e[a].from)&&(0,t.isNullOrUndefined)(e[a].to)&&(0,t.isNullOrUndefined)(e[a].minOpacity)&&(0,t.isNullOrUndefined)(e[a].maxOpacity)&&(0,t.isNullOrUndefined)(e[a].value)&&(o="[object Array]"===Object.prototype.toString.call(e[a].color)?e[a].color[0]:e[a].color),l=(0,t.isNullOrUndefined)(l)?"1":l,n.push(o)}for(var d=n.length-1;d>=0;d--)d=(o=n[d])?-1:d;return{fill:o,opacity:l}}function ue(e,t){var i=1;t>=e.from&&t<=e.to&&(i=(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity);return i.toString()}function me(e,t){return ye(e,t)}function fe(e,t,i){return"#"+Pe(e)+Pe(t)+Pe(i)}function ye(e,t){var i;return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:fe((i=ve(Number(t),e)).r,i.g,i.b)}function ve(e,t){var i,r,o=t.from,l=t.to,n=0,a=l-o;if(n=(e-o)/a,t.color.length<=2)i="#"===t.color[0].charAt(0)?t.color[0]:Be(t.color[0]),r="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:Be(t.color[t.color.length-1]);else{i="#"===t.color[0].charAt(0)?t.color[0]:Be(t.color[0]),r="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:Be(t.color[t.color.length-1]);for(var s=a/(t.color.length-1),h=t.color.length-1,d=[],p={},g=1;g<h;g++)p={b:o+g*s,color:t.color[g]},d.push(p);for(var c=0;c<d.length;c++)o<=e&&e<=d[c].b&&0===c?(r="#"===d[c].color.charAt(0)?d[c].color:Be(d[c].color),n=e<d[c].b?1-Math.abs((e-d[c].b)/s):(e-d[c].b)/s):d[c].b<=e&&e<=l&&c===d.length-1&&(i="#"===d[c].color.charAt(0)?d[c].color:Be(d[c].color),n=e<d[c].b?1-Math.abs((e-d[c].b)/s):(e-d[c].b)/s),c!==d.length-1&&c<d.length&&d[c].b<=e&&e<=d[c+1].b&&(i="#"===d[c].color.charAt(0)?d[c].color:Be(d[c].color),r="#"===d[c+1].color.charAt(0)?d[c+1].color:Be(d[c+1].color),n=Math.abs(e-d[c+1].b)/s)}return be(n,i,r)}function be(e,t,i){var r=i.split("#")[1],o=t.split("#")[1],l=Se(e,parseInt(o.substr(0,2),16),parseInt(r.substr(0,2),16)),n=Se(e,parseInt(o.substr(2,2),16),parseInt(r.substr(2,2),16)),a=Se(e,parseInt(o.substr(4,2),16),parseInt(r.substr(4,2),16));return new Ee(l,n,a)}function Se(e,t,i){var r=i-t;return Math.round(t+r*e)}function xe(e,t,i){for(var r,o=t.split(" "),l="",n=[],a=0,s=o.length;a<s;a++)r=o[a],V(l.concat(r),i).width<e?l=l.concat((""===l?"":" ")+r):""!==l?(n.push(X(e,l,i)),l=r):(n.push(X(e,r,i)),r=""),l&&a===s-1&&n.push(X(e,l,i));return n}function we(e,t,i){var r=[],o=0,l=V(t,i).width,n=t.length;if(e>=l)return r.push(t),r;for(var a=t.length;a>o;a--){var s=t.slice(o,a);if((l=V(s,i).width)<=e){if(r.push(s),n===(o+=s.length))return r;a=n+1}}return r}function Fe(e,t,i,r){var o=V(i,r);return o.width>e||o.height>t?" ":i}function Ce(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function Ie(e,t,i){var r=e.levelSelection;if(r)for(var o=0;o<r.length;o++)t.getAttribute("id")===r[o]?t.childElementCount>0&&(t.children[0].setAttribute("class",i),Te(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function Oe(e,t){var i=e.legendId;if(i)for(var r=0;r<i.length;r++)for(var o=0;o<t.childElementCount;o++)if(t.childNodes[o].id===i[r]){var l=t.childNodes[o];l.setAttribute("fill",e.selectionSettings.fill),l.setAttribute("stroke",e.selectionSettings.border.color),l.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),l.setAttribute("opacity",e.selectionSettings.opacity)}}function Le(e,i,r){for(var o,l={},n=0;n<e.length;n++)o=(0,t.isNullOrUndefined)(e[n].childNodes[0])?e[n]:e[n].childNodes[0],l=r.layout.renderItems[parseFloat(o.id.split("_Item_Index_")[1])].options,Te(o,l),e[n].classList.remove(i),n-=1}function Te(e,i){e.setAttribute("opacity",i.opacity),(0,t.isNullOrUndefined)(i.fill)||e.setAttribute("fill",i.fill),e.setAttribute("stroke",i.border.color),e.setAttribute("stroke-width",i.border.width)}function Ne(e,i,r){if((0,t.isNullOrUndefined)(e))return null;for(var o=0,l=Object.keys(i);o<l.length;o++){var n=l[o];e=e.split("${"+n+"}").join(De(i[n],r).toString())}return e}function De(e,t){return(t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)||""}var Ee=function(e,t,i){this.r=e,this.g=t,this.b=i};function Me(e){return"#"+Pe(e.r)+Pe(e.g)+Pe(e.b)}function Pe(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function _e(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new Ee(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Ee(255,255,255)}function Be(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 Me(new Ee(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function Re(e,t,r,o,l){var n=new i.SvgRenderer(""),a=ze(e,r,t,l,o);return n["draw"+a.functionName](a.renderOption)}function ze(e,i,r,o,l){var n,a="Path",s=i.width,h=i.height,d=e.x,p=e.y,g=e.x+-s/2,c=e.y+-h/2;switch(r){case"Circle":case"Bubble":a="Ellipse",(0,t.merge)(o,{rx:s/2,ry:h/2,cx:d,cy:p});break;case"VerticalLine":n="M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),(0,t.merge)(o,{d:n});break;case"Diamond":n="M "+g+" "+p+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+p+" L "+d+" "+(p+h/2)+" L "+g+" "+p+" z",(0,t.merge)(o,{d:n});break;case"Rectangle":n="M "+g+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+g+" "+(p+h/2)+" L "+g+" "+(p+-h/2)+" z",(0,t.merge)(o,{d:n});break;case"Triangle":n="M "+g+" "+(p+h/2)+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+g+" "+(p+h/2)+" z",(0,t.merge)(o,{d:n});break;case"InvertedTriangle":n="M "+(d+s/2)+" "+(p-h/2)+" L "+d+" "+(p+h/2)+" L "+(d-s/2)+" "+(p-h/2)+" L "+(d+s/2)+" "+(p-h/2)+" z",(0,t.merge)(o,{d:n});break;case"Pentagon":for(var u=void 0,m=void 0,f=0;f<=5;f++)u=s/2*Math.cos(Math.PI/180*(72*f)),m=s/2*Math.sin(Math.PI/180*(72*f)),n=0===f?"M "+(d+u)+" "+(p+m)+" ":n.concat("L "+(d+u)+" "+(p+m)+" ");n=n.concat("Z"),(0,t.merge)(o,{d:n});break;case"Star":n="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",(0,t.merge)(o,{d:n});break;case"Cross":n="M "+g+" "+p+" L "+(d+s/2)+" "+p+" M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),(0,t.merge)(o,{d:n});break;case"Image":a="Image",(0,t.merge)(o,{href:l,height:h,width:s,x:g,y:c})}return{renderOption:o,functionName:a}}function Ue(e,t){for(var i=!1,r=0;r<e.length;r++)if(t.levelOrderName===e[r].levelOrderName){i=!0;break}return i}var ke=function(e,t,i,r,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=r,this.sendData=o};function Ae(e){if(e.length>0)for(var t=0;t<e.length;t++){var i=e[t];We(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function He(e){if(e.length>0)for(var t=0;t<e.length;t++){var i=e[t];We(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth);for(var r=i.ShapeCollection.Elements.length,o=0;o<r;o++)We(i.ShapeCollection.Elements[o],i.shapeOldFill,i.shapeOldOpacity,i.shapeOldBorderColor,i.shapeOldBorderWidth)}}function We(e,t,i,r,o){e.setAttribute("fill",t),e.setAttribute("opacity",i),e.setAttribute("stroke",r),e.setAttribute("stroke-width",o)}function je(e,t,i){Ae(e),Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function Ge(e,t,i){for(var r,o=0;o<e;o++)for(var l=i.treeMapLegendModule.legendCollections[o].legendData.length,n=0;n<l;n++)if(i.treeMapLegendModule.legendCollections[o].legendData[n].levelOrderName===t.levelOrderName){r=o;break}return r}function Ve(e,t,i,r,o,l,n){e.push({legendEle:r,oldFill:n[t].legendFill,oldOpacity:n[t].opacity,oldBorderColor:n[t].borderColor,oldBorderWidth:n[t].borderWidth,shapeElement:o,shapeOldFill:l[i].options.fill,shapeOldOpacity:l[i].options.opacity,shapeOldBorderColor:l[i].options.border.color,shapeOldBorderWidth:l[i].options.border.width})}function qe(e,i,r,o){(0,t.createElement)("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:r}}).dispatchEvent(new MouseEvent(o?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function Xe(e){var i=document.getElementById(e);return i?(0,t.remove)(i):null}var Je,Ye=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=(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)||(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupName)||!((0,t.isNullOrUndefined)(this.treemap.drilledItems)?(0,t.isNullOrUndefined)(this.treemap.drilledItems):0===this.treemap.drilledItems.length)?this.treemap.treemapLevelData.levelsData[0]:this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0],[])[0],i=(0,t.extend)({},this.treemap.areaRect,i,!1),(0,t.isNullOrUndefined)(this.treemap.treeMapLegendModule)||(0,t.isNullOrUndefined)(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(i=this.treemap.totalRect),(0,t.isNullOrUndefined)(this.treemap.currentLevel)||((0,t.isNullOrUndefined)(this.treemap.drilledItems)?(0,t.isNullOrUndefined)(this.treemap.drilledItems):0===this.treemap.drilledItems.length))!(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)&&((0,t.isNullOrUndefined)(this.treemap.drilledItems)?(0,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 r=this.treemap.drilledItems.length-1,o=this.treemap.drilledItems[r].data,l={};l[this.treemap.drilledItems[r].data.groupName]=[o],(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[r].data.groupIndex),this.calculateLayoutItems(l||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems()}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,r={},o=ie(e).values;if(o&&o.length>0&&0===t.length){for(var l=0;l<o.length;l++)o[l].groupIndex===i.initialDrillDown.groupIndex&&o[l].name===i.initialDrillDown.groupName&&(o[l].isDrilled=!0,r[o[l].groupName]=[o[l]],t.push(r));for(var n=0;n<o.length;n++)this.getDrilldownData(o[n],t)}return t},e.prototype.calculateLayoutItems=function(e,i){this.renderItems=[],this.parentData=[],(0,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,r,o,l,n=this.treemap.leafItemSettings,a=this.treemap.levels,s=ie(e).values;if(s&&s.length>0&&(this.sliceAndDiceProcess(s,t),this.treemap.levels.length>0))for(var h=0;h<s.length;h++)r=s[h].groupIndex,o=0===a.length||r===a.length?n.gap:a[r].groupGap,l=0===a.length?0:a[r]?a[r].showHeader?a[r].headerHeight:0:a[r-1].showHeader?a[r-1].headerHeight:0,i=s[h].rect,i=new W(i.x+o/2,i.y+(l+o/2),i.width-o,Math.abs(i.height-(o+l))),this.computeSliceAndDiceDimensional(s[h],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var r,o=i.height*i.width,l=this.treemap.levels,n=0,a=0;e.forEach((function(e){a+=e.weight})),e.forEach((function(e){e.weightArea=o*e.weight/a}));var s="SliceAndDiceAuto"===this.treemap.layoutType?i.width>i.height:"SliceAndDiceHorizontal"===this.treemap.layoutType;e.sort(ee);for(var h=0;h<e.length;h++){var d=e[h];d.isLeafItem=0===l.length||(this.treemap.isHierarchicalData||(0,t.isNullOrUndefined)(this.treemap.leafItemSettings.labelPath)?d.groupIndex===l.length-1:d.groupIndex===this.treemap.levels.length),s?(r=o/a*e[h].weight/i.height,n<=i.width&&(e[h].rect=new W(n+i.x,i.y,r,i.height))):(r=o/a*e[h].weight/i.width,n<=i.height&&(e[h].rect=new W(i.x,n+i.y,i.width,r))),n+=r,this.renderItems.push(e[h])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,r,o,l,n,a=this.treemap.leafItemSettings,s=this.treemap.levels,h=ie(e).values;if(h&&h.length>0&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(h)),this.calculateChildrenLayout(e,h,t),this.treemap.levels.length>0))for(var d=0;d<h.length;d++)o=(r=h[d]).groupIndex,i=r.rect,l=(r.isLeafItem?a.padding:s[o].groupPadding)/2,n=this.treemap.isHierarchicalData?0===o&&r.isLeafItem?0:s[o]&&s[o].showHeader?s[o].headerHeight:0:0===s.length?0:s[o]&&s[o].showHeader?s[o].headerHeight:0,i=new W(i.x+l,i.y+(n+l),i.width-l,i.height-l),!r.isLeafItem&&r.weight>0&&this.computeSquarifyDimensional(h[d],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,se(i)),t.sort(Ce),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,r){var o=e.length;if(0===o){var l=this.getCoordinates(t,i);return u=r.concat(l)}var n=he(i),a=e[0],s=e.slice(1,o);if(this.aspectRatio(t,a,n)){var h=t.concat(a);return this.performRowsLayout(s,h,i,r)}for(var d=t.length,p=0,g=0;g<d;g+=1)p+=t[g].itemArea;var c=this.cutArea(i,p),u=(l=this.getCoordinates(t,i),r.concat(l));return this.performRowsLayout(e,[],c,u)},e.prototype.aspectRatio=function(e,t,i){if(0===e.length)return!0;var r=e.concat(t);return this.findMaxAspectRatio(e,i)>=this.findMaxAspectRatio(r,i)},e.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,r=1/0,o=-1/0,l=0,n=0;n<i;n+=1){var a=e[n].itemArea;a<r&&(r=a),a>o&&(o=a),l+=a}return Math.max(Math.pow(t,2)*o/Math.pow(l,2),Math.pow(l,2)/(Math.pow(t,2)*r))},e.prototype.cutArea=function(e,t){var i=de(e),r=i.width,o=i.height,l=i.x,n=i.y;if(r>=o){var a=t/o;return pe({x:l+a,y:n,width:r-a,height:o})}var s=t/r;return pe({x:l,y:n+s,width:r,height:o-s})},e.prototype.getCoordinates=function(e,i){for(var r,o=de(i),l=o.width,n=o.height,a=o.x,s=o.y,h=e.length,d=this.treemap.levels,p=this.treemap.leafItemSettings,g=0,c=0;c<h;c+=1)g+=e[c].itemArea;var u,m,f,y=g/n,v=g/l,b=a,S=s,x=[];for(c=0;c<h;c+=1){var w=e[c];if(r=w.groupIndex,w.isLeafItem=0===d.length||(this.treemap.isHierarchicalData||!(0,t.isNullOrUndefined)(p.labelPath))&&r===d.length,f=(m=Ue(this.parentData[0],w))?this.treemap.areaRect:w.parent.rect,u=w.isLeafItem?p.padding:d[r].groupPadding,l>=n){var F=S+w.itemArea/y;w.rect={x:b,y:S,width:b+y,height:F},S=F}else{var C=b+w.itemArea/v;w.rect={x:b,y:S,width:C,height:S+v},b=C}w.weight>0&&(m||Math.round(i.y+u/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+u/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(w),x.push(w))}return x},e.prototype.computeTotalArea=function(e,t){for(var i=e.length,r=[],o=0;o<i;o+=1){for(var l=e.length,n=0,a=0;a<l;a+=1)n+=e[a].weight;for(var s=t/n,h=void 0,d=0;d<l;d++)(h=e[d]).itemArea=h.weight*s,r.push(h)}return r},e.prototype.onDemandProcess=function(e){var i,r;i=e[0].parent,this.treemap.currentLevel=i.isDrilled?i.groupIndex:null;var o={};(0,t.isNullOrUndefined)(i.groupName)?o=i:o[i.groupName]=[i],r=(0,t.extend)({},this.treemap.areaRect,r,!1),(0,t.isNullOrUndefined)(this.treemap.treeMapLegendModule)||(0,t.isNullOrUndefined)(this.treemap.totalRect)||(r=this.treemap.totalRect);for(var l=this.treemap.levels.length,n=0;n<l;n++){l===e[0].groupIndex?this.treemap.levels[l]=this.treemap.levels[n]:this.treemap.levels.splice(l-1,1)}this.calculateLayoutItems(o,r),this.renderLayoutItems()},e.prototype.renderLayoutItems=function(){var e,i,r,o,l,n=this,a=this.treemap;this.renderer=a.renderer;var h,d,p,g,c,u,m,f,y,v,b,S,x,w,F,C=a.element.id,I=a.layoutType,O=this.treemap.leafItemSettings.interSectAction,L="",T=document.getElementById(a.element.id+"_Secondary_Element"),N=a.levels;this.layoutGroup=this.renderer.createGroup({id:C+"_TreeMap_"+I+"_Layout"});var D=(0,t.createElement)("div",{id:a.element.id+"_Label_Template_Group",className:"template"});D.style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+a.areaRect.y+"px;left:"+a.areaRect.x+"px;height:"+a.areaRect.height+"px;width:"+a.areaRect.width+"px;";for(var E,M,P=!1,_=a.leafItemSettings,B=function(I){if(u=R.renderItems[I],h=u.groupIndex,R.treemap.drillDownView&&(0,t.isNullOrUndefined)(R.treemap.currentLevel)&&h>0||R.treemap.drillDownView&&h>R.treemap.currentLevel+1)return"continue";p=u.rect,P=u.isLeafItem,y=C+"_Level_Index_"+h+"_Item_Index_"+I,x=R.renderer.createGroup({id:y+"_Group"}),b=(P?_.gap:N[h].groupGap)/2;var B,z=R.treemap.totalRect?de(R.treemap.totalRect):R.treemap.areaRect;if("Squarified"===a.layoutType&&(p.width=Math.abs(p.x-p.width)-b,p.height=Math.abs(p.y-p.height)-b),"TopRightBottomLeft"===a.renderDirection?p.x=z.x+z.width-p.width-Math.abs(z.x-p.x):"BottomLeftTopRight"===a.renderDirection?p.y=z.y+z.height-p.height-Math.abs(z.y-p.y):"BottomRightTopLeft"===a.renderDirection&&(p.x=z.x+z.width-p.width-Math.abs(z.x-p.x),p.y=z.y+z.height-p.height-Math.abs(z.y-p.y)),r=R.getItemColor(P,u),c=r.fill,f=r.opacity,g=P?_.labelFormat:N[h].headerFormat,i=P?_.showLabels:N[h].showHeader,h===R.treemap.currentLevel)if(R.treemap.enableBreadcrumb){M="#"+R.treemap.breadcrumbConnector+"#",B=u.levelOrderName.replace(/#/gi,M),B=0!==h?"#"+B:B}else B=u.name;else R.treemap.enableBreadcrumb&&(u.isDrilled=!1),B=u.name;m=Ne(g,u.data,R.treemap)||B||"undefined",E=ie(u).values,m=!P&&E&&E.length>0&&R.treemap.enableDrillDown?u.isDrilled?a.enableRtl?m+" [-]":"[-] "+m:a.enableRtl?m+" [+]":"[+] "+m:m,(S=P?_.labelStyle:N[h].headerStyle).fontFamily=R.treemap.themeStyle.labelFontFamily||S.fontFamily,S.fontWeight=S.fontWeight||R.treemap.themeStyle.fontWeight,S.size=S.size||R.treemap.themeStyle.labelFontSize,F=P?_.border:N[h].border,e=P?_.labelPosition:"Near"===N[h].headerAlignment?"TopLeft":"Center"===N[h].headerAlignment?"TopCenter":"TopRight",d=P?_.templatePosition:N[h].templatePosition,w=P?_.labelTemplate:N[h].headerTemplate,u.options={border:F,opacity:f,fill:c},o={cancel:!1,name:s,treemap:R.treemap,text:m,currentItem:u,RenderItems:R.renderItems,options:u.options},R.treemap.trigger(s,o,(function(r){if(!r.cancel){L=" M "+p.x+" "+p.y+" L "+(p.x+p.width)+" "+p.y+" L "+(p.x+p.width)+" "+(p.y+p.height)+" L "+p.x+" "+(p.y+p.height)+"z",l=new G(y+"_RectPath",c,F.width,F.color,f,null,L);var a=n.renderer.drawPath(l);x.appendChild(a),i&&(o.text!==m&&(o.text=Ne(o.text,u.data,n.treemap)||B),n.renderItemText(o.text.toString(),x,S,p,O,y,c,e,M)),w&&(v=n.renderTemplate(T,y,p,d,w,u,P),(0,t.isNullOrUndefined)(v)||(D.appendChild(v),n.treemap.renderReactTemplates())),x.setAttribute("aria-label",u.name),n.treemap.enableDrillDown&&P||n.treemap.selectionSettings.enable||n.treemap.highlightSettings.enable?(x.setAttribute("role","button"),x.setAttribute("tabindex",n.treemap.tabIndex.toString()),x.style.cursor=n.treemap.highlightSettings.enable&&!n.treemap.selectionSettings.enable&&n.treemap.enableDrillDown&&u.groupIndex===n.treemap.levels.length-1?"default":!n.treemap.highlightSettings.enable||n.treemap.selectionSettings.enable||n.treemap.enableDrillDown?"pointer":"default"):x.setAttribute("role","region"),Ie(n.treemap,x,"treeMapSelection"),n.layoutGroup.appendChild(x)}}))},R=this,z=0;z<this.renderItems.length;z++)B(z);D.childNodes.length>0&&T.appendChild(D),this.treemap.svgObject.appendChild(this.layoutGroup)},e.prototype.renderItemText=function(e,i,r,o,l,n,a,s,h){var d,p,g,c,u=[],m=0;if(p=-1!==e.indexOf("<br>")?e.split("<br>"):null,g=this.labelInterSectAction(o,e,r,l),d=V(p&&p[0]||g[0],r),this.treemap.enableRtl){var f=V(e,r),y=e.search("[+]")||e.search("[-]");if(o.width<f.width&&y>0){var v=e.substring(y-1,e.length),b=V("[+]",r);g[0]=X(o.width-b.width-5,g[0],r)+v}}var S=ne(o,s,d,"Text",this.treemap);if(!(0,t.isNullOrUndefined)(p)){for(var x=[],w=null,F=[],C=0;C<p.length;C++)m+=(d=V(w=X(o.width-5,p[C],r),r)).height,F.push(d.width),x.push(w);g=x,d.width=Math.max.apply(null,F),d.height=m}if("WrapByWord"===l||"Wrap"===l||"Trim"===l){for(var I=0;I<g.length;I++)m+=(d=V(g[I],r)).height,o.height-5>m&&u.push(g[I]);if("Wrap"===l&&g.length!==u.length&&u.length){var O=u.length-1,L=u[O];L=L.substring(0,L.length-1)+"...",u.splice(O),"..."!==L&&u.push(L)}}else c=g,u.push(c);Q(new q(n+"_Text",S.x,S.y,"start",u,"","",h),r,r.color||this.getSaturatedColor(a),i)},e.prototype.getItemColor=function(e,i){var r=this.treemap,o=e?r.leafItemSettings.fill:r.levels[i.groupIndex].fill,l=e?r.leafItemSettings.opacity:r.levels[i.groupIndex].opacity;(0,t.isNullOrUndefined)(r.treemapLevelData.defaultLevelsData)||r.treemapLevelData.defaultLevelsData.length>0&&(r.treemapLevelData.levelsData=r.treemapLevelData.defaultLevelsData);var n=ie(r.treemapLevelData.levelsData[0]).values,a=e?r.leafItemSettings.colorMapping:r.levels[i.groupIndex].colorMapping;if(a.length>0){var s=ce(a,i.data[r.equalColorValuePath],i.data[r.rangeColorValuePath]);(0,t.isNullOrUndefined)(s)||(o=(0,t.isNullOrUndefined)(s.fill)?r.leafItemSettings.fill:s.fill,l=s.opacity)}else for(var h=0;h<n.length;h++)n[h].levelOrderName===i.levelOrderName.split("#")[0]&&(o=(0,t.isNullOrUndefined)(o)?(0,t.isNullOrUndefined)(r.colorValuePath)?!(0,t.isNullOrUndefined)(r.palette)&&r.palette.length>0?r.palette[h%r.palette.length]:"#808080":n[h].data[r.colorValuePath]:o);return{fill:o,opacity:l}},e.prototype.getSaturatedColor=function(e){var t=e,i=_e(Be(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,r,o,l,n,a){var s,h=a?i+"_LabelTemplate":i+"_HeaderTemplate",d=a?"_LabelTemplate":"_HeaderTemplate";if((0,t.isNullOrUndefined)(l.prototype)&&"string"==typeof l)for(var p=Object.keys(n.data),g=0;g<p.length;g++){var c=RegExp;l=l.replace(new c("{{:"+p[g]+"}}","g"),n.data[p[g].toString()])}if(!(0,t.isNullOrUndefined)(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var u=ne(r,o,ae(s=le(oe(l)(n.data,this.treemap,l,this.treemap.element.id+d,!1),h,n.data),e),"Template",this.treemap);s.style.left=u.x+"px",s.style.top=u.y+"px"}return s},e.prototype.labelInterSectAction=function(e,t,i,r){var o,l=e.width-10;switch(r){case"Hide":o=[Fe(l,e.height,t,i)];break;case"Trim":o=[X(l+3,t,i)];break;case"WrapByWord":o=xe(l,t,i);break;case"Wrap":o=we(l,t,i)}return o},e.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]},e}(),Ze=n(74);function Qe(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",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",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"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",legendBorderColor:"#000000",legendBorderWidth:0}}return t}!function(e){e.mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"}}(Je||(Je={}));var $e=function(){function e(e){}return e.prototype.print=function(e,i){var r=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no");r.moveTo(0,0),r.resizeTo(screen.availWidth,screen.availHeight);var o={cancel:!1,htmlContent:this.getHTMLContent(e,i),name:l};e.trigger(l,o,(function(){o.cancel||(0,t.print)(o.htmlContent,r)}))},e.prototype.getHTMLContent=function(e,i){var r=(0,t.createElement)("div");if(i)i instanceof Array?i.forEach((function(e){r.appendChild(K(e).cloneNode(!0))})):i instanceof Element?r.appendChild(i.cloneNode(!0)):r.appendChild(K(i).cloneNode(!0));else{var o=e.element.cloneNode(!0),l=o.getElementsByTagName("svg")[0];if(!(0,t.isNullOrUndefined)(l)&&(l=l.childNodes[0],!(0,t.isNullOrUndefined)(l))){var n=l.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n||l.setAttribute("fill","rgba(0, 0, 0, 1)"):l.setAttribute("fill","rgba(255,255,255, 1)")}r.appendChild(o)}return r},e.prototype.getModuleName=function(){return"Print"},e.prototype.destroy=function(){},e}(),Ke=function(){function e(e){}return e.prototype.export=function(e,i,r,o){return new Promise((function(l,n){var a=(0,t.createElement)("canvas",{id:"ej2-canvas",attrs:{height:e.availableSize.height.toString(),width:e.availableSize.width.toString()}}),s=e.svgObject.cloneNode(!0),h=s.childNodes[0];if(!(0,t.isNullOrUndefined)(h)){var d=h.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d||s.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):s.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var p=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1),g='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+s.outerHTML+"</svg>",c=window.URL.createObjectURL(new Blob("SVG"===i?[g]:[(new XMLSerializer).serializeToString(s)],{type:"image/svg+xml"}));if("SVG"===i)o?qe(r,i,c,p):l(null);else{var u=new Image,m=a.getContext("2d");u.onload=function(){m.drawImage(u,0,0),window.URL.revokeObjectURL(c),o?qe(r,i,a.toDataURL("image/png").replace("image/png","image/octet-stream"),p):"JPEG"===i?l(a.toDataURL("image/jpeg")):"PNG"===i&&l(a.toDataURL("image/png"))},u.src=c}}))},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(){},e}(),et=n(461),tt=function(){function e(e){}return e.prototype.export=function(e,i,r,o,l){return new Promise((function(i,n){var a=(0,t.createElement)("canvas",{id:"ej2-canvas",attrs:{width:e.availableSize.width.toString(),height:e.availableSize.height.toString()}});o=(0,t.isNullOrUndefined)(o)?et.PdfPageOrientation.Landscape:o;var s=e.svgObject.cloneNode(!0),h=s.childNodes[0];if(!(0,t.isNullOrUndefined)(h)){var d=h.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d||s.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):s.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var p=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(s)],{type:"image/svg+xml"})),g=new Image,c=a.getContext("2d");g.onload=function(){c.drawImage(g,0,0),window.URL.revokeObjectURL(p);var t=new et.PdfDocument,n=a.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=o,n=n.slice(n.indexOf(",")+1),t.pages.add().graphics.drawImage(new et.PdfBitmap(n),0,0,e.availableSize.width-60,e.availableSize.height),l?(t.save(r+".pdf"),t.destroy()):i(null)},g.src=p}))},e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.destroy=function(){},e}(),it=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])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rt=function(e,t,i,r){var o,l=arguments.length,n=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(l<3?o(n):l>3?o(t,i,n):o(t,i))||n);return l>3&&n&&Object.defineProperty(t,i,n),n},ot=function(e){function l(t,i){var r=e.call(this,t,i)||this;return r.isResize=!1,r.orientation="Horizontal",r.drilledItems=[],r.isHierarchicalData=!1,r.levelSelection=[],r.legendId=[],r}return it(l,e),l.prototype.preRender=function(){var e=this;this.trigger(r,{treemap:this},(function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()}))},l.prototype.render=function(){this.renderElements()},l.prototype.renderElements=function(){this.treemapLevelData=new lt,this.treemapLevelData.levelsData=null,this.treemapLevelData.defaultLevelsData=null,this.treemapLevelData.hierarchyData=null,this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=Qe(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),(0,t.isNullOrUndefined)(this.treemapLevelData.levelsData)||(this.treemapLevelData.defaultLevelsData=this.treemapLevelData.levelsData),this.processDataManager()},l.prototype.processDataManager=function(){var e,i,r,o,l=this;this.dataSource instanceof Ze.DataManager?(e=this.dataSource,i=this.query instanceof Ze.Query?this.query:new Ze.Query,e.executeQuery(i).then((function(e){l.dataSource=e.result,l.renderTreeMapElements()}))):this.dataSource instanceof ke?(o=this.dataSource,(r=new t.Fetch(o.dataOptions,o.type,o.contentType)).onSuccess=function(e){if((0,t.isNullOrUndefined)(e.type)||"application/octet-stream"!==e.type)l.dataSource=e,l.renderTreeMapElements();else{var i=new FileReader,r=l;i.onload=function(){e=JSON.parse(i.result.toString()),r.dataSource=e,r.renderTreeMapElements()},i.readAsText(e)}},r.send(o.sendData)):this.renderTreeMapElements()},l.prototype.renderTreeMapElements=function(){this.processingData(),this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.renderLegend(),this.layout.processLayoutPanel(),this.element.appendChild(this.svgObject),this.elementChange(),this.trigger(o,{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},l.prototype.createSvg=function(){if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&(0,t.remove)(this.svgObject)}(0,t.isNullOrUndefined)(this.renderer)&&(this.renderer=new i.SvgRenderer(this.element.id)),(0,t.isNullOrUndefined)(this.layout)&&(this.layout=new Ye(this)),this.clearTemplate();var e=this.element.clientWidth,r=this.element.clientHeight;this.availableSize=new A(H(this.width,e)||e||600,H(this.height,r)||r||450),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},l.prototype.initPrivateVariable=function(){if(""===this.element.id){var e=document.getElementsByClassName("e-treemap").length;this.element.id="treemap_control_"+e}this.renderer=new i.SvgRenderer(this.element.id),this.layout=new Ye(this)},l.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"_Secondary_Element");if(e&&e.childElementCount>0&&e.parentNode.removeChild(e),(0,t.isNullOrUndefined)(document.getElementById(this.element.id+"_Secondary_Element"))){var i=(0,t.createElement)("div",{id:this.element.id+"_Secondary_Element"});i.style.cssText="position: absolute;z-index:1;",this.element.appendChild(i)}},l.prototype.elementChange=function(){this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.legendGroup&&this.layout.layoutGroup&&!(0,t.isNullOrUndefined)(this.svgObject)&&!(0,t.isNullOrUndefined)(document.getElementById(this.layout.layoutGroup.id))&&!(0,t.isNullOrUndefined)(document.getElementById(this.treeMapLegendModule.legendGroup.id))&&this.svgObject.insertBefore(this.layout.layoutGroup,this.treeMapLegendModule.legendGroup)},l.prototype.renderBorder=function(){var e=this.border.width,i=this.svgObject.querySelector("#"+this.element.id+"_TreeMap_Border");if((this.border.width>0||this.background||this.themeStyle.backgroundColor)&&(0,t.isNullOrUndefined)(i)){var r=new j(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new W(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e));this.svgObject.appendChild(this.renderer.drawRectangle(r))}else i&&i.setAttribute("fill",this.background||this.themeStyle.backgroundColor)},l.prototype.renderTitle=function(e,i,r,o){var l,n={color:e.textStyle.color,size:e.textStyle.size,fontFamily:e.textStyle.fontFamily,fontStyle:e.textStyle.fontStyle,fontWeight:e.textStyle.fontWeight,opacity:e.textStyle.opacity},a=this.availableSize.width-this.margin.right-this.margin.left;if(n.fontFamily=n.fontFamily||this.themeStyle.fontFamily,n.fontWeight=n.fontWeight||this.themeStyle.titleFontWeight,n.size=n.size||("title"===i?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text){(0,t.isNullOrUndefined)(o)&&(o=this.renderer.createGroup({id:this.element.id+"_Title_Group"}));var s=X(a,e.text,n),h=V(s,n),d=Y((0,t.isNullOrUndefined)(r)?new W(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):r,e.alignment,h,i),p=new q(this.element.id+"_TreeMap_"+i,d.x,d.y,"start",s),g=new W(d.x,d.y,h.width,h.height),c=Q(p,n,n.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),o);c.setAttribute("aria-label",e.description||e.text),c.setAttribute("role","region"),c.setAttribute("tabindex",this.tabIndex.toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(l=this.availableSize.height-g.y-10-this.margin.bottom,this.areaRect=new W(this.margin.left,g.y+10,a,l)),"subtitle"!==i&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",g,o):this.svgObject.appendChild(o)}else l=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new W(this.margin.left,this.margin.top,a,l)},l.prototype.processingData=function(){var e,i=this;if(this.dataSource=this.dataSource,!(0,t.isNullOrUndefined)(this.dataSource)&&this.dataSource.length>0&&this.weightValuePath){if(this.treemapLevelData.levelsData=[],this.dataSource.map((function(e){e[i.weightValuePath]=e[i.weightValuePath]?e[i.weightValuePath].toString():e[i.weightValuePath]})),this.leafItemSettings.labelPath=this.leafItemSettings.labelPath||this.weightValuePath,this.checkIsHierarchicalData(),0===this.levels.length){var r={level:0};e=this.leafItemSettings.labelPath,r[e]=[];for(var o=0;o<this.dataSource.length;o++){var l=ie(this.dataSource[o]).values;this.isHierarchicalData&&l&&l.length>0?l.forEach((function(t){t[e]&&r[e].push({groupIndex:0,name:t[e],levelOrderName:t[e].toString(),data:t,weight:t[i.weightValuePath]})})):this.dataSource[o][e]&&r[e].push({groupIndex:0,name:this.dataSource[o][e],levelOrderName:this.dataSource[o][e].toString(),data:this.dataSource[o],weight:this.dataSource[o][this.weightValuePath]})}this.treemapLevelData.levelsData.push(r)}else{if(this.isHierarchicalData){this.treemapLevelData.hierarchyData=[],this.treemapLevelData.hierarchyData=(0,t.extend)([],this.dataSource,this.treemapLevelData.hierarchyData,!0);for(o=0;o<this.treemapLevelData.hierarchyData.length;o++)this.processHierarchicalData(this.treemapLevelData.hierarchyData[o],o);this.treemapLevelData.levelsData=this.treemapLevelData.hierarchyData}else this.processFlatJsonData(),this.treemapLevelData.levelsData.length>1&&this.reOrderLevelData(this.treemapLevelData.levelsData.length-1);e=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(this.treemapLevelData.levelsData[0][e],"Parent")}},l.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=ie(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},l.prototype.processHierarchicalData=function(e,i){var r,o,l,n=this,a={},s=this.leafItemSettings.labelPath?this.leafItemSettings.labelPath:this.weightValuePath;if((r=(a=ie(e))?a.values:null)&&r.length>0){l=a.key;for(var h=0;h<this.levels.length;h++)l===this.levels[h].groupPath&&(o=h);for(var d=0;d<r.length;d++){r[d].name=r[d][s],r[d].levelOrderName=(0===o?r[d].name:e.levelOrderName+"#"+r[d].name)+"";var p=r[d].levelOrderName,g=void 0;p.search("#")>0&&(g=p.split("#").length-1),r[d].groupIndex=(0,t.isNullOrUndefined)(o)?g===this.levels.length?this.levels.length:g:o,0!==o&&(r[d].parent=e),r[d].groupName=l,r[d].data=r[d],r[d].isDrilled=!1,r[d].weight=r[d][this.weightValuePath]}r.forEach((function(e){n.processHierarchicalData(e,i)}))}if(i===this.treemapLevelData.hierarchyData.length-1){var c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];if(!(0,t.isNullOrUndefined)(c)){for(var u=0;u<this.treemapLevelData.hierarchyData.length;u++)r=ie(this.treemapLevelData.hierarchyData[u]).values,0!==u&&r&&(r.forEach((function(e){c.push(e)})),this.treemapLevelData.hierarchyData.splice(u,1),u-=1);c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];for(var m=0;m<c.length;m++)a[this.levels[0].groupPath]=c,c[m].parent=a}}},l.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},l.prototype.export=function(e,i,r,o){var l=this;return(0,t.isNullOrUndefined)(o)&&(o=!0),"PDF"===e&&this.allowPdfExport&&this.pdfExportModule?new Promise((function(t,n){t(l.pdfExportModule.export(l,e,i,r,o))})):this.allowImageExport&&"PDF"!==e&&this.imageExportModule?new Promise((function(t,r){t(l.imageExportModule.export(l,e,i,o))})):null},l.prototype.processFlatJsonData=function(){var e;this.dataSource=this.dataSource;for(var i=[],r=0;r<this.levels.length+1;r++){e=this.levels[r]?this.levels[r].groupPath:this.leafItemSettings.labelPath;var o={};o.level=r,o[e]=[],this.treemapLevelData.levelsData.push(o);for(var l=0;l<this.dataSource.length;l++){var n={},a="";if(!(0,t.isNullOrUndefined)(e)){var s=this.dataSource[l][e];if(0!==r)for(var h=0;h<=r;h++){var d=this.levels[h]?this.levels[h].groupPath:e;a+=this.dataSource[l][d]+(h===r?"":"#")}i.length>0&&-1!==i.indexOf(a||s)||(n.name=s,n.levelOrderName=(a||s)+"",n.groupIndex=r,n.isDrilled=!1,n.groupName=e,n.data=this.dataSource[l],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][e].push(n),i.push(a||s))}}}},l.prototype.reOrderLevelData=function(e){for(var i,r=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,o=this.levels[e-1].groupPath,l=this.treemapLevelData.levelsData[e][r],n=this.treemapLevelData.levelsData[e-1][o],a=0;a<l.length;a++){i=l[a].levelOrderName;for(var s=0;s<n.length;s++)if(n[s][r]=(0,t.isNullOrUndefined)(n[s][r])?[]:n[s][r],this.IsChildHierarchy(i.split("#"),n[s].levelOrderName.split("#"))){(0,t.isNullOrUndefined)(l[a].parent)&&(l[a].parent=n[s]),n[s][r].push(l[a]);break}}this.findTotalWeight(this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][r],"Child"),this.treemapLevelData.levelsData.splice(e,1),e-1>0&&this.reOrderLevelData(e-1)},l.prototype.IsChildHierarchy=function(e,t){for(var i=!1,r=0;r<t.length;r++){if(e.length<r||t[r]!==e[r])return!1;i=!0}return i},l.prototype.findTotalWeight=function(e,t){for(var i,r,o,l=this,n={},a=function(a){i=0,o=e[a].groupName,r=e[a].levelOrderName.split("#"),s.dataSource.forEach((function(t){te(r,e[a].levelOrderName,t,l)&&(i+=parseFloat(t[l.weightValuePath]))})),"Parent"===t&&(n[o]=e,e[a].parent=n),e[a].weight=i},s=this,h=0;h<e.length;h++)a(h)},l.prototype.unWireEVents=function(){t.EventHandler.remove(this.element,"click",this.clickOnTreeMap),t.EventHandler.remove(this.element,"dblclick",this.doubleClickOnTreeMap),t.EventHandler.remove(this.element,"contextmenu",this.rightClickOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap),t.EventHandler.remove(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap),window.removeEventListener("resize",this.resizeEvent)},l.prototype.wireEVents=function(){t.EventHandler.add(this.element,"click",this.clickOnTreeMap,this),t.EventHandler.add(this.element,"dblclick",this.doubleClickOnTreeMap,this),t.EventHandler.add(this.element,"contextmenu",this.rightClickOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap,this),t.EventHandler.add(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent)},l.prototype.setCulture=function(){this.intl=new t.Internationalization},l.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},l.prototype.resizeOnTreeMap=function(e){var i=this;if(!this.isDestroyed){this.isResize=!0;var r={name:w,cancel:!1,previousSize:this.availableSize,currentSize:new A(0,0),treemap:this};this.resizeTo&&clearTimeout(this.resizeTo),!(0,t.isNullOrUndefined)(this.element)&&this.element.classList.contains("e-treemap")&&(this.resizeTo=setTimeout((function(){i.unWireEVents(),i.createSvg(),i.refreshing=!0,i.wireEVents(),r.currentSize=i.availableSize,i.trigger(w,r,(function(e){i.render(),i.refreshing=!1}))}),500))}},l.prototype.clickOnTreeMap=function(e){var i,r,o=this,l=e.target,n=l.id,a=l.innerHTML,s={cancel:!1,name:f,treemap:this,mouseEvent:e};this.trigger(f,s),n.indexOf("_Item_Index")>-1&&(e.preventDefault(),r=parseFloat(n.split("_Item_Index_")[1]),i={cancel:!1,name:u,treemap:this,item:this.layout.renderItems[r],mouseEvent:e,groupIndex:this.layout.renderItems[r].groupIndex,groupName:this.layout.renderItems[r].name,text:a,contentItemTemplate:a},this.trigger(u,i,(function(e){e.text===a&&e.contentItemTemplate===a||((0,t.isNullOrUndefined)(o.leafItemSettings.labelTemplate)?(e.text=Ne(e.text,e.item.data,e.treemap),l.textContent=e.text):$(n,l,e.contentItemTemplate))})));var h,d=(new Date).getMilliseconds();(0,t.isNullOrUndefined)(this.doubleClick)||(!(0,t.isNullOrUndefined)(h)&&d-h<500&&this.doubleClickOnTreeMap(e),h=d)},l.prototype.doubleClickOnTreeMap=function(e){var t={cancel:!1,name:y,treemap:this,mouseEvent:e};this.trigger(y,t)},l.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:v,treemap:this,mouseEvent:e};this.trigger(v,t)},l.prototype.mouseDownOnTreeMap=function(e){e.target.id.indexOf("_Item_Index")>-1&&(this.mouseDown=!0),this.notify(t.Browser.touchStartEvent,e)},l.prototype.mouseMoveOnTreeMap=function(e){var i,r,o,l=e.target.id,n={cancel:!1,name:b,treemap:this,mouseEvent:e};this.trigger(b,n),l.indexOf("_Item_Index")>-1?(o=ie(r=this.layout.renderItems[parseFloat(l.split("_Item_Index_")[1])]).values,this.element.style.cursor=!r.isLeafItem&&o&&o.length>0&&this.enableDrillDown?"pointer":"auto",i={cancel:!1,name:m,treemap:this,item:r,mouseEvent:e},this.trigger(m,i)):this.element.style.cursor="default",this.notify(t.Browser.touchMoveEvent,e)},l.prototype.calculateSelectedTextLevels=function(e,t){for(var i,r,o,l=t.levelOrderName.split("#"),n=0,a=Object.keys(l);n<a.length;n++)l[r=a[n]]===e&&(i=parseInt(r,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:l}},l.prototype.calculatePreviousLevelChildItems=function(e,i,r){for(var o,l,n,a=0,s=this.layout.renderItems[0].levelOrderName.split("#").length,h=0;h<s;h++)n=0===h?e.levelText[h]:n+"#"+e.levelText[h];a=s>1?s:a;for(var d=0,p=Object.values(this.layout.renderItems);d<p.length;d++){(l=p[d]).levelOrderName.split("#")[0]===e.levelText[0]&&(o=0===a?(0,t.isNullOrUndefined)(n)?n:e.levelText[a]:r?n:n+"#"+e.levelText[a])===l.levelOrderName&&(this.drilledItems.push({name:l.levelOrderName,data:l}),r=!0,++a<=i.groupIndex&&(n=o=o+"#"+e.levelText[a]))}return r},l.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var r,o={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((r=this.drilledItems[i].data.parent).isDrilled=!0,o[r[this.drilledItems[i].data.groupName]]=[r],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(o[t.groupName]=[t]),o},l.prototype.mouseEndOnTreeMap=function(e){var i,r,o,l,n,a,s,p=this,g=e.target,c=g.id,u=!1,m={},f=this.element.id+"_TreeMap_"+this.layoutType+"_Layout",y=this.element.id+"_Label_Template_Group";if(c.indexOf("_Item_Index")>-1&&this.enableDrillDown&&!this.drillMouseMove){e.cancelable&&e.preventDefault(),l=parseFloat(c.split("_Item_Index_")[1]),n=this.layout.renderItems[l];var v=g.textContent;if(this.enableBreadcrumb&&(s=this.calculateSelectedTextLevels(v,n),a=s.drillLevel,this.drillDownView||-1===v.search("[+]")||(u=this.calculatePreviousLevelChildItems(s,n,u))),0!==this.levels.length&&!n.isLeafItem&&ie(n).values&&ie(n).values.length>0){if(this.drilledItems.length>0){n=u?this.drilledItems[this.drilledItems.length-1].data:n;for(var b=0;b<this.drilledItems.length;b++){if(!(0,t.isNullOrUndefined)(a)){var S=this.drilledItems.length;if(m=this.compareSelectedLabelWithDrillDownItems(s,n,b),S!==this.drilledItems.length){b-=1;break}}if(n.levelOrderName===this.drilledItems[b].name&&!u&&(0,t.isNullOrUndefined)(a)){0===n.groupIndex&&n.parent[n.groupName]instanceof Array?(n.isDrilled=!n.isDrilled,n.isDrilled?m[n.groupName]=[n]:m=n.parent):(n.isDrilled=!1,n.parent.isDrilled=!0,n=n.parent,m[n.groupName]=[n]),this.drilledItems.splice(b,1),b-=1;break}b===this.drilledItems.length-1&&(0,t.isNullOrUndefined)(a)&&(n.isDrilled=!0,m[n.groupName]=[n])}}else n.isDrilled=!0,m[n.groupName]=[n];r={cancel:!1,name:h,treemap:this,element:g,groupIndex:this.enableBreadcrumb&&0!==this.drilledItems.length&&!(0,t.isNullOrUndefined)(a)?this.drilledItems[this.drilledItems.length-1].data.groupIndex:n.groupIndex,groupName:this.enableBreadcrumb&&0!==this.drilledItems.length&&!(0,t.isNullOrUndefined)(a)?this.drilledItems[this.drilledItems.length-1].data.name:n.name,rightClick:3===e.which,childItems:null,item:m},this.trigger(h,r,(function(e){if(p.currentLevel=n.isDrilled&&(0,t.isNullOrUndefined)(a)?n.groupIndex:!(0,t.isNullOrUndefined)(a)&&p.enableBreadcrumb&&n.isDrilled?a:null,!e.cancel){if(document.getElementById(f)){var r=document.getElementById(f);r.parentNode.removeChild(r)}if(i=(0,t.extend)({},p.areaRect,i,!0),p.legendSettings.visible&&!(0,t.isNullOrUndefined)(p.treeMapLegendModule)&&((0,t.isNullOrUndefined)(m)||(p.treeMapLegendModule.legendGroup.textContent="",p.treeMapLegendModule.legendGroup=null,p.treeMapLegendModule.widthIncrement=0,p.treeMapLegendModule.heightIncrement=0,p.enableBreadcrumb&&!(0,t.isNullOrUndefined)(a)?p.drilledLegendItems={name:p.drilledItems[p.drilledItems.length-1].data.levelOrderName,data:p.drilledItems[p.drilledItems.length-1].data}:p.drilledLegendItems={name:n.levelOrderName,data:n},p.treeMapLegendModule.renderLegend()),i=(0,t.isNullOrUndefined)(p.totalRect)?i:p.totalRect),document.getElementById(y)){var o=document.getElementById(y);o.parentNode.removeChild(o)}(0,t.isNullOrUndefined)(e.childItems)||e.cancel?(p.layout.calculateLayoutItems(m,i),p.layout.renderLayoutItems()):p.layout.onDemandProcess(e.childItems)}})),o={cancel:!1,name:d,treemap:this,renderItems:this.layout.renderItems},this.trigger(d,o),!u&&(0,t.isNullOrUndefined)(a)&&this.drilledItems.push({name:n.levelOrderName,data:n})}}this.mouseDown=!1,this.notify(t.Browser.touchEndEvent,e)},l.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(Ae(this.treeMapHighlightModule.shapeHighlightCollection),this.treeMapHighlightModule.highLightId="")},l.prototype.selectItem=function(e,i){(0,t.isNullOrUndefined)(i)&&(i=!0);for(var r="",o=0;o<e.length;o++)o!==e.length-1?r+=e[o]+"#":r+=e[o];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(r,i)},l.prototype.requiredModules=function(){var e=[];return this.tooltipSettings.visible&&e.push({member:"treeMapTooltip",args:[this],name:"TreeMapTooltip"}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this],name:"TreeMapHighlight"}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this],name:"TreeMapSelection"}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this],name:"TreeMapLegend"}),this.allowPrint&&e.push({member:"Print",args:[this,$e],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Ke],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,tt],name:"PdfExport"}),e},l.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,r=0,o=Object.keys(e);r<o.length;r++){switch(o[r]){case"background":this.renderBorder();break;case"height":case"width":case"layoutType":case"levels":case"drillDownView":case"renderDirection":case"leafItemSettings":case"legendSettings":case"dataSource":i=!0}}i&&(this.createSvg(),this.renderElements())}},l.prototype.getModuleName=function(){return"treemap"},l.prototype.destroy=function(){this.unWireEVents(),Xe("treeMapMeasureText"),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),e.prototype.destroy.call(this),this.areaRect=null,this.themeStyle=null,this.totalRect=null,this.drilledLegendItems=null,this.doubleTapTimer=null,this.treemapLevelData=null,this.resizeEvent=null,this.availableSize=null,this.intl=null,(0,t.isNullOrUndefined)(this.layout)||this.layout.destroy(),this.layout=null,this.renderer=null},l.prototype.removeSvg=function(){if(Xe(this.element.id+"_Secondary_Element"),this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&(0,t.remove)(this.svgObject)}},l.prototype.getPersistData=function(){return""},rt([(0,t.Property)(!1)],l.prototype,"allowPrint",void 0),rt([(0,t.Property)(!1)],l.prototype,"allowImageExport",void 0),rt([(0,t.Property)(!1)],l.prototype,"allowPdfExport",void 0),rt([(0,t.Property)(null)],l.prototype,"width",void 0),rt([(0,t.Property)(null)],l.prototype,"height",void 0),rt([(0,t.Complex)({},O)],l.prototype,"border",void 0),rt([(0,t.Complex)({},L)],l.prototype,"margin",void 0),rt([(0,t.Property)(null)],l.prototype,"background",void 0),rt([(0,t.Property)("Material")],l.prototype,"theme",void 0),rt([(0,t.Complex)({},E)],l.prototype,"titleSettings",void 0),rt([(0,t.Property)("Squarified")],l.prototype,"layoutType",void 0),rt([(0,t.Property)(null)],l.prototype,"dataSource",void 0),rt([(0,t.Property)(null)],l.prototype,"query",void 0),rt([(0,t.Property)(null)],l.prototype,"weightValuePath",void 0),rt([(0,t.Property)("")],l.prototype,"rangeColorValuePath",void 0),rt([(0,t.Property)("")],l.prototype,"equalColorValuePath",void 0),rt([(0,t.Property)(null)],l.prototype,"colorValuePath",void 0),rt([(0,t.Property)([])],l.prototype,"palette",void 0),rt([(0,t.Property)("TopLeftBottomRight")],l.prototype,"renderDirection",void 0),rt([(0,t.Property)(!1)],l.prototype,"enableDrillDown",void 0),rt([(0,t.Property)(!1)],l.prototype,"enableBreadcrumb",void 0),rt([(0,t.Property)(" - ")],l.prototype,"breadcrumbConnector",void 0),rt([(0,t.Property)(!1)],l.prototype,"drillDownView",void 0),rt([(0,t.Complex)({},_)],l.prototype,"initialDrillDown",void 0),rt([(0,t.Complex)({},B)],l.prototype,"leafItemSettings",void 0),rt([(0,t.Collection)([],k)],l.prototype,"levels",void 0),rt([(0,t.Complex)({},U)],l.prototype,"highlightSettings",void 0),rt([(0,t.Complex)({},z)],l.prototype,"selectionSettings",void 0),rt([(0,t.Complex)({},R)],l.prototype,"tooltipSettings",void 0),rt([(0,t.Complex)({},P)],l.prototype,"legendSettings",void 0),rt([(0,t.Property)(!1)],l.prototype,"useGroupingSeparator",void 0),rt([(0,t.Property)(null)],l.prototype,"description",void 0),rt([(0,t.Property)(0)],l.prototype,"tabIndex",void 0),rt([(0,t.Property)(null)],l.prototype,"format",void 0),rt([(0,t.Event)()],l.prototype,"load",void 0),rt([(0,t.Event)()],l.prototype,"beforePrint",void 0),rt([(0,t.Event)()],l.prototype,"loaded",void 0),rt([(0,t.Event)()],l.prototype,"itemRendering",void 0),rt([(0,t.Event)()],l.prototype,"drillStart",void 0),rt([(0,t.Event)()],l.prototype,"drillEnd",void 0),rt([(0,t.Event)()],l.prototype,"itemSelected",void 0),rt([(0,t.Event)()],l.prototype,"itemHighlight",void 0),rt([(0,t.Event)()],l.prototype,"tooltipRendering",void 0),rt([(0,t.Event)()],l.prototype,"itemClick",void 0),rt([(0,t.Event)()],l.prototype,"itemMove",void 0),rt([(0,t.Event)()],l.prototype,"click",void 0),rt([(0,t.Event)()],l.prototype,"doubleClick",void 0),rt([(0,t.Event)()],l.prototype,"rightClick",void 0),rt([(0,t.Event)()],l.prototype,"mouseMove",void 0),rt([(0,t.Event)()],l.prototype,"resize",void 0),rt([(0,t.Event)()],l.prototype,"legendItemRendering",void 0),rt([(0,t.Event)()],l.prototype,"legendRendering",void 0),l=rt([t.NotifyPropertyChanges],l)}(t.Component),lt=function(){},nt=function(){function e(e){this.page=0,this.legendBorderRect=new W(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new W(0,0,0,0),this.treemap=e,this.addEventListener()}return e.prototype.renderLegend=function(){var e=this;this.page=0,this.legendRenderingCollections=[],this.legendCollections=[],this.legendNames=[],this.totalPages=[],this.gradientCount=1,this.widthIncrement=0,this.heightIncrement=0,this.defsElement=this.treemap.renderer.createDefs(),this.treemap.svgObject.appendChild(this.defsElement);var t={cancel:!1,name:x,treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position};this.treemap.trigger(x,t,(function(t){t.cancel||t._changePosition===e.treemap.legendSettings.position||(e.treemap.legendSettings.position=t._changePosition),e.calculateLegendBounds(),e.legendCollections.length>0&&e.drawLegend()}))},e.prototype.calculateLegendBounds=function(){var e=this,i=this.treemap,r=i.legendSettings;if(this.findColorMappingLegendItems(i.treemapLevelData.levelsData[0]),(!(0,t.isNullOrUndefined)(this.treemap.palette)&&this.treemap.palette.length>0||!(0,t.isNullOrUndefined)(i.colorValuePath))&&0===this.legendCollections.length&&this.findPaletteLegendItems(i.treemapLevelData.levelsData[0]),this.legendCollections.length>0){this.legendCollections.sort((function(e,t){return e.levelIndex>t.levelIndex?1:e.levelIndex<t.levelIndex?-1:0})),this.legendCollections.sort((function(e,t){return e.groupIndex>t.groupIndex?1:e.groupIndex<t.groupIndex?-1:0})),this.legendCollections.sort((function(e,t){return e.leafIndex>t.leafIndex?1:e.leafIndex<t.leafIndex?-1:0}));var o=r.position,l=r.title.text,n=r.titleStyle,a=r.mode,s=0,h=0,d=0,p=0,g=r.shapeHeight,c=r.shapeWidth,u=[],m=[],f="None"===r.orientation?"Top"===o||"Bottom"===o||"Auto"===o&&i.availableSize.width<=i.availableSize.height?"Horizontal":"Vertical":r.orientation,y=r.width.length>1?r.width.indexOf("%")>-1?i.availableSize.width/100*parseFloat(r.width):parseFloat(r.width):null,v=r.height.length>1?r.height.indexOf("%")>-1?i.availableSize.height/100*parseFloat(r.height):parseFloat(r.height):null;n.fontFamily=n.fontFamily||i.themeStyle.fontFamily,n.fontWeight=n.fontWeight||i.themeStyle.titleFontWeight,n.size=n.size||i.themeStyle.subtitleFontSize;var b=V(l,n),S=0,x=0,w=r.shapePadding,F=r.textStyle;if(F.size=F.size||i.themeStyle.legendFontSize,F.fontFamily=F.fontFamily||i.themeStyle.fontFamily,F.fontWeight=F.fontWeight||i.themeStyle.fontWeight,"Default"===a){y=(0,t.isNullOrUndefined)(y)?i.areaRect.width:y,v=(0,t.isNullOrUndefined)(v)?i.areaRect.height:v;for(var C=0,I=0;I<this.legendCollections.length;I++){var O=this.legendCollections[I];(0,t.isNullOrUndefined)(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]});var L=V(O.legendName,F);if(this.textMaxWidth=Math.max(this.textMaxWidth,L.width),0===I)S=s=10+c/2,x=h=10+b.height+(g>L.height?g/2:L.height/4);else{var T=L.height>g?L.height:g;if("Horizontal"===f){var N=m[C-1].x+m[C-1].width+10+c;if(N+w+L.width>y){var D=(m[C-1].y>u[C-1].y+g/2?m[C-1].y:u[C-1].y+g/2)+10;D+T>v?(this.getPageChanged(),C=0,u=[],m=[],s=S,h=x):(s=u[0].x,h=D+T/2)}else s=N-c/2,h=u[C-1].y}else{var E=m[C-1].y>u[C-1].y+g/2?m[C-1].y:u[C-1].y+g/2;if(E+10+T>v){var M=m[C-1].x+this.textMaxWidth+10;M+w+L.width>y?(s=S,h=x,m=[],u=[],this.getPageChanged(),C=0):(s=M+c/2,h=u[0].y)}else s=u[C-1].x,h=E+10+g/2}}d=s+c/2+w,p=h+L.height/4,u.push({x:s,y:h}),m.push({x:d,y:p,width:L.width,height:L.height/2}),this.totalPages[this.page].Collection.push({DisplayText:O.legendName,element:O.gradientElement,Shape:{x:s,y:h},Text:{x:d,y:p},Fill:O.legendFill,Data:O.legendData,Rect:{x:u[C].x-c/2,y:u[C].y-g/2<p-L.height?u[C].y-g/2:p-L.height,width:Math.abs(u[C].x-c/2-(d+L.width)),height:g>L.height?g:L.height}}),C++}var P=this.totalPages[0].Collection;P.forEach((function(t,i){var r=new W(t.Rect.x,t.Rect.y,t.Rect.width,t.Rect.height);0===i&&(S=r.x,x=r.y),e.widthIncrement=Math.max(e.widthIncrement,Math.abs(S-(r.x+r.width))),e.heightIncrement=Math.max(e.heightIncrement,Math.abs(x-(r.y+r.height)))})),y=this.widthIncrement<y?this.widthIncrement:y,v=this.heightIncrement<v?this.heightIncrement:v,this.legendItemRect={x:P[0].Rect.x,y:P[0].Rect.y,width:y,height:v}}else{var _=this.legendCollections.length,B="Horizontal"===f?(0,t.isNullOrUndefined)(y)?i.areaRect.width/_:y/_:(0,t.isNullOrUndefined)(y)?25:y,R="Horizontal"===f?(0,t.isNullOrUndefined)(v)?25:v:(0,t.isNullOrUndefined)(v)?i.areaRect.height/_:v/_;S=0,x=b.height+10;var z=10,U=r.labelPosition,k=0,H=0,j=r.labelDisplayMode,G=0,q=0;for(I=0;I<this.legendCollections.length;I++){S="Horizontal"===f?S+B:S,x="Horizontal"===f?x:x+R;var J=this.legendCollections[I].legendName,Y=new A(0,0);"None"===j?Y=V(J,F):"Trim"===j?Y=V(J=X("Horizontal"===f?B:R,J,F),F):J="",G=Math.max(G,Y.height),q=Math.max(q,Y.width),Y.width>0&&Y.height>0&&("Horizontal"===f?(d=S+B/2,p="After"===U?x+R+Y.height/2+z:x-z):(d="After"===U?S-Y.width/2-z:S+B+Y.width/2+z,p=x+R/2+Y.height/4)),0===I&&(k="Horizontal"===f?S:"After"===U?d-Y.width/2:S,H="Horizontal"===f?"After"===U?x:p-Y.height/2:x),I===_-1&&(y="Horizontal"===f?Math.abs(S+B-k):B+q+z,v="Horizontal"===f?R+G/2+z:Math.abs(x+R-H)),this.legendRenderingCollections.push({fill:this.legendCollections[I].legendFill,x:S,y:x,width:B,height:R,element:this.legendCollections[I].gradientElement,text:J,textX:d,textY:p,textWidth:Y.width,textHeight:Y.height,data:this.legendCollections[I].legendData})}this.legendItemRect={x:k,y:H,width:y,height:v}}}},e.prototype.getPageChanged=function(){this.page++,(0,t.isNullOrUndefined)(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},e.prototype.findColorMappingLegendItems=function(e){var t=ie(e).values;if(t&&t.length>0&&(this.calculateLegendItems(t),this.treemap.levels.length>0))for(var i=0;i<t.length;i++)this.findColorMappingLegendItems(t[i])},e.prototype.findPaletteLegendItems=function(e){var i,r,o;if(!(0,t.isNullOrUndefined)(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupName)&&(0,t.isNullOrUndefined)(this.treemap.drilledLegendItems))for(var l=ie(e).values,n=0;n<l.length;n++)if(l[n].Name===this.treemap.initialDrillDown.groupName){l[n].isDrilled=!l[n].isDrilled,e=l[n],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,r=this.treemap.palette.length>0?this.treemap.palette[n%this.treemap.palette.length]:l[n].data[this.treemap.colorValuePath];break}if(this.treemap.enableDrillDown&&!(0,t.isNullOrUndefined)(this.treemap.drilledLegendItems)){var a=this.treemap.drilledLegendItems;if(r=a.data.options.fill,a.data.isDrilled)i=ie(a.data).values;else i=ie(a.data.parent).values}else i=ie(e).values;if(i&&i.length>0){for(var s=0;s<i.length;s++)((0,t.isNullOrUndefined)(i[s].data[this.treemap.legendSettings.showLegendPath])||i[s].data[this.treemap.legendSettings.showLegendPath])&&(o=i[s].data[this.treemap.legendSettings.valuePath]?i[s].data[this.treemap.legendSettings.valuePath]:i[s].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,o)||this.legendCollections.push({legendName:o,legendFill:this.treemap.palette.length>0?(0,t.isNullOrUndefined)(this.treemap.currentLevel)?this.treemap.palette[s%this.treemap.palette.length]:r:i[s].data[this.treemap.colorValuePath],legendData:[],itemArea:i[s].weight}));if(this.legendCollections.sort(Ce),this.treemap.palette.length>0)for(var h=0;h<this.legendCollections.length;h++)this.legendCollections[h].legendFill=(0,t.isNullOrUndefined)(this.treemap.currentLevel)?this.treemap.palette[h%this.treemap.palette.length]:r}},e.prototype.calculateLegendItems=function(e){var i,r,o,l,n,a,s,h,d,p,g,c,u,m,f,y,v,b,S,x=!1,w=this.treemap.leafItemSettings,F=this.treemap.levels,C=this.treemap.legendSettings.position,I=!1,O=0;this.outOfRangeLegend=null;for(var L=0;L<e.length;L++){r="",f=!1,y=!1,I=!1,l=e[L].data,h=e[L].groupIndex,s=(a=0===this.treemap.levels.length||h===this.treemap.levels.length)?w.colorMapping:F[h].colorMapping;for(var T=0;T<s.length;T++){var N=s[T];if(p=null,o=Number(l[this.treemap.rangeColorValuePath]),d=l[this.treemap.equalColorValuePath],N.value=(0,t.isNullOrUndefined)(N.value)?N.value:N.value.toString(),!(0,t.isNullOrUndefined)(N.from)&&!(0,t.isNullOrUndefined)(N.to)&&o>=N.from&&o<=N.to&&N.showLegend?(x=!0,y=!0,u=N.from+" - "+N.to,n=(0,t.isNullOrUndefined)(N.label)?N.from+" - "+N.to:N.label,r=(0,t.isNullOrUndefined)(N.color)?r:N.color,i=this.isAddNewLegendData(u)):!(0,t.isNullOrUndefined)(N.value)&&d===N.value&&N.showLegend&&(x=!0,f=!0,u=N.value.toString(),n=(0,t.isNullOrUndefined)(N.label)?N.value.toString():N.label,r=(0,t.isNullOrUndefined)(N.color)?r:"[object Array]"===Object.prototype.toString.call(N.color)?N.color[0]:N.color,i=this.isAddNewLegendData(u)),x&&(0,t.isNullOrUndefined)(N.value)&&N.maxOpacity&&N.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var D=[];if(I=!0,"[object Array]"===Object.prototype.toString.call(N.color))for(var E=0;E<N.color.length;E++){var M={colorStop:(E*(100/(N.color.length-1))+"%").toString(),color:N.color[E]};D.push(M)}else{M={colorStop:"0%",color:r};var P={colorStop:"100%",color:r};D.push(M),D.push(P)}g="Top"===C||"Bottom"===C?"100%":"0%",c="Top"===C||"Bottom"===C?"0%":"100%";var _={id:"groupIndex_"+h+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:g,y2:c};p=this.treemap.renderer.drawGradient("linearGradient",_,D).childNodes[0],"[object Array]"!==Object.prototype.toString.call(N.color)&&(p.childNodes[0].setAttribute("stop-opacity",N.minOpacity.toString()),p.childNodes[1].setAttribute("stop-opacity",N.maxOpacity.toString())),this.defsElement.appendChild(p),this.gradientCount++}m=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,n),i&&i.process&&x&&!m?(x=!1,r="[object Array]"===Object.prototype.toString.call(N.color)&&(0,t.isNullOrUndefined)(p)&&(0,t.isNullOrUndefined)(N.value)?this.legendGradientColor(N,O):r,this.legendCollections.push({actualValue:u,levelIndex:a?-1:T,leafIndex:a?T:-1,legendName:n,legendFill:r,legendData:[],groupIndex:a?-1:h,gradientElement:(0,t.isNullOrUndefined)(p)?(0,t.isNullOrUndefined)(N.value)?this.legendLinearGradient:null:p,name:e[L].name,opacity:this.treemap.legendSettings.opacity,borderColor:this.treemap.legendSettings.border.color,borderWidth:this.treemap.legendSettings.border.width}),this.legendCollections[this.legendCollections.length-1].legendData.push(e[L]),O++):x&&!m&&(x=!1,this.legendCollections[i.value].legendData.push(e[L])),y||I||f||(0,t.isNullOrUndefined)(N.from)&&(0,t.isNullOrUndefined)(N.to)&&(0,t.isNullOrUndefined)(N.minOpacity)&&(0,t.isNullOrUndefined)(N.maxOpacity)&&(0,t.isNullOrUndefined)(N.value)&&!(0,t.isNullOrUndefined)(N.color)&&(v="[object Array]"===Object.prototype.toString.call(N.color)?N.color[0]:N.color,b=(0,t.isNullOrUndefined)(N.label)?"Others":N.label,m=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,b),(0,t.isNullOrUndefined)(this.outOfRangeLegend)&&!m&&(this.legendCollections.push({actualValue:b,legendData:[],legendName:b,legendFill:v}),S=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[S-1],O++),this.legendCollections[this.legendCollections.length-1].legendData.push(e[L]))}}},e.prototype.removeDuplicates=function(e,t){for(var i=!1,r=0;r<e.length;r++)if(e[r].legendName===t){i=!0;break}return i},e.prototype.isAddNewLegendData=function(e){var t,i;if(0===this.legendCollections.length)t=!0;else for(var r=0;r<this.legendCollections.length;r++){if(e===this.legendCollections[r].actualValue){t=!1,i=r;break}r===this.legendCollections.length-1&&(t=!0)}return{process:t,value:i}},e.prototype.drawLegend=function(){var e,t,i=this.treemap.legendSettings,r=this.treemap.renderer,o=i.textStyle;if(this.legendGroup=r.createGroup({id:this.treemap.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===i.mode)this.drawLegendItem(this.currentPage);else for(var l=0;l<this.legendRenderingCollections.length;l++){var n=this.treemap.element.id+"_Legend_Index_"+l,a=this.treemap.element.id+"_Legend_Index_"+l+"_Text",s=this.legendRenderingCollections[l];e=(t=s.element)?"url(#"+t.id+")":s.fill;var h=new W(s.x,s.y,s.width,s.height),d=new J(s.textX,s.textY),p=new j(n,e,i.shapeBorder,i.opacity,h);this.treemap.enableRtl&&("Left"===this.treemap.legendSettings.position||"Right"===this.treemap.legendSettings.position||"Auto"===this.treemap.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height?(p.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-(this.translate.y+p.height)-Math.abs(this.legendBorderRect.y-p.y),d.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+s.textHeight/2-Math.abs(this.legendBorderRect.y-d.y)):(p.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+p.width)-Math.abs(this.legendBorderRect.x-p.x),d.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-d.x))),Q(new q(a,d.x,d.y,"middle",s.text,"",""),o,o.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),this.legendGroup.appendChild(r.drawRectangle(p))}Oe(this.treemap,this.legendGroup)},e.prototype.defaultLegendRtlLocation=function(e,t,i,r){var o=e.Shape,l=e.Text,n=V(e.DisplayText,r.textStyle);return o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-o.x),l.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+n.width+t)-Math.abs(this.legendBorderRect.x-l.x),("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height)&&(o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-o.y)-r.shapeHeight/2,l.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-l.y)),{shapeLocation:o,textLocation:l}},e.prototype.drawLegendItem=function(e){var i,r,o=this,l=this.treemap,n=10,a=l.legendSettings,s=new A(a.shapeWidth,a.shapeHeight),h=l.renderer,d=a.shapeBorder;if(e>=0&&e<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var p="HorizontalLine"===a.shape||"VerticalLine"===a.shape||"Cross"===a.shape,g=p?(0,t.isNullOrUndefined)(a.fill)?"#000000":a.fill:d.color,c=p&&0===d.width?1:d.width,u=function(t){var d=m.totalPages[e].Collection[t],u=d.DisplayText,f=h.createGroup({id:l.element.id+"_Legend_Index_"+t});f.setAttribute("aria-label",u+" Legend"),f.setAttribute("role","region");var y=l.element.id+"_Legend_Shape_Index_"+t,v=l.element.id+"_Legend_Text_Index_"+t,b=d.Shape,x=d.Text;l.enableRtl&&(i=m.defaultLegendRtlLocation(d,n,l,a),b=i.shapeLocation,x=i.textLocation),r={cancel:!1,name:S,treemap:l,fill:d.Fill,shape:a.shape,imageUrl:a.imageUrl},l.trigger(S,r,(function(e){var t=new G(y,e.fill,c,p?d.Fill:g,a.opacity,"");f.appendChild(Re(b,e.shape,s,e.imageUrl,t)),Q(new q(v,x.x,x.y,"start",u,"",""),a.textStyle,a.textStyle.color||l.themeStyle.legendTextColor,f),o.legendGroup.appendChild(f)}))},m=this,f=0;f<this.totalPages[e].Collection.length;f++)u(f);var y=void 0,v=n;if(0!==this.page){var b=e+1+"/"+this.totalPages.length,x=a.textStyle,w=V(b,x),F=this.legendItemRect.x+this.legendItemRect.width-w.width-20-n,C=this.legendItemRect.x+this.legendItemRect.width,I=this.legendItemRect.y+this.legendItemRect.height+2.5+n,O=C-v-w.width/2-5;y=h.createGroup({id:l.element.id+"_Legend_Paging_Group"});var L=h.createGroup({id:l.element.id+"_Legend_Left_Paging_Group"}),T=h.createGroup({id:l.element.id+"_Legend_Right_Paging_Group"}),N=" M "+C+" "+I+" L "+(C-v)+" "+(I-5)+" L "+(C-v)+" "+(I+5)+" z ",D=" M "+F+" "+I+" L "+(F+v)+" "+(I-5)+" L "+(F+v)+" "+(I+5)+" z ",E=new G(l.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",D);L.appendChild(h.drawPath(E));var M=new j(l.element.id+"_Left_Page_Rect","transparent",{},1,new W(F-5,I-10,20,20),"");L.appendChild(h.drawRectangle(M)),this.wireEvents(L);var P=new G(l.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",N);T.appendChild(h.drawPath(P));var _=new j(l.element.id+"_Right_Page_Rect","transparent",{},1,new W(C-v,I-5,v,n),"");T.appendChild(h.drawRectangle(_)),this.wireEvents(T),y.appendChild(L),y.appendChild(T);var B={id:l.element.id+"_Paging_Text",x:O,y:I+w.height/4,fill:"#a6a6a6","font-size":"14px","font-style":x.fontStyle,"font-family":x.fontFamily,"font-weight":x.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":"",role:"region","aria-label":b};y.appendChild(h.createText(B,b)),this.legendGroup.appendChild(y)}}},e.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,r=10,o=t.titleStyle,l=V(X(this.legendItemRect.width+20,i,o),o);this.legendBorderRect=new W(this.legendItemRect.x-r,this.legendItemRect.y-r-l.height,this.legendItemRect.width+20,this.legendItemRect.height+20+l.height+("Interactive"===t.mode?0:0!==this.page?r:0));var n={color:t.border.color||this.treemap.themeStyle.legendBorderColor,width:t.border.width||this.treemap.themeStyle.legendBorderWidth},a=new j(e.element.id+"_Legend_Border",t.background,n,1,this.legendBorderRect,""),s=e.renderer.drawRectangle(a);s.style.pointerEvents="none",this.legendGroup.appendChild(s),this.getLegendAlignment(e,this.legendBorderRect.width,this.legendBorderRect.height,t),this.legendGroup.setAttribute("transform","translate( "+(this.translate.x+-this.legendBorderRect.x)+" "+(this.translate.y+-this.legendBorderRect.y)+" )"),e.svgObject.appendChild(this.legendGroup)},e.prototype.renderLegendTitle=function(){var e=this.treemap.legendSettings,t=e.titleStyle,i=e.title.text,r=X(this.legendItemRect.width+20,i,t),o=V(r,t);if(i){var l=Q(new q(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-o.height/2-5,"middle",r,""),t,t.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup);l.setAttribute("role","region"),l.setAttribute("aria-label",i)}},e.prototype.renderInteractivePointer=function(e){var i,r=this.treemap,o=e.target,l=r.element.id+"_Interactive_Legend";o=e.type.indexOf("touch")>-1?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):o;var n=r.legendSettings;if(o.id.indexOf("_Item_Index")>-1&&n.visible&&this.legendRenderingCollections.length>0){var a=void 0,s=void 0,h=void 0,d=void 0,p=void 0,g=void 0,c=void 0;i=r.layout.renderItems[parseFloat(o.id.split("_Item_Index_")[1])];for(var u=r.svgObject.getBoundingClientRect(),m=0;m<this.legendCollections.length;m++){a=this.legendCollections[m],s=(c=document.getElementById(r.element.id+"_Legend_Index_"+m)).getBoundingClientRect();var f=new W(Math.abs(s.left-u.left),Math.abs(s.top-u.top),s.width,s.height);if(d=c.getAttribute("fill"),p=n.shapeBorder.color,g=n.shapeBorder.width,!(0,t.isNullOrUndefined)(a.legendData)){h=a.legendData;for(var y=0;y<h.length;y++)if(h[y].levelOrderName===i.levelOrderName){this.drawInteractivePointer(n,d,p,l,g,f);break}}}}else this.removeInteractivePointer()},e.prototype.drawInteractivePointer=function(e,t,i,r,o,l){var n,a,s,h=10,d=10;n="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(a=l.x+l.width/2)+" "+(s=l.y+l.height)+" L "+(a-d)+" "+(s+h)+" L "+(a+d)+" "+(s+h)+" Z ":" M "+(a=l.x+l.width/2)+" "+(s=l.y)+" L "+(a-d)+" "+(s-h)+" L "+(a+d)+" "+(s-h)+" Z ":e.invertedPointer?" M "+(a=l.x)+" "+(s=l.y+l.height/2)+" L "+(a-d)+" "+(s-h)+" L "+(a-d)+" "+(s+h)+" z ":" M "+(a=l.x+l.width)+" "+(s=l.y+l.height/2)+" L "+(a+d)+" "+(s-h)+" L "+(a+d)+" "+(s+h)+" z ";var p=new G(r,t,o,i,1,"",n);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(p))},e.prototype.getLegendAlignment=function(e,i,r,o){var l,n,a,s=(a=(0,t.extend)({},e.areaRect,a,!0)).x,h=a.y,d=a.height,p=a.width,g=e.availableSize.width,c=e.availableSize.height,u="Auto"===o.position?g>c?"Right":"Bottom":o.position;if("Float"===o.position)this.translate=o.location;else{switch(u){case"Top":case"Bottom":a.height=d-r,l=g/2-i/2,n="Top"===u?h:h+a.height+10,a.y="Top"===u?h+r+10:h;break;case"Left":case"Right":a.width=p-i,l="Left"===u?s:s+a.width,n=c/2-r/2,a.x="Left"===u?s+i:s}switch(o.alignment){case"Near":"Top"===u||"Bottom"===u?l=a.x:n=a.y;break;case"Far":"Top"===u||"Bottom"===u?l=g-i:n=c-r}this.treemap.totalRect=a,this.translate=new J(l,n)}},e.prototype.mouseUpHandler=function(e){this.renderInteractivePointer(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeInteractivePointer.bind(this),3e3)},e.prototype.removeInteractivePointer=function(){if(document.getElementById(this.treemap.element.id+"_Interactive_Legend")){var e=document.getElementById(this.treemap.element.id+"_Interactive_Legend");e.parentNode.removeChild(e)}},e.prototype.changeNextPage=function(e){this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?this.currentPage-1:this.currentPage+1,this.currentPage>=0&&this.currentPage<this.totalPages.length?this.drawLegend():this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?0:this.totalPages.length-1},e.prototype.wireEvents=function(e){t.EventHandler.add(e,t.Browser.touchStartEvent,this.changeNextPage,this)},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderInteractivePointer,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderInteractivePointer),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapLegend"},e.prototype.destroy=function(){clearTimeout(this.clearTimeout),this.clearTimeout=null,this.legendRenderingCollections=[],this.legendCollections=[],this.outOfRangeLegend=null,this.totalPages=[],this.translate=null,this.legendBorderRect=null,this.legendGroup=null,this.legendNames=[],this.defsElement=null,this.legendLinearGradient=null,this.legendInteractiveGradient=[],this.legendItemRect=null,this.removeEventListener(),this.treemap=null},e.prototype.legendGradientColor=function(e,i){var r,o="http://www.w3.org/2000/svg";if(!(0,t.isNullOrUndefined)(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var l=this.treemap.renderer.createDefs(),n=document.createElementNS(o,"linearGradient"),a=this.treemap.legendSettings.position,s="Top"===a||"Bottom"===a?"100":"0",h="Top"===a||"Bottom"===a?"0":"100";n.setAttribute("id","linear_"+i),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2",s+"%"),n.setAttribute("y2",h+"%");for(var d=0;d<e.color.length;d++){var p=100/(e.color.length-1),g=document.createElementNS(o,"stop");g.setAttribute("offset",d*p+"%"),g.setAttribute("stop-color",e.color[d]),g.setAttribute("stop-opacity",1..toString()),n.appendChild(g)}l.appendChild(n),this.legendLinearGradient=n;var c="url(#linear_"+i+")";this.defsElement.appendChild(n),r=c}return r},e}(),at=function(){function e(e){this.target="highlight",this.shapeTarget="highlight",this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.treemap=e,this.addEventListener()}return e.prototype.mouseMove=function(e){var t,i,r,o,l,n,a,s=this.treemap,h=e.target.id,d=[],p=this.treemap.highlightSettings,c=[],u=this.treemap.treeMapSelectionModule;if(h.indexOf("_Item_Index")>-1&&(!u||this.treemap.selectionId!==h)){if(this.highLightId!==h){l=document.getElementById(s.element.id+"_TreeMap_"+s.layoutType+"_Layout");var m=document.getElementsByClassName("treeMapSelection");r=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var f=void 0;if(this.treemap.legendSettings.visible){var y=this.treemap.treeMapLegendModule.legendCollections;f=Ge(this.treemap.treeMapLegendModule.legendCollections.length,r,s),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+f):document.getElementById(this.treemap.element.id+"_Legend_Index_"+f),null===this.shapeElement||u&&this.shapeElement.getAttribute("id")===u.legendSelectId||u&&this.shapeElement===u.shapeElement?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(je(this.shapeHighlightCollection,this.currentElement,s),this.highLightId=""):(this.currentElement.push({currentElement:this.shapeElement}),Ae(this.shapeHighlightCollection),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:y[f].legendFill,oldOpacity:y[f].opacity,oldBorderColor:y[f].borderColor,oldBorderWidth:y[f].borderWidth}),We(this.shapeElement,p.fill,p.opacity,p.border.color,p.border.width.toString()),this.target="highlight")}if(a=re(r,[],p.mode,s),!this.treemap.legendSettings.visible||(!u||(!this.shapeElement||this.shapeElement.getAttribute("id")!==u.legendSelectId)))if(this.treemap.legendSettings.visible&&(u&&this.shapeElement===u.shapeElement))t=!1;else{for(var v=0;v<l.childElementCount;v++){n=l.childNodes[v],o=!0,r=s.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])];for(var b=0;b<m.length;b++)if(n.id===m[b].id){o=!1;break}a.indexOf(r.levelOrderName)>-1&&o&&(c.push(n),d.push(r))}Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s);for(var S=0;S<c.length;S++)Te((n=c[S]).childNodes[0],{border:p.border,fill:p.fill,opacity:p.opacity}),n.classList.add("treeMapHighLight"),this.highLightId=h;i={cancel:!1,name:g,treemap:s,items:d,elements:c},s.trigger(g,i)}}}else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){if(this.treemap.legendSettings.visible&&(!u||u.legendSelectId!==h)&&(!u||u.shapeSelectId!==h)){var x,w=void 0,F=void 0,C=document.getElementById(h);"highlight"===this.shapeTarget&&He(this.legendHighlightCollection),this.shapeTarget="highlight";f="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);var I=this.treemap.treeMapLegendModule.legendCollections[f].legendData.length,O=(y=this.treemap.treeMapLegendModule.legendCollections,parseInt(h[h.length-1],10));for(v=0;v<I;v++)for(b=0;b<this.treemap.layout.renderItems.length;b++)if(this.treemap.treeMapLegendModule.legendCollections[f].legendData[v].levelOrderName===this.treemap.layout.renderItems[b].levelOrderName){w=b,F=this.treemap.layout.renderItems[b].groupIndex;var L=document.getElementById(this.treemap.element.id+"_Level_Index_"+F+"_Item_Index_"+w+"_RectPath");0===v&&(this.legendHighlightCollection=[],Ve(this.legendHighlightCollection,O,b,C,L,this.treemap.layout.renderItems,y),x=this.legendHighlightCollection.length,this.legendHighlightCollection[x-1].ShapeCollection={Elements:[]}),We(C,p.fill,p.opacity,p.border.color,p.border.width.toString()),We(L,p.fill,p.opacity,p.border.color,p.border.width.toString()),x=this.legendHighlightCollection.length,this.legendHighlightCollection[x-1].ShapeCollection.Elements.push(L)}}}else u&&this.shapeElement&&this.shapeElement.getAttribute("id")===u.legendSelectId||(u?this.shapeElement!==u.shapeElement:this.treemap.legendSettings.visible)&&Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||u&&this.shapeElement&&this.shapeElement.getAttribute("id")===u.legendSelectId||(u?this.shapeElement!==u.shapeElement:!u||u.legendSelect)&&(Ae(this.shapeHighlightCollection),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&He(this.legendHighlightCollection),this.highLightId="",t=!1;return t},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchMoveEvent,this.mouseMove,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchMoveEvent,this.mouseMove)},e.prototype.getModuleName=function(){return"treeMapHighlight"},e.prototype.destroy=function(){this.shapeElement=null,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.removeEventListener(),this.treemap=null},e}(),st=function(){function e(e){this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeSelect=!0,this.legendSelect=!0,this.treemap=e,this.addEventListener()}return e.prototype.mouseDown=function(e){var t,i=e.target,r=this.treemap;r.levelSelection=[];var o,l,n,a,s=[],h=i.id,d=i.innerHTML,g=[],c=r.selectionSettings,u=this.treemap.treeMapHighlightModule,m=r.element.id+"_TreeMap_"+r.layoutType+"_Layout";if(h.indexOf("_Item_Index")>-1)if(e.preventDefault(),this.treemap.selectionId!==h&&this.legendSelect){l=document.getElementById(m),o=r.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var f=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var y=this.treemap.treeMapLegendModule.legendCollections.length,v=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Ae(this.shapeSelectionCollection),u&&(u.shapeTarget="selection",u.shapeHighlightCollection=[]),f=Ge(y,o,r),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+f):document.getElementById(this.treemap.element.id+"_Legend_Index_"+f),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:v[f].legendFill,oldOpacity:v[f].opacity,oldBorderColor:v[f].borderColor,oldBorderWidth:v[f].borderWidth}),We(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()))}a=re(o,[],c.mode,r);for(var b=0;b<l.childElementCount;b++)n=l.childNodes[b],o=r.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],a.indexOf(o.levelOrderName)>-1&&(g.push(n),r.levelSelection.push(n.id),s.push(o));Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId=h;for(var S=document.getElementsByClassName("treeMapHighLight"),x=0;x<g.length;x++){if(n=g[x],S.length>0)for(var w=0;w<S.length;w++)S[w].id===n.id&&S[w].classList.remove("treeMapHighLight"),Te(n.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),n.classList.add("treeMapSelection");else Te(n.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),n.classList.add("treeMapSelection");t={cancel:!1,name:p,treemap:r,items:s,elements:g,text:d,contentItemTemplate:d},r.trigger(p,t,(function(e){e.contentItemTemplate!==d&&$(h,i,e.contentItemTemplate)}))}}else Ae(this.shapeSelectionCollection),this.shapeSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId="";else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){v=this.treemap.treeMapLegendModule.legendCollections;if(this.treemap.legendSettings.visible&&this.legendSelectId!==h&&this.shapeSelect){var F,C=void 0,I=void 0;this.legendSelectId=h,this.legendSelect=!1;var O=parseInt(h[h.length-1],10),L=document.getElementById(h);He(this.legendSelectionCollection),u&&(u.shapeTarget="selection");f="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);var T=this.treemap.treeMapLegendModule.legendCollections[f].legendData.length;for(x=0;x<T;x++)for(var N=0;N<this.treemap.layout.renderItems.length;N++)if(this.treemap.treeMapLegendModule.legendCollections[f].legendData[x].levelOrderName===this.treemap.layout.renderItems[N].levelOrderName){C=N,I=this.treemap.layout.renderItems[N].groupIndex;var D=document.getElementById(this.treemap.element.id+"_Level_Index_"+I+"_Item_Index_"+C+"_RectPath");0===x&&(Ve(this.legendSelectionCollection,O,N,L,D,this.treemap.layout.renderItems,v),F=this.legendSelectionCollection.length,this.legendSelectionCollection[F-1].ShapeCollection={Elements:[]}),We(L,c.fill,c.opacity,c.border.color,c.border.width.toString()),We(D,c.fill,c.opacity,c.border.color,c.border.width.toString()),F=this.legendSelectionCollection.length,this.legendSelectionCollection[F-1].ShapeCollection.Elements.push(D)}}else He(this.legendSelectionCollection),u&&(u.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId=""}},e.prototype.selectTreemapItem=function(e,t){if(t){for(var i=void 0,r=0;r<this.treemap.layout.renderItems.length;r++)if(e===this.treemap.layout.renderItems[r].levelOrderName){i=this.treemap.layout.renderItems[r];break}var o=this.treemap.selectionSettings,l=[],n=void 0,a=void 0,s=[];this.treemap.levelSelection=[];for(var h=this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout",d=document.getElementById(h),p=re(i,[],o.mode,this.treemap),g=0;g<d.childElementCount;g++)n=d.childNodes[g],i=this.treemap.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],p.indexOf(i.levelOrderName)>-1&&(l.push(n),this.treemap.levelSelection.push(n.id),s.push(i));if(this.treemap.legendSettings.visible)for(var c=0;c<s.length;c++){this.shapeSelect=!1;var u=this.treemap.treeMapLegendModule.legendCollections.length,m=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Ae(this.shapeSelectionCollection),a=Ge(u,s[c],this.treemap),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+a):document.getElementById(this.treemap.element.id+"_Legend_Index_"+a),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.treemap.legendId.push(this.shapeSelectId),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:m[a].legendFill,oldOpacity:m[a].opacity,oldBorderColor:m[a].borderColor,oldBorderWidth:m[a].borderWidth}),We(this.shapeElement,o.fill,o.opacity,o.border.color,o.border.width.toString()))}Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap);var f=document.getElementById(this.treemap.levelSelection[0]);this.treemap.selectionId=f.childNodes[0].id;for(var y=document.getElementsByClassName("treeMapHighLight"),v=0;v<l.length;v++)if(n=l[v],y.length>0)for(var b=0;b<y.length;b++)y[b].id===n.id&&y[b].classList.remove("treeMapHighLight"),Te(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection");else o.fill="null"===o.fill?this.treemap.layout.renderItems[parseInt(n.id.split("Item_Index_")[1],10)].options.fill:o.fill,Te(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection")}else Ae(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap),this.treemap.selectionId=""},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchStartEvent,this.mouseDown,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchStartEvent,this.mouseDown)},e.prototype.getModuleName=function(){return"treeMapSelection"},e.prototype.destroy=function(){this.shapeElement=null,this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.removeEventListener(),this.treemap=null},e}(),ht=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(i[r[o]]=e[r[o]])}return i},dt=function(){function e(e){this.treemap=e,this.tooltipSettings=this.treemap.tooltipSettings,this.tooltipId=this.treemap.element.id+"_TreeMapTooltip",this.addEventListener()}return e.prototype.renderTooltip=function(e){var i,r,o,l,n,a,s=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,i=(l=e).changedTouches[0].pageX,r=l.changedTouches[0].pageY,o=l.target):(this.isTouch="touch"===e.pointerType,i=e.pageX,r=e.pageY,o=e.target);var h,d,p,g=o.id,u={},m={},f=[];if(g.indexOf("_Item_Index")>-1){if(u=this.treemap.layout.renderItems[parseFloat(g.split("_Item_Index_")[1])],!(0,t.isNullOrUndefined)(u)){a=u.weight,m=u.data,(0,t.isNullOrUndefined)(u.options)||(p=u.options.fill),f=this.treemap.enableRtl?[((0,t.isNullOrUndefined)(this.tooltipSettings.format)?null:Ne(this.tooltipSettings.format,m,this.treemap))||De(a,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[((0,t.isNullOrUndefined)(this.tooltipSettings.format)?null:Ne(this.tooltipSettings.format,m,this.treemap))||this.treemap.weightValuePath.toString()+" : "+De(a,this.treemap)],document.getElementById(this.tooltipId)?h=document.getElementById(this.tooltipId):((h=(0,t.createElement)("div",{id:this.treemap.element.id+"_TreeMapTooltip",className:"EJ2-TreeMap-Tooltip"})).style.cssText="position: absolute;pointer-events:none;",document.getElementById(this.treemap.element.id+"_Secondary_Element").appendChild(h)),(d=ge(i,r,this.treemap.svgObject)).y=this.tooltipSettings.template?d.y+10:d.y,this.tooltipSettings.textStyle.size=this.tooltipSettings.textStyle.size||this.treemap.themeStyle.tooltipFontSize,this.tooltipSettings.textStyle.fontFamily=this.tooltipSettings.textStyle.fontFamily||this.treemap.themeStyle.fontFamily,this.tooltipSettings.textStyle.fontStyle=(0,t.isNullOrUndefined)(this.tooltipSettings.textStyle.fontStyle)?"Normal":this.tooltipSettings.textStyle.fontStyle,this.tooltipSettings.textStyle.fontWeight=this.tooltipSettings.textStyle.fontWeight||this.treemap.themeStyle.fontWeight,this.tooltipSettings.textStyle.color=this.tooltipSettings.textStyle.color||this.treemap.themeStyle.tooltipFontColor,this.tooltipSettings.textStyle.opacity=this.tooltipSettings.textStyle.opacity||this.treemap.themeStyle.tooltipTextOpacity;var y={width:this.tooltipSettings.border.width||this.treemap.themeStyle.tooltipBorderWidth||0,color:this.tooltipSettings.border.color||this.treemap.themeStyle.tooltipBorderColor||"transparent"};n={cancel:!1,name:c,item:u,options:{location:d,text:f,data:m,border:y,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:o,eventArgs:e},this.treemap.trigger(c,n,(function(e){s.addTooltip(n,p,h)}))}}else this.removeTooltip(),this.treemap.clearTemplate()},e.prototype.addTooltip=function(e,r,o,l){var n,a;(0,t.isNullOrUndefined)(e)?(n=l.cancel,a=l):(n=e.cancel,a=ht(e,["cancel"]).options);n?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new i.Tooltip({theme:this.treemap.theme,enable:!0,header:"",data:a.data,template:a.template,content:a.text,shapes:[],location:a.location,palette:[r],areaBounds:this.treemap.areaRect,textStyle:a.textStyle,fill:this.treemap.tooltipSettings.fill?this.treemap.tooltipSettings.fill:this.treemap.themeStyle.tooltipFillColor,border:a.border,enableShadow:!0}),(this.treemap.isVue||this.treemap.isVue3)&&(this.svgTooltip.controlInstance=this.treemap),this.svgTooltip.opacity=this.treemap.themeStyle.tooltipFillOpacity||this.svgTooltip.opacity,this.svgTooltip.appendTo(o),this.treemap.renderReactTemplates())},e.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},e.prototype.removeTooltip=function(){if(document.getElementsByClassName("EJ2-TreeMap-Tooltip").length>0){var e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0];e.parentNode.removeChild(e)}},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderTooltip,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderTooltip),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapTooltip"},e.prototype.destroy=function(){(0,t.isNullOrUndefined)(this.svgTooltip)||this.svgTooltip.destroy(),this.svgTooltip=null,this.tooltipSettings=null,this.removeEventListener(),this.treemap=null},e}()})(),a})()));
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionSvgBase"),require("SyncfusionData"),require("SyncfusionPdfExport")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionSvgBase","SyncfusionData","SyncfusionPdfExport"],t):"object"==typeof exports?exports.SyncfusionTreemap=t(require("SyncfusionBase"),require("SyncfusionSvgBase"),require("SyncfusionData"),require("SyncfusionPdfExport")):e.SyncfusionTreemap=t(e.SyncfusionBase,e.SyncfusionSvgBase,e.SyncfusionData,e.SyncfusionPdfExport)}(self,((e,t,i,r)=>(()=>{"use strict";var l={766:t=>{t.exports=e},74:e=>{e.exports=i},461:e=>{e.exports=r},727:e=>{e.exports=t}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={exports:{}};return l[e](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{n.r(a),n.d(a,{Border:()=>O,ColorMapping:()=>M,ColorValue:()=>Ee,CommonTitleSettings:()=>N,Font:()=>T,HighlightSettings:()=>U,ImageExport:()=>Ke,InitialDrillSettings:()=>_,LayoutPanel:()=>Ye,LeafItemSettings:()=>B,LegendSettings:()=>P,LevelSettings:()=>k,LevelsData:()=>ot,Location:()=>J,Margin:()=>L,PathOption:()=>G,PdfExport:()=>tt,Print:()=>$e,Rect:()=>W,RectOption:()=>j,SelectionSettings:()=>z,Size:()=>A,SubTitleSettings:()=>D,TextOption:()=>q,Theme:()=>Je,TitleSettings:()=>E,TooltipSettings:()=>R,TreeMap:()=>lt,TreeMapAjax:()=>ke,TreeMapHighlight:()=>at,TreeMapLegend:()=>nt,TreeMapSelection:()=>st,TreeMapTooltip:()=>dt,applyOptions:()=>Te,beforePrint:()=>o,click:()=>f,colorCollections:()=>me,colorMap:()=>ce,colorNameToHex:()=>Be,componentToHex:()=>Pe,convertElement:()=>oe,convertHexToColor:()=>_e,convertToContainer:()=>de,convertToHexCode:()=>Me,convertToRect:()=>pe,createTextStyle:()=>Z,deSaturationColor:()=>ue,defaultFont:()=>F,doubleClick:()=>y,drawSymbol:()=>Re,drillEnd:()=>d,drillStart:()=>h,findChildren:()=>ie,findHightLightItems:()=>re,findLabelLocation:()=>ne,findPosition:()=>Y,formatValue:()=>De,getArea:()=>se,getColorByValue:()=>ye,getElement:()=>K,getGradientColor:()=>ve,getLegendIndex:()=>Ge,getMousePosition:()=>ge,getPercentage:()=>Se,getPercentageColor:()=>be,getShortestEdge:()=>he,getTemplateFunction:()=>le,getThemeStyle:()=>Qe,hide:()=>Fe,isContainsData:()=>te,isParentItem:()=>Ue,itemClick:()=>u,itemHighlight:()=>g,itemMove:()=>m,itemRendering:()=>s,itemSelected:()=>p,itemsToOrder:()=>ee,legendItemRendering:()=>S,legendMaintain:()=>Oe,legendRendering:()=>x,load:()=>r,loaded:()=>l,maintainSelection:()=>Ie,measureElement:()=>ae,measureText:()=>V,mouseMove:()=>b,orderByArea:()=>Ce,pushCollection:()=>Ve,removeClassNames:()=>Le,removeElement:()=>Xe,removeLegend:()=>He,removeSelectionWithHighlight:()=>je,removeShape:()=>Ae,renderLegendShape:()=>ze,renderTextElement:()=>Q,resize:()=>w,rgbToHex:()=>fe,rightClick:()=>v,setColor:()=>We,setItemTemplateContent:()=>$,stringToNumber:()=>H,textFormatter:()=>Ne,textTrim:()=>X,textWrap:()=>we,tooltipRendering:()=>c,triggerDownload:()=>qe,wordWrap:()=>xe});var e,t=n(766),i=n(727),r="load",l="loaded",o="beforePrint",s="itemRendering",h="drillStart",d="drillEnd",p="itemSelected",g="itemHighlight",c="tooltipRendering",u="itemClick",m="itemMove",f="click",y="doubleClick",v="rightClick",b="mouseMove",S="legendItemRendering",x="legendRendering",w="resize",F="Roboto, Segoe UI, Noto, Sans-serif",C=(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])},e(t,i)},function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}),I=function(e,t,i,r){var l,o=arguments.length,n=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(l=e[a])&&(n=(o<3?l(n):o>3?l(t,i,n):l(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)("#808080")],i.prototype,"color",void 0),I([(0,t.Property)(0)],i.prototype,"width",void 0),i}(t.ChildProperty),L=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(10)],i.prototype,"left",void 0),I([(0,t.Property)(10)],i.prototype,"right",void 0),I([(0,t.Property)(10)],i.prototype,"top",void 0),I([(0,t.Property)(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),T=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(null)],i.prototype,"size",void 0),I([(0,t.Property)(null)],i.prototype,"color",void 0),I([(0,t.Property)(F)],i.prototype,"fontFamily",void 0),I([(0,t.Property)("")],i.prototype,"fontWeight",void 0),I([(0,t.Property)("Normal")],i.prototype,"fontStyle",void 0),I([(0,t.Property)(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)("")],i.prototype,"text",void 0),I([(0,t.Property)("")],i.prototype,"description",void 0),i}(t.ChildProperty),D=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Complex)({fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),I([(0,t.Property)("Center")],i.prototype,"alignment",void 0),i}(N),E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Complex)({fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),I([(0,t.Property)("Center")],i.prototype,"alignment",void 0),I([(0,t.Complex)({},D)],i.prototype,"subtitleSettings",void 0),i}(N),M=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(null)],i.prototype,"from",void 0),I([(0,t.Property)(null)],i.prototype,"to",void 0),I([(0,t.Property)(null)],i.prototype,"color",void 0),I([(0,t.Property)(null)],i.prototype,"label",void 0),I([(0,t.Property)(null)],i.prototype,"value",void 0),I([(0,t.Property)(null)],i.prototype,"minOpacity",void 0),I([(0,t.Property)(null)],i.prototype,"maxOpacity",void 0),I([(0,t.Property)(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),P=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(!1)],i.prototype,"visible",void 0),I([(0,t.Property)("Default")],i.prototype,"mode",void 0),I([(0,t.Property)("transparent")],i.prototype,"background",void 0),I([(0,t.Property)("Circle")],i.prototype,"shape",void 0),I([(0,t.Property)("")],i.prototype,"width",void 0),I([(0,t.Property)("")],i.prototype,"height",void 0),I([(0,t.Complex)({size:null,fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),I([(0,t.Property)(null)],i.prototype,"fill",void 0),I([(0,t.Property)(1)],i.prototype,"opacity",void 0),I([(0,t.Property)(15)],i.prototype,"shapeWidth",void 0),I([(0,t.Property)(15)],i.prototype,"shapeHeight",void 0),I([(0,t.Property)(10)],i.prototype,"shapePadding",void 0),I([(0,t.Property)(null)],i.prototype,"imageUrl",void 0),I([(0,t.Complex)({color:null,width:null},O)],i.prototype,"border",void 0),I([(0,t.Complex)({color:"#000000",width:0},O)],i.prototype,"shapeBorder",void 0),I([(0,t.Complex)({},N)],i.prototype,"title",void 0),I([(0,t.Complex)({size:null,fontFamily:null,fontWeight:null},T)],i.prototype,"titleStyle",void 0),I([(0,t.Property)("Bottom")],i.prototype,"position",void 0),I([(0,t.Property)("None")],i.prototype,"orientation",void 0),I([(0,t.Property)(!1)],i.prototype,"invertedPointer",void 0),I([(0,t.Property)("After")],i.prototype,"labelPosition",void 0),I([(0,t.Property)("None")],i.prototype,"labelDisplayMode",void 0),I([(0,t.Property)("Center")],i.prototype,"alignment",void 0),I([(0,t.Property)({x:0,y:0})],i.prototype,"location",void 0),I([(0,t.Property)(null)],i.prototype,"showLegendPath",void 0),I([(0,t.Property)(null)],i.prototype,"valuePath",void 0),I([(0,t.Property)(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(null)],i.prototype,"groupIndex",void 0),I([(0,t.Property)(null)],i.prototype,"groupName",void 0),i}(t.ChildProperty),B=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(null)],i.prototype,"fill",void 0),I([(0,t.Property)(!1)],i.prototype,"autoFill",void 0),I([(0,t.Complex)({},O)],i.prototype,"border",void 0),I([(0,t.Property)(0)],i.prototype,"gap",void 0),I([(0,t.Property)(10)],i.prototype,"padding",void 0),I([(0,t.Property)(1)],i.prototype,"opacity",void 0),I([(0,t.Property)(!0)],i.prototype,"showLabels",void 0),I([(0,t.Property)(null)],i.prototype,"labelPath",void 0),I([(0,t.Property)(null)],i.prototype,"labelFormat",void 0),I([(0,t.Property)("TopLeft")],i.prototype,"labelPosition",void 0),I([(0,t.Complex)({color:null,size:null,fontFamily:null},T)],i.prototype,"labelStyle",void 0),I([(0,t.Property)(null)],i.prototype,"labelTemplate",void 0),I([(0,t.Property)("Center")],i.prototype,"templatePosition",void 0),I([(0,t.Property)("Trim")],i.prototype,"interSectAction",void 0),I([(0,t.Collection)([],M)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),R=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(!1)],i.prototype,"visible",void 0),I([(0,t.Property)("")],i.prototype,"template",void 0),I([(0,t.Property)(null)],i.prototype,"format",void 0),I([(0,t.Property)(null)],i.prototype,"fill",void 0),I([(0,t.Property)(.75)],i.prototype,"opacity",void 0),I([(0,t.Property)(["Circle"])],i.prototype,"markerShapes",void 0),I([(0,t.Complex)({width:null,color:null},O)],i.prototype,"border",void 0),I([(0,t.Complex)({fontFamily:null,size:null,fontWeight:null,opacity:null},T)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(!1)],i.prototype,"enable",void 0),I([(0,t.Property)(null)],i.prototype,"fill",void 0),I([(0,t.Property)("0.5")],i.prototype,"opacity",void 0),I([(0,t.Complex)({},O)],i.prototype,"border",void 0),I([(0,t.Property)("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),U=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(!1)],i.prototype,"enable",void 0),I([(0,t.Property)("#808080")],i.prototype,"fill",void 0),I([(0,t.Property)("0.5")],i.prototype,"opacity",void 0),I([(0,t.Complex)({},O)],i.prototype,"border",void 0),I([(0,t.Property)("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),k=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return C(i,e),I([(0,t.Property)(null)],i.prototype,"groupPath",void 0),I([(0,t.Property)(0)],i.prototype,"groupGap",void 0),I([(0,t.Property)(10)],i.prototype,"groupPadding",void 0),I([(0,t.Complex)({},O)],i.prototype,"border",void 0),I([(0,t.Property)(null)],i.prototype,"fill",void 0),I([(0,t.Property)(!1)],i.prototype,"autoFill",void 0),I([(0,t.Property)(1)],i.prototype,"opacity",void 0),I([(0,t.Property)(!0)],i.prototype,"showHeader",void 0),I([(0,t.Property)(20)],i.prototype,"headerHeight",void 0),I([(0,t.Property)(null)],i.prototype,"headerTemplate",void 0),I([(0,t.Property)(null)],i.prototype,"headerFormat",void 0),I([(0,t.Property)("Near")],i.prototype,"headerAlignment",void 0),I([(0,t.Complex)({color:null,size:"13px",fontFamily:null},T)],i.prototype,"headerStyle",void 0),I([(0,t.Property)("TopLeft")],i.prototype,"templatePosition",void 0),I([(0,t.Collection)([],M)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),A=function(e,t){this.width=e,this.height=t};function H(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}var W=function(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r},j=function(e,t,i,r,l,o){this.y=l.y,this.x=l.x,this.height=l.height,this.width=l.width,this.id=e,this.fill=t,this.opacity=r,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=o},G=function(e,t,i,r,l,o,n){this.id=e,this.opacity=l,this.fill=t,this.stroke=r,this["stroke-width"]=i,this["stroke-dasharray"]=o,this.d=n};function V(e,i){var r=document.getElementById("treeMapMeasureText");return null===r&&(r=(0,t.createElement)("text",{id:"treeMapMeasureText"}),document.body.appendChild(r)),r.innerHTML=t.SanitizeHtmlHelper.sanitize(e),r.style.position="absolute",r.style.fontSize=i.size,r.style.fontWeight=i.fontWeight,r.style.fontStyle=i.fontStyle,r.style.fontFamily=i.fontFamily,r.style.visibility="hidden",r.style.top="-100",r.style.left="0",r.style.whiteSpace="nowrap",r.style.lineHeight="normal",new A(r.clientWidth,r.clientHeight)}var q=function(e,t,i,r,l,o,n,a){void 0===o&&(o=""),this.transform="",this.baseLine="auto",this.id=e,this.text=l,this.transform=o,this.anchor=r,this.x=t,this.y=i,this.baseLine=n,this.connectorText=a};function X(e,t,i){var r=t,l=V(t,i).width;if(l>e)for(var o=t.length-1;o>=0;--o)if((l=V(r=t.substring(0,o)+"...",i).width)<=e||r.length<4)return r.length<4&&(r=" "),r;return r}var J=function(e,t){this.x=e,this.y=t};function Y(e,t,i,r){var l;switch(t){case"Near":l=e.x;break;case"Center":l="title"===r?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":l="title"===r?e.width-e.y-i.width:e.x+e.width-i.width}var o="title"===r?e.y+i.height/2:e.y+e.height/2+i.height/2;return new J(l,o)}function Z(e,t,i){var r=e.createText(t,i);return r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.style["user-select"]="none",r.style["-moz-user-select"]="none",r.style["-webkit-touch-callout"]="none",r.style["-webkit-user-select"]="none",r.style["-khtml-user-select"]="none",r.style["-ms-user-select"]="none",r.style["-o-user-select"]="none",r}function Q(e,r,l,o,n){void 0===n&&(n=!1);var a,s,h,d={"font-size":r.size,"font-style":r.fontStyle,"font-family":r.fontFamily,"font-weight":r.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:r.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:l},p="string"==typeof e.text?e.text:n?e.text[e.text.length-1]:e.text[0],g=new i.SvgRenderer("");if(!(0,t.isNullOrUndefined)(p)&&!(0,t.isNullOrUndefined)(e.connectorText)&&p.search(e.connectorText[1])>=0)for(var c=p.split("#"),u=0;u<c.length;u++){var m=-1===c[u].search(e.connectorText)||(0,t.isNullOrUndefined)(e.connectorText)?c[u]:e.connectorText;if(d.id=e.id+"_"+u,h=Z(g,d,m),u%2==0&&0!==u){m=m.replace(/\s+/g,"&nbsp")}var f=V(m,r);d.x=0!==u?d.x+f.width:d.x+f.width+5,o.appendChild(h)}else h=Z(g,d,p),o.appendChild(h);if("string"!=typeof e.text&&e.text.length>1){for(var y=1,v=e.text.length;y<v;y++)s=V(e.text[y],r).height,a=g.createTSpan({x:e.x,id:e.id,y:e.y+y*s},e.text[y]),h.appendChild(a);o.appendChild(h)}return h}function $(e,i,r){var l,o=e.split("_RectPath")[0];l=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+o+"_LabelTemplate"),(0,t.isNullOrUndefined)(l)||(l.innerHTML=r)}function K(e){return document.getElementById(e)}function ee(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function te(e,t,i,r){for(var l=!1,o="",n=r.leafItemSettings,a=0;a<e.length;a++){var s=i[r.levels[a]?r.levels[a].groupPath:n.labelPath?n.labelPath:r.weightValuePath]||"undefined";if(e[a]===s&&(o+=s+(a===e.length-1?"":"#"))===t){l=!0;break}}return l}function ie(e){var t;if(e){var i=Object.keys(e);t={};for(var r=0;r<i.length;r++)if(e[i[r]]instanceof Array){t.values=e[i[r]],t.key=i[r];break}}return t}function re(e,t,i,r){if("Child"===i){t.push(e.levelOrderName);var l=ie(e).values;if(l&&l.length>0){for(var o=0;o<l.length;o++)-1===t.indexOf(l[o].levelOrderName)&&t.push(l[o].levelOrderName);for(var n=0;n<l.length;n++)re(l[n],t,i,r)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),re(e.parent,t,i,r));else if("All"===i){var a=e.levelOrderName.split("#")[0],s=void 0;for(o=0;o<r.layout.renderItems.length;o++)(s=r.layout.renderItems[o]).levelOrderName.indexOf(a)>-1&&-1===t.indexOf(s.levelOrderName)&&t.push(s.levelOrderName)}else t.push(e.levelOrderName);return t}function le(e){var i=null;try{i="function"!=typeof e&&document.querySelectorAll(e).length?(0,t.compile)(document.querySelector(e).innerHTML.trim()):(0,t.compile)(e)}catch(r){i=(0,t.compile)(e)}return i}function oe(e,i,r){var l=(0,t.createElement)("div",{id:i});l.style.cssText="position: absolute;pointer-events: auto;";for(var o=e.length;o>0;)l.appendChild(e[0]),o--;for(var n=l.innerHTML,a=Object.keys(r),s=0;s<a.length;s++){var h=RegExp;n=n.replace(new h("{{:"+a[s]+"}}","g"),r[a[s].toString()])}return l.innerHTML=n,l}function ne(e,t,i,r,l){var o=new J(0,0),n="Template"===r?l.areaRect.x:0,a="Template"===r?l.areaRect.y:0;return o.x=Math.abs(n-(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,!l.enableDrillDown||"BottomLeftTopRight"!==l.renderDirection&&"BottomRightTopLeft"!==l.renderDirection?o.y=Math.abs(a-(t.indexOf("Top")>-1?"Template"===r?e.y:e.y+i.height:t.indexOf("Bottom")>-1?e.y+e.height-i.height:"Template"===r?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 ae(e,t){var i=new A(0,0);t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth;var r=document.getElementById(e.id);return r.parentNode.removeChild(r),i}function se(e){return(e.width-e.x)*(e.height-e.y)}function he(e){var t=de(e),i=t.width,r=t.height;return Math.min(i,r)}function de(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function pe(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function ge(e,t,i){var r=i.getBoundingClientRect(),l=i.ownerDocument.defaultView.pageXOffset,o=i.ownerDocument.defaultView.pageYOffset,n=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=r.left+l-a,h=r.top+o-n;return new J(e-s,t-h)}function ce(e,i,r){var l,o,n=[];if((0,t.isNullOrUndefined)(i)&&(0,t.isNullOrUndefined)(r)&&isNaN(r))return null;for(var a=0;a<e.length;a++){var s=!1,h=r;(0,t.isNullOrUndefined)(e[a].from)||(0,t.isNullOrUndefined)(e[a].to)||(0,t.isNullOrUndefined)(e[a].value)?((0,t.isNullOrUndefined)(e[a].from)||(0,t.isNullOrUndefined)(e[a].to))&&(0,t.isNullOrUndefined)(e[a].value)||(r>=e[a].from&&e[a].to>=r||e[a].value===i)&&(e[a].value===i&&(s=!0),l="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:me(e[a],h):e[a].color):r>=e[a].from&&e[a].to>=r&&e[a].value===i&&(s=!0,l="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:me(e[a],h):e[a].color),(r>=e[a].from&&r<=e[a].to||e[a].value===i)&&!(0,t.isNullOrUndefined)(e[a].minOpacity)&&!(0,t.isNullOrUndefined)(e[a].maxOpacity)&&l&&(o=ue(e[a],r)),(""===l||(0,t.isNullOrUndefined)(l))&&(0,t.isNullOrUndefined)(e[a].from)&&(0,t.isNullOrUndefined)(e[a].to)&&(0,t.isNullOrUndefined)(e[a].minOpacity)&&(0,t.isNullOrUndefined)(e[a].maxOpacity)&&(0,t.isNullOrUndefined)(e[a].value)&&(l="[object Array]"===Object.prototype.toString.call(e[a].color)?e[a].color[0]:e[a].color),o=(0,t.isNullOrUndefined)(o)?"1":o,n.push(l)}for(var d=n.length-1;d>=0;d--)d=(l=n[d])?-1:d;return{fill:l,opacity:o}}function ue(e,t){var i=1;t>=e.from&&t<=e.to&&(i=(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity);return i.toString()}function me(e,t){return ye(e,t)}function fe(e,t,i){return"#"+Pe(e)+Pe(t)+Pe(i)}function ye(e,t){var i;return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:fe((i=ve(Number(t),e)).r,i.g,i.b)}function ve(e,t){var i,r,l=t.from,o=t.to,n=0,a=o-l;if(n=(e-l)/a,t.color.length<=2)i="#"===t.color[0].charAt(0)?t.color[0]:Be(t.color[0]),r="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:Be(t.color[t.color.length-1]);else{i="#"===t.color[0].charAt(0)?t.color[0]:Be(t.color[0]),r="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:Be(t.color[t.color.length-1]);for(var s=a/(t.color.length-1),h=t.color.length-1,d=[],p={},g=1;g<h;g++)p={b:l+g*s,color:t.color[g]},d.push(p);for(var c=0;c<d.length;c++)l<=e&&e<=d[c].b&&0===c?(r="#"===d[c].color.charAt(0)?d[c].color:Be(d[c].color),n=e<d[c].b?1-Math.abs((e-d[c].b)/s):(e-d[c].b)/s):d[c].b<=e&&e<=o&&c===d.length-1&&(i="#"===d[c].color.charAt(0)?d[c].color:Be(d[c].color),n=e<d[c].b?1-Math.abs((e-d[c].b)/s):(e-d[c].b)/s),c!==d.length-1&&c<d.length&&d[c].b<=e&&e<=d[c+1].b&&(i="#"===d[c].color.charAt(0)?d[c].color:Be(d[c].color),r="#"===d[c+1].color.charAt(0)?d[c+1].color:Be(d[c+1].color),n=Math.abs(e-d[c+1].b)/s)}return be(n,i,r)}function be(e,t,i){var r=i.split("#")[1],l=t.split("#")[1],o=Se(e,parseInt(l.substr(0,2),16),parseInt(r.substr(0,2),16)),n=Se(e,parseInt(l.substr(2,2),16),parseInt(r.substr(2,2),16)),a=Se(e,parseInt(l.substr(4,2),16),parseInt(r.substr(4,2),16));return new Ee(o,n,a)}function Se(e,t,i){var r=i-t;return Math.round(t+r*e)}function xe(e,t,i){for(var r,l=t.split(" "),o="",n=[],a=0,s=l.length;a<s;a++)r=l[a],V(o.concat(r),i).width<e?o=o.concat((""===o?"":" ")+r):""!==o?(n.push(X(e,o,i)),o=r):(n.push(X(e,r,i)),r=""),o&&a===s-1&&n.push(X(e,o,i));return n}function we(e,t,i){var r=[],l=0,o=V(t,i).width,n=t.length;if(e>=o)return r.push(t),r;for(var a=t.length;a>l;a--){var s=t.slice(l,a);if((o=V(s,i).width)<=e){if(r.push(s),n===(l+=s.length))return r;a=n+1}}return r}function Fe(e,t,i,r){var l=V(i,r);return l.width>e||l.height>t?" ":i}function Ce(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function Ie(e,t,i){var r=e.levelSelection;if(r)for(var l=0;l<r.length;l++)t.getAttribute("id")===r[l]?t.childElementCount>0&&(t.children[0].setAttribute("class",i),Te(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function Oe(e,t){var i=e.legendId;if(i)for(var r=0;r<i.length;r++)for(var l=0;l<t.childElementCount;l++)if(t.childNodes[l].id===i[r]){var o=t.childNodes[l];o.setAttribute("fill",e.selectionSettings.fill),o.setAttribute("stroke",e.selectionSettings.border.color),o.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),o.setAttribute("opacity",e.selectionSettings.opacity)}}function Le(e,i,r){for(var l,o={},n=0;n<e.length;n++)l=(0,t.isNullOrUndefined)(e[n].childNodes[0])?e[n]:e[n].childNodes[0],o=r.layout.renderItems[parseFloat(l.id.split("_Item_Index_")[1])].options,Te(l,o),e[n].classList.remove(i),n-=1}function Te(e,i){e.setAttribute("opacity",i.opacity),(0,t.isNullOrUndefined)(i.fill)||e.setAttribute("fill",i.fill),e.setAttribute("stroke",i.border.color),e.setAttribute("stroke-width",i.border.width)}function Ne(e,i,r){if((0,t.isNullOrUndefined)(e))return null;for(var l=0,o=Object.keys(i);l<o.length;l++){var n=o[l];e=e.split("${"+n+"}").join(De(i[n],r).toString())}return e}function De(e,t){return(t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)||""}var Ee=function(e,t,i){this.r=e,this.g=t,this.b=i};function Me(e){return"#"+Pe(e.r)+Pe(e.g)+Pe(e.b)}function Pe(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function _e(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new Ee(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Ee(255,255,255)}function Be(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 Me(new Ee(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function Re(e,t,r,l,o){var n=new i.SvgRenderer(""),a=ze(e,r,t,o,l);return n["draw"+a.functionName](a.renderOption)}function ze(e,i,r,l,o){var n,a="Path",s=i.width,h=i.height,d=e.x,p=e.y,g=e.x+-s/2,c=e.y+-h/2;switch(r){case"Circle":case"Bubble":a="Ellipse",(0,t.merge)(l,{rx:s/2,ry:h/2,cx:d,cy:p});break;case"VerticalLine":n="M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),(0,t.merge)(l,{d:n});break;case"Diamond":n="M "+g+" "+p+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+p+" L "+d+" "+(p+h/2)+" L "+g+" "+p+" z",(0,t.merge)(l,{d:n});break;case"Rectangle":n="M "+g+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+g+" "+(p+h/2)+" L "+g+" "+(p+-h/2)+" z",(0,t.merge)(l,{d:n});break;case"Triangle":n="M "+g+" "+(p+h/2)+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+g+" "+(p+h/2)+" z",(0,t.merge)(l,{d:n});break;case"InvertedTriangle":n="M "+(d+s/2)+" "+(p-h/2)+" L "+d+" "+(p+h/2)+" L "+(d-s/2)+" "+(p-h/2)+" L "+(d+s/2)+" "+(p-h/2)+" z",(0,t.merge)(l,{d:n});break;case"Pentagon":for(var u=void 0,m=void 0,f=0;f<=5;f++)u=s/2*Math.cos(Math.PI/180*(72*f)),m=s/2*Math.sin(Math.PI/180*(72*f)),n=0===f?"M "+(d+u)+" "+(p+m)+" ":n.concat("L "+(d+u)+" "+(p+m)+" ");n=n.concat("Z"),(0,t.merge)(l,{d:n});break;case"Star":n="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",(0,t.merge)(l,{d:n});break;case"Cross":n="M "+g+" "+p+" L "+(d+s/2)+" "+p+" M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),(0,t.merge)(l,{d:n});break;case"Image":a="Image",(0,t.merge)(l,{href:o,height:h,width:s,x:g,y:c})}return{renderOption:l,functionName:a}}function Ue(e,t){for(var i=!1,r=0;r<e.length;r++)if(t.levelOrderName===e[r].levelOrderName){i=!0;break}return i}var ke=function(e,t,i,r,l){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=r,this.sendData=l};function Ae(e){if(e.length>0)for(var t=0;t<e.length;t++){var i=e[t];We(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function He(e){if(e.length>0)for(var t=0;t<e.length;t++){var i=e[t];We(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth);for(var r=i.ShapeCollection.Elements.length,l=0;l<r;l++)We(i.ShapeCollection.Elements[l],i.shapeOldFill,i.shapeOldOpacity,i.shapeOldBorderColor,i.shapeOldBorderWidth)}}function We(e,t,i,r,l){e.setAttribute("fill",t),e.setAttribute("opacity",i),e.setAttribute("stroke",r),e.setAttribute("stroke-width",l)}function je(e,t,i){Ae(e),Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function Ge(e,t,i){for(var r,l=0;l<e;l++)for(var o=i.treeMapLegendModule.legendCollections[l].legendData.length,n=0;n<o;n++)if(i.treeMapLegendModule.legendCollections[l].legendData[n].levelOrderName===t.levelOrderName){r=l;break}return r}function Ve(e,t,i,r,l,o,n){e.push({legendEle:r,oldFill:n[t].legendFill,oldOpacity:n[t].opacity,oldBorderColor:n[t].borderColor,oldBorderWidth:n[t].borderWidth,shapeElement:l,shapeOldFill:o[i].options.fill,shapeOldOpacity:o[i].options.opacity,shapeOldBorderColor:o[i].options.border.color,shapeOldBorderWidth:o[i].options.border.width})}function qe(e,i,r,l){(0,t.createElement)("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:r}}).dispatchEvent(new MouseEvent(l?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function Xe(e){var i=document.getElementById(e);return i?(0,t.remove)(i):null}var Je,Ye=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=(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)||(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupName)||!((0,t.isNullOrUndefined)(this.treemap.drilledItems)?(0,t.isNullOrUndefined)(this.treemap.drilledItems):0===this.treemap.drilledItems.length)?this.treemap.treemapLevelData.levelsData[0]:this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0],[])[0],i=(0,t.extend)({},this.treemap.areaRect,i,!1),(0,t.isNullOrUndefined)(this.treemap.treeMapLegendModule)||(0,t.isNullOrUndefined)(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(i=this.treemap.totalRect),(0,t.isNullOrUndefined)(this.treemap.currentLevel)||((0,t.isNullOrUndefined)(this.treemap.drilledItems)?(0,t.isNullOrUndefined)(this.treemap.drilledItems):0===this.treemap.drilledItems.length))!(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)&&((0,t.isNullOrUndefined)(this.treemap.drilledItems)?(0,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 r=this.treemap.drilledItems.length-1,l=this.treemap.drilledItems[r].data,o={};o[this.treemap.drilledItems[r].data.groupName]=[l],(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[r].data.groupIndex),this.calculateLayoutItems(o||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems()}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,r={},l=ie(e).values;if(l&&l.length>0&&0===t.length){for(var o=0;o<l.length;o++)l[o].groupIndex===i.initialDrillDown.groupIndex&&l[o].name===i.initialDrillDown.groupName&&(l[o].isDrilled=!0,r[l[o].groupName]=[l[o]],t.push(r));for(var n=0;n<l.length;n++)this.getDrilldownData(l[n],t)}return t},e.prototype.calculateLayoutItems=function(e,i){this.renderItems=[],this.parentData=[],(0,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,r,l,o,n=this.treemap.leafItemSettings,a=this.treemap.levels,s=ie(e).values;if(s&&s.length>0&&(this.sliceAndDiceProcess(s,t),this.treemap.levels.length>0))for(var h=0;h<s.length;h++)r=s[h].groupIndex,l=0===a.length||r===a.length?n.gap:a[r].groupGap,o=0===a.length?0:a[r]?a[r].showHeader?a[r].headerHeight:0:a[r-1].showHeader?a[r-1].headerHeight:0,i=s[h].rect,i=new W(i.x+l/2,i.y+(o+l/2),i.width-l,Math.abs(i.height-(l+o))),this.computeSliceAndDiceDimensional(s[h],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var r,l=i.height*i.width,o=this.treemap.levels,n=0,a=0;e.forEach((function(e){a+=e.weight})),e.forEach((function(e){e.weightArea=l*e.weight/a}));var s="SliceAndDiceAuto"===this.treemap.layoutType?i.width>i.height:"SliceAndDiceHorizontal"===this.treemap.layoutType;e.sort(ee);for(var h=0;h<e.length;h++){var d=e[h];d.isLeafItem=0===o.length||(this.treemap.isHierarchicalData||(0,t.isNullOrUndefined)(this.treemap.leafItemSettings.labelPath)?d.groupIndex===o.length-1:d.groupIndex===this.treemap.levels.length),s?(r=l/a*e[h].weight/i.height,n<=i.width&&(e[h].rect=new W(n+i.x,i.y,r,i.height))):(r=l/a*e[h].weight/i.width,n<=i.height&&(e[h].rect=new W(i.x,n+i.y,i.width,r))),n+=r,this.renderItems.push(e[h])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,r,l,o,n,a=this.treemap.leafItemSettings,s=this.treemap.levels,h=ie(e).values;if(h&&h.length>0&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(h)),this.calculateChildrenLayout(e,h,t),this.treemap.levels.length>0))for(var d=0;d<h.length;d++)l=(r=h[d]).groupIndex,i=r.rect,o=(r.isLeafItem?a.padding:s[l].groupPadding)/2,n=this.treemap.isHierarchicalData?0===l&&r.isLeafItem?0:s[l]&&s[l].showHeader?s[l].headerHeight:0:0===s.length?0:s[l]&&s[l].showHeader?s[l].headerHeight:0,i=new W(i.x+o,i.y+(n+o),i.width-o,i.height-o),!r.isLeafItem&&r.weight>0&&this.computeSquarifyDimensional(h[d],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,se(i)),t.sort(Ce),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,r){var l=e.length;if(0===l){var o=this.getCoordinates(t,i);return u=r.concat(o)}var n=he(i),a=e[0],s=e.slice(1,l);if(this.aspectRatio(t,a,n)){var h=t.concat(a);return this.performRowsLayout(s,h,i,r)}for(var d=t.length,p=0,g=0;g<d;g+=1)p+=t[g].itemArea;var c=this.cutArea(i,p),u=(o=this.getCoordinates(t,i),r.concat(o));return this.performRowsLayout(e,[],c,u)},e.prototype.aspectRatio=function(e,t,i){if(0===e.length)return!0;var r=e.concat(t);return this.findMaxAspectRatio(e,i)>=this.findMaxAspectRatio(r,i)},e.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,r=1/0,l=-1/0,o=0,n=0;n<i;n+=1){var a=e[n].itemArea;a<r&&(r=a),a>l&&(l=a),o+=a}return Math.max(Math.pow(t,2)*l/Math.pow(o,2),Math.pow(o,2)/(Math.pow(t,2)*r))},e.prototype.cutArea=function(e,t){var i=de(e),r=i.width,l=i.height,o=i.x,n=i.y;if(r>=l){var a=t/l;return pe({x:o+a,y:n,width:r-a,height:l})}var s=t/r;return pe({x:o,y:n+s,width:r,height:l-s})},e.prototype.getCoordinates=function(e,i){for(var r,l=de(i),o=l.width,n=l.height,a=l.x,s=l.y,h=e.length,d=this.treemap.levels,p=this.treemap.leafItemSettings,g=0,c=0;c<h;c+=1)g+=e[c].itemArea;var u,m,f,y=g/n,v=g/o,b=a,S=s,x=[];for(c=0;c<h;c+=1){var w=e[c];if(r=w.groupIndex,w.isLeafItem=0===d.length||(this.treemap.isHierarchicalData||!(0,t.isNullOrUndefined)(p.labelPath))&&r===d.length,f=(m=Ue(this.parentData[0],w))?this.treemap.areaRect:w.parent.rect,u=w.isLeafItem?p.padding:d[r].groupPadding,o>=n){var F=S+w.itemArea/y;w.rect={x:b,y:S,width:b+y,height:F},S=F}else{var C=b+w.itemArea/v;w.rect={x:b,y:S,width:C,height:S+v},b=C}w.weight>0&&(m||Math.round(i.y+u/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+u/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(w),x.push(w))}return x},e.prototype.computeTotalArea=function(e,t){for(var i=e.length,r=[],l=0;l<i;l+=1){for(var o=e.length,n=0,a=0;a<o;a+=1)n+=e[a].weight;for(var s=t/n,h=void 0,d=0;d<o;d++)(h=e[d]).itemArea=h.weight*s,r.push(h)}return r},e.prototype.onDemandProcess=function(e){var i,r;i=e[0].parent,this.treemap.currentLevel=i.isDrilled?i.groupIndex:null;var l={};(0,t.isNullOrUndefined)(i.groupName)?l=i:l[i.groupName]=[i],r=(0,t.extend)({},this.treemap.areaRect,r,!1),(0,t.isNullOrUndefined)(this.treemap.treeMapLegendModule)||(0,t.isNullOrUndefined)(this.treemap.totalRect)||(r=this.treemap.totalRect);for(var o=this.treemap.levels.length,n=0;n<o;n++){o===e[0].groupIndex?this.treemap.levels[o]=this.treemap.levels[n]:this.treemap.levels.splice(o-1,1)}this.calculateLayoutItems(l,r),this.renderLayoutItems()},e.prototype.renderLayoutItems=function(){var e,i,r,l,o,n=this,a=this.treemap;this.renderer=a.renderer;var h,d,p,g,c,u,m,f,y,v,b,S,x,w,F,C=a.element.id,I=a.layoutType,O=this.treemap.leafItemSettings.interSectAction,L="",T=document.getElementById(a.element.id+"_Secondary_Element"),N=a.levels;this.layoutGroup=this.renderer.createGroup({id:C+"_TreeMap_"+I+"_Layout"});var D=(0,t.createElement)("div",{id:a.element.id+"_Label_Template_Group",className:"template"});D.style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+a.areaRect.y+"px;left:"+a.areaRect.x+"px;height:"+a.areaRect.height+"px;width:"+a.areaRect.width+"px;";for(var E,M,P=!1,_=a.leafItemSettings,B=function(I){if(u=R.renderItems[I],h=u.groupIndex,R.treemap.drillDownView&&(0,t.isNullOrUndefined)(R.treemap.currentLevel)&&h>0||R.treemap.drillDownView&&h>R.treemap.currentLevel+1)return"continue";p=u.rect,P=u.isLeafItem,y=C+"_Level_Index_"+h+"_Item_Index_"+I,x=R.renderer.createGroup({id:y+"_Group"}),b=(P?_.gap:N[h].groupGap)/2;var B,z=R.treemap.totalRect?de(R.treemap.totalRect):R.treemap.areaRect;if("Squarified"===a.layoutType&&(p.width=Math.abs(p.x-p.width)-b,p.height=Math.abs(p.y-p.height)-b),"TopRightBottomLeft"===a.renderDirection?p.x=z.x+z.width-p.width-Math.abs(z.x-p.x):"BottomLeftTopRight"===a.renderDirection?p.y=z.y+z.height-p.height-Math.abs(z.y-p.y):"BottomRightTopLeft"===a.renderDirection&&(p.x=z.x+z.width-p.width-Math.abs(z.x-p.x),p.y=z.y+z.height-p.height-Math.abs(z.y-p.y)),r=R.getItemColor(P,u),c=r.fill,f=r.opacity,g=P?_.labelFormat:N[h].headerFormat,i=P?_.showLabels:N[h].showHeader,h===R.treemap.currentLevel)if(R.treemap.enableBreadcrumb){M="#"+R.treemap.breadcrumbConnector+"#",B=u.levelOrderName.replace(/#/gi,M),B=0!==h?"#"+B:B}else B=u.name;else R.treemap.enableBreadcrumb&&(u.isDrilled=!1),B=u.name;m=Ne(g,u.data,R.treemap)||B||"undefined",E=ie(u).values,m=!P&&E&&E.length>0&&R.treemap.enableDrillDown?u.isDrilled?a.enableRtl?m+" [-]":"[-] "+m:a.enableRtl?m+" [+]":"[+] "+m:m;var U=P?_.labelStyle.fontFamily:N[h].headerStyle.fontFamily;U=U||R.treemap.themeStyle.labelFontFamily;var k=P?_.labelStyle.size:N[h].headerStyle.size;k=k||R.treemap.themeStyle.labelFontSize;var A=P?_.labelStyle.fontWeight:N[h].headerStyle.fontWeight;A=A||R.treemap.themeStyle.fontWeight;var H=P?_.labelStyle.color:N[h].headerStyle.color,W=P?_.labelStyle.fontStyle:N[h].headerStyle.fontStyle,j=P?_.labelStyle.opacity:N[h].headerStyle.opacity;S={fontFamily:U,size:k,fontWeight:A,color:H,fontStyle:W,opacity:j},F=P?_.border:N[h].border,e=P?_.labelPosition:"Near"===N[h].headerAlignment?"TopLeft":"Center"===N[h].headerAlignment?"TopCenter":"TopRight",d=P?_.templatePosition:N[h].templatePosition,w=P?_.labelTemplate:N[h].headerTemplate,u.options={border:F,opacity:f,fill:c},l={cancel:!1,name:s,treemap:R.treemap,text:m,currentItem:u,RenderItems:R.renderItems,options:u.options,textColor:S.color},R.treemap.trigger(s,l,(function(r){if(!r.cancel){L=" M "+p.x+" "+p.y+" L "+(p.x+p.width)+" "+p.y+" L "+(p.x+p.width)+" "+(p.y+p.height)+" L "+p.x+" "+(p.y+p.height)+"z",o=new G(y+"_RectPath",c,F.width,F.color,f,null,L);var a=n.renderer.drawPath(o);x.appendChild(a),i&&(l.text!==m&&(l.text=Ne(l.text,u.data,n.treemap)||B),S.color=l.textColor?l.textColor:S.color,n.renderItemText(l.text.toString(),x,S,p,O,y,c,e,M)),w&&(v=n.renderTemplate(T,y,p,d,w,u,P),(0,t.isNullOrUndefined)(v)||(D.appendChild(v),n.treemap.renderReactTemplates())),x.setAttribute("aria-label",u.name),n.treemap.enableDrillDown&&P||n.treemap.selectionSettings.enable||n.treemap.highlightSettings.enable?(x.setAttribute("role","button"),x.setAttribute("tabindex",n.treemap.tabIndex.toString()),x.style.cursor=n.treemap.highlightSettings.enable&&!n.treemap.selectionSettings.enable&&n.treemap.enableDrillDown&&u.groupIndex===n.treemap.levels.length-1?"default":!n.treemap.highlightSettings.enable||n.treemap.selectionSettings.enable||n.treemap.enableDrillDown?"pointer":"default"):x.setAttribute("role","region"),Ie(n.treemap,x,"treeMapSelection"),n.layoutGroup.appendChild(x)}}))},R=this,z=0;z<this.renderItems.length;z++)B(z);D.childNodes.length>0&&T.appendChild(D),this.treemap.svgObject.appendChild(this.layoutGroup)},e.prototype.renderItemText=function(e,i,r,l,o,n,a,s,h){var d,p,g,c,u=[],m=0;if(p=-1!==e.indexOf("<br>")?e.split("<br>"):null,g=this.labelInterSectAction(l,e,r,o),d=V(p&&p[0]||g[0],r),this.treemap.enableRtl){var f=V(e,r),y=e.search("[+]")||e.search("[-]");if(l.width<f.width&&y>0){var v=e.substring(y-1,e.length),b=V("[+]",r);g[0]=X(l.width-b.width-5,g[0],r)+v}}var S=ne(l,s,d,"Text",this.treemap);if(!(0,t.isNullOrUndefined)(p)){for(var x=[],w=null,F=[],C=0;C<p.length;C++)m+=(d=V(w=X(l.width-5,p[C],r),r)).height,F.push(d.width),x.push(w);g=x,d.width=Math.max.apply(null,F),d.height=m}if("WrapByWord"===o||"Wrap"===o||"Trim"===o){for(var I=0;I<g.length;I++)m+=(d=V(g[I],r)).height,l.height-5>m&&u.push(g[I]);if("Wrap"===o&&g.length!==u.length&&u.length){var O=u.length-1,L=u[O];L=L.substring(0,L.length-1)+"...",u.splice(O),"..."!==L&&u.push(L)}}else c=g,u.push(c);Q(new q(n+"_Text",S.x,S.y,"start",u,"","",h),r,r.color||this.getSaturatedColor(a),i)},e.prototype.getItemColor=function(e,i){var r=this.treemap,l=e?r.leafItemSettings.fill:r.levels[i.groupIndex].fill,o=e?r.leafItemSettings.opacity:r.levels[i.groupIndex].opacity;(0,t.isNullOrUndefined)(r.treemapLevelData.defaultLevelsData)||r.treemapLevelData.defaultLevelsData.length>0&&(r.treemapLevelData.levelsData=r.treemapLevelData.defaultLevelsData);var n=ie(r.treemapLevelData.levelsData[0]).values,a=e?r.leafItemSettings.colorMapping:r.levels[i.groupIndex].colorMapping;if(a.length>0){var s=ce(a,i.data[r.equalColorValuePath],i.data[r.rangeColorValuePath]);(0,t.isNullOrUndefined)(s)||(l=(0,t.isNullOrUndefined)(s.fill)?r.leafItemSettings.fill:s.fill,o=s.opacity)}else for(var h=0;h<n.length;h++)n[h].levelOrderName===i.levelOrderName.split("#")[0]&&(l=(0,t.isNullOrUndefined)(l)?(0,t.isNullOrUndefined)(r.colorValuePath)?!(0,t.isNullOrUndefined)(r.palette)&&r.palette.length>0?r.palette[h%r.palette.length]:"#808080":n[h].data[r.colorValuePath]:l);return{fill:l,opacity:o}},e.prototype.getSaturatedColor=function(e){var t=e,i=_e(Be(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,r,l,o,n,a){var s,h=a?i+"_LabelTemplate":i+"_HeaderTemplate",d=a?"_LabelTemplate":"_HeaderTemplate";if((0,t.isNullOrUndefined)(o.prototype)&&"string"==typeof o)for(var p=Object.keys(n.data),g=0;g<p.length;g++){var c=RegExp;o=o.replace(new c("{{:"+p[g]+"}}","g"),n.data[p[g].toString()])}if(!(0,t.isNullOrUndefined)(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var u=ne(r,l,ae(s=oe(le(o)(n.data,this.treemap,o,this.treemap.element.id+d,!1),h,n.data),e),"Template",this.treemap);s.style.left=u.x+"px",s.style.top=u.y+"px"}return s},e.prototype.labelInterSectAction=function(e,t,i,r){var l,o=e.width-10;switch(r){case"Hide":l=[Fe(o,e.height,t,i)];break;case"Trim":l=[X(o+3,t,i)];break;case"WrapByWord":l=xe(o,t,i);break;case"Wrap":l=we(o,t,i)}return l},e.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]},e}(),Ze=n(74);function Qe(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:F,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",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:F,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"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",labelFontFamily:F,fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0}}return t}!function(e){e.mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"}}(Je||(Je={}));var $e=function(){function e(e){}return e.prototype.print=function(e,i){var r=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no");r.moveTo(0,0),r.resizeTo(screen.availWidth,screen.availHeight);var l={cancel:!1,htmlContent:this.getHTMLContent(e,i),name:o};e.trigger(o,l,(function(){l.cancel||(0,t.print)(l.htmlContent,r)}))},e.prototype.getHTMLContent=function(e,i){var r=(0,t.createElement)("div");if(i)i instanceof Array?i.forEach((function(e){r.appendChild(K(e).cloneNode(!0))})):i instanceof Element?r.appendChild(i.cloneNode(!0)):r.appendChild(K(i).cloneNode(!0));else{var l=e.element.cloneNode(!0),o=l.getElementsByTagName("svg")[0];if(!(0,t.isNullOrUndefined)(o)&&(o=o.childNodes[0],!(0,t.isNullOrUndefined)(o))){var n=o.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n||o.setAttribute("fill","rgba(0, 0, 0, 1)"):o.setAttribute("fill","rgba(255,255,255, 1)")}r.appendChild(l)}return r},e.prototype.getModuleName=function(){return"Print"},e.prototype.destroy=function(){},e}(),Ke=function(){function e(e){}return e.prototype.export=function(e,i,r,l){return new Promise((function(o,n){var a=(0,t.createElement)("canvas",{id:"ej2-canvas",attrs:{height:e.availableSize.height.toString(),width:e.availableSize.width.toString()}}),s=e.svgObject.cloneNode(!0),h=s.childNodes[0];if(!(0,t.isNullOrUndefined)(h)){var d=h.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d||s.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):s.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var p=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1),g='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+s.outerHTML+"</svg>",c=window.URL.createObjectURL(new Blob("SVG"===i?[g]:[(new XMLSerializer).serializeToString(s)],{type:"image/svg+xml"}));if("SVG"===i)l?qe(r,i,c,p):o(null);else{var u=new Image,m=a.getContext("2d");u.onload=function(){m.drawImage(u,0,0),window.URL.revokeObjectURL(c),l?qe(r,i,a.toDataURL("image/png").replace("image/png","image/octet-stream"),p):"JPEG"===i?o(a.toDataURL("image/jpeg")):"PNG"===i&&o(a.toDataURL("image/png"))},u.src=c}}))},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(){},e}(),et=n(461),tt=function(){function e(e){}return e.prototype.export=function(e,i,r,l,o){return new Promise((function(i,n){var a=(0,t.createElement)("canvas",{id:"ej2-canvas",attrs:{width:e.availableSize.width.toString(),height:e.availableSize.height.toString()}});l=(0,t.isNullOrUndefined)(l)?et.PdfPageOrientation.Landscape:l;var s=e.svgObject.cloneNode(!0),h=s.childNodes[0];if(!(0,t.isNullOrUndefined)(h)){var d=h.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d||s.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):s.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var p=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(s)],{type:"image/svg+xml"})),g=new Image,c=a.getContext("2d");g.onload=function(){c.drawImage(g,0,0),window.URL.revokeObjectURL(p);var t=new et.PdfDocument,n=a.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=l,n=n.slice(n.indexOf(",")+1),t.pages.add().graphics.drawImage(new et.PdfBitmap(n),0,0,e.availableSize.width-60,e.availableSize.height),o?(t.save(r+".pdf"),t.destroy()):i(null)},g.src=p}))},e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.destroy=function(){},e}(),it=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])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rt=function(e,t,i,r){var l,o=arguments.length,n=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(l=e[a])&&(n=(o<3?l(n):o>3?l(t,i,n):l(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},lt=function(e){function o(t,i){var r=e.call(this,t,i)||this;return r.isResize=!1,r.orientation="Horizontal",r.drilledItems=[],r.isHierarchicalData=!1,r.levelSelection=[],r.legendId=[],r}return it(o,e),o.prototype.preRender=function(){var e=this;this.trigger(r,{treemap:this},(function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()}))},o.prototype.render=function(){this.renderElements()},o.prototype.renderElements=function(){this.treemapLevelData=new ot,this.treemapLevelData.levelsData=null,this.treemapLevelData.defaultLevelsData=null,this.treemapLevelData.hierarchyData=null,this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=Qe(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),(0,t.isNullOrUndefined)(this.treemapLevelData.levelsData)||(this.treemapLevelData.defaultLevelsData=this.treemapLevelData.levelsData),this.processDataManager()},o.prototype.processDataManager=function(){var e,i,r,l,o=this;this.dataSource instanceof Ze.DataManager?(e=this.dataSource,i=this.query instanceof Ze.Query?this.query:new Ze.Query,e.executeQuery(i).then((function(e){o.dataSource=e.result,o.renderTreeMapElements()}))):this.dataSource instanceof ke?(l=this.dataSource,(r=new t.Fetch(l.dataOptions,l.type,l.contentType)).onSuccess=function(e){if((0,t.isNullOrUndefined)(e.type)||"application/octet-stream"!==e.type)o.dataSource=e,o.renderTreeMapElements();else{var i=new FileReader,r=o;i.onload=function(){e=JSON.parse(i.result.toString()),r.dataSource=e,r.renderTreeMapElements()},i.readAsText(e)}},r.send(l.sendData)):this.renderTreeMapElements()},o.prototype.renderTreeMapElements=function(){this.processingData(),this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.renderLegend(),this.layout.processLayoutPanel(),this.element.appendChild(this.svgObject),this.elementChange(),this.trigger(l,{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},o.prototype.createSvg=function(){if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&(0,t.remove)(this.svgObject)}(0,t.isNullOrUndefined)(this.renderer)&&(this.renderer=new i.SvgRenderer(this.element.id)),(0,t.isNullOrUndefined)(this.layout)&&(this.layout=new Ye(this)),this.clearTemplate();var e=this.element.clientWidth,r=this.element.clientHeight;this.availableSize=new A(H(this.width,e)||e||600,H(this.height,r)||r||450),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},o.prototype.initPrivateVariable=function(){if(""===this.element.id){var e=document.getElementsByClassName("e-treemap").length;this.element.id="treemap_control_"+e}this.renderer=new i.SvgRenderer(this.element.id),this.layout=new Ye(this)},o.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"_Secondary_Element");if(e&&e.childElementCount>0&&e.parentNode.removeChild(e),(0,t.isNullOrUndefined)(document.getElementById(this.element.id+"_Secondary_Element"))){var i=(0,t.createElement)("div",{id:this.element.id+"_Secondary_Element"});i.style.cssText="position: absolute;z-index:1;",this.element.appendChild(i)}},o.prototype.elementChange=function(){this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.legendGroup&&this.layout.layoutGroup&&!(0,t.isNullOrUndefined)(this.svgObject)&&!(0,t.isNullOrUndefined)(document.getElementById(this.layout.layoutGroup.id))&&!(0,t.isNullOrUndefined)(document.getElementById(this.treeMapLegendModule.legendGroup.id))&&this.svgObject.insertBefore(this.layout.layoutGroup,this.treeMapLegendModule.legendGroup)},o.prototype.renderBorder=function(){var e=this.border.width,i=this.svgObject.querySelector("#"+this.element.id+"_TreeMap_Border");if((this.border.width>0||this.background||this.themeStyle.backgroundColor)&&(0,t.isNullOrUndefined)(i)){var r=new j(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new W(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e));this.svgObject.appendChild(this.renderer.drawRectangle(r))}else i&&i.setAttribute("fill",this.background||this.themeStyle.backgroundColor)},o.prototype.renderTitle=function(e,i,r,l){var o,n={color:e.textStyle.color,size:e.textStyle.size,fontFamily:e.textStyle.fontFamily,fontStyle:e.textStyle.fontStyle,fontWeight:e.textStyle.fontWeight,opacity:e.textStyle.opacity},a=this.availableSize.width-this.margin.right-this.margin.left;if(n.fontFamily=n.fontFamily||this.themeStyle.fontFamily,n.fontWeight=n.fontWeight||this.themeStyle.titleFontWeight,n.size=n.size||("title"===i?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text){(0,t.isNullOrUndefined)(l)&&(l=this.renderer.createGroup({id:this.element.id+"_Title_Group"}));var s=X(a,e.text,n),h=V(s,n),d=Y((0,t.isNullOrUndefined)(r)?new W(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):r,e.alignment,h,i),p=new q(this.element.id+"_TreeMap_"+i,d.x,d.y,"start",s),g=new W(d.x,d.y,h.width,h.height),c=Q(p,n,n.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),l);c.setAttribute("aria-label",e.description||e.text),c.setAttribute("role","region"),c.setAttribute("tabindex",this.tabIndex.toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(o=this.availableSize.height-g.y-10-this.margin.bottom,this.areaRect=new W(this.margin.left,g.y+10,a,o)),"subtitle"!==i&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",g,l):this.svgObject.appendChild(l)}else o=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new W(this.margin.left,this.margin.top,a,o)},o.prototype.processingData=function(){var e,i=this;if(this.dataSource=this.dataSource,!(0,t.isNullOrUndefined)(this.dataSource)&&this.dataSource.length>0&&this.weightValuePath){if(this.treemapLevelData.levelsData=[],this.dataSource.map((function(e){e[i.weightValuePath]=e[i.weightValuePath]?e[i.weightValuePath].toString():e[i.weightValuePath]})),this.leafItemSettings.labelPath=this.leafItemSettings.labelPath||this.weightValuePath,this.checkIsHierarchicalData(),0===this.levels.length){var r={level:0};e=this.leafItemSettings.labelPath,r[e]=[];for(var l=0;l<this.dataSource.length;l++){var o=ie(this.dataSource[l]).values;this.isHierarchicalData&&o&&o.length>0?o.forEach((function(t){t[e]&&r[e].push({groupIndex:0,name:t[e],levelOrderName:t[e].toString(),data:t,weight:t[i.weightValuePath]})})):this.dataSource[l][e]&&r[e].push({groupIndex:0,name:this.dataSource[l][e],levelOrderName:this.dataSource[l][e].toString(),data:this.dataSource[l],weight:this.dataSource[l][this.weightValuePath]})}this.treemapLevelData.levelsData.push(r)}else{if(this.isHierarchicalData){this.treemapLevelData.hierarchyData=[],this.treemapLevelData.hierarchyData=(0,t.extend)([],this.dataSource,this.treemapLevelData.hierarchyData,!0);for(l=0;l<this.treemapLevelData.hierarchyData.length;l++)this.processHierarchicalData(this.treemapLevelData.hierarchyData[l],l);this.treemapLevelData.levelsData=this.treemapLevelData.hierarchyData}else this.processFlatJsonData(),this.treemapLevelData.levelsData.length>1&&this.reOrderLevelData(this.treemapLevelData.levelsData.length-1);e=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(this.treemapLevelData.levelsData[0][e],"Parent")}},o.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=ie(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},o.prototype.processHierarchicalData=function(e,i){var r,l,o,n=this,a={},s=this.leafItemSettings.labelPath?this.leafItemSettings.labelPath:this.weightValuePath;if((r=(a=ie(e))?a.values:null)&&r.length>0){o=a.key;for(var h=0;h<this.levels.length;h++)o===this.levels[h].groupPath&&(l=h);for(var d=0;d<r.length;d++){r[d].name=r[d][s],r[d].levelOrderName=(0===l?r[d].name:e.levelOrderName+"#"+r[d].name)+"";var p=r[d].levelOrderName,g=void 0;p.search("#")>0&&(g=p.split("#").length-1),r[d].groupIndex=(0,t.isNullOrUndefined)(l)?g===this.levels.length?this.levels.length:g:l,0!==l&&(r[d].parent=e),r[d].groupName=o,r[d].data=r[d],r[d].isDrilled=!1,r[d].weight=r[d][this.weightValuePath]}r.forEach((function(e){n.processHierarchicalData(e,i)}))}if(i===this.treemapLevelData.hierarchyData.length-1){var c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];if(!(0,t.isNullOrUndefined)(c)){for(var u=0;u<this.treemapLevelData.hierarchyData.length;u++)r=ie(this.treemapLevelData.hierarchyData[u]).values,0!==u&&r&&(r.forEach((function(e){c.push(e)})),this.treemapLevelData.hierarchyData.splice(u,1),u-=1);c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];for(var m=0;m<c.length;m++)a[this.levels[0].groupPath]=c,c[m].parent=a}}},o.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},o.prototype.export=function(e,i,r,l){var o=this;return(0,t.isNullOrUndefined)(l)&&(l=!0),"PDF"===e&&this.allowPdfExport&&this.pdfExportModule?new Promise((function(t,n){t(o.pdfExportModule.export(o,e,i,r,l))})):this.allowImageExport&&"PDF"!==e&&this.imageExportModule?new Promise((function(t,r){t(o.imageExportModule.export(o,e,i,l))})):null},o.prototype.processFlatJsonData=function(){var e;this.dataSource=this.dataSource;for(var i=[],r=0;r<this.levels.length+1;r++){e=this.levels[r]?this.levels[r].groupPath:this.leafItemSettings.labelPath;var l={};l.level=r,l[e]=[],this.treemapLevelData.levelsData.push(l);for(var o=0;o<this.dataSource.length;o++){var n={},a="";if(!(0,t.isNullOrUndefined)(e)){var s=this.dataSource[o][e];if(0!==r)for(var h=0;h<=r;h++){var d=this.levels[h]?this.levels[h].groupPath:e;a+=this.dataSource[o][d]+(h===r?"":"#")}i.length>0&&-1!==i.indexOf(a||s)||(n.name=s,n.levelOrderName=(a||s)+"",n.groupIndex=r,n.isDrilled=!1,n.groupName=e,n.data=this.dataSource[o],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][e].push(n),i.push(a||s))}}}},o.prototype.reOrderLevelData=function(e){for(var i,r=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,l=this.levels[e-1].groupPath,o=this.treemapLevelData.levelsData[e][r],n=this.treemapLevelData.levelsData[e-1][l],a=0;a<o.length;a++){i=o[a].levelOrderName;for(var s=0;s<n.length;s++)if(n[s][r]=(0,t.isNullOrUndefined)(n[s][r])?[]:n[s][r],this.IsChildHierarchy(i.split("#"),n[s].levelOrderName.split("#"))){(0,t.isNullOrUndefined)(o[a].parent)&&(o[a].parent=n[s]),n[s][r].push(o[a]);break}}this.findTotalWeight(this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][r],"Child"),this.treemapLevelData.levelsData.splice(e,1),e-1>0&&this.reOrderLevelData(e-1)},o.prototype.IsChildHierarchy=function(e,t){for(var i=!1,r=0;r<t.length;r++){if(e.length<r||t[r]!==e[r])return!1;i=!0}return i},o.prototype.findTotalWeight=function(e,t){for(var i,r,l,o=this,n={},a=function(a){i=0,l=e[a].groupName,r=e[a].levelOrderName.split("#"),s.dataSource.forEach((function(t){te(r,e[a].levelOrderName,t,o)&&(i+=parseFloat(t[o.weightValuePath]))})),"Parent"===t&&(n[l]=e,e[a].parent=n),e[a].weight=i},s=this,h=0;h<e.length;h++)a(h)},o.prototype.unWireEVents=function(){t.EventHandler.remove(this.element,"click",this.clickOnTreeMap),t.EventHandler.remove(this.element,"dblclick",this.doubleClickOnTreeMap),t.EventHandler.remove(this.element,"contextmenu",this.rightClickOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap),t.EventHandler.remove(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap),window.removeEventListener("resize",this.resizeEvent)},o.prototype.wireEVents=function(){t.EventHandler.add(this.element,"click",this.clickOnTreeMap,this),t.EventHandler.add(this.element,"dblclick",this.doubleClickOnTreeMap,this),t.EventHandler.add(this.element,"contextmenu",this.rightClickOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap,this),t.EventHandler.add(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent)},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},o.prototype.resizeOnTreeMap=function(e){var i=this;if(!this.isDestroyed){this.isResize=!0;var r={name:w,cancel:!1,previousSize:this.availableSize,currentSize:new A(0,0),treemap:this};this.resizeTo&&clearTimeout(this.resizeTo),!(0,t.isNullOrUndefined)(this.element)&&this.element.classList.contains("e-treemap")&&(this.resizeTo=setTimeout((function(){i.unWireEVents(),i.createSvg(),i.refreshing=!0,i.wireEVents(),r.currentSize=i.availableSize,i.trigger(w,r,(function(e){i.render(),i.refreshing=!1}))}),500))}},o.prototype.clickOnTreeMap=function(e){var i,r,l=this,o=e.target,n=o.id,a=o.innerHTML,s={cancel:!1,name:f,treemap:this,mouseEvent:e};this.trigger(f,s),n.indexOf("_Item_Index")>-1&&(e.preventDefault(),r=parseFloat(n.split("_Item_Index_")[1]),i={cancel:!1,name:u,treemap:this,item:this.layout.renderItems[r],mouseEvent:e,groupIndex:this.layout.renderItems[r].groupIndex,groupName:this.layout.renderItems[r].name,text:a,contentItemTemplate:a},this.trigger(u,i,(function(e){e.text===a&&e.contentItemTemplate===a||((0,t.isNullOrUndefined)(l.leafItemSettings.labelTemplate)?(e.text=Ne(e.text,e.item.data,e.treemap),o.textContent=e.text):$(n,o,e.contentItemTemplate))})));var h,d=(new Date).getMilliseconds();(0,t.isNullOrUndefined)(this.doubleClick)||(!(0,t.isNullOrUndefined)(h)&&d-h<500&&this.doubleClickOnTreeMap(e),h=d)},o.prototype.doubleClickOnTreeMap=function(e){var t={cancel:!1,name:y,treemap:this,mouseEvent:e};this.trigger(y,t)},o.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:v,treemap:this,mouseEvent:e};this.trigger(v,t)},o.prototype.mouseDownOnTreeMap=function(e){e.target.id.indexOf("_Item_Index")>-1&&(this.mouseDown=!0),this.notify(t.Browser.touchStartEvent,e)},o.prototype.mouseMoveOnTreeMap=function(e){var i,r,l,o=e.target.id,n={cancel:!1,name:b,treemap:this,mouseEvent:e};this.trigger(b,n),o.indexOf("_Item_Index")>-1?(l=ie(r=this.layout.renderItems[parseFloat(o.split("_Item_Index_")[1])]).values,this.element.style.cursor=!r.isLeafItem&&l&&l.length>0&&this.enableDrillDown?"pointer":"auto",i={cancel:!1,name:m,treemap:this,item:r,mouseEvent:e},this.trigger(m,i)):this.element.style.cursor="default",this.notify(t.Browser.touchMoveEvent,e)},o.prototype.calculateSelectedTextLevels=function(e,t){for(var i,r,l,o=t.levelOrderName.split("#"),n=0,a=Object.keys(o);n<a.length;n++)o[r=a[n]]===e&&(i=parseInt(r,10),l=e);return{drillLevel:i,currentLevelLabel:l,levelText:o}},o.prototype.calculatePreviousLevelChildItems=function(e,i,r){for(var l,o,n,a=0,s=this.layout.renderItems[0].levelOrderName.split("#").length,h=0;h<s;h++)n=0===h?e.levelText[h]:n+"#"+e.levelText[h];a=s>1?s:a;for(var d=0,p=Object.values(this.layout.renderItems);d<p.length;d++){(o=p[d]).levelOrderName.split("#")[0]===e.levelText[0]&&(l=0===a?(0,t.isNullOrUndefined)(n)?n:e.levelText[a]:r?n:n+"#"+e.levelText[a])===o.levelOrderName&&(this.drilledItems.push({name:o.levelOrderName,data:o}),r=!0,++a<=i.groupIndex&&(n=l=l+"#"+e.levelText[a]))}return r},o.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var r,l={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((r=this.drilledItems[i].data.parent).isDrilled=!0,l[r[this.drilledItems[i].data.groupName]]=[r],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(l[t.groupName]=[t]),l},o.prototype.mouseEndOnTreeMap=function(e){var i,r,l,o,n,a,s,p=this,g=e.target,c=g.id,u=!1,m={},f=this.element.id+"_TreeMap_"+this.layoutType+"_Layout",y=this.element.id+"_Label_Template_Group";if(c.indexOf("_Item_Index")>-1&&this.enableDrillDown&&!this.drillMouseMove){e.cancelable&&e.preventDefault(),o=parseFloat(c.split("_Item_Index_")[1]),n=this.layout.renderItems[o];var v=g.textContent;if(this.enableBreadcrumb&&(s=this.calculateSelectedTextLevels(v,n),a=s.drillLevel,this.drillDownView||-1===v.search("[+]")||(u=this.calculatePreviousLevelChildItems(s,n,u))),0!==this.levels.length&&!n.isLeafItem&&ie(n).values&&ie(n).values.length>0){if(this.drilledItems.length>0){n=u?this.drilledItems[this.drilledItems.length-1].data:n;for(var b=0;b<this.drilledItems.length;b++){if(!(0,t.isNullOrUndefined)(a)){var S=this.drilledItems.length;if(m=this.compareSelectedLabelWithDrillDownItems(s,n,b),S!==this.drilledItems.length){b-=1;break}}if(n.levelOrderName===this.drilledItems[b].name&&!u&&(0,t.isNullOrUndefined)(a)){0===n.groupIndex&&n.parent[n.groupName]instanceof Array?(n.isDrilled=!n.isDrilled,n.isDrilled?m[n.groupName]=[n]:m=n.parent):(n.isDrilled=!1,n.parent.isDrilled=!0,n=n.parent,m[n.groupName]=[n]),this.drilledItems.splice(b,1),b-=1;break}b===this.drilledItems.length-1&&(0,t.isNullOrUndefined)(a)&&(n.isDrilled=!0,m[n.groupName]=[n])}}else n.isDrilled=!0,m[n.groupName]=[n];r={cancel:!1,name:h,treemap:this,element:g,groupIndex:this.enableBreadcrumb&&0!==this.drilledItems.length&&!(0,t.isNullOrUndefined)(a)?this.drilledItems[this.drilledItems.length-1].data.groupIndex:n.groupIndex,groupName:this.enableBreadcrumb&&0!==this.drilledItems.length&&!(0,t.isNullOrUndefined)(a)?this.drilledItems[this.drilledItems.length-1].data.name:n.name,rightClick:3===e.which,childItems:null,item:m},this.trigger(h,r,(function(e){if(p.currentLevel=n.isDrilled&&(0,t.isNullOrUndefined)(a)?n.groupIndex:!(0,t.isNullOrUndefined)(a)&&p.enableBreadcrumb&&n.isDrilled?a:null,!e.cancel){if(document.getElementById(f)){var r=document.getElementById(f);r.parentNode.removeChild(r)}if(i=(0,t.extend)({},p.areaRect,i,!0),p.legendSettings.visible&&!(0,t.isNullOrUndefined)(p.treeMapLegendModule)&&((0,t.isNullOrUndefined)(m)||(p.treeMapLegendModule.legendGroup.textContent="",p.treeMapLegendModule.legendGroup=null,p.treeMapLegendModule.widthIncrement=0,p.treeMapLegendModule.heightIncrement=0,p.enableBreadcrumb&&!(0,t.isNullOrUndefined)(a)?p.drilledLegendItems={name:p.drilledItems[p.drilledItems.length-1].data.levelOrderName,data:p.drilledItems[p.drilledItems.length-1].data}:p.drilledLegendItems={name:n.levelOrderName,data:n},p.treeMapLegendModule.renderLegend()),i=(0,t.isNullOrUndefined)(p.totalRect)?i:p.totalRect),document.getElementById(y)){var l=document.getElementById(y);l.parentNode.removeChild(l)}(0,t.isNullOrUndefined)(e.childItems)||e.cancel?(p.layout.calculateLayoutItems(m,i),p.layout.renderLayoutItems()):p.layout.onDemandProcess(e.childItems)}})),l={cancel:!1,name:d,treemap:this,renderItems:this.layout.renderItems},this.trigger(d,l),!u&&(0,t.isNullOrUndefined)(a)&&this.drilledItems.push({name:n.levelOrderName,data:n})}}this.mouseDown=!1,this.notify(t.Browser.touchEndEvent,e)},o.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(Ae(this.treeMapHighlightModule.shapeHighlightCollection),this.treeMapHighlightModule.highLightId="")},o.prototype.selectItem=function(e,i){(0,t.isNullOrUndefined)(i)&&(i=!0);for(var r="",l=0;l<e.length;l++)l!==e.length-1?r+=e[l]+"#":r+=e[l];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(r,i)},o.prototype.requiredModules=function(){var e=[];return this.tooltipSettings.visible&&e.push({member:"treeMapTooltip",args:[this],name:"TreeMapTooltip"}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this],name:"TreeMapHighlight"}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this],name:"TreeMapSelection"}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this],name:"TreeMapLegend"}),this.allowPrint&&e.push({member:"Print",args:[this,$e],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Ke],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,tt],name:"PdfExport"}),e},o.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,r=0,l=Object.keys(e);r<l.length;r++){switch(l[r]){case"background":this.renderBorder();break;case"height":case"width":case"layoutType":case"levels":case"drillDownView":case"renderDirection":case"leafItemSettings":case"legendSettings":case"dataSource":i=!0}}i&&(this.createSvg(),this.renderElements())}},o.prototype.getModuleName=function(){return"treemap"},o.prototype.destroy=function(){this.unWireEVents(),Xe("treeMapMeasureText"),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),e.prototype.destroy.call(this),this.areaRect=null,this.themeStyle=null,this.totalRect=null,this.drilledLegendItems=null,this.doubleTapTimer=null,this.treemapLevelData=null,this.resizeEvent=null,this.availableSize=null,this.intl=null,(0,t.isNullOrUndefined)(this.layout)||this.layout.destroy(),this.layout=null,this.renderer=null},o.prototype.removeSvg=function(){if(Xe(this.element.id+"_Secondary_Element"),this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&(0,t.remove)(this.svgObject)}},o.prototype.getPersistData=function(){return""},rt([(0,t.Property)(!1)],o.prototype,"allowPrint",void 0),rt([(0,t.Property)(!1)],o.prototype,"allowImageExport",void 0),rt([(0,t.Property)(!1)],o.prototype,"allowPdfExport",void 0),rt([(0,t.Property)(null)],o.prototype,"width",void 0),rt([(0,t.Property)(null)],o.prototype,"height",void 0),rt([(0,t.Complex)({},O)],o.prototype,"border",void 0),rt([(0,t.Complex)({},L)],o.prototype,"margin",void 0),rt([(0,t.Property)(null)],o.prototype,"background",void 0),rt([(0,t.Property)("Material")],o.prototype,"theme",void 0),rt([(0,t.Complex)({},E)],o.prototype,"titleSettings",void 0),rt([(0,t.Property)("Squarified")],o.prototype,"layoutType",void 0),rt([(0,t.Property)(null)],o.prototype,"dataSource",void 0),rt([(0,t.Property)(null)],o.prototype,"query",void 0),rt([(0,t.Property)(null)],o.prototype,"weightValuePath",void 0),rt([(0,t.Property)("")],o.prototype,"rangeColorValuePath",void 0),rt([(0,t.Property)("")],o.prototype,"equalColorValuePath",void 0),rt([(0,t.Property)(null)],o.prototype,"colorValuePath",void 0),rt([(0,t.Property)([])],o.prototype,"palette",void 0),rt([(0,t.Property)("TopLeftBottomRight")],o.prototype,"renderDirection",void 0),rt([(0,t.Property)(!1)],o.prototype,"enableDrillDown",void 0),rt([(0,t.Property)(!1)],o.prototype,"enableBreadcrumb",void 0),rt([(0,t.Property)(" - ")],o.prototype,"breadcrumbConnector",void 0),rt([(0,t.Property)(!1)],o.prototype,"drillDownView",void 0),rt([(0,t.Complex)({},_)],o.prototype,"initialDrillDown",void 0),rt([(0,t.Complex)({},B)],o.prototype,"leafItemSettings",void 0),rt([(0,t.Collection)([],k)],o.prototype,"levels",void 0),rt([(0,t.Complex)({},U)],o.prototype,"highlightSettings",void 0),rt([(0,t.Complex)({},z)],o.prototype,"selectionSettings",void 0),rt([(0,t.Complex)({},R)],o.prototype,"tooltipSettings",void 0),rt([(0,t.Complex)({},P)],o.prototype,"legendSettings",void 0),rt([(0,t.Property)(!1)],o.prototype,"useGroupingSeparator",void 0),rt([(0,t.Property)(null)],o.prototype,"description",void 0),rt([(0,t.Property)(0)],o.prototype,"tabIndex",void 0),rt([(0,t.Property)(null)],o.prototype,"format",void 0),rt([(0,t.Event)()],o.prototype,"load",void 0),rt([(0,t.Event)()],o.prototype,"beforePrint",void 0),rt([(0,t.Event)()],o.prototype,"loaded",void 0),rt([(0,t.Event)()],o.prototype,"itemRendering",void 0),rt([(0,t.Event)()],o.prototype,"drillStart",void 0),rt([(0,t.Event)()],o.prototype,"drillEnd",void 0),rt([(0,t.Event)()],o.prototype,"itemSelected",void 0),rt([(0,t.Event)()],o.prototype,"itemHighlight",void 0),rt([(0,t.Event)()],o.prototype,"tooltipRendering",void 0),rt([(0,t.Event)()],o.prototype,"itemClick",void 0),rt([(0,t.Event)()],o.prototype,"itemMove",void 0),rt([(0,t.Event)()],o.prototype,"click",void 0),rt([(0,t.Event)()],o.prototype,"doubleClick",void 0),rt([(0,t.Event)()],o.prototype,"rightClick",void 0),rt([(0,t.Event)()],o.prototype,"mouseMove",void 0),rt([(0,t.Event)()],o.prototype,"resize",void 0),rt([(0,t.Event)()],o.prototype,"legendItemRendering",void 0),rt([(0,t.Event)()],o.prototype,"legendRendering",void 0),o=rt([t.NotifyPropertyChanges],o)}(t.Component),ot=function(){},nt=function(){function e(e){this.page=0,this.legendBorderRect=new W(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new W(0,0,0,0),this.treemap=e,this.addEventListener()}return e.prototype.renderLegend=function(){var e=this;this.page=0,this.legendRenderingCollections=[],this.legendCollections=[],this.legendNames=[],this.totalPages=[],this.gradientCount=1,this.widthIncrement=0,this.heightIncrement=0,this.defsElement=this.treemap.renderer.createDefs(),this.treemap.svgObject.appendChild(this.defsElement);var t={cancel:!1,name:x,treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position};this.treemap.trigger(x,t,(function(t){t.cancel||t._changePosition===e.treemap.legendSettings.position||(e.treemap.legendSettings.position=t._changePosition),e.calculateLegendBounds(),e.legendCollections.length>0&&e.drawLegend()}))},e.prototype.calculateLegendBounds=function(){var e=this,i=this.treemap,r=i.legendSettings;if(this.findColorMappingLegendItems(i.treemapLevelData.levelsData[0]),(!(0,t.isNullOrUndefined)(this.treemap.palette)&&this.treemap.palette.length>0||!(0,t.isNullOrUndefined)(i.colorValuePath))&&0===this.legendCollections.length&&this.findPaletteLegendItems(i.treemapLevelData.levelsData[0]),this.legendCollections.length>0){this.legendCollections.sort((function(e,t){return e.levelIndex>t.levelIndex?1:e.levelIndex<t.levelIndex?-1:0})),this.legendCollections.sort((function(e,t){return e.groupIndex>t.groupIndex?1:e.groupIndex<t.groupIndex?-1:0})),this.legendCollections.sort((function(e,t){return e.leafIndex>t.leafIndex?1:e.leafIndex<t.leafIndex?-1:0}));var l=r.position,o=r.title.text,n=r.titleStyle,a=r.mode,s=0,h=0,d=0,p=0,g=r.shapeHeight,c=r.shapeWidth,u=[],m=[],f="None"===r.orientation?"Top"===l||"Bottom"===l||"Auto"===l&&i.availableSize.width<=i.availableSize.height?"Horizontal":"Vertical":r.orientation,y=r.width.length>1?r.width.indexOf("%")>-1?i.availableSize.width/100*parseFloat(r.width):parseFloat(r.width):null,v=r.height.length>1?r.height.indexOf("%")>-1?i.availableSize.height/100*parseFloat(r.height):parseFloat(r.height):null;n.fontFamily=n.fontFamily||i.themeStyle.fontFamily,n.fontWeight=n.fontWeight||i.themeStyle.titleFontWeight,n.size=n.size||i.themeStyle.subtitleFontSize;var b=V(o,n),S=0,x=0,w=r.shapePadding,F=r.textStyle;if(F.size=F.size||i.themeStyle.legendFontSize,F.fontFamily=F.fontFamily||i.themeStyle.fontFamily,F.fontWeight=F.fontWeight||i.themeStyle.fontWeight,"Default"===a){y=(0,t.isNullOrUndefined)(y)?i.areaRect.width:y,v=(0,t.isNullOrUndefined)(v)?i.areaRect.height:v;for(var C=0,I=0;I<this.legendCollections.length;I++){var O=this.legendCollections[I];(0,t.isNullOrUndefined)(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]});var L=V(O.legendName,F);if(this.textMaxWidth=Math.max(this.textMaxWidth,L.width),0===I)S=s=10+c/2,x=h=10+b.height+(g>L.height?g/2:L.height/4);else{var T=L.height>g?L.height:g;if("Horizontal"===f){var N=m[C-1].x+m[C-1].width+10+c;if(N+w+L.width>y){var D=(m[C-1].y>u[C-1].y+g/2?m[C-1].y:u[C-1].y+g/2)+10;D+T>v?(this.getPageChanged(),C=0,u=[],m=[],s=S,h=x):(s=u[0].x,h=D+T/2)}else s=N-c/2,h=u[C-1].y}else{var E=m[C-1].y>u[C-1].y+g/2?m[C-1].y:u[C-1].y+g/2;if(E+10+T>v){var M=m[C-1].x+this.textMaxWidth+10;M+w+L.width>y?(s=S,h=x,m=[],u=[],this.getPageChanged(),C=0):(s=M+c/2,h=u[0].y)}else s=u[C-1].x,h=E+10+g/2}}d=s+c/2+w,p=h+L.height/4,u.push({x:s,y:h}),m.push({x:d,y:p,width:L.width,height:L.height/2}),this.totalPages[this.page].Collection.push({DisplayText:O.legendName,element:O.gradientElement,Shape:{x:s,y:h},Text:{x:d,y:p},Fill:O.legendFill,Data:O.legendData,Rect:{x:u[C].x-c/2,y:u[C].y-g/2<p-L.height?u[C].y-g/2:p-L.height,width:Math.abs(u[C].x-c/2-(d+L.width)),height:g>L.height?g:L.height}}),C++}var P=this.totalPages[0].Collection;P.forEach((function(t,i){var r=new W(t.Rect.x,t.Rect.y,t.Rect.width,t.Rect.height);0===i&&(S=r.x,x=r.y),e.widthIncrement=Math.max(e.widthIncrement,Math.abs(S-(r.x+r.width))),e.heightIncrement=Math.max(e.heightIncrement,Math.abs(x-(r.y+r.height)))})),y=this.widthIncrement<y?this.widthIncrement:y,v=this.heightIncrement<v?this.heightIncrement:v,this.legendItemRect={x:P[0].Rect.x,y:P[0].Rect.y,width:y,height:v}}else{var _=this.legendCollections.length,B="Horizontal"===f?(0,t.isNullOrUndefined)(y)?i.areaRect.width/_:y/_:(0,t.isNullOrUndefined)(y)?25:y,R="Horizontal"===f?(0,t.isNullOrUndefined)(v)?25:v:(0,t.isNullOrUndefined)(v)?i.areaRect.height/_:v/_;S=0,x=b.height+10;var z=10,U=r.labelPosition,k=0,H=0,j=r.labelDisplayMode,G=0,q=0;for(I=0;I<this.legendCollections.length;I++){S="Horizontal"===f?S+B:S,x="Horizontal"===f?x:x+R;var J=this.legendCollections[I].legendName,Y=new A(0,0);"None"===j?Y=V(J,F):"Trim"===j?Y=V(J=X("Horizontal"===f?B:R,J,F),F):J="",G=Math.max(G,Y.height),q=Math.max(q,Y.width),Y.width>0&&Y.height>0&&("Horizontal"===f?(d=S+B/2,p="After"===U?x+R+Y.height/2+z:x-z):(d="After"===U?S-Y.width/2-z:S+B+Y.width/2+z,p=x+R/2+Y.height/4)),0===I&&(k="Horizontal"===f?S:"After"===U?d-Y.width/2:S,H="Horizontal"===f?"After"===U?x:p-Y.height/2:x),I===_-1&&(y="Horizontal"===f?Math.abs(S+B-k):B+q+z,v="Horizontal"===f?R+G/2+z:Math.abs(x+R-H)),this.legendRenderingCollections.push({fill:this.legendCollections[I].legendFill,x:S,y:x,width:B,height:R,element:this.legendCollections[I].gradientElement,text:J,textX:d,textY:p,textWidth:Y.width,textHeight:Y.height,data:this.legendCollections[I].legendData})}this.legendItemRect={x:k,y:H,width:y,height:v}}}},e.prototype.getPageChanged=function(){this.page++,(0,t.isNullOrUndefined)(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},e.prototype.findColorMappingLegendItems=function(e){var t=ie(e).values;if(t&&t.length>0&&(this.calculateLegendItems(t),this.treemap.levels.length>0))for(var i=0;i<t.length;i++)this.findColorMappingLegendItems(t[i])},e.prototype.findPaletteLegendItems=function(e){var i,r,l;if(!(0,t.isNullOrUndefined)(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupName)&&(0,t.isNullOrUndefined)(this.treemap.drilledLegendItems))for(var o=ie(e).values,n=0;n<o.length;n++)if(o[n].Name===this.treemap.initialDrillDown.groupName){o[n].isDrilled=!o[n].isDrilled,e=o[n],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,r=this.treemap.palette.length>0?this.treemap.palette[n%this.treemap.palette.length]:o[n].data[this.treemap.colorValuePath];break}if(this.treemap.enableDrillDown&&!(0,t.isNullOrUndefined)(this.treemap.drilledLegendItems)){var a=this.treemap.drilledLegendItems;if(r=a.data.options.fill,a.data.isDrilled)i=ie(a.data).values;else i=ie(a.data.parent).values}else i=ie(e).values;if(i&&i.length>0){for(var s=0;s<i.length;s++)((0,t.isNullOrUndefined)(i[s].data[this.treemap.legendSettings.showLegendPath])||i[s].data[this.treemap.legendSettings.showLegendPath])&&(l=i[s].data[this.treemap.legendSettings.valuePath]?i[s].data[this.treemap.legendSettings.valuePath]:i[s].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,l)||this.legendCollections.push({legendName:l,legendFill:this.treemap.palette.length>0?(0,t.isNullOrUndefined)(this.treemap.currentLevel)?this.treemap.palette[s%this.treemap.palette.length]:r:i[s].data[this.treemap.colorValuePath],legendData:[],itemArea:i[s].weight}));if(this.legendCollections.sort(Ce),this.treemap.palette.length>0)for(var h=0;h<this.legendCollections.length;h++)this.legendCollections[h].legendFill=(0,t.isNullOrUndefined)(this.treemap.currentLevel)?this.treemap.palette[h%this.treemap.palette.length]:r}},e.prototype.calculateLegendItems=function(e){var i,r,l,o,n,a,s,h,d,p,g,c,u,m,f,y,v,b,S,x=!1,w=this.treemap.leafItemSettings,F=this.treemap.levels,C=this.treemap.legendSettings.position,I=!1,O=0;this.outOfRangeLegend=null;for(var L=0;L<e.length;L++){r="",f=!1,y=!1,I=!1,o=e[L].data,h=e[L].groupIndex,s=(a=0===this.treemap.levels.length||h===this.treemap.levels.length)?w.colorMapping:F[h].colorMapping;for(var T=0;T<s.length;T++){var N=s[T];if(p=null,l=Number(o[this.treemap.rangeColorValuePath]),d=o[this.treemap.equalColorValuePath],N.value=(0,t.isNullOrUndefined)(N.value)?N.value:N.value.toString(),!(0,t.isNullOrUndefined)(N.from)&&!(0,t.isNullOrUndefined)(N.to)&&l>=N.from&&l<=N.to&&N.showLegend?(x=!0,y=!0,u=N.from+" - "+N.to,n=(0,t.isNullOrUndefined)(N.label)?N.from+" - "+N.to:N.label,r=(0,t.isNullOrUndefined)(N.color)?r:N.color,i=this.isAddNewLegendData(u)):!(0,t.isNullOrUndefined)(N.value)&&d===N.value&&N.showLegend&&(x=!0,f=!0,u=N.value.toString(),n=(0,t.isNullOrUndefined)(N.label)?N.value.toString():N.label,r=(0,t.isNullOrUndefined)(N.color)?r:"[object Array]"===Object.prototype.toString.call(N.color)?N.color[0]:N.color,i=this.isAddNewLegendData(u)),x&&(0,t.isNullOrUndefined)(N.value)&&N.maxOpacity&&N.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var D=[];if(I=!0,"[object Array]"===Object.prototype.toString.call(N.color))for(var E=0;E<N.color.length;E++){var M={colorStop:(E*(100/(N.color.length-1))+"%").toString(),color:N.color[E]};D.push(M)}else{M={colorStop:"0%",color:r};var P={colorStop:"100%",color:r};D.push(M),D.push(P)}g="Top"===C||"Bottom"===C?"100%":"0%",c="Top"===C||"Bottom"===C?"0%":"100%";var _={id:"groupIndex_"+h+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:g,y2:c};p=this.treemap.renderer.drawGradient("linearGradient",_,D).childNodes[0],"[object Array]"!==Object.prototype.toString.call(N.color)&&(p.childNodes[0].setAttribute("stop-opacity",N.minOpacity.toString()),p.childNodes[1].setAttribute("stop-opacity",N.maxOpacity.toString())),this.defsElement.appendChild(p),this.gradientCount++}m=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,n),i&&i.process&&x&&!m?(x=!1,r="[object Array]"===Object.prototype.toString.call(N.color)&&(0,t.isNullOrUndefined)(p)&&(0,t.isNullOrUndefined)(N.value)?this.legendGradientColor(N,O):r,this.legendCollections.push({actualValue:u,levelIndex:a?-1:T,leafIndex:a?T:-1,legendName:n,legendFill:r,legendData:[],groupIndex:a?-1:h,gradientElement:(0,t.isNullOrUndefined)(p)?(0,t.isNullOrUndefined)(N.value)?this.legendLinearGradient:null:p,name:e[L].name,opacity:this.treemap.legendSettings.opacity,borderColor:this.treemap.legendSettings.border.color,borderWidth:this.treemap.legendSettings.border.width}),this.legendCollections[this.legendCollections.length-1].legendData.push(e[L]),O++):x&&!m&&(x=!1,this.legendCollections[i.value].legendData.push(e[L])),y||I||f||(0,t.isNullOrUndefined)(N.from)&&(0,t.isNullOrUndefined)(N.to)&&(0,t.isNullOrUndefined)(N.minOpacity)&&(0,t.isNullOrUndefined)(N.maxOpacity)&&(0,t.isNullOrUndefined)(N.value)&&!(0,t.isNullOrUndefined)(N.color)&&(v="[object Array]"===Object.prototype.toString.call(N.color)?N.color[0]:N.color,b=(0,t.isNullOrUndefined)(N.label)?"Others":N.label,m=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,b),(0,t.isNullOrUndefined)(this.outOfRangeLegend)&&!m&&(this.legendCollections.push({actualValue:b,legendData:[],legendName:b,legendFill:v}),S=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[S-1],O++),this.legendCollections[this.legendCollections.length-1].legendData.push(e[L]))}}},e.prototype.removeDuplicates=function(e,t){for(var i=!1,r=0;r<e.length;r++)if(e[r].legendName===t){i=!0;break}return i},e.prototype.isAddNewLegendData=function(e){var t,i;if(0===this.legendCollections.length)t=!0;else for(var r=0;r<this.legendCollections.length;r++){if(e===this.legendCollections[r].actualValue){t=!1,i=r;break}r===this.legendCollections.length-1&&(t=!0)}return{process:t,value:i}},e.prototype.drawLegend=function(){var e,t,i=this.treemap.legendSettings,r=this.treemap.renderer,l=i.textStyle;if(this.legendGroup=r.createGroup({id:this.treemap.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===i.mode)this.drawLegendItem(this.currentPage);else for(var o=0;o<this.legendRenderingCollections.length;o++){var n=this.treemap.element.id+"_Legend_Index_"+o,a=this.treemap.element.id+"_Legend_Index_"+o+"_Text",s=this.legendRenderingCollections[o];e=(t=s.element)?"url(#"+t.id+")":s.fill;var h=new W(s.x,s.y,s.width,s.height),d=new J(s.textX,s.textY),p=new j(n,e,i.shapeBorder,i.opacity,h);this.treemap.enableRtl&&("Left"===this.treemap.legendSettings.position||"Right"===this.treemap.legendSettings.position||"Auto"===this.treemap.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height?(p.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-(this.translate.y+p.height)-Math.abs(this.legendBorderRect.y-p.y),d.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+s.textHeight/2-Math.abs(this.legendBorderRect.y-d.y)):(p.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+p.width)-Math.abs(this.legendBorderRect.x-p.x),d.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-d.x))),Q(new q(a,d.x,d.y,"middle",s.text,"",""),l,l.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),this.legendGroup.appendChild(r.drawRectangle(p))}Oe(this.treemap,this.legendGroup)},e.prototype.defaultLegendRtlLocation=function(e,t,i,r){var l=e.Shape,o=e.Text,n=V(e.DisplayText,r.textStyle);return l.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-l.x),o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+n.width+t)-Math.abs(this.legendBorderRect.x-o.x),("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height)&&(l.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-l.y)-r.shapeHeight/2,o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-o.y)),{shapeLocation:l,textLocation:o}},e.prototype.drawLegendItem=function(e){var i,r,l=this,o=this.treemap,n=10,a=o.legendSettings,s=new A(a.shapeWidth,a.shapeHeight),h=o.renderer,d=a.shapeBorder;if(e>=0&&e<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var p="HorizontalLine"===a.shape||"VerticalLine"===a.shape||"Cross"===a.shape,g=p?(0,t.isNullOrUndefined)(a.fill)?"#000000":a.fill:d.color,c=p&&0===d.width?1:d.width,u=function(t){var d=m.totalPages[e].Collection[t],u=d.DisplayText,f=h.createGroup({id:o.element.id+"_Legend_Index_"+t});f.setAttribute("aria-label",u+" Legend"),f.setAttribute("role","region");var y=o.element.id+"_Legend_Shape_Index_"+t,v=o.element.id+"_Legend_Text_Index_"+t,b=d.Shape,x=d.Text;o.enableRtl&&(i=m.defaultLegendRtlLocation(d,n,o,a),b=i.shapeLocation,x=i.textLocation),r={cancel:!1,name:S,treemap:o,fill:d.Fill,shape:a.shape,imageUrl:a.imageUrl},o.trigger(S,r,(function(e){var t=new G(y,e.fill,c,p?d.Fill:g,a.opacity,"");f.appendChild(Re(b,e.shape,s,e.imageUrl,t)),Q(new q(v,x.x,x.y,"start",u,"",""),a.textStyle,a.textStyle.color||o.themeStyle.legendTextColor,f),l.legendGroup.appendChild(f)}))},m=this,f=0;f<this.totalPages[e].Collection.length;f++)u(f);var y=void 0,v=n;if(0!==this.page){var b=e+1+"/"+this.totalPages.length,x=a.textStyle,w=V(b,x),F=this.legendItemRect.x+this.legendItemRect.width-w.width-20-n,C=this.legendItemRect.x+this.legendItemRect.width,I=this.legendItemRect.y+this.legendItemRect.height+2.5+n,O=C-v-w.width/2-5;y=h.createGroup({id:o.element.id+"_Legend_Paging_Group"});var L=h.createGroup({id:o.element.id+"_Legend_Left_Paging_Group"}),T=h.createGroup({id:o.element.id+"_Legend_Right_Paging_Group"}),N=" M "+C+" "+I+" L "+(C-v)+" "+(I-5)+" L "+(C-v)+" "+(I+5)+" z ",D=" M "+F+" "+I+" L "+(F+v)+" "+(I-5)+" L "+(F+v)+" "+(I+5)+" z ",E=new G(o.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",D);L.appendChild(h.drawPath(E));var M=new j(o.element.id+"_Left_Page_Rect","transparent",{},1,new W(F-5,I-10,20,20),"");L.appendChild(h.drawRectangle(M)),this.wireEvents(L);var P=new G(o.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",N);T.appendChild(h.drawPath(P));var _=new j(o.element.id+"_Right_Page_Rect","transparent",{},1,new W(C-v,I-5,v,n),"");T.appendChild(h.drawRectangle(_)),this.wireEvents(T),y.appendChild(L),y.appendChild(T);var B={id:o.element.id+"_Paging_Text",x:O,y:I+w.height/4,fill:"#a6a6a6","font-size":"14px","font-style":x.fontStyle,"font-family":x.fontFamily,"font-weight":x.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":"",role:"region","aria-label":b};y.appendChild(h.createText(B,b)),this.legendGroup.appendChild(y)}}},e.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,r=10,l=t.titleStyle,o=V(X(this.legendItemRect.width+20,i,l),l);this.legendBorderRect=new W(this.legendItemRect.x-r,this.legendItemRect.y-r-o.height,this.legendItemRect.width+20,this.legendItemRect.height+20+o.height+("Interactive"===t.mode?0:0!==this.page?r:0));var n={color:t.border.color||this.treemap.themeStyle.legendBorderColor,width:t.border.width||this.treemap.themeStyle.legendBorderWidth},a=new j(e.element.id+"_Legend_Border",t.background,n,1,this.legendBorderRect,""),s=e.renderer.drawRectangle(a);s.style.pointerEvents="none",this.legendGroup.appendChild(s),this.getLegendAlignment(e,this.legendBorderRect.width,this.legendBorderRect.height,t),this.legendGroup.setAttribute("transform","translate( "+(this.translate.x+-this.legendBorderRect.x)+" "+(this.translate.y+-this.legendBorderRect.y)+" )"),e.svgObject.appendChild(this.legendGroup)},e.prototype.renderLegendTitle=function(){var e=this.treemap.legendSettings,t=e.titleStyle,i=e.title.text,r=X(this.legendItemRect.width+20,i,t),l=V(r,t);if(i){var o=Q(new q(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-l.height/2-5,"middle",r,""),t,t.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup);o.setAttribute("role","region"),o.setAttribute("aria-label",i)}},e.prototype.renderInteractivePointer=function(e){var i,r=this.treemap,l=e.target,o=r.element.id+"_Interactive_Legend";l=e.type.indexOf("touch")>-1?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):l;var n=r.legendSettings;if(l.id.indexOf("_Item_Index")>-1&&n.visible&&this.legendRenderingCollections.length>0){var a=void 0,s=void 0,h=void 0,d=void 0,p=void 0,g=void 0,c=void 0;i=r.layout.renderItems[parseFloat(l.id.split("_Item_Index_")[1])];for(var u=r.svgObject.getBoundingClientRect(),m=0;m<this.legendCollections.length;m++){a=this.legendCollections[m],s=(c=document.getElementById(r.element.id+"_Legend_Index_"+m)).getBoundingClientRect();var f=new W(Math.abs(s.left-u.left),Math.abs(s.top-u.top),s.width,s.height);if(d=c.getAttribute("fill"),p=n.shapeBorder.color,g=n.shapeBorder.width,!(0,t.isNullOrUndefined)(a.legendData)){h=a.legendData;for(var y=0;y<h.length;y++)if(h[y].levelOrderName===i.levelOrderName){this.drawInteractivePointer(n,d,p,o,g,f);break}}}}else this.removeInteractivePointer()},e.prototype.drawInteractivePointer=function(e,t,i,r,l,o){var n,a,s,h=10,d=10;n="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(a=o.x+o.width/2)+" "+(s=o.y+o.height)+" L "+(a-d)+" "+(s+h)+" L "+(a+d)+" "+(s+h)+" Z ":" M "+(a=o.x+o.width/2)+" "+(s=o.y)+" L "+(a-d)+" "+(s-h)+" L "+(a+d)+" "+(s-h)+" Z ":e.invertedPointer?" M "+(a=o.x)+" "+(s=o.y+o.height/2)+" L "+(a-d)+" "+(s-h)+" L "+(a-d)+" "+(s+h)+" z ":" M "+(a=o.x+o.width)+" "+(s=o.y+o.height/2)+" L "+(a+d)+" "+(s-h)+" L "+(a+d)+" "+(s+h)+" z ";var p=new G(r,t,l,i,1,"",n);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(p))},e.prototype.getLegendAlignment=function(e,i,r,l){var o,n,a,s=(a=(0,t.extend)({},e.areaRect,a,!0)).x,h=a.y,d=a.height,p=a.width,g=e.availableSize.width,c=e.availableSize.height,u="Auto"===l.position?g>c?"Right":"Bottom":l.position;if("Float"===l.position)this.translate=l.location;else{switch(u){case"Top":case"Bottom":a.height=d-r,o=g/2-i/2,n="Top"===u?h:h+a.height+10,a.y="Top"===u?h+r+10:h;break;case"Left":case"Right":a.width=p-i,o="Left"===u?s:s+a.width,n=c/2-r/2,a.x="Left"===u?s+i:s}switch(l.alignment){case"Near":"Top"===u||"Bottom"===u?o=a.x:n=a.y;break;case"Far":"Top"===u||"Bottom"===u?o=g-i:n=c-r}this.treemap.totalRect=a,this.translate=new J(o,n)}},e.prototype.mouseUpHandler=function(e){this.renderInteractivePointer(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeInteractivePointer.bind(this),3e3)},e.prototype.removeInteractivePointer=function(){if(document.getElementById(this.treemap.element.id+"_Interactive_Legend")){var e=document.getElementById(this.treemap.element.id+"_Interactive_Legend");e.parentNode.removeChild(e)}},e.prototype.changeNextPage=function(e){this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?this.currentPage-1:this.currentPage+1,this.currentPage>=0&&this.currentPage<this.totalPages.length?this.drawLegend():this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?0:this.totalPages.length-1},e.prototype.wireEvents=function(e){t.EventHandler.add(e,t.Browser.touchStartEvent,this.changeNextPage,this)},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderInteractivePointer,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderInteractivePointer),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapLegend"},e.prototype.destroy=function(){clearTimeout(this.clearTimeout),this.clearTimeout=null,this.legendRenderingCollections=[],this.legendCollections=[],this.outOfRangeLegend=null,this.totalPages=[],this.translate=null,this.legendBorderRect=null,this.legendGroup=null,this.legendNames=[],this.defsElement=null,this.legendLinearGradient=null,this.legendInteractiveGradient=[],this.legendItemRect=null,this.removeEventListener(),this.treemap=null},e.prototype.legendGradientColor=function(e,i){var r,l="http://www.w3.org/2000/svg";if(!(0,t.isNullOrUndefined)(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var o=this.treemap.renderer.createDefs(),n=document.createElementNS(l,"linearGradient"),a=this.treemap.legendSettings.position,s="Top"===a||"Bottom"===a?"100":"0",h="Top"===a||"Bottom"===a?"0":"100";n.setAttribute("id","linear_"+i),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2",s+"%"),n.setAttribute("y2",h+"%");for(var d=0;d<e.color.length;d++){var p=100/(e.color.length-1),g=document.createElementNS(l,"stop");g.setAttribute("offset",d*p+"%"),g.setAttribute("stop-color",e.color[d]),g.setAttribute("stop-opacity",1..toString()),n.appendChild(g)}o.appendChild(n),this.legendLinearGradient=n;var c="url(#linear_"+i+")";this.defsElement.appendChild(n),r=c}return r},e}(),at=function(){function e(e){this.target="highlight",this.shapeTarget="highlight",this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.treemap=e,this.addEventListener()}return e.prototype.mouseMove=function(e){var t,i,r,l,o,n,a,s=this.treemap,h=e.target.id,d=[],p=this.treemap.highlightSettings,c=[],u=this.treemap.treeMapSelectionModule;if(h.indexOf("_Item_Index")>-1&&(!u||this.treemap.selectionId!==h)){if(this.highLightId!==h){o=document.getElementById(s.element.id+"_TreeMap_"+s.layoutType+"_Layout");var m=document.getElementsByClassName("treeMapSelection");r=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var f=void 0;if(this.treemap.legendSettings.visible){var y=this.treemap.treeMapLegendModule.legendCollections;f=Ge(this.treemap.treeMapLegendModule.legendCollections.length,r,s),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+f):document.getElementById(this.treemap.element.id+"_Legend_Index_"+f),null===this.shapeElement||u&&this.shapeElement.getAttribute("id")===u.legendSelectId||u&&this.shapeElement===u.shapeElement?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(je(this.shapeHighlightCollection,this.currentElement,s),this.highLightId=""):(this.currentElement.push({currentElement:this.shapeElement}),Ae(this.shapeHighlightCollection),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:y[f].legendFill,oldOpacity:y[f].opacity,oldBorderColor:y[f].borderColor,oldBorderWidth:y[f].borderWidth}),We(this.shapeElement,p.fill,p.opacity,p.border.color,p.border.width.toString()),this.target="highlight")}if(a=re(r,[],p.mode,s),!this.treemap.legendSettings.visible||(!u||(!this.shapeElement||this.shapeElement.getAttribute("id")!==u.legendSelectId)))if(this.treemap.legendSettings.visible&&(u&&this.shapeElement===u.shapeElement))t=!1;else{for(var v=0;v<o.childElementCount;v++){n=o.childNodes[v],l=!0,r=s.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])];for(var b=0;b<m.length;b++)if(n.id===m[b].id){l=!1;break}a.indexOf(r.levelOrderName)>-1&&l&&(c.push(n),d.push(r))}Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s);for(var S=0;S<c.length;S++)Te((n=c[S]).childNodes[0],{border:p.border,fill:p.fill,opacity:p.opacity}),n.classList.add("treeMapHighLight"),this.highLightId=h;i={cancel:!1,name:g,treemap:s,items:d,elements:c},s.trigger(g,i)}}}else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){if(this.treemap.legendSettings.visible&&(!u||u.legendSelectId!==h)&&(!u||u.shapeSelectId!==h)){var x,w=void 0,F=void 0,C=document.getElementById(h);"highlight"===this.shapeTarget&&He(this.legendHighlightCollection),this.shapeTarget="highlight";f="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);var I=this.treemap.treeMapLegendModule.legendCollections[f].legendData.length,O=(y=this.treemap.treeMapLegendModule.legendCollections,parseInt(h[h.length-1],10));for(v=0;v<I;v++)for(b=0;b<this.treemap.layout.renderItems.length;b++)if(this.treemap.treeMapLegendModule.legendCollections[f].legendData[v].levelOrderName===this.treemap.layout.renderItems[b].levelOrderName){w=b,F=this.treemap.layout.renderItems[b].groupIndex;var L=document.getElementById(this.treemap.element.id+"_Level_Index_"+F+"_Item_Index_"+w+"_RectPath");0===v&&(this.legendHighlightCollection=[],Ve(this.legendHighlightCollection,O,b,C,L,this.treemap.layout.renderItems,y),x=this.legendHighlightCollection.length,this.legendHighlightCollection[x-1].ShapeCollection={Elements:[]}),We(C,p.fill,p.opacity,p.border.color,p.border.width.toString()),We(L,p.fill,p.opacity,p.border.color,p.border.width.toString()),x=this.legendHighlightCollection.length,this.legendHighlightCollection[x-1].ShapeCollection.Elements.push(L)}}}else u&&this.shapeElement&&this.shapeElement.getAttribute("id")===u.legendSelectId||(u?this.shapeElement!==u.shapeElement:this.treemap.legendSettings.visible)&&Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||u&&this.shapeElement&&this.shapeElement.getAttribute("id")===u.legendSelectId||(u?this.shapeElement!==u.shapeElement:!u||u.legendSelect)&&(Ae(this.shapeHighlightCollection),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&He(this.legendHighlightCollection),this.highLightId="",t=!1;return t},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchMoveEvent,this.mouseMove,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchMoveEvent,this.mouseMove)},e.prototype.getModuleName=function(){return"treeMapHighlight"},e.prototype.destroy=function(){this.shapeElement=null,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.removeEventListener(),this.treemap=null},e}(),st=function(){function e(e){this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeSelect=!0,this.legendSelect=!0,this.treemap=e,this.addEventListener()}return e.prototype.mouseDown=function(e){var t,i=e.target,r=this.treemap;r.levelSelection=[];var l,o,n,a,s=[],h=i.id,d=i.innerHTML,g=[],c=r.selectionSettings,u=this.treemap.treeMapHighlightModule,m=r.element.id+"_TreeMap_"+r.layoutType+"_Layout";if(h.indexOf("_Item_Index")>-1)if(e.preventDefault(),this.treemap.selectionId!==h&&this.legendSelect){o=document.getElementById(m),l=r.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var f=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var y=this.treemap.treeMapLegendModule.legendCollections.length,v=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Ae(this.shapeSelectionCollection),u&&(u.shapeTarget="selection",u.shapeHighlightCollection=[]),f=Ge(y,l,r),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+f):document.getElementById(this.treemap.element.id+"_Legend_Index_"+f),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:v[f].legendFill,oldOpacity:v[f].opacity,oldBorderColor:v[f].borderColor,oldBorderWidth:v[f].borderWidth}),We(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()))}a=re(l,[],c.mode,r);for(var b=0;b<o.childElementCount;b++)n=o.childNodes[b],l=r.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],a.indexOf(l.levelOrderName)>-1&&(g.push(n),r.levelSelection.push(n.id),s.push(l));Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId=h;for(var S=document.getElementsByClassName("treeMapHighLight"),x=0;x<g.length;x++){if(n=g[x],S.length>0)for(var w=0;w<S.length;w++)S[w].id===n.id&&S[w].classList.remove("treeMapHighLight"),Te(n.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),n.classList.add("treeMapSelection");else Te(n.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),n.classList.add("treeMapSelection");t={cancel:!1,name:p,treemap:r,items:s,elements:g,text:d,contentItemTemplate:d},r.trigger(p,t,(function(e){e.contentItemTemplate!==d&&$(h,i,e.contentItemTemplate)}))}}else Ae(this.shapeSelectionCollection),this.shapeSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId="";else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){v=this.treemap.treeMapLegendModule.legendCollections;if(this.treemap.legendSettings.visible&&this.legendSelectId!==h&&this.shapeSelect){var F,C=void 0,I=void 0;this.legendSelectId=h,this.legendSelect=!1;var O=parseInt(h[h.length-1],10),L=document.getElementById(h);He(this.legendSelectionCollection),u&&(u.shapeTarget="selection");f="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);var T=this.treemap.treeMapLegendModule.legendCollections[f].legendData.length;for(x=0;x<T;x++)for(var N=0;N<this.treemap.layout.renderItems.length;N++)if(this.treemap.treeMapLegendModule.legendCollections[f].legendData[x].levelOrderName===this.treemap.layout.renderItems[N].levelOrderName){C=N,I=this.treemap.layout.renderItems[N].groupIndex;var D=document.getElementById(this.treemap.element.id+"_Level_Index_"+I+"_Item_Index_"+C+"_RectPath");0===x&&(Ve(this.legendSelectionCollection,O,N,L,D,this.treemap.layout.renderItems,v),F=this.legendSelectionCollection.length,this.legendSelectionCollection[F-1].ShapeCollection={Elements:[]}),We(L,c.fill,c.opacity,c.border.color,c.border.width.toString()),We(D,c.fill,c.opacity,c.border.color,c.border.width.toString()),F=this.legendSelectionCollection.length,this.legendSelectionCollection[F-1].ShapeCollection.Elements.push(D)}}else He(this.legendSelectionCollection),u&&(u.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId=""}},e.prototype.selectTreemapItem=function(e,t){if(t){for(var i=void 0,r=0;r<this.treemap.layout.renderItems.length;r++)if(e===this.treemap.layout.renderItems[r].levelOrderName){i=this.treemap.layout.renderItems[r];break}var l=this.treemap.selectionSettings,o=[],n=void 0,a=void 0,s=[];this.treemap.levelSelection=[];for(var h=this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout",d=document.getElementById(h),p=re(i,[],l.mode,this.treemap),g=0;g<d.childElementCount;g++)n=d.childNodes[g],i=this.treemap.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],p.indexOf(i.levelOrderName)>-1&&(o.push(n),this.treemap.levelSelection.push(n.id),s.push(i));if(this.treemap.legendSettings.visible)for(var c=0;c<s.length;c++){this.shapeSelect=!1;var u=this.treemap.treeMapLegendModule.legendCollections.length,m=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Ae(this.shapeSelectionCollection),a=Ge(u,s[c],this.treemap),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+a):document.getElementById(this.treemap.element.id+"_Legend_Index_"+a),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.treemap.legendId.push(this.shapeSelectId),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:m[a].legendFill,oldOpacity:m[a].opacity,oldBorderColor:m[a].borderColor,oldBorderWidth:m[a].borderWidth}),We(this.shapeElement,l.fill,l.opacity,l.border.color,l.border.width.toString()))}Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap);var f=document.getElementById(this.treemap.levelSelection[0]);this.treemap.selectionId=f.childNodes[0].id;for(var y=document.getElementsByClassName("treeMapHighLight"),v=0;v<o.length;v++)if(n=o[v],y.length>0)for(var b=0;b<y.length;b++)y[b].id===n.id&&y[b].classList.remove("treeMapHighLight"),Te(n.childNodes[0],{border:l.border,fill:l.fill,opacity:l.opacity}),n.classList.add("treeMapSelection");else l.fill="null"===l.fill?this.treemap.layout.renderItems[parseInt(n.id.split("Item_Index_")[1],10)].options.fill:l.fill,Te(n.childNodes[0],{border:l.border,fill:l.fill,opacity:l.opacity}),n.classList.add("treeMapSelection")}else Ae(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap),this.treemap.selectionId=""},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchStartEvent,this.mouseDown,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchStartEvent,this.mouseDown)},e.prototype.getModuleName=function(){return"treeMapSelection"},e.prototype.destroy=function(){this.shapeElement=null,this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.removeEventListener(),this.treemap=null},e}(),ht=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(r=Object.getOwnPropertySymbols(e);l<r.length;l++)t.indexOf(r[l])<0&&(i[r[l]]=e[r[l]])}return i},dt=function(){function e(e){this.treemap=e,this.tooltipSettings=this.treemap.tooltipSettings,this.tooltipId=this.treemap.element.id+"_TreeMapTooltip",this.addEventListener()}return e.prototype.renderTooltip=function(e){var i,r,l,o,n,a,s=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,i=(o=e).changedTouches[0].pageX,r=o.changedTouches[0].pageY,l=o.target):(this.isTouch="touch"===e.pointerType,i=e.pageX,r=e.pageY,l=e.target);var h,d,p,g=l.id,u={},m={},f=[];if(g.indexOf("_Item_Index")>-1){if(u=this.treemap.layout.renderItems[parseFloat(g.split("_Item_Index_")[1])],!(0,t.isNullOrUndefined)(u)){a=u.weight,m=u.data,(0,t.isNullOrUndefined)(u.options)||(p=u.options.fill),f=this.treemap.enableRtl?[((0,t.isNullOrUndefined)(this.tooltipSettings.format)?null:Ne(this.tooltipSettings.format,m,this.treemap))||De(a,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[((0,t.isNullOrUndefined)(this.tooltipSettings.format)?null:Ne(this.tooltipSettings.format,m,this.treemap))||this.treemap.weightValuePath.toString()+" : "+De(a,this.treemap)],document.getElementById(this.tooltipId)?h=document.getElementById(this.tooltipId):((h=(0,t.createElement)("div",{id:this.treemap.element.id+"_TreeMapTooltip",className:"EJ2-TreeMap-Tooltip"})).style.cssText="position: absolute;pointer-events:none;",document.getElementById(this.treemap.element.id+"_Secondary_Element").appendChild(h)),(d=ge(i,r,this.treemap.svgObject)).y=this.tooltipSettings.template?d.y+10:d.y,this.tooltipSettings.textStyle.size=this.tooltipSettings.textStyle.size||this.treemap.themeStyle.tooltipFontSize,this.tooltipSettings.textStyle.fontFamily=this.tooltipSettings.textStyle.fontFamily||this.treemap.themeStyle.fontFamily,this.tooltipSettings.textStyle.fontStyle=(0,t.isNullOrUndefined)(this.tooltipSettings.textStyle.fontStyle)?"Normal":this.tooltipSettings.textStyle.fontStyle,this.tooltipSettings.textStyle.fontWeight=this.tooltipSettings.textStyle.fontWeight||this.treemap.themeStyle.fontWeight,this.tooltipSettings.textStyle.color=this.tooltipSettings.textStyle.color||this.treemap.themeStyle.tooltipFontColor,this.tooltipSettings.textStyle.opacity=this.tooltipSettings.textStyle.opacity||this.treemap.themeStyle.tooltipTextOpacity;var y={width:this.tooltipSettings.border.width||this.treemap.themeStyle.tooltipBorderWidth||0,color:this.tooltipSettings.border.color||this.treemap.themeStyle.tooltipBorderColor||"transparent"};n={cancel:!1,name:c,item:u,options:{location:d,text:f,data:m,border:y,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:l,eventArgs:e},this.treemap.trigger(c,n,(function(e){s.addTooltip(n,p,h)}))}}else this.removeTooltip(),this.treemap.clearTemplate()},e.prototype.addTooltip=function(e,r,l,o){var n,a;(0,t.isNullOrUndefined)(e)?(n=o.cancel,a=o):(n=e.cancel,a=ht(e,["cancel"]).options);n?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new i.Tooltip({theme:this.treemap.theme,enable:!0,header:"",data:a.data,template:a.template,content:a.text,shapes:[],location:a.location,palette:[r],areaBounds:this.treemap.areaRect,textStyle:a.textStyle,fill:this.treemap.tooltipSettings.fill?this.treemap.tooltipSettings.fill:this.treemap.themeStyle.tooltipFillColor,border:a.border,enableShadow:!0}),(this.treemap.isVue||this.treemap.isVue3)&&(this.svgTooltip.controlInstance=this.treemap),this.svgTooltip.opacity=this.treemap.themeStyle.tooltipFillOpacity||this.svgTooltip.opacity,this.svgTooltip.appendTo(l),this.treemap.renderReactTemplates())},e.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},e.prototype.removeTooltip=function(){if(document.getElementsByClassName("EJ2-TreeMap-Tooltip").length>0){var e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0];e.parentNode.removeChild(e)}},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderTooltip,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderTooltip),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapTooltip"},e.prototype.destroy=function(){(0,t.isNullOrUndefined)(this.svgTooltip)||this.svgTooltip.destroy(),this.svgTooltip=null,this.tooltipSettings=null,this.removeEventListener(),this.treemap=null},e}()})(),a})()));