/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as t}from"tslib";import{clone as e}from"../core/lang.js";import{property as o,subclass as i}from"../core/accessorSupport/decorators.js";import r from"./Font.js";import l from"./Symbol3DLayer.js";import{screenSizeProperty as n}from"./support/materialUtils.js";import s from"./support/OccludedVisibility.js";import{occludedVisibilityProperty as a}from"./support/occludedVisibilityUtils.js";import u from"./support/Symbol3DHalo.js";import p from"./support/Symbol3DMaterial.js";import c from"./support/Symbol3DTextBackground.js";import{horizontalAlignmentProperty as m,lineHeightProperty as h,verticalAlignmentProperty as d}from"./support/textUtils.js";import{writer as f}from"../core/accessorSupport/decorators/writer.js";import{enumeration as y}from"../core/accessorSupport/decorators/enumeration.js";var g;let b=class extends l{static{g=this}constructor(t){super(t),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline",this.occludedVisibility=new s({mode:"adaptive"})}get font(){return this._get("font")||null}set font(t){null!=t&&null!=this._userSize&&(t.size=this._userSize),this._set("font",t)}writeFont(t,e,o,i){const r={...i,textSymbol3D:!0};e.font=t.write({},r),delete e.font.size}get size(){return null!=this._userSize?this._userSize:null!=this.font?.size?this.font.size:9}set size(t){this._userSize=Number(t),null!=this.font&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const t=new g({enabled:this.enabled,font:e(this.font),halo:e(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:null!=this.material?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:e(this.background),occludedVisibility:e(this.occludedVisibility)});return t._userSize=this._userSize,t}static fromTextSymbol(t){return new g({font:null!=t.font?t.font.clone():new r,halo:z(t.haloColor,t.haloSize),horizontalAlignment:t.horizontalAlignment,lineHeight:t.lineHeight,material:t.color?new p({color:t.color.clone()}):null,text:t.text,verticalAlignment:t.verticalAlignment,background:t.backgroundColor?new c({color:t.backgroundColor.clone()}):null,occludedVisibility:null})}};function z(t,o){return t&&null!=o&&o>0?new u({color:e(t),size:o}):null}t([o({type:r,json:{write:!0}})],b.prototype,"font",null),t([f("font")],b.prototype,"writeFont",null),t([o({type:u,json:{write:!0}})],b.prototype,"halo",void 0),t([o({...m,json:{default:"center",write:!0}})],b.prototype,"horizontalAlignment",void 0),t([o({...h,json:{default:1,write:!0}})],b.prototype,"lineHeight",void 0),t([o({type:p,json:{write:!0}})],b.prototype,"material",void 0),t([o({type:c,json:{write:!0}})],b.prototype,"background",void 0),t([o(n)],b.prototype,"size",null),t([o({type:String,json:{write:!0}})],b.prototype,"text",void 0),t([y({Text:"text"},{readOnly:!0})],b.prototype,"type",void 0),t([o({...d,json:{default:"baseline",write:!0}})],b.prototype,"verticalAlignment",void 0),t([o(a)],b.prototype,"occludedVisibility",void 0),b=g=t([i("esri.symbols.TextSymbol3DLayer")],b);export{b as default};
