import i,{}from"@arcgis/core/webscene/Slide";import{checkArg as t}from"../utilities/checkArg.js";import{isBasemap as e}from"../utilities/mapping.js";import{deepClone as n}from"../utilities/object.js";import{Lighting as r}from"./Lighting.js";import{Viewpoint as s}from"./Viewpoint.js";import{WebSceneBaseMap as o}from"./WebSceneBaseMap.js";export var Slide;!function(p){p.toEsriApiSlide=async function(e){t("slideJson",e).isNotMissing();const p={};e.hasOwnProperty("visibleLayers")&&(p.visibleLayers=e.visibleLayers);const a=new i(p);return e.hasOwnProperty("baseMap")&&(a.basemap=await o.toEsriApiBasemap(e.baseMap)),e.hasOwnProperty("description")&&null!=e.description&&(a.description.text=e.description.text),e.hasOwnProperty("environment")&&null!=e.environment?.lighting&&(a.environment={lighting:r.toEsriApiLighting(e.environment.lighting)}),e.hasOwnProperty("thumbnail")&&e.thumbnail?.url&&(a.thumbnail.url=e.thumbnail.url),e.hasOwnProperty("title")&&null!=e.title&&(a.title=n(e.title)),e.hasOwnProperty("id")&&null!=e.id&&(a.id=e.id),e.hasOwnProperty("viewpoint")&&null!=e.viewpoint&&(a.viewpoint=s.toEsriApiViewpoint(e.viewpoint)),a},p.fromEsriApiSlide=function(i){t("slide",i).isNotMissing();const n={};return e(i.basemap)?n.baseMap=o.fromEsriApiBasemap(i.basemap):i.basemap&&(n.baseMap=i.basemap),i.description&&(n.description={text:i.description.text}),i.environment&&(n.environment={lighting:r.fromEsriApiLighting(i.environment.lighting)}),i.visibleLayers&&(n.visibleLayers=[],i.visibleLayers.forEach((i=>{n.visibleLayers.push({id:i.id})}))),i.thumbnail&&(n.thumbnail={url:i.thumbnail.url}),i.title&&(n.title={text:i.title.text}),i.id&&(n.id=i.id),i.viewpoint&&(n.viewpoint=s.fromEsriApiViewpoint(i.viewpoint)),n}}(Slide||(Slide={}));