????
Current Path : C:/inetpub/vhost/bcvt.kontum.gov.vn/www/ |
Current File : C:/inetpub/vhost/bcvt.kontum.gov.vn/www/55-es2015.js |
(function(){ var absMids = { "esri/arcade/featureSetCollection":"./node_modules/arcgis-js-api/arcade/featureSetCollection.js", "esri/arcade/featureSetUtils":"./node_modules/arcgis-js-api/arcade/featureSetUtils.js", "esri/arcade/featureset/actions/Adapted":"./node_modules/arcgis-js-api/arcade/featureset/actions/Adapted.js", "esri/arcade/featureset/actions/AttributeFilter":"./node_modules/arcgis-js-api/arcade/featureset/actions/AttributeFilter.js", "esri/arcade/featureset/actions/GroupBy":"./node_modules/arcgis-js-api/arcade/featureset/actions/GroupBy.js", "esri/arcade/featureset/actions/OrderBy":"./node_modules/arcgis-js-api/arcade/featureset/actions/OrderBy.js", "esri/arcade/featureset/actions/SpatialFilter":"./node_modules/arcgis-js-api/arcade/featureset/actions/SpatialFilter.js", "esri/arcade/featureset/actions/Top":"./node_modules/arcgis-js-api/arcade/featureset/actions/Top.js", "esri/arcade/featureset/sources/Empty":"./node_modules/arcgis-js-api/arcade/featureset/sources/Empty.js", "esri/arcade/featureset/sources/FeatureLayerDynamic":"./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerDynamic.js", "esri/arcade/featureset/sources/FeatureLayerMemory":"./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerMemory.js", "esri/arcade/featureset/sources/FeatureLayerRelated":"./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerRelated.js", "esri/arcade/featureset/support/FeatureSet":"./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js", "esri/arcade/featureset/support/FeatureSetIterator":"./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSetIterator.js", "esri/arcade/featureset/support/IdSet":"./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js", "esri/arcade/featureset/support/OrderbyClause":"./node_modules/arcgis-js-api/arcade/featureset/support/OrderbyClause.js", "esri/arcade/featureset/support/StatsField":"./node_modules/arcgis-js-api/arcade/featureset/support/StatsField.js", "esri/arcade/featureset/support/cache":"./node_modules/arcgis-js-api/arcade/featureset/support/cache.js", "esri/arcade/featureset/support/sha":"./node_modules/arcgis-js-api/arcade/featureset/support/sha.js", "esri/arcade/featureset/support/shared":"./node_modules/arcgis-js-api/arcade/featureset/support/shared.js", "esri/arcade/featureset/support/sqlUtils":"./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js", "esri/arcade/featureset/support/stats":"./node_modules/arcgis-js-api/arcade/featureset/support/stats.js", "esri/arcade/functions/featuresetbase":"./node_modules/arcgis-js-api/arcade/functions/featuresetbase.js", "esri/arcade/functions/featuresetgeom":"./node_modules/arcgis-js-api/arcade/functions/featuresetgeom.js", "esri/arcade/functions/featuresetstats":"./node_modules/arcgis-js-api/arcade/functions/featuresetstats.js", "esri/arcade/functions/featuresetstring":"./node_modules/arcgis-js-api/arcade/functions/featuresetstring.js" }; var globalObj = this||window; var jsonpArray = globalObj["webpackJsonp"] = globalObj["webpackJsonp"] || []; if (jsonpArray.registerAbsMids) { jsonpArray.registerAbsMids(absMids); } else { var absMidsWaiting = jsonpArray.absMidsWaiting = jsonpArray.absMidsWaiting || []; absMidsWaiting.push(absMids); } })(),(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[55],{ /***/ "./node_modules/arcgis-js-api/arcade/featureSetCollection.js": /*!*******************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureSetCollection.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,r){return function(){function e(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}return e.prototype.add=function(e,t,r){this._layerById[t]=r,this._layerByName[e]=r},e.prototype.featureSetByName=function(e,t,r){return void 0===t&&(t=!0),void 0===r&&(r=["*"]),void 0===this._layerByName[e]?this.resolvePromise(null):this.resolvePromise(this._layerByName[e])},e.prototype.featureSetById=function(e,t,r){return void 0===t&&(t=!0),void 0===r&&(r=["*"]),void 0===this._layerById[e]?this.resolvePromise(null):this.resolvePromise(this._layerById[e])},e.prototype.castToText=function(){return"object, FeatureSetCollection"},e.prototype.resolvePromise=function(e){return r.resolve(e)},e}()}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureSetUtils.js": /*!**************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureSetUtils.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../core/tsSupport/extendsHelper */ "./node_modules/arcgis-js-api/core/tsSupport/extendsHelper.js"),__webpack_require__(/*! ../core/tsSupport/assignHelper */ "./node_modules/arcgis-js-api/core/tsSupport/assignHelper.js"),__webpack_require__(/*! ../request */ "./node_modules/arcgis-js-api/request.js"),__webpack_require__(/*! ./featureSetCollection */ "./node_modules/arcgis-js-api/arcade/featureSetCollection.js"),__webpack_require__(/*! ./featureset/sources/FeatureLayerDynamic */ "./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerDynamic.js"),__webpack_require__(/*! ./featureset/sources/FeatureLayerMemory */ "./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerMemory.js"),__webpack_require__(/*! ./featureset/sources/FeatureLayerRelated */ "./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerRelated.js"),__webpack_require__(/*! ./featureset/support/cache */ "./node_modules/arcgis-js-api/arcade/featureset/support/cache.js"),__webpack_require__(/*! ./featureset/support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../layers/FeatureLayer */ "./node_modules/arcgis-js-api/layers/FeatureLayer.js"),__webpack_require__(/*! ../portal/Portal */ "./node_modules/arcgis-js-api/portal/Portal.js"),__webpack_require__(/*! ../portal/PortalItem */ "./node_modules/arcgis-js-api/portal/PortalItem.js"),__webpack_require__(/*! ./featureset/actions/OrderBy */ "./node_modules/arcgis-js-api/arcade/featureset/actions/OrderBy.js"),__webpack_require__(/*! ./featureset/actions/Top */ "./node_modules/arcgis-js-api/arcade/featureset/actions/Top.js"),__webpack_require__(/*! ./featureset/actions/SpatialFilter */ "./node_modules/arcgis-js-api/arcade/featureset/actions/SpatialFilter.js"),__webpack_require__(/*! ./featureset/actions/AttributeFilter */ "./node_modules/arcgis-js-api/arcade/featureset/actions/AttributeFilter.js"),__webpack_require__(/*! ./featureset/actions/GroupBy */ "./node_modules/arcgis-js-api/arcade/featureset/actions/GroupBy.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,r,a,n,i,l,o,u,s,c,d,f,h,p){function y(){null===s.applicationCache&&(s.applicationCache=new s)}function m(e,t){if(s.applicationCache){var r=s.applicationCache.getLayerInfo(e);if(r)return r.then(function(r){return d.resolve(new f({url:e,outFields:t,sourceJSON:r}))});var a=new f({url:e,outFields:t}),n=d.create(function(e,t){a.load().then(function(){e(a.sourceJSON)},function(e){t(e)})});return s.applicationCache&&(s.applicationCache.setLayerInfo(e,n),n=n.catch(function(t){throw s.applicationCache.clearLayerInfo(e),t})),n.then(function(e){return d.resolve(a)})}return d.resolve(new f({url:e,outFields:t}))}function v(e,t,r,a,n){return m(e,["*"]).then(function(e){return d.resolve(L(e,t,r,a,n))})}function L(e,t,r,a,n){return void 0===t&&(t=null),void 0===r&&(r=null),void 0===a&&(a=!0),void 0===n&&(n=null),!0===e._hasMemorySource()?new o({layer:e,spatialReference:t,outFields:r,includeGeometry:a,lrucache:n}):new l({layer:e,spatialReference:t,outFields:r,includeGeometry:a,lrucache:n})}function I(e){if(null!==s.applicationCache){var t=s.applicationCache.getLayerInfo(e);if(null!==t)return t}var r=n(e,{responseType:"json",query:{f:"json"}}).then(function(e){if(e.data){var t=e.data;return d.resolve(t)}return d.resolve(null)});return null!==s.applicationCache&&(s.applicationCache.setLayerInfo(e,r),r=r.catch(function(t){throw s.applicationCache.clearLayerInfo(e),t})),r}function S(e,t){var r="QUERYDATAELEMTS:"+t.toString()+":"+e;if(null!==s.applicationCache){var a=s.applicationCache.getLayerInfo(r);if(null!==a)return a}var i=n(e+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([t.toString()]),f:"json"}}).then(function(e){if(e.data){var t=e.data;if(t.layerDataElements&&t.layerDataElements[0])return t.layerDataElements[0]}throw new Error("Not Found")});return null!==s.applicationCache&&(s.applicationCache.setLayerInfo(r,i),i=i.catch(function(e){throw s.applicationCache.clearLayerInfo(r),e})),i}function _(e){if(null!==s.applicationCache){var t=s.applicationCache.getLayerInfo(e);if(null!==t)return t}var r=n(e,{responseType:"json",query:{f:"json"}}).then(function(e){if(e.data){var t=e.data;return t.layers||(t.layers=[]),t.tables||(t.tables=[]),d.resolve(t)}var r={layers:[],tables:[]};return d.resolve(r)});return null!==s.applicationCache&&(s.applicationCache.setLayerInfo(e,r),r=r.catch(function(t){throw s.applicationCache.clearLayerInfo(e),t})),r}function F(e,t){var r={metadata:null,networkId:-1,terminals:[],queryelem:null,layerNameLkp:{},lkp:null};return _(e).then(function(a){if(r.metadata=a,a.controllerDatasetLayers&&void 0!==a.controllerDatasetLayers.utilityNetworkLayerId&&null!==a.controllerDatasetLayers.utilityNetworkLayerId){if(a.layers)for(var n=0,i=a.layers;n<i.length;n++){var l=i[n];r.layerNameLkp[l.id]=l.name}if(a.tables)for(var o=0,u=a.tables;o<u.length;o++){var l=u[o];r.layerNameLkp[l.id]=l.name}var s=a.controllerDatasetLayers.utilityNetworkLayerId;return r.networkId=s,S(e,s).then(function(a){if(a){r.queryelem=a,r.lkp={},r.queryelem.dataElement.domainNetworks||(r.queryelem.dataElement.domainNetworks=[]);for(var n=0,i=r.queryelem.dataElement.domainNetworks;n<i.length;n++){for(var l=i[n],o=0,u=l.edgeSources?l.edgeSources:[];o<u.length;o++){var c=u[o],d={layerId:c.layerId,sourceId:c.sourceId,className:r.layerNameLkp[c.layerId]?r.layerNameLkp[c.layerId]:null};d.className&&(r.lkp[d.className]=d)}for(var f=0,h=l.junctionSources?l.junctionSources:[];f<h.length;f++){var c=h[f],d={layerId:c.layerId,sourceId:c.sourceId,className:r.layerNameLkp[c.layerId]?r.layerNameLkp[c.layerId]:null};d.className&&(r.lkp[d.className]=d)}}if(r.queryelem.dataElement.terminalConfigurations)for(var p=0,y=r.queryelem.dataElement.terminalConfigurations;p<y.length;p++)for(var m=y[p],L=0,S=m.terminals;L<S.length;L++){var _=S[L];r.terminals.push({terminalId:_.terminalId,terminalName:_.terminalName})}return I(e+"/"+s).then(function(a){return a.systemLayers&&void 0!==a.systemLayers.associationsTableId&&null!==a.systemLayers.associationsTableId?v(e+"/"+a.systemLayers.associationsTableId.toString(),t,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID"],!1,null).then(function(e){return e.load()}).then(function(e){return{lkp:r.lkp,associations:e,terminals:r.terminals}}):{associations:null,lkp:null,terminals:[]}})}return{associations:null,lkp:null,terminals:[]}})}return{associations:null,lkp:null,terminals:[]}})}function g(e,t,r,a,n,i,l){void 0===a&&(a=null),void 0===n&&(n=null),void 0===i&&(i=!0),void 0===l&&(l=null);var o=e.serviceUrl();return o?(o="/"===o.charAt(o.length-1)?o+t.relatedTableId.toString():o+"/"+t.relatedTableId.toString(),v(o,a,n,i,l).then(function(o){return new u({layer:e,relatedLayer:o,relationship:t,objectId:r,spatialReference:a,outFields:n,includeGeometry:i,lrucache:l})})):null}function N(e,t,r){return void 0===r&&(r=null),new T(e,t,r)}function C(e,t,r){return void 0===r&&(r=null),new w(e,t,r)}function b(e,t){return null===e?t:new h({url:e.field("url")})}function k(e,t,r,a,n,i,l){if(s.applicationCache){var o=s.applicationCache.getLayerInfo(e+":"+i.url);if(o)return o.then(function(e){try{var i=new f({url:c.extractServiceUrl(e.url)+"/"+t,outFields:["*"]});return d.resolve(L(i,r,a,n,l))}catch(e){return d.reject(e)}},function(e){return d.reject(e)})}return d.create(function(o,u){var d=new p({id:e,portal:i}),h=d.load();s.applicationCache&&s.applicationCache.setLayerInfo(e+":"+i.url,h),h.then(function(e){try{var i=new f({url:c.extractServiceUrl(e.url)+"/"+t,outFields:["*"]});o(L(i,r,a,n,l))}catch(e){u(e)}},function(t){s.applicationCache&&s.applicationCache.clearLayerInfo(e+":"+i.url),u(t)})})}Object.defineProperty(t,"__esModule",{value:!0}),t.initialiseMetaDataCache=y,t.constructFeatureSetFromUrl=v,t.constructFeatureSet=L,t.constructAssociationMetaDataFeatureSetFromUrl=F,t.constructFeatureSetFromRelationship=g;var T=function(e){function t(t,r,a){void 0===r&&(r=null),void 0===a&&(a=null);var n=e.call(this)||this;return n._map=t,n._overridespref=r,n.lrucache=a,n._instantLayers=[],n}return r(t,e),t.prototype.makeAndAddFeatureSet=function(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=null);var a=L(e,this._overridespref,null===r?["*"]:r,t,this.lrucache);return this._instantLayers.push({featureset:a,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),a},t.prototype.featureSetByName=function(e,t,r){var n=this;if(void 0===t&&(t=!0),void 0===r&&(r=null),void 0!==this._map.loaded&&void 0!==this._map.load&&!1===this._map.loaded)return this._map.load().then(function(){try{return n.featureSetByName(e,t,r)}catch(e){return d.reject(e)}});null===r&&(r=["*"]),r=r.slice(0),r=r.sort();for(var i=JSON.stringify(r),l=0;l<this._instantLayers.length;l++){var o=this._instantLayers[l];if(o.opitem.title===e&&o.includeGeometry===t&&o.outFields===i)return this.resolvePromise(this._instantLayers[l].featureset)}var u=this._map.layers.find(function(t){return t instanceof f&&t.title===e});if(u)return this.resolvePromise(this.makeAndAddFeatureSet(u,t,r));if(this._map.tables){var s=this._map.tables.find(function(t){return!!(t.title&&t.title===e||t.title&&t.title===e)});if(s){if(s._materializedTable);else{var c=s.outFields?s:a({},s,{outFields:["*"]});s._materializedTable=new f(c)}return s._materializedTable.load().then(function(){return n.resolvePromise(n.makeAndAddFeatureSet(s._materializedTable,t,r))})}}return this.resolvePromise(null)},t.prototype.featureSetById=function(e,t,r){var n=this;if(void 0===t&&(t=!0),void 0===r&&(r=["*"]),void 0!==this._map.loaded&&void 0!==this._map.load&&!1===this._map.loaded)return this._map.load().then(function(){try{return n.featureSetById(e,t,r)}catch(e){return d.reject(e)}});null===r&&(r=["*"]),r=r.slice(0),r=r.sort();for(var i=JSON.stringify(r),l=0;l<this._instantLayers.length;l++){var o=this._instantLayers[l];if(o.opitem.id===e&&o.includeGeometry===t&&o.outFields===i)return this.resolvePromise(this._instantLayers[l].featureset)}var u=this._map.layers.find(function(t){return t instanceof f&&t.id===e});if(u)return this.resolvePromise(this.makeAndAddFeatureSet(u,t,r));if(this._map.tables){var s=this._map.tables.find(function(t){return t.id===e});if(s){if(s._materializedTable);else{var c=a({},s,{outFields:["*"]});s._materializedTable=new f(c)}return s._materializedTable.load().then(function(){return n.resolvePromise(n.makeAndAddFeatureSet(s._materializedTable,t,r))})}}return this.resolvePromise(null)},t}(i),w=function(e){function t(t,r,a){void 0===r&&(r=null),void 0===a&&(a=null);var n=e.call(this)||this;return n._url=t,n._overridespref=r,n.lrucache=a,n.metadata=null,n._instantLayers=[],n}return r(t,e),Object.defineProperty(t.prototype,"url",{get:function(){return this._url},enumerable:!0,configurable:!0}),t.prototype.makeAndAddFeatureSet=function(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=null);var a=L(e,this._overridespref,null===r?["*"]:r,t,this.lrucache);return this._instantLayers.push({featureset:a,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),a},t.prototype._loadMetaData=function(){var e=this;return _(this._url).then(function(t){return e.metadata=t,t})},t.prototype.load=function(){return this._loadMetaData()},t.prototype.clone=function(){return new t(this._url,this._overridespref,this.lrucache)},t.prototype.featureSetByName=function(e,t,r){var a=this;void 0===t&&(t=!0),void 0===r&&(r=null),null===r&&(r=["*"]),r=r.slice(0),r=r.sort();for(var n=JSON.stringify(r),i=0;i<this._instantLayers.length;i++){var l=this._instantLayers[i];if(l.opitem.title===e&&l.includeGeometry===t&&l.outFields===n)return this.resolvePromise(this._instantLayers[i].featureset)}return this._loadMetaData().then(function(n){for(var i=null,l=0,o=n.layers?n.layers:[];l<o.length;l++){var u=o[l];u.name===e&&(i=u)}if(!i)for(var s=0,c=n.tables?n.tables:[];s<c.length;s++){var u=c[s];u.name===e&&(i=u)}return i?m(a._url+"/"+i.id,["*"]).then(function(e){return a.makeAndAddFeatureSet(e,t,r)}):a.resolvePromise(null)})},t.prototype.featureSetById=function(e,t,r){var a=this;void 0===t&&(t=!0),void 0===r&&(r=["*"]),null===r&&(r=["*"]),r=r.slice(0),r=r.sort();var n=JSON.stringify(r);e=null!==e&&void 0!==e?e.toString():"";for(var i=0;i<this._instantLayers.length;i++){var l=this._instantLayers[i];if(l.opitem.id===e&&l.includeGeometry===t&&l.outFields===n)return this.resolvePromise(this._instantLayers[i].featureset)}return this._loadMetaData().then(function(n){for(var i=null,l=0,o=n.layers?n.layers:[];l<o.length;l++){var u=o[l];null!==u.id&&void 0!==u.id&&u.id.toString()===e&&(i=u)}if(!i)for(var s=0,c=n.tables?n.tables:[];s<c.length;s++){var u=c[s];null!==u.id&&void 0!==u.id&&u.id.toString()===e&&(i=u)}return i?m(a._url+"/"+i.id,["*"]).then(function(e){return a.makeAndAddFeatureSet(e,t,r)}):a.resolvePromise(null)})},t}(i);t.createFeatureSetCollectionFromMap=N,t.createFeatureSetCollectionFromService=C,t.getPortal=b,t.constructFeatureSetFromPortalItem=k}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/actions/Adapted.js": /*!*************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/actions/Adapted.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/tsSupport/extendsHelper */ "./node_modules/arcgis-js-api/core/tsSupport/extendsHelper.js"),__webpack_require__(/*! ../../../Graphic */ "./node_modules/arcgis-js-api/Graphic.js"),__webpack_require__(/*! ../../kernel */ "./node_modules/arcgis-js-api/arcade/kernel.js"),__webpack_require__(/*! ../support/FeatureSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js"),__webpack_require__(/*! ../support/IdSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js"),__webpack_require__(/*! ../support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../support/sqlUtils */ "./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../../core/sql/WhereClause */ "./node_modules/arcgis-js-api/core/sql/WhereClause.js"),__webpack_require__(/*! ../../../geometry/SpatialReference */ "./node_modules/arcgis-js-api/geometry/SpatialReference.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,r,a,i,n,l,o,s,u,h,d){Object.defineProperty(t,"__esModule",{value:!0});var p=function(){function e(){this.sqlRewritable=!1}return e.prototype.extractValue=function(e){return null},e.prototype.postInitialization=function(e,t){},e.prototype.rewriteSql=function(e,t){return{rewritten:this.sqlRewritable,where:e}},e}();t.AdaptedField=p;var c=function(e){function t(t){var r=e.call(this)||this;return r.field=t,r.sqlRewritable=!0,r}return r(t,e),t.prototype.extractValue=function(e){return e.attributes[this.field.name]},t.prototype.rewriteSql=function(e,t){return{rewritten:this.sqlRewritable,where:e}},t}(p);t.OriginalField=c;var f=function(e){function t(t,r,a){var i=e.call(this)||this;return i.originalField=t,i.sqlRewritable=!0,i.field=o.cloneField(t),i.field.name=r,i.field.alias=a,i}return r(t,e),t.prototype.rewriteSql=function(e,t){return{rewritten:this.sqlRewritable,where:s.reformulateWithoutField(e,this.field.name,this.originalField.name,t.getFieldsIndex())}},t.prototype.extractValue=function(e){return e.attributes[this.originalField.name]},t}(p);t.FieldRename=f;var v=function(e){function t(t,r,a){var i=e.call(this)||this;i.field=t,i.codefield=r,i.lkp=a,i.reverseLkp={};for(var n in a)i.reverseLkp[a[n]]=n;return i.sqlRewritable=!0,i}return r(t,e),t.prototype.rewriteSql=function(e,r){var a=this.evaluateNodeToWhereClause(e.parseTree,o.FeatureServiceDatabaseType.Standardised,this.field.name,this.codefield instanceof h.WhereClause?s.toWhereClause(this.codefield,o.FeatureServiceDatabaseType.Standardised):this.codefield,e.parameters);return a.indexOf(t.BADNESS)>=0?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:h.WhereClause.create(a,r._parent.getFieldsIndex())}},t.prototype.evaluateNodeToWhereClause=function(e,r,a,i,n){void 0===a&&(a=null),void 0===i&&(i=null);var l,u,h,d;switch(e.type){case"interval":return s.convertIntervalToSql(this.evaluateNodeToWhereClause(e.value,r,a,i,n),e.qualifier,e.op,o.FeatureServiceDatabaseType.Standardised);case"case_expression":var p=" CASE ";"simple"===e.format&&(p+=this.evaluateNodeToWhereClause(e.operand,r,a,t.BADNESS,n));for(var c=0;c<e.clauses.length;c++)p+=" WHEN "+this.evaluateNodeToWhereClause(e.clauses[c].operand,r,a,t.BADNESS,n)+" THEN "+this.evaluateNodeToWhereClause(e.clauses[c].value,r,a,t.BADNESS,n);return null!==e.else&&(p+=" ELSE "+this.evaluateNodeToWhereClause(e.else,r,a,t.BADNESS,n)),p+=" END ";case"param":var f=n[e.value.toLowerCase()];if("string"==typeof f){return"'"+n[e.value.toLowerCase()].toString().replace(/'/g,"''")+"'"}if(f instanceof Date)return s.makeDateString(f,r);if(f instanceof Array){for(var v=[],c=0;c<f.length;c++)"string"==typeof f[c]?v.push("'"+f[c].toString().replace(/'/g,"''")+"'"):f[c]instanceof Date?v.push(s.makeDateString(f[c],r)):v.push(f[c].toString());return v}return f.toString();case"expr_list":u=[];for(var g=0,S=e.value;g<S.length;g++){var _=S[g];u.push(this.evaluateNodeToWhereClause(_,r,a,i,n))}return u;case"unary_expr":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,r,a,t.BADNESS,n)+" ) ";case"binary_expr":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" AND "+this.evaluateNodeToWhereClause(e.right,r,a,i,n)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" OR "+this.evaluateNodeToWhereClause(e.right,r,a,i,n)+") ";case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" IS NOT NULL )";case"IN":if(l=[],"expr_list"===e.right.type){if("column_ref"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){for(var N=[],w=!0,C=0,T=e.right.value;C<T.length;C++){var m=T[C];if("string"!==m.type){w=!1;break}if(void 0===this.lkp[m.value]){w=!1;break}N.push(this.lkp[m.value].toString())}if(w)return" ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" IN ("+N.join(",")+")) "}return l=this.evaluateNodeToWhereClause(e.right,r,a,i,n)," ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" IN ("+l.join(",")+")) "}return d=this.evaluateNodeToWhereClause(e.right,r,a,i,n),d instanceof Array?" ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" IN ("+d.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" IN ("+d+")) ";case"NOT IN":if(l=[],"expr_list"===e.right.type){if("column_ref"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){for(var N=[],w=!0,y=0,F=e.right.value;y<F.length;y++){var m=F[y];if("string"!==m.type){w=!1;break}if(void 0===this.lkp[m.value]){w=!1;break}N.push(this.lkp[m.value].toString())}if(w)return" ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" NOT IN ("+N.join(",")+")) "}return l=this.evaluateNodeToWhereClause(e.right,r,a,i,n)," ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" NOT IN ("+l.join(",")+")) "}return d=this.evaluateNodeToWhereClause(e.right,r,a,i,n),d instanceof Array?" ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" NOT IN ("+d.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,r,a,i,n)+" NOT IN ("+d+")) ";case"BETWEEN":return h=this.evaluateNodeToWhereClause(e.right,r,a,t.BADNESS,n)," ("+this.evaluateNodeToWhereClause(e.left,r,a,t.BADNESS,n)+" BETWEEN "+h[0]+" AND "+h[1]+" ) ";case"NOTBETWEEN":return h=this.evaluateNodeToWhereClause(e.right,r,a,t.BADNESS,n)," ("+this.evaluateNodeToWhereClause(e.left,r,a,t.BADNESS,n)+" NOT BETWEEN "+h[0]+" AND "+h[1]+" ) ";case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,r,a,t.BADNESS,n)+" LIKE "+this.evaluateNodeToWhereClause(e.right,r,a,t.BADNESS,n)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,r,a,t.BADNESS,n)+" LIKE "+this.evaluateNodeToWhereClause(e.right,r,a,t.BADNESS,n)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,r,a,t.BADNESS,n)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,r,a,t.BADNESS,n)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,r,a,t.BADNESS,n)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,r,a,t.BADNESS,n)+") ";case"<>":case"=":if("column_ref"===e.left.type&&"string"===e.right.type){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&void 0!==this.lkp[e.right.value.toString()])return" ("+i+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if("column_ref"===e.right.type&&"string"===e.left.type&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+i+") ";return" ("+this.evaluateNodeToWhereClause(e.left,r,a,t.BADNESS,n)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,r,a,t.BADNESS,n)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":return" ("+this.evaluateNodeToWhereClause(e.left,r,a,t.BADNESS,n)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,r,a,t.BADNESS,n)+") "}throw new Error("Not Supported Operator "+e.operator);case"null":return"null";case"bool":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return s.makeDateString(e.value,r);case"number":return e.value.toString();case"column_ref":return"CURRENT_DATE"===e.column.toUpperCase()?s.makeToday(!0,r):"CURRENT_TIMESTAMP"===e.column.toUpperCase()?s.makeToday(!1,r):a&&a.toLowerCase()===e.column.toLowerCase()?"("+i+")":e.column;case"function":var E=this.evaluateNodeToWhereClause(e.args,r,a,t.BADNESS,n);return s.translateFunctionToDatabaseSpecific(e.name,E,r)}throw new Error("Unsupported sql syntax "+e.type)},t.prototype.extractValue=function(e){return this.codefield instanceof h.WhereClause?this.reverseLkp[this.codefield.calculateValueCompiled(e)]:this.reverseLkp[e.attributes[this.codefield]]},t.BADNESS="_!!!_BAD_LKP_!!!!",t}(p);t.StringToCodeAdapted=v;var g=function(e){function t(t,r){var a=e.call(this)||this;return a.field=t,a.sql=r,a}return r(t,e),t.prototype.rewriteSql=function(e,t){return{rewritten:!0,where:s.reformulateWithoutField(e,this.field.name,s.toWhereClause(this.sql,o.FeatureServiceDatabaseType.Standardised),t.getFieldsIndex())}},t.prototype.postInitialization=function(e,t){},t.prototype.extractValue=function(e){return this.sql.calculateValueCompiled(e)},t}(p);t.SqlExpressionAdapted=g;var S=function(e){function t(t){var r=e.call(this,t)||this;return r._calcFunc=null,r.declaredClass="esri.arcade.featureset.actions.Adapted",r.adaptedFields=null,r._extraFilter=null,r._extraFilter=t.extraFilter,r._parent=t.parentfeatureset,r._maxProcessing=30,r.adaptedFields=t.adaptedFields,r}return r(t,e),t.findField=function(e,t){for(var r=0,a=e;r<a.length;r++){var i=a[r];if(i.name.toLowerCase()===t.toString().toLowerCase())return i}return null},t.prototype._initialiseFeatureSet=function(){null!==this._parent?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new d({wkid:4326}),this.objectIdField="",this.geometryType=o.layerGeometryEsriConstants.point,this.typeIdField="",this.types=null),this.fields=[];for(var e=0,t=this.adaptedFields;e<t.length;e++){var r=t[e];r.postInitialization(this,this._parent),this.fields.push(r.field)}},t.prototype._getSet=function(e){var t=this;return null===this._wset?this._ensureLoaded().then(function(){return t._extraFilter?t._getFilteredSet("",null,null,null,e):t._parent._getSet(e)}).then(function(r){return t._checkCancelled(e),t._wset=new l(r._candidates.slice(0),r._known.slice(0),r._ordered,t._clonePageDefinition(r.pagesDefinition)),t._wset}):u.resolve(this._wset)},t.prototype._isInFeatureSet=function(e){return this._parent._isInFeatureSet(e)},t.prototype._getFeatures=function(e,t,r,n){var o=this,s=[];-1!==t&&void 0===this._featureCache[t]&&s.push(t);var h=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,h,n))return this._expandPagedSet(e,h,0,0,n).then(function(a){return o._getFeatures(e,t,r,n)});for(var d=0,p=e._lastFetchedIndex;p<e._known.length&&(d++,d<=r&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[p]]&&(e._known[p]!==t&&s.push(e._known[p]),s.length>=h-1)));p++);if(0===s.length)return u.resolve("success");e=new l([],s,e._ordered,null);var c=Math.min(s.length,r);return this._parent._getFeatures(e,-1,c,n).then(function(e){o._checkCancelled(n);for(var t=[],r=0;r<c;r++){var l=o._parent._featureFromCache(s[r]);void 0!==l&&t.push({geometry:l.geometry,attributes:l.attributes,id:s[r]})}for(var u=0,h=t;u<h.length;u++){for(var d=h[u],p=[],f=0,v=o.adaptedFields;f<v.length;f++){var g=v[f];p[g.field.name]=g.extractValue(d)}o._featureCache[d.id]=new a({attributes:p,geometry:i.cloneGeometry(d.geometry)})}return"success"})},t.prototype._fetchAndRefineFeatures=function(e,t,r){return u.reject(new Error("Fetch and Refine should not be called in this featureset"))},t.prototype._getFilteredSet=function(e,t,r,a,i){var n=this,o=!1,u=this.reformulateWithoutAdaptions(r);o=u.cannot,r=u.where;var h=!1;if(null!==a){h=!0;for(var d=[],p=0,v=this.adaptedFields;p<v.length;p++){var g=v[p];if(!(g instanceof c)&&!0===a.scanForField(g.field.name)){if(!(g instanceof f)){a=null,h=!1;break}d.push({field:g.field.name,newfield:g.originalField.name})}}a&&d.length>0&&(a=a.replaceFields(d))}return null!==r?null!==this._extraFilter&&(r=s.combine(this._extraFilter,r)):r=this._extraFilter,this._ensureLoaded().then(function(){return n._parent._getFilteredSet(e,t,r,a,i)}).then(function(e){return n._checkCancelled(i),!0===o?new l(e._candidates.slice(0).concat(e._known.slice(0)),[],!0===h&&e._ordered,n._clonePageDefinition(e.pagesDefinition)):new l(e._candidates.slice(0),e._known.slice(0),!0===h&&e._ordered,n._clonePageDefinition(e.pagesDefinition))})},t.prototype.reformulateWithoutAdaptions=function(e){var t={cannot:!1,where:e};if(null!==e)for(var r=0,a=this.adaptedFields;r<a.length;r++){var i=a[r];if(!0===s.scanForField(e,i.field.name)){var n=i.rewriteSql(e,this);if(!0!==n.rewritten){t.cannot=!0,t.where=null;break}t.where=n.where}}return t},t.prototype._stat=function(e,t,r,a,i,n,l){var o=this,h=!1,d=this.reformulateWithoutAdaptions(t);return h=d.cannot,t=d.where,d=this.reformulateWithoutAdaptions(i),h=h||d.cannot,i=d.where,null!==i?null!==this._extraFilter&&(i=s.combine(this._extraFilter,i)):i=this._extraFilter,!0===h?null===i&&""===r&&null===a?this._manualStat(e,t,n,l):u.resolve({calculated:!1}):this._parent._stat(e,t,r,a,i,n,l).then(function(s){return!1===s.calculated?null===i&&""===r&&null===a?o._manualStat(e,t,n,l):{calculated:!1}:s})},t.prototype._canDoAggregates=function(e,t,r,a,i){if(null===this._parent)return u.resolve(!1);for(var n=0;n<e.length;n++)for(var l=0,o=this.adaptedFields;l<o.length;l++){var h=o[l];if(e[n].toLowerCase()===h.field.name.toLowerCase()&&!(h instanceof c))return u.resolve(!1)}for(var d=[],n=0;n<t.length;n++){var p=t[n];if(null!==p.workingexpr){var f=this.reformulateWithoutAdaptions(p.workingexpr);if(f.cannot)return u.resolve(!1);var v=p.clone();v.workingexpr=f.where,d.push(v)}else d.push(p)}var g=this.reformulateWithoutAdaptions(i);return g.cannot?u.resolve(!1):(i=g.where,null!==i?null!==this._extraFilter&&(i=s.combine(this._extraFilter,i)):i=this._extraFilter,this._parent._canDoAggregates(e,d,r,a,i))},t.prototype._getAggregatePagesDataSourceDefinition=function(e,t,r,a,i,n,l){if(null===this._parent)return u.reject(new Error("Should never be called"));for(var o=[],h=0;h<t.length;h++){var d=t[h];if(null!==d.workingexpr){var p=this.reformulateWithoutAdaptions(d.workingexpr);if(p.cannot)return u.reject(new Error("Should never be called"));var c=d.clone();c.workingexpr=p.where,o.push(c)}else o.push(d)}var f=this.reformulateWithoutAdaptions(i);return f.cannot?u.reject(new Error("Should never be called")):(i=f.where,null!==i?null!==this._extraFilter&&(i=s.combine(this._extraFilter,i)):i=this._extraFilter,this._parent._getAggregatePagesDataSourceDefinition(e,o,r,a,i,n,l))},t}(n);t.AdaptedFeatureSet=S}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/actions/AttributeFilter.js": /*!*********************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/actions/AttributeFilter.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/tsSupport/extendsHelper */ "./node_modules/arcgis-js-api/core/tsSupport/extendsHelper.js"),__webpack_require__(/*! ../support/FeatureSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js"),__webpack_require__(/*! ../support/IdSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js"),__webpack_require__(/*! ../support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../support/sqlUtils */ "./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../../core/sql/WhereClause */ "./node_modules/arcgis-js-api/core/sql/WhereClause.js"),__webpack_require__(/*! ../../../geometry/SpatialReference */ "./node_modules/arcgis-js-api/geometry/SpatialReference.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,n,r,s,i,a,u,l,o){var c=function(e){function t(t){var n=e.call(this,t)||this;return n.declaredClass="esri.arcade.featureset.actions.AttributeFilter",n._maxProcessing=1e3,n._parent=t.parentfeatureset,t.whereclause instanceof l.WhereClause?(n._whereclause=t.whereclause,n._whereClauseFunction=null):(n._whereClauseFunction=t.whereclause,n._whereclause=null),n}return n(t,e),t.prototype._initialiseFeatureSet=function(){null!==this._parent?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.spatialReference=new o({wkid:4326}),this.geometryType=i.layerGeometryEsriConstants.point)},t.prototype._getSet=function(e){var t=this;return null===this._wset?this._ensureLoaded().then(function(){return t._parent._getFilteredSet("",null,t._whereclause,null,e)}).then(function(n){return t._checkCancelled(e),null!==t._whereClauseFunction?t._wset=new s(n._candidates.slice(0).concat(n._known.slice(0)),[],n._ordered,t._clonePageDefinition(n.pagesDefinition)):t._wset=new s(n._candidates.slice(0),n._known.slice(0),n._ordered,t._clonePageDefinition(n.pagesDefinition)),t._wset}):u.resolve(this._wset)},t.prototype._isInFeatureSet=function(e){var t=this._parent._isInFeatureSet(e);return t===i.IdState.NotInFeatureSet?t:(t=this._idstates[e],void 0===t?i.IdState.Unknown:t)},t.prototype._getFeature=function(e,t,n){return this._parent._getFeature(e,t,n)},t.prototype._getFeatures=function(e,t,n,r){return this._parent._getFeatures(e,t,n,r)},t.prototype._featureFromCache=function(e){return this._parent._featureFromCache(e)},t.prototype.executeWhereClause=function(e){return this._whereclause.testFeature(e)},t.prototype.executeWhereClauseDeferred=function(e){if(null!==this._whereClauseFunction)try{var t=this._whereClauseFunction(e);return u.isPromiseLike(t)?t:u.resolve(t)}catch(e){return u.reject(e)}return u.resolve(this.executeWhereClause(e))},t.prototype._fetchAndRefineFeatures=function(e,t,n){var r=this,a=new s([],e,!1,null),l=Math.min(t,e.length);return this._parent._getFeatures(a,-1,l,n).then(function(){if(r._checkCancelled(n),null==r._whereClauseFunction){for(var s=0;s<l;s++){var a=r._parent._featureFromCache(e[s]);!0===r.executeWhereClause(a)?r._idstates[e[s]]=i.IdState.InFeatureSet:r._idstates[e[s]]=i.IdState.NotInFeatureSet}return"success"}for(var o=[],s=0;s<l;s++){var a=r._parent._featureFromCache(e[s]);o.push(r.executeWhereClauseDeferred(a))}return u.all(o).then(function(n){for(var s=0;s<t;s++)!0===n[s]?r._idstates[e[s]]=i.IdState.InFeatureSet:r._idstates[e[s]]=i.IdState.NotInFeatureSet;return"success"})})},t.prototype._getFilteredSet=function(e,t,n,r,i){var u=this;return null!==this._whereClauseFunction||(null!==n?null!==this._whereclause&&(n=a.combine(this._whereclause,n)):n=this._whereclause),this._ensureLoaded().then(function(){return u._parent._getFilteredSet(e,t,n,r,i)}).then(function(e){u._checkCancelled(i);return null!==u._whereClauseFunction?new s(e._candidates.slice(0).concat(e._known.slice(0)),[],e._ordered,u._clonePageDefinition(e.pagesDefinition)):new s(e._candidates.slice(0),e._known.slice(0),e._ordered,u._clonePageDefinition(e.pagesDefinition))})},t.prototype._stat=function(e,t,n,r,s,i,l){var o=this;if(null!==this._whereClauseFunction)return null===s&&""===n&&null===r?this._manualStat(e,t,i,l):u.resolve({calculated:!1});var c=this._whereclause;return null!==s&&null!==this._whereclause&&(c=a.combine(this._whereclause,s)),this._parent._stat(e,t,n,r,c,i,l).then(function(a){return!1===a.calculated?null===s&&""===n&&null===r?o._manualStat(e,t,i,l):{calculated:!1}:a})},t.prototype._canDoAggregates=function(e,t,n,r,s){return null!==this._whereClauseFunction?u.resolve(!1):(null!==s?null!==this._whereclause&&(s=a.combine(this._whereclause,s)):s=this._whereclause,null===this._parent?u.resolve(!1):this._parent._canDoAggregates(e,t,n,r,s))},t.prototype._getAggregatePagesDataSourceDefinition=function(e,t,n,r,s,i,l){return null===this._parent?u.reject(new Error("Should never be called")):(null!==s?null!==this._whereclause&&(s=a.combine(this._whereclause,s)):s=this._whereclause,this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,s,i,l))},t}(r);return r._featuresetFunctions.filter=function(e){if("function"==typeof e)return new c({parentfeatureset:this,whereclause:e});var t=null;return e instanceof l.WhereClause&&(t=e),new c({parentfeatureset:this,whereclause:t})},c}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/actions/GroupBy.js": /*!*************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/actions/GroupBy.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/tsSupport/extendsHelper */ "./node_modules/arcgis-js-api/core/tsSupport/extendsHelper.js"),__webpack_require__(/*! ../../../Graphic */ "./node_modules/arcgis-js-api/Graphic.js"),__webpack_require__(/*! ../../languageUtils */ "./node_modules/arcgis-js-api/arcade/languageUtils.js"),__webpack_require__(/*! ./Adapted */ "./node_modules/arcgis-js-api/arcade/featureset/actions/Adapted.js"),__webpack_require__(/*! ./AttributeFilter */ "./node_modules/arcgis-js-api/arcade/featureset/actions/AttributeFilter.js"),__webpack_require__(/*! ./OrderBy */ "./node_modules/arcgis-js-api/arcade/featureset/actions/OrderBy.js"),__webpack_require__(/*! ../support/FeatureSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js"),__webpack_require__(/*! ../support/IdSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js"),__webpack_require__(/*! ../support/OrderbyClause */ "./node_modules/arcgis-js-api/arcade/featureset/support/OrderbyClause.js"),__webpack_require__(/*! ../support/sha */ "./node_modules/arcgis-js-api/arcade/featureset/support/sha.js"),__webpack_require__(/*! ../support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../support/sqlUtils */ "./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js"),__webpack_require__(/*! ../support/sqlUtils */ "./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js"),__webpack_require__(/*! ../support/stats */ "./node_modules/arcgis-js-api/arcade/featureset/support/stats.js"),__webpack_require__(/*! ../support/StatsField */ "./node_modules/arcgis-js-api/arcade/featureset/support/StatsField.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../../core/sql/WhereClause */ "./node_modules/arcgis-js-api/core/sql/WhereClause.js"),__webpack_require__(/*! ../../../geometry/SpatialReference */ "./node_modules/arcgis-js-api/geometry/SpatialReference.js"),__webpack_require__(/*! ../../../layers/support/Field */ "./node_modules/arcgis-js-api/layers/support/Field.js"),__webpack_require__(/*! ../../../layers/support/FieldsIndex */ "./node_modules/arcgis-js-api/layers/support/FieldsIndex.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,r,i,n,a,s,l,o,d,u,f,p,c,g,h,_,y,m,v,b,F){function w(e){if(!e)return"COUNT";switch(e.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}var S=function(e){function t(t){var r=e.call(this,t)||this;return r._decodedStatsfield=[],r._decodedGroupbyfield=[],r._candosimplegroupby=!0,r.phsyicalgroupbyfields=[],r.objectIdField="ROW__ID",r._internalObjectIdField="ROW__ID",r._adaptedFields=[],r.declaredClass="esri.arcade.featureset.actions.Aggregate",r._uniqueIds=1,r._maxQuery=10,r._maxProcessing=10,r._parent=t.parentfeatureset,r._config=t,r}return r(t,e),t.prototype.isTable=function(){return!0},t.prototype._getSet=function(e){var t=this;return null===this._wset?this._getFilteredSet("",null,null,null,e).then(function(e){return t._wset=e,t._wset}):y.resolve(this._wset)},t.prototype._isInFeatureSet=function(e){return p.IdState.InFeatureSet},t.prototype.nextUniqueName=function(e){for(;1===e["T"+this._uniqueIds.toString()];)this._uniqueIds++;var t="T"+this._uniqueIds.toString();return e[t]=1,t},t.prototype.convertToEsriFieldType=function(e){return e},t.prototype._initialiseFeatureSet=function(){var e={},t=!1,r=1,i=this._parent?this._parent.getFieldsIndex():new F([]);for(this.objectIdField="ROW__ID";!1===t;){for(var n=!1,s=0;s<this._config.groupbyfields.length;s++)if(this._config.groupbyfields[s].name.toLowerCase()===this.objectIdField.toLowerCase()){n=!0;break}if(!1===n)for(var s=0;s<this._config.statsfields.length;s++)if(this._config.statsfields[s].name.toLowerCase()===this.objectIdField.toLowerCase()){n=!0;break}!1===n?t=!0:(this.objectIdField="ROW__ID"+r.toString(),r++)}for(var l=0,o=this._config.statsfields;l<o.length;l++){var d=o[l],u=new _;u.field=d.name,u.tofieldname=d.name,u.workingexpr=d.expression instanceof m.WhereClause?d.expression:m.WhereClause.create(d.expression,i),u.typeofstat=w(d.statistic),this._decodedStatsfield.push(u)}this._decodedGroupbyfield=[];for(var f=0,h=this._config.groupbyfields;f<h.length;f++){var d=h[f],y={name:d.name,singlefield:null,tofieldname:d.name,expression:d.expression instanceof m.WhereClause?d.expression:m.WhereClause.create(d.expression,i)};this._decodedGroupbyfield.push(y)}if(null!==this._parent){this.geometryType=this._parent.geometryType,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField="";for(var S=0,I=this._parent.fields;S<I.length;S++){var d=I[S];e[d.name.toUpperCase()]=1}this.types=null}else this.geometryType=p.layerGeometryEsriConstants.point,this.typeIdField="",this.types=null,this.spatialReference=new v({wkid:4326});this.fields=[];var x=new _;x.field=this.nextUniqueName(e),x.tofieldname=this.objectIdField,x.workingexpr=m.WhereClause.create(this._parent.objectIdField,this._parent.getFieldsIndex()),x.typeofstat="MIN",this._decodedStatsfield.push(x);for(var D=0,k=this._decodedGroupbyfield;D<k.length;D++){var C=k[D],A=new b;if(C.name=this.nextUniqueName(e),A.name=C.tofieldname,A.alias=A.name,c.isSingleField(C.expression)){var T=this._parent.getField(g.toWhereClause(C.expression,p.FeatureServiceDatabaseType.Standardised));if(!T)throw new Error("Field is not present for Aggregation");C.name=T.name,C.singlefield=T.name,this.phsyicalgroupbyfields.push(T.name),A.type=T.type}else{A.type=this.convertToEsriFieldType(g.predictType(C.expression,this._parent.fields));var G=new b;G.name=C.name,G.alias=G.name,this.phsyicalgroupbyfields.push(C.name),this._adaptedFields.push(new a.SqlExpressionAdapted(G,C.expression)),this._candosimplegroupby=!1}this.fields.push(A)}if(this._adaptedFields.length>0)for(var W=0,O=this._parent.fields;W<O.length;W++){var d=O[W];this._adaptedFields.push(new a.OriginalField(d))}for(var s=0;s<this._decodedStatsfield.length;s++){var A=new b,T=null,C=this._decodedStatsfield[s];C.field=this.nextUniqueName(e),C.tofieldname===this.objectIdField&&(this._internalObjectIdField=C.field),A.name=C.tofieldname,A.alias=A.name;var j=null!==C.workingexpr&&c.isSingleField(C.workingexpr)?g.toWhereClause(C.workingexpr,p.FeatureServiceDatabaseType.Standardised):"";switch(this._decodedStatsfield[s].typeofstat){case"SUM":if(""!==j){if(!(T=this._parent.getField(j)))throw new Error("Field is not present for Aggregation");A.type=T.type}else A.type="double";break;case"MIN":case"MAX":if(""!==j){if(!(T=this._parent.getField(j)))throw new Error("Field is not present for Aggregation");A.type=T.type}else A.type="double";break;case"COUNT":A.type="integer";break;case"STDDEV":case"VAR":case"AVG":if(""!==j&&!(T=this._parent.getField(j)))throw new Error("Field is not present for Aggregation");A.type="double"}this.fields.push(A)}},t.prototype._canDoAggregates=function(e,t,r,i,n){return y.resolve(!1)},t.prototype._getFeatures=function(e,t,r,i){var n=this,a=[];-1!==t&&void 0===this._featureCache[t]&&a.push(t);var s=this._maxQuery;return!0===this._checkIfNeedToExpandKnownPage(e,s,i)?this._expandPagedSet(e,s,0,0,i).then(function(a){return n._getFeatures(e,t,r,i)}):y.resolve("success")},t.prototype._getFilteredSet=function(e,t,r,i,n){var o=this;if(""!==e)return y.resolve(new d([],[],!0,null));var f=null,p={ordered:!1,nowhereclause:!1};return this._ensureLoaded().then(function(){if(null!==r)for(var e=0;e<o._decodedStatsfield.length;e++)if(!0===c.scanForField(r,o._decodedStatsfield[e].tofieldname)){p.nowhereclause=!0,r=null;break}if(null!==i){p.ordered=!0;for(var e=0;e<o._decodedStatsfield.length;e++)if(!0===i.scanForField(o._decodedStatsfield[e].tofieldname)){i=null,p.ordered=!1;break}if(null!==i)for(var t=0,n=o._decodedGroupbyfield;t<n.length;t++){var a=n[t];if(null===a.singlefield&&!0===i.scanForField(a.tofieldname)){i=null,p.ordered=!1;break}}}return!1===o._candosimplegroupby?y.resolve(!1):o._parent._canDoAggregates(o.phsyicalgroupbyfields,o._decodedStatsfield,"",null,null)}).then(function(e){if(e){var t=null;r&&(t=o._reformulateWhereClauseWithoutGroupByFields(r));var c=null;return i&&(c=o._reformulateOrderClauseWithoutGroupByFields(i)),o._parent._getAggregatePagesDataSourceDefinition(o.phsyicalgroupbyfields,o._decodedStatsfield,"",null,t,c,o._internalObjectIdField).then(function(e){return o._checkCancelled(n),f=!0===p.nowhereclause?new d(e._candidates.slice(0).concat(e._known.slice(0)),[],!0===p.ordered&&e._ordered,o._clonePageDefinition(e.pagesDefinition)):new d(e._candidates.slice(0),e._known.slice(0),!0===p.ordered&&e._ordered,o._clonePageDefinition(e.pagesDefinition))})}var g=o._parent;if(o._adaptedFields.length>0&&(g=new a.AdaptedFeatureSet({parentfeatureset:o._parent,adaptedFields:o._adaptedFields,extraFilter:null})),!0===p.nowhereclause)f=new d(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:o._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new l({parentfeatureset:g,orderbyclause:new u(o.phsyicalgroupbyfields.join(",")+","+o._parent.objectIdField+" ASC")})}});else{var h=g;if(null!==r){var _=null;r&&(_=o._reformulateWhereClauseWithoutGroupByFields(r)),h=new s({parentfeatureset:h,whereclause:_})}f=new d(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:o._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new l({parentfeatureset:h,orderbyclause:new u(o.phsyicalgroupbyfields.join(",")+","+o._parent.objectIdField+" ASC")})}})}return f})},t.prototype._reformulateWhereClauseWithoutStatsFields=function(e){for(var t=0,r=this._decodedStatsfield;t<r.length;t++){var i=r[t];e=g.reformulateWithoutField(e,i.tofieldname,g.toWhereClause(i.workingexpr,p.FeatureServiceDatabaseType.Standardised),this._parent.getFieldsIndex())}return e},t.prototype._reformulateWhereClauseWithoutGroupByFields=function(e){for(var t=0,r=this._decodedGroupbyfield;t<r.length;t++){var i=r[t];i.tofieldname!==i.name&&(e=g.reformulateWithoutField(e,i.tofieldname,g.toWhereClause(i.expression,p.FeatureServiceDatabaseType.Standardised),this._parent.getFieldsIndex()))}return e},t.prototype._reformulateOrderClauseWithoutGroupByFields=function(e){for(var t=[],r=0,i=this._decodedGroupbyfield;r<i.length;r++){var n=i[r];n.tofieldname!==n.name&&t.push({field:n.tofieldname,newfield:n.name})}return t.length>0?e.replaceFields(t):e},t.prototype._clonePageDefinition=function(e){return null===e?null:!0===e.aggregatefeaturesetpagedefinition?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)},t.prototype._refineSetBlock=function(e,t,r){var i=this;try{if(!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQuery,r))return this._expandPagedSet(e,this._maxQuery,0,0,r).then(function(n){return i._refineSetBlock(e,t,r)});this._checkCancelled(r);var n=e._candidates.length;this._refineKnowns(e,t);e._candidates.length;return e._candidates.length,y.resolve(e)}catch(e){return y.reject(e)}},t.prototype._expandPagedSet=function(e,t,r,i,n){return this._expandPagedSetFeatureSet(e,t,r,i,n)},t.prototype._getPhysicalPage=function(e,t,r){var n=this;return!0===e.pagesDefinition.aggregatefeaturesetpagedefinition?y.create(function(t,i){n._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,r,[]).then(function(e){t(e)},i)}):this._getAgregagtePhysicalPage(e,t,r).then(function(e){for(var t=0,r=e;t<r.length;t++){for(var a=r[t],s={geometry:a.geometry,attributes:{}},l=0,o=n._decodedGroupbyfield;l<o.length;l++){var d=o[l];s.attributes[d.tofieldname]=a.attributes[d.name]}for(var u=0,f=n._decodedStatsfield;u<f.length;u++){var d=f[u];s.attributes[d.tofieldname]=a.attributes[d.field]}n._featureCache[s.attributes[n.objectIdField]]=new i(s)}return e.length})},t.prototype._sequentialGetPhysicalItem=function(e,t,r,i){var n=this;return y.create(function(a,s){null===e.pagesDefinition.internal.iterator&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(r)),!0===e.pagesDefinition.internal.fullyResolved?a(i.length):0===t?a(i.length):n._nextAggregateItem(e,t,r,i,function(s){null===s?a(i.length):(t-=1,a(n._sequentialGetPhysicalItem(e,t,r,i)))},s)})},t.prototype._nextAggregateItem=function(e,t,r,i,a,s){var l=this;try{n.tick(e.pagesDefinition.internal.iterator.next()).then(function(n){if(null===n)if(null!==e.pagesDefinition.internal.workingItem){var o=l._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);i.push(o),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(o.attributes[l.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,a(null)}else e.pagesDefinition.internal.fullyResolved=!0,a(null);else{var d=l._generateAggregateHash(n);if(null===e.pagesDefinition.internal.workingItem)e.pagesDefinition.internal.workingItem={features:[n],id:d};else{if(d!==e.pagesDefinition.internal.workingItem.id){var o=l._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return i.push(o),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(o.attributes[l.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:d},void a(o)}e.pagesDefinition.internal.workingItem.features.push(n)}l._nextAggregateItem(e,t,r,i,a,s)}},s)}catch(e){s(e)}},t.prototype._calculateFieldStat=function(e,t,r){for(var i=[],n=0;n<e.features.length;n++)if(null!==t.workingexpr){var a=t.workingexpr.calculateValue(e.features[n]);null!==a&&i.push(a)}else i.push(null);switch(t.typeofstat){case"MIN":r.attributes[t.tofieldname]=h.calculateStat("min",i,-1);break;case"MAX":r.attributes[t.tofieldname]=h.calculateStat("max",i,-1);break;case"SUM":r.attributes[t.tofieldname]=h.calculateStat("sum",i,-1);break;case"COUNT":r.attributes[t.tofieldname]=i.length;break;case"VAR":r.attributes[t.tofieldname]=h.calculateStat("var",i,-1);break;case"STDDEV":r.attributes[t.tofieldname]=h.calculateStat("stddev",i,-1);break;case"AVG":r.attributes[t.tofieldname]=h.calculateStat("avg",i,-1)}return!0},t.prototype._calculateAndAppendAggregateItem=function(e){for(var t={attributes:{},geometry:null},r=0,n=this._decodedGroupbyfield;r<n.length;r++){var a=n[r],s=a.singlefield?e.features[0].attributes[a.singlefield]:a.expression.calculateValue(e.features[0]);t.attributes[a.tofieldname]=s}for(var l=0,o=this._decodedStatsfield;l<o.length;l++){var d=o[l];this._calculateFieldStat(e,d,t)}for(var u=[],f=0;f<this._decodedStatsfield.length;f++)u.push(this._calculateFieldStat(e,this._decodedStatsfield[f],t));return this._featureCache[t.attributes[this.objectIdField]]=new i({attributes:t.attributes,geometry:t.geometry}),t},t.prototype._generateAggregateHash=function(e){for(var t="",r=0,i=this._decodedGroupbyfield;r<i.length;r++){var n=i[r],a=n.singlefield?e.attributes[n.singlefield]:n.expression.calculateValue(e);t+=null===a||void 0===a?":":":"+a.toString()}return new f(t,"TEXT").getHash("SHA-1","B64")},t.prototype._stat=function(e,t,r,i,n,a,s){return y.resolve({calculated:!1})},t.prototype.getFeatureByObjectId=function(e,t){return y.resolve(null)},t}(o);return o._featuresetFunctions.groupby=function(e,t){return new S({parentfeatureset:this,groupbyfields:e,statsfields:t})},S}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/actions/OrderBy.js": /*!*************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/actions/OrderBy.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/tsSupport/extendsHelper */ "./node_modules/arcgis-js-api/core/tsSupport/extendsHelper.js"),__webpack_require__(/*! ../../languageUtils */ "./node_modules/arcgis-js-api/arcade/languageUtils.js"),__webpack_require__(/*! ../support/FeatureSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js"),__webpack_require__(/*! ../support/IdSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js"),__webpack_require__(/*! ../support/OrderbyClause */ "./node_modules/arcgis-js-api/arcade/featureset/support/OrderbyClause.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,n,r,i,u,o,a){var s=function(e){function t(t){var n=e.call(this,t)||this;return n._orderbyclause=null,n.declaredClass="esri.arcade.featureset.actions.OrderBy",n._maxProcessing=100,n._orderbyclause=t.orderbyclause,n._parent=t.parentfeatureset,n}return n(t,e),t.prototype._getSet=function(e){var t=this;return null===this._wset?this._ensureLoaded().then(function(){return t._getFilteredSet("",null,null,t._orderbyclause,e)}).then(function(n){return t._checkCancelled(e),t._wset=n,t._wset}):a.resolve(this._wset)},t.prototype.manualOrderSet=function(e,t){var n=this;return this.getIdColumnDictionary(e,[],-1,t).then(function(e){n._orderbyclause.order(e);for(var t=new u([],[],!0,null),r=0;r<e.length;r++)t._known.push(e[r].id);return t})},t.prototype.getIdColumnDictionary=function(e,t,n,i){var u=this;if(n<e._known.length-1){var o=this._maxQueryRate();if("GETPAGES"===e._known[n+1])return r.tick(this._parent._expandPagedSet(e,o,0,0,i)).then(function(r){return u.getIdColumnDictionary(e,t,n,i)});for(var s=n+1,c=[];s<e._known.length&&"GETPAGES"!==e._known[s];)c.push(e._known[s]),s++;return n+=c.length,r.tick(this._parent._getFeatureBatch(c,i)).then(function(r){u._checkCancelled(i);for(var o=0,a=r;o<a.length;o++){var s=a[o];t.push({id:s.attributes[u.objectIdField],feature:s})}return u.getIdColumnDictionary(e,t,n,i)})}return e._candidates.length>0?r.tick(this._refineSetBlock(e,this._maxProcessingRate(),i)).then(function(){return u._checkCancelled(i),u.getIdColumnDictionary(e,t,n,i)}):a.resolve(t)},t.prototype._isInFeatureSet=function(e){return this._parent._isInFeatureSet(e)},t.prototype._getFeatures=function(e,t,n,r){return this._parent._getFeatures(e,t,n,r)},t.prototype._featureFromCache=function(e){if(void 0===this._featureCache[e]){var t=this._parent._featureFromCache(e);if(void 0===t)return;return null===t?null:(this._featureCache[e]=t,t)}return this._featureCache[e]},t.prototype._fetchAndRefineFeatures=function(e,t,n){return a.reject(new Error("Fetch and Refine should not be called in this featureset"))},t.prototype._getFilteredSet=function(e,t,n,r,i){var o=this;return this._ensureLoaded().then(function(){return o._parent._getFilteredSet(e,t,n,null===r?o._orderbyclause:r,i)}).then(function(e){o._checkCancelled(i);var r;r=new u(e._candidates.slice(0),e._known.slice(0),e._ordered,o._clonePageDefinition(e.pagesDefinition));var a=!0;return e._candidates.length>0&&(a=!1),!1===r._ordered?o.manualOrderSet(r,i).then(function(e){return!1===a&&(null===t&&null===n||(e=new u(e._candidates.slice(0).concat(e._known.slice(0)),[],e._ordered,o._clonePageDefinition(e.pagesDefinition)))),e}):r})},t}(i);return i._featuresetFunctions.orderBy=function(e){return""===e?this:new s({parentfeatureset:this,orderbyclause:new o(e)})},s}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/actions/SpatialFilter.js": /*!*******************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/actions/SpatialFilter.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/tsSupport/extendsHelper */ "./node_modules/arcgis-js-api/core/tsSupport/extendsHelper.js"),__webpack_require__(/*! ../sources/Empty */ "./node_modules/arcgis-js-api/arcade/featureset/sources/Empty.js"),__webpack_require__(/*! ../support/FeatureSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js"),__webpack_require__(/*! ../support/IdSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js"),__webpack_require__(/*! ../support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../../geometry/geometryEngineAsync */ "./node_modules/arcgis-js-api/geometry/geometryEngineAsync.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,n,r,i,a,o,s,l){var u=function(e){function t(t){var n=e.call(this,t)||this;return n._relation="",n._relationGeom=null,n._relationString="",n.declaredClass="esri.arcade.featureset.actions.SpatialFilter",n._relationString=t.relationString,n._parent=t.parentfeatureset,n._maxProcessing=40,n._relation=t.relation,n._relationGeom=t.relationGeom,n}return n(t,e),t.prototype._getSet=function(e){var t=this;return null===this._wset?this._ensureLoaded().then(function(){return t._parent._getFilteredSet("esriSpatialRelRelation"!==t._relation?t._relation:t._relation+":"+t._relationString,t._relationGeom,null,null,e)}).then(function(n){return t._checkCancelled(e),t._wset=new a(n._candidates.slice(0),n._known.slice(0),n._ordered,t._clonePageDefinition(n.pagesDefinition)),t._wset}):s.resolve(this._wset)},t.prototype._isInFeatureSet=function(e){var t=this._parent._isInFeatureSet(e);return t===o.IdState.NotInFeatureSet?t:(t=this._idstates[e],void 0===t?o.IdState.Unknown:t)},t.prototype._getFeature=function(e,t,n){return this._parent._getFeature(e,t,n)},t.prototype._getFeatures=function(e,t,n,r){return this._parent._getFeatures(e,t,n,r)},t.prototype._featureFromCache=function(e){return this._parent._featureFromCache(e)},t.prototype.executeSpatialRelationTest=function(e){if(null===e.geometry)return s.resolve(!1);switch(this._relation){case"esriSpatialRelEnvelopeIntersects":var t=o.shapeExtent(this._relationGeom),n=o.shapeExtent(e.geometry);return l.intersects(t,n);case"esriSpatialRelIntersects":return l.intersects(this._relationGeom,e.geometry);case"esriSpatialRelContains":return l.contains(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return l.overlaps(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return l.within(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return l.touches(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return l.crosses(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return l.relate(this._relationGeom,e.geometry,this._relationString)}},t.prototype._fetchAndRefineFeatures=function(e,t,n){var r=this,i=new a([],e,!1,null),l=Math.min(t,e.length);return this._parent._getFeatures(i,-1,l,n).then(function(){r._checkCancelled(n);for(var t=[],i=0;i<l;i++){var a=r._parent._featureFromCache(e[i]);t.push(r.executeSpatialRelationTest(a))}return s.all(t)}).then(function(n){for(var i=0;i<t;i++)!0===n[i]?r._idstates[e[i]]=o.IdState.InFeatureSet:r._idstates[e[i]]=o.IdState.NotInFeatureSet;return"success"})},t.prototype._getFilteredSet=function(e,t,n,r,i){var o=this;return this._ensureLoaded().then(function(){return o._parent._getFilteredSet("esriSpatialRelRelation"!==o._relation?o._relation:o._relation+":"+o._relationString,o._relationGeom,n,r,i)}).then(function(e){o._checkCancelled(i);return null!==t?new a(e._candidates.slice(0).concat(e._known.slice(0)),[],e._ordered,o._clonePageDefinition(e.pagesDefinition)):new a(e._candidates.slice(0),e._known.slice(0),e._ordered,o._clonePageDefinition(e.pagesDefinition))})},t.prototype._stat=function(e,t,n,r,i,a,o){var l=this;return""!==n?s.resolve({calculated:!1}):this._parent._stat(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,i,a,o).then(function(s){return!1===s.calculated?null===i&&""===n&&null===r?l._manualStat(e,t,a,o):{calculated:!1}:s})},t.prototype._canDoAggregates=function(e,t,n,r,i){return""!==n||null!==r?s.resolve(!1):null===this._parent?s.resolve(!1):this._parent._canDoAggregates(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,i)},t.prototype._getAggregatePagesDataSourceDefinition=function(e,t,n,r,i,a,o){return null===this._parent?s.reject(new Error("Should never be called")):this._parent._getAggregatePagesDataSourceDefinition(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,i,a,o)},t}(i);return i._featuresetFunctions.intersects=function(e){return null===e||void 0===e?new r({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelIntersects",relationGeom:e})},i._featuresetFunctions.envelopeIntersects=function(e){return null===e||void 0===e?new r({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelEnvelopeIntersects",relationGeom:e})},i._featuresetFunctions.contains=function(e){return null===e||void 0===e?new r({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelContains",relationGeom:e})},i._featuresetFunctions.overlaps=function(e){return null===e||void 0===e?new r({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelOverlaps",relationGeom:e})},i._featuresetFunctions.within=function(e){return null===e||void 0===e?new r({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelWithin",relationGeom:e})},i._featuresetFunctions.touches=function(e){return null===e||void 0===e?new r({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelTouches",relationGeom:e})},i._featuresetFunctions.crosses=function(e){return null===e||void 0===e?new r({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelCrosses",relationGeom:e})},i._featuresetFunctions.relate=function(e,t){return null===e||void 0===e?new r({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelRelation",relationGeom:e,relationString:t})},u}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/actions/Top.js": /*!*********************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/actions/Top.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/tsSupport/extendsHelper */ "./node_modules/arcgis-js-api/core/tsSupport/extendsHelper.js"),__webpack_require__(/*! ../support/FeatureSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js"),__webpack_require__(/*! ../support/IdSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js"),__webpack_require__(/*! ../support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(t,e,n,r,s,a,o){var i=function(t){function e(e){var n=t.call(this,e)||this;return n._topnum=0,n.declaredClass="esri.arcade.featureset.actions.Top",n._countedin=0,n._maxProcessing=100,n._topnum=e.topnum,n._parent=e.parentfeatureset,n}return n(e,t),e.prototype._getSet=function(t){var e=this;return null===this._wset?this._ensureLoaded().then(function(){return e._parent._getSet(t)}).then(function(t){return e._wset=new s(t._candidates.slice(0),t._known.slice(0),!1,e._clonePageDefinition(t.pagesDefinition)),e._setKnownLength(e._wset)>e._topnum&&(e._wset._known=e._wset._known.slice(0,e._topnum)),e._setKnownLength(e._wset)>=e._topnum&&(e._wset._candidates=[]),e._wset}):o.resolve(this._wset)},e.prototype._setKnownLength=function(t){return t._known.length>0&&"GETPAGES"===t._known[t._known.length-1]?t._known.length-1:t._known.length},e.prototype._isInFeatureSet=function(t){var e=this._parent._isInFeatureSet(t);if(e===a.IdState.NotInFeatureSet)return e;var n=this._idstates[t];return n===a.IdState.InFeatureSet||n===a.IdState.NotInFeatureSet?n:e===a.IdState.InFeatureSet&&void 0===n?this._countedin<this._topnum?(this._idstates[t]=a.IdState.InFeatureSet,this._countedin++,a.IdState.InFeatureSet):(this._idstates[t]=a.IdState.NotInFeatureSet,a.IdState.NotInFeatureSet):a.IdState.Unknown},e.prototype._expandPagedSet=function(t,e,n,r,s){var a=this;if(null===this._parent)return o.reject(new Error("Parent Paging not implemented"));if(e>this._topnum&&(e=this._topnum),this._countedin>=this._topnum&&t.pagesDefinition.internal.set.length<=t.pagesDefinition.resultOffset){var i=t._known.length;return i>0&&"GETPAGES"===t._known[i-1]&&(t._known.length=i-1),i=t._candidates.length,i>0&&"GETPAGES"===t._candidates[i-1]&&(t._candidates.length=i-1),o.resolve("success")}return this._parent._expandPagedSet(t,e,n,r,s).then(function(e){return a._setKnownLength(t)>a._topnum&&(t._known.length=a._topnum),a._setKnownLength(t)>=a._topnum&&(t._candidates.length=0),e})},e.prototype._getFeatures=function(t,e,n,r){var a=this,i=[],u=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(t,u,r))return this._expandPagedSet(t,u,0,0,r).then(function(s){return a._getFeatures(t,e,n,r)});-1!==e&&void 0===this._featureCache[e]&&i.push(e);for(var _=0,h=t._lastFetchedIndex;h<t._known.length&&(_++,_<=n&&(t._lastFetchedIndex+=1),!(void 0===this._featureCache[t._known[h]]&&(t._known[h]!==e&&i.push(t._known[h]),i.length>u-1)));h++);if(0===i.length)return o.resolve("success");var d=new s([],i,!1,null),p=Math.min(i.length,n);return this._parent._getFeatures(d,-1,p,r).then(function(t){for(var e=0;e<p;e++){var n=a._parent._featureFromCache(i[e]);void 0!==n&&(a._featureCache[i[e]]=n)}return"success"})},e.prototype._getFilteredSet=function(t,e,n,r,a){var o=this;return this._ensureLoaded().then(function(){return o._getSet(a)}).then(function(t){return new s(t._candidates.slice(0).concat(t._known.slice(0)),[],!1,o._clonePageDefinition(t.pagesDefinition))})},e.prototype._refineKnowns=function(t,e){for(var n=0,r=null,s=[],o=0;o<t._candidates.length;o++){var i=this._isInFeatureSet(t._candidates[o]);if(i===a.IdState.InFeatureSet){if(t._known.push(t._candidates[o]),n+=1,null===r?r={start:o,end:o}:r.end===o-1?r.end=o:(s.push(r),r={start:o,end:o}),t._known.length>=this._topnum)break}else if(i===a.IdState.NotInFeatureSet)null===r?r={start:o,end:o}:r.end===o-1?r.end=o:(s.push(r),r={start:o,end:o}),n+=1;else if(i===a.IdState.Unknown)break;if(n>=e)break}null!==r&&s.push(r);for(var u=s.length-1;u>=0;u--)t._candidates.splice(s[u].start,s[u].end-s[u].start+1);this._setKnownLength(t)>this._topnum&&(t._known=t._known.slice(0,this._topnum)),this._setKnownLength(t)>=this._topnum&&(t._candidates=[])},e.prototype._stat=function(t,e,n,r,s,a,i){return o.resolve({calculated:!1})},e.prototype._canDoAggregates=function(t,e,n,r,s){return o.resolve(!1)},e}(r);return r._featuresetFunctions.top=function(t){return new i({parentfeatureset:this,topnum:t})},i}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/sources/Empty.js": /*!***********************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/sources/Empty.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/tsSupport/extendsHelper */ "./node_modules/arcgis-js-api/core/tsSupport/extendsHelper.js"),__webpack_require__(/*! ../support/FeatureSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js"),__webpack_require__(/*! ../support/IdSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js"),__webpack_require__(/*! ../support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,r,n,o,u,s){return function(e){function t(t){var r=e.call(this,t)||this;return r.declaredClass="esri.layers.featureset.sources.Empty",r._maxProcessing=1e3,r._wset=new o([],[],!1,null),r._parent=t.parentfeatureset,r._databaseType=u.FeatureServiceDatabaseType.Standardised,r}return r(t,e),t.prototype._getSet=function(e){return s.resolve(this._wset)},t.prototype.optimisePagingFeatureQueries=function(e){},t.prototype._isInFeatureSet=function(e){return u.IdState.NotInFeatureSet},t.prototype._getFeature=function(e,t){return s.reject(new Error("No Feature Found in EmptySet"))},t.prototype.queryAttachments=function(e,t,r,n){return s.resolve([])},t.prototype._getFeatures=function(e,t,r,n){return s.resolve("success")},t.prototype._featureFromCache=function(e){return null},t.prototype._fetchAndRefineFeatures=function(e,t,r){return s.reject(new Error("Fetch and Refine should not be called in this featureset"))},t.prototype._getFilteredSet=function(e,t,r,n,u){return s.resolve(new o([],[],!1,null))},t.prototype._stat=function(e,t,r,n,o,u,s){return this._manualStat(e,t,u,s)},t.prototype._canDoAggregates=function(e,t,r,n,o){return s.resolve(!1)},t}(n)}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerDynamic.js": /*!*************************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerDynamic.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/tsSupport/extendsHelper */ "./node_modules/arcgis-js-api/core/tsSupport/extendsHelper.js"),__webpack_require__(/*! ../../../Graphic */ "./node_modules/arcgis-js-api/Graphic.js"),__webpack_require__(/*! ../../../request */ "./node_modules/arcgis-js-api/request.js"),__webpack_require__(/*! ../../Attachment */ "./node_modules/arcgis-js-api/arcade/Attachment.js"),__webpack_require__(/*! ../support/FeatureSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js"),__webpack_require__(/*! ../support/IdSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js"),__webpack_require__(/*! ../support/sha */ "./node_modules/arcgis-js-api/arcade/featureset/support/sha.js"),__webpack_require__(/*! ../support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../support/sqlUtils */ "./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js"),__webpack_require__(/*! ../support/sqlUtils */ "./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js"),__webpack_require__(/*! ../support/stats */ "./node_modules/arcgis-js-api/arcade/featureset/support/stats.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../../geometry/support/jsonUtils */ "./node_modules/arcgis-js-api/geometry/support/jsonUtils.js"),__webpack_require__(/*! ../../../layers/FeatureLayer */ "./node_modules/arcgis-js-api/layers/FeatureLayer.js"),__webpack_require__(/*! ../../../layers/graphics/featureConversionUtils */ "./node_modules/arcgis-js-api/layers/graphics/featureConversionUtils.js"),__webpack_require__(/*! ../../../tasks/QueryTask */ "./node_modules/arcgis-js-api/tasks/QueryTask.js"),__webpack_require__(/*! ../../../tasks/operations/query */ "./node_modules/arcgis-js-api/tasks/operations/query.js"),__webpack_require__(/*! ../../../tasks/support/FeatureSet */ "./node_modules/arcgis-js-api/tasks/support/FeatureSet.js"),__webpack_require__(/*! ../../../tasks/support/Query */ "./node_modules/arcgis-js-api/tasks/support/Query.js"),__webpack_require__(/*! ../../../tasks/support/StatisticDefinition */ "./node_modules/arcgis-js-api/tasks/support/StatisticDefinition.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,r,i,a,n,s,l,o,u,d,p,c,y,h,f,_,g,m,v,F,S){return function(e){function t(t){var r=e.call(this,t)||this;return r.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",r._removeGeometry=!1,r._overrideFields=null,r.formulaCredential=null,r._pageJustIds=!1,r._requestStandardised=!1,t.spatialReference&&(r.spatialReference=t.spatialReference),r._transparent=!0,r._maxProcessing=1e3,r._layer=t.layer,r._wset=null,void 0!==t.outFields&&(r._overrideFields=t.outFields),void 0!==t.includeGeometry&&(r._removeGeometry=!1===t.includeGeometry),r}return r(t,e),t.prototype._maxQueryRate=function(){return u.defaultMaxRecords},t.prototype.end=function(){return this._layer},t.prototype.optimisePagingFeatureQueries=function(e){this._pageJustIds=e},t.prototype.convertQueryToLruCacheKey=function(e){var t=u.stableStringify(e.toJSON());return new o(t,"TEXT").getHash("SHA-1","B64")},t.prototype.load=function(){var e=this;return null===this._loadPromise&&(this._loadPromise=y.create(function(t,r){try{if(!0===e._layer.loaded)return e._initialiseFeatureSet(),void t(e);e._layer.when().then(function(){try{e._initialiseFeatureSet(),t(e)}catch(e){r(e)}},r),e._layer.load()}catch(e){r(e)}})),this._loadPromise},t.prototype._initialiseFeatureSet=function(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._layer.outFields)if(1===this._layer.outFields.length&&"*"===this._layer.outFields[0]);else{for(var e=[],t=0,r=this.fields;t<r.length;t++){var i=r[t];if("oid"===i.type)e.push(i);else for(var a=0,n=this._layer.outFields;a<n.length;a++){var s=n[a];if(s.toLowerCase()===i.name.toLowerCase()){e.push(i);break}}}this.fields=e}else;if(null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{for(var e=[],l=[],o=0,d=this.fields;o<d.length;o++){var i=d[o];if("oid"===i.type)e.push(i),l.push(i.name);else for(var p=0,c=this._overrideFields;p<c.length;p++){var s=c[p];if(s.toLowerCase()===i.name.toLowerCase()){e.push(i),l.push(i.name);break}}}this.fields=e,this._overrideFields=l}if(this._layer.source&&this._layer.source.sourceJSON){var y=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=u.FeatureServiceDatabaseType.StandardisedNoInterval,void 0!==y&&null!==y&&y>=10.61&&(this._databaseType=u.FeatureServiceDatabaseType.Standardised)):void 0!==y&&null!==y&&(y>=10.5&&(this._databaseType=u.FeatureServiceDatabaseType.StandardisedNoInterval,this._requestStandardised=!0),y>=10.61&&(this._databaseType=u.FeatureServiceDatabaseType.Standardised))}this.objectIdField=this._layer.objectIdField,this.hasM=this._layer.supportsM,this.hasZ=this._layer.supportsZ,this.typeIdField=this._layer.typeIdField,this.types=this._layer.types},t.prototype._isInFeatureSet=function(){return u.IdState.InFeatureSet},t.prototype._refineSetBlock=function(e){return y.resolve(e)},t.prototype._candidateIdTransform=function(e){return e},t.prototype._transformSetWithIdChanges=function(){},t.prototype._getSet=function(e){var t=this;return null===this._wset?this._ensureLoaded().then(function(){return t._getFilteredSet("",null,null,null,e)}).then(function(e){return t._wset=e,e}):y.resolve(this._wset)},t.prototype._runDatabaseProbe=function(e){var t=this;return y.create(function(r,i){try{t._ensureLoaded().then(function(){try{var a=new F;a.where=e.replace("OBJECTID",t._layer.objectIdField),t._layer.queryObjectIds(a).then(function(){r(!0)},function(e){try{r(!1)}catch(e){i(e)}})}catch(e){i(e)}})}catch(e){i(e)}})},t.prototype._canUsePagination=function(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)},t.prototype._cacheableFeatureSetSourceKey=function(){return this._layer.url},t.prototype.pbfSupportedForQuery=function(e){return!e.outStatistics&&this._layer&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsFormatPBF&&!0===this._layer.capabilities.query.supportsQuantizationEditMode},t.prototype.queryPBF=function(e,t){return e.quantizationParameters={mode:"edit"},m.executeQueryPBF(this._layer.parsedUrl,e,{type:"optimized"}).then(function(e){return v.fromJSON(_.convertToFeatureSet(e.data)).unquantize()})},t.prototype.nativeCapabilities=function(){return{title:this._layer.title,source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}},t.prototype.executeQuery=function(e,t){var r=this,i=new g({url:this._layer.parsedUrl.path}),a="execute"===t&&this.pbfSupportedForQuery(e),n=null;if(this.recentlyUsedQueries){var s=this.convertQueryToLruCacheKey(e);n=this.recentlyUsedQueries.getFromCache(s),null===n&&(n=!0!==a?i[t](e):this.queryPBF(e,i),this.recentlyUsedQueries.addToCache(s,n),n=n.catch(function(e){throw r.recentlyUsedQueries.removeFromCache(s),e}))}return null===n&&(n=!0!==a?i[t](e):this.queryPBF(e,i)),n},t.prototype._getFilteredSet=function(e,t,r,i,a){var n=this;return this.databaseType().then(function(s){if(n.isTable()&&t&&null!==e&&""!==e){return new l([],[],!0,null)}if(n._canUsePagination())return n._getFilteredSetUsingPaging(e,t,r,i,a);var o="",u=!1;null!==i&&n._layer.capabilities&&n._layer.capabilities.query&&!0===n._layer.capabilities.query.supportsOrderBy&&(o=i.constructClause(),u=!0);var p=new F;return p.where=null===r?null===t?"1=1":"":d.toWhereClause(r,s),n._requestStandardised&&(p.sqlFormat="standard"),p.spatialRelationship=n._makeRelationshipEnum(e),p.outSpatialReference=n.spatialReference,p.orderByFields=""!==o?o.split(","):null,p.geometry=null===t?null:t,p.relationParameter=n._makeRelationshipParam(e),n.executeQuery(p,"executeForIds").then(function(e){return null===e&&(e=[]),n._checkCancelled(a),new l([],e,u,null)})})},t.prototype._expandPagedSet=function(e,t,r,i,a){return this._expandPagedSetFeatureSet(e,t,r,i,a)},t.prototype._getFilteredSetUsingPaging=function(e,t,r,i,a){var n=this;try{var s="",o=!1;return null!==i&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(s=i.constructClause(),o=!0),this.databaseType().then(function(i){var u=null===r?null===t?"1=1":"":d.toWhereClause(r,i);n._layer.definitionExpression&&(u=""!==u?"(("+n._layer.definitionExpression+") AND ("+u+"))":n._layer.definitionExpression);var p=n._maxQueryRate(),c=n._layer.capabilities.query.maxRecordCount;void 0!==c&&c<p&&(p=c);var y=null;if(!0===n._pageJustIds)y=new l([],["GETPAGES"],o,{spatialRel:n._makeRelationshipEnum(e),relationParam:n._makeRelationshipParam(e),outFields:n._layer.objectIdField,resultRecordCount:p,resultOffset:0,geometry:null===t?null:t,where:u,orderByFields:s,returnGeometry:!1,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,fullyResolved:!1}});else{var h=!0;!0===n._removeGeometry&&(h=!1);var f=null!==n._overrideFields?n._overrideFields:n._fieldsIncludingObjectId(n._layer.outFields?n._layer.outFields:["*"]);y=new l([],["GETPAGES"],o,{spatialRel:n._makeRelationshipEnum(e),relationParam:n._makeRelationshipParam(e),outFields:f.join(","),resultRecordCount:p,resultOffset:0,geometry:null===t?null:t,where:u,orderByFields:s,returnGeometry:h,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,fullyResolved:!1}})}return n._expandPagedSet(y,p,0,1,a).then(function(){return y})})}catch(e){return y.reject(e)}},t.prototype._clonePageDefinition=function(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}},t.prototype._getPhysicalPage=function(e,t,r){var i=this;try{var a=e.pagesDefinition.internal.lastRetrieved,n=a,s=new F;return this._requestStandardised&&(s.sqlFormat="standard"),s.spatialRelationship=e.pagesDefinition.spatialRel,s.relationParameter=e.pagesDefinition.relationParam,s.outFields=e.pagesDefinition.outFields.split(","),s.num=e.pagesDefinition.resultRecordCount,s.start=e.pagesDefinition.internal.lastRetrieved,s.geometry=e.pagesDefinition.geometry,s.where=e.pagesDefinition.where,s.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,s.returnGeometry=e.pagesDefinition.returnGeometry,s.outSpatialReference=this.spatialReference,this.executeQuery(s,"execute").then(function(t){if(i._checkCancelled(r),e.pagesDefinition.internal.lastRetrieved!==a)return"done";for(var s=0;s<t.features.length;s++)e.pagesDefinition.internal.set[n+s]=t.features[s].attributes[i._layer.objectIdField];if(!1===i._pageJustIds)for(var s=0;s<t.features.length;s++)i._featureCache[t.features[s].attributes[i._layer.objectIdField]]=t.features[s];return t.features.length!==e.pagesDefinition.resultRecordCount&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=a+e.pagesDefinition.resultRecordCount,"done"})}catch(e){return y.reject(e)}},t.prototype._fieldsIncludingObjectId=function(e){if(null===e)return[this.objectIdField];var t=e.slice(0);if(t.indexOf("*")>-1)return t;for(var r=!1,i=0,a=t;i<a.length;i++){if(a[i].toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}}return!1===r&&t.push(this.objectIdField),t},t.prototype._getFeatures=function(e,t,r,i){var a=this,n=[];try{if(-1!==t&&void 0===this._featureCache[t]&&n.push(t),!0===this._checkIfNeedToExpandKnownPage(e,this._maxProcessingRate(),i))return this._expandPagedSet(e,this._maxProcessingRate(),0,0,i).then(function(){return a._getFeatures(e,t,r,i)});for(var s=0,l=e._lastFetchedIndex;l<e._known.length;l++){if(e._lastFetchedIndex+=1,s++,void 0===this._featureCache[e._known[l]]){var o=!1;if(null!==this._layer._mode&&void 0!==this._layer._mode){var u=this._layer._mode;if(void 0!==u._featureMap[e._known[l]]){var d=u._featureMap[e._known[l]];null!==d&&(o=!0,this._featureCache[e._known[l]]=d)}}if(!1===o&&(e._known[l]!==t&&n.push(e._known[l]),n.length>=this._maxProcessingRate()-1))break}if(s>=r&&0===n.length)break}if(0===n.length)return y.resolve("success");try{var p=new F;return this._requestStandardised&&(p.sqlFormat="standard"),p.objectIds=n,p.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._layer.outFields?this._layer.outFields:["*"]),p.returnGeometry=!0,!0===this._removeGeometry&&(p.returnGeometry=!1),p.outSpatialReference=this.spatialReference,this.executeQuery(p,"execute").then(function(e){if(a._checkCancelled(i),void 0!==e.error)return y.reject(new Error(e.error));for(var t=0;t<e.features.length;t++)a._featureCache[e.features[t].attributes[a._layer.objectIdField]]=e.features[t];return"success"})}catch(e){return y.reject(e)}}catch(e){return y.reject(e)}},t.prototype._getDistinctPages=function(e,t,r,i,a,n,s,l,o){var u=this;return this._ensureLoaded().then(function(){return u.databaseType()}).then(function(p){for(var c=r.parseTree.column,h=0;h<u._layer.fields.length;h++)if(u._layer.fields[h].name.toLowerCase()===c.toLowerCase()){c=u._layer.fields[h].name;break}var f=new F;u._requestStandardised&&(f.sqlFormat="standard");var _=null===n?null===a?"1=1":"":d.toWhereClause(n,p);return u._layer.definitionExpression&&(_=""!==_?"(("+u._layer.definitionExpression+") AND ("+_+"))":u._layer.definitionExpression),f.where=_,f.spatialRelationship=u._makeRelationshipEnum(i),f.relationParameter=u._makeRelationshipParam(i),f.geometry=null===a?null:a,f.returnDistinctValues=!0,f.returnGeometry=!1,f.outFields=[c],u.executeQuery(f,"execute").then(function(d){if(u._checkCancelled(o),!d.hasOwnProperty("features"))return y.reject(new Error("Unnexected Result querying statistics from layer"));for(var p=!1,h=0;h<u._layer.fields.length;h++)if(u._layer.fields[h].name===c){"date"===u._layer.fields[h].type&&(p=!0);break}for(var h=0;h<d.features.length;h++){if(p){var f=d.features[h].attributes[c];null!==f?l.push(new Date(f)):l.push(f)}else l.push(d.features[h].attributes[c]);if(l.length>=s)break}return 0===d.features.length?l:d.features.length===u._layer.capabilities.query.maxRecordCount&&l.length<s?u._getDistinctPages(e+d.features.length,t,r,i,a,n,s,l,o).then(function(e){return{calculated:!0,result:e}}):l})})},t.prototype._distinctStat=function(e,t,r,i,a,n,s){return this._getDistinctPages(0,e,t,r,i,a,n,[],s).then(function(e){return{calculated:!0,result:e}})},t.prototype.isTable=function(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType},t.prototype._countstat=function(e,t,r,i,a){var n=this;return this.databaseType().then(function(e){var a=new F;if(n._requestStandardised&&(a.sqlFormat="standard"),n.isTable()&&r&&null!==t&&""!==t)return{calculated:!0,result:0};var s=null===i?null===r?"1=1":"":d.toWhereClause(i,e);return n._layer.definitionExpression&&(s=""!==s?"(("+n._layer.definitionExpression+") AND ("+s+"))":n._layer.definitionExpression),a.where=s,a.where=s,a.spatialRelationship=n._makeRelationshipEnum(t),a.relationParameter=n._makeRelationshipParam(t),a.geometry=null===r?null:r,a.returnGeometry=!1,n.executeQuery(a,"executeForCount").then(function(e){return{calculated:!0,result:e}})})},t.prototype._stats=function(e,t,r,i,a,n,s){var l=this;return this._ensureLoaded().then(function(){var o=l._layer.capabilities&&l._layer.capabilities.query&&!0===l._layer.capabilities.query.supportsSqlExpression,u=l._layer.capabilities&&l._layer.capabilities.query&&!0===l._layer.capabilities.query.supportsStatistics,h=l._layer.capabilities&&l._layer.capabilities.query&&!0===l._layer.capabilities.query.supportsDistinct;return"count"===e?h?l._countstat(e,r,i,a,s):{calculated:!1}:!1===u||!1===p.isSingleField(t)&&!1===o||!1===t.isStandardized?""!==r||null!==a?{calculated:!1}:l._manualStat(e,t,n,s):"distinct"===e?!1===h?""!==r||null!==a?{calculated:!1}:l._manualStat(e,t,n,s):l._distinctStat(e,t,r,i,a,n,s):l.databaseType().then(function(n){if(l.isTable()&&i&&null!==r&&""!==r)return{calculated:!0,result:null};var s=new F;l._requestStandardised&&(s.sqlFormat="standard");var o=null===a?null===i?"1=1":"":d.toWhereClause(a,n);l._layer.definitionExpression&&(o=""!==o?"(("+l._layer.definitionExpression+") AND ("+o+"))":l._layer.definitionExpression),s.where=o,s.spatialRelationship=l._makeRelationshipEnum(r),s.relationParameter=l._makeRelationshipParam(r),s.geometry=null===i?null:i;var u=new S;u.statisticType=c.decodeStatType(e),u.onStatisticField=d.toWhereClause(t,n),u.outStatisticFieldName="ARCADE_STAT_RESULT",s.returnGeometry=!1;var p="ARCADE_STAT_RESULT";return s.outStatistics=[u],l.executeQuery(s,"execute").then(function(e){if(!e.hasOwnProperty("features")||0===e.features.length)return y.reject(new Error("Unnexected Result querying statistics from layer"));for(var t=!1,r=0;r<e.fields.length;r++)if("ARCADE_STAT_RESULT"===e.fields[r].name.toUpperCase()){p=e.fields[r].name,"date"===e.fields[r].type&&(t=!0);break}if(t){var i=e.features[0].attributes[p];return null!==i&&(i=new Date(e.features[0].attributes[p])),{calculated:!0,result:i}}return{calculated:!0,result:e.features[0].attributes[p]}})})})},t.prototype._stat=function(e,t,r,i,a,n,s){return this._stats(e,t,r,i,a,n,s)},t.prototype._canDoAggregates=function(e,t,r,i,a){var n=this;return this._ensureLoaded().then(function(){var e=!1,r=n._layer.capabilities&&n._layer.capabilities.query&&!0===n._layer.capabilities.query.supportsSqlExpression;if(void 0!==n._layer.capabilities&&null!==n._layer.capabilities.query&&!0===n._layer.capabilities.query.supportsStatistics&&!0===n._layer.capabilities.query.supportsOrderBy&&(e=!0),e)for(var i=0;i<t.length-1;i++)null!==t[i].workingexpr&&(!1===t[i].workingexpr.isStandardized?e=!1:!1===p.isSingleField(t[i].workingexpr)&&!1===r&&(e=!1));return!1!==e})},t.prototype._makeRelationshipEnum=function(e){if(e.indexOf("esriSpatialRelRelation")>=0)return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e},t.prototype._makeRelationshipParam=function(e){return e.indexOf("esriSpatialRelRelation")>=0?e.split(":")[1]:""},t.prototype._getAggregatePagesDataSourceDefinition=function(e,t,r,i,a,n,s){var o=this;return this._ensureLoaded().then(function(){return o.databaseType()}).then(function(u){var p="",c=!1,y=!1;null!==n&&o._layer.capabilities&&o._layer.capabilities.query&&!0===o._layer.capabilities.query.supportsOrderBy&&(p=n.constructClause(),y=!0),o._layer.capabilities&&o._layer.capabilities.query&&!1===o._layer.capabilities.query.supportsPagination&&(y=!1,c=!0,p=o._layer.objectIdField);for(var h=[],f=0;f<t.length;f++){var _=new S;_.onStatisticField=null!==t[f].workingexpr?d.toWhereClause(t[f].workingexpr,u):"",_.outStatisticFieldName=t[f].field,_.statisticType=t[f].toStatisticsName(),h.push(_)}""===p&&(p=e.join(","));var g=o._maxQueryRate(),m=o._layer.capabilities.query.maxRecordCount;void 0!==m&&m<g&&(g=m);var v=null===a?null===i?"1=1":"":d.toWhereClause(a,u);return o._layer.definitionExpression&&(v=""!==v?"(("+o._layer.definitionExpression+") AND ("+v+"))":o._layer.definitionExpression),new l([],["GETPAGES"],y,{groupbypage:!0,spatialRel:o._makeRelationshipEnum(r),relationParam:o._makeRelationshipParam(r),outFields:["*"],useOIDpagination:c,generatedOid:s,resultRecordCount:g,resultOffset:0,groupByFieldsForStatistics:e,outStatistics:h,geometry:null===i?null:i,where:v,orderByFields:p,returnGeometry:!1,returnIdsOnly:!1,internal:{lastMaxId:-1,set:[],lastRetrieved:0,fullyResolved:!1}})})},t.prototype._getAgregagtePhysicalPage=function(e,t,r){var a=this;try{var n=e.pagesDefinition.where;!0===e.pagesDefinition.useOIDpagination&&(n=""!==n?"("+n+") AND ("+e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString()+")":e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString());var s=e.pagesDefinition.internal.lastRetrieved,l=s,o=new F;return this._requestStandardised&&(o.sqlFormat="standard"),o.where=n,o.spatialRelationship=e.pagesDefinition.spatialRel,o.relationParameter=e.pagesDefinition.relationParam,o.outFields=e.pagesDefinition.outFields,o.outStatistics=e.pagesDefinition.outStatistics,o.geometry=e.pagesDefinition.geometry,o.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,o.num=e.pagesDefinition.resultRecordCount,o.start=e.pagesDefinition.internal.lastRetrieved,o.returnGeometry=e.pagesDefinition.returnGeometry,o.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&o.geometry&&o.spatialRelationship?y.resolve([]):this.executeQuery(o,"execute").then(function(t){if(a._checkCancelled(r),!t.hasOwnProperty("features"))return y.reject(new Error("Unnexected Result querying aggregates from layer"));var n=[];if(e.pagesDefinition.internal.lastRetrieved!==s)return[];for(var o=0;o<t.features.length;o++)e.pagesDefinition.internal.set[l+o]=t.features[o].attributes[e.pagesDefinition.generatedOid];for(var o=0;o<t.features.length;o++)n.push(new i({attributes:t.features[o].attributes,geometry:null}));return!0===e.pagesDefinition.useOIDpagination?0===t.features.length?e.pagesDefinition.internal.fullyResolved=!0:e.pagesDefinition.internal.lastMaxId=t.features[t.features.length-1].attributes[e.pagesDefinition.generatedOid]:t.features.length!==e.pagesDefinition.resultRecordCount&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=s+e.pagesDefinition.resultRecordCount,n})}catch(e){return y.reject(e)}},t.create=function(e,r,i,a){return new t({layer:new f({url:e,outFields:null===r?["*"]:r}),spatialReference:i,lrucache:a})},t.prototype.relationshipMetaData=function(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON&&this._layer.source.sourceJSON.relationships?this._layer.source.sourceJSON.relationships:[]},t.prototype.serviceUrl=function(){return u.extractServiceUrl(this._layer.parsedUrl.path)},t.prototype.queryAttachments=function(e,t,r,i){var a=this;if(this._layer.capabilities.data.supportsAttachment&&this._layer.capabilities.operations.supportsQueryAttachments){var s={objectIds:[e]};return(t&&t>0||r&&r>0)&&(s.size=[t&&t>0?t:0,r&&r>0?r:t+1]),i&&i.length>0&&(s.attachmentTypes=i),this._layer.queryAttachments(s).then(function(t){var r=[];return t&&t[e]&&t[e].forEach(function(t){var i=a._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+t.id.toString();r.push(new n(t.id,t.name,t.contentType,t.size,i))}),r})}return y.resolve([])},t.prototype.queryRelatedFeatures=function(e){var t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields.join(","),returnGeometry:e.returnGeometry.toString()};return void 0!==e.resultOffset&&null!==e.resultOffset&&(t.resultOffset=e.resultOffset.toString()),void 0!==e.resultRecordCount&&null!==e.resultRecordCount&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=JSON.stringify(e.outSpatialReference.toJSON())),a(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t}).then(function(e){if(e.data){var t={},r=e.data;if(r&&r.relatedRecordGroups)for(var a=r.spatialReference,n=0,s=r.relatedRecordGroups;n<s.length;n++){for(var l=s[n],o=l.objectId,u=[],d=0,p=l.relatedRecords;d<p.length;d++){var c=p[d];c.geometry&&(c.geometry.spatialReference=a);var f=new i({geometry:c.geometry?h.fromJSON(c.geometry):null,attributes:c.attributes});u.push(f)}t[o]={features:u,exceededTransferLimit:!0===r.exceededTransferLimit}}return t}return y.reject("Invalid Request")})},t.prototype.getFeatureByObjectId=function(e,t){var r=new g({url:this._layer.parsedUrl.path}),i=new F;return i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=this.objectIdField+"="+e.toString(),r.execute(i).then(function(e){return 1===e.features.length?e.features[0]:null})},t}(s)}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerMemory.js": /*!************************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerMemory.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/tsSupport/extendsHelper */ "./node_modules/arcgis-js-api/core/tsSupport/extendsHelper.js"),__webpack_require__(/*! ../../../Graphic */ "./node_modules/arcgis-js-api/Graphic.js"),__webpack_require__(/*! ../support/FeatureSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js"),__webpack_require__(/*! ../support/IdSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js"),__webpack_require__(/*! ../support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../support/sqlUtils */ "./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../../geometry/Geometry */ "./node_modules/arcgis-js-api/geometry/Geometry.js"),__webpack_require__(/*! ../../../layers/FeatureLayer */ "./node_modules/arcgis-js-api/layers/FeatureLayer.js"),__webpack_require__(/*! ../../../layers/support/Field */ "./node_modules/arcgis-js-api/layers/support/Field.js"),__webpack_require__(/*! ../../../tasks/support/Query */ "./node_modules/arcgis-js-api/tasks/support/Query.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,r,i,a,s,n,o,l,u,p,c,h){return function(e){function t(t){var r=e.call(this,t)||this;return r.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",r._removeGeometry=!1,r._overrideFields=null,r._forceIsTable=!1,t.spatialReference&&(r.spatialReference=t.spatialReference),r._transparent=!0,r._maxProcessing=1e3,r._layer=t.layer,r._wset=null,!0===t.isTable&&(r._forceIsTable=!0),void 0!==t.outFields&&(r._overrideFields=t.outFields),void 0!==t.includeGeometry&&(r._removeGeometry=!1===t.includeGeometry),r}return r(t,e),t.prototype._maxQueryRate=function(){return n.defaultMaxRecords},t.prototype.end=function(){return this._layer},t.prototype.optimisePagingFeatureQueries=function(e){},t.prototype.load=function(){var e=this;return null===this._loadPromise&&(this._loadPromise=l.create(function(t,r){if(!0===e._layer.loaded)return e._initialiseFeatureSet(),void t(e);e._layer.when().then(function(){try{e._initialiseFeatureSet(),t(e)}catch(e){r(e)}},r),e._layer.load()})),this._loadPromise},t.prototype._initialiseFeatureSet=function(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._layer.outFields)if(1===this._layer.outFields.length&&"*"===this._layer.outFields[0]);else{for(var e=[],t=0,r=this.fields;t<r.length;t++){var i=r[t];if("oid"===i.type)e.push(i);else for(var a=0,s=this._layer.outFields;a<s.length;a++){var o=s[a];if(o.toLowerCase()===i.name.toLowerCase()){e.push(i);break}}}this.fields=e}else;if(null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{for(var e=[],l=[],u=0,p=this.fields;u<p.length;u++){var i=p[u];if("oid"===i.type)e.push(i),l.push(i.name);else for(var c=0,h=this._overrideFields;c<h.length;c++){var o=h[c];if(o.toLowerCase()===i.name.toLowerCase()){e.push(i),l.push(i.name);break}}}this.fields=e,this._overrideFields=l}this.objectIdField=this._layer.objectIdField,this.hasM=this._layer.supportsM,this.hasZ=this._layer.supportsZ,this._databaseType=n.FeatureServiceDatabaseType.Standardised,this.typeIdField=this._layer.typeIdField,this.types=this._layer.types},t.prototype.isTable=function(){return this._forceIsTable||this._layer.isTable||"table"===this._layer.type||!this._layer.geometryType},t.prototype._isInFeatureSet=function(e){return n.IdState.InFeatureSet},t.prototype._transformSetWithIdChanges=function(e){},t.prototype._candidateIdTransform=function(e){return e},t.prototype._getSet=function(e){var t=this;return null===this._wset?this._ensureLoaded().then(function(){return t._getFilteredSet("",null,null,null,e)}).then(function(e){return t._wset=e,e}):l.resolve(this._wset)},t.prototype._changeFeature=function(e){for(var t={},r=0,a=this.fields;r<a.length;r++){var s=a[r];t[s.name]=e.attributes[s.name]}return new i({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})},t.prototype._getFilteredSet=function(e,t,r,i,a){var u=this,p="",c=!1;if(null!==i&&(p=i.constructClause(),c=!0),this.isTable()&&t&&null!==e&&""!==e){var f=new s([],[],!0,null);return l.resolve(f)}var y=new h;return y.where=null===r?null===t?"1=1":"":o.toWhereClause(r,n.FeatureServiceDatabaseType.Standardised),y.spatialRelationship=this._makeRelationshipEnum(e),y.outSpatialReference=this.spatialReference,y.orderByFields=""!==p?p.split(","):null,y.geometry=null===t?null:t,y.returnGeometry=!0,y.relationParameter=this._makeRelationshipParam(e),this._layer.queryFeatures(y).then(function(e){if(null===e)return new s([],[],c,null);u._checkCancelled(a);var t=[];return e.features.forEach(function(e){var r=e.attributes[u._layer.objectIdField];t.push(r),u._featureCache[r]=u._changeFeature(e)}),new s([],t,c,null)})},t.prototype._makeRelationshipEnum=function(e){if(e.indexOf("esriSpatialRelRelation")>=0)return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e},t.prototype._makeRelationshipParam=function(e){return e.indexOf("esriSpatialRelRelation")>=0?e.split(":")[1]:""},t.prototype._queryAllFeatures=function(){var e=this;if(this._wset)return l.resolve(this._wset);var t=new h;return t.where="1=1",this._ensureLoaded().then(function(){if(e._layer.source&&e._layer.source.items){var r=[];return e._layer.source.items.forEach(function(t){var i=t.attributes[e._layer.objectIdField];r.push(i),e._featureCache[i]=e._changeFeature(t)}),e._wset=new s([],r,!1,null),e._wset}return e._layer.queryFeatures(t).then(function(t){var r=[];return t.features.forEach(function(t){var i=t.attributes[e._layer.objectIdField];r.push(i),e._featureCache[i]=e._changeFeature(t)}),e._wset=new s([],r,!1,null),e._wset})})},t.prototype._getFeatures=function(e,t,r,i){var a=[];-1!==t&&void 0===this._featureCache[t]&&a.push(t);for(var s=e._lastFetchedIndex;s<e._known.length&&(e._lastFetchedIndex+=1,!(void 0===this._featureCache[e._known[s]]&&(e._known[s]!==t&&a.push(e._known[s]),a.length>r)));s++);return 0===a.length?l.resolve("success"):l.reject(new Error("Unaccounted for Features. Not in Feature Collection"))},t.prototype._refineSetBlock=function(e,t,r){return l.resolve(e)},t.prototype._stat=function(e,t,r,i,a,s,n){return l.resolve({calculated:!1})},t.prototype._canDoAggregates=function(e,t,r,i,a){return l.resolve(!1)},t.prototype.relationshipMetaData=function(){return[]},t._cloneAttr=function(e){var t={};for(var r in e)t[r]=e[r];return t},t.prototype.nativeCapabilities=function(){return{title:this._layer.title,canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}},t.create=function(e,r){var i=e.layerDefinition.objectIdField,a=e.layerDefinition.geometryType;void 0===a&&(a=e.featureSet.geometryType||"");var s=e.featureSet.features,n=r.toJSON();if(""===i||void 0===i){for(var o=!1,l=0,h=e.layerDefinition.fields;l<h.length;l++){var f=h[l];if("oid"===f.type||"esriFieldTypeOID"===f.type){i=f.name,o=!0;break}}if(!1===o){for(var y="FID",d=!0,_=0;d;){for(var v=!0,m=0,F=e.layerDefinition.fields;m<F.length;m++){var f=F[m];if(f.name===y){v=!1;break}}!0===v?d=!1:(_++,y="FID"+_.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:y,alias:y});for(var g=[],b=0;b<s.length;b++)g.push({geometry:e.featureSet.features[b].geometry,attributes:e.featureSet.features[b].attributes?this._cloneAttr(e.featureSet.features[b].attributes):{}}),g[b].attributes[y]=b;s=g,i=y}}for(var S=[],w=0,R=e.layerDefinition.fields;w<R.length;w++){var f=R[w];f instanceof c?S.push(f):S.push(c.fromJSON(f))}var I=a;switch(I){case"esriGeometryPoint":I="point";break;case"esriGeometryPolyline":I="polyline";break;case"esriGeometryPolygon":I="polygon";break;case"esriGeometryExtent":I="extent";break;case"esriGeometryMultipoint":I="multipoint"}for(var T=0,k=s;T<k.length;T++){var f=k[T];f.geometry&&f.geometry instanceof u==!1&&(f.geometry.type=I,void 0===f.geometry.spatialReference&&(f.geometry.spatialReference=n))}var C={outFields:["*"],source:s,fields:S,objectIdField:i,spatialReference:r};return C.geometryType=I||"point",new t({layer:new p(C),spatialReference:r,isTable:null===I||""===I})},t.prototype.queryAttachments=function(e,t,r,i){return l.resolve([])},t.prototype.getFeatureByObjectId=function(e,t){var r=new h;return r.where=this.objectIdField+"="+e.toString(),this._layer.queryFeatures(r).then(function(e){return 1===e.features.length?e.features[0]:null})},t}(a)}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerRelated.js": /*!*************************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerRelated.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/tsSupport/extendsHelper */ "./node_modules/arcgis-js-api/core/tsSupport/extendsHelper.js"),__webpack_require__(/*! ../../../Graphic */ "./node_modules/arcgis-js-api/Graphic.js"),__webpack_require__(/*! ../support/FeatureSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js"),__webpack_require__(/*! ../support/IdSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js"),__webpack_require__(/*! ../support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../../tasks/support/RelationshipQuery */ "./node_modules/arcgis-js-api/tasks/support/RelationshipQuery.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,r,i,n,a,s,l,o){return function(e){function t(t){var r=e.call(this,t)||this;return r.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",r._findObjectId=-1,r._requestStandardised=!1,r._removeGeometry=!1,r._overrideFields=null,r.featureObjectId=null,r.relatedLayer=null,r.relationship=null,t.spatialReference&&(r.spatialReference=t.spatialReference),r._transparent=!0,r._maxProcessing=1e3,r._layer=t.layer,r._wset=null,r._findObjectId=t.objectId,r.featureObjectId=t.objectId,r.relationship=t.relationship,r.relatedLayer=t.relatedLayer,void 0!==t.outFields&&(r._overrideFields=t.outFields),void 0!==t.includeGeometry&&(r._removeGeometry=!1===t.includeGeometry),r}return r(t,e),t.prototype._maxQueryRate=function(){return s.defaultMaxRecords},t.prototype.end=function(){return this._layer},t.prototype.optimisePagingFeatureQueries=function(e){},t.prototype.load=function(){var e=this;return null===this._loadPromise&&(this._loadPromise=l.create(function(t,r){l.all([e._layer.load(),e.relatedLayer.load()]).then(function(){e._initialiseFeatureSet(),t(e)},r)})),this._loadPromise},t.prototype.nativeCapabilities=function(){return this.relatedLayer.nativeCapabilities()},t.prototype._initialiseFeatureSet=function(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this.relatedLayer.geometryType,this.fields=this.relatedLayer.fields.slice(0),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{for(var e=[],t=[],r=0,i=this.fields;r<i.length;r++){var n=i[r];if("oid"===n.type)e.push(n),t.push(n.name);else for(var a=0,s=this._overrideFields;a<s.length;a++){var l=s[a];if(l.toLowerCase()===n.name.toLowerCase()){e.push(n),t.push(n.name);break}}}this.fields=e,this._overrideFields=t}var o=this._layer.nativeCapabilities();o&&(this._databaseType=o.databaseType,this._requestStandardised=o.requestStandardised),this.objectIdField=this.relatedLayer.objectIdField,this.hasM=this.relatedLayer.supportsM,this.hasZ=this.relatedLayer.supportsZ,this.typeIdField=this.relatedLayer.typeIdField,this.types=this.relatedLayer.types},t.prototype.databaseType=function(){var e=this;return this.relatedLayer.databaseType().then(function(){return e._databaseType=e.relatedLayer._databaseType,e._databaseType})},t.prototype.isTable=function(){return this.relatedLayer.isTable()},t.prototype._isInFeatureSet=function(e){return s.IdState.InFeatureSet},t.prototype._transformSetWithIdChanges=function(e){},t.prototype._candidateIdTransform=function(e){return e},t.prototype._getSet=function(e){var t=this;return null===this._wset?this._ensureLoaded().then(function(){return t._getFilteredSet("",null,null,null,e)}).then(function(e){return t._wset=e,e}):l.resolve(this._wset)},t.prototype._changeFeature=function(e){for(var t={},r=0,n=this.fields;r<n.length;r++){var a=n[r];t[a.name]=e.attributes[a.name]}return new i({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})},t.prototype._getFilteredSet=function(e,t,r,i,n){var s=this;return this.databaseType().then(function(l){if(s.isTable()&&t&&null!==e&&""!==e){var d=new a([],[],!0,null);return d}var u=s._layer.nativeCapabilities();if(!1===u.canQueryRelated){var d=new a([],[],!0,null);return d}if(u.capabilities.queryRelated&&u.capabilities.queryRelated.supportsPagination)return s._getFilteredSetUsingPaging(e,t,r,i,n);var p="",c=!1;null!==i&&u.capabilities&&u.capabilities.queryRelated&&!0===u.capabilities.queryRelated.supportsOrderBy&&(p=i.constructClause(),c=!0);var y=new o;y.objectIds=[s._findObjectId];var f=null!==s._overrideFields?s._overrideFields:s._fieldsIncludingObjectId(s.relatedLayer.fields?s.relatedLayer.fields.map(function(e){return e.name}):["*"]);y.outFields=f,y.relationshipId=s.relationship.id,y.where="1=1";var h=!0;return!0===s._removeGeometry&&(h=!1),y.returnGeometry=h,s._requestStandardised&&(y.sqlFormat="standard"),y.outSpatialReference=s.spatialReference,y.orderByFields=""!==p?p.split(","):null,u.source.queryRelatedFeatures(y).then(function(i){s._checkCancelled(n);for(var l=i[s._findObjectId]?i[s._findObjectId].features:[],o=[],d=0;d<l.length;d++)s._featureCache[l[d].attributes[s._layer.objectIdField]]=l[d],o.push(l[d].attributes[s._layer.objectIdField]);var u=t&&null!==e&&""!==e,p=null!==r&&void 0!==r,y=u||p?[]:o;return new a(u||p?o:[],y,c,null)})})},t.prototype._fieldsIncludingObjectId=function(e){if(null===e)return[this.objectIdField];var t=e.slice(0);if(t.indexOf("*")>-1)return t;for(var r=!1,i=0,n=t;i<n.length;i++){if(n[i].toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}}return!1===r&&t.push(this.objectIdField),t},t.prototype._getFilteredSetUsingPaging=function(e,t,r,i,n){var s=this;try{var o="",d=!1,u=this._layer.nativeCapabilities();return null!==i&&u&&u.capabilities.queryRelated&&!0===u.capabilities.queryRelated.supportsOrderBy&&(o=i.constructClause(),d=!0),this.databaseType().then(function(i){var l=s._maxQueryRate(),p=u.capabilities.query.maxRecordCount;void 0!==p&&p<l&&(l=p);var c=t&&null!==e&&""!==e,y=null!==r&&void 0!==r,f=null,h=!0;!0===s._removeGeometry&&(h=!1);var _=null!==s._overrideFields?s._overrideFields:s._fieldsIncludingObjectId(s.relatedLayer.fields?s.relatedLayer.fields.map(function(e){return e.name}):["*"]),g=c||y?[]:["GETPAGES"];return f=new a(c||y?["GETPAGES"]:[],g,d,{outFields:_.join(","),resultRecordCount:l,resultOffset:0,objectIds:[s._findObjectId],where:"1=1",orderByFields:o,returnGeometry:h,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,fullyResolved:!1}}),s._expandPagedSet(f,l,0,0,n).then(function(){return f})})}catch(e){return l.reject(e)}},t.prototype._expandPagedSet=function(e,t,r,i,n){return this._expandPagedSetFeatureSet(e,t,r,i,n)},t.prototype._clonePageDefinition=function(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}},t.prototype._getPhysicalPage=function(e,t,r){var i=this;try{var n=e.pagesDefinition.internal.lastRetrieved,a=n,s=this._layer.nativeCapabilities(),d=new o;return!0===this._requestStandardised&&(d.sqlFormat="standard"),d.relationshipId=this.relationship.id,d.objectIds=e.pagesDefinition.objectIds,d.resultOffset=e.pagesDefinition.internal.lastRetrieved,d.resultRecordCount=e.pagesDefinition.resultRecordCount,d.outFields=e.pagesDefinition.outFields.split(","),d.where=e.pagesDefinition.where,d.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,d.returnGeometry=e.pagesDefinition.returnGeometry,d.outSpatialReference=this.spatialReference,s.source.queryRelatedFeatures(d).then(function(t){if(i._checkCancelled(r),e.pagesDefinition.internal.lastRetrieved!==n)return 0;for(var s=t[i._findObjectId]?t[i._findObjectId].features:[],l=0;l<s.length;l++)e.pagesDefinition.internal.set[a+l]=s[l].attributes[i._layer.objectIdField];for(var l=0;l<s.length;l++)i._featureCache[s[l].attributes[i._layer.objectIdField]]=s[l];var o=!t[i._findObjectId]||!1===t[i._findObjectId].exceededTransferLimit;return s.length!==e.pagesDefinition.resultRecordCount&&o&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=n+s.length,s.length})}catch(e){return l.reject(e)}},t.prototype._getFeatures=function(e,t,r,i){var n=this,a=[];-1!==t&&void 0===this._featureCache[t]&&a.push(t);var s=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,s,i))return this._expandPagedSet(e,s,0,0,i).then(function(a){return n._getFeatures(e,t,r,i)});for(var o=0,d=e._lastFetchedIndex;d<e._known.length&&(o++,o<=r&&(e._lastFetchedIndex+=1),!("GETPAGES"!==e._known[d]&&void 0===this._featureCache[e._known[d]]&&(e._known[d]!==t&&a.push(e._known[d]),a.length>r)))&&!(o>=r&&0===a.length);d++);return 0===a.length?l.resolve("success"):l.reject(new Error("Unaccounted for Features. Not in Feature Collection"))},t.prototype._refineSetBlock=function(e,t,r){return l.resolve(e)},t.prototype._stat=function(e,t,r,i,n,a,s){return l.resolve({calculated:!1})},t.prototype._canDoAggregates=function(e,t,r,i,n){return l.resolve(!1)},t.prototype.relationshipMetaData=function(){return this.relatedLayer.relationshipMetaData()},t.prototype.serviceUrl=function(){return this.relatedLayer.serviceUrl()},t.prototype.queryAttachments=function(e,t,r,i){return this.relatedLayer.queryAttachments(e,t,r,i)},t.prototype.getFeatureByObjectId=function(e,t){return this.relatedLayer.getFeatureByObjectId(e,t)},t}(n)}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js": /*!****************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSet.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../support/FeatureSetIterator */ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSetIterator.js"),__webpack_require__(/*! ../support/IdSet */ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js"),__webpack_require__(/*! ../support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ./cache */ "./node_modules/arcgis-js-api/arcade/featureset/support/cache.js"),__webpack_require__(/*! ./stats */ "./node_modules/arcgis-js-api/arcade/featureset/support/stats.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../../core/sql/WhereClause */ "./node_modules/arcgis-js-api/core/sql/WhereClause.js"),__webpack_require__(/*! ../../../geometry/geometryEngineAsync */ "./node_modules/arcgis-js-api/geometry/geometryEngineAsync.js"),__webpack_require__(/*! ../../../geometry/SpatialReference */ "./node_modules/arcgis-js-api/geometry/SpatialReference.js"),__webpack_require__(/*! ../../../layers/support/FieldsIndex */ "./node_modules/arcgis-js-api/layers/support/FieldsIndex.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,n,r,i,a,o,s,u,c,l,h){return function(){function e(e){this.recentlyUsedQueries=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=i.FeatureServiceDatabaseType.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=[],this.types=null,this.fields=null,this.geometryType="",this.objectIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,e&&e.lrucache&&(this.recentlyUsedQueries=e.lrucache)}return e.prototype.optimisePagingFeatureQueries=function(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)},e.prototype._hasMemorySource=function(){return!0},e.prototype.prop=function(e,t){return void 0===t?this[e]:(void 0!==this[e]&&(this[e]=t),this)},e.prototype.end=function(){return null!==this._parent&&!0===this._parent._transparent?this._parent.end():this._parent},e.prototype._ensureLoaded=function(){return this.load()},e.prototype.load=function(){var e=this;return null===this._loadPromise&&(this._loadPromise=s.create(function(t,n){if(!0===e._parent.loaded)return e._initialiseFeatureSet(),void t(e);e._parent.load().then(function(){try{e._initialiseFeatureSet(),t(e)}catch(e){n(e)}},n)})),this._loadPromise},e.prototype._initialiseFeatureSet=function(){null!==this._parent?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.spatialReference=new l({wkid:4326}),this.geometryType=i.layerGeometryEsriConstants.point)},e.prototype.getField=function(e,t){var n;return t=t||this.fields,t&&(e=e.toLowerCase(),t.some(function(t){return t&&t.name.toLowerCase()===e&&(n=t),!!n})),n},e.prototype.getFieldsIndex=function(){return null===this._fieldsIndex&&(this._fieldsIndex=new h(this.fields)),this._fieldsIndex},e.prototype._maxProcessingRate=function(){return null!==this._parent?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())},e.prototype._maxQueryRate=function(){return null!==this._parent?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery},e.prototype._checkCancelled=function(e){if(null!==e&&e.aborted)throw new Error("Operation has been cancelled.")},e.prototype.nativeCapabilities=function(){return this._parent.nativeCapabilities()},e.prototype._canDoAggregates=function(e,t,n,r,i){return null===this._parent?s.resolve(!1):this._parent._canDoAggregates(e,t,n,r,i)},e.prototype._getAggregatePagesDataSourceDefinition=function(e,t,n,r,i,a,o){return null===this._parent?s.reject(new Error("Should never be called")):this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,i,a,o)},e.prototype._getAgregagtePhysicalPage=function(e,t,n){return null===this._parent?s.reject(new Error("Should never be called")):this._parent._getAgregagtePhysicalPage(e,t,n)},e.prototype.databaseType=function(){var e=this;if(this._databaseType===i.FeatureServiceDatabaseType.NotEvaluated){if(null!==a.applicationCache){var t=a.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(null!==t)return t}if(null!==this._databaseTypeProbed)return this._databaseTypeProbed;var n=[{thetype:i.FeatureServiceDatabaseType.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:i.FeatureServiceDatabaseType.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:i.FeatureServiceDatabaseType.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}],r=s.create(function(t,r){e._getDatabaseTypeImpl(n,0).then(function(n){e._databaseType=n,t(e._databaseType)},function(e){r(e)})});return null!==a.applicationCache&&(a.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),r),r=r.catch(function(t){throw a.applicationCache.clearDatabaseType(e._cacheableFeatureSetSourceKey()),t})),this._databaseTypeProbed=r,this._databaseTypeProbed}return s.resolve(this._databaseType)},e.prototype._cacheableFeatureSetSourceKey=function(){return"MUSTBESET"},e.prototype._getDatabaseTypeImpl=function(e,t){var n=this;return t>=e.length?s.resolve(i.FeatureServiceDatabaseType.StandardisedNoInterval):this._runDatabaseProbe(e[t].testwhere).then(function(r){return!0===r?e[t].thetype:n._getDatabaseTypeImpl(e,t+1)})},e.prototype._runDatabaseProbe=function(e){return null!==this._parent?this._parent._runDatabaseProbe(e):s.reject(new Error("Not Implemented"))},e.prototype.isTable=function(){return this._parent.isTable()},e.prototype._featureFromCache=function(e){if(void 0!==this._featureCache[e])return this._featureCache[e]},e.prototype._isInFeatureSet=function(e){return i.IdState.Unknown},e.prototype._getSet=function(e){throw new Error("Not implemented in abstract class")},e.prototype._getFeature=function(e,t,n){var r=this;try{return this._checkCancelled(n),void 0!==this._featureFromCache(t)?s.resolve(this._featureFromCache(t)):this._getFeatures(e,t,this._maxProcessingRate(),n).then(function(){return r._checkCancelled(n),void 0!==r._featureFromCache(t)?r._featureFromCache(t):s.reject(new Error("Feature Not Found"))})}catch(e){return s.reject(e)}},e.prototype._getFeatureBatch=function(e,t){var n=this;try{this._checkCancelled(t);var i=new r([],e,!1,null),a=[];return this._getFeatures(i,-1,e.length,t).then(function(){n._checkCancelled(t);for(var r=0,i=e;r<i.length;r++){var o=i[r];void 0!==n._featureFromCache(o)&&a.push(n._featureFromCache(o))}return a})}catch(e){return s.reject(e)}},e.prototype._getFeatures=function(e,t,n,r){return s.resolve("success")},e.prototype._getFilteredSet=function(e,t,n,r,i){throw new Error("Not implemented in abstract class")},e.prototype._refineSetBlock=function(e,t,n){var r=this;try{if(!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate(),n))return this._expandPagedSet(e,this._maxQueryRate(),0,0,n).then(function(){return r._refineSetBlock(e,t,n)});this._checkCancelled(n);var i=e._candidates.length;this._refineKnowns(e,t);var a=i-e._candidates.length;return 0===e._candidates.length?s.resolve(e):a>=t?s.resolve(e):this._refineIfParentKnown(e,t-a,n).then(function(){if(r._checkCancelled(n),r._refineKnowns(e,t-a),(a=i-e._candidates.length)<t&&e._candidates.length>0){var o=t-a,s=r._prepareFetchAndRefineSet(e._candidates,r._maxQueryRate());return r._fetchAndRefineFeatures(s,s.length>o?o:e._candidates.length,n).then(function(){return r._checkCancelled(n),r._refineKnowns(e,t-a),e})}return e})}catch(e){return s.reject(e)}},e.prototype._fetchAndRefineFeatures=function(e,t,n){return null},e.prototype._prepareFetchAndRefineSet=function(e,t){for(var n=[],r=0;r<e.length;r++)this._isPhysicalFeature(e[r])&&n.push(e[r]);return n},e.prototype._isPhysicalFeature=function(e){return null===this._parent||this._parent._isPhysicalFeature(e)},e.prototype._refineKnowns=function(e,t){var n=0,r=null,a=[];t=this._maxQueryRate();for(var o=0;o<e._candidates.length&&"GETPAGES"!==e._candidates[o];o++){var s=!1,u=this._candidateIdTransform(e._candidates[o]);u!==e._candidates[o]&&(s=!0);var c=this._isInFeatureSet(u);if(c===i.IdState.InFeatureSet)!0===s?e._known.indexOf(u)<0&&(e._known.push(u),n+=1):(e._known.push(e._candidates[o]),n+=1),null===r?r={start:o,end:o}:r.end===o-1?r.end=o:(a.push(r),r={start:o,end:o});else if(c===i.IdState.NotInFeatureSet)null===r?r={start:o,end:o}:r.end===o-1?r.end=o:(a.push(r),r={start:o,end:o}),n+=1;else if(c===i.IdState.Unknown&&(n+=1,!0===e._ordered))break;if(n>=t)break}null!==r&&a.push(r);for(var l=a.length-1;l>=0;l--)e._candidates.splice(a[l].start,a[l].end-a[l].start+1)},e.prototype._refineIfParentKnown=function(e,t,n){var i=this,a=new r([],[],e._ordered,null);return a._candidates=e._candidates.slice(0),this._parent._refineSetBlock(a,t,n).then(function(t){return i._parent._transformSetWithIdChanges(e),t})},e.prototype._candidateIdTransform=function(e){return this._parent._candidateIdTransform(e)},e.prototype._transformSetWithIdChanges=function(e){this._parent._transformSetWithIdChanges(e)},e.prototype._checkIfNeedToExpandKnownPage=function(e,t,n){if(null===e.pagesDefinition)return!1;for(var r=0,i=e._lastFetchedIndex;i<e._known.length;i++){if("GETPAGES"===e._known[i])return!0;if(void 0===this._featureCache[e._known[i]]&&(r+=1)>=t)break}return!1},e.prototype._checkIfNeedToExpandCandidatePage=function(e,t,n){if(null===e.pagesDefinition)return!1;for(var r=0,i=0;i<e._candidates.length;i++){if("GETPAGES"===e._candidates[i])return!0;if((r+=1)>=t)break}return!1},e.prototype._expandPagedSet=function(e,t,n,r,i){return null===this._parent?s.reject(new Error("Parent Paging not implemented")):this._parent._expandPagedSet(e,t,n,r,i)},e.prototype._expandPagedSetFeatureSet=function(e,t,n,r,i){var a=this;return e._known.length>0&&"GETPAGES"===e._known[e._known.length-1]&&(r=1),0===r&&e._candidates.length>0&&"GETPAGES"===e._candidates[e._candidates.length-1]&&(r=2),0===r?s.resolve("finished"):this._getPage(e,r,i).then(function(r){return n+r<t?a._expandPagedSet(e,t,n+r,0,i):"success"})},e.prototype._getPage=function(e,t,n){var r=this,i=1===t?e._known:e._candidates;if(e.pagesDefinition.internal.set.length>e.pagesDefinition.resultOffset||!0===e.pagesDefinition.internal.fullyResolved){i.length=i.length-1;for(var a=0,o=0;o<e.pagesDefinition.resultRecordCount&&!(e.pagesDefinition.resultOffset+o>=e.pagesDefinition.internal.set.length);o++)i[i.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+o],a++;e.pagesDefinition.resultOffset+=a;var u=!1;return!0===e.pagesDefinition.internal.fullyResolved&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(u=!0),!1===u&&i.push("GETPAGES"),s.resolve(a)}return this._getPhysicalPage(e,t,n).then(function(){return r._getPage(e,t,n)})},e.prototype._getPhysicalPage=function(e,t,n){return null},e.prototype._clonePageDefinition=function(e){return null===this._parent?null:this._parent._clonePageDefinition(e)},e.prototype._first=function(e){return this.iterator(e).next()},e.prototype.first=function(e){return this._first(e)},e.prototype.calculateStatistic=function(e,t,n,r){var i=this;return this._ensureLoaded().then(function(){return i._stat(e,t,"",null,null,n,r).then(function(a){return!1===a.calculated?i._manualStat(e,t,n,r).then(function(e){return e.result}):a.result})})},e.prototype._manualStat=function(e,t,n,r){switch(e.toLowerCase()){case"count":return o.count(this,r).then(function(e){return{calculated:!0,result:e}});case"distinct":return o.distinct(this,t,n).then(function(e){return{calculated:!0,result:e}});case"avg":case"mean":return o.mean(this,t,r).then(function(e){return{calculated:!0,result:e}});case"stdev":return o.stdev(this,t,r).then(function(e){return{calculated:!0,result:e}});case"variance":return o.variance(this,t,r).then(function(e){return{calculated:!0,result:e}});case"sum":return o.sum(this,t,r).then(function(e){return{calculated:!0,result:e}});case"min":return o.min(this,t,r).then(function(e){return{calculated:!0,result:e}});case"max":return o.max(this,t,r).then(function(e){return{calculated:!0,result:e}});default:return s.resolve({calculated:!0,result:0})}},e.prototype._stat=function(e,t,n,r,i,a,o){var s=this;return this._parent._stat(e,t,n,r,i,a,o).then(function(u){return!1===u.calculated?null===i&&""===n&&null===r?s._manualStat(e,t,a,o):{calculated:!1}:u})},e.prototype._unionAllGeomSelf=function(e){var t=this,n=this.iterator(this._defaultTracker(e)),r=[];return s.create(function(e,i){t._unionShapeInBatches(r,n,e,i)})},e.prototype._unionAllGeom=function(e){var t=this;return s.create(function(n,r){var i=t.iterator(t._defaultTracker(e)),a=[];t._unionShapeInBatches(a,i,n,r)})},e.prototype._unionShapeInBatches=function(e,t,n,r){var i=this;t.next().then(function(a){try{null!==a&&null!==a.geometry&&e.push(a.geometry),e.length>30||null===a&&e.length>1?c.union(e).then(function(o){try{null===a?n(o):(e=[o],i._unionShapeInBatches(e,t,n,r))}catch(e){r(e)}},r):null===a?n(1===e.length?e[0]:null):i._unionShapeInBatches(e,t,n,r)}catch(e){r(e)}},r)},e.prototype.iterator=function(e){return new n(this,e)},e.prototype.intersection=function(t,n){return void 0===n&&(n=!1),e._featuresetFunctions.intersection.bind(this)(t,n)},e.prototype.difference=function(t,n,r){return void 0===n&&(n=!1),void 0===r&&(r=!0),e._featuresetFunctions.difference.bind(this)(t,n,r)},e.prototype.symmetricDifference=function(t,n,r){return void 0===n&&(n=!1),void 0===r&&(r=!0),e._featuresetFunctions.symmetricDifference.bind(this)(t,n,r)},e.prototype.morphShape=function(t,n,r,i){return void 0===r&&(r="unknown"),void 0===i&&(i=null),e._featuresetFunctions.morphShape.bind(this)(t,n,r,i)},e.prototype.morphShapeAndAttributes=function(t,n,r){return void 0===r&&(r="unknown"),e._featuresetFunctions.morphShapeAndAttributes.bind(this)(t,n,r)},e.prototype.union=function(t,n){return void 0===n&&(n=!1),e._featuresetFunctions.union.bind(this)(t,n)},e.prototype.intersects=function(t){return e._featuresetFunctions.intersects.bind(this)(t)},e.prototype.envelopeIntersects=function(t){return e._featuresetFunctions.envelopeIntersects.bind(this)(t)},e.prototype.contains=function(t){return e._featuresetFunctions.contains.bind(this)(t)},e.prototype.overlaps=function(t){return e._featuresetFunctions.overlaps.bind(this)(t)},e.prototype.relate=function(t,n){return e._featuresetFunctions.relate.bind(this)(t,n)},e.prototype.within=function(t){return e._featuresetFunctions.within.bind(this)(t)},e.prototype.touches=function(t){return e._featuresetFunctions.touches.bind(this)(t)},e.prototype.top=function(t){return e._featuresetFunctions.top.bind(this)(t)},e.prototype.crosses=function(t){return e._featuresetFunctions.crosses.bind(this)(t)},e.prototype.buffer=function(t,n,r,i){return void 0===i&&(i=!0),e._featuresetFunctions.buffer.bind(this)(t,n,r,i)},e.prototype.filter=function(t,n){return void 0===n&&(n=null),e._featuresetFunctions.filter.bind(this)(t,n)},e.prototype.orderBy=function(t){return e._featuresetFunctions.orderBy.bind(this)(t)},e.prototype.dissolve=function(t,n){return e._featuresetFunctions.dissolve.bind(this)(t,n)},e.prototype.groupby=function(t,n){return e._featuresetFunctions.groupby.bind(this)(t,n)},e.prototype.reduce=function(e,t,n){var r=this;return void 0===t&&(t=null),s.create(function(i,a){r._reduceImpl(r.iterator(r._defaultTracker(n)),e,t,0,i,a,0)})},e.prototype._reduceImpl=function(e,t,n,r,i,a,o){var u=this;try{if(++o>1e3)return void setTimeout(function(){o=0,u._reduceImpl(e,t,n,r,i,a,o)});e.next().then(function(c){try{if(null===c)i(n);else{var l=t(n,c,r,u);s.isPromiseLike(l)?l.then(function(n){u._reduceImpl(e,t,n,r+1,i,a,o)},a):u._reduceImpl(e,t,l,r+1,i,a,o)}}catch(e){a(e)}},a)}catch(e){a(e)}},e.prototype.removeField=function(t){return e._featuresetFunctions.removeField.bind(this)(t)},e.prototype.addField=function(t,n,r){return void 0===r&&(r=null),e._featuresetFunctions.addField.bind(this)(t,n,r)},e.prototype.sumArea=function(e,t,n){void 0===t&&(t=!1);var r=i.convertSquareUnitsToCode(e);return this.reduce(function(e,n){return null===n.geometry?0:t?c.geodesicArea(n.geometry,r).then(function(t){return e+t}):c.planarArea(n.geometry,r).then(function(t){return e+t})},0,n)},e.prototype.sumLength=function(e,t,n){void 0===t&&(t=!1);var r=i.convertLinearUnitsToCode(e);return this.reduce(function(e,n){return null===n.geometry?0:t?c.geodesicLength(n.geometry,r).then(function(t){return e+t}):c.planarLength(n.geometry,r).then(function(t){return e+t})},0,n)},e.prototype._substituteVars=function(e,t){if(null!==t){var n={};for(var r in t)n[r.toLowerCase()]=t[r];e.parameters=n}},e.prototype.distinct=function(e,t,n,r){var i=this;return void 0===t&&(t=1e3),void 0===n&&(n=null),this.load().then(function(){var a=u.WhereClause.create(e,i.getFieldsIndex());return i._substituteVars(a,n),i.calculateStatistic("distinct",a,t,i._defaultTracker(r))})},e.prototype.min=function(e,t,n){var r=this;return void 0===t&&(t=null),this.load().then(function(){var i=u.WhereClause.create(e,r.getFieldsIndex());return r._substituteVars(i,t),r.calculateStatistic("min",i,-1,r._defaultTracker(n))})},e.prototype.max=function(e,t,n){var r=this;return void 0===t&&(t=null),this.load().then(function(){var i=u.WhereClause.create(e,r.getFieldsIndex());return r._substituteVars(i,t),r.calculateStatistic("max",i,-1,r._defaultTracker(n))})},e.prototype.avg=function(e,t,n){var r=this;return void 0===t&&(t=null),this.load().then(function(){var i=u.WhereClause.create(e,r.getFieldsIndex());return r._substituteVars(i,t),r.calculateStatistic("avg",i,-1,r._defaultTracker(n))})},e.prototype.sum=function(e,t,n){var r=this;return void 0===t&&(t=null),this.load().then(function(){var i=u.WhereClause.create(e,r.getFieldsIndex());return r._substituteVars(i,t),r.calculateStatistic("sum",i,-1,r._defaultTracker(n))})},e.prototype.stdev=function(e,t,n){var r=this;return void 0===t&&(t=null),this.load().then(function(){var i=u.WhereClause.create(e,r.getFieldsIndex());return r._substituteVars(i,t),r.calculateStatistic("stdev",i,-1,r._defaultTracker(n))})},e.prototype.variance=function(e,t,n){var r=this;return void 0===t&&(t=null),this.load().then(function(){var i=u.WhereClause.create(e,r.getFieldsIndex());return r._substituteVars(i,t),r.calculateStatistic("variance",i,-1,r._defaultTracker(n))})},e.prototype.count=function(e){var t=this;return this.load().then(function(){return t.calculateStatistic("count",u.WhereClause.create("1",t.getFieldsIndex()),-1,t._defaultTracker(e))})},e.prototype._defaultTracker=function(e){return e||{aborted:!1}},e.prototype.forEach=function(e,t){var n=this;return s.create(function(r,i){n._forEachImpl(n.iterator(n._defaultTracker(t)),e,n,r,i,0)})},e.prototype._forEachImpl=function(e,t,n,r,i,a){var o=this;try{if(++a>1e3)return void setTimeout(function(){a=0,o._forEachImpl(e,t,n,r,i,a)},0);e.next().then(function(u){try{if(null===u)r(n);else{var c=t(u);void 0===c||null===c?o._forEachImpl(e,t,n,r,i,a):s.isPromiseLike(c)?c.then(function(){try{o._forEachImpl(e,t,n,r,i,a)}catch(e){i(e)}},i):o._forEachImpl(e,t,n,r,i,a)}}catch(e){i(e)}},i)}catch(e){i(e)}},e.prototype.convertToJSON=function(e){for(var t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}},n=0;n<this.fields.length;n++)t.layerDefinition.fields.push(i.esriFieldToJson(this.fields[n]));return this.reduce(function(e){var n={geometry:e.geometry&&e.geometry.toJSON(),attributes:{}};for(var r in e.attributes)n.attributes[r]=e.attributes[r];return t.featureSet.features.push(n),1},0,e)},e.prototype.castToText=function(){return"object, FeatureSet"},e.prototype.queryAttachments=function(e,t,n,r){return this._parent.queryAttachments(e,t,n,r)},e.prototype.serviceUrl=function(){return this._parent.serviceUrl()},e.prototype.relationshipMetaData=function(){return this._parent.relationshipMetaData()},e.prototype.schema=function(){for(var e=[],t=0,n=this.fields;t<n.length;t++){var r=n[t];e.push(i.esriFieldToJson(r))}return{objectIdField:this.objectIdField,typeIdField:this.typeIdField,geometryType:void 0===i.layerGeometryEsriConstants[this.geometryType]?"":i.layerGeometryEsriConstants[this.geometryType],hasZ:this.hasZ,hasM:this.hasM,fields:e}},e.prototype.convertToText=function(e,t){var n=this;return"schema"===e?this._ensureLoaded().then(function(){return JSON.stringify(n.schema())}):"featureset"===e?this._ensureLoaded().then(function(){var e=[];return n.reduce(function(t,n){var r={geometry:n.geometry?n.geometry.toJSON():null,attributes:n.attributes};return null!==r.geometry&&r.geometry.spatialReference&&delete r.geometry.spatialReference,e.push(r),1},0,t).then(function(){var t=n.schema();return t.features=e,t.spatialReference=n.spatialReference.toJSON(),JSON.stringify(t)})}):s.resolve(this.castToText())},e.prototype.getFeatureByObjectId=function(e,t){return this._parent.getFeatureByObjectId(e,t)},e._featuresetFunctions={},e}()}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSetIterator.js": /*!************************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/support/FeatureSetIterator.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(n,t,e){return function(){function n(n,t){this._lastId=-1,this._progress=t,this._parent=n}return n.prototype.reset=function(){this._lastId=-1},n.prototype.nextBatch=function(n){var t=this;if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then(function(e){return t.nextBatch(n)},function(e){return t.nextBatch(n)});var r={returnpromise:null,hasset:!1},s=[];return r.returnpromise=e.create(function(e,a){t._parent._getSet(t._progress).then(function(_){var i=_._known.length-1;if("GETPAGES"===_._known[_._known.length-1]&&(i-=1),t._lastId+n<i&&_._known.length>0&&"GETPAGES"===_._known[_._known.length-1])return void t._parent._expandPagedSet(_,t._parent._maxQueryRate(),0,0,t._progress).then(function(e){return r.hasset=!0,t._parent._mainSetInUse=null,t.nextBatch(n)},function(n){r.hasset=!0,t._parent._mainSetInUse=null,a(n)});if(i>=t._lastId+n||0===_._candidates.length){for(var o=0;o<n;o++){var u=o+t._lastId+1;if(u>=_._known.length)break;s[o]=_._known[u]}return t._lastId+=s.length,0===s.length&&(r.hasset=!0,t._parent._mainSetInUse=null,e([])),void t._parent._getFeatureBatch(s,t._progress).then(function(n){r.hasset=!0,t._parent._mainSetInUse=null,e(n)},function(n){r.hasset=!0,t._parent._mainSetInUse=null,a(n)})}t._parent._refineSetBlock(_,t._parent._maxProcessingRate(),t._progress).then(function(){r.hasset=!0,t._parent._mainSetInUse=null,t.nextBatch(n).then(e,a)},function(n){r.hasset=!0,t._parent._mainSetInUse=null,a(n)})},function(n){r.hasset=!0,t._parent._mainSetInUse=null,a(n)})}),!1===r.hasset&&(this._parent._mainSetInUse=r.returnpromise,r.hasset=!0),r.returnpromise},n.prototype.next=function(){var n=this;if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then(function(t){return n.next()},function(t){return n.next()});var t={returnpromise:null,hasset:!1};return t.returnpromise=e.create(function(e,r){n._parent._getSet(n._progress).then(function(s){n._lastId<s._known.length-1?"GETPAGES"===s._known[n._lastId+1]?n._parent._expandPagedSet(s,n._parent._maxQueryRate(),0,0,n._progress).then(function(e){return t.hasset=!0,n._parent._mainSetInUse=null,n.next()}).then(e,r):(n._lastId+=1,n._parent._getFeature(s,s._known[n._lastId],n._progress).then(function(r){t.hasset=!0,n._parent._mainSetInUse=null,e(r)},function(e){t.hasset=!0,n._parent._mainSetInUse=null,r(e)})):s._candidates.length>0?n._parent._refineSetBlock(s,n._parent._maxProcessingRate(),n._progress).then(function(){t.hasset=!0,n._parent._mainSetInUse=null,n.next().then(e,r)},function(e){t.hasset=!0,n._parent._mainSetInUse=null,r(e)}):(t.hasset=!0,n._parent._mainSetInUse=null,e(null))},function(e){t.hasset=!0,n._parent._mainSetInUse=null,r(e)})}),!1===t.hasset&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise},n.prototype.count=function(){var n=this;return-1!==this._parent._totalCount?e.resolve(this._parent._totalCount):this._parent._getSet(this._progress).then(function(t){return n._refineAllSets(t)}).then(function(t){return n._parent._totalCount=t._known.length,e.resolve(n._parent._totalCount)})},n.prototype._refineAllSets=function(n){var t=this;return n._known.length>0&&"GETPAGES"===n._known[n._known.length-1]?this._parent._expandPagedSet(n,this._parent._maxQueryRate(),0,1,this._progress).then(function(e){return t._refineAllSets(n)}).then(function(n){return e.resolve(n)}):n._candidates.length>0?"GETPAGES"===n._known[n._candidates.length-1]?this._parent._expandPagedSet(n,this._parent._maxQueryRate(),0,2,this._progress).then(function(e){return t._refineAllSets(n)}).then(function(n){return e.resolve(n)}):this._parent._refineSetBlock(n,this._parent._maxProcessingRate(),this._progress).then(function(n){return n._candidates.length>0?t._refineAllSets(n):e.resolve(n)}):e.resolve(n)},n}()}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js": /*!***********************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/support/IdSet.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function(n,i){return function(){function n(n,i,t,e){this._candidates=null,this._known=null,this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=n,this._known=i,this._ordered=t,this.pagesDefinition=e}return n}()}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/support/OrderbyClause.js": /*!*******************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/support/OrderbyClause.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function(t,e){function r(t,e){return t===e?0:null===t?-1:null===e?1:t<e?-1:1}return function(){function t(t){var e=t.split(",");this._fields=[],this._directions=[];for(var r=0;r<e.length;r++){var i=e[r],s=i.match(/\S+/g);this._fields.push(s[0]),2===s.length?"asc"===s[1].toLowerCase()?this._directions.push(1):this._directions.push(0):this._directions.push(1)}}return t.prototype.constructClause=function(){for(var t="",e=0;e<this._fields.length;e++)0!==e&&(t+=","),t+=this._fields[e],1===this._directions[e]?t+=" ASC":t+=" DESC";return t},t.prototype.order=function(t){var e=this;t.sort(function(t,i){for(var s=0;s<e._fields.length;s++){var n=e.featureValue(t.feature,e._fields[s],s),o=e.featureValue(i.feature,e._fields[s],s),u=0;if(0!==(u=1===e._directions[s]?r(n,o):-1*r(n,o)))return u}return 0})},t.prototype.scanForField=function(t){for(var e=0;e<this._fields.length;e++)if(this._fields[e].toLowerCase().trim()===t.toLowerCase().trim())return!0;return!1},t.prototype.replaceFields=function(e){for(var r="",i=0;i<this._fields.length;i++){0!==i&&(r+=",");for(var s=this._fields[i],n=0,o=e;n<o.length;n++){var u=o[n];if(s.toLowerCase()===u.field.toLowerCase()){s=u.newfield;break}}r+=s,1===this._directions[i]?r+=" ASC":r+=" DESC"}return new t(r)},t.prototype.featureValue=function(t,e,r){var i=t.attributes[e];if(void 0!==i)return i;for(var s in t.attributes)if(e.toLowerCase()===s.toLowerCase())return this._fields[r]=s,t.attributes[s];return null},t}()}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/support/StatsField.js": /*!****************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/support/StatsField.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ./shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ./sqlUtils */ "./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js"),__webpack_require__(/*! ../../../core/sql/WhereClause */ "./node_modules/arcgis-js-api/core/sql/WhereClause.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,r,t,n,a){function i(e){if("function"===e.parseTree.type){if(0===e.parseTree.args.value.length)return{name:e.parseTree.name,expr:null};if(e.parseTree.args.value.length>1)throw new Error("Statistic does not have 1 or 0 Parameters");var r=a.WhereClause.create(n.toWhereClauseFromTree(e.parseTree.args.value[0],t.FeatureServiceDatabaseType.Standardised,e.parameters),e.fieldsIndex);return{name:e.parseTree.name,expr:r}}return null}return function(){function e(){}return e.prototype.clone=function(){var r=new e;return r.field=this.field,r.tofieldname=this.tofieldname,r.typeofstat=this.typeofstat,r.workingexpr=this.workingexpr,r},e.parseStatField=function(r,t,n){var s=new e;s.field=r;var o=a.WhereClause.create(t,n),l=i(o);if(null===l)throw new Error("Invalid Statistic Function");var u=l.name.toUpperCase().trim();if("MIN"===u){if(s.typeofstat="MIN",s.workingexpr=l.expr,null===o)throw new Error("Invalid Statistic Function Parameters")}else if("MAX"===u){if(s.typeofstat="MAX",s.workingexpr=l.expr,null===o)throw new Error("Invalid Statistic Function Parameters")}else if("COUNT"===u)s.typeofstat="COUNT",s.workingexpr=l.expr;else if("STDEV"===u){if(s.typeofstat="STDDEV",s.workingexpr=l.expr,null===o)throw new Error("Invalid Statistic Function Parameters")}else if("SUM"===u){if(s.typeofstat="SUM",s.workingexpr=l.expr,null===o)throw new Error("Invalid Statistic Function Parameters")}else if("MEAN"===u){if(s.typeofstat="AVG",s.workingexpr=l.expr,null===o)throw new Error("Invalid Statistic Function Parameters")}else if("AVG"===u){if(s.typeofstat="AVG",s.workingexpr=l.expr,null===o)throw new Error("Invalid Statistic Function Parameters")}else{if("VAR"!==u)throw new Error("Invalid Statistic Function");if(s.typeofstat="VAR",s.workingexpr=l.expr,null===o)throw new Error("Invalid Statistic Function Parameters")}return s},e.prototype.toStatisticsName=function(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg";default:return"count"}},e}()}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/support/cache.js": /*!***********************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/support/cache.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function(t,e){return function(){function t(){this._databaseTypeMetaData={},this._layerInfo={}}return t.prototype.clearDatabaseType=function(t){void 0===this._databaseTypeMetaData[t]&&delete this._databaseTypeMetaData[t]},t.prototype.getDatabaseType=function(t){return"MUSTBESET"===t?null:void 0===this._databaseTypeMetaData[t]?null:this._databaseTypeMetaData[t]},t.prototype.setDatabaseType=function(t,e){this._databaseTypeMetaData[t]=e},t.prototype.getLayerInfo=function(t){return void 0===this._layerInfo[t]?null:this._layerInfo[t]},t.prototype.setLayerInfo=function(t,e){this._layerInfo[t]=e},t.prototype.clearLayerInfo=function(t){void 0!==this._layerInfo[t]&&delete this._layerInfo[t]},t.applicationCache=null,t}()}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/support/sha.js": /*!*********************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/support/sha.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. /** * @preserve A JavaScript implementation of the SHA family of hashes, as * defined in FIPS PUB 180-2 as well as the corresponding HMAC implementation * as defined in FIPS PUB 198a * * Copyright Brian Turek 2008-2015 * Distributed under the BSD License * See http://caligatio.github.com/jsSHA/ for more information * * Several functions taken from Paul Johnston */ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function(r,e){function n(r,e){var n,t,h,i,o=[],w=[],d=0;if("UTF8"===e)for(t=0;t<r.length;t+=1)for(n=r.charCodeAt(t),w=[],128>n?w.push(n):2048>n?(w.push(192|n>>>6),w.push(128|63&n)):55296>n||57344<=n?w.push(224|n>>>12,128|n>>>6&63,128|63&n):(t+=1,n=65536+((1023&n)<<10|1023&r.charCodeAt(t)),w.push(240|n>>>18,128|n>>>12&63,128|n>>>6&63,128|63&n)),h=0;h<w.length;h+=1){for(i=d>>>2;o.length<=i;)o.push(0);o[i]|=w[h]<<24-d%4*8,d+=1}else if("UTF16BE"===e||"UTF16LE"===e)for(t=0;t<r.length;t+=1){for(n=r.charCodeAt(t),"UTF16LE"===e&&(h=255&n,n=h<<8|n>>8),i=d>>>2;o.length<=i;)o.push(0);o[i]|=n<<16-d%4*8,d+=2}return{value:o,binLen:8*d}}function t(r){var e,n,t,h=[],i=r.length;if(0!=i%2)throw"String of HEX type must be in byte increments";for(e=0;e<i;e+=2){if(n=parseInt(r.substr(e,2),16),isNaN(n))throw"String of HEX type contains invalid characters";for(t=e>>>3;h.length<=t;)h.push(0);h[e>>>3]|=n<<24-e%8*4}return{value:h,binLen:4*i}}function h(r){var e,n,t,h=[];for(n=0;n<r.length;n+=1)e=r.charCodeAt(n),t=n>>>2,h.length<=t&&h.push(0),h[t]|=e<<24-n%4*8;return{value:h,binLen:8*r.length}}function i(r){var e,n,t,h,i,o,w,d=[],u=0,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";if(-1===r.search(/^[a-zA-Z0-9=+\/]+$/))throw"Invalid character in base-64 string";if(o=r.indexOf("="),r=r.replace(/\=/g,""),-1!==o&&o<r.length)throw"Invalid '=' found in base-64 string";for(n=0;n<r.length;n+=4){for(i=r.substr(n,4),h=0,t=0;t<i.length;t+=1)e=l.indexOf(i[t]),h|=e<<18-6*t;for(t=0;t<i.length-1;t+=1){for(w=u>>>2;d.length<=w;)d.push(0);d[w]|=(h>>>16-8*t&255)<<24-u%4*8,u+=1}}return{value:d,binLen:8*u}}function o(r,e){var n,t,h="0123456789abcdef",i="",o=4*r.length;for(n=0;n<o;n+=1)t=r[n>>>2]>>>8*(3-n%4),i+=h.charAt(t>>>4&15)+h.charAt(15&t);return e.outputUpper?i.toUpperCase():i}function w(r,e){var n,t,h,i,o,w,d="",u=4*r.length;for(n=0;n<u;n+=3)for(i=n+1>>>2,o=r.length<=i?0:r[i],i=n+2>>>2,w=r.length<=i?0:r[i],h=(r[n>>>2]>>>8*(3-n%4)&255)<<16|(o>>>8*(3-(n+1)%4)&255)<<8|w>>>8*(3-(n+2)%4)&255,t=0;t<4;t+=1)8*n+6*t<=32*r.length?d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h>>>6*(3-t)&63):d+=e.b64Pad;return d}function d(r,e){var n,t,h="",i=4*r.length;for(n=0;n<i;n+=1)t=r[n>>>2]>>>8*(3-n%4)&255,h+=String.fromCharCode(t);return h}function u(r){var e={outputUpper:!1,b64Pad:"="};try{r.hasOwnProperty("outputUpper")&&(e.outputUpper=r.outputUpper),r.hasOwnProperty("b64Pad")&&(e.b64Pad=r.b64Pad)}catch(r){}if("boolean"!=typeof e.outputUpper)throw"Invalid outputUpper formatting option";if("string"!=typeof e.b64Pad)throw"Invalid b64Pad formatting option";return e}function l(r,e){return r<<e|r>>>32-e}function s(r,e){return r>>>e|r<<32-e}function f(r,e){var n=new I(r.highOrder,r.lowOrder);return 32>=e?new I(n.highOrder>>>e|n.lowOrder<<32-e&4294967295,n.lowOrder>>>e|n.highOrder<<32-e&4294967295):new I(n.lowOrder>>>e-32|n.highOrder<<64-e&4294967295,n.highOrder>>>e-32|n.lowOrder<<64-e&4294967295)}function O(r,e){return r>>>e}function a(r,e){return 32>=e?new I(r.highOrder>>>e,r.lowOrder>>>e|r.highOrder<<32-e&4294967295):new I(0,r.highOrder>>>e-32)}function g(r,e,n){return r^e^n}function c(r,e,n){return r&e^~r&n}function p(r,e,n){return new I(r.highOrder&e.highOrder^~r.highOrder&n.highOrder,r.lowOrder&e.lowOrder^~r.lowOrder&n.lowOrder)}function H(r,e,n){return r&e^r&n^e&n}function v(r,e,n){return new I(r.highOrder&e.highOrder^r.highOrder&n.highOrder^e.highOrder&n.highOrder,r.lowOrder&e.lowOrder^r.lowOrder&n.lowOrder^e.lowOrder&n.lowOrder)}function T(r){return s(r,2)^s(r,13)^s(r,22)}function b(r){var e=f(r,28),n=f(r,34),t=f(r,39);return new I(e.highOrder^n.highOrder^t.highOrder,e.lowOrder^n.lowOrder^t.lowOrder)}function S(r){return s(r,6)^s(r,11)^s(r,25)}function A(r){var e=f(r,14),n=f(r,18),t=f(r,41);return new I(e.highOrder^n.highOrder^t.highOrder,e.lowOrder^n.lowOrder^t.lowOrder)}function E(r){return s(r,7)^s(r,18)^O(r,3)}function m(r){var e=f(r,1),n=f(r,8),t=a(r,7);return new I(e.highOrder^n.highOrder^t.highOrder,e.lowOrder^n.lowOrder^t.lowOrder)}function B(r){return s(r,17)^s(r,19)^O(r,10)}function L(r){var e=f(r,19),n=f(r,61),t=a(r,6);return new I(e.highOrder^n.highOrder^t.highOrder,e.lowOrder^n.lowOrder^t.lowOrder)}function U(r,e){var n=(65535&r)+(65535&e);return(65535&(r>>>16)+(e>>>16)+(n>>>16))<<16|65535&n}function y(r,e,n,t){var h=(65535&r)+(65535&e)+(65535&n)+(65535&t);return(65535&(r>>>16)+(e>>>16)+(n>>>16)+(t>>>16)+(h>>>16))<<16|65535&h}function X(r,e,n,t,h){var i=(65535&r)+(65535&e)+(65535&n)+(65535&t)+(65535&h);return(65535&(r>>>16)+(e>>>16)+(n>>>16)+(t>>>16)+(h>>>16)+(i>>>16))<<16|65535&i}function F(r,e){var n,t,h,i;return n=(65535&r.lowOrder)+(65535&e.lowOrder),t=(r.lowOrder>>>16)+(e.lowOrder>>>16)+(n>>>16),h=(65535&t)<<16|65535&n,n=(65535&r.highOrder)+(65535&e.highOrder)+(t>>>16),t=(r.highOrder>>>16)+(e.highOrder>>>16)+(n>>>16),i=(65535&t)<<16|65535&n,new I(i,h)}function C(r,e,n,t){var h,i,o,w;return h=(65535&r.lowOrder)+(65535&e.lowOrder)+(65535&n.lowOrder)+(65535&t.lowOrder),i=(r.lowOrder>>>16)+(e.lowOrder>>>16)+(n.lowOrder>>>16)+(t.lowOrder>>>16)+(h>>>16),o=(65535&i)<<16|65535&h,h=(65535&r.highOrder)+(65535&e.highOrder)+(65535&n.highOrder)+(65535&t.highOrder)+(i>>>16),i=(r.highOrder>>>16)+(e.highOrder>>>16)+(n.highOrder>>>16)+(t.highOrder>>>16)+(h>>>16),w=(65535&i)<<16|65535&h,new I(w,o)}function P(r,e,n,t,h){var i,o,w,d;return i=(65535&r.lowOrder)+(65535&e.lowOrder)+(65535&n.lowOrder)+(65535&t.lowOrder)+(65535&h.lowOrder),o=(r.lowOrder>>>16)+(e.lowOrder>>>16)+(n.lowOrder>>>16)+(t.lowOrder>>>16)+(h.lowOrder>>>16)+(i>>>16),w=(65535&o)<<16|65535&i,i=(65535&r.highOrder)+(65535&e.highOrder)+(65535&n.highOrder)+(65535&t.highOrder)+(65535&h.highOrder)+(o>>>16),o=(r.highOrder>>>16)+(e.highOrder>>>16)+(n.highOrder>>>16)+(t.highOrder>>>16)+(h.highOrder>>>16)+(i>>>16),d=(65535&o)<<16|65535&i,new I(d,w)}function Y(r,e){var n,t,h,i,o,w,d,u,s,f,O=[],a=c,p=g,v=H,T=l,b=U,S=X,A=[1732584193,4023233417,2562383102,271733878,3285377520];for(f=15+(e+65>>>9<<4);r.length<=f;)r.push(0);for(r[e>>>5]|=128<<24-e%32,r[f]=e,s=r.length,d=0;d<s;d+=16){for(n=A[0],t=A[1],h=A[2],i=A[3],o=A[4],u=0;u<80;u+=1)O[u]=u<16?r[u+d]:T(O[u-3]^O[u-8]^O[u-14]^O[u-16],1),w=u<20?S(T(n,5),a(t,h,i),o,1518500249,O[u]):u<40?S(T(n,5),p(t,h,i),o,1859775393,O[u]):u<60?S(T(n,5),v(t,h,i),o,2400959708,O[u]):S(T(n,5),p(t,h,i),o,3395469782,O[u]),o=i,i=h,h=T(t,30),t=n,n=w;A[0]=b(n,A[0]),A[1]=b(t,A[1]),A[2]=b(h,A[2]),A[3]=b(i,A[3]),A[4]=b(o,A[4])}return A}function x(r,e,n){var t,h,i,o,w,d,u,l,s,f,O,a,g,Y,x,M,N,q,z,R,Z,j,D,G,J,K,Q,V,W,$,_,rr,er=[],nr=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],tr=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],hr=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];if(("SHA-224"===n||"SHA-256"===n)&&2&k)a=64,g=15+(e+65>>>9<<4),M=16,N=1,Q=Number,q=U,z=y,R=X,Z=E,j=B,D=T,G=S,K=H,J=c,O="SHA-224"===n?tr:hr;else{if("SHA-384"!==n&&"SHA-512"!==n||!(4&k))throw"Unexpected error in SHA-2 implementation";a=80,g=31+(e+128>>>10<<5),M=32,N=2,Q=I,q=F,z=C,R=P,Z=m,j=L,D=b,G=A,K=v,J=p,nr=[new Q(nr[0],3609767458),new Q(nr[1],602891725),new Q(nr[2],3964484399),new Q(nr[3],2173295548),new Q(nr[4],4081628472),new Q(nr[5],3053834265),new Q(nr[6],2937671579),new Q(nr[7],3664609560),new Q(nr[8],2734883394),new Q(nr[9],1164996542),new Q(nr[10],1323610764),new Q(nr[11],3590304994),new Q(nr[12],4068182383),new Q(nr[13],991336113),new Q(nr[14],633803317),new Q(nr[15],3479774868),new Q(nr[16],2666613458),new Q(nr[17],944711139),new Q(nr[18],2341262773),new Q(nr[19],2007800933),new Q(nr[20],1495990901),new Q(nr[21],1856431235),new Q(nr[22],3175218132),new Q(nr[23],2198950837),new Q(nr[24],3999719339),new Q(nr[25],766784016),new Q(nr[26],2566594879),new Q(nr[27],3203337956),new Q(nr[28],1034457026),new Q(nr[29],2466948901),new Q(nr[30],3758326383),new Q(nr[31],168717936),new Q(nr[32],1188179964),new Q(nr[33],1546045734),new Q(nr[34],1522805485),new Q(nr[35],2643833823),new Q(nr[36],2343527390),new Q(nr[37],1014477480),new Q(nr[38],1206759142),new Q(nr[39],344077627),new Q(nr[40],1290863460),new Q(nr[41],3158454273),new Q(nr[42],3505952657),new Q(nr[43],106217008),new Q(nr[44],3606008344),new Q(nr[45],1432725776),new Q(nr[46],1467031594),new Q(nr[47],851169720),new Q(nr[48],3100823752),new Q(nr[49],1363258195),new Q(nr[50],3750685593),new Q(nr[51],3785050280),new Q(nr[52],3318307427),new Q(nr[53],3812723403),new Q(nr[54],2003034995),new Q(nr[55],3602036899),new Q(nr[56],1575990012),new Q(nr[57],1125592928),new Q(nr[58],2716904306),new Q(nr[59],442776044),new Q(nr[60],593698344),new Q(nr[61],3733110249),new Q(nr[62],2999351573),new Q(nr[63],3815920427),new Q(3391569614,3928383900),new Q(3515267271,566280711),new Q(3940187606,3454069534),new Q(4118630271,4000239992),new Q(116418474,1914138554),new Q(174292421,2731055270),new Q(289380356,3203993006),new Q(460393269,320620315),new Q(685471733,587496836),new Q(852142971,1086792851),new Q(1017036298,365543100),new Q(1126000580,2618297676),new Q(1288033470,3409855158),new Q(1501505948,4234509866),new Q(1607167915,987167468),new Q(1816402316,1246189591)],O="SHA-384"===n?[new Q(3418070365,tr[0]),new Q(1654270250,tr[1]),new Q(2438529370,tr[2]),new Q(355462360,tr[3]),new Q(1731405415,tr[4]),new Q(41048885895,tr[5]),new Q(3675008525,tr[6]),new Q(1203062813,tr[7])]:[new Q(hr[0],4089235720),new Q(hr[1],2227873595),new Q(hr[2],4271175723),new Q(hr[3],1595750129),new Q(hr[4],2917565137),new Q(hr[5],725511199),new Q(hr[6],4215389547),new Q(hr[7],327033209)]}for(;r.length<=g;)r.push(0);for(r[e>>>5]|=128<<24-e%32,r[g]=e,_=r.length,Y=0;Y<_;Y+=M){for(t=O[0],h=O[1],i=O[2],o=O[3],w=O[4],d=O[5],u=O[6],l=O[7],x=0;x<a;x+=1)x<16?($=x*N+Y,V=r.length<=$?0:r[$],W=r.length<=$+1?0:r[$+1],er[x]=new Q(V,W)):er[x]=z(j(er[x-2]),er[x-7],Z(er[x-15]),er[x-16]),s=R(l,G(w),J(w,d,u),nr[x],er[x]),f=q(D(t),K(t,h,i)),l=u,u=d,d=w,w=q(o,s),o=i,i=h,h=t,t=q(s,f);O[0]=q(t,O[0]),O[1]=q(h,O[1]),O[2]=q(i,O[2]),O[3]=q(o,O[3]),O[4]=q(w,O[4]),O[5]=q(d,O[5]),O[6]=q(u,O[6]),O[7]=q(l,O[7])}if("SHA-224"===n&&2&k)rr=[O[0],O[1],O[2],O[3],O[4],O[5],O[6]];else if("SHA-256"===n&&2&k)rr=O;else if("SHA-384"===n&&4&k)rr=[O[0].highOrder,O[0].lowOrder,O[1].highOrder,O[1].lowOrder,O[2].highOrder,O[2].lowOrder,O[3].highOrder,O[3].lowOrder,O[4].highOrder,O[4].lowOrder,O[5].highOrder,O[5].lowOrder];else{if(!("SHA-512"===n&&4&k))throw"Unexpected error in SHA-2 implementation";rr=[O[0].highOrder,O[0].lowOrder,O[1].highOrder,O[1].lowOrder,O[2].highOrder,O[2].lowOrder,O[3].highOrder,O[3].lowOrder,O[4].highOrder,O[4].lowOrder,O[5].highOrder,O[5].lowOrder,O[6].highOrder,O[6].lowOrder,O[7].highOrder,O[7].lowOrder]}return rr}var k=7,I=function(){function r(r,e){this.highOrder=r,this.lowOrder=e}return r}();return function(){function r(r,e,o){this.strBinLen=0,this.strToHash=null,this.utfType="";var w=null;if(this.strToHash=[0],this.strBinLen=0,this.utfType=o||"UTF8","UTF8"!==this.utfType&&"UTF16BE"!==this.utfType&&"UTF16LE"!==this.utfType)throw"encoding must be UTF8, UTF16BE, or UTF16LE";if("HEX"===e){if(0!=r.length%2)throw"srcString of HEX type must be in byte increments";w=t(r),this.strBinLen=w.binLen,this.strToHash=w.value}else if("TEXT"===e)w=n(r,this.utfType),this.strBinLen=w.binLen,this.strToHash=w.value;else if("B64"===e)w=i(r),this.strBinLen=w.binLen,this.strToHash=w.value;else{if("BYTES"!==e)throw"inputFormat must be HEX, TEXT, B64, or BYTES";w=h(r),this.strBinLen=w.binLen,this.strToHash=w.value}}return r.prototype.getHash=function(r,e,n,t){var h,i=null,l=this.strToHash.slice(),s=this.strBinLen;if(3===arguments.length?"number"!=typeof n&&(t=n,n=1):2===arguments.length&&(n=1),n!==parseInt(n,10)||1>n)throw"numRounds must a integer >= 1";switch(e){case"HEX":i=o;break;case"B64":i=w;break;case"BYTES":i=d;break;default:throw"format must be HEX, B64, or BYTES"}if("SHA-1"===r&&1&k)for(h=0;h<n;h+=1)l=Y(l,s),s=160;else if("SHA-224"===r&&2&k)for(h=0;h<n;h+=1)l=x(l,s,r),s=224;else if("SHA-256"===r&&2&k)for(h=0;h<n;h+=1)l=x(l,s,r),s=256;else if("SHA-384"===r&&4&k)for(h=0;h<n;h+=1)l=x(l,s,r),s=384;else{if(!("SHA-512"===r&&4&k))throw"Chosen SHA variant is not supported";for(h=0;h<n;h+=1)l=x(l,s,r),s=512}return i(l,u(t))},r.prototype.getHMAC=function(r,e,l,s,f){var O,a,g,c,p,H,v,T,b,S=[],A=[],E=null;switch(s){case"HEX":O=o;break;case"B64":O=w;break;case"BYTES":O=d;break;default:throw"outputFormat must be HEX, B64, or BYTES"}if("SHA-1"===l&&1&k)g=64,b=160;else if("SHA-224"===l&&2&k)g=64,b=224;else if("SHA-256"===l&&2&k)g=64,b=256;else if("SHA-384"===l&&4&k)g=128,b=384;else{if(!("SHA-512"===l&&4&k))throw"Chosen SHA variant is not supported";g=128,b=512}if("HEX"===e)E=t(r),T=E.binLen,a=E.value;else if("TEXT"===e)E=n(r,this.utfType),T=E.binLen,a=E.value;else if("B64"===e)E=i(r),T=E.binLen,a=E.value;else{if("BYTES"!==e)throw"inputFormat must be HEX, TEXT, B64, or BYTES";E=h(r),T=E.binLen,a=E.value}if(c=8*g,v=g/4-1,g<T/8){if("SHA-1"===l&&1&k)a=Y(a,T);else{if(!(6&k))throw"Unexpected error in HMAC implementation";a=x(a,T,l)}for(;a.length<=v;)a.push(0);a[v]&=4294967040}else if(g>T/8){for(;a.length<=v;)a.push(0);a[v]&=4294967040}for(p=0;p<=v;p+=1)S[p]=909522486^a[p],A[p]=1549556828^a[p];if("SHA-1"===l&&1&k)H=Y(A.concat(Y(S.concat(this.strToHash),c+this.strBinLen)),c+b);else{if(!(6&k))throw"Unexpected error in HMAC implementation";H=x(A.concat(x(S.concat(this.strToHash),c+this.strBinLen,l)),c+b,l)}return O(H,u(f))},r}()}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js": /*!************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/support/shared.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../../geometry/Extent */ "./node_modules/arcgis-js-api/geometry/Extent.js"),__webpack_require__(/*! ../../../layers/support/Field */ "./node_modules/arcgis-js-api/layers/support/Field.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,r,n,o){function i(e){return o.fromJSON(e.toJSON())}function u(e){return e.toJSON()}function l(e){return"string"==typeof e||e instanceof String}function s(e){return"boolean"==typeof e}function a(e){return"number"==typeof e}function c(e){return e instanceof Array}function y(e){return e instanceof Date}function f(e,t){return e===t||!(!y(e)||!y(t))&&e.getTime()===t.getTime()}function p(e){var t={};for(var r in e)t[r]=e[r];return t}function m(e){if(void 0===e)return null;if("number"==typeof e)return e;switch(e.toLowerCase()){case"meters":case"meter":return 109404;case"miles":case"mile":return 109413;case"kilometers":case"kilometer":case"km":return 109414}return null}function v(e){if(null===e)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new n({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}return null}function d(e){if(void 0===e)return null;if("number"==typeof e)return e;if("number"==typeof e)return e;switch(e.toLowerCase()){case"meters":case"meter":return 9001;case"miles":case"mile":return 9035;case"kilometers":case"kilometer":case"km":return 9036}return null}function S(e,t){return e===t||("point"===e&&"esriGeometryPoint"===t||("polyline"===e&&"esriGeometryPolyline"===t||("polygon"===e&&"esriGeometryPolygon"===t||("extent"===e&&"esriGeometryEnvelope"===t||("multipoint"===e&&"esriGeometryMultipoint"===t||("point"===t&&"esriGeometryPoint"===e||("polyline"===t&&"esriGeometryPolyline"===e||("polygon"===t&&"esriGeometryPolygon"===e||("extent"===t&&"esriGeometryEnvelope"===e||"multipoint"===t&&"esriGeometryMultipoint"===e)))))))))}function G(e){return function(t){e.reject(t)}}function g(e,t){return function(r){try{e.apply(null,arguments)}catch(e){t.reject(e)}}}function x(e){switch(e){case"point":return"esriGeometryPoint";case"polygon":return"esriGeometryPolygon";case"multipoint":return"esriGeometryMultipoint";case"polyline":return"esriGeometryPolyline";default:return"esriGeometryPoint"}}function P(e,t,n){return r.create(function(n,o){var i=r.resolve(!0);e.reduce(function(e,n,o,i){return e.then(function(e){try{return t(e,n,o,i)}catch(e){return r.reject(e)}},function(e){return r.reject(e)})},i).then(n,o)})}function b(e){return void 0===e?"":(e=e.replace(/\/featureserver\/[0-9]*/i,"/FeatureServer"),e=e.replace(/\/mapserver\/[0-9]*/i,"/MapServer"),e=e.split("?")[0])}function N(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&function(e){return function(t){return function(r,n){var o={key:r,value:t[r]},i={key:n,value:t[n]};return e(o,i)}}}(t.cmp),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var i,u;if(Array.isArray(t)){for(u="[",i=0;i<t.length;i++)i&&(u+=","),u+=e(t[i])||"null";return u+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var l=o.push(t)-1,s=Object.keys(t).sort(n&&n(t));for(u="",i=0;i<s.length;i++){var a=s[i],c=e(t[a]);c&&(u&&(u+=","),u+=JSON.stringify(a)+":"+c)}return o.splice(l,1),"{"+u+"}"}}(e)}Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.Standardised=0]="Standardised",e[e.StandardisedNoInterval=1]="StandardisedNoInterval",e[e.SqlServer=2]="SqlServer",e[e.Oracle=3]="Oracle",e[e.Postgres=4]="Postgres",e[e.PGDB=5]="PGDB",e[e.FILEGDB=6]="FILEGDB",e[e.NotEvaluated=7]="NotEvaluated"}(t.FeatureServiceDatabaseType||(t.FeatureServiceDatabaseType={})),t.cloneField=i,t.esriFieldToJson=u;!function(e){e[e.InFeatureSet=0]="InFeatureSet",e[e.NotInFeatureSet=1]="NotInFeatureSet",e[e.Unknown=2]="Unknown"}(t.IdState||(t.IdState={})),t.isString=l,t.isBoolean=s,t.isNumber=a,t.isArray=c,t.isDate=y,t.equalityTest=f,t.cloneAttributes=p,t.convertSquareUnitsToCode=m,t.shapeExtent=v,t.convertLinearUnitsToCode=d,t.sameGeomType=S,t.defaultMaxRecords=1e3,t.errback=G,t.callback=g,t.layerGeometryEsriConstants={point:"point",polygon:"polygon",polyline:"polyline",multipoint:"multipoint",extent:"extent",esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint",esriGeometryEnvelope:"extent",envelope:"extent"},t.toEsriGeometryType=x,t.reduceArrayWithPromises=P,t.extractServiceUrl=b,t.stableStringify=N}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js": /*!**************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../languageUtils */ "./node_modules/arcgis-js-api/arcade/languageUtils.js"),__webpack_require__(/*! ./shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../../../core/sql/WhereClause */ "./node_modules/arcgis-js-api/core/sql/WhereClause.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,r,a,t,n){function s(e,r){return i(e.parseTree,r,e.parameters)}function o(e,r,a){return i(e,r,a)}function c(e,r,a,s){return n.WhereClause.create(i(e.parseTree,t.FeatureServiceDatabaseType.Standardised,e.parameters,r,a),s)}function u(e,r,a){return void 0===a&&(a="AND"),n.WhereClause.create("(("+s(e,t.FeatureServiceDatabaseType.Standardised)+")"+a+"("+s(r,t.FeatureServiceDatabaseType.Standardised)+"))",e.fieldsIndex)}function i(e,r,a,t,n){void 0===t&&(t=null),void 0===n&&(n=null);var s,o,c,u;switch(e.type){case"interval":return m(i(e.value,r,a,t,n),e.qualifier,e.op,r);case"case_expression":var d=" CASE ";"simple"===e.format&&(d+=i(e.operand,r,a,t,n));for(var g=0;g<e.clauses.length;g++)d+=" WHEN "+i(e.clauses[g].operand,r,a,t,n)+" THEN "+i(e.clauses[g].value,r,a,t,n);return null!==e.else&&(d+=" ELSE "+i(e.else,r,a,t,n)),d+=" END ";case"param":var T=a[e.value.toLowerCase()];if("string"==typeof T){return"'"+a[e.value.toLowerCase()].toString().replace(/'/g,"''")+"'"}if(T instanceof Date)return p(T,r);if(T instanceof Array){for(var v=[],g=0;g<T.length;g++)"string"==typeof T[g]?v.push("'"+T[g].toString().replace(/'/g,"''")+"'"):T[g]instanceof Date?v.push(p(T[g],r)):v.push(T[g].toString());return v}return T.toString();case"expr_list":o=[];for(var h=0,E=e.value;h<E.length;h++){var S=E[h];o.push(i(S,r,a,t,n))}return o;case"unary_expr":return" ( NOT "+i(e.expr,r,a,t,n)+" ) ";case"binary_expr":switch(e.operator){case"AND":return" ("+i(e.left,r,a,t,n)+" AND "+i(e.right,r,a,t,n)+") ";case"OR":return" ("+i(e.left,r,a,t,n)+" OR "+i(e.right,r,a,t,n)+") ";case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+i(e.left,r,a,t,n)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+i(e.left,r,a,t,n)+" IS NOT NULL )";case"IN":return s=[],"expr_list"===e.right.type?(s=i(e.right,r,a,t,n)," ("+i(e.left,r,a,t,n)+" IN ("+s.join(",")+")) "):(u=i(e.right,r,a,t,n),u instanceof Array?" ("+i(e.left,r,a,t,n)+" IN ("+u.join(",")+")) ":" ("+i(e.left,r,a,t,n)+" IN ("+u+")) ");case"NOT IN":return s=[],"expr_list"===e.right.type?(s=i(e.right,r,a,t,n)," ("+i(e.left,r,a,t,n)+" NOT IN ("+s.join(",")+")) "):(u=i(e.right,r,a,t,n),u instanceof Array?" ("+i(e.left,r,a,t,n)+" NOT IN ("+u.join(",")+")) ":" ("+i(e.left,r,a,t,n)+" NOT IN ("+u+")) ");case"BETWEEN":return c=i(e.right,r,a,t,n)," ("+i(e.left,r,a,t,n)+" BETWEEN "+c[0]+" AND "+c[1]+" ) ";case"NOTBETWEEN":return c=i(e.right,r,a,t,n)," ("+i(e.left,r,a,t,n)+" NOT BETWEEN "+c[0]+" AND "+c[1]+" ) ";case"LIKE":return""!==e.escape?" ("+i(e.left,r,a,t,n)+" LIKE "+i(e.right,r,a,t,n)+" ESCAPE '"+e.escape+"') ":" ("+i(e.left,r,a,t,n)+" LIKE "+i(e.right,r,a,t,n)+") ";case"NOT LIKE":return""!==e.escape?" ("+i(e.left,r,a,t,n)+" NOT LIKE "+i(e.right,r,a,t,n)+" ESCAPE '"+e.escape+"') ":" ("+i(e.left,r,a,t,n)+" NOT LIKE "+i(e.right,r,a,t,n)+") ";case"<>":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+i(e.left,r,a,t,n)+" "+e.operator+" "+i(e.right,r,a,t,n)+") "}throw new Error("Not Supported Operator "+e.operator);case"null":return"null";case"bool":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return p(e.value,r);case"number":return e.value.toString();case"column_ref":return"CURRENT_DATE"===e.column.toUpperCase()?f(!0,r):"CURRENT_TIMESTAMP"===e.column.toUpperCase()?f(!1,r):t&&t.toLowerCase()===e.column.toLowerCase()?"("+n+")":e.column;case"function":var D=i(e.args,r,a,t,n);return l(e.name,D,r)}throw new Error("Unsupported sql syntax "+e.type)}function l(e,r,a){switch(e.toLowerCase().trim()){case"abs":if(1!==r.length)throw new Error("Invalid Parameter for call to ABS");return"abs("+r[0]+")";case"ceiling":case"ceil":if(1!==r.length)throw new Error("Invalid Parameter for call to CEILING");switch(a){case t.FeatureServiceDatabaseType.Standardised:case t.FeatureServiceDatabaseType.StandardisedNoInterval:default:return"CEILING("+r[0]+")"}case"floor":if(1!==r.length)throw new Error("Invalid Parameter for call to Floor");return"FLOOR("+r[0]+")";case"log":if(1!==r.length)throw new Error("Invalid Parameter for call to LOG");return"LOG("+r[0]+")";case"log10":if(1!==r.length)throw new Error("Invalid Parameter for call to LOG10");return"LOG10("+r[0]+")";case"power":if(2!==r.length)throw new Error("Invalid Parameter for call to POWER");return"POWER("+r[0]+","+r[1]+")";case"round":if(2===r.length)return"ROUND("+r[0]+","+r[1]+")";if(1===r.length)return"ROUND("+r[0]+")";throw new Error("Invalid Parameter for call to ROUND");case"truncate":if(r.length<1||r.length>2)throw new Error("Invalid Parameter for TRUNCATE function");switch(a){case t.FeatureServiceDatabaseType.SqlServer:return"ROUND("+r[0]+(1===r.length?"0":","+r[1])+",1)";default:return"TRUNCATE("+r[0]+(1===r.length?")":","+r[1]+")")}case"char_length":case"len":if(1!==r.length)throw new Error("Invalid Parameter for CHAR_LENGTH function");switch(a){case t.FeatureServiceDatabaseType.SqlServer:return"LEN("+r[0]+")";case t.FeatureServiceDatabaseType.Oracle:return"LENGTH("+r[0]+")";default:return"CHAR_LENGTH("+r[0]+")"}case"concat":if(r.length<1)throw new Error("Invalid Parameter for CONCAT function");for(var n="CONCAT(",s=0;s<r.length;s++)0!==s&&(n+=","),n+=r[s];return n+=")";case"lower":case"lcase":if(1!==r.length)throw new Error("Invalid Parameter for Lower function");return"LOWER("+r[0]+")";case"upper":case"ucase":if(1!==r.length)throw new Error("Invalid Parameter for Upper function");return"UPPER("+r[0]+")";case"substring":var o="";switch(a){case t.FeatureServiceDatabaseType.Oracle:return o="SUBSTR("+r[0]+","+r[1],3===r.length&&(o+=","+r[2]),o+=")";case t.FeatureServiceDatabaseType.SqlServer:return o=3===r.length?"SUBSTRING("+r[0]+","+r[1]+","+r[2]+")":"SUBSTRING("+r[0]+", "+r[1]+", LEN("+r[0]+") - "+r[1]+")";default:return o="SUBSTRING("+r[0]+" FROM "+r[1],3===r.length&&(o+=" FOR "+r[2]),o+=")"}case"extract":return"EXTRACT("+r[0].replace(/\'/g,"")+" FROM "+r[1]+")"}throw new Error("Function Not Recognised")}function p(e,r){var n=a.MomentLibrary.Moment(e),s=0===n.minute()&&0===n.hour()&&0===n.second()&&0===n.millisecond();switch(r){case t.FeatureServiceDatabaseType.FILEGDB:case t.FeatureServiceDatabaseType.Standardised:case t.FeatureServiceDatabaseType.StandardisedNoInterval:return s?"date '"+n.format("YYYY-MM-DD")+"'":"date '"+n.format("YYYY-MM-DD HH:mm:ss")+"'";case t.FeatureServiceDatabaseType.Oracle:return s?"TO_DATE('"+n.format("YYYY-MM-DD")+"','YYYY-MM-DD')":"TO_DATE('"+n.format("YYYY-MM-DD HH:mm:ss")+"','YYYY-MM-DD HH24:MI:SS')";case t.FeatureServiceDatabaseType.SqlServer:return"'"+n.format(s?"YYYY-MM-DD":"YYYY-MM-DD HH:mm:ss")+"'";case t.FeatureServiceDatabaseType.PGDB:return"#"+n.format(s?"MM-DD-YYYY":"MM-DD-YYYY HH:mm:ss")+"#";case t.FeatureServiceDatabaseType.Postgres:return"TIMESTAMP '"+n.format(s?"YYYY-MM-DD":"YYYY-MM-DD HH:mm:ss")+"'";default:return"date '"+n.format("YYYY-MM-DD HH:mm:ss")+"'"}}function f(e,r){switch(r){case t.FeatureServiceDatabaseType.FILEGDB:case t.FeatureServiceDatabaseType.Standardised:case t.FeatureServiceDatabaseType.StandardisedNoInterval:case t.FeatureServiceDatabaseType.Oracle:return e?"CURRENT_DATE":"CURRENT_TIMESTAMP";case t.FeatureServiceDatabaseType.SqlServer:return e?"CAST(GETDATE() AS DATE)":"GETDATE()";case t.FeatureServiceDatabaseType.PGDB:case t.FeatureServiceDatabaseType.Postgres:default:return e?"CURRENT_DATE":"CURRENT_TIMESTAMP"}}function d(e,r,a){void 0===a&&(a={});for(var t={},n={},s={esriFieldTypeSmallInteger:"integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"double",esriFieldTypeDouble:"double",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"integer",oid:"integer",long:"integer","small-integer":"integer",integer:"integer",single:"double",double:"double",date:"date",string:"string"},o=0,c=r;o<c.length;o++){var u=c[o],i=s[u.type];t[u.name.toLowerCase()]=void 0===i?"":i}for(var u in a){var i=s[a[u]];n[u.toLowerCase()]=void 0===i?"":i}switch(g(t,e.parseTree,e.parameters,n)){case"double":return"double";case"integer":return"integer";case"double":return"double";case"date":return"date";case"string":return"string"}return""}function g(e,r,a,t){var n;switch(r.type){case"interval":return"integer";case"case_expression":var s=[];if("simple"===r.format){for(var o=0;o<r.clauses.length;o++)s.push(g(e,r.clauses[o].value,a,t));null!==r.else&&s.push(g(e,r.else,a,t))}else{for(var o=0;o<r.clauses.length;o++)s.push(g(e,r.else,a,t));null!==r.else&&s.push(g(e,r.else,a,t))}return T(s);case"param":var c=t[r.value.toLowerCase()];if(void 0===c&&a){var u=a[r.value.toLowerCase()];if(void 0===u)return"";if(null===u)return"";if("string"==typeof u||u instanceof String)return"string";if("boolean"==typeof u)return"boolean";if(u instanceof Date)return"date";if("number"==typeof u)return u%1==0?"integer":"double"}return void 0===c?"":c;case"expr_list":for(var i=[],l=0,p=r.value;l<p.length;l++){var f=p[l];i.push(g(e,f,a,t))}return i;case"unary_expr":return"boolean";case"binary_expr":switch(r.operator){case"AND":case"OR":return"boolean";case"IS":case"ISNOT":if("null"!==r.right.type)throw new Error("Unsupported RHS for IS");return"boolean";case"IN":case"NOT IN":case"BETWEEN":case"NOTBETWEEN":case"LIKE":case"NOT LIKE":return"boolean";case"<>":case"<":case">":case">=":case"<=":case"=":return"boolean";case"*":case"-":case"+":case"/":return T([g(e,r.left,a,t),g(e,r.right,a,t)])}throw new Error("Not Supported Operator "+r.operator);case"null":return"";case"bool":return"boolean";case"string":return"string";case"number":return null===r.value?"":r.value%1==0?"integer":"double";case"date":case"timestamp":return"date";case"column_ref":if("CURRENT_DATE"===r.column.toUpperCase())return"date";if("CURRENT_TIMESTAMP"===r.column.toUpperCase())return"date";var d=e[r.column.toLowerCase()];return void 0===d?"":d;case"function":switch(r.name.toLowerCase()){case"position":case"extract":case"char_length":return"integer";case"round":return n=g(e,r.args,a,t),n instanceof Array?n.length>0?n[0]:"":n;case"sign":return n=g(e,r.args,a,t),n instanceof Array&&(n=T(n)),"integer"===n||"double"===n?n:"double";case"ceiling":case"floor":case"abs":var v=g(e,r.args,a,t);return v instanceof Array?T(v):v;case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"round":return n=g(e,r.args,a,t),n instanceof Array?n.length>0?n[0]:"":n}return""}throw new Error("Unsupported sql syntax "+r.type)}function T(e){if(e){for(var r="",a=0,t=e;a<t.length;a++){var n=t[a];""!==n&&(r=""===r?n:D[r]<D[n]?n:r)}return r}return""}function v(e,r){return E(e.parseTree,r)}function h(e){return"column_ref"===e.parseTree.type}function E(e,r){if(null===e||void 0===e)return!1;switch(e.type){case"when_clause":return E(e.operand,r)||E(e.value,r);case"case_expression":for(var a=0,t=e.clauses;a<t.length;a++){var n=t[a];if(E(n,r))return!0}return!("simple"!==e.format||!E(e.operand,r))||!(null===e.else||!E(e.else,r));case"param":return!1;case"expr_list":for(var s=0,o=e.value;s<o.length;s++){var n=o[s];if(E(n,r))return!0}return!1;case"unary_expr":return E(e.expr,r);case"binary_expr":return E(e.left,r)||E(e.right,r);case"null":case"bool":case"date":case"timestamp":case"string":case"number":return!1;case"column_ref":return r.toLowerCase()===e.column.toLowerCase();case"function":return E(e.args,r)}return!1}function S(e,r){var a="";return a+=e.period.toUpperCase()}function m(e,r,a,t){var n="";return n="interval-period"===r.type?S(r,t):S(r.start,t)+" TO "+S(r.end,t),"INTERVAL "+a+" "+e+" "+n}Object.defineProperty(r,"__esModule",{value:!0}),r.toWhereClause=s,r.toWhereClauseFromTree=o,r.reformulateWithoutField=c,r.combine=u,r.translateFunctionToDatabaseSpecific=l,r.makeDateString=p,r.makeToday=f,r.predictType=d;var D={boolean:1,string:2,integer:3,double:4,date:5};r.scanForField=v,r.isSingleField=h,r.convertIntervalToSql=m}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/featureset/support/stats.js": /*!***********************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/featureset/support/stats.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../../languageUtils */ "./node_modules/arcgis-js-api/arcade/languageUtils.js"),__webpack_require__(/*! ./shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ./sqlUtils */ "./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js"),__webpack_require__(/*! ../../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(t,n,e,r,u,a){function c(t){return t=+t,isFinite(t)?t-t%1||(t<0?-0:0===t?t:0):t}function i(t){for(var n=0,e=0;e<t.length;e++)n+=t[e];return n/t.length}function l(t){for(var n=i(t),e=0,r=0;r<t.length;r++)e+=Math.pow(n-t[r],2);return e/t.length}function o(t){for(var n=i(t),e=0,r=0;r<t.length;r++)e+=Math.pow(n-t[r],2);return e/(t.length-1)}function s(t){for(var n=0,e=0;e<t.length;e++)n+=t[e];return n}function h(t,n){for(var e=[],u={},a=[],c=0;c<t.length;c++){if(void 0!==t[c]&&null!==t[c]){var i=t[c];if(r.isNumber(i)||r.isString(i))void 0===u[i]&&(e.push(i),u[i]=1);else{for(var l=!1,o=0;o<a.length;o++)!0===r.equalityTest(a[o],i)&&(l=!0);!1===l&&(a.push(i),e.push(i))}}if(e.length>=n&&-1!==n)return e}return e}function f(t){switch(t.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function v(t,n,e){switch(void 0===e&&(e=1e3),t.toLowerCase()){case"distinct":return h(n,e);case"avg":case"mean":return i(n);case"min":return Math.min.apply(Math,n);case"sum":return s(n);case"max":return Math.max.apply(Math,n);case"stdev":case"stddev":return Math.sqrt(l(n));case"var":case"variance":return l(n);case"count":return n.length}return 0}function d(t,n,e){return w(t,n,e,!0).then(function(t){return 0===t.length?null:Math.min.apply(Math,t)})}function g(t,n,e){return w(t,n,e,!0).then(function(t){return 0===t.length?null:Math.max.apply(Math,t)})}function m(t,n,e){var r="";return!1===u.isSingleField(n)&&(r=u.predictType(n,t.fields,null)),w(t,n,e,!0).then(function(t){if(0===t.length)return null;var n=i(t);return null===n?n:"integer"===r?c(n):n})}function p(t,n,e){return w(t,n,e,!0).then(function(t){return 0===t.length?null:o(t)})}function M(t,n,e){return w(t,n,e,!0).then(function(t){return 0===t.length?null:Math.sqrt(o(t))})}function y(t,n,e){return w(t,n,e,!0).then(function(t){return 0===t.length?null:s(t)})}function x(t,n){try{return t.iterator(n).count()}catch(t){return a.reject(t)}}function w(t,n,e,r){void 0===r&&(r=!1);try{var u=t.iterator(e);return a.create(function(t,e){q(u,[],n,r,t,e)})}catch(t){return a.reject(t)}}function q(t,n,r,u,a,c){e.tick(t.next().then(function(e){try{if(null!==e){var i=r.calculateValue(e);return null===i?!1===u&&(n[n.length]=i):n[n.length]=i,q(t,n,r,u,a,c)}a(n)}catch(t){c(t)}},c))}function j(t,n,e,r){return void 0===e&&(e=1e3),void 0===r&&(r=null),S(t,n,e,r)}function S(t,n,e,r){try{return T(t.iterator(r),{},[],n,e)}catch(t){return a.reject(t)}}function T(t,n,e,r,u){return t.next().then(function(a){if(null!==a){var c=r.calculateValue(a);return void 0!==c&&null!==c&&void 0===n[c]&&(e.push(c),n[c]=1),e.length>=u&&-1!==u?e:T(t,n,e,r,u)}return e})}Object.defineProperty(n,"__esModule",{value:!0}),n.decodeStatType=f,n.calculateStat=v,n.min=d,n.max=g,n.mean=m,n.variance=p,n.stdev=M,n.sum=y,n.count=x,n.distinct=j}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/functions/featuresetbase.js": /*!***********************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/functions/featuresetbase.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../ArcadePortal */ "./node_modules/arcgis-js-api/arcade/ArcadePortal.js"),__webpack_require__(/*! ../Dictionary */ "./node_modules/arcgis-js-api/arcade/Dictionary.js"),__webpack_require__(/*! ../Dictionary */ "./node_modules/arcgis-js-api/arcade/Dictionary.js"),__webpack_require__(/*! ../Feature */ "./node_modules/arcgis-js-api/arcade/Feature.js"),__webpack_require__(/*! ../featureSetCollection */ "./node_modules/arcgis-js-api/arcade/featureSetCollection.js"),__webpack_require__(/*! ../featureSetUtils */ "./node_modules/arcgis-js-api/arcade/featureSetUtils.js"),__webpack_require__(/*! ../languageUtils */ "./node_modules/arcgis-js-api/arcade/languageUtils.js"),__webpack_require__(/*! ../featureset/actions/Adapted */ "./node_modules/arcgis-js-api/arcade/featureset/actions/Adapted.js"),__webpack_require__(/*! ../featureset/actions/AttributeFilter */ "./node_modules/arcgis-js-api/arcade/featureset/actions/AttributeFilter.js"),__webpack_require__(/*! ../featureset/actions/OrderBy */ "./node_modules/arcgis-js-api/arcade/featureset/actions/OrderBy.js"),__webpack_require__(/*! ../featureset/actions/Top */ "./node_modules/arcgis-js-api/arcade/featureset/actions/Top.js"),__webpack_require__(/*! ../featureset/sources/Empty */ "./node_modules/arcgis-js-api/arcade/featureset/sources/Empty.js"),__webpack_require__(/*! ../featureset/sources/FeatureLayerMemory */ "./node_modules/arcgis-js-api/arcade/featureset/sources/FeatureLayerMemory.js"),__webpack_require__(/*! ../featureset/support/OrderbyClause */ "./node_modules/arcgis-js-api/arcade/featureset/support/OrderbyClause.js"),__webpack_require__(/*! ../featureset/support/shared */ "./node_modules/arcgis-js-api/arcade/featureset/support/shared.js"),__webpack_require__(/*! ../featureset/support/sqlUtils */ "./node_modules/arcgis-js-api/arcade/featureset/support/sqlUtils.js"),__webpack_require__(/*! ./fieldStats */ "./node_modules/arcgis-js-api/arcade/functions/fieldStats.js"),__webpack_require__(/*! ../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../core/sql/WhereClause */ "./node_modules/arcgis-js-api/core/sql/WhereClause.js"),__webpack_require__(/*! ../../layers/FeatureLayer */ "./node_modules/arcgis-js-api/layers/FeatureLayer.js"),__webpack_require__(/*! ../../layers/support/Field */ "./node_modules/arcgis-js-api/layers/support/Field.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,r,t,n,a,i,l,s,o,u,f,d,c,m,p,y,g,h,v,F,I,S,A){function b(e,r,t,n){if(1===n.length){if(o.isArray(n[0]))return v.calculateStat(e,n[0],-1);if(o.isImmutableArray(n[0]))return v.calculateStat(e,n[0].toArray(),-1)}return v.calculateStat(e,n,-1)}function D(e,r,t){var n=e.getVariables();if(n.length>0){for(var a=[],i=0;i<n.length;i++){var l={name:n[i]};a.push(r.evaluateIdentifier(t,l))}return F.all(a).then(function(r){for(var t={},a=0;a<n.length;a++)t[n[a]]=r[a];return e.parameters=t,e})}return F.resolve(e)}function w(e,r,t){void 0===t&&(t=null);for(var n in e)if(n.toLowerCase()===r.toLowerCase())return e[n];return t}function E(e){if(null===e)return null;var r={type:w(e,"type",""),name:w(e,"name","")};if("range"===r.type)r.range=w(e,"range",[]);else{r.codedValues=[];for(var t=0,n=w(e,"codedValues",[]);t<n.length;t++){var a=n[t];r.codedValues.push({name:w(a,"name",""),code:w(a,"code",null)})}}return r}function x(e){if(null===e)return null;var r={},t=w(e,"wkt",null);null!==t&&(r.wkt=t);var n=w(e,"wkid",null);return null!==n&&(r.wkid=n),r}function C(e){if(null===e)return null;var r={hasZ:w(e,"hasz",!1),hasM:w(e,"hasm",!1)},t=w(e,"spatialreference",null);t&&(r.spatialReference=x(t));var n=w(e,"x",null);if(null!==n)return r.x=n,r.y=w(e,"y",null),r;var a=w(e,"rings",null);if(null!==a)return r.rings=a,r;var i=w(e,"paths",null);if(null!==i)return r.paths=i,r;var l=w(e,"points",null);if(null!==l)return r.points=l,r;for(var s=0,o=["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"];s<o.length;s++){var u=o[s],f=w(e,u,null);null!==f&&(r[u]=f)}return r}function N(e,r){for(var t=0,n=r;t<n.length;t++){if(n[t]===e)return!0}return!1}function T(e){return!!e.layerDefinition&&(!!e.featureSet&&(!1!==N(e.layerDefinition.geometryType,["","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])&&(null!==e.layerDefinition.objectIdField&&""!==e.layerDefinition.objectIdField&&(!1!==o.isArray(e.layerDefinition.fields)&&!1!==o.isArray(e.featureSet.features)))))}function L(e){"async"===e.mode&&(e.functions.featuresetbyid=function(r,t){return e.standardFunctionAsync(r,t,function(e,r,t){if(o.pcCheck(t,2,4),t[0]instanceof l){var n=o.toString(t[1]),a=o.defaultUndefined(t[2],null),i=o.toBoolean(o.defaultUndefined(t[3],!0));if(null===a&&(a=["*"]),!1===o.isArray(a))throw new Error("Invalid Parameter");return t[0].featureSetById(n,i,a)}throw new Error("Invalid Parameter")})},e.signatures.push({name:"featuresetbyid",min:"2",max:"4"}),e.functions.featuresetbyportalitem=function(r,n){return e.standardFunctionAsync(r,n,function(e,n,a){if(o.pcCheck(a,2,5),null===a[0])throw new Error("Portal is required");if(a[0]instanceof t){var i=o.toString(a[1]),l=o.toString(a[2]),u=o.defaultUndefined(a[3],null),f=o.toBoolean(o.defaultUndefined(a[4],!0));if(null===u&&(u=["*"]),!1===o.isArray(u))throw new Error("Invalid Parameter");var d=null;return r.services&&r.services.portal&&(d=r.services.portal),d=s.getPortal(a[0],d),s.constructFeatureSetFromPortalItem(i,l,r.spatialReference,u,f,d,r.lrucache)}if(!1===o.isString(a[0]))throw new Error("Portal is required");var c=o.toString(a[0]),m=o.toString(a[1]),p=o.defaultUndefined(a[2],null),y=o.toBoolean(o.defaultUndefined(a[3],!0));if(null===p&&(p=["*"]),!1===o.isArray(p))throw new Error("Invalid Parameter");if(r.services&&r.services.portal)return s.constructFeatureSetFromPortalItem(c,m,r.spatialReference,p,y,r.services.portal,r.lrucache);throw new Error("Portal is required")})},e.signatures.push({name:"featuresetbyportalitem",min:"2",max:"5"}),e.functions.featuresetbyname=function(r,t){return e.standardFunctionAsync(r,t,function(e,r,t){if(o.pcCheck(t,2,4),t[0]instanceof l){var n=o.toString(t[1]),a=o.defaultUndefined(t[2],null),i=o.toBoolean(o.defaultUndefined(t[3],!0));if(null===a&&(a=["*"]),!1===o.isArray(a))throw new Error("Invalid Parameter");return t[0].featureSetByName(n,i,a)}throw new Error("Invalid Parameter")})},e.signatures.push({name:"featuresetbyname",min:"2",max:"4"}),e.functions.featureset=function(r,t){return e.standardFunction(r,t,function(e,t,a){o.pcCheck(a,1,1);var i=a[0],l={layerDefinition:{geometryType:"",objectIdField:"",typeIdField:"",fields:[]},featureSet:{geometryType:"",features:[]}};if(o.isString(i))i=JSON.parse(i),void 0!==i.layerDefinition?(l.layerDefinition=i.layerDefinition,l.featureSet=i.featureSet,i.layerDefinition.spatialReference&&(l.layerDefinition.spatialReference=i.layerDefinition.spatialReference)):(l.featureSet.features=i.features,l.featureSet.geometryType=i.geometryType,l.layerDefinition.geometryType=l.featureSet.geometryType,l.layerDefinition.objectIdField=i.objectIdFieldName,l.layerDefinition.typeIdField=i.typeIdFieldName,l.layerDefinition.fields=i.fields,i.spatialReference&&(l.layerDefinition.spatialReference=i.spatialReference));else{if(!(a[0]instanceof n))throw new Error("Invalid Parameter");i=JSON.parse(a[0].castToText());var s=w(i,"layerdefinition");if(null!==s){l.layerDefinition.geometryType=w(s,"geometrytype",""),l.featureSet.geometryType=l.layerDefinition.geometryType,l.layerDefinition.objectIdField=w(s,"objectidfield",""),l.layerDefinition.typeIdField=w(s,"typeidfield","");var u=w(s,"spatialreference",null);u&&(l.layerDefinition.spatialReference=x(u));for(var f=0,d=w(s,"fields",[]);f<d.length;f++){var c=d[f],m={name:w(c,"name",""),alias:w(c,"alias",""),type:w(c,"type",""),nullable:w(c,"nullable",!0),editable:w(c,"editable",!0),length:w(c,"length",null),domain:E(w(c,"domain"))};l.layerDefinition.fields.push(m)}var y=w(i,"featureset",null);if(y){for(var g={},h=0,v=l.layerDefinition.fields;h<v.length;h++){var F=v[h];g[F.name.toLowerCase()]=F.name}for(var I=0,S=w(y,"features",[]);I<S.length;I++){var A=S[I],b={},D=w(A,"attributes",{});for(var F in D)b[g[F.toLowerCase()]]=D[F];l.featureSet.features.push({attributes:b,geometry:C(w(A,"geometry",null))})}}}else{l.layerDefinition.geometryType=w(i,"geometrytype",""),l.featureSet.geometryType=l.layerDefinition.geometryType,l.layerDefinition.objectIdField=w(i,"objectidfieldname",""),l.layerDefinition.typeIdField=w(i,"typeidfieldname","");var u=w(i,"spatialreference",null);u&&(l.layerDefinition.spatialReference=x(u));for(var N=0,L=w(i,"fields",[]);N<L.length;N++){var c=L[N],m={name:w(c,"name",""),alias:w(c,"alias",""),type:w(c,"type",""),nullable:w(c,"nullable",!0),editable:w(c,"editable",!0),length:w(c,"length",null),domain:E(w(c,"domain"))};l.layerDefinition.fields.push(m)}for(var g={},R=0,k=l.layerDefinition.fields;R<k.length;R++){var F=k[R];g[F.name.toLowerCase()]=F.name}for(var O=0,P=w(i,"features",[]);O<P.length;O++){var A=P[O],b={},D=w(A,"attributes",{});for(var F in D)b[g[F.toLowerCase()]]=D[F];l.featureSet.features.push({attributes:b,geometry:C(w(A,"geometry",null))})}}}if(!1===T(l))throw new Error("Invalid Parameter");return p.create(l,r.spatialReference)})},e.signatures.push({name:"featureset",min:"1",max:"1"}),e.functions.filter=function(r,t){return e.standardFunctionAsync(r,t,function(t,n,a){return o.pcCheck(a,2,2),o.isFeatureSet(a[0])?a[0].load().then(function(t){var n=I.WhereClause.create(a[1],t.getFieldsIndex()),i=n.getVariables();if(i.length>0){for(var l=[],s=0;s<i.length;s++){var o={name:i[s]};l.push(e.evaluateIdentifier(r,o))}return F.all(l).then(function(e){for(var r={},t=0;t<i.length;t++)r[i[t]]=e[t];return n.parameters=r,new f({parentfeatureset:a[0],whereclause:n})})}return F.resolve(new f({parentfeatureset:a[0],whereclause:n}))}):e.failDefferred("Filter cannot accept this parameter type")})},e.signatures.push({name:"filter",min:"2",max:"2"}),e.functions.orderby=function(r,t){return e.standardFunctionAsync(r,t,function(r,t,n){if(o.pcCheck(n,2,2),o.isFeatureSet(n[0])){var a=new y(n[1]);return F.resolve(new d({parentfeatureset:n[0],orderbyclause:a}))}return e.failDefferred("Order cannot accept this parameter type")})},e.signatures.push({name:"orderby",min:"2",max:"2"}),e.functions.top=function(r,t){return e.standardFunctionAsync(r,t,function(r,t,n){return o.pcCheck(n,2,2),o.isFeatureSet(n[0])?F.resolve(new c({parentfeatureset:n[0],topnum:n[1]})):o.isArray(n[0])?o.toNumber(n[1])>=n[0].length?n[0].slice(0):n[0].slice(0,o.toNumber(n[1])):o.isImmutableArray(n[0])?o.toNumber(n[1])>=n[0].length()?n[0].slice(0):n[0].slice(0,o.toNumber(n[1])):e.failDefferred("Top cannot accept this parameter type")})},e.signatures.push({name:"top",min:"2",max:"2"}),e.functions.first=function(r,t){return e.standardFunctionAsync(r,t,function(e,r,t){return o.pcCheck(t,1,1),o.isFeatureSet(t[0])?t[0].first(e.abortSignal).then(function(e){if(null!==e){var r=i.createFromGraphicLikeObject(e.geometry,e.attributes,t[0]);r._underlyingGraphic=e,e=r}return e}):o.isArray(t[0])?0===t[0].length?F.resolve(null):F.resolve(t[0][0]):o.isImmutableArray(t[0])?0===t[0].length()?F.resolve(null):F.resolve(t[0].get(0)):null})},e.signatures.push({name:"first",min:"1",max:"1"}),e.functions.attachments=function(r,t){return e.standardFunctionAsync(r,t,function(e,t,a){o.pcCheck(a,1,2);var l={minsize:-1,maxsize:-1,types:null};if(a.length>1)if(a[1]instanceof n){if(a[1].hasField("minsize")&&(l.minsize=o.toNumber(a[1].field("minsize"))),a[1].hasField("maxsize")&&(l.maxsize=o.toNumber(a[1].field("maxsize"))),a[1].hasField("types")){var u=o.toStringArray(a[1].field("types"),!1);u.length>0&&(l.types=u)}}else if(null!==a[1])throw new Error("Invalid Parameter");if(a[0]instanceof i){var f=a[0]._layer;return f instanceof S&&(f=s.constructFeatureSet(f,r.spatialReference,["*"],!0,r.lrucache)),null===f?[]:!1===o.isFeatureSet(f)?[]:f.load().then(function(){return f.queryAttachments(a[0].field(f.objectIdField),l.minsize,l.maxsize,l.types)})}if(null===a[0])return[];throw new Error("Invalid Parameter")})},e.signatures.push({name:"attachments",min:"1",max:"2"}),e.functions.featuresetbyrelationshipname=function(r,t){return e.standardFunctionAsync(r,t,function(e,t,n){o.pcCheck(n,2,4);var a=n[0],l=o.toString(n[1]),u=o.defaultUndefined(n[2],null),f=o.toBoolean(o.defaultUndefined(n[3],!0));if(null===u&&(u=["*"]),!1===o.isArray(u))throw new Error("Invalid Parameter");if(null===n[0])return null;if(!(n[0]instanceof i))throw new Error("Invalid Parameter");var d=a._layer;return d instanceof S&&(d=s.constructFeatureSet(d,r.spatialReference,["*"],!0,r.lrucache)),null===d?null:!1===o.isFeatureSet(d)?null:d.load().then(function(e){var t=e.relationshipMetaData(),n=t.filter(function(e){return e.name===l});if(0===n.length)return null;if(void 0!==n[0].relationshipTableId&&null!==n[0].relationshipTableId&&n[0].relationshipTableId>-1)return s.constructFeatureSetFromRelationship(e,n[0],a.field(e.objectIdField),e.spatialReference,u,f,r.lrucache);var i=e.serviceUrl();return i?(i="/"===i.charAt(i.length-1)?i+n[0].relatedTableId.toString():i+"/"+n[0].relatedTableId.toString(),s.constructFeatureSetFromUrl(i,e.spatialReference,u,f,r.lrucache).then(function(r){return r.load().then(function(){return r.relationshipMetaData()}).then(function(t){if(t=t.filter(function(e){return e.id===n[0].id}),!1===a.hasField(n[0].keyField)||null===a.field(n[0].keyField))return e.getFeatureByObjectId(a.field(e.objectIdField),[n[0].keyField]).then(function(e){if(e){var a=I.WhereClause.create(t[0].keyField+"= @id",r.getFieldsIndex());return a.parameters={id:e.attributes[n[0].keyField]},r.filter(a)}return new m({parentfeatureset:r})});var i=I.WhereClause.create(t[0].keyField+"= @id",r.getFieldsIndex());return i.parameters={id:a.field(n[0].keyField)},r.filter(i)})})):null})})},e.signatures.push({name:"featuresetbyrelationshipname",min:"2",max:"4"}),e.functions.featuresetbyassociation=function(r,t){return e.standardFunctionAsync(r,t,function(e,t,n){o.pcCheck(n,2,3);var a=n[0],l=o.toString(o.defaultUndefined(n[1],"")).toLowerCase(),f=o.isString(n[2])?o.toString(n[2]):null;if(null===n[0])return null;if(!(n[0]instanceof i))throw new Error("Invalid Parameter");var d=a._layer;return d instanceof S&&(d=s.constructFeatureSet(d,r.spatialReference,["*"],!0,r.lrucache)),null===d?null:!1===o.isFeatureSet(d)?null:d.load().then(function(){var e=d.serviceUrl();return s.constructAssociationMetaDataFeatureSetFromUrl(e,r.spatialReference)}).then(function(e){var r=null,t=null,n=!1;if(null!==f&&""!==f&&void 0!==f){for(var i=0,s=e.terminals;i<s.length;i++){var c=s[i];c.terminalName===f&&(t=c.terminalId)}null===t&&(n=!0)}for(var m=e.associations.getFieldsIndex(),p=m.get("TOGLOBALID").name,y=m.get("FROMGLOBALID").name,h=m.get("TOTERMINALID").name,v=m.get("FROMTERMINALID").name,F=m.get("FROMNETWORKSOURCEID").name,S=m.get("TONETWORKSOURCEID").name,b=m.get("ASSOCIATIONTYPE").name,D=m.get("ISCONTENTVISIBLE").name,w=m.get("OBJECTID").name,E=0,x=d.fields;E<x.length;E++){var C=x[E];if("global-id"===C.type){r=a.field(C.name);break}}var N=null,T={};for(var L in e.lkp)T[L]=e.lkp[L].sourceId;var R=new u.StringToCodeAdapted(new A({name:"classname",alias:"classname",type:"string"}),null,T),k="";switch(l){case"connected":var O=p+"='@T'",P=y+"='@T'";null!==t&&(O+=" AND "+h+"=@A",P+=" AND "+v+"=@A"),k="(("+O+") OR ("+P+"))",k=o.multiReplace(k,"@T",r),O=o.multiReplace(O,"@T",r),null!==t&&(O=o.multiReplace(O,"@A",t.toString()),k=o.multiReplace(k,"@A",t.toString())),R.codefield=I.WhereClause.create("CASE WHEN "+O+" THEN "+F+" ELSE "+S+" END",e.associations.getFieldsIndex());var M=g.cloneField(u.AdaptedFeatureSet.findField(e.associations.fields,y));M.name="globalid",M.alias="globalid",N=new u.SqlExpressionAdapted(M,I.WhereClause.create("CASE WHEN "+O+" THEN "+y+" ELSE "+p+" END",e.associations.getFieldsIndex()));break;case"container":k=p+"='"+r+"' AND "+b+" = 2",null!==t&&(k+=" AND "+h+" = "+t.toString()),R.codefield=F,k="( "+k+" )",N=new u.FieldRename(u.AdaptedFeatureSet.findField(e.associations.fields,y),"globalid","globalid");case"content":k="("+y+"='"+r+"' AND "+b+" = 2)",null!==t&&(k+=" AND "+v+" = "+t.toString()),R.codefield=S,k="( "+k+" )",N=new u.FieldRename(u.AdaptedFeatureSet.findField(e.associations.fields,p),"globalid","globalid");break;case"structure":k="("+p+"='"+r+"' AND "+b+" = 3)",null!==t&&(k+=" AND "+h+" = "+t.toString()),R.codefield=F,k="( "+k+" )",N=new u.FieldRename(u.AdaptedFeatureSet.findField(e.associations.fields,y),"globalid","globalId");break;case"attached":k="("+y+"='"+r+"' AND "+b+" = 3)",null!==t&&(k+=" AND "+v+" = "+t.toString()),R.codefield=S,k="( "+k+" )",N=new u.FieldRename(u.AdaptedFeatureSet.findField(e.associations.fields,p),"globalid","globalId");break;default:throw new Error("Invalid Parameter")}return n&&(k="1 <> 1"),new u.AdaptedFeatureSet({parentfeatureset:e.associations,adaptedFields:[new u.OriginalField(u.AdaptedFeatureSet.findField(e.associations.fields,w)),new u.OriginalField(u.AdaptedFeatureSet.findField(e.associations.fields,D)),N,R],extraFilter:k?I.WhereClause.create(k,e.associations.getFieldsIndex()):null})})})},e.signatures.push({name:"featuresetbyassociation",min:"2",max:"6"}),e.functions.groupby=function(r,t){return e.standardFunctionAsync(r,t,function(t,n,i){return o.pcCheck(i,3,3),o.isFeatureSet(i[0])?i[0].load().then(function(t){var n=[],l=[],s=!1,u=[];if(o.isString(i[1]))u.push(i[1]);else if(i[1]instanceof a)u.push(i[1]);else if(o.isArray(i[1]))u=i[1];else{if(!o.isImmutableArray(i[1]))return e.failDefferred("Illegal Value: GroupBy");u=i[1].toArray()}for(var f=0,d=u;f<d.length;f++){var c=d[f];if(o.isString(c)){var m=I.WhereClause.create(o.toString(c),t.getFieldsIndex()),p=!0===h.isSingleField(m)?o.toString(c):"%%%%FIELDNAME";n.push({name:p,expression:m}),"%%%%FIELDNAME"===p&&(s=!0)}else{if(!(c instanceof a))return e.failDefferred("Illegal Value: GroupBy");var y=c.hasField("name")?c.field("name"):"%%%%FIELDNAME",m=c.hasField("expression")?c.field("expression"):"";if("%%%%FIELDNAME"===y&&(s=!0),!y)return e.failDefferred("Illegal Value: GroupBy");n.push({name:y,expression:I.WhereClause.create(m||y,t.getFieldsIndex())})}}if(u=[],o.isString(i[2]))u.push(i[2]);else if(o.isArray(i[2]))u=i[2];else if(o.isImmutableArray(i[2]))u=i[2].toArray();else{if(!(i[2]instanceof a))return e.failDefferred("Illegal Value: GroupBy");u.push(i[2])}for(var g=0,v=u;g<v.length;g++){var c=v[g];if(!(c instanceof a))return e.failDefferred("Illegal Value: GroupBy");var S=c.hasField("name")?c.field("name"):"",A=c.hasField("statistic")?c.field("statistic"):"",m=c.hasField("expression")?c.field("expression"):"";if(!S||!A||!m)return e.failDefferred("Illegal Value: GroupBy");l.push({name:S,statistic:A.toLowerCase(),expression:I.WhereClause.create(m,t.getFieldsIndex())})}if(s){for(var b={},w=0,E=t.fields;w<E.length;w++){var x=E[w];b[x.name.toLowerCase()]=1}for(var C=0,N=n;C<N.length;C++){var x=N[C];"%%%%FIELDNAME"!==x.name&&(b[x.name.toLowerCase()]=1)}for(var T=0,L=l;T<L.length;T++){var x=L[T];"%%%%FIELDNAME"!==x.name&&(b[x.name.toLowerCase()]=1)}for(var R=0,k=0,O=n;k<O.length;k++){var x=O[k];if("%%%%FIELDNAME"===x.name){for(;1===b["field_"+R.toString()];)R++;b["field_"+R.toString()]=1,x.name="FIELD_"+R.toString()}}}for(var P=[],M=0,B=n;M<B.length;M++){var U=B[M];P.push(D(U.expression,e,r))}for(var G=0,V=l;G<V.length;G++){var U=V[G];P.push(D(U.expression,e,r))}return P.length>0?F.all(P).then(function(){return F.resolve(i[0].groupby(n,l))}):F.resolve(i[0].groupby(n,l))}):e.failDefferred("Illegal Value: GroupBy")})},e.signatures.push({name:"groupby",min:"3",max:"3"}),e.functions.distinct=function(r,t){return e.standardFunctionAsync(r,t,function(t,n,i){return o.isFeatureSet(i[0])?(o.pcCheck(i,2,2),i[0].load().then(function(t){var n=[],l=[];if(o.isString(i[1]))l.push(i[1]);else if(i[1]instanceof a)l.push(i[1]);else if(o.isArray(i[1]))l=i[1];else{if(!o.isImmutableArray(i[1]))return e.failDefferred("Illegal Value: GroupBy");l=i[1].toArray()}for(var s=!1,u=0,f=l;u<f.length;u++){var d=f[u];if(o.isString(d)){var c=I.WhereClause.create(o.toString(d),t.getFieldsIndex()),m=!0===h.isSingleField(c)?o.toString(d):"%%%%FIELDNAME";n.push({name:m,expression:c}),"%%%%FIELDNAME"===m&&(s=!0)}else{if(!(d instanceof a))return e.failDefferred("Illegal Value: GroupBy");var p=d.hasField("name")?d.field("name"):"%%%%FIELDNAME",c=d.hasField("expression")?d.field("expression"):"";if("%%%%FIELDNAME"===p&&(s=!0),!p)return e.failDefferred("Illegal Value: GroupBy");n.push({name:p,expression:I.WhereClause.create(c||p,t.getFieldsIndex())})}}if(s){for(var y={},g=0,v=t.fields;g<v.length;g++){var S=v[g];y[S.name.toLowerCase()]=1}for(var A=0,b=n;A<b.length;A++){var S=b[A];"%%%%FIELDNAME"!==S.name&&(y[S.name.toLowerCase()]=1)}for(var w=0,E=0,x=n;E<x.length;E++){var S=x[E];if("%%%%FIELDNAME"===S.name){for(;1===y["field_"+w.toString()];)w++;y["field_"+w.toString()]=1,S.name="FIELD_"+w.toString()}}}for(var C=[],N=0,T=n;N<T.length;N++){var L=T[N];C.push(D(L.expression,e,r))}return C.length>0?F.all(C).then(function(){return F.resolve(i[0].groupby(n,[]))}):F.resolve(i[0].groupby(n,[]))})):b("distinct",t,n,i)})})}Object.defineProperty(r,"__esModule",{value:!0}),r.registerFunctions=L}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/functions/featuresetgeom.js": /*!***********************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/functions/featuresetgeom.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../kernel */ "./node_modules/arcgis-js-api/arcade/kernel.js"),__webpack_require__(/*! ../languageUtils */ "./node_modules/arcgis-js-api/arcade/languageUtils.js"),__webpack_require__(/*! ../featureset/actions/SpatialFilter */ "./node_modules/arcgis-js-api/arcade/featureset/actions/SpatialFilter.js"),__webpack_require__(/*! ../featureset/sources/Empty */ "./node_modules/arcgis-js-api/arcade/featureset/sources/Empty.js"),__webpack_require__(/*! ../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../geometry/Geometry */ "./node_modules/arcgis-js-api/geometry/Geometry.js"),__webpack_require__(/*! ../../geometry/geometryEngineAsync */ "./node_modules/arcgis-js-api/geometry/geometryEngineAsync.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,t,n,r,a,i,s,l,o){function u(e,t,u,c,f){return f(e,t,function(e,t,f){if(f.length<2)return c(new Error("Missing Parameters"));if(f=r.autoCastFeatureToGeometry(f),null===f[0]&&null===f[1])return s.resolve(!1);if(r.isFeatureSet(f[0]))return f[1]instanceof l?s.resolve(new a({parentfeatureset:f[0],relation:u,relationGeom:f[1]})):null===f[1]?s.resolve(new i({parentfeatureset:f[0]})):c("Spatial Relation cannot accept this parameter type");if(f[0]instanceof l){if(f[1]instanceof l){var p=null;switch(u){case"esriSpatialRelEnvelopeIntersects":p=o.intersects(n.shapeExtent(f[0]),n.shapeExtent(f[1]));break;case"esriSpatialRelIntersects":p=o.intersects(f[0],f[1]);break;case"esriSpatialRelContains":p=o.contains(f[0],f[1]);break;case"esriSpatialRelOverlaps":p=o.overlaps(f[0],f[1]);break;case"esriSpatialRelWithin":p=o.within(f[0],f[1]);break;case"esriSpatialRelTouches":p=o.touches(f[0],f[1]);break;case"esriSpatialRelCrosses":p=o.crosses(f[0],f[1])}return null!==p?p:s.reject(new Error("Unrecognised Relationship"))}return r.isFeatureSet(f[1])?s.resolve(new a({parentfeatureset:f[1],relation:u,relationGeom:f[0]})):null===f[1]?s.resolve(!1):c("Spatial Relation cannot accept this parameter type")}return null!==f[0]?c("Spatial Relation cannot accept this parameter type"):r.isFeatureSet(f[1])?s.resolve(new i({parentfeatureset:f[1]})):f[1]instanceof l||null===f[1]?s.resolve(!1):void 0})}function c(e){"async"===e.mode&&(e.functions.intersects=function(t,n){return u(t,n,"esriSpatialRelIntersects",e.failDefferred,e.standardFunctionAsync)},e.functions.envelopeintersects=function(t,n){return u(t,n,"esriSpatialRelEnvelopeIntersects",e.failDefferred,e.standardFunctionAsync)},e.signatures.push({name:"envelopeintersects",min:"2",max:"2"}),e.functions.contains=function(t,n){return u(t,n,"esriSpatialRelContains",e.failDefferred,e.standardFunctionAsync)},e.functions.overlaps=function(t,n){return u(t,n,"esriSpatialRelOverlaps",e.failDefferred,e.standardFunctionAsync)},e.functions.within=function(t,n){return u(t,n,"esriSpatialRelWithin",e.failDefferred,e.standardFunctionAsync)},e.functions.touches=function(t,n){return u(t,n,"esriSpatialRelTouches",e.failDefferred,e.standardFunctionAsync)},e.functions.crosses=function(t,n){return u(t,n,"esriSpatialRelCrosses",e.failDefferred,e.standardFunctionAsync)},e.functions.relate=function(t,n){return e.standardFunctionAsync(t,n,function(e,t,n){if(n=r.autoCastFeatureToGeometry(n),r.pcCheck(n,3,3),n[0]instanceof l&&n[1]instanceof l)return o.relate(n[0],n[1],r.toString(n[2]));if(n[0]instanceof l&&null===n[1])return!1;if(n[1]instanceof l&&null===n[0])return!1;if(r.isFeatureSet(n[0])&&null===n[1])return new i({parentfeatureset:n[0]});if(r.isFeatureSet(n[1])&&null===n[0])return new i({parentfeatureset:n[1]});if(r.isFeatureSet(n[0])&&n[1]instanceof l)return n[0].relate(n[1],r.toString(n[2]));if(r.isFeatureSet(n[1])&&n[0]instanceof l)return n[1].relate(n[0],r.toString(n[2]));if(null===n[0]&&null===n[1])return!1;throw new Error("Illegal Argument")})})}Object.defineProperty(t,"__esModule",{value:!0}),t.registerFunctions=c}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/functions/featuresetstats.js": /*!************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/functions/featuresetstats.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../languageUtils */ "./node_modules/arcgis-js-api/arcade/languageUtils.js"),__webpack_require__(/*! ./fieldStats */ "./node_modules/arcgis-js-api/arcade/functions/fieldStats.js"),__webpack_require__(/*! ../../core/promiseUtils */ "./node_modules/arcgis-js-api/core/promiseUtils.js"),__webpack_require__(/*! ../../core/sql/WhereClause */ "./node_modules/arcgis-js-api/core/sql/WhereClause.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(n,t,e,r,u,a){function i(n,t,i,o,s,f){if(1===o.length){if(e.isArray(o[0]))return u.resolve(r.calculateStat(n,o[0],e.defaultUndefined(o[1],-1)));if(e.isImmutableArray(o[0]))return u.resolve(r.calculateStat(n,o[0].toArray(),e.defaultUndefined(o[1],-1)))}else if(2===o.length){if(e.isArray(o[0]))return u.resolve(r.calculateStat(n,o[0],e.defaultUndefined(o[1],-1)));if(e.isImmutableArray(o[0]))return u.resolve(r.calculateStat(n,o[0].toArray(),e.defaultUndefined(o[1],-1)));if(e.isFeatureSet(o[0]))return o[0].load().then(function(r){return c(a.WhereClause.create(o[1],r.getFieldsIndex()),f,s).then(function(r){return o[0].calculateStatistic(n,r,e.defaultUndefined(o[2],1e3),t.abortSignal)})})}else if(3===o.length&&e.isFeatureSet(o[0]))return o[0].load().then(function(r){return c(a.WhereClause.create(o[1],r.getFieldsIndex()),f,s).then(function(r){return o[0].calculateStatistic(n,r,e.defaultUndefined(o[2],1e3),t.abortSignal)})});return u.resolve(r.calculateStat(n,o,-1))}function c(n,t,e){try{var r=n.getVariables();if(r.length>0){for(var a=[],i=0;i<r.length;i++){var c={name:r[i]};a.push(t.evaluateIdentifier(e,c))}return u.all(a).then(function(t){for(var e={},u=0;u<r.length;u++)e[r[u]]=t[u];return n.parameters=e,n})}return u.resolve(n)}catch(n){return u.reject(n)}}function o(n){"async"===n.mode&&(n.functions.stdev=function(t,e){return n.standardFunctionAsync(t,e,function(e,r,u){return i("stdev",e,r,u,t,n)})},n.functions.variance=function(t,e){return n.standardFunctionAsync(t,e,function(e,r,u){return i("variance",e,r,u,t,n)})},n.functions.average=function(t,e){return n.standardFunctionAsync(t,e,function(e,r,u){return i("mean",e,r,u,t,n)})},n.functions.mean=function(t,e){return n.standardFunctionAsync(t,e,function(e,r,u){return i("mean",e,r,u,t,n)})},n.functions.sum=function(t,e){return n.standardFunctionAsync(t,e,function(e,r,u){return i("sum",e,r,u,t,n)})},n.functions.min=function(t,e){return n.standardFunctionAsync(t,e,function(e,r,u){return i("min",e,r,u,t,n)})},n.functions.max=function(t,e){return n.standardFunctionAsync(t,e,function(e,r,u){return i("max",e,r,u,t,n)})},n.functions.count=function(t,r){return n.standardFunctionAsync(t,r,function(n,t,r){if(e.pcCheck(r,1,1),e.isFeatureSet(r[0]))return r[0].count(n.abortSignal);if(e.isArray(r[0])||e.isString(r[0]))return r[0].length;if(e.isImmutableArray(r[0]))return r[0].length();throw new Error("Invalid Parameters for Count")})})}Object.defineProperty(t,"__esModule",{value:!0}),t.registerFunctions=o}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }), /***/ "./node_modules/arcgis-js-api/arcade/functions/featuresetstring.js": /*!*************************************************************************!*\ !*** ./node_modules/arcgis-js-api/arcade/functions/featuresetstring.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// COPYRIGHT © 2019 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.14/esri/copyright.txt for details. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__.dj.c(module.i),exports,__webpack_require__(/*! ../Feature */ "./node_modules/arcgis-js-api/arcade/Feature.js"),__webpack_require__(/*! ../languageUtils */ "./node_modules/arcgis-js-api/arcade/languageUtils.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e,n,t,o){function r(e){"async"===e.mode&&(e.functions.domainname=function(n,r){return e.standardFunctionAsync(n,r,function(e,n,r){if(o.pcCheck(r,2,4),r[0]instanceof t)return r[0].domainValueLookup(o.toString(r[1]),r[2],void 0===r[3]?void 0:o.toNumber(r[3]));if(o.isFeatureSet(r[0]))return r[0]._ensureLoaded().then(function(){var e=o.getDomain(o.toString(r[1]),r[0],null,void 0===r[3]?void 0:o.toNumber(r[3]));return o.getDomainValue(e,r[2])});throw new Error("Invalid Parameter")})},e.signatures.push({name:"domainname",min:"2",max:"4"}),e.functions.domaincode=function(n,r){return e.standardFunctionAsync(n,r,function(e,n,r){if(o.pcCheck(r,2,4),r[0]instanceof t)return r[0].domainCodeLookup(o.toString(r[1]),r[2],void 0===r[3]?void 0:o.toNumber(r[3]));if(o.isFeatureSet(r[0]))return r[0]._ensureLoaded().then(function(){var e=o.getDomain(o.toString(r[1]),r[0],null,void 0===r[3]?void 0:o.toNumber(r[3]));return o.getDomainCode(e,r[2])});throw new Error("Invalid Parameter")})},e.signatures.push({name:"domaincode",min:"2",max:"4"})),e.functions.text=function(n,t){return e.standardFunctionAsync(n,t,function(e,n,t){if(o.pcCheck(t,1,2),!o.isFeatureSet(t[0]))return o.toStringExplicit(t[0],t[1]);var r=o.defaultUndefined(t[1],"");return""===r?t[0].castToText():"schema"===r.toLowerCase()?t[0].convertToText("schema",e.abortSignal):"featureset"===r.toLowerCase()?t[0].convertToText("featureset",e.abortSignal):void 0})}}Object.defineProperty(n,"__esModule",{value:!0}),n.registerFunctions=r}).apply(null, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); /***/ }) }]); //# sourceMappingURL=55-es2015.js.map