@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
1 lines • 510 kB
JavaScript
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6061,8487],{563:(t,e,s)=>{s.d(e,{QueueProcessor:()=>l});var i=s(97768),r=s(74887),n=s(9775),o=s(32587),a=s(11932),h=s(44794);class c{constructor(t,e){this.item=t,this.controller=e,this.promise=null}}class l{constructor(t){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,h.v)(!1),this.concurrency=1,t.concurrency&&(this.concurrency=t.concurrency),this._queue=new n.A(t.peeker),this.process=t.process}destroy(){this.clear(),this._schedule=(0,i.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}abort(t){const e=this._controllers.get(t);e&&e.abort()}clear(){this._queue.clear();const t=[];this._controllers.forEach((e=>t.push(e))),this._controllers.clear(),t.forEach((t=>t.abort())),this._processingItems.clear(),this._cancelNext()}forEach(t){this._deferreds.forEach(((e,s)=>t(s)))}get(t){const e=this._deferreds.get(t);return e?e.promise:void 0}isOngoing(t){return this._processingItems.has(t)}has(t){return this._deferreds.has(t)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(t,e){const s=this.get(t);if(s)return s;const i=new AbortController;let n=null;e&&(n=(0,r.u7)(e,(()=>i.abort())));const o=()=>{a.remove(),null!=n&&n.remove(),this._removeItem(t),this._queue.remove(t),this._scheduleNext()},a=(0,r.NY)(i.signal,(()=>{const e=this._processingItems.get(t);e&&e.controller.abort(),o(),h.reject((0,r.NK)())})),h=(0,r.Tw)();return this._deferreds.set(t,h),this._controllers.set(t,i),h.promise.then(o,o),this._queue.push(t),this._scheduleNext(),h.promise}last(){return this._queue.last()}lastPromise(){const t=this.last();return t?this.get(t):null}peek(){return this._queue.peek()}popLast(){const t=this._queue.popLast();return t&&(this._deferreds.get(t)?.reject((0,r.NK)()),this._removeItem(t)),t}reset(){const t=Array.from(this._processingItems.values());this._processingItems.clear();for(const e of t)this._queue.push(e.item),e.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const t=[];for(;this._queue.length;)t.push(this._queue.pop());return this.clear(),t}_removeItem(t){this._deferreds.delete(t),this._controllers.delete(t),this._processingItems.delete(t)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,a._)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(t,e){this._canProcessFulfillment(t)&&(this._scheduleNext(),this._deferreds.get(t.item).resolve(e))}_processError(t,e){this._canProcessFulfillment(t)&&(this._scheduleNext(),this._deferreds.get(t.item).reject(e))}_canProcessFulfillment(t){return!!this._deferreds.get(t.item)&&this._processingItems.get(t.item)===t}_process(t){if(null==t)return;let e;const s=new AbortController,i=new c(t,s);this._processingItems.set(t,i);try{e=this.process(t,s.signal)}catch(t){this._processError(i,t)}(0,r.$X)(e)?(i.promise=e,e.then((t=>this._processResult(i,t)),(t=>this._processError(i,t)))):this._processResult(i,e)}}},5503:(t,e,s)=>{s.d(e,{A:()=>E});var i,r=s(90237),n=s(98291),o=s(65529),a=s(36563),h=s(4718),c=s(93687);!function(t){t[t.ADD=1]="ADD",t[t.REMOVE=2]="REMOVE",t[t.MOVE=4]="MOVE"}(i||(i={}));var l,u=s(11932),d=s(56507),_=s(62788),p=s(10107),f=s(7695),g=s(40608),m=s(95488),y=s(12195);class b{constructor(t,e,s,i,r){this.target=t,this.added=e,this.removed=s,this.start=i,this.deleteCount=r}}const x=new c.A(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(t){this.defaultPrevented=!1,this.item=t}},void 0,(t=>{t.item=null,t.target=null,t.defaultPrevented=!1,t.cancellable=!1}));function w(t){t&&"object"==typeof t&&"destroy"in t&&"function"==typeof t.destroy&&t.destroy()}function v(t){return t?t instanceof F?t.toArray():t.length?Array.prototype.slice.apply(t):[]:[]}function I(t){if(t?.length)return t[0]}function S(t,e,s,i){const r=Math.min(t.length-s,e.length-i);let n=0;for(;n<r&&t[s+n]===e[i+n];)n++;return n}function P(t,e,s,i){e&&e.forEach(((e,r,n)=>{t.push(e),P(t,s.call(i,e,r,n),s,i)}))}const M=new Set,A=new Set,T=new Set,k=new Map;let C=0,F=class extends o.A.EventedAccessor{static{l=this}static{this.ofType=t=>{if(!t)return l;if(k.has(t))return k.get(t);let e=null;if("function"==typeof t)e=t.prototype.declaredClass;else if(t.base)e=t.base.prototype.declaredClass;else for(const s in t.typeMap){const i=t.typeMap[s].prototype.declaredClass;e?e+=` | ${i}`:e=i}let s=class extends l{};return(0,r._)([(0,f.u)({Type:t,ensureType:"function"==typeof t?(0,d.dp)(t):(0,d.aq)(t)})],s.prototype,"itemType",void 0),s=(0,r._)([(0,g.$)(`esri.core.Collection<${e}>`)],s),k.set(t,s),s}}static isCollection(t){return null!=t&&t instanceof l}constructor(t){super(t),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new m.I,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:C++})}normalizeCtorArgs(t){return t?Array.isArray(t)||t instanceof l?{items:t}:t:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),this._emitter.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get items(){return(0,_.gc)(this._observable),this._items}set items(t){this._emitBeforeChanges(i.ADD)||(this._splice(0,this.length,v(t)),this._emitAfterChanges(i.ADD))}hasEventListener(t){return!this.destroyed&&("change"===t?this._chgListeners.length>0:this._emitter.hasEventListener(t))}on(t,e){if(this.destroyed)return(0,a.hA)();if("change"===t){const t=this._chgListeners,s={removed:!1,callback:e};return t.push(s),this._notifications&&this._notifications.push({listeners:t.slice(),items:this._items.slice(),changes:[]}),(0,a.hA)((()=>{s.removed=!0,t.splice(t.indexOf(s),1)}))}return this._emitter.on(t,e)}once(t,e){const s="deref"in e?()=>e.deref():()=>e,i=this.on(t,(t=>{s()?.call(null,t),i.remove()}));return i}add(t,e){if((0,_.gc)(this._observable),this._emitBeforeChanges(i.ADD))return this;const s=this.getNextIndex(e??null);return this._splice(s,0,[t]),this._emitAfterChanges(i.ADD),this}addMany(t,e=this._items.length){if((0,_.gc)(this._observable),!t?.length)return this;if(this._emitBeforeChanges(i.ADD))return this;const s=this.getNextIndex(e);return this._splice(s,0,v(t)),this._emitAfterChanges(i.ADD),this}at(t){if((0,_.gc)(this._observable),(t=Math.trunc(t)||0)<0&&(t+=this.length),!(t<0||t>=this.length))return this._items[t]}removeAll(){if((0,_.gc)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return[];const t=this._removeAllRaw();return this._emitAfterChanges(i.REMOVE),t}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return(0,_.gc)(this._observable),this._createNewInstance({items:this._items.map(h.o8)})}concat(...t){(0,_.gc)(this._observable);const e=t.map(v);return this._createNewInstance({items:this._items.concat(...e)})}drain(t,e){if((0,_.gc)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const s=this._splice(0,this.length),r=s.length;for(let i=0;i<r;i++)t.call(e,s[i],i,s);this._emitAfterChanges(i.REMOVE)}destroyAll(){this.drain(w)}destroyMany(t){const e=this.removeMany(t);return e.forEach(w),e}every(t,e){return(0,_.gc)(this._observable),this._items.every(t,e)}filter(t,e){(0,_.gc)(this._observable);const s=2===arguments.length?this._items.filter(t,e):this._items.filter(t);return this._createNewInstance({items:s})}find(t,e){return(0,_.gc)(this._observable),this._items.find(t,e)}findIndex(t,e){return(0,_.gc)(this._observable),this._items.findIndex(t,e)}flatten(t,e){(0,_.gc)(this._observable);const s=[];return P(s,this,t,e),new l(s)}forEach(t,e){return(0,_.gc)(this._observable),this._items.forEach(t,e)}getItemAt(t){return(0,_.gc)(this._observable),this._items[t]}getNextIndex(t){(0,_.gc)(this._observable);const e=this.length;return(t=t??e)<0?t=0:t>e&&(t=e),t}includes(t,e=0){return(0,_.gc)(this._observable),this._items.includes(t,e)}indexOf(t,e=0){return(0,_.gc)(this._observable),this._items.indexOf(t,e)}join(t=","){return(0,_.gc)(this._observable),this._items.join(t)}lastIndexOf(t,e=this.length-1){return(0,_.gc)(this._observable),this._items.lastIndexOf(t,e)}map(t,e){(0,_.gc)(this._observable);const s=this._items.map(t,e);return new l({items:s})}reorder(t,e=this.length-1){(0,_.gc)(this._observable);const s=this.indexOf(t);if(-1!==s){if(e<0?e=0:e>=this.length&&(e=this.length-1),s!==e){if(this._emitBeforeChanges(i.MOVE))return t;this._splice(s,1),this._splice(e,0,[t]),this._emitAfterChanges(i.MOVE)}return t}}pop(){if((0,_.gc)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const t=I(this._splice(this.length-1,1));return this._emitAfterChanges(i.REMOVE),t}push(...t){return(0,_.gc)(this._observable),this._emitBeforeChanges(i.ADD)||(this._splice(this.length,0,t),this._emitAfterChanges(i.ADD)),this.length}reduce(t,e){(0,_.gc)(this._observable);const s=this._items;return 2===arguments.length?s.reduce(t,e):s.reduce(t)}reduceRight(t,e){(0,_.gc)(this._observable);const s=this._items;return 2===arguments.length?s.reduceRight(t,e):s.reduceRight(t)}remove(t){return(0,_.gc)(this._observable),this.removeAt(this.indexOf(t))}removeAt(t){if((0,_.gc)(this._observable),t<0||t>=this.length||this._emitBeforeChanges(i.REMOVE))return;const e=I(this._splice(t,1));return this._emitAfterChanges(i.REMOVE),e}removeMany(t){if((0,_.gc)(this._observable),!t?.length||this._emitBeforeChanges(i.REMOVE))return[];const e=t instanceof l?t.toArray():t,s=this._items,r=[],n=e.length;for(let t=0;t<n;t++){const i=e[t],n=s.indexOf(i);if(n>-1){const i=1+S(e,s,t+1,n+1),o=this._splice(n,i);o&&o.length>0&&r.push.apply(r,o),t+=i-1}}return this._emitAfterChanges(i.REMOVE),r}reverse(){if((0,_.gc)(this._observable),this._emitBeforeChanges(i.MOVE))return this;const t=this._splice(0,this.length);return t&&(t.reverse(),this._splice(0,0,t)),this._emitAfterChanges(i.MOVE),this}shift(){if((0,_.gc)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const t=I(this._splice(0,1));return this._emitAfterChanges(i.REMOVE),t}slice(t=0,e=this.length){return(0,_.gc)(this._observable),this._createNewInstance({items:this._items.slice(t,e)})}some(t,e){return(0,_.gc)(this._observable),this._items.some(t,e)}sort(t){if((0,_.gc)(this._observable),!this.length||this._emitBeforeChanges(i.MOVE)||!this._requiresSort(t))return this;const e=this._splice(0,this.length);return arguments.length?e.sort(t):e.sort(),this._splice(0,0,e),this._emitAfterChanges(i.MOVE),this}_requiresSort(t=(t,e)=>t===e?0:t<e?-1:1){const e=this.length-1;for(let s=0;s<e;s++)if(t(this.items[s],this.items[s+1])>0)return!0;return!1}splice(t,e,...s){(0,_.gc)(this._observable),1===arguments.length&&(e=this.length),e??=0;const r=(e?i.REMOVE:0)|(s.length?i.ADD:0);if(this._emitBeforeChanges(r))return[];const n=this._splice(t,e,s)||[];return this._emitAfterChanges(r),n}toArray(){return(0,_.gc)(this._observable),this._items.slice()}toJSON(t){return(0,_.gc)(this._observable),this.toArray().map((e=>(0,y.W)(e)?e.toJSON(t):e))}toLocaleString(){return(0,_.gc)(this._observable),this._items.toLocaleString()}toString(){return(0,_.gc)(this._observable),this._items.toString()}unshift(...t){return(0,_.gc)(this._observable),!t.length||this._emitBeforeChanges(i.ADD)||(this._splice(0,0,t),this._emitAfterChanges(i.ADD)),this.length}_createNewInstance(t){return new this.constructor(t)}_splice(t,e,s){const i=this._items,r=this.itemType;let n,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=(0,u._)((()=>this._dispatchChange()))),t<0&&(t+=this.length),e){if(o=i.splice(t,e),this.hasEventListener("before-remove")){const e=x.acquire();e.target=this,e.cancellable=!0;for(let s=0,r=o.length;s<r;s++)n=o[s],e.reset(n),this.emit("before-remove",e),e.defaultPrevented&&(o.splice(s,1),i.splice(t,0,n),t+=1,s-=1,r-=1);x.release(e)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const t=x.acquire();t.target=this,t.cancellable=!1;const e=o.length;for(let s=0;s<e;s++)t.reset(o[s]),this.emit("after-remove",t);x.release(t)}}if(s?.length){if(r){const t=[];for(const e of s){const s=r.ensureType(e);null==s&&null!=e||t.push(s)}s=t}const e=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),o=t===this.length;if(e||n){const r=x.acquire();r.target=this,r.cancellable=!0;const a=x.acquire();a.target=this,a.cancellable=!1;for(const h of s)e?(r.reset(h),this.emit("before-add",r),r.defaultPrevented||(o?i.push(h):i.splice(t++,0,h),this._set("length",i.length),n&&(a.reset(h),this.emit("after-add",a)))):(o?i.push(h):i.splice(t++,0,h),this._set("length",i.length),a.reset(h),this.emit("after-add",a));x.release(a),x.release(r)}else{if(o)for(const t of s)i.push(t);else i.splice(t,0,...s);this._set("length",i.length)}}if((s?.length||o?.length)&&this._notifyChangeEvent(s,o),this.hasEventListener("after-splice")){const i=new b(this,s,o,t,e);this.emit("after-splice",i)}return o}_emitBeforeChanges(t){let e=!1;if(this.hasEventListener("before-changes")){const s=x.acquire();s.target=this,s.cancellable=!0,s.type=t,this.emit("before-changes",s),e=s.defaultPrevented,x.release(s)}return e}_emitAfterChanges(t){if(this.hasEventListener("after-changes")){const e=x.acquire();e.target=this,e.cancellable=!1,e.type=t,this.emit("after-changes",e),x.release(e)}this._observable.notify()}_notifyChangeEvent(t,e){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:t,removed:e})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),this._updating=!1,!this._notifications)return;const t=this._notifications;this._notifications=null;for(const e of t){const t=e.changes;M.clear(),A.clear(),T.clear();for(const{added:e,removed:s}of t){if(e)if(0===T.size&&0===A.size)for(const t of e)M.add(t);else for(const t of e)A.has(t)?(T.add(t),A.delete(t)):T.has(t)||M.add(t);if(s)if(0===T.size&&0===M.size)for(const t of s)A.add(t);else for(const t of s)M.has(t)?M.delete(t):(T.delete(t),A.add(t))}const s=n.A.acquire();M.forEach((t=>{s.push(t)}));const i=n.A.acquire();A.forEach((t=>{i.push(t)}));const r=this._items,o=e.items,a=n.A.acquire();if(T.forEach((t=>{o.indexOf(t)!==r.indexOf(t)&&a.push(t)})),e.listeners&&(s.length||i.length||a.length)){const t={target:this,added:s,removed:i,moved:a},r=e.listeners.length;for(let s=0;s<r;s++){const i=e.listeners[s];i.removed||i.callback.call(this,t)}}n.A.release(s),n.A.release(i),n.A.release(a)}M.clear(),A.clear(),T.clear()}};(0,r._)([(0,p.MZ)()],F.prototype,"_updating",void 0),(0,r._)([(0,p.MZ)()],F.prototype,"length",void 0),(0,r._)([(0,p.MZ)()],F.prototype,"items",null),(0,r._)([(0,p.MZ)({readOnly:!0})],F.prototype,"updating",null),F=l=(0,r._)([(0,g.$)("esri.core.Collection")],F);const E=F},5808:(t,e,s)=>{s.d(e,{O:()=>i});const i={geodesic:0,loxodrome:1,"great-elliptic":2,"normal-section":3,"shape-preserving":4}},6797:(t,e,s)=>{s.d(e,{Mj:()=>d,Ui:()=>p,w2:()=>_});var i=s(69622),r=s(5503),n=s(88620);const o=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function a(t){return t instanceof i.A}function h(t){return t instanceof r.A?Object.keys(t.items):a(t)?(0,n.oY)(t).keys():t?Object.keys(t):[]}function c(t,e){return t instanceof r.A?t.items[e]:t[e]}function l(t){return t?t.declaredClass:null}function u(t,e){const s=t.diff;if(s&&"function"==typeof s)return s(t,e);const i=h(t),r=h(e);if(0===i.length&&0===r.length)return;if(!i.length||!r.length||function(t,e){return!(!Array.isArray(t)||!Array.isArray(e))&&t.length!==e.length}(t,e))return{type:"complete",oldValue:t,newValue:e};const n=r.filter((t=>!i.includes(t))),d=i.filter((t=>!r.includes(t))),_=i.filter((s=>r.includes(s)&&c(t,s)!==c(e,s))).concat(n,d).sort(),p=l(t);if(p&&o.has(p)&&_.length)return{type:"complete",oldValue:t,newValue:e};let f;const g=a(t)&&a(e);for(const i of _){const r=c(t,i),n=c(e,i);let o;if((g||"function"!=typeof r&&"function"!=typeof n)&&r!==n&&(null!=r||null!=n)){if(s&&s[i]&&"function"==typeof s[i])o=s[i]?.(r,n);else if(r instanceof Date&&n instanceof Date){if(r.getTime()===n.getTime())continue;o={type:"complete",oldValue:r,newValue:n}}else o="object"==typeof r&&"object"==typeof n&&l(r)===l(n)?u(r,n):{type:"complete",oldValue:r,newValue:n};null!=o&&(null!=f?f.diff[i]=o:f={type:"partial",diff:{[i]:o}})}}return f}function d(t,e){return function(t,e){if(null==t)return!1;const s=e.split(".");let i=t;for(const t of s){if("complete"===i.type)return!0;if("partial"!==i.type)return!1;{const e=i.diff[t];if(!e)return!1;i=e}}return!0}(t,e)}function _(t,e){if(!t)return!1;if("partial"===t.type){const s=Object.keys(t.diff);return 1===s.length&&s[0]===e}return!1}function p(t,e){if("function"!=typeof t&&"function"!=typeof e&&(null!=t||null!=e))return null==t||null==e||"object"==typeof t&&"object"==typeof e&&l(t)!==l(e)?{type:"complete",oldValue:t,newValue:e}:u(t,e)}},7695:(t,e,s)=>{function i(t){return(e,s)=>{e[s]=t}}s.d(e,{u:()=>i})},9775:(t,e,s)=>{s.d(e,{A:()=>n});var i=s(62788),r=s(95488);class n{constructor(t=t=>t.values().next().value){this._peeker=t,this._observable=new r.I,this._items=new Set}get length(){return(0,i.gc)(this._observable),this._items.size}clear(){0!==this.length&&(this._items.clear(),this._observable.notify())}last(){if(0===this.length)return;let t;for(t of this._items);return t}peek(){if(0!==this.length)return this._peeker(this._items)}push(t){this.contains(t)||(this._items.add(t),this._observable.notify())}contains(t){return(0,i.gc)(this._observable),this._items.has(t)}pop(){if(0===this.length)return;const t=this.peek();return this._items.delete(t),this._observable.notify(),t}popLast(){if(0===this.length)return;const t=this.last();return this._items.delete(t),this._observable.notify(),t}remove(t){this.contains(t)&&(this._items.delete(t),this._observable.notify())}filter(t){const e=this.length;return this._items.forEach((e=>{t(e)||this._items.delete(e)})),e!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){(0,i.gc)(this._observable),yield*this._items}}},10382:(t,e,s)=>{s.d(e,{A:()=>c});var i=s(36563),r=(s(44208),s(74887)),n=s(9775),o=s(72457),a=s(52268),h=s(61322);class c{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new n.A,this._ongoingLowPriorityJobsQueue=new n.A}destroy(){this.close()}get closed(){return!this._clients?.length}open(t,e){return new Promise(((s,i)=>{let n=!0;const o=t=>{(0,r.Te)(e.signal),n&&(n=!1,t())};this._clients.length=t.length,this._clientPromises.length=t.length,this._inUseClients.length=t.length;for(let n=0;n<t.length;++n){const a=t[n];(0,r.$X)(a)?this._clientPromises[n]=a.then((t=>(this._clients[n]=new h.default(t,e,this._ongoingJobsQueue,this._ongoingLowPriorityJobsQueue),o(s),this._clients[n])),(()=>(o(i),null))):(this._clients[n]=new h.default(a,e,this._ongoingJobsQueue,this._ongoingLowPriorityJobsQueue),this._clientPromises[n]=Promise.resolve(this._clients[n]),o(s))}}))}broadcast(t,e,s){const i=new Array(this._clientPromises.length);for(let r=0;r<this._clientPromises.length;++r){const n=this._clientPromises[r];i[r]=n.then((i=>i?.invoke(t,e,s)))}return i}close(){let t;for(;t=this._ongoingJobsQueue.pop();)t.resolver.reject((0,r.NK)(`Worker closing, aborting job calling '${t.methodName}'`));for(;t=this._ongoingLowPriorityJobsQueue.pop();)t.resolver.reject((0,r.NK)(`Worker closing, aborting job calling '${t.methodName}'`));for(const t of this._clientPromises)t.then((t=>t?.close()));this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,(0,o.h)(this)}invoke(t,e,s){return this.apply(t,[e],s)}apply(t,e,s){const i=(0,r.Tw)();("low"===s?.priority?this._ongoingLowPriorityJobsQueue:this._ongoingJobsQueue).push({methodName:t,data:e,invokeOptions:s,resolver:i});for(let t=0;t<this._clientPromises.length;t++){const e=this._clients[t];e?e.jobAdded():this._clientPromises[t].then((t=>t?.jobAdded()))}return i.promise}createInvokeProxy(t){return(0,a.L)(this,t)}on(t,e){return Promise.all(this._clientPromises).then((()=>(0,i.vE)(this._clients.map((s=>s.on(t,e))))))}openPorts(){return new Promise((t=>{const e=new Array(this._clientPromises.length);let s=e.length;for(let i=0;i<this._clientPromises.length;++i)this._clientPromises[i].then((r=>{r&&(e[i]=r.openPort()),0===--s&&t(e)}))}))}get test(){}}},18047:(t,e,s)=>{s.d(e,{ZV:()=>h,yx:()=>a});var i=s(73444);const r={ar:"ar-u-nu-latn",bs:"sr-Latn-CS",nn:"no-NN"};let n=new WeakMap,o={};function a(t={}){const e={};return null!=t.digitSeparator&&(e.useGrouping=t.digitSeparator),null!=t.places&&(e.minimumFractionDigits=e.maximumFractionDigits=t.places),e}function h(t,e){return Object.is(t,-0)&&(t=0),function(t){const e=t||o;if(!n.has(e)){const s=(0,i.JK)(),o=(0,i.ZS)(s)?.language,a=o&&r[o]||s;n.set(e,new Intl.NumberFormat(a,t))}return n.get(e)}(e).format(t)}(0,i.Ml)((()=>{n=new WeakMap,o={}})),new Map},30624:(t,e,s)=>{s.r(e),s.d(e,{createConnection:()=>P});var i=s(90237),r=s(78888),n=s(49186),o=s(53966),a=s(74887),h=s(84952),c=(s(44208),s(87811),s(40608)),l=s(16930),u=s(65864),d=s(10107),_=s(62815),p=s(65529);let f=class extends p.A.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new n.A("stream-connection",this.errorString):null}onFeature(t){this.emit("data-received",t)}onMessage(t){this.emit("message-received",t)}};var g,m;(0,i._)([(0,d.MZ)({readOnly:!0})],f.prototype,"connectionError",null),f=(0,i._)([(0,c.$)("esri.layers.support.StreamConnection")],f),(m=g||(g={}))[m.CONNECTING=0]="CONNECTING",m[m.OPEN=1]="OPEN",m[m.CLOSING=2]="CLOSING",m[m.CLOSED=3]="CLOSED";let y=class extends f{constructor(t){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:e,spatialReference:s,sourceSpatialReference:i}=t;this._config=t,this._featureZScaler=(0,_.N)(e,i,s),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(t){null!=this._websocket?this._websocket.send(JSON.stringify(t)):this._outstandingMessages.push(t)}sendMessageToClient(t){this._onMessage(t)}updateCustomParameters(t){this._config.customParameters=t,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(t=this._config.source.path,e=1e3,s=0){try{if(this.destroyed)return;const e=(0,h.a6)(t,this._config.customParameters??{});this._websocket=await this._createWebSocket(e),this.notifyChange("connectionStatus")}catch(i){const r=e/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(o.A.getLogger(this).error(new n.A("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(o.A.getLogger(this).error(new n.A("websocket-connection",`Failed to connect. Attempting to reconnect in ${r}s`,i)),await(0,a.Pl)(e),this._tryCreateWebSocket(t,Math.min(1.5*e,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(t){t.onmessage=t=>{try{const e=JSON.parse(t.data);this._onMessage(e)}catch(t){return void o.A.getLogger(this).error(new n.A("websocket-connection","Failed to parse message, invalid JSON",{error:t}))}}}_createWebSocket(t){return new Promise(((e,s)=>{const i=new WebSocket(t);i.onopen=()=>{if(i.onopen=null,this.destroyed)return i.onclose=null,void i.close();i.onclose=t=>this._onClose(t),i.onerror=t=>this._onError(t),this._setWebSocketJSONParseHandler(i),e(i)},i.onclose=t=>{i.onopen=i.onclose=null,s(t)}}))}async _handshake(t=1e4){const e=this._websocket;if(null==e)return;const s=(0,a.Tw)(),i=e.onmessage,{filter:r,outFields:h,spatialReference:c}=this._config;return s.timeout(t),e.onmessage=t=>{let a=null;try{a=JSON.parse(t.data)}catch(t){}a&&"object"==typeof a||(o.A.getLogger(this).error(new n.A("websocket-connection","Protocol violation. Handshake failed - malformed message",t.data)),s.reject(),this.destroy()),a.spatialReference?.wkid!==c?.wkid&&(o.A.getLogger(this).error(new n.A("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${c.wkid}`,t.data)),s.reject(),this.destroy()),"json"!==a.format&&(o.A.getLogger(this).error(new n.A("websocket-connection","Protocol violation. Handshake failed - format is not set",t.data)),s.reject(),this.destroy()),r&&a.filter!==r&&o.A.getLogger(this).error(new n.A("websocket-connection","Tried to set filter, but server doesn't support it")),h&&a.outFields!==h&&o.A.getLogger(this).error(new n.A("websocket-connection","Tried to set outFields, but server doesn't support it")),e.onmessage=i;for(const t of this._outstandingMessages)e.send(JSON.stringify(t));this._outstandingMessages=[],s.resolve()},e.send(JSON.stringify({filter:r,outFields:h,format:"json",spatialReference:{wkid:c.wkid}})),s.promise}_onMessage(t){if(this.onMessage(t),"type"in t)switch(t.type){case"features":case"featureResult":for(const e of t.features)null!=this._featureZScaler&&this._featureZScaler(e.geometry),this.onFeature(e)}}_onError(t){const e="Encountered an error over WebSocket connection";this._set("errorString",e),o.A.getLogger(this).error("websocket-connection",e)}_onClose(t){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==t.code&&o.A.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${t.code}`),this.destroyed||this._open()}};(0,i._)([(0,d.MZ)()],y.prototype,"connectionStatus",null),(0,i._)([(0,d.MZ)()],y.prototype,"errorString",void 0),y=(0,i._)([(0,c.$)("esri.layers.graphics.sources.connections.WebSocketConnection")],y);var b=s(80893),x=s(61956);const w={maxQueryDepth:5,maxRecordCountFactor:3};let v=class extends y{constructor(t){super({...w,...t}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const t=await this._fetchServiceDefinition(this._config.source);t.timeInfo.trackIdField||o.A.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const e=this._fetchWebSocketUrl(t.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(e);const{filter:s,outFields:i}=this._config;this.destroyed||this._setFilter(s,i)}_onMessage(t){if("attributes"in t){let e;try{e=this._enrich(t),null!=this._featureZScaler&&this._featureZScaler(e.geometry)}catch(t){return void o.A.getLogger(this).error(new n.A("geoevent-connection","Failed to parse message",t))}this.onFeature(e)}else this.onMessage(t)}async _fetchServiceDefinition(t){const e={f:"json",...this._config.customParameters},s=(0,r.A)(t.path,{query:e,responseType:"json"}),i=(await s).data;return this._serviceDefinition=i,i}_fetchWebSocketUrl(t,e){const s=t[0],{urls:i,token:r}=s,n=this._inferWebSocketBaseUrl(i);return(0,h.a6)(`${n}/subscribe`,{outSR:""+e.wkid,token:r})}_inferWebSocketBaseUrl(t){if(1===t.length)return t[0];for(const e of t)if(e.includes("wss"))return e;return o.A.getLogger(this).error(new n.A("geoevent-connection","Unable to infer WebSocket url",t)),null}async _setFilter(t,e){const s=this._websocket;if(null==s||null==t&&null==e)return;const i=JSON.stringify({filter:this._serializeFilter(t,e)});let r=!1;const h=(0,a.Tw)();return s.onmessage=t=>{const e=JSON.parse(t.data);e.filter&&(e.error&&(o.A.getLogger(this).error(new n.A("geoevent-connection","Failed to set service filter",e.error)),this._set("errorString",`Could not set service filter - ${e.error}`),h.reject(e.error)),this._setWebSocketJSONParseHandler(s),r=!0,h.resolve())},s.send(i),setTimeout((()=>{r||(this.destroyed||this._websocket!==s||o.A.getLogger(this).error(new n.A("geoevent-connection","Server timed out when setting filter")),h.reject())}),1e4),h.promise}_serializeFilter(t,e){const s={};if(null==t&&null==e)return s;if(t?.geometry)try{const e=(0,u.rS)(t.geometry);if("extent"!==e.type)throw new n.A("geoevent-connection",`Expected extent but found type ${e.type}`);s.geometry=JSON.stringify(e.shiftCentralMeridian())}catch(t){o.A.getLogger(this).error(new n.A("geoevent-connection","Encountered an error when setting connection geometryDefinition",t))}return t?.where&&"1 = 1"!==t.where&&"1=1"!==t.where&&(s.where=t.where),null!=e&&(s.outFields=e.join(",")),s}_enrich(t){if(!this._relatedFeatures)return t;const e=this._serviceDefinition.relatedFeatures.joinField,s=t.attributes[e],i=this._relatedFeatures.get(s);if(!i)return o.A.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",t),t;const{attributes:r,geometry:a}=i;for(const e in r)t.attributes[e]=r[e];return a&&(t.geometry=a),t.geometry||t.centroid||o.A.getLogger(this).error(new n.A("geoevent-connection","Found malformed feature - no geometry found",t)),t}async _queryBuddyServices(){try{const{relatedFeatures:t,keepLatestArchive:e}=this._serviceDefinition,s=this._queryRelatedFeatures(t),i=this._queryArchive(e);await s;const r=await i;if(!r)return;for(const t of r.features)this.onFeature(this._enrich(t))}catch(t){o.A.getLogger(this).error(new n.A("geoevent-connection","Encountered an error when querying buddy services",{error:t}))}}async _queryRelatedFeatures(t){if(!t)return;const e=await this._queryBuddy(t.featuresUrl);this._addRelatedFeatures(e)}async _queryArchive(t){if(t)return this._queryBuddy(t.featuresUrl)}async _queryBuddy(t){const e=new((await Promise.all([s.e(6131),s.e(8219),s.e(8948),s.e(3910),s.e(13),s.e(1214),s.e(9953),s.e(4796),s.e(3029),s.e(4111),s.e(8506),s.e(3600),s.e(812),s.e(655),s.e(4697)]).then(s.bind(s,13600))).default)({url:t}),{capabilities:i}=await e.load(),r=i.query.supportsMaxRecordCountFactor,n=i.query.supportsPagination,o=i.query.supportsCentroid,a=this._config.maxRecordCountFactor,h=e.capabilities.query.maxRecordCount,c=r?h*a:h,u=new x.A;if(u.outFields=this._config.outFields??["*"],u.where=this._config.filter?.where??"1=1",u.returnGeometry=!0,u.returnExceededLimitFeatures=!0,u.outSpatialReference=l.A.fromJSON(this._config.spatialReference),o&&(u.returnCentroid=!0),r&&(u.maxRecordCountFactor=a),n)return u.num=c,e.destroy(),this._queryPages(t,u);const d=await(0,b.eW)(t,u,this._config.sourceSpatialReference);return e.destroy(),d.data}async _queryPages(t,e,s=[],i=0){e.start=null!=e.num?i*e.num:null;const{data:r}=await(0,b.eW)(t,e,this._config.sourceSpatialReference);return r.exceededTransferLimit&&i<(this._config.maxQueryDepth??0)?(r.features.forEach((t=>s.push(t))),this._queryPages(t,e,s,i+1)):(s.forEach((t=>r.features.push(t))),r)}_addRelatedFeatures(t){const e=new Map,s=t.features,i=this._serviceDefinition.relatedFeatures.joinField;for(const t of s){const s=t.attributes[i];e.set(s,t)}this._relatedFeatures=e}};v=(0,i._)([(0,c.$)("esri.layers.graphics.sources.connections.GeoEventConnection")],v);let I=class extends f{constructor(t){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:e,spatialReference:s,sourceSpatialReference:i}=t;this._featureZScaler=(0,_.N)(e,i,s)}normalizeCtorArgs(){return{}}updateCustomParameters(t){}sendMessageToSocket(t){}sendMessageToClient(t){if("type"in t)switch(t.type){case"features":case"featureResult":for(const e of t.features)null!=this._featureZScaler&&this._featureZScaler(e.geometry),this.onFeature(e)}this.onMessage(t)}};function S(t,e){if(null==t&&null==e)return null;const s={};return null!=e&&(s.geometry=e),null!=t&&(s.where=t),s}function P(t,e,s,i,r,n,o,a,h){const c={source:t,sourceSpatialReference:e,spatialReference:s,geometryType:i,filter:S(r,n),maxReconnectionAttempts:o,maxReconnectionInterval:a,customParameters:h};return t?t.path.startsWith("wss://")||t.path.startsWith("ws://")?new y(c):new v(c):new I(c)}(0,i._)([(0,d.MZ)()],I.prototype,"connectionStatus",void 0),(0,i._)([(0,d.MZ)()],I.prototype,"errorString",void 0),I=(0,i._)([(0,c.$)("esri.layers.support.ClientSideConnection")],I)},32587:(t,e,s)=>{s.d(e,{A:()=>n});var i=s(62788),r=s(95488);class n{constructor(t){this._observable=new r.I,this._map=new Map(t)}get size(){return(0,i.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(t){const e=this._map.delete(t);return e&&this._observable.notify(),e}entries(){return(0,i.gc)(this._observable),this._map.entries()}forEach(t,e){(0,i.gc)(this._observable),this._map.forEach(((s,i)=>t.call(e,s,i,this)),e)}get(t){return(0,i.gc)(this._observable),this._map.get(t)}has(t){return(0,i.gc)(this._observable),this._map.has(t)}keys(){return(0,i.gc)(this._observable),this._map.keys()}set(t,e){return this._map.set(t,e),this._observable.notify(),this}values(){return(0,i.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,i.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},32730:(t,e,s)=>{s.d(e,{BI:()=>g,D3:()=>p,XJ:()=>f,lc:()=>_,mX:()=>y,rU:()=>m,tH:()=>I});var i=s(799);const r="__begin__",n="__end__",o=new RegExp(r,"ig"),a=new RegExp(n,"ig"),h=new RegExp("^"+r,"i"),c=new RegExp(n+"$","i"),l='"',u=l+" + ",d=" + "+l;function _(t){return t.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function p(t){return t.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(t){const e={expression:"",type:"none"};return t.labelExpressionInfo?t.labelExpressionInfo.value?(e.expression=t.labelExpressionInfo.value,e.type="conventional"):t.labelExpressionInfo.expression&&(e.expression=t.labelExpressionInfo.expression,e.type="arcade"):null!=t.labelExpression&&(e.expression=_(t.labelExpression),e.type="conventional"),e}function g(t){const e=f(t);if(!e)return null;switch(e.type){case"conventional":return y(e.expression);case"arcade":return e.expression}return null}function m(t){const e=f(t);if(!e)return null;switch(e.type){case"conventional":return function(t){const e=t?.match(b);return e?.[1].trim()||null}(e.expression);case"arcade":return I(e.expression)}return null}function y(t){let e;return t?(e=(0,i.HC)(t,(t=>r+'$feature["'+t+'"]'+n)),e=h.test(e)?e.replace(h,""):l+e,e=c.test(e)?e.replace(c,""):e+l,e=e.replaceAll(o,u).replaceAll(a,d)):e='""',e}const b=/^\s*\{([^}]+)\}\s*$/i,x=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,v=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function I(t){if(!t)return null;let e=x.exec(t)||w.exec(t);return e?e[1]||e[3]:(e=v.exec(t),e?e[2]:null)}},36708:(t,e,s)=>{s.d(e,{C_:()=>d,OH:()=>f,Vh:()=>g,on:()=>u,pc:()=>m,wB:()=>h,z7:()=>c});var i=s(37955),r=s(36563),n=s(97768),o=s(74887),a=s(14012);function h(t,e,s={}){return l(t,e,s,_)}function c(t,e,s={}){return l(t,e,s,p)}function l(t,e,s={},i){let r=null;const o=s.once?(t,s)=>{i(t)&&((0,n.xt)(r),e(t,s))}:(t,s)=>{i(t)&&e(t,s)};if(r=(0,a.Cn)(t,o,s.sync,s.equals),s.initial){const e=t();o(e,e)}return r}function u(t,e,s,o={}){let a=null,c=null,l=null;function u(){a&&c&&(c.remove(),o.onListenerRemove?.(a),a=null,c=null)}function d(t){o.once&&o.once&&(0,n.xt)(l),s(t)}const _=h(t,((t,s)=>{u(),(0,i.wb)(t)&&(a=t,c=(0,i.on)(t,e,d),o.onListenerAdd?.(t))}),{sync:o.sync,initial:!0});return l=(0,r.hA)((()=>{_.remove(),u()})),l}function d(t,e){return function(t,e,s){if((0,o.G4)(s))return Promise.reject((0,o.NK)());const i=t();if(e?.(i))return Promise.resolve(i);let a=null;function h(){a=(0,n.xt)(a)}return new Promise(((i,n)=>{a=(0,r.vE)([(0,o.u7)(s,(()=>{h(),n((0,o.NK)())})),l(t,(t=>{h(),i(t)}),{sync:!1,once:!0},e??_)])}))}(t,p,e)}function _(t){return!0}function p(t){return!!t}s(80559);const f={sync:!0},g={initial:!0},m={sync:!0,initial:!0}},37585:(t,e,s)=>{s.d(e,{C:()=>r,Cc:()=>g,Io:()=>u,S8:()=>f,WQ:()=>o,e$:()=>y,hZ:()=>n,hs:()=>l,jb:()=>x,l0:()=>m});var i=s(34304);function r(t,e){return t[0]=e[0],t[1]=e[1],t}function n(t,e,s){return t[0]=e,t[1]=s,t}function o(t,e,s){return t[0]=e[0]+s[0],t[1]=e[1]+s[1],t}function a(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t}function h(t,e,s){return t[0]=e[0]*s[0],t[1]=e[1]*s[1],t}function c(t,e,s){return t[0]=e[0]/s[0],t[1]=e[1]/s[1],t}function l(t,e,s){return t[0]=e[0]*s,t[1]=e[1]*s,t}function u(t,e){const s=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(s*s+i*i)}function d(t,e){const s=e[0]-t[0],i=e[1]-t[1];return s*s+i*i}function _(t){const e=t[0],s=t[1];return Math.sqrt(e*e+s*s)}function p(t){const e=t[0],s=t[1];return e*e+s*s}function f(t,e){const s=e[0],i=e[1];let r=s*s+i*i;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t}function g(t,e,s,i){const r=e[0],n=e[1];return t[0]=r+i*(s[0]-r),t[1]=n+i*(s[1]-n),t}function m(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[2]*r+s[4],t[1]=s[1]*i+s[3]*r+s[5],t}function y(t,e,s,i){const r=e[0]-s[0],n=e[1]-s[1],o=Math.sin(i),a=Math.cos(i);return t[0]=r*a-n*o+s[0],t[1]=r*o+n*a+s[1],t}const b=_,x=a,w=h,v=c,I=u,S=d,P=p;Object.freeze(Object.defineProperty({__proto__:null,add:o,angle:function(t,e){const s=t[0],i=t[1],r=e[0],n=e[1];let o=s*s+i*i;o>0&&(o=1/Math.sqrt(o));let a=r*r+n*n;a>0&&(a=1/Math.sqrt(a));const h=(s*r+i*n)*o*a;return h>1?0:h<-1?Math.PI:Math.acos(h)},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},copy:r,cross:function(t,e,s){const i=e[0]*s[1]-e[1]*s[0];return t[0]=t[1]=0,t[2]=i,t},dist:I,distance:u,div:v,divide:c,dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},equals:function(t,e){const s=t[0],r=t[1],n=e[0],o=e[1],a=(0,i.FD)();return Math.abs(s-n)<=a*Math.max(1,Math.abs(s),Math.abs(n))&&Math.abs(r-o)<=a*Math.max(1,Math.abs(r),Math.abs(o))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},len:b,length:_,lerp:g,max:function(t,e,s){return t[0]=Math.max(e[0],s[0]),t[1]=Math.max(e[1],s[1]),t},min:function(t,e,s){return t[0]=Math.min(e[0],s[0]),t[1]=Math.min(e[1],s[1]),t},mul:w,multiply:h,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},normalize:f,projectAndScale:function(t,e,s,i,r){let n=e[0]-s[0],o=e[1]-s[1];const a=(i[0]*n+i[1]*o)*(r-1);return n=i[0]*a,o=i[1]*a,t[0]=e[0]+n,t[1]=e[1]+o,t},random:function(t,e=1){const s=2*(0,i.Ov)()*Math.PI;return t[0]=Math.cos(s)*e,t[1]=Math.sin(s)*e,t},rotate:y,round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},scale:l,scaleAndAdd:function(t,e,s,i){return t[0]=e[0]+s[0]*i,t[1]=e[1]+s[1]*i,t},set:n,sqrDist:S,sqrLen:P,squaredDistance:d,squaredLength:p,str:function(t){return"vec2("+t[0]+", "+t[1]+")"},sub:x,subtract:a,transformMat2:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[2]*r,t[1]=s[1]*i+s[3]*r,t},transformMat2d:m,transformMat3:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[3]*r+s[6],t[1]=s[1]*i+s[4]*r+s[7],t},transformMat4:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[4]*r+s[12],t[1]=s[1]*i+s[5]*r+s[13],t}},Symbol.toStringTag,{value:"Module"}))},37730:(t,e,s)=>{s.d(e,{T:()=>r});var i=s(43334);const r={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new i.Om(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>t.ensureCentroid(e)}},38487:(t,e,s)=>{s.r(e),s.d(e,{default:()=>hu});var i=s(49186),r=s(36563),n=s(44208),o=s(26390),a=s(74887),h=s(87811),c=s(36708),l=s(90629),u=s(8341),d=s(87045),_=s(76213);class p{constructor(t){this._client=t,this.layerView=this._client.createInvokeProxy(""),this.container=this._client.createInvokeProxy("container"),this._eventLog=this._client.createInvokeProxy("eventLog")}onEvent(t){(0,u.oV)(this._eventLog.onEvent(t))}}var f=s(97768),g=s(93637),m=s(6797),y=s(16930),b=s(21325),x=s(44159);function w(t,e){return[t,e]}function v(t,e,s){return t[0]=e,t[1]=s,t}const I=new x.A("0/0/0/0");class S{static create(t,e,s=null){const i=(0,b.Vp)(t.spatialReference),r=e.origin||w(t.origin.x,t.origin.y),n=w(t.size[0]*e.resolution,t.size[1]*e.resolution),o=w(-1/0,-1/0),a=w(1/0,1/0),h=w(1/0,1/0);null!=s&&(v(o,Math.max(0,Math.floor((s.xmin-r[0])/n[0])),Math.max(0,Math.floor((r[1]-s.ymax)/n[1]))),v(a,Math.max(0,Math.floor((s.xmax-r[0])/n[0])),Math.max(0,Math.floor((r[1]-s.ymin)/n[1]))),v(h,a[0]-o[0]+1,a[1]-o[1]+1));const{cols:c,rows:l}=e;let u,d,_,p;return!s&&c&&l&&(v(o,c[0],l[0]),v(a,c[1],l[1]),v(h,c[1]-c[0]+1,l[1]-l[0]+1)),t.isWrappable?(u=w(Math.ceil(Math.round((i.valid[1]-i.valid[0])/e.resolution)/t.size[0]),h[1]),d=!0,_=i.origin,p=i.valid):(u=h,d=!1),new S(e.level,e.resolution,e.scale,r,o,a,h,n,u,d,_,p)}constructor(t,e,s,i,r,n,o,a,h,c,l,u){this.level=t,this.resolution=e,this.scale=s,this.origin=i,this.first=r,this.last=n,this.size=o,this.norm=a,this.worldSize=h,this.wrap=c,this._spatialReferenceOrigin=l,this._spatialReferenceValid=u}normalizeCol(t){if(!this.wrap)return t;const e=this.worldSize[0];return t<0?e-1-Math.abs((t+1)%e):t%e}normalizeKey(t){if(!this.wrap)return;const e=this.worldSize[0],s=t.col;s<0?(t.col=s+e,t.world-=1):s>=e&&(t.col=s-e,t.world+=1)}denormalizeCol(t,e){return this.wrap?this.worldSize[0]*e+t:t}getWorldForColumn(t){return this.wrap?Math.floor(t/this.worldSize[0]):0}getFirstColumnForWorld(t){return t*this.worldSize[0]+this.first[0]}getLastColumnForWorld(t){return t*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(t){return(t-this.origin[0])/this.norm[0]}getXForColumn(t){const e=this.origin[0]+t*this.norm[0],s=this._spatialReferenceOrigin,i=this._spatialReferenceValid;return this.wrap&&s&&i?e===s[0]?i[0]:this.origin[0]===s[0]&&t===this.worldSize[0]?i[1]:e:e}getRowForY(t){return(this.origin[1]-t)/this.norm[1]}getYForRow(t){return this.origin[1]-t*this.norm[1]}getTileBounds(t,e,s=!1){I.set(e);const i=s?I.col:this.denormalizeCol(I.col,I.world),r=I.row;return function(t,e,s,i,r){t[0]=e,t[1]=s,t[2]=i,t[3]=r}(t,this.getXForColumn(i),this.getYForRow(r+1),this.getXForColumn(i+1),this.getYForRow(r)),t}getTileCoords(t,e,s=!1){I.set(e);const i=s?I.col:this.denormalizeCol(I.col,I.world);return Array.isArray(t)?v(t,this.getXForColumn(i),this.getYForRow(I.row)):(t.x=this.getXForColumn(i),t.y=this.getYForRow(I.row)),t}}var P=s(93687);class M{constructor(){this.spans=[]}static{this.pool=new P.A(M)}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}*keys(){const t=this.lodInfo;for(const{row:e,colFrom:s,colTo:i}of this.spans)for(let r=s;r<=i;r++){const s=t.getWorldForColumn(r);yield new x.A(t.level,e,t.normalizeCol(r),s)}}forEach(t,e){const{spans:s,lodInfo:i}=this,{level:r}=i;if(0!==s.length)for(const{row:n,colFrom:o,colTo:a}of s)for(let s=o;s<=a;s++)t.call(e,r,n,i.normalizeCol(s),i.getWorldForColumn(s))}}class A{constructor(t,e,s){this.row=t,this.colFrom=e,this.colTo=s}}const T=new x.A("0/0/0/0");class k{static create(t,e){t[1]>e[1]&&([t,e]=[e,t]);const[s,i]=t,[r,n]=e,o=r-s,a=n-i,h=0!==a?o/a:0,c=(Math.ceil(i)-i)*h,l=(Math.floor(i)-i)*h;return new k(s,Math.floor(i),Math.ceil(n),h,o<0?c:l,o<0?l:c,o<0?r:s,o<0?s:r)}constructor(t,e,s,i,r,n,o,a){this.x=t,this.ymin=e,this.ymax=s,this.invM=i,this.leftAdjust=r,this.rightAdjust=n,this.leftBound=o,this.rightBound=a}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const C=[[0,0],[0,0],[0,0],[0,0]];class F{constructor(t,e=null,s=t.lods[0].level,i=t.lods[t.lods.length-1].level){this.tileInfo=t,this.fullExtent=e,this.scales=[],this._infoByScale={},this._infoByLevel={};const r=t.lods.filter((t=>t.level>=s&&t.level<=i));this.minScale=r[0].scale,this.maxScale=r[r.length-1].scale;const n=this._lodInfos=r.map((s=>S.create(t,s,e)));r.forEach(((t,e)=>{this._infoByLevel[t.level]=n[e],this._infoByScale[t.scale]=n[e],this.scales[e]=t.scale}),this),this._wrap=t.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(t){return this._infoByLevel["number"==typeof t?t:t.level]}getTileBounds(t,e,s=!1){T.set(e);const i=this._infoByLevel[T.level];return i?i.getTileBounds(t,T,s):t}getTileCoords(t,e,s=!1){T.set(e);const i=this._infoByLevel[T.level];return i?i.getTileCoords(t,T,s):t}getTileCoverage(t,e=192,s=!0,i="closest"){if(!s&&(t.scale>this.minScale||t.scale<this.maxScale))return null;const r="closest"===i?this.getClosestInfoForScale(t.scale):this.getSmallestInfoForScale(t.scale),n=M.pool.acquire(r),o=this._wrap;let a,h,c,l=1/0,u=-1/0;const d=n.spans;C[0][0]=C[0][1]=C[1][1]=C[3][0]=-e,C[1][0]=C[2][0]=t.size[0]+e,C[2][1]=C[3][1]=t.size[1]+e;for(const e of C)t.toMap(e,e),e[0]=r.getColumnForX(e[0]),e[1]=r.getRowForY(e[1]);const _=[];let p=3;for(let t=0;t<4;t++){if(C[t][1]===C[p][1]){p=t;continue}const e=k.create(C[t],C[p]);l=Math.min(e.ymin,l),u=Math.max(e.ymax,u),void 0===_[e.ymin]&&(_[e.ymin]=[]),_[e.ymin].push(e),p=t}if(null==l||null==u||u-l>100)return null;let f=[];for(a=l;a<u;){null!=_[a]&&(f=f.concat(_[a])),h=1/0,c=-1/0;for(let t=f.length-1;t>=0;t--){const e=f[t];h=Math.min(h,e.getLeftCol()),c=Math.max(c,e.getRightCol())}if(h=Math.floor(h),c=Math.floor(c),a>=r.first[1]&&a<=r.last[1])if(o)if(r.size[0]<r.worldSize[0]){const t=Math.floor(c/r.worldSize[0]);for(let e=Math.floor(h/r.worldSize[0]);e<=t;e++)d.push(new A(a,Math.max(r.getFirstColumnForWorld(e),h),Math.min(r.getLastColumnForWorld(e),c)))}else d.push(new A(a,h,c));else h>r.last[0]||c<r.first[0]||(h=Math.max(h,r.first[0]),c=Math.min(c,r.last[0]),d.push(new A(a,h,c)));a+=1;for(let t=f.length-1;t>=0;t--){const e=f[t];e.ymax>=a?e.incrRow():f.splice(t,1)}}return n}getTileParentId(t){T.set(t);const e=this._infoByLevel[T.level],s=this._lodInfos.indexOf(e)-1;return s<0?null:(this._getTileIdAtLOD(T,this._lodInfos[s],T),T.id)}getTileResolution(t){const e=this._infoByLevel["object"==typeof t?t.level:t];return e?e.resolution:-1}getTileScale(t){const e=this._infoByLevel[t.level];return e?e.scale:-1}intersects(t,e){T.set(e);const s=this._infoByLevel[T.level],i=t.lodInfo;if(i.resolution>s.resolution){this._getTileIdAtLOD(T,i,T);const e=i.denormalizeCol(T.col,T.world);for(const s of t.spans)if(s.row===T.row&&s.colFrom<=e&&s.colTo>=e)return!0}if(i.resolution<s.resolution){const[e,r,n,o]=t.spans.reduce(((t,e)=>(t[0]=Math.min(t[0],e.row),t[1]=Math.max(t[1],e.row),t[2]=Math.min(t[2],e.colFrom),t[3]=Math.max(t[3],e.colTo),t)),[1/0,-1/0,1/0,-1/0]),a=s.denormalizeCol(T.col,T.world),h=i.getColumnForX(s.getXForColumn(a)),c=i.getRowForY(s.getYForRow(T.row)),l=i.getColumnForX(s.getXForColumn(a+1))-1,u=i.getRowForY(s.getYForRow(T.row+1))-1;return!(h>o||l<n||c>r||u<e)}const r=i.denormalizeCol(T.col,T.world);return t.spans.some((t=>t.row===T.row&&t.colFrom<=r&&t.colTo>=r))}normalizeBounds(t,e,s){if(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._wrap){const e=(0,b.Vp)(this.tileInfo.spatialReference),i=-s*(e.valid[1]-e.valid[0]);t[0]+=i,t[2]+=i}return t}getSmallestInfoForScale(t){const e=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>e[0])return this._infoByScale[e[0]];for(let s=1;s<e.length-1;s++)if(t>e[s]+1e-6)return this._infoByScale[e[s-1]];return this._infoByScale[e[e.length-1]]}getClosestInfoForScale(t){const e=this.scales;return this._infoByScale[t]||(t=e.reduce(((e,s)=>Math.abs(s-t)<Math.abs(e-t)?s:e),e[0])),this._infoByScale[t]}scaleToLevel(t){const e=this.scales;if(this._infoByScale[t])return this._infoByScale[t].level;for(let s=e.length-1;s>=0;s--)if(t<e[s])return s===e.length-1?this._infoByScale[e[e.length-1]].level:this._infoByScale[e[s]].level+(e[s]-t)/(e[s]-e[s+1]);return this._infoByScale[e[0]].level}scaleToZoom(t){return this.tileInfo.scaleToZoom(t)}zoomToScale(t){return this.tileInfo.zoomToScale(t)}_getTileIdAtLOD(t,e,s){const i=this._infoByLevel[s.level];return t.set(s),e.resolution<i.resolution?null:(e.resolution===i.resolution||(t.level=e.level,t.col=Math.floor(s.col*i.resolution/e.resolution+.01),t.row=Math.floor(s.row*i.resolution/e.resolution+.01)),t)}}var E=s(90237),O=s(69622),z=s(91869),R=s(3483),L=s(10107),D=s(53966),N=s(40608),G=s(37585),B=s(9775),q=s(32587),W=s(11932),Y=s(44794);class U{constructor(t,e){this.item=t,this.controller=e,this.promise=null}}class j{constructor(t){this._schedule=null,this._task=null,this._deferreds=new q.A,this._controllers=new q.A,this._processingItems=new q.A,this._pausedSignal=(0,Y.v)(!1),this.concurrency=1,t.concurrency&&(this.concurrency=t.concurrency),this._queue=new B.A(t.peeker),this.process=t.process;const e=t.scheduler;t.priority&&e&&(this._task=e.registerTask(t.priority,this))}destroy(){this.clear(),this._schedule=(0,f.xt)(this._schedule),this._task=(0,f.xt)(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(t){const e=this._controllers.get(t);e&&e.abort()}clear(){this._queue.clear();const t=[];this._controllers.forEach((e=>t.push(e))),this._controllers.clear(),t.forEach((t=>t.abort())),this._processingItem