@avs/go 0.14.71999 → 0.14.72000

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,7 +39,7 @@ const b=globalThis,S=b.trustedTypes,M=S?S.createPolicy("lit-html",{createHTML:t=
39
39
  * This product includes software developed at
40
40
  * Advanced Visual Systems Inc. (http://www.avs.com)
41
41
  */
42
- class st extends rt{_httpRequest(t,e,n,i){t||(this._dispatchErrorEvent("'url' property must point to an instance of AVS/Go server."),n());const r="0.14.71999".split("."),a=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2])],s={source:this.localName,model:i,version:a};fetch(t,{method:i?"POST":"GET",headers:{"Content-Type":"application/json"},body:i?JSON.stringify(s):void 0}).then((t=>t.json())).then((t=>{t.error?(this._processServerError(t.error),n&&n()):e&&e(t)})).catch((t=>{this._dispatchErrorEvent(t),n&&n()}))}_processServerError(t){if(!t)return;const e=JSON.parse(decodeURIComponent(t.replace(/\+/g,"%20")));let n="An error occurred on the AVS/Go server";for(const t in e)if(e.hasOwnProperty(t)){""!=n&&(n+="\n "),n+=t+": ";const i=e[t];i===Object(i)?n+=JSON.stringify(i):n+=e[t]}this._dispatchErrorEvent(n)}_dispatchErrorEvent(t){this.dispatchEvent(new CustomEvent("avs-error",{bubbles:!0,composed:!0,detail:t}))}}
42
+ class st extends rt{_httpRequest(t,e,n,i){t||(this._dispatchErrorEvent("'url' property must point to an instance of AVS/Go server."),n());const r="0.14.72000".split("."),a=[parseInt(r[0]),parseInt(r[1]),parseInt(r[2])],s={source:this.localName,model:i,version:a};fetch(t,{method:i?"POST":"GET",headers:{"Content-Type":"application/json"},body:i?JSON.stringify(s):void 0}).then((t=>t.json())).then((t=>{t.error?(this._processServerError(t.error),n&&n()):e&&e(t)})).catch((t=>{this._dispatchErrorEvent(t),n&&n()}))}_processServerError(t){if(!t)return;const e=JSON.parse(decodeURIComponent(t.replace(/\+/g,"%20")));let n="An error occurred on the AVS/Go server";for(const t in e)if(e.hasOwnProperty(t)){""!=n&&(n+="\n "),n+=t+": ";const i=e[t];i===Object(i)?n+=JSON.stringify(i):n+=e[t]}this._dispatchErrorEvent(n)}_dispatchErrorEvent(t){this.dispatchEvent(new CustomEvent("avs-error",{bubbles:!0,composed:!0,detail:t}))}}
43
43
  /**
44
44
  * @license
45
45
  * Copyright 2017 Google LLC
@@ -305,7 +305,7 @@ class bf extends st{render(){return z`
305
305
  <div id="spinner"></div>
306
306
  </div>
307
307
  <div id="tooltip"></div>
308
- `}static properties={manualUpdate:{type:Boolean,attribute:"manual-update"},displayCanvas:{type:Boolean,attribute:"display-canvas"},url:{type:String},urlLoadJsonFile:{type:Boolean,attribute:"url-load-json-file"},dataSourceName:{type:String,attribute:"data-source-name"},dataSourceUserProperties:{type:String,attribute:"data-source-user-properties"},sceneName:{type:String,attribute:"scene-name"},sceneUserProperties:{type:String,attribute:"scene-user-properties"},rendererName:{type:String,attribute:"renderer-name"},rendererUserProperties:{type:String,attribute:"renderer-user-properties"},renderer:{type:String},streamEnable:{type:Boolean,attribute:"stream-enable"},streamChunkSizeFirst:{type:Number,attribute:"stream-chunk-size-first"},streamChunkSize:{type:Number,attribute:"stream-chunk-size"},themeName:{type:String,attribute:"theme-name"},hidden:{type:Boolean},resizeThreshold:{type:Number,attribute:"resize-threshold"},aspectRatio:{type:Number,attribute:"aspect-ration"},pointerTimeout:{type:Number,attribute:"pointer-timeout"},tapEnable:{type:Boolean,attribute:"tap-enable"},tapLevel:{type:String,attribute:"tap-level"},tapDepth:{type:String,attribute:"tap-depth"},tapHighlightEnable:{type:Boolean,attribute:"tap-highlight-enable"},tapHighlightColor:{type:String,attribute:"tap-highlight-color"},tapHighlightLayerEnable:{type:Boolean,attribute:"tap-highlight-layer-enable"},tapProcessEventOnClient:{type:Boolean,attribute:"tap-process-event-on-client"},trackEnable:{type:Boolean,attribute:"track-enable"},trackLevel:{type:String,attribute:"track-level"},trackDepth:{type:String,attribute:"track-depth"},trackHighlightEnable:{type:Boolean,attribute:"track-highlight-enable"},trackHighlightColor:{type:String,attribute:"track-highlight-color"},trackHighlightLayerEnable:{type:Boolean,attribute:"track-highlight-layer-enable"},trackProcessEventOnClient:{type:Boolean,attribute:"track-process-event-on-client"},hoverEnable:{type:Boolean,attribute:"hover-enable"},hoverLevel:{type:String,attribute:"hover-level"},hoverDepth:{type:String,attribute:"hover-depth"},hoverHighlightEnable:{type:Boolean,attribute:"hover-highlight-enable"},hoverHighlightColor:{type:String,attribute:"hover-highlight-color"},hoverHighlightLayerEnable:{type:Boolean,attribute:"hover-highlight-layer-enable"},transformEnable:{type:Boolean,attribute:"transform-enable"},transformClientOnly:{type:Boolean,attribute:"transform-client-only"},transformRotateDisable:{type:Boolean,attribute:"transform-rotate-disable-changed"},transformZoomDisable:{type:Boolean,attribute:"transform-zoom-disable"},transformPanDisable:{type:Boolean,attribute:"transform-pan-disable"},transformTwistAngle:{type:Number,attribute:"transform-twist-angle"},transformTiltAngle:{type:Number,attribute:"transform-tilt-angle"},transformScale:{type:Number,attribute:"transform-scale"},motionCapture:{type:String,attribute:"motion-capture"},zoomRectangleEnable:{type:Boolean,attribute:"zoom-rectangle-enable"},panEnable:{type:Boolean,attribute:"pan-enable"},panZoomEnable:{type:Boolean,attribute:"pan-zoom-enable"},panWidthZoomLevel:{type:Number,attribute:"pan-width-zoom-level"},panHeightZoomLevel:{type:Number,attribute:"pan-height-zoom-level"},panMaximumZoomLevel:{type:Number,attribute:"pan-maximum-zoom-level"},animatedGlyphsVisible:{type:Boolean,attribute:"animated-glyphs-visible"},animatedGlyphsEnable:{type:Boolean,attribute:"animated-glyphs-enable"},motionCaptureControlsEnable:{type:Boolean,attribute:"motion-capture-controls-enable"}};_rectangleStyle(){this.rectCtx.setLineDash([3]),this.rectCtx.strokeStyle="#ff0000"}_assembleModel(t){if(!this.sceneName)return void this._dispatchErrorEvent("'scene-name' property must be set to the name of the scene registered in the library map on the AVS/Go server.");const e={sceneProperties:{name:this.sceneName}};if(this.sceneUserProperties){let t;try{t=JSON.parse(this.sceneUserProperties)}catch(t){return void this._dispatchErrorEvent("Can't parse 'scene-user-properties'. "+t.message)}e.sceneProperties.userProperties=t}const n={width:this.width,height:this.height,name:this.rendererName,type:this.renderer};if(this.rendererUserProperties){let t;try{t=JSON.parse(this.rendererUserProperties)}catch(t){return void this._dispatchErrorEvent("Can't parse 'renderer-user-properties'. "+t.message)}n.userProperties=t}e.rendererProperties=n,this.transformInteractor&&(this.transformMatrix=this.transformInteractor.object.matrix.elements.slice()),this.transformMatrix&&!this.transformClientOnly&&(n.transformMatrix=this.transformMatrix),t&&(this.transformClientOnly&&this.transformInteractor?this.transformInteractor.fullReset=t:n.fullReset=!0),this.panEnable&&(n.panProperties={widthZoomLevel:Math.min(this.panWidthZoomLevel,this.panMaximumZoomLevel),heightZoomLevel:Math.min(this.panHeightZoomLevel,this.panMaximumZoomLevel)}),n.themeName=this.themeName;var i=window.getComputedStyle(this,null),r=i.getPropertyValue("background-color").trim(),a=i.getPropertyValue("color").trim(),s=i.getPropertyValue("font-family").trim().replace(/['"]+/g,"");if(n.cssProperties={sceneBackgroundType:"Solid",sceneBackgroundColor:r,sceneLineColor:a,sceneTextColor:a,sceneFontFamily:s,sceneSurfaceColor:a},this._applyCustomCssProperties(n.cssProperties,i,{sceneBackgroundType:"--avs-scene-background-type",sceneBackgroundColor:"--avs-scene-background-color",sceneBackgroundStartColor:"--avs-scene-background-start-color",sceneBackgroundEndColor:"--avs-scene-background-end-color",sceneBackgroundGradientStyle:"--avs-scene-background-gradient-style",sceneBackgroundGradientInterpolation:"--avs-scene-background-gradient-interpolation",sceneBackgroundGradientColorRepeat:"--avs-scene-background-gradient-color-repeat",sceneHighlightColor:"--avs-scene-highlight-color",sceneSurfaceColor:"--avs-scene-surface-color",scenePointColor:"--avs-scene-point-color",sceneLineColor:"--avs-scene-line-color",sceneLineWidth:"--avs-scene-line-width",sceneTextColor:"--avs-scene-text-color",sceneTextRotation:"--avs-scene-text-rotation",sceneFontFamily:"--avs-scene-font-family",sceneFontStyle:"--avs-scene-font-style",sceneFontWeight:"--avs-scene-font-weight",sceneFontSize:"--avs-scene-font-size",sceneTitleTextColor:"--avs-scene-title-text-color",sceneTitleTextRotation:"--avs-scene-title-text-rotation",sceneTitleFontFamily:"--avs-scene-title-font-family",sceneTitleFontStyle:"--avs-scene-title-font-style",sceneTitleFontWeight:"--avs-scene-title-font-weight",sceneTitleFontSize:"--avs-scene-title-font-size",chartBackgroundType:"--avs-chart-background-type",chartBackgroundColor:"--avs-chart-background-color",chartBackgroundStartColor:"--avs-chart-background-start-color",chartBackgroundEndColor:"--avs-chart-background-end-color",chartBackgroundGradientStyle:"--avs-chart-background-gradient-style",chartBackgroundGradientInterpolation:"--avs-chart-background-gradient-interpolation",chartBackgroundGradientColorRepeat:"--avs-chart-background-gradient-color-repeat",chartHighlightColor:"--avs-chart-highlight-color",chartSurfaceColor:"--avs-chart-surface-color",chartPointColor:"--avs-chart-point-color",chartLineColor:"--avs-chart-line-color",chartLineWidth:"--avs-chart-line-width",chartLinePattern:"--avs-chart-line-pattern",chartTextColor:"--avs-chart-text-color",chartTextRotation:"--avs-chart-text-rotation",chartFontFamily:"--avs-chart-font-family",chartFontStyle:"--avs-chart-font-style",chartFontWeight:"--avs-chart-font-weight",chartFontSize:"--avs-chart-font-size",chartTitleTextColor:"--avs-chart-title-text-color",chartTitleTextRotation:"--avs-chart-title-text-rotation",chartTitleFontFamily:"--avs-chart-title-font-family",chartTitleFontStyle:"--avs-chart-title-font-style",chartTitleFontWeight:"--avs-chart-title-font-weight",chartTitleFontSize:"--avs-chart-title-font-size",axisLineColor:"--avs-axis-line-color",axisLineWidth:"--avs-axis-line-width",axisTextColor:"--avs-axis-text-color",axisTextRotation:"--avs-axis-text-rotation",axisFontFamily:"--avs-axis-font-family",axisFontStyle:"--avs-axis-font-style",axisFontWeight:"--avs-axis-font-weight",axisFontSize:"--avs-axis-font-size",axisAxleColor:"--avs-axis-axle-color",axisAxleWidth:"--avs-axis-axle-width",axisMajorTickMarkColor:"--avs-axis-major-tick-mark-color",axisMajorTickMarkWidth:"--avs-axis-major-tick-mark-width",axisMajorTickLineColor:"--avs-axis-major-tick-line-color",axisMajorTickLineWidth:"--avs-axis-major-tick-line-width",axisMajorTickLineStyle:"--avs-axis-major-tick-line-style",axisMajorUnlabeledTickMarkColor:"--avs-axis-major-unlabeled-tick-mark-color",axisMajorUnlabeledTickMarkWidth:"--avs-axis-major-unlabeled-tick-mark-width",axisMajorUnlabeledTickLineColor:"--avs-axis-major-unlabeled-tick-line-color",axisMajorUnlabeledTickLineWidth:"--avs-axis-major-unlabeled-tick-line-width",axisMajorUnlabeledTickLineStyle:"--avs-axis-major-unlabeled-tick-line-style",axisMinorTickMarkColor:"--avs-axis-minor-tick-mark-color",axisMinorTickMarkWidth:"--avs-axis-minor-tick-mark-width",axisMinorTickLineColor:"--avs-axis-minor-tick-line-color",axisMinorTickLineWidth:"--avs-axis-minor-tick-line-width",axisMinorTickLineStyle:"--avs-axis-minor-tick-line-style",axisTitleTextColor:"--avs-axis-title-text-color",axisTitleTextRotation:"--avs-axis-title-text-rotation",axisTitleFontFamily:"--avs-axis-title-font-family",axisTitleFontStyle:"--avs-axis-title-font-style",axisTitleFontWeight:"--avs-axis-title-font-weight",axisTitleFontSize:"--avs-axis-title-font-size",axisUnitTextColor:"--avs-axis-unit-text-color",axisUnitTextRotation:"--avs-axis-unit-text-rotation",axisUnitFontFamily:"--avs-axis-unit-font-family",axisUnitFontStyle:"--avs-axis-unit-font-style",axisUnitFontWeight:"--avs-axis-unit-font-weight",axisUnitFontSize:"--avs-axis-unit-font-size",axisLabelTextColor:"--avs-axis-label-text-color",axisLabelTextRotation:"--avs-axis-label-text-rotation",axisLabelFontFamily:"--avs-axis-label-font-family",axisLabelFontStyle:"--avs-axis-label-font-style",axisLabelFontWeight:"--avs-axis-label-font-weight",axisLabelFontSize:"--avs-axis-label-font-size",legendBackgroundColor:"--avs-legend-background-color",legendTextColor:"--avs-legend-text-color",legendTextRotation:"--avs-legend-text-rotation",legendFontFamily:"--avs-legend-font-family",legendFontStyle:"--avs-legend-font-style",legendFontWeight:"--avs-legend-font-weight",legendFontSize:"--avs-legend-font-size",legendPointColor:"--avs-legend-point-color",legendTitleTextColor:"--avs-legend-title-text-color",legendTitleTextRotation:"--avs-legend-title-text-rotation",legendTitleFontFamily:"--avs-legend-title-font-family",legendTitleFontStyle:"--avs-legend-title-font-style",legendTitleFontWeight:"--avs-legend-title-font-weight",legendTitleFontSize:"--avs-legend-title-font-size"}),this.dataSourceName&&(e.dataSourceProperties={name:this.dataSourceName},this.dataSourceUserProperties)){let t;try{t=JSON.parse(this.dataSourceUserProperties)}catch(t){return void this._dispatchErrorEvent("Can't parse 'data-source-user-properties'. "+t.message)}e.dataSourceProperties.userProperties=t}return this.threeViewer&&this.streamEnable&&(n.streamProperties={chunkSizeFirst:this.streamChunkSizeFirst,chunkSize:this.streamChunkSize}),e}_applyCustomCssProperties(t,e,n){for(var i in n)if(n.hasOwnProperty(i)){var r=e.getPropertyValue(n[i]).trim();r.length>0&&(t[i]=r)}}_onResize(){!this.urlLoadJsonFile&&!this.manualUpdate&&this.resizeThreshold>0&&(this.clientWidth<this.lowResizeWidth||this.clientWidth>this.highResizeWidth||this.clientHeight<this.lowResizeHeight||this.clientHeight>this.highResizeHeight)?this.updateViewer():this._updateViewerClient()}_updateSize(){this.width=this.clientWidth,this.width<=0?(this.width=200,this.style.width=this.width+"px"):this.style.width="100%",this.height=this.clientHeight,this.height<=0?(this.aspectRatio>.1?this.height=this.width/this.aspectRatio:this.height=200,this.style.height=this.height+"px"):this.style.height="100%",this.rectCanvas&&(this.rectCanvas.width=this.width,this.rectCanvas.height=this.height)}showSpinner(){var t=window.getComputedStyle(this,null).getPropertyValue("--avs-spinner").trim().replace(/['"]+/g,"");t.length>0?fetch(t).then((t=>{if(!t.ok)throw new Error(t);return t.text()})).then((t=>{this.renderRoot.querySelector("#spinner").innerHTML=t})).catch((t=>{this.renderRoot.querySelector("#spinner").innerHTML=""})):this.renderRoot.querySelector("#spinner").innerHTML='<svg xmlns="http://www.w3.org/2000/svg" height="46px" viewBox="0 0 12.170833 12.170834" width="46px"><path d="M 7.2486073,9.9076469 H 5.2849946 L 8.4704866,6.123394 6.2360101,3.4130208 7.1885217,2.271515 10.424524,6.122616 Z M 6.0677825,8.6164059 3.9785527,6.1181874 6.0843599,3.5947138 8.1676051,6.1217782 Z M 1.7215741,6.1177086 6.5503222,0.33124232 H 8.5047186 L 3.6754319,6.1184268 5.9155339,8.7972611 4.958833,9.9337997 Z M 7.3399924,2.0900614 9.0019205,0.09856041 H 6.441462 L 1.4175556,6.1188457 4.7994028,10.140329 H 7.3569887 L 10.728423,6.122616 Z" style="display:inline;fill:#2e8cbd;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0598462" id="path22" /><path d="M 7.2486073,9.9076469 H 5.2849946 L 8.4704866,6.123394 6.2360101,3.4130208 7.1885217,2.271515 10.424524,6.122616 Z M 6.0677825,8.6164059 3.9785527,6.1181874 6.0843599,3.5947138 8.1676051,6.1217782 Z M 1.7215741,6.1177086 6.5503222,0.33124232 H 8.5047186 L 3.6754319,6.1184268 5.9155339,8.7972611 4.958833,9.9337997 Z M 7.3399924,2.0900614 9.0019205,0.09856041 H 6.441462 L 1.4175556,6.1188457 4.7994028,10.140329 H 7.3569887 L 10.728423,6.122616 Z" style="fill:none;stroke:#2e8cbd;stroke-width:0.179539;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" id="path26" /><g id="g78" class="spinnerBackground"><path d="M 5.0916012,7.2951741 C 4.5581951,6.6568 4.1217726,6.1273448 4.1217726,6.1186069 c 0,-0.022412 1.9511841,-2.3603376 1.9654853,-2.3550616 0.00645,0.00237 0.4481639,0.5337638 0.981573,1.1808488 L 8.0386633,6.1209126 7.7794202,6.4289493 C 7.6368389,6.5983701 7.1955674,7.1235887 6.7988191,7.5961017 6.4020707,8.0686158 6.0738528,8.4553619 6.0694438,8.4555369 6.0650388,8.4557059 5.6250056,7.9335497 5.0916012,7.2951741 Z" id="path39" /><path d="M 5.5264617,9.7764122 C 5.5385577,9.7616559 6.2319291,8.9374956 7.0672769,7.9449584 7.9026265,6.9524246 8.5861155,6.1329723 8.5861409,6.1239554 8.5861681,6.1149485 8.0879549,5.5032753 7.4789997,4.7647 6.8700453,4.0261248 6.3741103,3.4156149 6.3769213,3.4080117 6.3797713,3.4004117 6.562373,3.1774787 6.7827896,2.9126121 7.164399,2.4540426 7.1848936,2.4323657 7.2117806,2.4588741 7.2273026,2.4741751 7.9274525,3.3048587 8.767655,4.3048177 L 10.295296,6.1229243 9.4136171,7.1736012 C 8.9286921,7.751474 8.2336861,8.5795488 7.8691565,9.0137659 L 7.2063776,9.8032561 H 6.3554188 c -0.7939025,0 -0.8494825,-0.00179 -0.8289571,-0.026839 z" id="path41" /><path d="M 3.4382986,7.9881037 C 2.6063322,7.0074024 1.9089456,6.1852746 1.8885531,6.1611518 L 1.8514763,6.1172937 4.2262773,3.2714352 6.6010789,0.42557499 H 7.4490822 8.2970851 L 7.0763447,1.8883334 c -3.0218884,3.6209928 -3.5158893,4.2139972 -3.519859,4.2252855 -0.00231,0.00662 0.4954141,0.6094855 1.1060858,1.3397178 0.6106728,0.7302338 1.1103133,1.3348316 1.1103133,1.3435515 0,0.017734 -0.7956667,0.9718373 -0.8117152,0.9733472 -0.00562,5.108e-4 -0.6909038,-0.80143 -1.522871,-1.7821306 z" id="path43" /></g></svg>',this.renderRoot.querySelector("#spinner").style.display="block"}hideSpinner(){this.renderRoot.querySelector("#spinner").style.display="none"}startSpinner(){this.renderRoot.querySelector("#spinner").className="spin"}stopSpinner(){this.renderRoot.querySelector("#spinner").className=""}updated(t){if(this._updateSize(),this.lowResizeWidth=(100-this.resizeThreshold)/100*this.width,this.highResizeWidth=(100+this.resizeThreshold)/100*this.width,this.lowResizeHeight=(100-this.resizeThreshold)/100*this.height,this.highResizeHeight=(100+this.resizeThreshold)/100*this.height,t.has("renderer")&&this._rendererChanged(this.renderer,t.renderer),t.has("transformEnable")&&this._transformEnableChanged(this.transformEnable,t.transformEnable),t.has("transformClientOnly")&&this._transformClientOnlyChanged(this.transformClientOnly,t.transformClientOnly),t.has("transformRotateDisable")&&this._transformRotateDisableChanged(this.transformRotateDisable,t.transformRotateDisable),t.has("transformZoomDisable")&&this._transformZoomDisableChanged(this.transformZoomDisable,t.transformZoomDisable),t.has("transformPanDisable")&&this._transformPanDisableChanged(this.transformPanDisable,t.transformPanDisable),t.has("animatedGlyphsVisible")&&this._animatedGlyphsVisibleChanged(this.animatedGlyphsVisible,t.animatedGlyphsVisible),t.has("animatedGlyphsEnable")&&this._animatedGlyphsEnableChanged(this.animatedGlyphsEnable,t.animatedGlyphsEnable),(t.has("transformTwistAngle")||t.has("transformTiltAngle")||t.has("transformScale"))&&this._transformValueChanged(),t.has("animatedGlyphsEnable")&&this._animatedGlyphsEnableChanged(this.animatedGlyphsEnable,t.animatedGlyphsEnable),t.has("zoomRectangleEnable")&&this._zoomRectangleEnableChanged(this.zoomRectangleEnable,t.zoomRectangleEnable),t.has("panEnable")&&this._panEnableChanged(this.panEnable,t.panEnable),t.has("panZoomEnable")&&this._panZoomEnableChanged(this.panZoomEnable,t.panZoomEnable),t.has("panWidthZoomLevel")&&this._panWidthZoomLevelChanged(this.panWidthZoomLevel,t.panWidthZoomLevel),t.has("panHeightZoomLevel")&&this._panHeightZoomLevelChanged(this.panHeightZoomLevel,t.panHeightZoomLevel),t.has("panMaximumZoomLevel")&&this._panMaximumZoomLevelChanged(this.panMaximumZoomLevel,t.panMaximumZoomLevel),t.has("trackEnable")&&this._trackEnableChanged(this.trackEnable,t.trackEnable),t.has("displayCanvas")&&this._displayCanvasChanged(this.displayCanvas,t.displayCanvas),t.has("motionCaptureControlsEnable")&&this._motionCaptureControlsEnableChanged(this.motionCaptureControlsEnable,t.motionCaptureControlsEnable),t.has("motionCapture")&&this._motionCaptureValueChanged(this.motionCapture,t.motionCapture),t.has("hidden")&&this._hiddenChanged(this.hidden,t.hidden),!this.url)return;let e=!1;this.manualUpdate?this.forceUpdate&&(e=!0):(this.forceUpdate||t.has("url")||t.has("renderer")||t.has("urlLoadJsonFile")||t.has("sceneName")||t.has("sceneUserProperties")||t.has("dataSourceName")||t.has("dataSourceUserProperties")||t.has("rendererName")||t.has("rendererUserProperties")||t.has("streamEnable")||this.panEnable&&t.has("panWidthZoomLevel")||this.panEnable&&t.has("panHeightZoomLevel"))&&(e=!0),e&&(this.forceUpdate=!1,this.urlLoadJsonFile?(this.chunkFile=0,this.showSpinner(),this.startSpinner(),this._httpRequest(this.url,this._handleHttpResponse.bind(this),this._handleHttpError.bind(this))):(this.model=this._assembleModel(),this.model&&(this.showSpinner(),this.startSpinner(),this._httpRequest(this.url,this._handleHttpResponse.bind(this),this._handleHttpError.bind(this),this.model))))}_handleHttpError(t){this.hideSpinner()}updateViewer(){this.forceUpdate=!0,this.requestUpdate()}_updateViewerClient(){this._updateSize(),this.threeViewer&&this.threeViewer.render(!0)}clear(){if(this.threeViewer)this.threeViewer.clearGeometry(),this.threeViewer.render();else if("SVG"===this.renderer)for(var t=this.svgDiv;t.firstChild;)t.removeChild(t.firstChild);else this.sceneImage.src="data:,";this.showSpinner()}_handleHttpResponse(t){if(t){if(t.selectionInfo&&this._dispatchPickEvents(t.selectionInfo),t.sceneInfo){var e={detail:t.sceneInfo};if(this.dispatchEvent(new CustomEvent("avs-scene-info",e)),t.sceneInfo.backgroundColor){var n=t.sceneInfo.backgroundColor.match(/[0-9.]+/gi),i=this.getInheritedBackgroundCol(this.parentNode).trim().match(/[0-9.]+/gi),r=n[0]*n[3],a=n[1]*n[3],s=n[2]*n[3];0==n[3]&&(r+=i[0]*(1-n[3]),a+=i[1]*(1-n[3]),s+=i[2]*(1-n[3])),this.renderRoot.querySelector("#motionCapture").style.color="var(--avs-motion-capture-color, rgb("+r+", "+a+", "+s+"))",this.renderRoot.querySelector("#zoomOverlay").style.color="var(--avs-zoom-overlay-color, rgb("+r+","+a+","+s+"))",this.renderRoot.querySelector("#tooltip").style.color="var(--avs-tooltip-color, rgb("+r+","+a+","+s+"))",this.renderRoot.querySelector("#motionCaptureTooltip").style.color="var(--avs-tooltip-color, rgb("+r+","+a+","+s+"))"}if(t.sceneInfo.color){n=t.sceneInfo.color.match(/[0-9.]+/gi);this.renderRoot.querySelector("#motionCapture").style.background="var(--avs-motion-capture-background, rgba("+n[0]+","+n[1]+","+n[2]+",0.75))",this.renderRoot.querySelector("#zoomOverlay").style.background="var(--avs-zoom-overlay-background, rgba("+n[0]+","+n[1]+","+n[2]+",0.75))",this.renderRoot.querySelector("#tooltip").style.background="var(--avs-tooltip-background, rgb("+n[0]+","+n[1]+","+n[2]+"))",this.renderRoot.querySelector("#motionCaptureTooltip").style.background="var(--avs-tooltip-background, rgb("+n[0]+","+n[1]+","+n[2]+"))"}t.sceneInfo.fontFamily&&(this.renderRoot.querySelector("#motionCapture").style.fontFamily="var(--avs-motion-capture-font-family, "+t.sceneInfo.fontFamily+")",this.renderRoot.querySelector("#zoomOverlay").style.fontFamily="var(--avs-zoom-overlay-font-family, "+t.sceneInfo.fontFamily+")",this.renderRoot.querySelector("#tooltip").style.fontFamily="var(--avs-tooltip-font-family, "+t.sceneInfo.fontFamily+")",this.renderRoot.querySelector("#motionCaptureTooltip").style.fontFamily="var(--avs-tooltip-font-family, "+t.sceneInfo.fontFamily+")")}if(t.image)this.sceneImage.src=t.image,t.imagemap?(this.sceneImageMap.innerHTML=decodeURIComponent(t.imagemap.replace(/\+/g,"%20")),this.imageMapData=Array.from(this.sceneImageMap.querySelectorAll("area")).map((t=>({shape:t.getAttribute("shape"),coords:t.getAttribute("coords").split(",").map(Number),seriesIndex:t.getAttribute("series-index"),itemIndex:t.getAttribute("item-index"),componentInfo:t.getAttribute("component-info")})))):(this.sceneImageMap.innerHTML="",this.imageMapData=void 0),this.urlLoadJsonFile||this._dispatchSceneData(t),this._handleLoadComplete();else if(t.svg)this.svgDiv.innerHTML=decodeURIComponent(t.svg.replace(/\+/g,"%20")),this.urlLoadJsonFile||this._dispatchSceneData(t),this._handleLoadComplete();else if(t.threejs)if(this.urlLoadJsonFile||this._dispatchSceneData(t),t.threejs.chunkId){if(this.threeViewer.loadGeometryAsEvents(t.threejs,this._handleLoadComplete.bind(this)),!0===t.threejs.moreChunks)if(this.urlLoadJsonFile){this.chunkFile++;const t=this.url.substring(0,this.url.lastIndexOf("."))||this.url,e=this.url.split(".").pop();this._httpRequest(t+"-"+this.chunkFile+"."+e,this._handleHttpResponse.bind(this),this._handleHttpError.bind(this))}else this.model.rendererProperties.streamProperties.chunkId=t.threejs.chunkId,this._httpRequest(this.url,this._handleHttpResponse.bind(this),this._handleHttpError.bind(this),this.model)}else this.threeViewer.loadGeometryAsJson(t.threejs,this._handleLoadComplete.bind(this));else this._dispatchErrorEvent("No image, SVG, or ThreeJS found in response."),this._handleLoadComplete()}}getInheritedBackgroundCol(t){var e=this.getDefaultBackground(),n=window.getComputedStyle(t).backgroundColor;return n!=e?n:t.parentElement?this.getInheritedBackgroundCol(t.parentElement):e}getDefaultBackground(){var t=document.createElement("div");document.head.appendChild(t);var e=window.getComputedStyle(t).backgroundColor;return document.head.removeChild(t),e}_handleLoadComplete(){this.hideSpinner(),this.stopSpinner(),this.dispatchEvent(new CustomEvent("avs-load-complete"))}_dispatchSceneData(t){const e={detail:t};this.dispatchEvent(new CustomEvent("avs-scene-data",e))}_handleTap(t){var e=this._getAdjustedCoords(t.detail.x,t.detail.y),n={type:"TAP",x:e.x,y:e.y};void 0!==this.tapLevel&&(n.level=this.tapLevel),void 0!==this.tapDepth&&(n.depth=this.tapDepth),this.tapHighlightEnable&&(n.highlight=!0),void 0!==this.tapHighlightColor&&(n.highlightColor=this.tapHighlightColor),this.tapHighlightLayerEnable&&(n.highlightLayer=!0),this._processPick(n,this.tapProcessEventOnClient,t.originalTarget)}_handleTrack(t){var e=this._getAdjustedRectangleCoords(t);switch(t.detail.state){case"start":break;case"track":this.rectCtx.clearRect(0,0,this.width,this.height),this._rectangleStyle(),this.rectCtx.strokeRect(e.left,e.top,e.right-e.left,e.bottom-e.top);break;case"end":this.rectCtx.clearRect(0,0,this.width,this.height);var n={type:"TRACK"};n.left=e.left,n.right=e.right,n.top=e.top,n.bottom=e.bottom,void 0!==this.trackLevel&&(n.level=this.trackLevel),void 0!==this.trackDepth&&(n.depth=this.trackDepth),this.trackHighlightEnable&&(n.highlight=!0),void 0!==this.trackHighlightColor&&(n.highlightColor=this.trackHighlightColor),this.trackHighlightLayerEnable&&(n.highlightLayer=!0),this._processPick(n,this.trackProcessEventOnClient)}}_handlePointerDown(t){this.pointerDownX=t.clientX,this.pointerDownY=t.clientY,this.pointerDown=!0,this.tapEnable&&1&t.buttons&&(this.tapping=!0),this.trackEnable&&2&t.buttons&&(this.tracking=1)}_handlePointerMove(t){if(this.tracking>=1){if(1===this.tracking){var e=Math.abs(t.clientX-this.pointerDownX),n=Math.abs(t.clientY-this.pointerDownY);e*e+n*n>=5&&(this.tracking=2,this._handleTrack({detail:{state:"start",x:t.clientX,y:t.clientY,dx:t.clientX-this.pointerDownX,dy:t.clientY-this.pointerDownY}}))}2===this.tracking&&this._handleTrack({detail:{state:"track",x:t.clientX,y:t.clientY,dx:t.clientX-this.pointerDownX,dy:t.clientY-this.pointerDownY}})}if(this.hoverEnable){var i=this._getAdjustedCoords(t.clientX,t.clientY),r={type:"HOVER",x:i.x,y:i.y};this.pointerDown?(r.selected={},this._dispatchPickEvents(r)):(void 0!==this.hoverLevel&&(r.level=this.hoverLevel),void 0!==this.hoverDepth&&(r.depth=this.hoverDepth),this.hoverHighlightEnable&&(r.highlight=!0),void 0!==this.hoverHighlightColor&&(r.highlightColor=this.hoverHighlightColor),this.hoverHighlightLayerEnable&&(r.highlightLayer=!0),this._processPick(r,!0,t.originalTarget))}this._resetTimer()}_handlePointerUp(t){if(this.pointerDown=!1,this.tapping){this.tapping=!1;var e=Math.abs(t.clientX-this.pointerDownX),n=Math.abs(t.clientY-this.pointerDownY);e*e+n*n<25&&this._handleTap({detail:{x:t.clientX,y:t.clientY}})}this.tracking>1&&(this.tracking=0,this._handleTrack({detail:{state:"end",x:t.clientX,y:t.clientY,dx:t.clientX-this.pointerDownX,dy:t.clientY-this.pointerDownY}}))}_getAdjustedCoords(t,e){var n=this.renderRoot.querySelector("#dataVizDiv").getBoundingClientRect();t=Math.round(t-n.left),e=Math.round(e-n.top);return{x:Math.max(0,Math.min(t,this.width)),y:Math.max(0,Math.min(e,this.height))}}_getAdjustedRectangleCoords(t){var e=this.renderRoot.querySelector("#dataVizDiv").getBoundingClientRect(),n=Math.round(t.detail.x-e.left),i=Math.round(t.detail.y-e.top),r=Math.max(0,Math.min(n,this.width)),a=Math.max(0,Math.min(i,this.height)),s=n-t.detail.dx,o=i-t.detail.dy;return{left:Math.min(s,r),right:Math.max(s,r),top:Math.min(o,a),bottom:Math.max(o,a)}}_processPick(t,e,n){if(e)if(this.threeViewer){this.threeViewer.setPickDepth(this._getPickDepth(t.depth)),"TRACK"===t.type?this.threeViewer.setPickRectangle(t.left,t.top,t.right,t.bottom):this.threeViewer.setPickRay(t.x,t.y),this.threeViewer.pick();var i={};i="CELL"===t.level?this.threeViewer.getPickedCells():"CELL_SET"===t.level?this.threeViewer.getPickedCellSets():this.threeViewer.getPickedSceneNodes(),t.selected=this.threeViewer.getSelectionInfo(i),this._dispatchPickEvents(t),t.highlight&&(this.threeViewer.highlightColor.set(t.highlightColor),this.threeViewer.highlightObjects(i,t.highlightLayer))}else if("SVG"===this.renderer){if(t.selected=[],"TRACK"!==t.type&&("polygon"===n.nodeName||"circle"===n.nodeName)){for(var r={},a=null,s=n.parentElement;null!==s&&null===(a=s.getAttribute("series-index"));)s=s.parentElement;null!==a&&(r.seriesIndex=parseInt(a));var o=null;for(s=n.parentElement;null!==s&&null===(o=s.getAttribute("item-index"));)s=s.parentElement;null!==o&&(r.itemIndex=parseInt(o));var l=null;for(s=n.parentElement;null!==s&&null===(l=s.getAttribute("component-info"));)s=s.parentElement;null!==l&&(r.componentInfo=decodeURIComponent(l)),t.selected.push(r)}if(this._dispatchPickEvents(t),t.highlight){void 0===this.highlightSvg&&(this.highlightSvg=[]);for(var c=0;c<this.highlightSvg.length;c++)this.highlightSvg[c].setAttribute("fill",this.highlightSvg[c].getAttribute("saveFill"));this.highlightSvg.length=0,"TRACK"===t.type||"polygon"!==n.nodeName&&"circle"!==n.nodeName||(this.highlightSvg.push(n),n.setAttribute("saveFill",n.getAttribute("fill")),n.setAttribute("fill",t.highlightColor))}}else{if(t.selected=[],"TRACK"!==t.type&&void 0!==this.imageMapData)for(c=0;c<this.imageMapData.length;c++){var h=this.imageMapData[c];if("poly"===h.shape&&!1!==this._pointInPoly(t.x,t.y,h.coords)){r={};null!==h.seriesIndex&&(r.seriesIndex=parseInt(h.seriesIndex)),null!==h.itemIndex&&(r.itemIndex=parseInt(h.itemIndex)),null!==h.componentInfo&&(r.componentInfo=decodeURIComponent(h.componentInfo)),t.selected.push(r)}}this._dispatchPickEvents(t)}else this.urlLoadJsonFile||(this.showSpinner(),this.url&&(this.startSpinner(),this.model=this._assembleModel(),this.model&&(this.model.rendererProperties.pickProperties=t,this._httpRequest(this.url,this._handleHttpResponse.bind(this),this._handleHttpError.bind(this),this.model))))}_pointInPoly(t,e,n){for(var i,r,a,s=n[0]-t,o=n[1]-e,l=0,c=2;c<n.length;c+=2)if(r=n[c+1]-e,o<0&&r<0||o>0&&r>0)o=r,s=n[c]-t;else{if(i=n[c]-t,r>0&&o<=0){if((a=s*r-i*o)>0)l++;else if(0===a)return 0}else if(o>0&&r<=0){if((a=s*r-i*o)<0)l++;else if(0===a)return 0}else if(0===r&&o<0){if(0===(a=s*r-i*o))return 0}else if(0===o&&r<0){if(0===(a=s*r-i*o))return 0}else if(0===o&&0===r){if(i<=0&&s>=0)return 0;if(s<=0&&i>=0)return 0}o=r,s=i}return l%2!=0}_getPickDepth(t){return"ALL"==t?im:rm}_dispatchPickEvents(t){var e={detail:{selected:t.selected}};"TRACK"===t.type?(e.detail.left=t.left,e.detail.top=t.top,e.detail.right=t.right,e.detail.bottom=t.bottom,this.dispatchEvent(new CustomEvent("avs-track",e))):(e.detail.x=t.x,e.detail.y=t.y,"HOVER"===t.type?this.dispatchEvent(new CustomEvent("avs-hover",e)):this.dispatchEvent(new CustomEvent("avs-tap",e)))}_resetTimer(){clearTimeout(this.timer),this.timer=setTimeout(function(){this.dispatchEvent(new Event("avs-pointer-timeout"))}.bind(this),1e3*this.pointerTimeout)}constructor(){super(),this.renderer="THREEJS",this.resizeThreshold=10,this.aspectRatio=1.777777,this.pointerTimeout=600,this.panWidthZoomLevel=100,this.panHeightZoomLevel=100,this.panMaximumZoomLevel=1e3,this.motionCaptureTime=0,this.motionCaptureFrames??=[],this._resetTimer(),this._updatePixelRatio()}connectedCallback(){super.connectedCallback(),Sf.observe(this),this.addEventListener("pointerdown",this._handlePointerDown),this.addEventListener("pointerup",this._handlePointerUp),this.addEventListener("pointermove",this._handlePointerMove),this.addEventListener("pointerout",this._handlePointerMove);var t=this;this.addEventListener("contextmenu",(function(e){t.trackEnable&&e.preventDefault()}))}disconnectedCallback(){super.disconnectedCallback(),Sf.unobserve(this)}_handlePointerEnterMotionCaptureControl(t){if(!this.showMotionCaptureTooltip){var e=this._getAdjustedCoords(t.clientX,t.clientY),n=this.renderRoot.querySelector("#motionCaptureTooltip"),i=this._calcTooltipPosition(n,e.x,e.y);n.style.left=i.x+"px",n.style.top=i.y+"px",n.style.opacity=1,n.innerHTML=t.currentTarget.dataset.tooltip??t.currentTarget.id,this.showMotionCaptureTooltip=!0}}_handlePointerLeaveMotionCaptureControl(){this.renderRoot.querySelector("#motionCaptureTooltip").style.opacity=0,this.showMotionCaptureTooltip=!1}_round2dp(t){return Math.round(100*(t+Number.EPSILON))/100}_handleMotionCaptureSnapshot(){const t=this._getTransformComponents();this.motionCaptureFrames.length>0&&(this.motionCaptureTime+=this.motionCaptureDelay);const e={time:1e3*this.motionCaptureTime,scale:this._round2dp(t.scale),position:[this._round2dp(t.position[0]),this._round2dp(t.position[1]),this._round2dp(t.position[2])],rotation:[this._round2dp(t.rotation[0]),this._round2dp(t.rotation[1]),this._round2dp(t.rotation[2]),t.rotation[3]]};this.motionCaptureFrames.push(e),1==this.motionCaptureFrames.length&&(this.renderRoot.querySelector("#motionCapturePlay").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureDelay").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText="2",this.renderRoot.querySelector("#motionCaptureClear").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureCopyData").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureCopyUrl").classList.remove("disabled"),this.motionCaptureDelay=2),this.renderRoot.querySelector("#motionCaptureSnapshotLabel").innerText=this.motionCaptureFrames.length}_handleMotionCaptureDelayIncrease(){this.motionCaptureDelay++,this.motionCaptureDelay>9&&(this.motionCaptureDelay=9),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText=this.motionCaptureDelay}_handleMotionCaptureDelayDecrease(){this.motionCaptureDelay--,this.motionCaptureDelay<1&&(this.motionCaptureDelay=1),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText=this.motionCaptureDelay}_handleMotionCaptureCopyData(){const t=JSON.stringify(this.motionCaptureFrames);navigator.clipboard.writeText(t),this.renderRoot.querySelector("#motionCaptureAlert").innerText="Motion capture data copied to clipboard",this.renderRoot.querySelector("#motionCaptureAlert").style.opacity=1,setTimeout(function(){this.renderRoot.querySelector("#motionCaptureAlert").style.opacity=0}.bind(this),2e3)}async _handleMotionCaptureCopyUrl(){const t=JSON.stringify(this.motionCaptureFrames),e=(await this._compress(t)).toBase64().replaceAll("/","_").replaceAll("+","-"),n=window.location.origin+window.location.pathname+"?motionCapture="+e;navigator.clipboard.writeText(n),this.renderRoot.querySelector("#motionCaptureAlert").innerText="Motion capture URL copied to clipboard",this.renderRoot.querySelector("#motionCaptureAlert").style.opacity=1,setTimeout(function(){this.renderRoot.querySelector("#motionCaptureAlert").style.opacity=0}.bind(this),2e3)}async _compress(t){const e=new Blob([t]).stream().pipeThrough(new CompressionStream("gzip")),n=[];for await(const t of e)n.push(t);return this._concatUint8Arrays(n)}async _decompress(t){const e=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip")),n=[];for await(const t of e)n.push(t);const i=await this._concatUint8Arrays(n);return(new TextDecoder).decode(i)}async _concatUint8Arrays(t){const e=new Blob(t),n=await e.arrayBuffer();return new Uint8Array(n)}_handleMotionCaptureClear(){this.motionCaptureFrames.length=0,this.renderRoot.querySelector("#motionCapturePlay").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureSnapshotLabel").innerText="0",this.renderRoot.querySelector("#motionCaptureDelay").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText="0",this.renderRoot.querySelector("#motionCaptureClear").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureCopyData").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureCopyUrl").classList.add("disabled"),this.motionCaptureDelay=0,this.motionCaptureTime=0}_updatePixelRatio(t){const e=window.devicePixelRatio;matchMedia(`(resolution: ${e}dppx)`).addEventListener("change",this._updatePixelRatio.bind(this,!0),{once:!0}),t&&this.updateViewer()}_motionCaptureControlsEnableChanged(t,e){this.renderRoot.querySelector("#motionCapture").style.display=t?"block":"none"}_hiddenChanged(t,e){t?this.renderRoot.querySelector("#dataVizDiv").style.display="none":(this.renderRoot.querySelector("#dataVizDiv").style.display="",this.threeViewer&&this.threeViewer.render())}_transformEnableChanged(t,e){this.threeViewer&&(t?(void 0===this.transformInteractor&&(this.transformInteractor=new sf(this.renderRoot.querySelector("#dataVizDiv"))),this.threeViewer.addInteractor(this.transformInteractor),this.transformRotateDisable&&(this.transformInteractor.enableRotate=!1),this.transformZoomDisable&&(this.transformInteractor.enableZoom=!1),this.transformPanDisable&&(this.transformInteractor.enablePan=!1),this.transformClientOnly&&(this.transformInteractor.clientOnly=!0)):this.threeViewer.removeInteractor(this.transformInteractor))}_transformClientOnlyChanged(t,e){this.transformInteractor&&(this.transformInteractor.clientOnly=t),this.zoomRectangleInteractor&&(this.zoomRectangleInteractor.clientOnly=t)}_transformRotateDisableChanged(t,e){this.transformInteractor&&(this.transformInteractor.enableRotate=!t)}_transformZoomDisableChanged(t,e){this.transformInteractor&&(this.transformInteractor.enableZoom=!t)}_transformPanDisableChanged(t,e){this.transformInteractor&&(this.transformInteractor.enablePan=!t)}resetTransform(){this.transformInteractor&&this.transformInteractor.reset()}zoomIn(){this.transformInteractor&&this.transformInteractor.zoomIn()}zoomOut(){this.transformInteractor&&this.transformInteractor.zoomOut()}panTo(t,e,n){this.transformInteractor&&this.transformInteractor.panTo(t,e,n)}_getTransformComponents(){var t,e=new Si,n=new bi,i=new Si,r=new nr;return this.transformInteractor&&(t=this.transformInteractor.object.matrix),t.decompose(e,n,i),r.setFromQuaternion(n),{position:e.toArray(),rotation:[180*r.x/Math.PI,180*r.y/Math.PI,180*r.z/Math.PI,r.order],scale:100*i.x}}getTransformMatrix(){if(this.transformInteractor)return this.transformInteractor.object.matrix.elements.slice()}runAnimation(){if(this.threeViewer){var t=window.getComputedStyle(this,null),e={};this._applyCustomCssProperties(e,t,{scene:"--avs-scene-animations",sceneTitle:"--avs-scene-title-animations",chart:"--avs-chart-animations",chartTitle:"--avs-chart-title-animations",axis:"--avs-axis-animations",legend:"--avs-legend-animations",legendTitle:"--avs-legend-title-animations",glyph:"--avs-glyph-animations"}),e.transform=this.motionCaptureFrames.length>0?JSON.stringify(this.motionCaptureFrames):null,this.animator.setStyleMap(e),this.threeViewer.runAnimation()}}_animatedGlyphsVisibleChanged(t,e){this.threeViewer&&this.threeViewer.setVisibleAnimatedGlyphs(t)}_animatedGlyphsEnableChanged(t,e){this.threeViewer&&this.threeViewer.setEnableAnimatedGlyphs(t)}_transformValueChanged(){var t=void 0!==this.transformTwistAngle?this.transformTwistAngle*Math.PI/180:0,e=void 0!==this.transformTiltAngle?this.transformTiltAngle*Math.PI/180:0,n=void 0!==this.transformScale?this.transformScale/100:1,i=Math.sin(t),r=Math.cos(t),a=Math.sin(e),s=Math.cos(e),o=[r*n,0,s*i*n,0,0,s*n,-a*n,0,-i*n,r*a*n,r*s*n,0,0,0,0,1];this.transformMatrix=o,this.transformInteractor&&this.transformInteractor.object.matrix.fromArray(o)}async _motionCaptureValueChanged(t,e){if(t){try{this.motionCaptureFrames=JSON.parse(t)}catch{const e=Uint8Array.fromBase64(t.replaceAll("_","/").replaceAll("-","+")),n=await this._decompress(e);this.motionCaptureFrames=JSON.parse(n)}this.motionCaptureFrames||(this.motionCaptureFrames=[]),this.motionCaptureFrames.length>0?(this.renderRoot.querySelector("#motionCapturePlay").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureSnapshotLabel").innerText=this.motionCaptureFrames.length,this.renderRoot.querySelector("#motionCaptureDelay").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText="2",this.renderRoot.querySelector("#motionCaptureClear").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureCopyData").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureCopyUrl").classList.remove("disabled"),this.motionCaptureDelay=2,this.motionCaptureTime=this.motionCaptureFrames[this.motionCaptureFrames.length-1].time/1e3):(this.renderRoot.querySelector("#motionCapturePlay").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureSnapshotLabel").innerText="0",this.renderRoot.querySelector("#motionCaptureDelay").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText="0",this.renderRoot.querySelector("#motionCaptureClear").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureCopyData").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureCopyUrl").classList.add("disabled"),this.motionCaptureDelay=0,this.motionCaptureTime=0)}}_zoomRectangleEnableChanged(t,e){this.threeViewer&&(t?(void 0===this.zoomRectangleInteractor&&(this.zoomRectangleInteractor=new gf(this)),this.threeViewer.addInteractor(this.zoomRectangleInteractor),this.transformClientOnly&&(this.zoomRectangleInteractor.clientOnly=!0)):this.threeViewer.removeInteractor(this.zoomRectangleInteractor))}_panEnableChanged(t,e){this.threeViewer&&(t?(void 0===this.panInteractor&&(this.panInteractor=new uf(this)),this.threeViewer.addInteractor(this.panInteractor),this.panZoomEnable&&(this.panInteractor.addEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.addEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.addEventListener("zoomEnd",this._handlePanZoomEnd.bind(this))),this.panInteractor.setWidthZoomLevel(this.panWidthZoomLevel),this.panInteractor.setHeightZoomLevel(this.panHeightZoomLevel),this.panInteractor.setMaximumZoomLevel(this.panMaximumZoomLevel),this.panInteractor.saveState()):(this.threeViewer.removeInteractor(this.panInteractor),this.panZoomEnable&&(this.panInteractor.removeEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.removeEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.removeEventListener("zoomEnd",this._handlePanZoomEnd.bind(this)))))}_panZoomEnableChanged(t,e){this.threeViewer&&this.panInteractor&&(t?(this.panInteractor.addEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.addEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.addEventListener("zoomEnd",this._handlePanZoomEnd.bind(this))):(this.panInteractor.removeEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.removeEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.removeEventListener("zoomEnd",this._handlePanZoomEnd.bind(this))))}_handlePanChanged(t){this.dispatchEvent(new CustomEvent("avs-pan-info",t))}_zoomOverlayTimeout(){this.renderRoot.querySelector("#zoomOverlay").style.opacity=0,this.pointerDown=!1}_handlePanZoom(t){clearTimeout(this.zoomOverlayTimeoutId);var e=Math.round(t.detail.widthZoomLevel),n=Math.round(t.detail.heightZoomLevel);this.renderRoot.querySelector("#zoomOverlay").innerHTML=e===n?e+"%":e+"%,"+n+"%";var i=this._getAdjustedCoords(t.detail.clientX,t.detail.clientY);this.renderRoot.querySelector("#zoomOverlay").style.left=i.x+"px",this.renderRoot.querySelector("#zoomOverlay").style.top=i.y+"px",this.renderRoot.querySelector("#zoomOverlay").style.opacity=1,this.pointerDown=!0,this._dispatchPickEvents({type:"HOVER",x:0,y:0,selected:{}}),this.zoomOverlayTimeoutId=setTimeout(this._zoomOverlayTimeout.bind(this),1e3)}_handlePanZoomEnd(t){this.panWidthZoomLevel=t.detail.widthZoomLevel,this.panHeightZoomLevel=t.detail.heightZoomLevel}_panWidthZoomLevelChanged(t,e){this.panInteractor&&this.panInteractor.setWidthZoomLevel(t)}_panHeightZoomLevelChanged(t,e){this.panInteractor&&this.panInteractor.setHeightZoomLevel(t)}_panMaximumZoomLevelChanged(t,e){this.panInteractor&&this.panInteractor.setMaximumZoomLevel(t)}resetPan(){this.panInteractor&&this.panInteractor.reset()}_rendererChanged(t,e){if("IMAGE"===e)this.sceneImage.src="data:,",this.renderRoot.querySelector("#dataVizDiv").removeChild(this.sceneImage),this.renderRoot.querySelector("#dataVizDiv").removeChild(this.sceneImageMap);else if("SVG"===e){for(var n=this.svgDiv;n.firstChild;)n.removeChild(n.firstChild);this.renderRoot.querySelector("#dataVizDiv").removeChild(this.svgDiv)}else this.threeViewer&&(this.threeViewer.clearGeometry(),this.threeViewer.render(),this.renderRoot.querySelector("#dataVizDiv").removeChild(this.threeViewer.domElement));if("IMAGE"===t)void 0===this.sceneImage&&(this.sceneImage=document.createElement("img"),this.sceneImage.setAttribute("id","sceneImage"),this.sceneImage.setAttribute("usemap","#sceneImageMap"),this.sceneImageMap=document.createElement("map"),this.sceneImageMap.setAttribute("id","sceneImageMap"),this.sceneImageMap.setAttribute("name","sceneImageMap")),this.renderRoot.querySelector("#dataVizDiv").appendChild(this.sceneImage),this.renderRoot.querySelector("#dataVizDiv").appendChild(this.sceneImageMap),this.threeViewer=null;else if("SVG"===t)void 0===this.svgDiv&&(this.svgDiv=document.createElement("div"),this.svgDiv.setAttribute("id","svgDiv")),this.renderRoot.querySelector("#dataVizDiv").appendChild(this.svgDiv),this.threeViewer=null;else{if(!this.threeViewer){this.threeViewer=new ef;var i="avsDefaultWebGLRenderer",r=document.getElementById(i);null==r&&((r=new nm).setAttribute("id",i),document.body.appendChild(r)),this.threeViewer.setWebGLRenderer(r.webGLRenderer),this.animator=new xf,this.threeViewer.setAnimator(this.animator)}this.renderRoot.querySelector("#dataVizDiv").appendChild(this.threeViewer.domElement)}}_trackEnableChanged(t,e){t?(void 0===this.rectCanvas&&(this.rectCanvas=document.createElement("canvas"),this.rectCanvas.setAttribute("id","rectCanvas"),this.rectCtx=this.rectCanvas.getContext("2d")),this.renderRoot.appendChild(this.rectCanvas)):this.renderRoot.removeChild(this.rectCanvas)}_displayCanvasChanged(t,e){this.threeViewer&&(this.threeViewer.displayCanvas=t)}setTooltipHTML(t){this.renderRoot.querySelector("#tooltip").innerHTML=t}showTooltip(t,e){var n=this.renderRoot.querySelector("#tooltip"),i=this._calcTooltipPosition(n,t,e);n.style.left=i.x+"px",n.style.top=i.y+"px",n.style.opacity=1}hideTooltip(){this.renderRoot.querySelector("#tooltip").style.opacity=0}_calcTooltipPosition(t,e,n){var i=this.renderRoot.querySelector("#dataVizDiv"),r=this._getOffset(i),a=-Math.min(0,r.top-window.pageYOffset),s=-Math.min(0,r.left-window.pageXOffset),o=-Math.min(0,window.innerHeight-(i.offsetHeight+r.top-window.pageYOffset)),l=-Math.min(0,window.innerWidth-(i.offsetWidth+r.left-window.pageXOffset)),c=(i.offsetHeight-a-o)/2+a,h={x:0,y:0};if(e<(i.offsetWidth-s-l)/2+s){r=n<c?15:5;h.x=e+r+i.offsetLeft}else h.x=e-10+i.offsetLeft-t.offsetWidth;return h.y=n<c?n+5+i.offsetTop:n-10+i.offsetTop-t.offsetHeight,h}_getOffset(t){var e=t.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,i=window.pageYOffset||document.documentElement.scrollTop;return{top:e.top+i,left:e.left+n}}}const Sf=new ResizeObserver((t=>{t.forEach((t=>t.target._onResize(t.contentRect)))}));customElements.define("avs-go-dataviz",bf);customElements.define("avs-go-info",
308
+ `}static properties={manualUpdate:{type:Boolean,attribute:"manual-update"},displayCanvas:{type:Boolean,attribute:"display-canvas"},url:{type:String},urlLoadJsonFile:{type:Boolean,attribute:"url-load-json-file"},dataSourceName:{type:String,attribute:"data-source-name"},dataSourceUserProperties:{type:String,attribute:"data-source-user-properties"},sceneName:{type:String,attribute:"scene-name"},sceneUserProperties:{type:String,attribute:"scene-user-properties"},rendererName:{type:String,attribute:"renderer-name"},rendererUserProperties:{type:String,attribute:"renderer-user-properties"},renderer:{type:String},streamEnable:{type:Boolean,attribute:"stream-enable"},streamChunkSizeFirst:{type:Number,attribute:"stream-chunk-size-first"},streamChunkSize:{type:Number,attribute:"stream-chunk-size"},themeName:{type:String,attribute:"theme-name"},hidden:{type:Boolean},resizeThreshold:{type:Number,attribute:"resize-threshold"},aspectRatio:{type:Number,attribute:"aspect-ration"},pointerTimeout:{type:Number,attribute:"pointer-timeout"},tapEnable:{type:Boolean,attribute:"tap-enable"},tapLevel:{type:String,attribute:"tap-level"},tapDepth:{type:String,attribute:"tap-depth"},tapHighlightEnable:{type:Boolean,attribute:"tap-highlight-enable"},tapHighlightColor:{type:String,attribute:"tap-highlight-color"},tapHighlightLayerEnable:{type:Boolean,attribute:"tap-highlight-layer-enable"},tapProcessEventOnClient:{type:Boolean,attribute:"tap-process-event-on-client"},trackEnable:{type:Boolean,attribute:"track-enable"},trackLevel:{type:String,attribute:"track-level"},trackDepth:{type:String,attribute:"track-depth"},trackHighlightEnable:{type:Boolean,attribute:"track-highlight-enable"},trackHighlightColor:{type:String,attribute:"track-highlight-color"},trackHighlightLayerEnable:{type:Boolean,attribute:"track-highlight-layer-enable"},trackProcessEventOnClient:{type:Boolean,attribute:"track-process-event-on-client"},hoverEnable:{type:Boolean,attribute:"hover-enable"},hoverLevel:{type:String,attribute:"hover-level"},hoverDepth:{type:String,attribute:"hover-depth"},hoverHighlightEnable:{type:Boolean,attribute:"hover-highlight-enable"},hoverHighlightColor:{type:String,attribute:"hover-highlight-color"},hoverHighlightLayerEnable:{type:Boolean,attribute:"hover-highlight-layer-enable"},transformEnable:{type:Boolean,attribute:"transform-enable"},transformClientOnly:{type:Boolean,attribute:"transform-client-only"},transformRotateDisable:{type:Boolean,attribute:"transform-rotate-disable-changed"},transformZoomDisable:{type:Boolean,attribute:"transform-zoom-disable"},transformPanDisable:{type:Boolean,attribute:"transform-pan-disable"},transformTwistAngle:{type:Number,attribute:"transform-twist-angle"},transformTiltAngle:{type:Number,attribute:"transform-tilt-angle"},transformScale:{type:Number,attribute:"transform-scale"},motionCapture:{type:String,attribute:"motion-capture"},zoomRectangleEnable:{type:Boolean,attribute:"zoom-rectangle-enable"},panEnable:{type:Boolean,attribute:"pan-enable"},panZoomEnable:{type:Boolean,attribute:"pan-zoom-enable"},panWidthZoomLevel:{type:Number,attribute:"pan-width-zoom-level"},panHeightZoomLevel:{type:Number,attribute:"pan-height-zoom-level"},panMaximumZoomLevel:{type:Number,attribute:"pan-maximum-zoom-level"},animatedGlyphsVisible:{type:Boolean,attribute:"animated-glyphs-visible"},animatedGlyphsEnable:{type:Boolean,attribute:"animated-glyphs-enable"},motionCaptureControlsEnable:{type:Boolean,attribute:"motion-capture-controls-enable"}};_rectangleStyle(){this.rectCtx.setLineDash([3]),this.rectCtx.strokeStyle="#ff0000"}_assembleModel(t){if(!this.sceneName)return void this._dispatchErrorEvent("'scene-name' property must be set to the name of the scene registered in the library map on the AVS/Go server.");if(!this.width||!this.height)return;const e={sceneProperties:{name:this.sceneName}};if(this.sceneUserProperties){let t;try{t=JSON.parse(this.sceneUserProperties)}catch(t){return void this._dispatchErrorEvent("Can't parse 'scene-user-properties'. "+t.message)}e.sceneProperties.userProperties=t}const n={width:this.width,height:this.height,name:this.rendererName,type:this.renderer};if(this.rendererUserProperties){let t;try{t=JSON.parse(this.rendererUserProperties)}catch(t){return void this._dispatchErrorEvent("Can't parse 'renderer-user-properties'. "+t.message)}n.userProperties=t}e.rendererProperties=n,this.transformInteractor&&(this.transformMatrix=this.transformInteractor.object.matrix.elements.slice()),this.transformMatrix&&!this.transformClientOnly&&(n.transformMatrix=this.transformMatrix),t&&(this.transformClientOnly&&this.transformInteractor?this.transformInteractor.fullReset=t:n.fullReset=!0),this.panEnable&&(n.panProperties={widthZoomLevel:Math.min(this.panWidthZoomLevel,this.panMaximumZoomLevel),heightZoomLevel:Math.min(this.panHeightZoomLevel,this.panMaximumZoomLevel)}),n.themeName=this.themeName;var i=window.getComputedStyle(this,null),r=i.getPropertyValue("background-color").trim(),a=i.getPropertyValue("color").trim(),s=i.getPropertyValue("font-family").trim().replace(/['"]+/g,"");if(n.cssProperties={sceneBackgroundType:"Solid",sceneBackgroundColor:r,sceneLineColor:a,sceneTextColor:a,sceneFontFamily:s,sceneSurfaceColor:a},this._applyCustomCssProperties(n.cssProperties,i,{sceneBackgroundType:"--avs-scene-background-type",sceneBackgroundColor:"--avs-scene-background-color",sceneBackgroundStartColor:"--avs-scene-background-start-color",sceneBackgroundEndColor:"--avs-scene-background-end-color",sceneBackgroundGradientStyle:"--avs-scene-background-gradient-style",sceneBackgroundGradientInterpolation:"--avs-scene-background-gradient-interpolation",sceneBackgroundGradientColorRepeat:"--avs-scene-background-gradient-color-repeat",sceneHighlightColor:"--avs-scene-highlight-color",sceneSurfaceColor:"--avs-scene-surface-color",scenePointColor:"--avs-scene-point-color",sceneLineColor:"--avs-scene-line-color",sceneLineWidth:"--avs-scene-line-width",sceneTextColor:"--avs-scene-text-color",sceneTextRotation:"--avs-scene-text-rotation",sceneFontFamily:"--avs-scene-font-family",sceneFontStyle:"--avs-scene-font-style",sceneFontWeight:"--avs-scene-font-weight",sceneFontSize:"--avs-scene-font-size",sceneTitleTextColor:"--avs-scene-title-text-color",sceneTitleTextRotation:"--avs-scene-title-text-rotation",sceneTitleFontFamily:"--avs-scene-title-font-family",sceneTitleFontStyle:"--avs-scene-title-font-style",sceneTitleFontWeight:"--avs-scene-title-font-weight",sceneTitleFontSize:"--avs-scene-title-font-size",chartBackgroundType:"--avs-chart-background-type",chartBackgroundColor:"--avs-chart-background-color",chartBackgroundStartColor:"--avs-chart-background-start-color",chartBackgroundEndColor:"--avs-chart-background-end-color",chartBackgroundGradientStyle:"--avs-chart-background-gradient-style",chartBackgroundGradientInterpolation:"--avs-chart-background-gradient-interpolation",chartBackgroundGradientColorRepeat:"--avs-chart-background-gradient-color-repeat",chartHighlightColor:"--avs-chart-highlight-color",chartSurfaceColor:"--avs-chart-surface-color",chartPointColor:"--avs-chart-point-color",chartLineColor:"--avs-chart-line-color",chartLineWidth:"--avs-chart-line-width",chartLinePattern:"--avs-chart-line-pattern",chartTextColor:"--avs-chart-text-color",chartTextRotation:"--avs-chart-text-rotation",chartFontFamily:"--avs-chart-font-family",chartFontStyle:"--avs-chart-font-style",chartFontWeight:"--avs-chart-font-weight",chartFontSize:"--avs-chart-font-size",chartTitleTextColor:"--avs-chart-title-text-color",chartTitleTextRotation:"--avs-chart-title-text-rotation",chartTitleFontFamily:"--avs-chart-title-font-family",chartTitleFontStyle:"--avs-chart-title-font-style",chartTitleFontWeight:"--avs-chart-title-font-weight",chartTitleFontSize:"--avs-chart-title-font-size",axisLineColor:"--avs-axis-line-color",axisLineWidth:"--avs-axis-line-width",axisTextColor:"--avs-axis-text-color",axisTextRotation:"--avs-axis-text-rotation",axisFontFamily:"--avs-axis-font-family",axisFontStyle:"--avs-axis-font-style",axisFontWeight:"--avs-axis-font-weight",axisFontSize:"--avs-axis-font-size",axisAxleColor:"--avs-axis-axle-color",axisAxleWidth:"--avs-axis-axle-width",axisMajorTickMarkColor:"--avs-axis-major-tick-mark-color",axisMajorTickMarkWidth:"--avs-axis-major-tick-mark-width",axisMajorTickLineColor:"--avs-axis-major-tick-line-color",axisMajorTickLineWidth:"--avs-axis-major-tick-line-width",axisMajorTickLineStyle:"--avs-axis-major-tick-line-style",axisMajorUnlabeledTickMarkColor:"--avs-axis-major-unlabeled-tick-mark-color",axisMajorUnlabeledTickMarkWidth:"--avs-axis-major-unlabeled-tick-mark-width",axisMajorUnlabeledTickLineColor:"--avs-axis-major-unlabeled-tick-line-color",axisMajorUnlabeledTickLineWidth:"--avs-axis-major-unlabeled-tick-line-width",axisMajorUnlabeledTickLineStyle:"--avs-axis-major-unlabeled-tick-line-style",axisMinorTickMarkColor:"--avs-axis-minor-tick-mark-color",axisMinorTickMarkWidth:"--avs-axis-minor-tick-mark-width",axisMinorTickLineColor:"--avs-axis-minor-tick-line-color",axisMinorTickLineWidth:"--avs-axis-minor-tick-line-width",axisMinorTickLineStyle:"--avs-axis-minor-tick-line-style",axisTitleTextColor:"--avs-axis-title-text-color",axisTitleTextRotation:"--avs-axis-title-text-rotation",axisTitleFontFamily:"--avs-axis-title-font-family",axisTitleFontStyle:"--avs-axis-title-font-style",axisTitleFontWeight:"--avs-axis-title-font-weight",axisTitleFontSize:"--avs-axis-title-font-size",axisUnitTextColor:"--avs-axis-unit-text-color",axisUnitTextRotation:"--avs-axis-unit-text-rotation",axisUnitFontFamily:"--avs-axis-unit-font-family",axisUnitFontStyle:"--avs-axis-unit-font-style",axisUnitFontWeight:"--avs-axis-unit-font-weight",axisUnitFontSize:"--avs-axis-unit-font-size",axisLabelTextColor:"--avs-axis-label-text-color",axisLabelTextRotation:"--avs-axis-label-text-rotation",axisLabelFontFamily:"--avs-axis-label-font-family",axisLabelFontStyle:"--avs-axis-label-font-style",axisLabelFontWeight:"--avs-axis-label-font-weight",axisLabelFontSize:"--avs-axis-label-font-size",legendBackgroundColor:"--avs-legend-background-color",legendTextColor:"--avs-legend-text-color",legendTextRotation:"--avs-legend-text-rotation",legendFontFamily:"--avs-legend-font-family",legendFontStyle:"--avs-legend-font-style",legendFontWeight:"--avs-legend-font-weight",legendFontSize:"--avs-legend-font-size",legendPointColor:"--avs-legend-point-color",legendTitleTextColor:"--avs-legend-title-text-color",legendTitleTextRotation:"--avs-legend-title-text-rotation",legendTitleFontFamily:"--avs-legend-title-font-family",legendTitleFontStyle:"--avs-legend-title-font-style",legendTitleFontWeight:"--avs-legend-title-font-weight",legendTitleFontSize:"--avs-legend-title-font-size"}),this.dataSourceName&&(e.dataSourceProperties={name:this.dataSourceName},this.dataSourceUserProperties)){let t;try{t=JSON.parse(this.dataSourceUserProperties)}catch(t){return void this._dispatchErrorEvent("Can't parse 'data-source-user-properties'. "+t.message)}e.dataSourceProperties.userProperties=t}return this.threeViewer&&this.streamEnable&&(n.streamProperties={chunkSizeFirst:this.streamChunkSizeFirst,chunkSize:this.streamChunkSize}),e}_applyCustomCssProperties(t,e,n){for(var i in n)if(n.hasOwnProperty(i)){var r=e.getPropertyValue(n[i]).trim();r.length>0&&(t[i]=r)}}_onResize(t){this.width=Math.round(t.width),this.height=Math.round(t.height),this.rectCanvas&&(this.rectCanvas.width=this.width,this.rectCanvas.height=this.height),!this.urlLoadJsonFile&&!this.manualUpdate&&this.resizeThreshold>0&&(!this.lowResizeWidth||this.width<this.lowResizeWidth||this.width>this.highResizeWidth||this.height<this.lowResizeHeight||this.height>this.highResizeHeight)?(this._updateResizeLimits(),this.updateViewer()):this.threeViewer&&this.threeViewer.render(!0)}_updateResizeLimits(){this.lowResizeWidth=(100-this.resizeThreshold)/100*this.width,this.highResizeWidth=(100+this.resizeThreshold)/100*this.width,this.lowResizeHeight=(100-this.resizeThreshold)/100*this.height,this.highResizeHeight=(100+this.resizeThreshold)/100*this.height}showSpinner(){var t=window.getComputedStyle(this,null).getPropertyValue("--avs-spinner").trim().replace(/['"]+/g,"");t.length>0?fetch(t).then((t=>{if(!t.ok)throw new Error(t);return t.text()})).then((t=>{this.renderRoot.querySelector("#spinner").innerHTML=t})).catch((t=>{this.renderRoot.querySelector("#spinner").innerHTML=""})):this.renderRoot.querySelector("#spinner").innerHTML='<svg xmlns="http://www.w3.org/2000/svg" height="46px" viewBox="0 0 12.170833 12.170834" width="46px"><path d="M 7.2486073,9.9076469 H 5.2849946 L 8.4704866,6.123394 6.2360101,3.4130208 7.1885217,2.271515 10.424524,6.122616 Z M 6.0677825,8.6164059 3.9785527,6.1181874 6.0843599,3.5947138 8.1676051,6.1217782 Z M 1.7215741,6.1177086 6.5503222,0.33124232 H 8.5047186 L 3.6754319,6.1184268 5.9155339,8.7972611 4.958833,9.9337997 Z M 7.3399924,2.0900614 9.0019205,0.09856041 H 6.441462 L 1.4175556,6.1188457 4.7994028,10.140329 H 7.3569887 L 10.728423,6.122616 Z" style="display:inline;fill:#2e8cbd;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0598462" id="path22" /><path d="M 7.2486073,9.9076469 H 5.2849946 L 8.4704866,6.123394 6.2360101,3.4130208 7.1885217,2.271515 10.424524,6.122616 Z M 6.0677825,8.6164059 3.9785527,6.1181874 6.0843599,3.5947138 8.1676051,6.1217782 Z M 1.7215741,6.1177086 6.5503222,0.33124232 H 8.5047186 L 3.6754319,6.1184268 5.9155339,8.7972611 4.958833,9.9337997 Z M 7.3399924,2.0900614 9.0019205,0.09856041 H 6.441462 L 1.4175556,6.1188457 4.7994028,10.140329 H 7.3569887 L 10.728423,6.122616 Z" style="fill:none;stroke:#2e8cbd;stroke-width:0.179539;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" id="path26" /><g id="g78" class="spinnerBackground"><path d="M 5.0916012,7.2951741 C 4.5581951,6.6568 4.1217726,6.1273448 4.1217726,6.1186069 c 0,-0.022412 1.9511841,-2.3603376 1.9654853,-2.3550616 0.00645,0.00237 0.4481639,0.5337638 0.981573,1.1808488 L 8.0386633,6.1209126 7.7794202,6.4289493 C 7.6368389,6.5983701 7.1955674,7.1235887 6.7988191,7.5961017 6.4020707,8.0686158 6.0738528,8.4553619 6.0694438,8.4555369 6.0650388,8.4557059 5.6250056,7.9335497 5.0916012,7.2951741 Z" id="path39" /><path d="M 5.5264617,9.7764122 C 5.5385577,9.7616559 6.2319291,8.9374956 7.0672769,7.9449584 7.9026265,6.9524246 8.5861155,6.1329723 8.5861409,6.1239554 8.5861681,6.1149485 8.0879549,5.5032753 7.4789997,4.7647 6.8700453,4.0261248 6.3741103,3.4156149 6.3769213,3.4080117 6.3797713,3.4004117 6.562373,3.1774787 6.7827896,2.9126121 7.164399,2.4540426 7.1848936,2.4323657 7.2117806,2.4588741 7.2273026,2.4741751 7.9274525,3.3048587 8.767655,4.3048177 L 10.295296,6.1229243 9.4136171,7.1736012 C 8.9286921,7.751474 8.2336861,8.5795488 7.8691565,9.0137659 L 7.2063776,9.8032561 H 6.3554188 c -0.7939025,0 -0.8494825,-0.00179 -0.8289571,-0.026839 z" id="path41" /><path d="M 3.4382986,7.9881037 C 2.6063322,7.0074024 1.9089456,6.1852746 1.8885531,6.1611518 L 1.8514763,6.1172937 4.2262773,3.2714352 6.6010789,0.42557499 H 7.4490822 8.2970851 L 7.0763447,1.8883334 c -3.0218884,3.6209928 -3.5158893,4.2139972 -3.519859,4.2252855 -0.00231,0.00662 0.4954141,0.6094855 1.1060858,1.3397178 0.6106728,0.7302338 1.1103133,1.3348316 1.1103133,1.3435515 0,0.017734 -0.7956667,0.9718373 -0.8117152,0.9733472 -0.00562,5.108e-4 -0.6909038,-0.80143 -1.522871,-1.7821306 z" id="path43" /></g></svg>',this.renderRoot.querySelector("#spinner").style.display="block"}hideSpinner(){this.renderRoot.querySelector("#spinner").style.display="none"}startSpinner(){this.renderRoot.querySelector("#spinner").className="spin"}stopSpinner(){this.renderRoot.querySelector("#spinner").className=""}updated(t){if(t.has("renderer")&&this._rendererChanged(this.renderer,t.renderer),t.has("transformEnable")&&this._transformEnableChanged(this.transformEnable,t.transformEnable),t.has("transformClientOnly")&&this._transformClientOnlyChanged(this.transformClientOnly,t.transformClientOnly),t.has("transformRotateDisable")&&this._transformRotateDisableChanged(this.transformRotateDisable,t.transformRotateDisable),t.has("transformZoomDisable")&&this._transformZoomDisableChanged(this.transformZoomDisable,t.transformZoomDisable),t.has("transformPanDisable")&&this._transformPanDisableChanged(this.transformPanDisable,t.transformPanDisable),t.has("animatedGlyphsVisible")&&this._animatedGlyphsVisibleChanged(this.animatedGlyphsVisible,t.animatedGlyphsVisible),t.has("animatedGlyphsEnable")&&this._animatedGlyphsEnableChanged(this.animatedGlyphsEnable,t.animatedGlyphsEnable),(t.has("transformTwistAngle")||t.has("transformTiltAngle")||t.has("transformScale"))&&this._transformValueChanged(),t.has("animatedGlyphsEnable")&&this._animatedGlyphsEnableChanged(this.animatedGlyphsEnable,t.animatedGlyphsEnable),t.has("zoomRectangleEnable")&&this._zoomRectangleEnableChanged(this.zoomRectangleEnable,t.zoomRectangleEnable),t.has("panEnable")&&this._panEnableChanged(this.panEnable,t.panEnable),t.has("panZoomEnable")&&this._panZoomEnableChanged(this.panZoomEnable,t.panZoomEnable),t.has("panWidthZoomLevel")&&this._panWidthZoomLevelChanged(this.panWidthZoomLevel,t.panWidthZoomLevel),t.has("panHeightZoomLevel")&&this._panHeightZoomLevelChanged(this.panHeightZoomLevel,t.panHeightZoomLevel),t.has("panMaximumZoomLevel")&&this._panMaximumZoomLevelChanged(this.panMaximumZoomLevel,t.panMaximumZoomLevel),t.has("trackEnable")&&this._trackEnableChanged(this.trackEnable,t.trackEnable),t.has("displayCanvas")&&this._displayCanvasChanged(this.displayCanvas,t.displayCanvas),t.has("motionCaptureControlsEnable")&&this._motionCaptureControlsEnableChanged(this.motionCaptureControlsEnable,t.motionCaptureControlsEnable),t.has("motionCapture")&&this._motionCaptureValueChanged(this.motionCapture,t.motionCapture),t.has("hidden")&&this._hiddenChanged(this.hidden,t.hidden),!this.url)return;let e=!1;this.manualUpdate?this.forceUpdate&&(e=!0):(this.forceUpdate||t.has("url")||t.has("renderer")||t.has("urlLoadJsonFile")||t.has("sceneName")||t.has("sceneUserProperties")||t.has("dataSourceName")||t.has("dataSourceUserProperties")||t.has("rendererName")||t.has("rendererUserProperties")||t.has("streamEnable")||this.panEnable&&t.has("panWidthZoomLevel")||this.panEnable&&t.has("panHeightZoomLevel"))&&(e=!0),e&&(this.forceUpdate=!1,this.urlLoadJsonFile?(this.chunkFile=0,this.showSpinner(),this.startSpinner(),this._httpRequest(this.url,this._handleHttpResponse.bind(this),this._handleHttpError.bind(this))):(this.model=this._assembleModel(),this.model&&(this.showSpinner(),this.startSpinner(),this._httpRequest(this.url,this._handleHttpResponse.bind(this),this._handleHttpError.bind(this),this.model))))}_handleHttpError(t){this.hideSpinner()}updateViewer(){this.forceUpdate=!0,this.requestUpdate()}clear(){if(this.threeViewer)this.threeViewer.clearGeometry(),this.threeViewer.render();else if("SVG"===this.renderer)for(var t=this.svgDiv;t.firstChild;)t.removeChild(t.firstChild);else this.sceneImage.src="data:,";this.showSpinner()}_handleHttpResponse(t){if(t){if(t.selectionInfo&&this._dispatchPickEvents(t.selectionInfo),t.sceneInfo){var e={detail:t.sceneInfo};if(this.dispatchEvent(new CustomEvent("avs-scene-info",e)),t.sceneInfo.backgroundColor){var n=t.sceneInfo.backgroundColor.match(/[0-9.]+/gi),i=this.getInheritedBackgroundCol(this.parentNode).trim().match(/[0-9.]+/gi),r=n[0]*n[3],a=n[1]*n[3],s=n[2]*n[3];0==n[3]&&(r+=i[0]*(1-n[3]),a+=i[1]*(1-n[3]),s+=i[2]*(1-n[3])),this.renderRoot.querySelector("#motionCapture").style.color="var(--avs-motion-capture-color, rgb("+r+", "+a+", "+s+"))",this.renderRoot.querySelector("#zoomOverlay").style.color="var(--avs-zoom-overlay-color, rgb("+r+","+a+","+s+"))",this.renderRoot.querySelector("#tooltip").style.color="var(--avs-tooltip-color, rgb("+r+","+a+","+s+"))",this.renderRoot.querySelector("#motionCaptureTooltip").style.color="var(--avs-tooltip-color, rgb("+r+","+a+","+s+"))"}if(t.sceneInfo.color){n=t.sceneInfo.color.match(/[0-9.]+/gi);this.renderRoot.querySelector("#motionCapture").style.background="var(--avs-motion-capture-background, rgba("+n[0]+","+n[1]+","+n[2]+",0.75))",this.renderRoot.querySelector("#zoomOverlay").style.background="var(--avs-zoom-overlay-background, rgba("+n[0]+","+n[1]+","+n[2]+",0.75))",this.renderRoot.querySelector("#tooltip").style.background="var(--avs-tooltip-background, rgb("+n[0]+","+n[1]+","+n[2]+"))",this.renderRoot.querySelector("#motionCaptureTooltip").style.background="var(--avs-tooltip-background, rgb("+n[0]+","+n[1]+","+n[2]+"))"}t.sceneInfo.fontFamily&&(this.renderRoot.querySelector("#motionCapture").style.fontFamily="var(--avs-motion-capture-font-family, "+t.sceneInfo.fontFamily+")",this.renderRoot.querySelector("#zoomOverlay").style.fontFamily="var(--avs-zoom-overlay-font-family, "+t.sceneInfo.fontFamily+")",this.renderRoot.querySelector("#tooltip").style.fontFamily="var(--avs-tooltip-font-family, "+t.sceneInfo.fontFamily+")",this.renderRoot.querySelector("#motionCaptureTooltip").style.fontFamily="var(--avs-tooltip-font-family, "+t.sceneInfo.fontFamily+")")}if(t.image)this.sceneImage.src=t.image,t.imagemap?(this.sceneImageMap.innerHTML=decodeURIComponent(t.imagemap.replace(/\+/g,"%20")),this.imageMapData=Array.from(this.sceneImageMap.querySelectorAll("area")).map((t=>({shape:t.getAttribute("shape"),coords:t.getAttribute("coords").split(",").map(Number),seriesIndex:t.getAttribute("series-index"),itemIndex:t.getAttribute("item-index"),componentInfo:t.getAttribute("component-info")})))):(this.sceneImageMap.innerHTML="",this.imageMapData=void 0),this.urlLoadJsonFile||this._dispatchSceneData(t),this._handleLoadComplete();else if(t.svg)this.svgDiv.innerHTML=decodeURIComponent(t.svg.replace(/\+/g,"%20")),this.urlLoadJsonFile||this._dispatchSceneData(t),this._handleLoadComplete();else if(t.threejs)if(this.urlLoadJsonFile||this._dispatchSceneData(t),t.threejs.chunkId){if(this.threeViewer.loadGeometryAsEvents(t.threejs,this._handleLoadComplete.bind(this)),!0===t.threejs.moreChunks)if(this.urlLoadJsonFile){this.chunkFile++;const t=this.url.substring(0,this.url.lastIndexOf("."))||this.url,e=this.url.split(".").pop();this._httpRequest(t+"-"+this.chunkFile+"."+e,this._handleHttpResponse.bind(this),this._handleHttpError.bind(this))}else this.model.rendererProperties.streamProperties.chunkId=t.threejs.chunkId,this._httpRequest(this.url,this._handleHttpResponse.bind(this),this._handleHttpError.bind(this),this.model)}else this.threeViewer.loadGeometryAsJson(t.threejs,this._handleLoadComplete.bind(this));else this._dispatchErrorEvent("No image, SVG, or ThreeJS found in response."),this._handleLoadComplete()}}getInheritedBackgroundCol(t){var e=this.getDefaultBackground(),n=window.getComputedStyle(t).backgroundColor;return n!=e?n:t.parentElement?this.getInheritedBackgroundCol(t.parentElement):e}getDefaultBackground(){var t=document.createElement("div");document.head.appendChild(t);var e=window.getComputedStyle(t).backgroundColor;return document.head.removeChild(t),e}_handleLoadComplete(){this.hideSpinner(),this.stopSpinner(),this.dispatchEvent(new CustomEvent("avs-load-complete"))}_dispatchSceneData(t){const e={detail:t};this.dispatchEvent(new CustomEvent("avs-scene-data",e))}_handleTap(t){var e=this._getAdjustedCoords(t.detail.x,t.detail.y),n={type:"TAP",x:e.x,y:e.y};void 0!==this.tapLevel&&(n.level=this.tapLevel),void 0!==this.tapDepth&&(n.depth=this.tapDepth),this.tapHighlightEnable&&(n.highlight=!0),void 0!==this.tapHighlightColor&&(n.highlightColor=this.tapHighlightColor),this.tapHighlightLayerEnable&&(n.highlightLayer=!0),this._processPick(n,this.tapProcessEventOnClient,t.originalTarget)}_handleTrack(t){var e=this._getAdjustedRectangleCoords(t);switch(t.detail.state){case"start":break;case"track":this.rectCtx.clearRect(0,0,this.width,this.height),this._rectangleStyle(),this.rectCtx.strokeRect(e.left,e.top,e.right-e.left,e.bottom-e.top);break;case"end":this.rectCtx.clearRect(0,0,this.width,this.height);var n={type:"TRACK"};n.left=e.left,n.right=e.right,n.top=e.top,n.bottom=e.bottom,void 0!==this.trackLevel&&(n.level=this.trackLevel),void 0!==this.trackDepth&&(n.depth=this.trackDepth),this.trackHighlightEnable&&(n.highlight=!0),void 0!==this.trackHighlightColor&&(n.highlightColor=this.trackHighlightColor),this.trackHighlightLayerEnable&&(n.highlightLayer=!0),this._processPick(n,this.trackProcessEventOnClient)}}_handlePointerDown(t){this.pointerDownX=t.clientX,this.pointerDownY=t.clientY,this.pointerDown=!0,this.tapEnable&&1&t.buttons&&(this.tapping=!0),this.trackEnable&&2&t.buttons&&(this.tracking=1)}_handlePointerMove(t){if(this.tracking>=1){if(1===this.tracking){var e=Math.abs(t.clientX-this.pointerDownX),n=Math.abs(t.clientY-this.pointerDownY);e*e+n*n>=5&&(this.tracking=2,this._handleTrack({detail:{state:"start",x:t.clientX,y:t.clientY,dx:t.clientX-this.pointerDownX,dy:t.clientY-this.pointerDownY}}))}2===this.tracking&&this._handleTrack({detail:{state:"track",x:t.clientX,y:t.clientY,dx:t.clientX-this.pointerDownX,dy:t.clientY-this.pointerDownY}})}if(this.hoverEnable){var i=this._getAdjustedCoords(t.clientX,t.clientY),r={type:"HOVER",x:i.x,y:i.y};this.pointerDown?(r.selected={},this._dispatchPickEvents(r)):(void 0!==this.hoverLevel&&(r.level=this.hoverLevel),void 0!==this.hoverDepth&&(r.depth=this.hoverDepth),this.hoverHighlightEnable&&(r.highlight=!0),void 0!==this.hoverHighlightColor&&(r.highlightColor=this.hoverHighlightColor),this.hoverHighlightLayerEnable&&(r.highlightLayer=!0),this._processPick(r,!0,t.originalTarget))}this._resetTimer()}_handlePointerUp(t){if(this.pointerDown=!1,this.tapping){this.tapping=!1;var e=Math.abs(t.clientX-this.pointerDownX),n=Math.abs(t.clientY-this.pointerDownY);e*e+n*n<25&&this._handleTap({detail:{x:t.clientX,y:t.clientY}})}this.tracking>1&&(this.tracking=0,this._handleTrack({detail:{state:"end",x:t.clientX,y:t.clientY,dx:t.clientX-this.pointerDownX,dy:t.clientY-this.pointerDownY}}))}_getAdjustedCoords(t,e){var n=this.renderRoot.querySelector("#dataVizDiv").getBoundingClientRect();t=Math.round(t-n.left),e=Math.round(e-n.top);return{x:Math.max(0,Math.min(t,this.width)),y:Math.max(0,Math.min(e,this.height))}}_getAdjustedRectangleCoords(t){var e=this.renderRoot.querySelector("#dataVizDiv").getBoundingClientRect(),n=Math.round(t.detail.x-e.left),i=Math.round(t.detail.y-e.top),r=Math.max(0,Math.min(n,this.width)),a=Math.max(0,Math.min(i,this.height)),s=n-t.detail.dx,o=i-t.detail.dy;return{left:Math.min(s,r),right:Math.max(s,r),top:Math.min(o,a),bottom:Math.max(o,a)}}_processPick(t,e,n){if(e)if(this.threeViewer){this.threeViewer.setPickDepth(this._getPickDepth(t.depth)),"TRACK"===t.type?this.threeViewer.setPickRectangle(t.left,t.top,t.right,t.bottom):this.threeViewer.setPickRay(t.x,t.y),this.threeViewer.pick();var i={};i="CELL"===t.level?this.threeViewer.getPickedCells():"CELL_SET"===t.level?this.threeViewer.getPickedCellSets():this.threeViewer.getPickedSceneNodes(),t.selected=this.threeViewer.getSelectionInfo(i),this._dispatchPickEvents(t),t.highlight&&(this.threeViewer.highlightColor.set(t.highlightColor),this.threeViewer.highlightObjects(i,t.highlightLayer))}else if("SVG"===this.renderer){if(t.selected=[],"TRACK"!==t.type&&("polygon"===n.nodeName||"circle"===n.nodeName)){for(var r={},a=null,s=n.parentElement;null!==s&&null===(a=s.getAttribute("series-index"));)s=s.parentElement;null!==a&&(r.seriesIndex=parseInt(a));var o=null;for(s=n.parentElement;null!==s&&null===(o=s.getAttribute("item-index"));)s=s.parentElement;null!==o&&(r.itemIndex=parseInt(o));var l=null;for(s=n.parentElement;null!==s&&null===(l=s.getAttribute("component-info"));)s=s.parentElement;null!==l&&(r.componentInfo=decodeURIComponent(l)),t.selected.push(r)}if(this._dispatchPickEvents(t),t.highlight){void 0===this.highlightSvg&&(this.highlightSvg=[]);for(var c=0;c<this.highlightSvg.length;c++)this.highlightSvg[c].setAttribute("fill",this.highlightSvg[c].getAttribute("saveFill"));this.highlightSvg.length=0,"TRACK"===t.type||"polygon"!==n.nodeName&&"circle"!==n.nodeName||(this.highlightSvg.push(n),n.setAttribute("saveFill",n.getAttribute("fill")),n.setAttribute("fill",t.highlightColor))}}else{if(t.selected=[],"TRACK"!==t.type&&void 0!==this.imageMapData)for(c=0;c<this.imageMapData.length;c++){var h=this.imageMapData[c];if("poly"===h.shape&&!1!==this._pointInPoly(t.x,t.y,h.coords)){r={};null!==h.seriesIndex&&(r.seriesIndex=parseInt(h.seriesIndex)),null!==h.itemIndex&&(r.itemIndex=parseInt(h.itemIndex)),null!==h.componentInfo&&(r.componentInfo=decodeURIComponent(h.componentInfo)),t.selected.push(r)}}this._dispatchPickEvents(t)}else this.urlLoadJsonFile||(this.showSpinner(),this.url&&(this.startSpinner(),this.model=this._assembleModel(),this.model&&(this.model.rendererProperties.pickProperties=t,this._httpRequest(this.url,this._handleHttpResponse.bind(this),this._handleHttpError.bind(this),this.model))))}_pointInPoly(t,e,n){for(var i,r,a,s=n[0]-t,o=n[1]-e,l=0,c=2;c<n.length;c+=2)if(r=n[c+1]-e,o<0&&r<0||o>0&&r>0)o=r,s=n[c]-t;else{if(i=n[c]-t,r>0&&o<=0){if((a=s*r-i*o)>0)l++;else if(0===a)return 0}else if(o>0&&r<=0){if((a=s*r-i*o)<0)l++;else if(0===a)return 0}else if(0===r&&o<0){if(0===(a=s*r-i*o))return 0}else if(0===o&&r<0){if(0===(a=s*r-i*o))return 0}else if(0===o&&0===r){if(i<=0&&s>=0)return 0;if(s<=0&&i>=0)return 0}o=r,s=i}return l%2!=0}_getPickDepth(t){return"ALL"==t?im:rm}_dispatchPickEvents(t){var e={detail:{selected:t.selected}};"TRACK"===t.type?(e.detail.left=t.left,e.detail.top=t.top,e.detail.right=t.right,e.detail.bottom=t.bottom,this.dispatchEvent(new CustomEvent("avs-track",e))):(e.detail.x=t.x,e.detail.y=t.y,"HOVER"===t.type?this.dispatchEvent(new CustomEvent("avs-hover",e)):this.dispatchEvent(new CustomEvent("avs-tap",e)))}_resetTimer(){clearTimeout(this.timer),this.timer=setTimeout(function(){this.dispatchEvent(new Event("avs-pointer-timeout"))}.bind(this),1e3*this.pointerTimeout)}constructor(){super(),this.renderer="THREEJS",this.resizeThreshold=10,this.aspectRatio=1.777777,this.pointerTimeout=600,this.panWidthZoomLevel=100,this.panHeightZoomLevel=100,this.panMaximumZoomLevel=1e3,this.lowResizeWidth=this.highResizeWidth=0,this.highResizeWidth=this.highResizeHeight=0,this.motionCaptureTime=0,this.motionCaptureFrames??=[],this._resetTimer(),this._updatePixelRatio()}connectedCallback(){super.connectedCallback(),Sf.observe(this),this.addEventListener("pointerdown",this._handlePointerDown),this.addEventListener("pointerup",this._handlePointerUp),this.addEventListener("pointermove",this._handlePointerMove),this.addEventListener("pointerout",this._handlePointerMove);var t=this;this.addEventListener("contextmenu",(function(e){t.trackEnable&&e.preventDefault()}))}disconnectedCallback(){super.disconnectedCallback(),Sf.unobserve(this)}_handlePointerEnterMotionCaptureControl(t){if(!this.showMotionCaptureTooltip){var e=this._getAdjustedCoords(t.clientX,t.clientY),n=this.renderRoot.querySelector("#motionCaptureTooltip"),i=this._calcTooltipPosition(n,e.x,e.y);n.style.left=i.x+"px",n.style.top=i.y+"px",n.style.opacity=1,n.innerHTML=t.currentTarget.dataset.tooltip??t.currentTarget.id,this.showMotionCaptureTooltip=!0}}_handlePointerLeaveMotionCaptureControl(){this.renderRoot.querySelector("#motionCaptureTooltip").style.opacity=0,this.showMotionCaptureTooltip=!1}_round2dp(t){return Math.round(100*(t+Number.EPSILON))/100}_handleMotionCaptureSnapshot(){const t=this._getTransformComponents();this.motionCaptureFrames.length>0&&(this.motionCaptureTime+=this.motionCaptureDelay);const e={time:1e3*this.motionCaptureTime,scale:this._round2dp(t.scale),position:[this._round2dp(t.position[0]),this._round2dp(t.position[1]),this._round2dp(t.position[2])],rotation:[this._round2dp(t.rotation[0]),this._round2dp(t.rotation[1]),this._round2dp(t.rotation[2]),t.rotation[3]]};this.motionCaptureFrames.push(e),1==this.motionCaptureFrames.length&&(this.renderRoot.querySelector("#motionCapturePlay").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureDelay").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText="2",this.renderRoot.querySelector("#motionCaptureClear").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureCopyData").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureCopyUrl").classList.remove("disabled"),this.motionCaptureDelay=2),this.renderRoot.querySelector("#motionCaptureSnapshotLabel").innerText=this.motionCaptureFrames.length}_handleMotionCaptureDelayIncrease(){this.motionCaptureDelay++,this.motionCaptureDelay>9&&(this.motionCaptureDelay=9),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText=this.motionCaptureDelay}_handleMotionCaptureDelayDecrease(){this.motionCaptureDelay--,this.motionCaptureDelay<1&&(this.motionCaptureDelay=1),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText=this.motionCaptureDelay}_handleMotionCaptureCopyData(){const t=JSON.stringify(this.motionCaptureFrames);navigator.clipboard.writeText(t),this.renderRoot.querySelector("#motionCaptureAlert").innerText="Motion capture data copied to clipboard",this.renderRoot.querySelector("#motionCaptureAlert").style.opacity=1,setTimeout(function(){this.renderRoot.querySelector("#motionCaptureAlert").style.opacity=0}.bind(this),2e3)}async _handleMotionCaptureCopyUrl(){const t=JSON.stringify(this.motionCaptureFrames),e=(await this._compress(t)).toBase64().replaceAll("/","_").replaceAll("+","-"),n=window.location.origin+window.location.pathname+"?motionCapture="+e;navigator.clipboard.writeText(n),this.renderRoot.querySelector("#motionCaptureAlert").innerText="Motion capture URL copied to clipboard",this.renderRoot.querySelector("#motionCaptureAlert").style.opacity=1,setTimeout(function(){this.renderRoot.querySelector("#motionCaptureAlert").style.opacity=0}.bind(this),2e3)}async _compress(t){const e=new Blob([t]).stream().pipeThrough(new CompressionStream("gzip")),n=[];for await(const t of e)n.push(t);return this._concatUint8Arrays(n)}async _decompress(t){const e=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip")),n=[];for await(const t of e)n.push(t);const i=await this._concatUint8Arrays(n);return(new TextDecoder).decode(i)}async _concatUint8Arrays(t){const e=new Blob(t),n=await e.arrayBuffer();return new Uint8Array(n)}_handleMotionCaptureClear(){this.motionCaptureFrames.length=0,this.renderRoot.querySelector("#motionCapturePlay").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureSnapshotLabel").innerText="0",this.renderRoot.querySelector("#motionCaptureDelay").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText="0",this.renderRoot.querySelector("#motionCaptureClear").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureCopyData").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureCopyUrl").classList.add("disabled"),this.motionCaptureDelay=0,this.motionCaptureTime=0}_updatePixelRatio(t){const e=window.devicePixelRatio;matchMedia(`(resolution: ${e}dppx)`).addEventListener("change",this._updatePixelRatio.bind(this,!0),{once:!0}),t&&this.updateViewer()}_motionCaptureControlsEnableChanged(t,e){this.renderRoot.querySelector("#motionCapture").style.display=t?"block":"none"}_hiddenChanged(t,e){t?this.renderRoot.querySelector("#dataVizDiv").style.display="none":(this.renderRoot.querySelector("#dataVizDiv").style.display="",this.threeViewer&&this.threeViewer.render())}_transformEnableChanged(t,e){this.threeViewer&&(t?(void 0===this.transformInteractor&&(this.transformInteractor=new sf(this.renderRoot.querySelector("#dataVizDiv"))),this.threeViewer.addInteractor(this.transformInteractor),this.transformRotateDisable&&(this.transformInteractor.enableRotate=!1),this.transformZoomDisable&&(this.transformInteractor.enableZoom=!1),this.transformPanDisable&&(this.transformInteractor.enablePan=!1),this.transformClientOnly&&(this.transformInteractor.clientOnly=!0)):this.threeViewer.removeInteractor(this.transformInteractor))}_transformClientOnlyChanged(t,e){this.transformInteractor&&(this.transformInteractor.clientOnly=t),this.zoomRectangleInteractor&&(this.zoomRectangleInteractor.clientOnly=t)}_transformRotateDisableChanged(t,e){this.transformInteractor&&(this.transformInteractor.enableRotate=!t)}_transformZoomDisableChanged(t,e){this.transformInteractor&&(this.transformInteractor.enableZoom=!t)}_transformPanDisableChanged(t,e){this.transformInteractor&&(this.transformInteractor.enablePan=!t)}resetTransform(){this.transformInteractor&&this.transformInteractor.reset()}zoomIn(){this.transformInteractor&&this.transformInteractor.zoomIn()}zoomOut(){this.transformInteractor&&this.transformInteractor.zoomOut()}panTo(t,e,n){this.transformInteractor&&this.transformInteractor.panTo(t,e,n)}_getTransformComponents(){var t,e=new Si,n=new bi,i=new Si,r=new nr;return this.transformInteractor&&(t=this.transformInteractor.object.matrix),t.decompose(e,n,i),r.setFromQuaternion(n),{position:e.toArray(),rotation:[180*r.x/Math.PI,180*r.y/Math.PI,180*r.z/Math.PI,r.order],scale:100*i.x}}getTransformMatrix(){if(this.transformInteractor)return this.transformInteractor.object.matrix.elements.slice()}runAnimation(){if(this.threeViewer){var t=window.getComputedStyle(this,null),e={};this._applyCustomCssProperties(e,t,{scene:"--avs-scene-animations",sceneTitle:"--avs-scene-title-animations",chart:"--avs-chart-animations",chartTitle:"--avs-chart-title-animations",axis:"--avs-axis-animations",legend:"--avs-legend-animations",legendTitle:"--avs-legend-title-animations",glyph:"--avs-glyph-animations"}),e.transform=this.motionCaptureFrames.length>0?JSON.stringify(this.motionCaptureFrames):null,this.animator.setStyleMap(e),this.threeViewer.runAnimation()}}_animatedGlyphsVisibleChanged(t,e){this.threeViewer&&this.threeViewer.setVisibleAnimatedGlyphs(t)}_animatedGlyphsEnableChanged(t,e){this.threeViewer&&this.threeViewer.setEnableAnimatedGlyphs(t)}_transformValueChanged(){var t=void 0!==this.transformTwistAngle?this.transformTwistAngle*Math.PI/180:0,e=void 0!==this.transformTiltAngle?this.transformTiltAngle*Math.PI/180:0,n=void 0!==this.transformScale?this.transformScale/100:1,i=Math.sin(t),r=Math.cos(t),a=Math.sin(e),s=Math.cos(e),o=[r*n,0,s*i*n,0,0,s*n,-a*n,0,-i*n,r*a*n,r*s*n,0,0,0,0,1];this.transformMatrix=o,this.transformInteractor&&this.transformInteractor.object.matrix.fromArray(o)}async _motionCaptureValueChanged(t,e){if(t){try{this.motionCaptureFrames=JSON.parse(t)}catch{const e=Uint8Array.fromBase64(t.replaceAll("_","/").replaceAll("-","+")),n=await this._decompress(e);this.motionCaptureFrames=JSON.parse(n)}this.motionCaptureFrames||(this.motionCaptureFrames=[]),this.motionCaptureFrames.length>0?(this.renderRoot.querySelector("#motionCapturePlay").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureSnapshotLabel").innerText=this.motionCaptureFrames.length,this.renderRoot.querySelector("#motionCaptureDelay").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText="2",this.renderRoot.querySelector("#motionCaptureClear").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureCopyData").classList.remove("disabled"),this.renderRoot.querySelector("#motionCaptureCopyUrl").classList.remove("disabled"),this.motionCaptureDelay=2,this.motionCaptureTime=this.motionCaptureFrames[this.motionCaptureFrames.length-1].time/1e3):(this.renderRoot.querySelector("#motionCapturePlay").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureSnapshotLabel").innerText="0",this.renderRoot.querySelector("#motionCaptureDelay").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureDelayLabel").innerText="0",this.renderRoot.querySelector("#motionCaptureClear").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureCopyData").classList.add("disabled"),this.renderRoot.querySelector("#motionCaptureCopyUrl").classList.add("disabled"),this.motionCaptureDelay=0,this.motionCaptureTime=0)}}_zoomRectangleEnableChanged(t,e){this.threeViewer&&(t?(void 0===this.zoomRectangleInteractor&&(this.zoomRectangleInteractor=new gf(this)),this.threeViewer.addInteractor(this.zoomRectangleInteractor),this.transformClientOnly&&(this.zoomRectangleInteractor.clientOnly=!0)):this.threeViewer.removeInteractor(this.zoomRectangleInteractor))}_panEnableChanged(t,e){this.threeViewer&&(t?(void 0===this.panInteractor&&(this.panInteractor=new uf(this)),this.threeViewer.addInteractor(this.panInteractor),this.panZoomEnable&&(this.panInteractor.addEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.addEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.addEventListener("zoomEnd",this._handlePanZoomEnd.bind(this))),this.panInteractor.setWidthZoomLevel(this.panWidthZoomLevel),this.panInteractor.setHeightZoomLevel(this.panHeightZoomLevel),this.panInteractor.setMaximumZoomLevel(this.panMaximumZoomLevel),this.panInteractor.saveState()):(this.threeViewer.removeInteractor(this.panInteractor),this.panZoomEnable&&(this.panInteractor.removeEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.removeEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.removeEventListener("zoomEnd",this._handlePanZoomEnd.bind(this)))))}_panZoomEnableChanged(t,e){this.threeViewer&&this.panInteractor&&(t?(this.panInteractor.addEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.addEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.addEventListener("zoomEnd",this._handlePanZoomEnd.bind(this))):(this.panInteractor.removeEventListener("change",this._handlePanChanged.bind(this)),this.panInteractor.removeEventListener("zoom",this._handlePanZoom.bind(this)),this.panInteractor.removeEventListener("zoomEnd",this._handlePanZoomEnd.bind(this))))}_handlePanChanged(t){this.dispatchEvent(new CustomEvent("avs-pan-info",t))}_zoomOverlayTimeout(){this.renderRoot.querySelector("#zoomOverlay").style.opacity=0,this.pointerDown=!1}_handlePanZoom(t){clearTimeout(this.zoomOverlayTimeoutId);var e=Math.round(t.detail.widthZoomLevel),n=Math.round(t.detail.heightZoomLevel);this.renderRoot.querySelector("#zoomOverlay").innerHTML=e===n?e+"%":e+"%,"+n+"%";var i=this._getAdjustedCoords(t.detail.clientX,t.detail.clientY);this.renderRoot.querySelector("#zoomOverlay").style.left=i.x+"px",this.renderRoot.querySelector("#zoomOverlay").style.top=i.y+"px",this.renderRoot.querySelector("#zoomOverlay").style.opacity=1,this.pointerDown=!0,this._dispatchPickEvents({type:"HOVER",x:0,y:0,selected:{}}),this.zoomOverlayTimeoutId=setTimeout(this._zoomOverlayTimeout.bind(this),1e3)}_handlePanZoomEnd(t){this.panWidthZoomLevel=t.detail.widthZoomLevel,this.panHeightZoomLevel=t.detail.heightZoomLevel}_panWidthZoomLevelChanged(t,e){this.panInteractor&&this.panInteractor.setWidthZoomLevel(t)}_panHeightZoomLevelChanged(t,e){this.panInteractor&&this.panInteractor.setHeightZoomLevel(t)}_panMaximumZoomLevelChanged(t,e){this.panInteractor&&this.panInteractor.setMaximumZoomLevel(t)}resetPan(){this.panInteractor&&this.panInteractor.reset()}_rendererChanged(t,e){if("IMAGE"===e)this.sceneImage.src="data:,",this.renderRoot.querySelector("#dataVizDiv").removeChild(this.sceneImage),this.renderRoot.querySelector("#dataVizDiv").removeChild(this.sceneImageMap);else if("SVG"===e){for(var n=this.svgDiv;n.firstChild;)n.removeChild(n.firstChild);this.renderRoot.querySelector("#dataVizDiv").removeChild(this.svgDiv)}else this.threeViewer&&(this.threeViewer.clearGeometry(),this.threeViewer.render(),this.renderRoot.querySelector("#dataVizDiv").removeChild(this.threeViewer.domElement));if("IMAGE"===t)void 0===this.sceneImage&&(this.sceneImage=document.createElement("img"),this.sceneImage.setAttribute("id","sceneImage"),this.sceneImage.setAttribute("usemap","#sceneImageMap"),this.sceneImageMap=document.createElement("map"),this.sceneImageMap.setAttribute("id","sceneImageMap"),this.sceneImageMap.setAttribute("name","sceneImageMap")),this.renderRoot.querySelector("#dataVizDiv").appendChild(this.sceneImage),this.renderRoot.querySelector("#dataVizDiv").appendChild(this.sceneImageMap),this.threeViewer=null;else if("SVG"===t)void 0===this.svgDiv&&(this.svgDiv=document.createElement("div"),this.svgDiv.setAttribute("id","svgDiv")),this.renderRoot.querySelector("#dataVizDiv").appendChild(this.svgDiv),this.threeViewer=null;else{if(!this.threeViewer){this.threeViewer=new ef;var i="avsDefaultWebGLRenderer",r=document.getElementById(i);null==r&&((r=new nm).setAttribute("id",i),document.body.appendChild(r)),this.threeViewer.setWebGLRenderer(r.webGLRenderer),this.animator=new xf,this.threeViewer.setAnimator(this.animator)}this.renderRoot.querySelector("#dataVizDiv").appendChild(this.threeViewer.domElement)}}_trackEnableChanged(t,e){t?(void 0===this.rectCanvas&&(this.rectCanvas=document.createElement("canvas"),this.rectCanvas.setAttribute("id","rectCanvas"),this.rectCtx=this.rectCanvas.getContext("2d")),this.renderRoot.appendChild(this.rectCanvas)):this.renderRoot.removeChild(this.rectCanvas)}_displayCanvasChanged(t,e){this.threeViewer&&(this.threeViewer.displayCanvas=t)}setTooltipHTML(t){this.renderRoot.querySelector("#tooltip").innerHTML=t}showTooltip(t,e){var n=this.renderRoot.querySelector("#tooltip"),i=this._calcTooltipPosition(n,t,e);n.style.left=i.x+"px",n.style.top=i.y+"px",n.style.opacity=1}hideTooltip(){this.renderRoot.querySelector("#tooltip").style.opacity=0}_calcTooltipPosition(t,e,n){var i=this.renderRoot.querySelector("#dataVizDiv"),r=this._getOffset(i),a=-Math.min(0,r.top-window.pageYOffset),s=-Math.min(0,r.left-window.pageXOffset),o=-Math.min(0,window.innerHeight-(i.offsetHeight+r.top-window.pageYOffset)),l=-Math.min(0,window.innerWidth-(i.offsetWidth+r.left-window.pageXOffset)),c=(i.offsetHeight-a-o)/2+a,h={x:0,y:0};if(e<(i.offsetWidth-s-l)/2+s){r=n<c?15:5;h.x=e+r+i.offsetLeft}else h.x=e-10+i.offsetLeft-t.offsetWidth;return h.y=n<c?n+5+i.offsetTop:n-10+i.offsetTop-t.offsetHeight,h}_getOffset(t){var e=t.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,i=window.pageYOffset||document.documentElement.scrollTop;return{top:e.top+i,left:e.left+n}}}const Sf=new ResizeObserver((t=>{t.forEach((t=>t.target._onResize(t.contentRect)))}));customElements.define("avs-go-dataviz",bf);customElements.define("avs-go-info",
309
309
  /**
310
310
  * @license
311
311
  * Copyright 2018 Advanced Visual Systems Inc.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avs/go",
3
- "version": "0.14.71999",
3
+ "version": "0.14.72000",
4
4
  "description": "AVS/Go",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -652,6 +652,9 @@ export class AvsGoDataViz extends AvsElementBase {
652
652
  this._dispatchErrorEvent("'scene-name' property must be set to the name of the scene registered in the library map on the AVS/Go server.");
653
653
  return undefined;
654
654
  }
655
+ if (!this.width || !this.height) {
656
+ return undefined;
657
+ }
655
658
 
656
659
  // Scene Properties
657
660
  const model = {
@@ -911,57 +914,43 @@ export class AvsGoDataViz extends AvsElementBase {
911
914
  /**
912
915
  *
913
916
  */
914
- _onResize() {
917
+ _onResize(contentRect) {
918
+ // Get the width & height provided by our container
919
+ this.width = Math.round(contentRect.width);
920
+ this.height = Math.round(contentRect.height);
921
+
922
+ if (this.rectCanvas) {
923
+ this.rectCanvas.width = this.width;
924
+ this.rectCanvas.height = this.height;
925
+ }
926
+
927
+ // Check if we need to acquire a new scene due to
928
+ // the size change and other properties
915
929
  if (!this.urlLoadJsonFile &&
916
930
  !this.manualUpdate &&
917
931
  this.resizeThreshold > 0 &&
918
- (this.clientWidth < this.lowResizeWidth ||
919
- this.clientWidth > this.highResizeWidth ||
920
- this.clientHeight < this.lowResizeHeight ||
921
- this.clientHeight > this.highResizeHeight)) {
932
+ (!this.lowResizeWidth ||
933
+ this.width < this.lowResizeWidth ||
934
+ this.width > this.highResizeWidth ||
935
+ this.height < this.lowResizeHeight ||
936
+ this.height > this.highResizeHeight)) {
922
937
 
938
+ this._updateResizeLimits();
923
939
  this.updateViewer();
924
940
  }
925
941
  else {
926
- this._updateViewerClient();
927
- }
928
- }
929
-
930
- /**
931
- *
932
- */
933
- _updateSize() {
934
- // Get the width provided by our container
935
- this.width = this.clientWidth;
936
- if (this.width <= 0) {
937
- this.width = 200; // fallback if clientWidth fails
938
- this.style.width = this.width + "px";
939
- }
940
- else {
941
- this.style.width = "100%";
942
- }
943
-
944
- // Get the height provided by our container
945
- this.height = this.clientHeight;
946
- if (this.height <= 0) {
947
- if (this.aspectRatio > 0.1) {
948
- // Use the aspect ratio if one is set
949
- this.height = this.width / this.aspectRatio;
950
- }
951
- else {
952
- this.height = 200; // fallback if clientHeight fails
942
+ if (this.threeViewer) {
943
+ this.threeViewer.render(true);
953
944
  }
954
- this.style.height = this.height + "px";
955
- }
956
- else {
957
- this.style.height = "100%";
958
945
  }
946
+ }
959
947
 
960
- if (this.rectCanvas) {
961
- this.rectCanvas.width = this.width;
962
- this.rectCanvas.height = this.height;
963
- }
964
- }
948
+ _updateResizeLimits() {
949
+ this.lowResizeWidth = (100 - this.resizeThreshold) / 100 * this.width;
950
+ this.highResizeWidth = (100 + this.resizeThreshold) / 100 * this.width;
951
+ this.lowResizeHeight = (100 - this.resizeThreshold) / 100 * this.height;
952
+ this.highResizeHeight = (100 + this.resizeThreshold) / 100 * this.height;
953
+ }
965
954
 
966
955
  showSpinner() {
967
956
  var spinner = window.getComputedStyle(this, null).getPropertyValue("--avs-spinner").trim().replace(/['"]+/g, '');
@@ -1003,13 +992,6 @@ export class AvsGoDataViz extends AvsElementBase {
1003
992
  * At least one of the properties was changed.
1004
993
  */
1005
994
  updated(changedProperties) {
1006
- this._updateSize();
1007
-
1008
- this.lowResizeWidth = (100 - this.resizeThreshold) / 100 * this.width;
1009
- this.highResizeWidth = (100 + this.resizeThreshold) / 100 * this.width;
1010
- this.lowResizeHeight = (100 - this.resizeThreshold) / 100 * this.height;
1011
- this.highResizeHeight = (100 + this.resizeThreshold) / 100 * this.height;
1012
-
1013
995
  if (changedProperties.has('renderer')) {
1014
996
  this._rendererChanged(this.renderer, changedProperties['renderer']);
1015
997
  }
@@ -1140,16 +1122,6 @@ export class AvsGoDataViz extends AvsElementBase {
1140
1122
  this.requestUpdate();
1141
1123
  }
1142
1124
 
1143
- /**
1144
- *
1145
- */
1146
- _updateViewerClient() {
1147
- this._updateSize();
1148
- if (this.threeViewer) {
1149
- this.threeViewer.render(true);
1150
- }
1151
- }
1152
-
1153
1125
  /**
1154
1126
  *
1155
1127
  */
@@ -1763,6 +1735,9 @@ export class AvsGoDataViz extends AvsElementBase {
1763
1735
  this.panHeightZoomLevel = 100;
1764
1736
  this.panMaximumZoomLevel = 1000;
1765
1737
 
1738
+ this.lowResizeWidth = this.highResizeWidth = 0;
1739
+ this.highResizeWidth = this.highResizeHeight = 0;
1740
+
1766
1741
  this.motionCaptureTime = 0;
1767
1742
  this.motionCaptureFrames ??= [];
1768
1743
 
package/src/constants.js CHANGED
@@ -18,4 +18,4 @@
18
18
  * Advanced Visual Systems Inc. (http://www.avs.com)
19
19
  */
20
20
 
21
- export var VERSION = '0.14.71999';
21
+ export var VERSION = '0.14.72000';