@arcgis/core 4.29.8 → 4.29.9

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 (21) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{a8ac511280f873960d46.js → 1dc474a28d5ddac1a4b7.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{fc5ac713872766571e07.js → 31c065746e53f7518c17.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{c556644bb0cf88770939.js → 413978b96c88d5ff01ee.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{8225febaf0a412f4cee4.js → 5e4465448b2728cafab0.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{df6fbabbc74a408575fc.js → 6301990e489d31596bc8.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{9a8ab968ebb18480481d.js → 8699eaadd3fb6709fd94.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{b139cf91bc148aa84419.js → 96cb79adabfbbcc3e707.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{2433b39624a7e274cb98.js → b4c41a8244b7371e864e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{b42a83db83851cb57d44.js → bed684a8d38fa7ac5eb7.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{fe74ee642bc72fe18210.js → d576aa444ad7c9289617.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{f60e5dd0e712cf32f782.js → f2e8b75ad3b574894ade.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{b9c55ff1f21db198ce03.js → ff96940be6a4c8489ebb.js} +1 -1
  14. package/interfaces.d.ts +3 -3
  15. package/kernel.js +1 -1
  16. package/package.json +1 -1
  17. package/support/revision.js +1 -1
  18. package/views/2d/layers/RouteLayerView2D.js +1 -1
  19. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  20. package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +1 -1
  21. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9368,8528],{8528:(e,t,i)=>{i.d(t,{c:()=>s,g:()=>n});var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},11004:(e,t,i)=>{i.d(t,{o:()=>n});var s=i(74452);class n{constructor(e,t){this._storage=new s.kB,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},74452:(e,t,i)=>{i.d(t,{ML:()=>o,kB:()=>a});var s,n,r=i(24680);(n=s||(s={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,i){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),i&&(this._storage.registerRemoveFunc(this.id,i),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,i,s=0){this._storage.put(this,e,t,i,s)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,i){this._storage.updateSize(this,e,t,i)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new r.c,this._users=new r.c}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const i=this._db.get(e.id+t);return i?.size??0}put(e,t,i,n,r){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==i&&this._notifyRemove(t,o.entry,o.size,s.ALL)),n>this._maxSize)return void this._notifyRemove(t,i,n,s.ALL);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,i,0,s.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(t,new c(i,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,i,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===i){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,i,n,s.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;const i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){const i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=new Array;this._db.forEach(((e,s)=>{const n=e.lifetime;i[n]=(i[n]||0)+e.size,this._users.forAll((i=>{const{id:n,name:r}=i;if(s.startsWith(n)){const i=t[r]||0;t[r]=i+e.size}}))}));const s={};this._users.forAll((e=>{const i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[i]||0;t[i]=n,s[i]=Math.round(100*e.hitRate)+"%"}else s[i]="0%"}));const n=Object.keys(t);n.sort(((e,i)=>t[i]-t[e])),n.forEach((i=>e[i]=Math.round(t[i]/2**20)+"MB / "+s[i]));for(let t=i.length-1;t>=0;--t){const s=i[t];s&&(e["Priority "+(t+-3-1)]=Math.round(s/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,s.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,s.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,s){let n;return this._removeFuncs.some((r=>{if(e.startsWith(r[0])){const e=r[1](t,s,i);return"number"==typeof e&&(n=e),!0}return!1})),n}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const i=e?.id;let s=!0;for(;s;){s=!1;for(const[n,r]of this._db)if(0===r.lifetime&&(!i||n.startsWith(i))){if(this._purgeItem(n,r,e),t.size<=.9*t.maxSize)return;s||=this._db.has(n)}}for(const[s,n]of this._db)if((!i||s.startsWith(i))&&(this._purgeItem(s,n,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,i=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,s.SOME);null!=n&&n>0&&(this._size+=n,i&&(i.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0;class c{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}},39180:(e,t,i)=>{function s(e){return null!=a(e)||null!=o(e)}function n(e){return l.test(e)}function r(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let i=!0;if(u&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,s=0;for(;!t&&s<=e.length;)t=!c.test(e[s]),s++;i=!t}}return i}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=l.exec(e);if(!t?.groups)return null;const i=t.groups,s=+i.year,n=+i.month-1,r=+i.day,o=+(i.hours??"0"),a=+(i.minutes??"0"),c=+(i.seconds??"0");if(o>23)return null;if(a>59)return null;if(c>59)return null;const u=i.ms??"0",h=u?+u.padEnd(3,"0").substring(0,3):0;let d;if(i.isUTC||!i.offsetSign)d=Date.UTC(s,n,r,o,a,c,h);else{const e=+i.offsetHours,t=+i.offsetMinutes;d=6e4*("+"===i.offsetSign?-1:1)*(60*e+t)+Date.UTC(s,n,r,o,a,c,h)}return Number.isNaN(d)?null:d}i.d(t,{H9:()=>s,_:()=>n,sn:()=>r});const l=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,c=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,u=!Number.isNaN(new Date("technology 10").getTime())},3024:(e,t,i)=>{i.d(t,{U:()=>o});var s=i(92400),n=i(24680),r=i(85304);class o{constructor(e=9,t){this._compareMinX=u,this._compareMinY=h,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),S.prune(),b.prune(),I.prune()}all(e){this._all(this._data,e)}search(e,t){let i=this._data;const s=this._toBBox;if(_(e,i))for(x.clear();i;){for(let n=0,r=i.children.length;n<r;n++){const r=i.children[n],o=i.leaf?s(r):r;_(e,o)&&(i.leaf?t(r):g(e,o)?this._all(r,t):x.push(r))}i=x.pop()}}collides(e){let t=this._data;const i=this._toBBox;if(!_(e,t))return!1;for(x.clear();t;){for(let s=0,n=t.children.length;s<n;s++){const n=t.children[s],r=t.leaf?i(n):n;if(_(e,r)){if(t.leaf||g(e,r))return!0;x.push(n)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new F([]),this}remove(e){if(!e)return this;let t,i=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(b.clear(),I.clear();i||b.length>0;){if(i||(i=b.pop(),n=b.data[b.length-1],r=I.pop()??0,o=!0),i.leaf&&(t=(0,s.IP)(i.children,e,i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),b.push(i),this._condense(b),this;o||i.leaf||!g(i,a)?n?(r++,i=n.children[r],o=!1):i=null:(b.push(i),I.push(r),r=0,n=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let i=e;for(S.clear();i;){if(!0===i.leaf)for(const e of i.children)t(e);else S.pushArray(i.children);i=S.pop()??null}}_build(e,t,i,s){const n=i-t+1;let r=this._maxEntries;if(n<=r){const s=new F(e.slice(t,i+1));return a(s,this._toBBox),s}s||(s=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(s-1)));const o=new z([]);o.height=s;const l=Math.ceil(n/r),c=l*Math.ceil(Math.sqrt(r));y(e,t,i,c,this._compareMinX);for(let n=t;n<=i;n+=c){const t=Math.min(n+c-1,i);y(e,n,t,l,this._compareMinY);for(let i=n;i<=t;i+=l){const n=Math.min(i+l-1,t);o.children.push(this._build(e,i,n,s-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,i,s){for(;s.push(t),!0!==t.leaf&&s.length-1!==i;){let i,s=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=d(o),l=p(e,o)-a;l<n?(n=l,s=a<s?a:s,i=o):l===n&&a<s&&(s=a,i=o)}t=i||t.children[0]}return t}_insert(e,t,i){const s=this._toBBox,n=i?e:s(e);b.clear();const r=this._chooseSubtree(n,this._data,t,b);for(r.children.push(e),c(r,n);t>=0&&b.data[t].children.length>this._maxEntries;)this._split(b,t),t--;this._adjustParentBBoxes(n,b,t)}_split(e,t){const i=e.data[t],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);const r=this._chooseSplitIndex(i,n,s);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=i.children.splice(r,i.children.length-r),l=i.leaf?new F(o):new z(o);l.height=i.height,a(i,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(i,l)}_splitRoot(e,t){this._data=new z([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,i){let s,n,r;s=n=1/0;for(let o=t;o<=i-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,i,this._toBBox),c=m(t,a),u=d(t)+d(a);c<s?(s=c,r=o,n=u<n?u:n):c===s&&u<n&&(n=u,r=o)}return r}_chooseSplitAxis(e,t,i){const s=e.leaf?this._compareMinX:u,n=e.leaf?this._compareMinY:h;this._allDistMargin(e,t,i,s)<this._allDistMargin(e,t,i,n)&&e.children.sort(s)}_allDistMargin(e,t,i,s){e.children.sort(s);const n=this._toBBox,r=l(e,0,t,n),o=l(e,i-t,i,n);let a=f(r)+f(o);for(let s=t;s<i-t;s++){const t=e.children[s];c(r,e.leaf?n(t):t),a+=f(r)}for(let s=i-t-1;s>=t;s--){const t=e.children[s];c(o,e.leaf?n(t):t),a+=f(o)}return a}_adjustParentBBoxes(e,t,i){for(let s=i;s>=0;s--)c(t.data[s],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const i=e.data[t];if(0===i.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,s.IP)(r,i,r.length,n.indexHint),1)}else this.clear();else a(i,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,i,s,n){n||(n=new F([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<i;o++)r=e.children[o],c(n,e.leaf?s(r):r);return n}function c(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function u(e,t){return e.minX-t.minX}function h(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function m(e,t){const i=Math.max(e.minX,t.minX),s=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,r-s)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,i,s,n){const o=[t,i];for(;o.length;){const t=o.pop(),i=o.pop();if(t-i<=s)continue;const a=i+Math.ceil((t-i)/s/2)*s;(0,r.q)(e,a,i,t,n),o.push(i,a,a,t)}}const x=new n.c,S=new n.c,b=new n.c,I=new n.c({deallocator:void 0});class w{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class v extends w{constructor(){super(...arguments),this.height=1,this.indexHint=new s.is}}class F extends v{constructor(e){super(),this.children=e,this.leaf=!0}}class z extends v{constructor(e){super(),this.children=e,this.leaf=!1}}},55376:(e,t,i)=>{i.d(t,{E9:()=>a,K0:()=>u,Qt:()=>c});var s=i(88264),n=i(89960);const r={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function o(e=(0,n.a8)()){let t=(e=e.toLowerCase())in r;if(!t){const i=e.split("-");i.length>1&&i[0]in r&&(e=i[0],t=!0),t||(e="en")}const[i,s,o="#,##0.###"]=r[e];return{decimal:i,group:s,pattern:o}}function a(e,t){const i=o((t={...t}).locale);t.customs=i;const s=t.pattern||i.pattern;return isNaN(e)||Math.abs(e)===1/0?null:function(e,t,i){const s=(i=i||{}).customs.group,n=i.customs.decimal,r=t.split(";"),o=r[0];if((t=r[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const a=l,c=o.match(a);if(!c)throw new Error("unable to find a number expression in pattern: "+t);return!1===i.fractional&&(i.places=0),t.replace(a,function(e,t,i){!0===(i=i||{}).places&&(i.places=0),i.places===1/0&&(i.places=6);const s=t.split("."),n="string"==typeof i.places&&i.places.indexOf(",");let r=i.places;n?r=i.places.substring(n+1):+r>=0||(r=(s[1]||[]).length),i.round<0||(e=Number(e.toFixed(Number(r))));const o=String(Math.abs(e)).split("."),a=o[1]||"";if(s[1]||i.places){n&&(i.places=i.places.substring(0,n));const e=void 0!==i.places?i.places:s[1]&&s[1].lastIndexOf("0")+1;+e>a.length&&(o[1]=a.padEnd(Number(e),"0")),+r<a.length&&(o[1]=a.substr(0,Number(r)))}else o[1]&&o.pop();const l=s[0].replace(",","");let c=l.indexOf("0");-1!==c&&(c=l.length-c,c>o[0].length&&(o[0]=o[0].padStart(c,"0")),l.includes("#")||(o[0]=o[0].substr(o[0].length-c)));let u,h,d=s[0].lastIndexOf(",");if(-1!==d){u=s[0].length-d-1;const e=s[0].substr(0,d);d=e.lastIndexOf(","),-1!==d&&(h=e.length-d-1)}const f=[];for(let e=o[0];e;){const t=e.length-u;f.push(t>0?e.substr(t):e),e=t>0?e.slice(0,t):"",h&&(u=h,h=void 0)}return o[0]=f.reverse().join(i.group||","),o.join(i.decimal||".")}(e,c[0],{decimal:n,group:s,places:i.places,round:i.round}))}(e,s,t)}const l=/[#0,]*[#0](?:\.0*#*)?/;function c(e){const t=o((e=e||{}).locale),i=e.pattern||t.pattern,n=t.group,r=t.decimal;let a=1;if(i.includes("%"))a/=100;else if(i.includes("‰"))a/=1e3;else if(i.includes("¤"))throw new Error("currency notation not supported");const c=i.split(";");1===c.length&&c.push("-"+c[0]);const u=d(c,(t=>(t="(?:"+(0,s.cB)(t,".")+")").replace(l,(t=>{const i={signed:!1,separator:e.strict?n:[n,""],fractional:e.fractional,decimal:r,exponent:!1},s=t.split(".");let o=e.places;1===s.length&&1!==a&&(s[1]="###"),1===s.length||0===o?i.fractional=!1:(void 0===o&&(o=e.pattern?s[1].lastIndexOf("0")+1:1/0),o&&null==e.fractional&&(i.fractional=!0),!e.places&&+o<s[1].length&&(o+=","+s[1].length),i.places=o);const l=s[0].split(",");return l.length>1&&(i.groupSize=l.pop().length,l.length>1&&(i.groupSize2=l.pop().length)),"("+function(e){"places"in(e=e||{})||(e.places=1/0),"string"!=typeof e.decimal&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=h(e),i=d(e.fractional,(t=>{let i="";return t&&0!==e.places&&(i="\\"+e.decimal,e.places===1/0?i="(?:"+i+"\\d+)?":i+="\\d{"+e.places+"}"),i}),!0);let s=t+i;return i&&(s="(?:(?:"+s+")|(?:"+i+"))"),s+d(e.exponent,(t=>t?"([eE]"+h({signed:e.eSigned})+")":""))}(i)+")"}))),!0);return{regexp:u.replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:n,decimal:r,factor:a}}function u(e,t){const i=c(t),s=new RegExp("^"+i.regexp+"$").exec(e);if(!s)return NaN;let n=s[1];if(!s[1]){if(!s[2])return NaN;n=s[2],i.factor*=-1}return n=n.replaceAll(new RegExp("["+i.group+"\\s\\xa0]","g"),"").replace(i.decimal,"."),Number(n)*i.factor}function h(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",d(e.signed,(e=>e?"[-+]":""),!0)+d(e.separator,(t=>{if(!t)return"(?:\\d+)";" "===(t=(0,s.cB)(t))?t="\\s":" "===t&&(t="\\s\\xa0");const i=e.groupSize,n=e.groupSize2;if(n){const e="(?:0|[1-9]\\d{0,"+(n-1)+"}(?:["+t+"]\\d{"+n+"})*["+t+"]\\d{"+i+"})";return i-n>0?"(?:"+e+"|(?:0|[1-9]\\d{0,"+(i-1)+"}))":e}return"(?:0|[1-9]\\d{0,"+(i-1)+"}(?:["+t+"]\\d{"+i+"})*)"}),!0)}const d=(e,t,i)=>{if(!(e instanceof Array))return t(e);const s=[];for(let i=0;i<e.length;i++)s.push(t(e[i]));return f(s.join("|"),Boolean(i))},f=(e,t)=>"("+(t?"?:":"")+e+")"},57896:(e,t,i)=>{i.d(t,{Eq:()=>d,KG:()=>_,_8:()=>g,_I:()=>c,aE:()=>l,du:()=>m,on:()=>h}),i(40196),i(2952);var s=i(60976),n=i(38912),r=i(70680),o=i(10860),a=i(37176);function l(e,t,i={}){return u(e,t,i,f)}function c(e,t,i={}){return u(e,t,i,p)}function u(e,t,i={},s){let n=null;const o=i.once?(e,i)=>{s(e)&&((0,r.oR)(n),t(e,i))}:(e,i)=>{s(e)&&t(e,i)};if(n=(0,a.M9)(e,o,i.sync,i.equals),i.initial){const t=e();o(t,t)}return n}function h(e,t,i,o={}){let a=null,c=null,u=null;function h(){a&&c&&(c.remove(),o.onListenerRemove?.(a),a=null,c=null)}function d(e){o.once&&o.once&&(0,r.oR)(u),i(e)}const f=l(e,((e,i)=>{h(),(0,s.sh)(e)&&(a=e,c=(0,s.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return u=(0,n.uU)((()=>{f.remove(),h()})),u}function d(e,t){return function(e,t,i){if((0,o.wv)(i))return Promise.reject((0,o.Uh)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,r.oR)(a)}return new Promise(((s,r)=>{a=(0,n.Ip)([(0,o.wD)(i,(()=>{l(),r((0,o.Uh)())})),u(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??f)])}))}(e,p,t)}function f(e){return!0}function p(e){return!!e}i(41168);const m={sync:!0},g={initial:!0},_={sync:!0,initial:!0}},20480:(e,t,i)=>{i.d(t,{WW:()=>I});var s=i(6220),n=i(20744),r=i(66360),o=i(7488),a=i(48516),l=i(44048),c=i(60544),u=i(29120),h=(i(60708),i(2600)),d=i(6704),f=i(21980),p=i(28176),m=i(81976);const g=()=>r.c.getLogger("esri.geometry.support.normalizeUtils");function _(e){return"polygon"===e[0].type}function y(e){return"polyline"===e[0].type}function x(e,t,i){if(t){const t=function(e,t){if(!(e instanceof a.c||e instanceof o.c)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw g().error(e),new n.c(e)}const i=(0,l.iM)(e),s=[];for(const e of i){const i=[];s.push(i),i.push([e[0][0],e[0][1]]);for(let s=0;s<e.length-1;s++){const n=e[s][0],r=e[s][1],o=e[s+1][0],a=e[s+1][1],l=Math.sqrt((o-n)*(o-n)+(a-r)*(a-r)),c=(a-r)/l,u=(o-n)/l,h=l/t;if(h>1){for(let e=1;e<=h-1;e++){const s=e*t,o=u*s+n,a=c*s+r;i.push([o,a])}const e=(l+Math.floor(h-1)*t)/2,s=u*e+n,o=c*e+r;i.push([s,o])}i.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new o.c({rings:s,spatialReference:e.spatialReference}):new a.c({paths:s,spatialReference:e.spatialReference})}(e,1e6);e=(0,u.aq)(t,!0)}return i&&(e=(0,l.wb)(e,i)),e}function S(e,t,i){if(Array.isArray(e)){const s=e[0];if(s>t){const i=(0,l.yK)(s,t);e[0]=s+i*(-2*t)}else if(s<i){const t=(0,l.yK)(s,i);e[0]=s+t*(-2*i)}}else{const s=e.x;if(s>t){const i=(0,l.yK)(s,t);e=e.clone().offset(i*(-2*t),0)}else if(s<i){const t=(0,l.yK)(s,i);e=e.clone().offset(t*(-2*i),0)}}return e}function b(e,t){let i=-1;for(let s=0;s<t.cutIndexes.length;s++){const n=t.cutIndexes[s],r=t.geometries[s],o=(0,l.iM)(r);for(let e=0;e<o.length;e++){const t=o[e];t.some((i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const s=t[e][0];i=s>i?s:i}i=Number(i.toFixed(9));const s=-360*(0,l.yK)(i,180);for(let i=0;i<t.length;i++){const t=r.getPoint(e,i);r.setPoint(e,i,t.clone().offset(s,0))}return!0}}))}if(n===i){if(_(e))for(const t of(0,l.iM)(r))e[n]=e[n].addRing(t);else if(y(e))for(const t of(0,l.iM)(r))e[n]=e[n].addPath(t)}else i=n,e[n]=r}return e}async function I(e,t,i){if(!Array.isArray(e))return I([e],t);t&&"string"!=typeof t&&g().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??s.default.geometryServiceUrl;let r,_,y,w,v,F,z,B,M=0;const N=[],E=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,_=(0,c.Nq)(r),y=r.isWebMercator,F=y?102100:4326,w=l.Hh[F].maxX,v=l.Hh[F].minX,z=l.Hh[F].plus180Line,B=l.Hh[F].minus180Line),_)if("mesh"===t.type)E.push(t);else if("point"===t.type)E.push(S(t.clone(),w,v));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>S(e,w,v))),E.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,_);E.push(e.rings?new o.c(e):e)}else if(t.extent){const e=t.extent,i=(0,l.yK)(e.xmin,v)*(2*w);let s=0===i?t.clone():(0,l.wb)(t.clone(),i);e.offset(i,0),e.intersects(z)&&e.xmax!==w?(M=e.xmax>M?e.xmax:M,s=x(s,y),N.push(s),E.push("cut")):e.intersects(B)&&e.xmin!==v?(M=e.xmax*(2*w)>M?e.xmax*(2*w):M,s=x(s,y,360),N.push(s),E.push("cut")):E.push(s)}else E.push(t.clone());else E.push(t);else E.push(t);let T=(0,l.yK)(M,w),R=-90;const A=T,C=new a.c;for(;T>0;){const e=360*T-180;C.addPath([[e,R],[e,-1*R]]),R*=-1,T--}if(N.length>0&&A>0){const t=b(N,await async function(e,t,i,s){const n=(0,f.UX)(e),r=t[0].spatialReference,o={...s,responseType:"json",query:{...n.query,f:"json",sr:(0,c.um)(r),target:JSON.stringify({geometryType:(0,d.Ce)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},a=await(0,h.c)(n.path+"/cut",o),{cutIndexes:l,geometries:u=[]}=a.data;return{cutIndexes:l,geometries:u.map((e=>{const t=(0,d.h4)(e);return t.spatialReference=r,t}))}}(n,N,C,i)),s=[],r=[];for(let i=0;i<E.length;i++){const n=E[i];if("cut"!==n)r.push(n);else{const n=t.shift(),o=e[i];null!=o&&"polygon"===o.type&&o.rings&&o.rings.length>1&&n.rings.length>=o.rings.length?(s.push(n),r.push("simplify")):r.push(y?(0,u.w7)(n):n)}}if(!s.length)return r;const o=await async function(e,t,i){const s="string"==typeof e?(0,p.as)(e):e,n=t[0].spatialReference,r=(0,d.Ce)(t[0]),o={...i,query:{...s.query,f:"json",sr:(0,c.um)(n),geometries:JSON.stringify((0,m.y)(t))}},{data:a}=await(0,h.c)(s.path+"/simplify",o);return(0,m.Q)(a.geometries,r,n)}(n,s,i),a=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?a.push(t):a.push(y?(0,u.w7)(o.shift()):o.shift())}return a}const L=[];for(let e=0;e<E.length;e++){const t=E[e];if("cut"!==t)L.push(t);else{const e=N.shift();L.push(!0===y?(0,u.w7)(e):e)}}return L}},44048:(e,t,i)=>{i.d(t,{Hh:()=>o,iM:()=>c,wb:()=>l,yK:()=>a});var s=i(48516),n=i(56156),r=i(6704);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.c({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator}),minus180Line:new s.c({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.c({paths:[[[180,-180],[180,180]]],spatialReference:n.c.WGS84}),minus180Line:new s.c({paths:[[[-180,-180],[-180,180]]],spatialReference:n.c.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const i=c(e);for(const e of i)for(const i of e)i[0]+=t;return e}function c(e){return(0,r.Cs)(e)?e.rings:e.paths}},6904:(e,t,i)=>{i.d(t,{c:()=>a});var s=i(9456),n=i(3024),r=i(83372);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.U(9,(0,s.c)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((i,s)=>{e[t++]=s})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.FZ)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,i){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,i)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9107:(e,t,i)=>{i.d(t,{c:()=>p});var s=i(92400),n=i(20744),r=i(77860),o=i(66360),a=i(77048),l=i(83372),c=i(97088),u=i(6904),h=i(83624),d=i(51752);const f=(0,a.Su)();class p{constructor(e){this.geometryInfo=e,this._boundsStore=new u.c,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.c,this.featureAdapter=d.u}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,i,s,n]=this.fullBounds;return{xmin:t,ymin:i,xmax:s,ymax:n,spatialReference:(0,h.C6)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(s.G6)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const i of e){const e=this._boundsStore.get(i.objectId);e&&t((0,a.Qv)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,i)=>{this._markedIds.has(i)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e}));const i=this._featuresById.get(t);let s;if(this._markedIds.add(t),i?(e.displayId=i.displayId,s=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);s=(0,c.C_)(null!=s?s:(0,l.Su)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=s&&this._boundsStore.set(t,s),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const i=this._featuresById.get(t);if(!i)return this._add(e),e;this._markedIds.add(t);const{geometry:s,attributes:r}=e;for(const e in r)i.attributes[e]=r[e];return s&&(i.geometry=s,this._boundsStore.set(t,(0,c.C_)((0,l.Su)(),s,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),i}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},88300:(e,t,i)=>{i.r(t),i.d(t,{default:()=>H}),i(60708);var s=i(2600),n=i(40196),r=i(39180),o=i(20744),a=i(66360),l=i(10860),c=i(28176),u=i(60074),h=i(3452),d=i(60544),f=i(29120),p=i(34888),m=i(85152),g=i(9107),_=i(7684),y=i(47302),x=i(55376),S=i(564);const b=/^\s*"([\S\s]*)"\s*$/,I=/""/g,w="\n",v=[","," ",";","|","\t"];function*F(e,t,i){let s=0;for(;s<=e.length;){const n=e.indexOf(t,s),r=e.substring(s,n>-1?n:void 0);s+=r.length+t.length,i&&!r.trim()||(yield r)}}function z(e){const t=e.includes("\r\n")?"\r\n":w;return F(e,t,!0)}function B(e,t){return F(e,t,!1)}function M(e,t,i){e=e.trim(),t=t?.trim();const s=[],n=Array.from(new Set([i?.delimiter,...v])).filter((e=>null!=e));for(const i of n){const n=T(e,i).length,r=T(t,i).length??n;n>1&&s.push({weight:Math.min(n,r),delimiter:i})}const r=s.sort((({weight:e},{weight:t})=>t-e)).map((({delimiter:e})=>e));for(const t of r){const s=A(E(e,t).names,i?.longitudeField,i?.latitudeField);if(s.longitudeFieldName&&s.latitudeFieldName)return{delimiter:t,locationInfo:s}}return{delimiter:r[0],locationInfo:null}}function*N(e,t,i,s=(()=>Object.create(null))){const n=z(e);n.next();let r="",o="",a=0,l=s(),c=0;e:for(const e of n){const n=B(e,i);for(const e of n)if(r+=o+e,o="",a+=R(e),a%2==0){if(a>0){const e=b.exec(r);if(!e){l=s(),c=0,r="",a=0;continue e}l[t[c]]=e[1].replaceAll(I,'"'),c++}else l[t[c]]=r,c++;r="",a=0}else o=i;0===a?(yield l,l=s(),c=0):o=w}}function E(e,t){const i=T(e,t).filter((e=>null!=e)),s=i.map((e=>(0,S.gP)(e)));for(let e=s.length-1;e>=0;e--)s[e]||(s.splice(e,1),i.splice(e,1));return{names:s,aliases:i}}function T(e,t){if(!e?.length)return[];const i=[];let s="",n="",r=0;const o=B(e,t);for(const e of o)if(s+=n+e,n="",r+=R(e),r%2==0){if(r>0){const e=b.exec(s);e&&i.push(e[1].replaceAll(I,'"'))}else i.push(s);s="",r=0}else n=t;return i}function R(e){let t=0,i=0;for(i=e.indexOf('"',i);i>=0;)t++,i=e.indexOf('"',i+1);return t}function A(e,t,i){t=(0,S.gP)(t)?.toLowerCase(),i=(0,S.gP)(i)?.toLowerCase();const s=e.map((e=>e.toLowerCase())),n=t?e[s.indexOf(t)]:null,r=i?e[s.indexOf(i)]:null;return{longitudeFieldName:n||e[s.indexOf(k.find((e=>s.includes(e))))],latitudeFieldName:r||e[s.indexOf(O.find((e=>s.includes(e))))]}}function C(e){if(!e.length)return"string";const t=/[^+\-.,0-9]/;return e.map((e=>{if(""!==e){if(!t.test(e)){let t=L(e);if(!isNaN(t))return/[.,]/.test(e)||!Number.isInteger(t)||t>214783647||t<-214783648?"double":"integer";if(e.includes("E")){if(t=Number(e),!Number.isNaN(t))return"double";if(e.includes(",")&&(e=e.replace(",","."),t=Number(e),!Number.isNaN(t)))return"double"}}return(0,r.H9)(e)?"date":"string"}})).reduce(((e,t)=>void 0===e?t:void 0===t?e:e===t?t:"string"===e||"string"===t?"string":"double"===e||"double"===t?"double":void 0))}const L=function(){const e=(0,x.Qt)(),t=new RegExp("^"+e.regexp+"$"),i=new RegExp("["+e.group+"\\s\\xa0]","g"),s=e.factor;return n=>{const r=t.exec(n);if(e.factor=s,!r)return NaN;let o=r[1];if(!r[1]){if(!r[2])return NaN;o=r[2],e.factor*=-1}return o=o.replace(i,"").replace(e.decimal,"."),+o*e.factor}}(),O=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],k=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"];var X=i(17724),Y=i(16424),q=i(28484),j=i(56156);const P=(0,X.w7)("esriGeometryPoint"),D=["csv"],U=[0,0];class G{constructor(e,t){this.x=e,this.y=t}}class H{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){this._loadOptions=e;const[i]=await Promise.all([this._fetch(t.signal),this._checkProjection(e?.parsingOptions?.spatialReference)]),s=function(e,t){const i=t.parsingOptions||{},s={delimiter:i.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:i.latitudeField,longitudeFieldName:i.longitudeField}},n=s.layerDefinition={name:(0,c.u8)(t.url,D)||"csv",dateFieldsTimeReference:{timeZoneIANA:q.Gw},drawingInfo:P,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:i.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:i.spatialReference||{wkid:4326}}},r=z(e),a=r.next().value?.trim(),l=r.next().value?.trim();if(!a)throw new o.c("csv-layer:empty-csv","CSV is empty",{csv:e});const{delimiter:u,locationInfo:h}=M(a,l,i);if(!u)throw new o.c("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:a,secondLine:l,parsingOptions:i});if(!h)throw new o.c("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:a,secondLine:l,parsingOptions:i});s.locationInfo=h,s.delimiter=u;const{names:d,aliases:f}=E(a,u),p=function(e,t,i,s,n){const r=[],o=N(e,i,t),a=[];for(const e of o){if(10===a.length)break;a.push(e)}for(let e=0;e<i.length;e++){const t=i[e],o=s[e];if(t===n.longitudeFieldName||t===n.latitudeFieldName)r.push({name:t,type:"esriFieldTypeDouble",alias:o});else{let e;switch(C(a.map((e=>e[t])))){case"integer":e="esriFieldTypeInteger";break;case"double":e="esriFieldTypeDouble";break;case"date":e="esriFieldTypeDate";break;default:e="esriFieldTypeString"}r.push({name:t,type:e,alias:o,length:(0,S.G0)(e)})}}return r}(e,s.delimiter,d,f,s.locationInfo);if(i.fields?.length){const e=new Y.c(i.fields);for(const t of p){const i=e.get(t.name);i&&Object.assign(t,i)}}if(!p.some((e=>"esriFieldTypeOID"===e.type&&(n.objectIdField=e.name,!0)))){const e={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=e.name,p.unshift(e)}n.fields=p;const m=new Y.c(n.fields);if(s.locationInfo&&(s.locationInfo.latitudeFieldName=m.get(s.locationInfo.latitudeFieldName).name,s.locationInfo.longitudeFieldName=m.get(s.locationInfo.longitudeFieldName).name),n.timeInfo){const e=n.timeInfo;if(e.startTimeField){const t=m.get(e.startTimeField);t?(e.startTimeField=t.name,t.type="esriFieldTypeDate"):e.startTimeField=null}if(e.endTimeField){const t=m.get(e.endTimeField);t?(e.endTimeField=t.name,t.type="esriFieldTypeDate"):e.endTimeField=null}if(e.trackIdField){const t=m.get(e.trackIdField);e.trackIdField=t?t.name:null}e.startTimeField||e.endTimeField||(n.timeInfo=null)}return s}(i,e);this._locationInfo=s.locationInfo,this._delimiter=s.delimiter,this._queryEngine=this._createQueryEngine(s);const n=await this._createFeatures(i);this._queryEngine.featureStore.addMany(n);const{fullExtent:r,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();if(s.layerDefinition.extent=r,a){const{start:e,end:t}=a;s.layerDefinition.timeInfo.timeExtent=[e,t]}return s}async applyEdits(){throw new o.c("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=(0,n.kn)(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),e&&this._queryEngine.featureStore.addMany(e)}),(e=>{this._queryEngine.featureStore.clear(),(0,l.mA)(e)||a.c.getLogger("esri.layers.CSVLayer").error(new o.c("csv-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:i}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:i}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:i}=this._loadOptions;if(!t)throw new o.c("csv-layer:invalid-source","url not defined");const n=(0,c.as)(t);return(await(0,s.c)(n.path,{query:{...n.query,...i},responseType:"text",signal:e})).data}_createQueryEngine(e){const{objectIdField:t,fields:i,extent:s,timeInfo:n}=e.layerDefinition,r=new g.c({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new y.U({fieldsIndex:Y.c.fromLayerJSON({fields:i,dateFieldsTimeReference:{timeZoneIANA:q.Gw}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:n,objectIdField:t,spatialReference:s.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:r})}async _createFeatures(e){const{latitudeFieldName:t,longitudeFieldName:i}=this._locationInfo,{objectIdField:s,fieldsIndex:n,spatialReference:o}=this._queryEngine;let a=[];const l=[],c=n.fields.filter((e=>e.name!==s)).map((e=>e.name));let g=0;const _={};for(const e of n.fields)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=(0,S.gB)(e);void 0!==t&&(_[e.name]=t)}const y=N(e,c,this._delimiter,(0,X.GA)(_,s));for(const e of y){const o=this._parseCoordinateValue(e[t]),c=this._parseCoordinateValue(e[i]);if(null!=c&&null!=o&&!isNaN(o)&&!isNaN(c)){e[t]=o,e[i]=c;for(const s in e)if(s!==t&&s!==i)if(n.isDateField(s))e[s]=(0,r.sn)(e[s]);else if(n.isNumericField(s)){const t=L(e[s]);isNaN(t)?e[s]=null:e[s]=t}e[s]=g,g++,a.push(new G(c,o)),l.push(e)}}if(!(0,d.yK)({wkid:4326},o))if((0,d.kn)(o))for(const e of a)[e.x,e.y]=(0,f.S6)(e.x,e.y,U);else a=(0,u.projectMany)(h.O,a,j.c.WGS84,o,null,null);const x=[];for(let e=0;e<a.length;e++){const{x:t,y:i}=a[e],n=l[e];n[s]=e+1,x.push(new p._M(new m.c([],[t,i]),n,null,n[s]))}return x}_parseCoordinateValue(e){if(null==e||""===e)return null;let t=L(e);return(isNaN(t)||Math.abs(t)>181)&&(t=parseFloat(e)),t}async _checkProjection(e){try{await(0,_.Qv)(d.UH,e)}catch{throw new o.c("csv-layer:projection-not-supported","Projection not supported")}}}},17724:(e,t,i)=>{i.d(t,{G4:()=>d,GA:()=>u,QD:()=>h,w7:()=>a});var s=i(9456),n=i(62088),r=i(13136),o=i(9504);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.qe:"esriGeometryPolyline"===e?o.MZ:o.yq}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let c=1;function u(e,t){if((0,s.c)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let i=`this.${t} = null;`;for(const t in e)i+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${c++} {\n constructor() {\n ${i};\n }\n }\n `)();return()=>new s}catch(i){return()=>({[t]:null,...e})}}function h(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,n.ct)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r.u,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},81976:(e,t,i)=>{i.d(t,{Q:()=>r,y:()=>n});var s=i(6704);function n(e){return{geometryType:(0,s.Ce)(e[0]),geometries:e.map((e=>e.toJSON()))}}function r(e,t,i){const n=(0,s.uG)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=i,t}))}},21980:(e,t,i)=>{i.d(t,{OW:()=>a,UX:()=>o,sR:()=>r}),i(6220),i(47620);var s=i(62088),n=i(28176);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function o(e){return"string"==typeof e?(0,n.as)(e):(0,s.ct)(e)}function a(e,t,i){const s={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))s[n]=r.map((e=>a({item:e},t,i).item));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i?.[n]);s[n]=t?e:JSON.stringify(e)}else s[n]=t?r:JSON.stringify(r);else s[n]=r}return s}i(20572)},9504:(e,t,i)=>{i.d(t,{MZ:()=>r,aV:()=>c,gF:()=>a,gP:()=>l,qe:()=>n,wp:()=>u,yq:()=>o});const s=[252,146,31,255],n={type:"esriSMS",style:"esriSMSCircle",size:6,color:s,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},r={type:"esriSLS",style:"esriSLSSolid",width:.75,color:s},o={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},c={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},u={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9368,8528],{8528:(e,t,i)=>{i.d(t,{c:()=>s,g:()=>n});var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},11004:(e,t,i)=>{i.d(t,{o:()=>n});var s=i(74452);class n{constructor(e,t){this._storage=new s.kB,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},74452:(e,t,i)=>{i.d(t,{ML:()=>o,kB:()=>a});var s,n,r=i(24680);(n=s||(s={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,i){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),i&&(this._storage.registerRemoveFunc(this.id,i),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,i,s=0){this._storage.put(this,e,t,i,s)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,i){this._storage.updateSize(this,e,t,i)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new r.c,this._users=new r.c}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const i=this._db.get(e.id+t);return i?.size??0}put(e,t,i,n,r){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==i&&this._notifyRemove(t,o.entry,o.size,s.ALL)),n>this._maxSize)return void this._notifyRemove(t,i,n,s.ALL);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,i,0,s.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(t,new c(i,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,i,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===i){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,i,n,s.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;const i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){const i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=new Array;this._db.forEach(((e,s)=>{const n=e.lifetime;i[n]=(i[n]||0)+e.size,this._users.forAll((i=>{const{id:n,name:r}=i;if(s.startsWith(n)){const i=t[r]||0;t[r]=i+e.size}}))}));const s={};this._users.forAll((e=>{const i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[i]||0;t[i]=n,s[i]=Math.round(100*e.hitRate)+"%"}else s[i]="0%"}));const n=Object.keys(t);n.sort(((e,i)=>t[i]-t[e])),n.forEach((i=>e[i]=Math.round(t[i]/2**20)+"MB / "+s[i]));for(let t=i.length-1;t>=0;--t){const s=i[t];s&&(e["Priority "+(t+-3-1)]=Math.round(s/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,s.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,s.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,s){let n;return this._removeFuncs.some((r=>{if(e.startsWith(r[0])){const e=r[1](t,s,i);return"number"==typeof e&&(n=e),!0}return!1})),n}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const i=e?.id;let s=!0;for(;s;){s=!1;for(const[n,r]of this._db)if(0===r.lifetime&&(!i||n.startsWith(i))){if(this._purgeItem(n,r,e),t.size<=.9*t.maxSize)return;s||=this._db.has(n)}}for(const[s,n]of this._db)if((!i||s.startsWith(i))&&(this._purgeItem(s,n,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,i=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,s.SOME);null!=n&&n>0&&(this._size+=n,i&&(i.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0;class c{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}},39180:(e,t,i)=>{function s(e){return null!=a(e)||null!=o(e)}function n(e){return l.test(e)}function r(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let i=!0;if(u&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,s=0;for(;!t&&s<=e.length;)t=!c.test(e[s]),s++;i=!t}}return i}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=l.exec(e);if(!t?.groups)return null;const i=t.groups,s=+i.year,n=+i.month-1,r=+i.day,o=+(i.hours??"0"),a=+(i.minutes??"0"),c=+(i.seconds??"0");if(o>23)return null;if(a>59)return null;if(c>59)return null;const u=i.ms??"0",h=u?+u.padEnd(3,"0").substring(0,3):0;let d;if(i.isUTC||!i.offsetSign)d=Date.UTC(s,n,r,o,a,c,h);else{const e=+i.offsetHours,t=+i.offsetMinutes;d=6e4*("+"===i.offsetSign?-1:1)*(60*e+t)+Date.UTC(s,n,r,o,a,c,h)}return Number.isNaN(d)?null:d}i.d(t,{H9:()=>s,_:()=>n,sn:()=>r});const l=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,c=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,u=!Number.isNaN(new Date("technology 10").getTime())},3024:(e,t,i)=>{i.d(t,{U:()=>o});var s=i(92400),n=i(24680),r=i(85304);class o{constructor(e=9,t){this._compareMinX=u,this._compareMinY=h,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),S.prune(),b.prune(),I.prune()}all(e){this._all(this._data,e)}search(e,t){let i=this._data;const s=this._toBBox;if(_(e,i))for(x.clear();i;){for(let n=0,r=i.children.length;n<r;n++){const r=i.children[n],o=i.leaf?s(r):r;_(e,o)&&(i.leaf?t(r):g(e,o)?this._all(r,t):x.push(r))}i=x.pop()}}collides(e){let t=this._data;const i=this._toBBox;if(!_(e,t))return!1;for(x.clear();t;){for(let s=0,n=t.children.length;s<n;s++){const n=t.children[s],r=t.leaf?i(n):n;if(_(e,r)){if(t.leaf||g(e,r))return!0;x.push(n)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new F([]),this}remove(e){if(!e)return this;let t,i=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(b.clear(),I.clear();i||b.length>0;){if(i||(i=b.pop(),n=b.data[b.length-1],r=I.pop()??0,o=!0),i.leaf&&(t=(0,s.IP)(i.children,e,i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),b.push(i),this._condense(b),this;o||i.leaf||!g(i,a)?n?(r++,i=n.children[r],o=!1):i=null:(b.push(i),I.push(r),r=0,n=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let i=e;for(S.clear();i;){if(!0===i.leaf)for(const e of i.children)t(e);else S.pushArray(i.children);i=S.pop()??null}}_build(e,t,i,s){const n=i-t+1;let r=this._maxEntries;if(n<=r){const s=new F(e.slice(t,i+1));return a(s,this._toBBox),s}s||(s=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(s-1)));const o=new z([]);o.height=s;const l=Math.ceil(n/r),c=l*Math.ceil(Math.sqrt(r));y(e,t,i,c,this._compareMinX);for(let n=t;n<=i;n+=c){const t=Math.min(n+c-1,i);y(e,n,t,l,this._compareMinY);for(let i=n;i<=t;i+=l){const n=Math.min(i+l-1,t);o.children.push(this._build(e,i,n,s-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,i,s){for(;s.push(t),!0!==t.leaf&&s.length-1!==i;){let i,s=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=d(o),l=p(e,o)-a;l<n?(n=l,s=a<s?a:s,i=o):l===n&&a<s&&(s=a,i=o)}t=i||t.children[0]}return t}_insert(e,t,i){const s=this._toBBox,n=i?e:s(e);b.clear();const r=this._chooseSubtree(n,this._data,t,b);for(r.children.push(e),c(r,n);t>=0&&b.data[t].children.length>this._maxEntries;)this._split(b,t),t--;this._adjustParentBBoxes(n,b,t)}_split(e,t){const i=e.data[t],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);const r=this._chooseSplitIndex(i,n,s);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=i.children.splice(r,i.children.length-r),l=i.leaf?new F(o):new z(o);l.height=i.height,a(i,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(i,l)}_splitRoot(e,t){this._data=new z([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,i){let s,n,r;s=n=1/0;for(let o=t;o<=i-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,i,this._toBBox),c=m(t,a),u=d(t)+d(a);c<s?(s=c,r=o,n=u<n?u:n):c===s&&u<n&&(n=u,r=o)}return r}_chooseSplitAxis(e,t,i){const s=e.leaf?this._compareMinX:u,n=e.leaf?this._compareMinY:h;this._allDistMargin(e,t,i,s)<this._allDistMargin(e,t,i,n)&&e.children.sort(s)}_allDistMargin(e,t,i,s){e.children.sort(s);const n=this._toBBox,r=l(e,0,t,n),o=l(e,i-t,i,n);let a=f(r)+f(o);for(let s=t;s<i-t;s++){const t=e.children[s];c(r,e.leaf?n(t):t),a+=f(r)}for(let s=i-t-1;s>=t;s--){const t=e.children[s];c(o,e.leaf?n(t):t),a+=f(o)}return a}_adjustParentBBoxes(e,t,i){for(let s=i;s>=0;s--)c(t.data[s],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const i=e.data[t];if(0===i.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,s.IP)(r,i,r.length,n.indexHint),1)}else this.clear();else a(i,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,i,s,n){n||(n=new F([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<i;o++)r=e.children[o],c(n,e.leaf?s(r):r);return n}function c(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function u(e,t){return e.minX-t.minX}function h(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function m(e,t){const i=Math.max(e.minX,t.minX),s=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,r-s)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,i,s,n){const o=[t,i];for(;o.length;){const t=o.pop(),i=o.pop();if(t-i<=s)continue;const a=i+Math.ceil((t-i)/s/2)*s;(0,r.q)(e,a,i,t,n),o.push(i,a,a,t)}}const x=new n.c,S=new n.c,b=new n.c,I=new n.c({deallocator:void 0});class w{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class v extends w{constructor(){super(...arguments),this.height=1,this.indexHint=new s.is}}class F extends v{constructor(e){super(),this.children=e,this.leaf=!0}}class z extends v{constructor(e){super(),this.children=e,this.leaf=!1}}},55376:(e,t,i)=>{i.d(t,{E9:()=>a,K0:()=>u,Qt:()=>c});var s=i(88264),n=i(89960);const r={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function o(e=(0,n.a8)()){let t=(e=e.toLowerCase())in r;if(!t){const i=e.split("-");i.length>1&&i[0]in r&&(e=i[0],t=!0),t||(e="en")}const[i,s,o="#,##0.###"]=r[e];return{decimal:i,group:s,pattern:o}}function a(e,t){const i=o((t={...t}).locale);t.customs=i;const s=t.pattern||i.pattern;return isNaN(e)||Math.abs(e)===1/0?null:function(e,t,i){const s=(i=i||{}).customs.group,n=i.customs.decimal,r=t.split(";"),o=r[0];if((t=r[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const a=l,c=o.match(a);if(!c)throw new Error("unable to find a number expression in pattern: "+t);return!1===i.fractional&&(i.places=0),t.replace(a,function(e,t,i){!0===(i=i||{}).places&&(i.places=0),i.places===1/0&&(i.places=6);const s=t.split("."),n="string"==typeof i.places&&i.places.indexOf(",");let r=i.places;n?r=i.places.substring(n+1):+r>=0||(r=(s[1]||[]).length),i.round<0||(e=Number(e.toFixed(Number(r))));const o=String(Math.abs(e)).split("."),a=o[1]||"";if(s[1]||i.places){n&&(i.places=i.places.substring(0,n));const e=void 0!==i.places?i.places:s[1]&&s[1].lastIndexOf("0")+1;+e>a.length&&(o[1]=a.padEnd(Number(e),"0")),+r<a.length&&(o[1]=a.substr(0,Number(r)))}else o[1]&&o.pop();const l=s[0].replace(",","");let c=l.indexOf("0");-1!==c&&(c=l.length-c,c>o[0].length&&(o[0]=o[0].padStart(c,"0")),l.includes("#")||(o[0]=o[0].substr(o[0].length-c)));let u,h,d=s[0].lastIndexOf(",");if(-1!==d){u=s[0].length-d-1;const e=s[0].substr(0,d);d=e.lastIndexOf(","),-1!==d&&(h=e.length-d-1)}const f=[];for(let e=o[0];e;){const t=e.length-u;f.push(t>0?e.substr(t):e),e=t>0?e.slice(0,t):"",h&&(u=h,h=void 0)}return o[0]=f.reverse().join(i.group||","),o.join(i.decimal||".")}(e,c[0],{decimal:n,group:s,places:i.places,round:i.round}))}(e,s,t)}const l=/[#0,]*[#0](?:\.0*#*)?/;function c(e){const t=o((e=e||{}).locale),i=e.pattern||t.pattern,n=t.group,r=t.decimal;let a=1;if(i.includes("%"))a/=100;else if(i.includes("‰"))a/=1e3;else if(i.includes("¤"))throw new Error("currency notation not supported");const c=i.split(";");1===c.length&&c.push("-"+c[0]);const u=d(c,(t=>(t="(?:"+(0,s.cB)(t,".")+")").replace(l,(t=>{const i={signed:!1,separator:e.strict?n:[n,""],fractional:e.fractional,decimal:r,exponent:!1},s=t.split(".");let o=e.places;1===s.length&&1!==a&&(s[1]="###"),1===s.length||0===o?i.fractional=!1:(void 0===o&&(o=e.pattern?s[1].lastIndexOf("0")+1:1/0),o&&null==e.fractional&&(i.fractional=!0),!e.places&&+o<s[1].length&&(o+=","+s[1].length),i.places=o);const l=s[0].split(",");return l.length>1&&(i.groupSize=l.pop().length,l.length>1&&(i.groupSize2=l.pop().length)),"("+function(e){"places"in(e=e||{})||(e.places=1/0),"string"!=typeof e.decimal&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=h(e),i=d(e.fractional,(t=>{let i="";return t&&0!==e.places&&(i="\\"+e.decimal,e.places===1/0?i="(?:"+i+"\\d+)?":i+="\\d{"+e.places+"}"),i}),!0);let s=t+i;return i&&(s="(?:(?:"+s+")|(?:"+i+"))"),s+d(e.exponent,(t=>t?"([eE]"+h({signed:e.eSigned})+")":""))}(i)+")"}))),!0);return{regexp:u.replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:n,decimal:r,factor:a}}function u(e,t){const i=c(t),s=new RegExp("^"+i.regexp+"$").exec(e);if(!s)return NaN;let n=s[1];if(!s[1]){if(!s[2])return NaN;n=s[2],i.factor*=-1}return n=n.replaceAll(new RegExp("["+i.group+"\\s\\xa0]","g"),"").replace(i.decimal,"."),Number(n)*i.factor}function h(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",d(e.signed,(e=>e?"[-+]":""),!0)+d(e.separator,(t=>{if(!t)return"(?:\\d+)";" "===(t=(0,s.cB)(t))?t="\\s":" "===t&&(t="\\s\\xa0");const i=e.groupSize,n=e.groupSize2;if(n){const e="(?:0|[1-9]\\d{0,"+(n-1)+"}(?:["+t+"]\\d{"+n+"})*["+t+"]\\d{"+i+"})";return i-n>0?"(?:"+e+"|(?:0|[1-9]\\d{0,"+(i-1)+"}))":e}return"(?:0|[1-9]\\d{0,"+(i-1)+"}(?:["+t+"]\\d{"+i+"})*)"}),!0)}const d=(e,t,i)=>{if(!(e instanceof Array))return t(e);const s=[];for(let i=0;i<e.length;i++)s.push(t(e[i]));return f(s.join("|"),Boolean(i))},f=(e,t)=>"("+(t?"?:":"")+e+")"},57896:(e,t,i)=>{i.d(t,{Eq:()=>d,KG:()=>_,_8:()=>g,_I:()=>c,aE:()=>l,du:()=>m,on:()=>h}),i(40196),i(2952);var s=i(60976),n=i(38912),r=i(70680),o=i(10860),a=i(37176);function l(e,t,i={}){return u(e,t,i,f)}function c(e,t,i={}){return u(e,t,i,p)}function u(e,t,i={},s){let n=null;const o=i.once?(e,i)=>{s(e)&&((0,r.oR)(n),t(e,i))}:(e,i)=>{s(e)&&t(e,i)};if(n=(0,a.M9)(e,o,i.sync,i.equals),i.initial){const t=e();o(t,t)}return n}function h(e,t,i,o={}){let a=null,c=null,u=null;function h(){a&&c&&(c.remove(),o.onListenerRemove?.(a),a=null,c=null)}function d(e){o.once&&o.once&&(0,r.oR)(u),i(e)}const f=l(e,((e,i)=>{h(),(0,s.sh)(e)&&(a=e,c=(0,s.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return u=(0,n.uU)((()=>{f.remove(),h()})),u}function d(e,t){return function(e,t,i){if((0,o.wv)(i))return Promise.reject((0,o.Uh)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,r.oR)(a)}return new Promise(((s,r)=>{a=(0,n.Ip)([(0,o.wD)(i,(()=>{l(),r((0,o.Uh)())})),u(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??f)])}))}(e,p,t)}function f(e){return!0}function p(e){return!!e}i(41168);const m={sync:!0},g={initial:!0},_={sync:!0,initial:!0}},20480:(e,t,i)=>{i.d(t,{WW:()=>I});var s=i(6220),n=i(20744),r=i(66360),o=i(7488),a=i(48516),l=i(44048),c=i(60544),u=i(29120),h=(i(60708),i(2600)),d=i(6704),f=i(21980),p=i(28176),m=i(81976);const g=()=>r.c.getLogger("esri.geometry.support.normalizeUtils");function _(e){return"polygon"===e[0].type}function y(e){return"polyline"===e[0].type}function x(e,t,i){if(t){const t=function(e,t){if(!(e instanceof a.c||e instanceof o.c)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw g().error(e),new n.c(e)}const i=(0,l.iM)(e),s=[];for(const e of i){const i=[];s.push(i),i.push([e[0][0],e[0][1]]);for(let s=0;s<e.length-1;s++){const n=e[s][0],r=e[s][1],o=e[s+1][0],a=e[s+1][1],l=Math.sqrt((o-n)*(o-n)+(a-r)*(a-r)),c=(a-r)/l,u=(o-n)/l,h=l/t;if(h>1){for(let e=1;e<=h-1;e++){const s=e*t,o=u*s+n,a=c*s+r;i.push([o,a])}const e=(l+Math.floor(h-1)*t)/2,s=u*e+n,o=c*e+r;i.push([s,o])}i.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new o.c({rings:s,spatialReference:e.spatialReference}):new a.c({paths:s,spatialReference:e.spatialReference})}(e,1e6);e=(0,u.aq)(t,!0)}return i&&(e=(0,l.wb)(e,i)),e}function S(e,t,i){if(Array.isArray(e)){const s=e[0];if(s>t){const i=(0,l.yK)(s,t);e[0]=s+i*(-2*t)}else if(s<i){const t=(0,l.yK)(s,i);e[0]=s+t*(-2*i)}}else{const s=e.x;if(s>t){const i=(0,l.yK)(s,t);e=e.clone().offset(i*(-2*t),0)}else if(s<i){const t=(0,l.yK)(s,i);e=e.clone().offset(t*(-2*i),0)}}return e}function b(e,t){let i=-1;for(let s=0;s<t.cutIndexes.length;s++){const n=t.cutIndexes[s],r=t.geometries[s],o=(0,l.iM)(r);for(let e=0;e<o.length;e++){const t=o[e];t.some((i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const s=t[e][0];i=s>i?s:i}i=Number(i.toFixed(9));const s=-360*(0,l.yK)(i,180);for(let i=0;i<t.length;i++){const t=r.getPoint(e,i);r.setPoint(e,i,t.clone().offset(s,0))}return!0}}))}if(n===i){if(_(e))for(const t of(0,l.iM)(r))e[n]=e[n].addRing(t);else if(y(e))for(const t of(0,l.iM)(r))e[n]=e[n].addPath(t)}else i=n,e[n]=r}return e}async function I(e,t,i){if(!Array.isArray(e))return I([e],t);t&&"string"!=typeof t&&g().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??s.default.geometryServiceUrl;let r,_,y,w,v,F,z,B,M=0;const N=[],E=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,_=(0,c.Nq)(r),y=r.isWebMercator,F=y?102100:4326,w=l.Hh[F].maxX,v=l.Hh[F].minX,z=l.Hh[F].plus180Line,B=l.Hh[F].minus180Line),_)if("mesh"===t.type)E.push(t);else if("point"===t.type)E.push(S(t.clone(),w,v));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>S(e,w,v))),E.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,_);E.push(e.rings?new o.c(e):e)}else if(t.extent){const e=t.extent,i=(0,l.yK)(e.xmin,v)*(2*w);let s=0===i?t.clone():(0,l.wb)(t.clone(),i);e.offset(i,0),e.intersects(z)&&e.xmax!==w?(M=e.xmax>M?e.xmax:M,s=x(s,y),N.push(s),E.push("cut")):e.intersects(B)&&e.xmin!==v?(M=e.xmax*(2*w)>M?e.xmax*(2*w):M,s=x(s,y,360),N.push(s),E.push("cut")):E.push(s)}else E.push(t.clone());else E.push(t);else E.push(t);let T=(0,l.yK)(M,w),R=-90;const A=T,C=new a.c;for(;T>0;){const e=360*T-180;C.addPath([[e,R],[e,-1*R]]),R*=-1,T--}if(N.length>0&&A>0){const t=b(N,await async function(e,t,i,s){const n=(0,f.UX)(e),r=t[0].spatialReference,o={...s,responseType:"json",query:{...n.query,f:"json",sr:(0,c.um)(r),target:JSON.stringify({geometryType:(0,d.Ce)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},a=await(0,h.c)(n.path+"/cut",o),{cutIndexes:l,geometries:u=[]}=a.data;return{cutIndexes:l,geometries:u.map((e=>{const t=(0,d.h4)(e);return t.spatialReference=r,t}))}}(n,N,C,i)),s=[],r=[];for(let i=0;i<E.length;i++){const n=E[i];if("cut"!==n)r.push(n);else{const n=t.shift(),o=e[i];null!=o&&"polygon"===o.type&&o.rings&&o.rings.length>1&&n.rings.length>=o.rings.length?(s.push(n),r.push("simplify")):r.push(y?(0,u.w7)(n):n)}}if(!s.length)return r;const o=await async function(e,t,i){const s="string"==typeof e?(0,p.as)(e):e,n=t[0].spatialReference,r=(0,d.Ce)(t[0]),o={...i,query:{...s.query,f:"json",sr:(0,c.um)(n),geometries:JSON.stringify((0,m.y)(t))}},{data:a}=await(0,h.c)(s.path+"/simplify",o);return(0,m.Q)(a.geometries,r,n)}(n,s,i),a=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?a.push(t):a.push(y?(0,u.w7)(o.shift()):o.shift())}return a}const L=[];for(let e=0;e<E.length;e++){const t=E[e];if("cut"!==t)L.push(t);else{const e=N.shift();L.push(!0===y?(0,u.w7)(e):e)}}return L}},44048:(e,t,i)=>{i.d(t,{Hh:()=>o,iM:()=>c,wb:()=>l,yK:()=>a});var s=i(48516),n=i(56156),r=i(6704);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.c({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator}),minus180Line:new s.c({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.c({paths:[[[180,-180],[180,180]]],spatialReference:n.c.WGS84}),minus180Line:new s.c({paths:[[[-180,-180],[-180,180]]],spatialReference:n.c.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const i=c(e);for(const e of i)for(const i of e)i[0]+=t;return e}function c(e){return(0,r.Cs)(e)?e.rings:e.paths}},6904:(e,t,i)=>{i.d(t,{c:()=>a});var s=i(9456),n=i(3024),r=i(83372);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.U(9,(0,s.c)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((i,s)=>{e[t++]=s})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.FZ)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,i){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,i)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9107:(e,t,i)=>{i.d(t,{c:()=>p});var s=i(92400),n=i(20744),r=i(77860),o=i(66360),a=i(77048),l=i(83372),c=i(97088),u=i(6904),h=i(83624),d=i(16736);const f=(0,a.Su)();class p{constructor(e){this.geometryInfo=e,this._boundsStore=new u.c,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.c,this.featureAdapter=d.u}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,i,s,n]=this.fullBounds;return{xmin:t,ymin:i,xmax:s,ymax:n,spatialReference:(0,h.C6)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(s.G6)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const i of e){const e=this._boundsStore.get(i.objectId);e&&t((0,a.Qv)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,i)=>{this._markedIds.has(i)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e}));const i=this._featuresById.get(t);let s;if(this._markedIds.add(t),i?(e.displayId=i.displayId,s=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);s=(0,c.C_)(null!=s?s:(0,l.Su)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=s&&this._boundsStore.set(t,s),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const i=this._featuresById.get(t);if(!i)return this._add(e),e;this._markedIds.add(t);const{geometry:s,attributes:r}=e;for(const e in r)i.attributes[e]=r[e];return s&&(i.geometry=s,this._boundsStore.set(t,(0,c.C_)((0,l.Su)(),s,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),i}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},88300:(e,t,i)=>{i.r(t),i.d(t,{default:()=>H}),i(60708);var s=i(2600),n=i(40196),r=i(39180),o=i(20744),a=i(66360),l=i(10860),c=i(28176),u=i(60074),h=i(3452),d=i(60544),f=i(29120),p=i(34888),m=i(85152),g=i(9107),_=i(7684),y=i(47302),x=i(55376),S=i(564);const b=/^\s*"([\S\s]*)"\s*$/,I=/""/g,w="\n",v=[","," ",";","|","\t"];function*F(e,t,i){let s=0;for(;s<=e.length;){const n=e.indexOf(t,s),r=e.substring(s,n>-1?n:void 0);s+=r.length+t.length,i&&!r.trim()||(yield r)}}function z(e){const t=e.includes("\r\n")?"\r\n":w;return F(e,t,!0)}function B(e,t){return F(e,t,!1)}function M(e,t,i){e=e.trim(),t=t?.trim();const s=[],n=Array.from(new Set([i?.delimiter,...v])).filter((e=>null!=e));for(const i of n){const n=T(e,i).length,r=T(t,i).length??n;n>1&&s.push({weight:Math.min(n,r),delimiter:i})}const r=s.sort((({weight:e},{weight:t})=>t-e)).map((({delimiter:e})=>e));for(const t of r){const s=A(E(e,t).names,i?.longitudeField,i?.latitudeField);if(s.longitudeFieldName&&s.latitudeFieldName)return{delimiter:t,locationInfo:s}}return{delimiter:r[0],locationInfo:null}}function*N(e,t,i,s=(()=>Object.create(null))){const n=z(e);n.next();let r="",o="",a=0,l=s(),c=0;e:for(const e of n){const n=B(e,i);for(const e of n)if(r+=o+e,o="",a+=R(e),a%2==0){if(a>0){const e=b.exec(r);if(!e){l=s(),c=0,r="",a=0;continue e}l[t[c]]=e[1].replaceAll(I,'"'),c++}else l[t[c]]=r,c++;r="",a=0}else o=i;0===a?(yield l,l=s(),c=0):o=w}}function E(e,t){const i=T(e,t).filter((e=>null!=e)),s=i.map((e=>(0,S.gP)(e)));for(let e=s.length-1;e>=0;e--)s[e]||(s.splice(e,1),i.splice(e,1));return{names:s,aliases:i}}function T(e,t){if(!e?.length)return[];const i=[];let s="",n="",r=0;const o=B(e,t);for(const e of o)if(s+=n+e,n="",r+=R(e),r%2==0){if(r>0){const e=b.exec(s);e&&i.push(e[1].replaceAll(I,'"'))}else i.push(s);s="",r=0}else n=t;return i}function R(e){let t=0,i=0;for(i=e.indexOf('"',i);i>=0;)t++,i=e.indexOf('"',i+1);return t}function A(e,t,i){t=(0,S.gP)(t)?.toLowerCase(),i=(0,S.gP)(i)?.toLowerCase();const s=e.map((e=>e.toLowerCase())),n=t?e[s.indexOf(t)]:null,r=i?e[s.indexOf(i)]:null;return{longitudeFieldName:n||e[s.indexOf(k.find((e=>s.includes(e))))],latitudeFieldName:r||e[s.indexOf(O.find((e=>s.includes(e))))]}}function C(e){if(!e.length)return"string";const t=/[^+\-.,0-9]/;return e.map((e=>{if(""!==e){if(!t.test(e)){let t=L(e);if(!isNaN(t))return/[.,]/.test(e)||!Number.isInteger(t)||t>214783647||t<-214783648?"double":"integer";if(e.includes("E")){if(t=Number(e),!Number.isNaN(t))return"double";if(e.includes(",")&&(e=e.replace(",","."),t=Number(e),!Number.isNaN(t)))return"double"}}return(0,r.H9)(e)?"date":"string"}})).reduce(((e,t)=>void 0===e?t:void 0===t?e:e===t?t:"string"===e||"string"===t?"string":"double"===e||"double"===t?"double":void 0))}const L=function(){const e=(0,x.Qt)(),t=new RegExp("^"+e.regexp+"$"),i=new RegExp("["+e.group+"\\s\\xa0]","g"),s=e.factor;return n=>{const r=t.exec(n);if(e.factor=s,!r)return NaN;let o=r[1];if(!r[1]){if(!r[2])return NaN;o=r[2],e.factor*=-1}return o=o.replace(i,"").replace(e.decimal,"."),+o*e.factor}}(),O=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],k=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"];var X=i(17724),Y=i(16424),q=i(28484),j=i(56156);const P=(0,X.w7)("esriGeometryPoint"),D=["csv"],U=[0,0];class G{constructor(e,t){this.x=e,this.y=t}}class H{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){this._loadOptions=e;const[i]=await Promise.all([this._fetch(t.signal),this._checkProjection(e?.parsingOptions?.spatialReference)]),s=function(e,t){const i=t.parsingOptions||{},s={delimiter:i.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:i.latitudeField,longitudeFieldName:i.longitudeField}},n=s.layerDefinition={name:(0,c.u8)(t.url,D)||"csv",dateFieldsTimeReference:{timeZoneIANA:q.Gw},drawingInfo:P,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:i.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:i.spatialReference||{wkid:4326}}},r=z(e),a=r.next().value?.trim(),l=r.next().value?.trim();if(!a)throw new o.c("csv-layer:empty-csv","CSV is empty",{csv:e});const{delimiter:u,locationInfo:h}=M(a,l,i);if(!u)throw new o.c("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:a,secondLine:l,parsingOptions:i});if(!h)throw new o.c("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:a,secondLine:l,parsingOptions:i});s.locationInfo=h,s.delimiter=u;const{names:d,aliases:f}=E(a,u),p=function(e,t,i,s,n){const r=[],o=N(e,i,t),a=[];for(const e of o){if(10===a.length)break;a.push(e)}for(let e=0;e<i.length;e++){const t=i[e],o=s[e];if(t===n.longitudeFieldName||t===n.latitudeFieldName)r.push({name:t,type:"esriFieldTypeDouble",alias:o});else{let e;switch(C(a.map((e=>e[t])))){case"integer":e="esriFieldTypeInteger";break;case"double":e="esriFieldTypeDouble";break;case"date":e="esriFieldTypeDate";break;default:e="esriFieldTypeString"}r.push({name:t,type:e,alias:o,length:(0,S.G0)(e)})}}return r}(e,s.delimiter,d,f,s.locationInfo);if(i.fields?.length){const e=new Y.c(i.fields);for(const t of p){const i=e.get(t.name);i&&Object.assign(t,i)}}if(!p.some((e=>"esriFieldTypeOID"===e.type&&(n.objectIdField=e.name,!0)))){const e={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=e.name,p.unshift(e)}n.fields=p;const m=new Y.c(n.fields);if(s.locationInfo&&(s.locationInfo.latitudeFieldName=m.get(s.locationInfo.latitudeFieldName).name,s.locationInfo.longitudeFieldName=m.get(s.locationInfo.longitudeFieldName).name),n.timeInfo){const e=n.timeInfo;if(e.startTimeField){const t=m.get(e.startTimeField);t?(e.startTimeField=t.name,t.type="esriFieldTypeDate"):e.startTimeField=null}if(e.endTimeField){const t=m.get(e.endTimeField);t?(e.endTimeField=t.name,t.type="esriFieldTypeDate"):e.endTimeField=null}if(e.trackIdField){const t=m.get(e.trackIdField);e.trackIdField=t?t.name:null}e.startTimeField||e.endTimeField||(n.timeInfo=null)}return s}(i,e);this._locationInfo=s.locationInfo,this._delimiter=s.delimiter,this._queryEngine=this._createQueryEngine(s);const n=await this._createFeatures(i);this._queryEngine.featureStore.addMany(n);const{fullExtent:r,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();if(s.layerDefinition.extent=r,a){const{start:e,end:t}=a;s.layerDefinition.timeInfo.timeExtent=[e,t]}return s}async applyEdits(){throw new o.c("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=(0,n.kn)(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),e&&this._queryEngine.featureStore.addMany(e)}),(e=>{this._queryEngine.featureStore.clear(),(0,l.mA)(e)||a.c.getLogger("esri.layers.CSVLayer").error(new o.c("csv-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:i}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:i}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:i}=this._loadOptions;if(!t)throw new o.c("csv-layer:invalid-source","url not defined");const n=(0,c.as)(t);return(await(0,s.c)(n.path,{query:{...n.query,...i},responseType:"text",signal:e})).data}_createQueryEngine(e){const{objectIdField:t,fields:i,extent:s,timeInfo:n}=e.layerDefinition,r=new g.c({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new y.U({fieldsIndex:Y.c.fromLayerJSON({fields:i,dateFieldsTimeReference:{timeZoneIANA:q.Gw}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:n,objectIdField:t,spatialReference:s.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:r})}async _createFeatures(e){const{latitudeFieldName:t,longitudeFieldName:i}=this._locationInfo,{objectIdField:s,fieldsIndex:n,spatialReference:o}=this._queryEngine;let a=[];const l=[],c=n.fields.filter((e=>e.name!==s)).map((e=>e.name));let g=0;const _={};for(const e of n.fields)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=(0,S.gB)(e);void 0!==t&&(_[e.name]=t)}const y=N(e,c,this._delimiter,(0,X.GA)(_,s));for(const e of y){const o=this._parseCoordinateValue(e[t]),c=this._parseCoordinateValue(e[i]);if(null!=c&&null!=o&&!isNaN(o)&&!isNaN(c)){e[t]=o,e[i]=c;for(const s in e)if(s!==t&&s!==i)if(n.isDateField(s))e[s]=(0,r.sn)(e[s]);else if(n.isNumericField(s)){const t=L(e[s]);isNaN(t)?e[s]=null:e[s]=t}e[s]=g,g++,a.push(new G(c,o)),l.push(e)}}if(!(0,d.yK)({wkid:4326},o))if((0,d.kn)(o))for(const e of a)[e.x,e.y]=(0,f.S6)(e.x,e.y,U);else a=(0,u.projectMany)(h.O,a,j.c.WGS84,o,null,null);const x=[];for(let e=0;e<a.length;e++){const{x:t,y:i}=a[e],n=l[e];n[s]=e+1,x.push(new p._M(new m.c([],[t,i]),n,null,n[s]))}return x}_parseCoordinateValue(e){if(null==e||""===e)return null;let t=L(e);return(isNaN(t)||Math.abs(t)>181)&&(t=parseFloat(e)),t}async _checkProjection(e){try{await(0,_.Qv)(d.UH,e)}catch{throw new o.c("csv-layer:projection-not-supported","Projection not supported")}}}},17724:(e,t,i)=>{i.d(t,{G4:()=>d,GA:()=>u,QD:()=>h,w7:()=>a});var s=i(9456),n=i(62088),r=i(13136),o=i(9504);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.qe:"esriGeometryPolyline"===e?o.MZ:o.yq}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let c=1;function u(e,t){if((0,s.c)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let i=`this.${t} = null;`;for(const t in e)i+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${c++} {\n constructor() {\n ${i};\n }\n }\n `)();return()=>new s}catch(i){return()=>({[t]:null,...e})}}function h(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,n.ct)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r.u,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},81976:(e,t,i)=>{i.d(t,{Q:()=>r,y:()=>n});var s=i(6704);function n(e){return{geometryType:(0,s.Ce)(e[0]),geometries:e.map((e=>e.toJSON()))}}function r(e,t,i){const n=(0,s.uG)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=i,t}))}},21980:(e,t,i)=>{i.d(t,{OW:()=>a,UX:()=>o,sR:()=>r}),i(6220),i(47620);var s=i(62088),n=i(28176);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function o(e){return"string"==typeof e?(0,n.as)(e):(0,s.ct)(e)}function a(e,t,i){const s={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))s[n]=r.map((e=>a({item:e},t,i).item));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i?.[n]);s[n]=t?e:JSON.stringify(e)}else s[n]=t?r:JSON.stringify(r);else s[n]=r}return s}i(20572)},9504:(e,t,i)=>{i.d(t,{MZ:()=>r,aV:()=>c,gF:()=>a,gP:()=>l,qe:()=>n,wp:()=>u,yq:()=>o});const s=[252,146,31,255],n={type:"esriSMS",style:"esriSMSCircle",size:6,color:s,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},r={type:"esriSLS",style:"esriSLSSolid",width:.75,color:s},o={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},c={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},u={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2259],{3615:(e,a,t)=>{t.d(a,{q:()=>n});var r=t(66668);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const t=this._serviceMetadatas.get(e);if(t)return t;const n=await(0,r.S)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:t}=this;if(t.has(a))return t.get(a);const r=await e.fetchData();return t.set(a,r),r}async fetchCustomParameters(e,a){const t=await this.fetchItemData(e);return t&&"object"==typeof t&&(a?a(t):t.customParameters)||null}}},50420:(e,a,t)=>{t.d(a,{S:()=>u});var r=t(47620),n=t(2600),s=t(20744),i=t(10860),l=t(48212),c=t(54872),o=t(9764);async function u(e,a){const t=(0,l.K0)(e);if(!t)throw new s.c("invalid-url","Invalid scene service url");const u={...a,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(u.sceneLayerItem??=await async function(e){const a=(await y(e)).serviceItemId;if(!a)return null;const t=new o.default({id:a,apiKey:e.apiKey}),s=await async function(e){const a=r.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.c)(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,i.CE)(e)}return null}(e);null!=s&&(t.portal=new c.c({url:s}));try{return t.load({signal:e.signal})}catch(e){return(0,i.CE)(e),null}}(u),null==u.sceneLayerItem)return d(u.sceneServerUrl.replace("/SceneServer","/FeatureServer"),u);const m=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const t=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!t)return null;const r=new o.default({portal:t.portal,id:t.id});return await r.load(),r}catch(e){return(0,i.CE)(e),null}}(u);if(!m?.url)throw new s.c("related-service-not-found","Could not find feature service through portal item relationship");u.featureServiceItem=m;const f=await d(m.url,u);return f.portalItem=m,f}async function y(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await(0,n.c)(e.sceneServerUrl,a);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const t=(0,l.K0)(e);if(!t)throw new s.c("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,i=a.layerId;if(null==i)return{serverUrl:r};const c=y(a),o=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,u=(o?.layers?.[0]||o?.tables?.[0])?.customParameters,d=e=>{const t={query:{f:"json",...u},responseType:"json",authMode:e,signal:a.signal};return(0,n.c)(r,t)},m=d("anonymous").catch((()=>d("no-prompt"))),[f,w]=await Promise.all([m,c]),p=w?.layers,h=f.data&&f.data.layers;if(!Array.isArray(h))throw new Error("expected layers array");if(Array.isArray(p)){for(let e=0;e<Math.min(p.length,h.length);e++)if(p[e].id===i)return{serverUrl:r,layerId:h[e].id}}else if(null!=i&&i<h.length)return{serverUrl:r,layerId:h[i].id};throw new Error("could not find matching associated sublayer")}},83928:(e,a,t)=>{t.d(a,{q:()=>r});const r={BingMapsLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3912)]).then(t.bind(t,48388))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(3180),t.e(9644),t.e(8344),t.e(9420),t.e(8644),t.e(5928)]).then(t.bind(t,10948))).default,CatalogLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(2664),t.e(2848),t.e(5468),t.e(572),t.e(2907)]).then(t.bind(t,20324))).default,CSVLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(1744)]).then(t.bind(t,79468))).default,DimensionLayer:async()=>(await Promise.all([t.e(5612),t.e(7832)]).then(t.bind(t,28320))).default,ElevationLayer:async()=>(await Promise.all([t.e(5612),t.e(2968),t.e(8380)]).then(t.bind(t,47104))).default,FeatureLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(8348)]).then(t.bind(t,672))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(6528)]).then(t.bind(t,92768))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(7988),t.e(7148),t.e(2672)]).then(t.bind(t,43984))).default,GroupLayer:async()=>(await Promise.all([t.e(5612),t.e(7456)]).then(t.bind(t,44080))).default,ImageryLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(2848),t.e(6128),t.e(9056),t.e(3291)]).then(t.bind(t,7896))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(6128),t.e(7048),t.e(9056),t.e(5496)]).then(t.bind(t,82744))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(5612),t.e(9644),t.e(7024)]).then(t.bind(t,96584))).default,KMLLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(236),t.e(9032)]).then(t.bind(t,53688))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(5612),t.e(3536)]).then(t.bind(t,91884))).default,LinkChartLayer:async()=>(await Promise.all([t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(9512),t.e(3220),t.e(1512),t.e(6680),t.e(8080)]).then(t.bind(t,54192))).default,MapImageLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(2848),t.e(5468),t.e(1248),t.e(3089)]).then(t.bind(t,3089))).default,MapNotesLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(9516)]).then(t.bind(t,37784))).default,MediaLayer:async()=>(await Promise.all([t.e(5612),t.e(2364)]).then(t.bind(t,66664))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(3160),t.e(8224)]).then(t.bind(t,56288))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3632),t.e(1244)]).then(t.bind(t,1244))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(1740)]).then(t.bind(t,75432))).default,PointCloudLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(9644),t.e(2296)]).then(t.bind(t,21680))).default,RouteLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(236),t.e(6352)]).then(t.bind(t,40900))).default,SceneLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(8624),t.e(3180),t.e(9644),t.e(8344),t.e(9420),t.e(7424),t.e(9780),t.e(8644),t.e(712)]).then(t.bind(t,3688))).default,StreamLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(3460)]).then(t.bind(t,18e3))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(2664),t.e(6556),t.e(5368),t.e(2608)]).then(t.bind(t,8444))).default,TileLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(2848),t.e(5468),t.e(2968),t.e(1248),t.e(0)]).then(t.bind(t,5e4))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([t.e(5612),t.e(7752)]).then(t.bind(t,71316))).default,UnknownLayer:async()=>(await t.e(6584).then(t.bind(t,56584))).default,UnsupportedLayer:async()=>(await t.e(2456).then(t.bind(t,12456))).default,VectorTileLayer:async()=>(await Promise.all([t.e(5612),t.e(2968),t.e(3780),t.e(6055),t.e(7936)]).then(t.bind(t,65632))).default,VoxelLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(9644),t.e(8256)]).then(t.bind(t,59496))).default,WFSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(4808),t.e(3688)]).then(t.bind(t,53440))).default,WMSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(280)]).then(t.bind(t,85024))).default,WMTSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3632),t.e(4832)]).then(t.bind(t,54832))).default,WebTileLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3632)]).then(t.bind(t,32896))).default}},67632:(e,a,t)=>{t.d(a,{AX:()=>l,Ur:()=>y,cr:()=>i,eW:()=>s,k1:()=>o,mg:()=>c,oD:()=>d,qi:()=>n,wp:()=>u});var r=t(50420);function n(e){const a={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(a.layerType="OrientedImageryLayer"),a}async function s(e,a,t){if(null==e?.layers||null==e?.tables){const r=await t.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||r?.layers?.map(n),e.tables=e.tables||r?.tables?.map(n)}return e}function i(e){const{layers:a,tables:t}=e;return a?.length?a[0].id:t?.length?t[0].id:null}function l(e){if(!e)return null;const{layers:a,tables:t}=e;return a?.length?a[0]:t?.length?t[0]:null}function c(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function o(e){const a=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&a.push(e.id)})),a}function u(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}function y(e){return e?.layers?.filter((({layerType:e})=>"CatalogLayer"===e)).map((({id:e})=>e))}async function d(e,a,t){if(!e?.url)return a??{};if(a??={},!a.layers){const r=await t.fetchServiceMetadata(e.url);a.layers=r.layers?.map(n)}const{serverUrl:s,portalItem:i}=await(0,r.S)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==s)return a.tables=[],a;if(!a.tables&&i){const e=await i.fetchData();if(e?.tables)a.tables=e.tables.map(n);else{const r=await t.fetchServiceMetadata(s,{customParameters:l(e)?.customParameters});a.tables=r?.tables?.map(n)}}if(a.tables)for(const e of a.tables)e.url=`${s}/${e.id}`;return a}},12259:(e,a,t)=>{t.d(a,{fromItem:()=>y,q:()=>d});var r=t(20744),n=t(50420),s=t(3615),i=t(71068),l=t(83928),c=t(9764),o=t(67632),u=t(46940);async function y(e){!e.portalItem||e.portalItem instanceof c.default||(e={...e,portalItem:new c.default(e.portalItem)});const a=await async function(e){await e.load();const a=new s.q;return async function(e){const a=e.className,t=l.q[a];return{constructor:await t(),properties:e.properties}}(await d(e,a))}(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function d(e,a){switch(e.type){case"3DTiles Service":return{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,u._S)(e,"Map Notes"),t=(0,u._S)(e,"Markup");if(a||t)return{className:"MapNotesLayer"};if((0,u._S)(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return 1===(0,o.mg)(r)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const t=await m(e,a);if("object"==typeof t){const{sourceJSON:e,className:a}=t,r={sourceJSON:e};return null!=t.id&&(r.layerId=t.id),{className:a||"FeatureLayer",properties:r}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const t=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(t.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(t.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await a.fetchItemData(e),n=r?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),i=s.cacheType?.toLowerCase(),l=s.capabilities?.toLowerCase().includes("tilesonly");return"map"===i||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:t}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return t}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const t=await m(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:t}=await(0,n.S)(e.url,{sceneLayerItem:e}),r=await a.fetchServiceMetadata(t);return r?.tables??[]}catch{return[]}}));if("object"==typeof t){const r={};let n;if(null!=t.id?(r.layerId=t.id,n=`${e.url}/layers/${t.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(i.Wr))if(e.typeKeywords.includes(a))return{className:i.Wr[a]};const s=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.AX)(e)?.customParameters))});return{className:i.Wr[s?.layerType]||"SceneLayer",properties:r}}if(!1===t){const t=await a.fetchServiceMetadata(e.url);if("Voxel"===t?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new r.c("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function m(e,a,t){const{url:r,type:n}=e,s="Feature Service"===n;if(!r)return{};if(/\/\d+$/.test(r)){if(s){const t=await a.fetchServiceMetadata(r,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.AX)(e)?.customParameters))});if("Oriented Imagery Layer"===t.type)return{id:t.id,className:"OrientedImageryLayer",sourceJSON:t}}return{}}await e.load();let i=await a.fetchItemData(e);if(s){const e=await(0,o.eW)(i,r,a),t=f(e);if("object"==typeof t){const a=(0,o.k1)(e),r=(0,o.wp)(e),n=(0,o.Ur)(e);t.className=null!=t.id&&a.includes(t.id)?"SubtypeGroupLayer":null!=t.id&&r?.includes(t.id)?"OrientedImageryLayer":null!=t.id&&n?.includes(t.id)?"CatalogLayer":"FeatureLayer"}return t}if("Scene Service"===n&&(i=await(0,o.oD)(e,i,a)),(0,o.mg)(i)>0)return f(i);const l=await a.fetchServiceMetadata(r);return t&&(l.tables=await t()),f(l)}function f(e){return 1===(0,o.mg)(e)&&{id:(0,o.cr)(e)}}},66668:(e,a,t)=>{t.d(a,{S:()=>n});var r=t(2600);async function n(e,a){const{data:t}=await(0,r.c)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return t}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2259],{3615:(e,a,t)=>{t.d(a,{q:()=>n});var r=t(66668);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const t=this._serviceMetadatas.get(e);if(t)return t;const n=await(0,r.S)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:t}=this;if(t.has(a))return t.get(a);const r=await e.fetchData();return t.set(a,r),r}async fetchCustomParameters(e,a){const t=await this.fetchItemData(e);return t&&"object"==typeof t&&(a?a(t):t.customParameters)||null}}},50420:(e,a,t)=>{t.d(a,{S:()=>u});var r=t(47620),n=t(2600),s=t(20744),i=t(10860),l=t(48212),c=t(54872),o=t(9764);async function u(e,a){const t=(0,l.K0)(e);if(!t)throw new s.c("invalid-url","Invalid scene service url");const u={...a,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(u.sceneLayerItem??=await async function(e){const a=(await y(e)).serviceItemId;if(!a)return null;const t=new o.default({id:a,apiKey:e.apiKey}),s=await async function(e){const a=r.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.c)(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,i.CE)(e)}return null}(e);null!=s&&(t.portal=new c.c({url:s}));try{return t.load({signal:e.signal})}catch(e){return(0,i.CE)(e),null}}(u),null==u.sceneLayerItem)return d(u.sceneServerUrl.replace("/SceneServer","/FeatureServer"),u);const m=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const t=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!t)return null;const r=new o.default({portal:t.portal,id:t.id});return await r.load(),r}catch(e){return(0,i.CE)(e),null}}(u);if(!m?.url)throw new s.c("related-service-not-found","Could not find feature service through portal item relationship");u.featureServiceItem=m;const f=await d(m.url,u);return f.portalItem=m,f}async function y(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await(0,n.c)(e.sceneServerUrl,a);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const t=(0,l.K0)(e);if(!t)throw new s.c("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,i=a.layerId;if(null==i)return{serverUrl:r};const c=y(a),o=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,u=(o?.layers?.[0]||o?.tables?.[0])?.customParameters,d=e=>{const t={query:{f:"json",...u},responseType:"json",authMode:e,signal:a.signal};return(0,n.c)(r,t)},m=d("anonymous").catch((()=>d("no-prompt"))),[f,w]=await Promise.all([m,c]),p=w?.layers,h=f.data&&f.data.layers;if(!Array.isArray(h))throw new Error("expected layers array");if(Array.isArray(p)){for(let e=0;e<Math.min(p.length,h.length);e++)if(p[e].id===i)return{serverUrl:r,layerId:h[e].id}}else if(null!=i&&i<h.length)return{serverUrl:r,layerId:h[i].id};throw new Error("could not find matching associated sublayer")}},83928:(e,a,t)=>{t.d(a,{q:()=>r});const r={BingMapsLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3912)]).then(t.bind(t,48388))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(3180),t.e(9644),t.e(8344),t.e(9420),t.e(8644),t.e(5928)]).then(t.bind(t,10948))).default,CatalogLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(2664),t.e(2848),t.e(5468),t.e(572),t.e(2907)]).then(t.bind(t,20324))).default,CSVLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(1744)]).then(t.bind(t,79468))).default,DimensionLayer:async()=>(await Promise.all([t.e(5612),t.e(7832)]).then(t.bind(t,28320))).default,ElevationLayer:async()=>(await Promise.all([t.e(5612),t.e(2968),t.e(8380)]).then(t.bind(t,47104))).default,FeatureLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(8348)]).then(t.bind(t,672))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(6528)]).then(t.bind(t,92768))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(7988),t.e(7148),t.e(2672)]).then(t.bind(t,43984))).default,GroupLayer:async()=>(await Promise.all([t.e(5612),t.e(7456)]).then(t.bind(t,44080))).default,ImageryLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(2848),t.e(6128),t.e(9056),t.e(3291)]).then(t.bind(t,7896))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(6128),t.e(7048),t.e(9056),t.e(5496)]).then(t.bind(t,82744))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(5612),t.e(9644),t.e(7024)]).then(t.bind(t,96584))).default,KMLLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(236),t.e(9032)]).then(t.bind(t,53688))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(5612),t.e(3536)]).then(t.bind(t,91884))).default,LinkChartLayer:async()=>(await Promise.all([t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(9512),t.e(3220),t.e(4608),t.e(6680),t.e(8080)]).then(t.bind(t,54192))).default,MapImageLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(2848),t.e(5468),t.e(1248),t.e(3089)]).then(t.bind(t,3089))).default,MapNotesLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(9516)]).then(t.bind(t,37784))).default,MediaLayer:async()=>(await Promise.all([t.e(5612),t.e(2364)]).then(t.bind(t,66664))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(3160),t.e(8224)]).then(t.bind(t,56288))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3632),t.e(1244)]).then(t.bind(t,1244))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(1740)]).then(t.bind(t,75432))).default,PointCloudLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(9644),t.e(2296)]).then(t.bind(t,21680))).default,RouteLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(236),t.e(6352)]).then(t.bind(t,40900))).default,SceneLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(8624),t.e(3180),t.e(9644),t.e(8344),t.e(9420),t.e(7424),t.e(9780),t.e(8644),t.e(712)]).then(t.bind(t,3688))).default,StreamLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(3460)]).then(t.bind(t,18e3))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(2664),t.e(6556),t.e(5368),t.e(2608)]).then(t.bind(t,8444))).default,TileLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(2848),t.e(5468),t.e(2968),t.e(1248),t.e(0)]).then(t.bind(t,5e4))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([t.e(5612),t.e(7752)]).then(t.bind(t,71316))).default,UnknownLayer:async()=>(await t.e(6584).then(t.bind(t,56584))).default,UnsupportedLayer:async()=>(await t.e(2456).then(t.bind(t,12456))).default,VectorTileLayer:async()=>(await Promise.all([t.e(5612),t.e(2968),t.e(3780),t.e(6055),t.e(7936)]).then(t.bind(t,65632))).default,VoxelLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(9644),t.e(8256)]).then(t.bind(t,59496))).default,WFSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(9364),t.e(4984),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(4808),t.e(3688)]).then(t.bind(t,53440))).default,WMSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(7148),t.e(280)]).then(t.bind(t,85024))).default,WMTSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3632),t.e(4832)]).then(t.bind(t,54832))).default,WebTileLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3632)]).then(t.bind(t,32896))).default}},67632:(e,a,t)=>{t.d(a,{AX:()=>l,Ur:()=>y,cr:()=>i,eW:()=>s,k1:()=>o,mg:()=>c,oD:()=>d,qi:()=>n,wp:()=>u});var r=t(50420);function n(e){const a={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(a.layerType="OrientedImageryLayer"),a}async function s(e,a,t){if(null==e?.layers||null==e?.tables){const r=await t.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||r?.layers?.map(n),e.tables=e.tables||r?.tables?.map(n)}return e}function i(e){const{layers:a,tables:t}=e;return a?.length?a[0].id:t?.length?t[0].id:null}function l(e){if(!e)return null;const{layers:a,tables:t}=e;return a?.length?a[0]:t?.length?t[0]:null}function c(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function o(e){const a=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&a.push(e.id)})),a}function u(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}function y(e){return e?.layers?.filter((({layerType:e})=>"CatalogLayer"===e)).map((({id:e})=>e))}async function d(e,a,t){if(!e?.url)return a??{};if(a??={},!a.layers){const r=await t.fetchServiceMetadata(e.url);a.layers=r.layers?.map(n)}const{serverUrl:s,portalItem:i}=await(0,r.S)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==s)return a.tables=[],a;if(!a.tables&&i){const e=await i.fetchData();if(e?.tables)a.tables=e.tables.map(n);else{const r=await t.fetchServiceMetadata(s,{customParameters:l(e)?.customParameters});a.tables=r?.tables?.map(n)}}if(a.tables)for(const e of a.tables)e.url=`${s}/${e.id}`;return a}},12259:(e,a,t)=>{t.d(a,{fromItem:()=>y,q:()=>d});var r=t(20744),n=t(50420),s=t(3615),i=t(71068),l=t(83928),c=t(9764),o=t(67632),u=t(46940);async function y(e){!e.portalItem||e.portalItem instanceof c.default||(e={...e,portalItem:new c.default(e.portalItem)});const a=await async function(e){await e.load();const a=new s.q;return async function(e){const a=e.className,t=l.q[a];return{constructor:await t(),properties:e.properties}}(await d(e,a))}(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function d(e,a){switch(e.type){case"3DTiles Service":return{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,u._S)(e,"Map Notes"),t=(0,u._S)(e,"Markup");if(a||t)return{className:"MapNotesLayer"};if((0,u._S)(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return 1===(0,o.mg)(r)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const t=await m(e,a);if("object"==typeof t){const{sourceJSON:e,className:a}=t,r={sourceJSON:e};return null!=t.id&&(r.layerId=t.id),{className:a||"FeatureLayer",properties:r}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const t=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(t.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(t.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await a.fetchItemData(e),n=r?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),i=s.cacheType?.toLowerCase(),l=s.capabilities?.toLowerCase().includes("tilesonly");return"map"===i||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:t}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return t}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const t=await m(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:t}=await(0,n.S)(e.url,{sceneLayerItem:e}),r=await a.fetchServiceMetadata(t);return r?.tables??[]}catch{return[]}}));if("object"==typeof t){const r={};let n;if(null!=t.id?(r.layerId=t.id,n=`${e.url}/layers/${t.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(i.Wr))if(e.typeKeywords.includes(a))return{className:i.Wr[a]};const s=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.AX)(e)?.customParameters))});return{className:i.Wr[s?.layerType]||"SceneLayer",properties:r}}if(!1===t){const t=await a.fetchServiceMetadata(e.url);if("Voxel"===t?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new r.c("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function m(e,a,t){const{url:r,type:n}=e,s="Feature Service"===n;if(!r)return{};if(/\/\d+$/.test(r)){if(s){const t=await a.fetchServiceMetadata(r,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.AX)(e)?.customParameters))});if("Oriented Imagery Layer"===t.type)return{id:t.id,className:"OrientedImageryLayer",sourceJSON:t}}return{}}await e.load();let i=await a.fetchItemData(e);if(s){const e=await(0,o.eW)(i,r,a),t=f(e);if("object"==typeof t){const a=(0,o.k1)(e),r=(0,o.wp)(e),n=(0,o.Ur)(e);t.className=null!=t.id&&a.includes(t.id)?"SubtypeGroupLayer":null!=t.id&&r?.includes(t.id)?"OrientedImageryLayer":null!=t.id&&n?.includes(t.id)?"CatalogLayer":"FeatureLayer"}return t}if("Scene Service"===n&&(i=await(0,o.oD)(e,i,a)),(0,o.mg)(i)>0)return f(i);const l=await a.fetchServiceMetadata(r);return t&&(l.tables=await t()),f(l)}function f(e){return 1===(0,o.mg)(e)&&{id:(0,o.cr)(e)}}},66668:(e,a,t)=>{t.d(a,{S:()=>n});var r=t(2600);async function n(e,a){const{data:t}=await(0,r.c)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return t}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3163,8528],{8528:(e,t,s)=>{s.d(t,{c:()=>i,g:()=>n});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},11004:(e,t,s)=>{s.d(t,{o:()=>n});var i=s(74452);class n{constructor(e,t){this._storage=new i.kB,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,s=1){this._storage.put(this,e,t,s,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},74452:(e,t,s)=>{s.d(t,{ML:()=>o,kB:()=>a});var i,n,r=s(24680);(n=i||(i={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,s,i=0){this._storage.put(this,e,t,s,i)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new r.c,this._users=new r.c}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const s=this._db.get(e.id+t);return s?.size??0}put(e,t,s,n,r){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==s&&this._notifyRemove(t,o.entry,o.size,i.ALL)),n>this._maxSize)return void this._notifyRemove(t,s,n,i.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,s,0,i.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(t,new u(s,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,s,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===s){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,s,n,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},s=new Array;this._db.forEach(((e,i)=>{const n=e.lifetime;s[n]=(s[n]||0)+e.size,this._users.forAll((s=>{const{id:n,name:r}=s;if(i.startsWith(n)){const s=t[r]||0;t[r]=s+e.size}}))}));const i={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[s]||0;t[s]=n,i[s]=Math.round(100*e.hitRate)+"%"}else i[s]="0%"}));const n=Object.keys(t);n.sort(((e,s)=>t[s]-t[e])),n.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+i[s]));for(let t=s.length-1;t>=0;--t){const i=s[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,s,i){let n;return this._removeFuncs.some((r=>{if(e.startsWith(r[0])){const e=r[1](t,i,s);return"number"==typeof e&&(n=e),!0}return!1})),n}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const s=e?.id;let i=!0;for(;i;){i=!1;for(const[n,r]of this._db)if(0===r.lifetime&&(!s||n.startsWith(s))){if(this._purgeItem(n,r,e),t.size<=.9*t.maxSize)return;i||=this._db.has(n)}}for(const[i,n]of this._db)if((!s||i.startsWith(s))&&(this._purgeItem(i,n,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=n&&n>0&&(this._size+=n,s&&(s.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0;class u{constructor(e,t,s){this.entry=e,this.size=t,this.lifetime=s,this.lives=s}}},39180:(e,t,s)=>{function i(e){return null!=a(e)||null!=o(e)}function n(e){return l.test(e)}function r(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let s=!0;if(h&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,i=0;for(;!t&&i<=e.length;)t=!u.test(e[i]),i++;s=!t}}return s}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=l.exec(e);if(!t?.groups)return null;const s=t.groups,i=+s.year,n=+s.month-1,r=+s.day,o=+(s.hours??"0"),a=+(s.minutes??"0"),u=+(s.seconds??"0");if(o>23)return null;if(a>59)return null;if(u>59)return null;const h=s.ms??"0",c=h?+h.padEnd(3,"0").substring(0,3):0;let d;if(s.isUTC||!s.offsetSign)d=Date.UTC(i,n,r,o,a,u,c);else{const e=+s.offsetHours,t=+s.offsetMinutes;d=6e4*("+"===s.offsetSign?-1:1)*(60*e+t)+Date.UTC(i,n,r,o,a,u,c)}return Number.isNaN(d)?null:d}s.d(t,{H9:()=>i,_:()=>n,sn:()=>r});const l=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,u=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,h=!Number.isNaN(new Date("technology 10").getTime())},3024:(e,t,s)=>{s.d(t,{U:()=>o});var i=s(92400),n=s(24680),r=s(85304);class o{constructor(e=9,t){this._compareMinX=h,this._compareMinY=c,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),b.prune(),I.prune(),S.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(_(e,s))for(x.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;_(e,o)&&(s.leaf?t(r):y(e,o)?this._all(r,t):x.push(r))}s=x.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!_(e,t))return!1;for(x.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(_(e,r)){if(t.leaf||y(e,r))return!0;x.push(n)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new w([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(I.clear(),S.clear();s||I.length>0;){if(s||(s=I.pop(),n=I.data[I.length-1],r=S.pop()??0,o=!0),s.leaf&&(t=(0,i.IP)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),I.push(s),this._condense(I),this;o||s.leaf||!y(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(I.push(s),S.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(b.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else b.pushArray(s.children);s=b.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new w(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new B([]);o.height=i;const l=Math.ceil(n/r),u=l*Math.ceil(Math.sqrt(r));g(e,t,s,u,this._compareMinX);for(let n=t;n<=s;n+=u){const t=Math.min(n+u-1,s);g(e,n,t,l,this._compareMinY);for(let s=n;s<=t;s+=l){const n=Math.min(s+l-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=d(o),l=p(e,o)-a;l<n?(n=l,i=a<i?a:i,s=o):l===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);I.clear();const r=this._chooseSubtree(n,this._data,t,I);for(r.children.push(e),u(r,n);t>=0&&I.data[t].children.length>this._maxEntries;)this._split(I,t),t--;this._adjustParentBBoxes(n,I,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),l=s.leaf?new w(o):new B(o);l.height=s.height,a(s,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(s,l)}_splitRoot(e,t){this._data=new B([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,s,this._toBBox),u=m(t,a),h=d(t)+d(a);u<i?(i=u,r=o,n=h<n?h:n):u===i&&h<n&&(n=h,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:h,n=e.leaf?this._compareMinY:c;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=l(e,0,t,n),o=l(e,s-t,s,n);let a=f(r)+f(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=f(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=f(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.IP)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,s,i,n){n||(n=new w([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],u(n,e.leaf?i(r):r);return n}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function m(e,t){const s=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function y(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function g(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const x=new n.c,b=new n.c,I=new n.c,S=new n.c({deallocator:void 0});class v{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class M extends v{constructor(){super(...arguments),this.height=1,this.indexHint=new i.is}}class w extends M{constructor(e){super(),this.children=e,this.leaf=!0}}class B extends M{constructor(e){super(),this.children=e,this.leaf=!1}}},57896:(e,t,s)=>{s.d(t,{Eq:()=>d,KG:()=>_,_8:()=>y,_I:()=>u,aE:()=>l,du:()=>m,on:()=>c}),s(40196),s(2952);var i=s(60976),n=s(38912),r=s(70680),o=s(10860),a=s(37176);function l(e,t,s={}){return h(e,t,s,f)}function u(e,t,s={}){return h(e,t,s,p)}function h(e,t,s={},i){let n=null;const o=s.once?(e,s)=>{i(e)&&((0,r.oR)(n),t(e,s))}:(e,s)=>{i(e)&&t(e,s)};if(n=(0,a.M9)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return n}function c(e,t,s,o={}){let a=null,u=null,h=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.oR)(h),s(e)}const f=l(e,((e,s)=>{c(),(0,i.sh)(e)&&(a=e,u=(0,i.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,n.uU)((()=>{f.remove(),c()})),h}function d(e,t){return function(e,t,s){if((0,o.wv)(s))return Promise.reject((0,o.Uh)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,r.oR)(a)}return new Promise(((i,r)=>{a=(0,n.Ip)([(0,o.wD)(s,(()=>{l(),r((0,o.Uh)())})),h(e,(e=>{l(),i(e)}),{sync:!1,once:!0},t??f)])}))}(e,p,t)}function f(e){return!0}function p(e){return!!e}s(41168);const m={sync:!0},y={initial:!0},_={sync:!0,initial:!0}},20480:(e,t,s)=>{s.d(t,{WW:()=>S});var i=s(6220),n=s(20744),r=s(66360),o=s(7488),a=s(48516),l=s(44048),u=s(60544),h=s(29120),c=(s(60708),s(2600)),d=s(6704),f=s(21980),p=s(28176),m=s(81976);const y=()=>r.c.getLogger("esri.geometry.support.normalizeUtils");function _(e){return"polygon"===e[0].type}function g(e){return"polyline"===e[0].type}function x(e,t,s){if(t){const t=function(e,t){if(!(e instanceof a.c||e instanceof o.c)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw y().error(e),new n.c(e)}const s=(0,l.iM)(e),i=[];for(const e of s){const s=[];i.push(s),s.push([e[0][0],e[0][1]]);for(let i=0;i<e.length-1;i++){const n=e[i][0],r=e[i][1],o=e[i+1][0],a=e[i+1][1],l=Math.sqrt((o-n)*(o-n)+(a-r)*(a-r)),u=(a-r)/l,h=(o-n)/l,c=l/t;if(c>1){for(let e=1;e<=c-1;e++){const i=e*t,o=h*i+n,a=u*i+r;s.push([o,a])}const e=(l+Math.floor(c-1)*t)/2,i=h*e+n,o=u*e+r;s.push([i,o])}s.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new o.c({rings:i,spatialReference:e.spatialReference}):new a.c({paths:i,spatialReference:e.spatialReference})}(e,1e6);e=(0,h.aq)(t,!0)}return s&&(e=(0,l.wb)(e,s)),e}function b(e,t,s){if(Array.isArray(e)){const i=e[0];if(i>t){const s=(0,l.yK)(i,t);e[0]=i+s*(-2*t)}else if(i<s){const t=(0,l.yK)(i,s);e[0]=i+t*(-2*s)}}else{const i=e.x;if(i>t){const s=(0,l.yK)(i,t);e=e.clone().offset(s*(-2*t),0)}else if(i<s){const t=(0,l.yK)(i,s);e=e.clone().offset(t*(-2*s),0)}}return e}function I(e,t){let s=-1;for(let i=0;i<t.cutIndexes.length;i++){const n=t.cutIndexes[i],r=t.geometries[i],o=(0,l.iM)(r);for(let e=0;e<o.length;e++){const t=o[e];t.some((s=>{if(s[0]<180)return!0;{let s=0;for(let e=0;e<t.length;e++){const i=t[e][0];s=i>s?i:s}s=Number(s.toFixed(9));const i=-360*(0,l.yK)(s,180);for(let s=0;s<t.length;s++){const t=r.getPoint(e,s);r.setPoint(e,s,t.clone().offset(i,0))}return!0}}))}if(n===s){if(_(e))for(const t of(0,l.iM)(r))e[n]=e[n].addRing(t);else if(g(e))for(const t of(0,l.iM)(r))e[n]=e[n].addPath(t)}else s=n,e[n]=r}return e}async function S(e,t,s){if(!Array.isArray(e))return S([e],t);t&&"string"!=typeof t&&y().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??i.default.geometryServiceUrl;let r,_,g,v,M,w,B,z,F=0;const R=[],E=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,_=(0,u.Nq)(r),g=r.isWebMercator,w=g?102100:4326,v=l.Hh[w].maxX,M=l.Hh[w].minX,B=l.Hh[w].plus180Line,z=l.Hh[w].minus180Line),_)if("mesh"===t.type)E.push(t);else if("point"===t.type)E.push(b(t.clone(),v,M));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>b(e,v,M))),E.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,_);E.push(e.rings?new o.c(e):e)}else if(t.extent){const e=t.extent,s=(0,l.yK)(e.xmin,M)*(2*v);let i=0===s?t.clone():(0,l.wb)(t.clone(),s);e.offset(s,0),e.intersects(B)&&e.xmax!==v?(F=e.xmax>F?e.xmax:F,i=x(i,g),R.push(i),E.push("cut")):e.intersects(z)&&e.xmin!==M?(F=e.xmax*(2*v)>F?e.xmax*(2*v):F,i=x(i,g,360),R.push(i),E.push("cut")):E.push(i)}else E.push(t.clone());else E.push(t);else E.push(t);let T=(0,l.yK)(F,v),A=-90;const j=T,q=new a.c;for(;T>0;){const e=360*T-180;q.addPath([[e,A],[e,-1*A]]),A*=-1,T--}if(R.length>0&&j>0){const t=I(R,await async function(e,t,s,i){const n=(0,f.UX)(e),r=t[0].spatialReference,o={...i,responseType:"json",query:{...n.query,f:"json",sr:(0,u.um)(r),target:JSON.stringify({geometryType:(0,d.Ce)(t[0]),geometries:t}),cutter:JSON.stringify(s)}},a=await(0,c.c)(n.path+"/cut",o),{cutIndexes:l,geometries:h=[]}=a.data;return{cutIndexes:l,geometries:h.map((e=>{const t=(0,d.h4)(e);return t.spatialReference=r,t}))}}(n,R,q,s)),i=[],r=[];for(let s=0;s<E.length;s++){const n=E[s];if("cut"!==n)r.push(n);else{const n=t.shift(),o=e[s];null!=o&&"polygon"===o.type&&o.rings&&o.rings.length>1&&n.rings.length>=o.rings.length?(i.push(n),r.push("simplify")):r.push(g?(0,h.w7)(n):n)}}if(!i.length)return r;const o=await async function(e,t,s){const i="string"==typeof e?(0,p.as)(e):e,n=t[0].spatialReference,r=(0,d.Ce)(t[0]),o={...s,query:{...i.query,f:"json",sr:(0,u.um)(n),geometries:JSON.stringify((0,m.y)(t))}},{data:a}=await(0,c.c)(i.path+"/simplify",o);return(0,m.Q)(a.geometries,r,n)}(n,i,s),a=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?a.push(t):a.push(g?(0,h.w7)(o.shift()):o.shift())}return a}const X=[];for(let e=0;e<E.length;e++){const t=E[e];if("cut"!==t)X.push(t);else{const e=R.shift();X.push(!0===g?(0,h.w7)(e):e)}}return X}},44048:(e,t,s)=>{s.d(t,{Hh:()=>o,iM:()=>u,wb:()=>l,yK:()=>a});var i=s(48516),n=s(56156),r=s(6704);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.c({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator}),minus180Line:new i.c({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.c({paths:[[[180,-180],[180,180]]],spatialReference:n.c.WGS84}),minus180Line:new i.c({paths:[[[-180,-180],[-180,180]]],spatialReference:n.c.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const s=u(e);for(const e of s)for(const s of e)s[0]+=t;return e}function u(e){return(0,r.Cs)(e)?e.rings:e.paths}},6904:(e,t,s)=>{s.d(t,{c:()=>a});var i=s(9456),n=s(3024),r=s(83372);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.U(9,(0,i.c)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.FZ)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9107:(e,t,s)=>{s.d(t,{c:()=>p});var i=s(92400),n=s(20744),r=s(77860),o=s(66360),a=s(77048),l=s(83372),u=s(97088),h=s(6904),c=s(83624),d=s(51752);const f=(0,a.Su)();class p{constructor(e){this.geometryInfo=e,this._boundsStore=new h.c,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.c,this.featureAdapter=d.u}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,c.C6)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.G6)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.Qv)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.C_)(null!=i?i:(0,l.Su)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.C_)((0,l.Su)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},46019:(e,t,s)=>{s.d(t,{A:()=>n,q:()=>i});const i=1;function n(e,t){let s=0;for(const i of t){const t=i.attributes?.[e];"number"==typeof t&&isFinite(t)&&(s=Math.max(s,t))}return s}},48784:(e,t,s)=>{s.r(t),s.d(t,{default:()=>S});var i=s(20744),n=s(6704),r=s(60544),o=s(97088),a=s(46019),l=s(9107),u=s(7684),h=s(47302),c=s(17724),d=s(49372),f=s(16424),p=s(36408),m=s(564),y=s(28484);const _=r.UH,g={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:r.UH},x={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};function b(e){return(0,n._x)(e)?null!=e.z:!!e.hasZ}function I(e){return(0,n._x)(e)?null!=e.m:!!e.hasM}class S{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const t=[],{features:s}=e,n=this._inferLayerProperties(s,e.fields),r=e.fields||[],o=null!=e.hasM?e.hasM:!!n.hasM,d=null!=e.hasZ?e.hasZ:!!n.hasZ,b=!e.spatialReference&&!n.spatialReference,I=b?_:e.spatialReference||n.spatialReference,S=b?g:null,v=e.geometryType||n.geometryType,M=!v;let w=e.objectIdField||n.objectIdField,B=e.timeInfo;const z=new f.c(r);if(!M&&(b&&t.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!v))throw new i.c("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!w)throw new i.c("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&w!==n.objectIdField&&(t.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${w}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),w=n.objectIdField),w&&!n.objectIdField){const e=z.get(w);e?(w=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):r.unshift({alias:w,name:w,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const e of r){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),!e.name)throw new i.c("feature-layer:invalid-field-name","field name is missing",{field:e});if(e.name===w&&(e.type="esriFieldTypeOID"),!p.M.jsonValues.includes(e.type))throw new i.c("feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e});null==e.length&&(e.length=(0,m.G0)(e))}const F={};for(const e of r)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=(0,m.gB)(e);void 0!==t&&(F[e.name]=t)}if(B){if(B.startTimeField){const e=z.get(B.startTimeField);e?(B.startTimeField=e.name,e.type="esriFieldTypeDate"):B.startTimeField=null}if(B.endTimeField){const e=z.get(B.endTimeField);e?(B.endTimeField=e.name,e.type="esriFieldTypeDate"):B.endTimeField=null}if(B.trackIdField){const e=z.get(B.trackIdField);e?B.trackIdField=e.name:(B.trackIdField=null,t.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:B}}))}B.startTimeField||B.endTimeField||(t.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:B}}),B=null)}const R=z.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??y.Gw}:null;this._createDefaultAttributes=(0,c.GA)(F,w);const E={warnings:t,featureErrors:[],layerDefinition:{...x,drawingInfo:(0,c.w7)(v),templates:(0,c.QD)(F),extent:S,geometryType:v,objectIdField:w,fields:r,hasZ:d,hasM:o,timeInfo:B,dateFieldsTimeReference:R},assignedObjectIds:{}};if(this._queryEngine=new h.U({fieldsIndex:f.c.fromLayerJSON({fields:r,timeInfo:B,dateFieldsTimeReference:R}),geometryType:v,hasM:o,hasZ:d,objectIdField:w,spatialReference:I,featureStore:new l.c({geometryType:v,hasM:o,hasZ:d}),timeInfo:B,cacheSpatialQueries:!0}),!s?.length)return this._nextObjectId=a.q,E;const T=(0,a.A)(w,s);return this._nextObjectId=T+1,await(0,u.Qv)(s,I),this._loadInitialFeatures(E,s)}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([(0,d.Oo)(t,s),(0,u.Qv)(e.adds,t),(0,u.Qv)(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}_inferLayerProperties(e,t){let s,i,r=null,o=null,a=null;for(const t of e){const e=t.geometry;if(null!=e&&(r||(r=(0,n.Ce)(e)),o||(o=e.spatialReference),null==s&&(s=b(e)),null==i&&(i=I(e)),r&&o&&null!=s&&null!=i))break}if(t&&t.length){let e=null;t.some((t=>{const s="esriFieldTypeOID"===t.type,i=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,s||i}))&&(a=e.name)}return{geometryType:r,spatialReference:o,objectIdField:a,hasM:i,hasZ:s}}async _loadInitialFeatures(e,t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:a,spatialReference:l,featureStore:h,fieldsIndex:c}=this._queryEngine,f=[];for(const i of t){if(null!=i.uid&&(e.assignedObjectIds[i.uid]=-1),i.geometry&&s!==(0,n.Ce)(i.geometry)){e.featureErrors.push((0,d.or)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=(0,d.uo)(c,t,i.attributes,!0);r?e.featureErrors.push(r):(this._assignObjectId(t,i.attributes,!0),i.attributes=t,null!=i.uid&&(e.assignedObjectIds[i.uid]=i.attributes[a]),null!=i.geometry&&(i.geometry=(0,u.yU)(i.geometry,i.geometry.spatialReference,l)),f.push(i))}h.addMany((0,o.od)([],f,s,r,i,a));const{fullExtent:p,timeExtent:m}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=p,m){const{start:t,end:s}=m;e.layerDefinition.timeInfo.timeExtent=[t,s]}return e}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,n={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(n,t),s?.length&&this._applyUpdateEdits(n,s),i?.length){for(const e of i)n.deleteResults.push((0,d.GI)(e));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:r,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();return{extent:r,timeExtent:o,featureEditResults:n}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:a,objectIdField:l,spatialReference:h,featureStore:c,fieldsIndex:f}=this._queryEngine,p=[];for(const r of t){if(r.geometry&&i!==(0,n.Ce)(r.geometry)){s.push((0,d.or)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),o=(0,d.uo)(f,t,r.attributes);if(o)s.push(o);else{if(this._assignObjectId(t,r.attributes),r.attributes=t,null!=r.uid){const t=r.attributes[l];e.uidToObjectId[r.uid]=t}if(null!=r.geometry){const e=r.geometry.spatialReference??h;r.geometry=(0,u.yU)((0,d.OM)(r.geometry,e),e,h)}p.push(r),s.push((0,d.GI)(r.attributes[l]))}}c.addMany((0,o.od)([],p,i,a,r,l))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:a,spatialReference:l,featureStore:h,fieldsIndex:c}=this._queryEngine;for(const f of t){const{attributes:t,geometry:p}=f,m=t?.[a];if(null==m){e.push((0,d.or)(`Identifier field ${a} missing`));continue}if(!h.has(m)){e.push((0,d.or)(`Feature with object id ${m} missing`));continue}const y=(0,o.G0)(h.getFeature(m),s,r,i);if(null!=p){if(s!==(0,n.Ce)(p)){e.push((0,d.or)("Incorrect geometry type."));continue}const t=p.spatialReference??l;y.geometry=(0,u.yU)((0,d.OM)(p,t),t,l)}if(t){const s=(0,d.uo)(c,y.attributes,t);if(s){e.push(s);continue}}h.add((0,o.ye)(y,s,r,i,a)),e.push((0,d.GI)(m))}}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;s&&t&&isFinite(t[i])?e[i]=t[i]:e[i]=this._nextObjectId++}}},17724:(e,t,s)=>{s.d(t,{G4:()=>d,GA:()=>h,QD:()=>c,w7:()=>a});var i=s(9456),n=s(62088),r=s(13136),o=s(9504);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.qe:"esriGeometryPolyline"===e?o.MZ:o.yq}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function h(e,t){if((0,i.c)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let s=`this.${t} = null;`;for(const t in e)s+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const i=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${s};\n }\n }\n `)();return()=>new i}catch(s){return()=>({[t]:null,...e})}}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,n.ct)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r.u,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},49372:(e,t,s)=>{s.d(t,{GI:()=>h,OM:()=>m,Oo:()=>y,or:()=>l,uo:()=>d});var i=s(39180),n=s(60544),r=s(564);class o{constructor(){this.code=null,this.description=null}}class a{constructor(e){this.error=new o,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}}function l(e){return new a(e)}class u{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function h(e){return new u(e)}const c=new Set;function d(e,t,s,i=!1){c.clear();for(const n in s){const o=e.get(n);if(!o)continue;const a=f(o,s[n]);if(c.add(o.name),o&&(i||o.editable)){const e=(0,r.YT)(o,a);if(e)return l((0,r.Ke)(e,o,a));t[o.name]=a}}for(const t of e?.requiredFields??[])if(!c.has(t.name))return l(`missing required field "${t.name}"`);return null}function f(e,t){let s=t;return(0,r.iW)(e)&&"string"==typeof t?s=parseFloat(t):(0,r.AZ)(e)&&null!=t&&"string"!=typeof t?s=String(t):(0,r.gp)(e)&&"string"==typeof t&&(s=(0,i.sn)(t)),(0,r.OJ)(s)}let p;function m(e,t){if(!e||!(0,n.U3)(t))return e;if("rings"in e||"paths"in e){if(null==p)throw new TypeError("geometry engine not loaded");return p.simplify(t,e)}return e}async function y(e,t){!(0,n.U3)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==p&&(p=await Promise.all([s.e(984),s.e(2704)]).then(s.bind(s,82704))),p}()}},81976:(e,t,s)=>{s.d(t,{Q:()=>r,y:()=>n});var i=s(6704);function n(e){return{geometryType:(0,i.Ce)(e[0]),geometries:e.map((e=>e.toJSON()))}}function r(e,t,s){const n=(0,i.uG)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=s,t}))}},21980:(e,t,s)=>{s.d(t,{OW:()=>a,UX:()=>o,sR:()=>r}),s(6220),s(47620);var i=s(62088),n=s(28176);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function o(e){return"string"==typeof e?(0,n.as)(e):(0,i.ct)(e)}function a(e,t,s){const i={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))i[n]=r.map((e=>a({item:e},t,s).item));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(s?.[n]);i[n]=t?e:JSON.stringify(e)}else i[n]=t?r:JSON.stringify(r);else i[n]=r}return i}s(20572)},9504:(e,t,s)=>{s.d(t,{MZ:()=>r,aV:()=>u,gF:()=>a,gP:()=>l,qe:()=>n,wp:()=>h,yq:()=>o});const i=[252,146,31,255],n={type:"esriSMS",style:"esriSMSCircle",size:6,color:i,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},r={type:"esriSLS",style:"esriSLSSolid",width:.75,color:i},o={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},h={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3163,8528],{8528:(e,t,s)=>{s.d(t,{c:()=>i,g:()=>n});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},11004:(e,t,s)=>{s.d(t,{o:()=>n});var i=s(74452);class n{constructor(e,t){this._storage=new i.kB,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,s=1){this._storage.put(this,e,t,s,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},74452:(e,t,s)=>{s.d(t,{ML:()=>o,kB:()=>a});var i,n,r=s(24680);(n=i||(i={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,s,i=0){this._storage.put(this,e,t,s,i)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new r.c,this._users=new r.c}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const s=this._db.get(e.id+t);return s?.size??0}put(e,t,s,n,r){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==s&&this._notifyRemove(t,o.entry,o.size,i.ALL)),n>this._maxSize)return void this._notifyRemove(t,s,n,i.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,s,0,i.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(t,new u(s,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,s,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===s){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,s,n,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},s=new Array;this._db.forEach(((e,i)=>{const n=e.lifetime;s[n]=(s[n]||0)+e.size,this._users.forAll((s=>{const{id:n,name:r}=s;if(i.startsWith(n)){const s=t[r]||0;t[r]=s+e.size}}))}));const i={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[s]||0;t[s]=n,i[s]=Math.round(100*e.hitRate)+"%"}else i[s]="0%"}));const n=Object.keys(t);n.sort(((e,s)=>t[s]-t[e])),n.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+i[s]));for(let t=s.length-1;t>=0;--t){const i=s[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,s,i){let n;return this._removeFuncs.some((r=>{if(e.startsWith(r[0])){const e=r[1](t,i,s);return"number"==typeof e&&(n=e),!0}return!1})),n}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const s=e?.id;let i=!0;for(;i;){i=!1;for(const[n,r]of this._db)if(0===r.lifetime&&(!s||n.startsWith(s))){if(this._purgeItem(n,r,e),t.size<=.9*t.maxSize)return;i||=this._db.has(n)}}for(const[i,n]of this._db)if((!s||i.startsWith(s))&&(this._purgeItem(i,n,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=n&&n>0&&(this._size+=n,s&&(s.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0;class u{constructor(e,t,s){this.entry=e,this.size=t,this.lifetime=s,this.lives=s}}},39180:(e,t,s)=>{function i(e){return null!=a(e)||null!=o(e)}function n(e){return l.test(e)}function r(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let s=!0;if(h&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,i=0;for(;!t&&i<=e.length;)t=!u.test(e[i]),i++;s=!t}}return s}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=l.exec(e);if(!t?.groups)return null;const s=t.groups,i=+s.year,n=+s.month-1,r=+s.day,o=+(s.hours??"0"),a=+(s.minutes??"0"),u=+(s.seconds??"0");if(o>23)return null;if(a>59)return null;if(u>59)return null;const h=s.ms??"0",c=h?+h.padEnd(3,"0").substring(0,3):0;let d;if(s.isUTC||!s.offsetSign)d=Date.UTC(i,n,r,o,a,u,c);else{const e=+s.offsetHours,t=+s.offsetMinutes;d=6e4*("+"===s.offsetSign?-1:1)*(60*e+t)+Date.UTC(i,n,r,o,a,u,c)}return Number.isNaN(d)?null:d}s.d(t,{H9:()=>i,_:()=>n,sn:()=>r});const l=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,u=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,h=!Number.isNaN(new Date("technology 10").getTime())},3024:(e,t,s)=>{s.d(t,{U:()=>o});var i=s(92400),n=s(24680),r=s(85304);class o{constructor(e=9,t){this._compareMinX=h,this._compareMinY=c,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),b.prune(),I.prune(),S.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(_(e,s))for(x.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;_(e,o)&&(s.leaf?t(r):y(e,o)?this._all(r,t):x.push(r))}s=x.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!_(e,t))return!1;for(x.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(_(e,r)){if(t.leaf||y(e,r))return!0;x.push(n)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new w([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(I.clear(),S.clear();s||I.length>0;){if(s||(s=I.pop(),n=I.data[I.length-1],r=S.pop()??0,o=!0),s.leaf&&(t=(0,i.IP)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),I.push(s),this._condense(I),this;o||s.leaf||!y(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(I.push(s),S.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(b.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else b.pushArray(s.children);s=b.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new w(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new B([]);o.height=i;const l=Math.ceil(n/r),u=l*Math.ceil(Math.sqrt(r));g(e,t,s,u,this._compareMinX);for(let n=t;n<=s;n+=u){const t=Math.min(n+u-1,s);g(e,n,t,l,this._compareMinY);for(let s=n;s<=t;s+=l){const n=Math.min(s+l-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=d(o),l=p(e,o)-a;l<n?(n=l,i=a<i?a:i,s=o):l===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);I.clear();const r=this._chooseSubtree(n,this._data,t,I);for(r.children.push(e),u(r,n);t>=0&&I.data[t].children.length>this._maxEntries;)this._split(I,t),t--;this._adjustParentBBoxes(n,I,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),l=s.leaf?new w(o):new B(o);l.height=s.height,a(s,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(s,l)}_splitRoot(e,t){this._data=new B([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,s,this._toBBox),u=m(t,a),h=d(t)+d(a);u<i?(i=u,r=o,n=h<n?h:n):u===i&&h<n&&(n=h,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:h,n=e.leaf?this._compareMinY:c;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=l(e,0,t,n),o=l(e,s-t,s,n);let a=f(r)+f(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=f(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=f(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.IP)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,s,i,n){n||(n=new w([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],u(n,e.leaf?i(r):r);return n}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function m(e,t){const s=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function y(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function g(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const x=new n.c,b=new n.c,I=new n.c,S=new n.c({deallocator:void 0});class v{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class M extends v{constructor(){super(...arguments),this.height=1,this.indexHint=new i.is}}class w extends M{constructor(e){super(),this.children=e,this.leaf=!0}}class B extends M{constructor(e){super(),this.children=e,this.leaf=!1}}},57896:(e,t,s)=>{s.d(t,{Eq:()=>d,KG:()=>_,_8:()=>y,_I:()=>u,aE:()=>l,du:()=>m,on:()=>c}),s(40196),s(2952);var i=s(60976),n=s(38912),r=s(70680),o=s(10860),a=s(37176);function l(e,t,s={}){return h(e,t,s,f)}function u(e,t,s={}){return h(e,t,s,p)}function h(e,t,s={},i){let n=null;const o=s.once?(e,s)=>{i(e)&&((0,r.oR)(n),t(e,s))}:(e,s)=>{i(e)&&t(e,s)};if(n=(0,a.M9)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return n}function c(e,t,s,o={}){let a=null,u=null,h=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.oR)(h),s(e)}const f=l(e,((e,s)=>{c(),(0,i.sh)(e)&&(a=e,u=(0,i.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,n.uU)((()=>{f.remove(),c()})),h}function d(e,t){return function(e,t,s){if((0,o.wv)(s))return Promise.reject((0,o.Uh)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,r.oR)(a)}return new Promise(((i,r)=>{a=(0,n.Ip)([(0,o.wD)(s,(()=>{l(),r((0,o.Uh)())})),h(e,(e=>{l(),i(e)}),{sync:!1,once:!0},t??f)])}))}(e,p,t)}function f(e){return!0}function p(e){return!!e}s(41168);const m={sync:!0},y={initial:!0},_={sync:!0,initial:!0}},20480:(e,t,s)=>{s.d(t,{WW:()=>S});var i=s(6220),n=s(20744),r=s(66360),o=s(7488),a=s(48516),l=s(44048),u=s(60544),h=s(29120),c=(s(60708),s(2600)),d=s(6704),f=s(21980),p=s(28176),m=s(81976);const y=()=>r.c.getLogger("esri.geometry.support.normalizeUtils");function _(e){return"polygon"===e[0].type}function g(e){return"polyline"===e[0].type}function x(e,t,s){if(t){const t=function(e,t){if(!(e instanceof a.c||e instanceof o.c)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw y().error(e),new n.c(e)}const s=(0,l.iM)(e),i=[];for(const e of s){const s=[];i.push(s),s.push([e[0][0],e[0][1]]);for(let i=0;i<e.length-1;i++){const n=e[i][0],r=e[i][1],o=e[i+1][0],a=e[i+1][1],l=Math.sqrt((o-n)*(o-n)+(a-r)*(a-r)),u=(a-r)/l,h=(o-n)/l,c=l/t;if(c>1){for(let e=1;e<=c-1;e++){const i=e*t,o=h*i+n,a=u*i+r;s.push([o,a])}const e=(l+Math.floor(c-1)*t)/2,i=h*e+n,o=u*e+r;s.push([i,o])}s.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new o.c({rings:i,spatialReference:e.spatialReference}):new a.c({paths:i,spatialReference:e.spatialReference})}(e,1e6);e=(0,h.aq)(t,!0)}return s&&(e=(0,l.wb)(e,s)),e}function b(e,t,s){if(Array.isArray(e)){const i=e[0];if(i>t){const s=(0,l.yK)(i,t);e[0]=i+s*(-2*t)}else if(i<s){const t=(0,l.yK)(i,s);e[0]=i+t*(-2*s)}}else{const i=e.x;if(i>t){const s=(0,l.yK)(i,t);e=e.clone().offset(s*(-2*t),0)}else if(i<s){const t=(0,l.yK)(i,s);e=e.clone().offset(t*(-2*s),0)}}return e}function I(e,t){let s=-1;for(let i=0;i<t.cutIndexes.length;i++){const n=t.cutIndexes[i],r=t.geometries[i],o=(0,l.iM)(r);for(let e=0;e<o.length;e++){const t=o[e];t.some((s=>{if(s[0]<180)return!0;{let s=0;for(let e=0;e<t.length;e++){const i=t[e][0];s=i>s?i:s}s=Number(s.toFixed(9));const i=-360*(0,l.yK)(s,180);for(let s=0;s<t.length;s++){const t=r.getPoint(e,s);r.setPoint(e,s,t.clone().offset(i,0))}return!0}}))}if(n===s){if(_(e))for(const t of(0,l.iM)(r))e[n]=e[n].addRing(t);else if(g(e))for(const t of(0,l.iM)(r))e[n]=e[n].addPath(t)}else s=n,e[n]=r}return e}async function S(e,t,s){if(!Array.isArray(e))return S([e],t);t&&"string"!=typeof t&&y().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??i.default.geometryServiceUrl;let r,_,g,v,M,w,B,z,F=0;const R=[],E=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,_=(0,u.Nq)(r),g=r.isWebMercator,w=g?102100:4326,v=l.Hh[w].maxX,M=l.Hh[w].minX,B=l.Hh[w].plus180Line,z=l.Hh[w].minus180Line),_)if("mesh"===t.type)E.push(t);else if("point"===t.type)E.push(b(t.clone(),v,M));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>b(e,v,M))),E.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,_);E.push(e.rings?new o.c(e):e)}else if(t.extent){const e=t.extent,s=(0,l.yK)(e.xmin,M)*(2*v);let i=0===s?t.clone():(0,l.wb)(t.clone(),s);e.offset(s,0),e.intersects(B)&&e.xmax!==v?(F=e.xmax>F?e.xmax:F,i=x(i,g),R.push(i),E.push("cut")):e.intersects(z)&&e.xmin!==M?(F=e.xmax*(2*v)>F?e.xmax*(2*v):F,i=x(i,g,360),R.push(i),E.push("cut")):E.push(i)}else E.push(t.clone());else E.push(t);else E.push(t);let T=(0,l.yK)(F,v),A=-90;const j=T,q=new a.c;for(;T>0;){const e=360*T-180;q.addPath([[e,A],[e,-1*A]]),A*=-1,T--}if(R.length>0&&j>0){const t=I(R,await async function(e,t,s,i){const n=(0,f.UX)(e),r=t[0].spatialReference,o={...i,responseType:"json",query:{...n.query,f:"json",sr:(0,u.um)(r),target:JSON.stringify({geometryType:(0,d.Ce)(t[0]),geometries:t}),cutter:JSON.stringify(s)}},a=await(0,c.c)(n.path+"/cut",o),{cutIndexes:l,geometries:h=[]}=a.data;return{cutIndexes:l,geometries:h.map((e=>{const t=(0,d.h4)(e);return t.spatialReference=r,t}))}}(n,R,q,s)),i=[],r=[];for(let s=0;s<E.length;s++){const n=E[s];if("cut"!==n)r.push(n);else{const n=t.shift(),o=e[s];null!=o&&"polygon"===o.type&&o.rings&&o.rings.length>1&&n.rings.length>=o.rings.length?(i.push(n),r.push("simplify")):r.push(g?(0,h.w7)(n):n)}}if(!i.length)return r;const o=await async function(e,t,s){const i="string"==typeof e?(0,p.as)(e):e,n=t[0].spatialReference,r=(0,d.Ce)(t[0]),o={...s,query:{...i.query,f:"json",sr:(0,u.um)(n),geometries:JSON.stringify((0,m.y)(t))}},{data:a}=await(0,c.c)(i.path+"/simplify",o);return(0,m.Q)(a.geometries,r,n)}(n,i,s),a=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?a.push(t):a.push(g?(0,h.w7)(o.shift()):o.shift())}return a}const X=[];for(let e=0;e<E.length;e++){const t=E[e];if("cut"!==t)X.push(t);else{const e=R.shift();X.push(!0===g?(0,h.w7)(e):e)}}return X}},44048:(e,t,s)=>{s.d(t,{Hh:()=>o,iM:()=>u,wb:()=>l,yK:()=>a});var i=s(48516),n=s(56156),r=s(6704);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.c({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator}),minus180Line:new i.c({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.c({paths:[[[180,-180],[180,180]]],spatialReference:n.c.WGS84}),minus180Line:new i.c({paths:[[[-180,-180],[-180,180]]],spatialReference:n.c.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const s=u(e);for(const e of s)for(const s of e)s[0]+=t;return e}function u(e){return(0,r.Cs)(e)?e.rings:e.paths}},6904:(e,t,s)=>{s.d(t,{c:()=>a});var i=s(9456),n=s(3024),r=s(83372);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.U(9,(0,i.c)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.FZ)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9107:(e,t,s)=>{s.d(t,{c:()=>p});var i=s(92400),n=s(20744),r=s(77860),o=s(66360),a=s(77048),l=s(83372),u=s(97088),h=s(6904),c=s(83624),d=s(16736);const f=(0,a.Su)();class p{constructor(e){this.geometryInfo=e,this._boundsStore=new h.c,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.c,this.featureAdapter=d.u}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,c.C6)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.G6)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.Qv)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.C_)(null!=i?i:(0,l.Su)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.C_)((0,l.Su)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},46019:(e,t,s)=>{s.d(t,{A:()=>n,q:()=>i});const i=1;function n(e,t){let s=0;for(const i of t){const t=i.attributes?.[e];"number"==typeof t&&isFinite(t)&&(s=Math.max(s,t))}return s}},48784:(e,t,s)=>{s.r(t),s.d(t,{default:()=>S});var i=s(20744),n=s(6704),r=s(60544),o=s(97088),a=s(46019),l=s(9107),u=s(7684),h=s(47302),c=s(17724),d=s(49372),f=s(16424),p=s(36408),m=s(564),y=s(28484);const _=r.UH,g={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:r.UH},x={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};function b(e){return(0,n._x)(e)?null!=e.z:!!e.hasZ}function I(e){return(0,n._x)(e)?null!=e.m:!!e.hasM}class S{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const t=[],{features:s}=e,n=this._inferLayerProperties(s,e.fields),r=e.fields||[],o=null!=e.hasM?e.hasM:!!n.hasM,d=null!=e.hasZ?e.hasZ:!!n.hasZ,b=!e.spatialReference&&!n.spatialReference,I=b?_:e.spatialReference||n.spatialReference,S=b?g:null,v=e.geometryType||n.geometryType,M=!v;let w=e.objectIdField||n.objectIdField,B=e.timeInfo;const z=new f.c(r);if(!M&&(b&&t.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!v))throw new i.c("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!w)throw new i.c("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&w!==n.objectIdField&&(t.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${w}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),w=n.objectIdField),w&&!n.objectIdField){const e=z.get(w);e?(w=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):r.unshift({alias:w,name:w,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const e of r){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),!e.name)throw new i.c("feature-layer:invalid-field-name","field name is missing",{field:e});if(e.name===w&&(e.type="esriFieldTypeOID"),!p.M.jsonValues.includes(e.type))throw new i.c("feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e});null==e.length&&(e.length=(0,m.G0)(e))}const F={};for(const e of r)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=(0,m.gB)(e);void 0!==t&&(F[e.name]=t)}if(B){if(B.startTimeField){const e=z.get(B.startTimeField);e?(B.startTimeField=e.name,e.type="esriFieldTypeDate"):B.startTimeField=null}if(B.endTimeField){const e=z.get(B.endTimeField);e?(B.endTimeField=e.name,e.type="esriFieldTypeDate"):B.endTimeField=null}if(B.trackIdField){const e=z.get(B.trackIdField);e?B.trackIdField=e.name:(B.trackIdField=null,t.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:B}}))}B.startTimeField||B.endTimeField||(t.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:B}}),B=null)}const R=z.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??y.Gw}:null;this._createDefaultAttributes=(0,c.GA)(F,w);const E={warnings:t,featureErrors:[],layerDefinition:{...x,drawingInfo:(0,c.w7)(v),templates:(0,c.QD)(F),extent:S,geometryType:v,objectIdField:w,fields:r,hasZ:d,hasM:o,timeInfo:B,dateFieldsTimeReference:R},assignedObjectIds:{}};if(this._queryEngine=new h.U({fieldsIndex:f.c.fromLayerJSON({fields:r,timeInfo:B,dateFieldsTimeReference:R}),geometryType:v,hasM:o,hasZ:d,objectIdField:w,spatialReference:I,featureStore:new l.c({geometryType:v,hasM:o,hasZ:d}),timeInfo:B,cacheSpatialQueries:!0}),!s?.length)return this._nextObjectId=a.q,E;const T=(0,a.A)(w,s);return this._nextObjectId=T+1,await(0,u.Qv)(s,I),this._loadInitialFeatures(E,s)}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([(0,d.Oo)(t,s),(0,u.Qv)(e.adds,t),(0,u.Qv)(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}_inferLayerProperties(e,t){let s,i,r=null,o=null,a=null;for(const t of e){const e=t.geometry;if(null!=e&&(r||(r=(0,n.Ce)(e)),o||(o=e.spatialReference),null==s&&(s=b(e)),null==i&&(i=I(e)),r&&o&&null!=s&&null!=i))break}if(t&&t.length){let e=null;t.some((t=>{const s="esriFieldTypeOID"===t.type,i=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,s||i}))&&(a=e.name)}return{geometryType:r,spatialReference:o,objectIdField:a,hasM:i,hasZ:s}}async _loadInitialFeatures(e,t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:a,spatialReference:l,featureStore:h,fieldsIndex:c}=this._queryEngine,f=[];for(const i of t){if(null!=i.uid&&(e.assignedObjectIds[i.uid]=-1),i.geometry&&s!==(0,n.Ce)(i.geometry)){e.featureErrors.push((0,d.or)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=(0,d.uo)(c,t,i.attributes,!0);r?e.featureErrors.push(r):(this._assignObjectId(t,i.attributes,!0),i.attributes=t,null!=i.uid&&(e.assignedObjectIds[i.uid]=i.attributes[a]),null!=i.geometry&&(i.geometry=(0,u.yU)(i.geometry,i.geometry.spatialReference,l)),f.push(i))}h.addMany((0,o.od)([],f,s,r,i,a));const{fullExtent:p,timeExtent:m}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=p,m){const{start:t,end:s}=m;e.layerDefinition.timeInfo.timeExtent=[t,s]}return e}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,n={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(n,t),s?.length&&this._applyUpdateEdits(n,s),i?.length){for(const e of i)n.deleteResults.push((0,d.GI)(e));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:r,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();return{extent:r,timeExtent:o,featureEditResults:n}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:a,objectIdField:l,spatialReference:h,featureStore:c,fieldsIndex:f}=this._queryEngine,p=[];for(const r of t){if(r.geometry&&i!==(0,n.Ce)(r.geometry)){s.push((0,d.or)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),o=(0,d.uo)(f,t,r.attributes);if(o)s.push(o);else{if(this._assignObjectId(t,r.attributes),r.attributes=t,null!=r.uid){const t=r.attributes[l];e.uidToObjectId[r.uid]=t}if(null!=r.geometry){const e=r.geometry.spatialReference??h;r.geometry=(0,u.yU)((0,d.OM)(r.geometry,e),e,h)}p.push(r),s.push((0,d.GI)(r.attributes[l]))}}c.addMany((0,o.od)([],p,i,a,r,l))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:a,spatialReference:l,featureStore:h,fieldsIndex:c}=this._queryEngine;for(const f of t){const{attributes:t,geometry:p}=f,m=t?.[a];if(null==m){e.push((0,d.or)(`Identifier field ${a} missing`));continue}if(!h.has(m)){e.push((0,d.or)(`Feature with object id ${m} missing`));continue}const y=(0,o.G0)(h.getFeature(m),s,r,i);if(null!=p){if(s!==(0,n.Ce)(p)){e.push((0,d.or)("Incorrect geometry type."));continue}const t=p.spatialReference??l;y.geometry=(0,u.yU)((0,d.OM)(p,t),t,l)}if(t){const s=(0,d.uo)(c,y.attributes,t);if(s){e.push(s);continue}}h.add((0,o.ye)(y,s,r,i,a)),e.push((0,d.GI)(m))}}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;s&&t&&isFinite(t[i])?e[i]=t[i]:e[i]=this._nextObjectId++}}},17724:(e,t,s)=>{s.d(t,{G4:()=>d,GA:()=>h,QD:()=>c,w7:()=>a});var i=s(9456),n=s(62088),r=s(13136),o=s(9504);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.qe:"esriGeometryPolyline"===e?o.MZ:o.yq}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function h(e,t){if((0,i.c)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let s=`this.${t} = null;`;for(const t in e)s+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const i=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${s};\n }\n }\n `)();return()=>new i}catch(s){return()=>({[t]:null,...e})}}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,n.ct)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r.u,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},49372:(e,t,s)=>{s.d(t,{GI:()=>h,OM:()=>m,Oo:()=>y,or:()=>l,uo:()=>d});var i=s(39180),n=s(60544),r=s(564);class o{constructor(){this.code=null,this.description=null}}class a{constructor(e){this.error=new o,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}}function l(e){return new a(e)}class u{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function h(e){return new u(e)}const c=new Set;function d(e,t,s,i=!1){c.clear();for(const n in s){const o=e.get(n);if(!o)continue;const a=f(o,s[n]);if(c.add(o.name),o&&(i||o.editable)){const e=(0,r.YT)(o,a);if(e)return l((0,r.Ke)(e,o,a));t[o.name]=a}}for(const t of e?.requiredFields??[])if(!c.has(t.name))return l(`missing required field "${t.name}"`);return null}function f(e,t){let s=t;return(0,r.iW)(e)&&"string"==typeof t?s=parseFloat(t):(0,r.AZ)(e)&&null!=t&&"string"!=typeof t?s=String(t):(0,r.gp)(e)&&"string"==typeof t&&(s=(0,i.sn)(t)),(0,r.OJ)(s)}let p;function m(e,t){if(!e||!(0,n.U3)(t))return e;if("rings"in e||"paths"in e){if(null==p)throw new TypeError("geometry engine not loaded");return p.simplify(t,e)}return e}async function y(e,t){!(0,n.U3)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==p&&(p=await Promise.all([s.e(984),s.e(2704)]).then(s.bind(s,82704))),p}()}},81976:(e,t,s)=>{s.d(t,{Q:()=>r,y:()=>n});var i=s(6704);function n(e){return{geometryType:(0,i.Ce)(e[0]),geometries:e.map((e=>e.toJSON()))}}function r(e,t,s){const n=(0,i.uG)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=s,t}))}},21980:(e,t,s)=>{s.d(t,{OW:()=>a,UX:()=>o,sR:()=>r}),s(6220),s(47620);var i=s(62088),n=s(28176);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function o(e){return"string"==typeof e?(0,n.as)(e):(0,i.ct)(e)}function a(e,t,s){const i={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))i[n]=r.map((e=>a({item:e},t,s).item));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(s?.[n]);i[n]=t?e:JSON.stringify(e)}else i[n]=t?r:JSON.stringify(r);else i[n]=r}return i}s(20572)},9504:(e,t,s)=>{s.d(t,{MZ:()=>r,aV:()=>u,gF:()=>a,gP:()=>l,qe:()=>n,wp:()=>h,yq:()=>o});const i=[252,146,31,255],n={type:"esriSMS",style:"esriSMSCircle",size:6,color:i,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},r={type:"esriSLS",style:"esriSLSSolid",width:.75,color:i},o={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},h={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);