import{checkArg as r}from"../utilities/checkArg.js";import{LayerBase as a}from"./LayerBase.js";export var Ground;!function(n){async function i(n,i,o){if(r("json",n).isNotMissing(),r("ground",i).isNotMissing(),n.hasOwnProperty("navigationConstraint")&&null!=n.navigationConstraint)switch(n.navigationConstraint.type){case"none":i.navigationConstraint={type:"none"};break;case"stayAbove":i.navigationConstraint={type:"stay-above"}}n.hasOwnProperty("transparency")&&null!=n.transparency&&(i.opacity=1-n.transparency/100),n.hasOwnProperty("surfaceColor")&&(i.surfaceColor=(await import("@arcgis/core/Color")).default.fromJSON(n.surfaceColor)),n.hasOwnProperty("layers")&&n.layers&&await a.applyToEsriApiLayers(i.layers,n.layers,o)}n.DEFAULT_ELEVATION_ID="globalElevation",n.DEFAULT_ELEVATION_URL="http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",n.DEFAULT_ELEVATION_TITLE="Terrain 3D",n.toEsriApiGround=async function(a,n){r("json",a).isNotMissing();const o=new((await import("@arcgis/core/Ground")).default);return await i(a,o,n),o},n.applyToEsriApiGround=i,n.fromEsriApiGround=function(a){return r("ground",a).isNotMissing(),a.toJSON()},n.createDefaultElevationService=async function(){return new((await import("@arcgis/core/layers/ElevationLayer")).default)({id:n.DEFAULT_ELEVATION_ID,listMode:"hide",title:n.DEFAULT_ELEVATION_TITLE,url:n.DEFAULT_ELEVATION_URL,visible:!0})}}(Ground||(Ground={}));