(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0fd495f6","chunk-2d22611c"],{2698:function(e,t,r){"use strict";function o(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,"a",(function(){return o}))},"5d34":function(e,t,r){"use strict";r.d(t,"a",(function(){return O})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return c})),r.d(t,"d",(function(){return b}));var o=r("a4ee"),a=r("6a0ed"),i=r("59b2"),n=(r("b50f"),r("c120"),r("cea0"),r("448d")),s=r("d386");let c=class extends a["a"]{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};Object(o["a"])([Object(i["b"])({type:Number})],c.prototype,"nodesPerPage",void 0),Object(o["a"])([Object(i["b"])({type:Number})],c.prototype,"rootIndex",void 0),Object(o["a"])([Object(i["b"])({type:String})],c.prototype,"lodSelectionMetricType",void 0),c=Object(o["a"])([Object(s["a"])("esri.layer.support.I3SNodePageDefinition")],c);let l=class extends a["a"]{constructor(){super(...arguments),this.factor=1}};Object(o["a"])([Object(i["b"])({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],l.prototype,"id",void 0),Object(o["a"])([Object(i["b"])({type:Number})],l.prototype,"factor",void 0),l=Object(o["a"])([Object(s["a"])("esri.layer.support.I3SMaterialTexture")],l);let p=class extends a["a"]{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};Object(o["a"])([Object(i["b"])({type:[Number]})],p.prototype,"baseColorFactor",void 0),Object(o["a"])([Object(i["b"])({type:l})],p.prototype,"baseColorTexture",void 0),Object(o["a"])([Object(i["b"])({type:l})],p.prototype,"metallicRoughnessTexture",void 0),Object(o["a"])([Object(i["b"])({type:Number})],p.prototype,"metallicFactor",void 0),Object(o["a"])([Object(i["b"])({type:Number})],p.prototype,"roughnessFactor",void 0),p=Object(o["a"])([Object(s["a"])("esri.layer.support.I3SMaterialPBRMetallicRoughness")],p);let u=class extends a["a"]{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};Object(o["a"])([Object(n["a"])({opaque:"opaque",mask:"mask",blend:"blend"})],u.prototype,"alphaMode",void 0),Object(o["a"])([Object(i["b"])({type:Number})],u.prototype,"alphaCutoff",void 0),Object(o["a"])([Object(i["b"])({type:Boolean})],u.prototype,"doubleSided",void 0),Object(o["a"])([Object(n["a"])({none:"none",back:"back",front:"front"})],u.prototype,"cullFace",void 0),Object(o["a"])([Object(i["b"])({type:l})],u.prototype,"normalTexture",void 0),Object(o["a"])([Object(i["b"])({type:l})],u.prototype,"occlusionTexture",void 0),Object(o["a"])([Object(i["b"])({type:l})],u.prototype,"emissiveTexture",void 0),Object(o["a"])([Object(i["b"])({type:[Number]})],u.prototype,"emissiveFactor",void 0),Object(o["a"])([Object(i["b"])({type:p})],u.prototype,"pbrMetallicRoughness",void 0),u=Object(o["a"])([Object(s["a"])("esri.layer.support.I3SMaterialDefinition")],u);let d=class extends a["a"]{};Object(o["a"])([Object(i["b"])({type:String,json:{read:{source:["name","index"],reader:(e,t)=>null!=e?e:""+t.index}}})],d.prototype,"name",void 0),Object(o["a"])([Object(n["a"])({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],d.prototype,"format",void 0),d=Object(o["a"])([Object(s["a"])("esri.layer.support.I3STextureFormat")],d);let b=class extends a["a"]{constructor(){super(...arguments),this.atlas=!1}};Object(o["a"])([Object(i["b"])({type:[d]})],b.prototype,"formats",void 0),Object(o["a"])([Object(i["b"])({type:Boolean})],b.prototype,"atlas",void 0),b=Object(o["a"])([Object(s["a"])("esri.layer.support.I3STextureSetDefinition")],b);let y=class extends a["a"]{};Object(o["a"])([Object(n["a"])({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],y.prototype,"type",void 0),Object(o["a"])([Object(i["b"])({type:Number})],y.prototype,"component",void 0),y=Object(o["a"])([Object(s["a"])("esri.layer.support.I3SGeometryAttribute")],y);let h=class extends a["a"]{};Object(o["a"])([Object(n["a"])({draco:"draco"})],h.prototype,"encoding",void 0),Object(o["a"])([Object(i["b"])({type:[String]})],h.prototype,"attributes",void 0),h=Object(o["a"])([Object(s["a"])("esri.layer.support.I3SGeometryCompressedAttributes")],h);let f=class extends a["a"]{constructor(){super(...arguments),this.offset=0}};Object(o["a"])([Object(i["b"])({type:Number})],f.prototype,"offset",void 0),Object(o["a"])([Object(i["b"])({type:y})],f.prototype,"position",void 0),Object(o["a"])([Object(i["b"])({type:y})],f.prototype,"normal",void 0),Object(o["a"])([Object(i["b"])({type:y})],f.prototype,"uv0",void 0),Object(o["a"])([Object(i["b"])({type:y})],f.prototype,"color",void 0),Object(o["a"])([Object(i["b"])({type:y})],f.prototype,"uvRegion",void 0),Object(o["a"])([Object(i["b"])({type:y})],f.prototype,"featureId",void 0),Object(o["a"])([Object(i["b"])({type:y})],f.prototype,"faceRange",void 0),Object(o["a"])([Object(i["b"])({type:h})],f.prototype,"compressedAttributes",void 0),f=Object(o["a"])([Object(s["a"])("esri.layer.support.I3SGeometryBuffer")],f);let O=class extends a["a"]{};Object(o["a"])([Object(n["a"])({triangle:"triangle"})],O.prototype,"topology",void 0),Object(o["a"])([Object(i["b"])()],O.prototype,"geometryBuffers",void 0),O=Object(o["a"])([Object(s["a"])("esri.layer.support.I3SGeometryDefinition")],O)},"623b":function(e,t,r){"use strict";r.d(t,"a",(function(){return h}));var o,a=r("a4ee"),i=(r("e06a"),r("6a0ed")),n=r("7ffa"),s=r("0028"),c=r("59b2"),l=(r("cea0"),r("d386")),p=r("09db"),u=r("c6f7"),d=r("8188"),b=r("1219");let y=o=class extends i["a"]{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,r,o){if(o.layer&&o.layer.spatialReference&&!o.layer.spatialReference.equals(this.geometry.spatialReference)){if(!Object(d["b"])(e.spatialReference,o.layer.spatialReference))return void(o&&o.messages&&o.messages.push(new s["a"]("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:o.layer.spatialReference,context:o})));const a=new b["a"];Object(d["v"])(e,a,o.layer.spatialReference),t[r]=a.toJSON(o)}else t[r]=e.toJSON(o);delete t[r].spatialReference}clone(){return new o({geometry:Object(n["a"])(this.geometry),type:this.type})}};Object(a["a"])([Object(c["b"])({type:b["a"]}),Object(u["a"])()],y.prototype,"geometry",void 0),Object(a["a"])([Object(p["a"])(["web-scene","portal-item"],"geometry")],y.prototype,"writeGeometry",null),Object(a["a"])([Object(c["b"])({type:["clip","mask","replace"],nonNullable:!0}),Object(u["a"])()],y.prototype,"type",void 0),y=o=Object(a["a"])([Object(l["a"])("esri.layers.support.SceneModification")],y);const h=y},"6e36":function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var o=r("2eab"),a=r("ce50"),i=r("b2b2");async function n(e,t,r,n,s,c){let l=null;if(Object(i["k"])(r)){const t=e+"/nodepages/",a=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await Object(o["default"])(a,{query:{f:"json",token:n},responseType:"json",signal:c})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(d){Object(i["k"])(s)&&s.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",a,d),l=d}}if(!t)return null;const p=e+"/nodes/",u=p+(t&&t.split("/").pop());try{return{type:"node",rootNode:(await Object(o["default"])(u,{query:{f:"json",token:n},responseType:"json",signal:c})).data,urlPrefix:p}}catch(d){throw new a["a"]("sceneservice:root-node-missing","Root node missing.",{pageError:l,nodeError:d,url:u})}}},"96ae":function(e,t,r){"use strict";r.d(t,"a",(function(){return E})),r.d(t,"b",(function(){return P}));var o=r("a4ee"),a=r("2eab"),i=r("ce50"),n=(r("c120"),r("e92d")),s=r("b2b2"),c=r("f4cc"),l=r("e041"),p=r("59b2"),u=(r("b50f"),r("cea0"),r("afcf")),d=r("d386"),b=r("09db"),y=r("ca81"),h=r("3af1"),f=r("e64d"),O=r("5996"),j=r("54b4"),m=r("22f4"),v=r("6e36"),g=r("0224"),w=r("a7e1"),S=r("792b"),x=r("8eed"),I=r("e6a6");async function T(e,t,r){if(!t||!t.resources)return;const o=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const a=new Set(t.resources.toKeep.map(e=>e.resource.path)),n=new Set,s=[];a.forEach(t=>{o.delete(t),e.paths.push(t)});for(const i of t.resources.toUpdate)if(o.delete(i.resource.path),a.has(i.resource.path)||n.has(i.resource.path)){const{resource:t,content:o,finish:a,error:n}=i,c=Object(I["getSiblingOfSameTypeI"])(t,Object(x["a"])());e.paths.push(c.path),s.push(R({resource:c,content:o,finish:a,error:n},r))}else e.paths.push(i.resource.path),s.push(_(i,r)),n.add(i.resource.path);for(const i of t.resources.toAdd)s.push(R(i,r)),e.paths.push(i.resource.path);if(o.forEach(e=>{const r=t.portalItem.resourceFromPath(e);s.push(r.portalItem.removeResource(r).catch(()=>{}))}),0===s.length)return;const l=await Object(c["j"])(s);Object(c["v"])(r);const p=l.filter(e=>"error"in e).map(e=>e.error);if(p.length>0)throw new i["a"]("save:resources","Failed to save one or more resources",{errors:p})}async function R(e,t){const r=await Object(S["d"])(e.resource.portalItem.addResource(e.resource,e.content,t));if(!0!==r.ok)throw e.error&&e.error(r.error),r.error;e.finish&&e.finish(e.resource)}async function _(e,t){const r=await Object(S["d"])(e.resource.update(e.content,t));if(!0!==r.ok)throw e.error(r.error),r.error;e.finish(e.resource)}const N=n["a"].getLogger("esri.layers.mixins.SceneService"),P=e=>{let t=class extends e{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=Object(c["i"])(async(e,t,r)=>{switch(e){case E.SAVE:return this._save(t);case E.SAVE_AS:return this._saveAs(r,t)}})}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(null!=e.spatialReference)return O["a"].fromJSON(e.spatialReference);{const t=e.store,r=t.indexCRS||t.geographicCRS,o=r&&parseInt(r.substring(r.lastIndexOf("/")+1,r.length),10);return null!=o?new O["a"](o):null}}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const o=null==e.spatialReference?{...e,spatialReference:this._readSpatialReference(t)}:e;return h["a"].fromJSON(o,r)}const o=t.store,a=this._readSpatialReference(t);return null==a||null==o||null==o.extent||!Array.isArray(o.extent)||o.extent.some(e=>e=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,o=null!=r.version?r.version.toString():"";return this.parseVersionString(o)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return Object(j["i"])(this.url,t.name);let o=t.name;if(!o&&this.url){const e=Object(j["e"])(this.url);Object(s["k"])(e)&&(o=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(o=r+" - "+o),Object(j["a"])(o)}set url(e){const t=Object(j["h"])({layer:this,url:e,nonStandardUrlAllowed:!1,logger:N});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,o){Object(j["j"])(this,e,"layers",t,o)}get parsedUrl(){const e=this._get("url");if(!e)return null;const t=Object(l["M"])(e);return null!=this.layerId&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=Object(v["a"])(this.parsedUrl.path,this.rootNode,e,this.apiKey,N,t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===(null==e?void 0:e.type)){var t,r;const o=e.rootIndex%e.pageSize,a=null==(t=e.rootPage)||null==(r=t.nodes)?void 0:r[o];if(null==a||null==a.obb||null==a.obb.center||null==a.obb.halfSize)throw new i["a"]("sceneservice:invalid-node-page","Invalid node page.");if(a.obb.center[0]0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await Object(a["default"])(this.parsedUrl.path,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const o=t.data;this.read(o,{origin:"service",url:this.parsedUrl}),this.validateLayer(o)}async _fetchVoxelServiceLayer(e){const t=(await Object(a["default"])(this.parsedUrl.path+"/layer",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,{origin:"service",url:this.parsedUrl}),this.validateLayer(t)}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const o=t.getTypeKeywords();for(const a of o)e.typeKeywords.push(a);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),r===M.newItem&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}async _saveAs(e,t){const r={...F,...t};let o=w["default"].from(e);o||(N.error("_saveAs(): requires a portal item parameter"),await Promise.reject(new i["a"]("sceneservice:portal-item-required","_saveAs() requires a portal item to save to"))),o.id&&(o=o.clone(),o.id=null);const a=o.portal||g["a"].getDefault();await this._ensureLoadBeforeSave(),o.type=k,o.portal=a;const n={origin:"portal-item",url:null,messages:[],portal:a,portalItem:o,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},s={layers:[this.write({},n)]};return await Promise.all(n.resources.pendingOperations),await this._validateAgainstJSONSchema(s,n,r),o.url=this.url,o.title||(o.title=this.title),this._updateTypeKeywords(o,r,M.newItem),await a._signIn(),await a.user.addItem({item:o,folder:r&&r.folder,data:s}),await T(this.resourceReferences,n,null),this.portalItem=o,Object(y["a"])(n),n.portalItem=o,o}async _save(e){const t={...F,...e};this.portalItem||(N.error("_save(): requires the .portalItem property to be set"),await Promise.reject(new i["a"]("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService"))),this.portalItem.type!==k&&(N.error("_save(): Non-matching portal item type. Got "+this.portalItem.type+", expected "+k),await Promise.reject(new i["a"]("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${k}"`))),await this._ensureLoadBeforeSave();const r={origin:"portal-item",url:this.portalItem.itemUrl&&Object(l["M"])(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||g["a"].getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},o={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations),await this._validateAgainstJSONSchema(o,r,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,M.existingItem),await this.portalItem.update({data:o}),await T(this.resourceReferences,r,null),Object(y["a"])(r),this.portalItem}async _validateAgainstJSONSchema(e,t,o){let a=t.messages.filter(e=>"error"===e.type).map(e=>new i["a"](e.name,e.message,e.details));if(o&&o.validationOptions.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)),o.validationOptions.enabled||A){const t=(await r.e("chunk-2d209409").then(r.bind(null,"a7eb"))).validate(e,o.portalItemLayerType);if(t.length>0){const e="Layer item did not validate:\n"+t.join("\n");if(N.error("_validateAgainstJSONSchema(): "+e),"throw"===o.validationOptions.failPolicy){const e=t.map(e=>new i["a"]("sceneservice:schema-validation",e)).concat(a);throw new i["a"]("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{combined:e})}}}if(a.length>0)throw new i["a"]("sceneservice:save","Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:a})}};return Object(o["a"])([Object(p["b"])(m["c"])],t.prototype,"id",void 0),Object(o["a"])([Object(p["b"])({type:O["a"]})],t.prototype,"spatialReference",void 0),Object(o["a"])([Object(u["a"])("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readSpatialReference",null),Object(o["a"])([Object(p["b"])({type:h["a"]})],t.prototype,"fullExtent",void 0),Object(o["a"])([Object(u["a"])("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readFullExtent",null),Object(o["a"])([Object(p["b"])({readOnly:!0,type:f["a"]})],t.prototype,"heightModelInfo",void 0),Object(o["a"])([Object(p["b"])({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],t.prototype,"minScale",void 0),Object(o["a"])([Object(p["b"])({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],t.prototype,"maxScale",void 0),Object(o["a"])([Object(p["b"])({readOnly:!0})],t.prototype,"version",void 0),Object(o["a"])([Object(u["a"])("version",["store.version"])],t.prototype,"readVersion",null),Object(o["a"])([Object(p["b"])({type:String,json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),Object(o["a"])([Object(p["b"])({type:String,json:{read:!1}})],t.prototype,"sublayerTitleMode",void 0),Object(o["a"])([Object(p["b"])({type:String})],t.prototype,"title",void 0),Object(o["a"])([Object(u["a"])("portal-item","title")],t.prototype,"readTitlePortalItem",null),Object(o["a"])([Object(u["a"])("service","title",["name"])],t.prototype,"readTitleService",null),Object(o["a"])([Object(p["b"])({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],t.prototype,"layerId",void 0),Object(o["a"])([Object(p["b"])(m["n"])],t.prototype,"url",null),Object(o["a"])([Object(b["a"])("url")],t.prototype,"writeUrl",null),Object(o["a"])([Object(p["b"])()],t.prototype,"parsedUrl",null),Object(o["a"])([Object(p["b"])({readOnly:!0})],t.prototype,"store",void 0),Object(o["a"])([Object(p["b"])({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],t.prototype,"rootNode",void 0),t=Object(o["a"])([Object(d["a"])("esri.layers.mixins.SceneService")],t),t},U=-1e38,A=!1;var M;!function(e){e[e.existingItem=0]="existingItem",e[e.newItem=1]="newItem"}(M||(M={}));const k="Scene Service",F={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var E;!function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(E||(E={}))},c6f7:function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var o=r("b2b2"),a=r("2698"),i=r("e041"),n=r("8eed"),s=r("7af8"),c=r("92ef"),l=r("59b2");function p(e){return b[u(e)]||h}function u(e){return e instanceof Blob?e.type:d(e.url)}function d(e){const t=Object(i["p"])(e);return f[t]||y}const b={},y="text/plain",h=b[y],f={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip"};for(const N in f)b[f[N]]=N;var O=r("fcf2");function j(e){const t=Object(o["k"])(e)&&e.origins?e.origins:[void 0];return(r,o)=>{const a=m(e,r,o);for(const e of t){const t=Object(l["c"])(r,e,o);for(const e in a)t[e]=a[e]}}}function m(e,t,r){if(Object(o["k"])(e)&&"resource"===e.type)return v(e,t,r);switch(Object(o["k"])(e)&&e.type?e.type:"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=O["d"];return{read:e,write:t}}}}function v(e,t,r){const n=Object(s["b"])(t,r);return{type:String,read:(e,t,r)=>{const o=Object(O["e"])(e,t,r);return n.type===String?o:"function"==typeof n.type?new n.type({url:o}):void 0},write:{writer(t,s,l,p){if(!p||!p.resources)return"string"==typeof t?void(s[l]=Object(O["f"])(t,p)):void(s[l]=t.write({},p));const u=R(t),d=u?Object(O["f"])(u,{...p,verifyItemRelativeUrls:p&&p.verifyItemRelativeUrls?{writtenUrls:p.verifyItemRelativeUrls.writtenUrls,rootPath:null}:null},O["a"].NO):null,b=n.type!==String&&(!Object(a["a"])(this)||p&&p.origin&&this.originIdOf(r)>Object(c["e"])(p.origin));p&&p.portalItem&&Object(o["k"])(d)&&!Object(i["u"])(d)?b?w(this,r,t,d,s,l,p,e):S(d,s,l,p):p&&p.portalItem&&(Object(o["j"])(d)||Object(o["k"])(Object(O["c"])(d))||Object(i["v"])(d)||b)?g(this,r,t,d,s,l,p,e):s[l]=d}}}}function g(e,t,r,a,s,c,l,u){const d=Object(n["a"])(),b=I(r,a,l),y=Object(i["B"])(Object(o["i"])(u,"prefix"),d),h=`${y}.${p(b)}`,f=l.portalItem.resourceFromPath(h);Object(i["v"])(a)&&l.resources.pendingOperations.push(T(a).then(e=>{f.path=`${y}.${p(e)}`,s[c]=f.itemRelativeUrl}).catch(()=>{})),x(e,t,f,b,l.resources.toAdd),s[c]=f.itemRelativeUrl}function w(e,t,r,o,a,n,s,c){const l=s.portalItem.resourceFromPath(o),u=I(r,o,s);p(u)===Object(i["p"])(l.path)?(x(e,t,l,u,s.resources.toUpdate),a[n]=o):g(e,t,r,o,a,n,s,c)}function S(e,t,r,o){o.resources.toKeep.push({resource:o.portalItem.resourceFromPath(e)}),t[r]=e}function x(e,t,r,o,a){a.push({resource:r,content:o,finish:r=>{_(e,t,r)}})}function I(e,t,r){return"string"==typeof e?{url:t}:new Blob([JSON.stringify(e.toJSON(r))],{type:"application/json"})}async function T(e){const t=(await Promise.resolve().then(r.bind(null,"2eab"))).default,{data:o}=await t(e,{responseType:"blob"});return o}function R(e){return Object(o["j"])(e)?null:"string"==typeof e?e:e.url}function _(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}},ca81:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var o=r("2698");function a(e){e&&e.writtenProperties&&e.writtenProperties.forEach(e=>{const t=e.target;e.newOrigin&&e.oldOrigin!==e.newOrigin&&Object(o["a"])(t)&&t.updateOrigin(e.propName,e.newOrigin)})}},cafc:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return M}));var o,a=r("a4ee"),i=r("ce50"),n=r("af40"),s=r("b2b2"),c=r("e694"),l=r("f4cc"),p=r("477c"),u=r("59b2"),d=(r("b50f"),r("c120"),r("cea0"),r("afcf")),b=r("d386"),y=r("c6f7"),h=r("a6a3"),f=r("f46e"),O=r("3d59"),j=r("b911"),m=r("0db5"),v=r("5a62"),g=r("96ae"),w=r("22f4"),S=r("5d34"),x=r("2eab"),I=r("2c4f"),T=r("6a0ed"),R=r("e041"),_=r("623b");let N=o=class extends(Object(T["b"])(I["a"].ofType(_["a"]))){constructor(e){super(e),this.url=null}toJSON(e){return this.toArray().map(t=>t.toJSON(e)).filter(e=>!!e.geometry)}clone(){return new o({url:this.url,items:this.items.map(e=>e.clone())})}_readModifications(e,t){for(const r of e)this.add(_["a"].fromJSON(r,t))}static fromJSON(e,t){const r=new o;return r._readModifications(e,t),r}static async fromUrl(e,t,r){const a={url:Object(R["M"])(e),origin:"service"},i=await Object(x["default"])(e,{responseType:"json",signal:Object(s["i"])(r,"signal")}),n=t.toJSON(),c=[];for(const o of i.data)c.push(_["a"].fromJSON({...o,geometry:{...o.geometry,spatialReference:n}},a));return new o({url:e,items:c})}};Object(a["a"])([Object(u["b"])({type:String})],N.prototype,"url",void 0),N=o=Object(a["a"])([Object(b["a"])("esri.layers.support.SceneModifications")],N);const P=N;var U=r("fcf2");let A=class extends(Object(g["b"])(Object(O["a"])(Object(j["a"])(Object(m["a"])(Object(v["a"])(Object(c["a"])(Object(f["a"])(h["a"])))))))){constructor(...e){super(...e),this.handles=new n["a"],this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.elevationInfo=null,this.path=null}destroy(){this.handles.destroy()}initialize(){this.handles.add(Object(p["b"])(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,p["c"]))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readModifications(e,t,r){this._modificationsSource={url:Object(U["b"])(e,r),context:r}}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=Object(s["i"])(e,"signal");try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){Object(l["u"])(r)}if(await this._fetchService(t),Object(s["k"])(this._modificationsSource)){const t=await P.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(!Object(s["j"])(this._modificationsSource))return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(g["a"].SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(g["a"].SAVE,e)}validateLayer(e){if(e.layerType&&"IntegratedMesh"!==e.layerType)throw new i["a"]("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new i["a"]("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new i["a"]("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}};Object(a["a"])([Object(u["b"])({type:String,readOnly:!0})],A.prototype,"geometryType",void 0),Object(a["a"])([Object(u["b"])({type:["show","hide"]})],A.prototype,"listMode",void 0),Object(a["a"])([Object(u["b"])({type:["IntegratedMeshLayer"]})],A.prototype,"operationalLayerType",void 0),Object(a["a"])([Object(u["b"])({json:{read:!1},readOnly:!0})],A.prototype,"type",void 0),Object(a["a"])([Object(u["b"])({type:S["c"],readOnly:!0})],A.prototype,"nodePages",void 0),Object(a["a"])([Object(u["b"])({type:[S["b"]],readOnly:!0})],A.prototype,"materialDefinitions",void 0),Object(a["a"])([Object(u["b"])({type:[S["d"]],readOnly:!0})],A.prototype,"textureSetDefinitions",void 0),Object(a["a"])([Object(u["b"])({type:[S["a"]],readOnly:!0})],A.prototype,"geometryDefinitions",void 0),Object(a["a"])([Object(u["b"])({readOnly:!0})],A.prototype,"serviceUpdateTimeStamp",void 0),Object(a["a"])([Object(u["b"])({type:P}),Object(y["a"])({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],A.prototype,"modifications",void 0),Object(a["a"])([Object(d["a"])(["web-scene","portal-item"],"modifications")],A.prototype,"readModifications",null),Object(a["a"])([Object(u["b"])(w["b"])],A.prototype,"elevationInfo",void 0),Object(a["a"])([Object(u["b"])({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],A.prototype,"path",void 0),A=Object(a["a"])([Object(b["a"])("esri.layers.IntegratedMeshLayer")],A);const M=A},e6a6:function(e,t,r){"use strict";r.r(t),r.d(t,"addOrUpdateResource",(function(){return c})),r.d(t,"contentToBlob",(function(){return y})),r.d(t,"fetchResources",(function(){return s})),r.d(t,"getSiblingOfSameType",(function(){return h})),r.d(t,"getSiblingOfSameTypeI",(function(){return f})),r.d(t,"removeAllResources",(function(){return p})),r.d(t,"removeResource",(function(){return l})),r.d(t,"splitPrefixFileNameAndExtension",(function(){return d}));var o=r("2eab"),a=r("ce50"),i=r("b2b2"),n=r("e041");async function s(e,t={},r){await e.load(r);const o=Object(n["B"])(e.itemUrl,"resources"),{start:a=1,num:s=10,sortOrder:c="asc",sortField:l="created"}=t,p={query:{start:a,num:s,sortOrder:c,sortField:l,token:e.apiKey},signal:Object(i["i"])(r,"signal")},u=await e.portal._request(o,p);return{total:u.total,nextStart:u.nextStart,resources:u.resources.map(({created:t,size:r,resource:o})=>({created:new Date(t),size:r,resource:e.resourceFromPath(o)}))}}async function c(e,t,r,o){if(!e.hasPath())throw new a["a"](`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const s=e.portalItem;await s.load(o);const c=Object(n["B"])(s.userItemUrl,"add"===t?"addResources":"updateResources"),[l,p]=u(e.path),d=await y(r),b=new FormData;return l&&"."!==l&&b.append("resourcesPrefix",l),b.append("fileName",p),b.append("file",d,p),b.append("f","json"),Object(i["k"])(o)&&o.access&&b.append("access",o.access),await s.portal._request(c,{method:"post",body:b,signal:Object(i["i"])(o,"signal")}),e}async function l(e,t,r){if(!t.hasPath())throw new a["a"]("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const o=Object(n["B"])(e.userItemUrl,"removeResources");await e.portal._request(o,{method:"post",query:{resource:t.path},signal:Object(i["i"])(r,"signal")}),t.portalItem=null}async function p(e,t){await e.load(t);const r=Object(n["B"])(e.userItemUrl,"removeResources");return e.portal._request(r,{method:"post",query:{deleteAll:!0},signal:Object(i["i"])(t,"signal")})}function u(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}function d(e){const[t,r]=b(e),[o,a]=u(t);return[o,a,r]}function b(e){const t=Object(n["p"])(e);return Object(i["j"])(t)?[e,""]:[e.slice(0,e.length-t.length-1),"."+t]}async function y(e){return e instanceof Blob?e:(await Object(o["default"])(e.url,{responseType:"blob"})).data}function h(e,t){if(!e.hasPath())return null;const[r,,o]=d(e.path);return e.portalItem.resourceFromPath(Object(n["B"])(r,t+o))}function f(e,t){if(!e.hasPath())return null;const[r,,o]=d(e.path);return e.portalItem.resourceFromPath(Object(n["B"])(r,t+o))}}}]); //# sourceMappingURL=chunk-0fd495f6.c434c043.js.map