/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.25/esri/copyright.txt for details. */ import{_ as e}from"./chunks/tslib.es6.js";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import o from"./core/Collection.js";import s from"./core/Error.js";import a from"./core/Handles.js";import"./core/has.js";import{clone as n}from"./core/lang.js";import l from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import c from"./core/Logger.js";import{isSome as d}from"./core/maybe.js";import{MultiOriginJSONMixin as h,MultiOriginJSONSupport as u}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as m}from"./core/Promise.js";import{debounce as y,eachAlways as w}from"./core/promiseUtils.js";import{urlToObject as g,addQueryParameter as f}from"./core/urlUtils.js";import{property as v}from"./core/accessorSupport/decorators/property.js";import"./core/accessorSupport/ensureType.js";import{reader as b}from"./core/accessorSupport/decorators/reader.js";import{subclass as S}from"./core/accessorSupport/decorators/subclass.js";import{writer as _}from"./core/accessorSupport/decorators/writer.js";import{updateOrigins as A}from"./core/accessorSupport/originUtils.js";import{readLoadable as I}from"./core/accessorSupport/read.js";import j from"./geometry/Extent.js";import R from"./geometry/HeightModelInfo.js";import{canProjectWithoutEngine as L}from"./geometry/projection.js";import P from"./geometry/SpatialReference.js";import{validateWebSceneError as V}from"./geometry/support/heightModelInfoUtils.js";import{fromJSON as U}from"./geometry/support/jsonUtils.js";import{isEarth as M}from"./geometry/support/spatialReferenceUtils.js";import O from"./portal/Portal.js";import E from"./portal/PortalItem.js";import C from"./support/MapFloorInfo.js";import{createSchemaValidationError as N,createCopyError as T}from"./support/webSceneUtils.js";import{ViewingMode as G}from"./views/ViewingMode.js";import{isSpatialReferenceSupported as F}from"./views/support/spatialReferenceSupport.js";import{saveResources as $}from"./webdoc/support/saveUtils.js";import{getOptimalThumbnailSize as W}from"./webdoc/support/thumbnailUtils.js";import J from"./webscene/ApplicationProperties.js";import x from"./webscene/Environment.js";import k from"./webscene/InitialViewProperties.js";import B from"./webscene/Presentation.js";import q from"./webscene/TransportationNetwork.js";import{Version as K}from"./webscene/Version.js";const D=new K(1,29),H=()=>{const e=8,t=[],r=D.major;for(let i=e;i<=D.minor;i++)t.push(`${r}.${i}`);return t},z="Web Scene",Q="ViewingMode-Local";let X=class extends(l.LoadableMixin(m(h(r)))){constructor(e){super(e),this._handles=new a,this.applicationProperties=null,this.clippingArea=null,this.clippingEnabled=!1,this.floorInfo=null,this.heightModelInfo=null,this.sourceVersion=null,this.transportationNetworks=null,this.presentation=new B,this.initialViewProperties=new k,this.portalItem=null,this.resourceInfo=null,this._debouncedSaveOperations=y((async(e,t,r)=>{switch(e){case Y.SAVE:return this._saveImpl(t);case Y.SAVE_AS:return this._saveAsImpl(r,t)}})),this._resourceReferences={portalItem:null,paths:[]},this.authoringApp=null,this.authoringAppVersion=null,this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1}initialize(){if(this.when().catch((e=>{c.getLogger(this.declaredClass).error("#load()","Failed to load web scene",e)})),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t),this.addResolvingPromise(this._validateSpatialReference()),this.addResolvingPromise(this._validateHeightModelInfo())}this._handles.add(this.allLayers.on("change",(()=>this._scheduleLayersIdGC())))}destroy(){this._unscheduleLayersIdGC(),this._handles.destroy(),this.presentation&&this.presentation.destroy();const e=this.portalItem;this.portalItem=null,e?.destroy()}writeClippingArea(e,t){t.clippingArea||(t.clippingArea={}),t.clippingArea.geometry=e.toJSON()}readClippingEnabled(e,t){return!!t.clippingArea&&!!t.clippingArea.clip}writeClippingEnabled(e,t){this.clippingArea&&(t.clippingArea||(t.clippingArea={}),t.clippingArea.clip=e)}writeLayers(e,t,r,i){const o={...i,layerContainerType:"operational-layers"},s=e.map((e=>this.verifyWriteLayer(e,i)?e.write({},o):null)).filter((e=>!!e));t[r]=s.toArray()}verifyWriteLayer(e,t){return"write"in e||(t&&t.messages&&t.messages.push(new s("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted in web scenes`,{layer:e})),!1)}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new K(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${D.major}.${D.minor}`}get thumbnailUrl(){return this.portalItem&&this.portalItem.thumbnailUrl||null}set thumbnailUrl(e){e?this._override("thumbnailUrl",e):(this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp="ArcGIS API for JavaScript"}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}writeGround(e,t,r,i){t[r]=e?e.write({},i):{transparency:0,layers:[]}}readInitialViewProperties(e,t){const r={};return t.initialState&&t.initialState.environment&&(r.environment=x.fromJSON(t.initialState.environment)),t.spatialReference?r.spatialReference=P.fromJSON(t.spatialReference):r.spatialReference=P.WebMercator,r.viewingMode=t.viewingMode||"global",t.initialState&&t.initialState.viewpoint&&(r.viewpoint=i.fromJSON(t.initialState.viewpoint)),new k(r)}get spatialReference(){return this.initialViewProperties?.spatialReference??P.WebMercator}get viewingMode(){return this.initialViewProperties?.viewingMode??"global"}load(e){return this.addResolvingPromise(this._loadFromSource()),Promise.resolve(this)}loadAll(){return p(this,(e=>{const t=this.presentation&&this.presentation.slides;e(this.ground,this.basemap,this.layers,t&&t.map((e=>e.basemap)))}))}read(e,t){t={...t,origin:"web-scene"};const r=this._isAuthoringAppVersionSetByUser,i=this._isAuthoringAppSetByUser;if(I(this,e,(t=>super.read(e,t)),t),i||(this._isAuthoringAppSetByUser=!1),r||(this._isAuthoringAppVersionSetByUser=!1),e.baseMap&&Array.isArray(e.baseMap.elevationLayers)&&this.sourceVersion.supportsVisibleElevationLayersInSlides){const t=e.baseMap.elevationLayers.map((e=>({id:e.id}))),r=this.presentation.slides,i=(e,t)=>e.visibleLayers.some((e=>e.id===t)),o=t.filter((e=>!r.some((t=>i(t,e.id)))));r.forEach((e=>{e.visibleLayers.addMany(o)}))}}_writeBasemapElevationLayers(e){const t=e.ground&&e.ground.layers;!e.baseMap&&t&&t.length&&(e.baseMap={title:"Basemap",baseMapLayers:[]}),e.baseMap&&(e.baseMap.elevationLayers=n(t))}write(e,t){if("loaded"!==this.loadStatus){const e=new s("webscene:not-loaded","Web scene must be loaded before it can be serialized");throw c.getLogger(this.declaredClass).error("#toJSON()","Web scene must be loaded before it can be serialized",this.loadError||this.loadStatus),e}this._runLayersIdGC();const r=!t?.messages;t={messages:[],...t,origin:"web-scene"};const i=super.write(e,t);if(r){const e=t.messages.filter((e=>"web-document-write:property-required"===e.name));if(e.length){const t=new s("web-document:property-required","One or more properties that are required in the webscene JSON are missing, see details for the specific errors",{errors:e});throw c.getLogger(this.declaredClass).error("#toJSON()","One or more properties that are required in the webscene JSON are missing",e),t}}return this._writeBasemapElevationLayers(i),i}async save(e){return this._debouncedSaveOperations(Y.SAVE,e)}async _saveImpl(e){this.portalItem||(c.getLogger(this.declaredClass).error("save(): requires the .portalItem property to be set"),await Promise.reject(new s("webscene:portal-item-not-set","Portal item to save to has not been set on the WebScene"))),this.portalItem.type!==z&&await Promise.reject(new s("webscene:portal-item-wrong-type",`Portal item needs to have type "${z}"`));const t=this._updateFromPromise;await this._ensureLoadBeforeSave();const r=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:this.portalItem.itemUrl&&g(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||O.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}),i=this.write({},r);return await Promise.all(r.resources.pendingOperations),await this._verifySave(i,r,e),this._updateTypeKeywords(this.portalItem),await this.portalItem.update({data:i}),await $(this._resourceReferences,r,null),A(r),t&&await t,await this._saveThumbnail(),this.portalItem}async saveAs(e,t){return this._debouncedSaveOperations(Y.SAVE_AS,t,e)}async _saveAsImpl(e,t){let r=E.from(e);r||(c.getLogger(this.declaredClass).error("saveAs(portalItem): requires a portal item parameter"),await Promise.reject(new s("webscene:portal-item-required","saveAs requires a portal item to save to"))),r.id&&(r=r.clone(),r.id=null);const i=r.portal||O.getDefault();await this._ensureLoadBeforeSave(),r.type=z,r.portal=i;const o=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:null,messages:[],portal:i,portalItem:r,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}),a=this.write({},o);await Promise.all(o.resources.pendingOperations),await this._verifySaveAs(a,o,t);const n=this.thumbnailUrl,l=!this._isOverridden("thumbnailUrl");return this._updateTypeKeywords(r),await i._signIn(),await i.user.addItem({item:r,folder:t&&t.folder,data:a}),await $(this._resourceReferences,o,null),this.portalItem=r,u.prototype.read.call(this,{version:a.version,authoringApp:a.authoringApp,authoringAppVersion:a.authoringAppVersion},{name:"web-scene",ignoreDefaults:!0,url:r.itemUrl&&g(r.itemUrl)}),A(o),n&&(this.thumbnailUrl=l?f(n,"w","8192"):n),o.portalItem=r,await this._saveThumbnail(),r}async _saveThumbnail(){this._isOverridden("thumbnailUrl")&&(await this.portalItem.updateThumbnail({thumbnail:this.thumbnailUrl}),this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}_verifySave(e,t,r,i=!1){if(!M(this.spatialReference))return Promise.reject(new s("webscene:unsupported-spatial-reference","Webscenes using spatial reference systems from Mars or Moon can not be saved currently."));let o,a=t.messages.filter((e=>"error"===e.type)).map((e=>new s(e.name,e.message,e.details)));t.blockedRelativeUrls&&(a=a.concat(t.blockedRelativeUrls.map((e=>new s("url:unsupported",`Relative url '${e}' is not supported in Web Scene`))))),r&&r.ignoreUnsupported&&(a=a.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name&&"scenemodification:unsupported"!==e.name))),r?.requiredPropertyChecksDisabled&&(a=a.filter((e=>"web-document-write:property-required"!==e.name)));const n=r&&r.strictSchemaValidationEnabled;return o=n?import("./webscene/support/schemaValidator.js").then((t=>{const r=t.validate(e);if(r.length>0){const e=`webscene did not validate:\n${r.join("\n")}`;c.getLogger(this.declaredClass).error(`${i?"saveAs":"save"}(): ${e}`)}return r.map((e=>new s("webscene:schema-validation",e)))})).then((e=>{if(n&&e.length>0){throw N(e.concat(a))}return a})):Promise.resolve(a),o.then((e=>{if(e.length>0)throw new s("webscene:save","Failed to save webscene due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}))}_verifySaveAs(e,t,r){return this.canNotSaveAs(t)?Promise.reject(T()):this._verifySave(e,t,r,!0)}verifySaveAs(e){const t=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),r=this.write({},t);return this._verifySaveAs(r,t,e)}canNotSaveAs(e){return e||(e=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),this.write({},e)),e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.writtenUrls.length>0}async updateFrom(e,t={}){const r=this._updateFrom(e,t);this._updateFromPromise=r,await r;this._updateFromPromise===r&&(this._updateFromPromise=null)}async _updateFrom(e,t={}){if(await e.whenReady(),!t.environmentExcluded&&e.environment&&(this.initialViewProperties.environment=x.prototype.clone.apply(e.environment)),!t.viewpointExcluded&&e.viewpoint&&(this.initialViewProperties.viewpoint=e.viewpoint.clone()),this.initialViewProperties.spatialReference=e.spatialReference.clone(),this.initialViewProperties.viewingMode=e.viewingMode,d(e.clippingArea)?e.clippingArea!==this.clippingArea&&(this.clippingArea=e.clippingArea.clone(),this.clippingEnabled=!0):this.clippingEnabled=!1,e.heightModelInfo&&(this.heightModelInfo=e.heightModelInfo.clone()),e.map===this)for(const r of e.allLayerViews){const e="visible";e in r&&e in r.layer&&r._isOverridden(e)&&(r.layer[e]=r[e])}(!1===t.thumbnailExcluded||null==t.thumbnailExcluded&&!t.viewpointExcluded)&&await this._updateFromThumbnail(e,t.thumbnailSize||void 0)}async _updateFromThumbnail(e,t){const r=W(e,t),i=await e.takeScreenshot({format:"jpg",width:r.width,height:r.height,disableDecorations:!0});this.thumbnailUrl=i.dataUrl}_loadFromSource(){return this.resourceInfo?this._loadFromJSON(this.resourceInfo,{origin:"web-scene"}):this.portalItem&&this.portalItem.id?this._loadFromItem(this.portalItem):this._loadObjectsWithLayers()}_readAndLoadFromJSON(e,t){const r=this._validateJSON(e);return this.read(r,t),this._loadFromJSON(r,t)}_extractOperationalLayers(e){const t=[];if(!this.sourceVersion.supportsGround&&e.baseMap&&Array.isArray(e.baseMap.elevationLayers))for(const o of e.baseMap.elevationLayers)t.push(o);const r=[],i=e=>(e.layers&&(e.layers=e.layers.filter(i)),"ArcGISTiledElevationServiceLayer"!==e.layerType||(this.sourceVersion.supportsGround||r.push(e),!1));return{operationalLayers:e.operationalLayers?e.operationalLayers.filter(i):[],operationalElevationLayers:r,basemapElevationLayers:t}}_loadFromJSON(e,t){const r=new o;return this._validateSpatialReference().then((()=>this._validateHeightModelInfo())).then((()=>import("./layers/support/layersCreator.js"))).then((({populateOperationalLayers:i})=>{const{operationalLayers:o,operationalElevationLayers:s,basemapElevationLayers:a}=this._extractOperationalLayers(e),n=[],l={context:{...t,layerContainerType:"operational-layers"}};if(this.portalItem&&(l.context.portal=this.portalItem.portal||O.getDefault()),a.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(i(this.ground.layers,a,e))}if(s.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(i(r,s,e))}return o&&o.length>0&&n.push(i(this.layers,o,l)),w(n).then((()=>{}))})).then((()=>this._loadObjectsWithLayers())).then((()=>{this.ground.layers.addMany(r)}))}async _ensureLoadBeforeSave(){await this.load(),await this._loadObjectsWithLayers();const e=[];for(const t of this.allLayers.items)if("beforeSave"in t&&"function"==typeof t.beforeSave){const r=t.beforeSave();r&&e.push(r)}await w(e)}async _loadObjectsWithLayers(){const e=[];this.ground&&e.push(this.ground.load()),this.basemap&&e.push(this.basemap.load()),this.presentation.slides.forEach((t=>{t.basemap&&e.push(t.basemap.load())})),await w(e)}async _loadFromItem(e){if(await e.load().catch((e=>{throw new s("webscene:load-portal-item","Failed to load portal item",{error:e})})),"Web Scene"!==e.type)throw new s("webscene:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Scene'",{type:e.type});const t=await e.fetchData();this.resourceInfo=t;const r={origin:"web-scene",url:g(e.itemUrl),portal:e.portal||O.getDefault(),portalItem:e,readResourcePaths:[]};await this._readAndLoadFromJSON(t,r),this._resourceReferences={portalItem:e,paths:r.readResourcePaths}}_validateSpatialReference(){const e=this.initialViewProperties,t=this._sceneSpatialReference;let r;if("local"!==e.viewingMode){if(!F(t,G.Global))return Promise.reject(new s("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in global mode, only Web Mercator, WGS84 GCS or CGCS2000 are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||L(e,t)}else{if(!F(t,G.Local))return Promise.reject(new s("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in local mode, only projected coordinate systems are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||e.equals(t)}const i=e=>e&&(d(e.camera)&&e.camera.position&&e.camera.position.spatialReference||d(e.targetGeometry)&&e.targetGeometry.spatialReference),o=e.viewpoint,a=i(o);if(a&&!r(a))return Promise.reject(new s("webscene:incompatible-camera-spatial-reference","Camera spatial reference (${cameraSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{cameraSpatialReference:a,sceneSpatialReference:t,viewingMode:e.viewingMode}));const n=this.presentation.slides.find((e=>!r(i(e.viewpoint))));if(n){const r=i(n.viewpoint);return Promise.reject(new s("webscene:incompatible-slide-spatial-reference","Slide spatial reference (${slideSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{slideSpatialReference:r,sceneSpatialReference:t,viewingMode:e.viewingMode}))}return Promise.resolve()}_validateHeightModelInfo(){const e=this._sceneSpatialReference,t=V(this.heightModelInfo,e);return t?Promise.reject(t):Promise.resolve()}_validateJSON(e){const t=K.parse(e.version||"","webscene");return D.validate(t),e.version=`${t.major}.${t.minor}`,1===t.major&&t.minor<=2&&(e.spatialReference=P.WebMercator.toJSON()),e}_updateTypeKeywords(e){"local"===this.initialViewProperties.viewingMode?e.typeKeywords?e.typeKeywords.includes(Q)||e.typeKeywords.push(Q):e.typeKeywords=[Q]:"global"===this.initialViewProperties.viewingMode&&e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e=>e!==Q))),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}get _sceneSpatialReference(){return this.initialViewProperties.spatialReference||P.WebMercator}get _verifyItemRelativeRootPath(){return this.portalItem&&this.portalItem.itemUrl?g(this.portalItem.itemUrl).path:null}_enableVerifyItemRelativeUrls(e){const t=this._verifyItemRelativeRootPath;return t&&(e.verifyItemRelativeUrls={rootPath:t,writtenUrls:[]}),e}_unscheduleLayersIdGC(){this._layersIdGCTimeoutId&&(clearTimeout(this._layersIdGCTimeoutId),this._layersIdGCTimeoutId=0)}_scheduleLayersIdGC(){this._unscheduleLayersIdGC(),this._layersIdGCTimeoutId=setTimeout((()=>{this._layersIdGCTimeoutId=0,this._runLayersIdGC()}),3e3)}_runLayersIdGC(){this._unscheduleLayersIdGC();const e=this.applicationProperties&&this.applicationProperties.viewing&&this.applicationProperties.viewing.search,t=e=>this.allLayers.some((t=>t.id===e));e&&e.layers&&(e.layers=e.layers.filter((e=>t(e.id))));const r=this.presentation&&this.presentation.slides;r&&r.forEach((e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter((e=>t(e.id))))}))}static fromJSON(e){if(!e)throw new s("webscene:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:e})}};var Y;X.version=`${D.major}.${D.minor}`,e([v({type:J,json:{write:!0}})],X.prototype,"applicationProperties",void 0),e([v({json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],X.prototype,"basemap",void 0),e([v({type:j,json:{read:{source:"clippingArea.geometry",reader:U},write:{target:"clippingArea.geometry"}}})],X.prototype,"clippingArea",void 0),e([_("clippingArea")],X.prototype,"writeClippingArea",null),e([v({type:Boolean,json:{write:{target:"clippingArea.clip"}}})],X.prototype,"clippingEnabled",void 0),e([b("clippingEnabled",["clippingArea"])],X.prototype,"readClippingEnabled",null),e([_("clippingEnabled")],X.prototype,"writeClippingEnabled",null),e([v({type:C,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],X.prototype,"floorInfo",void 0),e([v({type:R,json:{write:!0}})],X.prototype,"heightModelInfo",void 0),e([v({json:{write:{target:"operationalLayers",ignoreOrigin:!0}}})],X.prototype,"layers",void 0),e([_("layers")],X.prototype,"writeLayers",null),e([v({readOnly:!0,type:K,json:{type:H(),write:{ignoreOrigin:!0,target:"version",isRequired:!0,overridePolicy:()=>({enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],X.prototype,"sourceVersion",void 0),e([b("sourceVersion",["version"])],X.prototype,"readSourceVersion",null),e([_("sourceVersion")],X.prototype,"writeSourceVersion",null),e([v({json:{read:!1,write:!1}})],X.prototype,"tables",void 0),e([v()],X.prototype,"thumbnailUrl",null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],X.prototype,"authoringApp",null),e([_("authoringApp")],X.prototype,"writeAuthoringApp",null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],X.prototype,"authoringAppVersion",null),e([_("authoringAppVersion")],X.prototype,"writeAuthoringAppVersion",null),e([v({json:{write:{isRequired:!0,allowNull:!0,ignoreOrigin:!0,enabled:!0}}})],X.prototype,"ground",void 0),e([_("ground")],X.prototype,"writeGround",null),e([v({type:o.ofType(q),json:{write:!0}})],X.prototype,"transportationNetworks",void 0),e([v({type:B,nonNullable:!0,json:{write:{ignoreOrigin:!0,writer:(e,t,r,i)=>{if(e.slides&&e.slides.length>0){const r={...i,isPresentation:!0};t.presentation=e.write({},r)}}}}})],X.prototype,"presentation",void 0),e([v({type:k,nonNullable:!0,json:{write:{target:"initialState",isRequired:!0,ignoreOrigin:!0},default:()=>new k({viewingMode:"global",spatialReference:P.WebMercator})}})],X.prototype,"initialViewProperties",void 0),e([b("initialViewProperties",["initialState.environment","spatialReference","viewingMode","initialState.viewpoint"])],X.prototype,"readInitialViewProperties",null),e([v({type:P,json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],X.prototype,"spatialReference",null),e([v({type:["local","global"],json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],X.prototype,"viewingMode",null),e([v({type:E})],X.prototype,"portalItem",void 0),e([v()],X.prototype,"resourceInfo",void 0),X=e([S("esri.WebScene")],X),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(Y||(Y={}));const Z=X;export{Z as default};