UNPKG

@syncfusion/ej2-treemap

Version:
10 lines 138 kB
/*! * filename: ej2-treemap.min.js * version : 31.1.17 * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ !function(e,t){"object"==typeof exports&&"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,l)=>(()=>{"use strict";var o={766:t=>{t.exports=e},74:e=>{e.exports=i},461:e=>{e.exports=l},727:e=>{e.exports=t}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return o[e](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{r.r(a),r.d(a,{Border:()=>O,ColorMapping:()=>E,ColorValue:()=>_e,CommonTitleSettings:()=>M,Font:()=>T,HighlightSettings:()=>R,ImageExport:()=>Ke,InitialDrillSettings:()=>P,LayoutPanel:()=>Ye,LeafItemSettings:()=>B,LegendSettings:()=>D,LevelSettings:()=>U,LevelsData:()=>nt,Location:()=>J,Margin:()=>L,PathOption:()=>V,PdfExport:()=>tt,Print:()=>$e,Rect:()=>W,RectOption:()=>j,SelectionSettings:()=>H,Size:()=>k,SubTitleSettings:()=>N,TextOption:()=>q,Theme:()=>Je,TitleSettings:()=>_,TooltipSettings:()=>z,TreeMap:()=>ot,TreeMapAjax:()=>Ue,TreeMapHighlight:()=>at,TreeMapLegend:()=>rt,TreeMapSelection:()=>st,TreeMapTooltip:()=>ht,applyOptions:()=>Te,beforePrint:()=>n,click:()=>f,colorCollections:()=>ue,colorMap:()=>ce,colorNameToHex:()=>Be,componentToHex:()=>De,convertElement:()=>ne,convertHexToColor:()=>Pe,convertToContainer:()=>he,convertToHexCode:()=>Ee,convertToRect:()=>pe,createTextStyle:()=>Z,deSaturationColor:()=>me,defaultFont:()=>C,doubleClick:()=>y,drawSymbol:()=>ze,drillEnd:()=>h,drillStart:()=>d,findChildren:()=>ie,findHightLightItems:()=>le,findLabelLocation:()=>re,findPosition:()=>Y,formatValue:()=>Ne,getArea:()=>se,getColorByValue:()=>ye,getElement:()=>K,getGradientColor:()=>ve,getLegendIndex:()=>Ve,getMousePosition:()=>ge,getPercentage:()=>xe,getPercentageColor:()=>Se,getShortestEdge:()=>de,getTemplateFunction:()=>oe,getThemeStyle:()=>Qe,hide:()=>Ce,isContainsData:()=>te,isParentItem:()=>Re,itemClick:()=>m,itemHighlight:()=>g,itemMove:()=>u,itemRendering:()=>s,itemSelected:()=>p,itemsToOrder:()=>ee,legendItemRendering:()=>x,legendMaintain:()=>Oe,legendRendering:()=>b,load:()=>l,loaded:()=>o,maintainSelection:()=>we,measureElement:()=>ae,measureText:()=>G,mouseMove:()=>S,orderByArea:()=>Fe,pushCollection:()=>Ge,removeClassNames:()=>Le,removeElement:()=>Xe,removeLegend:()=>Ae,removeSelectionWithHighlight:()=>je,removeShape:()=>ke,renderLegendShape:()=>He,renderTextElement:()=>Q,resize:()=>I,rgbToHex:()=>fe,rightClick:()=>v,setColor:()=>We,setItemTemplateContent:()=>$,stringToNumber:()=>A,textFormatter:()=>Me,textTrim:()=>X,textWrap:()=>Ie,tooltipRendering:()=>c,triggerDownload:()=>qe,wordWrap:()=>be});var e,t=r(766),i=r(727),l="load",o="loaded",n="beforePrint",s="itemRendering",d="drillStart",h="drillEnd",p="itemSelected",g="itemHighlight",c="tooltipRendering",m="itemClick",u="itemMove",f="click",y="doubleClick",v="rightClick",S="mouseMove",x="legendItemRendering",b="legendRendering",I="resize",C="Roboto, Segoe UI, Noto, Sans-serif",F=(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 l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}),w=function(e,t,i,l){var o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)("#808080")],i.prototype,"color",void 0),w([(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 F(i,e),w([(0,t.Property)(10)],i.prototype,"left",void 0),w([(0,t.Property)(10)],i.prototype,"right",void 0),w([(0,t.Property)(10)],i.prototype,"top",void 0),w([(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 F(i,e),w([(0,t.Property)(null)],i.prototype,"size",void 0),w([(0,t.Property)(null)],i.prototype,"color",void 0),w([(0,t.Property)(C)],i.prototype,"fontFamily",void 0),w([(0,t.Property)("")],i.prototype,"fontWeight",void 0),w([(0,t.Property)("Normal")],i.prototype,"fontStyle",void 0),w([(0,t.Property)(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),M=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)("")],i.prototype,"text",void 0),w([(0,t.Property)("")],i.prototype,"description",void 0),i}(t.ChildProperty),N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Complex)({fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),w([(0,t.Property)("Center")],i.prototype,"alignment",void 0),i}(M),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Complex)({fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),w([(0,t.Property)("Center")],i.prototype,"alignment",void 0),w([(0,t.Complex)({},N)],i.prototype,"subtitleSettings",void 0),i}(M),E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(null)],i.prototype,"from",void 0),w([(0,t.Property)(null)],i.prototype,"to",void 0),w([(0,t.Property)(null)],i.prototype,"color",void 0),w([(0,t.Property)(null)],i.prototype,"label",void 0),w([(0,t.Property)(null)],i.prototype,"value",void 0),w([(0,t.Property)(null)],i.prototype,"minOpacity",void 0),w([(0,t.Property)(null)],i.prototype,"maxOpacity",void 0),w([(0,t.Property)(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),D=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(!1)],i.prototype,"visible",void 0),w([(0,t.Property)("Default")],i.prototype,"mode",void 0),w([(0,t.Property)("transparent")],i.prototype,"background",void 0),w([(0,t.Property)("Circle")],i.prototype,"shape",void 0),w([(0,t.Property)("")],i.prototype,"width",void 0),w([(0,t.Property)("")],i.prototype,"height",void 0),w([(0,t.Complex)({size:null,fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),w([(0,t.Property)(null)],i.prototype,"fill",void 0),w([(0,t.Property)(1)],i.prototype,"opacity",void 0),w([(0,t.Property)(15)],i.prototype,"shapeWidth",void 0),w([(0,t.Property)(15)],i.prototype,"shapeHeight",void 0),w([(0,t.Property)(10)],i.prototype,"shapePadding",void 0),w([(0,t.Property)(null)],i.prototype,"imageUrl",void 0),w([(0,t.Complex)({color:null,width:null},O)],i.prototype,"border",void 0),w([(0,t.Complex)({color:"#000000",width:0},O)],i.prototype,"shapeBorder",void 0),w([(0,t.Complex)({},M)],i.prototype,"title",void 0),w([(0,t.Complex)({size:null,fontFamily:null,fontWeight:null},T)],i.prototype,"titleStyle",void 0),w([(0,t.Property)("Bottom")],i.prototype,"position",void 0),w([(0,t.Property)("None")],i.prototype,"orientation",void 0),w([(0,t.Property)(!1)],i.prototype,"invertedPointer",void 0),w([(0,t.Property)("After")],i.prototype,"labelPosition",void 0),w([(0,t.Property)("None")],i.prototype,"labelDisplayMode",void 0),w([(0,t.Property)("Center")],i.prototype,"alignment",void 0),w([(0,t.Property)({x:0,y:0})],i.prototype,"location",void 0),w([(0,t.Property)(null)],i.prototype,"showLegendPath",void 0),w([(0,t.Property)(null)],i.prototype,"valuePath",void 0),w([(0,t.Property)(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),P=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(null)],i.prototype,"groupIndex",void 0),w([(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 F(i,e),w([(0,t.Property)(null)],i.prototype,"fill",void 0),w([(0,t.Property)(!1)],i.prototype,"autoFill",void 0),w([(0,t.Complex)({},O)],i.prototype,"border",void 0),w([(0,t.Property)(0)],i.prototype,"gap",void 0),w([(0,t.Property)(10)],i.prototype,"padding",void 0),w([(0,t.Property)(1)],i.prototype,"opacity",void 0),w([(0,t.Property)(!0)],i.prototype,"showLabels",void 0),w([(0,t.Property)(null)],i.prototype,"labelPath",void 0),w([(0,t.Property)(null)],i.prototype,"labelFormat",void 0),w([(0,t.Property)("TopLeft")],i.prototype,"labelPosition",void 0),w([(0,t.Complex)({color:null,size:null,fontFamily:null},T)],i.prototype,"labelStyle",void 0),w([(0,t.Property)(null)],i.prototype,"labelTemplate",void 0),w([(0,t.Property)("Center")],i.prototype,"templatePosition",void 0),w([(0,t.Property)("Trim")],i.prototype,"interSectAction",void 0),w([(0,t.Collection)([],E)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(!1)],i.prototype,"visible",void 0),w([(0,t.Property)("")],i.prototype,"template",void 0),w([(0,t.Property)(null)],i.prototype,"format",void 0),w([(0,t.Property)(null)],i.prototype,"fill",void 0),w([(0,t.Property)(.75)],i.prototype,"opacity",void 0),w([(0,t.Property)(["Circle"])],i.prototype,"markerShapes",void 0),w([(0,t.Complex)({width:null,color:null},O)],i.prototype,"border",void 0),w([(0,t.Complex)({fontFamily:null,size:null,fontWeight:null,opacity:null},T)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),H=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(!1)],i.prototype,"enable",void 0),w([(0,t.Property)(null)],i.prototype,"fill",void 0),w([(0,t.Property)("0.5")],i.prototype,"opacity",void 0),w([(0,t.Complex)({},O)],i.prototype,"border",void 0),w([(0,t.Property)("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),R=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(!1)],i.prototype,"enable",void 0),w([(0,t.Property)("#808080")],i.prototype,"fill",void 0),w([(0,t.Property)("0.5")],i.prototype,"opacity",void 0),w([(0,t.Complex)({},O)],i.prototype,"border",void 0),w([(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 F(i,e),w([(0,t.Property)(null)],i.prototype,"groupPath",void 0),w([(0,t.Property)(0)],i.prototype,"groupGap",void 0),w([(0,t.Property)(10)],i.prototype,"groupPadding",void 0),w([(0,t.Complex)({},O)],i.prototype,"border",void 0),w([(0,t.Property)(null)],i.prototype,"fill",void 0),w([(0,t.Property)(!1)],i.prototype,"autoFill",void 0),w([(0,t.Property)(1)],i.prototype,"opacity",void 0),w([(0,t.Property)(!0)],i.prototype,"showHeader",void 0),w([(0,t.Property)(20)],i.prototype,"headerHeight",void 0),w([(0,t.Property)(null)],i.prototype,"headerTemplate",void 0),w([(0,t.Property)(null)],i.prototype,"headerFormat",void 0),w([(0,t.Property)("Near")],i.prototype,"headerAlignment",void 0),w([(0,t.Complex)({color:null,size:"13px",fontFamily:null},T)],i.prototype,"headerStyle",void 0),w([(0,t.Property)("TopLeft")],i.prototype,"templatePosition",void 0),w([(0,t.Collection)([],E)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),k=function(e,t){this.width=e,this.height=t};function A(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}var W=function(e,t,i,l){this.x=e,this.y=t,this.width=i,this.height=l},j=function(e,t,i,l,o,n){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=l,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=n},V=function(e,t,i,l,o,n,r){this.id=e,this.opacity=o,this.fill=t,this.stroke=l,this["stroke-width"]=i,this["stroke-dasharray"]=n,this.d=r};function G(e,i){var l=document.getElementById("treeMapMeasureText");return null===l&&(l=(0,t.createElement)("text",{id:"treeMapMeasureText"}),document.body.appendChild(l)),l.innerHTML=t.SanitizeHtmlHelper.sanitize(e),l.style.position="absolute",l.style.fontSize=i.size,l.style.fontWeight=i.fontWeight,l.style.fontStyle=i.fontStyle,l.style.fontFamily=i.fontFamily,l.style.visibility="hidden",l.style.top="-100",l.style.left="0",l.style.whiteSpace="nowrap",l.style.lineHeight="normal",new k(l.clientWidth,l.clientHeight)}var q=function(e,t,i,l,o,n,r,a){void 0===n&&(n=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=n,this.anchor=l,this.x=t,this.y=i,this.baseLine=r,this.connectorText=a};function X(e,t,i){var l=t,o=G(t,i).width;if(o>e)for(var n=t.length-1;n>=0;--n)if((o=G(l=t.substring(0,n)+"...",i).width)<=e||l.length<4)return l.length<4&&(l=" "),l;return l}var J=function(e,t){this.x=e,this.y=t};function Y(e,t,i,l){var o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===l?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===l?e.width-e.y-i.width:e.x+e.width-i.width}var n="title"===l?e.y+i.height/2:e.y+e.height/2+i.height/2;return new J(o,n)}function Z(e,t,i){var l=e.createText(t,i);return l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.style["user-select"]="none",l.style["-moz-user-select"]="none",l.style["-webkit-touch-callout"]="none",l.style["-webkit-user-select"]="none",l.style["-khtml-user-select"]="none",l.style["-ms-user-select"]="none",l.style["-o-user-select"]="none",l}function Q(e,l,o,n,r){void 0===r&&(r=!1);var a,s,d,h={"font-size":l.size,"font-style":l.fontStyle,"font-family":l.fontFamily,"font-weight":l.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:l.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:o},p="string"==typeof e.text?e.text:r?e.text[e.text.length-1]:e.text[0],g=new i.SvgRenderer("");if(!(0,t.isNullOrUndefined)(p)&&!(0,t.isNullOrUndefined)(e.connectorText)&&p.includes(e.connectorText[1]))for(var c=p.split("#"),m=0;m<c.length;m++){var u=-1===c[m].search(e.connectorText)||(0,t.isNullOrUndefined)(e.connectorText)?c[m]:e.connectorText;if(h.id=e.id+"_"+m,d=Z(g,h,u),m%2==0&&0!==m){u=u.replace(/\s+/g,"&nbsp")}var f=G(u,l);h.x=0!==m?h.x+f.width:h.x+f.width+5,n.appendChild(d)}else d=Z(g,h,p),n.appendChild(d);if("string"!=typeof e.text&&e.text.length>1){for(var y=1,v=e.text.length;y<v;y++)s=G(e.text[y],l).height,a=g.createTSpan({x:e.x,id:e.id,y:e.y+y*s},e.text[y]),d.appendChild(a);n.appendChild(d)}return d}function $(e,i,l){var o,n=e.split("_RectPath")[0];o=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+n+"_LabelTemplate"),(0,t.isNullOrUndefined)(o)||(o.innerHTML=l)}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,l){for(var o=!1,n="",r=l.leafItemSettings,a=0;a<e.length;a++){var s=i[l.levels[a]?l.levels[a].groupPath:r.labelPath?r.labelPath:l.weightValuePath]||"undefined";if(e[a]===s&&(n+=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 l=0;l<i.length;l++)if(e[i[l]]instanceof Array){t.values=e[i[l]],t.key=i[l];break}}return t}function le(e,t,i,l){if("Child"===i){t.push(e.levelOrderName);var o=ie(e).values;if(o&&o.length>0){for(var n=0;n<o.length;n++)-1===t.indexOf(o[n].levelOrderName)&&t.push(o[n].levelOrderName);for(var r=0;r<o.length;r++)le(o[r],t,i,l)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),le(e.parent,t,i,l));else if("All"===i){var a=e.levelOrderName.split("#")[0],s=void 0;for(n=0;n<l.layout.renderItems.length;n++)(s=l.layout.renderItems[n]).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(l){i=(0,t.compile)(e)}return i}function ne(e,i,l){var o=(0,t.createElement)("div",{id:i});o.style.cssText="position: absolute;pointer-events: auto;";for(var n=e.length;n>0;)o.appendChild(e[0]),n--;for(var r=o.innerHTML,a=Object.keys(l),s=0;s<a.length;s++){var d=RegExp;r=r.replace(new d("{{:"+a[s]+"}}","g"),l[a[s].toString()])}return o.innerHTML=r,o}function re(e,t,i,l,o){var n=new J(0,0),r="Template"===l?o.areaRect.x:0,a="Template"===l?o.areaRect.y:0;return n.x=Math.abs(r-(t.indexOf("Left")>-1?e.x+5:t.indexOf("Right")>-1?e.x+e.width-i.width:e.x+(e.width/2-i.width/2)))-2,!o.enableDrillDown||"BottomLeftTopRight"!==o.renderDirection&&"BottomRightTopLeft"!==o.renderDirection?n.y=Math.abs(a-(t.indexOf("Top")>-1?"Template"===l?e.y:e.y+i.height:t.indexOf("Bottom")>-1?e.y+e.height-i.height:"Template"===l?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):n.y=Math.abs(e.y+e.height-i.height+5),n}function ae(e,t){var i=new k(0,0);t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth;var l=document.getElementById(e.id);return l.parentNode.removeChild(l),i}function se(e){return(e.width-e.x)*(e.height-e.y)}function de(e){var t=he(e),i=t.width,l=t.height;return Math.min(i,l)}function he(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 l=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,n=i.ownerDocument.defaultView.pageYOffset,r=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=l.left+o-a,d=l.top+n-r;return new J(e-s,t-d)}function ce(e,i,l){var o,n,r=[];if((0,t.isNullOrUndefined)(i)&&(0,t.isNullOrUndefined)(l)&&isNaN(l))return null;for(var a=0;a<e.length;a++){var s=!1,d=l;(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)||(l>=e[a].from&&e[a].to>=l||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]:ue(e[a],d):e[a].color):l>=e[a].from&&e[a].to>=l&&e[a].value===i&&(s=!0,o="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:ue(e[a],d):e[a].color),(l>=e[a].from&&l<=e[a].to||e[a].value===i)&&!(0,t.isNullOrUndefined)(e[a].minOpacity)&&!(0,t.isNullOrUndefined)(e[a].maxOpacity)&&o&&(n=me(e[a],l)),(""===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),n=(0,t.isNullOrUndefined)(n)?"1":n,r.push(o)}for(var h=r.length-1;h>=0;h--)h=(o=r[h])?-1:h;return{fill:o,opacity:n}}function me(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 ue(e,t){return ye(e,t)}function fe(e,t,i){return"#"+De(e)+De(t)+De(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,l,o=t.from,n=t.to,r=0,a=n-o;if(r=(e-o)/a,t.color.length<=2)i="#"===t.color[0].charAt(0)?t.color[0]:Be(t.color[0]),l="#"===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]),l="#"===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),d=t.color.length-1,h=[],p={},g=1;g<d;g++)p={b:o+g*s,color:t.color[g]},h.push(p);for(var c=0;c<h.length;c++)o<=e&&e<=h[c].b&&0===c?(l="#"===h[c].color.charAt(0)?h[c].color:Be(h[c].color),r=e<h[c].b?1-Math.abs((e-h[c].b)/s):(e-h[c].b)/s):h[c].b<=e&&e<=n&&c===h.length-1&&(i="#"===h[c].color.charAt(0)?h[c].color:Be(h[c].color),r=e<h[c].b?1-Math.abs((e-h[c].b)/s):(e-h[c].b)/s),c!==h.length-1&&c<h.length&&h[c].b<=e&&e<=h[c+1].b&&(i="#"===h[c].color.charAt(0)?h[c].color:Be(h[c].color),l="#"===h[c+1].color.charAt(0)?h[c+1].color:Be(h[c+1].color),r=Math.abs(e-h[c+1].b)/s)}return Se(r,i,l)}function Se(e,t,i){var l=i.split("#")[1],o=t.split("#")[1],n=xe(e,parseInt(o.substr(0,2),16),parseInt(l.substr(0,2),16)),r=xe(e,parseInt(o.substr(2,2),16),parseInt(l.substr(2,2),16)),a=xe(e,parseInt(o.substr(4,2),16),parseInt(l.substr(4,2),16));return new _e(n,r,a)}function xe(e,t,i){var l=i-t;return Math.round(t+l*e)}function be(e,t,i){for(var l,o=t.split(" "),n="",r=[],a=0,s=o.length;a<s;a++)l=o[a],G(n.concat(l),i).width<e?n=n.concat((""===n?"":" ")+l):""!==n?(r.push(X(e,n,i)),n=l):(r.push(X(e,l,i)),l=""),n&&a===s-1&&r.push(X(e,n,i));return r}function Ie(e,t,i){var l=[],o=0,n=G(t,i).width,r=t.length;if(e>=n)return l.push(t),l;for(var a=t.length;a>o;a--){var s=t.slice(o,a);if((n=G(s,i).width)<=e){if(l.push(s),r===(o+=s.length))return l;a=r+1}}return l}function Ce(e,t,i,l){var o=G(i,l);return o.width>e||o.height>t?" ":i}function Fe(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function we(e,t,i){var l=e.levelSelection;if(l)for(var o=0;o<l.length;o++)t.getAttribute("id")===l[o]||t.children[0].id===l[o]?t.childElementCount>0&&-1===t.children[0].id.indexOf("_Group")&&(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,i){var l=e.legendId;if(l)for(var o=0;o<l.length;o++)if("Interactive"===e.legendSettings.mode){for(var n=0;n<i.childElementCount;n++)if(i.childNodes[n].id===l[o]||parseFloat(i.childNodes[n].id.split("Index_")[1])===parseFloat(l[o].split("Index_")[1])){var r=i.childNodes[n];r.setAttribute("fill",e.selectionSettings.fill),r.setAttribute("opacity",e.selectionSettings.opacity),-1===r.id.indexOf("Text")?(r.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),r.setAttribute("stroke",e.selectionSettings.border.color)):(r.setAttribute("stroke",null),r.setAttribute("stroke-width",null))}}else{var a=document.getElementById(l[o]);(0,t.isNullOrUndefined)(a)||(a.setAttribute("fill",e.selectionSettings.fill),a.setAttribute("opacity",e.selectionSettings.opacity),-1===a.id.indexOf("Text")?(a.setAttribute("stroke",e.selectionSettings.border.color),a.setAttribute("stroke-width",e.selectionSettings.border.width.toString())):(a.setAttribute("stroke",null),a.setAttribute("stroke-width",null)))}}function Le(e,i,l){for(var o,n={},r=0;r<e.length;r++)o=(0,t.isNullOrUndefined)(e[r].childNodes[0])?e[r]:e[r].childNodes[0],n=l.layout.renderItems[parseFloat(o.id.split("_Item_Index_")[1])].options,Te(o,n),e[r].classList.remove(i),r-=1}function Te(e,i){e.setAttribute("opacity",i.opacity),(0,t.isNullOrUndefined)(i.fill)?e.setAttribute("fill","black"):e.setAttribute("fill",i.fill),e.setAttribute("stroke",i.border.color),e.setAttribute("stroke-width",i.border.width)}function Me(e,i,l){if((0,t.isNullOrUndefined)(e))return null;for(var o=0,n=Object.keys(i);o<n.length;o++){var r=n[o];e=e.split("${"+r+"}").join(Ne(i[r],l).toString())}return e}function Ne(e,t){return(t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)||""}var _e=function(e,t,i){this.r=e,this.g=t,this.b=i};function Ee(e){return"#"+De(e.r)+De(e.g)+De(e.b)}function De(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function Pe(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new _e(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new _e(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 Ee(new _e(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function ze(e,t,l,o,n){var r=new i.SvgRenderer(""),a=He(e,l,t,n,o);return r["draw"+a.functionName](a.renderOption)}function He(e,i,l,o,n){var r,a="Path",s=i.width,d=i.height,h=e.x,p=e.y,g=e.x+-s/2,c=e.y+-d/2;switch(l){case"Circle":case"Bubble":a="Ellipse",(0,t.merge)(o,{rx:s/2,ry:d/2,cx:h,cy:p});break;case"VerticalLine":r="M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),(0,t.merge)(o,{d:r});break;case"Diamond":r="M "+g+" "+p+" L "+h+" "+(p+-d/2)+" L "+(h+s/2)+" "+p+" L "+h+" "+(p+d/2)+" L "+g+" "+p+" z",(0,t.merge)(o,{d:r});break;case"Rectangle":r="M "+g+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+d/2)+" L "+g+" "+(p+d/2)+" L "+g+" "+(p+-d/2)+" z",(0,t.merge)(o,{d:r});break;case"Triangle":r="M "+g+" "+(p+d/2)+" L "+h+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+d/2)+" L "+g+" "+(p+d/2)+" z",(0,t.merge)(o,{d:r});break;case"InvertedTriangle":r="M "+(h+s/2)+" "+(p-d/2)+" L "+h+" "+(p+d/2)+" L "+(h-s/2)+" "+(p-d/2)+" L "+(h+s/2)+" "+(p-d/2)+" z",(0,t.merge)(o,{d:r});break;case"Pentagon":for(var m=void 0,u=void 0,f=0;f<=5;f++)m=s/2*Math.cos(Math.PI/180*(72*f)),u=s/2*Math.sin(Math.PI/180*(72*f)),r=0===f?"M "+(h+m)+" "+(p+u)+" ":r.concat("L "+(h+m)+" "+(p+u)+" ");r=r.concat("Z"),(0,t.merge)(o,{d:r});break;case"Star":r="M "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" L "+(e.x-i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x+i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x-i.width/3)+" "+(e.y-i.height/2)+" L "+e.x+" "+(e.y+i.height/2)+" L "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" Z",(0,t.merge)(o,{d:r});break;case"Cross":r="M "+g+" "+p+" L "+(h+s/2)+" "+p+" M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),(0,t.merge)(o,{d:r});break;case"Image":a="Image",(0,t.merge)(o,{href:n,height:d,width:s,x:g,y:c})}return{renderOption:o,functionName:a}}function Re(e,t){for(var i=!1,l=0;l<e.length;l++)if(t.levelOrderName===e[l].levelOrderName){i=!0;break}return i}var Ue=function(e,t,i,l,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=l,this.sendData=o};function ke(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 Ae(e,i){if(e.length>0)for(var l=0;l<e.length;l++){var o=e[l],n=parseFloat(o.legendEle.id.split("_Index_")[1]),r=o.legendEle.id.indexOf("Text")>-1?o.legendEle.id.replace("_Text",""):o.legendEle.id,a="Interactive"===i.legendSettings.mode?document.getElementById(r):document.getElementById(i.element.id+"_Legend_Shape_Index_"+n),s="Interactive"===i.legendSettings.mode?document.getElementById(r+"_Text"):document.getElementById(i.element.id+"_Legend_Text_Index_"+n);(0,t.isNullOrUndefined)(a)||We(a,o.oldFill,o.oldOpacity,"none","0px"),(0,t.isNullOrUndefined)(s)||We(s,i.legendSettings.textStyle.color||i.themeStyle.legendTextColor,o.oldOpacity,null,null);for(var d=(0,t.isNullOrUndefined)(o.ShapeCollection)?0:o.ShapeCollection.Elements.length,h=0;h<d;h++){var p=document.getElementById(o.ShapeCollection.Elements[h].id);(0,t.isNullOrUndefined)(p)||We(p,o.shapeOldFill,o.shapeOldOpacity,o.shapeOldBorderColor,o.shapeOldBorderWidth)}}}function We(e,i,l,o,n){e.setAttribute("fill",i),e.setAttribute("opacity",l),(0,t.isNullOrUndefined)(o)||e.setAttribute("stroke",o),(0,t.isNullOrUndefined)(n)||e.setAttribute("stroke-width",n)}function je(e,t,i){Ae(e,i),Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function Ve(e,i,l){for(var o,n=""!==l.rangeColorValuePath?l.rangeColorValuePath:null,r=!1,a=0;a<e&&!r;a++){var s=l.treeMapLegendModule.legendCollections[a].legendData.length;if(s>0){for(var d=0;d<s;d++)if(!(0,t.isNullOrUndefined)(n)&&l.leafItemSettings.colorMapping.length>0?l.treeMapLegendModule.legendCollections[a].legendData[d].data[n]===i.data[n]:l.treeMapLegendModule.legendCollections[a].legendData[d].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].legendName)>-1){o=a,r=!0;break}}else if(l.palette&&l.palette.length>0&&(l.treeMapLegendModule.legendCollections[a].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].levelOrderName)>-1)&&l.treeMapLegendModule.legendCollections[a].legendName===i.name){o=a;break}}return o}function Ge(e,t,i,l,o,n,r){e.push({legendEle:l,oldFill:r[t].legendFill,oldOpacity:r[t].opacity,oldBorderColor:r[t].borderColor,oldBorderWidth:r[t].borderWidth,shapeElement:o,shapeOldFill:n[i].options.fill,shapeOldOpacity:n[i].options.opacity,shapeOldBorderColor:n[i].options.border.color,shapeOldBorderWidth:n[i].options.border.width})}function qe(e,i,l,o){(0,t.createElement)("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:l}}).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 l=this.treemap.drilledItems.length-1,o=this.treemap.drilledItems[l].data,n={};n[this.treemap.drilledItems[l].data.groupName]=[o],(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[l].data.groupIndex),this.calculateLayoutItems(n||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems()}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,l={},o=ie(e).values;if(o&&o.length>0&&0===t.length){for(var n=0;n<o.length;n++)o[n].groupIndex===i.initialDrillDown.groupIndex&&o[n].name===i.initialDrillDown.groupName&&(o[n].isDrilled=!0,l[o[n].groupName]=[o[n]],t.push(l));for(var r=0;r<o.length;r++)this.getDrilldownData(o[r],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,l,o,n,r=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 d=0;d<s.length;d++)l=s[d].groupIndex,o=0===a.length||l===a.length?r.gap:a[l].groupGap,n=0===a.length?0:a[l]?a[l].showHeader?a[l].headerHeight:0:a[l-1].showHeader?a[l-1].headerHeight:0,i=s[d].rect,i=new W(i.x+o/2,i.y+(n+o/2),i.width-o,Math.abs(i.height-(o+n))),this.computeSliceAndDiceDimensional(s[d],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var l,o=i.height*i.width,n=this.treemap.levels,r=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 d=0;d<e.length;d++){var h=e[d];h.isLeafItem=0===n.length||(this.treemap.isHierarchicalData||(0,t.isNullOrUndefined)(this.treemap.leafItemSettings.labelPath)?h.groupIndex===n.length-1:h.groupIndex===this.treemap.levels.length),s?(l=o/a*e[d].weight/i.height,r<=i.width&&(e[d].rect=new W(r+i.x,i.y,l,i.height))):(l=o/a*e[d].weight/i.width,r<=i.height&&(e[d].rect=new W(i.x,r+i.y,i.width,l))),r+=l,this.renderItems.push(e[d])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,l,o,n,r,a=this.treemap.leafItemSettings,s=this.treemap.levels,d=ie(e).values;if(d&&d.length>0&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(d)),this.calculateChildrenLayout(e,d,t),this.treemap.levels.length>0))for(var h=0;h<d.length;h++)o=(l=d[h]).groupIndex,i=l.rect,n=(l.isLeafItem?a.padding:s[o].groupPadding)/2,r=this.treemap.isHierarchicalData?0===o&&l.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+n,i.y+(r+n),i.width-n,i.height-n),!l.isLeafItem&&l.weight>0&&this.computeSquarifyDimensional(d[h],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,se(i)),t.sort(Fe),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,l){var o=e.length;if(0===o){var n=this.getCoordinates(t,i);return m=l.concat(n)}var r=de(i),a=e[0],s=e.slice(1,o);if(this.aspectRatio(t,a,r)){var d=t.concat(a);return this.performRowsLayout(s,d,i,l)}for(var h=t.length,p=0,g=0;g<h;g+=1)p+=t[g].itemArea;var c=this.cutArea(i,p),m=(n=this.getCoordinates(t,i),l.concat(n));return this.performRowsLayout(e,[],c,m)},e.prototype.aspectRatio=function(e,t,i){if(0===e.length)return!0;var l=e.concat(t);return this.findMaxAspectRatio(e,i)>=this.findMaxAspectRatio(l,i)},e.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,l=1/0,o=-1/0,n=0,r=0;r<i;r+=1){var a=e[r].itemArea;a<l&&(l=a),a>o&&(o=a),n+=a}return Math.max(Math.pow(t,2)*o/Math.pow(n,2),Math.pow(n,2)/(Math.pow(t,2)*l))},e.prototype.cutArea=function(e,t){var i=he(e),l=i.width,o=i.height,n=i.x,r=i.y;if(l>=o){var a=t/o;return pe({x:n+a,y:r,width:l-a,height:o})}var s=t/l;return pe({x:n,y:r+s,width:l,height:o-s})},e.prototype.getCoordinates=function(e,i){for(var l,o=he(i),n=o.width,r=o.height,a=o.x,s=o.y,d=e.length,h=this.treemap.levels,p=this.treemap.leafItemSettings,g=0,c=0;c<d;c+=1)g+=e[c].itemArea;var m,u,f,y=g/r,v=g/n,S=a,x=s,b=[];for(c=0;c<d;c+=1){var I=e[c];if(l=I.groupIndex,I.isLeafItem=0===h.length||(this.treemap.isHierarchicalData||!(0,t.isNullOrUndefined)(p.labelPath))&&l===h.length,f=(u=Re(this.parentData[0],I))?this.treemap.areaRect:I.parent.rect,m=I.isLeafItem?p.padding:h[l].groupPadding,n>=r){var C=x+I.itemArea/y;I.rect={x:S,y:x,width:S+y,height:C},x=C}else{var F=S+I.itemArea/v;I.rect={x:S,y:x,width:F,height:x+v},S=F}I.weight>0&&(u||Math.round(i.y+m/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+m/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(I),b.push(I))}return b},e.prototype.computeTotalArea=function(e,t){for(var i=e.length,l=[],o=0;o<i;o+=1){for(var n=e.length,r=0,a=0;a<n;a+=1)r+=e[a].weight;for(var s=t/r,d=void 0,h=0;h<n;h++)(d=e[h]).itemArea=d.weight*s,l.push(d)}return l},e.prototype.onDemandProcess=function(e){var i,l;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],l=(0,t.extend)({},this.treemap.areaRect,l,!1),(0,t.isNullOrUndefined)(this.treemap.treeMapLegendModule)||(0,t.isNullOrUndefined)(this.treemap.totalRect)||(l=this.treemap.totalRect);for(var n=this.treemap.levels.length,r=0;r<n;r++){n===e[0].groupIndex?this.treemap.levels[n]=this.treemap.levels[r]:this.treemap.levels.splice(n-1,1)}this.calculateLayoutItems(o,l),this.renderLayoutItems()},e.prototype.renderLayoutItems=function(){var e,i,l,o,n,r=this,a=this.treemap;this.renderer=a.renderer;var d,h,p,g,c,m,u,f,y,v,S,x,b,I,C,F=a.element.id,w=a.layoutType,O=this.treemap.leafItemSettings.interSectAction,L="",T=document.getElementById(a.element.id+"_Secondary_Element"),M=a.levels;this.layoutGroup=this.renderer.createGroup({id:F+"_TreeMap_"+w+"_Layout"});var N=(0,t.createElement)("div",{id:a.element.id+"_Label_Template_Group",className:"template"});N.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,D=!1,P=a.leafItemSettings,B=function(w){if(m=z.renderItems[w],d=m.groupIndex,z.treemap.drillDownView&&(0,t.isNullOrUndefined)(z.treemap.currentLevel)&&d>0||z.treemap.drillDownView&&d>z.treemap.currentLevel+1)return"continue";p=m.rect,D=m.isLeafItem,y=F+"_Level_Index_"+d+"_Item_Index_"+w,b=z.renderer.createGroup({id:y+"_Group"}),S=(D?P.gap:M[d].groupGap)/2;var B,H=z.treemap.totalRect?a.legendSettings.visible?z.treemap.totalRect:he(z.treemap.totalRect):z.treemap.areaRect;if("Squarified"===a.layoutType&&(p.width=Math.abs(p.x-p.width)-S,p.height=Math.abs(p.y-p.height)-S),"TopRightBottomLeft"===a.renderDirection?p.x=H.x+H.width-p.width-Math.abs(H.x-p.x):"BottomLeftTopRight"===a.renderDirection?p.y=H.y+H.height-p.height-Math.abs(H.y-p.y):"BottomRightTopLeft"===a.renderDirection&&(p.x=H.x+H.width-p.width-Math.abs(H.x-p.x),p.y=H.y+H.height-p.height-Math.abs(H.y-p.y)),l=z.getItemColor(D,m),c=l.fill,f=l.opacity,g=D?P.labelFormat:M[d].headerFormat,i=D?P.showLabels:M[d].showHeader,d===z.treemap.currentLevel)if(z.treemap.enableBreadcrumb){E="#"+z.treemap.breadcrumbConnector+"#",B=m.levelOrderName.replace(/#/gi,E),B=0!==d?"#"+B:B}else B=m.name;else z.treemap.enableBreadcrumb&&(m.isDrilled=!1),B=m.name;u=Me(g,m.data,z.treemap)||B||"undefined",_=ie(m).values,u=!D&&_&&_.length>0&&z.treemap.enableDrillDown?m.isDrilled?a.enableRtl?u+" [-]":"[-] "+u:a.enableRtl?u+" [+]":"[+] "+u:u,a.enableHtmlSanitizer&&(u=t.SanitizeHtmlHelper.sanitize(u));var R=D?P.labelStyle.fontFamily:M[d].headerStyle.fontFamily;R=R||z.treemap.themeStyle.labelFontFamily;var U=D?P.labelStyle.size:M[d].headerStyle.size;U=U||z.treemap.themeStyle.labelFontSize;var k=D?P.labelStyle.fontWeight:M[d].headerStyle.fontWeight;k=k||z.treemap.themeStyle.fontWeight;var A=D?P.labelStyle.color:M[d].headerStyle.color,W=D?P.labelStyle.fontStyle:M[d].headerStyle.fontStyle,j=D?P.labelStyle.opacity:M[d].headerStyle.opacity;x={fontFamily:R,size:U,fontWeight:k,color:A,fontStyle:W,opacity:j},C=D?P.border:M[d].border,e=D?P.labelPosition:"Near"===M[d].headerAlignment?"TopLeft":"Center"===M[d].headerAlignment?"TopCenter":"TopRight",h=D?P.templatePosition:M[d].templatePosition,I=D?P.labelTemplate:M[d].headerTemplate,m.options={border:C,opacity:f,fill:c},o={cancel:!1,name:s,treemap:z.treemap,text:u,currentItem:m,RenderItems:z.renderItems,options:m.options,textColor:x.color},z.treemap.trigger(s,o,(function(l){if(!l.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",n=new V(y+"_RectPath",c,C.width,C.color,f,null,L);var a=r.renderer.drawPath(n);b.appendChild(a),i&&(o.text!==u&&(o.text=Me(o.text,m.data,r.treemap)||B),x.color=o.textColor?o.textColor:x.color,r.renderItemText(o.text.toString(),b,x,p,O,y,c,e,E)),I&&(v=r.renderTemplate(T,y,p,h,I,m,D),(0,t.isNullOrUndefined)(v)||(N.appendChild(v),r.treemap.renderReactTemplates())),b.setAttribute("aria-label",m.name),r.treemap.enableDrillDown&&!D||r.treemap.selectionSettings.enable||r.treemap.highlightSettings.enable?(b.setAttribute("role","button"),b.setAttribute("tabindex",r.treemap.tabIndex.toString()),b.style.outline="none",b.style.cursor=r.treemap.highlightSettings.enable&&!r.treemap.selectionSettings.enable&&r.treemap.enableDrillDown&&m.groupIndex===r.treemap.levels.length-1?"default":!r.treemap.highlightSettings.enable||r.treemap.selectionSettings.enable||r.treemap.enableDrillDown?"pointer":"default"):b.setAttribute("role","region"),we(r.treemap,b,"treeMapSelection"),r.layoutGroup.appendChild(b)}}))},z=this,H=0;H<this.renderItems.length;H++)B(H);N.childNodes.length>0&&T.appendChild(N),this.treemap.svgObject.appendChild(this.layoutGroup),we(this.treemap,this.layoutGroup,"treeMapSelection")},e.prototype.renderItemText=function(e,i,l,o,n,r,a,s,d){var h,p,g,c,m=[],u=0;if(p=-1!==e.indexOf("<br>")?e.split("<br>"):null,g=this.labelInterSectAction(o,e,l,n),h=G(p&&p[0]||g[0],l),this.treemap.enableRtl){var f=G(e,l),y=e.search("[+]")||e.search("[-]");if(o.width<f.width&&y>0){var v=e.substring(y-1,e.length),S=G("[+]",l);g[0]=X(o.width-S.width-5,g[0],l)+v}}var x=re(o,s,h,"Text",this.treemap);if(!(0,t.isNullOrUndefined)(p)){for(var b=[],I=null,C=[],F=0;F<p.length;F++)u+=(h=G(I=X(o.width-5,p[F],l),l)).height,C.push(h.width),b.push(I);g=b,h.width=Math.max.apply(null,C),h.height=u}if("WrapByWord"===n||"Wrap"===n||"Trim"===n){for(var w=0;w<g.length;w++)u+=(h=G(g[w],l)).height,o.height-5>u&&m.push(g[w]);if("Wrap"===n&&g.length!==m.length&&m.length){var O=m.length-1,L=m[O];L=L.substring(0,L.length-1)+"...",m.splice(O),"..."!==L&&m.push(L)}}else c=g,m.push(c);Q(new q(r+"_Text",x.x,x.y,"start",m,"","",d),l,l.color||this.getSaturatedColor(a),i)},e.prototype.getItemColor=function(e,i){var l=this.treemap,o=e?l.leafItemSettings.fill:l.levels[i.groupIndex].fill,n=e?l.leafItemSettings.opacity:l.levels[i.groupIndex].opacity;(0,t.isNullOrUndefined)(l.treemapLevelData.defaultLevelsData)||l.treemapLevelData.defaultLevelsData.length>0&&(l.treemapLevelData.levelsData=l.treemapLevelData.defaultLevelsData);var r=ie(l.treemapLevelData.levelsData[0]).values,a=e?l.leafItemSettings.colorMapping:l.levels[i.groupIndex].colorMapping;if(a.length>0){var s=ce(a,i.data[l.equalColorValuePath],i.data[l.rangeColorValuePath]);(0,t.isNullOrUndefined)(s)||(o=(0,t.isNullOrUndefined)(s.fill)?l.leafItemSettings.fill:s.fill,n=s.opacity)}else for(var d=0;d<r.length;d++)r[d].levelOrderName===i.levelOrderName.split("#")[0]&&(o=(0,t.isNullOrUndefined)(o)?(0,t.isNullOrUndefined)(l.colorValuePath)?(0,t.isNullOrUndefined)(i.options)?!(0,t.isNullOrUndefined)(l.palette)&&l.palette.length>0?l.palette[d%l.palette.length]:"#808080":i.options.fill:r[d].data[l.colorValuePath]:o);return{fill:o,opacity:n}},e.prototype.getSaturatedColor=function(e){var t=e,i=Pe(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,l,o,n,r,a){var s,d=a?i+"_LabelTemplate":i+"_HeaderTemplate",h=a?"_LabelTemplate":"_HeaderTemplate";if((0,t.isNullOrUndefined)(n.prototype)&&"string"==typeof n)for(var p=Object.keys(r.data),g=0;g<p.length;g++){var c=RegExp;n=n.replace(new c("{{:"+p[g]+"}}","g"),r.data[p[g].toString()])}if(this.treemap.enableHtmlSanitizer&&"string"==typeof n&&(n=t.SanitizeHtmlHelper.sanitize(n)),!(0,t.isNullOrUndefined)(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var m=re(l,o,ae(s=ne(oe(n)(r.data,this.treemap,n,this.treemap.element.id+h,!1),d,r.data),e),"Template",this.treemap);s.style.left=m.x+"px",s.style.top=m.y+"px"}return s},e.prototype.labelInterSectAction=function(e,t,i,l){var o,n=e.width-10;switch(l){case"Hide":o=[Ce(n,e.height,t,i)];break;case"Trim":o=[X(n+3,t,i)];break;case"WrapByWord":o=be(n,t,i);break;case"Wrap":o=Ie(n,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=r(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:C,legendBorderColor:"#000000",legendBorderWidth:0};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",labelFontFamily:C,fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",titleFontWeight:"Normal",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",titleFontWeight:"Normal",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",titleFontWeight:"Normal",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontWeight:"Normal",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3":t={backgroundColor:"transparent",titleFontColor:"#111827",titleFontWeight:"600",subTitleFontColor:"#111827",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#111827",legendTextColor:"#111827",fontFamily:"Inter",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Inter",fontWeight:"400",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5":t={backgroundColor:"transparent",titleFontColor:"#212529",titleFontWeight:"400",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5dark":t={backgroundColor:"transparent",titleFontColor:"#DEE2E6",titleFontWeight:"400",subTitleFontColor:"#DEE2E6",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#212529",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#DEE2E6",legendTextColor:"#DEE2E6",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",titleFontWeight:"Normal",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",titleFontWeight:"Normal",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"1