{"version":3,"sources":["webpack:///./node_modules/arcgis-js-api/layers/mixins/SceneService.js","webpack:///./node_modules/arcgis-js-api/layers/support/I3SLayerDefinitions.js","webpack:///./node_modules/arcgis-js-api/layers/support/FetchAssociatedFeatureLayer.js","webpack:///./node_modules/arcgis-js-api/webdoc/support/saveUtils.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAO,CAAC,kCAAS,CAAC,OAAS,CAAC,2BAAO,CAAC,2BAAe,CAAC,2BAAkB,CAAC,2BAAgB,CAAC,2BAAmB,CAAC,2BAAyB,CAAC,2BAAqB,CAAC,2BAAuC,CAAC,2BAAwC,CAAC,2BAAuB,CAAC,2BAAgC,CAAC,2BAAiC,CAAC,2BAA2B,CAAC,2BAA6B,CAAC,2BAAqB,CAAC,2BAAyB,CAAC,2BAAgC,CAAC,2BAA8B,CAAC,mCAAE,gDAAgD,aAAa,sCAAsC,SAAS,kDAAkD,qDAAqD,2BAA2B,mBAAmB,aAAa,8CAA8C,6GAA6G,mDAAmD,sIAAsI,+CAA+C,uCAAuC,UAAU,+BAA+B,mCAAmC,UAAU,GAAG,GAAG,KAAK,uEAAuE,qCAAqC,+CAA+C,kEAAkE,yGAAyG,6BAA6B,0CAA0C,8CAA8C,8FAA8F,WAAW,eAAe,uFAAuF,EAAE,uCAAuC,2DAA2D,kDAAkD,gBAAgB,4EAA4E,6CAA6C,qDAAqD,4CAA4C,6CAA6C,uFAAuF,sCAAsC,+FAA+F,0CAA0C,gBAAgB,yCAAyC,uEAAuE,+BAA+B,yCAAyC,2CAA2C,gDAAgD,eAAe,uBAAuB,kBAAkB,uBAAuB,4FAA4F,+BAA+B,2DAA2D,kDAAkD,UAAU,uCAAuC,gBAAgB,yBAAyB,UAAU,wGAAwG,oDAAoD,6BAA6B,0EAA0E,2CAA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAO,CAAC,kCAAS,CAAC,OAAS,CAAC,2BAAO,CAAC,2BAAuB,CAAC,2BAAkB,CAAC,2BAAyB,CAAC,2BAAqB,CAAC,2BAAiB,CAAC,2BAAoC,CAAC,mCAAE,4BAA4B,aAAa,gBAAgB,kDAAkD,MAAM,uCAAuC,gBAAgB,qFAAqF,uEAAuE,2CAA2C,GAAG,GAAG,gBAAgB,kDAAkD,MAAM,uCAAuC,gBAAgB,0DAA0D,8DAA8D,iCAAiC,GAAG,GAAG,sCAAsC,SAAS,yDAAyD,kDAAkD,sCAAsC,uCAAuC,gBAAgB,qCAAqC,oKAAoK,uBAAuB,0CAA0C,4BAA4B,8BAA8B,WAAW,gNAAgN,sCAAsC,4EAA4E,4BAA4B,WAAW,wDAAwD,8BAA8B,uCAAuC,yDAAyD,IAAI,wCAAwC,kEAAkE,kBAAkB,oBAAoB,eAAe,kFAAkF,SAAS,EAAE,WAAW,GAAG,IAAI;AAAA,oGAAE,C","file":"js/chunk-a62d9714.95713c0b.js","sourcesContent":["// COPYRIGHT © 2020 Esri\n//\n// All rights reserved under the copyright laws of the United States\n// and applicable international laws, treaties, and conventions.\n//\n// This material is licensed for use under the Esri Master License\n// Agreement (MLA), and is bound by the terms of that agreement.\n// You may redistribute and use this code without modification,\n// provided you adhere to the terms of the MLA and include this\n// copyright notice.\n//\n// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english\n//\n// For additional information, contact:\n// Environmental Systems Research Institute, Inc.\n// Attn: Contracts and Legal Services Department\n// 380 New York Street\n// Redlands, California, USA 92373\n// USA\n//\n// email: contracts@esri.com\n//\n// See http://js.arcgis.com/4.17/esri/copyright.txt for details.\n\ndefine([\"require\",\"exports\",\"tslib\",\"../../request\",\"../../core/Error\",\"../../core/has\",\"../../core/Logger\",\"../../core/promiseUtils\",\"../../core/urlUtils\",\"../../core/accessorSupport/decorators\",\"../../core/accessorSupport/originUtils\",\"../../geometry/Extent\",\"../../geometry/HeightModelInfo\",\"../../geometry/SpatialReference\",\"../support/arcgisLayerUrl\",\"../support/commonProperties\",\"../../portal/Portal\",\"../../portal/PortalItem\",\"../../webdoc/support/saveUtils\",\"@dojo/framework/shim/Promise\"],(function(e,t,r,o,n,i,a,s,l,p,u,c,d,y,h,_,v,f,m){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.SCENE_SERVICE_ITEM_TYPE=t.SceneService=void 0;var g=a.getLogger(\"esri.layers.mixins.SceneService\");t.SceneService=function(i){return function(i){function a(){var e=null!==i&&i.apply(this,arguments)||this;return e.spatialReference=null,e.fullExtent=null,e.heightModelInfo=null,e.minScale=0,e.maxScale=0,e.version={major:Number.NaN,minor:Number.NaN,versionString:\"\"},e.copyright=null,e.sublayerTitleMode=\"item-title\",e.title=null,e.layerId=null,e._debouncedSaveOperations=s.debounce((function(t,o,n){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(t){case 0:return[2,this._save(o)];case 1:return[2,this._saveAs(n,o)]}return[2]}))}))})),e}return r.__extends(a,i),a.prototype.readSpatialReference=function(e,t){return this._readSpatialReference(t)},a.prototype._readSpatialReference=function(e){if(null!=e.spatialReference)return y.fromJSON(e.spatialReference);var t=e.store,r=t.indexCRS||t.geographicCRS,o=r&&parseInt(r.substring(r.lastIndexOf(\"/\")+1,r.length),10);return null!=o?new y(o):null},a.prototype.readFullExtent=function(e,t){var r=t.store,o=this._readSpatialReference(t);return null==o||null==r||null==r.extent||!Array.isArray(r.extent)||r.extent.some((function(e){return e=2&&(n.major=parseInt(i[0],10),n.minor=parseInt(i[1],10)),n},a.prototype.readTitlePortalItem=function(e){return\"item-title\"!==this.sublayerTitleMode?void 0:e},a.prototype.readTitleService=function(e,t){var r=this.portalItem&&this.portalItem.title;if(\"item-title\"===this.sublayerTitleMode)return h.titleFromUrlAndName(this.url,t.name);var o=t.name||h.parse(this.url).title;return\"item-title-and-service-name\"===this.sublayerTitleMode&&r&&(o=r+\" - \"+o),h.cleanTitle(o)},Object.defineProperty(a.prototype,\"url\",{set:function(e){var t=h.sanitizeUrlWithLayerId(this,e,g);this._set(\"url\",t.url),null!=t.layerId&&this._set(\"layerId\",t.layerId)},enumerable:!1,configurable:!0}),a.prototype.writeUrl=function(e,t,r,o){h.writeUrlWithLayerId(this,e,\"layers\",t,o)},Object.defineProperty(a.prototype,\"parsedUrl\",{get:function(){var e=this._get(\"url\");if(!e)return null;var t=l.urlToObject(e);return null!=this.layerId&&h.isArcGISUrl(t.path)&&(t.path=t.path+\"/layers/\"+this.layerId),t},enumerable:!1,configurable:!0}),a.prototype._verifyRootNodeAndUpdateExtent=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var o,n,i;return r.__generator(this,(function(r){switch(r.label){case 0:if(!e)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),o=this._updateExtentFromRootPage,n=[e],[4,this._fetchRootPage(e,t)];case 2:return[2,o.apply(this,n.concat([r.sent()]))];case 3:return r.sent(),[3,4];case 4:return i=this._updateExtentFromRootNode,[4,this._fetchRootNode(t)];case 5:return[2,i.apply(this,[r.sent()])]}}))}))},a.prototype._fetchRootPage=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var n,i;return r.__generator(this,(function(r){switch(r.label){case 0:return e?(n=Math.floor(e.rootIndex/e.nodesPerPage),i=this.parsedUrl.path+\"/nodepages/\"+n,[4,o(i,{responseType:\"json\",signal:t})]):[2,s.reject()];case 1:return[2,r.sent().data]}}))}))},a.prototype._updateExtentFromRootPage=function(e,t){if(null==t||null==t.nodes)throw new n(\"sceneservice:invalid-node-page\",\"Inavlid node page.\");var r=t.nodes[e.rootIndex%e.nodesPerPage];if(null==r||null==r.obb||null==r.obb.center||null==r.obb.halfSize)throw new n(\"sceneservice:invalid-node-page\",\"Inavlid node page.\");if(!(r.obb.center[0]0?[2,t.data.layers[0].id]:[2,void 0]}}))}))},a.prototype._fetchServiceLayer=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t,n;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,o(this.parsedUrl.path,{query:{f:\"json\"},responseType:\"json\",signal:e})];case 1:return(t=r.sent()).ssl&&(this.url=this.url.replace(/^http:/i,\"https:\")),n=t.data,this.read(n,{origin:\"service\",url:this.parsedUrl}),this.validateLayer(n),[2]}}))}))},a.prototype._ensureLoadBeforeSave=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return[4,this.load()];case 1:return e.sent(),\"beforeSave\"in this&&\"function\"==typeof this.beforeSave?[4,this.beforeSave()]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},a.prototype.validateLayer=function(e){},a.prototype._updateTypeKeywords=function(e,t,r){e.typeKeywords||(e.typeKeywords=[]);for(var o=0,n=t.getTypeKeywords();o0&&(p=\"Layer item did not validate:\\n\"+l.join(\"\\n\"),g.error(\"_validateAgainstJSONSchema(): \"+p),\"throw\"===i.validationOptions.failPolicy))throw u=l.map((function(e){return new n(\"sceneservice:schema-validation\",e)})),c=u.concat(a),new n(\"sceneservice-validate:error\",\"Failed to save layer item due to schema validation, see `details.errors`.\",{combined:c});r.label=2;case 2:if(a.length>0)throw new n(\"sceneservice:save\",\"Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information\",{errors:a});return[2]}}))}))},r.__decorate([p.property({json:{origins:{service:{read:!1},\"portal-item\":{read:!1}}}})],a.prototype,\"id\",void 0),r.__decorate([p.property({type:y})],a.prototype,\"spatialReference\",void 0),r.__decorate([p.reader(\"spatialReference\",[\"spatialReference\",\"store.indexCRS\",\"store.geographicCRS\"])],a.prototype,\"readSpatialReference\",null),r.__decorate([p.property({type:c})],a.prototype,\"fullExtent\",void 0),r.__decorate([p.reader(\"fullExtent\",[\"store.extent\",\"spatialReference\",\"store.indexCRS\",\"store.geographicCRS\"])],a.prototype,\"readFullExtent\",null),r.__decorate([p.property({readOnly:!0,type:d})],a.prototype,\"heightModelInfo\",void 0),r.__decorate([p.property({type:Number,json:{name:\"layerDefinition.minScale\",write:!0,origins:{service:{read:{source:\"minScale\"},write:!1}}}})],a.prototype,\"minScale\",void 0),r.__decorate([p.property({type:Number,json:{name:\"layerDefinition.maxScale\",write:!0,origins:{service:{read:{source:\"maxScale\"},write:!1}}}})],a.prototype,\"maxScale\",void 0),r.__decorate([p.property({readOnly:!0})],a.prototype,\"version\",void 0),r.__decorate([p.reader(\"version\",[\"store.version\"])],a.prototype,\"readVersion\",null),r.__decorate([p.property({type:String,json:{read:{source:\"copyrightText\"}}})],a.prototype,\"copyright\",void 0),r.__decorate([p.property({type:String,json:{read:!1}})],a.prototype,\"sublayerTitleMode\",void 0),r.__decorate([p.property({type:String})],a.prototype,\"title\",void 0),r.__decorate([p.reader(\"portal-item\",\"title\")],a.prototype,\"readTitlePortalItem\",null),r.__decorate([p.reader(\"service\",\"title\",[\"name\"])],a.prototype,\"readTitleService\",null),r.__decorate([p.property({type:Number,json:{origins:{service:{read:{source:\"id\"}},\"portal-item\":{write:{target:\"id\",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],a.prototype,\"layerId\",void 0),r.__decorate([p.property(_.url)],a.prototype,\"url\",null),r.__decorate([p.writer(\"url\")],a.prototype,\"writeUrl\",null),r.__decorate([p.property({dependsOn:[\"layerId\"]})],a.prototype,\"parsedUrl\",null),r.__decorate([p.property({readOnly:!0})],a.prototype,\"store\",void 0),r.__decorate([p.property({type:String,readOnly:!0,json:{read:{source:\"store.rootNode\"}}})],a.prototype,\"rootNode\",void 0),a=r.__decorate([p.subclass(\"esri.layers.mixins.SceneService\")],a)}(i)};var S=-1e38,b=i(\"esri-debug-messages\");t.SCENE_SERVICE_ITEM_TYPE=\"Scene Service\";var w={getTypeKeywords:function(){return[]},portalItemLayerType:\"unknown\",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:\"throw\"}}}));","// COPYRIGHT © 2020 Esri\n//\n// All rights reserved under the copyright laws of the United States\n// and applicable international laws, treaties, and conventions.\n//\n// This material is licensed for use under the Esri Master License\n// Agreement (MLA), and is bound by the terms of that agreement.\n// You may redistribute and use this code without modification,\n// provided you adhere to the terms of the MLA and include this\n// copyright notice.\n//\n// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english\n//\n// For additional information, contact:\n// Environmental Systems Research Institute, Inc.\n// Attn: Contracts and Legal Services Department\n// 380 New York Street\n// Redlands, California, USA 92373\n// USA\n//\n// email: contracts@esri.com\n//\n// See http://js.arcgis.com/4.17/esri/copyright.txt for details.\n\ndefine([\"require\",\"exports\",\"tslib\",\"../../core/JSONSupport\",\"../../core/accessorSupport/decorators\"],(function(e,t,r,o,p){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.I3SGeometryDefinition=t.I3SGeometryBuffer=t.I3SGeometryCompressedAttributes=t.I3SGeometryAttribute=t.I3STextureSetDefinition=t.I3STextureFormat=t.I3SMaterialDefinition=t.I3SMaterialPBRMetallicRoughness=t.I3SMaterialTexture=t.I3SNodePageDefinition=void 0;var a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.nodesPerPage=null,t.rootIndex=0,t.lodSelectionMetricType=null,t}return r.__extends(t,e),r.__decorate([p.property({type:Number})],t.prototype,\"nodesPerPage\",void 0),r.__decorate([p.property({type:Number})],t.prototype,\"rootIndex\",void 0),r.__decorate([p.property({type:String})],t.prototype,\"lodSelectionMetricType\",void 0),t=r.__decorate([p.subclass(\"esri.layer.support.I3SNodePageDefinition\")],t)}(o.JSONSupport);t.I3SNodePageDefinition=a;var i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.factor=1,t}return r.__extends(t,e),r.__decorate([p.property({type:Number,json:{read:{source:\"textureSetDefinitionId\"}}})],t.prototype,\"id\",void 0),r.__decorate([p.property({type:Number})],t.prototype,\"factor\",void 0),t=r.__decorate([p.subclass(\"esri.layer.support.I3SMaterialTexture\")],t)}(o.JSONSupport);t.I3SMaterialTexture=i;var n=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.baseColorFactor=[1,1,1,1],t.baseColorTexture=null,t.metallicRoughnessTexture=null,t.metallicFactor=1,t.roughnessFactor=1,t}return r.__extends(t,e),r.__decorate([p.property({type:[Number]})],t.prototype,\"baseColorFactor\",void 0),r.__decorate([p.property({type:i})],t.prototype,\"baseColorTexture\",void 0),r.__decorate([p.property({type:i})],t.prototype,\"metallicRoughnessTexture\",void 0),r.__decorate([p.property({type:Number})],t.prototype,\"metallicFactor\",void 0),r.__decorate([p.property({type:Number})],t.prototype,\"roughnessFactor\",void 0),t=r.__decorate([p.subclass(\"esri.layer.support.I3SMaterialPBRMetallicRoughness\")],t)}(o.JSONSupport);t.I3SMaterialPBRMetallicRoughness=n;var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alphaMode=\"opaque\",t.alphaCutoff=.25,t.doubleSided=!1,t.cullFace=\"none\",t.normalTexture=null,t.occlusionTexture=null,t.emissiveTexture=null,t.emissiveFactor=null,t.pbrMetallicRoughness=null,t}return r.__extends(t,e),r.__decorate([p.enumeration({opaque:\"opaque\",mask:\"mask\",blend:\"blend\"})],t.prototype,\"alphaMode\",void 0),r.__decorate([p.property({type:Number})],t.prototype,\"alphaCutoff\",void 0),r.__decorate([p.property({type:Boolean})],t.prototype,\"doubleSided\",void 0),r.__decorate([p.enumeration({none:\"none\",back:\"back\",front:\"front\"})],t.prototype,\"cullFace\",void 0),r.__decorate([p.property({type:i})],t.prototype,\"normalTexture\",void 0),r.__decorate([p.property({type:i})],t.prototype,\"occlusionTexture\",void 0),r.__decorate([p.property({type:i})],t.prototype,\"emissiveTexture\",void 0),r.__decorate([p.property({type:[Number]})],t.prototype,\"emissiveFactor\",void 0),r.__decorate([p.property({type:n})],t.prototype,\"pbrMetallicRoughness\",void 0),t=r.__decorate([p.subclass(\"esri.layer.support.I3SMaterialDefinition\")],t)}(o.JSONSupport);t.I3SMaterialDefinition=u;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),r.__decorate([p.property({type:String,json:{read:{source:[\"name\",\"index\"],reader:function(e,t){return null!=e?e:\"\"+t.index}}}})],t.prototype,\"name\",void 0),r.__decorate([p.enumeration({jpg:\"jpg\",png:\"png\",dds:\"dds\",\"ktx-etc2\":\"ktx-etc2\"})],t.prototype,\"format\",void 0),t=r.__decorate([p.subclass(\"esri.layer.support.I3STextureFormat\")],t)}(o.JSONSupport);t.I3STextureFormat=s;var d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.atlas=!1,t}return r.__extends(t,e),r.__decorate([p.property({type:[s]})],t.prototype,\"formats\",void 0),r.__decorate([p.property({type:Boolean})],t.prototype,\"atlas\",void 0),t=r.__decorate([p.subclass(\"esri.layer.support.I3STextureSetDefinition\")],t)}(o.JSONSupport);t.I3STextureSetDefinition=d;var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),r.__decorate([p.enumeration({Float32:\"Float32\",UInt64:\"UInt64\",UInt32:\"UInt32\",UInt16:\"UInt16\",UInt8:\"UInt8\"})],t.prototype,\"type\",void 0),r.__decorate([p.property({type:Number})],t.prototype,\"component\",void 0),t=r.__decorate([p.subclass(\"esri.layer.support.I3SGeometryAttribute\")],t)}(o.JSONSupport);t.I3SGeometryAttribute=y;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),r.__decorate([p.enumeration({draco:\"draco\"})],t.prototype,\"encoding\",void 0),r.__decorate([p.property({type:[String]})],t.prototype,\"attributes\",void 0),t=r.__decorate([p.subclass(\"esri.layer.support.I3SGeometryCompressedAttributes\")],t)}(o.JSONSupport);t.I3SGeometryCompressedAttributes=l;var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.offset=0,t}return r.__extends(t,e),r.__decorate([p.property({type:Number})],t.prototype,\"offset\",void 0),r.__decorate([p.property({type:y})],t.prototype,\"position\",void 0),r.__decorate([p.property({type:y})],t.prototype,\"normal\",void 0),r.__decorate([p.property({type:y})],t.prototype,\"uv0\",void 0),r.__decorate([p.property({type:y})],t.prototype,\"color\",void 0),r.__decorate([p.property({type:y})],t.prototype,\"uvRegion\",void 0),r.__decorate([p.property({type:y})],t.prototype,\"featureId\",void 0),r.__decorate([p.property({type:y})],t.prototype,\"faceRange\",void 0),r.__decorate([p.property({type:l})],t.prototype,\"compressedAttributes\",void 0),t=r.__decorate([p.subclass(\"esri.layer.support.I3SGeometryBuffer\")],t)}(o.JSONSupport);t.I3SGeometryBuffer=c;var _=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),r.__decorate([p.enumeration({triangle:\"triangle\"})],t.prototype,\"topology\",void 0),r.__decorate([p.property()],t.prototype,\"geometryBuffers\",void 0),t=r.__decorate([p.subclass(\"esri.layer.support.I3SGeometryDefinition\")],t)}(o.JSONSupport);t.I3SGeometryDefinition=_}));","// COPYRIGHT © 2020 Esri\n//\n// All rights reserved under the copyright laws of the United States\n// and applicable international laws, treaties, and conventions.\n//\n// This material is licensed for use under the Esri Master License\n// Agreement (MLA), and is bound by the terms of that agreement.\n// You may redistribute and use this code without modification,\n// provided you adhere to the terms of the MLA and include this\n// copyright notice.\n//\n// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english\n//\n// For additional information, contact:\n// Environmental Systems Research Institute, Inc.\n// Attn: Contracts and Legal Services Department\n// 380 New York Street\n// Redlands, California, USA 92373\n// USA\n//\n// email: contracts@esri.com\n//\n// See http://js.arcgis.com/4.17/esri/copyright.txt for details.\n\ndefine([\"require\",\"exports\",\"tslib\",\"../../kernel\",\"../../request\",\"../../core/arrayUtils\",\"../../core/maybe\",\"../../core/promiseUtils\",\"../FeatureLayer\",\"../../portal/Portal\",\"../../portal/PortalItem\"],(function(t,e,r,n,i,a,o,s,l,u,c){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.FetchAssociatedFeatureLayer=void 0;var h=function(){function t(t,e,r){this.parsedUrl=t,this.portalItem=e,this.signal=r,this.rootDocument=null;var n=this.parsedUrl.path.match(/^(.*)\\/SceneServer\\/layers\\/([\\d]*)\\/?$/i);n&&(this.urlParts={root:n[1],layerId:parseInt(n[2],10)})}return t.prototype.fetch=function(){var t;return r.__awaiter(this,void 0,void 0,(function(){var e,n,i;return r.__generator(this,(function(r){switch(r.label){case 0:return this.urlParts?null===(t=this.portalItem)||void 0===t?[3,1]:(n=t,[3,3]):[2,null];case 1:return[4,this.portalItemFromServiceItemId()];case 2:n=r.sent(),r.label=3;case 3:return e=n,o.isNone(e)?[2,this.loadFromUrl()]:[4,this.findAndLoadRelatedPortalItem(e)];case 4:return i=r.sent(),o.isNone(i)?[2,null]:[2,this.loadFeatureLayerFromPortalItem(i)]}}))}))},t.prototype.fetchPortalItem=function(){var t;return r.__awaiter(this,void 0,void 0,(function(){var e,n;return r.__generator(this,(function(r){switch(r.label){case 0:return this.urlParts?null===(t=this.portalItem)||void 0===t?[3,1]:(n=t,[3,3]):[2,null];case 1:return[4,this.portalItemFromServiceItemId()];case 2:n=r.sent(),r.label=3;case 3:return e=n,o.isNone(e)?[2,null]:[2,this.findAndLoadRelatedPortalItem(e)]}}))}))},t.prototype.fetchRootDocument=function(){return r.__awaiter(this,void 0,void 0,(function(){var t,e,n;return r.__generator(this,(function(r){switch(r.label){case 0:if(o.isSome(this.rootDocument))return[2,this.rootDocument];if(o.isNone(this.urlParts))return this.rootDocument={},[2,{}];t={query:{f:\"json\"},responseType:\"json\",authMode:\"no-prompt\",signal:this.signal},e=this.urlParts.root+\"/SceneServer\",r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i(e,t)];case 2:return n=r.sent(),this.rootDocument=n.data,[3,4];case 3:return r.sent(),this.rootDocument={},[3,4];case 4:return[2,this.rootDocument]}}))}))},t.prototype.fetchServiceOwningPortalUrl=function(){var t;return r.__awaiter(this,void 0,void 0,(function(){var e,a,o,l,u;return r.__generator(this,(function(r){switch(r.label){case 0:if(null==(e=null===(t=n.id)||void 0===t?void 0:t.findServerInfo(this.parsedUrl.path))?void 0:e.owningSystemUrl)return[2,e.owningSystemUrl];a=this.parsedUrl.path.replace(/(.*\\/rest)\\/.*/i,\"$1\")+\"/info\",r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i(a,{query:{f:\"json\"},responseType:\"json\",signal:this.signal})];case 2:return o=r.sent(),(l=o.data.owningSystemUrl)?[2,l]:[3,4];case 3:return u=r.sent(),s.throwIfAbortError(u),[3,4];case 4:return[2,null]}}))}))},t.prototype.findAndLoadRelatedPortalItem=function(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.fetchRelatedItems({relationshipType:\"Service2Service\",direction:\"reverse\"},{signal:this.signal})];case 1:return e=r.sent(),[2,a.find(e,(function(t){return\"Feature Service\"===t.type}))||null];case 2:return n=r.sent(),s.throwIfAbortError(n),[2,null];case 3:return[2]}}))}))},t.prototype.loadFeatureLayerFromPortalItem=function(t){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,t.load({signal:this.signal})];case 1:return r.sent(),[4,this.findMatchingAssociatedSublayerUrl(t.url)];case 2:return e=r.sent(),[2,new l({url:e,portalItem:t}).load({signal:this.signal})]}}))}))},t.prototype.loadFromUrl=function(){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(e){switch(e.label){case 0:return[4,this.findMatchingAssociatedSublayerUrl(this.urlParts.root+\"/FeatureServer\")];case 1:return t=e.sent(),[2,new l({url:t}).load({signal:this.signal})]}}))}))},t.prototype.findMatchingAssociatedSublayerUrl=function(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n,a,o,l,u,c,h,d,f,p;return r.__generator(this,(function(r){switch(r.label){case 0:return e=t.replace(/^(.*FeatureServer)(\\/[\\d]*\\/?)?$/i,\"$1\"),n={query:{f:\"json\"},responseType:\"json\",authMode:\"no-prompt\",signal:this.signal},a=this.urlParts.layerId,o=this.fetchRootDocument(),l=i(e,n),[4,s.all([l,o])];case 1:if(u=r.sent(),c=u[0],h=u[1],d=h&&h.layers,f=c.data&&c.data.layers,!Array.isArray(f))throw new Error(\"expected layers array\");if(Array.isArray(d)){for(p=0;p0)throw new s(\"save:resources\",\"Failed to save one or more resources\",{errors:A});return[2]}}))}))}}));"],"sourceRoot":""}