@arcgis/core 4.24.0-next.20220504 → 4.24.0-next.20220505

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/arcade/featureset/actions/Adapted.js +1 -1
  2. package/arcade/featureset/support/sqlUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/3c8c020d9e723888352b.js +1 -0
  5. package/assets/esri/core/workers/chunks/48810a9391b787f195ed.js +1 -0
  6. package/assets/esri/core/workers/chunks/5637a192b47ed9cfd5d6.js +1 -0
  7. package/assets/esri/core/workers/chunks/7820409909105f2f014c.js +1 -0
  8. package/assets/esri/core/workers/chunks/9964386c07e73404cff9.js +1 -0
  9. package/assets/esri/core/workers/chunks/b340c9bdabdb37995c8f.js +1 -0
  10. package/assets/esri/core/workers/chunks/b5b7bcbc19b3430903ee.js +1 -0
  11. package/assets/esri/core/workers/chunks/{8cc85d1d46dda16ad041.js → c535c18c00e823665603.js} +1 -1
  12. package/assets/esri/core/workers/chunks/caed2365bd296fcc8a75.js +1 -0
  13. package/assets/esri/core/workers/chunks/cc372e1bc7ce932c4b76.js +1 -0
  14. package/assets/esri/core/workers/chunks/{b5ede4df4620097c6528.js → d4ed4d2f5129ee750276.js} +1 -1
  15. package/assets/esri/core/workers/chunks/d85b5b73a151c6fbb658.js +1 -0
  16. package/assets/esri/core/workers/chunks/{9e6df034d7949880471f.js → ec6d138e8183e193f977.js} +1 -1
  17. package/assets/esri/core/workers/chunks/f206300eef4560611728.js +1 -0
  18. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  19. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  20. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  21. package/chunks/arcgis-knowledge-client-core-simd.js +5 -0
  22. package/chunks/arcgis-knowledge-client-core.js +5 -0
  23. package/chunks/boundedPlane.js +1 -1
  24. package/core/has.js +1 -1
  25. package/core/reactiveUtils.js +1 -1
  26. package/core/sql/WhereClause.js +1 -1
  27. package/core/sql/WhereGrammar.js +1 -1
  28. package/core/unitUtils.js +1 -1
  29. package/geometry/support/boundedPlane.js +1 -1
  30. package/geometry/support/meshUtils/georeference.js +1 -1
  31. package/layers/SubtypeGroupLayer.js +1 -1
  32. package/layers/VoxelLayer.js +1 -1
  33. package/layers/VoxelWasmManager.js +1 -1
  34. package/layers/VoxelWasmPerScene.js +1 -1
  35. package/layers/WCSLayer.js +1 -1
  36. package/layers/WMSLayer.js +1 -1
  37. package/layers/WMTSLayer.js +1 -1
  38. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  39. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  40. package/layers/graphics/controllers/StreamController.js +1 -1
  41. package/layers/mixins/ArcGISImageService.js +1 -1
  42. package/layers/mixins/SublayersOwner.js +1 -1
  43. package/layers/support/TilemapCache.js +1 -1
  44. package/package.json +1 -1
  45. package/properties/defaultUnit.js +1 -1
  46. package/rest/knowledgeGraph/DataModel.js +5 -0
  47. package/rest/knowledgeGraph/DocumentEntityTypeInfo.js +5 -0
  48. package/rest/knowledgeGraph/Entity.js +5 -0
  49. package/rest/knowledgeGraph/EntityType.js +5 -0
  50. package/rest/knowledgeGraph/FieldIndex.js +5 -0
  51. package/rest/knowledgeGraph/GraphAnyValue.js +4 -0
  52. package/rest/knowledgeGraph/GraphNamedObject.js +5 -0
  53. package/rest/knowledgeGraph/GraphObject.js +5 -0
  54. package/rest/knowledgeGraph/GraphObjectType.js +5 -0
  55. package/rest/knowledgeGraph/GraphProperty.js +5 -0
  56. package/rest/knowledgeGraph/GraphQuery.js +5 -0
  57. package/rest/knowledgeGraph/GraphQueryResult.js +5 -0
  58. package/rest/knowledgeGraph/GraphSearch.js +5 -0
  59. package/rest/knowledgeGraph/KnowledgeGraph.js +5 -0
  60. package/rest/knowledgeGraph/ObjectValue.js +5 -0
  61. package/rest/knowledgeGraph/Path.js +5 -0
  62. package/rest/knowledgeGraph/Relationship.js +5 -0
  63. package/rest/knowledgeGraph/RelationshipType.js +5 -0
  64. package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js +5 -0
  65. package/rest/knowledgeGraph/wasmInterface/WasmQueryWrapperInterfaces.js +5 -0
  66. package/rest/knowledgeGraph/wasmInterface/knowledgeWasmDecoderAccess.js +5 -0
  67. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelFactories.js +5 -0
  68. package/rest/knowledgeGraph/wasmInterface/wasmToGeometryFactories.js +5 -0
  69. package/rest/knowledgeGraph/wasmInterface/wasmToQueryResponseObjFactories.js +5 -0
  70. package/rest/knowledgeGraphService.js +5 -0
  71. package/support/revision.js +1 -1
  72. package/views/2d/FrameTask.js +1 -1
  73. package/views/2d/PaddedViewState.js +1 -1
  74. package/views/2d/engine/webgl/ClippingInfo.js +1 -1
  75. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  76. package/views/3d/terrain/TileRenderer.js +1 -1
  77. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  78. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  79. package/widgets/Attachments.js +1 -1
  80. package/widgets/Compass/CompassViewModel.js +1 -1
  81. package/widgets/Expand/ExpandViewModel.js +1 -1
  82. package/widgets/Spinner.js +1 -1
  83. package/widgets/TableList/TableListViewModel.js +1 -1
  84. package/widgets/TableList.js +1 -1
  85. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  86. package/assets/esri/core/workers/chunks/2133499e642193f6738f.js +0 -1
  87. package/assets/esri/core/workers/chunks/33abc6d8da34bafef6e8.js +0 -1
  88. package/assets/esri/core/workers/chunks/3bbb2f08a6c6261dc405.js +0 -1
  89. package/assets/esri/core/workers/chunks/3fd52a03b3126556aee6.js +0 -1
  90. package/assets/esri/core/workers/chunks/500c988ba52176159b5c.js +0 -1
  91. package/assets/esri/core/workers/chunks/54577c2522ca3ff08f7e.js +0 -1
  92. package/assets/esri/core/workers/chunks/814234844a056d9f1ddc.js +0 -1
  93. package/assets/esri/core/workers/chunks/958a7ef2cbf048819988.js +0 -1
  94. package/assets/esri/core/workers/chunks/a056a79f31cddb066f15.js +0 -1
  95. package/assets/esri/core/workers/chunks/ac0df52b2f2a4874e4ea.js +0 -1
  96. package/assets/esri/core/workers/chunks/b08eb084cdf5f87e9500.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Graphic.js";import{cloneGeometry as t}from"../../kernel.js";import r from"../support/FeatureSet.js";import s from"../support/IdSet.js";import{cloneField as a,FeatureServiceDatabaseType as i,layerGeometryEsriConstants as l}from"../support/shared.js";import{reformulateWithoutField as n,toWhereClause as o,translateFunctionToDatabaseSpecific as h,makeToday as u,makeDateString as d,convertIntervalToSql as c,combine as p,scanForField as f}from"../support/sqlUtils.js";import{resolve as g,reject as _}from"../../../core/promiseUtils.js";import{WhereClause as N}from"../../../core/sql/WhereClause.js";import S from"../../../geometry/SpatialReference.js";class m{constructor(e){this.field=e,this.sqlRewritable=!1}postInitialization(e,t){}}class w extends m{constructor(e){super(e),this.sqlRewritable=!0}extractValue(e){return e.attributes[this.field.name]}rewriteSql(e){return{rewritten:this.sqlRewritable,where:e}}}class v extends m{constructor(e,t,r){super(a(e)),this.originalField=e,this.sqlRewritable=!0,this.field.name=t,this.field.alias=r}rewriteSql(e,t){return{rewritten:this.sqlRewritable,where:n(e,this.field.name,this.originalField.name,t.getFieldsIndex())}}extractValue(e){return e.attributes[this.originalField.name]}}class C extends m{constructor(e,t,r){super(e),this.codefield=t,this.lkp=r,this.reverseLkp={};for(const s in r)this.reverseLkp[r[s]]=s;this.sqlRewritable=!0}rewriteSql(e,t){const r=this.evaluateNodeToWhereClause(e.parseTree,i.Standardised,this.field.name,this.codefield instanceof N?o(this.codefield,i.Standardised):this.codefield,e.parameters);return r.includes(C.BADNESS)?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:N.create(r,t._parent.getFieldsIndex())}}evaluateNodeToWhereClause(e,t,r=null,s=null,a){let i,l,n,o;switch(e.type){case"interval":return c(this.evaluateNodeToWhereClause(e.value,t,r,s,a),e.qualifier,e.op);case"case_expression":{let s=" CASE ";"simple"===e.format&&(s+=this.evaluateNodeToWhereClause(e.operand,t,r,C.BADNESS,a));for(let i=0;i<e.clauses.length;i++)s+=" WHEN "+this.evaluateNodeToWhereClause(e.clauses[i].operand,t,r,C.BADNESS,a)+" THEN "+this.evaluateNodeToWhereClause(e.clauses[i].value,t,r,C.BADNESS,a);return null!==e.else&&(s+=" ELSE "+this.evaluateNodeToWhereClause(e.else,t,r,C.BADNESS,a)),s+=" END ",s}case"param":{const r=a[e.value.toLowerCase()];if("string"==typeof r){return"'"+a[e.value.toLowerCase()].toString().replace(/'/g,"''")+"'"}if(r instanceof Date)return d(r,t);if(r instanceof Array){const e=[];for(let s=0;s<r.length;s++)"string"==typeof r[s]?e.push("'"+r[s].toString().replace(/'/g,"''")+"'"):r[s]instanceof Date?e.push(d(r[s],t)):e.push(r[s].toString());return e}return r.toString()}case"expr_list":l=[];for(const i of e.value)l.push(this.evaluateNodeToWhereClause(i,t,r,s,a));return l;case"unary_expr":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,t,r,C.BADNESS,a)+" ) ";case"binary_expr":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" AND "+this.evaluateNodeToWhereClause(e.right,t,r,s,a)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" OR "+this.evaluateNodeToWhereClause(e.right,t,r,s,a)+") ";case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" IS NOT NULL )";case"IN":if(i=[],"expr_list"===e.right.type){if("column_ref"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const i=[];let l=!0;for(const t of e.right.value){if("string"!==t.type){l=!1;break}if(void 0===this.lkp[t.value]){l=!1;break}i.push(this.lkp[t.value].toString())}if(l)return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" IN ("+i.join(",")+")) "}return i=this.evaluateNodeToWhereClause(e.right,t,r,s,a)," ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" IN ("+i.join(",")+")) "}return o=this.evaluateNodeToWhereClause(e.right,t,r,s,a),o instanceof Array?" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" IN ("+o.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" IN ("+o+")) ";case"NOT IN":if(i=[],"expr_list"===e.right.type){if("column_ref"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const i=[];let l=!0;for(const t of e.right.value){if("string"!==t.type){l=!1;break}if(void 0===this.lkp[t.value]){l=!1;break}i.push(this.lkp[t.value].toString())}if(l)return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" NOT IN ("+i.join(",")+")) "}return i=this.evaluateNodeToWhereClause(e.right,t,r,s,a)," ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" NOT IN ("+i.join(",")+")) "}return o=this.evaluateNodeToWhereClause(e.right,t,r,s,a),o instanceof Array?" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" NOT IN ("+o.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,a)+" NOT IN ("+o+")) ";case"BETWEEN":return n=this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,a)," ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,a)+" BETWEEN "+n[0]+" AND "+n[1]+" ) ";case"NOTBETWEEN":return n=this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,a)," ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,a)+" NOT BETWEEN "+n[0]+" AND "+n[1]+" ) ";case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,a)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,a)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,a)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,a)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,a)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,a)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,a)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,a)+") ";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" ("+s+" "+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+" "+s+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,a)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,a)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":return" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,a)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,a)+") "}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 d(e.value,t);case"number":return e.value.toString();case"current_time":return u("date"===e.mode,t);case"column_ref":return r&&r.toLowerCase()===e.column.toLowerCase()?"("+s+")":e.column;case"function":{const s=this.evaluateNodeToWhereClause(e.args,t,r,C.BADNESS,a);return h(e.name,s,t)}}throw new Error("Unsupported sql syntax "+e.type)}extractValue(e){return this.codefield instanceof N?this.reverseLkp[this.codefield.calculateValueCompiled(e)]:this.reverseLkp[e.attributes[this.codefield]]}}C.BADNESS="_!!!_BAD_LKP_!!!!";class T extends m{constructor(e,t){super(e),this.sql=t}rewriteSql(e,t){return{rewritten:!0,where:n(e,this.field.name,o(this.sql,i.Standardised),t.getFieldsIndex())}}extractValue(e){return this.sql.calculateValueCompiled(e)}}class E extends r{constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=null,this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}static findField(e,t){for(const r of e)if(r.name.toLowerCase()===t.toString().toLowerCase())return r;return null}_initialiseFeatureSet(){null!==this._parent?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,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 S({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=l.point,this.typeIdField="",this.types=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}_getSet(e){return null===this._wset?this._ensureLoaded().then((()=>this._extraFilter?this._getFilteredSet("",null,null,null,e):this._parent._getSet(e))).then((t=>(this._checkCancelled(e),this._wset=new s(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset))):g(this._wset)}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(r,a,i,l){const n=[];-1!==a&&void 0===this._featureCache[a]&&n.push(a);const o=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(r,o))return this._expandPagedSet(r,o,0,0,l).then((()=>this._getFeatures(r,a,i,l)));let h=0;for(let e=r._lastFetchedIndex;e<r._known.length&&(h++,h<=i&&(r._lastFetchedIndex+=1),!(void 0===this._featureCache[r._known[e]]&&(r._known[e]!==a&&n.push(r._known[e]),n.length>=o)));e++);if(0===n.length)return g("success");r=new s([],n,r._ordered,null);const u=Math.min(n.length,i);return this._parent._getFeatures(r,-1,u,l).then((()=>{this._checkCancelled(l);const r=[];for(let e=0;e<u;e++){const t=this._parent._featureFromCache(n[e]);void 0!==t&&r.push({geometry:t.geometry,attributes:t.attributes,id:n[e]})}for(const s of r){const r=[];for(const e of this.adaptedFields)r[e.field.name]=e.extractValue(s);this._featureCache[s.id]=new e({attributes:r,geometry:t(s.geometry)})}return"success"}))}_fetchAndRefineFeatures(){return _(new Error("Fetch and Refine should not be called in this featureset"))}_getFilteredSet(e,t,r,a,i){let l=!1;const n=this._reformulateWithoutAdaptions(r);l=n.cannot,r=n.where;let o=!1;if(null!==a){o=!0;const e=[];for(const t of this.adaptedFields)if(!(t instanceof w)&&!0===a.scanForField(t.field.name)){if(!(t instanceof v)){a=null,o=!1;break}e.push({field:t.field.name,newfield:t.originalField.name})}a&&e.length>0&&(a=a.replaceFields(e))}return null!==r?null!==this._extraFilter&&(r=p(this._extraFilter,r)):r=this._extraFilter,this._ensureLoaded().then((()=>this._parent._getFilteredSet(e,t,r,a,i))).then((e=>{let t;return this._checkCancelled(i),t=!0===l?new s(e._candidates.slice(0).concat(e._known.slice(0)),[],!0===o&&e._ordered,this._clonePageDefinition(e.pagesDefinition)):new s(e._candidates.slice(0),e._known.slice(0),!0===o&&e._ordered,this._clonePageDefinition(e.pagesDefinition)),t}))}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(null!==e)for(const r of this.adaptedFields)if(!0===f(e,r.field.name)){const s=r.rewriteSql(e,this);if(!0!==s.rewritten){t.cannot=!0,t.where=null;break}t.where=s.where}return t}_stat(e,t,r,s,a,i,l){let n=!1,o=this._reformulateWithoutAdaptions(t);return n=o.cannot,t=o.where,o=this._reformulateWithoutAdaptions(a),n=n||o.cannot,null!==(a=o.where)?null!==this._extraFilter&&(a=p(this._extraFilter,a)):a=this._extraFilter,!0===n?null===a&&""===r&&null===s?this._manualStat(e,t,i,l):g({calculated:!1}):this._parent._stat(e,t,r,s,a,i,l).then((n=>!1===n.calculated?null===a&&""===r&&null===s?this._manualStat(e,t,i,l):{calculated:!1}:n))}_canDoAggregates(e,t,r,s,a){if(null===this._parent)return g(!1);for(let n=0;n<e.length;n++)for(const t of this.adaptedFields)if(e[n].toLowerCase()===t.field.name.toLowerCase()&&!(t instanceof w))return g(!1);const i=[];for(let n=0;n<t.length;n++){const e=t[n];if(null!==e.workingexpr){const t=this._reformulateWithoutAdaptions(e.workingexpr);if(t.cannot)return g(!1);const r=e.clone();r.workingexpr=t.where,i.push(r)}else i.push(e)}const l=this._reformulateWithoutAdaptions(a);return l.cannot?g(!1):(null!==(a=l.where)?null!==this._extraFilter&&(a=p(this._extraFilter,a)):a=this._extraFilter,this._parent._canDoAggregates(e,i,r,s,a))}_getAggregatePagesDataSourceDefinition(e,t,r,s,a,i,l){if(null===this._parent)return _(new Error("Should never be called"));const n=[];for(let h=0;h<t.length;h++){const e=t[h];if(null!==e.workingexpr){const t=this._reformulateWithoutAdaptions(e.workingexpr);if(t.cannot)return _(new Error("Should never be called"));const r=e.clone();r.workingexpr=t.where,n.push(r)}else n.push(e)}const o=this._reformulateWithoutAdaptions(a);return o.cannot?_(new Error("Should never be called")):(null!==(a=o.where)?null!==this._extraFilter&&(a=p(this._extraFilter,a)):a=this._extraFilter,this._parent._getAggregatePagesDataSourceDefinition(e,n,r,s,a,i,l))}}export{E as AdaptedFeatureSet,m as AdaptedField,v as FieldRename,w as OriginalField,T as SqlExpressionAdapted,C as StringToCodeAdapted};
5
+ import e from"../../../Graphic.js";import{cloneGeometry as t}from"../../kernel.js";import r from"../support/FeatureSet.js";import s from"../support/IdSet.js";import{cloneField as i,FeatureServiceDatabaseType as a,layerGeometryEsriConstants as l}from"../support/shared.js";import{reformulateWithoutField as n,toWhereClause as o,translateFunctionToDatabaseSpecific as h,makeToday as u,makeDateString as c,convertIntervalToSql as d,combine as p,scanForField as f}from"../support/sqlUtils.js";import{resolve as g,reject as _}from"../../../core/promiseUtils.js";import{WhereClause as N}from"../../../core/sql/WhereClause.js";import S from"../../../geometry/SpatialReference.js";class m{constructor(e){this.field=e,this.sqlRewritable=!1}postInitialization(e,t){}}class w extends m{constructor(e){super(e),this.sqlRewritable=!0}extractValue(e){return e.attributes[this.field.name]}rewriteSql(e){return{rewritten:this.sqlRewritable,where:e}}}class v extends m{constructor(e,t,r){super(i(e)),this.originalField=e,this.sqlRewritable=!0,this.field.name=t,this.field.alias=r}rewriteSql(e,t){return{rewritten:this.sqlRewritable,where:n(e,this.field.name,this.originalField.name,t.getFieldsIndex())}}extractValue(e){return e.attributes[this.originalField.name]}}class C extends m{constructor(e,t,r){super(e),this.codefield=t,this.lkp=r,this.reverseLkp={};for(const s in r)this.reverseLkp[r[s]]=s;this.sqlRewritable=!0}rewriteSql(e,t){const r=this.evaluateNodeToWhereClause(e.parseTree,a.Standardised,this.field.name,this.codefield instanceof N?o(this.codefield,a.Standardised):this.codefield,e.parameters);return r.includes(C.BADNESS)?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:N.create(r,t._parent.getFieldsIndex())}}evaluateNodeToWhereClause(e,t,r=null,s=null,i){let a,l,n,o;switch(e.type){case"interval":return d(this.evaluateNodeToWhereClause(e.value,t,r,s,i),e.qualifier,e.op);case"case-expression":{let s=" CASE ";"simple"===e.format&&(s+=this.evaluateNodeToWhereClause(e.operand,t,r,C.BADNESS,i));for(let a=0;a<e.clauses.length;a++)s+=" WHEN "+this.evaluateNodeToWhereClause(e.clauses[a].operand,t,r,C.BADNESS,i)+" THEN "+this.evaluateNodeToWhereClause(e.clauses[a].value,t,r,C.BADNESS,i);return null!==e.else&&(s+=" ELSE "+this.evaluateNodeToWhereClause(e.else,t,r,C.BADNESS,i)),s+=" END ",s}case"parameter":{const r=i[e.value.toLowerCase()];if("string"==typeof r){return"'"+i[e.value.toLowerCase()].toString().replace(/'/g,"''")+"'"}if(r instanceof Date)return c(r,t);if(r instanceof Array){const e=[];for(let s=0;s<r.length;s++)"string"==typeof r[s]?e.push("'"+r[s].toString().replace(/'/g,"''")+"'"):r[s]instanceof Date?e.push(c(r[s],t)):e.push(r[s].toString());return e}return r.toString()}case"expression-list":l=[];for(const a of e.value)l.push(this.evaluateNodeToWhereClause(a,t,r,s,i));return l;case"unary-expression":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,t,r,C.BADNESS,i)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" AND "+this.evaluateNodeToWhereClause(e.right,t,r,s,i)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" OR "+this.evaluateNodeToWhereClause(e.right,t,r,s,i)+") ";case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" IS NOT NULL )";case"IN":if(a=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const a=[];let l=!0;for(const t of e.right.value){if("string"!==t.type){l=!1;break}if(void 0===this.lkp[t.value]){l=!1;break}a.push(this.lkp[t.value].toString())}if(l)return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" IN ("+a.join(",")+")) "}return a=this.evaluateNodeToWhereClause(e.right,t,r,s,i)," ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" IN ("+a.join(",")+")) "}return o=this.evaluateNodeToWhereClause(e.right,t,r,s,i),o instanceof Array?" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" IN ("+o.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" IN ("+o+")) ";case"NOT IN":if(a=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const a=[];let l=!0;for(const t of e.right.value){if("string"!==t.type){l=!1;break}if(void 0===this.lkp[t.value]){l=!1;break}a.push(this.lkp[t.value].toString())}if(l)return" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" NOT IN ("+a.join(",")+")) "}return a=this.evaluateNodeToWhereClause(e.right,t,r,s,i)," ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" NOT IN ("+a.join(",")+")) "}return o=this.evaluateNodeToWhereClause(e.right,t,r,s,i),o instanceof Array?" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" NOT IN ("+o.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,s,i)+" NOT IN ("+o+")) ";case"BETWEEN":return n=this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,i)," ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,i)+" BETWEEN "+n[0]+" AND "+n[1]+" ) ";case"NOTBETWEEN":return n=this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,i)," ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,i)+" NOT BETWEEN "+n[0]+" AND "+n[1]+" ) ";case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,i)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,i)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,i)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,i)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,i)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,i)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,i)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,i)+") ";case"<>":case"=":if("column-reference"===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" ("+s+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if("column-reference"===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+" "+s+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,i)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,i)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":return" ("+this.evaluateNodeToWhereClause(e.left,t,r,C.BADNESS,i)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,r,C.BADNESS,i)+") "}case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return c(e.value,t);case"number":return e.value.toString();case"current-time":return u("date"===e.mode,t);case"column-reference":return r&&r.toLowerCase()===e.column.toLowerCase()?"("+s+")":e.column;case"function":{const s=this.evaluateNodeToWhereClause(e.args,t,r,C.BADNESS,i);return h(e.name,s,t)}}throw new Error("Unsupported sql syntax "+e.type)}extractValue(e){return this.codefield instanceof N?this.reverseLkp[this.codefield.calculateValueCompiled(e)]:this.reverseLkp[e.attributes[this.codefield]]}}C.BADNESS="_!!!_BAD_LKP_!!!!";class T extends m{constructor(e,t){super(e),this.sql=t}rewriteSql(e,t){return{rewritten:!0,where:n(e,this.field.name,o(this.sql,a.Standardised),t.getFieldsIndex())}}extractValue(e){return this.sql.calculateValueCompiled(e)}}class E extends r{constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=null,this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}static findField(e,t){for(const r of e)if(r.name.toLowerCase()===t.toString().toLowerCase())return r;return null}_initialiseFeatureSet(){null!==this._parent?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,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 S({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=l.point,this.typeIdField="",this.types=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}_getSet(e){return null===this._wset?this._ensureLoaded().then((()=>this._extraFilter?this._getFilteredSet("",null,null,null,e):this._parent._getSet(e))).then((t=>(this._checkCancelled(e),this._wset=new s(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset))):g(this._wset)}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(r,i,a,l){const n=[];-1!==i&&void 0===this._featureCache[i]&&n.push(i);const o=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(r,o))return this._expandPagedSet(r,o,0,0,l).then((()=>this._getFeatures(r,i,a,l)));let h=0;for(let e=r._lastFetchedIndex;e<r._known.length&&(h++,h<=a&&(r._lastFetchedIndex+=1),!(void 0===this._featureCache[r._known[e]]&&(r._known[e]!==i&&n.push(r._known[e]),n.length>=o)));e++);if(0===n.length)return g("success");r=new s([],n,r._ordered,null);const u=Math.min(n.length,a);return this._parent._getFeatures(r,-1,u,l).then((()=>{this._checkCancelled(l);const r=[];for(let e=0;e<u;e++){const t=this._parent._featureFromCache(n[e]);void 0!==t&&r.push({geometry:t.geometry,attributes:t.attributes,id:n[e]})}for(const s of r){const r=[];for(const e of this.adaptedFields)r[e.field.name]=e.extractValue(s);this._featureCache[s.id]=new e({attributes:r,geometry:t(s.geometry)})}return"success"}))}_fetchAndRefineFeatures(){return _(new Error("Fetch and Refine should not be called in this featureset"))}_getFilteredSet(e,t,r,i,a){let l=!1;const n=this._reformulateWithoutAdaptions(r);l=n.cannot,r=n.where;let o=!1;if(null!==i){o=!0;const e=[];for(const t of this.adaptedFields)if(!(t instanceof w)&&!0===i.scanForField(t.field.name)){if(!(t instanceof v)){i=null,o=!1;break}e.push({field:t.field.name,newfield:t.originalField.name})}i&&e.length>0&&(i=i.replaceFields(e))}return null!==r?null!==this._extraFilter&&(r=p(this._extraFilter,r)):r=this._extraFilter,this._ensureLoaded().then((()=>this._parent._getFilteredSet(e,t,r,i,a))).then((e=>{let t;return this._checkCancelled(a),t=!0===l?new s(e._candidates.slice(0).concat(e._known.slice(0)),[],!0===o&&e._ordered,this._clonePageDefinition(e.pagesDefinition)):new s(e._candidates.slice(0),e._known.slice(0),!0===o&&e._ordered,this._clonePageDefinition(e.pagesDefinition)),t}))}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(null!==e)for(const r of this.adaptedFields)if(!0===f(e,r.field.name)){const s=r.rewriteSql(e,this);if(!0!==s.rewritten){t.cannot=!0,t.where=null;break}t.where=s.where}return t}_stat(e,t,r,s,i,a,l){let n=!1,o=this._reformulateWithoutAdaptions(t);return n=o.cannot,t=o.where,o=this._reformulateWithoutAdaptions(i),n=n||o.cannot,null!==(i=o.where)?null!==this._extraFilter&&(i=p(this._extraFilter,i)):i=this._extraFilter,!0===n?null===i&&""===r&&null===s?this._manualStat(e,t,a,l):g({calculated:!1}):this._parent._stat(e,t,r,s,i,a,l).then((n=>!1===n.calculated?null===i&&""===r&&null===s?this._manualStat(e,t,a,l):{calculated:!1}:n))}_canDoAggregates(e,t,r,s,i){if(null===this._parent)return g(!1);for(let n=0;n<e.length;n++)for(const t of this.adaptedFields)if(e[n].toLowerCase()===t.field.name.toLowerCase()&&!(t instanceof w))return g(!1);const a=[];for(let n=0;n<t.length;n++){const e=t[n];if(null!==e.workingexpr){const t=this._reformulateWithoutAdaptions(e.workingexpr);if(t.cannot)return g(!1);const r=e.clone();r.workingexpr=t.where,a.push(r)}else a.push(e)}const l=this._reformulateWithoutAdaptions(i);return l.cannot?g(!1):(null!==(i=l.where)?null!==this._extraFilter&&(i=p(this._extraFilter,i)):i=this._extraFilter,this._parent._canDoAggregates(e,a,r,s,i))}_getAggregatePagesDataSourceDefinition(e,t,r,s,i,a,l){if(null===this._parent)return _(new Error("Should never be called"));const n=[];for(let h=0;h<t.length;h++){const e=t[h];if(null!==e.workingexpr){const t=this._reformulateWithoutAdaptions(e.workingexpr);if(t.cannot)return _(new Error("Should never be called"));const r=e.clone();r.workingexpr=t.where,n.push(r)}else n.push(e)}const o=this._reformulateWithoutAdaptions(i);return o.cannot?_(new Error("Should never be called")):(null!==(i=o.where)?null!==this._extraFilter&&(i=p(this._extraFilter,i)):i=this._extraFilter,this._parent._getAggregatePagesDataSourceDefinition(e,n,r,s,i,a,l))}}export{E as AdaptedFeatureSet,m as AdaptedField,v as FieldRename,w as OriginalField,T as SqlExpressionAdapted,C as StringToCodeAdapted};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureServiceDatabaseType as e}from"./shared.js";import{WhereClause as r}from"../../../core/sql/WhereClause.js";import{DateTime as t}from"luxon";function n(e,r){return c(e.parseTree,r,e.parameters)}function a(e,r,t){return c(e,r,t)}function s(t,n,a,s){return r.create(c(t.parseTree,e.Standardised,t.parameters,n,a),s)}function o(t,a,s="AND"){return r.create("(("+n(t,e.Standardised)+")"+s+"("+n(a,e.Standardised)+"))",t.fieldsIndex)}function c(e,r,t,n=null,a=null){let s,o,f,d;switch(e.type){case"interval":return T(c(e.value,r,t,n,a),e.qualifier,e.op);case"case_expression":{let s=" CASE ";"simple"===e.format&&(s+=c(e.operand,r,t,n,a));for(let o=0;o<e.clauses.length;o++)s+=" WHEN "+c(e.clauses[o].operand,r,t,n,a)+" THEN "+c(e.clauses[o].value,r,t,n,a);return null!==e.else&&(s+=" ELSE "+c(e.else,r,t,n,a)),s+=" END ",s}case"param":{const n=t[e.value.toLowerCase()];if("string"==typeof n){return"'"+t[e.value.toLowerCase()].toString().replace(/'/g,"''")+"'"}if(n instanceof Date)return u(n,r);if(n instanceof Array){const e=[];for(let t=0;t<n.length;t++)"string"==typeof n[t]?e.push("'"+n[t].toString().replace(/'/g,"''")+"'"):n[t]instanceof Date?e.push(u(n[t],r)):e.push(n[t].toString());return e}return n.toString()}case"expr_list":o=[];for(const s of e.value)o.push(c(s,r,t,n,a));return o;case"unary_expr":return" ( NOT "+c(e.expr,r,t,n,a)+" ) ";case"binary_expr":switch(e.operator){case"AND":return" ("+c(e.left,r,t,n,a)+" AND "+c(e.right,r,t,n,a)+") ";case"OR":return" ("+c(e.left,r,t,n,a)+" OR "+c(e.right,r,t,n,a)+") ";case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+c(e.left,r,t,n,a)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+c(e.left,r,t,n,a)+" IS NOT NULL )";case"IN":return s=[],"expr_list"===e.right.type?(s=c(e.right,r,t,n,a)," ("+c(e.left,r,t,n,a)+" IN ("+s.join(",")+")) "):(d=c(e.right,r,t,n,a),d instanceof Array?" ("+c(e.left,r,t,n,a)+" IN ("+d.join(",")+")) ":" ("+c(e.left,r,t,n,a)+" IN ("+d+")) ");case"NOT IN":return s=[],"expr_list"===e.right.type?(s=c(e.right,r,t,n,a)," ("+c(e.left,r,t,n,a)+" NOT IN ("+s.join(",")+")) "):(d=c(e.right,r,t,n,a),d instanceof Array?" ("+c(e.left,r,t,n,a)+" NOT IN ("+d.join(",")+")) ":" ("+c(e.left,r,t,n,a)+" NOT IN ("+d+")) ");case"BETWEEN":return f=c(e.right,r,t,n,a)," ("+c(e.left,r,t,n,a)+" BETWEEN "+f[0]+" AND "+f[1]+" ) ";case"NOTBETWEEN":return f=c(e.right,r,t,n,a)," ("+c(e.left,r,t,n,a)+" NOT BETWEEN "+f[0]+" AND "+f[1]+" ) ";case"LIKE":return""!==e.escape?" ("+c(e.left,r,t,n,a)+" LIKE "+c(e.right,r,t,n,a)+" ESCAPE '"+e.escape+"') ":" ("+c(e.left,r,t,n,a)+" LIKE "+c(e.right,r,t,n,a)+") ";case"NOT LIKE":return""!==e.escape?" ("+c(e.left,r,t,n,a)+" NOT LIKE "+c(e.right,r,t,n,a)+" ESCAPE '"+e.escape+"') ":" ("+c(e.left,r,t,n,a)+" NOT LIKE "+c(e.right,r,t,n,a)+") ";case"<>":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+c(e.left,r,t,n,a)+" "+e.operator+" "+c(e.right,r,t,n,a)+") "}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 u(e.value,r);case"number":return e.value.toString();case"current_time":return i("date"===e.mode,r);case"column_ref":return n&&n.toLowerCase()===e.column.toLowerCase()?"("+a+")":e.column;case"function":{const s=c(e.args,r,t,n,a);return l(e.name,s,r)}}throw new Error("Unsupported sql syntax "+e.type)}function l(r,t,n){switch(r.toLowerCase().trim()){case"abs":if(1!==t.length)throw new Error("Invalid Parameter for call to ABS");return"abs("+t[0]+")";case"ceiling":case"ceil":if(1!==t.length)throw new Error("Invalid Parameter for call to CEILING");switch(n){case e.Standardised:case e.StandardisedNoInterval:}return"CEILING("+t[0]+")";case"floor":if(1!==t.length)throw new Error("Invalid Parameter for call to Floor");return"FLOOR("+t[0]+")";case"log":if(1!==t.length)throw new Error("Invalid Parameter for call to LOG");return"LOG("+t[0]+")";case"log10":if(1!==t.length)throw new Error("Invalid Parameter for call to LOG10");return"LOG10("+t[0]+")";case"power":if(2!==t.length)throw new Error("Invalid Parameter for call to POWER");return"POWER("+t[0]+","+t[1]+")";case"round":if(2===t.length)return"ROUND("+t[0]+","+t[1]+")";if(1===t.length)return"ROUND("+t[0]+")";throw new Error("Invalid Parameter for call to ROUND");case"truncate":if(t.length<1||t.length>2)throw new Error("Invalid Parameter for TRUNCATE function");return n===e.SqlServer?"ROUND("+t[0]+(1===t.length?"0":","+t[1])+",1)":"TRUNCATE("+t[0]+(1===t.length?")":","+t[1]+")");case"char_length":case"len":if(1!==t.length)throw new Error("Invalid Parameter for CHAR_LENGTH function");switch(n){case e.SqlServer:return"LEN("+t[0]+")";case e.Oracle:return"LENGTH("+t[0]+")";default:return"CHAR_LENGTH("+t[0]+")"}case"concat":if(t.length<1)throw new Error("Invalid Parameter for CONCAT function");{let e="CONCAT(";for(let r=0;r<t.length;r++)0!==r&&(e+=","),e+=t[r];return e+=")",e}case"lower":case"lcase":if(1!==t.length)throw new Error("Invalid Parameter for Lower function");return"LOWER("+t[0]+")";case"upper":case"ucase":if(1!==t.length)throw new Error("Invalid Parameter for Upper function");return"UPPER("+t[0]+")";case"substring":{let r="";switch(n){case e.Oracle:return r="SUBSTR("+t[0]+","+t[1],3===t.length&&(r+=","+t[2]),r+=")",r;case e.SqlServer:return r=3===t.length?"SUBSTRING("+t[0]+","+t[1]+","+t[2]+")":"SUBSTRING("+t[0]+", "+t[1]+", LEN("+t[0]+") - "+t[1]+")",r;default:return r="SUBSTRING("+t[0]+" FROM "+t[1],3===t.length&&(r+=" FOR "+t[2]),r+=")",r}}case"extract":return"EXTRACT("+t[0].replace(/\'/g,"")+" FROM "+t[1]+")"}throw new Error("Function Not Recognised")}function u(r,n){const a=t.fromJSDate(r),s=0===a.hour&&0===a.minute&&0===a.second&&0===a.millisecond;switch(n){case e.FILEGDB:case e.Standardised:case e.StandardisedNoInterval:return s?`date '${a.toFormat("yyyy-LL-dd")}'`:`date '${a.toFormat("yyyy-LL-dd HH:mm:ss")}'`;case e.Oracle:return s?`TO_DATE('${a.toFormat("yyyy-LL-dd")}','YYYY-MM-DD')`:`TO_DATE('${a.toFormat("yyyy-LL-dd HH:mm:ss")}','YYYY-MM-DD HH24:MI:SS')`;case e.SqlServer:return`'${a.toFormat(s?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;case e.PGDB:return`#${a.toFormat(s?"LL-dd-yyyy":"LL-dd-yyyy HH:mm:ss")}#`;case e.Postgres:return`TIMESTAMP '${a.toFormat(s?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;default:return`date '${a.toFormat("yyyy-LL-dd HH:mm:ss")}'`}}function i(r,t){switch(t){case e.FILEGDB:case e.Standardised:case e.StandardisedNoInterval:case e.Oracle:return r?"CURRENT_DATE":"CURRENT_TIMESTAMP";case e.SqlServer:return r?"CAST(GETDATE() AS DATE)":"GETDATE()";case e.PGDB:case e.Postgres:default:return r?"CURRENT_DATE":"CURRENT_TIMESTAMP"}}function f(e,r,t={}){const n={},a={},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"};for(const o of r){const e=s[o.type];n[o.name.toLowerCase()]=void 0===e?"":e}for(const o in t){const e=s[t[o]];a[o.toLowerCase()]=void 0===e?"":e}switch(d(n,e.parseTree,e.parameters,a)){case"double":return"double";case"integer":return"integer";case"date":return"date";case"string":return"string"}return""}function d(e,r,t,n){let a;switch(r.type){case"interval":return"integer";case"case_expression":{const a=[];if("simple"===r.format){for(let s=0;s<r.clauses.length;s++)a.push(d(e,r.clauses[s].value,t,n));null!==r.else&&a.push(d(e,r.else,t,n))}else{for(let s=0;s<r.clauses.length;s++)a.push(d(e,r.else,t,n));null!==r.else&&a.push(d(e,r.else,t,n))}return g(a)}case"param":{const e=n[r.value.toLowerCase()];if(void 0===e&&t){const e=t[r.value.toLowerCase()];if(void 0===e)return"";if(null===e)return"";if("string"==typeof e||e instanceof String)return"string";if("boolean"==typeof e)return"boolean";if(e instanceof Date)return"date";if("number"==typeof e)return e%1==0?"integer":"double"}return void 0===e?"":e}case"expr_list":{const a=[];for(const s of r.value)a.push(d(e,s,t,n));return a}case"unary_expr":return"boolean";case"binary_expr":switch(r.operator){case"AND":case"OR":case"IN":case"NOT IN":case"BETWEEN":case"NOTBETWEEN":case"LIKE":case"NOT LIKE":case"<>":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if("null"!==r.right.type)throw new Error("Unsupported RHS for IS");return"boolean";case"*":case"-":case"+":case"/":return g([d(e,r.left,t,n),d(e,r.right,t,n)]);default: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":case"current_time":return"date";case"column_ref":{const t=e[r.column.toLowerCase()];return void 0===t?"":t}case"function":switch(r.name.toLowerCase()){case"position":case"extract":case"char_length":return"integer";case"round":return a=d(e,r.args,t,n),a instanceof Array?a.length>0?a[0]:"":a;case"sign":return a=d(e,r.args,t,n),a instanceof Array&&(a=g(a)),"integer"===a||"double"===a?a:"double";case"ceiling":case"floor":case"abs":{const a=d(e,r.args,t,n);return a instanceof Array?g(a):a}case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"power":case"truncate":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string"}return""}throw new Error("Unsupported sql syntax "+r.type)}const p={boolean:1,string:2,integer:3,double:4,date:5};function g(e){if(e){let r="";for(const t of e)""!==t&&(r=""===r||p[r]<p[t]?t:r);return r}return""}function h(e,r){return y(e.parseTree,r)}function E(e){return"column_ref"===e.parseTree.type}function y(e,r){if(null==e)return!1;switch(e.type){case"when_clause":return y(e.operand,r)||y(e.value,r);case"case_expression":for(const t of e.clauses)if(y(t,r))return!0;return!("simple"!==e.format||!y(e.operand,r))||!(null===e.else||!y(e.else,r));case"param":case"null":case"bool":case"date":case"timestamp":case"string":case"number":return!1;case"expr_list":for(const t of e.value)if(y(t,r))return!0;return!1;case"unary_expr":return y(e.expr,r);case"binary_expr":return y(e.left,r)||y(e.right,r);case"column_ref":return r.toLowerCase()===e.column.toLowerCase();case"function":return y(e.args,r)}return!1}function m(e){let r="";return r+=e.period.toUpperCase(),r}function T(e,r,t){let n="";return n="interval-period"===r.type?m(r):m(r.start)+" TO "+m(r.end),"INTERVAL "+t+" "+e+" "+n}export{o as combine,T as convertIntervalToSql,E as isSingleField,u as makeDateString,i as makeToday,f as predictType,s as reformulateWithoutField,h as scanForField,n as toWhereClause,a as toWhereClauseFromTree,l as translateFunctionToDatabaseSpecific};
5
+ import{FeatureServiceDatabaseType as e}from"./shared.js";import{WhereClause as r}from"../../../core/sql/WhereClause.js";import{DateTime as t}from"luxon";function n(e,r){return c(e.parseTree,r,e.parameters)}function a(e,r,t){return c(e,r,t)}function s(t,n,a,s){return r.create(c(t.parseTree,e.Standardised,t.parameters,n,a),s)}function o(t,a,s="AND"){return r.create("(("+n(t,e.Standardised)+")"+s+"("+n(a,e.Standardised)+"))",t.fieldsIndex)}function c(e,r,t,n=null,a=null){let s,o,f,d;switch(e.type){case"interval":return T(c(e.value,r,t,n,a),e.qualifier,e.op);case"case-expression":{let s=" CASE ";"simple"===e.format&&(s+=c(e.operand,r,t,n,a));for(let o=0;o<e.clauses.length;o++)s+=" WHEN "+c(e.clauses[o].operand,r,t,n,a)+" THEN "+c(e.clauses[o].value,r,t,n,a);return null!==e.else&&(s+=" ELSE "+c(e.else,r,t,n,a)),s+=" END ",s}case"parameter":{const n=t[e.value.toLowerCase()];if("string"==typeof n){return"'"+t[e.value.toLowerCase()].toString().replace(/'/g,"''")+"'"}if(n instanceof Date)return i(n,r);if(n instanceof Array){const e=[];for(let t=0;t<n.length;t++)"string"==typeof n[t]?e.push("'"+n[t].toString().replace(/'/g,"''")+"'"):n[t]instanceof Date?e.push(i(n[t],r)):e.push(n[t].toString());return e}return n.toString()}case"expression-list":o=[];for(const s of e.value)o.push(c(s,r,t,n,a));return o;case"unary-expression":return" ( NOT "+c(e.expr,r,t,n,a)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+c(e.left,r,t,n,a)+" AND "+c(e.right,r,t,n,a)+") ";case"OR":return" ("+c(e.left,r,t,n,a)+" OR "+c(e.right,r,t,n,a)+") ";case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+c(e.left,r,t,n,a)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+c(e.left,r,t,n,a)+" IS NOT NULL )";case"IN":return s=[],"expression-list"===e.right.type?(s=c(e.right,r,t,n,a)," ("+c(e.left,r,t,n,a)+" IN ("+s.join(",")+")) "):(d=c(e.right,r,t,n,a),d instanceof Array?" ("+c(e.left,r,t,n,a)+" IN ("+d.join(",")+")) ":" ("+c(e.left,r,t,n,a)+" IN ("+d+")) ");case"NOT IN":return s=[],"expression-list"===e.right.type?(s=c(e.right,r,t,n,a)," ("+c(e.left,r,t,n,a)+" NOT IN ("+s.join(",")+")) "):(d=c(e.right,r,t,n,a),d instanceof Array?" ("+c(e.left,r,t,n,a)+" NOT IN ("+d.join(",")+")) ":" ("+c(e.left,r,t,n,a)+" NOT IN ("+d+")) ");case"BETWEEN":return f=c(e.right,r,t,n,a)," ("+c(e.left,r,t,n,a)+" BETWEEN "+f[0]+" AND "+f[1]+" ) ";case"NOTBETWEEN":return f=c(e.right,r,t,n,a)," ("+c(e.left,r,t,n,a)+" NOT BETWEEN "+f[0]+" AND "+f[1]+" ) ";case"LIKE":return""!==e.escape?" ("+c(e.left,r,t,n,a)+" LIKE "+c(e.right,r,t,n,a)+" ESCAPE '"+e.escape+"') ":" ("+c(e.left,r,t,n,a)+" LIKE "+c(e.right,r,t,n,a)+") ";case"NOT LIKE":return""!==e.escape?" ("+c(e.left,r,t,n,a)+" NOT LIKE "+c(e.right,r,t,n,a)+" ESCAPE '"+e.escape+"') ":" ("+c(e.left,r,t,n,a)+" NOT LIKE "+c(e.right,r,t,n,a)+") ";case"<>":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+c(e.left,r,t,n,a)+" "+e.operator+" "+c(e.right,r,t,n,a)+") "}throw new Error("Not Supported Operator "+e.operator);case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return i(e.value,r);case"number":return e.value.toString();case"current-time":return u("date"===e.mode,r);case"column-reference":return n&&n.toLowerCase()===e.column.toLowerCase()?"("+a+")":e.column;case"function":{const s=c(e.args,r,t,n,a);return l(e.name,s,r)}}throw new Error("Unsupported sql syntax "+e.type)}function l(r,t,n){switch(r.toLowerCase().trim()){case"abs":if(1!==t.length)throw new Error("Invalid Parameter for call to ABS");return"abs("+t[0]+")";case"ceiling":case"ceil":if(1!==t.length)throw new Error("Invalid Parameter for call to CEILING");switch(n){case e.Standardised:case e.StandardisedNoInterval:}return"CEILING("+t[0]+")";case"floor":if(1!==t.length)throw new Error("Invalid Parameter for call to Floor");return"FLOOR("+t[0]+")";case"log":if(1!==t.length)throw new Error("Invalid Parameter for call to LOG");return"LOG("+t[0]+")";case"log10":if(1!==t.length)throw new Error("Invalid Parameter for call to LOG10");return"LOG10("+t[0]+")";case"power":if(2!==t.length)throw new Error("Invalid Parameter for call to POWER");return"POWER("+t[0]+","+t[1]+")";case"round":if(2===t.length)return"ROUND("+t[0]+","+t[1]+")";if(1===t.length)return"ROUND("+t[0]+")";throw new Error("Invalid Parameter for call to ROUND");case"truncate":if(t.length<1||t.length>2)throw new Error("Invalid Parameter for TRUNCATE function");return n===e.SqlServer?"ROUND("+t[0]+(1===t.length?"0":","+t[1])+",1)":"TRUNCATE("+t[0]+(1===t.length?")":","+t[1]+")");case"char_length":case"len":if(1!==t.length)throw new Error("Invalid Parameter for CHAR_LENGTH function");switch(n){case e.SqlServer:return"LEN("+t[0]+")";case e.Oracle:return"LENGTH("+t[0]+")";default:return"CHAR_LENGTH("+t[0]+")"}case"concat":if(t.length<1)throw new Error("Invalid Parameter for CONCAT function");{let e="CONCAT(";for(let r=0;r<t.length;r++)0!==r&&(e+=","),e+=t[r];return e+=")",e}case"lower":case"lcase":if(1!==t.length)throw new Error("Invalid Parameter for Lower function");return"LOWER("+t[0]+")";case"upper":case"ucase":if(1!==t.length)throw new Error("Invalid Parameter for Upper function");return"UPPER("+t[0]+")";case"substring":{let r="";switch(n){case e.Oracle:return r="SUBSTR("+t[0]+","+t[1],3===t.length&&(r+=","+t[2]),r+=")",r;case e.SqlServer:return r=3===t.length?"SUBSTRING("+t[0]+","+t[1]+","+t[2]+")":"SUBSTRING("+t[0]+", "+t[1]+", LEN("+t[0]+") - "+t[1]+")",r;default:return r="SUBSTRING("+t[0]+" FROM "+t[1],3===t.length&&(r+=" FOR "+t[2]),r+=")",r}}case"extract":return"EXTRACT("+t[0].replace(/\'/g,"")+" FROM "+t[1]+")"}throw new Error("Function Not Recognised")}function i(r,n){const a=t.fromJSDate(r),s=0===a.hour&&0===a.minute&&0===a.second&&0===a.millisecond;switch(n){case e.FILEGDB:case e.Standardised:case e.StandardisedNoInterval:return s?`date '${a.toFormat("yyyy-LL-dd")}'`:`date '${a.toFormat("yyyy-LL-dd HH:mm:ss")}'`;case e.Oracle:return s?`TO_DATE('${a.toFormat("yyyy-LL-dd")}','YYYY-MM-DD')`:`TO_DATE('${a.toFormat("yyyy-LL-dd HH:mm:ss")}','YYYY-MM-DD HH24:MI:SS')`;case e.SqlServer:return`'${a.toFormat(s?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;case e.PGDB:return`#${a.toFormat(s?"LL-dd-yyyy":"LL-dd-yyyy HH:mm:ss")}#`;case e.Postgres:return`TIMESTAMP '${a.toFormat(s?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;default:return`date '${a.toFormat("yyyy-LL-dd HH:mm:ss")}'`}}function u(r,t){switch(t){case e.FILEGDB:case e.Standardised:case e.StandardisedNoInterval:case e.Oracle:return r?"CURRENT_DATE":"CURRENT_TIMESTAMP";case e.SqlServer:return r?"CAST(GETDATE() AS DATE)":"GETDATE()";case e.PGDB:case e.Postgres:default:return r?"CURRENT_DATE":"CURRENT_TIMESTAMP"}}function f(e,r,t={}){const n={},a={},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"};for(const o of r){const e=s[o.type];n[o.name.toLowerCase()]=void 0===e?"":e}for(const o in t){const e=s[t[o]];a[o.toLowerCase()]=void 0===e?"":e}switch(d(n,e.parseTree,e.parameters,a)){case"double":return"double";case"integer":return"integer";case"date":return"date";case"string":return"string"}return""}function d(e,r,t,n){let a;switch(r.type){case"interval":return"integer";case"case-expression":{const a=[];if("simple"===r.format){for(let s=0;s<r.clauses.length;s++)a.push(d(e,r.clauses[s].value,t,n));null!==r.else&&a.push(d(e,r.else,t,n))}else{for(let s=0;s<r.clauses.length;s++)a.push(d(e,r.else,t,n));null!==r.else&&a.push(d(e,r.else,t,n))}return g(a)}case"parameter":{const e=n[r.value.toLowerCase()];if(void 0===e&&t){const e=t[r.value.toLowerCase()];if(void 0===e)return"";if(null===e)return"";if("string"==typeof e||e instanceof String)return"string";if("boolean"==typeof e)return"boolean";if(e instanceof Date)return"date";if("number"==typeof e)return e%1==0?"integer":"double"}return void 0===e?"":e}case"expression-list":{const a=[];for(const s of r.value)a.push(d(e,s,t,n));return a}case"unary-expression":return"boolean";case"binary-expression":switch(r.operator){case"AND":case"OR":case"IN":case"NOT IN":case"BETWEEN":case"NOTBETWEEN":case"LIKE":case"NOT LIKE":case"<>":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if("null"!==r.right.type)throw new Error("Unsupported RHS for IS");return"boolean";case"*":case"-":case"+":case"/":return g([d(e,r.left,t,n),d(e,r.right,t,n)]);default:throw new Error("Not Supported Operator "+r.operator)}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return null===r.value?"":r.value%1==0?"integer":"double";case"date":case"timestamp":case"current-time":return"date";case"column-reference":{const t=e[r.column.toLowerCase()];return void 0===t?"":t}case"function":switch(r.name.toLowerCase()){case"position":case"extract":case"char_length":return"integer";case"round":return a=d(e,r.args,t,n),a instanceof Array?a.length>0?a[0]:"":a;case"sign":return a=d(e,r.args,t,n),a instanceof Array&&(a=g(a)),"integer"===a||"double"===a?a:"double";case"ceiling":case"floor":case"abs":{const a=d(e,r.args,t,n);return a instanceof Array?g(a):a}case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"power":case"truncate":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string"}return""}throw new Error("Unsupported sql syntax "+r.type)}const p={boolean:1,string:2,integer:3,double:4,date:5};function g(e){if(e){let r="";for(const t of e)""!==t&&(r=""===r||p[r]<p[t]?t:r);return r}return""}function h(e,r){return y(e.parseTree,r)}function E(e){return"column-reference"===e.parseTree.type}function y(e,r){if(null==e)return!1;switch(e.type){case"when-clause":return y(e.operand,r)||y(e.value,r);case"case-expression":for(const t of e.clauses)if(y(t,r))return!0;return!("simple"!==e.format||!y(e.operand,r))||!(null===e.else||!y(e.else,r));case"parameter":case"null":case"boolean":case"date":case"timestamp":case"string":case"number":return!1;case"expression-list":for(const t of e.value)if(y(t,r))return!0;return!1;case"unary-expression":return y(e.expr,r);case"binary-expression":return y(e.left,r)||y(e.right,r);case"column-reference":return r.toLowerCase()===e.column.toLowerCase();case"function":return y(e.args,r)}return!1}function m(e){let r="";return r+=e.period.toUpperCase(),r}function T(e,r,t){let n="";return n="interval-period"===r.type?m(r):m(r.start)+" TO "+m(r.end),"INTERVAL "+t+" "+e+" "+n}export{o as combine,T as convertIntervalToSql,E as isSingleField,i as makeDateString,u as makeToday,f as predictType,s as reformulateWithoutField,h as scanForField,n as toWhereClause,a as toWhereClauseFromTree,l as translateFunctionToDatabaseSpecific};
@@ -1 +1 @@
1
- var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s}),r(80442);var n=r(78286),o=r(17202);const s={apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.24.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(s,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),s.request.corsEnabledServers=[],s.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof i))return new i(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=void 0,this instanceof o&&(this.message=t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,r)=>{if(""===r)return"$";const o=(0,n.hS)(r,t),s=null==o?"":o;if(void 0===s)throw new Error(`could not find key "${r}" in template`);return s.toString()}))}(t,r)||"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=null==e?Math.random()*n._m:e}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{"use strict";r.d(t,{FY:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function i(e,t){let r=e.length!==t.length;e.length=t.length;for(let n=0;n<t.length;++n)e[n]!==t[n]&&(e[n]=t[n],r=!0);return r}function a(e,t,r){let n,o;return r?(n=t.filter((t=>!e.some((e=>r(e,t))))),o=e.filter((e=>!t.some((t=>r(t,e)))))):(n=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:n,removed:o}}function c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function f(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class d{constructor(){this.last=0}}const h=new d;function p(e,t,r,n){n=n||h;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function b(e,t,r,n){const o=null==r?e.length:r,s=p(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const g=new Set;function m(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;g.clear();for(let e=0;e<n;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;return g.clear(),r}function y(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},60235:(e,t,r)=>{"use strict";r.d(t,{XV:()=>i,x9:()=>a});var n=r(80442);const o=new Set;function s(e,t,r=!1){r&&o.has(t)||(r&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{moduleName:n}=r;a(e,"Function: "+(n?n+"::":"")+t+"()",r)}}function a(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{replacement:n,version:o,see:i,warnOnce:a}=r;let c=t;n&&(c+=`\n\t🛠️ Replacement: ${n}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{IH:()=>s,on:()=>o,vT:()=>n})},80442:(e,t,r)=>{"use strict";let n;function o(e){return"function"==typeof n[e]?n[e]=n[e](globalThis):n[e]}r.d(t,{Z:()=>o}),n=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,r,s)=>((s||void 0===n[e])&&(n[e]=t),r&&o(e)),o.cache=n,o.add("esri-deprecation-warnings",!0),(()=>{o.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",r.includes("Konqueror")?n:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!r.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(r.split("Version/")[1])),o.add("mac",r.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));o.add(e,n),o.add("ios",n)}o.add("trident",parseFloat(r.split("Trident/")[1])||void 0),o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("trident")||o("edge")||o.add("mozilla",n),o("mozilla")&&o.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&o.add("esri-mobile",t),r&&o.add("esri-iPhone",r),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-canvas-svg-support",!o("trident")),o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-enabled",!1),o.add("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),o.add("heatmap-force-raster",!1),o.add("heatmap-kernel-density",!1),o.add("heatmap-kernel-density-disable-conversion",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{Vo:()=>a,d9:()=>i,fS:()=>d,yd:()=>s}),r(67676),r(80442);var n=r(70586),o=r(1533);function s(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&s(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function i(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(c(e))return e.clone();if(l(e))return e.map(i);if(u(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=i(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(l(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(c(e))return e.clone();if(!u(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function f(e){if((0,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(e))return(0,o.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,i(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(i(e))})),t}return null}function d(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e){return void 0===e}function i(e,t){return n(e)?t(e):null}function a(e){return e}function c(e,t){if(o(e))throw new Error(t);return e}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e,t){return n(e)?e:t}function f(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function h(e){return n(e)&&e.remove(),null}function p(e){return n(e)&&e.release(),null}function b(e){return null}function g(e,t){const r=new Array;for(const n of e)r.push(y(n,null,t));return r}function m(e,t){for(const r of e)i(r,t)}function y(e,t,r){return n(e)?r(e):t}function w(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function v(e){return e}r.d(t,{Bd:()=>b,Fd:()=>g,JR:()=>m,O3:()=>d,Pt:()=>l,R2:()=>y,RY:()=>p,SC:()=>f,U2:()=>w,Wg:()=>a,Wi:()=>o,hw:()=>h,j0:()=>v,o8:()=>s,pC:()=>n,s3:()=>c,yl:()=>u,yw:()=>i})},78286:(e,t,r)=>{"use strict";r.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>A,$6:()=>f,Ue:()=>d,zE:()=>h,dD:()=>P,hh:()=>$,vr:()=>N,Ds:()=>M,as:()=>S,WW:()=>C,R8:()=>k,D_:()=>O,Hc:()=>g,y8:()=>x,fu:()=>w,$F:()=>v,d1:()=>E,DB:()=>j,r9:()=>m,k_:()=>p,H9:()=>y,Yn:()=>I,gx:()=>T,Hl:()=>_});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o,s=r(60235),i=r(20102),a=r(91460),c=r(92604),l=r(70586);const u=c.Z.getLogger("esri.core.promiseUtils");function f(e){return(0,s.XV)(u,"all()",{moduleName:"promiseUtils",replacement:"Promise.all()",version:"4.19"}),Promise.all(e)}function d(e){return new Promise(((t,r)=>{try{e(t,r)}catch(e){Promise.resolve().then((()=>r(e)))}}))}function h(e="Aborted"){return new i.Z("AbortError",e)}function p(e,t="Aborted"){if(g(e))throw h(t)}function b(e){return(0,l.pC)(e)?"aborted"in e?e:e.signal:e}function g(e){const t=b(e);return(0,l.pC)(t)&&t.aborted}function m(e){if(O(e))throw e}function y(e){if(!O(e))throw e}function w(e,t){const r=b(e);if(!(0,l.Wi)(r)){if(!r.aborted)return(0,a.IH)(r,"abort",(()=>t()));t()}}function v(e,t){const r=b(e);if(!(0,l.Wi)(r))return p(r),(0,a.IH)(r,"abort",(()=>t(h())))}function _(e,t){const r=b(t);return(0,l.Wi)(r)?e:new Promise(((r,n)=>{let o=w(t,(()=>n(h())));const s=()=>o=(0,l.hw)(o);e.then(s,s),e.then(r,n)}))}function O(e){return e&&"AbortError"===e.name}async function k(e){try{return await e}catch(e){if(!O(e))throw e}}function P(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}async function S(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await S(r),o={};return t.map(((e,t)=>o[e]=n[t])),o}const t=e;return d((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}async function C(e){return(await S(e)).filter((e=>!!e.value)).map((e=>e.value))}function E(e){return(0,s.XV)(u,"reject()",{moduleName:"promiseUtils",replacement:"Promise.reject()",version:"4.19"}),Promise.reject(e)}function j(e){return(0,s.XV)(u,"resolve()",{moduleName:"promiseUtils",replacement:"Promise.resolve()",version:"4.19"}),Promise.resolve(e)}function A(e,t,r){const n=new AbortController;return w(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);w(n,(()=>{s&&(clearTimeout(s),o(h()))}))}))}function x(e){return e&&"function"==typeof e.then}function T(e){return x(e)?e:Promise.resolve(e)}function M(e,t=-1){let r,n,o,s,i=null;const a=(...c)=>{if(r){n=c,s&&s.reject(h()),s=P();const e=(0,l.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||P(),s=null,t>0){const n=new AbortController;r=T(e(...c,n.signal));const o=r;A(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=T(e(...c));const u=()=>{const e=n;n=o=r=i=null,null!=e&&a(...e)},f=r,d=o;return f.then(u,u),f.then(d.resolve,d.reject),(0,l.j0)(d.promise)};return a}function $(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}function N(e,t){let r,n=new AbortController;const o=e(n.signal);let s={promise:o,finished:!1,abort:()=>{n&&(n.abort(),n=null)}};const i=()=>{s&&(s.finished=!0,s=null),(0,l.pC)(r)&&(r.remove(),r=null),n=null};return o.then(i,i),r=w(t,(()=>{(0,l.pC)(s)&&s.abort()})),s}async function I(e){await Promise.resolve(),p(e)}},19153:(e,t,r)=>{"use strict";r.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return null==e?"":e}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&t.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,Hx:()=>f,KZ:()=>c,Uc:()=>u,W0:()=>i,ZY:()=>d,eP:()=>s,fS:()=>p,lq:()=>a,tP:()=>o,xZ:()=>h,z3:()=>l})},17452:(e,t,r)=>{"use strict";r.d(t,{$U:()=>ne,AH:()=>V,B7:()=>E,D6:()=>U,Fv:()=>Z,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>D,PF:()=>F,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>j,ed:()=>N,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>L,mN:()=>P,oC:()=>te,oh:()=>W,qg:()=>A,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>S,v_:()=>B,vt:()=>ce});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const w={};let v=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function P(e){const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=S(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function S(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function E(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function j(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=N(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),P(r)}function A(e){const t=N(e);let r,n;if(t){const e=T(t.proxyUrl);r=e.path,n=e.query?S(e.query):null}if(r){const t=P(e);e=r+"?"+t.path;const o=E({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function T(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=T(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function N(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function U(e,t,r=!1){const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function L(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(U(e,v))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(U(e,n[t]))return!0}return!1}function J(e){return w[e]||(re(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===D(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(B("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function F(e,t=_,r){if(!H(e))return e;const n=Z(e),o=n.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=r?Z(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function Z(e){return function(e){const t=c.httpsDomains;if(!function(e){return f.test(e)||"http"===v.scheme&&te(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&n===v.authority&&!b.test(e)||(se()&&n===v.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=T(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function B(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function D(e,t=!1){if(z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return"data:"===e.slice(0,5)}function V(e){const t=Y(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&void 0!==e&&"/"===e[0]&&"/"===e[1]}function re(e){return u.test(e)}function ne(e){return d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=P(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(!t?.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const r=P(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function he(e,t,r){const n=P(e),o=n.query||{};return o[t]=String(r),`${n.path}?${E(o)}`}function pe(e,t){const r=P(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=E(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(ge);return t?t[1]:null}const ge=/.*?\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5406),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(4478)]).then(r.bind(r,14478)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(8936),r.e(6529)]).then(r.bind(r,18936)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(6481),r.e(6459),r.e(3356)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(9662),r.e(6208)]).then(r.bind(r,2255)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5886),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(9662),r.e(4325),r.e(1684)]).then(r.bind(r,70299)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(2736)]).then(r.bind(r,16583)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(176),r.e(2398),r.e(3716)]).then(r.bind(r,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(6481),r.e(2631),r.e(8936),r.e(7799)]).then(r.bind(r,28615)),SceneLayerWorker:()=>Promise.all([r.e(3739),r.e(1412)]).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6810),r.e(3388)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t,r){this._port=e,this._getNextJob=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r},(()=>null));return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const l=(0,c.jt)();return new Promise(((r,o)=>{if((0,a.Hc)(n))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(n,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._getNextJob();if(!e)return;const{methodName:t,data:r,invokeOptions:n,deferred:o}=e;this.invoke(t,r,n).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=null),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e).type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);this._processWork(),s.delete(t),(0,i.hw)(a.abortHandle),r?a.reject(o.Z.fromJSON(JSON.parse(r))):a.resolve(n)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{AB:()=>c,Cs:()=>n,QM:()=>u,jt:()=>a,oi:()=>l});var n,o,s=r(80442);(o=n||(n={}))[o.HANDSHAKE=0]="HANDSHAKE",o[o.OPEN=1]="OPEN",o[o.OPENED=2]="OPENED",o[o.RESPONSE=3]="RESPONSE",o[o.INVOKE=4]="INVOKE",o[o.ABORT=5]="ABORT",o[o.CLOSE=6]="CLOSE",o[o.OPEN_PORT=7]="OPEN_PORT",o[o.ON=8]="ON";let i=0;function a(){return i++}function c(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function l(e,t,r,o){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(s=f(o),t.data=r):(s=f(r.transferList),t.data=r.result),s?e.postMessage(t,s):e.postMessage(t)}function u(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function f(e){if(!e||!e.length)return null;if((0,s.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var n=r(80442),o=r(17452);const s="4.24",i={async request(e,t){const{default:n}=await r.e(3172).then(r.bind(r,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await n(e.url,s),c={data:a.data,ssl:a.ssl};switch(a.requestOptions.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")||((0,n.Z)("edge")||(0,n.Z)("trident"))&&console.warn("Deprecated browser - see http://esriurl.com/oldbrowser")},17202:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,r:()=>n});const n="20220504",o="2559b3a236348f57db7adaddd8bf9e9b8442a715"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{24:"048645611caa28dca7cd",176:"7dfd70f4fa1096e56641",247:"b24a76738482ebfc626f",280:"31df729c17470245288c",461:"505b0aa5ee3e5a26c351",510:"500c988ba52176159b5c",565:"0018053ac16a09feba70",576:"812a5abfadd747a09b6f",635:"36272141b3c33cb19026",639:"afddfe620e6539991e6b",739:"c6929ab080e934047a21",819:"5d3e774ce7b006c8cba8",1197:"06c1bae22fa9698e9427",1400:"9d738aab0d907cd09a9d",1408:"4f5272bc52f8ee81dba0",1412:"1db8bfb1731be3ae320c",1421:"770cf0a66102100abe74",1423:"54d67e450da6ce2641b4",1433:"dfdd853dd6c023089963",1534:"2133499e642193f6738f",1562:"7c290763920f52a1f504",1684:"8ccbde593c86c872e525",1773:"2aede0d1dcac8592436b",1785:"adae54f116f311d72d97",1825:"a8ed1a938dc164b401d9",1916:"e6f76f62cf58fb1e67c6",1938:"b5ede4df4620097c6528",2133:"04f7a5fceba712596683",2134:"076d1b1101b59af0d389",2173:"5405f478af3563580926",2304:"66cd99e91dad60c5274c",2398:"5baa162351551817838b",2399:"1d91aa745b49b2ab36cf",2485:"11ba5144ebd70d027c9f",2548:"a9a73bc4875a5aeaf1b9",2631:"fc9b5f40c5179a8c90de",2664:"69a20e4d9e28c3e599fc",2723:"49d75dc1c42dfdc3c3d3",2736:"a056a79f31cddb066f15",2855:"eefd45906011cadab1d3",3027:"4cdd29e1f3a1c7a39af7",3121:"9c4b53c6ea9443174e3e",3127:"586ede983ab00d69fd1f",3128:"958a7ef2cbf048819988",3172:"0b72d123386dc4ec7538",3230:"dafe120243db6648a4ab",3301:"dfb6a28039e5d5ce6fd4",3356:"3fd52a03b3126556aee6",3388:"36c8e8de9c3f67d32572",3471:"b50ae3dc7e43ff452568",3529:"98607a0da63626cc4614",3668:"5cf2064bfd9d0847d9ec",3716:"ac0df52b2f2a4874e4ea",3723:"99badac039fb3ef82937",3739:"ed4519ac9533a4d340f1",3750:"f2cfad73498829c140db",3852:"f60bbd47e9376e8b10f6",3879:"40b11eea270f6688ff9c",3974:"761779217e808d63fa24",4133:"8793070d288878d6f49b",4166:"a57cace73522b95fffd8",4325:"cfbb332d144e65a4a55d",4358:"5c334b4a40c2c5f7e5ad",4475:"8c50af01668496e1fec2",4477:"f0e462f5a16852f33225",4478:"f55cbaf5a1d6ee6ac171",4499:"ea73a1d9cad5e1a5d861",4547:"aeeb364b7c1876f6e7db",4695:"f356e505c36397fda3cf",4720:"4281b4b27f4767cdd3ae",4756:"1a6784ed96103426638c",4889:"17be5bd0d1c233d73d7a",4910:"24217129d492e170f0f0",5001:"adcc5bce6c0971c1b592",5235:"12feeace7215248be23f",5329:"c8a3a28809542396c6fd",5406:"967af0aa4dc4da032fdc",5410:"b08eb084cdf5f87e9500",5787:"263a99045803b278f56d",5837:"49baead4baf2766a2ae7",5853:"33abc6d8da34bafef6e8",5886:"814234844a056d9f1ddc",5906:"3bbb2f08a6c6261dc405",6130:"8865c5cc28df60364e60",6135:"2ab3ae26c9d26509affc",6199:"2798a7dc75a236c1c962",6208:"4f378ad6f4299183df85",6233:"9c4c721d890b49697132",6237:"c544df83e86a9d36b68c",6459:"8cc85d1d46dda16ad041",6481:"8b1c1e9a1d57d0610040",6529:"5fd787f63362defc984f",6550:"042938ca73f0b9e5a7e2",6690:"37c428489c59df4b597b",6710:"b577ec80647cf2ece397",6748:"6c5441da675a8af35be2",6774:"af3766a2d27419c7766c",6810:"5f47e9fc1e50b0d61248",6841:"b426f7b4c3dc60a366f6",6920:"9e6df034d7949880471f",6968:"2290bd6dc2e6bb136e14",7202:"241481d3d9a2b7f10181",7277:"125b14c2ccd96d7c20c2",7340:"f1599bd46635ae342328",7374:"1d253bf2561842e990aa",7572:"8417b3d5821b306a0fc4",7799:"b97a34d2e7cceef1ac41",7832:"b7d7ad127f8939cbdec2",7845:"b4c23630d6c85f7b59c0",7873:"93eb468381bfcf0e47d7",8008:"c180c40838246985479d",8062:"493169fd978fd543ef3b",8096:"acfa8eb19225f7862b1d",8157:"8726bc3f38928c0e6221",8163:"620dc3c13c345d5aa9f6",8227:"76b424b6d2c1ef089324",8297:"fdafc815fbd51ee17f13",8326:"99d2911ca31de4040d43",8422:"c0e6dbecdbd30066a82c",8636:"2f4a8eff11d263fa798a",8758:"88193e61072d7bf957f5",8828:"13b04d5bf348ab5054c2",8875:"54577c2522ca3ff08f7e",8899:"8033531b0cc706b40d86",8936:"fdf80a371b7b2a45f1ff",9070:"c2a36243eb105d570bff",9153:"9c6be39f1f21ab8b1c2d",9169:"cda2b237cbef22f688fa",9291:"2dfd3def105005fc72c7",9296:"23da29c22825c242c5af",9348:"40d5ee3105c5468c307b",9454:"b85218d44c6094b7e5e6",9490:"a73795cce722ba15b3da",9662:"5b4efe0014162f777534",9884:"356db8b8297282c77291",9932:"5edb60bed8f151431d3e"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
1
+ var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s}),r(80442);var n=r(78286),o=r(17202);const s={apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.24.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(s,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),s.request.corsEnabledServers=[],s.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof i))return new i(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=void 0,this instanceof o&&(this.message=t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,r)=>{if(""===r)return"$";const o=(0,n.hS)(r,t),s=null==o?"":o;if(void 0===s)throw new Error(`could not find key "${r}" in template`);return s.toString()}))}(t,r)||"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=null==e?Math.random()*n._m:e}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{"use strict";r.d(t,{FY:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function i(e,t){let r=e.length!==t.length;e.length=t.length;for(let n=0;n<t.length;++n)e[n]!==t[n]&&(e[n]=t[n],r=!0);return r}function a(e,t,r){let n,o;return r?(n=t.filter((t=>!e.some((e=>r(e,t))))),o=e.filter((e=>!t.some((t=>r(t,e)))))):(n=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:n,removed:o}}function c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function f(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class d{constructor(){this.last=0}}const h=new d;function p(e,t,r,n){n=n||h;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function b(e,t,r,n){const o=null==r?e.length:r,s=p(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const g=new Set;function m(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;g.clear();for(let e=0;e<n;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;return g.clear(),r}function y(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},60235:(e,t,r)=>{"use strict";r.d(t,{XV:()=>i,x9:()=>a});var n=r(80442);const o=new Set;function s(e,t,r=!1){r&&o.has(t)||(r&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{moduleName:n}=r;a(e,"Function: "+(n?n+"::":"")+t+"()",r)}}function a(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{replacement:n,version:o,see:i,warnOnce:a}=r;let c=t;n&&(c+=`\n\t🛠️ Replacement: ${n}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{IH:()=>s,on:()=>o,vT:()=>n})},80442:(e,t,r)=>{"use strict";let n;function o(e){return"function"==typeof n[e]?n[e]=n[e](globalThis):n[e]}r.d(t,{Z:()=>o}),n=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,r,s)=>((s||void 0===n[e])&&(n[e]=t),r&&o(e)),o.cache=n,o.add("esri-deprecation-warnings",!0),(()=>{o.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",r.includes("Konqueror")?n:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!r.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(r.split("Version/")[1])),o.add("mac",r.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));o.add(e,n),o.add("ios",n)}o.add("trident",parseFloat(r.split("Trident/")[1])||void 0),o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("trident")||o("edge")||o.add("mozilla",n),o("mozilla")&&o.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&o.add("esri-mobile",t),r&&o.add("esri-iPhone",r),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-canvas-svg-support",!o("trident")),o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.add("wasm-simd",(()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-enabled",!1),o.add("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),o.add("heatmap-force-raster",!1),o.add("heatmap-kernel-density",!1),o.add("heatmap-kernel-density-disable-conversion",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{Vo:()=>a,d9:()=>i,fS:()=>d,yd:()=>s}),r(67676),r(80442);var n=r(70586),o=r(1533);function s(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&s(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function i(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(c(e))return e.clone();if(l(e))return e.map(i);if(u(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=i(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(l(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(c(e))return e.clone();if(!u(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function f(e){if((0,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(e))return(0,o.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,i(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(i(e))})),t}return null}function d(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e){return void 0===e}function i(e,t){return n(e)?t(e):null}function a(e){return e}function c(e,t){if(o(e))throw new Error(t);return e}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e,t){return n(e)?e:t}function f(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function h(e){return n(e)&&e.remove(),null}function p(e){return n(e)&&e.release(),null}function b(e){return null}function g(e,t){const r=new Array;for(const n of e)r.push(y(n,null,t));return r}function m(e,t){for(const r of e)i(r,t)}function y(e,t,r){return n(e)?r(e):t}function w(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function v(e){return e}r.d(t,{Bd:()=>b,Fd:()=>g,JR:()=>m,O3:()=>d,Pt:()=>l,R2:()=>y,RY:()=>p,SC:()=>f,U2:()=>w,Wg:()=>a,Wi:()=>o,hw:()=>h,j0:()=>v,o8:()=>s,pC:()=>n,s3:()=>c,yl:()=>u,yw:()=>i})},78286:(e,t,r)=>{"use strict";r.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>j,$6:()=>f,Ue:()=>d,zE:()=>h,dD:()=>P,hh:()=>$,vr:()=>N,Ds:()=>M,as:()=>S,WW:()=>C,R8:()=>k,D_:()=>O,Hc:()=>g,y8:()=>x,fu:()=>w,$F:()=>v,d1:()=>E,DB:()=>A,r9:()=>m,k_:()=>p,H9:()=>y,Yn:()=>I,gx:()=>T,Hl:()=>_});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o,s=r(60235),i=r(20102),a=r(91460),c=r(92604),l=r(70586);const u=c.Z.getLogger("esri.core.promiseUtils");function f(e){return(0,s.XV)(u,"all()",{moduleName:"promiseUtils",replacement:"Promise.all()",version:"4.19"}),Promise.all(e)}function d(e){return new Promise(((t,r)=>{try{e(t,r)}catch(e){Promise.resolve().then((()=>r(e)))}}))}function h(e="Aborted"){return new i.Z("AbortError",e)}function p(e,t="Aborted"){if(g(e))throw h(t)}function b(e){return(0,l.pC)(e)?"aborted"in e?e:e.signal:e}function g(e){const t=b(e);return(0,l.pC)(t)&&t.aborted}function m(e){if(O(e))throw e}function y(e){if(!O(e))throw e}function w(e,t){const r=b(e);if(!(0,l.Wi)(r)){if(!r.aborted)return(0,a.IH)(r,"abort",(()=>t()));t()}}function v(e,t){const r=b(e);if(!(0,l.Wi)(r))return p(r),(0,a.IH)(r,"abort",(()=>t(h())))}function _(e,t){const r=b(t);return(0,l.Wi)(r)?e:new Promise(((r,n)=>{let o=w(t,(()=>n(h())));const s=()=>o=(0,l.hw)(o);e.then(s,s),e.then(r,n)}))}function O(e){return e&&"AbortError"===e.name}async function k(e){try{return await e}catch(e){if(!O(e))throw e}}function P(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}async function S(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await S(r),o={};return t.map(((e,t)=>o[e]=n[t])),o}const t=e;return d((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}async function C(e){return(await S(e)).filter((e=>!!e.value)).map((e=>e.value))}function E(e){return(0,s.XV)(u,"reject()",{moduleName:"promiseUtils",replacement:"Promise.reject()",version:"4.19"}),Promise.reject(e)}function A(e){return(0,s.XV)(u,"resolve()",{moduleName:"promiseUtils",replacement:"Promise.resolve()",version:"4.19"}),Promise.resolve(e)}function j(e,t,r){const n=new AbortController;return w(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);w(n,(()=>{s&&(clearTimeout(s),o(h()))}))}))}function x(e){return e&&"function"==typeof e.then}function T(e){return x(e)?e:Promise.resolve(e)}function M(e,t=-1){let r,n,o,s,i=null;const a=(...c)=>{if(r){n=c,s&&s.reject(h()),s=P();const e=(0,l.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||P(),s=null,t>0){const n=new AbortController;r=T(e(...c,n.signal));const o=r;j(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=T(e(...c));const u=()=>{const e=n;n=o=r=i=null,null!=e&&a(...e)},f=r,d=o;return f.then(u,u),f.then(d.resolve,d.reject),(0,l.j0)(d.promise)};return a}function $(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}function N(e,t){let r,n=new AbortController;const o=e(n.signal);let s={promise:o,finished:!1,abort:()=>{n&&(n.abort(),n=null)}};const i=()=>{s&&(s.finished=!0,s=null),(0,l.pC)(r)&&(r.remove(),r=null),n=null};return o.then(i,i),r=w(t,(()=>{(0,l.pC)(s)&&s.abort()})),s}async function I(e){await Promise.resolve(),p(e)}},19153:(e,t,r)=>{"use strict";r.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return null==e?"":e}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&t.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,Hx:()=>f,KZ:()=>c,Uc:()=>u,W0:()=>i,ZY:()=>d,eP:()=>s,fS:()=>p,lq:()=>a,tP:()=>o,xZ:()=>h,z3:()=>l})},17452:(e,t,r)=>{"use strict";r.d(t,{$U:()=>ne,AH:()=>V,B7:()=>E,D6:()=>U,Fv:()=>Z,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>D,PF:()=>F,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>A,ed:()=>N,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>L,mN:()=>P,oC:()=>te,oh:()=>W,qg:()=>j,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>S,v_:()=>B,vt:()=>ce});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const w={};let v=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function P(e){const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=S(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function S(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function E(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function A(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=N(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),P(r)}function j(e){const t=N(e);let r,n;if(t){const e=T(t.proxyUrl);r=e.path,n=e.query?S(e.query):null}if(r){const t=P(e);e=r+"?"+t.path;const o=E({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function T(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=T(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function N(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function U(e,t,r=!1){const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function L(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(U(e,v))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(U(e,n[t]))return!0}return!1}function J(e){return w[e]||(re(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===D(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(B("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function F(e,t=_,r){if(!H(e))return e;const n=Z(e),o=n.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=r?Z(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function Z(e){return function(e){const t=c.httpsDomains;if(!function(e){return f.test(e)||"http"===v.scheme&&te(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&n===v.authority&&!b.test(e)||(se()&&n===v.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=T(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function B(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function D(e,t=!1){if(z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return"data:"===e.slice(0,5)}function V(e){const t=Y(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&void 0!==e&&"/"===e[0]&&"/"===e[1]}function re(e){return u.test(e)}function ne(e){return d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=P(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(!t?.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const r=P(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function he(e,t,r){const n=P(e),o=n.query||{};return o[t]=String(r),`${n.path}?${E(o)}`}function pe(e,t){const r=P(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=E(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(ge);return t?t[1]:null}const ge=/.*?\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5406),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(4478)]).then(r.bind(r,14478)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(8936),r.e(6529)]).then(r.bind(r,18936)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(6481),r.e(6459),r.e(3356)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(9662),r.e(6208)]).then(r.bind(r,2255)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5886),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(9662),r.e(4325),r.e(1684)]).then(r.bind(r,70299)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(2736)]).then(r.bind(r,16583)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(176),r.e(2398),r.e(3716)]).then(r.bind(r,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(6481),r.e(2631),r.e(8936),r.e(7799)]).then(r.bind(r,28615)),SceneLayerWorker:()=>Promise.all([r.e(3739),r.e(1412)]).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(5406),r.e(2548),r.e(1825),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6810),r.e(3388)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t,r){this._port=e,this._getNextJob=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r},(()=>null));return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const l=(0,c.jt)();return new Promise(((r,o)=>{if((0,a.Hc)(n))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(n,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._getNextJob();if(!e)return;const{methodName:t,data:r,invokeOptions:n,deferred:o}=e;this.invoke(t,r,n).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=null),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e).type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);this._processWork(),s.delete(t),(0,i.hw)(a.abortHandle),r?a.reject(o.Z.fromJSON(JSON.parse(r))):a.resolve(n)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{AB:()=>c,Cs:()=>n,QM:()=>u,jt:()=>a,oi:()=>l});var n,o,s=r(80442);(o=n||(n={}))[o.HANDSHAKE=0]="HANDSHAKE",o[o.OPEN=1]="OPEN",o[o.OPENED=2]="OPENED",o[o.RESPONSE=3]="RESPONSE",o[o.INVOKE=4]="INVOKE",o[o.ABORT=5]="ABORT",o[o.CLOSE=6]="CLOSE",o[o.OPEN_PORT=7]="OPEN_PORT",o[o.ON=8]="ON";let i=0;function a(){return i++}function c(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function l(e,t,r,o){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(s=f(o),t.data=r):(s=f(r.transferList),t.data=r.result),s?e.postMessage(t,s):e.postMessage(t)}function u(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function f(e){if(!e||!e.length)return null;if((0,s.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var n=r(80442),o=r(17452);const s="4.24",i={async request(e,t){const{default:n}=await r.e(3172).then(r.bind(r,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await n(e.url,s),c={data:a.data,ssl:a.ssl};switch(a.requestOptions.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")||((0,n.Z)("edge")||(0,n.Z)("trident"))&&console.warn("Deprecated browser - see http://esriurl.com/oldbrowser")},17202:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,r:()=>n});const n="20220505",o="b14002bcc703e74515244fe1c3617cc7ad26298f"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{24:"048645611caa28dca7cd",176:"7dfd70f4fa1096e56641",247:"b24a76738482ebfc626f",280:"31df729c17470245288c",461:"505b0aa5ee3e5a26c351",510:"b5b7bcbc19b3430903ee",565:"0018053ac16a09feba70",576:"812a5abfadd747a09b6f",635:"36272141b3c33cb19026",639:"afddfe620e6539991e6b",739:"c6929ab080e934047a21",819:"5d3e774ce7b006c8cba8",1197:"06c1bae22fa9698e9427",1400:"9d738aab0d907cd09a9d",1408:"4f5272bc52f8ee81dba0",1412:"1db8bfb1731be3ae320c",1421:"770cf0a66102100abe74",1423:"54d67e450da6ce2641b4",1433:"dfdd853dd6c023089963",1534:"d85b5b73a151c6fbb658",1562:"7c290763920f52a1f504",1684:"8ccbde593c86c872e525",1773:"2aede0d1dcac8592436b",1785:"adae54f116f311d72d97",1825:"a8ed1a938dc164b401d9",1916:"e6f76f62cf58fb1e67c6",1938:"d4ed4d2f5129ee750276",2133:"04f7a5fceba712596683",2134:"076d1b1101b59af0d389",2173:"5405f478af3563580926",2304:"66cd99e91dad60c5274c",2398:"5baa162351551817838b",2399:"1d91aa745b49b2ab36cf",2485:"11ba5144ebd70d027c9f",2548:"a9a73bc4875a5aeaf1b9",2631:"fc9b5f40c5179a8c90de",2664:"69a20e4d9e28c3e599fc",2723:"49d75dc1c42dfdc3c3d3",2736:"5637a192b47ed9cfd5d6",2855:"eefd45906011cadab1d3",3027:"4cdd29e1f3a1c7a39af7",3121:"9c4b53c6ea9443174e3e",3127:"586ede983ab00d69fd1f",3128:"7820409909105f2f014c",3172:"0b72d123386dc4ec7538",3230:"dafe120243db6648a4ab",3301:"dfb6a28039e5d5ce6fd4",3356:"cc372e1bc7ce932c4b76",3388:"36c8e8de9c3f67d32572",3471:"b50ae3dc7e43ff452568",3529:"98607a0da63626cc4614",3668:"5cf2064bfd9d0847d9ec",3716:"9964386c07e73404cff9",3723:"99badac039fb3ef82937",3739:"ed4519ac9533a4d340f1",3750:"f2cfad73498829c140db",3852:"f60bbd47e9376e8b10f6",3879:"40b11eea270f6688ff9c",3974:"761779217e808d63fa24",4133:"8793070d288878d6f49b",4166:"a57cace73522b95fffd8",4325:"cfbb332d144e65a4a55d",4358:"5c334b4a40c2c5f7e5ad",4475:"8c50af01668496e1fec2",4477:"f0e462f5a16852f33225",4478:"f55cbaf5a1d6ee6ac171",4499:"ea73a1d9cad5e1a5d861",4547:"aeeb364b7c1876f6e7db",4695:"f356e505c36397fda3cf",4720:"4281b4b27f4767cdd3ae",4756:"1a6784ed96103426638c",4889:"17be5bd0d1c233d73d7a",4910:"24217129d492e170f0f0",5001:"adcc5bce6c0971c1b592",5235:"12feeace7215248be23f",5329:"c8a3a28809542396c6fd",5406:"967af0aa4dc4da032fdc",5410:"f206300eef4560611728",5787:"263a99045803b278f56d",5837:"49baead4baf2766a2ae7",5853:"3c8c020d9e723888352b",5886:"caed2365bd296fcc8a75",5906:"48810a9391b787f195ed",6130:"8865c5cc28df60364e60",6135:"2ab3ae26c9d26509affc",6199:"2798a7dc75a236c1c962",6208:"4f378ad6f4299183df85",6233:"9c4c721d890b49697132",6237:"c544df83e86a9d36b68c",6459:"c535c18c00e823665603",6481:"8b1c1e9a1d57d0610040",6529:"5fd787f63362defc984f",6550:"042938ca73f0b9e5a7e2",6690:"37c428489c59df4b597b",6710:"b577ec80647cf2ece397",6748:"6c5441da675a8af35be2",6774:"af3766a2d27419c7766c",6810:"5f47e9fc1e50b0d61248",6841:"b426f7b4c3dc60a366f6",6920:"ec6d138e8183e193f977",6968:"2290bd6dc2e6bb136e14",7202:"241481d3d9a2b7f10181",7277:"125b14c2ccd96d7c20c2",7340:"f1599bd46635ae342328",7374:"1d253bf2561842e990aa",7572:"8417b3d5821b306a0fc4",7799:"b97a34d2e7cceef1ac41",7832:"b7d7ad127f8939cbdec2",7845:"b4c23630d6c85f7b59c0",7873:"93eb468381bfcf0e47d7",8008:"c180c40838246985479d",8062:"493169fd978fd543ef3b",8096:"acfa8eb19225f7862b1d",8157:"8726bc3f38928c0e6221",8163:"620dc3c13c345d5aa9f6",8227:"76b424b6d2c1ef089324",8297:"fdafc815fbd51ee17f13",8326:"99d2911ca31de4040d43",8422:"c0e6dbecdbd30066a82c",8636:"2f4a8eff11d263fa798a",8758:"88193e61072d7bf957f5",8828:"13b04d5bf348ab5054c2",8875:"b340c9bdabdb37995c8f",8899:"8033531b0cc706b40d86",8936:"fdf80a371b7b2a45f1ff",9070:"c2a36243eb105d570bff",9153:"9c6be39f1f21ab8b1c2d",9169:"cda2b237cbef22f688fa",9291:"2dfd3def105005fc72c7",9296:"23da29c22825c242c5af",9348:"40d5ee3105c5468c307b",9454:"b85218d44c6094b7e5e6",9490:"a73795cce722ba15b3da",9662:"5b4efe0014162f777534",9884:"356db8b8297282c77291",9932:"5edb60bed8f151431d3e"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5853],{55853:(e,t,r)=>{r.r(t),r.d(t,{default:()=>me});var i=r(43697),s=r(3172),l=r(80539),a=r(20102),o=r(61247),n=r(22974),u=r(16453),c=r(78286),p=r(95330),d=r(17445),h=r(17452),m=r(5600),y=(r(75215),r(71715)),f=r(52011),g=r(30556),w=r(6570),x=r(87085),v=r(16199),S=r(71612),b=r(38009),M=r(16859),C=r(34760),I=r(72965),_=r(11145);class L{constructor(e,t=0,r=e.lods.length-1){this.tileInfo=e,this.minLOD=t,this.maxLOD=r}getAvailability(e,t,r){const i=this.tileInfo.lodAt(e);return!i||e<this.minLOD||e>this.maxLOD?"unavailable":i.cols&&i.rows?r>=i.cols[0]&&r<=i.cols[1]&&t>=i.rows[0]&&t<=i.rows[1]?"available":"unavailable":"available"}async fetchAvailability(e,t,r,i){return await(0,p.Yn)(i),this.getAvailability(e,t,r)}async fetchAvailabilityUpsample(e,t,r,i,s){await(0,p.Yn)(s),i.level=e,i.row=t,i.col=r;const l=this.tileInfo;for(l.updateTileInfo(i);;){const e=this.getAvailability(i.level,i.row,i.col);if("unavailable"!==e)return e;if(!l.upsampleTile(i))return"unavailable"}}}var T,E=r(5833),P=r(96674);r(67676),r(80442);let O=T=class extends P.wq{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new T;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo&&this.tileInfo.clone()),e}};(0,i._)([(0,m.Cb)({type:w.Z,json:{read:{source:"fullExtent"}}})],O.prototype,"fullExtent",void 0),(0,i._)([(0,m.Cb)({type:String,json:{read:{source:"id"}}})],O.prototype,"id",void 0),(0,i._)([(0,m.Cb)({type:_.Z,json:{read:{source:"tileInfo"}}})],O.prototype,"tileInfo",void 0),O=T=(0,i._)([(0,f.j)("esri.layer.support.TileMatrixSet")],O);const R=O;var F;let A=F=class extends P.wq{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new F;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,i._)([(0,m.Cb)({json:{read:{source:"id"}}})],A.prototype,"id",void 0),(0,i._)([(0,m.Cb)({json:{read:{source:"title"}}})],A.prototype,"title",void 0),(0,i._)([(0,m.Cb)({json:{read:{source:"abstract"}}})],A.prototype,"description",void 0),(0,i._)([(0,m.Cb)({json:{read:{source:"legendUrl"}}})],A.prototype,"legendUrl",void 0),(0,i._)([(0,m.Cb)({json:{read:{source:"isDefault"}}})],A.prototype,"isDefault",void 0),(0,i._)([(0,m.Cb)({json:{read:{source:"keywords"}}})],A.prototype,"keywords",void 0),A=F=(0,i._)([(0,f.j)("esri.layer.support.WMTSStyle")],A);const V=A;var j;let U=j=class extends P.wq{constructor(e){super(e),this.fullExtent=null,this.fullExtents=null,this.imageFormats=null,this.id=null,this.layer=null,this.styles=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}get description(){return this._get("description")}set description(e){this._set("description",e)}readFullExtent(e,t){return(e=t.fullExtent)?w.Z.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map((e=>w.Z.fromJSON(e))):t.tileMatrixSets.map((e=>w.Z.fromJSON(e.fullExtent))).filter((e=>e))}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){let e=this._get("styleId");return e||(e=this.styles&&this.styles.length?this.styles.getItemAt(0).id:""),e}set styleId(e){this._set("styleId",e)}get title(){return this._get("title")}set title(e){this._set("title",e)}get tileMatrixSet(){return this.tileMatrixSets?this.tileMatrixSets.find((e=>e.id===this.tileMatrixSetId)):null}clone(){const e=new j;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats&&this.imageFormats.slice()),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles&&this.styles.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,i._)([(0,m.Cb)()],U.prototype,"description",null),(0,i._)([(0,m.Cb)()],U.prototype,"fullExtent",void 0),(0,i._)([(0,y.r)("fullExtent",["fullExtent"])],U.prototype,"readFullExtent",null),(0,i._)([(0,m.Cb)({readOnly:!0})],U.prototype,"fullExtents",void 0),(0,i._)([(0,y.r)("fullExtents",["fullExtents","tileMatrixSets"])],U.prototype,"readFullExtents",null),(0,i._)([(0,m.Cb)()],U.prototype,"imageFormat",null),(0,i._)([(0,m.Cb)({json:{read:{source:"formats"}}})],U.prototype,"imageFormats",void 0),(0,i._)([(0,m.Cb)()],U.prototype,"id",void 0),(0,i._)([(0,m.Cb)()],U.prototype,"layer",void 0),(0,i._)([(0,m.Cb)()],U.prototype,"styleId",null),(0,i._)([(0,m.Cb)({type:l.Z.ofType(V),json:{read:{source:"styles"}}})],U.prototype,"styles",void 0),(0,i._)([(0,m.Cb)({value:null,json:{write:{ignoreOrigin:!0}}})],U.prototype,"title",null),(0,i._)([(0,m.Cb)()],U.prototype,"tileMatrixSetId",void 0),(0,i._)([(0,m.Cb)({readOnly:!0})],U.prototype,"tileMatrixSet",null),(0,i._)([(0,m.Cb)({type:l.Z.ofType(R),json:{read:{source:"tileMatrixSets"}}})],U.prototype,"tileMatrixSets",void 0),U=j=(0,i._)([(0,f.j)("esri.layers.support.WMTSSublayer")],U);const N=U;var Z=r(70586),k=r(13473),D=r(24678),W=r(58116),B=r(52162),K=r(88724);const $=90.71428571428571;function H(e){const t=e.replace(/ows:/gi,"");if(!J("Contents",(new DOMParser).parseFromString(t,"text/xml").documentElement))throw new a.Z("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function q(e){return e.nodeType===Node.ELEMENT_NODE}function J(e,t){for(let r=0;r<t.childNodes.length;r++){const i=t.childNodes[r];if(q(i)&&i.nodeName===e)return i}return null}function Y(e,t){const r=[];for(let i=0;i<t.childNodes.length;i++){const s=t.childNodes[i];q(s)&&s.nodeName===e&&r.push(s)}return r}function G(e,t){const r=[];for(let i=0;i<t.childNodes.length;i++){const s=t.childNodes[i];q(s)&&s.nodeName===e&&r.push(s)}return r.map((e=>e.textContent))}function z(e,t){return e.split(">").forEach((e=>{t&&(t=J(e,t))})),t&&t.textContent}function Q(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some((i=>{if(i.nodeName.includes(e)){const e=J(t,i),l=e&&e.textContent;if(l===r||r.split(":")&&r.split(":")[1]===l)return s=i,!0}return!1})),s}function X(e,t,r,i,s){const l=z("Abstract",t),a=G("Format",t);return{id:e,fullExtent:te(t),fullExtents:re(t),description:l,formats:a,styles:ie(t,i),title:z("Title",t),tileMatrixSets:se(s,t,r)}}function ee(e,t){const r=[],i=e.layerMap?.get(t);if(!i)return;const s=Y("ResourceURL",i),l=Y("Dimension",i);let a,o,n,u;return l.length&&(a=z("Identifier",l[0]),o=G("Default",l[0])||G("Value",l[0])),l.length>1&&(n=z("Identifier",l[1]),u=G("Default",l[1])||G("Value",l[1])),e.dimensionMap.set(t,{dimensions:o,dimensions2:u}),s.forEach((e=>{let t=e.getAttribute("template");if("tile"===e.getAttribute("resourceType")){if(a&&o.length)if(t.includes("{"+a+"}"))t=t.replace("{"+a+"}","{dimensionValue}");else{const e=t.toLowerCase().indexOf("{"+a.toLowerCase()+"}");e>-1&&(t=t.substring(0,e)+"{dimensionValue}"+t.substring(e+a.length+2))}if(n&&u.length)if(t.includes("{"+n+"}"))t=t.replace("{"+n+"}","{dimensionValue2}");else{const e=t.toLowerCase().indexOf("{"+n.toLowerCase()+"}");e>-1&&(t=t.substring(0,e)+"{dimensionValue2}"+t.substring(e+n.length+2))}r.push({template:t,format:e.getAttribute("format"),resourceType:"tile"})}})),r}function te(e){const t=J("WGS84BoundingBox",e),r=t?z("LowerCorner",t).split(" "):["-180","-90"],i=t?z("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function re(e){const t=[];return(0,K.h)(e,{BoundingBox:e=>{if(!e.getAttribute("crs"))return;const r=e.getAttribute("crs").toLowerCase(),i=le(r),s=r.includes("epsg")&&(0,B.A)(i.wkid);let l,a,o,n;(0,K.h)(e,{LowerCorner:e=>{[l,a]=e.textContent.split(" ").map((e=>Number.parseFloat(e))),s&&([l,a]=[a,l])},UpperCorner:e=>{[o,n]=e.textContent.split(" ").map((e=>Number.parseFloat(e))),s&&([o,n]=[n,o])}}),t.push({xmin:l,ymin:a,xmax:o,ymax:n,spatialReference:i})}}),t}function ie(e,t){return Y("Style",e).map((e=>{const r=J("LegendURL",e),i=J("Keywords",e),s=i&&G("Keyword",i);let l=r&&r.getAttribute("xlink:href");return t&&(l=l&&l.replace(/^http:/i,"https:")),{abstract:z("Abstract",e),id:z("Identifier",e),isDefault:"true"===e.getAttribute("isDefault"),keywords:s,legendUrl:l,title:z("Title",e)}}))}function se(e,t,r){return Y("TileMatrixSetLink",t).map((t=>function(e,t,r){const i=J("TileMatrixSet",t).textContent,s=G("TileMatrix",t),l=r.find((e=>{const t=J("Identifier",e),r=t&&t.textContent;return!!(r===i||i.split(":")&&i.split(":")[1]===r)})),a=J("TileMatrixSetLimits",t),o=a&&Y("TileMatrixLimits",a),n=new Map;if(o?.length)for(const e of o){const t=J("TileMatrix",e).textContent,r=+J("MinTileRow",e).textContent,i=+J("MaxTileRow",e).textContent,s=+J("MinTileCol",e).textContent,l=+J("MaxTileCol",e).textContent;n.set(t,{minCol:s,maxCol:l,minRow:r,maxRow:i})}const u=z("SupportedCRS",l).toLowerCase(),c=function(e,t){return ae(J("TileMatrix",e),t)}(l,u),p=c.spatialReference,d=J("TileMatrix",l),h=[parseInt(z("TileWidth",d),10),parseInt(z("TileHeight",d),10)],m=[];s.length?s.forEach(((e,t)=>{const r=Q("TileMatrix","Identifier",e,l);m.push(ue(r,u,t,i,n))})):Y("TileMatrix",l).forEach(((e,t)=>{m.push(ue(e,u,t,i,n))}));const y=function(e,t,r,i,s){const l=J("BoundingBox",t);let a,o,n,u,c,p;if(l&&(a=z("LowerCorner",l).split(" "),o=z("UpperCorner",l).split(" ")),a&&a.length>1&&o&&o.length>1)n=parseFloat(a[0]),c=parseFloat(a[1]),u=parseFloat(o[0]),p=parseFloat(o[1]);else{const e=J("TileMatrix",t),l=parseInt(z("MatrixWidth",e),10),a=parseInt(z("MatrixHeight",e),10);n=r.x,p=r.y,u=n+l*i[0]*s.resolution,c=p-a*i[1]*s.resolution}return function(e,t){return"1.0.0"===e&&(0,B.A)(t.wkid)}(e,r.spatialReference)?new w.Z(c,n,p,u,r.spatialReference):new w.Z(n,c,u,p,r.spatialReference)}(e,l,c,h,m[0]).toJSON(),f=new _.Z({dpi:96,spatialReference:p,size:h,origin:c,lods:m}).toJSON();return{id:i,fullExtent:y,tileInfo:f}}(e,t,r)))}function le(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);900913!==t&&3857!==t||(t=102100);const r=function(e){return e.includes("crs84")||e.includes("crs:84")?oe.CRS84:e.includes("crs83")||e.includes("crs:83")?oe.CRS83:e.includes("crs27")||e.includes("crs:27")?oe.CRS27:null}(e);return(0,Z.pC)(r)&&(t=r),{wkid:t}}function ae(e,t){const r=le(t),[i,s]=z("TopLeftCorner",e).split(" ").map((e=>parseFloat(e))),l=t.includes("epsg")&&(0,B.A)(r.wkid);return new k.Z(l?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}var oe,ne;function ue(e,t,r,i,s){const l=le(t),a=z("Identifier",e);let o=parseFloat(z("ScaleDenominator",e));const n=ce(l.wkid,o,i);o*=96/$;const u=+z("MatrixWidth",e),c=+z("MatrixHeight",e),{maxCol:p=u-1,maxRow:d=c-1,minCol:h=0,minRow:m=0}=s.get(a)??{},{x:y,y:f}=ae(e,t);return{cols:[h,p],level:r,levelValue:a,origin:[y,f],scale:o,resolution:n,rows:[m,d]}}function ce(e,t,r){let i;return i=W.Z.hasOwnProperty(""+e)?W.Z.values[W.Z[e]]:"default028mm"===r?6370997*Math.PI/180:(0,D.e8)(e).metersPerDegree,7*t/25e3/i}(ne=oe||(oe={}))[ne.CRS84=4326]="CRS84",ne[ne.CRS83=4269]="CRS83",ne[ne.CRS27=4267]="CRS27";const pe={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},de=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let he=class extends((0,S.h)((0,C.Q)((0,I.M)((0,b.q)((0,M.I)((0,u.R)(x.Z))))))){constructor(...e){super(...e),this._sublayersHandles=new o.Z,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.own([(0,d.YP)((()=>this.activeLayer),((e,t)=>{t&&(t.layer=null),e&&(e.layer=this)}),d.Z_),(0,d.YP)((()=>this.sublayers),((e,t)=>{t&&(t.forEach((e=>{e.layer=null})),this._sublayersHandles.removeAll(),this._sublayersHandles=null),e&&(e.forEach((e=>{e.layer=this})),this._sublayersHandles||(this._sublayersHandles=new o.Z),this._sublayersHandles.add([e.on("after-add",(({item:e})=>{e.layer=this})),e.on("after-remove",(({item:e})=>{e.layer=null}))]))}),d.Z_)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){if("KVP"===this.serviceMode||"RESTful"===this.serviceMode)return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(p.r9).then((()=>this._fetchService(e))).catch((e=>{throw(0,p.r9)(e),new a.Z("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:e})}))),Promise.resolve(this);console.error("WMTS mode could only be 'KVP' or 'RESTful'")}get activeLayer(){return this._get("activeLayer")}set activeLayer(e){this._set("activeLayer",e)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new N);let i=t.layers.find((e=>e.id===this.activeLayer.id));return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,l=i?.layerIdentifier;let a=null;const o=i?.tileMatrixSet;o&&(Array.isArray(o)?o.length&&(a=o[0]):a=o);const n=s?.format,u=s?.style;return new N({id:l,imageFormat:n,styleId:u,tileMatrixSetId:a})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const l=(0,c.hS)("tileMatrixSet.tileInfo",s);t.tileInfo=l?l.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return function(e,t){return e.map((e=>{const r=new N;return r.read(e,t),r}))}(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets.map((e=>e.tileInfo.spatialReference)).toArray()}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return new L(e)}get title(){return this.activeLayer?.title??"Layer"}set title(e){e?this._override("title",e):this._clearOverride("title")}get url(){return this._get("url")}set url(e){e&&"/"===e.substr(-1)?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId).tileInfo,i=e.fullExtent,s=new E.B({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(s.customLayerParameters=this.customLayerParameters),this.customParameters&&(s.customParameters=this.customParameters),new v.default({fullExtent:i,urlTemplate:t,tileInfo:r,wmtsInfo:s})}fetchTile(e,t,r){const i=this.getTileUrl(e,t,r);return(0,s.default)(i,{responseType:"image"}).then((e=>e.data))}findSublayerById(e){return this.sublayers.find((t=>t.id===e))}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId).tileInfo.lods[e],s=i?i.levelValue?i.levelValue:`${i.level}`:`${e}`;let l=this.resourceInfo?"":function(e,t,r,i,s,l,a,o){const n=function(e,t,r){const i=ee(e,t),s=i.filter((e=>e.format===r));return s.length?s:i}(e,t,i);if(!(n?.length>0))return"";const{dimensionMap:u}=e,c=u.get(t).dimensions?.[0],p=u.get(t).dimensions2?.[0];return n[a%n.length].template.replace(/\{Style\}/gi,s).replace(/\{TileMatrixSet\}/gi,r).replace(/\{TileMatrix\}/gi,l).replace(/\{TileRow\}/gi,""+a).replace(/\{TileCol\}/gi,""+o).replace(/\{dimensionValue\}/gi,c).replace(/\{dimensionValue2\}/gi,p)}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,s,t,r);return l||(l=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replace(/\{level\}/gi,s).replace(/\{row\}/gi,`${t}`).replace(/\{col\}/gi,`${r}`)),l=this._appendCustomLayerParameters(l),l}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const r=function(e,t,r,i){const{dimensionMap:s}=e,l=ee(e,t);let a="";if(l&&l.length>0){const e=s.get(t).dimensions&&s.get(t).dimensions[0],o=s.get(t).dimensions2&&s.get(t).dimensions2[0];a=l[0].template,a.indexOf(".xxx")===a.length-4&&(a=a.slice(0,a.length-4)),a=a.replace(/\{Style\}/gi,i),a=a.replace(/\{TileMatrixSet\}/gi,r),a=a.replace(/\{TileMatrix\}/gi,"{level}"),a=a.replace(/\{TileRow\}/gi,"{row}"),a=a.replace(/\{TileCol\}/gi,"{col}"),a=a.replace(/\{dimensionValue\}/gi,e),a=a.replace(/\{dimensionValue2\}/gi,o)}return a}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(r)return r}if("KVP"===this.serviceMode)return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if("RESTful"===this.serviceMode){let s="";return pe[r.toLowerCase()]&&(s=pe[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)"KVP"===this.resourceInfo.serviceMode&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),H(t.data)}catch{const r="KVP"===this.serviceMode?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),H(t.data),this.serviceMode=r}catch(e){throw new a.Z("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:e})}}this.resourceInfo?t.data=function(e){return e.layers.forEach((e=>{e.tileMatrixSets.forEach((e=>{const t=e.tileInfo;96!==t.dpi&&(t.lods.forEach((r=>{r.scale=96*r.scale/t.dpi,r.resolution=ce(t.spatialReference.wkid,r.scale*$/96,e.id)})),t.dpi=96)}))})),e}(t.data):t.data=function(e,t){e=e.replace(/ows:/gi,"");const r=(new DOMParser).parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,l=J("Contents",r);if(!l)throw new a.Z("wmtslayer:wmts-capabilities-xml-is-not-valid");const o=J("OperationsMetadata",r)?.querySelector("[name='GetTile']"),n=o?.getElementsByTagName("Get"),u=n&&Array.prototype.slice.call(n),c=t?.url?.indexOf("https")>-1??!1;let p,d,h=t.serviceMode,m=t&&t.url;if(u&&u.length&&u.some((e=>{const t=J("Constraint",e);return!t||Q("AllowedValues","Value",h,t)?(m=e.attributes[0].nodeValue,!0):(!t||Q("AllowedValues","Value","RESTful",t)||Q("AllowedValues","Value","REST",t)?d=e.attributes[0].nodeValue:t&&!Q("AllowedValues","Value","KVP",t)||(p=e.attributes[0].nodeValue),!1)})),!m)if(d)m=d,h="RESTful";else if(p)m=p,h="KVP";else{const e=J("ServiceMetadataURL",r);m=e&&e.getAttribute("xlink:href")}const y=m.indexOf("1.0.0/");-1===y&&"RESTful"===h?m+="/":y>-1&&(m=m.substring(0,y)),"KVP"===h&&(m+=y>-1?"":"?"),c&&(m=m.replace(/^http:/i,"https:"));const f=z("ServiceIdentification>ServiceTypeVersion",r),g=z("ServiceIdentification>AccessConstraints",r),w=/^none$/i.test(g)?null:g,x=Y("Layer",l),v=Y("TileMatrixSet",l),S=x.map((e=>{const t=z("Identifier",e);return i.set(t,e),X(t,e,v,c,f)}));return{copyright:w,dimensionMap:s,layerMap:i,layers:S,serviceMode:h,tileUrl:m}}(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await(0,s.default)(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){return this.findSublayerById(this.activeLayer.id).tileMatrixSets.find((t=>t.id===e))}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...(0,n.d9)(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=(0,h.mN)(e),i={...r.query,...t},s=(0,h.B7)(i);return""===s?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=this.url.split("?")[0];const t="KVP"===e?`${this.url}?request=GetCapabilities&service=WMTS&version=${this.version}`:`${this.url}/${this.version}/WMTSCapabilities.xml`;return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=(0,h.mN)(e).query;if(!t)return null;const r={};return Object.keys(t).forEach((e=>{r[e.toLowerCase()]=t[e]})),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const t=Object.keys(r);t.length&&(e=e?(0,n.d9)(e):{},t.forEach((t=>{e.hasOwnProperty(t)||de.has(t)||(e[t]=r[t])})))}return e}};(0,i._)([(0,m.Cb)()],he.prototype,"dimensionMap",void 0),(0,i._)([(0,m.Cb)()],he.prototype,"layerMap",void 0),(0,i._)([(0,m.Cb)({type:N,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],he.prototype,"activeLayer",null),(0,i._)([(0,y.r)("service","activeLayer",["layers"])],he.prototype,"readActiveLayerFromService",null),(0,i._)([(0,y.r)(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],he.prototype,"readActiveLayerFromItemOrWebDoc",null),(0,i._)([(0,g.c)(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:_.Z},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],he.prototype,"writeActiveLayer",null),(0,i._)([(0,m.Cb)({type:String,value:"",json:{write:!0}})],he.prototype,"copyright",void 0),(0,i._)([(0,m.Cb)({type:["show","hide"]})],he.prototype,"listMode",void 0),(0,i._)([(0,m.Cb)({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],he.prototype,"customParameters",void 0),(0,i._)([(0,y.r)(["portal-item","web-document"],"customParameters")],he.prototype,"readCustomParameters",null),(0,i._)([(0,m.Cb)({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],he.prototype,"customLayerParameters",void 0),(0,i._)([(0,m.Cb)({type:w.Z,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],he.prototype,"fullExtent",void 0),(0,i._)([(0,m.Cb)({readOnly:!0})],he.prototype,"fullExtents",null),(0,i._)([(0,m.Cb)({type:["WebTiledLayer"]})],he.prototype,"operationalLayerType",void 0),(0,i._)([(0,m.Cb)()],he.prototype,"resourceInfo",void 0),(0,i._)([(0,m.Cb)()],he.prototype,"serviceMode",void 0),(0,i._)([(0,y.r)(["portal-item","web-document"],"serviceMode",["templateUrl"])],he.prototype,"readServiceMode",null),(0,i._)([(0,m.Cb)({type:l.Z.ofType(N)})],he.prototype,"sublayers",void 0),(0,i._)([(0,y.r)("service","sublayers",["layers"])],he.prototype,"readSublayersFromService",null),(0,i._)([(0,m.Cb)({readOnly:!0})],he.prototype,"supportedSpatialReferences",null),(0,i._)([(0,m.Cb)({readOnly:!0})],he.prototype,"tilemapCache",null),(0,i._)([(0,m.Cb)({json:{read:{source:"title"}}})],he.prototype,"title",null),(0,i._)([(0,m.Cb)({json:{read:!1},readOnly:!0,value:"wmts"})],he.prototype,"type",void 0),(0,i._)([(0,m.Cb)({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],he.prototype,"url",null),(0,i._)([(0,m.Cb)()],he.prototype,"version",void 0),he=(0,i._)([(0,f.j)("esri.layers.WMTSLayer")],he);const me=he},52162:(e,t,r)=>{r.d(t,{A:()=>s});const i=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function s(e){return i.some((([t,r])=>e>=t&&e<=r))}},88724:(e,t,r)=>{function i(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];if("function"==typeof e){const t=e(r);t&&i(r,t)}else i(r,e)}}function*s(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];"function"==typeof e?yield e(r):yield*s(r,e)}}r.d(t,{H:()=>s,h:()=>i})}}]);