import r from"@arcgis/core/webscene/Environment";import{checkArg as n}from"../utilities/checkArg.js";import{Background as e}from"./Background.js";import{Lighting as t}from"./Lighting.js";import{Weather as i}from"./Weather.js";export var Environment;!function(o){o.toEsriApiEnvironment=function(o){n("environmentJson",o).isNotMissing();const a=new r;return o.hasOwnProperty("atmosphereEnabled")&&null!=o.atmosphereEnabled&&(a.atmosphereEnabled=o.atmosphereEnabled),o.hasOwnProperty("background")&&null!=o.background&&(a.background=e.toEsriApiBackground(o.background)),o.hasOwnProperty("starsEnabled")&&null!=o.starsEnabled&&(a.starsEnabled=o.starsEnabled),o.hasOwnProperty("lighting")&&null!=o.lighting&&(a.lighting=t.toEsriApiLighting(o.lighting)),o.hasOwnProperty("weather")&&null!=o.weather&&(a.weather=i.toEsriApiWeather(o.weather)),a},o.fromEsriApiEnvironment=function(r){if(r)return{atmosphereEnabled:r.atmosphereEnabled,background:e.fromEsriApiBackground(r.background),starsEnabled:r.starsEnabled,lighting:t.fromEsriApiLighting(r.lighting),weather:i.fromEsriApiWeather(r.weather)}}}(Environment||(Environment={}));