/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{property as t,subclass as o}from"../../../../core/accessorSupport/decorators.js";import s from"../../../Widget.js";import{ToolbarGroupBase as r}from"./ToolbarGroupBase.js";import{loadCalciteComponents as i}from"../../../support/componentsUtils.js";import{tsx as n}from"../../../support/widget.js";import{onResize as d}from"../../../support/widgetUtils.js";const u=Symbol("on-resize-handle-key");let p=class extends(r(s)){constructor(e){super(e),this._measuredWidth=0,this._measuredHeight=0,this._measuredElement=null,this.useActionGroup=!1}loadDependencies(){return this.useActionGroup?i({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group")}):void 0}destroy(){this._measuredElement=null}get lengthOptions(){return["horizontal"===this.layout?this._measuredWidth:this._measuredHeight]}render(){const e={afterCreate:e=>{this._measuredElement=this.useActionGroup?e:e.firstElementChild,this.addHandles(d(this._measuredElement,()=>{this._measuredWidth=this._measuredElement?.clientWidth??0,this._measuredHeight=this._measuredElement?.clientHeight??0}),u)},afterRemoved:()=>this.removeHandles(u),slot:this.slot,layout:this.layout};return this.useActionGroup?n("calcite-action-group",{...e},this.children):n("div",{...e},this.children)}};e([t()],p.prototype,"_measuredWidth",void 0),e([t()],p.prototype,"_measuredHeight",void 0),e([t()],p.prototype,"lengthOptions",null),e([t()],p.prototype,"_measuredElement",void 0),e([t()],p.prototype,"useActionGroup",void 0),p=e([o("esri.widgets.Sketch.support.ResponsiveToolbar.MeasuredContentGroup")],p);export{p as default};
