/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import"../../../core/has.js";import{removeMaybe as o,destroyMaybe as n}from"../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{ShadowTooltipContent as c}from"./ShadowTooltipContent.js";let d=class extends e{constructor(t){super(t),this._updateHandle=null,this._contentContainer=this._createContainer()}initialize(){this.container.appendChild(this._contentContainer),this._contentWidget=new c({},this._contentContainer),this._updateHandle=i(()=>{const t=this._contentContainer,{screenPoint:e,accumulatedShadowTime:o}=this.viewModel.tooltip;return{contentContainer:t,screenPoint:e,accumulatedShadowTime:o}},t=>this._update(t),r)}destroy(){this._updateHandle=o(this._updateHandle),this._contentWidget=n(this._contentWidget),this.container.contains(this._contentContainer)&&this.container.removeChild(this._contentContainer)}get testData(){}_update({contentContainer:t,screenPoint:e,accumulatedShadowTime:o}){const{style:n}=t;null!=e?(n.display="block",n.transform=`translate(${e.x}px, ${e.y}px)`,this._contentWidget.accumulatedShadowTime=o):n.display="none"}_createContainer(){const t=document.createElement("div"),{style:e}=t;return e.position="absolute",e.top="0",e.left="0",t}};t([a()],d.prototype,"viewModel",void 0),t([a()],d.prototype,"container",void 0),t([a()],d.prototype,"_contentContainer",void 0),t([a()],d.prototype,"_contentWidget",void 0),d=t([s("esri.widgets.ShadowCast.components.ShadowTooltip")],d);export{d as ShadowTooltip};
