-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsmart.3dchart.js
6 lines (4 loc) · 101 KB
/
smart.3dchart.js
1
2
3
4
5
6
/* Smart UI v15.2.0 (2023-04-20)
Copyright (c) 2011-2023 jQWidgets.
License: https://htmlelements.com/license/ */ //
Smart("smart-3d-chart",class extends Smart.BaseElement{static get properties(){return{lightColor:{type:"string",value:"#ffffff"},autoRotate:{type:"boolean",value:!1},autoRotateSpeed:{type:"number",value:1},animationSpeed:{type:"number",value:1},animation:{type:"string",value:""},borderLineColor:{value:null,type:"string?"},borderLineWidth:{value:1,type:"number"},cameraAnimationSpeed:{type:"number",value:1},customModels:{type:"array",value:[]},showConnectionLines:{type:"boolean",value:!1},transitionSpeed:{type:"number",value:1},backgroundColor:{type:"string",value:"#ffffff"},backgroundGradient:{type:"array",value:[]},backgroundTexture:{type:"array",value:[]},backgroundImage:{type:"string",value:""},caption:{type:"string",value:""},colorScheme:{value:"scheme01",type:"string"},cameraPosition:{type:"object",value:{x:{value:5,type:"number"},y:{value:20,type:"number"},z:{value:55,type:"number"}}},messages:{value:{en:{resetCamera:"Reset Camera",cameraMode:"Camera Mode",panMode:"Pan Mode",zoomMode:"Zoom Mode",saveImage:"Save Image",zoomOut:"Zoom Out",zoomIn:"Zoom In",field:"Field",invalidSeries:"smart-chart: Invalid property: each series group must have a 'series' property which must be a valid array.",invalidSeriesGroups:"smart-chart: Invalid property: 'seriesGroups' property is required and must be a valid array.",invalidType:'smart-chart: Invalid serie type "{{type}}".',missingReference:"smart-chart: Missing reference to {{files}}.",missingType:"smart-chart: Invalid property: each series group must have a valid 'type' property."}},type:"object",extend:!0},cameraZoom:{type:"number",value:1},controlsSettings:{type:"object",value:{enablePan:{type:"boolean",value:!0},enableZoom:{type:"boolean",value:!0},enableRotate:{type:"boolean",value:!0},enableDamping:{type:"boolean",value:!0},dampingFactor:{type:"number",value:.15}}},selectMode:{type:"string",value:"multiple",allowedValues:["none","one","multiple"]},legendLayout:{value:{flow:{value:"horizontal",allowedValues:["horizontal","vertical"],type:"string"},height:{value:null,type:"number?"},left:{value:null,type:"number?"},top:{value:null,type:"number?"},width:{value:null,type:"number?"}},type:"object?"},legendIndex:{value:"auto",allowedValues:["auto","group","serie"],type:"string"},seriesGroups:{value:[],type:"any",reflectToAttribute:!1},dataSource:{value:[],type:"object",reflectToAttribute:!1},description:{type:"string",value:"Description"},greyScale:{type:"boolean",value:!1},showBorderLine:{type:"boolean",value:!0},showLegend:{type:"boolean",value:!0},showLegendTable:{type:"boolean",value:!1},showToolTips:{type:"boolean",value:!0},toolTipFormatFunction:{value:null,type:"function?"},toolTipFormatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},toolTipLineColor:{value:null,type:"string?"},gridOptions:{value:{dynamicWidth:{value:!1,type:"boolean"},slotWidthX:{value:16,type:"number?"},slotWidthZ:{value:16,type:"number?"},height:{value:30,type:"number"},width:{value:90,type:"number"},lineColor:{value:"#808080",type:"string?"},orientation:{value:"vertical",type:"string",allowedValues:["vertical","horizontal"]}},type:"object",reflectToAttribute:!1},xAxis:{value:{alternatingBackgroundColor:{value:"",type:"string"},alternatingBackgroundColor2:{value:"",type:"string"},alternatingBackgroundOpacity:{value:1,type:"number"},axisSize:{value:null,type:"any"},bands:{value:null,type:"array?"},baseUnit:{value:null,allowedValues:["year","month","day","hour","minute","second","millisecond",null],type:"string?"},customDraw:{value:!1,type:"boolean"},dataField:{value:"",type:"string"},dateFormat:{value:null,type:"string?"},displayText:{value:null,type:"string?"},flip:{value:!1,type:"boolean"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},gridLines:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},formatFunction:{value:null,type:"function?"},lineWidth:{value:1,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},labels:{value:{angle:{value:0,type:"number"},autoRotate:{value:!1,type:"boolean"},class:{value:null,type:"string?"},custom:{value:null,type:"array?"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},offset:{value:{x:{value:0,type:"number"},y:{value:0,type:"number"}},type:"object"},rotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"any"}},type:"object"},line:{value:{color:{value:"",type:"string"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},visible:{value:!0,type:"any"}},type:"object"},logarithmicScale:{value:!1,type:"boolean"},logarithmicScaleBase:{value:10,type:"number"},maxValue:{value:NaN,type:"any"},minValue:{value:NaN,type:"any"},position:{value:"bottom",allowedValues:["bottom","top","left","right"],type:"string"},rangeSelector:{value:{backgroundColor:{value:null,type:"string?"},backgroundImage:{value:"",type:"string"},baseUnit:{value:null,allowedValues:["year","month","day","hour","minute","second","millisecond",null],type:"string?"},borderLineColor:{value:null,type:"string?"},borderLineWidth:{value:null,type:"number?"},caption:{value:"",type:"string"},colorScheme:{value:null,type:"string?"},columnSeriesOverlap:{value:!1,type:"boolean"},dynamic:{value:!1,type:"boolean"},columnsGapPercent:{value:25,type:"number"},dataField:{value:null,type:"string?"},description:{value:"",type:"string"},greyScale:{value:null,type:"boolean?"},gridLines:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},labels:{value:{angle:{value:0,type:"number"},autoRotate:{value:!1,type:"boolean"},class:{value:null,type:"string?"},custom:{value:null,type:"array?"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},offset:{value:{x:{value:0,type:"number"},y:{value:0,type:"number"}},type:"object"},rotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"any"}},type:"object"},maxValue:{value:150,type:"any"},minValue:{value:50,type:"any"},padding:{value:{bottom:{value:0,type:"number"},left:{value:0,type:"number"},right:{value:0,type:"number"},top:{value:0,type:"number"}},type:"object"},position:{value:null,allowedValues:["bottom","top","left","right"],type:"string?"},renderTo:{value:null,type:"any"},rightToLeft:{value:null,type:"boolean?"},seriesGapPercent:{value:10,type:"number"},seriesGroups:{value:null,type:"array?"},serieType:{value:"area",type:"string"},showBorderLine:{value:null,type:"boolean?"},size:{value:null,type:"number?"},skipOverlappingPoints:{value:!0,type:"boolean"},titlePadding:{value:{bottom:{value:10,type:"number"},left:{value:5,type:"number"},right:{value:5,type:"number"},top:{value:5,type:"number"}},type:"object"},visible:{value:!1,type:"boolean"}},type:"object"},textRotationAngle:{value:null,type:"number?"},textRotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},tickMarks:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},size:{value:4,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},title:{value:{class:{value:null,type:"string?"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},text:{value:"",type:"string"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"boolean"}},type:"object"},type:{value:"auto",allowedValues:["auto","date","basic","linear"],type:"string"},unitInterval:{value:null,type:"number?"},valuesOnTicks:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"}},type:"object",reflectToAttribute:!1},zAxis:{value:{alternatingBackgroundColor:{value:"",type:"string"},alternatingBackgroundColor2:{value:"",type:"string"},alternatingBackgroundOpacity:{value:1,type:"number"},axisSize:{value:null,type:"any"},bands:{value:null,type:"array?"},baseUnit:{value:null,allowedValues:["year","month","day","hour","minute","second","millisecond",null],type:"string?"},customDraw:{value:!1,type:"boolean"},dataField:{value:"",type:"string"},dateFormat:{value:null,type:"string?"},displayText:{value:null,type:"string?"},flip:{value:!1,type:"boolean"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},gridLines:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},labels:{value:{angle:{value:0,type:"number"},autoRotate:{value:!1,type:"boolean"},class:{value:null,type:"string?"},custom:{value:null,type:"array?"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},offset:{value:{x:{value:0,type:"number"},y:{value:0,type:"number"}},type:"object"},rotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"any"}},type:"object"},line:{value:{color:{value:"",type:"string"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},visible:{value:!0,type:"any"}},type:"object"},logarithmicScale:{value:!1,type:"boolean"},logarithmicScaleBase:{value:10,type:"number"},maxValue:{value:NaN,type:"any"},minValue:{value:NaN,type:"any"},position:{value:"bottom",allowedValues:["bottom","top","left","right"],type:"string"},textRotationAngle:{value:null,type:"number?"},textRotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},tickMarks:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},size:{value:4,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},title:{value:{class:{value:null,type:"string?"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},text:{value:"",type:"string"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"boolean"}},type:"object"},type:{value:"auto",allowedValues:["auto","date","basic","linear"],type:"string"},unitInterval:{value:null,type:"number?"},valuesOnTicks:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"}},type:"object",reflectToAttribute:!1},valueAxis:{value:{bands:{value:null,type:"array?"},baselineValue:{value:null,type:"any"},customDraw:{value:!1,type:"boolean"},displayText:{value:null,type:"string?"},flip:{value:!1,type:"boolean"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},gridLines:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},labels:{value:{angle:{value:0,type:"number"},autoRotate:{value:!1,type:"boolean"},class:{value:null,type:"string?"},custom:{value:null,type:"array?"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},offset:{value:{x:{value:0,type:"number"},y:{value:0,type:"number"}},type:"object"},rotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"any"}},type:"object"},line:{value:{color:{value:"",type:"string"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},visible:{value:!0,type:"any"}},type:"object"},logarithmicScale:{value:!1,type:"boolean"},logarithmicScaleBase:{value:10,type:"number"},maxValue:{value:NaN,type:"any"},minValue:{value:NaN,type:"any"},position:{value:"left",allowedValues:["left","right","top","bottom"],type:"string"},textRotationAngle:{value:null,type:"number?"},textRotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},tickMarks:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},size:{value:4,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},title:{value:{class:{value:null,type:"string?"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},text:{value:"",type:"string"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"boolean"}},type:"object"},unitInterval:{value:10,type:"number?"},valuesOnTicks:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"}},type:"object"},enableControlsToolbar:{value:!0,type:"boolean"},controlsToolbarItems:{value:["reset-camera","zoom-in","zoom-out","save-image","camera-control"],reflectToAttribute:!1,type:"array"}}}static get listeners(){return{click:"_clickHandler",down:"_downMoveHandler",mouseleave:"_mouseleaveHandler",move:"_moveHandler",resize:"_resizeHandler","document.move":"_downMoveHandler","document.up":"_documentUpHandler",mousedown:"_documentUpHandler",mouseover:"_mouseoverHandler"}}static get requires(){return{"Smart.DropDownList":"smart.dropdownlist.js","Smart.Tooltip":"smart.tooltip.js"}}static get styleUrls(){return["smart.3dchart.css"]}_setDefaults(){const e=this;e._hiddenIndexes=[],e._inMotionQueue=[],e._inTransitionQueue=[],e._hiddenIndexes=[],e._scaledLabels=[],e._seriesData=[],e._chartObjects=[],e._startPoints=[],e._labels=[],e._rangeSelector={},e._grid=null,e._drawComplete=!1,e.colorSchemes=[{name:"scheme01",colors:["#307DD7","#AA4643","#89A54E","#71588F","#4198AF"]},{name:"scheme02",colors:["#7FD13B","#EA157A","#FEB80A","#00ADDC","#738AC8"]},{name:"scheme03",colors:["#E8601A","#FF9639","#F5BD6A","#599994","#115D6E"]},{name:"scheme04",colors:["#D02841","#FF7C41","#FFC051","#5B5F4D","#364651"]},{name:"scheme05",colors:["#25A0DA","#309B46","#8EBC00","#FF7515","#FFAE00"]},{name:"scheme06",colors:["#0A3A4A","#196674","#33A6B2","#9AC836","#D0E64B"]},{name:"scheme07",colors:["#CC6B32","#FFAB48","#FFE7AD","#A7C9AE","#888A63"]},{name:"scheme08",colors:["#3F3943","#01A2A6","#29D9C2","#BDF271","#FFFFA6"]},{name:"scheme09",colors:["#1B2B32","#37646F","#A3ABAF","#E1E7E8","#B22E2F"]},{name:"scheme10",colors:["#5A4B53","#9C3C58","#DE2B5B","#D86A41","#D2A825"]},{name:"scheme11",colors:["#993144","#FFA257","#CCA56A","#ADA072","#949681"]},{name:"scheme12",colors:["#105B63","#EEEAC5","#FFD34E","#DB9E36","#BD4932"]},{name:"scheme13",colors:["#BBEBBC","#F0EE94","#F5C465","#FA7642","#FF1E54"]},{name:"scheme14",colors:["#60573E","#F2EEAC","#BFA575","#A63841","#BFB8A3"]},{name:"scheme15",colors:["#444546","#FFBB6E","#F28D00","#D94F00","#7F203B"]},{name:"scheme16",colors:["#583C39","#674E49","#948658","#F0E99A","#564E49"]},{name:"scheme17",colors:["#142D58","#447F6E","#E1B65B","#C8782A","#9E3E17"]},{name:"scheme18",colors:["#4D2B1F","#635D61","#7992A2","#97BFD5","#BFDCF5"]},{name:"scheme19",colors:["#844341","#D5CC92","#BBA146","#897B26","#55591C"]},{name:"scheme20",colors:["#56626B","#6C9380","#C0CA55","#F07C6C","#AD5472"]},{name:"scheme21",colors:["#96003A","#FF7347","#FFBC7B","#FF4154","#642223"]},{name:"scheme22",colors:["#5D7359","#E0D697","#D6AA5C","#8C5430","#661C0E"]},{name:"scheme23",colors:["#16193B","#35478C","#4E7AC7","#7FB2F0","#ADD5F7"]},{name:"scheme24",colors:["#7B1A25","#BF5322","#9DA860","#CEA457","#B67818"]},{name:"scheme25",colors:["#0081DA","#3AAFFF","#99C900","#FFEB3D","#309B46"]},{name:"scheme26",colors:["#0069A5","#0098EE","#7BD2F6","#FFB800","#FF6800"]},{name:"scheme27",colors:["#FF6800","#A0A700","#FF8D00","#678900","#0069A5"]},{name:"scheme28",colors:["#3A43BA","#281E5D","#48AAAD","#0492C2","#1E456E","#59788D","#52B2C0","#82EDFD"]},{name:"scheme29",colors:["#003F5C","#BC5090","#58508D","#FF6361","#FFA600"]},{name:"scheme30",colors:["#16736F","#A2D56A","#1C515C","#62B773","#EEEF63","#1F313F","#309577"]},{name:"scheme31",colors:["#74CC66","#191A4D","#2D867A","#EEE3CD","#224D19","#0D261B","#5771C7","#B6D7E7","#206052","#6B5724","#C3AF4B","#603620","#536722","#B6E7B9","#34819D","#94ACDB"]},{name:"scheme32",colors:["#87C5FF","#5B5B60","#9BE076","#F7A384","#7479D3","#F13A80","#E4D388","#2BC6B2","#F45B14"]}],e._seriesTypes=["line","stackedline","stackedline100","spline","stackedspline","stackedspline100","stepline","stackedstepline","stackedstepline100","area","stackedarea","stackedarea100","splinearea","stackedsplinearea","stackedsplinearea100","steparea","stackedsteparea","stackedsteparea100","rangearea","splinerangearea","steprangearea","column","stackedcolumn","stackedcolumn100","rangecolumn","bar","stackedbar","stackedbar100","rangebar","scatter","stackedscatter","stackedscatter100","bubble","stackedbubble","stackedbubble100","pie","donut","candlestick","ohlc","waterfall","stackedwaterfall"],e._seriesGridTypes=e._seriesTypes.filter((e=>!["pie","donut","pyramid","funnel"].includes(e)))}template(){return'<div class="smart-3d-chart-controls"></div> <div class="smart-3d-chart-container"><div class="smart-3d-chart-tooltip"></div></div> <div class="smart-3d-chart-footer"></div>'}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const r="xAxis_rangeSelector_minValue"===e||"xAxis_rangeSelector_maxValue"===e,n="controlsToolbarItems"===e||"enableControlsToolbar"===e;this.refresh(!1,r,n)}refresh(e=!1,t=!1){this._internalRefresh(e,t)}update(){this._internalRefresh()}_internalRefresh(e=!1,t=!1,a=!1){const r=this;let n;r.$.fireEvent("refreshStart",{}),e||(r._drawComplete=!0),r._camera&&(n=r._camera.position),(a||e)&&r._setControls(),t||(r._setCaption(),r._setLegendTable(),r._setScene(),r._buildSource()),r._setChart(),t||(r._rangeSelector.rangeSelector||r._setRangeSelector(),r._chartResize(r)),e&&r._rangeSelector.rangeSelector&&r._setRangeValues(),n&&r._camera.position.set(n.x,n.y,n.z),r.$.fireEvent("refreshEnd",{})}_setLegendTable(){const e=this;if(e.querySelector(".smart-3d-chart-legend-table")&&e.querySelector(".smart-3d-chart-legend-table").parentNode.removeChild(e.querySelector(".smart-3d-chart-legend-table")),e.showLegendTable){const t=e._getAxisLabels();let a=e._createLegendTable("column",t);a.style.width="100%",e.querySelector(".smart-3d-chart-footer").appendChild(a)}}_setRangeSelector(){const e=this;if(e.querySelector(".smart-3d-chart-range-selector")&&e.querySelector(".smart-3d-chart-range-selector").parentNode.removeChild(e.querySelector(".smart-3d-chart-range-selector")),e.xAxis.rangeSelector.visible){const t=e._getAxisLabels();let a=e._createRangeSelector(t);e.querySelector(".smart-3d-chart-footer").appendChild(a),e._updateResizeHandlers()}}_getRangeChartCoordinates(){const e=this;let t=e._getObjectsByIndexes(0,0).map((e=>{const t=e.userData;return{xAxisValue:t.xAxisField,value:t.value,itemIndex:t.itemIndex,serieIndex:t.serieIndex,groupIndex:t.groupIndex}}));e._rangeSelector.dataPoints=t;const a=e._grid.userData.gridProps.maxValue,r=[];return t.forEach((e=>{r.push({x:e.itemIndex/(t.length-1)*100,y:100-e.value/a*100,xAxisValue:e.xAxisValue})})),r}_initDragElement(e,t){const a=this;var r=0,n=0;function i(i){(i=i||window.event).preventDefault(),r=n-i.clientX,n=i.clientX;let o=t.getBoundingClientRect(),l=e.getBoundingClientRect();l.left-r>o.left&&l.right-r<o.right&&(e.style.left=e.offsetLeft-r+"px",e.classList.contains("smart-3d-chart-range-selector-rect")?a._updateResizeHandlers():a._updateDragRectangle(),a.xAxis.rangeSelector.dynamic&&(clearTimeout(a.dragTimeout),a.dragTimeout=setTimeout((()=>{a._updateRange()}),20)))}function o(){document.onmouseup=null,document.onmousemove=null,a._updateRange()}e.onmousedown=function(e){(e=e||window.event).preventDefault(),n=e.clientX,document.onmousemove=i,document.onmouseup=o}}_setRangeValues(e=!0){const t=this,a=t.xAxis.minValue||t._rangeSelector.dataPoints[0].xAxisValue,r=t.xAxis.maxValue||t._rangeSelector.dataPoints[t._rangeSelector.dataPoints.length-1].xAxisValue;t._rangeSelector.minIndex=t._rangeSelector.dataPoints.findIndex((e=>e.xAxisValue===a)),t._rangeSelector.maxIndex=t._rangeSelector.dataPoints.findIndex((e=>e.xAxisValue===r));const n=t._rangeSelector.rangeSelector.getBoundingClientRect();t._rangeSelector.sliders[0].style.left=t._rangeSelector.minIndex/(t._rangeSelector.dataPoints.length-1)*n.width+"px",t._rangeSelector.sliders[1].style.left=t._rangeSelector.maxIndex/(t._rangeSelector.dataPoints.length-1)*n.width+"px",t._updateDragRectangle(),e&&t.update()}_updateRange(){const e=this,t=e._rangeSelector.rangeSelector.getBoundingClientRect(),a=e._rangeSelector.rangeSelectorRect.getBoundingClientRect(),r=(a.left-t.left)/t.width,n=(a.left-t.left+a.width)/t.width,i=e._rangeSelector.dataPoints[Math.round(r*(e._rangeSelector.dataPoints.length-1))].xAxisValue,o=e._rangeSelector.dataPoints[Math.round(n*(e._rangeSelector.dataPoints.length-1))].xAxisValue;e.$.fireEvent("rangeSelectionChanging",{minValue:i,maxValue:o,oldMinValue:e.xAxis.minValue,oldMaxValue:e.xAxis.maxValue}).defaultPrevented?e._setRangeValues(!1):(e._rangeSelector.minIndex=Math.round(r*(e._rangeSelector.dataPoints.length-1)),e._rangeSelector.maxIndex=Math.round(n*(e._rangeSelector.dataPoints.length-1)),e.xAxis.minValue=e._rangeSelector.dataPoints[Math.round(r*(e._rangeSelector.dataPoints.length-1))].xAxisValue,e.xAxis.maxValue=e._rangeSelector.dataPoints[Math.round(n*(e._rangeSelector.dataPoints.length-1))].xAxisValue,e.$.fireEvent("rangeSelectionChanged",{minValue:e.xAxis.minValue,maxValue:e.xAxis.maxValue}),e.update())}_updateDragRectangle(){const e=this._rangeSelector.rangeSelectorRect,t=this._rangeSelector.sliders,a=parseFloat(t[0].style.left)>parseFloat(t[1].style.left)?t[1]:t[0],r=parseFloat(t[0].style.left)>parseFloat(t[1].style.left)?t[0]:t[1];e.style.left=a.style.left,e.style.width=parseFloat(r.style.left)-parseFloat(a.style.left)+"px"}_initResizeElement(e,t){const a=this,r=document.createElement("div");r.classList.add("smart-3d-chart-range-selector-slider");const n=document.createElement("div");n.classList.add("smart-3d-chart-range-selector-slider"),t.appendChild(r),t.appendChild(n),a._rangeSelector.sliders=[r,n],a._initDragElement(r,t),a._initDragElement(n,t)}_updateResizeHandlers(){const e=this,t=e._rangeSelector.rangeSelectorRect,a=t.getBoundingClientRect();e._rangeSelector.sliders[0].style.left=t.style.left,e._rangeSelector.sliders[1].style.left=parseFloat(t.style.left)+a.width+"px"}_createRangeSelector(){const e=this,t=document.createElement("div");t.classList.add("smart-3d-chart-range-selector-container"),t.style.height="70px",t.style.width="95%",t.style.margin="10px auto";const a=document.createElement("div");a.classList.add("smart-3d-chart-range-selector"),t.appendChild(a),e._rangeSelector.rangeSelector=a;const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("viewBox","0 0 100 100"),r.setAttribute("preserveAspectRatio","none");const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width","100%"),n.setAttribute("height","20%"),r.setAttribute("viewBox","0 0 100 100"),r.setAttribute("preserveAspectRatio","none"),n.style.overflow="visible";const i=document.createElementNS("http://www.w3.org/2000/svg","polygon"),o=e._getRangeChartCoordinates();let l="";l+="0,100 ",o.forEach((e=>{l+=`${e.x},${e.y} `})),l+="100,100",i.setAttribute("points",l);let s=e.xAxis.rangeSelector.color||e._getColorFromScheme(e.colorScheme,0),d=e.xAxis.rangeSelector.opacity||.8;i.setAttribute("fill",s),i.setAttribute("opacity",d),r.appendChild(i),a.appendChild(r);let u=e.xAxis.rangeSelector.labels.step||Math.round(o.length/20);for(let e=0;e<o.length;e+=u){const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("x",o[e].x+.2+"%"),t.setAttribute("y","10"),t.setAttribute("font-size","10px"),t.setAttribute("fill","gray"),t.setAttribute("text-anchor","middle"),t.setAttribute("alignment-baseline","middle"),t.innerHTML=o[e].xAxisValue,n.appendChild(t);const a=document.createElementNS("http://www.w3.org/2000/svg","line");a.setAttribute("x1",o[e].x+.2+"%"),a.setAttribute("y1","0"),a.setAttribute("x2",o[e].x+.2+"%"),a.setAttribute("y2","2"),a.setAttribute("stroke","gray"),a.setAttribute("stroke-width","1"),a.style.position="absolute",n.appendChild(a)}t.appendChild(n);const c=document.createElement("div");return c.classList.add("smart-3d-chart-range-selector-rect"),c.style.left="0px",e._rangeSelector.rangeSelectorRect=c,a.appendChild(c),e._initDragElement(c,a),e._initResizeElement(c,a),t}ready(){super.ready()}beginUpdate(){this._updating=!0}endUpdate(e=!1){const t=this;t._updating=!1,e?t.refresh():t._setChart()}setCameraPosition(e,t,a,r=!0){const n=this;r?n._inMotionQueue.push({obj:n._camera,target:{x:e,y:t,z:a},type:"camera"}):n._camera.position.set(e,t,a)}setCameraZoom(e,t=!0){const a=this,r=a._camera.position,n={x:r.x/e,y:r.y/e,z:r.z/e};t?a.setCameraPosition(n.x,n.y,n.z):a._camera.position.set(n.x,n.y,n.z)}saveAsJPEG(e="chart",t=!0,a=!0){this._saveAsImage(e,"jpeg",t,a)}saveAsPNG(e="chart",t=!0,a=!0){this._saveAsImage(e,"png",t,a)}saveAsPDF(e="chart",t=!0,a=!0){this._saveAsImage(e,"pdf",t,a)}_saveAsImage(e,t,a,r){const n=this,i=n.querySelector(".smart-3d-chart-legend"),o=n.querySelector(".smart-3d-chart-caption");if(!a&&i&&(i.style.display="none"),!r&&o&&(o.style.display="none"),"undefined"!=typeof html2canvas){const a=n.querySelector(".smart-3d-chart-container").getBoundingClientRect();html2canvas(n.querySelector(".smart-3d-chart-container"),{allowTaint:!0,useCORS:!0,logging:!1,width:a.width,height:a.height}).then((function(a){let r;if("jpeg"===t&&(r=a.toDataURL("image/jpeg")),"png"===t&&(r=a.toDataURL("image/png")),"pdf"===t){r=a.toDataURL("application/jpeg");const t={content:{image:r,width:Math.min(a.width/1.35,515)},pageOrientation:"portait"};try{pdfMake.createPdf(t).download(e)}catch(e){n.error(n.localize("missingReference",{files:"pdfmake.min.js"}))}}if(r&&"pdf"!==t){const a=document.createElement("a");a.download=e+"."+t,a.href=r,a.click()}}))}else{const a=n.querySelector("canvas");if(a){let r;if("jpeg"===t&&(r=a.toDataURL("image/jpeg")),"png"===t&&(r=a.toDataURL("image/png")),"pdf"===t){r=a.toDataURL("application/jpeg");const t={content:{image:r,width:Math.min(a.width/1.35,515)},pageOrientation:"portait"};try{pdfMake.createPdf(t).download(e)}catch(e){n.error(n.localize("missingReference",{files:"pdfmake.min.js"}))}}r&&"pdf"!==t&&(document.createElement("a").download=e+"."+t)}}!a&&i&&(i.style.display="block"),!r&&o&&(o.style.display="block")}_getLabelPoint(e,t=0,a=1.5){const r=new window.THREE.Vector3;return e.geometry.computeBoundingBox(),e.geometry.boundingBox.getCenter(r),r.x*=t,r.y+=a,r.z*=t,r}_createDonutSlice(e,t={x:0,y:0,z:0}){const a={curveItems:32,steps:1,curveSegments:32,depth:e.height,bevelEnabled:!1},r=new window.THREE.MeshLambertMaterial({color:e.color,transparent:!0,opacity:e.opacity});let n=new window.THREE.Shape;n.absarc(t.x,t.z,e.radius,e.angleStart,e.angleEnd,!1),n.absarc(t.x,t.z,e.radius-e.width,e.angleEnd,e.angleStart,!0);let i=new window.THREE.ExtrudeGeometry(n,a);return i.rotateX(-Math.PI/2),new window.THREE.Mesh(i,r)}_createPieSlice(e,t={x:0,y:0,z:0}){const a={curveItems:32,steps:1,curveSegments:32,depth:e.height,bevelEnabled:!1},r=new window.THREE.MeshLambertMaterial({color:e.color,transparent:!0,opacity:e.opacity});let n=new window.THREE.Shape;n.moveTo(t.x,t.z),n.absarc(t.x,t.z,e.radius,e.angleStart,e.angleEnd,!1),n.lineTo(t.x,t.z);let i=new window.THREE.ExtrudeGeometry(n,a);return i.rotateX(-Math.PI/2),new window.THREE.Mesh(i,r)}_getItemColor(e,t,a,r,n,i){const o=this.seriesGroups[n],l=o.series[r],s=this._getColorFromScheme(e,t);return o.colorFunction?o.colorFunction(i,a,r,n,s):l.colorFunction?l.colorFunction(i,a,r,n,s):s}_getColorFromScheme(e,t){const a=this;null!=e&&""!==e||(e=this.colorSchemes[0].name);const r=a.colorSchemes.find((t=>t.name===e));if(null==r){const e=a.colorSchemes[0].colors;return e[t%e.length]}{const e=r.colors;return e[t%e.length]}}_clearScene(){const e=this;e._chartObjects.forEach((t=>{t.remove(t.userData.labelObject),e._grid?e._grid.remove(t):e._scene.remove(t)})),e._chartObjects=[],e._grid&&(e._scaledLabels.forEach((t=>{e._grid.remove(t)})),e._scene.remove(e._grid))}_getBaseLog(e,t){return Math.log(t)/Math.log(e)}_getLogValue(e,t){const a=this;return t||(t=a.valueAxis),t.logarithmicScaleBase?a._getBaseLog(t.logarithmicScaleBase,e):Math.log(e)}getValueAxisLabels(){return this.valueAxis._labels}getXAxisLabels(){return this.xAxis._labels}getZAxisLabels(){return this.zAxis._labels}_createCandlestick(e,t,a){const r=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0,opacity:a.opacity}),n=new window.THREE.BoxGeometry(.2,Math.abs(t.high-t.low),.2),i=new window.THREE.Mesh(n,r);i.position.set(e.low.x,e.low.y,e.low.z);const o=new window.THREE.BoxGeometry(.4,Math.abs(t.open-t.close),.4),l=new window.THREE.Mesh(o,r);return l.position.set(0,t.open-(t.high+t.low)/2,0),i.add(l),i}_createOHLC(e,t,a){const r=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0,opacity:a.opacity}),n=.2,i=new window.THREE.BoxGeometry(n,Math.abs(t.high-t.low),n),o=new window.THREE.Mesh(i,r);o.position.set(e.low.x,e.low.y,e.low.z);const l=.4,s=new window.THREE.BoxGeometry(l,.1,.1),d=new window.THREE.Mesh(s,r);d.position.set(l,t.open-(t.high+t.low)/2,0),o.add(d);const u=new window.THREE.BoxGeometry(l,.1,.1),c=new window.THREE.Mesh(u,r);return c.position.set(-.4,t.low-(t.high+t.low)/2,0),o.add(c),o}_createColumn(e,t,a){"number"!=typeof t&&(t=t.to-t.from);const r=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0,opacity:a.opacity}),n=new window.THREE.BoxGeometry(a.width,Math.abs(t),a.depth),i=new window.THREE.Mesh(n,r);if(i.position.set(e.x,e.y+t/2,e.z),a.showOutlineColor){const r=new window.THREE.MeshBasicMaterial({color:a.outlineColor||a.color,transparent:!0,opacity:a.outlineOpacity||a.opacity}),o=new window.THREE.Mesh(n,r);o.position.set(e.x,e.y+t/2,e.z),o.scale.multiplyScalar(1+(a.outlineWidth||.1)),i.add(o)}return i}_createCustomModel(e,t,a,r){const n=this;return(new window.THREE.GLTFLoader).load(e,(function(e){let r=e.scene.children[0];const i=(new window.THREE.Box3).setFromObject(r).getSize(new window.THREE.Vector3);let o=a/i.y;r.scale.set(o,o,o),r.position.set(t.x,t.y,t.z),n._grid.add(r)})),r.opacity=0,this._createColumn(t,a,r)}_createBar(e,t,a){"number"!=typeof t&&(t=t.to-t.from);const r=new window.THREE.CylinderGeometry(a.width,a.width,Math.abs(t),64),n=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0,opacity:a.opacity}),i=new window.THREE.Mesh(r,n);if(i.position.set(e.x,e.y+t/2,e.z),a.showOutlineColor){const n=new window.THREE.MeshBasicMaterial({color:a.outlineColor||a.color,transparent:!0,opacity:a.outlineOpacity||a.opacity}),o=new window.THREE.Mesh(r,n);o.position.set(e.x,e.y+t/2,e.z),o.scale.multiplyScalar(1+(a.outlineWidth||.1)),i.add(o)}return i}_createAreaSlice(e,t,a,r=1){const n=a=>t[a]+(e[a]-t[a])*r,i=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0});let o={curveItems:32,steps:1,depth:a.depth,bevelEnabled:!1},l=new window.THREE.Shape;l.moveTo(t.x,Math.max(t.y,t.bottomY)),l.lineTo(n("x"),Math.max(n("y"),n("bottomY"))),l.lineTo(n("x"),Math.min(n("y"),n("bottomY"))),l.lineTo(t.x,Math.min(t.y,t.bottomY));let s=new window.THREE.ExtrudeGeometry(l,o),d=new window.THREE.Mesh(s,i);return d.position.set(0,0,e.z-a.depth/2),d}_createStepAreaSlice(e,t,a){const r=(a,r=1)=>t[a]+(e[a]-t[a])*r,n=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0});let i={curveItems:32,steps:1,depth:a.depth,bevelEnabled:!1},o=new window.THREE.Shape;o.moveTo(t.x,t.y),o.lineTo(r("x",.5),t.y),o.lineTo(r("x",.5),r("y")),o.lineTo(r("x"),r("y")),o.lineTo(r("x"),r("bottomY")),o.lineTo(r("x",.5)-.5,r("bottomY")),o.lineTo(r("x",.5)-.5,t.bottomY),o.lineTo(t.x,t.bottomY);let l=new window.THREE.ExtrudeGeometry(o,i),s=new window.THREE.Mesh(l,n);return s.position.set(0,0,e.z),s}_createSplineAreaSlice(e,t,a,r=1){const n=a=>t[a]+(e[a]-t[a])*r,i=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0});let o={curveItems:32,steps:1,depth:a.depth,bevelEnabled:!1};const l=a.nextPosition,s=new window.THREE.SplineCurve([new window.THREE.Vector3(t.x,t.y),new window.THREE.Vector3(n("x"),n("y")),new window.THREE.Vector3(l.x,l.y)]),d=new window.THREE.SplineCurve([new window.THREE.Vector3(t.x,t.bottomY),new window.THREE.Vector3(n("x"),n("bottomY")),new window.THREE.Vector3(l.x,l.bottomY)]),u=s.getPoints(32),c=d.getPoints(32);let p=new window.THREE.Shape;p.moveTo(...u[0]);for(let e=1;e<u.length/2;e++)p.lineTo(...u[e]);for(let e=(c.length-1)/2;e>=0;e--)p.lineTo(...c[e]);let m=new window.THREE.ExtrudeGeometry(p,o),g=new window.THREE.Mesh(m,i);return g.position.set(0,0,e.z),g}_createCube(e,t,a,r,n){const i=new window.THREE.BoxGeometry(t,t,t),o=new window.THREE.MeshLambertMaterial({color:r,transparent:!0}),l=new window.THREE.Mesh(i,o);return l.position.set(e.x,e.y+a+t/2,e.z),"diamond"===n&&l.rotateZ(Math.PI/4),l}_createTriangle(e,t,a,r,n){const i=new window.THREE.ConeGeometry(t,t,3),o=new window.THREE.MeshLambertMaterial({color:r,transparent:!0}),l=new window.THREE.Mesh(i,o);l.position.set(e.x,e.y+a+t/2,e.z);let s=n.slice(n.indexOf("_")+1);return"right"===s&&l.rotateZ(Math.PI/2),"down"===s&&l.rotateZ(Math.PI),"left"===s&&l.rotateZ(-Math.PI/2),l}_createSphere(e,t,a,r){const n=new window.THREE.SphereGeometry(t,32,32),i=new window.THREE.MeshLambertMaterial({color:r,transparent:!0}),o=new window.THREE.Mesh(n,i);return o.position.set(e.x,e.y+a+t/2,e.z),o}_getXAxisLabels(){const e=this;let t=e.dataSource.map(((t,a)=>{if(e.xAxis.dataField){let a=t[e.xAxis.dataField];return"date"!==e.xAxis.type||a instanceof Date||(a=new Date(a)),a}return a}));if(e.rightToLeft&&(t=t.reverse()),e.xAxis.rangeSelector.visible){let a=e._rangeSelector.minIndex||0,r=e._rangeSelector.maxIndex||t.length-1;t=t.slice(a,r+1)}return t}_getZAxisLabels(){const e=this;let t=e.seriesGroups.map((e=>e.displayText));return void 0===t[0]&&(t=[],e.seriesGroups.forEach((e=>{e.series.forEach((e=>t.push(e.displayText)))}))),t}_getAxisLabels(e,t){const a=this;let r={xAxis:a._getXAxisLabels(t),zAxis:a._getZAxisLabels()};return e&&(r.yAxis=e.series.map((e=>e.displayText)),a.seriesGroup.formatFunction&&(r.yAxis=r.yAxis.map((e=>a.seriesGroup.formatFunction(e))))),r}_getSourceValue(e,t,a){return t.includes("ohlc")||t.includes("candlestick")?{open:parseFloat(e[a.dataFieldOpen]),high:parseFloat(e[a.dataFieldHigh]),low:parseFloat(e[a.dataFieldLow]),close:parseFloat(e[a.dataFieldClose])}:t.includes("range")?{from:parseFloat(e[a.dataFieldFrom]),to:parseFloat(e[a.dataFieldTo])}:parseFloat(e[a.dataField])}_getObjectHeight(e,t,a,r){const n=this;let i=e=>(e-this.valueAxis._baseLine)/(a.maxValue-this.valueAxis._baseLine)*(a.height-a.floorHeight);return n.valueAxis.logarithmicScale&&(i=e=>n._getLogValue(e)*(a.height-a.floorHeight)/n._getLogValue(a.maxValue)),t.includes("100")&&(i=e=>0===r?0:e/r*(a.height-a.floorHeight)),t.includes("ohlc")||t.includes("candlestick")?{open:i(e.open),high:i(e.high),low:i(e.low),close:i(e.close)}:t.includes("range")?{from:i(e.from),to:i(e.to)}:i(e)||.1}_getObjectPosition(e,t,a,r,n,i,o,l,s){const d=this.rightToLeft;let u=o.slot.x/2+o.origin.x+(e-(this._rangeSelector.minIndex||0))*o.slot.x,c=(n||0)+o.floorHeight,p=o.origin.z+(t+s)*o.slot.z+o.slot.z/2;return d&&(u=-u),l.includes("stacked")&&(p=o.origin.z+a*o.slot.z+o.slot.z/2),l.includes("waterfall")&&(c+=i),!l.includes("line")&&!l.includes("area")||l.includes("range")||(c+=r),l.includes("ohlc")||l.includes("candlestick")?{open:{x:u,y:c+r.open,z:p},low:{x:u,y:c+r.low,z:p}}:l.includes("range")?l.includes("column")||l.includes("bar")?{x:u,y:c+r.from,bottomY:c+r.from,z:p}:{x:u,y:c+r.to,bottomY:c+r.from,z:p}:{x:u,y:c,z:p,bottomY:l.includes("line")?c:c-r}}_getDimension(e,t,a=""){if(a.includes("bar")&&(t/=1.5),void 0===e||e<=0||""===e)return.5*t;if("string"==typeof e){if(e.includes("%"))return t*(parseFloat(e)/100);e=parseFloat(e)}return Math.min(e,t)}_createBubble(e,t,a,r){const n=this;let i;return i="square"===a||"diamond"===a?n._createCube(e,t,r.height,r.color,a):a.includes("triangle")?n._createTriangle(e,t,r.height,r.color,a):n._createSphere(e,t,r.height,r.color),i}_getDisplayText(e,t){let a=e;return t.formatFunction&&(a=t.formatFunction(e)),t.formatSettings&&t.formatSettings.prefix&&(a=t.formatSettings.prefix+a),t.formatSettings.sufix&&(a+=t.formatSettings.sufix),a}_getFormattedValue(e,t={},a){let r=e;return a?(r=a(e),r):(t.dateFormat&&(r=t.dateFormat(e)),null!==t.decimalPlaces&&void 0!==t.decimalPlaces&&(r=r.toFixed(t.decimalPlaces)),null!==t.decimalSeparator&&void 0!==t.decimalSeparator&&(r=r.toString().replace(".",t.decimalSeparator)),null!==t.thousandsSeparator&&void 0!==t.thousandsSeparator&&(r=r.toString().replace(/\B(?=(\d{3})+(?!\d))/g,t.thousandsSeparator)),t.negativeWithBrackets&&(r=parseFloat(r)<0?"("+r+")":r),t.prefix&&(r=t.prefix+r),t.sufix&&(r+=t.sufix),r)}_createPieLabel(e,t,a){let r=t.labelRadius;const n=document.createElement("div");n.className="smart-3d-chart-label",n.style.marginTop="-1em",n.innerHTML=e.value;const i=new window.THREE.CSS2DObject(n);r||(r=.8*e.pieRadius);const o=Math.cos(e.radians)*r,l=-Math.sin(e.radians)*r;if(i.position.set(o,e.height,l),r>e.pieRadius){const t={x:Math.cos(e.radians)*e.pieRadius,y:e.height/2,z:-Math.sin(e.radians)*e.pieRadius},r=.1;let n;t.x+=t.x>0?r:-r,t.z+=t.z>0?r:-r,n=(new window.THREE.BufferGeometry).setFromPoints([new window.THREE.Vector3(t.x,t.y,t.z),new window.THREE.Vector3(i.position.x,t.y,i.position.z),new window.THREE.Vector3(i.position.x,i.position.y,i.position.z)]);const o=new window.THREE.LineBasicMaterial({color:e.color,transparent:!0}),l=new window.THREE.Line(n,o);a.add(l)}a.add(i),a.userData.labelObject=i}_setPieChartData(e){const t=this,a=t.seriesGroups[e],r=a.series,n=a.dataSource?a.dataSource:t.dataSource,i=a.colorScheme?a.colorScheme:t.colorScheme,o="none"===t.animation||t._drawComplete?100:0,l=!("none"!==t.animation&&!t._drawComplete);for(let s=0;s<r.length;s++){const d=r[s],u=d.dataField,c=n.filter(((a,r)=>!t._objectIsHidden(r,s,e))),p=d.variableHeightField,m=n.reduce(((e,t)=>e+t[u]),0),g=c.reduce(((e,t)=>e+t[u]),0)||.1,h=(a.endAngle||360)/180*Math.PI;let y=(d.initialAngle||0)/180*Math.PI;for(let r=0;r<n.length;r++){const c=n[r],b=c[u],x=t._getItemColor(i,r,r,s,e,b),w=y,_=y+b/g*h||w;t._objectIsHidden(r,s,e)||(y=_);let v,f=d.height||3;d.variableHeight&&(f*=c[p]/t._getMinimumValue(n,p));let E={radius:d.radius||30,color:x,angleStart:w,angleEnd:_,height:f,width:d.width,opacity:a.objectOpacity||1},D={dataField:u,displayText:t._getFormattedValue(c[d.displayText],a.formatSettings,a.formatFunction),displayedValue:t._getFormattedValue(b,d.formatSettings,d.formatFunction),value:b,percentage:b/m*100,visiblePercentage:b/g*100,type:a.type,itemIndex:r,serieIndex:s,groupIndex:e,drawComplete:l,drawProgress:o,hidden:t._objectIsHidden(r,s,e),color:x,labelProps:{}};Object.assign(D,E);let S={text:D.displayText,color:D.color,value:D.displayedValue,radians:(D.angleStart+D.angleEnd)/2,height:D.height,pieRadius:D.radius};D.labelProps=S,"pie"===a.type?v=t._createPieSlice(E):"donut"===a.type&&(v=t._createDonutSlice(E)),a.showLabels&&t._createPieLabel(D.labelProps,d,v),t._setPieItemProperties(v,D),t._chartObjects.push(v),t._drawComplete&&!D.hidden&&t._scene.add(v)}}}_getTotalItemValue(e,t,a,r){const n=this;let i=0;for(let o=0;o<r.series.length;o++)this._objectIsHidden(t,o,a)||(i+=n._getSourceValue(e[t][r.dataField],r.type,r.series[o]));return i}_setBands(e){const t=this;t.seriesGroups[e].bands.forEach((e=>{let a={from:e.minValue,to:e.maxValue};const r=t._getObjectHeight(a,"range",t._grid.userData.gridProps);r.from===r.to&&(r.from-=e.lineWidth/2,r.to+=e.lineWidth/2);const n=t._grid.userData.gridProps,i=t._grid.userData.gridWalls.back,o=t._grid.userData.gridWalls.side,l=new window.THREE.LineBasicMaterial({color:e.color,side:window.THREE.DoubleSide,opacity:e.opacity,transparent:!0}),s=new window.THREE.PlaneGeometry(n.width,Math.abs(r.from-r.to)),d=new window.THREE.Mesh(s,l);d.position.set(0,r.from,-n.depthWidth/2),i.add(d);const u=new window.THREE.PlaneGeometry(n.depthWidth,Math.abs(r.from-r.to)),c=new window.THREE.Mesh(u,l);c.position.set(-n.width/2,r.from,0),c.rotation.set(0,Math.PI/2,0),o.add(c)}))}_createBand(e,t,a,r){const n=new window.THREE.MeshLambertMaterial({color:e.color,transparent:!0,opacity:e.opacity});let i=new window.THREE.Shape;i.moveTo(r.position.x-a/2,t.to),i.lineTo(r.position.x+a/2,t.from);let o=new window.THREE.ExtrudeGeometry(i,{curveItems:32,steps:1,depth:.1,bevelEnabled:!1}),l=new window.THREE.Mesh(o,n);return l.position.set(0,0,0),r.add(l),l}_setGridChartData(e){const t=this,a=t.seriesGroups[e],r=a.series,n=a.dataField,i=t.xAxis.dataField,o=t._grid.userData.gridProps,l=a.colorScheme?a.colorScheme:t.colorScheme;let s=a.dataSource?a.dataSource:t.dataSource;const d=s;t.rightToLeft&&(s=s.slice().reverse());let u=0;if(e>0)for(let a=0;a<e;a++)u+=t.seriesGroups[a].series.length;const c="none"===t.animation||t._drawComplete?100:0,p=!("none"!==t.animation&&!t._drawComplete);let m=new Array(s.length).fill(0);for(let g=0;g<r.length;g++){let h=0,y=0;for(let b=0;b<s.length;b++){let x,w,_,v,f,E,D,S,T,I=s[b],L=b>0?s[b-1]:null,C=s[b+1];n&&(I=I[n],L=b>0?L[n]:null,C=C?C[n]:null);let F=t._getSourceValue(I,a.type,r[g]);a.type.includes("waterfall")&&(b===s.length-1?(F=y,h=0):y+=F),a.type.includes("100")&&(x=t._getTotalItemValue(s,b,e,a));let A=t._getObjectHeight(F,a.type,o,x),R=t._getObjectPosition(b,g,e,A,Math.max(m[b],0),h,o,a.type,u);a.type.includes("waterfall")&&(b===s.length-1?h=0:h+=A),(a.type.includes("line")||a.type.includes("area"))&&(L&&b-(t._rangeSelector.minIndex||0)!=0?(b===s.length-1&&(R.x+=o.slot.x/2*.9),a.type.includes("100")&&(f=t._getTotalItemValue(s,b-1,e,a)),w=t._getSourceValue(L,a.type,r[g]),_=t._getObjectHeight(w,a.type,o,f),v=t._getObjectPosition(b-1,g,e,_,Math.max(m[b-1]-_,0),h,o,a.type,u)):(w=F,_=A,v={x:R.x,y:R.y,z:R.z,bottomY:R.bottomY},v.x-=o.slot.x/2*.9),C&&b-(t._rangeSelector.minIndex||0)!=s.length-1?(a.type.includes("100")&&(T=t._getTotalItemValue(s,b+1,e,a)),E=t._getSourceValue(C,a.type,r[g]),D=t._getObjectHeight(E,a.type,o,T),S=t._getObjectPosition(b+1,g,e,D,Math.max(m[b+1]-D,0),h,o,a.type,u)):(E=F,D=A,S={x:R.x,y:R.y,z:R.z,bottomY:R.bottomY},S.x+=o.slot.x/2*.9));let M=g;!a.type.includes("column")&&!a.type.includes("bar")||a.type.includes("stacked")||1!==a.series.length||(M=b),"serie"===a.colorIndex?M=g:"item"===a.colorIndex&&(M=b);const P=t._getItemColor(l,M,b,g,e,F);let j,H=a.type;"waterfall"===a.type&&(H="column"),["column","bar"].includes(a.objectType)&&(H=a.objectType);let V,z=t.customModels.findIndex((t=>t.groupIndex===e&&t.serieIndex===g&&t.itemIndex===b));-1!==z&&(j=t.customModels[z].model);let O={color:P,width:t._getDimension(a.width,o.slot.x,H),depth:t._getDimension(a.depth,o.slot.z,H),verticalWidth:a.verticalWidth?a.verticalWidth:2,opacity:a.opacity?a.opacity:1,object3DType:H,customModel:j,position:R,height:A,prevHeight:_,nextPosition:S,nextHeight:D},B=d[b][i]||b;"date"!==t.xAxis.type||B instanceof Date||(B=new Date(B)),B=t._getFormattedValue(B,t.xAxis.formatSettings,t.xAxis.formatFunction);let G={groupDisplayText:a.displayText,serieDisplayText:r[g].displayText||"",displayTextFrom:r[g].displayTextFrom||"",displayTextTo:r[g].displayTextTo||"",displayTextOpen:r[g].displayTextOpen||"",displayTextClose:r[g].displayTextClose||"",displayTextHigh:r[g].displayTextHigh||"",displayTextLow:r[g].displayTextLow||"",xAxisField:B,value:F,displayedValue:t._getFormattedValue(F,r[g].formatSettings,r[g].formatFunction),type:a.type,itemIndex:b,serieIndex:g,groupIndex:e,drawComplete:p,drawProgress:j?1:c,hidden:t._objectIsHidden(b,g,e),isStacked:a.type.includes("stacked")};if(Object.assign(G,O),H.includes("column")||H.includes("waterfall")||H.includes("bar"))V=j?t._createCustomModel(j,R,A,G):H.includes("bar")?t._createBar(R,A,O):t._createColumn(R,A,O),t._setColumnProperties(V,G);else if(H.includes("line")||H.includes("area"))H.includes("line")&&(R.bottomY-=O.verticalWidth,v.bottomY-=O.verticalWidth),V=H.includes("spline")?t._createSplineAreaSlice(R,v,O):H.includes("step")?t._createStepAreaSlice(R,v,O):t._createAreaSlice(R,v,O),G.prevObjectPosition=v,t._setAreaProperties(V,G);else if(H.includes("bubble")){const e=r[g].symbolType?r[g].symbolType:"circle",a=t._getDimension(r[g].maxRadius||0,Math.min(o.slot.z,o.slot.x)),n=Math.min(t._getDimension(r[g].minRadius||0,Math.min(o.slot.z,o.slot.x)),3),i=a/t._getMaximumValue(s,r[g].radiusDataField)||1,l=Math.max((I[r[g].radiusDataField]||n)*i,n);G.radius=l,G.symbolType=e,V=t._createBubble(R,l,e,O),t._setBubbleProperties(V,G)}else H.includes("ohlc")?(V=t._createOHLC(R,A,O),t._setFinancialProperties(V,G)):H.includes("candlestick")&&(V=t._createCandlestick(R,A,O),t._setFinancialProperties(V,G));a.type.includes("stacked")&&!G.hidden&&(m[b]+=A),V&&(t._chartObjects.push(V),!G.hidden&&p&&t._validRange(b,s.length-1)&&t._grid.add(V))}}}_setScatterChartData(e){const t=this,a=t.seriesGroups[e],r=a.series,n=t._grid.userData.gridProps,i=a.colorScheme?a.colorScheme:t.colorScheme;let o=a.dataSource?a.dataSource:t.dataSource;t.rightToLeft&&(o=o.slice().reverse());let l=(e,t,a,r)=>(e-t)*r/(a-t);t.valueAxis.logarithmicScale&&(l=(e,a,r,n)=>t._getLogValue(e)*n/t._getLogValue(r));for(let s=0;s<o.length;s++){let d,u=t._getItemColor(i,e,0,0,e,o[s]),c={x:o[s][t.xAxis.dataField],y:o[s][a.series[0].dataField],z:o[s][t.zAxis.dataField]},p={x:l(c.x,t.xAxis._minValue,t.xAxis._maxValue,n.width)-n.width/2,y:l(c.y,t.valueAxis._minValue,t.valueAxis._maxValue,n.height),z:l(c.z,t.zAxis._minValue,t.zAxis._maxValue,n.depthWidth)-n.depthWidth/2},m=r[0].symbolType?r[0].symbolType:"circle",g=r[0].symbolSize;d="square"===m||"diamond"===m?t._createCube(p,g,0,u,m):m.includes("triangle")?t._createTriangle(p,g,0,u,m):t._createSphere(p,g,0,u,m);let h=t._drawComplete||"none"===t.animation,y={serieDisplayText:r[0].displayText,xAxisField:o[s][t.xAxis.dataField],zAxisField:o[s][t.zAxis.dataField],color:u,value:c,type:a.type,groupIndex:e,isStacked:!1,serieIndex:0,itemIndex:s,position:p,width:g,height:0,drawComplete:h,drawProgress:0,radius:g,hidden:t._objectIsHidden(s,0,e),symbol:m};d.material.opacity=r[0].opacity?r[0].opacity:1,t._setBubbleProperties(d,y),t._setScatterProperties(d,y),t._chartObjects.push(d),h&&!y.hidden&&t._grid.add(d)}}_validRange(e,t){return e>=(this._rangeSelector.minIndex||0)&&e<=(this._rangeSelector.maxIndex||t)}_toolTipFormatter(e){return this._getFormattedValue(e,this.toolTipFormatSettings)}_drawLines(e,t){const a=this,r=e.map((e=>new window.THREE.Vector3(e[0],e[1],e[2]))),n=new window.THREE.MeshBasicMaterial({color:t,transparent:!0,opacity:0}),i=new window.THREE.Object3D;for(let e=0;e<r.length-1;e++){const t=new window.THREE.QuadraticBezierCurve3(r[e],r[e],r[e+1]),a=new window.THREE.TubeGeometry(t,32,.5,8,!0),o=new window.THREE.Mesh(a,n);i.add(o)}return void 0===a._grid.userData.vectorColors&&(a._grid.userData.vectorColors=[]),a._grid.userData.vectorColors.push(t),void 0===a._grid.userData.vectorPoints&&(a._grid.userData.vectorPoints=[]),a._grid.userData.vectorPoints.push(e.map((e=>(e[3]=!1,e)))),void 0===a._grid.userData.vectorLines&&(a._grid.userData.vectorLines=[]),a._grid.userData.vectorLines.push(i),i}_createPoint(e,t,a,r,n,i,o){const l=new window.THREE.SphereGeometry(1,32,32),s=new window.THREE.MeshLambertMaterial({color:i,wireframe:!1}),d=new window.THREE.Mesh(l,s);return d.position.set(e,n,a),d.userData=o,d}_setPyramidItemProperties(e,t){const a=this;a._setPieItemProperties(e,t),e.userData.drawAnimate=function(){if(e.userData.tempSlice&&(a._scene.remove(e.userData.tempSlice),e.userData.tempSlice=null),e.userData.drawComplete)return!0;if(0!==e.userData.itemIndex&&!1===a._getObjectByIndexes(e.userData.groupIndex,e.userData.serieIndex,e.userData.itemIndex-1).userData.drawComplete)return;const t=e.userData;t.drawProgress>=1&&(t.drawProgress=1,e.userData.drawComplete=!0,e.material.opacity=1,a._scene.add(e));let r=t.widthStart-(t.widthStart-t.widthEnd)*t.drawProgress,n=t.heightStart-(t.heightStart-t.heightEnd)*t.drawProgress,i=t.heightStart+(n-t.heightStart)/2,o=a._createPyramidItem(n,r,i,t);e.userData.tempSlice=o,a._scene.add(o),e.userData.drawProgress+=.05},e.userData.selectObject=function(){}}_setPieItemProperties(e,t){const a=this;Object.assign(e.userData,t),a._setCommonItemMethods(e);const r=e.userData;e.userData.drawAnimate=function(){if(r.animatedObject&&(a._scene.remove(e.userData.animatedObject),e.userData.animatedObject=null),e.userData.drawComplete)return!0;if(0!==e.userData.itemIndex&&!1===a._getObjectByIndexes(e.userData.groupIndex,e.userData.serieIndex,e.userData.itemIndex-1).userData.drawComplete)return;r.drawProgress>=1&&(r.drawProgress=1,e.userData.drawComplete=!0,e.material.opacity=r.opacity,a._scene.add(e));const t=r.angleStart+(r.angleEnd-r.angleStart)*r.drawProgress;let n,i={radius:r.radius,color:r.color,angleStart:r.angleStart,angleEnd:t,height:r.height,width:r.width,opacity:r.opacity};n="pie"===r.type?a._createPieSlice(i):a._createDonutSlice(i),e.userData.animatedObject=n,a._scene.add(n),e.userData.drawProgress+=.25/(e.userData.angleEnd-e.userData.angleStart)},e.userData.highlightObject=function(t=!1){void 0!==a._mouseIsValid&&(a._inTransitionQueue.push({obj:e,targetValue:1}),e.userData.highlighted=!0,e.userData.dehighlighted=!1,a._getObjectsByIndexes().forEach((t=>{t.uuid!==e.uuid&&t.userData.dehighlightObject()})),t&&!0!==e.userData.hidden&&e.userData.showToolTip())},e.userData.unhighlightObject=function(){a._inTransitionQueue.push({obj:e,targetValue:1}),e.userData.highlighted=!1,e.userData.dehighlighted=!1},e.userData.dehighlightObject=function(){a._inTransitionQueue.push({obj:e,targetValue:.5}),e.userData.highlighted=!1,e.userData.dehighlighted=!0},e.userData.selectObject=function(){if("null"!==a.selectMode){const t=.5*(e.userData.angleEnd+e.userData.angleStart),r=.2*e.userData.angleStart,n=Math.abs(Math.sin(r+1)),i=Math.cos(t)*n,o=-Math.sin(t)*n;a._inMotionQueue.push({obj:e,target:{x:i,z:o}}),e.userData.selected=!0,"one"===a.selectMode&&a._getObjectsByIndexes(e.userData.groupIndex,0).forEach((t=>{t.userData.itemIndex!==e.userData.itemIndex&&t.userData.unselectObject()}))}a.$.fireEvent("select",{groupIndex:e.userData.groupIndex,seriesIndex:e.userData.serieIndex,itemIndex:e.userData.itemIndex})},e.userData.unselectObject=function(){a._inMotionQueue.push({obj:e,target:{x:0,z:0}}),e.userData.selected=!1,a.$.fireEvent("unselect",{groupIndex:e.userData.groupIndex,seriesIndex:e.userData.serieIndex,itemIndex:e.userData.itemIndex})},e.userData.showToolTip=function(){if(!0===e.userData.hidden)return;let t=e.userData.displayText,n=e.userData.dataField+": "+a._toolTipFormatter(e.userData.displayedValue);const i=a.toolTipLineColor||e.userData.color;a.toolTipFormatFunction&&(n=a.toolTipFormatFunction(r.value,r.itemIndex,r.serieIndex,r.groupIndex,r.displayText),t=""),a._setToolTipContent(t,n,i),a._setToolTip()}}_setAreaProperties(e,t){const a=this;Object.assign(e.userData,t),a._setCommonItemMethods(e),e.userData.drawAnimate=function(){const t=e.userData;if(t.drawComplete)return!0;if(t.itemIndex>0&&!1===a._getObjectByIndexes(t.groupIndex,t.serieIndex,t.itemIndex-1).userData.drawComplete)return;if(t.prevObject&&a._grid.remove(t.prevObject),t.drawProgress>=1)return t.drawComplete=!0,void a._grid.add(e);let r;r=t.type.includes("spline")?a._createSplineAreaSlice(t.position,t.prevObjectPosition,t,t.drawProgress):t.type.includes("step")?a._createStepAreaSlice(t.position,t.prevObjectPosition,t,t.drawProgress):a._createAreaSlice(t.position,t.prevObjectPosition,t,t.drawProgress),a._grid.add(r),e.userData.prevObject=r,e.userData.drawProgress+=Math.max(a.dataSource.length/100,.1)},e.userData.highlightObject=function(t=!1){if(t&&void 0===a._mouseIsValid)return;const r=e.userData.color,n=a._shadeHexColor(r,.3);e.material.color=new window.THREE.Color(n),e.userData.highlighted=!0,e.userData.dehighlighted=!1,e.userData.labelObject&&e.add(e.userData.labelObject),a._getObjectsByIndexes().forEach((t=>{t.uuid!==e.uuid&&t.userData.dehighlightObject()}))},e.userData.unhighlightObject=function(){const t=e.userData.color;e.material.color=new window.THREE.Color(t),e.userData.labelObject&&e.remove(e.userData.labelObject),e.userData.highlighted=!1,e.userData.dehighlighted=!1},e.userData.dehighlightObject=function(){const t=e.userData.color;e.material.color=new window.THREE.Color(t),e.userData.labelObject&&e.remove(e.userData.labelObject),e.userData.highlighted=!1,e.userData.dehighlighted=!0},e.userData.selectObject=function(){a.$.fireEvent("select",{groupIndex:e.userData.groupIndex,seriesIndex:e.userData.serieIndex,itemIndex:e.userData.itemIndex})},e.userData.unselectObject=function(){a.$.fireEvent("unselect",{groupIndex:e.userData.groupIndex,seriesIndex:e.userData.serieIndex,itemIndex:e.userData.itemIndex})},e.userData.showToolTip=function(){const t=e.userData;let r=e.userData.serieDisplayText+" "+(e.userData.xAxisField||""),n=a._getFormattedValue(e.userData.value,this.toolTipFormatSettings,this.toolTipFormatFunction);e.userData.value.from&&(n=e.userData.displayTextFrom+": "+a._toolTipFormatter(t.value.from)+"<br>"+e.userData.displayTextTo+": "+a._toolTipFormatter(t.value.to)),a.toolTipFormatFunction&&(n=a.toolTipFormatFunction(t.value,t.itemIndex,t.serieIndex,t.groupIndex,t.displayText),r="");const i=a.toolTipLineColor||e.userData.color;a._setToolTipContent(r,n,i),a._setToolTip()}}_setScatterProperties(e,t){const a=this;a._setBubbleProperties(e,t),e.userData.showToolTip=function(){const t=e.userData;let r=e.userData.serieDisplayText,n=`${a.valueAxis.displayText||"y"}: ${a._toolTipFormatter(t.value.y)}<br>\n ${a.xAxis.displayText||"x"}: ${a._toolTipFormatter(t.value.x)}<br>\n ${a.zAxis.displayText||"z"}: ${a._toolTipFormatter(t.value.z)}`;a.toolTipFormatFunction&&(n=a.toolTipFormatFunction(t.value,t.itemIndex,t.serieIndex,t.groupIndex,t.displayText),r="");const i=a.toolTipLineColor||e.userData.color;a._setToolTipContent(r,n,i),a._setToolTip()}}_setColumnProperties(e,t){const a=this;Object.assign(e.userData,t),a._setCommonItemMethods(e),e.userData.drawAnimate=function(){const t=e.userData;if(t.drawComplete)return!0;if(t.isStacked&&0!==t.serieIndex&&!1===a._getObjectByIndexes(t.groupIndex,t.serieIndex-1,t.itemIndex).userData.drawComplete)return;if(t.prevObject&&a._grid.remove(t.prevObject),t.drawProgress>=1)return t.drawComplete=!0,void a._grid.add(e);let r,n=t.height;"number"!=typeof n&&(n=Math.abs(n.from-n.to)),t.object3DType.includes("column")?r=a._createColumn(t.position,n*t.drawProgress,t):t.object3DType.includes("bar")&&(r=a._createBar(t.position,n*t.drawProgress,t)),a._grid.add(r),e.userData.prevObject=r,t.drawProgress+=.03},e.userData.highlightObject=function(t=!1){if(t&&void 0===a._mouseIsValid)return;const r=e.userData.color,n=a._shadeHexColor(r,.3);e.material.color=new window.THREE.Color(n),e.userData.highlighted=!0,e.userData.dehighlighted=!1,e.userData.sideLine||e.userData.backLine||!a.showConnectionLines||e.userData.drawConnectingLines(),a._getObjectsByIndexes().forEach((t=>{t.userData.itemIndex===e.userData.itemIndex&&t.userData.serieIndex===e.userData.serieIndex&&t.userData.groupIndex===e.userData.groupIndex||t.userData.dehighlightObject()}))},e.userData.unhighlightObject=function(){const t=e.userData.color;e.material.color=new window.THREE.Color(t),e.userData.highlighted=!1,e.userData.dehighlighted=!1,e.userData.selected||e.userData.removeConnectingLines()},e.userData.dehighlightObject=function(){const t=e.userData.color;e.material.color=new window.THREE.Color(t),e.userData.highlighted=!1,e.userData.dehighlighted=!0},e.userData.selectObject=function(){e.userData.selected=!0,a.$.fireEvent("select",{groupIndex:e.userData.groupIndex,seriesIndex:e.userData.serieIndex,itemIndex:e.userData.itemIndex})},e.userData.unselectObject=function(){e.userData.selected=!1,a.$.fireEvent("unselect",{groupIndex:e.userData.groupIndex,seriesIndex:e.userData.serieIndex,itemIndex:e.userData.itemIndex})},e.userData.showToolTip=function(){const t=e.userData;let r=e.userData.serieDisplayText+" "+e.userData.xAxisField,n=a._toolTipFormatter(t.value);"waterfall"!==e.userData.type||e.userData.value||(n="Total: "+e.userData.total),e.userData.value.from&&(n=e.userData.displayTextFrom+": "+a._toolTipFormatter(t.value.from)+"<br>"+e.userData.displayTextTo+": "+a._toolTipFormatter(t.value.to));const i=a.toolTipLineColor||e.userData.color;a.toolTipFormatFunction&&(n=a.toolTipFormatFunction(t.value,t.itemIndex,t.serieIndex,t.groupIndex,t.xAxisField,t.serieDisplayText),r=""),a._setToolTipContent(r,n,i),a._setToolTip()}}_setBubbleProperties(e,t){const a=this;a._setColumnProperties(e,t),e.userData.drawAnimate=function(){const t=e.userData;if(t.drawComplete)return!0;if(0!==t.itemIndex&&!1===a._getObjectByIndexes(t.groupIndex,t.serieIndex,t.itemIndex-1).userData.drawComplete)return;if(t.prevObject&&a._grid.remove(t.prevObject),t.drawProgress>=1)return t.drawComplete=!0,void a._grid.add(e);let r=a._createBubble(t.position,t.radius*t.drawProgress,t.symbolType,t);a._grid.add(r),t.prevObject=r,t.drawProgress+=.1}}_setFinancialProperties(e,t){const a=this;a._setColumnProperties(e,t),e.userData.drawAnimate=function(){const t=e.userData;if(t.drawComplete)return!0;if(t.prevObject&&a._grid.remove(t.prevObject),t.drawProgress>=1)return t.drawComplete=!0,void a._grid.add(e);let r,n={open:t.height.open*t.drawProgress,close:t.height.close*t.drawProgress,high:t.height.high*t.drawProgress,low:t.height.low*t.drawProgress};r="ohlc"===t.type?a._createOHLC(t.position,n,t):a._createCandlestick(t.position,n,t),a._grid.add(r),t.prevObject=r,t.drawProgress+=.1},e.userData.showToolTip=function(){const t=e.userData;let r=e.userData.serieDisplayText+" "+e.userData.xAxisField,n="";n+=e.userData.displayTextOpen+": "+a._toolTipFormatter(t.value.open)+"<br>",n+=e.userData.displayTextClose+": "+a._toolTipFormatter(t.value.close)+"<br>",n+=e.userData.displayTextHigh+": "+a._toolTipFormatter(t.value.high)+"<br>",n+=e.userData.displayTextLow+": "+a._toolTipFormatter(t.value.low)+"<br>";const i=a.toolTipLineColor||e.userData.color;a.toolTipFormatFunction&&(n=a.toolTipFormatFunction(t.value,t.itemIndex,t.serieIndex,t.groupIndex,t.displayText),r=""),a._setToolTipContent(r,n,i),a._setToolTip()}}_setCommonItemMethods(e){const t=this,a=e.userData;e.userData.showObject=function(){let e=a.groupIndex,r=a.serieIndex,n=a.itemIndex,i=t._hiddenIndexes.findIndex((t=>t.groupIndex===e&&t.serieIndex===r&&t.itemIndex===n));-1!==i&&t._hiddenIndexes.splice(i,1),a.hidden=!1,t.$.fireEvent("show",{groupIndex:a.groupIndex,seriesIndex:a.serieIndex,itemIndex:a.itemIndex}),t._setChart()},e.userData.hideObject=function(){a.hidden||(t._hiddenIndexes.push({groupIndex:a.groupIndex,serieIndex:a.serieIndex,itemIndex:a.itemIndex}),a.hidden=!0,t.$.fireEvent("hide",{groupIndex:a.groupIndex,seriesIndex:a.serieIndex,itemIndex:a.itemIndex}),t._setChart())},e.userData.toggleVisibility=function(){!0===a.hidden?a.showObject():a.hideObject()},e.userData.drawConnectingLines=function(){const a=e.position,r=t._grid.userData.gridProps,n=t._grid.userData.gridWalls.back.userData.flipped,i=t._grid.userData.gridWalls.side.userData.flipped,o=new window.THREE.LineBasicMaterial({color:"#545454"}),l=(new window.THREE.BufferGeometry).setFromPoints([new window.THREE.Vector3(a.x,a.y,a.z),new window.THREE.Vector3((i?1:-1)*(r.width/2),a.y,a.z)]),s=new window.THREE.Line(l,o),d=(new window.THREE.BufferGeometry).setFromPoints([new window.THREE.Vector3(a.x,a.y,a.z),new window.THREE.Vector3(a.x,a.y,(n?1:-1)*(r.depthWidth/2))]),u=new window.THREE.Line(d,o),c=(new window.THREE.BufferGeometry).setFromPoints([new window.THREE.Vector3(a.x,a.y,a.z),new window.THREE.Vector3(a.x,0,a.z)]),p=new window.THREE.Line(c,o);e.userData.sideLine=s,e.userData.backLine=u,e.userData.bottomLine=p,t._grid.add(s),t._grid.add(u),t._grid.add(p)},e.userData.removeConnectingLines=function(){a.sideLine&&(t._grid.remove(a.sideLine),a.sideLine=void 0),a.backLine&&(t._grid.remove(a.backLine),a.backLine=void 0),a.bottomLine&&(t._grid.remove(a.bottomLine),a.bottomLine=void 0)}}toggleVisibility(e,t,a){const r=this,n=this._getObjectsByIndexes(e,t,a);let i;n.length>1&&r.beginUpdate(),null===t?i=!r._groupIsShown(e):null===e&&(i=!r._serieIsShown(t)),n.forEach((e=>{!0===i?e.userData.showObject():!1===i?e.userData.hideObject():e.userData.toggleVisibility()})),n.length>1&&r.endUpdate()}_objectIsHidden(e,t,a){return this._hiddenIndexes.some((r=>r.groupIndex===a&&r.serieIndex===t&&r.itemIndex===e))}_createPyramidItem(e,t,a,r){let n=new window.THREE.CylinderGeometry(t/2,r.widthStart/2,e-r.heightStart,4),i=new window.THREE.MeshLambertMaterial({color:r.color,transparent:!0}),o=new window.THREE.Mesh(n,i);return o.rotateY(-Math.PI/4),o.position.set(0,a,0),o}_setPyramidChartData(e){const t=this,a=t.seriesGroups[e],r=a.series,n=a.dataSource?a.dataSource:t.dataSource,i=a.colorScheme?a.colorScheme:t.colorScheme,o="none"===t.animation||t._drawComplete?100:0,l=!("none"!==t.animation&&!t._drawComplete);for(let s=0;s<r.length;s++){const d=r[s],u=d.dataField,c=n.filter(((a,r)=>!t._objectIsHidden(r,s,e))),p=n.reduce(((e,t)=>e+t[u]),0),m=c.reduce(((e,t)=>e+t[u]),0)||.1;let g=-d.height/2,h=d.width;for(let r=0;r<n.length;r++){const c=n[r],y=c[u],b=t._getItemColor(i,r,r,s,e,y);let x=g,w=g+y/m*d.height,_=h,v=_-y/m*d.width;t._objectIsHidden(r,s,e)||(g=w,h=v);let f={color:b,heightStart:x,heightEnd:w,widthStart:_,widthEnd:v,opacity:a.objectOpacity||1,positionY:x+(w-x)/2},E={dataField:u,displayText:t._getFormattedValue(c[d.displayText],a.formatSettings,a.formatFunction),displayedValue:t._getFormattedValue(y,d.formatSettings,a.formatFunction),value:y,percentage:y/p*100,visiblePercentage:t._objectIsHidden(r,s,e)?0:y/m*100,type:a.type,itemIndex:r,serieIndex:s,groupIndex:e,drawComplete:l,drawProgress:o,hidden:t._objectIsHidden(r,s,e),color:b,labelProps:{}};Object.assign(E,f);let D={text:E.displayText,color:E.color,value:E.visiblePercentage.toFixed(2)+"%",height:E.heightEnd-E.heightStart,width:E.widthEnd-E.widthStart};E.labelProps=D;let S=t._createPyramidItem(w,v,f.positionY,f);a.showLabels,t._setPyramidItemProperties(S,E),t._chartObjects.push(S),l&&!E.hidden&&t._scene.add(S)}}}_getMinimumValue(e,t){let a=e[0][t];for(let r=1;r<e.length;r++)e[r][t]<a&&(a=e[r][t]);return a}_getMaximumValue(e,t){let a=e[0][t];for(let r=1;r<e.length;r++)e[r][t]>a&&(a=e[r][t]);return a}_updateLegendToggle(e,t,a){const r=this,n=r.querySelector(`.smart-3d-chart-legend-item .smart-3d-chart-legend-item-color[series-group-index='${e}'][serie-index='${t}'][item-index='${a}']`);r.showLegend&&n&&(r._hiddenIndexes.some((r=>r.itemIndex===a&&r.groupIndex===e&&r.serieIndex===t))?(n.classList.add("smart-3d-chart-legend-item-color-hidden"),n.setAttribute("active","false")):(n.classList.remove("smart-3d-chart-legend-item-color-hidden"),n.setAttribute("active","true")))}_updateLegendMutltiToggles(){const e=this;e.showLegend&&Array.from(document.querySelectorAll('.smart-3d-chart-legend-item .smart-3d-chart-legend-item-color[multi-control="true"]')).forEach((t=>{const a=t.getAttribute("toggle-by");if("series-group-index"===a){const a=t.getAttribute("series-group-index");!1===e._seriesGroupIsShown(a)?(t.classList.add("smart-3d-chart-legend-item-color-hidden"),t.setAttribute("active","false")):(t.classList.remove("smart-3d-chart-legend-item-color-hidden"),t.setAttribute("active","true"))}else if("serie-index"===a){const a=t.getAttribute("series-group-index"),r=t.getAttribute("serie-index");e._serieIsShown(a,r)?(t.classList.remove("smart-3d-chart-legend-item-color-hidden"),t.setAttribute("active","true")):(t.classList.add("smart-3d-chart-legend-item-color-hidden"),t.setAttribute("active","false"))}}))}getHidden(){return this._hiddenIndexes}_toggleLegendItem(e,t,a=null,r=!1){const n=this;let i=n.querySelector(`.smart-3d-chart-legend-item-color[series-group-index='${e}'][serie-index='${t}']`);null!==a&&(i=n.querySelector(`.smart-3d-chart-legend-item-color[series-group-index='${e}'][serie-index='${t}'][item-index='${a}']`)),r?i.classList.add("smart-3d-chart-legend-item-color-hidden"):i.classList.remove("smart-3d-chart-legend-item-color-hidden")}showItem(e=null,t=null,a=null){let r=this._getObjectByIndexes(e,t,a);r&&r.userData.showObject()}unselectItem(e=null,t=null,a=null){let r=this._getObjectByIndexes(e,t,a);r&&r.userData.unselectObject()}selectItem(e=null,t=null,a=null){let r=this._getObjectByIndexes(e,t,a);r&&r.userData.selectObject()}hideItem(e=null,t=null,a=null){let r=this._getObjectByIndexes(e,t,a);r&&r.userData.hideObject()}showSeries(e=null,t=null){this._getObjectsByIndexes(e,t).forEach((e=>e.userData.showObject()))}hideSeries(e=null,t=null){this._getObjectsByIndexes(e,t).forEach((e=>e.userData.hideObject()))}showGroup(e=null){this._getObjectsByIndexes(e).forEach((e=>e.userData.showObject()))}hideGroup(e=null){this._getObjectsByIndexes(e).forEach((e=>e.userData.hideObject()))}getSelection(){return this._getObjectsByIndexes().filter((e=>e.userData.selected)).map((e=>e.userData))}getItemByIndexes(e=null,t=null,a=null){return this._getObjectByIndexes(e,t,a).userData}getItemsByIndexes(e=null,t=null,a=null){return this._getObjectsByIndexes(e,t,a).map((e=>e.userData))}_getObjectByIndexes(e=null,t=null,a=null){return this._getObjectsByIndexes(e,t,a)[0]}_getObjectsByIndexes(e=null,t=null,a=null){return this._chartObjects.filter((r=>!(r.userData.groupIndex!==e&&null!==e||r.userData.serieIndex!==t&&null!==t||r.userData.itemIndex!==a&&null!==a)))}_toggleSeriesGroup(e,t=null){const a=this,r=a._getObjectsByIndexes(e);let n;null===t&&(n=a._seriesGroupIsShown(e)),r.forEach((e=>{n?e.userData.hideObject():e.userData.showObject()}))}_toggleSerie(e,t,a=null){const r=this,n=r._getObjectsByIndexes(e,t);let i;null===a&&(i=r._seriesGroupIsShown(e)),n.forEach((e=>{i?e.userData.hideObject():e.userData.showObject()}))}_seriesGroupIsHidden(e){let t;const a=this._getObjectsByIndexes(e);return t=a.filter((e=>e.userData.hidden)).length===a.length,t}_seriesGroupIsShown(e){const t=this;let a;const r=t._getObjectsByIndexes(e);return a=r.filter((e=>!t._hiddenIndexes.some((t=>t.itemIndex===e.userData.itemIndex&&t.groupIndex===e.userData.groupIndex&&t.serieIndex===e.userData.serieIndex)))).length===r.length,a}_serieIsShown(e,t){let a;const r=this._getObjectsByIndexes(e,t);return a=r.filter((e=>!e.userData.hidden)).length===r.length,a}_serieIsHidden(e,t){let a,r=this._getObjectsByIndexes(e,t),n=r.filter((e=>e.userData.hidden));return n.length===r.length&&(a=!0),0===n.length&&(a=!1),a}_groupIsHidden(e){let t;const a=this._getObjectsByIndexes(e),r=a.filter((e=>e.userData.hidden));return r.length===a.length&&(t=!0),0===r.length&&(t=!1),t}_groupIsShown(e){let t;const a=this._getObjectsByIndexes(e),r=a.filter((e=>!e.userData.hidden));return r.length===a.length&&(t=!0),0===r.length&&(t=!1),t}_createLegendItem(e,t,a,r,n,i,o){const l=this,s=document.createElement("div");s.classList.add("smart-3d-chart-legend-item"),s.innerHTML=`<div class='smart-3d-chart-legend-item-color' group-index='${e}' serie-index='${t}' item-index='${a}'></div>`,i&&(s.innerHTML+=`<div class='smart-3d-chart-legend-item-text'>${i}</div>`),o&&s.classList.add("smart-3d-chart-legend-item-hidden");const d=s.querySelector(".smart-3d-chart-legend-item-color");return d.style.backgroundColor=r,d.style.borderColor=n,d.addEventListener("click",(function(){l.toggleVisibility(e,t,a)})),s}_createLegendTable(e,t){const a=t.xAxis,r=t.zAxis,n=document.createElement("table");n.classList.add("smart-3d-chart-legend-table");const i=document.createElement("thead"),o=document.createElement("tr");i.appendChild(o),o.classList.add("smart-3d-chart-legend-table-header-row"),o.innerHTML="<th class='smart-3d-chart-legend-table-header-cell' scope=\"col\">Field</th>";for(let e=0;e<a.length;e++)o.innerHTML+=`<th class='smart-3d-chart-legend-table-header-cell' scope="col">${a[e]}</th>`;o.innerHTML+="<th class='smart-3d-chart-legend-table-header-cell smart-3d-chart-legend-table-header-checkbox' scope=\"col\"></th>",n.appendChild(i);const l=document.createElement("tbody");for(let e=0;e<r.length;e++){const t=document.createElement("tr");t.classList.add("smart-3d-chart-legend-table-body-row"),t.innerHTML=`<td class='smart-3d-chart-legend-table-body-cell'>${r[e]}</td>`;for(let e=0;e<=a.length;e++){const e=document.createElement("td");e.classList.add("smart-3d-chart-legend-table-body-cell");const a=document.createElement("div");a.classList.add("smart-3d-chart-legend-table-body-cell-flex"),e.appendChild(a),t.appendChild(e)}l.appendChild(t)}return n.appendChild(l),n}_createGridLegend(e,t){const a=this;a.querySelector(".smart-3d-chart-legend")&&a.querySelector(".smart-3d-chart-legend").parentNode.removeChild(a.querySelector(".smart-3d-chart-legend"));const r=document.createElement("div");if(r.classList.add("smart-3d-chart-legend"),"group"===e){const e=document.createElement("div");e.classList.add("smart-3d-chart-legend-column"),r.appendChild(e);for(let t=0;t<a.seriesGroups.length;t++){const r=a.seriesGroups[t].displayText,n=a.seriesGroups[t].legendFillColor||a._getColorFromScheme(a.colorScheme,t),i=a.seriesGroups[t].legendLineColor||a._getColorFromScheme(a.colorScheme,t),o=a._createLegendItem(t,null,null,n,i,r,!a._groupIsShown(t));e.appendChild(o)}}else if("serie"===e){const e=document.createElement("div");e.classList.add("smart-3d-chart-legend-column"),r.appendChild(e);for(let r=0;r<a.seriesGroups.length;r++)for(let n=0;n<a.seriesGroups[r].series.length;n++){const i=a.seriesGroups[r].series[n].displayText,o=a.seriesGroups[r].series[n].legendFillColor||(t?a._getColorFromScheme(a.colorScheme,r):a._getObjectByIndexes(r,n).userData.color),l=a.seriesGroups[r].series[n].legendLineColor||(t?a._getColorFromScheme(a.colorScheme,r):a._getObjectByIndexes(r,n).userData.color),s=a._createLegendItem(r,n,null,o,l,i,!a._serieIsShown(r,n));e.appendChild(s)}}return r}_createPieLegend(e){const t=this;t.querySelector(".smart-3d-chart-legend")&&t.querySelector(".smart-3d-chart-legend").parentNode.removeChild(t.querySelector(".smart-3d-chart-legend"));const a=document.createElement("div");a.classList.add("smart-3d-chart-legend");for(let r=0;r<t.seriesGroups.length;r++){const n=document.createElement("div");n.classList.add("smart-3d-chart-legend-column"),a.appendChild(n),t._getObjectsByIndexes(r).forEach((a=>{const i=a.userData,o=i.displayText+(e?" ("+i.labelProps.value+")":""),l=t._createLegendItem(r,i.serieIndex,i.itemIndex,i.color,i.color,o,i.hidden);n.appendChild(l)}))}return a}_setLegendLayout(e){const t=this,a=t.legendLayout,r=document.querySelector(".smart-3d-chart-container").getBoundingClientRect();"vertical"===a.flow?(e.querySelectorAll(".smart-3d-chart-legend-column").forEach((e=>{e.style.flexDirection="column"})),e.style.width="fit-content",e.style.top=(null!==a.top?a.top:t.remainingHeight/2-100)+"px",e.style.left=(null!==a.left?a.left:t.width-150)+"px"):(e.style.width="fit-content",e.style.flexDirection="column",null!==a.top?e.style.top=a.top+"px":e.style.top=r.height-40+"px",a.left?e.style.left=a.left+"px":(e.style.left="0px",e.style.right="0px",e.style.margin="auto"))}_getGridMinValue(e){const t=this;if(t.seriesGroups.some((e=>e.type.includes("100"))))return 0;if(!isNaN(t.valueAxis.minValue))return t.valueAxis.minValue;if(t.valueAxis.logarithmicScale)return 1;let a;if(e)a=Math.min(...t.seriesGroups.map((e=>e.dataField)).map((e=>Math.min(...t.bindedSource.slice(t._rangeSelector.minIndex||0,t._rangeSelector.maxIndex+1||t.dataSource.length).map((t=>Object.values(t[e]))).sort()[0]))));else{if("waterfall"===t.seriesGroups[0].type)return 0;a=Math.min(...t.seriesGroups[0].series.map((e=>Math.min(...t.dataSource.slice(t._rangeSelector.minIndex||0,t._rangeSelector.maxIndex||t.dataSource.length).map((t=>parseFloat(t[e.dataField])?parseFloat(t[e.dataField]):Number.POSITIVE_INFINITY))))))}return a}_getGridMaxValue(e){const t=this;let a=Number.NEGATIVE_INFINITY;if(t.seriesGroups.some((e=>e.type.includes("100"))))return 100;if(!isNaN(t.valueAxis.maxValue))return t.valueAxis.maxValue;if(e)a=Math.max(...t.seriesGroups.map((e=>e.dataField)).map((e=>Math.max(...t.bindedSource.slice(t._rangeSelector.minIndex||0,t._rangeSelector.maxIndex+1||t.dataSource.length).map((t=>Object.values(t[e]))).map((e=>e.reduce(((e,t)=>e+t))))))));else{if("waterfall"===t.seriesGroups[0].type)return a=Math.max(...t.seriesGroups[0].series.map((e=>t.dataSource.slice(t._rangeSelector.minIndex||0,t._rangeSelector.maxIndex||t.dataSource.length).reduce(((t,a)=>t+(a[e.dataField]?a[e.dataField]:0)),0)))),a;for(let e of t.seriesGroups){let r=Math.max(...e.series.map((e=>Math.max(...t.dataSource.slice(t._rangeSelector.minIndex||0,t._rangeSelector.maxIndex||t.dataSource.length).map((t=>{let a=parseFloat(t[e.dataField])?parseFloat(t[e.dataField]):Number.NEGATIVE_INFINITY,r=parseFloat(t[e.dataFieldHigh])?parseFloat(t[e.dataFieldHigh]):Number.NEGATIVE_INFINITY,n=parseFloat(t[e.dataFieldTo])?parseFloat(t[e.dataFieldTo]):Number.NEGATIVE_INFINITY;return Math.max(a,r,n)}))))));a=Math.max(a,r)}}return a}_getScatterGridMaxValues(){const e=this;let t={x:Math.max(...e.seriesGroups.map((t=>Math.max(...t.dataSource.map((t=>t[e.xAxis.dataField])))))),y:Math.max(...e.seriesGroups.map((e=>Math.max(...e.dataSource.map((t=>t[e.series[0].dataField])))))),z:Math.max(...e.seriesGroups.map((t=>Math.max(...t.dataSource.map((t=>t[e.zAxis.dataField]))))))};return isNaN(e.xAxis.maxValue)||(t.x=e.xAxis.maxValue),isNaN(e.valueAxis.maxValue)||(t.y=e.valueAxis.maxValue),isNaN(e.zAxis.maxValue)||(t.z=e.zAxis.maxValue),t}_getScatterGridMinValues(){const e=this;let t={x:Math.min(...e.seriesGroups.map((t=>Math.min(...t.dataSource.map((t=>t[e.xAxis.dataField])))))),y:Math.min(...e.seriesGroups.map((e=>Math.min(...e.dataSource.map((t=>t[e.series[0].dataField])))))),z:Math.min(...e.seriesGroups.map((t=>Math.min(...t.dataSource.map((t=>t[e.zAxis.dataField]))))))};return isNaN(e.xAxis.minValue)||(t.x=e.xAxis.minValue),isNaN(e.valueAxis.minValue)||(t.y=e.valueAxis.minValue),isNaN(e.zAxis.minValue)||(t.z=e.zAxis.minValue),t}_getGridDepth(){const e=this;let t=e.seriesGroups.filter((e=>["stackedcolumn","stackedbar","stackedarea","stackedcolumn100","stackedbar100","stackedarea100","stackedline","stackedline100"].includes(e.type))).length;return 0===t&&e.seriesGroups.forEach((e=>t+=e.series.length)),t}_getGridRequiredSteps(e,t,a,r,n,i,o){let l;if(r.logarithmicScale){let t=0,a=r.logarithmicScaleBase||10;for(;Math.pow(a,t)<=e;)t++;return l=t,l}return a>0?(l=Math.ceil((e-t)/a),o&&(r._maxValue=t+l*a),l):(l=Math.ceil(n/i),l)}_getGridLinePoints(e,t,a,r=!1,n={}){let i=[];if(n.logarithmicScale){let e=n.logarithmicScaleBase||10,t=-1;for(;Math.pow(e,t)<=n._maxValue;)t++,i.push(Math.pow(e,t));return n._maxValue=i[i.length-1],i}let o=(e-t)/a;o=r?Math.ceil(o):o;let l=t;for(let e=0;e<=a;e++)i.push(l),l+=o;return i}_getGridLines(e,t){let a=[];for(let r=0;r<e.length;r+=t)a.push(e[r]);return a}_getGridValueLabels(e,t){let a=[];for(let r=0;r<e.length;r+=t)a.push(e[r]);return a}_calcGridDimension(e,t,a,r){let n=t*e.slotWidthX,i=a*e.slotWidthZ;!1===e.dynamicWidth&&(n=e.width);let o=n/t,l=e.slotWidthZ;return r&&(i=n,l=o),{height:this.gridOptions.height,widthX:n,widthZ:i,cell:{x:o,z:l}}}_drawLine(e,t,a,r,n){let i=a.color;a.colorFunction&&void 0!==n&&(i=a.colorFunction(n,i));const o=new window.THREE.LineBasicMaterial({color:i||r}),l=(new window.THREE.BufferGeometry).setFromPoints([new window.THREE.Vector3(e.x,e.y,e.z),new window.THREE.Vector3(t.x,t.y,t.z)]);return new window.THREE.Line(l,o)}_createLabel(e,t,a,r,n){const i=document.createElement("div");i.className=t.join(" ");let o=r?`style="transform: rotate(${r}deg)"`:"";i.innerHTML=`<div ${o}>${e}</div>`;const l=new window.THREE.CSS2DObject(i);return l.position.copy(a),n&&Object.keys(n).forEach((e=>{l.userData[e]=n[e]})),l}_drawGrid(e,t,a,r){const n=this,i=n.gridOptions;let o=a=>(a-t._minValue)*e.height/(t._maxValue-t._minValue);if(t.logarithmicScale){const a=t.logarithmicScaleBase||10;o=r=>n._getBaseLog(a,r)*e.height/n._getBaseLog(a,t._maxValue)}const l={x:-e.widthX/2,y:0,z:-e.widthZ/2},s=new window.THREE.Object3D,d=new window.THREE.Object3D,u=new window.THREE.Object3D,c=new window.THREE.Object3D;s.userData.gridWalls={side:d,back:u,floor:c},s.userData.gridLabels={frontLabels:[],sideLabels:[],valueLabels:[]};const p=o(t._baseLine);if(t.gridLines.visible)for(let a=0;a<=2;a++){let r={x:l.x+(1===a)*e.widthX,y:l.y,z:l.z+(2===a)*e.widthZ},o={x:l.x+(1===a)*e.widthX,y:l.y+e.height,z:l.z+(2===a)*e.widthZ};const s=n._drawLine(r,o,t.gridLines,i.lineColor);let c;switch(a){case 0:d.add(s),c=s.clone(),u.add(c);break;case 1:u.add(s);break;case 2:d.add(s)}}if(a.gridLines.visible&&r.gridLines.visible){let a={x:l.x,y:l.y,z:l.z+e.widthZ},r={x:l.x+e.widthX,y:l.y,z:l.z+e.widthZ},o=n._drawLine(a,r,t.gridLines,i.lineColor);c.add(o),a={x:l.x,y:l.y,z:l.z},r={x:l.x+e.widthX,y:l.y,z:l.z},o=n._drawLine(a,r,t.gridLines,i.lineColor),c.add(o);let s={x:l.x+e.widthX,y:l.y,z:l.z},d={x:l.x+e.widthX,y:l.y,z:l.z+e.widthZ},u=n._drawLine(s,d,t.gridLines,i.lineColor);c.add(u),s={x:l.x,y:l.y,z:l.z},d={x:l.x,y:l.y,z:l.z+e.widthZ},u=n._drawLine(s,d,t.gridLines,i.lineColor),c.add(u)}t.gridLines.visible&&t._gridLines.forEach((a=>{const r={x:l.x,y:l.y+o(a),z:l.z},s={x:l.x+e.widthX,y:l.y+o(a),z:l.z},c={x:l.x,y:l.y+o(a),z:l.z+e.widthZ},p=n._drawLine(r,s,t.gridLines,i.lineColor,a),m=n._drawLine(r,c,t.gridLines,i.lineColor,a);u.add(p),d.add(m)})),a.gridLines.visible&&a._gridLines.forEach(((t,r)=>{const o=e.widthX/a._gridLines.length,s={x:l.x+(r+1)*o,y:l.y,z:l.z},d={x:l.x+(r+1)*o,y:l.y,z:l.z+e.widthZ},u=n._drawLine(s,d,a.gridLines,i.lineColor);c.add(u)})),r.gridLines.visible&&r._gridLines.forEach(((t,a)=>{const o={x:l.x,y:l.y,z:l.z+(a+1)*e.cell.z},s={x:l.x+e.widthX,y:l.y,z:l.z+(a+1)*e.cell.z},d=n._drawLine(o,s,r.gridLines,i.lineColor);c.add(d)})),t.labels.visible&&t._labelPoints.forEach(((a,r)=>{const i={x:l.x,y:l.y+o(a)+t.labels.offset.y+.5,z:l.z+e.widthZ},d={positionOne:i,positionTwo:{x:i.x+e.widthX,y:i.y,z:i.z},positionThree:{x:i.x,y:i.y,z:i.z-e.widthZ},positionFour:{x:i.x+e.widthX,y:i.y,z:i.z-e.widthZ}},u=n._createLabel(t._labels[r],["smart-3d-chart-value-axis-label",t.labels.class],i,t.labels.angle,d);s.add(u),n._scaledLabels.push(u),s.userData.gridLabels.valueLabels.push(u)})),a.labels.visible&&a._labelPoints.forEach(((t,r)=>{const i=e.widthX/a._labelPoints.length,o={x:l.x+(r+1)*i-i/2,y:p+(a.labels.offset.y||0),z:l.z+e.widthZ+(a.labels.offset.z||0)},d={positionOne:o,positionTwo:{x:o.x,y:o.y,z:o.z-e.widthZ}},u=n._createLabel(a._labels[r],["smart-3d-chart-x-axis-label",a.labels.class],o,a.labels.angle,d);s.add(u),n._scaledLabels.push(u),s.userData.gridLabels.frontLabels.push(u)})),r.labels.visible&&r._labelPoints.forEach(((t,a)=>{const i=e.widthZ/r._labelPoints.length,o={x:l.x+e.widthX,y:p,z:l.z+(a+1)*i-i/2},d={positionOne:o,positionTwo:{x:o.x-e.widthX,y:o.y,z:o.z}},u=n._createLabel(r._labels[a],["smart-3d-chart-z-axis-label",r.labels.class],o,r.labels.angle,d);s.add(u),n._scaledLabels.push(u),s.userData.gridLabels.sideLabels.push(u)})),d.position.set(0,0,0),u.position.set(0,0,0),c.position.set(0,p,0),s.position.set(0,-e.height/2,0),s.add(d),s.add(u),s.add(c),n._scene.add(s),n._grid=s,s.userData.gridProps={height:e.height,width:e.widthX,depthWidth:e.widthZ,maxValue:t._maxValue,minValue:t._minValue,slot:e.cell,floorHeight:p,origin:{x:l.x,y:l.y-e.height/2,z:l.z}},s.userData.tempObjects=[],s.userData.isInverted=t.isInverted||!1,t.isInverted&&s.rotateX(Math.PI)}_createGrid(e,t){const a=this,r=a._getAxisLabels(),n=t?r.zAxis.lenght:a._getGridDepth();let i,o,l=a._calcGridDimension(a.gridOptions,r.xAxis.length,n,t),s=a.valueAxis,d=a.xAxis,u=a.zAxis;if(t&&(i=a._getScatterGridMaxValues(),o=a._getScatterGridMinValues()),s._maxValue=t?i.y:a._getGridMaxValue(e),s._minValue=t?o.y:a._getGridMinValue(e),s._maxValue===s._minValue&&(s._maxValue+=s.unitInterval||s._maxValue/2,s._minValue-=s.unitInterval||s._maxValue/2),s._baseLine=null===s.baselineValue?s._minValue:s.baselineValue,s._requiredSteps=a._getGridRequiredSteps(s._maxValue,s._minValue,s.unitInterval,s,a.gridOptions.height,3,!0),s._linePoints=a._getGridLinePoints(s._maxValue,s._minValue,s._requiredSteps,!1,s),s._gridLines=a._getGridLines(s._linePoints,s.gridLines.step||1,s),s._labelPoints=a._getGridValueLabels(s._linePoints,s.labels.step||1,s),s._labels=s._labelPoints.map((e=>a._getFormattedValue(e,s.formatSettings,s.formatFunction))),d._elementsCount=r.xAxis.length,d._maxValue=t?i.x:d.maxValue,d._minValue=t?o.x:d.minValue,t)d._requiredSteps=a._getGridRequiredSteps(d._maxValue,d._minValue,d.unitInterval,d,l.widthX,5),d._linePoints=a._getGridLinePoints(d._maxValue,d._minValue,d._requiredSteps),d._gridLines=a._getGridLines(d._linePoints,d.gridLines.step||1),d._labelPoints=a._getGridValueLabels(d._linePoints,d.labels.step||1),d._labels=d._labelPoints.map((e=>a._getFormattedValue(e,d.formatSettings,d.formatFunction,d.type))),l.cell.x=l.widthX/d._linePoints.length;else{for(d._requiredSteps=Math.min(a._getGridRequiredSteps(d._elementsCount,0,d.unitInterval,d,l.widthX,5),d._elementsCount),d._linePoints=a._getGridLinePoints(d._elementsCount,0,d._requiredSteps,!0);d._linePoints[d._linePoints.length-1]>=d._elementsCount;)d._linePoints.pop();d._gridLines=a._getGridLines(d._linePoints,d.gridLines.step||1),d._labelPoints=a._getGridValueLabels(d._linePoints,d.labels.step||1),d._labels=d._labelPoints.map((e=>a._getFormattedValue(r.xAxis[e],d.formatSettings,d.formatFunction,d.type)))}if(u._elementsCount=n,u._maxValue=t?i.z:u.maxValue,u._minValue=t?o.z:u.minValue,t)u._requiredSteps=a._getGridRequiredSteps(u._maxValue,u._minValue,u.unitInterval,u,l.widthZ,5),u._linePoints=a._getGridLinePoints(u._maxValue,u._minValue,u._requiredSteps),u._gridLines=a._getGridLines(u._linePoints,u.gridLines.step||1),u._labelPoints=a._getGridValueLabels(u._linePoints,u.labels.step||1),u._labels=u._labelPoints.map((e=>a._getFormattedValue(e,u.formatSettings,u.formatFunction,u.type))),l.cell.z=l.widthZ/u._linePoints.length;else{for(u._requiredSteps=Math.min(a._getGridRequiredSteps(u._elementsCount,0,u.unitInterval,u,l.widthZ,5),u._elementsCount),u._linePoints=a._getGridLinePoints(u._elementsCount,0,u._requiredSteps,!0);u._linePoints[u._linePoints.length-1]>=u._elementsCount;)u._linePoints.pop();u._gridLines=a._getGridLines(u._linePoints,u.gridLines.step||1),u._labelPoints=a._getGridValueLabels(u._linePoints,u.labels.step||1),u._labels=u._labelPoints.map((e=>a._getFormattedValue(r.zAxis[e],u.formatSettings,u.formatFunction,u.type)))}a._drawGrid(l,s,d,u,t)}_gridNeeded(){const e=this;return e.seriesGroups.filter((t=>e._seriesGridTypes.indexOf(t.type)>-1)).length>0}_setChart(){const e=this,t=e.seriesGroups;if(e._updating)return;e._clearScene();const a=e._gridNeeded(),r=t.filter((e=>e.type.includes("stacked"))).length>0,n=t.filter((e=>e.type.includes("pyramid"))).length>0,i=t.filter((e=>e.type.includes("scatter"))).length>0;a&&e._createGrid(r,i);for(let r=0;r<t.length;r++){let n=t[r];"pie"===n.type||"donut"===n.type?e._setPieChartData(r):"pyramid"===n.type?e._setPyramidChartData(r):a&&(n.type.includes("scatter")?e._setScatterChartData(r):e._setGridChartData(r),n.bands&&e._setBands(r))}let o=e.legendIndex;if("auto"===o&&(o=r?"group":"serie"),e.showLegend){let t=a?e._createGridLegend(o,i):e._createPieLegend(n);e.querySelector(".smart-3d-chart-container").appendChild(t),e._setLegendLayout(t)}e.showLegendTable&&e._fillLegendTable(o)}_fillLegendTable(){const e=this,t=e.querySelector(".smart-3d-chart-legend-table tbody");t.setAttribute("filled","true");for(let a=0;a<e.seriesGroups.length;a++){for(let r=0;r<e.dataSource.length;r++){const n=e._getObjectsByIndexes(a,null,r);for(let i=0;i<n.length;i++){const o=n[i];let l=e._createLegendItem(o.userData.groupIndex,o.userData.serieIndex,o.userData.itemIndex,o.userData.color,o.userData.color,null,o.userData.hidden),s=t.children[a].children[r+1].firstChild;s.appendChild(l),s.children.length>3&&s.removeChild(s.children[0])}}let r=e._createLegendItem(a,null,null,e.seriesGroups[a].legendFillColor||e._getColorFromScheme(e.colorScheme,a),e.seriesGroups[a].legendFillColor||e._getColorFromScheme(e.colorScheme,a),"",!e._groupIsShown(a)),n=t.children[a].children[e.dataSource.length+1];n.children.length>0&&n.removeChild(n.children[0]),n.appendChild(r)}}_animateTo(e,t,a,r){e.progress||(e.progress=0),e.progress+=r?.015*this.cameraAnimationSpeed:.05;const n=new window.THREE.Vector3;return a.y=a.y||0,n.lerpVectors(t.position,a,e.progress),t.position.set(n.x,n.y,n.z),!(e.progress>=1)}_transition(e,t,a,r){const n=this;r/=50;const i="zoom"===a?n._camera.zoom-t:e.material[a]-t;return!i||Math.abs(i)<=r?("zoom"===a?n._camera.zoom=t:e.material[a]=t,!1):("zoom"===a?n._camera.zoom-=r*i/Math.abs(i):e.material[a]-=r*i/Math.abs(i),!0)}setCameraMode(e="default"){const t=this;"default"===e?t._controls.mouseButtons={LEFT:window.THREE.MOUSE.ROTATE,MIDDLE:window.THREE.MOUSE.DOLLY,RIGHT:window.THREE.MOUSE.PAN}:"pan"===e?t._controls.mouseButtons={LEFT:window.THREE.MOUSE.PAN,MIDDLE:window.THREE.MOUSE.DOLLY,RIGHT:window.THREE.MOUSE.ROTATE}:"zoom"===e&&(t._controls.mouseButtons={LEFT:window.THREE.MOUSE.DOLLY,MIDDLE:window.THREE.MOUSE.ROTATE,RIGHT:window.THREE.MOUSE.PAN})}setDefaultPosition(){const e=this;e._controls.target.set(0,0,0),e._camera.position.set(e.cameraPosition.x,e.cameraPosition.y,e.cameraPosition.z);const t=e.querySelector(".smart-3d-chart-control-reset-camera");t&&(t.style.display="none")}_setControls(){const e=this;let t=e.querySelector(".smart-3d-chart-controls");for(;t.firstChild;)t.removeChild(t.firstChild);t&&e.enableControlsToolbar&&e.controlsToolbarItems.forEach((a=>{if("string"==typeof a){let r=document.createElement("div");r.className="smart-3d-chart-control smart-3d-chart-control-"+a,t.appendChild(r);let n=document.createElement("smart-tooltip");n.selector=r,n.position="bottom",n.className="smart-3d-chart-control-tooltip material animation",n.arrow=!0;let i=a.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}));if(n.innerHTML=e.localize(i),"camera-control"!==a&&(r.classList.add("smart-3d-chart-control-button"),t.appendChild(n)),"reset-camera"===a)r.addEventListener("click",(()=>{e.setDefaultPosition()})),r.style.display="none";else if("zoom-in"===a){let t;r.addEventListener("mousedown",(()=>{t=setInterval((()=>{e.setCameraZoom(1.03)}),100)})),r.addEventListener("mouseup",(()=>{clearInterval(t)}))}else if("zoom-out"===a){let t;r.addEventListener("mousedown",(()=>{t=setInterval((()=>{e.setCameraZoom(.97)}),100)})),r.addEventListener("mouseup",(()=>{clearInterval(t)}))}else if("save-image"===a)r.addEventListener("click",(()=>{e.saveAsPNG()}));else if("camera-control"===a){let t=`<smart-drop-down-list class="smart-3d-chart-control-drop-down-list">\n <smart-list-item value="default" selected><span class='smart-3d-chart-control-camera-mode smart-3d-chart-control-list-item'></span>${e.localize("cameraMode")}</smart-list-item>\n <smart-list-item value="pan"><span class='smart-3d-chart-control-pan-mode smart-3d-chart-control-list-item'></span>${e.localize("panMode")}</smart-list-item>\n <smart-list-item value="zoom"><span class='smart-3d-chart-control-zoom-mode smart-3d-chart-control-list-item'></span>${e.localize("zoomMode")}</smart-list-item>\n </smart-down-list>`;r.innerHTML=t,r.querySelector("smart-drop-down-list").addEventListener("change",(function(t){e.setCameraMode(t.detail.value)}))}}else{let e=document.createElement("div");if(e.className="smart-3d-chart-control smart-3d-chart-control-"+a.name,e.innerHTML=a.content,t.appendChild(e),a.init&&e.init(e),a.action){let t=e.querySelector("smart-button")||e.querySelector("button")||e.querySelector("smart-toggle-button")||e.querySelector("smart-repeat-button");t?t.addEventListener("click",a.action):e.addEventListener("click",a.action)}}}))}_setCaption(){const e=this;let t=e.querySelector(".smart-3d-chart-caption");t||(t=document.createElement("div"),t.classList.add("smart-3d-chart-caption"),e.querySelector(".smart-3d-chart-container").appendChild(t)),t.innerHTML=`<h3>${e.caption}</h3><p>${e.description}</p>`}_setToolTipContent(e,t,a=""){const r=this.querySelector(".smart-3d-chart-tooltip");let n=`<div class='smart-3d-chart-tooltip-heading'>${e}</div>`;""!==t&&(n+=`<div class='smart-3d-chart-tooltip-body'>${t}</div>`),r.innerHTML=n,r.style.borderColor=a}_toolTipMove(e){const t=this.querySelector(".smart-3d-chart-tooltip");t.style.left=e.pageX-window.pageXOffset+"px",t.style.top=e.pageY-43-window.pageYOffset+"px"}_setToolTip(){const e=this;if(!e._mouseIsValid)return;e.classList.add("smart-3d-chart-hover");const t=e.querySelector(".smart-3d-chart-tooltip");e.addEventListener("mousemove",e._toolTipMove.bind(e)),setTimeout((function(){t.style.display="block"}),1)}_removeToolTip(){const e=this;e.querySelector(".smart-3d-chart-tooltip").style.display="none",e.classList.remove("smart-3d-chart-hover"),e.removeEventListener("mousemove",e._toolTipMove.bind(e))}_shadeHexColor(e,t){var a=parseInt(e.slice(1),16),r=t<0?0:255,n=t<0?-1*t:t,i=a>>16,o=a>>8&255,l=255&a;return"#"+(16777216+65536*(Math.round((r-i)*n)+i)+256*(Math.round((r-o)*n)+o)+(Math.round((r-l)*n)+l)).toString(16).slice(1)}_buildSource(){const e=this;let t=JSON.parse(JSON.stringify(e.dataSource));e.seriesGroups.forEach(((e,a)=>{e.dataSource&&e.dataSource.forEach(((r,n)=>{t[n]||(t[n]={}),t[n][e.dataField||"group-"+a]=r}))})),e.bindedSource=t}_getBackground(){const e=this;if(6===e.backgroundTexture.length)return(new window.THREE.CubeTextureLoader).load(e.backgroundTexture);if(e.backgroundImage)return(new window.THREE.TextureLoader).load(e.backgroundImage);if(e.backgroundGradient.length>0){const t=document.createElement("canvas");t.width=e.width,t.height=e.remainingHeight;const a=t.getContext("2d"),r=a.createLinearGradient(0,0,0,e.remainingHeight);return e.backgroundGradient.forEach((e=>{let t=e.split(", ");r.addColorStop(t[0],t[1])})),a.fillStyle=r,a.fillRect(0,0,e.width,e.remainingHeight),new window.THREE.CanvasTexture(t)}return"dark"===e.theme&&"#ffffff"===e.backgroundColor?e.backgroundColor="#000000":"#000000"===e.backgroundColor&&(e.backgroundColor="#ffffff"),new window.THREE.Color(e.backgroundColor)}_setScene(){const e=this;let t=new window.THREE.Scene;t.background=e._getBackground();let a=new window.THREE.DirectionalLight(e.lightColor,.5);a.position.set(0,15,0),t.add(a);let r=new window.THREE.DirectionalLight(e.lightColor,.2);r.position.set(0,-15,0),t.add(r);let n=new window.THREE.AmbientLight(e.lightColor,.8);t.add(n);let i=new window.THREE.DirectionalLight(e.lightColor,.25);i.position.set(0,0,10),t.add(i);let o=new window.THREE.DirectionalLight(e.lightColor,.1);o.position.set(0,0,-15),t.add(o);var l=new window.THREE.PerspectiveCamera(75,e.width/e.remainingHeight,1,1e3);l.position.set(e.cameraPosition.x,e.cameraPosition.y,e.cameraPosition.z),l.zoom=e.cameraZoom,l.updateProjectionMatrix();let s=e._renderer;s||(s=new window.THREE.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0,outputEncoding:window.THREE.sRGBEncoding,physicallyCorrectLights:!0}),s.setPixelRatio(window.devicePixelRatio),s.domElement.classList.add("smart-3d-chart-canvas"),e.querySelector(".smart-3d-chart-container")&&e.querySelector(".smart-3d-chart-container").appendChild(s.domElement)),s.setSize(e.width,e.remainingHeight);let d=e._labelRenderer;d||(d=new window.THREE.CSS2DRenderer,d.domElement.style.position="absolute",d.domElement.style.top="0px",d.domElement.style.pointerEvents="none",d.domElement.style.zIndex="1",e.querySelector(".smart-3d-chart-container")&&e.querySelector(".smart-3d-chart-container").appendChild(d.domElement)),d.setSize(e.width,e.remainingHeight);let u=new window.THREE.OrbitControls(l,s.domElement);u.enableDamping=e.controlsSettings.enableDamping,u.dampingFactor=e.controlsSettings.dampingFactor,u.enableZoom=e.controlsSettings.enableZoom,u.enablePan=e.controlsSettings.enablePan,u.enableKeys=e.controlsSettings.enableKeys,u.enableRotate=e.controlsSettings.enableRotate,u.autoRotate=e.autoRotate,u.autoRotateSpeed=e.autoRotateSpeed,u.currentTarget={x:0,y:0,z:0},u.target.set(0,0,0),e._controls=u;const c=new window.THREE.RoomEnvironment,p=new window.THREE.PMREMGenerator(s);t.environment=p.fromScene(c).texture,c.dispose(),e._scene=t,e._renderer=s,e._labelRenderer=d,e._camera=l,e._controls=u}_updateWalls(e){const t=this,a=t._grid.userData.isInverted;if(e.position.z>=0&&t._grid.userData.gridWalls.back.userData.flipped){t._grid.userData.gridWalls.back.userData.flipped=!1,t._grid.userData.gridWalls.back.rotateX(Math.PI),t._grid.userData.gridWalls.back.rotateZ(Math.PI);for(const e of t._grid.userData.gridLabels.frontLabels)e.position.copy(e.userData.positionOne)}else if(e.position.z<0&&!t._grid.userData.gridWalls.back.userData.flipped){t._grid.userData.gridWalls.back.userData.flipped=!0,t._grid.userData.gridWalls.back.rotateY(Math.PI);for(const e of t._grid.userData.gridLabels.frontLabels)e.position.copy(e.userData.positionTwo)}if(e.position.x>=0&&t._grid.userData.gridWalls.side.userData.flipped&&!1===a||e.position.y>=0&&t._grid.userData.gridWalls.side.userData.flipped&&!0===a){t._grid.userData.gridWalls.side.userData.flipped=!1,t._grid.userData.gridWalls.side.rotateY(Math.PI);for(const e of t._grid.userData.gridLabels.sideLabels)e.position.copy(e.userData.positionOne)}else if(e.position.x<0&&!t._grid.userData.gridWalls.side.userData.flipped&&!1===a||e.position.y<0&&!t._grid.userData.gridWalls.side.userData.flipped&&!0===a){t._grid.userData.gridWalls.side.userData.flipped=!0,t._grid.userData.gridWalls.side.rotateY(Math.PI);for(const e of t._grid.userData.gridLabels.sideLabels)e.position.copy(e.userData.positionTwo)}if(t._grid.userData.gridWalls.back.userData.flipped||t._grid.userData.gridWalls.side.userData.flipped)if(t._grid.userData.gridWalls.back.userData.flipped&&!t._grid.userData.gridWalls.side.userData.flipped)for(const e of t._grid.userData.gridLabels.valueLabels)!1===a?e.position.copy(e.userData.positionTwo):e.position.copy(e.userData.positionThree);else if(!t._grid.userData.gridWalls.back.userData.flipped&&t._grid.userData.gridWalls.side.userData.flipped)for(const e of t._grid.userData.gridLabels.valueLabels)!1===a?e.position.copy(e.userData.positionThree):e.position.copy(e.userData.positionTwo);else for(const e of t._grid.userData.gridLabels.valueLabels)e.position.copy(e.userData.positionFour);else for(const e of t._grid.userData.gridLabels.valueLabels)e.position.copy(e.userData.positionOne)}_animateDrawChart(){const e=this;e._drawComplete=!0,e._chartObjects.forEach((function(t,a){t.userData.drawAnimate()||a!==e._chartObjects.length-1||(e._drawComplete=!1)})),e._drawComplete&&e._grid&&e._grid.userData.tempObjects.forEach((t=>{e._grid.remove(t)}))}_chartResize(e){const t=e.getBoundingClientRect();if(e.width=t.width-2,e.height=t.height-2,e.remainingHeight=e.height,e.$.fireEvent("resizeBegin",{}),e.querySelector(".smart-3d-chart-footer").children.length>0){let t=e.querySelector(".smart-3d-chart-footer").getBoundingClientRect().height;e.remainingHeight-=t}else e.querySelector(".smart-3d-chart-footer").style.display="none";e._camera.aspect=e.width/e.remainingHeight,e._camera.updateProjectionMatrix(),e._renderer.setSize(e.width,e.remainingHeight),e._labelRenderer.setSize(e.width,e.remainingHeight),e.querySelector(".smart-3d-chart-legend")&&e._setLegendLayout(e.querySelector(".smart-3d-chart-legend")),e.querySelector(".smart-3d-chart-range-selector")&&e._setRangeValues(!1),e.$.fireEvent("resizeEnd",{})}addColorScheme(e,t){this.colorSchemes.push({name:e,colors:t})}getColorScheme(e){return this.colorSchemes.find((t=>t.name===e))}removeColorScheme(e){let t=this.colorSchemes.findIndex((t=>t.name===e));t>-1&&this.colorSchemes.splice(t,1)}render(){const e=this;super.render(),e._setDefaults(),e.refresh(!0),"undefined"==typeof THREE&&e.error(e.localize("missingReference",{elementType:e.nodeName.toLowerCase(),files:"three.js"})),window.addEventListener("resize",(function(){e._chartResize(e)}),!1),e.addEventListener("mouseover",(function(){e._mouseEntered=!0})),e.addEventListener("mousemove",(function(){e._mouseEntered&&(e._mouseIsValid=!0)})),e.addEventListener("pointermove",(function(t){const a=e._renderer.domElement.getBoundingClientRect(),r=e._renderer.domElement,n=t.clientX-a.left,o=t.clientY-a.top;i.x=n/r.clientWidth*2-1,i.y=o/r.clientHeight*-2+1})),e.addEventListener("pointerdown",(function(e){a=e.pageX,r=e.pageY,n=Date.now()})),e.addEventListener("pointerup",(function(o){t.setFromCamera(i,e._camera);const l=e._chartObjects,[s]=t.intersectObjects(l,!1);let d=o.pageX-a,u=o.pageY-r;const c=Date.now()-n;if(s&&d<=5&&u<=5&&c<300)for(let t=0;t<l.length;t++){const a=l[t];s.object.uuid===a.uuid&&(a.userData.selected?a.userData.unselectObject():a.userData.selectObject(),e.$.fireEvent("itemClick",{groupIndex:a.userData.groupIndex,seriesIndex:a.userData.serieIndex,itemIndex:a.userData.itemIndex}))}})),e.querySelector(".smart-3d-chart-container").style.height=e.remainingHeight+"px";const t=new window.THREE.Raycaster;let a,r,n,i=new window.THREE.Vector2;!function a(){requestAnimationFrame(a),function(){e._grid&&e._updateWalls(e._camera),t.setFromCamera(i,e._camera);const a=e._chartObjects,r=t.intersectObjects(a);e._animateDrawChart();let n=[];for(let t=e._inMotionQueue.length-1;t>=0;t--){let a=e._inMotionQueue[t];n.includes(a.obj.uuid)?e._inMotionQueue.splice(t,1):(e._animateTo(a,a.obj,a.target,"camera"===a.type)||e._inMotionQueue.splice(t,1),n.push(a.obj.uuid))}let o,l=[],s=Array.from(e._inTransitionQueue).reverse();for(let t=0;t<s.length;t++){let a=s[t];l.includes(a.obj.uuid)?e._inTransitionQueue.splice(t,1):(e._transition(a.obj,a.targetValue,"camera"===a.type?"zoom":"opacity",e.transitionSpeed)||e._inTransitionQueue.splice(t,1),l.push(a.obj.uuid))}for(let t=e._inTransitionQueue.length-1;t>=0;t--){let a=e._inTransitionQueue[t];l.includes(a.obj)||(e._transition(a.obj,a.targetValue,"camera"===a.type?"zoom":"opacity",e.transitionSpeed)||e._inTransitionQueue.splice(t,1),l.push(a.obj))}for(const t of e._scaledLabels){var d=new window.THREE.Vector3;d.copy(t.position);const a=1/d.distanceTo(e._camera.position);t.element.style.fontSize=Math.max(45*a,.5)+"em"}for(let e=0;e<a.length;e++)a[e].userData.highlighted&&a[e].userData.unhighlightObject();if(r.length>0)for(let e=0;e<a.length;e++)r[0].object.uuid===a[e].uuid&&(a[e].userData.highlightObject(!0),o!==a[e].uuid&&a[e].userData.showToolTip(),o=a[e].uuid);else for(let e=0;e<a.length;e++)a[e].userData.unhighlightObject();void 0===o&&!0!==e._colorHovered&&e._removeToolTip(),e.querySelector(".smart-3d-chart-controls")&&(Math.round(e._camera.position.x)===Math.round(e.cameraPosition.x)&&Math.round(e._camera.position.y)===Math.round(e.cameraPosition.y)&&Math.round(e._camera.position.z)===Math.round(e.cameraPosition.z)||e.querySelector(".smart-3d-chart-control-reset-camera")&&(e.querySelector(".smart-3d-chart-control-reset-camera").style.display="block")),e._controls.update(),e._renderer.render(e._scene,e._camera),e._labelRenderer.render(e._scene,e._camera),e._camera.updateProjectionMatrix()}()}()}});