@arcgis/core 4.23.0 → 4.23.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s}),r(80442);var n,o=r(78286);const s={apiKey:void 0,applicationUrl:null==(n=globalThis.location)?void 0:n.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,o.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.23.0";s.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}s.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(s,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),s.request.corsEnabledServers=[],s.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof i))return new i(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=void 0,this instanceof o&&(this.message=t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(function(e,r){if(""===r)return"$";const o=(0,n.hS)(r,t),s=null==o?"":o;if(void 0===s)throw new Error(`could not find key "${r}" in template`);return s.toString()}))}(t,r)||"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=null==e?Math.random()*n._m:e}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{"use strict";r.d(t,{SO:()=>u,a9:()=>c,fS:()=>s,cq:()=>d,zG:()=>i,w6:()=>l,Od:()=>g,e$:()=>h,FY:()=>b});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function i(e){return e&&"number"==typeof e.length}const a=!!Array.prototype.fill;function c(e,t){if(a)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function l(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class u{constructor(){this.last=0}}const f=new u;function d(e,t,r,n){n=n||f;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function h(e,t,r,n){const o=null==r?e.length:r,s=d(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const p=new Set;function b(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;p.clear();for(let e=0;e<n;++e)p.add(t[e]);o=o||f;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(p.has(e[t])&&(s&&s.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;for(let t=0;t<i;++t)if(p.has(e[t])&&(s&&s.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;return p.clear(),r}function g(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{vT:()=>n,on:()=>o,IH:()=>s})},80442:(e,t,r)=>{"use strict";var n,o;let s;var i,a;function c(e){return"function"==typeof s[e]?s[e]=s[e](globalThis):s[e]}r.d(t,{Z:()=>c}),s=null!=(n=globalThis.dojoConfig)&&n.has||null!=(o=globalThis.esriConfig)&&o.has?{...null==(i=globalThis.dojoConfig)?void 0:i.has,...null==(a=globalThis.esriConfig)?void 0:a.has}:{},c.add=(e,t,r,n)=>((n||void 0===s[e])&&(s[e]=t),r&&c(e)),c.cache=s,c.add("esri-deprecation-warnings",!0),(()=>{var e;c.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const t="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(c.add("host-browser",t),c.add("host-node","object"==typeof globalThis.process&&(null==(e=globalThis.process.versions)?void 0:e.node)&&globalThis.process.versions.v8),c.add("dom",t),c("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(c.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),c.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),c.add("khtml",r.includes("Konqueror")?n:void 0),c.add("edge",parseFloat(t.split("Edge/")[1])||void 0),c.add("opr",parseFloat(t.split("OPR/")[1])||void 0),c.add("webkit",!c("wp")&&!c("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),c.add("chrome",!c("edge")&&!c("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),c.add("android",!c("wp")&&parseFloat(t.split("Android ")[1])||void 0),c.add("safari",!r.includes("Safari")||c("wp")||c("chrome")||c("android")||c("edge")||c("opr")?void 0:parseFloat(r.split("Version/")[1])),c.add("mac",r.includes("Macintosh")),!c("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));c.add(e,n),c.add("ios",n)}c.add("trident",parseFloat(r.split("Trident/")[1])||void 0),c("webkit")||(!t.includes("Gecko")||c("wp")||c("khtml")||c("trident")||c("edge")||c.add("mozilla",n),c("mozilla")&&c.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&c.add("esri-mobile",t),r&&c.add("esri-iPhone",r),c.add("esri-geolocation",!!navigator.geolocation)}c.add("esri-canvas-svg-support",!c("trident")),c.add("esri-wasm","WebAssembly"in globalThis),c.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),c.add("esri-atomics","Atomics"in globalThis),c.add("esri-workers","Worker"in globalThis),c.add("web-feat:cache","caches"in globalThis),c.add("esri-workers-arraybuffer-transfer",!c("safari")||Number(c("safari"))>=12),c.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),c.add("featurelayer-simplify-payload-size-factors",[1,1,4]),c.add("featurelayer-snapshot-enabled",!0),c.add("featurelayer-snapshot-point-min-threshold",8e4),c.add("featurelayer-snapshot-point-max-threshold",4e5),c.add("featurelayer-snapshot-point-coverage",.1),c.add("featurelayer-advanced-symbols",!1),c.add("featurelayer-pbf",!0),c.add("featurelayer-pbf-statistics",!1),c.add("feature-layers-workers",!0),c.add("feature-polyline-generalization-factor",1),c.add("mapview-transitions-duration",200),c.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),c.add("mapserver-pbf-enabled",!1),c("host-webworker")||c("host-browser")&&(c.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),c.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{c.add("esri-image-decode",!0,!0,!0)})).catch((()=>{c.add("esri-image-decode",!1,!0,!0)}))}return!1})),c.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{d9:()=>i,fS:()=>d,yd:()=>s,Vo:()=>a}),r(67676),r(80442);var n=r(70586),o=r(1533);function s(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&s(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function i(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(c(e))return e.clone();if(l(e))return e.map(i);if(u(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=i(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(l(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(c(e))return e.clone();if(!u(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function f(e){if((0,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(e))return(0,o.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,i(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(i(e))})),t}return null}function d(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e){return void 0===e}function i(e,t){return n(e)?t(e):null}function a(e){return e}function c(e,t){if(o(e))throw new Error(t);return e}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e,t){return n(e)?e:t}function f(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function h(e){return n(e)&&e.remove(),null}function p(e){return n(e)&&e.release(),null}function b(e){return null}function g(e,t){const r=new Array;for(const n of e)r.push(y(n,null,t));return r}function m(e,t){for(const r of e)i(r,t)}function y(e,t,r){return n(e)?r(e):t}function v(e){return e.filter((e=>n(e)))}function w(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function _(e){return e}r.d(t,{yw:()=>i,j0:()=>_,SC:()=>f,O3:()=>d,lV:()=>v,JR:()=>m,U2:()=>w,Wi:()=>o,pC:()=>n,o8:()=>s,Fd:()=>g,R2:()=>y,Bd:()=>b,RY:()=>p,hw:()=>h,Wg:()=>a,Pt:()=>l,s3:()=>c,yl:()=>u})},78286:(e,t,r)=>{"use strict";r.d(t,{RH:()=>o,hS:()=>s,RB:()=>i});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce((function(e,o){let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{-1===s.indexOf(e)&&s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>C,$6:()=>c,Ue:()=>l,zE:()=>u,dD:()=>_,hh:()=>T,vr:()=>x,Ds:()=>j,as:()=>O,WW:()=>P,R8:()=>w,D_:()=>v,Hc:()=>h,y8:()=>E,fu:()=>g,$F:()=>m,d1:()=>k,DB:()=>S,r9:()=>p,k_:()=>f,H9:()=>b,Yn:()=>M,gx:()=>A,Hl:()=>y});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o,s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e){return Promise.all(e)}function l(e){return new Promise(((t,r)=>{try{e(t,r)}catch(e){Promise.resolve().then((()=>r(e)))}}))}function u(e="Aborted"){return new s.Z("AbortError",e)}function f(e,t="Aborted"){if(h(e))throw u(t)}function d(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function h(e){const t=d(e);return(0,a.pC)(t)&&t.aborted}function p(e){if(v(e))throw e}function b(e){if(!v(e))throw e}function g(e,t){const r=d(e);if(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function m(e,t){const r=d(e);if(!(0,a.Wi)(r))return f(r),(0,i.IH)(r,"abort",(()=>t(u())))}function y(e,t){const r=d(t);return(0,a.Wi)(r)?e:new Promise(((r,n)=>{let o=g(t,(()=>n(u())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function v(e){return e&&"AbortError"===e.name}function w(e){return e.catch((e=>{if(!v(e))throw e}))}function _(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}function O(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e);return O(t.map((t=>e[t]))).then((e=>{const r={};return t.forEach(((t,n)=>r[t]=e[n])),r}))}const t=e;return l((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}function P(e){return O(e).then((e=>e.filter((e=>!!e.value)).map((e=>e.value))))}function k(e){return Promise.reject(e)}function S(e){return Promise.resolve(e)}function C(e,t,r){const n=new AbortController;return g(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);g(n,(()=>{s&&(clearTimeout(s),o(u()))}))}))}function E(e){return e&&"function"==typeof e.then}function A(e){return E(e)?e:Promise.resolve(e)}function j(e,t=-1){let r,n,o,s,i=null;const c=(...l)=>{if(r){n=l,s&&s.reject(u()),s=_();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||_(),s=null,t>0){const n=new AbortController;r=A(e(...l,n.signal));const o=r;C(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=A(e(...l));const f=()=>{const e=n;n=o=r=i=null,null!=e&&c(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return c}function T(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}function x(e,t){let r,n=new AbortController;const o=e(n.signal);let s={promise:o,finished:!1,abort:()=>{n&&(n.abort(),n=null)}};const i=()=>{s&&(s.finished=!0,s=null),(0,a.pC)(r)&&(r.remove(),r=null),n=null};return o.then(i,i),r=g(t,(()=>{(0,a.pC)(s)&&s.abort()})),s}function M(e){return Promise.resolve().then((()=>{f(e)}))}},19153:(e,t,r)=>{"use strict";r.d(t,{Qs:()=>a,hP:()=>c,gx:()=>i,Cb:()=>l});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return null==e?"":e}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&-1!==t.indexOf(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,eP:()=>s,xZ:()=>h,fS:()=>p,z3:()=>l,Hx:()=>f,W0:()=>i,Uc:()=>u,ZY:()=>d,lq:()=>a,KZ:()=>c,tP:()=>o})},17452:(e,t,r)=>{"use strict";r.d(t,{R9:()=>y,qg:()=>j,tD:()=>$,ZN:()=>he,fl:()=>pe,rS:()=>V,Ie:()=>ue,sJ:()=>Y,AH:()=>Q,io:()=>ee,L:()=>P,TI:()=>O,vt:()=>ce,oh:()=>U,P$:()=>D,Ml:()=>be,ed:()=>I,b7:()=>A,D6:()=>W,tm:()=>R,YP:()=>H,jc:()=>z,HK:()=>K,$U:()=>ne,oC:()=>te,kl:()=>L,v_:()=>B,hF:()=>q,_l:()=>X,PF:()=>F,Fv:()=>Z,B7:()=>E,u0:()=>S,Yd:()=>ae,Hu:()=>de,Qj:()=>le,hO:()=>oe,mN:()=>k});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const v={};let w=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(w.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${w.scheme}://${w.host}${null!=w.port?`:${w.port}`:""}${t}`}();const O=()=>w,P=()=>_;function k(e){const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=S(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function S(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function E(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function A(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=I(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),k(r)}function j(e){const t=I(e);let r,n;if(t){const e=x(t.proxyUrl);r=e.path,n=e.query?S(e.query):null}if(r){const t=k(e);e=r+"?"+t.path;const o=E({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const T={path:"",query:""};function x(e){const t=e.indexOf("?");return-1!==t?(T.path=e.slice(0,t),T.query=e.slice(t+1)):(T.path=e,T.query=null),T}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=x(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function I(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function R(e,t){return e=N(e),t=N(t),ie(e)===ie(t)}function N(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function U(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function W(e,t,r=!1){const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function L(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(W(e,w))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(W(e,n[t]))return!0}return!1}function J(e){return v[e]||(re(e)||te(e)?v[e]=[new y(q(e))]:v[e]=[new y(`http://${e}`),new y(`https://${e}`)]),v[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===w.scheme&&w.authority===D(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(B("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function F(e,t=_,r){if(!H(e))return e;const n=Z(e),o=n.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=r?Z(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function Z(e){return function(e){const t=c.httpsDomains;if(!function(e){return f.test(e)||"http"===w.scheme&&te(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===w.scheme&&n===w.authority&&!b.test(e)||(se()&&n===w.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!I(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=x(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function B(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function D(e,t=!1){if(z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return"data:"===e.slice(0,5)}function Q(e){const t=Y(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function V(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&void 0!==e&&"/"===e[0]&&"/"===e[1]}function re(e){return u.test(e)}function ne(e){return d.test(e)||"https"===w.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===w.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=k(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(null==t||!t.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=w.scheme),e)}function de(e,t){const r=k(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function he(e,t,r){const n=k(e),o=n.query||{};return o[t]=String(r),`${n.path}?${E(o)}`}function pe(e,t){const r=k(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=E(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(ge);return t?t[1]:null}const ge=/.*?\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5406),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(7793)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(8936)]).then(r.bind(r,18936)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(6481),r.e(6459),r.e(7996)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(9662),r.e(6353)]).then(r.bind(r,98363)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5886),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(9662),r.e(4325),r.e(1684)]).then(r.bind(r,70299)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(6347)]).then(r.bind(r,16583)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(176),r.e(2398),r.e(7282)]).then(r.bind(r,61576)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6810),r.e(3388)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t){this._port=e,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r});return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const i=(0,c.jt)();return new Promise(((r,o)=>{const c=(0,a.$F)(n,(()=>{var e;const t=this._outJobs.get(i);t&&(this._outJobs.delete(i),null==(e=t.abortHandle)||e.remove(),this._post({type:d,jobId:i}),o((0,a.zE)()))})),l={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(i,l),this._post({type:h,jobId:i,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_close(){this._channel&&(this._channel=null),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{var t;null==(t=e.abortHandle)||t.remove(),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&-1!==t.indexOf(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e).type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){var t;const{jobId:r,error:n,data:s}=e,i=this._outJobs;if(!i.has(r))return;const a=i.get(r);i.delete(r),null==(t=a.abortHandle)||t.remove(),n?a.reject(o.Z.fromJSON(JSON.parse(n))):a.resolve(s)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{Cs:()=>n,jt:()=>a,oi:()=>l,QM:()=>u,AB:()=>c});var n,o,s=r(80442);(o=n||(n={}))[o.HANDSHAKE=0]="HANDSHAKE",o[o.OPEN=1]="OPEN",o[o.OPENED=2]="OPENED",o[o.RESPONSE=3]="RESPONSE",o[o.INVOKE=4]="INVOKE",o[o.ABORT=5]="ABORT",o[o.CLOSE=6]="CLOSE",o[o.OPEN_PORT=7]="OPEN_PORT",o[o.ON=8]="ON";let i=0;function a(){return i++}function c(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function l(e,t,r,o){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(s=f(o),t.data=r):(s=f(r.transferList),t.data=r.result),s?e.postMessage(t,s):e.postMessage(t)}function u(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function f(e){if(!e||!e.length)return null;if((0,s.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,id:()=>a,qh:()=>c,i8:()=>s,Nv:()=>i});var n=r(80442),o=r(17452);const s="4.23",i={async request(e,t){var n;const{default:s}=await r.e(3172).then(r.bind(r,3172)),i=e.options,a=i.responseType;i.signal=null==t?void 0:t.signal,i.responseType="native"===a||"native-request-init"===a?"native-request-init":["blob","json","text"].includes(a)&&null!=(n=(0,o.oh)(e.url))&&n.after?a:"array-buffer";const c=await s(e.url,i),l={data:c.data,ssl:c.ssl};switch(c.requestOptions.responseType){case"native-request-init":return delete l.data.signal,l;case"blob":l.data=await l.data.arrayBuffer();break;case"json":l.data=(new TextEncoder).encode(JSON.stringify(l.data)).buffer;break;case"text":l.data=(new TextEncoder).encode(l.data).buffer}return{result:l,transferList:[l.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")||((0,n.Z)("edge")||(0,n.Z)("trident"))&&console.warn("Deprecated browser - see http://esriurl.com/oldbrowser")},17202:(e,t,r)=>{"use strict";r.d(t,{r:()=>n,$:()=>o});const n="20220323",o="c28564c6883e903e24fea4e0add902fedc81aa4b"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{24:"5d5fa2b1fc48a17eb9ab",86:"666f3fc44eaee390d2b1",176:"93ace2e16c102db1bc29",214:"53a150a1eec3894e2a9e",223:"5bdd4df2b0ea60dba368",247:"a0450fbf01de854f5c97",280:"73a3ad2146bfea9f5dce",565:"0018053ac16a09feba70",576:"812a5abfadd747a09b6f",609:"792fc86380a84b6ac98e",635:"86ec93705546377103b0",639:"db2604563294bf49bbf9",678:"ea313474f460ce31b6d5",712:"93bd67b4258e84c1e6f0",819:"5d3e774ce7b006c8cba8",999:"da7cce130c459c84a794",1188:"b04af5e4a9ae0c90a1de",1197:"e9d59300727f5e52e148",1400:"de337486515d9aff478b",1412:"8d95f3a3f776fef3f9cb",1421:"7fa2d758a24bbaaab0bf",1433:"52489e2f7748dc610263",1534:"6ef8de3aa9a8d9c22161",1562:"6141d433dda78b29e6e1",1684:"410e9b40a2b7f88ea669",1773:"4d2ef57ff3a5cfc1313f",1785:"d88cb7568e2f8ac9905b",1916:"3011f1c1ee5631df98b2",2133:"3403cb53e4e60923c5fc",2134:"070a78b488f92d022495",2279:"cab3f15de3686ca966ec",2304:"d209d82484aa725c5aa9",2397:"3d70f945621de60c7b14",2398:"2a1adc5de77f832b31de",2399:"467b5faa1c90d9821609",2515:"68fc1d7c3fd10a7205c4",3003:"2dcdad8e77bb4bd82680",3027:"0c711b129d501b1d4439",3127:"45155ec947e3f4511c08",3172:"10322d990cda5aedf2f0",3230:"29eb733e18be5a778f4a",3388:"dd47b92663f21fc442b8",3529:"2f6bff1aa485cf22527d",3668:"85fde4b92b0c212f5ff6",3852:"62c683f44c297d239ab8",4166:"8cfefa829131ec234de3",4325:"c7da2f1bdda4de915210",4358:"f977977564b2b75332a9",4369:"2758b8c1fc9a29b71470",4475:"e07cd9d316923546745c",4499:"f971884d4e7400d88a21",4547:"592e91f00549c5b20a2f",4579:"11a45709b703be84caaf",4695:"778d55486ce1e96338d4",4720:"113362697da1b69deaed",4889:"28a5878cbe5880476855",4959:"ae7dbdab79bca1e11741",5163:"3d52f71bf73811246d52",5235:"8b4c76cebb100e6c06f8",5257:"49d645e0bce92c156a4b",5307:"19e74eebecf4aac8cb72",5313:"15a969377bab11e7fd77",5318:"4837b6dc4b4878b01018",5329:"0a4401a148c3cb73d6ff",5358:"7691aa2227321066149d",5406:"4fc0a5f51be0ee462f0e",5410:"3e030fef8292b5e42295",5517:"591dd9e631437f92fa6b",5808:"096eb783027492e82937",5823:"fe1f3c93c92bc80810a4",5837:"42c67e6579b54844ec06",5853:"341dfd1b8201725518b9",5886:"2dd00e2bc45445cac33c",6088:"c087477e016da3827f3e",6233:"a66fd506069e3c776e1b",6237:"c544df83e86a9d36b68c",6347:"cc2bbd979dde20369b47",6353:"c52feec2175d8378ec90",6459:"7dcf52d3db3903c8eb9f",6481:"e84b935c285888a892c1",6550:"3894fe150674f64d6f19",6619:"b6d3d3b4807a2c6be002",6690:"6b6ad7d34669e2a8e52f",6710:"d11d1d294ccc4ccdf60f",6748:"7110152ed817433ceec0",6774:"4a830f056c4d0ed93928",6785:"43586fec92d0e9545972",6810:"411db587521e12c593be",6841:"b426f7b4c3dc60a366f6",6903:"e57b71ba70f088a3a052",6968:"f9579dd231563114fb30",7039:"60553206e233bf18a0a2",7054:"7adf62addc056a6309a5",7055:"8fb2fb11646d3973e8da",7277:"c23d965a55215168a1a2",7282:"b160857d5d25e8b56335",7284:"160052071932e0deda52",7319:"36df90c086bdb14d903b",7572:"6f827a32646bab0a8777",7604:"6d01a79473d6556b5c90",7682:"2a40d566961cce44426e",7793:"bfe8ca8b69975bfb2167",7845:"5b696059d1c392353fc1",7873:"93eb468381bfcf0e47d7",7913:"9f458f10dc65b185f66e",7996:"a6a2131bb9e10463c6fb",8014:"013eefcf29d02f955676",8062:"3bbff5ea1ea0e955c592",8121:"4f90019bf2a1fbf3c754",8163:"c75745292f7eb5f8d3f1",8227:"1f394b20410fddb30a96",8234:"c415af3787d6af66fc9e",8297:"b59a296f0371b6e26508",8326:"d34daffae237de764aab",8422:"7f91f70ef69a7e24f8e2",8625:"e4019b63a1fe74e2c842",8734:"f6e7506ee0a7b132a65f",8739:"98a63d4a405b11ac70b5",8758:"6d7fa026f58fd0c68a39",8828:"13b04d5bf348ab5054c2",8833:"fa42e7b062e44940617e",8927:"1e0498dc9836658d9aba",8936:"fffea9587ec14c6d34e8",9032:"f720ce44e0af6a68b608",9070:"1d4bc5b86d436fd09603",9127:"5cd20be7d545e84937a2",9151:"9bcec5ff5afc2bcd753a",9153:"9c6be39f1f21ab8b1c2d",9169:"f7ae0344257e6e08469b",9254:"f19feacc02a2091b6583",9291:"214910032945dd2d86b0",9296:"78ccff2011adbd73f10b",9490:"8fcabb9332d1d425e64f",9662:"d50d2bf051ed9f2d2008",9754:"c512898c1fc9072c2c5e",9870:"52c972e98d60a0c62a6b",9884:"356db8b8297282c77291",9932:"3d6d9906a534ddd8fa37",9941:"365176c3b81e191ede66",9989:"807ffca9c71313cf2ea8"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
|
|
1
|
+
var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s}),r(80442);var n,o=r(78286);const s={apiKey:void 0,applicationUrl:null==(n=globalThis.location)?void 0:n.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,o.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.23.1";s.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}s.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(s,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),s.request.corsEnabledServers=[],s.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof i))return new i(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=void 0,this instanceof o&&(this.message=t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(function(e,r){if(""===r)return"$";const o=(0,n.hS)(r,t),s=null==o?"":o;if(void 0===s)throw new Error(`could not find key "${r}" in template`);return s.toString()}))}(t,r)||"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=null==e?Math.random()*n._m:e}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{"use strict";r.d(t,{SO:()=>u,a9:()=>c,fS:()=>s,cq:()=>d,zG:()=>i,w6:()=>l,Od:()=>g,e$:()=>h,FY:()=>b});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function i(e){return e&&"number"==typeof e.length}const a=!!Array.prototype.fill;function c(e,t){if(a)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function l(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class u{constructor(){this.last=0}}const f=new u;function d(e,t,r,n){n=n||f;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function h(e,t,r,n){const o=null==r?e.length:r,s=d(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const p=new Set;function b(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;p.clear();for(let e=0;e<n;++e)p.add(t[e]);o=o||f;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(p.has(e[t])&&(s&&s.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;for(let t=0;t<i;++t)if(p.has(e[t])&&(s&&s.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;return p.clear(),r}function g(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{vT:()=>n,on:()=>o,IH:()=>s})},80442:(e,t,r)=>{"use strict";var n,o;let s;var i,a;function c(e){return"function"==typeof s[e]?s[e]=s[e](globalThis):s[e]}r.d(t,{Z:()=>c}),s=null!=(n=globalThis.dojoConfig)&&n.has||null!=(o=globalThis.esriConfig)&&o.has?{...null==(i=globalThis.dojoConfig)?void 0:i.has,...null==(a=globalThis.esriConfig)?void 0:a.has}:{},c.add=(e,t,r,n)=>((n||void 0===s[e])&&(s[e]=t),r&&c(e)),c.cache=s,c.add("esri-deprecation-warnings",!0),(()=>{var e;c.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const t="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(c.add("host-browser",t),c.add("host-node","object"==typeof globalThis.process&&(null==(e=globalThis.process.versions)?void 0:e.node)&&globalThis.process.versions.v8),c.add("dom",t),c("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(c.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),c.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),c.add("khtml",r.includes("Konqueror")?n:void 0),c.add("edge",parseFloat(t.split("Edge/")[1])||void 0),c.add("opr",parseFloat(t.split("OPR/")[1])||void 0),c.add("webkit",!c("wp")&&!c("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),c.add("chrome",!c("edge")&&!c("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),c.add("android",!c("wp")&&parseFloat(t.split("Android ")[1])||void 0),c.add("safari",!r.includes("Safari")||c("wp")||c("chrome")||c("android")||c("edge")||c("opr")?void 0:parseFloat(r.split("Version/")[1])),c.add("mac",r.includes("Macintosh")),!c("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));c.add(e,n),c.add("ios",n)}c.add("trident",parseFloat(r.split("Trident/")[1])||void 0),c("webkit")||(!t.includes("Gecko")||c("wp")||c("khtml")||c("trident")||c("edge")||c.add("mozilla",n),c("mozilla")&&c.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&c.add("esri-mobile",t),r&&c.add("esri-iPhone",r),c.add("esri-geolocation",!!navigator.geolocation)}c.add("esri-canvas-svg-support",!c("trident")),c.add("esri-wasm","WebAssembly"in globalThis),c.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),c.add("esri-atomics","Atomics"in globalThis),c.add("esri-workers","Worker"in globalThis),c.add("web-feat:cache","caches"in globalThis),c.add("esri-workers-arraybuffer-transfer",!c("safari")||Number(c("safari"))>=12),c.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),c.add("featurelayer-simplify-payload-size-factors",[1,1,4]),c.add("featurelayer-snapshot-enabled",!0),c.add("featurelayer-snapshot-point-min-threshold",8e4),c.add("featurelayer-snapshot-point-max-threshold",4e5),c.add("featurelayer-snapshot-point-coverage",.1),c.add("featurelayer-advanced-symbols",!1),c.add("featurelayer-pbf",!0),c.add("featurelayer-pbf-statistics",!1),c.add("feature-layers-workers",!0),c.add("feature-polyline-generalization-factor",1),c.add("mapview-transitions-duration",200),c.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),c.add("mapserver-pbf-enabled",!1),c("host-webworker")||c("host-browser")&&(c.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),c.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{c.add("esri-image-decode",!0,!0,!0)})).catch((()=>{c.add("esri-image-decode",!1,!0,!0)}))}return!1})),c.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{d9:()=>i,fS:()=>d,yd:()=>s,Vo:()=>a}),r(67676),r(80442);var n=r(70586),o=r(1533);function s(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&s(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function i(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(c(e))return e.clone();if(l(e))return e.map(i);if(u(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=i(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(l(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(c(e))return e.clone();if(!u(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function f(e){if((0,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(e))return(0,o.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,i(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(i(e))})),t}return null}function d(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e){return void 0===e}function i(e,t){return n(e)?t(e):null}function a(e){return e}function c(e,t){if(o(e))throw new Error(t);return e}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e,t){return n(e)?e:t}function f(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function h(e){return n(e)&&e.remove(),null}function p(e){return n(e)&&e.release(),null}function b(e){return null}function g(e,t){const r=new Array;for(const n of e)r.push(y(n,null,t));return r}function m(e,t){for(const r of e)i(r,t)}function y(e,t,r){return n(e)?r(e):t}function v(e){return e.filter((e=>n(e)))}function w(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function _(e){return e}r.d(t,{yw:()=>i,j0:()=>_,SC:()=>f,O3:()=>d,lV:()=>v,JR:()=>m,U2:()=>w,Wi:()=>o,pC:()=>n,o8:()=>s,Fd:()=>g,R2:()=>y,Bd:()=>b,RY:()=>p,hw:()=>h,Wg:()=>a,Pt:()=>l,s3:()=>c,yl:()=>u})},78286:(e,t,r)=>{"use strict";r.d(t,{RH:()=>o,hS:()=>s,RB:()=>i});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce((function(e,o){let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{-1===s.indexOf(e)&&s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>C,$6:()=>c,Ue:()=>l,zE:()=>u,dD:()=>_,hh:()=>T,vr:()=>x,Ds:()=>j,as:()=>O,WW:()=>P,R8:()=>w,D_:()=>v,Hc:()=>h,y8:()=>E,fu:()=>g,$F:()=>m,d1:()=>k,DB:()=>S,r9:()=>p,k_:()=>f,H9:()=>b,Yn:()=>M,gx:()=>A,Hl:()=>y});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o,s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e){return Promise.all(e)}function l(e){return new Promise(((t,r)=>{try{e(t,r)}catch(e){Promise.resolve().then((()=>r(e)))}}))}function u(e="Aborted"){return new s.Z("AbortError",e)}function f(e,t="Aborted"){if(h(e))throw u(t)}function d(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function h(e){const t=d(e);return(0,a.pC)(t)&&t.aborted}function p(e){if(v(e))throw e}function b(e){if(!v(e))throw e}function g(e,t){const r=d(e);if(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function m(e,t){const r=d(e);if(!(0,a.Wi)(r))return f(r),(0,i.IH)(r,"abort",(()=>t(u())))}function y(e,t){const r=d(t);return(0,a.Wi)(r)?e:new Promise(((r,n)=>{let o=g(t,(()=>n(u())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function v(e){return e&&"AbortError"===e.name}function w(e){return e.catch((e=>{if(!v(e))throw e}))}function _(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}function O(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e);return O(t.map((t=>e[t]))).then((e=>{const r={};return t.forEach(((t,n)=>r[t]=e[n])),r}))}const t=e;return l((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}function P(e){return O(e).then((e=>e.filter((e=>!!e.value)).map((e=>e.value))))}function k(e){return Promise.reject(e)}function S(e){return Promise.resolve(e)}function C(e,t,r){const n=new AbortController;return g(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);g(n,(()=>{s&&(clearTimeout(s),o(u()))}))}))}function E(e){return e&&"function"==typeof e.then}function A(e){return E(e)?e:Promise.resolve(e)}function j(e,t=-1){let r,n,o,s,i=null;const c=(...l)=>{if(r){n=l,s&&s.reject(u()),s=_();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||_(),s=null,t>0){const n=new AbortController;r=A(e(...l,n.signal));const o=r;C(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=A(e(...l));const f=()=>{const e=n;n=o=r=i=null,null!=e&&c(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return c}function T(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}function x(e,t){let r,n=new AbortController;const o=e(n.signal);let s={promise:o,finished:!1,abort:()=>{n&&(n.abort(),n=null)}};const i=()=>{s&&(s.finished=!0,s=null),(0,a.pC)(r)&&(r.remove(),r=null),n=null};return o.then(i,i),r=g(t,(()=>{(0,a.pC)(s)&&s.abort()})),s}function M(e){return Promise.resolve().then((()=>{f(e)}))}},19153:(e,t,r)=>{"use strict";r.d(t,{Qs:()=>a,hP:()=>c,gx:()=>i,Cb:()=>l});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return null==e?"":e}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&-1!==t.indexOf(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,eP:()=>s,xZ:()=>h,fS:()=>p,z3:()=>l,Hx:()=>f,W0:()=>i,Uc:()=>u,ZY:()=>d,lq:()=>a,KZ:()=>c,tP:()=>o})},17452:(e,t,r)=>{"use strict";r.d(t,{R9:()=>y,qg:()=>j,tD:()=>$,ZN:()=>he,fl:()=>pe,rS:()=>V,Ie:()=>ue,sJ:()=>Y,AH:()=>Q,io:()=>ee,L:()=>P,TI:()=>O,vt:()=>ce,oh:()=>U,P$:()=>D,Ml:()=>be,ed:()=>I,b7:()=>A,D6:()=>W,tm:()=>R,YP:()=>H,jc:()=>z,HK:()=>K,$U:()=>ne,oC:()=>te,kl:()=>L,v_:()=>B,hF:()=>q,_l:()=>X,PF:()=>F,Fv:()=>Z,B7:()=>E,u0:()=>S,Yd:()=>ae,Hu:()=>de,Qj:()=>le,hO:()=>oe,mN:()=>k});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const v={};let w=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(w.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${w.scheme}://${w.host}${null!=w.port?`:${w.port}`:""}${t}`}();const O=()=>w,P=()=>_;function k(e){const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=S(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function S(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function E(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function A(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=I(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),k(r)}function j(e){const t=I(e);let r,n;if(t){const e=x(t.proxyUrl);r=e.path,n=e.query?S(e.query):null}if(r){const t=k(e);e=r+"?"+t.path;const o=E({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const T={path:"",query:""};function x(e){const t=e.indexOf("?");return-1!==t?(T.path=e.slice(0,t),T.query=e.slice(t+1)):(T.path=e,T.query=null),T}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=x(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function I(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function R(e,t){return e=N(e),t=N(t),ie(e)===ie(t)}function N(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function U(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function W(e,t,r=!1){const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function L(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(W(e,w))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(W(e,n[t]))return!0}return!1}function J(e){return v[e]||(re(e)||te(e)?v[e]=[new y(q(e))]:v[e]=[new y(`http://${e}`),new y(`https://${e}`)]),v[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===w.scheme&&w.authority===D(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(B("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function F(e,t=_,r){if(!H(e))return e;const n=Z(e),o=n.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=r?Z(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function Z(e){return function(e){const t=c.httpsDomains;if(!function(e){return f.test(e)||"http"===w.scheme&&te(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===w.scheme&&n===w.authority&&!b.test(e)||(se()&&n===w.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!I(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=x(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function B(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function D(e,t=!1){if(z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return"data:"===e.slice(0,5)}function Q(e){const t=Y(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function V(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&void 0!==e&&"/"===e[0]&&"/"===e[1]}function re(e){return u.test(e)}function ne(e){return d.test(e)||"https"===w.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===w.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=k(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(null==t||!t.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=w.scheme),e)}function de(e,t){const r=k(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function he(e,t,r){const n=k(e),o=n.query||{};return o[t]=String(r),`${n.path}?${E(o)}`}function pe(e,t){const r=k(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=E(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(ge);return t?t[1]:null}const ge=/.*?\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5406),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(7793)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(8936)]).then(r.bind(r,18936)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(6481),r.e(6459),r.e(7996)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(9662),r.e(6353)]).then(r.bind(r,98363)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5886),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(9662),r.e(4325),r.e(1684)]).then(r.bind(r,70299)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(6347)]).then(r.bind(r,16583)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(176),r.e(2398),r.e(7282)]).then(r.bind(r,61576)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6810),r.e(3388)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t){this._port=e,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r});return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const i=(0,c.jt)();return new Promise(((r,o)=>{const c=(0,a.$F)(n,(()=>{var e;const t=this._outJobs.get(i);t&&(this._outJobs.delete(i),null==(e=t.abortHandle)||e.remove(),this._post({type:d,jobId:i}),o((0,a.zE)()))})),l={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(i,l),this._post({type:h,jobId:i,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_close(){this._channel&&(this._channel=null),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{var t;null==(t=e.abortHandle)||t.remove(),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&-1!==t.indexOf(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e).type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){var t;const{jobId:r,error:n,data:s}=e,i=this._outJobs;if(!i.has(r))return;const a=i.get(r);i.delete(r),null==(t=a.abortHandle)||t.remove(),n?a.reject(o.Z.fromJSON(JSON.parse(n))):a.resolve(s)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{Cs:()=>n,jt:()=>a,oi:()=>l,QM:()=>u,AB:()=>c});var n,o,s=r(80442);(o=n||(n={}))[o.HANDSHAKE=0]="HANDSHAKE",o[o.OPEN=1]="OPEN",o[o.OPENED=2]="OPENED",o[o.RESPONSE=3]="RESPONSE",o[o.INVOKE=4]="INVOKE",o[o.ABORT=5]="ABORT",o[o.CLOSE=6]="CLOSE",o[o.OPEN_PORT=7]="OPEN_PORT",o[o.ON=8]="ON";let i=0;function a(){return i++}function c(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function l(e,t,r,o){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(s=f(o),t.data=r):(s=f(r.transferList),t.data=r.result),s?e.postMessage(t,s):e.postMessage(t)}function u(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function f(e){if(!e||!e.length)return null;if((0,s.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,id:()=>a,qh:()=>c,i8:()=>s,Nv:()=>i});var n=r(80442),o=r(17452);const s="4.23",i={async request(e,t){var n;const{default:s}=await r.e(3172).then(r.bind(r,3172)),i=e.options,a=i.responseType;i.signal=null==t?void 0:t.signal,i.responseType="native"===a||"native-request-init"===a?"native-request-init":["blob","json","text"].includes(a)&&null!=(n=(0,o.oh)(e.url))&&n.after?a:"array-buffer";const c=await s(e.url,i),l={data:c.data,ssl:c.ssl};switch(c.requestOptions.responseType){case"native-request-init":return delete l.data.signal,l;case"blob":l.data=await l.data.arrayBuffer();break;case"json":l.data=(new TextEncoder).encode(JSON.stringify(l.data)).buffer;break;case"text":l.data=(new TextEncoder).encode(l.data).buffer}return{result:l,transferList:[l.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")||((0,n.Z)("edge")||(0,n.Z)("trident"))&&console.warn("Deprecated browser - see http://esriurl.com/oldbrowser")},17202:(e,t,r)=>{"use strict";r.d(t,{r:()=>n,$:()=>o});const n="20220324",o="9cf26ea170966c3de028527befb4b12c79e5cd94"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{24:"5d5fa2b1fc48a17eb9ab",86:"666f3fc44eaee390d2b1",176:"93ace2e16c102db1bc29",214:"53a150a1eec3894e2a9e",223:"5bdd4df2b0ea60dba368",247:"a0450fbf01de854f5c97",280:"73a3ad2146bfea9f5dce",565:"0018053ac16a09feba70",576:"812a5abfadd747a09b6f",609:"792fc86380a84b6ac98e",635:"86ec93705546377103b0",639:"db2604563294bf49bbf9",678:"ea313474f460ce31b6d5",712:"93bd67b4258e84c1e6f0",819:"5d3e774ce7b006c8cba8",999:"da7cce130c459c84a794",1188:"b04af5e4a9ae0c90a1de",1197:"e9d59300727f5e52e148",1400:"de337486515d9aff478b",1412:"8d95f3a3f776fef3f9cb",1421:"7fa2d758a24bbaaab0bf",1433:"52489e2f7748dc610263",1534:"6ef8de3aa9a8d9c22161",1562:"6141d433dda78b29e6e1",1684:"410e9b40a2b7f88ea669",1773:"4d2ef57ff3a5cfc1313f",1785:"d88cb7568e2f8ac9905b",1916:"3011f1c1ee5631df98b2",2133:"3403cb53e4e60923c5fc",2134:"070a78b488f92d022495",2279:"cab3f15de3686ca966ec",2304:"d209d82484aa725c5aa9",2397:"3d70f945621de60c7b14",2398:"2a1adc5de77f832b31de",2399:"467b5faa1c90d9821609",2515:"68fc1d7c3fd10a7205c4",3003:"2dcdad8e77bb4bd82680",3027:"0c711b129d501b1d4439",3127:"45155ec947e3f4511c08",3172:"10322d990cda5aedf2f0",3230:"29eb733e18be5a778f4a",3388:"dd47b92663f21fc442b8",3529:"2f6bff1aa485cf22527d",3668:"85fde4b92b0c212f5ff6",3852:"62c683f44c297d239ab8",4166:"8cfefa829131ec234de3",4325:"c7da2f1bdda4de915210",4358:"f977977564b2b75332a9",4369:"2758b8c1fc9a29b71470",4475:"e07cd9d316923546745c",4499:"f971884d4e7400d88a21",4547:"592e91f00549c5b20a2f",4579:"11a45709b703be84caaf",4695:"778d55486ce1e96338d4",4720:"113362697da1b69deaed",4889:"28a5878cbe5880476855",4959:"ae7dbdab79bca1e11741",5163:"3d52f71bf73811246d52",5235:"8b4c76cebb100e6c06f8",5257:"49d645e0bce92c156a4b",5307:"19e74eebecf4aac8cb72",5313:"15a969377bab11e7fd77",5318:"4837b6dc4b4878b01018",5329:"0a4401a148c3cb73d6ff",5358:"7691aa2227321066149d",5406:"4fc0a5f51be0ee462f0e",5410:"3e030fef8292b5e42295",5517:"591dd9e631437f92fa6b",5808:"096eb783027492e82937",5823:"fe1f3c93c92bc80810a4",5837:"42c67e6579b54844ec06",5853:"341dfd1b8201725518b9",5886:"2dd00e2bc45445cac33c",6088:"c087477e016da3827f3e",6233:"a66fd506069e3c776e1b",6237:"c544df83e86a9d36b68c",6347:"cc2bbd979dde20369b47",6353:"c52feec2175d8378ec90",6459:"7dcf52d3db3903c8eb9f",6481:"e84b935c285888a892c1",6550:"3894fe150674f64d6f19",6619:"b6d3d3b4807a2c6be002",6690:"6b6ad7d34669e2a8e52f",6710:"d11d1d294ccc4ccdf60f",6748:"7110152ed817433ceec0",6774:"4a830f056c4d0ed93928",6785:"43586fec92d0e9545972",6810:"411db587521e12c593be",6841:"b426f7b4c3dc60a366f6",6903:"e57b71ba70f088a3a052",6968:"f9579dd231563114fb30",7039:"60553206e233bf18a0a2",7054:"7adf62addc056a6309a5",7055:"8fb2fb11646d3973e8da",7277:"c23d965a55215168a1a2",7282:"b160857d5d25e8b56335",7284:"160052071932e0deda52",7319:"36df90c086bdb14d903b",7572:"6f827a32646bab0a8777",7604:"6d01a79473d6556b5c90",7682:"2a40d566961cce44426e",7793:"bfe8ca8b69975bfb2167",7845:"5b696059d1c392353fc1",7873:"93eb468381bfcf0e47d7",7913:"9f458f10dc65b185f66e",7996:"a6a2131bb9e10463c6fb",8014:"013eefcf29d02f955676",8062:"3bbff5ea1ea0e955c592",8121:"4f90019bf2a1fbf3c754",8163:"c75745292f7eb5f8d3f1",8227:"1f394b20410fddb30a96",8234:"c415af3787d6af66fc9e",8297:"b59a296f0371b6e26508",8326:"d34daffae237de764aab",8422:"7f91f70ef69a7e24f8e2",8625:"e4019b63a1fe74e2c842",8734:"f6e7506ee0a7b132a65f",8739:"98a63d4a405b11ac70b5",8758:"6d7fa026f58fd0c68a39",8828:"13b04d5bf348ab5054c2",8833:"fa42e7b062e44940617e",8927:"1e0498dc9836658d9aba",8936:"fffea9587ec14c6d34e8",9032:"f720ce44e0af6a68b608",9070:"1d4bc5b86d436fd09603",9127:"5cd20be7d545e84937a2",9151:"9bcec5ff5afc2bcd753a",9153:"9c6be39f1f21ab8b1c2d",9169:"f7ae0344257e6e08469b",9254:"f19feacc02a2091b6583",9291:"214910032945dd2d86b0",9296:"78ccff2011adbd73f10b",9490:"8fcabb9332d1d425e64f",9662:"d50d2bf051ed9f2d2008",9754:"c512898c1fc9072c2c5e",9870:"52c972e98d60a0c62a6b",9884:"356db8b8297282c77291",9932:"3d6d9906a534ddd8fa37",9941:"365176c3b81e191ede66",9989:"807ffca9c71313cf2ea8"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
|
package/config.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";var r;const s={apiKey:void 0,applicationUrl:null==(r=globalThis.location)?void 0:r.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.23.
|
|
5
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";var r;const s={apiKey:void 0,applicationUrl:null==(r=globalThis.location)?void 0:r.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.23.1";s.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}s.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(s,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),s.request.corsEnabledServers=[],s.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0};export{s as default};
|
package/package.json
CHANGED
package/support/basemapUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../Basemap.js";import r from"../config.js";import a from"../core/Collection.js";import
|
|
5
|
+
import e from"../Basemap.js";import r from"../config.js";import a from"../core/Collection.js";import n from"../core/Logger.js";import{isSome as t,isNone as l}from"../core/maybe.js";import{normalize as i,Url as s,makeAbsolute as u}from"../core/urlUtils.js";import{ensureType as c}from"../core/accessorSupport/ensureType.js";import{esriBasemapDefinitions as o}from"./basemapDefinitions.js";const f=n.getLogger("esri.support.basemapUtils");function p(){return{}}function y(e){for(const r in e){const a=e[r];!1===(null==a?void 0:a.destroyed)&&a.destroy(),delete e[r]}}function m(a,n){var t;let l;if("string"==typeof a){if(!(a in o)){const e=Object.entries(o).filter((([e,a])=>r.apiKey&&!a.classic||!r.apiKey&&a.classic&&!a.deprecated)).map((([e])=>`"${e}"`)).join(", ");return f.warn(`Unable to find basemap definition for: ${a}. Try one of these: ${e}`),null}n&&(l=n[a]),l||(l=e.fromId(a),n&&(n[a]=l))}else l=c(e,a);return null!=(t=l)&&t.destroyed&&(f.warn("The provided basemap is already destroyed",{basemap:l}),l=null),l}function d(r,a=null){const n=m(r);if(!n)return null;const t=new e({id:n.id,title:n.title,baseLayers:n.baseLayers.slice(),referenceLayers:n.referenceLayers.slice()});return a&&(t.baseLayers=v(t.baseLayers,a.baseLayers),t.referenceLayers=v(t.referenceLayers,a.referenceLayers)),t.load().catch((()=>{})),t.portalItem=n.portalItem,t}function b(e){let r=null;const a=T(e),n=!a.baseLayers.length;for(const t in o){const e=M(a,q(o[t]),{mustMatchReferences:n});if("equal"===e){r=t;break}"base-layers-equal"===e&&(r=t)}return r}function L(e,r){if(e===r)return!0;return"equal"===M(T(e),T(r),{mustMatchReferences:!0})}function v(e,r){const n=new a;return e.forEach((e=>{const a=r.find((r=>$(j(e),j(r))))||e;n.some((e=>e===a))?n.push(e):n.push(a)})),n}function g(e){return!(null==e||!e.baseLayers.concat(e.referenceLayers).some(S))}function S(e){if(I(e.url))return!0;if("vector-tile"===e.type)for(const r in e.sourceNameToSource){const a=e.sourceNameToSource[r];if(I(null==a?void 0:a.sourceUrl))return!0}return!1}function h(e,r){var a,n,t;if(l(r)||l(e))return{spatialReference:null,updating:!1};if("not-loaded"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const i=r.baseLayers.getItemAt(0);switch(i.loadStatus){case"not-loaded":i.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const s=(("supportedSpatialReferences"in i?i.supportedSpatialReferences:null)||["tileInfo"in i?null==(a=i.tileInfo)?void 0:a.spatialReference:i.spatialReference]).filter(Boolean);return e.spatialReference?{spatialReference:null!=(n=null!=(t=s.find((r=>e.spatialReference.equals(r))))?t:s[0])?n:null,updating:!1}:{spatialReference:s[0],updating:!1}}const R=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function I(e){if(!e)return!1;const r=new s(u(e));return R.test(r.authority)}function T(e){return e?!e.loaded&&e.resourceInfo?q(e.resourceInfo.data):{baseLayers:w(e.baseLayers),referenceLayers:w(e.referenceLayers)}:null}function w(e){return(a.isCollection(e)?e.toArray():e).map(j)}function j(e){var r,a;return{type:e.type,url:A("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl),minScale:"minScale"in e&&null!=e.minScale?e.minScale:0,maxScale:"maxScale"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:"map-image"!==e.type&&"wms"!==e.type||!t(e.sublayers)||null==(r=e.sublayers)?void 0:r.map((e=>({id:e.id,visible:e.visible}))),activeLayerId:"wmts"===e.type?null==(a=e.activeLayer)?void 0:a.id:void 0}}function q(e){return e?{baseLayers:x(e.baseMapLayers.filter((e=>!e.isReference))),referenceLayers:x(e.baseMapLayers.filter((e=>e.isReference)))}:null}function x(e){return e.map((e=>U(e)))}function U(e){let r;switch(e.layerType){case"VectorTileLayer":r="vector-tile";break;case"ArcGISTiledMapServiceLayer":r="tile";break;default:r="unknown"}return{type:r,url:A(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:null!=e.minScale?e.minScale:0,maxScale:null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function M(e,r,a){if(null!=e!=(null!=r))return"not-equal";if(!e)return"equal";if(!k(e.baseLayers,r.baseLayers))return"not-equal";return k(e.referenceLayers,r.referenceLayers)?"equal":a.mustMatchReferences?"not-equal":"base-layers-equal"}function k(e,r){if(e.length!==r.length)return!1;for(let a=0;a<e.length;a++)if(!$(e[a],r[a]))return!1;return!0}function $(e,r){if(e.type!==r.type||e.url!==r.url||e.minScale!==r.minScale||e.maxScale!==r.maxScale||e.visible!==r.visible||e.opacity!==r.opacity)return!1;if(t(e.activeLayerId)||t(r.activeLayerId))return e.activeLayerId===r.activeLayerId;if(t(e.sublayers)||t(r.sublayers)){if(l(e.sublayers)||l(r.sublayers)||e.sublayers.length!==r.sublayers.length)return!1;for(let a=0;a<e.sublayers.length;a++){const n=e.sublayers.at(a),t=r.sublayers.at(a);if(n.id!==t.id||n.visible!==t.visible)return!1}}return!0}function A(e){return e?i(e).replace(/^\s*https?:/i,"").toLowerCase():""}export{d as clonePreservingTiledLayers,L as contentEquals,p as createCache,y as destroyCache,m as ensureType,h as findSpatialReference,b as getWellKnownBasemapId,g as hasDeveloperBasemapLayer,S as isDeveloperBasemapLayer};
|
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const c="20220324",e="9cf26ea170966c3de028527befb4b12c79e5cd94";export{c as buildDate,e as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import i from"../../../Graphic.js";import r from"../../../core/Collection.js";import s from"../../../core/Error.js";import a from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import o from"../../../core/Logger.js";import{applySome as l,isSome as h,unwrap as u,isNone as d}from"../../../core/maybe.js";import{debounce as p,isAbortError as y}from"../../../core/promiseUtils.js";import{watch as c,whenOnce as f,initial as g}from"../../../core/reactiveUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import v from"../../../layers/effects/FeatureEffectView.js";import b from"../../../layers/support/FeatureFilter.js";import R from"../../../rest/support/FeatureSet.js";import x from"../../../rest/support/Query.js";import{MAX_FILTERS as S}from"../engine/webgl/definitions.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import{createSchema as U}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as F}from"./features/tileRenderers.js";import{findSizeVV as C,createClusterCountSizeVariable as I,isClusterCompatibleRenderer as E,createClusterRenderer as O}from"./support/clusterUtils.js";import T from"./support/FeatureCommandQueue.js";import q from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as V}from"./support/util.js";import{TileManager as j}from"../tiling/TileManager.js";import{FeatureLayerView as N}from"../../layers/FeatureLayerView.js";import L from"../../layers/LayerView.js";import{RefreshableLayerView as P}from"../../layers/RefreshableLayerView.js";import{getWebGL1Capabilities as k}from"../../webgl/capabilities.js";import H from"../../../geometry/Extent.js";function z(e){return e&&"openPorts"in e}const J=o.getLogger("esri.views.2d.layers.FeatureLayerView2D");let Q=class extends(N(P(w(L)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new T({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=p((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new v,this._lastDefinitionExpression=null}destroy(){var e;l(this._updateClusterSizeTask,(e=>e.remove())),null==(e=this._proxy)||e.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.handles.add([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),c((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),{initial:!0,sync:!0})])}async _initProxy(){if("isTable"in this.layer&&this.layer.isTable)throw new s("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});this._proxy&&this._proxy.destroy();const e=this._createClientOptions();return this._set("_proxy",new q({client:e})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get orderByFields(){return"stream"!==this._serviceOptions.type&&this._serviceOptions.orderByFields}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,i=this.view.floors,{definitionExpression:r}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="feature"===t.type?t.gdbVersion:void 0,o="feature"===t.type&&t.historicMoment?t.historicMoment.getTime():void 0,{timeExtent:l}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,p="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,y=JSON.stringify(this.clips),c=t.featureReduction&&t.featureReduction.toJSON(),f="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),g="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),"");return JSON.stringify({orderBy:f,sublayerHash:g,filterHash:h(this.filter)&&this.filter.toJSON(),effectHash:h(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:p,gdbVersion:n,definitionExpression:r,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:l,floors:i,clipsHash:y,featureReduction:c,customParameters:u,apiKey:d})}highlight(e){var t;let s;return e instanceof i?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:Array.isArray(e)&&e.length>0?s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>null==e?void 0:e.getObjectId())):r.isCollection(e)&&e.length>0&&(s=e.map((e=>null==e?void 0:e.getObjectId())).toArray()),s=null==(t=s)?void 0:t.filter((e=>null!=e)),s&&s.length?(this._addHighlight(s),{remove:()=>this._removeHighlight(s)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,r){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(r);if(0===s.length)return null;const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((e=>this._createHittestResult(t.fromJSON(e)))),...a.map((e=>this._createHittestResult(i.fromJSON(e))))]}async queryAggregates(){return(await this._proxy.getAggregates()).map((e=>t.fromJSON(e)))}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),r,i)}async queryUniqueValues(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),r,i)}async queryClassBreaks(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),r,i)}async queryHistogram(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),r,i)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=R.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=R.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:H.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:i,removed:r}=this._tileStrategy.update(e);(i.length||r.length)&&this._proxy.updateTiles({added:i,removed:r}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new j({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.handles.add(c((()=>this.renderingConfigHash),(()=>this._update()),g),"attach"),"stream"!==this.layer.type&&this.handles.add(this.layer.on("edits",(e=>this._edit(e))),"attach")}detach(){var e;this._commandsQueue.clear(),null==(e=this._proxy)||e.stop(),this.container.removeAllChildren(),this.handles.remove("attach"),this.tileRenderer&&(this.tileRenderer.uninstall(this.container),this.tileRenderer=null),this._tileStrategy&&(this._tileStrategy.destroy(),this._tileStrategy=null),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){var e;const t="renderer"in this.layer&&null!=this.layer.renderer,i=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,s=!this._proxy||!this._proxy.isReady,n=this._pipelineIsUpdating,o=null==this.tileRenderer||(null==(e=this.tileRenderer)?void 0:e.updating),l=t&&(i||r||s||n||o);return a("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${l}\n -> hasRenderer ${t}\n -> hasPendingCommand ${i}\n -> updatingRequiredFields ${r}\n -> updatingProxy ${s}\n -> updatingPipeline ${n}\n -> updatingTileRenderer ${o}\n`),l}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){var t;const i="path"in e,r="editingInfo"in this.layer&&(null==(t=this.layer.editingInfo)?void 0:t.lastEditDate),s=!!this.layer.refreshInterval,n=!r&&s;if(i&&("feature"===this.layer.type||"subtype-group"===this.layer.type)&&"point"===this.layer.geometryType&&this.layer.capabilities.query.supportsPagination&&!this.layer.capabilities.operations.supportsEditing&&!n&&a("featurelayer-snapshot-enabled"))try{const e=await this.layer.queryFeatureCount();if(e<=a("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=a("featurelayer-snapshot-point-max-threshold"),i=a("featurelayer-snapshot-point-coverage"),r=this.view.extent,s=u(this.layer.fullExtent),n=null==s?void 0:s.clone().intersection(r),o=h(n)?n.width*n.height:0,l=(null==s?void 0:s.width)*(null==s?void 0:s.height),d=0===l?0:o/l;if(e<=t&&d>=i)return{mode:"snapshot",featureCount:e}}catch(o){J.warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:o})}return{mode:"on-demand"}}async _createServiceOptions(){var e;const t=this.layer;if("stream"===t.type)return null;const{capabilities:i,objectIdField:r}=t,s=t.fields.map((e=>e.toJSON())),a=h(t.fullExtent)&&t.fullExtent.toJSON(),o=V(t.geometryType),l=t.timeInfo&&t.timeInfo.toJSON()||null,u=t.spatialReference?t.spatialReference.toJSON():null,d="feature"===t.type?t.globalIdField:null;let p;"ogc-feature"===t.type?p=t.source.getFeatureDefinition():z(t.source)?p=await t.source.openPorts():t.parsedUrl&&(p=n(t.parsedUrl),"dynamicDataSource"in t&&t.dynamicDataSource&&(p.query={layer:JSON.stringify({source:t.dynamicDataSource})}));const y="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,c=null!=(e="subtypeField"in this.layer&&this.layer.subtypeField)?e:null,{mode:f,featureCount:g}=await this._detectQueryMode(p);let m=this.layer.objectIdField;if("feature"===this.layer.type&&h(this.layer.orderBy)&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(m=e)}return{type:f,timeReferenceUnknownClient:y,subtypeField:c,featureCount:g,globalIdField:d,maxRecordCount:i.query.maxRecordCount,tileMaxRecordCount:i.query.tileMaxRecordCount,capabilities:i,fields:s,fullExtent:a,geometryType:o,objectIdField:r,source:p,timeInfo:l,spatialReference:u,orderByFields:m}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=x.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._clearTiles();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,i=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),r=t&&this.availableFields.includes(t);return i&&!r?(J.error(new s("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:i}=this;await this._updateRequiredFields();const{renderer:r}=this._getEffectiveRenderer();this._set("_effectiveRenderer",r);const s=this._createSchemaConfig(),a=this._createConfiguration(s,i,t.filter),n=this._lastDefinitionExpression!==a.definitionExpression;this._lastDefinitionExpression=a.definitionExpression;const o=this._createTileRendererHash(r);if("snapshot"===this._serviceOptions.type&&(a.schema.source.featureCount=this._serviceOptions.featureCount),o!==this._tileRendererHash){await this._initTileRenderer(r);const e=this.layer,t="stream"===e.type?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(r),"stream"!==e.type&&z(e.source)&&(t.source=await e.source.openPorts());const i={added:this._tileStrategy.tileKeys(),removed:[]};await this._proxy.startup(this.view.featuresTilingScheme,a,t,i),this.hasHighlight()&&await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),await this._onceTilesUpdated(),this.tileRenderer.onConfigUpdate(r)}else{"snapshot"===this._serviceOptions.type&&n&&(a.schema.source.featureCount=await this.layer.queryFeatureCount());const t=await this._proxy.update(a);(t.mesh||t.targets.aggregate)&&this._lockGPUUploads();try{await this._proxy.applyUpdate(t)}catch(e){y(e)||J.error(e)}(t.mesh||t.targets.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(r),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=o,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){y(t),0}}async _doRefresh(e){this._lockGPUUploads();try{await this._proxy.refresh(e)}catch(t){y(t),0}this._unlockGPUUploads()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return this.watch("_aggregateValueRanges",(async i=>{this._updateClusterEffectiveRendererSizeVariable(e,t,i),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,i){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const r=C(e.visualVariables);if(h(r)&&"cluster_count"===r.field){const s=e.visualVariables.indexOf(r);e.visualVariables[s]=I(t,i);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e="renderer"in this.layer&&this.layer.renderer,t=this.layer.featureReduction;if(h(this._updateClusterSizeTask)&&(this._updateClusterSizeTask.remove(),this._updateClusterSizeTask=null),t&&"cluster"===t.type&&E(e)){const i=t,r=[],s=O(r,e,i,this._aggregateValueRanges);return l(this._updateClusterSizeTask,(e=>e.remove())),this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,i),{renderer:s,aggregateFields:r,featureReduction:t}}return{renderer:e,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}async _initTileRenderer(e){const t=await F(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer.destroy(),this.tileRenderer=null),this.destroyed?null:(this._proxy.tileRenderer=t,this._set("tileRenderer",t),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(e),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${"heatmap"===e.type?"heatmap":"symbol"}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=h(e)?e.timeExtent:null,i=h(this.timeExtent)&&h(t)?this.timeExtent.intersection(t):this.timeExtent||t;let r=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=h(e)&&e.where;r=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!i&&!s)return h(e)?e.toJSON():null;(e=h(e)&&e.clone()||new b).timeExtent=i,r&&(e.where=r);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let i=e||"";if("floorInfo"in t&&t.floorInfo){var r;let e=this.view.floors;if(!e||!e.length)return i;null!=(r=t.floorInfo.viewAllLevelIds)&&r.length&&(e=t.floorInfo.viewAllLevelIds);const s=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));s.push("''");const a=t.floorInfo.floorField;let n="("+a+" IN ({ids}) OR "+a+" IS NULL)";if(n=n.replace("{ids}",s.join(", ")),h(i)&&i.includes(a)){let e=new RegExp("AND \\("+a+".*NULL\\)","g");i=i.replace(e,""),e=new RegExp("\\("+a+".*NULL\\)","g"),i=i.replace(e,""),i=i.replace(/\s+/g," ").trim()}i=""!==i?"("+i+") AND "+n:n}return""!==i?i:null}_createConfiguration(e,t,i){const r="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion:void 0,a=new Array(S),n=this._injectOverrides(t);a[0]=n,a[1]=h(i)?i.toJSON():null;const o=U(e);if(d(o))return null;const l=k();return{definitionExpression:this.layer.definitionExpression,availableFields:this.availableFields,gdbVersion:s,historicMoment:r,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:l.supportsTextureFloat,maxTextureSize:l.maxTextureSize}}_hasRequiredSupport(e){var t;return!("renderer"in e&&"dot-density"===(null==(t=e.renderer)?void 0:t.type)&&!k().supportsTextureFloat)||(J.error(new s("webgl-missing-extension","Missing WebGL extension OES_Texture_Float which is required for DotDensity")),!1)}_onceTilesUpdated(){return this.requestUpdate(),f((()=>!this._pipelineIsUpdating))}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e="feature"===this.layer.type?this.layer.historicMoment:null,t="feature"===this.layer.type?this.layer.gdbVersion:null;return{renderer:"renderer"in this.layer&&this.layer.renderer,spatialReference:this.layer.spatialReference,timeExtent:this.layer.timeExtent,definitionExpression:this.layer.definitionExpression,featureReduction:this.layer.featureReduction,fields:this.layer.fields,geometryType:this.layer.geometryType,historicMoment:e,labelsVisible:"labelsVisible"in this.layer&&this.layer.labelsVisible,labelingInfo:"labelingInfo"in this.layer&&this.layer.labelingInfo,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:t,pixelBuffer:0,orderBy:"orderBy"in this.layer&&this.layer.orderBy?this.layer.orderBy:null,customParameters:{..."customParameters"in this.layer?this.layer.customParameters:void 0,token:"apiKey"in this.layer?this.layer.apiKey:void 0}}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{y(e)||J.error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{y(e)||J.error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createHittestResult(e){return this._setLayersForFeature(e),h(e.geometry)&&(e.geometry.spatialReference=this.view.spatialReference),e}};e([m()],Q.prototype,"_serviceOptions",void 0),e([m()],Q.prototype,"_proxy",void 0),e([m()],Q.prototype,"_pipelineIsUpdating",void 0),e([m()],Q.prototype,"_effectiveRenderer",void 0),e([m()],Q.prototype,"_aggregateValueRanges",void 0),e([m()],Q.prototype,"_commandsQueue",void 0),e([m()],Q.prototype,"featureEffectView",void 0),e([m()],Q.prototype,"labelsVisible",null),e([m({readOnly:!0})],Q.prototype,"queryMode",null),e([m()],Q.prototype,"renderingConfigHash",null),e([m()],Q.prototype,"tileRenderer",void 0),e([m()],Q.prototype,"updating",void 0),Q=e([_("esri.views.2d.layers.FeatureLayerView2D")],Q);const A=Q;export{A as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import i from"../../../Graphic.js";import r from"../../../core/Collection.js";import s from"../../../core/Error.js";import a from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{applySome as o,isSome as h,unwrap as u,isNone as d}from"../../../core/maybe.js";import{debounce as p,isAbortError as y}from"../../../core/promiseUtils.js";import{watch as c,whenOnce as f,initial as g}from"../../../core/reactiveUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import v from"../../../layers/effects/FeatureEffectView.js";import b from"../../../layers/support/FeatureFilter.js";import R from"../../../rest/support/FeatureSet.js";import x from"../../../rest/support/Query.js";import{MAX_FILTERS as S}from"../engine/webgl/definitions.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import{createSchema as U}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as F}from"./features/tileRenderers.js";import{findSizeVV as C,createClusterCountSizeVariable as I,isClusterCompatibleRenderer as E,createClusterRenderer as O}from"./support/clusterUtils.js";import T from"./support/FeatureCommandQueue.js";import q from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as V}from"./support/util.js";import{TileManager as j}from"../tiling/TileManager.js";import{FeatureLayerView as N}from"../../layers/FeatureLayerView.js";import L from"../../layers/LayerView.js";import{RefreshableLayerView as P}from"../../layers/RefreshableLayerView.js";import{getWebGL1Capabilities as k}from"../../webgl/capabilities.js";import z from"../../../geometry/Extent.js";function H(e){return e&&"openPorts"in e}const J=l.getLogger("esri.views.2d.layers.FeatureLayerView2D");let Q=class extends(N(P(w(L)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new T({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=p((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new v,this._lastDefinitionExpression=null}destroy(){var e;o(this._updateClusterSizeTask,(e=>e.remove())),null==(e=this._proxy)||e.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.handles.add([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),c((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),{initial:!0,sync:!0})])}async _initProxy(){if("isTable"in this.layer&&this.layer.isTable)throw new s("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});this._proxy&&this._proxy.destroy();const e=this._createClientOptions();return this._set("_proxy",new q({client:e})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get orderByFields(){return"stream"!==this._serviceOptions.type&&this._serviceOptions.orderByFields}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,i=this.view.floors,{definitionExpression:r}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="feature"===t.type?t.gdbVersion:void 0,l="feature"===t.type&&t.historicMoment?t.historicMoment.getTime():void 0,{timeExtent:o}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,p="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,y=JSON.stringify(this.clips),c=t.featureReduction&&t.featureReduction.toJSON(),f="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),g="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),"");return JSON.stringify({orderBy:f,sublayerHash:g,filterHash:h(this.filter)&&this.filter.toJSON(),effectHash:h(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:p,gdbVersion:n,definitionExpression:r,historicMoment:l,availableFields:e,renderer:a,labelingInfo:s,timeExtent:o,floors:i,clipsHash:y,featureReduction:c,customParameters:u,apiKey:d})}highlight(e){var t;let s;return e instanceof i?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:Array.isArray(e)&&e.length>0?s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>null==e?void 0:e.getObjectId())):r.isCollection(e)&&e.length>0&&(s=e.map((e=>null==e?void 0:e.getObjectId())).toArray()),s=null==(t=s)?void 0:t.filter((e=>null!=e)),s&&s.length?(this._addHighlight(s),{remove:()=>this._removeHighlight(s)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,r){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(r);if(0===s.length)return null;const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((e=>this._createHittestResult(t.fromJSON(e)))),...a.map((e=>this._createHittestResult(i.fromJSON(e))))]}async queryAggregates(){return(await this._proxy.getAggregates()).map((e=>t.fromJSON(e)))}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),r,i)}async queryUniqueValues(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),r,i)}async queryClassBreaks(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),r,i)}async queryHistogram(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),r,i)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=R.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=R.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:z.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:i,removed:r}=this._tileStrategy.update(e);(i.length||r.length)&&this._proxy.updateTiles({added:i,removed:r}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new j({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.handles.add(c((()=>this.renderingConfigHash),(()=>this._update()),g),"attach"),"stream"!==this.layer.type&&this.handles.add(this.layer.on("edits",(e=>this._edit(e))),"attach")}detach(){var e;this._commandsQueue.clear(),null==(e=this._proxy)||e.stop(),this.container.removeAllChildren(),this.handles.remove("attach"),this.tileRenderer&&(this.tileRenderer.uninstall(this.container),this.tileRenderer=null),this._tileStrategy&&(this._tileStrategy.destroy(),this._tileStrategy=null),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){var e;const t="renderer"in this.layer&&null!=this.layer.renderer,i=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,s=!this._proxy||!this._proxy.isReady,n=this._pipelineIsUpdating,l=null==this.tileRenderer||(null==(e=this.tileRenderer)?void 0:e.updating),o=t&&(i||r||s||n||l);return a("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${o}\n -> hasRenderer ${t}\n -> hasPendingCommand ${i}\n -> updatingRequiredFields ${r}\n -> updatingProxy ${s}\n -> updatingPipeline ${n}\n -> updatingTileRenderer ${l}\n`),o}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){var t;const i="path"in e,r="editingInfo"in this.layer&&(null==(t=this.layer.editingInfo)?void 0:t.lastEditDate),s=!!this.layer.refreshInterval,n=!r&&s;if(i&&("feature"===this.layer.type||"subtype-group"===this.layer.type)&&"point"===this.layer.geometryType&&this.layer.capabilities.query.supportsPagination&&!this.layer.capabilities.operations.supportsEditing&&!n&&a("featurelayer-snapshot-enabled"))try{const e=await this.layer.queryFeatureCount();if(e<=a("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=a("featurelayer-snapshot-point-max-threshold"),i=a("featurelayer-snapshot-point-coverage"),r=this.view.extent,s=u(this.layer.fullExtent),n=null==s?void 0:s.clone().intersection(r),l=h(n)?n.width*n.height:0,o=(null==s?void 0:s.width)*(null==s?void 0:s.height),d=0===o?0:l/o;if(e<=t&&d>=i)return{mode:"snapshot",featureCount:e}}catch(l){J.warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:l})}return{mode:"on-demand"}}async _createServiceOptions(){var e;const t=this.layer;if("stream"===t.type)return null;const{capabilities:i,objectIdField:r}=t,s=t.fields.map((e=>e.toJSON())),a=h(t.fullExtent)&&t.fullExtent.toJSON(),l=V(t.geometryType),o=t.timeInfo&&t.timeInfo.toJSON()||null,u=t.spatialReference?t.spatialReference.toJSON():null,d="feature"===t.type?t.globalIdField:null;let p;"ogc-feature"===t.type?p=t.source.getFeatureDefinition():H(t.source)?p=await t.source.openPorts():t.parsedUrl&&(p=n(t.parsedUrl),"dynamicDataSource"in t&&t.dynamicDataSource&&(p.query={layer:JSON.stringify({source:t.dynamicDataSource})}));const y="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,c=null!=(e="subtypeField"in this.layer&&this.layer.subtypeField)?e:null,{mode:f,featureCount:g}=await this._detectQueryMode(p);let m=this.layer.objectIdField;if("feature"===this.layer.type&&h(this.layer.orderBy)&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(m=e)}return{type:f,timeReferenceUnknownClient:y,subtypeField:c,featureCount:g,globalIdField:d,maxRecordCount:i.query.maxRecordCount,tileMaxRecordCount:i.query.tileMaxRecordCount,capabilities:i,fields:s,fullExtent:a,geometryType:l,objectIdField:r,source:p,timeInfo:o,spatialReference:u,orderByFields:m}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=x.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._clearTiles();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,i=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),r=t&&this.availableFields.includes(t);return i&&!r?(J.error(new s("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:i}=this;await this._updateRequiredFields();const{renderer:r}=this._getEffectiveRenderer();this._set("_effectiveRenderer",r);const s=this._createSchemaConfig(),a=this._createConfiguration(s,i,t.filter),n=this._lastDefinitionExpression!==a.definitionExpression;this._lastDefinitionExpression=a.definitionExpression;const l=this._createTileRendererHash(r);if("snapshot"===this._serviceOptions.type&&(a.schema.source.featureCount=this._serviceOptions.featureCount),l!==this._tileRendererHash){await this._initTileRenderer(r);const e=this.layer,t="stream"===e.type?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(r),"stream"!==e.type&&H(e.source)&&(t.source=await e.source.openPorts());const i={added:this._tileStrategy.tileKeys(),removed:[]};await this._proxy.startup(this.view.featuresTilingScheme,a,t,i),this.hasHighlight()&&await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),await this._onceTilesUpdated(),this.tileRenderer.onConfigUpdate(r)}else{"snapshot"===this._serviceOptions.type&&n&&(a.schema.source.featureCount=await this.layer.queryFeatureCount());const t=await this._proxy.update(a);(t.mesh||t.targets.aggregate)&&this._lockGPUUploads();try{await this._proxy.applyUpdate(t)}catch(e){y(e)||J.error(e)}(t.mesh||t.targets.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(r),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=l,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){y(t),0}}async _doRefresh(e){var t;this._lockGPUUploads();try{await this._proxy.refresh(e)}catch(i){y(i),0}this._unlockGPUUploads(),null!=(t=this.layer)&&t.featureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return this.watch("_aggregateValueRanges",(async i=>{this._updateClusterEffectiveRendererSizeVariable(e,t,i),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,i){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const r=C(e.visualVariables);if(h(r)&&"cluster_count"===r.field){const s=e.visualVariables.indexOf(r);e.visualVariables[s]=I(t,i);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e="renderer"in this.layer&&this.layer.renderer,t=this.layer.featureReduction;if(h(this._updateClusterSizeTask)&&(this._updateClusterSizeTask.remove(),this._updateClusterSizeTask=null),t&&"cluster"===t.type&&E(e)){const i=t,r=[],s=O(r,e,i,this._aggregateValueRanges);return o(this._updateClusterSizeTask,(e=>e.remove())),this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,i),{renderer:s,aggregateFields:r,featureReduction:t}}return{renderer:e,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}async _initTileRenderer(e){const t=await F(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer.destroy(),this.tileRenderer=null),this.destroyed?null:(this._proxy.tileRenderer=t,this._set("tileRenderer",t),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(e),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${"heatmap"===e.type?"heatmap":"symbol"}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=h(e)?e.timeExtent:null,i=h(this.timeExtent)&&h(t)?this.timeExtent.intersection(t):this.timeExtent||t;let r=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=h(e)&&e.where;r=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!i&&!s)return h(e)?e.toJSON():null;(e=h(e)&&e.clone()||new b).timeExtent=i,r&&(e.where=r);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let i=e||"";if("floorInfo"in t&&t.floorInfo){var r;let e=this.view.floors;if(!e||!e.length)return i;null!=(r=t.floorInfo.viewAllLevelIds)&&r.length&&(e=t.floorInfo.viewAllLevelIds);const s=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));s.push("''");const a=t.floorInfo.floorField;let n="("+a+" IN ({ids}) OR "+a+" IS NULL)";if(n=n.replace("{ids}",s.join(", ")),h(i)&&i.includes(a)){let e=new RegExp("AND \\("+a+".*NULL\\)","g");i=i.replace(e,""),e=new RegExp("\\("+a+".*NULL\\)","g"),i=i.replace(e,""),i=i.replace(/\s+/g," ").trim()}i=""!==i?"("+i+") AND "+n:n}return""!==i?i:null}_createConfiguration(e,t,i){const r="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion:void 0,a=new Array(S),n=this._injectOverrides(t);a[0]=n,a[1]=h(i)?i.toJSON():null;const l=U(e);if(d(l))return null;const o=k();return{definitionExpression:this.layer.definitionExpression,availableFields:this.availableFields,gdbVersion:s,historicMoment:r,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:l,supportsTextureFloat:o.supportsTextureFloat,maxTextureSize:o.maxTextureSize}}_hasRequiredSupport(e){var t;return!("renderer"in e&&"dot-density"===(null==(t=e.renderer)?void 0:t.type)&&!k().supportsTextureFloat)||(J.error(new s("webgl-missing-extension","Missing WebGL extension OES_Texture_Float which is required for DotDensity")),!1)}_onceTilesUpdated(){return this.requestUpdate(),f((()=>!this._pipelineIsUpdating))}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e="feature"===this.layer.type?this.layer.historicMoment:null,t="feature"===this.layer.type?this.layer.gdbVersion:null;return{renderer:"renderer"in this.layer&&this.layer.renderer,spatialReference:this.layer.spatialReference,timeExtent:this.layer.timeExtent,definitionExpression:this.layer.definitionExpression,featureReduction:this.layer.featureReduction,fields:this.layer.fields,geometryType:this.layer.geometryType,historicMoment:e,labelsVisible:"labelsVisible"in this.layer&&this.layer.labelsVisible,labelingInfo:"labelingInfo"in this.layer&&this.layer.labelingInfo,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:t,pixelBuffer:0,orderBy:"orderBy"in this.layer&&this.layer.orderBy?this.layer.orderBy:null,customParameters:{..."customParameters"in this.layer?this.layer.customParameters:void 0,token:"apiKey"in this.layer?this.layer.apiKey:void 0}}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{y(e)||J.error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{y(e)||J.error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createHittestResult(e){return this._setLayersForFeature(e),h(e.geometry)&&(e.geometry.spatialReference=this.view.spatialReference),e}};e([m()],Q.prototype,"_serviceOptions",void 0),e([m()],Q.prototype,"_proxy",void 0),e([m()],Q.prototype,"_pipelineIsUpdating",void 0),e([m()],Q.prototype,"_effectiveRenderer",void 0),e([m()],Q.prototype,"_aggregateValueRanges",void 0),e([m()],Q.prototype,"_commandsQueue",void 0),e([m()],Q.prototype,"featureEffectView",void 0),e([m()],Q.prototype,"labelsVisible",null),e([m({readOnly:!0})],Q.prototype,"queryMode",null),e([m()],Q.prototype,"renderingConfigHash",null),e([m()],Q.prototype,"tileRenderer",void 0),e([m()],Q.prototype,"updating",void 0),Q=e([_("esri.views.2d.layers.FeatureLayerView2D")],Q);const A=Q;export{A as default};
|
package/views/MapView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import i from"../Viewpoint.js";import s from"../core/Collection.js";import n from"../core/CollectionFlattener.js";import r from"../core/Error.js";import a from"../core/has.js";import{isIterable as o}from"../core/iteratorUtils.js";import l from"../core/Logger.js";import{isSome as p,unwrap as h,isNone as c}from"../core/maybe.js";import{throwIfAborted as d}from"../core/promiseUtils.js";import{watch as u,whenOnce as m,sync as g,syncAndInitial as f}from"../core/reactiveUtils.js";import{createScreenPoint as w}from"../core/screenUtils.js";import y from"../core/Warning.js";import{initialize as v}from"../core/workers/workers.js";import{property as _}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{subclass as V}from"../core/accessorSupport/decorators/subclass.js";import S from"../geometry/Extent.js";import j from"../geometry/Point.js";import{load as T,canProjectWithoutEngine as R,project as b,isLoaded as x}from"../geometry/projection.js";import{equals as M}from"../geometry/support/spatialReferenceUtils.js";import O from"../layers/support/TileInfo.js";import{BreakpointsOwner as k}from"./BreakpointsOwner.js";import{DOMContainer as z}from"./DOMContainer.js";import{PopupView as L}from"./PopupView.js";import P from"./View.js";import C from"./ViewAnimation.js";import E from"./2d/AnimationManager.js";import G from"./2d/FrameTask.js";import{layerView2DImporter as N}from"./2d/layerViewModuleImportUtils.js";import D from"./2d/MapViewConstraints.js";import q from"./2d/PaddedViewState.js";import"./2d/tiling/PagedTileQueue.js";import U from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{centerAt as A,setExtent as I,rotateTo as F,scaleTo as W,copy as B,create as H,extentToScale as $,resize as J,angleBetween as Q}from"./2d/viewpointUtils.js";import Z from"./2d/input/MapViewInputManager.js";import K from"./2d/layers/features/support/TileStore.js";import X from"./2d/support/HighlightOptions.js";import{Timeline as Y}from"./2d/support/Timeline.js";import ee from"./support/createScreenshotPlan.js";import{getMaximumResolutionScale as te,getFormatAndQuality as ie}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as se,createScreenPointFromSupportedEvent as ne}from"./support/screenUtils.js";import{check as re}from"./support/WebGLRequirements.js";import ae from"./ui/2d/DefaultUI2D.js";import oe from"../webmap/background/ColorBackground.js";const le=l.getLogger("esri.views.MapView");let pe,he,ce,de,ue,me;async function ge(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:s,MagnifierView2D:n,Stage:r}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);he=e,ce=t,de=i,ue=s,me=n,pe=r}const fe=160;function we(e){return e&&"esri.Viewpoint"===e.declaredClass}let ye=class extends(k(z(L(P)))){constructor(e){super(e),this._magnifierView=null,this._stage=null,this._resolveWhenReady=[],this.rootLayerViews=new n({getCollections:()=>{var e,t;return[null==(e=this.basemapView)?void 0:e.baseLayerViews,this.layerViews,null==(t=this.basemapView)?void 0:t.referenceLayerViews]},getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.graphicsView=null,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.rendering=!1,this.supersampleScreenshotsEnabled=!1,this.supportsGround=!1,this._stationaryTimer=null,this.frameTask=new G(this),this._pePromise=null,this.floors=new s,this.highlightOptions=new X,this.inputManager=new Z({view:this}),this.map=null,this.resizeAlign="center",this.spatialReferenceLocked=!1,this.timeline=new Y,this.type="2d",this.ui=new ae,this.constraints=new D,this.padding={top:0,right:0,bottom:0,left:0},this.handles.add([u((()=>this.viewpoint),(()=>{this._lastStationaryEventTimestamp=performance.now(),this._flipStationary(fe)}),g),this.on("resize",(e=>this._resizeHandler(e))),u((()=>{var e;return null==(e=this.animationManager)?void 0:e.animation}),(e=>{this.animation=e}))]),v()}destroy(){this._set("preconditionsReady",!1),this._gotoTask=this.frameTask=null,this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new K(this.featuresTilingScheme)}get initialExtentRequired(){var e;const{scale:t,constraints:i,center:s,viewpoint:n,extent:r}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&null!=(e=this.map.initialViewProperties)&&e.viewpoint)&&(!r&&(null!=i&&i.effectiveLODs||(a=-1),(!s||0===t&&-1===a)&&(!n||!p(n.targetGeometry)||"extent"!==n.targetGeometry.type&&!n.scale)))}get resourceManager(){return this._stage.resourceManager}get textureManager(){return this._stage.painter.textureManager}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get _projectionEngineLoaded(){return!!x()||(this._pePromise||(this._pePromise=T().finally((()=>{this._pePromise=null}))),!1)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=this.spatialReference,i=h(e.targetGeometry);return!!R(i.spatialReference,t)||this._projectionEngineLoaded}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),!e||e.isFulfilled())return void this._set("animation",null);this._set("animation",e),this.frameTask.animationInProgress=!0;const i=()=>{e===this._get("animation")&&(this._set("animation",null),this.frameTask.requestFrame()),this.frameTask.animationInProgress=!1};e.when(i,i)}get background(){return this.get("map.initialViewProperties.background")||null}set background(e){void 0===e?this._clearOverride("background"):this._override("background",e)}get center(){if(!this.ready)return this._get("center");const{center:e,spatialReference:t}=this.state.paddedViewState;return new j({x:e[0],y:e[1],spatialReference:t})}set center(e){if(null==e)return;if(!this.ready)return this._set("center",e),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void le.error(new r("mapview:invalid-center","could not project the value in the view's spatial reference",{input:e,error:s}))}const i=this.viewpoint;A(i,i,t),this.viewpoint=i}set constraints(e){const t=this._get("constraints");t&&(this.handles.remove("map-view-constraints"),t.destroy()),this._set("constraints",e),e&&(e.view=this,this.ready&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint)),this.handles.add(u((()=>e.version),(()=>{this.ready&&this.state&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint))}),g),"map-view-constraints"))}get extent(){return this.ready?this.state.paddedViewState.extent.clone():this._get("extent")}set extent(e){if(null==e)return;if(!e.width||!e.height)return void le.error(new r("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",e),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom",-1),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void le.error(new r("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:s}))}const i=this.viewpoint;I(i,i,t,this.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(e){this.ready?(this.state.padding=e,this._set("padding",this.state.padding)):this._set("padding",e)}get resolution(){return this.state?this.state.resolution:0}get rotation(){return this.ready?this.state.rotation:this._get("rotation")}set rotation(e){if(isNaN(e))return;if(!this.ready)return void this._set("rotation",e);const t=this.viewpoint;F(t,t,e),this.viewpoint=t}get scale(){return this.ready?this.state.scale:this._get("scale")}set scale(e){if(!e||isNaN(e))return;if(!this.ready){this._set("scale",e),this._set("zoom",-1);const t=this._get("extent");return t&&(this._set("extent",null),this._set("center",t.center)),void this.notifyChange("initialExtentRequired")}const t=this.viewpoint;W(t,t,e),this.viewpoint=t}get stationary(){return!(this.animation||this.navigating||this.resizing||this._stationaryTimer)}get updating(){return!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)))}get viewpoint(){if(!this.ready)return this._get("viewpoint");const e=this.state.paddedViewState;return e&&e.viewpoint.clone()}set viewpoint(e){if(null==e)return;if(!this.ready)return this._set("viewpoint",e),this._set("extent",null),this._set("center",null),this._set("zoom",-1),this._set("scale",0),void this.notifyChange("initialExtentRequired");let t,s;try{t=this._project(e,this.spatialReference),!e.scale||isNaN(e.scale)?s=new r("mapview:invalid-viewpoint",`invalid scale value of ${e.scale}`):c(e.targetGeometry)&&(s=new r("mapview:invalid-viewpoint","geometry not defined"))}catch(a){s=new r("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:a})}if(s)return void le.error(s);this._scaleBeforeChangingSpatialReference=null;const n=new i({targetGeometry:new j,scale:0,rotation:0});B(n,t),this.constraints.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this.frameTask.requestFrame(),this._set("viewpoint",n)}get zoom(){return this.ready?this.constraints.scaleToZoom(this.scale):this._get("zoom")}set zoom(e){if(null==e)return;if(!this.ready){this._set("zoom",e),this._set("scale",0);const t=this._get("extent");return t&&(this._set("extent",null),this._set("center",t.center)),void this.notifyChange("initialExtentRequired")}if(!this.constraints.effectiveLODs)return void this._set("zoom",-1);const t=this.viewpoint;W(t,t,this.constraints.zoomToScale(e)),this.viewpoint=t,this._set("zoom",this.constraints.scaleToZoom(this.scale))}get navigating(){return!(!this.mapViewNavigation||!this.mapViewNavigation.interacting)}goTo(e,t){if(e)return this.animation&&(this.animation=null),this._createAnimation(),m((()=>this.ready),t).then((()=>{const i={animate:!0,...t},s=H(e,this);return this.animation.update(s),this._gotoTask={},i.animate?this._gotoAnimated(s,i):this._gotoImmediate(s,i)}));le.error("#goTo()","target cannot be null or undefined")}async hitTest(e,t){const i=se(e)?ne(this,e):e;if(!this.ready||isNaN(i.x)||isNaN(i.y))return{screenPoint:i,results:[]};let s=new Set,n=!1,r=null,a=null;null!=t&&t.include?Se(t.include,Ve(this,(e=>s.add(e)),(e=>{r||(r=new Set),r.add(e)}),(e=>s.add(e)),(()=>n=!0))):(n=!0,s=new Set(this.allLayerViews)),null!=t&&t.exclude&&Se(t.exclude,Ve(this,(e=>s.delete(e)),(e=>{a||(a=new Set),a.add(e)})));const o=this.allLayerViews.filter((e=>!e.suspended&&s.has(e))).reverse(),l=this.toMap(i);let h=(await Promise.all([n?this.graphicsView.hitTest(l):null,...o.map((e=>e.hitTest(l,i)))])).filter(p).flat();return r&&(h=h.filter((e=>r.has(_e(e))))),a&&(h=h.filter((e=>!a.has(_e(e))))),{screenPoint:i,results:h.map((e=>({mapPoint:l,graphic:e})))}}takeScreenshot(e){e=e||{};const t=this.supersampleScreenshotsEnabled?Math.min(4,te(this.size,Math.min(4096,this._stage.context.parameters.maxTextureSize))):1;let i;e.layers?(i=[],e.layers.forEach((e=>{const t=this.allLayerViews.find((t=>t.layer.id===e.id));t&&"container"in t&&t.container&&i.push(t.container)}))):i=this._stage.children;const{format:s,quality:n}=ie(e.format,e.quality),r=ee(e,t,this.size,this.padding,s,n,i,e.rotation);return this._stage.takeScreenshot(r)}toMap(e){if(!this.ready)return null;const t=se(e)?ne(this,e):e,i=[0,0],[s,n]=this.state.toMap(i,[t.x,t.y]),r=this.spatialReference;return new j({x:s,y:n,spatialReference:r})}toScreen(e){if(!this.ready)return null;const t=this._project(e,this.spatialReference),i=[t.x,t.y];return this.state.toScreen(i,i),w(i[0],i[1])}on(e,t,i,s){const n=this.inputManager&&this.viewEvents.on(e,t,i,s);return n||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){var e,t,i;return this.map&&"initialViewProperties"in this.map&&(null==(e=this.map)||null==(t=e.initialViewProperties)?void 0:t.spatialReference)||(null==(i=this.defaultsFromMap)?void 0:i.spatialReference)||null}hasLayerViewModule(e){return N.hasLayerViewModule(e)}importLayerView(e){return N.importLayerView(e)}pixelSizeAt(){return this.ready?this.state.resolution:(le.error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}popupHitTest(e){return this.hitTest(e).then((t=>({...t,mapPoint:this.toMap(e)})))}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}validate(){let e=re(this.type);return a("safari")&&a("safari")<9&&(e=new r("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:a("safari")})),p(e)?(le.warn("#validate()",e.message),Promise.reject(e)):ge()}_createAnimation(){return this.animation&&!this.animation.done||(this.animation=new C),this.animation}_cancellableGoTo(e,t,i){const s=()=>e===this._gotoTask,n=i.then((()=>{s()&&(this.animation=null)})).catch((e=>{throw s()&&(this.animation=null,t.done||(t.stop(),this.frameTask.animationInProgress=!1)),e})),r=new Promise((e=>e(n)));return t.when().catch((()=>{s()&&r.cancel&&r.cancel()})),r}_gotoImmediate(e,t){const i=this._gotoTask,s=this.animation,n=e.then((e=>{if(d(t),i!==this._gotoTask)throw new r("view:goto-interrupted","Goto was interrupted");this.viewpoint=s.target=e,s.finish()}));return this._cancellableGoTo(i,s,n)}_flipStationary(e){return null!==this._stationaryTimer||(this._stationaryTimer=setTimeout((()=>{this._stationaryTimer=null;const e=performance.now()-this._lastStationaryEventTimestamp;e<fe&&(this._stationaryTimer=this._flipStationary(e))}),e)),this._stationaryTimer}_getDefaultViewpoint(){var e,t,s,n;const{constraints:r,initialExtent:a,map:o}=this;if(!r)return null;const l=o&&"initialViewProperties"in o&&o.initialViewProperties,c={zoom:this._get("zoom"),scale:this._get("scale"),center:this._get("center"),extent:this._get("extent"),rotation:this._get("rotation"),viewpoint:this._get("viewpoint"),spatialReference:this._userSpatialReference};r.effectiveLODs?-1!==c.zoom&&(c.scale=r.zoomToScale(c.zoom)):c.zoom=-1;let d=null,u=null,m=0;const g=c.viewpoint&&c.viewpoint.rotation,f=c.viewpoint&&c.viewpoint.targetGeometry;p(f)&&("extent"===f.type?d=f:"point"===f.type&&(u=f,m=c.viewpoint.scale));const w=c.extent||d||(null==(e=h(null==l||null==(t=l.viewpoint)?void 0:t.targetGeometry))?void 0:e.extent)||a,y=c.center||u||(null==w?void 0:w.center),v=c.scale||m||(null==l||null==(s=l.viewpoint)?void 0:s.scale)||w&&$(w,this.size),_=c.rotation||g||(null==l||null==(n=l.viewpoint)?void 0:n.rotation)||0;return y&&v?new i({targetGeometry:y,scale:v,rotation:_}):null}_gotoAnimated(e,t){const i=this._gotoTask,s=this.animation,n=e.then((e=>{if(d(t),i!==this._gotoTask)throw new r("view:goto-interrupted","Goto was interrupted");return s.update(e),this.animationManager.animate(s,this.viewpoint,t),s.when().then((()=>{}),(()=>{}))}));return this._cancellableGoTo(i,s,n)}_project(e,t){var i;const s=e&&e.targetGeometry||e;if(!t)return e;if(!s)return null;if(t.imageCoordinateSystem||null!=(i=s.spatialReference)&&i.imageCoordinateSystem)return e;if(M(t,s.spatialReference))return e;const n=b(s,t);if(!n)throw new r("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:s,spatialReference:t});return we(e)?(e.targetGeometry=n,e):n}_resizeHandler(e){if(!this.ready)return;const t=this.state;let i=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.concat();t.size=[e.width,e.height],J(i,i,s,this.state.paddedViewState.size,this.resizeAlign),i=this.constraints.constrain(i,null),this.state.viewpoint=i}_startup(){var e;this.timeline.begin("MapView Startup");const t=this._getDefaultViewpoint(),i=t.targetGeometry;try{this._project(t,this.spatialReference)}catch(p){var s;le.warn(new y("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:i.toJSON(),spatialReference:this.spatialReference,error:p})),t.targetGeometry=(null==(s=this.defaultsFromMap.extent)?void 0:s.center)||new j({x:0,y:0,spatialReference:this.spatialReference})}null==(e=this.constraints)||e.fit(t),this._set("state",new q({padding:this._get("padding"),size:this.size,viewpoint:t})),this.graphics.owner=this;const n=new pe(this.surface,{canvas:this.renderCanvas,supersampleScreenshots:this.supersampleScreenshotsEnabled,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this._stage=n,this._magnifierView=new me,this._magnifierView.magnifier=this.magnifier;const r=new de({view:this});this._set("labelManager",r);const a=new E({view:this});this._set("animationManager",a);const o=new ue({view:this,animationManager:a});this._set("mapViewNavigation",o),this._setupSpatialReferenceDependentProperties(),this.handles.add([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),n.on("post-render",(()=>this._set("rendering",n.renderRequested))),n.on("will-render",(()=>this._set("rendering",n.renderRequested))),n.on("webgl-error",(e=>this.fatalError=e.error)),u((()=>this.stationary),(e=>n.stationary=e),f),u((()=>this.background),(e=>{n.background=e,this._magnifierView.background=e}),f),u((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),f),u((()=>this.renderingOptions),(e=>n.renderingOptions=e),f),u((()=>this.highlightOptions),(e=>n.highlightOptions=e),f),u((()=>this.state.id),(()=>n.state=this.state),f)],"map-view"),this._updateStageChildren();const l=this._resolveWhenReady;this._resolveWhenReady=[],l.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask&&this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.handles.remove("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._stage.destroy(),this._stage=null,this._set("graphicsView",null),this._magnifierView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask&&this.frameTask.stop(),this._stationaryTimer&&(clearTimeout(this._stationaryTimer),this._stationaryTimer=null),this._set("ready",!1);const{center:[e,t],spatialReference:i,rotation:s,scale:n}=this.state.paddedViewState,r=new j({x:e,y:t,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",r),this._set("zoom",-1),this._set("rotation",s),this._set("scale",n),this._set("spatialReference",i),this._set("state",null),this.animation=null}_updateStageChildren(){this._stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this._stage.addChild(e.container)}));const e=this.graphicsView;this._stage.addChild(e.container),this._stage.addChild(this._magnifierView)}_setupSpatialReferenceDependentProperties(){const e=new U(O.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new he({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new ce(e)});this.frameTask.graphicsView=t,this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),this.frameTask.graphicsView=null,e.destroy(),this._set("featuresTilingScheme",null)}_spatialReferenceChanged(e){if(!this.ready)return;this.frameTask.stop();for(const i of this.allLayerViews)i.processDetach();this._destroySpatialReferenceDependentProperties();const t=this.state.paddedViewState.clone();if(c(this._scaleBeforeChangingSpatialReference))this._scaleBeforeChangingSpatialReference=t.scale;else{const e=t.viewpoint.clone();e.scale=this._scaleBeforeChangingSpatialReference,t.viewpoint=e}const s=t.clone(),[n,r]=t.center;let o=new j({x:n,y:r,spatialReference:t.spatialReference});try{o=this._project(o,e)}catch(p){x()||le.warn(new y("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:o.toJSON(),spatialReference:e,error:p}))}o||(o=new j({x:0,y:0,spatialReference:e}));const l=A(new i({targetGeometry:new j,scale:0,rotation:0}),t.viewpoint,o);s.viewpoint=l;try{const i=20,n=[t.size[0]/2,t.size[1]/2],r=[n[0]+i,n[1]],o=t.toMap([0,0],r),{x:p,y:h}=this._project(new j({x:o[0],y:o[1],spatialReference:t.spatialReference}),e);o[0]=p,o[1]=h,s.toScreen(o,o);const c=Q(n,o,r),d=Math.hypot(o[0]-n[0],o[1]-n[1])/i;!Number.isFinite(d)||Math.abs(d)>4?(l.rotation=0,l.targetGeometry=new j({x:0,y:0,spatialReference:e})):(l.scale*=d,l.scale>a("mapview-srswitch-adjust-rotation-scale-threshold")?l.rotation=0:l.rotation+=Number.isFinite(c)?c:0)}catch{}this._get("constraints").constrain(l,null),this._get("state").viewpoint=l,this._stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const i of this.allLayerViews)i.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}};e([_({readOnly:!0})],ye.prototype,"animationManager",void 0),e([_({constructOnly:!0})],ye.prototype,"deactivatedWebGLExtensions",void 0),e([_({constructOnly:!0})],ye.prototype,"debugWebGLExtensions",void 0),e([_({readOnly:!0})],ye.prototype,"featuresTilingScheme",void 0),e([_({readOnly:!0})],ye.prototype,"fullOpacity",void 0),e([_({readOnly:!0})],ye.prototype,"graphicsTileStore",null),e([_()],ye.prototype,"graphicsView",void 0),e([_({readOnly:!0})],ye.prototype,"state",void 0),e([_()],ye.prototype,"initialExtentRequired",null),e([_()],ye.prototype,"labelManager",void 0),e([_({readOnly:!0})],ye.prototype,"resourceManager",null),e([_({readOnly:!0})],ye.prototype,"textureManager",null),e([_({readOnly:!0})],ye.prototype,"mapViewNavigation",void 0),e([_({constructOnly:!0})],ye.prototype,"renderCanvas",void 0),e([_()],ye.prototype,"renderingOptions",void 0),e([_({readOnly:!0})],ye.prototype,"rendering",void 0),e([_({constructOnly:!0})],ye.prototype,"supersampleScreenshotsEnabled",void 0),e([_({readOnly:!0})],ye.prototype,"supportsGround",void 0),e([_()],ye.prototype,"_stationaryTimer",void 0),e([_()],ye.prototype,"_defaultsFromMapSettings",null),e([_()],ye.prototype,"_pePromise",void 0),e([_({readOnly:!0})],ye.prototype,"typeSpecificPreconditionsReady",null),e([_()],ye.prototype,"animation",null),e([_({type:oe})],ye.prototype,"background",null),e([_({value:null,type:j,dependsOn:["state.id","ready"]})],ye.prototype,"center",null),e([_({type:D})],ye.prototype,"constraints",null),e([_({value:null,type:S,dependsOn:["state.id","ready"]})],ye.prototype,"extent",null),e([_()],ye.prototype,"floors",void 0),e([_({type:X})],ye.prototype,"highlightOptions",void 0),e([_({readOnly:!0})],ye.prototype,"inputManager",void 0),e([_()],ye.prototype,"map",void 0),e([_({value:{top:0,right:0,bottom:0,left:0},cast:e=>({top:0,right:0,bottom:0,left:0,...e})})],ye.prototype,"padding",null),e([_()],ye.prototype,"resizeAlign",void 0),e([_({readOnly:!0,dependsOn:["state.id"]})],ye.prototype,"resolution",null),e([_({value:0,type:Number,dependsOn:["state.id","ready"]})],ye.prototype,"rotation",null),e([_({value:0,type:Number,dependsOn:["state.id","ready"]})],ye.prototype,"scale",null),e([_({constructOnly:!0})],ye.prototype,"spatialReferenceLocked",void 0),e([_()],ye.prototype,"stationary",null),e([_({type:Y,readOnly:!0})],ye.prototype,"timeline",void 0),e([_({readOnly:!0})],ye.prototype,"type",void 0),e([_({readOnly:!0})],ye.prototype,"updating",null),e([_({value:null,type:i,dependsOn:["state.id","ready"]})],ye.prototype,"viewpoint",null),e([_({value:-1,dependsOn:["state.id"]})],ye.prototype,"zoom",null),e([_({type:Boolean})],ye.prototype,"navigating",null),e([_({type:ae})],ye.prototype,"ui",void 0),ye=e([V("esri.views.MapView")],ye);const ve=ye;function _e(e){const t=e.getObjectId();var i,s,n,r;return t?`${null!=(i=null!=(s=null==(n=e.layer)?void 0:n.uid)?s:null==(r=e.sourceLayer)?void 0:r.uid)?i:"MapView"}/${t}`:`"MapView/${e.uid}`}function Ve(e,i,s,n,r){return a=>{if(a instanceof t){if(a.layer===e)null==r||r();else{const t=e.allLayerViews.find((e=>e.layer===a.layer));t&&(null==n||n(t))}s(_e(a))}else{const t=e.allLayerViews.find((e=>e.layer===a));t&&i(t)}}}function Se(e,t){if(e)if(o(e))for(const i of e)if(o(i))for(const e of i)t(e);else t(i);else t(e)}export{ve as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import i from"../Viewpoint.js";import s from"../core/Collection.js";import n from"../core/CollectionFlattener.js";import r from"../core/Error.js";import a from"../core/has.js";import{isIterable as o}from"../core/iteratorUtils.js";import l from"../core/Logger.js";import{isSome as p,unwrap as h,isNone as c}from"../core/maybe.js";import{throwIfAborted as d}from"../core/promiseUtils.js";import{watch as u,whenOnce as m,sync as g,syncAndInitial as f}from"../core/reactiveUtils.js";import{createScreenPoint as w}from"../core/screenUtils.js";import y from"../core/Warning.js";import{initialize as v}from"../core/workers/workers.js";import{property as _}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{subclass as V}from"../core/accessorSupport/decorators/subclass.js";import S from"../geometry/Extent.js";import j from"../geometry/Point.js";import{load as T,canProjectWithoutEngine as R,project as b,isLoaded as x}from"../geometry/projection.js";import{equals as M}from"../geometry/support/spatialReferenceUtils.js";import O from"../layers/support/TileInfo.js";import{BreakpointsOwner as k}from"./BreakpointsOwner.js";import{DOMContainer as z}from"./DOMContainer.js";import{PopupView as L}from"./PopupView.js";import P from"./View.js";import C from"./ViewAnimation.js";import E from"./2d/AnimationManager.js";import G from"./2d/FrameTask.js";import{layerView2DImporter as N}from"./2d/layerViewModuleImportUtils.js";import D from"./2d/MapViewConstraints.js";import q from"./2d/PaddedViewState.js";import"./2d/tiling/PagedTileQueue.js";import U from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{centerAt as A,setExtent as I,rotateTo as F,scaleTo as W,copy as B,create as H,extentToScale as $,resize as J,angleBetween as Q}from"./2d/viewpointUtils.js";import Z from"./2d/input/MapViewInputManager.js";import K from"./2d/layers/features/support/TileStore.js";import X from"./2d/support/HighlightOptions.js";import{Timeline as Y}from"./2d/support/Timeline.js";import ee from"./support/createScreenshotPlan.js";import{getMaximumResolutionScale as te,getFormatAndQuality as ie}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as se,createScreenPointFromSupportedEvent as ne}from"./support/screenUtils.js";import{check as re}from"./support/WebGLRequirements.js";import ae from"./ui/2d/DefaultUI2D.js";import oe from"../webmap/background/ColorBackground.js";const le=l.getLogger("esri.views.MapView");let pe,he,ce,de,ue,me;async function ge(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:s,MagnifierView2D:n,Stage:r}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);he=e,ce=t,de=i,ue=s,me=n,pe=r}const fe=160;function we(e){return e&&"esri.Viewpoint"===e.declaredClass}let ye=class extends(k(z(L(P)))){constructor(e){super(e),this._magnifierView=null,this._stage=null,this._resolveWhenReady=[],this.rootLayerViews=new n({getCollections:()=>{var e,t;return[null==(e=this.basemapView)?void 0:e.baseLayerViews,this.layerViews,null==(t=this.basemapView)?void 0:t.referenceLayerViews]},getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.graphicsView=null,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.rendering=!1,this.supersampleScreenshotsEnabled=!1,this.supportsGround=!1,this._stationaryTimer=null,this.frameTask=new G(this),this._pePromise=null,this.floors=new s,this.highlightOptions=new X,this.inputManager=new Z({view:this}),this.map=null,this.resizeAlign="center",this.spatialReferenceLocked=!1,this.timeline=new Y,this.type="2d",this.ui=new ae,this.constraints=new D,this.padding={top:0,right:0,bottom:0,left:0},this.handles.add([u((()=>this.viewpoint),(()=>{this._lastStationaryEventTimestamp=performance.now(),this._flipStationary(fe)}),g),this.on("resize",(e=>this._resizeHandler(e))),u((()=>{var e;return null==(e=this.animationManager)?void 0:e.animation}),(e=>{this.animation=e}))]),v()}destroy(){this._set("preconditionsReady",!1),this._gotoTask=this.frameTask=null,this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new K(this.featuresTilingScheme)}get initialExtentRequired(){var e;const{scale:t,constraints:i,center:s,viewpoint:n,extent:r}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&null!=(e=this.map.initialViewProperties)&&e.viewpoint)&&(!r&&(null!=i&&i.effectiveLODs||(a=-1),(!s||0===t&&-1===a)&&(!n||!p(n.targetGeometry)||"extent"!==n.targetGeometry.type&&!n.scale)))}get resourceManager(){return this._stage.resourceManager}get textureManager(){return this._stage.painter.textureManager}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get _projectionEngineLoaded(){return!!x()||(this._pePromise||(this._pePromise=T().finally((()=>{this._pePromise=null}))),!1)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=this.spatialReference,i=h(e.targetGeometry);return!!R(i.spatialReference,t)||this._projectionEngineLoaded}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),!e||e.isFulfilled())return void this._set("animation",null);this._set("animation",e),this.frameTask.animationInProgress=!0;const i=()=>{e===this._get("animation")&&(this._set("animation",null),this.frameTask.requestFrame()),this.frameTask.animationInProgress=!1};e.when(i,i)}get background(){return this.get("map.initialViewProperties.background")||null}set background(e){void 0===e?this._clearOverride("background"):this._override("background",e)}get center(){if(!this.ready)return this._get("center");const{center:e,spatialReference:t}=this.state.paddedViewState;return new j({x:e[0],y:e[1],spatialReference:t})}set center(e){if(null==e)return;if(!this.ready)return this._set("center",e),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void le.error(new r("mapview:invalid-center","could not project the value in the view's spatial reference",{input:e,error:s}))}const i=this.viewpoint;A(i,i,t),this.viewpoint=i}set constraints(e){const t=this._get("constraints");t&&(this.handles.remove("map-view-constraints"),t.destroy()),this._set("constraints",e),e&&(e.view=this,this.ready&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint)),this.handles.add(u((()=>e.version),(()=>{this.ready&&this.state&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint))}),g),"map-view-constraints"))}get extent(){return this.ready?this.state.paddedViewState.extent.clone():this._get("extent")}set extent(e){if(null==e)return;if(!e.width||!e.height)return void le.error(new r("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",e),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom",-1),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void le.error(new r("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:s}))}const i=this.viewpoint;I(i,i,t,this.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(e){this.ready?(this.state.padding=e,this._set("padding",this.state.padding)):this._set("padding",e)}get resolution(){return this.state?this.state.resolution:0}get rotation(){return this.ready?this.state.rotation:this._get("rotation")}set rotation(e){if(isNaN(e))return;if(!this.ready)return void this._set("rotation",e);const t=this.viewpoint;F(t,t,e),this.viewpoint=t}get scale(){return this.ready?this.state.scale:this._get("scale")}set scale(e){if(!e||isNaN(e))return;if(!this.ready){this._set("scale",e),this._set("zoom",-1);const t=this._get("extent");return t&&(this._set("extent",null),this._set("center",t.center)),void this.notifyChange("initialExtentRequired")}const t=this.viewpoint;W(t,t,e),this.viewpoint=t}get stationary(){return!(this.animation||this.navigating||this.resizing||this._stationaryTimer)}get updating(){return!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)))}get viewpoint(){if(!this.ready)return this._get("viewpoint");const e=this.state.paddedViewState;return e&&e.viewpoint.clone()}set viewpoint(e){if(null==e)return;if(!this.ready)return this._set("viewpoint",e),this._set("extent",null),this._set("center",null),this._set("zoom",-1),this._set("scale",0),void this.notifyChange("initialExtentRequired");let t,s;try{t=this._project(e,this.spatialReference),!e.scale||isNaN(e.scale)?s=new r("mapview:invalid-viewpoint",`invalid scale value of ${e.scale}`):c(e.targetGeometry)&&(s=new r("mapview:invalid-viewpoint","geometry not defined"))}catch(a){s=new r("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:a})}if(s)return void le.error(s);this._scaleBeforeChangingSpatialReference=null;const n=new i({targetGeometry:new j,scale:0,rotation:0});B(n,t),this.constraints.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this.frameTask.requestFrame(),this._set("viewpoint",n)}get zoom(){return this.ready?this.constraints.scaleToZoom(this.scale):this._get("zoom")}set zoom(e){if(null==e)return;if(!this.ready){this._set("zoom",e),this._set("scale",0);const t=this._get("extent");return t&&(this._set("extent",null),this._set("center",t.center)),void this.notifyChange("initialExtentRequired")}if(!this.constraints.effectiveLODs)return void this._set("zoom",-1);const t=this.viewpoint;W(t,t,this.constraints.zoomToScale(e)),this.viewpoint=t,this._set("zoom",this.constraints.scaleToZoom(this.scale))}get navigating(){return!(!this.mapViewNavigation||!this.mapViewNavigation.interacting)}goTo(e,t){if(e)return this.animation&&(this.animation=null),this._createAnimation(),m((()=>this.ready),t).then((()=>{const i={animate:!0,...t},s=H(e,this);return this.animation.update(s),this._gotoTask={},i.animate?this._gotoAnimated(s,i):this._gotoImmediate(s,i)}));le.error("#goTo()","target cannot be null or undefined")}async hitTest(e,t){const i=se(e)?ne(this,e):e;if(!this.ready||isNaN(i.x)||isNaN(i.y))return{screenPoint:i,results:[]};let s=new Set,n=!1,r=null,a=null;null!=t&&t.include?Se(t.include,Ve(this,(e=>s.add(e)),(e=>{r||(r=new Set),r.add(e)}),(e=>s.add(e)),(()=>n=!0))):(n=!0,s=new Set(this.allLayerViews)),null!=t&&t.exclude&&Se(t.exclude,Ve(this,(e=>s.delete(e)),(e=>{a||(a=new Set),a.add(e)})));const o=this.allLayerViews.filter((e=>!e.suspended&&s.has(e))).reverse(),l=this.toMap(i);let h=(await Promise.all([n?this.graphicsView.hitTest(l):null,...o.map((e=>e.hitTest(l,i)))])).filter(p).flat();return r&&(h=h.filter((e=>r.has(_e(e))))),a&&(h=h.filter((e=>!a.has(_e(e))))),{screenPoint:i,results:h.map((e=>({mapPoint:l,graphic:e})))}}takeScreenshot(e){e=e||{};const t=this.supersampleScreenshotsEnabled?Math.min(4,te(this.size,Math.min(4096,this._stage.context.parameters.maxTextureSize))):1;let i;e.layers?(i=[],e.layers.forEach((e=>{const t=this.allLayerViews.find((t=>t.layer.id===e.id));t&&"container"in t&&t.container&&i.push(t.container)}))):i=this._stage.children;const{format:s,quality:n}=ie(e.format,e.quality),r=ee(e,t,this.size,this.padding,s,n,i,e.rotation);return this._stage.takeScreenshot(r)}toMap(e){if(!this.ready)return null;const t=se(e)?ne(this,e):e,i=[0,0],[s,n]=this.state.toMap(i,[t.x,t.y]),r=this.spatialReference;return new j({x:s,y:n,spatialReference:r})}toScreen(e){if(!this.ready)return null;const t=this._project(e,this.spatialReference),i=[t.x,t.y];return this.state.toScreen(i,i),w(i[0],i[1])}on(e,t,i,s){const n=this.inputManager&&this.viewEvents.on(e,t,i,s);return n||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){var e,t,i;return this.map&&"initialViewProperties"in this.map&&(null==(e=this.map)||null==(t=e.initialViewProperties)?void 0:t.spatialReference)||(null==(i=this.defaultsFromMap)?void 0:i.spatialReference)||null}hasLayerViewModule(e){return N.hasLayerViewModule(e)}importLayerView(e){return N.importLayerView(e)}pixelSizeAt(){return this.ready?this.state.resolution:(le.error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}popupHitTest(e){return this.hitTest(e).then((t=>({...t,mapPoint:this.toMap(e)})))}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}validate(){let e=re(this.type);return a("safari")&&a("safari")<9&&(e=new r("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:a("safari")})),p(e)?(le.warn("#validate()",e.message),Promise.reject(e)):ge()}_createAnimation(){return this.animation&&!this.animation.done||(this.animation=new C),this.animation}_cancellableGoTo(e,t,i){const s=()=>e===this._gotoTask,n=i.then((()=>{s()&&(this.animation=null)})).catch((e=>{throw s()&&(this.animation=null,t.done||(t.stop(),this.frameTask.animationInProgress=!1)),e})),r=new Promise((e=>e(n)));return t.when().catch((()=>{s()&&r.cancel&&r.cancel()})),r}_gotoImmediate(e,t){const i=this._gotoTask,s=this.animation,n=e.then((e=>{if(d(t),i!==this._gotoTask)throw new r("view:goto-interrupted","Goto was interrupted");this.viewpoint=s.target=e,s.finish()}));return this._cancellableGoTo(i,s,n)}_flipStationary(e){return null!==this._stationaryTimer||(this._stationaryTimer=setTimeout((()=>{this._stationaryTimer=null;const e=performance.now()-this._lastStationaryEventTimestamp;e<fe&&(this._stationaryTimer=this._flipStationary(e))}),e)),this._stationaryTimer}_getDefaultViewpoint(){var e,t,s,n;const{constraints:r,initialExtent:a,map:o}=this;if(!r)return null;const l=o&&"initialViewProperties"in o&&o.initialViewProperties,c={zoom:this._get("zoom"),scale:this._get("scale"),center:this._get("center"),extent:this._get("extent"),rotation:this._get("rotation"),viewpoint:this._get("viewpoint"),spatialReference:this._userSpatialReference};r.effectiveLODs?-1!==c.zoom&&(c.scale=r.zoomToScale(c.zoom)):c.zoom=-1;let d=null,u=null,m=0;const g=c.viewpoint&&c.viewpoint.rotation,f=c.viewpoint&&c.viewpoint.targetGeometry;p(f)&&("extent"===f.type?d=f:"point"===f.type&&(u=f,m=c.viewpoint.scale));const w=c.extent||d||(null==(e=h(null==l||null==(t=l.viewpoint)?void 0:t.targetGeometry))?void 0:e.extent)||a,y=c.center||u||(null==w?void 0:w.center),v=c.scale||m||(null==l||null==(s=l.viewpoint)?void 0:s.scale)||w&&$(w,this.size),_=c.rotation||g||(null==l||null==(n=l.viewpoint)?void 0:n.rotation)||0;return y&&v?new i({targetGeometry:y,scale:v,rotation:_}):null}_gotoAnimated(e,t){const i=this._gotoTask,s=this.animation,n=e.then((e=>{if(d(t),i!==this._gotoTask)throw new r("view:goto-interrupted","Goto was interrupted");return s.update(e),this.animationManager.animate(s,this.viewpoint,t),s.when().then((()=>{}),(()=>{}))}));return this._cancellableGoTo(i,s,n)}_project(e,t){var i;const s=e&&e.targetGeometry||e;if(!t)return e;if(!s)return null;if(t.imageCoordinateSystem||null!=(i=s.spatialReference)&&i.imageCoordinateSystem)return e;if(M(t,s.spatialReference))return e;const n=b(s,t);if(!n)throw new r("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:s,spatialReference:t});return we(e)?(e.targetGeometry=n,e):n}_resizeHandler(e){if(!this.ready)return;const t=this.state;let i=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.concat();t.size=[e.width,e.height],J(i,i,s,this.state.paddedViewState.size,this.resizeAlign),i=this.constraints.constrain(i,null),this.state.viewpoint=i}_startup(){var e;this.timeline.begin("MapView Startup");const t=this._getDefaultViewpoint(),i=t.targetGeometry;try{this._project(t,this.spatialReference)}catch(p){var s;le.warn(new y("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:i.toJSON(),spatialReference:this.spatialReference,error:p})),t.targetGeometry=(null==(s=this.defaultsFromMap.extent)?void 0:s.center)||new j({x:0,y:0,spatialReference:this.spatialReference})}null==(e=this.constraints)||e.fit(t),this._set("state",new q({padding:this._get("padding"),size:this.size,viewpoint:t})),this.graphics.owner=this;const n=new pe(this.surface,{canvas:this.renderCanvas,supersampleScreenshots:this.supersampleScreenshotsEnabled,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this._stage=n,this._magnifierView=new me,this._magnifierView.magnifier=this.magnifier;const r=new de({view:this});this._set("labelManager",r);const a=new E({view:this});this._set("animationManager",a);const o=new ue({view:this,animationManager:a});this._set("mapViewNavigation",o),this._setupSpatialReferenceDependentProperties(),this.handles.add([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),n.on("post-render",(()=>this._set("rendering",n.renderRequested))),n.on("will-render",(()=>this._set("rendering",n.renderRequested))),n.on("webgl-error",(e=>this.fatalError=e.error)),u((()=>this.stationary),(e=>n.stationary=e),f),u((()=>this.background),(e=>{n.background=e,this._magnifierView.background=e}),f),u((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),f),u((()=>this.renderingOptions),(e=>n.renderingOptions=e),f),u((()=>this.highlightOptions),(e=>n.highlightOptions=e),f),u((()=>this.state.id),(()=>n.state=this.state),f)],"map-view"),this._updateStageChildren();const l=this._resolveWhenReady;this._resolveWhenReady=[],l.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask&&this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.handles.remove("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._stage.destroy(),this._stage=null,this._set("graphicsView",null),this._magnifierView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask&&this.frameTask.stop(),this._stationaryTimer&&(clearTimeout(this._stationaryTimer),this._stationaryTimer=null),this._set("ready",!1);const{center:[e,t],spatialReference:i,rotation:s,scale:n}=this.state.paddedViewState,r=new j({x:e,y:t,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",r),this._set("zoom",-1),this._set("rotation",s),this._set("scale",n),this._set("spatialReference",i),this._set("state",null),this.animation=null}_updateStageChildren(){this._stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this._stage.addChild(e.container)}));const e=this.graphicsView;this._stage.addChild(e.container),this._stage.addChild(this._magnifierView)}_setupSpatialReferenceDependentProperties(){const e=new U(O.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new he({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new ce(e)});this.frameTask.graphicsView=t,this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),this.frameTask.graphicsView=null,e.destroy(),this._set("featuresTilingScheme",null)}_spatialReferenceChanged(e){if(!this.ready)return;this.frameTask.stop();for(const i of this.allLayerViews)i.processDetach();this._destroySpatialReferenceDependentProperties();const t=this.state.paddedViewState.clone();if(c(this._scaleBeforeChangingSpatialReference))this._scaleBeforeChangingSpatialReference=t.scale;else{const e=t.viewpoint.clone();e.scale=this._scaleBeforeChangingSpatialReference,t.viewpoint=e}const s=t.clone(),[n,r]=t.center;let o=null;try{o=this._project(new j({x:n,y:r,spatialReference:t.spatialReference}),e)}catch(p){x()||le.warn(new y("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:o.toJSON(),spatialReference:e,error:p}))}o||(o=new j({x:0,y:0,spatialReference:e}));const l=A(new i({targetGeometry:new j,scale:0,rotation:0}),t.viewpoint,o);s.viewpoint=l;try{const i=20,n=[t.size[0]/2,t.size[1]/2],r=[n[0]+i,n[1]],o=t.toMap([0,0],r),{x:p,y:h}=this._project(new j({x:o[0],y:o[1],spatialReference:t.spatialReference}),e);o[0]=p,o[1]=h,s.toScreen(o,o);const c=Q(n,o,r),d=Math.hypot(o[0]-n[0],o[1]-n[1])/i;!Number.isFinite(d)||Math.abs(d)>4?(l.rotation=0,l.targetGeometry=new j({x:0,y:0,spatialReference:e})):(l.scale*=d,l.scale>a("mapview-srswitch-adjust-rotation-scale-threshold")?l.rotation=0:l.rotation+=Number.isFinite(c)?c:0)}catch{}this._get("constraints").constrain(l,null),this._get("state").viewpoint=l,this._stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const i of this.allLayerViews)i.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}};e([_({readOnly:!0})],ye.prototype,"animationManager",void 0),e([_({constructOnly:!0})],ye.prototype,"deactivatedWebGLExtensions",void 0),e([_({constructOnly:!0})],ye.prototype,"debugWebGLExtensions",void 0),e([_({readOnly:!0})],ye.prototype,"featuresTilingScheme",void 0),e([_({readOnly:!0})],ye.prototype,"fullOpacity",void 0),e([_({readOnly:!0})],ye.prototype,"graphicsTileStore",null),e([_()],ye.prototype,"graphicsView",void 0),e([_({readOnly:!0})],ye.prototype,"state",void 0),e([_()],ye.prototype,"initialExtentRequired",null),e([_()],ye.prototype,"labelManager",void 0),e([_({readOnly:!0})],ye.prototype,"resourceManager",null),e([_({readOnly:!0})],ye.prototype,"textureManager",null),e([_({readOnly:!0})],ye.prototype,"mapViewNavigation",void 0),e([_({constructOnly:!0})],ye.prototype,"renderCanvas",void 0),e([_()],ye.prototype,"renderingOptions",void 0),e([_({readOnly:!0})],ye.prototype,"rendering",void 0),e([_({constructOnly:!0})],ye.prototype,"supersampleScreenshotsEnabled",void 0),e([_({readOnly:!0})],ye.prototype,"supportsGround",void 0),e([_()],ye.prototype,"_stationaryTimer",void 0),e([_()],ye.prototype,"_defaultsFromMapSettings",null),e([_()],ye.prototype,"_pePromise",void 0),e([_({readOnly:!0})],ye.prototype,"typeSpecificPreconditionsReady",null),e([_()],ye.prototype,"animation",null),e([_({type:oe})],ye.prototype,"background",null),e([_({value:null,type:j,dependsOn:["state.id","ready"]})],ye.prototype,"center",null),e([_({type:D})],ye.prototype,"constraints",null),e([_({value:null,type:S,dependsOn:["state.id","ready"]})],ye.prototype,"extent",null),e([_()],ye.prototype,"floors",void 0),e([_({type:X})],ye.prototype,"highlightOptions",void 0),e([_({readOnly:!0})],ye.prototype,"inputManager",void 0),e([_()],ye.prototype,"map",void 0),e([_({value:{top:0,right:0,bottom:0,left:0},cast:e=>({top:0,right:0,bottom:0,left:0,...e})})],ye.prototype,"padding",null),e([_()],ye.prototype,"resizeAlign",void 0),e([_({readOnly:!0,dependsOn:["state.id"]})],ye.prototype,"resolution",null),e([_({value:0,type:Number,dependsOn:["state.id","ready"]})],ye.prototype,"rotation",null),e([_({value:0,type:Number,dependsOn:["state.id","ready"]})],ye.prototype,"scale",null),e([_({constructOnly:!0})],ye.prototype,"spatialReferenceLocked",void 0),e([_()],ye.prototype,"stationary",null),e([_({type:Y,readOnly:!0})],ye.prototype,"timeline",void 0),e([_({readOnly:!0})],ye.prototype,"type",void 0),e([_({readOnly:!0})],ye.prototype,"updating",null),e([_({value:null,type:i,dependsOn:["state.id","ready"]})],ye.prototype,"viewpoint",null),e([_({value:-1,dependsOn:["state.id"]})],ye.prototype,"zoom",null),e([_({type:Boolean})],ye.prototype,"navigating",null),e([_({type:ae})],ye.prototype,"ui",void 0),ye=e([V("esri.views.MapView")],ye);const ve=ye;function _e(e){const t=e.getObjectId();var i,s,n,r;return t?`${null!=(i=null!=(s=null==(n=e.layer)?void 0:n.uid)?s:null==(r=e.sourceLayer)?void 0:r.uid)?i:"MapView"}/${t}`:`"MapView/${e.uid}`}function Ve(e,i,s,n,r){return a=>{if(a instanceof t){if(a.layer===e)null==r||r();else{const t=e.allLayerViews.find((e=>e.layer===a.layer));t&&(null==n||n(t))}s(_e(a))}else{const t=e.allLayerViews.find((e=>e.layer===a));t&&i(t)}}}function Se(e,t){if(e)if(o(e))for(const i of e)if(o(i))for(const e of i)t(e);else t(i);else t(e)}export{ve as default};
|