{"size": 62459, "ext": "js", "max_stars_repo_path": "client/dist/jimu-arcgis/index.js", "max_stars_repo_name": "Freda0502/ArcGISExperienceBuilder", "max_stars_repo_stars_event_min_datetime": "2021-06-18T18:20:55.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-18T18:20:55.000Z", "max_issues_repo_path": "client/dist/jimu-arcgis/index.js", "max_issues_repo_name": "Freda0502/ArcGISExperienceBuilder", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/dist/jimu-arcgis/index.js", "max_forks_repo_name": "Freda0502/ArcGISExperienceBuilder", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 62459.0, "max_line_length": 62459, "alphanum_fraction": 0.7550393058}
System.register(["jimu-core"],(function(e){var t;return{setters:[function(e){t=e}],execute:function(){e(function(e){var t={};function r(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(i,a,function(t){return e[t]}.bind(null,a));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,r){e.exports=t},function(e,t,r){"use strict";var i,a;r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return i})),function(e){e.Map="MAP",e.WebMap="WEB_MAP",e.WebScene="WEB_SCENE"}(i||(i={})),function(e){e.BaseDynamicLayer="base-dynamic",e.BaseElevationLayer="base-elevation",e.BaseTileLayer="base-tile",e.BuildingSceneLayer="building-scene",e.CSVLayer="csv",e.ElevationLayer="elevation",e.FeatureLayer="feature",e.GeoJSONLayer="geojson",e.GeoRSSLayer="geo-rss",e.GraphicsLayer="graphics",e.GroupLayer="group",e.ImageryLayer="imagery",e.IntegratedMeshLayer="integrated-mesh",e.KMLLayer="kml",e.MapImageLayer="map-image",e.MapNotesLayer="map-notes",e.PointCloudLayer="point-cloud",e.SceneLayer="scene",e.TileLayer="tile",e.UnknownLayer="unknown",e.UnsupportedLayer="unsupported",e.VectorTileLayer="vector-tile",e.WMSLayer="wms",e.WMTSLayer="wmts",e.WebTileLayer="web-tile"}(a||(a={}))},,function(e,t,r){"use strict";r.r(t),r.d(t,"JimuLayerView",(function(){return O})),r.d(t,"JimuFeatureLayerView",(function(){return z})),r.d(t,"JimuSceneLayerView",(function(){return R})),r.d(t,"JimuMapView",(function(){return q})),r.d(t,"JimuMapViewGroup",(function(){return T})),r.d(t,"MapViewManager",(function(){return U})),r.d(t,"DataSourceTypes",(function(){return W.b})),r.d(t,"LayerTypes",(function(){return W.c})),r.d(t,"ArcGISDataSourceTypes",(function(){return W.a})),r.d(t,"ArcGISDependencyDefineExtension",(function(){return X})),r.d(t,"ArcGISDataSourceFactoryUriExtension",(function(){return Y})),r.d(t,"loadArcGISJSAPIModules",(function(){return s})),r.d(t,"JimuMapViewComponent",(function(){return Z})),r.d(t,"JimuLayerViewComponent",(function(){return re})),r.d(t,"init",(function(){return ie})),r.d(t,"geometryUtils",(function(){return i})),r.d(t,"zoomToUtils",(function(){return a})),r.d(t,"portalUtils",(function(){return n})),r.d(t,"defaultMessages",(function(){return J}));var i={};r.r(i),r.d(i,"projectToSpatialReference",(function(){return u}));var a={};r.r(a),r.d(a,"zoomTo",(function(){return p}));var n={};r.r(n),r.d(n,"checkDefaultBaseMapIsExist",(function(){return P})),r.d(n,"getDefaultWebMap",(function(){return x}));var o=r(0);function s(e){return Object(o.loadArcGISJSAPIModules)(e)}function u(e,t){return e&&0!==e.length&&e[0]&&t.wkid!==e[0].spatialReference.wkid&&!t.equals(e[0].spatialReference)?s(["esri/tasks/GeometryService","esri/tasks/support/ProjectParameters","esri/geometry/projection"]).then((function(r){var i,a,n;if(i=r[0],a=r[1],(n=r[2]).isSupported()){if(n.isLoaded()){var o=function(e,t,r){return r.project(e,t)}(e,t,n);return Promise.resolve(o)}return n.load(),c(e,t,i,a).then((function(e){return Promise.resolve(e)}),(function(e){return console.error(e),Promise.reject(e)}))}return c(e,t,i,a).then((function(e){return Promise.resolve(e)}),(function(e){return console.error(e),Promise.reject(e)}))})):Promise.resolve(e)}function c(e,t,r,i){var a=new r({url:Object(o.getAppStore)().getState().portalSelf.helperServices.geometry.url}),n=new i({geometries:e,outSpatialReference:t});return a.project(n)}var l,d=null;function p(e,t,r){return e&&t?(r||(r={}),s(["esri/Graphic","esri/geometry/Extent","esri/layers/Layer","esri/layers/support/TileInfo"]).then((function(i){var a,n,o;return a=i[0],n=i[1],o=i[2],d=i[3],t instanceof n?y(e,t,r.scale):Array.isArray(t)&&t.length&&t[0]instanceof a?function(e,t,r){if("3d"===e.type&&!r)return e.goTo(t);return v(e,t).then((function(t){return y(e,t,r)})).catch((function(e){return Promise.reject(e)}))}(e,t,r.scale):t instanceof o?h(e,t,null,null,r.scale):t.layer&&t.layer instanceof o&&t.extent&&t.extent instanceof n?h(e,t.layer,null,t.extent,r.scale):t.layer&&t.layer instanceof o&&Array.isArray(t.graphics)&&t.graphics.length&&t.graphics[0]instanceof a?h(e,t.layer,t.graphics,null,r.scale):Promise.reject(new Error("Invalid target."))}))):Promise.reject(new Error("Invalid target."))}function h(e,t,r,i,a){var n;if(i&&f(i)){if("3d"===e.type&&!a)return u([i],e.spatialReference).then((function(t){return e.goTo(t)}));n=Promise.resolve(i)}else if(r){if("3d"===e.type&&!a)return e.goTo(r);n=v(e,r)}else n=function(e,t){return"feature"===t.type?function(e,t){var r=t.fullExtent.clone();if(!t.url)return Promise.resolve(r);var i=t.capabilities.query;return i?s(["esri/tasks/support/Query"]).then((function(a){var n=new(0,a[0]);return n.where=t.definitionExpression?t.definitionExpression:"1=1",n.outSpatialReference=e.spatialReference,n.returnGeometry=!0,i.supportsExtent?t.queryExtent(n).then((function(e){return e.extent})).catch((function(e){return Promise.resolve(r)})):t.queryFeatures(n).then((function(t){return v(e,t.features)})).catch((function(e){return Promise.resolve(r)}))})).catch((function(e){return Promise.resolve(r)})):Promise.resolve(r)}(e,t):Promise.resolve(t.fullExtent.clone())}(e,t);return n.then((function(t){return u([t],e.spatialReference).then((function(e){return e&&e[0]}))})).then((function(r){if(!f(r))return Promise.reject(new Error("Invalid extent."));if(a)return r=S(e,r),j(e,r,a).then((function(t){return g(e,t)}));var i=t.minScale||0,n=t.maxScale||0;if(!w(r))return r=function(e,t){var r=e.size[0]/e.size[1],i=t.width/t.height;if(i>r){var a=t.width/r/2;t.ymin=t.center.y-a,t.ymax=t.center.y+a}else if(i<r){var n=t.height*r/2;t.xmin=t.center.x-n,t.xmax=t.center.x+n}return t}(e,r),function(e,t){return s(["esri/config","esri/geometry/support/WKIDUnitConversion"]).then((function(r){var i,a;i=r[0],a=r[1];var n,o,s=e.size[0],u=a,c=t.spatialReference;c&&(n=c.wkid,o=c.wkt);var l=null;if(n)l=u.values[u[n]];else if(o&&-1!==o.search(/^PROJCS/i)){var d=/UNIT\[([^\]]+)\]\]$/i.exec(o);d&&d[1]&&(l=parseFloat(d[1].split(",")[1]))}return t.width/s*(l||20015077/180)*39.37*(i.screenDPI||96)})).catch((function(e){return Promise.reject()}))}(e,r).then((function(t){return i>0&&t>i?(i=M(e,i,!0),r=S(e,r),j(e,r,i).then((function(t){return g(e,t)}))):t<n?(n=M(e,n,!1),r=S(e,r),j(e,r,n).then((function(t){return g(e,t)}))):g(e,r)}));var o=V(e,i,n,3);return o?("3d"===e.type&&4513.9887>o&&(o=0===i||4513.9887<i?4513.9887:i),r=S(e,r),j(e,r,o).then((function(t){return g(e,t)}))):void 0})).catch((function(e){return Promise.reject(e)}))}function y(e,t,r){return f(t=t.clone())?u([t],e.spatialReference).then((function(r){var i=r&&r[0];return i||(i=t),w(i)?function(e,t){var r=V(e,0,0,3);return r?(t=S(e,t),j(e,t,r)):Promise.reject()}(e,i):i})).then((function(t){return r?j(e,t,r):t})).then((function(t){return g(e,t)})).catch((function(e){return Promise.reject(e)})):Promise.reject(new Error("Invalid extent."))}function g(e,t){return e.goTo(t)}function f(e){return e&&m(e.xmin)&&m(e.ymin)&&m(e.xmax)&&m(e.ymax)}function m(e){return 0===e||!!e}function w(e){return e.xmin+l.X===e.xmax-l.X&&e.ymin+l.Y===e.ymax-l.Y}function v(e,t,r){void 0===r&&(r={});var i=t&&t[0]&&t[0].layer;return i&&"scene"===i.type?function(e,t,r){return s(["esri/tasks/support/Query"]).then((function(r){var i=r[0];if(t){var a=new i;return a.objectIds=e.map((function(e){return e.attributes[t.objectIdField]})),a.returnGeometry=!0,t.queryExtent(a).then((function(e){return 1===e.count?e.extent.expand(3.5):e.extent.expand(2)}))}return Promise.reject()})).catch((function(e){return Promise.reject(e)}))}(t,i,r.factor):"3d"===e.type?I(t,3):I(t)}function I(e,t){return s(["esri/Graphic","esri/geometry/Extent","esri/geometry/Point"]).then((function(r){var i,a,n,o=null,s=e;i=r[0],a=r[1],n=r[2];try{if(s&&1===s.length&&s[0].geometry&&"esri.geometry.Multipoint"===s[0].geometry.declaredClass&&1===s[0].geometry.points.length){var u=s[0].geometry.points[0];s=[new i({geometry:new n({x:u[0],y:u[1],spatialReference:s[0].geometry.spatialReference})})]}if(s&&1===s.length&&s[0].geometry&&"esri.geometry.Point"===s[0].geometry.declaredClass){var c=s[0].geometry;o=new a({xmin:c.x-l.X,ymin:c.y-l.Y,xmax:c.x+l.X,ymax:c.y+l.Y,spatialReference:c.spatialReference})}else s&&s.length>0&&(o=function(e,t){if(!e||!e.length)return null;var r,i=null,a=e.length;for(r=0;r<a;r++){var n=e[r].geometry;if(n){var o=n.extent;o||"point"!==n.type||null==n.x||null==n.y||(o=new t({xmin:n.x,ymin:n.y,xmax:n.x,ymax:n.y,spatialReference:n.spatialReference})),o&&(i=i?i.union(o):o)}}if(!i||i.width<0||i.height<0)return null;return i}(s,a))&&t&&t>0&&(o=o.expand(t));return o}catch(e){return console.error(e),Promise.reject()}})).catch((function(e){return Promise.reject()}))}function L(e){var t=[];return e.map.basemap.baseLayers.forEach((function(e){e&&e.tileInfo&&e.tileInfo.lods&&t.length<e.tileInfo.lods.length&&(t=e.tileInfo.lods)})),0===t.length?d.create().lods:t}function V(e,t,r,i){var a,n=L(e),o=1;if(n){var s=[],u=[];n.forEach((function(e){t>0&&e.scale>t||(e.scale<r?u.push(e.scale):s.push(e.scale))})),s.reverse();var c=void 0;s.length>=1?(o=u.length?u.length/n.length:1,c=Math.floor((s.length-1)/(i/o)),a=s[c]):a=null}else a=0===t?null:(t-r)/i;return a}function M(e,t,r){var i,a=L(e);if(a){if(r){for(i=0;i<a.length;i++)if(a[i].scale<t)return a[i].scale-1;return a[a.length-1].scale-1}for(i=a.length-1;i>=0;i--)if(a[i].scale>t)return a[i].scale+1;return a[0].scale+1}return r?t-1:t+1}function S(e,t){var r=t.width*(e.size[1]/e.size[0])/5;return t.ymin=t.center.y-r,t.ymax=t.center.y+r,t}function j(e,t,r){return s(["esri/config","esri/geometry/support/WKIDUnitConversion"]).then((function(i){var a,n;a=i[0],n=i[1];var o,s,u=e.size[0],c=n,l=t.spatialReference;l&&(o=l.wkid,s=l.wkt);var d=null;if(o)d=c.values[c[o]];else if(s&&-1!==s.search(/^PROJCS/i)){var p=/UNIT\[([^\]]+)\]\]$/i.exec(s);p&&p[1]&&(d=parseFloat(p[1].split(",")[1]))}return t.expand(r*u/(39.37*(d||20015077/180)*(a.screenDPI||96))/t.width)})).catch((function(e){return Promise.reject()}))}!function(e){e[e.X=1e-4]="X",e[e.Y=1e-4]="Y"}(l||(l={}));var b=" "+function(e){var t="",r=function(){var e=[];return e=(e=e.concat(["Web Map","Web Scene","CityEngine Web Scene"]).concat(["Feature Service","Map Service","Image Service","KML","WMS","Feature Collection","Feature Collection Template","Geodata Service","Globe Service"]).concat(["Geometry Service","Geocoding Service","Network Analysis Service","Geoprocessing Service"]).concat(["Web Mapping Application","Mobile Application","Code Attachment","Operations Dashboard Add In","Operation View"]).concat(["Symbol Set","Color Set","Shapefile","CSV","Service Definition","Document Link","Microsoft Word","Microsoft PowerPoint","Microsoft Excel","PDF","Image","Visio Document"])).concat(["Map Document","Map Package","Tile Package","ArcPad Package","Explorer Map","Globe Document","Scene Document","Published Map","Map Template","Windows Mobile Package"]).concat(["Layer","Layer Package","Explorer Layer"]).concat(["Geoprocessing Package","Geoprocessing Sample","Locator Package","Rule Package"]).concat(["Workflow Manager Package","Desktop Application","Desktop Application Template","Code Sample","Desktop Add In","Explorer Add In"])}();if(e&&e.length>0&&e.length>0){for(var i="",a=0;a<e.length;a++){var n=' type:"'+e[a]+'" ';i+=n,a!==e.length-1&&(i+=" OR ")}t=" ( "+i+" ) ";var o=e.concat(r).filter((function(t){return e.every((function(e){return e.toLowerCase().indexOf(t.toLowerCase())<0}))}));for(a=0;a<o.length;a++){n=' -type:"'+o[a]+'" ';t+=n}}return t}(["Web Map"])+" ",D=null;function P(){var e=Object(o.getAppStore)().getState().portalSelf;return!!(e&&e.defaultBasemap&&e.defaultBasemap.baseMapLayers&&e.defaultBasemap.baseMapLayers[0]&&e.defaultBasemap.baseMapLayers[0].url)}function x(e){return D||(D=s(["esri/portal/Portal"]).then((function(t){var r=new(0,t[0])({url:e});return r.load().then((function(){var e=r.sourceJSON,t=e.defaultBasemap&&e.defaultBasemap.id,i=e.defaultExtent;return t?Promise.resolve({defaultMapId:t,defaultExtent:i}):function(e,t,r){var i=t.defaultBasemap&&t.defaultBasemap.title;return r.queryGroups({f:"json",query:t.basemapGalleryGroupQuery}).then((function(e){var t=e.results;if(t.length>0){var a=t[0],n=b+" AND group:"+a.id+" AND title:"+i;return r.queryItems({start:1,num:1,f:"json",query:n}).then((function(e){var t=e.results;if((t=t.filter((function(e){return e.type&&"web map"===e.type.toLowerCase()}))).length>0){var a=t[0];return Promise.resolve(a.id)}var n=b+" AND title:"+i;return r.queryItems({start:1,num:1,f:"json",query:n}).then((function(e){var t=e.results;if((t=t.filter((function(e){return e.type&&"web map"===e.type.toLowerCase()}))).length>0){var r=t[0];return Promise.resolve(r.id)}return Promise.resolve(null)}))}))}}))}(0,e,r).then((function(e){return e?Promise.resolve({defaultMapId:e,defaultExtent:i}):function(e){var t={start:1,num:1,f:"json",query:b+" AND access:public AND owner:esri_en",sortField:"num-views",sortOrder:"desc"};return e.queryItems(t).then((function(e){var t=e.results;if((t=t.filter((function(e){return e.type&&"web map"===e.type.toLowerCase()}))).length>0){var r=t[0];return Promise.resolve(r.id)}return Promise.resolve(null)}))}(r).then((function(e){return Promise.resolve({defaultMapId:e,defaultExtent:i})}))}))}))})))}var F,J={layerIsNotSupported:"This layer type is not supported."},O=function(){function e(e){var t;if(this.runTimeIsHidden=!1,e.rootJimuLayerId?this.id=e.jimuMapViewId+"-"+e.rootJimuLayerId+"-"+e.jimuLayerId:this.id=e.jimuMapViewId+"-"+e.jimuLayerId,this.view=e.view,this.type=e.type,this.layerDataSourceId=e.layerDataSourceId,this.jimuMapViewId=e.jimuMapViewId,this.jimuLayerId=e.jimuLayerId,this.layer=e.layer,this.layerIndex=e.layerIndex,this.parentJimuLayerViewId=e.parentJimuLayerViewId,this.dataSourceInfoObserver=Object(o.observeStore)(this.onLayerDataSourceInfoChange.bind(this),["dataSourcesInfo",this.layerDataSourceId]),this.getLayerDataSource()){var r=this.getLayerDataSource(),i=null===(t=r.getDataSourceJson())||void 0===t?void 0:t.isHidden;this.runTimeIsHidden=i,i&&(this.layer.visible=!i);var a=r.getRootDataSource();this.layerDataSourceJsonObserver=Object(o.observeStore)(this.onLayerDatasourceJsonChange.bind(this),["appConfig","dataSources",a.id])}}return e.prototype.onLayerDataSourceInfoChange=function(e,t){},e.prototype.onLayerDatasourceJsonChange=function(e,t){var r,i,a=null===(i=null===(r=this.getLayerDataSource())||void 0===r?void 0:r.getDataSourceJson())||void 0===i?void 0:i.isHidden;this.runTimeIsHidden!==a&&(this.runTimeIsHidden=a,this.layer.visible=!a)},e.prototype.getLayerDataSource=function(){return o.DataSourceManager.getInstance().getDataSource(this.layerDataSourceId)},e.prototype.selectFeaturesByIds=function(e){},e.prototype.selectFeatureById=function(e){},e.prototype.destroy=function(){this.dataSourceInfoObserver&&this.dataSourceInfoObserver()},e}(),C=(F=function(e,t){return(F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}F(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),A=function(){return(A=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},R=function(e){function t(t){var r=e.call(this,t)||this;return r.features=[],r.isReservePopup=!1,r.selectedIds="",r.localDefinitionExpression="",r.getViewForMap().popup.watch("selectedFeature",(function(e){if(e){if(!e||!e.layer)return;if(e.layer===r.layer){var t=String(e.attributes[e.layer.objectIdField]);if(t===r.selectedIds)return;var i=r.getLayerDataSource(),a=U.getInstance().getJimuMapViewById(r.jimuMapViewId);null==i||i.queryById(t).then((function(e){r.selectFeatureById(t,e),r.isReservePopup=!0,o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(a.mapWidgetId,[e]))}))}else r.isReservePopup=!1,r.selectFeatureById(null)}})),r.getViewForMap().popup.watch("visible",(function(e){var t=r.getViewForMap();if(!e&&t.popup.selectedFeature&&t.popup.selectedFeature.layer===r.layer){var i=U.getInstance().getJimuMapViewById(r.jimuMapViewId);o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(i.mapWidgetId,[])),r.isReservePopup=!1,r.selectFeatureById(null)}})),r.getSelectedRecordIds().length>0?r.moveFeatureToCenter(r.getSelectedRecordIds()[0]).then((function(){r.highLightSelectedFeatures()})):r.getLayerDataSource()&&r.getLayerDataSource().getSelectedRecordIds().length>0&&r.moveFeatureToCenter(r.getLayerDataSource().getSelectedRecordIds()[0]).then((function(){r.highLightFeatures(r.getLayerDataSource().getSelectedRecordIds().map((function(e){return parseInt(e)})))}),(function(e){return console.error(e)})),r}return C(t,e),t.prototype.doQuery=function(e){var t=this;return new Promise((function(r){t.view.updating?(t.updateWatchHandle&&(t.updateWatchHandle.remove(),t.updateWatchHandle=null),t.updateWatchHandle=t.view.watch("updating",(function(i){i||t.view.queryFeatures(e).then((function(e){t.features=e.features,r(t.features)}))}))):t.view.queryFeatures(e).then((function(e){t.features=e.features,r(t.features)}),(function(e){console.error(e)}))}))},t.prototype.doQueryById=function(e){var t={objectIds:[parseInt(e)],returnGeometry:!0};return this.doQuery(t).then((function(e){return e[0]}))},t.prototype.mergeQuery=function(e,t){var r="("+e.where+") and ("+t.where+")";return A(A(A({},e),t),{where:r})},t.prototype.setRefreshIntervalForLayer=function(e){this.view&&null!=e&&(Object(o.getAppStore)().getState().appRuntimeInfo.appMode===o.AppMode.Design?this.layer.refreshInterval=0:this.layer.refreshInterval=e/60)},t.prototype.setDefinitionExpressionForLayer=function(e){var t,r,i=this;if(e){if(this.view&&this.view.layer){var a={outFields:["*"],where:this.localDefinitionExpression,returnGeometry:!0};if((n=null===(t=this.getLayerDataSource())||void 0===t?void 0:t.getRealQueryParams(a,"query"))&&(this.view.layer.definitionExpression=n.where),e.geometry){if(this.view.filter&&this.view.filter.geometry===e.geometry)return;s(["esri/geometry/support/jsonUtils"]).then((function(t){var r=t[0];i.view.filter={geometry:r.fromJSON(e.geometry)}}))}else this.view.filter&&(this.view.filter=null);return}if(!this.view&&this.layer){var n;a={outFields:["*"],where:this.localDefinitionExpression,returnGeometry:!0};return void((n=null===(r=this.getLayerDataSource())||void 0===r?void 0:r.getRealQueryParams(a,"query"))&&(this.layer.definitionExpression=n.where))}}},t.prototype.setLocalDefinitionExpression=function(e){var t;this.localDefinitionExpression=e,(null===(t=this.getLayerDataSource())||void 0===t?void 0:t.getCurrentQueryParams())&&this.setDefinitionExpressionForLayer(this.getLayerDataSource().getCurrentQueryParams())},t.prototype.highLightSelectedFeatures=function(){this.highLightFeatures(this.getSelectedRecordIds().map((function(e){return parseInt(e)})))},t.prototype.highLightFeatures=function(e){var t=this;this.highLightHandle&&(this.highLightHandle.remove(),this.highLightHandle=null),this.view&&this.view.when((function(){t.highLightHandle&&(t.highLightHandle.remove(),t.highLightHandle=null),t.highLightHandle=t.view.highlight(e)}))},t.prototype.clearHighLight=function(){this.highLightHandle&&(this.highLightHandle.remove(),this.highLightHandle=null,this.isReservePopup&&(this.getViewForMap().popup.close(),this.isReservePopup=!1))},t.prototype.selectFeatureById=function(e,t){var r;null===(r=this.getLayerDataSource())||void 0===r||r.selectRecordById(e,t),null==e?this.clearHighLight():this.highLightSelectedFeatures()},t.prototype.selectFeaturesByIds=function(e,t){var r;null===(r=this.getLayerDataSource())||void 0===r||r.selectRecordsByIds(e,t),e&&e.length>0?this.highLightSelectedFeatures():this.clearHighLight()},t.prototype.onAppModeInfoChange=function(e,t){var r;this.setRefreshIntervalForLayer(null===(r=this.getLayerDataSource())||void 0===r?void 0:r.getAutoRefreshInterval())},t.prototype.onLayerDataSourceInfoChange=function(e,t){var r,i,a,n;(null===(r=null==t?void 0:t.selectedIds)||void 0===r?void 0:r.length)>0||(null===(i=null==t?void 0:t.selectedIndexes)||void 0===i?void 0:i.length)>0?this.selectedIds!==t.selectedIds.join(",")&&(this.selectedIds=t.selectedIds.join(","),this.highLightSelectedFeatures()):(this.selectedIds="",this.clearHighLight()),(null===(a=this.getLayerDataSource())||void 0===a?void 0:a.getCurrentQueryParams())&&this.setDefinitionExpressionForLayer(this.getLayerDataSource().getCurrentQueryParams()),this.setRefreshIntervalForLayer(null===(n=this.getLayerDataSource())||void 0===n?void 0:n.getAutoRefreshInterval())},t.prototype.getViewForMap=function(){var e=U.getInstance().getJimuMapViewById(this.jimuMapViewId);return e&&e.view},t.prototype.handleFeatureNavigationAtPopUp=function(e){var t=this.getLayerDataSource();this.isReservePopup=!0,null==t||t.selectRecordById(e)},t.prototype.moveFeatureToCenter=function(e){var t=this;return this.doQueryById(e).then((function(r){return r||(t.getLayerDataSource()?t.getLayerDataSource().queryById(e).then((function(e){return e&&e.feature})):null)})).then((function(r){if(r){var i=t.getCenterPoint(r.geometry);return i?t.getViewForMap().goTo(i):Promise.reject("Does not find center point.")}return Promise.reject("Dose not find feature."+e)}))},t.prototype.getCenterPoint=function(e){switch(e.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"polyline":return e.extent.center;default:return e&&e.extent?e.extent.center:void 0}},t.prototype.getSelectedRecordIds=function(){var e=this;return Object(o.getAppStore)().getState().dataSourcesInfo[this.layerDataSourceId]?Object(o.getAppStore)().getState().dataSourcesInfo[this.layerDataSourceId].selectedIds?Object(o.getAppStore)().getState().dataSourcesInfo[this.layerDataSourceId].selectedIds.asMutable():Object(o.getAppStore)().getState().dataSourcesInfo[this.layerDataSourceId].selectedIndexes?Object(o.getAppStore)().getState().dataSourcesInfo[this.layerDataSourceId].selectedIndexes.asMutable().map((function(t){return e.features[t].attributes[e.getIdField()]})):[]:[]},t.prototype.getIdField=function(){var e=this.view.layer.objectIdField;if(!e){var t=this.view.layer.fields.find((function(e){return"oid"===e.type}));t&&(e=t.name)}return e||(e="OBJECTID"),e},t.prototype.getLayerDataSource=function(){return o.DataSourceManager.getInstance().getDataSource(this.layerDataSourceId)},t.prototype.selectRecordsByQuery=function(e){var t=this;return s(["esri/layers/FeatureLayer"]).then((function(r){for(var i=U.getInstance().getJimuMapViewById(t.jimuMapViewId),a=i.getParentLayerViews(t.id),n=!0,s=0;s<a.length;s++)if(!a[s].layer.visible){n=!1;break}if(!n||!t.layer.visible)return Promise.resolve([]);var u=t.getLayerDataSource();e.geometry=e.geometry.toJSON?e.geometry.toJSON():e.geometry;var c=null==u?void 0:u.dataSourceManager.createLocalDataSource(u,"view");return c&&c.layer?c.load(e,{widgetId:"view"}).then((function(e){if(e&&e.length>0){for(var t=[],r=[],a=[],n=0;n<e.length;n++)t.push(e[n].getId()),r.push(e[n].feature),a.push(e[n]);return o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(i.mapWidgetId,a)),c.selectRecordsByIds(t),Promise.resolve(r)}return Promise.resolve([])})):Promise.resolve([])}),(function(){return Promise.resolve([])})).then((function(e){if(!e||e&&0===e.length){var r=t.getLayerDataSource();null==r||r.selectRecordsByIds([])}return Promise.resolve(e)}))},t.prototype.getObjectIdField=function(e,t){for(var r=null,i=0;i<e.length;i++)if(e[i].name===t)return r=e[i];return r},t}(O),W=r(1),B=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),E=function(e){function t(t){var r=e.call(this,t)||this;return r.url=null,r.url=t.url,r.layer&&r.layer.watch("visible",(function(e){var t=U.getInstance().getJimuMapViewById(r.jimuMapViewId).getChildLayerViews(r.id);if(t&&t.length>0)for(var i=0;i<t.length;i++)t[i].virtualLayer&&(t[i].virtualLayer.visible=e&&t[i].layer.visible),t[i].view||t[i].type!==W.c.FeatureLayer||t[i].highLightSelectedFeaturesWithVirtualLayer()})),r}return B(t,e),t}(O),_=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),G=function(e){function t(t){var r=e.call(this,t)||this;return r.url=null,r.url=t.url,r.layer&&r.layer.watch("visible",(function(e){var t=U.getInstance().getJimuMapViewById(r.jimuMapViewId).getChildLayerViews(r.id);if(t&&t.length>0)for(var i=0;i<t.length;i++)t[i].virtualLayer&&(t[i].virtualLayer.visible=e&&t[i].layer.visible),t[i].view||t[i].type!==W.c.FeatureLayer||t[i].highLightSelectedFeaturesWithVirtualLayer()})),r}return _(t,e),t}(O),k=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),H=function(e){function t(t){var r=e.call(this,t)||this;return r.url=null,r.url=t.url,r.layer&&r.layer.watch("visible",(function(e){var t=U.getInstance().getJimuMapViewById(r.jimuMapViewId).getChildLayerViews(r.id);if(t&&t.length>0)for(var i=0;i<t.length;i++)t[i].virtualLayer&&(t[i].virtualLayer.visible=e&&t[i].layer.visible),t[i].view||t[i].type!==W.c.FeatureLayer||t[i].highLightSelectedFeaturesWithVirtualLayer()})),r}return k(t,e),t}(O),q=function(){function e(e){var t=this;this.jimuLayerViewLoadPromises={},this.isEnableHighlight=!0,this.getJimuLayerViewId=function(e,r){var i=o.DataSourceManager.getInstance().getDataSource(e);if(!i)return null;var a=i.getJimuChildId(r)[0];return t.id+"-"+a},this.clearSelectedFeatures=function(){for(var e=t.jimuLayerViews,r=Object.keys(e),i=0;i<r.length;i++){var a=e[r[i]];a.type!==W.c.FeatureLayer&&a.type!==W.c.SceneLayer||a.selectFeaturesByIds([])}o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(t.mapWidgetId,[]))},this.getSelectRecordsByQueryPromise=function(e,t){return e.selectRecordsByQuery(t)},this.id=e.mapWidgetId+"-"+e.datasourceId,this.mapWidgetId=e.mapWidgetId,this.isActive=e.isActive,this.datasourceId=e.datasourceId,this.view=e.view,this.jimuLayerViews={},this.status=o.JimuMapViewStatus.Loading,this.isEnablePopup=void 0===e.isEnablePopup||null===e.isEnablePopup||e.isEnablePopup,this.isEditing=!1,this.initView(this.view)}return e.prototype.startEdit=function(){this.isEditing=!0},e.prototype.exitEdit=function(){this.isEditing=!1},e.prototype.getIsEditing=function(){return this.isEditing},e.prototype.enablePopup=function(){this.isEditing&&!this.isEnablePopup&&this.view&&this.view.popup&&(this.view.popup.autoOpenEnabled=!0,this.isEnablePopup=!0)},e.prototype.disablePopup=function(){this.isEditing&&this.isEnablePopup&&this.view&&this.view.popup&&(this.view.popup.autoOpenEnabled=!1,this.isEnablePopup=!1)},e.prototype.getIsEnablePopup=function(){return this.isEnablePopup},e.prototype.enableHighlight=function(){this.isEditing&&!this.isEnableHighlight&&(this.isEnableHighlight=!0)},e.prototype.disableHighlight=function(){this.isEditing&&this.isEnableHighlight&&(this.isEnableHighlight=!1)},e.prototype.getIsEnableHighlight=function(){return this.isEnableHighlight},e.prototype.setIsActive=function(e){this.isActive=e,U.getInstance().setJimuMapView(this)},e.prototype.initView=function(e){var t=this;e&&e.when((function(){e.on("click",t.onClick.bind(t))}))},e.prototype.onClick=function(e){var t=this,r={x:e.x,y:e.y};this.view.hitTest(r).then((function(e){if(t.isEnableHighlight&&(e&&e.results&&0!==e.results.length||(t.clearAllJimuLayerViewsSelectRecord(),o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(t.mapWidgetId,[]))),e.results.length)){var r=t.jimuLayerViews,i=Object.keys(r),a=Object.keys(r);if("2d"==t.view.type){var n=!1;t.isEnablePopup||t.isEditing||(n=!0),e.results.forEach((function(e,r){var a=e.graphic;if(a&&a.layer){var s=a.layer.id,u=t.getJimuLayerViewId(t.datasourceId,s),c=t.jimuLayerViews[u];if(c)switch(c.type){case W.c.FeatureLayer:if(n&&a.layer.popupEnabled){i.splice(i.indexOf(u),1),c.clearHighLight();var l=String(a.attributes[a.layer.objectIdField]),d=c.getLayerDataSource();c.selectedIds=l,null==d||d.queryById(l).then((function(e){c.selectFeatureById(l,e),o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(t.mapWidgetId,[e]))})),n=!1}}}}))}else e.results.forEach((function(e,r){var a=e.graphic;if(a&&a.layer){var n=a.layer.id,s=t.getJimuLayerViewId(t.datasourceId,n),u=t.jimuLayerViews[s];if(u)switch(u.type){case W.c.FeatureLayer:if(0===r&&a.layer.popupEnabled){i.splice(i.indexOf(s),1),u.clearHighLight();var c=String(a.attributes[a.layer.objectIdField]),l=u.getLayerDataSource();u.selectedIds=c,l&&l.queryById(c).then((function(e){u.selectFeatureById(c,e),o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(t.mapWidgetId,[e]))}))}break;case W.c.SceneLayer:if(0===r&&a.layer.popupEnabled){i.splice(i.indexOf(s),1),u.clearHighLight();var d=String(a.attributes[a.layer.objectIdField]);l=u.getLayerDataSource();u.selectedIds=d,l&&l.queryById(d).then((function(e){u.selectFeatureById(d,e),o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(t.mapWidgetId,[e]))}))}}}}));if(i)for(var s=0;s<i.length;s++){var u=t.jimuLayerViews[i[s]];if(u)switch(u.type){case W.c.FeatureLayer:u.selectFeaturesByIds([])}}a&&i&&a.length===i.length&&a.length>0&&o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(t.mapWidgetId,[]))}}),(function(){t.clearAllJimuLayerViewsSelectRecord()}))},e.prototype.clearAllJimuLayerViewsSelectRecord=function(){for(var e=this.jimuLayerViews,t=Object.keys(e),r=0;r<t.length;r++){e[t[r]].selectFeaturesByIds([])}},e.prototype.createJimuLayerViews=function(){return this.whenAllJimuLayerViewsLoaded(this.view)},e.prototype.addJimuLayerView=function(e){this.jimuLayerViews[e.id]=e},e.prototype.whenJimuMapViewLoaded=function(){var e=this;return this.jimuMapViewLoadPromise?this.jimuMapViewLoadPromise:this.view?(this.jimuMapViewLoadPromise=this.view.when().then((function(){return e.createJimuLayerViews().then((function(){return e.status=o.JimuMapViewStatus.Loaded,U.getInstance().setJimuMapView(e),Promise.resolve(e)}))}),(function(t){return console.error(t),e.status=o.JimuMapViewStatus.Failed,U.getInstance().setJimuMapView(e),Promise.reject(e)})),this.jimuMapViewLoadPromise):(this.status=o.JimuMapViewStatus.Failed,U.getInstance().setJimuMapView(this),this.jimuMapViewLoadPromise=Promise.reject(this),this.jimuMapViewLoadPromise)},e.prototype.whenAllJimuLayerViewsLoaded=function(e){var t=this,r=[],i=this;return e.map.layers.toArray().map((function(a,n){var s=o.DataSourceManager.getInstance().getDataSource(t.datasourceId);if(s){var u=s.getJimuChildId(o.dataSourceUtils.fixLayerId(a.id))[0];t.maxLayerIndex=e.map.layers.length-1;var c=e.whenLayerView(a).then((function(e){var r=null,i=null,c=s.getDataSourceByLayer(a.id.toString(),o.dataSourceUtils.getUrlByLayer(a),a.id);switch(a.type){case W.c.SceneLayer:r={jimuLayerId:u,rootJimuLayerId:null,layerDataSourceId:c&&c.id,view:e,jimuMapViewId:t.id,type:a.type,layer:a,layerIndex:n,parentJimuLayerViewId:null},i=new R(r),t.addJimuLayerView(i);break;case W.c.FeatureLayer:r={jimuLayerId:u,rootJimuLayerId:null,layerDataSourceId:c&&c.id,view:e,jimuMapViewId:t.id,type:a.type,layer:a,layerIndex:n,parentJimuLayerViewId:null},i=new z(r),t.addJimuLayerView(i);break;case W.c.MapImageLayer:case W.c.TileLayer:r={jimuLayerId:u,rootJimuLayerId:null,layerDataSourceId:c&&c.id,view:e,jimuMapViewId:t.id,type:a.type,layer:a,layerIndex:n,parentJimuLayerViewId:null},a.type===W.c.MapImageLayer&&(i=new H(r)),a.type===W.c.TileLayer&&(i=new G(r)),t.addJimuLayerView(i);var l=a.sublayers;if(l&&l.length>0)for(var d=0;d<l.length;d++){var p=l.getItemAt(d);t.createJimuLayerViewInSublayersOfImageLayer(p,i.id,u,a.id)}break;case W.c.GroupLayer:r={jimuLayerId:u,rootJimuLayerId:null,layerDataSourceId:c&&c.id,view:null,jimuMapViewId:t.id,type:a.type,layer:a,layerIndex:n,parentJimuLayerViewId:null},i=new E(r),t.addJimuLayerView(i);var h=a.layers;if(h&&h.length>0)for(d=0;d<h.length;d++){p=h.getItemAt(d);t.createJimuLayerViewInlayersOfGroupLayer(p,i.id,u,a.id)}break;default:r={jimuLayerId:u,rootJimuLayerId:null,layerDataSourceId:c&&c.id,view:e,jimuMapViewId:t.id,type:a.type,layer:a,layerIndex:n,parentJimuLayerViewId:null},i=new O(r),t.addJimuLayerView(i)}return Promise.resolve(i)}),(function(){return Promise.resolve(null)}));r.push(c),i.jimuLayerViewLoadPromises[t.id+"-"+u]=c}})),Promise.all(r)},e.prototype.getParentLayerViews=function(e){var t=[];return this.jimuLayerViews[e]&&this.findParentLayerView(this.jimuLayerViews[e].parentJimuLayerViewId,t),t},e.prototype.findParentLayerView=function(e,t){var r=this.jimuLayerViews;(e||r[e])&&r[e]&&(t.push(r[e]),r[e].parentJimuLayerViewId&&this.findParentLayerView(r[e].parentJimuLayerViewId,t))},e.prototype.getChildLayerViews=function(e){var t=[];return this.findChildLayerView(e,t),t},e.prototype.findChildLayerView=function(e,t){for(var r=this.jimuLayerViews,i=Object.keys(r),a=0;a<i.length;a++)r[i[a]].parentJimuLayerViewId===e&&(t.push(r[i[a]]),this.findChildLayerView(r[i[a]].jimuLayerId,t))},e.prototype.updateMaxLayerIndex=function(){return this.maxLayerIndex=this.maxLayerIndex+1,this.maxLayerIndex},e.prototype.createJimuLayerViewInlayersOfGroupLayer=function(e,t,r,i){var a=this,n=o.DataSourceManager.getInstance().getDataSource(this.datasourceId);if(e.type===W.c.GroupLayer&&e.layers&&e.layers.length>0){if(!(l=n.getDataSourceByLayer(e.id.toString(),o.dataSourceUtils.getUrlByLayer(e),i)))return;var s={jimuLayerId:e.id,rootJimuLayerId:r,layerDataSourceId:l&&l.id,view:null,url:e.url,jimuMapViewId:this.id,type:W.c.GroupLayer,layer:e,parentJimuLayerViewId:t,layerIndex:this.updateMaxLayerIndex()},u=new E(s);this.addJimuLayerView(u);for(var c=0;c<e.layers.length;c++)this.createJimuLayerViewInlayersOfGroupLayer(e.layers.getItemAt(c),u.jimuLayerId,r,i)}else if((e.type===W.c.TileLayer||e.type===W.c.MapImageLayer)&&e.sublayers&&e.sublayers.length>0){var l;if(!(l=n.getDataSourceByLayer(e.id.toString(),o.dataSourceUtils.getUrlByLayer(e),i)))return;s={jimuLayerId:e.id,rootJimuLayerId:r,layerDataSourceId:l&&l.id,view:null,url:e.url,jimuMapViewId:this.id,type:e.type,layer:e,parentJimuLayerViewId:t,layerIndex:this.updateMaxLayerIndex()},u=new E(s);this.addJimuLayerView(u);for(c=0;c<e.sublayers.length;c++)this.createJimuLayerViewInSublayersOfImageLayer(e.sublayers.getItemAt(c),u.jimuLayerId,r,i)}else{var d=n.getDataSourceByLayer(e.id.toString(),o.dataSourceUtils.getUrlByLayer(e),i);if(!d)return;var p=this.updateMaxLayerIndex();this.view.whenLayerView(e).then((function(i){var n={jimuLayerId:e.id,rootJimuLayerId:r,layerDataSourceId:d&&d.id,view:i,url:e.url,jimuMapViewId:a.id,type:e.type,layer:e,parentJimuLayerViewId:t,layerIndex:p},o=new z(n);a.addJimuLayerView(o)}))}},e.prototype.createJimuLayerViewInSublayersOfImageLayer=function(e,t,r,i){var a=o.DataSourceManager.getInstance().getDataSource(this.datasourceId);if(e.sublayers&&e.sublayers.length>0){if(!(c=a.getDataSourceByLayer(e.id.toString(),o.dataSourceUtils.getUrlByLayer(e),i)))return;var n={jimuLayerId:e.id,rootJimuLayerId:r,layerDataSourceId:c&&c.id,view:null,url:e.url,jimuMapViewId:this.id,type:W.c.GroupLayer,layer:e,parentJimuLayerViewId:t,layerIndex:this.updateMaxLayerIndex()},s=new E(n);this.addJimuLayerView(s);for(var u=0;u<e.sublayers.length;u++)this.createJimuLayerViewInSublayersOfImageLayer(e.sublayers.getItemAt(u),s.jimuLayerId,r,i)}else{var c;if(!(c=a.getDataSourceByLayer(e.id.toString(),o.dataSourceUtils.getUrlByLayer(e),i)))return;n={jimuLayerId:e.id,rootJimuLayerId:r,layerDataSourceId:c&&c.id,view:null,url:e.url,jimuMapViewId:this.id,type:W.c.FeatureLayer,layer:e,parentJimuLayerViewId:t,layerIndex:this.updateMaxLayerIndex()},s=new z(n);this.addJimuLayerView(s)}},e.prototype.getJimuLayerViewLoadPromiseById=function(e){return this.jimuLayerViewLoadPromises[e]},e.prototype.selectFeaturesByGraphic=function(e,t){var r=this;return s(["esri/geometry/geometryEngine"]).then((function(i){var a=i[0],n=e.geometry;if("point"===n.type||"polyline"===n.type){var o=2.54*r.view.scale/9600;n=a.buffer(n,10*o,"meters")}for(var s={geometry:n,spatialRelationship:t,returnGeometry:!0,outFields:["*"]},u=r.jimuLayerViews,c=Object.keys(u),l=[],d=0;d<c.length;d++){var p=u[c[d]];if(p.type===W.c.FeatureLayer||p.type===W.c.SceneLayer){var h=r.getSelectRecordsByQueryPromise(p,s);l.push(h)}}return Promise.all(l)}))},e.prototype.destroy=function(){for(var e=this.jimuLayerViews,t=Object.keys(e),r=0;r<t.length;r++){e[t[r]].destroy()}if(this.view&&!this.view.destroyed){this.view.graphics&&this.view.graphics.destroyed&&this.view.graphics.destroy(),this.view.container=null,this.view.allLayerViews&&this.view.allLayerViews.destroyed&&this.view.allLayerViews.destroy(),this.view.layerViews&&this.view.layerViews.destroyed&&this.view.layerViews.destroy();var i=this.view.ui;i.exbMapTools&&0!==Object.keys(i.exbMapTools).length&&Object.keys(i.exbMapTools).map((function(e,t){i.exbMapTools[e].destroy()})),i.exbMapTools={},this.view.destroy(),this.view=null}},e}(),T=function(){function e(e){var t=this;this.switchMap=function(){return t.mapWidgetInstance?t.mapWidgetInstance.switchMap():Promise.resolve()},this.fullScreenMap=function(){t.mapWidgetInstance&&t.mapWidgetInstance.fullScreenMap()},this.mapWidgetId=e,this.jimuMapViews={}}return e.prototype.setMapWidgetInstance=function(e){this.mapWidgetInstance=e},e.prototype.addJimuMapView=function(e){this.jimuMapViews[e.id]=e},e.prototype.setJimuMapView=function(e){this.jimuMapViews[e.id]=e},e.prototype.removeJimuMapView=function(e){delete this.jimuMapViews[e.id]},e.prototype.getActiveJimuMapView=function(){for(var e=Object.keys(this.jimuMapViews),t=0;t<e.length;t++)if(this.jimuMapViews[e[t]].isActive)return this.jimuMapViews[e[t]];return null},e}(),U=function(){function e(){this.jimuMapViewGroups={}}return e.getInstance=function(){return window.jimuConfig.isBuilder?window._appWindow&&window._appWindow._mapViewManager:(e._instance||(e._instance=new e,window._mapViewManager=e._instance),e._instance)},e.prototype.getJimuMapViewById=function(e){var t=Object.keys(this.jimuMapViewGroups);if(0===t.length)return null;for(var r=0;r<t.length;r++){var i=t[r];if(Object.keys(this.jimuMapViewGroups[i].jimuMapViews).indexOf(e)>-1)return this.jimuMapViewGroups[i].jimuMapViews[e]}return null},e.prototype.getJimuMapViewGroup=function(e){return this.jimuMapViewGroups[e]?this.jimuMapViewGroups[e]:null},e.prototype.createJimuMapView=function(e){var t=e.mapWidgetId+"-"+e.datasourceId;if(this.getJimuMapViewById(t))return Promise.resolve(this.getJimuMapViewById(t));var r=new q(e);return this.addJimuMapView(r),r.whenJimuMapViewLoaded()},e.prototype.addJimuMapView=function(e){if(this.jimuMapViewGroups[e.mapWidgetId])this.jimuMapViewGroups[e.mapWidgetId].addJimuMapView(e);else{var t=new T(e.mapWidgetId);t.addJimuMapView(e),this.jimuMapViewGroups[e.mapWidgetId]=t}Object(o.getAppStore)().dispatch(o.appActions.jimuMapViewAdded(e.id,Object(o.Immutable)({id:e.id,mapWidgetId:e.mapWidgetId,datasourceId:e.datasourceId,status:e.status})))},e.prototype.setJimuMapView=function(e){if(this.jimuMapViewGroups[e.mapWidgetId])this.jimuMapViewGroups[e.mapWidgetId].setJimuMapView(e);else{var t=new T(e.mapWidgetId);t.addJimuMapView(e),this.jimuMapViewGroups[e.mapWidgetId]=t}Object(o.getAppStore)().dispatch(o.appActions.jimuMapViewUpdated(e.id,Object(o.Immutable)({id:e.id,mapWidgetId:e.mapWidgetId,datasourceId:e.datasourceId,isActive:e.isActive,status:e.status})))},e.prototype.destroyJimuMapView=function(e){var t=this.getJimuMapViewById(e);t&&t.destroy();var r=Object.keys(this.jimuMapViewGroups);if(0!==r.length)for(var i=0;i<r.length;i++){var a=r[i];if(Object.keys(this.jimuMapViewGroups[a].jimuMapViews).indexOf(e)>-1){delete this.jimuMapViewGroups[a].jimuMapViews[e],0===Object.keys(this.jimuMapViewGroups[a].jimuMapViews).length&&delete this.jimuMapViewGroups[a],Object(o.getAppStore)().dispatch(o.appActions.jimuMapViewRemoved(e));break}}},e}(),Q=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),N=function(){return(N=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},z=function(e){function t(t){var r=e.call(this,t)||this;return r.features=[],r.isReservePopup=!1,r.virtualLayer=null,r.selectedIds="",r.localDefinitionExpression="",r.originalGdbVersion=null,r.view&&(r.originalGdbVersion=r.layer.gdbVersion),r.layer&&r.layer.watch("visible",(function(e,t){r.virtualLayer&&(r.virtualLayer.visible=e),r.view||r.highLightSelectedFeaturesWithVirtualLayer()})),r.getViewForMap().popup.watch("selectedFeature",(function(e){if(e){if(!e||!e.layer)return;if(e.layer===r.layer){var t=String(e.attributes[e.layer.objectIdField]);if(t===r.selectedIds)return;var i=r.getLayerDataSource(),a=U.getInstance().getJimuMapViewById(r.jimuMapViewId);null==i||i.queryById(t).then((function(e){r.selectFeatureById(t,e),r.isReservePopup=!0,o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(a.mapWidgetId,[e]))}))}else r.isReservePopup=!1,r.selectFeatureById(null)}})),r.getViewForMap().popup.watch("visible",(function(e){var t=r.getViewForMap();if(!e&&t.popup.selectedFeature&&t.popup.selectedFeature.layer===r.layer){var i=U.getInstance().getJimuMapViewById(r.jimuMapViewId);o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(i.mapWidgetId,[])),r.isReservePopup=!1,r.selectFeatureById(null)}})),r.getSelectedRecordIds().length>0?r.moveFeatureToCenter(r.getSelectedRecordIds()[0]).then((function(){r.highLightSelectedFeatures()})):r.getLayerDataSource()&&r.getLayerDataSource().getSelectedRecordIds().length>0&&r.moveFeatureToCenter(r.getLayerDataSource().getSelectedRecordIds()[0]).then((function(){r.highLightFeatures(r.getLayerDataSource().getSelectedRecordIds().map((function(e){return parseInt(e)})))}),(function(e){return console.error(e)})),window&&window.jimuConfig&&window.jimuConfig.isInBuilder&&(r.appModeObserver=Object(o.observeStore)(r.onAppModeInfoChange.bind(r),["appRuntimeInfo","appMode"])),r}return Q(t,e),t.prototype.doQuery=function(e){var t=this;return new Promise((function(r){t.view.updating?(t.updateWatchHandle&&(t.updateWatchHandle.remove(),t.updateWatchHandle=null),t.updateWatchHandle=t.view.watch("updating",(function(i){i||t.view.queryFeatures(e).then((function(e){t.features=e.features,r(t.features)}))}))):t.view.queryFeatures(e).then((function(e){t.features=e.features,r(t.features)}),(function(e){console.error(e)}))}))},t.prototype.doQueryById=function(e){var t={objectIds:[parseInt(e)],returnGeometry:!0};return this.doQuery(t).then((function(e){return e[0]}))},t.prototype.mergeQuery=function(e,t){var r="("+e.where+") and ("+t.where+")";return N(N(N({},e),t),{where:r})},t.prototype.setRefreshIntervalForLayer=function(e){this.view&&null!=e&&(Object(o.getAppStore)().getState().appRuntimeInfo.appMode===o.AppMode.Design?this.layer.refreshInterval=0:this.layer.refreshInterval=e/60)},t.prototype.setDefinitionExpressionForLayer=function(e){var t,r,i=this;if(e){if(this.view&&this.view.layer){var a={outFields:["*"],where:this.localDefinitionExpression,returnGeometry:!0};if((n=null===(t=this.getLayerDataSource())||void 0===t?void 0:t.getRealQueryParams(a,"query"))&&(this.view.layer.definitionExpression=n.where),e.geometry){if(this.view.filter&&this.view.filter.geometry===e.geometry)return;s(["esri/geometry/support/jsonUtils"]).then((function(t){var r=t[0];i.view.filter={geometry:r.fromJSON(e.geometry)}}))}else this.view.filter&&(this.view.filter=null);return}if(!this.view&&this.layer){var n;a={outFields:["*"],where:this.localDefinitionExpression,returnGeometry:!0};return void((n=null===(r=this.getLayerDataSource())||void 0===r?void 0:r.getRealQueryParams(a,"query"))&&(this.layer.definitionExpression=n.where))}}},t.prototype.setLocalDefinitionExpression=function(e){var t;this.localDefinitionExpression=e,(null===(t=this.getLayerDataSource())||void 0===t?void 0:t.getCurrentQueryParams())&&this.setDefinitionExpressionForLayer(this.getLayerDataSource().getCurrentQueryParams())},t.prototype.highLightSelectedFeatures=function(){this.view?this.highLightFeatures(this.getSelectedRecordIds().map((function(e){return parseInt(e)}))):this.highLightSelectedFeaturesWithVirtualLayer()},t.prototype.highLightSelectedFeaturesWithVirtualLayer=function(){for(var e=this,t=U.getInstance().getJimuMapViewById(this.jimuMapViewId),r=t.getParentLayerViews(this.id),i=!0,a=0;a<r.length;a++)if(!r[a].layer.visible){i=!1;break}if(i&&this.layer.visible){this.virtualLayer&&(t.view.map.remove(this.virtualLayer),this.virtualLayer=null,this.clearHighLight());var n=this.getLayerDataSource(),o=null==n?void 0:n.getSelectedRecords();if(o&&o.length>0){var u=n.layer,c=this.getObjectIdField(u.fields,u.objectIdField),l=[];for(a=0;a<o.length;a++){var d=o[a].feature.clone(),p=d.attributes[u.objectIdField];d.attributes={},d.attributes[u.objectIdField]=p,l.push(d)}s(["esri/layers/FeatureLayer"]).then((function(r){var i=r[0];e.virtualLayer=new i({title:u.title,source:l,fields:c?[c]:[],objectIdField:u.objectIdField,renderer:e.getRendererForVirtualLayer(l[0].geometry.type),listMode:"hide",legendEnabled:!1}),t.view.map.add(e.virtualLayer,e.layerIndex),e.virtualLayer.on("layerview-create",(function(t){var r=t.layerView;e.highLightHandle=r.highlight(l)}))}))}}},t.prototype.highLightFeatures=function(e){var t=this;this.highLightHandle&&(this.highLightHandle.remove(),this.highLightHandle=null),this.view&&this.view.when((function(){t.highLightHandle&&(t.highLightHandle.remove(),t.highLightHandle=null),t.highLightHandle=t.view.highlight(e)}))},t.prototype.clearHighLight=function(){(this.highLightHandle&&(this.highLightHandle.remove(),this.highLightHandle=null,this.isReservePopup&&(this.getViewForMap().popup.close(),this.isReservePopup=!1)),this.virtualLayer)&&(U.getInstance().getJimuMapViewById(this.jimuMapViewId).view.map.remove(this.virtualLayer),this.virtualLayer=null)},t.prototype.selectFeatureById=function(e,t){var r;null===(r=this.getLayerDataSource())||void 0===r||r.selectRecordById(e,t),null==e?this.clearHighLight():this.highLightSelectedFeatures()},t.prototype.selectFeaturesByIds=function(e,t){var r;null===(r=this.getLayerDataSource())||void 0===r||r.selectRecordsByIds(e,t),e&&e.length>0?this.highLightSelectedFeatures():this.clearHighLight()},t.prototype.onAppModeInfoChange=function(e,t){var r;this.setRefreshIntervalForLayer(null===(r=this.getLayerDataSource())||void 0===r?void 0:r.getAutoRefreshInterval())},t.prototype.onLayerDataSourceInfoChange=function(e,t){var r,i,a,n;(null===(r=null==t?void 0:t.selectedIds)||void 0===r?void 0:r.length)>0||(null===(i=null==t?void 0:t.selectedIndexes)||void 0===i?void 0:i.length)>0?this.selectedIds!==t.selectedIds.join(",")&&(this.selectedIds=t.selectedIds.join(","),this.highLightSelectedFeatures()):(this.selectedIds="",this.clearHighLight()),(null===(a=this.getLayerDataSource())||void 0===a?void 0:a.getCurrentQueryParams())&&this.setDefinitionExpressionForLayer(this.getLayerDataSource().getCurrentQueryParams()),this.view&&((null==t?void 0:t.gdbVersion)&&(this.layer.gdbVersion=t.gdbVersion),(null==t?void 0:t.gdbVersion)||(this.layer.gdbVersion=this.originalGdbVersion)),this.setRefreshIntervalForLayer(null===(n=this.getLayerDataSource())||void 0===n?void 0:n.getAutoRefreshInterval())},t.prototype.getViewForMap=function(){var e=U.getInstance().getJimuMapViewById(this.jimuMapViewId);return e&&e.view},t.prototype.handleFeatureNavigationAtPopUp=function(e){var t=this.getLayerDataSource();this.isReservePopup=!0,null==t||t.selectRecordById(e)},t.prototype.moveFeatureToCenter=function(e){var t=this;return this.doQueryById(e).then((function(r){return r||(t.getLayerDataSource()?t.getLayerDataSource().queryById(e).then((function(e){return e&&e.feature})):null)})).then((function(r){if(r){var i=t.getCenterPoint(r.geometry);return i?t.getViewForMap().goTo(i):Promise.reject("Does not find center point.")}return Promise.reject("Dose not find feature."+e)}))},t.prototype.getCenterPoint=function(e){switch(e.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"polyline":return e.extent.center;default:return e&&e.extent?e.extent.center:void 0}},t.prototype.getSelectedRecordIds=function(){var e=this;return Object(o.getAppStore)().getState().dataSourcesInfo[this.layerDataSourceId]?Object(o.getAppStore)().getState().dataSourcesInfo[this.layerDataSourceId].selectedIds?Object(o.getAppStore)().getState().dataSourcesInfo[this.layerDataSourceId].selectedIds.asMutable():Object(o.getAppStore)().getState().dataSourcesInfo[this.layerDataSourceId].selectedIndexes?Object(o.getAppStore)().getState().dataSourcesInfo[this.layerDataSourceId].selectedIndexes.asMutable().map((function(t){return e.features[t].attributes[e.getIdField()]})):[]:[]},t.prototype.getIdField=function(){var e=this.view.layer.objectIdField;if(!e){var t=this.view.layer.fields.find((function(e){return"oid"===e.type}));t&&(e=t.name)}return e||(e="OBJECTID"),e},t.prototype.getLayerDataSource=function(){return o.DataSourceManager.getInstance().getDataSource(this.layerDataSourceId)},t.prototype.selectRecordsByQuery=function(e){var t=this;return s(["esri/layers/FeatureLayer"]).then((function(r){for(var i=U.getInstance().getJimuMapViewById(t.jimuMapViewId),a=i.getParentLayerViews(t.id),n=!0,s=0;s<a.length;s++)if(!a[s].layer.visible){n=!1;break}if(!n||!t.layer.visible)return Promise.resolve([]);t.virtualLayer&&(i.view.map.remove(t.virtualLayer),t.virtualLayer=null,t.clearHighLight());var u=t.getLayerDataSource();e.geometry=e.geometry.toJSON?e.geometry.toJSON():e.geometry;var c=null==u?void 0:u.dataSourceManager.createLocalDataSource(u,"view");return c&&c.layer?c.load(e,{widgetId:"view"}).then((function(e){if(e&&e.length>0){for(var t=[],r=[],a=[],n=0;n<e.length;n++)t.push(e[n].getId()),r.push(e[n].feature),a.push(e[n]);return o.MessageManager.getInstance().publishMessage(new o.DataRecordsSelectionChangeMessage(i.mapWidgetId,a)),c.selectRecordsByIds(t),Promise.resolve(r)}return Promise.resolve([])})):Promise.resolve([])}),(function(){return Promise.resolve([])})).then((function(e){if(!e||e&&0===e.length){var r=t.getLayerDataSource();null==r||r.selectRecordsByIds([])}return Promise.resolve(e)}))},t.prototype.getObjectIdField=function(e,t){for(var r=null,i=0;i<e.length;i++)if(e[i].name===t)return r=e[i];return r},t.prototype.getRendererForVirtualLayer=function(e){return["point","multipoint"].indexOf(e)>-1?{type:"simple",symbol:{type:"simple-marker",style:"circle",color:this.getViewForMap().highlightOptions.color,size:"16px",outline:{color:this.getViewForMap().highlightOptions.color,width:1}}}:["polyline"].indexOf(e)>-1?{type:"simple",symbol:{type:"simple-line",color:this.getViewForMap().highlightOptions.color,width:1,style:"solid"}}:["polygon","extent"].indexOf(e)>-1?{type:"simple",symbol:{type:"simple-fill",color:[0,255,255,0],style:"solid",outline:{color:this.getViewForMap().highlightOptions.color,width:1}}}:["mesh"].indexOf(e)>-1?{type:"simple",symbol:{type:"mesh-3d",symbolLayers:[{type:"fill",material:{color:this.getViewForMap().highlightOptions.color}}]}}:null},t}(O),X=function(){function e(){this.id="arcgis-dependency-define"}return e.prototype.getDependencyKey=function(){return"jimu-arcgis"},e.prototype.getResources=function(){var e=window.jimuConfig.arcgisJsApiUrl;if(!Object(o.getAppStore)().getState().queryObject.apiurl||(e=Object(o.getAppStore)().getState().queryObject.apiurl,this.checkApiUrl(e)))return/\/$/.test(e)||(e+="/"),window.dojoConfig={baseUrl:o.urlUtils.getFixedRootPath(),parseOnLoad:!1,async:!0,tlmSiblingOfDojo:!1,has:{"esri-featurelayer-webgl":1,"dojo-sniff":0,"dojo-cdn":0},locale:window.locale},window.dojoConfig.packages=[{name:"dojo",location:e+"dojo"},{name:"dijit",location:e+"dijit"},{name:"dojox",location:e+"dojox"},{name:"dgrid",location:e+"dgrid"},{name:"esri",location:e+"esri"},{name:"moment",location:e+"moment"},{name:"whatwg-fetch",location:e+"whatwg-fetch",main:"dist/fetch.umd"}],/src\/$/.test(e)?window.dojoConfig.packages=window.dojoConfig.packages.concat([{name:"@dojo",location:e+"node_modules/@dojo"},{name:"tslib",location:e+"node_modules/tslib",main:"tslib"},{name:"cldrjs",location:e+"node_modules/cldrjs",main:"dist/cldr"},{name:"globalize",location:e+"node_modules/globalize",main:"dist/globalize"},{name:"maquette",location:e+"node_modules/maquette",main:"dist/maquette.umd"},{name:"maquette-jsx",location:e+"node_modules/maquette-jsx",main:"dist/maquette-jsx.umd"},{name:"maquette-css-transitions",location:e+"node_modules/maquette-css-transitions",main:"dist/maquette-css-transitions.umd"}]):window.dojoConfig.packages=window.dojoConfig.packages.concat([{name:"@dojo",location:e+"@dojo"},{name:"tslib",location:e+"tslib",main:"tslib"},{name:"cldrjs",location:e+"cldrjs",main:"dist/cldr"},{name:"globalize",location:e+"globalize",main:"dist/globalize"},{name:"maquette",location:e+"maquette",main:"dist/maquette.umd"},{name:"maquette-jsx",location:e+"maquette-jsx",main:"dist/maquette-jsx.umd"},{name:"maquette-css-transitions",location:e+"maquette-css-transitions",main:"dist/maquette-css-transitions.umd"}]),[{url:"jimu-arcgis",dependencies:[{url:e+"dojo/dojo.js"},{url:e+"esri/css/main.css"}]}];console.log("Bad apiurl.",e)},e.prototype.checkApiUrl=function(e){return"development"===window.env||(!/^\/\//.test(e)&&!/^https?:\/\//.test(e)||/(?:[\w\-\_]+\.)+(?:esri|arcgis)\.com/.test(e))},e}(),Y=function(){function e(){this.id="arcgis-ds-factory"}return e.prototype.getFactoryUri=function(e){if(Object.keys(W.a).map((function(e){return W.a[e]})).indexOf(e)>-1)return"jimu-arcgis/arcgis-data-source"},e}(),K=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),$=function(e){function t(t){var r=e.call(this,t)||this;r.viewManager=U.getInstance(),r.onViewInfosChange=function(e,t){if(e){var i=r.getActiveViewId(),a=r.getViewIdsFromUseMapWidgetIds(t,e),n=r.getWhetherViewCreated(i,e),o=r.getWhetherAllViewsCreated(a,e);r.setState({activeViewId:i,isActiveViewCreated:n,areAllViewsCreated:o})}},r.onViewsCreate=function(e){e&&r.state.activeViewId&&Object.keys(e).some((function(e){return e===r.state.activeViewId}))&&r.setState({isActiveViewCreated:!0}),r.props.onViewsCreate&&r.props.onViewsCreate(e)},r.onViewGroupCreate=function(){if(r.props.onViewGroupCreate&&r.viewManager&&r.props.useMapWidgetIds&&r.props.useMapWidgetIds[0]){var e=r.viewManager.getJimuMapViewGroup(r.props.useMapWidgetIds[0]);r.props.onViewGroupCreate(e)}},r.getActiveViewId=function(){var e=r.props.useMapWidgetIds&&r.props.useMapWidgetIds[0],t=r.viewManager.getJimuMapViewGroup(e),i=t&&t.getActiveJimuMapView();return i&&i.id||null},r.getWhetherAllViewsCreated=function(e,t){return void 0===e&&(e=[]),e.length>0&&!e.some((function(e){return!r.getWhetherViewCreated(e,t)}))},r.getWhetherViewCreated=function(e,t){return!e||!!(e&&t&&t[e]&&t[e].status&&t[e].status===o.JimuMapViewStatus.Loaded)},r.getViewIdsFromUseMapWidgetIds=function(e,t){var i=[];return e&&e.forEach((function(e){i=i.concat(r.getViewIdsFromMapWidgetId(e,t))})),i},r.getViewIdsFromMapWidgetId=function(e,t){return t?Object.keys(t).filter((function(r){return t[r].mapWidgetId===e})):[]},r.getViews=function(e){if(!e)return null;var t={};return e.forEach((function(e){t[e]=r.viewManager.getJimuMapViewById(e)})),t};var i=r.getViewIdsFromUseMapWidgetIds(r.props.useMapWidgetIds,r.props.viewInfos),a=r.getActiveViewId();return r.state={activeViewId:a,isActiveViewCreated:r.getWhetherViewCreated(a,r.props.viewInfos),areAllViewsCreated:r.getWhetherAllViewsCreated(i,r.props.viewInfos)},r}return K(t,e),t.prototype.componentDidMount=function(){if(this.onViewsCreate&&this.state.areAllViewsCreated){var e=this.getViewIdsFromUseMapWidgetIds(this.props.useMapWidgetIds,this.props.viewInfos),t=this.getViews(e);this.onViewsCreate(t),this.onViewGroupCreate()}if(this.props.onActiveViewChange&&this.state.isActiveViewCreated){var r=this.viewManager&&this.viewManager.getJimuMapViewById(this.state.activeViewId)||null;this.props.onActiveViewChange(r,null)}},t.prototype.componentDidUpdate=function(e,t){if(this.props.viewInfos===e.viewInfos&&this.props.useMapWidgetIds===e.useMapWidgetIds||this.onViewInfosChange(this.props.viewInfos,this.props.useMapWidgetIds),this.props.onActiveViewChange&&this.state.isActiveViewCreated&&(!t.isActiveViewCreated||this.state.activeViewId!==t.activeViewId)){var r=this.viewManager&&this.viewManager.getJimuMapViewById(this.state.activeViewId)||null;this.props.onActiveViewChange(r,t.activeViewId)}if(this.onViewsCreate&&this.state.areAllViewsCreated&&(!t.areAllViewsCreated||this.props.useMapWidgetIds!==e.useMapWidgetIds)){var i=this.getViewIdsFromUseMapWidgetIds(this.props.useMapWidgetIds,this.props.viewInfos),a=this.getViews(i);this.onViewsCreate(a),this.onViewGroupCreate()}},t.prototype.render=function(){if(!this.props.useMapWidgetIds||!this.props.viewInfos||!this.props.children)return null;var e=this.getViewIdsFromUseMapWidgetIds(this.props.useMapWidgetIds,this.props.viewInfos),t=this.getViews(e);return"function"==typeof this.props.children?this.props.children(t):this.props.children},t}(o.React.PureComponent),Z=o.ReactRedux.connect((function(e,t){return e.appStateInBuilder?{viewInfos:e.appStateInBuilder&&e.appStateInBuilder.jimuMapViewsInfo}:{viewInfos:e&&e.jimuMapViewsInfo}}))($),ee=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),te=function(e){function t(t){var r=e.call(this,t)||this;return r.getJimuMapViewIdsFromUseMapWidgetIds=function(e,t,i){var a=[];return e&&e.forEach((function(e){a=a.concat(r.getJimuMapViewIdsFromMapWidgetId(e,t,i))})),a},r.getJimuMapViewIdsFromMapWidgetId=function(e,t,r){return r&&t?Object.keys(t).filter((function(i){return t[i].mapWidgetId===e&&t[i].datasourceId===r})):[]},r}return ee(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.getJimuMapViewIdsFromUseMapWidgetIds(this.props.useMapWidgetIds,this.props.viewInfos,this.props.jimuLayerViewInfo&&this.props.jimuLayerViewInfo.rootDatasourceId);if(t[0]&&this.props.viewInfos[t[0]].status===o.JimuMapViewStatus.Loaded&&this.props.jimuLayerViewInfo&&this.props.jimuLayerViewInfo.jimuMapViewId&&this.props.jimuLayerViewInfo.jimuLayerId){var r=U.getInstance().getJimuMapViewById(t[0]).getJimuLayerViewLoadPromiseById(this.props.jimuLayerViewInfo.jimuMapViewId+"-"+this.props.jimuLayerViewInfo.jimuLayerId);r?r.then((function(t){e.props.onLayerViewCreated&&e.props.onLayerViewCreated(t)}),(function(t){e.props.onLayerViewFailed&&e.props.onLayerViewFailed(t)})):this.props.onLayerViewCreated&&this.props.onLayerViewCreated(null)}t[0]&&this.props.viewInfos[t[0]].status===o.JimuMapViewStatus.Failed&&this.props.jimuLayerViewInfo&&this.props.jimuLayerViewInfo.jimuMapViewId&&this.props.jimuLayerViewInfo.jimuLayerId&&this.props.onLayerViewFailed&&this.props.onLayerViewFailed(null)},t.prototype.componentDidUpdate=function(e,t){var r=this,i=this.getJimuMapViewIdsFromUseMapWidgetIds(e.useMapWidgetIds,e.viewInfos,e.jimuLayerViewInfo&&e.jimuLayerViewInfo.rootDatasourceId),a=e.viewInfos[i[0]],n=a&&a.status,s=this.getJimuMapViewIdsFromUseMapWidgetIds(this.props.useMapWidgetIds,this.props.viewInfos,this.props.jimuLayerViewInfo&&this.props.jimuLayerViewInfo.rootDatasourceId),u=this.props.viewInfos[s[0]],c=u&&u.status;if(n!==c||n===c&&i.join("")===s.join(""))if(u){if(u.status===o.JimuMapViewStatus.Loaded){var l=U.getInstance().getJimuMapViewById(s[0]).getJimuLayerViewLoadPromiseById(this.props.jimuLayerViewInfo.jimuMapViewId+"-"+this.props.jimuLayerViewInfo.jimuLayerId);l?l.then((function(e){r.props.onLayerViewCreated&&r.props.onLayerViewCreated(e)}),(function(e){r.props.onLayerViewFailed&&r.props.onLayerViewFailed(e)})):this.props.onLayerViewCreated&&this.props.onLayerViewCreated(null)}u.status===o.JimuMapViewStatus.Failed&&this.props.onLayerViewFailed&&this.props.onLayerViewFailed(null)}else this.props.onLayerViewCreated&&this.props.onLayerViewCreated(null)},t.prototype.render=function(){return null},t}(o.React.PureComponent),re=o.ReactRedux.connect((function(e,t){return{viewInfos:e&&e.jimuMapViewsInfo}}))(te);function ie(){return Promise.resolve()}}]))}}}));