/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{O as c,U as u,a as s,b as r}from"./GRFF5Y4R.js";import"./ALDX5YZO.js";export default $arcgis.t(([{watch:o},p])=>{var d=s`.sr-label{display:flex;gap:var(--calcite-spacing-xs)}.invalid-wkid-text{color:var(--calcite-color-status-danger);font-size:var(--calcite-font-size--0)}`;function f(e){if(e==null)return!1;let t=e.wkid;return t!=null&&t>=2e3?!0:e.wkt2!=null||e.wkt!=null}function m(e){return e==null?e:Math.round(Number.parseFloat(e))}var n=class extends c{constructor(){super(...arguments),this._isValidSpatialReference=!0}static{this.properties={_isValidSpatialReference:16,_outSpatialReference:16,templateOptions:0,viewModel:0,messages:0}}static{this.styles=d}loaded(){this.manager.onLifecycle(()=>[o(()=>this.viewModel.outSpatialReference,t=>{this._outSpatialReference=t??void 0},{initial:!0})])}render(){let{messages:t,_outSpatialReference:a}=this;return r`<div><calcite-label><div class="sr-label">${t.outSpatialReference}<calcite-link href=https://next.gha.afd.arcgis.com/rest/services-reference/enterprise/using-spatial-references/ target=_blank>(WKID)</calcite-link></div><calcite-input-number data-input-name=outSpatialReference integer number-button-type=none .value=${this._outSpatialReference?.wkid?.toString()??""} .max=${Number.MAX_SAFE_INTEGER} @calciteInputNumberInput=${({currentTarget:l})=>{let i=m(l.value);if(Number.isNaN(i)||i==null||i<=0||!Number.isFinite(i)){l.value=`${a?.wkid??""}`;return}this.viewModel.outSpatialReference=Number.isNaN(i)||i==null?null:new p({wkid:i}),this._isValidSpatialReference=!a||f(a)}}></calcite-input-number>${this._isValidSpatialReference?null:r`<div class="invalid-wkid-text">${t.invalidWkid}</div>`}</calcite-label></div>`}};u("arcgis-print-out-spatial-reference-input",n);return n},"core/reactiveUtils","geometry/SpatialReference")