12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c351ddf8","chunk-2d22611c"],{2698:function(e,t,r){"use strict";function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,"a",(function(){return a}))},"5d34":function(e,t,r){"use strict";r.d(t,"a",(function(){return j})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return l})),r.d(t,"d",(function(){return y}));var a=r("a4ee"),o=r("6a0ed"),s=r("59b2"),i=(r("b50f"),r("c120"),r("cea0"),r("448d")),n=r("d386");let l=class extends o["a"]{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};Object(a["a"])([Object(s["b"])({type:Number})],l.prototype,"nodesPerPage",void 0),Object(a["a"])([Object(s["b"])({type:Number})],l.prototype,"rootIndex",void 0),Object(a["a"])([Object(s["b"])({type:String})],l.prototype,"lodSelectionMetricType",void 0),l=Object(a["a"])([Object(n["a"])("esri.layer.support.I3SNodePageDefinition")],l);let c=class extends o["a"]{constructor(){super(...arguments),this.factor=1}};Object(a["a"])([Object(s["b"])({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],c.prototype,"id",void 0),Object(a["a"])([Object(s["b"])({type:Number})],c.prototype,"factor",void 0),c=Object(a["a"])([Object(n["a"])("esri.layer.support.I3SMaterialTexture")],c);let p=class extends o["a"]{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};Object(a["a"])([Object(s["b"])({type:[Number]})],p.prototype,"baseColorFactor",void 0),Object(a["a"])([Object(s["b"])({type:c})],p.prototype,"baseColorTexture",void 0),Object(a["a"])([Object(s["b"])({type:c})],p.prototype,"metallicRoughnessTexture",void 0),Object(a["a"])([Object(s["b"])({type:Number})],p.prototype,"metallicFactor",void 0),Object(a["a"])([Object(s["b"])({type:Number})],p.prototype,"roughnessFactor",void 0),p=Object(a["a"])([Object(n["a"])("esri.layer.support.I3SMaterialPBRMetallicRoughness")],p);let d=class extends o["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(a["a"])([Object(i["a"])({opaque:"opaque",mask:"mask",blend:"blend"})],d.prototype,"alphaMode",void 0),Object(a["a"])([Object(s["b"])({type:Number})],d.prototype,"alphaCutoff",void 0),Object(a["a"])([Object(s["b"])({type:Boolean})],d.prototype,"doubleSided",void 0),Object(a["a"])([Object(i["a"])({none:"none",back:"back",front:"front"})],d.prototype,"cullFace",void 0),Object(a["a"])([Object(s["b"])({type:c})],d.prototype,"normalTexture",void 0),Object(a["a"])([Object(s["b"])({type:c})],d.prototype,"occlusionTexture",void 0),Object(a["a"])([Object(s["b"])({type:c})],d.prototype,"emissiveTexture",void 0),Object(a["a"])([Object(s["b"])({type:[Number]})],d.prototype,"emissiveFactor",void 0),Object(a["a"])([Object(s["b"])({type:p})],d.prototype,"pbrMetallicRoughness",void 0),d=Object(a["a"])([Object(n["a"])("esri.layer.support.I3SMaterialDefinition")],d);let u=class extends o["a"]{};Object(a["a"])([Object(s["b"])({type:String,json:{read:{source:["name","index"],reader:(e,t)=>null!=e?e:""+t.index}}})],u.prototype,"name",void 0),Object(a["a"])([Object(i["a"])({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],u.prototype,"format",void 0),u=Object(a["a"])([Object(n["a"])("esri.layer.support.I3STextureFormat")],u);let y=class extends o["a"]{constructor(){super(...arguments),this.atlas=!1}};Object(a["a"])([Object(s["b"])({type:[u]})],y.prototype,"formats",void 0),Object(a["a"])([Object(s["b"])({type:Boolean})],y.prototype,"atlas",void 0),y=Object(a["a"])([Object(n["a"])("esri.layer.support.I3STextureSetDefinition")],y);let b=class extends o["a"]{};Object(a["a"])([Object(i["a"])({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],b.prototype,"type",void 0),Object(a["a"])([Object(s["b"])({type:Number})],b.prototype,"component",void 0),b=Object(a["a"])([Object(n["a"])("esri.layer.support.I3SGeometryAttribute")],b);let h=class extends o["a"]{};Object(a["a"])([Object(i["a"])({draco:"draco"})],h.prototype,"encoding",void 0),Object(a["a"])([Object(s["b"])({type:[String]})],h.prototype,"attributes",void 0),h=Object(a["a"])([Object(n["a"])("esri.layer.support.I3SGeometryCompressedAttributes")],h);let f=class extends o["a"]{constructor(){super(...arguments),this.offset=0}};Object(a["a"])([Object(s["b"])({type:Number})],f.prototype,"offset",void 0),Object(a["a"])([Object(s["b"])({type:b})],f.prototype,"position",void 0),Object(a["a"])([Object(s["b"])({type:b})],f.prototype,"normal",void 0),Object(a["a"])([Object(s["b"])({type:b})],f.prototype,"uv0",void 0),Object(a["a"])([Object(s["b"])({type:b})],f.prototype,"color",void 0),Object(a["a"])([Object(s["b"])({type:b})],f.prototype,"uvRegion",void 0),Object(a["a"])([Object(s["b"])({type:b})],f.prototype,"featureId",void 0),Object(a["a"])([Object(s["b"])({type:b})],f.prototype,"faceRange",void 0),Object(a["a"])([Object(s["b"])({type:h})],f.prototype,"compressedAttributes",void 0),f=Object(a["a"])([Object(n["a"])("esri.layer.support.I3SGeometryBuffer")],f);let j=class extends o["a"]{};Object(a["a"])([Object(i["a"])({triangle:"triangle"})],j.prototype,"topology",void 0),Object(a["a"])([Object(s["b"])()],j.prototype,"geometryBuffers",void 0),j=Object(a["a"])([Object(n["a"])("esri.layer.support.I3SGeometryDefinition")],j)},"6e36":function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var a=r("2eab"),o=r("ce50"),s=r("b2b2");async function i(e,t,r,i,n,l){let c=null;if(Object(s["k"])(r)){const t=e+"/nodepages/",o=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await Object(a["default"])(o,{query:{f:"json",token:i},responseType:"json",signal:l})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(u){Object(s["k"])(n)&&n.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",o,u),c=u}}if(!t)return null;const p=e+"/nodes/",d=p+(t&&t.split("/").pop());try{return{type:"node",rootNode:(await Object(a["default"])(d,{query:{f:"json",token:i},responseType:"json",signal:l})).data,urlPrefix:p}}catch(u){throw new o["a"]("sceneservice:root-node-missing","Root node missing.",{pageError:c,nodeError:u,url:d})}}},"7eab":function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));const a={attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1},data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1},query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsDefaultSpatialReference:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}}},"96ae":function(e,t,r){"use strict";r.d(t,"a",(function(){return k})),r.d(t,"b",(function(){return L}));var a=r("a4ee"),o=r("2eab"),s=r("ce50"),i=(r("c120"),r("e92d")),n=r("b2b2"),l=r("f4cc"),c=r("e041"),p=r("59b2"),d=(r("b50f"),r("cea0"),r("afcf")),u=r("d386"),y=r("09db"),b=r("ca81"),h=r("3af1"),f=r("e64d"),j=r("5996"),O=r("54b4"),m=r("22f4"),g=r("6e36"),v=r("0224"),I=r("a7e1"),w=r("792b"),S=r("8eed"),x=r("e6a6");async function F(e,t,r){if(!t||!t.resources)return;const a=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const o=new Set(t.resources.toKeep.map(e=>e.resource.path)),i=new Set,n=[];o.forEach(t=>{a.delete(t),e.paths.push(t)});for(const s of t.resources.toUpdate)if(a.delete(s.resource.path),o.has(s.resource.path)||i.has(s.resource.path)){const{resource:t,content:a,finish:o,error:i}=s,l=Object(x["getSiblingOfSameTypeI"])(t,Object(S["a"])());e.paths.push(l.path),n.push(_({resource:l,content:a,finish:o,error:i},r))}else e.paths.push(s.resource.path),n.push(P(s,r)),i.add(s.resource.path);for(const s of t.resources.toAdd)n.push(_(s,r)),e.paths.push(s.resource.path);if(a.forEach(e=>{const r=t.portalItem.resourceFromPath(e);n.push(r.portalItem.removeResource(r).catch(()=>{}))}),0===n.length)return;const c=await Object(l["j"])(n);Object(l["v"])(r);const p=c.filter(e=>"error"in e).map(e=>e.error);if(p.length>0)throw new s["a"]("save:resources","Failed to save one or more resources",{errors:p})}async function _(e,t){const r=await Object(w["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 P(e,t){const r=await Object(w["d"])(e.resource.update(e.content,t));if(!0!==r.ok)throw e.error(r.error),r.error;e.finish(e.resource)}const T=i["a"].getLogger("esri.layers.mixins.SceneService"),L=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(l["i"])(async(e,t,r)=>{switch(e){case k.SAVE:return this._save(t);case k.SAVE_AS:return this._saveAs(r,t)}})}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(null!=e.spatialReference)return j["a"].fromJSON(e.spatialReference);{const t=e.store,r=t.indexCRS||t.geographicCRS,a=r&&parseInt(r.substring(r.lastIndexOf("/")+1,r.length),10);return null!=a?new j["a"](a):null}}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const a=null==e.spatialReference?{...e,spatialReference:this._readSpatialReference(t)}:e;return h["a"].fromJSON(a,r)}const a=t.store,o=this._readSpatialReference(t);return null==o||null==a||null==a.extent||!Array.isArray(a.extent)||a.extent.some(e=>e<R)?null:new h["a"]({xmin:a.extent[0],ymin:a.extent[1],xmax:a.extent[2],ymax:a.extent[3],spatialReference:o})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,a=null!=r.version?r.version.toString():"";return this.parseVersionString(a)}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(O["i"])(this.url,t.name);let a=t.name;if(!a&&this.url){const e=Object(O["e"])(this.url);Object(n["k"])(e)&&(a=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(a=r+" - "+a),Object(O["a"])(a)}set url(e){const t=Object(O["h"])({layer:this,url:e,nonStandardUrlAllowed:!1,logger:T});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,a){Object(O["j"])(this,e,"layers",t,a)}get parsedUrl(){const e=this._get("url");if(!e)return null;const t=Object(c["M"])(e);return null!=this.layerId&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=Object(g["a"])(this.parsedUrl.path,this.rootNode,e,this.apiKey,T,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 a=e.rootIndex%e.pageSize,o=null==(t=e.rootPage)||null==(r=t.nodes)?void 0:r[a];if(null==o||null==o.obb||null==o.obb.center||null==o.obb.halfSize)throw new s["a"]("sceneservice:invalid-node-page","Invalid node page.");if(o.obb.center[0]<R||null==this.fullExtent||this.fullExtent.hasZ)return;const i=o.obb.halfSize,n=o.obb.center[2],l=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);this.fullExtent.zmin=n-l,this.fullExtent.zmax=n+l}else if("node"===(null==e?void 0:e.type)){var a;const t=null==(a=e.rootNode)?void 0:a.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<R)return;const r=t[2],o=t[3];this.fullExtent.zmin=r-o,this.fullExtent.zmax=r+o}}async _fetchService(e){if(null==this.url)throw new s["a"]("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await Object(o["default"])(this.url,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await Object(o["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 a=t.data;this.read(a,{origin:"service",url:this.parsedUrl}),this.validateLayer(a)}async _fetchVoxelServiceLayer(e){const t=(await Object(o["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 a=t.getTypeKeywords();for(const o of a)e.typeKeywords.push(o);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),r===E.newItem&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}async _saveAs(e,t){const r={...N,...t};let a=I["default"].from(e);a||(T.error("_saveAs(): requires a portal item parameter"),await Promise.reject(new s["a"]("sceneservice:portal-item-required","_saveAs() requires a portal item to save to"))),a.id&&(a=a.clone(),a.id=null);const o=a.portal||v["a"].getDefault();await this._ensureLoadBeforeSave(),a.type=U,a.portal=o;const i={origin:"portal-item",url:null,messages:[],portal:o,portalItem:a,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},n={layers:[this.write({},i)]};return await Promise.all(i.resources.pendingOperations),await this._validateAgainstJSONSchema(n,i,r),a.url=this.url,a.title||(a.title=this.title),this._updateTypeKeywords(a,r,E.newItem),await o._signIn(),await o.user.addItem({item:a,folder:r&&r.folder,data:n}),await F(this.resourceReferences,i,null),this.portalItem=a,Object(b["a"])(i),i.portalItem=a,a}async _save(e){const t={...N,...e};this.portalItem||(T.error("_save(): requires the .portalItem property to be set"),await Promise.reject(new s["a"]("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService"))),this.portalItem.type!==U&&(T.error("_save(): Non-matching portal item type. Got "+this.portalItem.type+", expected "+U),await Promise.reject(new s["a"]("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${U}"`))),await this._ensureLoadBeforeSave();const r={origin:"portal-item",url:this.portalItem.itemUrl&&Object(c["M"])(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||v["a"].getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},a={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations),await this._validateAgainstJSONSchema(a,r,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,E.existingItem),await this.portalItem.update({data:a}),await F(this.resourceReferences,r,null),Object(b["a"])(r),this.portalItem}async _validateAgainstJSONSchema(e,t,a){let o=t.messages.filter(e=>"error"===e.type).map(e=>new s["a"](e.name,e.message,e.details));if(a&&a.validationOptions.ignoreUnsupported&&(o=o.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)),a.validationOptions.enabled||A){const t=(await r.e("chunk-2d209409").then(r.bind(null,"a7eb"))).validate(e,a.portalItemLayerType);if(t.length>0){const e="Layer item did not validate:\n"+t.join("\n");if(T.error("_validateAgainstJSONSchema(): "+e),"throw"===a.validationOptions.failPolicy){const e=t.map(e=>new s["a"]("sceneservice:schema-validation",e)).concat(o);throw new s["a"]("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{combined:e})}}}if(o.length>0)throw new s["a"]("sceneservice:save","Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:o})}};return Object(a["a"])([Object(p["b"])(m["c"])],t.prototype,"id",void 0),Object(a["a"])([Object(p["b"])({type:j["a"]})],t.prototype,"spatialReference",void 0),Object(a["a"])([Object(d["a"])("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readSpatialReference",null),Object(a["a"])([Object(p["b"])({type:h["a"]})],t.prototype,"fullExtent",void 0),Object(a["a"])([Object(d["a"])("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readFullExtent",null),Object(a["a"])([Object(p["b"])({readOnly:!0,type:f["a"]})],t.prototype,"heightModelInfo",void 0),Object(a["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(a["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(a["a"])([Object(p["b"])({readOnly:!0})],t.prototype,"version",void 0),Object(a["a"])([Object(d["a"])("version",["store.version"])],t.prototype,"readVersion",null),Object(a["a"])([Object(p["b"])({type:String,json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),Object(a["a"])([Object(p["b"])({type:String,json:{read:!1}})],t.prototype,"sublayerTitleMode",void 0),Object(a["a"])([Object(p["b"])({type:String})],t.prototype,"title",void 0),Object(a["a"])([Object(d["a"])("portal-item","title")],t.prototype,"readTitlePortalItem",null),Object(a["a"])([Object(d["a"])("service","title",["name"])],t.prototype,"readTitleService",null),Object(a["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(a["a"])([Object(p["b"])(m["n"])],t.prototype,"url",null),Object(a["a"])([Object(y["a"])("url")],t.prototype,"writeUrl",null),Object(a["a"])([Object(p["b"])()],t.prototype,"parsedUrl",null),Object(a["a"])([Object(p["b"])({readOnly:!0})],t.prototype,"store",void 0),Object(a["a"])([Object(p["b"])({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],t.prototype,"rootNode",void 0),t=Object(a["a"])([Object(u["a"])("esri.layers.mixins.SceneService")],t),t},R=-1e38,A=!1;var E;!function(e){e[e.existingItem=0]="existingItem",e[e.newItem=1]="newItem"}(E||(E={}));const U="Scene Service",N={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var k;!function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(k||(k={}))},9980:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var a=r("f7be"),o=r("2eab"),s=r("b2b2"),i=r("f4cc"),n=r("5bd5"),l=r("0224"),c=r("a7e1");class p{constructor(e,t,r,a){this.parsedUrl=e,this.portalItem=t,this.apiKey=r,this.signal=a,this.rootDocument=null;const o=this.parsedUrl.path.match(/^(.*)\/SceneServer\/layers\/([\d]*)\/?$/i);o&&(this.urlParts={root:o[1],layerId:parseInt(o[2],10)})}async fetch(){var e;if(!this.urlParts)return null;const t=null!=(e=this.portalItem)?e:await this._portalItemFromServiceItemId();if(Object(s["j"])(t))return this._loadFromUrl();const r=await this._findAndLoadRelatedPortalItem(t);return Object(s["j"])(r)?null:this._loadFeatureLayerFromPortalItem(r)}async fetchPortalItem(){var e;if(!this.urlParts)return null;const t=null!=(e=this.portalItem)?e:await this._portalItemFromServiceItemId();return Object(s["j"])(t)?null:this._findAndLoadRelatedPortalItem(t)}async _fetchRootDocument(){if(Object(s["k"])(this.rootDocument))return this.rootDocument;if(Object(s["j"])(this.urlParts))return this.rootDocument={},{};const e={query:{f:"json",token:this.apiKey},responseType:"json",signal:this.signal},t=this.urlParts.root+"/SceneServer";try{const r=await Object(o["default"])(t,e);this.rootDocument=r.data}catch{this.rootDocument={}}return this.rootDocument}async _fetchServiceOwningPortalUrl(){var e;const t=null==(e=a["b"])?void 0:e.findServerInfo(this.parsedUrl.path);if(null!=t&&t.owningSystemUrl)return t.owningSystemUrl;const r=this.parsedUrl.path.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const e=(await Object(o["default"])(r,{query:{f:"json"},responseType:"json",signal:this.signal})).data.owningSystemUrl;if(e)return e}catch(s){Object(i["u"])(s)}return null}async _findAndLoadRelatedPortalItem(e){try{return(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:this.signal})).find(e=>"Feature Service"===e.type)||null}catch(t){return Object(i["u"])(t),null}}async _loadFeatureLayerFromPortalItem(e){await e.load({signal:this.signal});const t=await this._findMatchingAssociatedSublayerUrl(e.url);return new n["default"]({url:t,portalItem:e}).load({signal:this.signal})}async _loadFromUrl(){const e=await this._findMatchingAssociatedSublayerUrl(this.urlParts.root+"/FeatureServer");return new n["default"]({url:e}).load({signal:this.signal})}async _findMatchingAssociatedSublayerUrl(e){const t=e.replace(/^(.*FeatureServer)(\/[\d]*\/?)?$/i,"$1"),r={query:{f:"json"},responseType:"json",authMode:"no-prompt",signal:this.signal},a=this.urlParts.layerId,s=this._fetchRootDocument(),i=Object(o["default"])(t,r),[n,l]=await Promise.all([i,s]),c=l&&l.layers,p=n.data&&n.data.layers;if(!Array.isArray(p))throw new Error("expected layers array");if(Array.isArray(c)){for(let o=0;o<Math.min(c.length,p.length);o++)if(c[o].id===a)return`${t}/${p[o].id}`}else if(a<p.length)return`${t}/${p[a].id}`;throw new Error("could not find matching associated sublayer")}async _portalItemFromServiceItemId(){const e=(await this._fetchRootDocument()).serviceItemId;if(!e)return null;const t=new c["default"]({id:e,apiKey:this.apiKey}),r=await this._fetchServiceOwningPortalUrl();Object(s["k"])(r)&&(t.portal=new l["a"]({url:r}));try{return t.load({signal:this.signal})}catch(a){return Object(i["u"])(a),null}}}},ca81:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var a=r("2698");function o(e){e&&e.writtenProperties&&e.writtenProperties.forEach(e=>{const t=e.target;e.newOrigin&&e.oldOrigin!==e.newOrigin&&Object(a["a"])(t)&&t.updateOrigin(e.propName,e.newOrigin)})}},d321:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return X}));var a=r("a4ee"),o=r("4856"),s=(r("b423"),r("261a"),r("b48d"),r("478c"),r("667b"),r("ff57"),r("da00"),r("f976"),r("5cdb")),i=r("2eab"),n=r("2c4f"),l=r("ce50"),c=r("e92d"),p=r("b2b2"),d=r("e694"),u=r("f4cc"),y=r("477c"),b=r("e041"),h=r("59b2"),f=(r("b50f"),r("c120"),r("4c37")),j=(r("cea0"),r("afcf")),O=r("d386"),m=r("92ef"),g=r("a6a3"),v=r("f46e"),I=r("3d59"),w=r("b911"),S=r("0db5"),x=r("5a62"),F=r("96ae"),_=r("7eab"),P=r("22f4"),T=r("ecc1"),L=r("91b0c"),R=r("9980"),A=r("2feb"),E=r("80b7"),U=r("c1da"),N=r("5d34"),k=r("c246"),D=r("10eb"),q=r("00c5"),M=r("6a0ed");let C=class extends M["a"]{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};Object(a["a"])([Object(h["b"])({type:String,json:{read:!0,write:!0}})],C.prototype,"name",void 0),Object(a["a"])([Object(h["b"])({type:String,json:{read:!0,write:!0}})],C.prototype,"field",void 0),Object(a["a"])([Object(h["b"])({type:[Number],json:{read:!0,write:!0}})],C.prototype,"currentRangeExtent",void 0),Object(a["a"])([Object(h["b"])({type:[Number],json:{read:!0,write:!0}})],C.prototype,"fullRangeExtent",void 0),Object(a["a"])([Object(h["b"])({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],C.prototype,"type",void 0),C=Object(a["a"])([Object(O["a"])("esri.layers.support.RangeInfo")],C);const K=C;var Q=r("60ec"),B=r("69dd"),V=r("f51b"),G=r("42be");const z=["3DObject","Point"],$=c["a"].getLogger("esri.layers.SceneLayer"),J=Object(A["a"])();let H=class extends(Object(F["b"])(Object(I["a"])(Object(w["a"])(Object(S["a"])(Object(x["a"])(Object(d["a"])(Object(v["a"])(g["a"])))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new n["a"],this.definitionExpression=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var r,a,o,s;const i=null==(r=this.getFeatureType(null==t?void 0:t.feature))||null==(a=r.domains)?void 0:a[e];return i&&"inherited"!==i.type?i:null!=(o=null==(s=this.getField(e))?void 0:s.domain)?o:null}getFeatureType(e){return e&&Object(p["k"])(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){return Object(p["k"])(this.associatedLayer)?this.associatedLayer.types:[]}get typeIdField(){return Object(p["k"])(this.associatedLayer)?this.associatedLayer.typeIdField:null}get formTemplate(){return Object(p["k"])(this.associatedLayer)?this.associatedLayer.formTemplate:null}get fieldsIndex(){return new E["a"](this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:N["c"].fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get geometryType(){return Z[this.profile]||"mesh"}set renderer(e){Object(U["k"])(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){const e=Object(p["k"])(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:_["a"],{query:t,editing:{supportsGlobalId:r,supportsRollbackOnFailure:a,supportsUploadWithItemId:o,supportsReturnServiceEditsInSourceSpatialReference:s},data:{supportsZ:i,supportsM:n,isVersioned:l,supportsAttachment:c},operations:{supportsEditing:d,supportsUpdate:u,supportsQuery:y,supportsQueryAttachments:b}}=e,h=e.operations.supportsChangeTracking;return{query:t,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:s,supportsRollbackOnFailure:a,supportsGeometryUpdate:!1,supportsUploadWithItemId:o},data:{supportsAttachment:c,supportsZ:i,supportsM:n,isVersioned:l},operations:{supportsQuery:y,supportsQueryAttachments:b,supportsEditing:d&&h,supportsAdd:!1,supportsDelete:!1,supportsUpdate:u&&h}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.userHasEditingPrivileges}set editingEnabled(e){null!=e?this._override("editingEnabled",e):this._clearOverride("editingEnabled")}get defaultPopupTemplate(){return Object(p["k"])(this.associatedLayer)||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return Object(p["k"])(this.associatedLayer)?this.associatedLayer.displayField:null}readProfile(e,t){const r=t.store.profile;return null!=r&&W[r]?W[r]:($.error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){const t=Object(p["k"])(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(u["u"]).then(()=>this._fetchService(t)).then(()=>Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t)])).then(()=>this._validateElevationInfo()).then(()=>this._applyAssociatedLayerOverrides()).then(()=>this._populateFieldUsageInfo()).then(()=>Object(Q["a"])(this,{origin:"service"},t)).then(()=>Object(U["k"])(this.renderer,this.fieldsIndex)).then(()=>this.finishLoadEditablePortalLayer(e));return this.addResolvingPromise(r),Promise.resolve(this)}createQuery(){const e=new B["a"];return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(null!=e&&e.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e})}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:($.error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return Object(V["a"])(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return Object(p["k"])(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),Object(p["j"])(this.associatedLayer))throw new l["a"]("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new l["a"]("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new l["a"]("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new l["a"]("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const a of this.statisticsInfo)if(a.name===r.name){const e=Object(b["B"])(this.parsedUrl.path,a.href);return Object(i["default"])(e,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then(e=>e.data)}throw new l["a"]("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(F["a"].SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(F["a"].SAVE,e)}async applyEdits(e,t){const a=await r.e("chunk-2d0a4c1e").then(r.bind(null,"0899"));if(await this.load(),Object(p["j"])(this.associatedLayer))throw new l["a"](this.type+"-layer:not-editable","Service is not editable");return await this.associatedLayer.load(),a.applyEdits(this,this.associatedLayer.source,e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&-1===z.indexOf(e.layerType))throw new l["a"]("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new l["a"]("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new l["a"]("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,a=!1;if(null==e)r=!0,a=!0;else{const o=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,a=o;break;case"vertex-reference-frame":r=!0,a=!o;break;default:r=!1}}if(!r)throw new l["a"]("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!a)throw new l["a"]("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new l["a"]("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some(t=>t.name===e.name)),r=!!(Object(p["k"])(this.associatedLayer)&&this.associatedLayer.fields&&this.associatedLayer.fields.some(t=>t&&e.name===t.name)),a={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=a}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides()}_applyAssociatedLayerFieldsOverrides(){if(Object(p["j"])(this.associatedLayer)||!this.associatedLayer.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(Object(p["j"])(this.associatedLayer))return;const e=["popupTemplate","popupEnabled"],t=Object(f["a"])(this);for(let r=0;r<e.length;r++){const a=e[r],o=this.originIdOf(a),s=this.associatedLayer.originIdOf(a);o<s&&(s===m["a"].SERVICE||s===m["a"].PORTAL_ITEM)&&t.setAtOrigin(a,this.associatedLayer[a],s)}}async _setAssociatedFeatureLayer(e){if(-1===["mesh-pyramids","points"].indexOf(this.profile))return;const t=new R["a"](this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedLayer=await t.fetch()}catch(r){Object(u["m"])(r)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await Object(y["g"])(()=>this.popupEnabled&&null!=this.popupTemplate);const e="this SceneLayer: "+this.title;null==this.attributeStorageInfo?$.warn("Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on "+e):$.info("Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on "+e)}_validateElevationInfo(){const e=this.elevationInfo;e&&("mesh-pyramids"===this.profile&&"absolute-height"!==e.mode&&$.warn(".elevationInfo=","Mesh scene layers only support absolute-height elevation mode"),e.featureExpressionInfo&&"0"!==e.featureExpressionInfo.expression&&$.warn(".elevationInfo=","Scene layers do not support featureExpressionInfo"))}};Object(a["a"])([Object(h["b"])({types:{key:"type",base:T["a"],typeMap:{selection:L["a"]}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],H.prototype,"featureReduction",void 0),Object(a["a"])([Object(h["b"])({type:[K],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],H.prototype,"rangeInfos",void 0),Object(a["a"])([Object(h["b"])({json:{read:!1}})],H.prototype,"associatedLayer",void 0),Object(a["a"])([Object(h["b"])({type:["show","hide"]})],H.prototype,"listMode",void 0),Object(a["a"])([Object(h["b"])({type:["ArcGISSceneServiceLayer"]})],H.prototype,"operationalLayerType",void 0),Object(a["a"])([Object(h["b"])({json:{read:!1},readOnly:!0})],H.prototype,"type",void 0),Object(a["a"])([Object(h["b"])({...J.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],H.prototype,"fields",void 0),Object(a["a"])([Object(h["b"])()],H.prototype,"types",null),Object(a["a"])([Object(h["b"])()],H.prototype,"typeIdField",null),Object(a["a"])([Object(h["b"])()],H.prototype,"formTemplate",null),Object(a["a"])([Object(h["b"])({readOnly:!0})],H.prototype,"fieldsIndex",null),Object(a["a"])([Object(h["b"])({type:q["a"],json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],H.prototype,"floorInfo",void 0),Object(a["a"])([Object(h["b"])(J.outFields)],H.prototype,"outFields",void 0),Object(a["a"])([Object(h["b"])({type:N["c"],readOnly:!0,json:{read:!1}})],H.prototype,"nodePages",void 0),Object(a["a"])([Object(j["a"])("service","nodePages",["nodePages","pointNodePages"])],H.prototype,"readNodePages",null),Object(a["a"])([Object(h["b"])({type:[N["b"]],readOnly:!0})],H.prototype,"materialDefinitions",void 0),Object(a["a"])([Object(h["b"])({type:[N["d"]],readOnly:!0})],H.prototype,"textureSetDefinitions",void 0),Object(a["a"])([Object(h["b"])({type:[N["a"]],readOnly:!0})],H.prototype,"geometryDefinitions",void 0),Object(a["a"])([Object(h["b"])({readOnly:!0})],H.prototype,"serviceUpdateTimeStamp",void 0),Object(a["a"])([Object(h["b"])({readOnly:!0})],H.prototype,"attributeStorageInfo",void 0),Object(a["a"])([Object(h["b"])({readOnly:!0})],H.prototype,"statisticsInfo",void 0),Object(a["a"])([Object(h["b"])({type:n["a"].ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],H.prototype,"excludeObjectIds",void 0),Object(a["a"])([Object(h["b"])({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],H.prototype,"definitionExpression",void 0),Object(a["a"])([Object(h["b"])({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],H.prototype,"path",void 0),Object(a["a"])([Object(h["b"])(P["b"])],H.prototype,"elevationInfo",null),Object(a["a"])([Object(h["b"])({type:String})],H.prototype,"geometryType",null),Object(a["a"])([Object(h["b"])(P["d"])],H.prototype,"labelsVisible",void 0),Object(a["a"])([Object(h["b"])({type:[k["a"]],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:D["a"]},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:D["a"]},write:!0}})],H.prototype,"labelingInfo",void 0),Object(a["a"])([Object(h["b"])(P["e"])],H.prototype,"legendEnabled",void 0),Object(a["a"])([Object(h["b"])({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){var r,a;if("number"==typeof e&&e>=0&&e<=1)return e;const o=null==(r=t.layerDefinition)||null==(a=r.drawingInfo)?void 0:a.transparency;return void 0!==o?Object(G["b"])(o):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],H.prototype,"opacity",void 0),Object(a["a"])([Object(h["b"])({types:s["b"],json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],H.prototype,"renderer",null),Object(a["a"])([Object(h["b"])({json:{read:!1}})],H.prototype,"cachedDrawingInfo",void 0),Object(a["a"])([Object(j["a"])("service","cachedDrawingInfo")],H.prototype,"readCachedDrawingInfo",null),Object(a["a"])([Object(h["b"])({readOnly:!0,json:{read:!1}})],H.prototype,"capabilities",null),Object(a["a"])([Object(h["b"])({type:Boolean,json:{read:!1}})],H.prototype,"editingEnabled",null),Object(a["a"])([Object(h["b"])(P["j"])],H.prototype,"popupEnabled",void 0),Object(a["a"])([Object(h["b"])({type:o["a"],json:{name:"popupInfo",write:!0}})],H.prototype,"popupTemplate",void 0),Object(a["a"])([Object(h["b"])({readOnly:!0,json:{read:!1}})],H.prototype,"defaultPopupTemplate",null),Object(a["a"])([Object(h["b"])({type:String,json:{read:!1}})],H.prototype,"objectIdField",void 0),Object(a["a"])([Object(j["a"])("service","objectIdField",["objectIdField","fields"])],H.prototype,"readObjectIdField",null),Object(a["a"])([Object(h["b"])({type:String,json:{read:!1}})],H.prototype,"globalIdField",void 0),Object(a["a"])([Object(j["a"])("service","globalIdField",["globalIdField","fields"])],H.prototype,"readGlobalIdField",null),Object(a["a"])([Object(h["b"])({readOnly:!0,type:String,json:{read:!1}})],H.prototype,"displayField",null),Object(a["a"])([Object(h["b"])({type:String,json:{read:!1}})],H.prototype,"profile",void 0),Object(a["a"])([Object(j["a"])("service","profile",["store.profile"])],H.prototype,"readProfile",null),Object(a["a"])([Object(h["b"])({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],H.prototype,"normalReferenceFrame",void 0),Object(a["a"])([Object(h["b"])(P["m"])],H.prototype,"screenSizePerspectiveEnabled",void 0),H=Object(a["a"])([Object(O["a"])("esri.layers.SceneLayer")],H);const W={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Z={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},X=H},e6a6:function(e,t,r){"use strict";r.r(t),r.d(t,"addOrUpdateResource",(function(){return l})),r.d(t,"contentToBlob",(function(){return b})),r.d(t,"fetchResources",(function(){return n})),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 c})),r.d(t,"splitPrefixFileNameAndExtension",(function(){return u}));var a=r("2eab"),o=r("ce50"),s=r("b2b2"),i=r("e041");async function n(e,t={},r){await e.load(r);const a=Object(i["B"])(e.itemUrl,"resources"),{start:o=1,num:n=10,sortOrder:l="asc",sortField:c="created"}=t,p={query:{start:o,num:n,sortOrder:l,sortField:c,token:e.apiKey},signal:Object(s["i"])(r,"signal")},d=await e.portal._request(a,p);return{total:d.total,nextStart:d.nextStart,resources:d.resources.map(({created:t,size:r,resource:a})=>({created:new Date(t),size:r,resource:e.resourceFromPath(a)}))}}async function l(e,t,r,a){if(!e.hasPath())throw new o["a"](`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const n=e.portalItem;await n.load(a);const l=Object(i["B"])(n.userItemUrl,"add"===t?"addResources":"updateResources"),[c,p]=d(e.path),u=await b(r),y=new FormData;return c&&"."!==c&&y.append("resourcesPrefix",c),y.append("fileName",p),y.append("file",u,p),y.append("f","json"),Object(s["k"])(a)&&a.access&&y.append("access",a.access),await n.portal._request(l,{method:"post",body:y,signal:Object(s["i"])(a,"signal")}),e}async function c(e,t,r){if(!t.hasPath())throw new o["a"]("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const a=Object(i["B"])(e.userItemUrl,"removeResources");await e.portal._request(a,{method:"post",query:{resource:t.path},signal:Object(s["i"])(r,"signal")}),t.portalItem=null}async function p(e,t){await e.load(t);const r=Object(i["B"])(e.userItemUrl,"removeResources");return e.portal._request(r,{method:"post",query:{deleteAll:!0},signal:Object(s["i"])(t,"signal")})}function d(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}function u(e){const[t,r]=y(e),[a,o]=d(t);return[a,o,r]}function y(e){const t=Object(i["p"])(e);return Object(s["j"])(t)?[e,""]:[e.slice(0,e.length-t.length-1),"."+t]}async function b(e){return e instanceof Blob?e:(await Object(a["default"])(e.url,{responseType:"blob"})).data}function h(e,t){if(!e.hasPath())return null;const[r,,a]=u(e.path);return e.portalItem.resourceFromPath(Object(i["B"])(r,t+a))}function f(e,t){if(!e.hasPath())return null;const[r,,a]=u(e.path);return e.portalItem.resourceFromPath(Object(i["B"])(r,t+a))}}}]);
- //# sourceMappingURL=chunk-c351ddf8.e6c6e740.js.map
|