@arcgis/core 4.25.0-next.20221106 → 4.25.0-next.20221107

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,n)=>{n.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s}),n(80442);var r=n(78286),o=n(17202);const s={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,r.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.25.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.defaultAssetsPath=s.assetsPath}},20102:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(22974),o=n(92604),s=n(58896);class i extends s.Z{constructor(e,t,n){if(super(e,t,n),!(this instanceof i))return new i(e,t,n)}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,r.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,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(68773),o=(n(80442),n(70586)),s=n(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,...n){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const r=this._argsToKey(n),o=this._loggedMessages[e].get(r);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(r,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of r.Z.log.interceptors)if(t(e,this.module,...n))return;this._inheritedWriter()(e,this.module,...n)}}_parentWithMember(e,t){let n=this;for(;(0,o.pC)(n);){const t=n[e];if((0,o.pC)(t))return t;n=n.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...n){console[e](`[${t}]`,...n)}_matchLevel(e){const t=r.Z.log.level?r.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,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78286);class o{constructor(e,t,n){this.name=e,this.details=n,this instanceof o&&(this.message=(t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,n)=>{if(""===n)return"$";const o=(0,r.hS)(n,t)??"";if(void 0===o)throw new Error(`could not find key "${n}" in template`);return o.toString()}))}(t,n))??"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});class r{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*r._m}getInt(){return this._seed=(r._a*this._seed+r._c)%r._m,this._seed}getFloat(){return this.getInt()/(r._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const n=t-e;return e+this.getInt()/r._m*n}}r._m=2147483647,r._a=48271,r._c=0},67676:(e,t,n)=>{"use strict";n.d(t,{FY:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var r=n(70586),o=n(77734);function s(e,t,n){if((0,r.Wi)(e)&&(0,r.Wi)(t))return!0;if((0,r.Wi)(e)||(0,r.Wi)(t)||e.length!==t.length)return!1;if(n){for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1}else for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function i(e,t){let n=e.length!==t.length;n&&(e.length=t.length);for(let r=0;r<t.length;++r)e[r]!==t[r]&&(e[r]=t[r],n=!0);return n}function a(e,t,n){let r,o;return n?(r=t.filter((t=>!e.some((e=>n(e,t))))),o=e.filter((e=>!t.some((t=>n(t,e)))))):(r=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:r,removed:o}}function c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const n=new Array(e);for(let r=0;r<e;r++)n[r]=t;return n}function f(e,t){void 0===t&&(t=e,e=0);const n=new Array(t-e);for(let r=e;r<t;r++)n[r-e]=r;return n}class d{constructor(){this.last=0}}const h=new d;function p(e,t,n,r){r=r||h;const o=Math.max(0,r.last-10);for(let s=o;s<n;++s)if(e[s]===t)return r.last=s,s;const s=Math.min(o,n);for(let n=0;n<s;++n)if(e[n]===t)return r.last=n,n;return-1}function b(e,t,n,r){const o=n??e.length,s=p(e,t,o,r);if(-1!==s)return e[s]=e[o-1],null==n&&e.pop(),t}const g=new Set;function m(e,t,n=e.length,r=t.length,o,s){if(0===r||0===n)return n;g.clear();for(let e=0;e<r;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<n;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[n-1],--n,--t,0===g.size||0===n))return g.clear(),n;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[n-1],--n,--t,0===g.size||0===n))return g.clear(),n;return g.clear(),n}function y(e,t){const n=e.indexOf(t);return-1!==n?(e.splice(n,1),t):null}new o.Z},60235:(e,t,n)=>{"use strict";n.d(t,{Mr:()=>i,x9:()=>a});var r=n(80442);const o=new Set;function s(e,t,n=!1){n&&o.has(t)||(n&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,n={}){if((0,r.Z)("esri-deprecation-warnings")){const{moduleName:r}=n;a(e,"Property: "+(r?r+"::":"")+t,n)}}function a(e,t,n={}){if((0,r.Z)("esri-deprecation-warnings")){const{replacement:r,version:o,see:i,warnOnce:a}=n;let c=t;r&&(c+=`\n\t🛠️ Replacement: ${r}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},91460:(e,t,n)=>{"use strict";function r(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,n){if(!r(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,n);if(Array.isArray(t)){const r=t.slice();for(const t of r)e.addEventListener(t,n);return{remove(){for(const t of r)e.removeEventListener(t,n)}}}return e.addEventListener(t,n),{remove(){e.removeEventListener(t,n)}}}function s(e,t,n){if(!r(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,n);const s=o(e,t,(t=>{s.remove(),n.call(e,t)}));return{remove(){s.remove()}}}n.d(t,{IH:()=>s,on:()=>o,vT:()=>r})},80442:(e,t,n)=>{"use strict";let r;function o(e){return"function"==typeof r[e]?r[e]=r[e](globalThis):r[e]}n.d(t,{Z:()=>o}),r=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,n,s)=>((s||void 0===r[e])&&(r[e]=t),n&&o(e)),o.cache=r,o.add("esri-deprecation-warnings",!0),(()=>{o.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,n=e.appVersion,r=parseFloat(n);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",n.includes("Konqueror")?r:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!n.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(n.split("Version/")[1])),o.add("mac",n.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),n=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",r=parseFloat(n.replace(/_/,".").replace(/_/g,""));o.add(e,r),o.add("ios",r)}o.add("trident",parseFloat(n.split("Trident/")[1])||void 0),o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("trident")||o("edge")||o.add("mozilla",r),o("mozilla")&&o.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),n=/iPhone/i.test(e);t&&o.add("esri-mobile",t),n&&o.add("esri-iPhone",n),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-canvas-svg-support",!o("trident")),o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.add("wasm-simd",(()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-enabled",!1),o.add("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),o.add("heatmap-force-raster",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,n)=>{"use strict";n.d(t,{Vo:()=>c,d9:()=>a,fS:()=>p,y7:()=>b,yd:()=>i});var r=n(67676),o=n(70586),s=n(1533);function i(e,t){let n;if(t)for(n in e)e.hasOwnProperty(n)&&(void 0===e[n]?delete e[n]:e[n]instanceof Object&&i(e[n],!0));else for(n in e)e.hasOwnProperty(n)&&void 0===e[n]&&delete e[n];return e}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(l(e))return e.clone();if(u(e))return e.map(a);if(f(e))return e.clone();const n={};for(const t of Object.getOwnPropertyNames(e))n[t]=a(e[t]);return n}function c(e){if(!e||"object"!=typeof e||"function"==typeof e||e instanceof HTMLElement)return e;const t=h(e);if((0,o.pC)(t))return t;if(u(e)){let t=!0;const n=e.map((e=>{const n=c(e);return null!=e&&null==n&&(t=!1),n}));return t?n:null}if(l(e))return e.clone();if(!f(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const n of Object.getOwnPropertyNames(e)){const r=e[n],o=c(r);if(null!=r&&null==o)return null;t[n]=o}return t}return null}function l(e){return"function"==typeof e.clone}function u(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function h(e){if((0,s.W0)(e)||(0,s.lq)(e)||(0,s.KZ)(e)||(0,s.z3)(e)||(0,s.Uc)(e)||(0,s.Hx)(e)||(0,s.ZY)(e)||(0,s.xZ)(e)||(0,s.fS)(e))return(0,s.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;for(const[n,r]of e)t.set(n,a(r));return t}if(e instanceof Set){const t=new Set;for(const n of e)t.add(a(n));return t}return null}function p(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}function b(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,r.fS)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e){const e=t.get(n);if(e!==r||void 0===e&&!t.has(n))return!1}return!0}(e,t):!!d(e)&&d(t)&&function(e,t){if(null===e||null===t)return!1;const n=Object.keys(e);if(null===t||Object.keys(t).length!==n.length)return!1;for(const r of n)if(e[r]!==t[r]||!Object.prototype.hasOwnProperty.call(t,r))return!1;return!0}(e,t))}},70586:(e,t,n)=>{"use strict";function r(e){return null!=e}function o(e){return null==e}function s(e,t){return r(e)?t(e):null}function i(e){return e}function a(e,t){return c(e,t),e}function c(e,t){if(o(e))throw new Error(t??"value is None")}function l(e,t){return r(e)?e:"function"==typeof t?t():t}function u(e,t){return r(e)?e:t}function f(e){return r(e)&&e.destroy(),null}function d(e){return r(e)&&e.dispose(),null}function h(e){return r(e)&&e.remove(),null}function p(e){return r(e)&&e.abort(),null}function b(e){return r(e)&&e.release(),null}function g(e,t,n){return r(e)&&r(t)?r(n)?n(e,t):e.equals(t):e===t}function m(e){return null}function y(e,t){const n=new Array;for(const r of e)n.push(v(r,null,t));return n}function w(e,t){for(const n of e)s(n,t)}function v(e,t,n){return r(e)?n(e):t}function _(e){return e.filter((e=>r(e)))}function O(e,...t){let n=e;for(let e=0;e<t.length&&n;++e)n=n[t[e]];return n}function k(e){return e}n.d(t,{Fd:()=>y,IM:()=>p,JR:()=>w,M2:()=>d,O3:()=>c,Pt:()=>l,R2:()=>v,RY:()=>b,SC:()=>f,U2:()=>O,Wg:()=>i,Wi:()=>o,_W:()=>g,hw:()=>h,j0:()=>k,lV:()=>_,pC:()=>r,s3:()=>a,wN:()=>m,yl:()=>u,yw:()=>s})},78286:(e,t,n)=>{"use strict";n.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var r=n(22974);function o(e,t,n=!1){return c(e,t,n)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,n){const r=e.split("."),o=r.pop(),s=a(r,!0,n);s&&o&&(s[o]=t)}function a(e,t,n){let r=n;for(const n of e){if(null==r)return;if(!(n in r)){if(!t)return;r[n]={}}r=r[n]}return r}function c(e,t,n){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,r.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]),n?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,n):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,n)=>{"use strict";n.d(t,{e4:()=>O,zE:()=>c,dD:()=>w,hh:()=>C,Ds:()=>P,as:()=>v,WW:()=>_,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>k,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>A,gx:()=>S,Hl:()=>g});const r=(o=globalThis,{setTimeout:(e,t)=>{const n=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(n)}}});var o;n(60235);var s=n(20102),i=n(91460),a=(n(92604),n(70586));function c(e="Aborted"){return new s.Z("AbortError",e)}function l(e,t="Aborted"){if(f(e))throw c(t)}function u(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return(0,a.pC)(t)&&t.aborted}function d(e){if(m(e))throw e}function h(e){if(!m(e))throw e}function p(e,t){const n=u(e);if(!(0,a.Wi)(n)){if(!n.aborted)return(0,i.IH)(n,"abort",(()=>t()));t()}}function b(e,t){const n=u(e);if(!(0,a.Wi)(n))return l(n),(0,i.IH)(n,"abort",(()=>t(c())))}function g(e,t){const n=u(t);return(0,a.Wi)(n)?e:new Promise(((n,r)=>{let o=p(t,(()=>r(c())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(n,r)}))}function m(e){return"AbortError"===e?.name}async function y(e){try{return await e}catch(e){if(!m(e))throw e;return}}function w(){let e=null;const t=new Promise(((t,n)=>{e={promise:void 0,resolve:t,reject:n}}));return e.promise=t,e}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),n=t.map((t=>e[t])),r=await v(n),o={};return t.map(((e,t)=>o[e]=r[t])),o}const t=e;return new Promise((e=>{const n=[];let r=t.length;0===r&&e(n),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};n.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--r,0===r&&e(n)}))}))}))}async function _(e){return(await v(e)).filter((e=>!!e.value)).map((e=>e.value))}function O(e,t,n){const r=new AbortController;return p(n,(()=>r.abort())),new Promise(((n,o)=>{let s=setTimeout((()=>{s=0,n(t)}),e);p(r,(()=>{s&&(clearTimeout(s),o(c()))}))}))}function k(e){return e&&"function"==typeof e.then}function S(e){return k(e)?e:Promise.resolve(e)}function P(e,t=-1){let n,r,o,s,i=null;const l=(...u)=>{if(n){r=u,s&&s.reject(c()),s=w();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||w(),s=null,t>0){const r=new AbortController;n=S(e(...u,r.signal));const o=n;O(t).then((()=>{n===o&&(s?r.abort():i=r)}))}else n=1,n=S(e(...u));const f=()=>{const e=r;r=o=n=i=null,null!=e&&l(...e)},d=n,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return l}function C(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>r.setTimeout((()=>o.reject(t)),e),o.promise=n,o}async function A(e){await Promise.resolve(),l(e)}},19153:(e,t,n)=>{"use strict";n.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var r=n(78286);const o=/\{([^\}]+)\}/g;function s(e){return e??""}function i(e,t){return e.replace(o,"object"==typeof t?(e,n)=>s((0,r.hS)(n,t)):(e,n)=>s(t(n)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&t.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,n)=>{"use strict";function r(e,t){if(e.forEach)e.forEach(t);else for(let n=0;n<e.length;n++)t(e[n],n,e)}function o(e,t,n){if(e.slice)return e.slice(t,n);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===n?n=e.length:(n<0&&(n+=e.length),n=Math.min(e.length,Math.max(0,n)));const r=Math.max(0,n-t),o=new(0,e.constructor)(r);for(let n=0;n<r;n++)o[n]=e[t+n];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}n.d(t,{Ed:()=>r,Hx:()=>f,KZ:()=>c,Uc:()=>u,W0:()=>i,ZY:()=>d,eP:()=>s,fS:()=>p,lq:()=>a,tP:()=>o,xZ:()=>h,z3:()=>l})},17452:(e,t,n)=>{"use strict";n.d(t,{$U:()=>re,AH:()=>V,B7:()=>A,D6:()=>L,Fv:()=>Z,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>D,PF:()=>F,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>j,ed:()=>N,fZ:()=>ge,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>U,mN:()=>S,oC:()=>te,oh:()=>W,qg:()=>E,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>P,v_:()=>B,vt:()=>ce});var r=n(68773),o=n(20102),s=n(92604),i=n(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=r.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const w={};let v=new y(r.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function S(e){if(!e)return null;const t={path:null,query:null},n=new y(e),r=e.indexOf("?");return null===n.query?t.path=e:(t.path=e.substring(0,r),t.query=P(n.query)),n.fragment&&(t.hash=n.fragment,null===n.query&&(t.path=t.path.substring(0,t.path.length-(n.fragment.length+1)))),t}function P(e){const t=e.split("&"),n={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let r,o;t<0?(r=decodeURIComponent(e),o=""):(r=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=n[r];"string"==typeof s&&(s=n[r]=[s]),Array.isArray(s)?s.push(o):n[r]=o}return n}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function A(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((n=>encodeURIComponent(n)+"="+encodeURIComponent(t(n,e[n])))).join("&"):Object.keys(e).map((n=>{const r=e[n];if(null==r)return"";const o=encodeURIComponent(n)+"=",s=t&&t[n];return s?o+encodeURIComponent(s(r)):Array.isArray(r)?r.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(r)?o+encodeURIComponent(JSON.stringify(r)):o+encodeURIComponent(r)})).filter((e=>e)).join("&"):""}function j(e=!1){let t,n=c.proxyUrl;if("string"==typeof e){t=re(e);const r=N(e);r&&(n=r.proxyUrl)}else t=!!e;if(!n)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(n=oe(n)),S(n)}function E(e){const t=N(e);let n,r;if(t){const e=T(t.proxyUrl);n=e.path,r=e.query?P(e.query):null}if(n){const t=S(e);e=n+"?"+t.path;const o=A({...r,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function T(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=T(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},n=c.proxyRules,r=t.urlPrefix;let o=n.length;for(let e=0;e<n.length;e++){const t=n[e].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=e;break}0===t.indexOf(r)&&(o=e+1)}return n.splice(o,0,t),o}function N(e){const t=c.proxyRules,n=M(e);for(let e=0;e<t.length;e++)if(0===n.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),n=c.interceptors;if(n)for(const e of n)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function L(e,t,n=!1){if(!e||!t)return!1;const r=fe(e),o=fe(t);return!(!n&&r.scheme!==o.scheme)&&null!=r.host&&null!=o.host&&r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port}function U(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(L(e,v))return!0;const t=c.trustedServers||[];for(let n=0;n<t.length;n++){const r=J(t[n]);for(let t=0;t<r.length;t++)if(L(e,r[t]))return!0}return!1}function J(e){return w[e]||(ne(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,n){return te(e)?n&&n.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===D(e).slice(2)?`http:${e}`:`https:${e}`:ne(e)?e:(0,i.j0)(B("/"===e[0]?function(e){const t=e.indexOf("//"),n=e.indexOf("/",t+2);return-1===n?e:e.slice(0,n)}(t):t,e))}function F(e,t=_,n){if(null==e||!H(e))return e;const r=Z(e),o=r.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=n?Z(n).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,n)=>-1===(n=e.indexOf(t,n))?e.length:n;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=r.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 null!=e&&f.test(e)||"http"===v.scheme&&te(e)}(e))return e;const n=e.indexOf("/",7);let r;if(r=-1===n?e:e.slice(0,n),r=r.toLowerCase().slice(7),p.test(r)){if(!r.endsWith(":80"))return e;r=r.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&r===v.authority&&!b.test(e)||(se()&&r===v.authority||t&&t.some((e=>r===e||r.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=T(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function B(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const n=[];if(H(t[0])){const e=t[0],r=e.indexOf("//");-1!==r&&(n.push(e.slice(0,r+1)),function(e){return null!=e&&h.test(e)}(t[0])&&(n[0]+="/"),t[0]=e.slice(r+2))}else"/"===t[0][0]&&n.push("");const r=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<r.length;e++){const t=r[e];".."===t&&n.length>0&&".."!==n[n.length-1]?n.pop():(!t&&e===r.length-1||t&&("."!==t||0===n.length))&&n.push(t)}return n.join("/")}function D(e,t=!1){if(null==e||z(e)||K(e))return null;let n=e.indexOf("://");if(-1===n&&te(e))n=2;else{if(-1===n)return null;n+=3}const r=e.indexOf("/",n);return-1!==r&&(e=e.slice(0,r)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||ne(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return null!=e&&"data:"===e.slice(0,5)}function V(e){const t=Y(e);if(!t||!t.isBase64)return null;const n=atob(t.data),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}function Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,n,r,o]=t;return{mediaType:n,isBase64:!!r,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 n=document.createElement("a");if(!("download"in n))return!1;const r=URL.createObjectURL(e);return n.download=t,n.href=r,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function ne(e){return null!=e&&u.test(e)}function re(e){return null!=e&&d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const n=e.indexOf("//");-1!==n&&(t=n+2)}const n=e.lastIndexOf("/");return n<t?e:e.slice(0,n+1)}function ce(e,t){if(!e)return"";const n=S(e).path.replace(/\/+$/,""),r=n.substring(n.lastIndexOf("/")+1);if(!t?.length)return r;const o=new RegExp(`.(${t.join("|")})$`,"ig");return r.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,n){if(!(t&&n&&e&&H(e)))return e;const r=e.indexOf("//"),o=e.indexOf("/",r+2),s=e.indexOf(":",r+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(r+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,r+2)}${n}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const n=S(e),r=Object.keys(n.query||{});return r.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),n.path}function he(e,t,n){const r=S(e),o=r.query||{};return o[t]=String(n),`${r.path}?${A(o)}`}function pe(e,t){const n=S(e),r=n.query||{};for(const e in t)r[e]=t[e];const o=A(r);return o?`${n.path}?${o}`:n.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?t[2]:null}function ge(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}const me=/([^.]*)\.([^\/]*)$/},25045:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y});var r=n(40330),o=n(20102),s=n(91460),i=n(70586),a=n(95330),c=n(94362),l=n(17202);const u={statsWorker:()=>Promise.all([n.e(1400),n.e(1562),n.e(3847),n.e(6841)]).then(n.bind(n,36841)),geometryEngineWorker:()=>Promise.all([n.e(5837),n.e(8227)]).then(n.bind(n,48227)),CSVSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(7154)]).then(n.bind(n,27793)),EdgeProcessingWorker:()=>Promise.all([n.e(6481),n.e(212),n.e(2062)]).then(n.bind(n,49594)),ElevationSamplerWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(4807),n.e(6481),n.e(6459),n.e(98)]).then(n.bind(n,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([n.e(4547),n.e(4588),n.e(1400),n.e(1534),n.e(1562),n.e(4599),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(2508)]).then(n.bind(n,65967)),GeoJSONSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(7774),n.e(7845)]).then(n.bind(n,97845)),LercWorker:()=>n.e(3027).then(n.bind(n,23027)),MemorySourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(7774),n.e(639)]).then(n.bind(n,30639)),PBFDecoderWorker:()=>Promise.all([n.e(1400),n.e(1562),n.e(5886),n.e(1916)]).then(n.bind(n,61916)),Pipeline:()=>Promise.all([n.e(4547),n.e(4088),n.e(4588),n.e(1400),n.e(1534),n.e(1562),n.e(4599),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4325),n.e(7483)]).then(n.bind(n,37138)),PointCloudWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(9324)]).then(n.bind(n,90447)),RasterWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(8363),n.e(3645),n.e(4370)]).then(n.bind(n,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(6481),n.e(212),n.e(1391)]).then(n.bind(n,73248)),SceneLayerWorker:()=>n.e(1412).then(n.bind(n,31412)),WFSSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(7774),n.e(3230)]).then(n.bind(n,43230)),WorkerTileHandler:()=>Promise.all([n.e(4325),n.e(1785),n.e(6810),n.e(3388)]).then(n.bind(n,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,n){this._port=e,this._getNextJob=n,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 n;n="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const r=new y(t.port1,{channel:t,client:n},(()=>null));return"object"==typeof n&&"remoteClient"in n&&(n.remoteClient=r),y.clients.set(r,n),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,n){const r=n&&n.signal,s=n&&n.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const l=(0,c.jt)();return new Promise(((n,o)=>{if((0,a.Hc)(r))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(r,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:n,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,methodName:e,abortable:null!=r},t,s)}))}on(e,t){const n=new MessageChannel;function r(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:n.port2},[n.port2]),n.port1.addEventListener("message",r),n.port1.start(),{remove(){n.port1.postMessage({type:c.Cs.CLOSE}),n.port1.close(),n.port1.removeEventListener("message",r)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._getNextJob();if(!e)return;const{methodName:t,data:n,invokeOptions:r,deferred:o}=e;this.invoke(t,n,r).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,n=e.jobId,r=t.get(n);this._invokeQueue.push(e),r&&(r.controller&&r.controller.abort(),t.delete(n))}_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:n,data:r,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,r,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:n,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(n,{controller:s,promise:l}),l.then((e=>{i.has(n)&&(i.delete(n),this._post({type:p,jobId:n},e))}),(e=>{i.has(n)&&(i.delete(n),(0,a.D_)(e)||this._post({type:p,jobId:n,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:n},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,n=this._client.on(e.eventType,(e=>{t.postMessage(e)})),r=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e)?.type===c.Cs.CLOSE&&(r.remove(),n.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:n,data:r}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);s.delete(t),this._processWork(),(0,i.hw)(a.abortHandle),n?a.reject(o.Z.fromJSON(JSON.parse(n))):a.resolve(r)}_post(e,t,n){return(0,c.oi)(this._port,e,t,n)}}y.kernelInfo={revision:l.$,version:r.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,n)=>{"use strict";n.d(t,{AB:()=>a,Cs:()=>r,QM:()=>l,jt:()=>i,oi:()=>c});var r,o=n(80442);!function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"}(r||(r={}));let s=0;function i(){return s++}function a(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 c(e,t,n,s){if(t.type===r.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==r.INVOKE&&t.type!==r.RESPONSE)return void e.postMessage(t);let i;if(function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(n)?(i=u(n.transferList),t.data=n.result):(i=u(s),t.data=n),i){if((0,o.Z)("ff"))for(const n of i)if("byteLength"in n&&n.byteLength>267386880){const n="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case r.INVOKE:throw n;case r.RESPONSE:return void c(e,{type:r.RESPONSE,jobId:t.jobId,error:a(n)})}}e.postMessage(t,i)}else e.postMessage(t)}function l(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function u(e){if(!e||!e.length)return null;if((0,o.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,n)=>{"use strict";n.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var r=n(80442),o=n(17452);const s="4.25",i={async request(e,t){const{default:r}=await n.e(3172).then(n.bind(n,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":i&&["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await r(e.url,s),c={data:a.data,ssl:a.ssl};switch(a.requestOptions?.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,r.Z)("host-webworker")},17202:(e,t,n)=>{"use strict";n.d(t,{$:()=>o,r:()=>r});const r="20221106",o="44e054f136576dd5840d73c22e62f5eb5bc7fecb"}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.m=e,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"chunks/"+{9:"3af85d739bdc86ff385d",81:"40874257b1ad3d0e8a5d",98:"b5e6a868256c5aae6d5e",212:"f436c86f86236ea7ea04",223:"360adb2e929956b690fe",247:"9d9e3a38c54c41f7764c",402:"5be314edd66cddf6c67c",565:"e967ffca641947212992",576:"7fdd029a76a7ab1c3d83",639:"7e5b167ee3fb3e47a3bb",661:"bee19483591ff9994495",690:"ae08f7801caa2d1854f0",739:"97d552d8f8fd0c95d31f",759:"c965dece40dcf4931c11",819:"d1ead6e8aa7e8e21fbc6",837:"d9d220622f5e2a15184a",911:"8b8954f3db825b90fddf",1070:"83c28dd2b91a88539b9b",1074:"1dcdde67304e8fe11fc0",1387:"0e340a2a6b8bb5055d6b",1391:"1335ac6ec3f45a484988",1400:"073fdfd01d940c7b1da1",1412:"4726c869d80257488a38",1421:"6196cfdeb91ceba52af3",1423:"b58badb11e610024ce4c",1433:"4d5bdf18feeb9c8cb6ff",1534:"933f9b62a3a20e768927",1545:"c2c288d42129354dc218",1562:"71bc42d18a9e5c356c2a",1612:"5a4ba7155dd858690bcf",1761:"c2a8813b618f98d0016d",1773:"7a343997ff7c88899f3f",1785:"ca92022f53080fda75fe",1916:"7e7c2e91a646edb32605",2062:"9d1faf9358df056be8e7",2133:"2f22105099a3ece58d1d",2134:"63ed004a15ccd6bb4491",2374:"1d00ffb8c70f69ee5080",2508:"516cf307872149caf3da",2592:"3f401ae025618149cb60",2664:"3cbaa8de2817c2560288",2710:"07270f2c07d995f005cd",2855:"490b989ceb9239888af4",3027:"f5b4a8b2bad9b0899954",3172:"878bc2b24cc45418e819",3230:"7125c94ba8ef5efd63b0",3388:"83879da1ff7938a76574",3492:"1596b8a7b9c6533684d3",3529:"688a25a0a9e8d306db6f",3572:"d46f034259943fd76b22",3645:"a4b430aa765a8c78e3f6",3668:"1734c8a19d221a0b5562",3743:"62edaa7821034031e1b5",3810:"f7b5efa569e0d79b3b32",3847:"95ee476d101968ff4925",3852:"b71a0a8a2f446c671161",3929:"07e13ba31ea201f33b97",4028:"a734a062e2785ab502f1",4046:"d08de1095c6db2bd30be",4088:"eb73506dd373453282ba",4166:"5d5c43d44b690bc377ab",4202:"f6bfae78970c7e44a795",4242:"f775b535abf3f2c8ec7e",4268:"a39a51e8a8369f6489bb",4325:"d91140bc583925e4faf6",4358:"71a4618d959a09302c51",4370:"d573ec98401fbae26383",4436:"9ab6855b8d5f9a41e23c",4475:"d0411fe75475c00bd04c",4499:"0551df1118be002289ad",4547:"b728e77d1fa4b8439b14",4588:"e196937fc3589e050009",4599:"abf77557b82133530335",4695:"cfd83bad25be40fe14e9",4807:"cacdb5a9d31d0aaadbe3",4889:"16e9bd57f774944d0bf8",5004:"3bdbcf98c174a54299b3",5179:"342b91fd7b4de1e9efaf",5235:"8fb8d3905f4271aac27d",5329:"0e21e5b4d065567a6a91",5468:"6ec223bcd2c3bd40ffee",5546:"ab5dcf1031f222503610",5587:"dd0cf9d097a64fcc6118",5732:"469ba1b24cdeea0758ec",5837:"ed59ec7a8688437ebdbc",5853:"5de864843c0d3f4d291d",5886:"f8e22d47fadc07b46b9b",6233:"4cb64ccb5fba126f9a66",6237:"794676ee030d605d7f47",6261:"1556e74845e521154fe8",6418:"49f4de4b5333dd83b4c4",6459:"fa3117bb2e11daac000e",6481:"2e3a4fc59789013185f4",6584:"4c0d7a074083aa9614bb",6636:"bdd86772994515142cc7",6710:"d828a0656e7351a74fc4",6748:"77cc27d60c79df45dbc2",6774:"c8402e32307a7b7eaaeb",6785:"33ea3449d32ac21adc91",6794:"c2c1489e005d59c39440",6810:"9bbcf17003f5650c4d96",6841:"31de71018575457155e5",6925:"6ecbb104079c5e276f1f",7035:"819d68175a6e2b3cfd3e",7062:"9d911ea24da940f09000",7126:"1475f89d86cfd422fd18",7154:"c90bca033e64cfad8b43",7202:"02485c243eba85358b53",7269:"7f96fd3844cd6eda0ec3",7275:"074516d441bc117397e4",7277:"09e948f3c726602f50ee",7374:"4dd25e7313c83c157744",7476:"da4d5d9555a7a9ae2622",7483:"284efc85d5716fadea7b",7541:"239c02de83811865c877",7542:"ae2bec0b83a8c4bc493b",7559:"5cd1ff051cbec40532ef",7572:"bf28a9adb9d86d6a14ad",7698:"aa3909ffe65b42c61b52",7774:"ab05015ded44c1f8f0e2",7827:"53864fe7110bc2bd7fbb",7845:"6316bea2130bb9cb515d",7873:"4c989506b46bfec9c5ed",8008:"f23d8ec18740eb2e5e8f",8092:"236cc6c02c45051e8ea9",8096:"22a990a8d4d4587866a5",8227:"ee04b1c0c42cb1b18b24",8244:"50afaa6fddc7ecc96bad",8325:"334289b69befdf9f051a",8363:"f3f8c9179accde36f6a8",8383:"64a5b391443129040852",8394:"ccc0d510f89b5f5eb13e",8636:"f54fcb9359c1da702231",8694:"2d70499eacbd1d2a33a7",8758:"803492088780e18de801",8794:"88e2e45d51151f13d449",8828:"2eb2d49c549e53934b8b",8833:"88b363928779b988418d",8882:"2ebba71cbbfa62ddf46a",9070:"038dc3f9ef06ef3c960c",9169:"76b75ac18c8239687321",9238:"952a5983cf13247e4f95",9243:"47f88f15bae6918d46af",9268:"ed6860ab02d0c848ada5",9291:"179efcf889111d2576c5",9296:"fdf1551b17369fc24905",9300:"f96674f2083018ceadf2",9324:"6dfb2ddfd72009564a34",9356:"9571158575e5a2a8967e",9513:"f7e91552b8f643a4d81a",9777:"211ad79ff0b187c52449",9880:"1b5bdd80db9a1a410ff8",9884:"356db8b8297282c77291",9903:"423ea34526a14fc39171",9904:"3376fbcbd92261d45169",9956:"6ea2f9328cff3d948a13"}[e]+".js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={134:1};n.f.i=(t,r)=>{e[t]||importScripts(n.p+n.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],r=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)n.o(s,a)&&(n.m[a]=s[a]);for(i&&i(n);o.length;)e[o.pop()]=1;r(t)}})(),n(88277);var r=n(25045);RemoteClient=r})();
1
+ var RemoteClient;(()=>{var e={88277:(e,t,n)=>{n.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s}),n(80442);var r=n(78286),o=n(17202);const s={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,r.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.25.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.defaultAssetsPath=s.assetsPath}},20102:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(22974),o=n(92604),s=n(58896);class i extends s.Z{constructor(e,t,n){if(super(e,t,n),!(this instanceof i))return new i(e,t,n)}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,r.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,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(68773),o=(n(80442),n(70586)),s=n(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,...n){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const r=this._argsToKey(n),o=this._loggedMessages[e].get(r);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(r,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of r.Z.log.interceptors)if(t(e,this.module,...n))return;this._inheritedWriter()(e,this.module,...n)}}_parentWithMember(e,t){let n=this;for(;(0,o.pC)(n);){const t=n[e];if((0,o.pC)(t))return t;n=n.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...n){console[e](`[${t}]`,...n)}_matchLevel(e){const t=r.Z.log.level?r.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,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78286);class o{constructor(e,t,n){this.name=e,this.details=n,this instanceof o&&(this.message=(t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,n)=>{if(""===n)return"$";const o=(0,r.hS)(n,t)??"";if(void 0===o)throw new Error(`could not find key "${n}" in template`);return o.toString()}))}(t,n))??"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});class r{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*r._m}getInt(){return this._seed=(r._a*this._seed+r._c)%r._m,this._seed}getFloat(){return this.getInt()/(r._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const n=t-e;return e+this.getInt()/r._m*n}}r._m=2147483647,r._a=48271,r._c=0},67676:(e,t,n)=>{"use strict";n.d(t,{FY:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var r=n(70586),o=n(77734);function s(e,t,n){if((0,r.Wi)(e)&&(0,r.Wi)(t))return!0;if((0,r.Wi)(e)||(0,r.Wi)(t)||e.length!==t.length)return!1;if(n){for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1}else for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function i(e,t){let n=e.length!==t.length;n&&(e.length=t.length);for(let r=0;r<t.length;++r)e[r]!==t[r]&&(e[r]=t[r],n=!0);return n}function a(e,t,n){let r,o;return n?(r=t.filter((t=>!e.some((e=>n(e,t))))),o=e.filter((e=>!t.some((t=>n(t,e)))))):(r=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:r,removed:o}}function c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const n=new Array(e);for(let r=0;r<e;r++)n[r]=t;return n}function f(e,t){void 0===t&&(t=e,e=0);const n=new Array(t-e);for(let r=e;r<t;r++)n[r-e]=r;return n}class d{constructor(){this.last=0}}const h=new d;function p(e,t,n,r){r=r||h;const o=Math.max(0,r.last-10);for(let s=o;s<n;++s)if(e[s]===t)return r.last=s,s;const s=Math.min(o,n);for(let n=0;n<s;++n)if(e[n]===t)return r.last=n,n;return-1}function b(e,t,n,r){const o=n??e.length,s=p(e,t,o,r);if(-1!==s)return e[s]=e[o-1],null==n&&e.pop(),t}const g=new Set;function m(e,t,n=e.length,r=t.length,o,s){if(0===r||0===n)return n;g.clear();for(let e=0;e<r;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<n;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[n-1],--n,--t,0===g.size||0===n))return g.clear(),n;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[n-1],--n,--t,0===g.size||0===n))return g.clear(),n;return g.clear(),n}function y(e,t){const n=e.indexOf(t);return-1!==n?(e.splice(n,1),t):null}new o.Z},60235:(e,t,n)=>{"use strict";n.d(t,{Mr:()=>i,x9:()=>a});var r=n(80442);const o=new Set;function s(e,t,n=!1){n&&o.has(t)||(n&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,n={}){if((0,r.Z)("esri-deprecation-warnings")){const{moduleName:r}=n;a(e,"Property: "+(r?r+"::":"")+t,n)}}function a(e,t,n={}){if((0,r.Z)("esri-deprecation-warnings")){const{replacement:r,version:o,see:i,warnOnce:a}=n;let c=t;r&&(c+=`\n\t🛠️ Replacement: ${r}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},91460:(e,t,n)=>{"use strict";function r(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,n){if(!r(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,n);if(Array.isArray(t)){const r=t.slice();for(const t of r)e.addEventListener(t,n);return{remove(){for(const t of r)e.removeEventListener(t,n)}}}return e.addEventListener(t,n),{remove(){e.removeEventListener(t,n)}}}function s(e,t,n){if(!r(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,n);const s=o(e,t,(t=>{s.remove(),n.call(e,t)}));return{remove(){s.remove()}}}n.d(t,{IH:()=>s,on:()=>o,vT:()=>r})},80442:(e,t,n)=>{"use strict";let r;function o(e){return"function"==typeof r[e]?r[e]=r[e](globalThis):r[e]}n.d(t,{Z:()=>o}),r=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,n,s)=>((s||void 0===r[e])&&(r[e]=t),n&&o(e)),o.cache=r,o.add("esri-deprecation-warnings",!0),(()=>{o.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,n=e.appVersion,r=parseFloat(n);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",n.includes("Konqueror")?r:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!n.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(n.split("Version/")[1])),o.add("mac",n.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),n=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",r=parseFloat(n.replace(/_/,".").replace(/_/g,""));o.add(e,r),o.add("ios",r)}o.add("trident",parseFloat(n.split("Trident/")[1])||void 0),o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("trident")||o("edge")||o.add("mozilla",r),o("mozilla")&&o.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),n=/iPhone/i.test(e);t&&o.add("esri-mobile",t),n&&o.add("esri-iPhone",n),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-canvas-svg-support",!o("trident")),o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.add("wasm-simd",(()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-enabled",!1),o.add("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),o.add("heatmap-force-raster",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,n)=>{"use strict";n.d(t,{Vo:()=>c,d9:()=>a,fS:()=>p,y7:()=>b,yd:()=>i});var r=n(67676),o=n(70586),s=n(1533);function i(e,t){let n;if(t)for(n in e)e.hasOwnProperty(n)&&(void 0===e[n]?delete e[n]:e[n]instanceof Object&&i(e[n],!0));else for(n in e)e.hasOwnProperty(n)&&void 0===e[n]&&delete e[n];return e}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(l(e))return e.clone();if(u(e))return e.map(a);if(f(e))return e.clone();const n={};for(const t of Object.getOwnPropertyNames(e))n[t]=a(e[t]);return n}function c(e){if(!e||"object"!=typeof e||"function"==typeof e||e instanceof HTMLElement)return e;const t=h(e);if((0,o.pC)(t))return t;if(u(e)){let t=!0;const n=e.map((e=>{const n=c(e);return null!=e&&null==n&&(t=!1),n}));return t?n:null}if(l(e))return e.clone();if(!f(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const n of Object.getOwnPropertyNames(e)){const r=e[n],o=c(r);if(null!=r&&null==o)return null;t[n]=o}return t}return null}function l(e){return"function"==typeof e.clone}function u(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function h(e){if((0,s.W0)(e)||(0,s.lq)(e)||(0,s.KZ)(e)||(0,s.z3)(e)||(0,s.Uc)(e)||(0,s.Hx)(e)||(0,s.ZY)(e)||(0,s.xZ)(e)||(0,s.fS)(e))return(0,s.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;for(const[n,r]of e)t.set(n,a(r));return t}if(e instanceof Set){const t=new Set;for(const n of e)t.add(a(n));return t}return null}function p(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}function b(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,r.fS)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e){const e=t.get(n);if(e!==r||void 0===e&&!t.has(n))return!1}return!0}(e,t):!!d(e)&&d(t)&&function(e,t){if(null===e||null===t)return!1;const n=Object.keys(e);if(null===t||Object.keys(t).length!==n.length)return!1;for(const r of n)if(e[r]!==t[r]||!Object.prototype.hasOwnProperty.call(t,r))return!1;return!0}(e,t))}},70586:(e,t,n)=>{"use strict";function r(e){return null!=e}function o(e){return null==e}function s(e,t){return r(e)?t(e):null}function i(e){return e}function a(e,t){return c(e,t),e}function c(e,t){if(o(e))throw new Error(t??"value is None")}function l(e,t){return r(e)?e:"function"==typeof t?t():t}function u(e,t){return r(e)?e:t}function f(e){return r(e)&&e.destroy(),null}function d(e){return r(e)&&e.dispose(),null}function h(e){return r(e)&&e.remove(),null}function p(e){return r(e)&&e.abort(),null}function b(e){return r(e)&&e.release(),null}function g(e,t,n){return r(e)&&r(t)?r(n)?n(e,t):e.equals(t):e===t}function m(e){return null}function y(e,t){const n=new Array;for(const r of e)n.push(v(r,null,t));return n}function w(e,t){for(const n of e)s(n,t)}function v(e,t,n){return r(e)?n(e):t}function _(e){return e.filter((e=>r(e)))}function O(e,...t){let n=e;for(let e=0;e<t.length&&n;++e)n=n[t[e]];return n}function k(e){return e}n.d(t,{Fd:()=>y,IM:()=>p,JR:()=>w,M2:()=>d,O3:()=>c,Pt:()=>l,R2:()=>v,RY:()=>b,SC:()=>f,U2:()=>O,Wg:()=>i,Wi:()=>o,_W:()=>g,hw:()=>h,j0:()=>k,lV:()=>_,pC:()=>r,s3:()=>a,wN:()=>m,yl:()=>u,yw:()=>s})},78286:(e,t,n)=>{"use strict";n.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var r=n(22974);function o(e,t,n=!1){return c(e,t,n)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,n){const r=e.split("."),o=r.pop(),s=a(r,!0,n);s&&o&&(s[o]=t)}function a(e,t,n){let r=n;for(const n of e){if(null==r)return;if(!(n in r)){if(!t)return;r[n]={}}r=r[n]}return r}function c(e,t,n){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,r.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]),n?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,n):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,n)=>{"use strict";n.d(t,{e4:()=>O,zE:()=>c,dD:()=>w,hh:()=>C,Ds:()=>P,as:()=>v,WW:()=>_,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>k,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>A,gx:()=>S,Hl:()=>g});const r=(o=globalThis,{setTimeout:(e,t)=>{const n=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(n)}}});var o;n(60235);var s=n(20102),i=n(91460),a=(n(92604),n(70586));function c(e="Aborted"){return new s.Z("AbortError",e)}function l(e,t="Aborted"){if(f(e))throw c(t)}function u(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return(0,a.pC)(t)&&t.aborted}function d(e){if(m(e))throw e}function h(e){if(!m(e))throw e}function p(e,t){const n=u(e);if(!(0,a.Wi)(n)){if(!n.aborted)return(0,i.IH)(n,"abort",(()=>t()));t()}}function b(e,t){const n=u(e);if(!(0,a.Wi)(n))return l(n),(0,i.IH)(n,"abort",(()=>t(c())))}function g(e,t){const n=u(t);return(0,a.Wi)(n)?e:new Promise(((n,r)=>{let o=p(t,(()=>r(c())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(n,r)}))}function m(e){return"AbortError"===e?.name}async function y(e){try{return await e}catch(e){if(!m(e))throw e;return}}function w(){let e=null;const t=new Promise(((t,n)=>{e={promise:void 0,resolve:t,reject:n}}));return e.promise=t,e}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),n=t.map((t=>e[t])),r=await v(n),o={};return t.map(((e,t)=>o[e]=r[t])),o}const t=e;return new Promise((e=>{const n=[];let r=t.length;0===r&&e(n),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};n.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--r,0===r&&e(n)}))}))}))}async function _(e){return(await v(e)).filter((e=>!!e.value)).map((e=>e.value))}function O(e,t,n){const r=new AbortController;return p(n,(()=>r.abort())),new Promise(((n,o)=>{let s=setTimeout((()=>{s=0,n(t)}),e);p(r,(()=>{s&&(clearTimeout(s),o(c()))}))}))}function k(e){return e&&"function"==typeof e.then}function S(e){return k(e)?e:Promise.resolve(e)}function P(e,t=-1){let n,r,o,s,i=null;const l=(...u)=>{if(n){r=u,s&&s.reject(c()),s=w();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||w(),s=null,t>0){const r=new AbortController;n=S(e(...u,r.signal));const o=n;O(t).then((()=>{n===o&&(s?r.abort():i=r)}))}else n=1,n=S(e(...u));const f=()=>{const e=r;r=o=n=i=null,null!=e&&l(...e)},d=n,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return l}function C(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>r.setTimeout((()=>o.reject(t)),e),o.promise=n,o}async function A(e){await Promise.resolve(),l(e)}},19153:(e,t,n)=>{"use strict";n.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var r=n(78286);const o=/\{([^\}]+)\}/g;function s(e){return e??""}function i(e,t){return e.replace(o,"object"==typeof t?(e,n)=>s((0,r.hS)(n,t)):(e,n)=>s(t(n)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&t.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,n)=>{"use strict";function r(e,t){if(e.forEach)e.forEach(t);else for(let n=0;n<e.length;n++)t(e[n],n,e)}function o(e,t,n){if(e.slice)return e.slice(t,n);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===n?n=e.length:(n<0&&(n+=e.length),n=Math.min(e.length,Math.max(0,n)));const r=Math.max(0,n-t),o=new(0,e.constructor)(r);for(let n=0;n<r;n++)o[n]=e[t+n];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}n.d(t,{Ed:()=>r,Hx:()=>f,KZ:()=>c,Uc:()=>u,W0:()=>i,ZY:()=>d,eP:()=>s,fS:()=>p,lq:()=>a,tP:()=>o,xZ:()=>h,z3:()=>l})},17452:(e,t,n)=>{"use strict";n.d(t,{$U:()=>re,AH:()=>V,B7:()=>A,D6:()=>L,Fv:()=>Z,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>D,PF:()=>F,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>j,ed:()=>N,fZ:()=>ge,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>U,mN:()=>S,oC:()=>te,oh:()=>W,qg:()=>E,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>P,v_:()=>B,vt:()=>ce});var r=n(68773),o=n(20102),s=n(92604),i=n(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=r.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const w={};let v=new y(r.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function S(e){if(!e)return null;const t={path:null,query:null},n=new y(e),r=e.indexOf("?");return null===n.query?t.path=e:(t.path=e.substring(0,r),t.query=P(n.query)),n.fragment&&(t.hash=n.fragment,null===n.query&&(t.path=t.path.substring(0,t.path.length-(n.fragment.length+1)))),t}function P(e){const t=e.split("&"),n={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let r,o;t<0?(r=decodeURIComponent(e),o=""):(r=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=n[r];"string"==typeof s&&(s=n[r]=[s]),Array.isArray(s)?s.push(o):n[r]=o}return n}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function A(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((n=>encodeURIComponent(n)+"="+encodeURIComponent(t(n,e[n])))).join("&"):Object.keys(e).map((n=>{const r=e[n];if(null==r)return"";const o=encodeURIComponent(n)+"=",s=t&&t[n];return s?o+encodeURIComponent(s(r)):Array.isArray(r)?r.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(r)?o+encodeURIComponent(JSON.stringify(r)):o+encodeURIComponent(r)})).filter((e=>e)).join("&"):""}function j(e=!1){let t,n=c.proxyUrl;if("string"==typeof e){t=re(e);const r=N(e);r&&(n=r.proxyUrl)}else t=!!e;if(!n)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(n=oe(n)),S(n)}function E(e){const t=N(e);let n,r;if(t){const e=T(t.proxyUrl);n=e.path,r=e.query?P(e.query):null}if(n){const t=S(e);e=n+"?"+t.path;const o=A({...r,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function T(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=T(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},n=c.proxyRules,r=t.urlPrefix;let o=n.length;for(let e=0;e<n.length;e++){const t=n[e].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=e;break}0===t.indexOf(r)&&(o=e+1)}return n.splice(o,0,t),o}function N(e){const t=c.proxyRules,n=M(e);for(let e=0;e<t.length;e++)if(0===n.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),n=c.interceptors;if(n)for(const e of n)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function L(e,t,n=!1){if(!e||!t)return!1;const r=fe(e),o=fe(t);return!(!n&&r.scheme!==o.scheme)&&null!=r.host&&null!=o.host&&r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port}function U(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(L(e,v))return!0;const t=c.trustedServers||[];for(let n=0;n<t.length;n++){const r=J(t[n]);for(let t=0;t<r.length;t++)if(L(e,r[t]))return!0}return!1}function J(e){return w[e]||(ne(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,n){return te(e)?n&&n.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===D(e).slice(2)?`http:${e}`:`https:${e}`:ne(e)?e:(0,i.j0)(B("/"===e[0]?function(e){const t=e.indexOf("//"),n=e.indexOf("/",t+2);return-1===n?e:e.slice(0,n)}(t):t,e))}function F(e,t=_,n){if(null==e||!H(e))return e;const r=Z(e),o=r.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=n?Z(n).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,n)=>-1===(n=e.indexOf(t,n))?e.length:n;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=r.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 null!=e&&f.test(e)||"http"===v.scheme&&te(e)}(e))return e;const n=e.indexOf("/",7);let r;if(r=-1===n?e:e.slice(0,n),r=r.toLowerCase().slice(7),p.test(r)){if(!r.endsWith(":80"))return e;r=r.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&r===v.authority&&!b.test(e)||(se()&&r===v.authority||t&&t.some((e=>r===e||r.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=T(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function B(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const n=[];if(H(t[0])){const e=t[0],r=e.indexOf("//");-1!==r&&(n.push(e.slice(0,r+1)),function(e){return null!=e&&h.test(e)}(t[0])&&(n[0]+="/"),t[0]=e.slice(r+2))}else"/"===t[0][0]&&n.push("");const r=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<r.length;e++){const t=r[e];".."===t&&n.length>0&&".."!==n[n.length-1]?n.pop():(!t&&e===r.length-1||t&&("."!==t||0===n.length))&&n.push(t)}return n.join("/")}function D(e,t=!1){if(null==e||z(e)||K(e))return null;let n=e.indexOf("://");if(-1===n&&te(e))n=2;else{if(-1===n)return null;n+=3}const r=e.indexOf("/",n);return-1!==r&&(e=e.slice(0,r)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||ne(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return null!=e&&"data:"===e.slice(0,5)}function V(e){const t=Y(e);if(!t||!t.isBase64)return null;const n=atob(t.data),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}function Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,n,r,o]=t;return{mediaType:n,isBase64:!!r,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 n=document.createElement("a");if(!("download"in n))return!1;const r=URL.createObjectURL(e);return n.download=t,n.href=r,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function ne(e){return null!=e&&u.test(e)}function re(e){return null!=e&&d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const n=e.indexOf("//");-1!==n&&(t=n+2)}const n=e.lastIndexOf("/");return n<t?e:e.slice(0,n+1)}function ce(e,t){if(!e)return"";const n=S(e).path.replace(/\/+$/,""),r=n.substring(n.lastIndexOf("/")+1);if(!t?.length)return r;const o=new RegExp(`.(${t.join("|")})$`,"ig");return r.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,n){if(!(t&&n&&e&&H(e)))return e;const r=e.indexOf("//"),o=e.indexOf("/",r+2),s=e.indexOf(":",r+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(r+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,r+2)}${n}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const n=S(e),r=Object.keys(n.query||{});return r.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),n.path}function he(e,t,n){const r=S(e),o=r.query||{};return o[t]=String(n),`${r.path}?${A(o)}`}function pe(e,t){const n=S(e),r=n.query||{};for(const e in t)r[e]=t[e];const o=A(r);return o?`${n.path}?${o}`:n.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?t[2]:null}function ge(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}const me=/([^.]*)\.([^\/]*)$/},25045:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y});var r=n(40330),o=n(20102),s=n(91460),i=n(70586),a=n(95330),c=n(94362),l=n(17202);const u={statsWorker:()=>Promise.all([n.e(1400),n.e(1562),n.e(3847),n.e(6841)]).then(n.bind(n,36841)),geometryEngineWorker:()=>Promise.all([n.e(5837),n.e(8227)]).then(n.bind(n,48227)),CSVSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(7154)]).then(n.bind(n,27793)),EdgeProcessingWorker:()=>Promise.all([n.e(6481),n.e(212),n.e(2062)]).then(n.bind(n,49594)),ElevationSamplerWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(4807),n.e(6481),n.e(6459),n.e(98)]).then(n.bind(n,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([n.e(4547),n.e(4588),n.e(1400),n.e(1534),n.e(1562),n.e(4599),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(2508)]).then(n.bind(n,65967)),GeoJSONSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(7774),n.e(7845)]).then(n.bind(n,97845)),LercWorker:()=>n.e(3027).then(n.bind(n,23027)),MemorySourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(7774),n.e(639)]).then(n.bind(n,30639)),PBFDecoderWorker:()=>Promise.all([n.e(1400),n.e(1562),n.e(5886),n.e(1916)]).then(n.bind(n,61916)),Pipeline:()=>Promise.all([n.e(4547),n.e(4088),n.e(4588),n.e(1400),n.e(1534),n.e(1562),n.e(4599),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4325),n.e(7483)]).then(n.bind(n,37138)),PointCloudWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(9324)]).then(n.bind(n,90447)),RasterWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1562),n.e(8363),n.e(3645),n.e(4370)]).then(n.bind(n,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(6481),n.e(212),n.e(1391)]).then(n.bind(n,73248)),SceneLayerWorker:()=>n.e(1412).then(n.bind(n,31412)),WFSSourceWorker:()=>Promise.all([n.e(4547),n.e(1400),n.e(1534),n.e(1562),n.e(5886),n.e(3847),n.e(9777),n.e(8833),n.e(4807),n.e(7774),n.e(3230)]).then(n.bind(n,43230)),WorkerTileHandler:()=>Promise.all([n.e(4325),n.e(1785),n.e(6810),n.e(3388)]).then(n.bind(n,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,n){this._port=e,this._getNextJob=n,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 n;n="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const r=new y(t.port1,{channel:t,client:n},(()=>null));return"object"==typeof n&&"remoteClient"in n&&(n.remoteClient=r),y.clients.set(r,n),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,n){const r=n&&n.signal,s=n&&n.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const l=(0,c.jt)();return new Promise(((n,o)=>{if((0,a.Hc)(r))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(r,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:n,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,methodName:e,abortable:null!=r},t,s)}))}on(e,t){const n=new MessageChannel;function r(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:n.port2},[n.port2]),n.port1.addEventListener("message",r),n.port1.start(),{remove(){n.port1.postMessage({type:c.Cs.CLOSE}),n.port1.close(),n.port1.removeEventListener("message",r)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._getNextJob();if(!e)return;const{methodName:t,data:n,invokeOptions:r,deferred:o}=e;this.invoke(t,n,r).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,n=e.jobId,r=t.get(n);this._invokeQueue.push(e),r&&(r.controller&&r.controller.abort(),t.delete(n))}_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:n,data:r,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,r,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:n,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(n,{controller:s,promise:l}),l.then((e=>{i.has(n)&&(i.delete(n),this._post({type:p,jobId:n},e))}),(e=>{i.has(n)&&(i.delete(n),(0,a.D_)(e)||this._post({type:p,jobId:n,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:n},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,n=this._client.on(e.eventType,(e=>{t.postMessage(e)})),r=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e)?.type===c.Cs.CLOSE&&(r.remove(),n.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:n,data:r}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);s.delete(t),this._processWork(),(0,i.hw)(a.abortHandle),n?a.reject(o.Z.fromJSON(JSON.parse(n))):a.resolve(r)}_post(e,t,n){return(0,c.oi)(this._port,e,t,n)}}y.kernelInfo={revision:l.$,version:r.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,n)=>{"use strict";n.d(t,{AB:()=>a,Cs:()=>r,QM:()=>l,jt:()=>i,oi:()=>c});var r,o=n(80442);!function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"}(r||(r={}));let s=0;function i(){return s++}function a(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 c(e,t,n,s){if(t.type===r.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==r.INVOKE&&t.type!==r.RESPONSE)return void e.postMessage(t);let i;if(function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(n)?(i=u(n.transferList),t.data=n.result):(i=u(s),t.data=n),i){if((0,o.Z)("ff"))for(const n of i)if("byteLength"in n&&n.byteLength>267386880){const n="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case r.INVOKE:throw n;case r.RESPONSE:return void c(e,{type:r.RESPONSE,jobId:t.jobId,error:a(n)})}}e.postMessage(t,i)}else e.postMessage(t)}function l(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function u(e){if(!e||!e.length)return null;if((0,o.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,n)=>{"use strict";n.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var r=n(80442),o=n(17452);const s="4.25",i={async request(e,t){const{default:r}=await n.e(3172).then(n.bind(n,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":i&&["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await r(e.url,s),c={data:a.data,ssl:a.ssl};switch(a.requestOptions?.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,r.Z)("host-webworker")},17202:(e,t,n)=>{"use strict";n.d(t,{$:()=>o,r:()=>r});const r="20221107",o="72df0da5ef2b9241612ecbfca45a84b70bb830ee"}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.m=e,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"chunks/"+{9:"3af85d739bdc86ff385d",81:"40874257b1ad3d0e8a5d",98:"b5e6a868256c5aae6d5e",212:"f436c86f86236ea7ea04",223:"360adb2e929956b690fe",247:"9d9e3a38c54c41f7764c",402:"5be314edd66cddf6c67c",565:"e967ffca641947212992",576:"7fdd029a76a7ab1c3d83",639:"7e5b167ee3fb3e47a3bb",661:"bee19483591ff9994495",690:"ae08f7801caa2d1854f0",739:"97d552d8f8fd0c95d31f",759:"c965dece40dcf4931c11",819:"d1ead6e8aa7e8e21fbc6",837:"d9d220622f5e2a15184a",911:"8b8954f3db825b90fddf",1070:"83c28dd2b91a88539b9b",1074:"1dcdde67304e8fe11fc0",1387:"0e340a2a6b8bb5055d6b",1391:"1335ac6ec3f45a484988",1400:"073fdfd01d940c7b1da1",1412:"4726c869d80257488a38",1421:"6196cfdeb91ceba52af3",1423:"b58badb11e610024ce4c",1433:"4d5bdf18feeb9c8cb6ff",1534:"933f9b62a3a20e768927",1545:"c2c288d42129354dc218",1562:"71bc42d18a9e5c356c2a",1612:"5a4ba7155dd858690bcf",1761:"c2a8813b618f98d0016d",1773:"7a343997ff7c88899f3f",1785:"ca92022f53080fda75fe",1916:"7e7c2e91a646edb32605",2062:"9d1faf9358df056be8e7",2133:"2f22105099a3ece58d1d",2134:"63ed004a15ccd6bb4491",2374:"1d00ffb8c70f69ee5080",2508:"516cf307872149caf3da",2592:"3f401ae025618149cb60",2664:"3cbaa8de2817c2560288",2710:"07270f2c07d995f005cd",2855:"490b989ceb9239888af4",3027:"f5b4a8b2bad9b0899954",3172:"878bc2b24cc45418e819",3230:"7125c94ba8ef5efd63b0",3388:"83879da1ff7938a76574",3492:"1596b8a7b9c6533684d3",3529:"688a25a0a9e8d306db6f",3572:"d46f034259943fd76b22",3645:"a4b430aa765a8c78e3f6",3668:"1734c8a19d221a0b5562",3743:"62edaa7821034031e1b5",3810:"f7b5efa569e0d79b3b32",3847:"95ee476d101968ff4925",3852:"b71a0a8a2f446c671161",3929:"07e13ba31ea201f33b97",4028:"a734a062e2785ab502f1",4046:"d08de1095c6db2bd30be",4088:"eb73506dd373453282ba",4166:"5d5c43d44b690bc377ab",4202:"f6bfae78970c7e44a795",4242:"f775b535abf3f2c8ec7e",4268:"a39a51e8a8369f6489bb",4325:"d91140bc583925e4faf6",4358:"71a4618d959a09302c51",4370:"d573ec98401fbae26383",4436:"9ab6855b8d5f9a41e23c",4475:"d0411fe75475c00bd04c",4499:"0551df1118be002289ad",4547:"b728e77d1fa4b8439b14",4588:"e196937fc3589e050009",4599:"abf77557b82133530335",4695:"cfd83bad25be40fe14e9",4807:"cacdb5a9d31d0aaadbe3",4889:"16e9bd57f774944d0bf8",5004:"3bdbcf98c174a54299b3",5179:"342b91fd7b4de1e9efaf",5235:"8fb8d3905f4271aac27d",5329:"0e21e5b4d065567a6a91",5468:"6ec223bcd2c3bd40ffee",5546:"ab5dcf1031f222503610",5587:"dd0cf9d097a64fcc6118",5732:"469ba1b24cdeea0758ec",5837:"ed59ec7a8688437ebdbc",5853:"5de864843c0d3f4d291d",5886:"f8e22d47fadc07b46b9b",6233:"4cb64ccb5fba126f9a66",6237:"794676ee030d605d7f47",6261:"1556e74845e521154fe8",6418:"49f4de4b5333dd83b4c4",6459:"fa3117bb2e11daac000e",6481:"2e3a4fc59789013185f4",6584:"4c0d7a074083aa9614bb",6636:"bdd86772994515142cc7",6710:"d828a0656e7351a74fc4",6748:"77cc27d60c79df45dbc2",6774:"c8402e32307a7b7eaaeb",6785:"33ea3449d32ac21adc91",6794:"c2c1489e005d59c39440",6810:"9bbcf17003f5650c4d96",6841:"31de71018575457155e5",6925:"6ecbb104079c5e276f1f",7035:"819d68175a6e2b3cfd3e",7062:"9d911ea24da940f09000",7126:"1475f89d86cfd422fd18",7154:"c90bca033e64cfad8b43",7202:"02485c243eba85358b53",7269:"7f96fd3844cd6eda0ec3",7275:"074516d441bc117397e4",7277:"09e948f3c726602f50ee",7374:"4dd25e7313c83c157744",7476:"da4d5d9555a7a9ae2622",7483:"284efc85d5716fadea7b",7541:"239c02de83811865c877",7542:"ae2bec0b83a8c4bc493b",7559:"5cd1ff051cbec40532ef",7572:"bf28a9adb9d86d6a14ad",7698:"aa3909ffe65b42c61b52",7774:"ab05015ded44c1f8f0e2",7827:"53864fe7110bc2bd7fbb",7845:"6316bea2130bb9cb515d",7873:"4c989506b46bfec9c5ed",8008:"f23d8ec18740eb2e5e8f",8092:"236cc6c02c45051e8ea9",8096:"22a990a8d4d4587866a5",8227:"ee04b1c0c42cb1b18b24",8244:"50afaa6fddc7ecc96bad",8325:"334289b69befdf9f051a",8363:"f3f8c9179accde36f6a8",8383:"64a5b391443129040852",8394:"ccc0d510f89b5f5eb13e",8636:"f54fcb9359c1da702231",8694:"2d70499eacbd1d2a33a7",8758:"803492088780e18de801",8794:"88e2e45d51151f13d449",8828:"2eb2d49c549e53934b8b",8833:"88b363928779b988418d",8882:"2ebba71cbbfa62ddf46a",9070:"038dc3f9ef06ef3c960c",9169:"76b75ac18c8239687321",9238:"952a5983cf13247e4f95",9243:"47f88f15bae6918d46af",9268:"ed6860ab02d0c848ada5",9291:"179efcf889111d2576c5",9296:"fdf1551b17369fc24905",9300:"f96674f2083018ceadf2",9324:"6dfb2ddfd72009564a34",9356:"9571158575e5a2a8967e",9513:"f7e91552b8f643a4d81a",9777:"211ad79ff0b187c52449",9880:"1b5bdd80db9a1a410ff8",9884:"356db8b8297282c77291",9903:"423ea34526a14fc39171",9904:"3376fbcbd92261d45169",9956:"6ea2f9328cff3d948a13"}[e]+".js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={134:1};n.f.i=(t,r)=>{e[t]||importScripts(n.p+n.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],r=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)n.o(s,a)&&(n.m[a]=s[a]);for(i&&i(n);o.length;)e[o.pop()]=1;r(t)}})(),n(88277);var r=n(25045);RemoteClient=r})();
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{ObjectStack as T}from"../../core/ObjectStack.js";import{m as _,a as O}from"../../chunks/mat4.js";import{s as R}from"../../chunks/vec3.js";import{c as t}from"../../chunks/vec3f64.js";import{t as A}from"../../chunks/vec4.js";import{f as r}from"../../chunks/vec4f64.js";import{create as E,fromRay as F,fromLineSegmentAndDirection as n}from"./clipRay.js";import{create as o,copy as M,fromPoints as N,clipInfinite as f,signedDistance as c,isAABBFullyInside as e,clip as u}from"./plane.js";import{sm4d as B,sv4d as G}from"./vectorStacks.js";function H(T){return T?[o(T[0]),o(T[1]),o(T[2]),o(T[3]),o(T[4]),o(T[5])]:[o(),o(),o(),o(),o(),o()]}function I(){return[t(),t(),t(),t(),t(),t(),t(),t()]}function i(T,_){for(let O=0;O<g.NUM;O++)M(T[O],_[O])}function s(T,t,r,E=w){const F=_(B.get(),t,T);O(F,F);for(let _=0;_<b.NUM;++_){const T=A(G.get(),y[_],F);R(E[_],T[0]/T[3],T[1]/T[3],T[2]/T[3])}L(r,E)}function L(T,_){N(_[v.FAR_BOTTOM_LEFT],_[v.NEAR_BOTTOM_LEFT],_[v.NEAR_TOP_LEFT],T[k.LEFT]),N(_[v.NEAR_BOTTOM_RIGHT],_[v.FAR_BOTTOM_RIGHT],_[v.FAR_TOP_RIGHT],T[k.RIGHT]),N(_[v.FAR_BOTTOM_LEFT],_[v.FAR_BOTTOM_RIGHT],_[v.NEAR_BOTTOM_RIGHT],T[k.BOTTOM]),N(_[v.NEAR_TOP_LEFT],_[v.NEAR_TOP_RIGHT],_[v.FAR_TOP_RIGHT],T[k.TOP]),N(_[v.NEAR_BOTTOM_LEFT],_[v.NEAR_BOTTOM_RIGHT],_[v.NEAR_TOP_RIGHT],T[k.NEAR]),N(_[v.FAR_BOTTOM_RIGHT],_[v.FAR_BOTTOM_LEFT],_[v.FAR_TOP_LEFT],T[k.FAR])}function P(T,_){for(let O=0;O<g.NUM;O++){const R=T[O];if(R[0]*_[0]+R[1]*_[1]+R[2]*_[2]+R[3]>=_[3])return!1}return!0}function a(T,_){return l(T,F(_,S.get()))}function m(T,_){for(let O=0;O<g.NUM;O++){const R=T[O];if(!f(R,_))return!1}return!0}function p(T,_,O){return l(T,n(_,O,S.get()))}function U(T,_){for(let O=0;O<g.NUM;O++){if(c(T[O],_)>0)return!1}return!0}function j(T,_){for(let O=0;O<g.NUM;O++)if(e(T[O],_))return!1;return!0}function l(T,_){for(let O=0;O<g.NUM;O++)if(!u(T[O],_))return!1;return!0}var k,v;!function(T){T[T.LEFT=0]="LEFT",T[T.RIGHT=1]="RIGHT",T[T.BOTTOM=2]="BOTTOM",T[T.TOP=3]="TOP",T[T.NEAR=4]="NEAR",T[T.FAR=5]="FAR"}(k||(k={})),function(T){T[T.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",T[T.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",T[T.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",T[T.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",T[T.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",T[T.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",T[T.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",T[T.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(v||(v={}));const h={bottom:[v.FAR_BOTTOM_RIGHT,v.NEAR_BOTTOM_RIGHT,v.NEAR_BOTTOM_LEFT,v.FAR_BOTTOM_LEFT],near:[v.NEAR_BOTTOM_LEFT,v.NEAR_BOTTOM_RIGHT,v.NEAR_TOP_RIGHT,v.NEAR_TOP_LEFT],far:[v.FAR_BOTTOM_RIGHT,v.FAR_BOTTOM_LEFT,v.FAR_TOP_LEFT,v.FAR_TOP_RIGHT],right:[v.NEAR_BOTTOM_RIGHT,v.FAR_BOTTOM_RIGHT,v.FAR_TOP_RIGHT,v.NEAR_TOP_RIGHT],left:[v.FAR_BOTTOM_LEFT,v.NEAR_BOTTOM_LEFT,v.NEAR_TOP_LEFT,v.FAR_TOP_LEFT],top:[v.FAR_TOP_LEFT,v.NEAR_TOP_LEFT,v.NEAR_TOP_RIGHT,v.FAR_TOP_RIGHT]};var g,b;!function(T){T[T.NUM=6]="NUM"}(g||(g={})),function(T){T[T.NUM=8]="NUM"}(b||(b={}));const y=[r(-1,-1,-1,1),r(1,-1,-1,1),r(1,1,-1,1),r(-1,1,-1,1),r(-1,-1,1,1),r(1,-1,1,1),r(1,1,1,1),r(-1,1,1,1)],S=new T(E),w=I();export{g as NumPlanes,b as NumPoints,k as PlaneIndex,v as PointIndex,L as computePlanes,i as copy,H as create,I as createPoints,s as fromMatrix,m as intersectClipRay,j as intersectsAABB,p as intersectsLineSegment,U as intersectsPoint,a as intersectsRay,P as intersectsSphere,h as planePointIndices};
5
+ import{ObjectStack as T}from"../../core/ObjectStack.js";import{m as _,a as O}from"../../chunks/mat4.js";import{s as R}from"../../chunks/vec3.js";import{c as t}from"../../chunks/vec3f64.js";import{t as A}from"../../chunks/vec4.js";import{f as E}from"../../chunks/vec4f64.js";import{create as F,fromRay as r,fromLineSegmentAndDirection as n}from"./clipRay.js";import{create as o,copy as M,fromPoints as N,clipInfinite as c,signedDistance as f,clip as e}from"./plane.js";import{sm4d as B,sv4d as G}from"./vectorStacks.js";function H(T){return T?[o(T[0]),o(T[1]),o(T[2]),o(T[3]),o(T[4]),o(T[5])]:[o(),o(),o(),o(),o(),o()]}function I(){return[t(),t(),t(),t(),t(),t(),t(),t()]}function u(T,_){for(let O=0;O<v.NUM;O++)M(T[O],_[O])}function s(T,t,E,F=y){const r=_(B.get(),t,T);O(r,r);for(let _=0;_<h.NUM;++_){const T=A(G.get(),g[_],r);R(F[_],T[0]/T[3],T[1]/T[3],T[2]/T[3])}L(E,F)}function L(T,_){N(_[l.FAR_BOTTOM_LEFT],_[l.NEAR_BOTTOM_LEFT],_[l.NEAR_TOP_LEFT],T[U.LEFT]),N(_[l.NEAR_BOTTOM_RIGHT],_[l.FAR_BOTTOM_RIGHT],_[l.FAR_TOP_RIGHT],T[U.RIGHT]),N(_[l.FAR_BOTTOM_LEFT],_[l.FAR_BOTTOM_RIGHT],_[l.NEAR_BOTTOM_RIGHT],T[U.BOTTOM]),N(_[l.NEAR_TOP_LEFT],_[l.NEAR_TOP_RIGHT],_[l.FAR_TOP_RIGHT],T[U.TOP]),N(_[l.NEAR_BOTTOM_LEFT],_[l.NEAR_BOTTOM_RIGHT],_[l.NEAR_TOP_RIGHT],T[U.NEAR]),N(_[l.FAR_BOTTOM_RIGHT],_[l.FAR_BOTTOM_LEFT],_[l.FAR_TOP_LEFT],T[U.FAR])}function i(T,_){for(let O=0;O<v.NUM;O++){const R=T[O];if(R[0]*_[0]+R[1]*_[1]+R[2]*_[2]+R[3]>=_[3])return!1}return!0}function P(T,_){return j(T,r(_,b.get()))}function a(T,_){for(let O=0;O<v.NUM;O++){const R=T[O];if(!c(R,_))return!1}return!0}function m(T,_,O){return j(T,n(_,O,b.get()))}function p(T,_){for(let O=0;O<v.NUM;O++){if(f(T[O],_)>0)return!1}return!0}function j(T,_){for(let O=0;O<v.NUM;O++)if(!e(T[O],_))return!1;return!0}var U,l;!function(T){T[T.LEFT=0]="LEFT",T[T.RIGHT=1]="RIGHT",T[T.BOTTOM=2]="BOTTOM",T[T.TOP=3]="TOP",T[T.NEAR=4]="NEAR",T[T.FAR=5]="FAR"}(U||(U={})),function(T){T[T.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",T[T.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",T[T.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",T[T.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",T[T.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",T[T.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",T[T.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",T[T.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(l||(l={}));const k={bottom:[l.FAR_BOTTOM_RIGHT,l.NEAR_BOTTOM_RIGHT,l.NEAR_BOTTOM_LEFT,l.FAR_BOTTOM_LEFT],near:[l.NEAR_BOTTOM_LEFT,l.NEAR_BOTTOM_RIGHT,l.NEAR_TOP_RIGHT,l.NEAR_TOP_LEFT],far:[l.FAR_BOTTOM_RIGHT,l.FAR_BOTTOM_LEFT,l.FAR_TOP_LEFT,l.FAR_TOP_RIGHT],right:[l.NEAR_BOTTOM_RIGHT,l.FAR_BOTTOM_RIGHT,l.FAR_TOP_RIGHT,l.NEAR_TOP_RIGHT],left:[l.FAR_BOTTOM_LEFT,l.NEAR_BOTTOM_LEFT,l.NEAR_TOP_LEFT,l.FAR_TOP_LEFT],top:[l.FAR_TOP_LEFT,l.NEAR_TOP_LEFT,l.NEAR_TOP_RIGHT,l.FAR_TOP_RIGHT]};var v,h;!function(T){T[T.NUM=6]="NUM"}(v||(v={})),function(T){T[T.NUM=8]="NUM"}(h||(h={}));const g=[E(-1,-1,-1,1),E(1,-1,-1,1),E(1,1,-1,1),E(-1,1,-1,1),E(-1,-1,1,1),E(1,-1,1,1),E(1,1,1,1),E(-1,1,1,1)],b=new T(F),y=I();export{v as NumPlanes,h as NumPoints,U as PlaneIndex,l as PointIndex,L as computePlanes,u as copy,H as create,I as createPoints,s as fromMatrix,a as intersectClipRay,m as intersectsLineSegment,p as intersectsPoint,P as intersectsRay,i as intersectsSphere,k as planePointIndices};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../core/mathUtils.js";import{isSome as n}from"../../core/maybe.js";import{c as r,k as o,b as c,n as e,e as u,f as i,g as f,a as s,s as a}from"../../chunks/vec3.js";import{c as I}from"../../chunks/vec3f64.js";import{g as N}from"../../chunks/sphere.js";import{projectPointSignedLength as m}from"./vector.js";import{sv4d as M,sv3d as g}from"./vectorStacks.js";import{tangentFrame as h}from"../../views/3d/support/mathUtils.js";function p(t=$){return[t[0],t[1],t[2],t[3]]}function E(t=$[0],n=$[1],r=$[2],o=$[3]){return F(t,n,r,o,M.get())}function A(t,n){return F(n[0],n[1],n[2],n[3],t)}function F(t,n,r,o,c=p()){return c[0]=t,c[1]=n,c[2]=r,c[3]=o,c}function T(t,n,o){return r(o,t),o[3]=n,o}function _(t,n,r){const o=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],c=Math.abs(o-1)>1e-5&&o>1e-12?1/Math.sqrt(o):1;return r[0]=n[0]*c,r[1]=n[1]*c,r[2]=n[2]*c,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}function j(t,n,r,o=p()){const c=r[0]-n[0],e=r[1]-n[1],u=r[2]-n[2],i=t[0]-n[0],f=t[1]-n[1],s=t[2]-n[2],a=e*s-u*f,I=u*i-c*s,N=c*f-e*i,m=a*a+I*I+N*N,M=Math.abs(m-1)>1e-5&&m>1e-12?1/Math.sqrt(m):1;return o[0]=a*M,o[1]=I*M,o[2]=N*M,o[3]=-(o[0]*t[0]+o[1]*t[1]+o[2]*t[2]),o}function v(t,n){return b(t,n,0,1,2)}function b(t,n,r,i,f){if(t.count<3)return!1;t.getVec(r,y);let s=i,a=!1;for(;s<t.count-1&&!a;)t.getVec(s,X),s++,a=!o(y,X);if(!a)return!1;for(s=Math.max(s,f),a=!1;s<t.count&&!a;)t.getVec(s,d),s++,c(l,y,X),e(l,l),c(C,X,d),e(C,C),a=!o(y,d)&&!o(X,d)&&Math.abs(u(l,C))<k;return a?(j(y,X,d,n),!0):(0!==r||1!==i||2!==f)&&b(t,n,0,1,2)}const k=.99619469809,y=I(),X=I(),d=I(),l=I(),C=I();function L(t,n,r){return n!==t&&A(t,n),t[3]=-u(Z(t),r),t}function P(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}function O(t,n,r,o){return i(d,n,t),_(r,d,o)}function V(t,n,r,o){return Y(t,n,c(g.get(),r,n),nt,o)}function q(t,r,o){return!!n(r)&&Y(t,r.origin,r.direction,rt,o)}function x(t,n,r){return Y(t,n.origin,n.vector,tt.NONE,r)}function U(t,n,r){return Y(t,n.origin,n.vector,tt.CLAMP,r)}function w(t,n){return W(t,N(n))-n[3]>=0}function S(t,n){return W(t,N(n))+n[3]<0}function z(t,n){return W(t,n)>=0}function B(t,n){return W(t,n)<0}function D(t,n){const r=n[0],o=n[1],c=n[2],e=n[3],u=n[4],i=n[5];return t[0]*(t[0]>0?r:e)+t[1]*(t[1]>0?o:u)+t[2]*(t[2]>0?c:i)+t[3]>=0}function G(t,n){const r=u(Z(t),n.ray.direction),o=-W(t,n.ray.origin);if(o<0&&r>=0)return!1;if(r>-1e-6&&r<1e-6)return o>0;if((o<0||r<0)&&!(o<0&&r<0))return!0;const c=o/r;return r>0?c<n.c1&&(n.c1=c):c>n.c0&&(n.c0=c),n.c0<=n.c1}function H(t,n){const r=u(Z(t),n.ray.direction),o=-W(t,n.ray.origin);if(r>-1e-6&&r<1e-6)return o>0;const c=o/r;return r>0?c<n.c1&&(n.c1=c):c>n.c0&&(n.c0=c),n.c0<=n.c1}function J(t,n,r){const o=f(g.get(),Z(t),-t[3]),e=Q(t,c(g.get(),n,o),g.get());return s(r,e,o),r}function K(t,n,r,o){const e=Z(t),u=g.get(),i=g.get();h(e,u,i);const f=c(g.get(),r,n),s=m(u,f),I=m(i,f),N=m(e,f);return a(o,s,I,N)}function Q(t,n,r){const o=f(g.get(),Z(t),u(Z(t),n));return c(r,n,o),r}function R(t,n){return Math.abs(W(t,n))}function W(t,n){return u(Z(t),n)+t[3]}function Y(n,r,o,c,e){const i=u(Z(n),o);if(0===i)return!1;let a=-(u(Z(n),r)+n[3])/i;return c&tt.CLAMP&&(a=t(a,0,1)),!(!(c&tt.INFINITE_MIN)&&a<0||!(c&tt.INFINITE_MAX)&&a>1)&&(s(e,r,f(e,o,a)),!0)}function Z(t){return t}const $=[0,0,1,0];var tt;!function(t){t[t.NONE=0]="NONE",t[t.CLAMP=1]="CLAMP",t[t.INFINITE_MIN=4]="INFINITE_MIN",t[t.INFINITE_MAX=8]="INFINITE_MAX"}(tt||(tt={}));const nt=tt.INFINITE_MIN|tt.INFINITE_MAX,rt=tt.INFINITE_MAX;export{$ as UP,G as clip,H as clipInfinite,A as copy,p as create,R as distance,v as fromManyPoints,b as fromManyPointsSampleAt,T as fromNormalAndOffset,j as fromPoints,_ as fromPositionAndNormal,F as fromValues,O as fromVectorsAndPoint,V as intersectLine,x as intersectLineSegment,U as intersectLineSegmentClamp,q as intersectRay,D as isAABBFullyInside,z as isPointInside,B as isPointOutside,w as isSphereFullyInside,S as isSphereFullyOutside,P as negate,Z as normal,J as projectPoint,K as projectPointLocal,Q as projectVector,L as setOffsetFromPoint,W as signedDistance,E as wrap};
5
+ import{clamp as t}from"../../core/mathUtils.js";import{isSome as n}from"../../core/maybe.js";import{c as r,k as o,b as c,n as e,e as u,f as i,g as f,a as s,s as a}from"../../chunks/vec3.js";import{c as I}from"../../chunks/vec3f64.js";import{g as N}from"../../chunks/sphere.js";import{projectPointSignedLength as m}from"./vector.js";import{sv4d as M,sv3d as g}from"./vectorStacks.js";import{tangentFrame as h}from"../../views/3d/support/mathUtils.js";function p(t=Z){return[t[0],t[1],t[2],t[3]]}function E(t=Z[0],n=Z[1],r=Z[2],o=Z[3]){return F(t,n,r,o,M.get())}function A(t,n){return F(n[0],n[1],n[2],n[3],t)}function F(t,n,r,o,c=p()){return c[0]=t,c[1]=n,c[2]=r,c[3]=o,c}function T(t,n,o){return r(o,t),o[3]=n,o}function _(t,n,r){const o=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],c=Math.abs(o-1)>1e-5&&o>1e-12?1/Math.sqrt(o):1;return r[0]=n[0]*c,r[1]=n[1]*c,r[2]=n[2]*c,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}function j(t,n,r,o=p()){const c=r[0]-n[0],e=r[1]-n[1],u=r[2]-n[2],i=t[0]-n[0],f=t[1]-n[1],s=t[2]-n[2],a=e*s-u*f,I=u*i-c*s,N=c*f-e*i,m=a*a+I*I+N*N,M=Math.abs(m-1)>1e-5&&m>1e-12?1/Math.sqrt(m):1;return o[0]=a*M,o[1]=I*M,o[2]=N*M,o[3]=-(o[0]*t[0]+o[1]*t[1]+o[2]*t[2]),o}function v(t,n){return b(t,n,0,1,2)}function b(t,n,r,i,f){if(t.count<3)return!1;t.getVec(r,y);let s=i,a=!1;for(;s<t.count-1&&!a;)t.getVec(s,X),s++,a=!o(y,X);if(!a)return!1;for(s=Math.max(s,f),a=!1;s<t.count&&!a;)t.getVec(s,d),s++,c(l,y,X),e(l,l),c(C,X,d),e(C,C),a=!o(y,d)&&!o(X,d)&&Math.abs(u(l,C))<k;return a?(j(y,X,d,n),!0):(0!==r||1!==i||2!==f)&&b(t,n,0,1,2)}const k=.99619469809,y=I(),X=I(),d=I(),l=I(),C=I();function L(t,n,r){return n!==t&&A(t,n),t[3]=-u(Y(t),r),t}function P(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}function O(t,n,r,o){return i(d,n,t),_(r,d,o)}function V(t,n,r,o){return W(t,n,c(g.get(),r,n),tt,o)}function q(t,r,o){return!!n(r)&&W(t,r.origin,r.direction,nt,o)}function x(t,n,r){return W(t,n.origin,n.vector,$.NONE,r)}function U(t,n,r){return W(t,n.origin,n.vector,$.CLAMP,r)}function w(t,n){return R(t,N(n))-n[3]>=0}function S(t,n){return R(t,N(n))+n[3]<0}function z(t,n){return R(t,n)>=0}function B(t,n){return R(t,n)<0}function D(t,n){const r=u(Y(t),n.ray.direction),o=-R(t,n.ray.origin);if(o<0&&r>=0)return!1;if(r>-1e-6&&r<1e-6)return o>0;if((o<0||r<0)&&!(o<0&&r<0))return!0;const c=o/r;return r>0?c<n.c1&&(n.c1=c):c>n.c0&&(n.c0=c),n.c0<=n.c1}function G(t,n){const r=u(Y(t),n.ray.direction),o=-R(t,n.ray.origin);if(r>-1e-6&&r<1e-6)return o>0;const c=o/r;return r>0?c<n.c1&&(n.c1=c):c>n.c0&&(n.c0=c),n.c0<=n.c1}function H(t,n,r){const o=f(g.get(),Y(t),-t[3]),e=K(t,c(g.get(),n,o),g.get());return s(r,e,o),r}function J(t,n,r,o){const e=Y(t),u=g.get(),i=g.get();h(e,u,i);const f=c(g.get(),r,n),s=m(u,f),I=m(i,f),N=m(e,f);return a(o,s,I,N)}function K(t,n,r){const o=f(g.get(),Y(t),u(Y(t),n));return c(r,n,o),r}function Q(t,n){return Math.abs(R(t,n))}function R(t,n){return u(Y(t),n)+t[3]}function W(n,r,o,c,e){const i=u(Y(n),o);if(0===i)return!1;let a=-(u(Y(n),r)+n[3])/i;return c&$.CLAMP&&(a=t(a,0,1)),!(!(c&$.INFINITE_MIN)&&a<0||!(c&$.INFINITE_MAX)&&a>1)&&(s(e,r,f(e,o,a)),!0)}function Y(t){return t}const Z=[0,0,1,0];var $;!function(t){t[t.NONE=0]="NONE",t[t.CLAMP=1]="CLAMP",t[t.INFINITE_MIN=4]="INFINITE_MIN",t[t.INFINITE_MAX=8]="INFINITE_MAX"}($||($={}));const tt=$.INFINITE_MIN|$.INFINITE_MAX,nt=$.INFINITE_MAX;export{Z as UP,D as clip,G as clipInfinite,A as copy,p as create,Q as distance,v as fromManyPoints,b as fromManyPointsSampleAt,T as fromNormalAndOffset,j as fromPoints,_ as fromPositionAndNormal,F as fromValues,O as fromVectorsAndPoint,V as intersectLine,x as intersectLineSegment,U as intersectLineSegmentClamp,q as intersectRay,z as isPointInside,B as isPointOutside,w as isSphereFullyInside,S as isSphereFullyOutside,P as negate,Y as normal,H as projectPoint,J as projectPointLocal,K as projectVector,L as setOffsetFromPoint,R as signedDistance,E as wrap};
package/interfaces.d.ts CHANGED
@@ -51962,7 +51962,7 @@ declare namespace __esri {
51962
51962
  */
51963
51963
  interface symbolService {
51964
51964
  /**
51965
- * Converts a [Scalable Vector Graphic](https://pro.arcgis.com/en/pro-app/3.1/help/mapping/layer-properties/scalable-vector-graphics-support.htm) (SVG) to a [CIMSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-CIMSymbol.html).
51965
+ * Converts a [Scalable Vector Graphic](https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/scalable-vector-graphics-support.htm) (SVG) to a [CIMSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-CIMSymbol.html).
51966
51966
  *
51967
51967
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-symbolService.html#generateSymbol)
51968
51968
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.25.0-next.20221106",
3
+ "version": "4.25.0-next.20221107",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS API for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- const e="20221106",c="44e054f136576dd5840d73c22e62f5eb5bc7fecb";export{e as buildDate,c as commitHash};
5
+ const b="20221107",e="72df0da5ef2b9241612ecbfca45a84b70bb830ee";export{b 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.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../core/maybe.js";import{f as t,c as r}from"../../../chunks/vec3f64.js";import{projectVectorToVector as i}from"../../../geometry/projection.js";import a from"../../../geometry/SpatialReference.js";import{wrap as s}from"../../../geometry/support/aaBoundingBox.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import{isPlateCarree as n}from"../../../geometry/support/spatialReferenceUtils.js";import{TileFrustumVisibility as c}from"./interfaces.js";import{createPlanarGlobePatch as l,updateCornersPlanar as h,updateEdgesAndCornersPlanar as m}from"./PatchGeometryFactory.js";import{Tile as u,CenterPosition as d}from"./Tile.js";import{intersectAabbInvDirBefore as p}from"../webgl-engine/materials/internal/MaterialUtil.js";class f extends u{constructor(e,t,r){super(),this._horizontalScaleFactor=1,this._extentInRenderSR=o(),void 0!==e&&this.init(e,t,r)}get horizontalScale(){return this._horizontalScaleFactor}init(r,s,o){super.init(r,s,o);const c=o.view.renderSpatialReference,l=o.spatialReference,h=e(c)&&n(c)&&e(l)&&l.isGeographic?this.ellipsoid.radius*Math.PI/180:1;this._horizontalScaleFactor=h;const m=this.surface.isWebMercatorOnPlateeCarree,u=this._extentInRenderSR,d=this.extent;if(m){const e=t(d[0],d[1],0);i(e,a.WebMercator,e,a.PlateCarree);const r=t(d[2],d[3],0);i(r,a.WebMercator,r,a.PlateCarree),u[0]=e[0],u[1]=e[1],u[2]=r[0],u[3]=r[1]}else for(let e=0;e<4;++e)u[e]=d[e]*h;this.centerAtSeaLevel[0]=.5*(u[0]+u[2]),this.centerAtSeaLevel[1]=.5*(u[1]+u[3]),this.centerAtSeaLevel[2]=0,this._edgeLen=Math.max(u[2]-u[0],u[3]-u[1]),this._edgeLen2=this._edgeLen*this._edgeLen,this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateCenter();const e=this._extentInRenderSR,t=.5*(e[2]-e[0]),r=.5*(e[3]-e[1]),i=Math.sqrt(t*t+r*r),a=.5*(this.elevationBounds[0]-this.elevationBounds[1]),s=Math.max(i,a);this._center[d.MIDDLE][3]=s}_calculateFrustumVisibilityStatus(e){const t=this._aabb(),r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],n=t[5];let l=!0;for(let h=0;h<6;h++){const t=e[h],m=t[0],u=t[1],d=t[2],p=t[3];if(m*(m>0?r:s)+u*(u>0?i:o)+d*(d>0?a:n)+p>=0)return c.OUTSIDE;if(l=l&&m*(m<0?r:s)+u*(u<0?i:o)+d*(d<0?a:n)+p<=0,!l)break}return l?c.INSIDE:c.INTERSECTS}_aabb(){const e=this._extentInRenderSR;return s(e[0],e[1],this.elevationBounds[0],e[2],e[3],this.elevationBounds[1])}intersectsRay(e,t,r,i){return S[0]=1/t[0],S[1]=1/t[1],S[2]=1/t[2],p(this._aabb(),e,S,r,i)}createGeometry(){l(this.renderData,this._horizontalScaleFactor),this.setMemoryDirty()}getDefaultVerticesPerRowOnLevel(){return this.level<9?3:2}updateCornerElevations(){h(this.renderData,this._horizontalScaleFactor)}updateEdgeElevations(){m(this.renderData,this._horizontalScaleFactor)}}const S=r();export{f as PlanarPatch};
5
+ import{isSome as e}from"../../../core/maybe.js";import{f as t,c as r}from"../../../chunks/vec3f64.js";import{projectVectorToVector as i}from"../../../geometry/projection.js";import a from"../../../geometry/SpatialReference.js";import{wrap as s}from"../../../geometry/support/aaBoundingBox.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import{isPlateCarree as n}from"../../../geometry/support/spatialReferenceUtils.js";import{TileFrustumVisibility as c}from"./interfaces.js";import{createPlanarGlobePatch as l,updateCornersPlanar as h,updateEdgesAndCornersPlanar as m}from"./PatchGeometryFactory.js";import{Tile as u,CenterPosition as d}from"./Tile.js";import{intersectAabbInvDirBefore as p}from"../webgl-engine/materials/internal/MaterialUtil.js";class f extends u{constructor(e,t,r){super(),this._horizontalScaleFactor=1,this._extentInRenderSR=o(),void 0!==e&&this.init(e,t,r)}get horizontalScale(){return this._horizontalScaleFactor}init(r,s,o){super.init(r,s,o);const c=o.view.renderSpatialReference,l=o.spatialReference,h=e(c)&&n(c)&&e(l)&&l.isGeographic?this.ellipsoid.radius*Math.PI/180:1;this._horizontalScaleFactor=h;const m=this.surface.isWebMercatorOnPlateeCarree,u=this._extentInRenderSR,d=this.extent;if(m){const e=t(d[0],d[1],0);i(e,a.WebMercator,e,a.PlateCarree);const r=t(d[2],d[3],0);i(r,a.WebMercator,r,a.PlateCarree),u[0]=e[0],u[1]=e[1],u[2]=r[0],u[3]=r[1]}else for(let e=0;e<4;++e)u[e]=d[e]*h;this.centerAtSeaLevel[0]=.5*(u[0]+u[2]),this.centerAtSeaLevel[1]=.5*(u[1]+u[3]),this.centerAtSeaLevel[2]=0,this._edgeLen=Math.max(u[2]-u[0],u[3]-u[1]),this._edgeLen2=this._edgeLen*this._edgeLen,this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateCenter();const e=this._extentInRenderSR,t=.5*(e[2]-e[0]),r=.5*(e[3]-e[1]),i=Math.sqrt(t*t+r*r),a=.5*(this.elevationBounds[0]-this.elevationBounds[1]),s=Math.max(i,a);this._center[d.MIDDLE][3]=s}_calculateFrustumVisibilityStatus(e){const t=this._aabb(),r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],n=t[5];let l=!0;for(let h=0;h<6;h++){const t=e[h],m=t[0],u=t[1],d=t[2],p=t[3];if(m*(m>0?r:s)+u*(u>0?i:o)+d*(d>0?a:n)+p>=0)return c.OUTSIDE;l=l&&m*(m<0?r:s)+u*(u<0?i:o)+d*(d<0?a:n)+p<=0}return l?c.INSIDE:c.INTERSECTS}_aabb(){const e=this._extentInRenderSR;return s(e[0],e[1],this.elevationBounds[0],e[2],e[3],this.elevationBounds[1])}intersectsRay(e,t,r,i){return S[0]=1/t[0],S[1]=1/t[1],S[2]=1/t[2],p(this._aabb(),e,S,r,i)}createGeometry(){l(this.renderData,this._horizontalScaleFactor),this.setMemoryDirty()}getDefaultVerticesPerRowOnLevel(){return this.level<9?3:2}updateCornerElevations(){h(this.renderData,this._horizontalScaleFactor)}updateEdgeElevations(){m(this.renderData,this._horizontalScaleFactor)}}const S=r();export{f as PlanarPatch};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../core/HandleOwner.js";import r from"../../../core/Handles.js";import{someMap as o}from"../../../core/MapUtils.js";import{isSome as n,isNone as s,unwrap as a}from"../../../core/maybe.js";import{eachAlwaysValues as i,throwIfAborted as c}from"../../../core/promiseUtils.js";import{sync as u,watch as l,syncAndInitial as p}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{o as g}from"../../../chunks/vec2.js";import{c as y}from"../../../chunks/vec3.js";import{c as S}from"../../../chunks/vec3f64.js";import{SnappingTypes as m}from"../../../layers/graphics/data/QueryEngineResult.js";import{absoluteHeightElevationInfo as f,getConvertedElevationFromVector as v}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as w}from"./SnappingConstraint.js";import{SnappingDomain as _}from"./SnappingDomain.js";import{sortCandidatesInPlace as j,convertPointElevation as C,screenDistance as F}from"./snappingUtils.js";import{EdgeSnappingCandidate as x}from"./candidates/EdgeSnappingCandidate.js";import{FeatureSnappingCandidate as H}from"./candidates/FeatureSnappingCandidate.js";import{RightAngleSnappingCandidate as b,OtherVertexType as R}from"./candidates/RightAngleSnappingCandidate.js";import{vectorToScreenPoint as L}from"../support/viewUtils.js";let M=class extends t{constructor(e){super(e),this.options=null,this._domain=_.FEATURE,this._sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null},notes:{module:null,loader:null},scene:{module:null,loader:null}}}get updating(){return o(this.snappingSources,(({snappingSource:e})=>e.updating))||this.updatingHandles.updating}get snappingSources(){const e=this._get("snappingSources")||new Map,t=new Map;if(n(this.options)&&n(this.options.featureSources))for(const r of this.options.featureSources.items){const o=r.layer.uid,s=e.get(o);if(s){e.delete(o),t.set(o,s);continue}if(!r.layer.loaded){this.updatingHandles.addPromise(r.layer.load());continue}const a=this._createSourceInfo(r);n(a)&&t.set(o,a)}for(const[,r]of e)r.destroy();return t}initialize(){this.updatingHandles.add((()=>this.snappingSources),(()=>this.notifyChange("updating")),u),n(this.view)&&this.handles.add([this.view.on("layerview-create",(e=>this._updateLayerView(e.layer,e.layerView))),this.view.on("layerview-destroy",(e=>this._updateLayerView(e.layer,null)))])}_updateLayerView(e,t){for(const[,r]of this.snappingSources)r.snappingSource.layerSource.layer===e&&(r.layerView=t)}destroy(){this._set("options",null);for(const[,e]of this.snappingSources)e.destroy()}async fetchCandidates(e,t,r,o){if(!(t&this._domain)||s(this.options)||!this.options.effectiveFeatureEnabled)return[];const a=[],u=this._computeScreeenSizeDistanceParameters(e,r),l={distance:u,point:e,coordinateHelper:r.coordinateHelper,types:this._types};for(const[,{snappingSource:s,layerView:i}]of this.snappingSources)!s.layerSource.enabled||n(i)&&i.suspended||a.push(s.fetchCandidates(l,o).then((e=>e.filter((e=>!this._candidateIsExcluded(s,e,r.excludeFeature))))));const p=(await i(a)).flat();return this._addRightAngleCandidates(p,e,u,r),c(o),j(e,p,r.coordinateHelper),p}_addRightAngleCandidates(e,t,r,o){const s=n(o.vertexHandle)?o.vertexHandle.rightEdge?.rightVertex?.pos:n(o.editGeometryOperations)&&"polygon"===o.editGeometryOperations.data.type?a(o.editGeometryOperations.data.components[0]?.getFirstVertex())?.pos:null,i=n(o.vertexHandle)?o.vertexHandle.leftEdge?.leftVertex?.pos:n(o.editGeometryOperations)?a(o.editGeometryOperations.data.components[0]?.getLastVertex())?.pos:null,{view:c}=this,u=C(s,c,o),l=C(i,c,o),p=e.length;for(let n=0;n<p;n++)this._addRightAngleCandidate(e[n],l,t,r,o,e),this._addRightAngleCandidate(e[n],u,t,r,o,e)}_addRightAngleCandidate(e,t,r,o,n,a){const i=e instanceof x,c=i&&g(e.constraint.start,e.constraint.end);if(s(t)||!i||c)return;const u=e.constraint.closestTo(t),l=(u[0]-r[0])/o.x,p=(u[1]-r[1])/o.y;if(l*l+p*p<=1){const r=n.coordinateHelper,o=new b({coordinateHelper:r,targetPoint:u,otherVertex:t,otherVertexType:R.NEXT,previousVertex:e.constraint.start,constraint:new w(r,t,u),objectId:e.objectId,elevationInfo:e.elevationInfo});a.push(o)}}_computeScreeenSizeDistanceParameters(e,t){let r=n(this.options)?this.options.distance*("touch"===t.pointer?this.options.touchSensitivityMultiplier:1):0;return s(this.view)?{x:r,y:r,z:r,distance:r}:"2d"===this.view.type?(r*=this.view.resolution,{x:r,y:r,z:r,distance:r}):this._computeScreenSizeDistanceParameters3D(e,r,this.view,t)}_computeScreenSizeDistanceParameters3D(e,t,r,o){const{coordinateHelper:n,elevationInfo:s}=o,{spatialReference:a}=n,i=n.hasZ()?f:s,c=n.toXYZ(e,E);c[2]=v(r,c,a,i,f),r.renderCoordsHelper.toRenderCoords(c,a,G);const u=r.state.camera.computeScreenPixelSizeAt(G),l=u*r.renderCoordsHelper.unitInMeters/r.mapCoordsHelper.unitInMeters,p=t*l,d=L(c,a,i,r),h=V(d,c,l,0,0,r,o),g=V(d,c,0,l,0,r,o),y=V(d,c,0,0,l,r,o);return{x:0===h?0:p/h,y:0===g?0:p/g,z:0===y?0:p/y,distance:u*t}}get _types(){return m.EDGE|m.VERTEX}_candidateIsExcluded(e,t,r){if(s(r))return!1;const o=this._getCandidateObjectId(t);if(s(o))return!1;const n=e.layerSource.layer;return"graphics"===n.type?r.uid===o:r.sourceLayer===n&&(!(!r.attributes||!("objectIdField"in n))&&r.attributes[n.objectIdField]===o)}_getCandidateObjectId(e){return e instanceof H?e.objectId:null}_createSourceInfo(e){const t=this._createFeatureSnappingSourceType(e);if(s(t))return null;if("loading"in t)return this.updatingHandles.addPromise(t.loading.then((()=>{this.destroyed||this.notifyChange("snappingSources")}))),null;const r=n(this.view)?this.view.allLayerViews.find((t=>t.layer===e.layer)):null;return new I(t.source,r)}_createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"oriented-imagery":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e);case"map-notes":return this._createFeatureSnappingSourceMapNotesLayer(e);case"scene":case"building-scene":return this._createFeatureSnappingSourceSceneLayer(e)}return null}_createFeatureSnappingSourceSceneLayer(e){const{view:t}=this;if(s(t)||"3d"!==t.type)return null;const r=this._getSourceModule("scene");return n(r.module)?{source:new r.module.SceneLayerSnappingSource({layerSource:e,view:t})}:{loading:r.loader}}_createFeatureSnappingSourceFeatureLayer(e){switch(e.layer.source.type){case"feature-layer":case"oriented-imagery":{const t=this._getSourceModule("featureService");return n(t.module)?{source:new t.module.FeatureServiceSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}case"memory":case"csv":case"geojson":case"wfs":{if("mesh"===e.layer.geometryType)return null;const t=this._getSourceModule("featureCollection");return n(t.module)?{source:new t.module.FeatureCollectionSnappingSource({layerSource:e,view:this.view})}:{loading:t.loader}}}return null}_createFeatureSnappingSourceGraphicsLayer(e){const t=this._getSourceModule("graphics");return n(t.module)?{source:new t.module.GraphicsSnappingSource({getGraphicsLayers:()=>[e.layer],spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}_createFeatureSnappingSourceMapNotesLayer(e){const t=this._getSourceModule("notes");return n(t.module)?{source:new t.module.GraphicsSnappingSource({getGraphicsLayers:()=>n(e.layer.sublayers)?e.layer.sublayers.toArray():[],spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}_getSourceModule(e){const t=this._sourceModules[e];if(s(t.loader)){const r=this._loadSourceModule(e).then((e=>{t.module=e}));return t.loader=r,{module:t.module,loader:r}}return{module:t.module,loader:t.loader}}_loadSourceModule(e){const t=this.updatingHandles;switch(e){case"featureService":return t.addPromise(import("./featureSources/FeatureServiceSnappingSource.js"));case"featureCollection":return t.addPromise(import("./featureSources/FeatureCollectionSnappingSource.js"));case"graphics":case"notes":return t.addPromise(import("./featureSources/GraphicsSnappingSource.js"));case"scene":return t.addPromise(import("./featureSources/SceneLayerSnappingSource.js"))}return null}};e([d({constructOnly:!0})],M.prototype,"spatialReference",void 0),e([d({constructOnly:!0})],M.prototype,"view",void 0),e([d()],M.prototype,"options",void 0),e([d({readOnly:!0})],M.prototype,"updating",null),e([d({readOnly:!0})],M.prototype,"snappingSources",null),M=e([h("esri.views.interactive.snapping.FeatureSnappingEngine")],M);class I{constructor(e,t){this.snappingSource=e,this.layerView=t,this.handles=new r;const o=this.snappingSource.layerSource.layer;if("refresh"in o){const t=o;this.handles.add(t.on("refresh",(()=>e.refresh())))}this.handles.add([l((()=>e.updating),(t=>e.layerSource.updating=t),p),l((()=>e.availability),(t=>e.layerSource.availability=t),p)])}destroy(){this.snappingSource.destroy(),this.handles.destroy()}}function V(e,t,r,o,n,s,{coordinateHelper:a}){const i=y(O,t);i[0]+=r,i[1]+=o,i[2]+=n;const c=L(i,a.spatialReference,f,s);return F(c,e)}const E=S(),G=S(),O=S();export{M as FeatureSnappingEngine};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../core/HandleOwner.js";import r from"../../../core/Handles.js";import{someMap as o}from"../../../core/MapUtils.js";import{isSome as n,isNone as s,unwrap as a}from"../../../core/maybe.js";import{eachAlwaysValues as i,throwIfAborted as c}from"../../../core/promiseUtils.js";import{sync as u,watch as l,syncAndInitial as p}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{o as g}from"../../../chunks/vec2.js";import{c as y}from"../../../chunks/vec3.js";import{c as S}from"../../../chunks/vec3f64.js";import{SnappingTypes as m}from"../../../layers/graphics/data/QueryEngineResult.js";import{absoluteHeightElevationInfo as f,getConvertedElevationFromVector as v}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as w}from"./SnappingConstraint.js";import{SnappingDomain as _}from"./SnappingDomain.js";import{sortCandidatesInPlace as j,convertPointElevation as C,screenDistance as F}from"./snappingUtils.js";import{EdgeSnappingCandidate as x}from"./candidates/EdgeSnappingCandidate.js";import{FeatureSnappingCandidate as H}from"./candidates/FeatureSnappingCandidate.js";import{RightAngleSnappingCandidate as b,OtherVertexType as R}from"./candidates/RightAngleSnappingCandidate.js";import{vectorToScreenPoint as L}from"../support/viewUtils.js";let M=class extends t{constructor(e){super(e),this.options=null,this._domain=_.FEATURE,this._sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null},notes:{module:null,loader:null},scene:{module:null,loader:null}}}get updating(){return o(this.snappingSources,(({snappingSource:e})=>e.updating))||this.updatingHandles.updating}get snappingSources(){const e=this._get("snappingSources")||new Map,t=new Map;if(n(this.options)&&n(this.options.featureSources))for(const r of this.options.featureSources.items){const o=r.layer.uid,s=e.get(o);if(s){e.delete(o),t.set(o,s);continue}if(!r.layer.loaded){this.updatingHandles.addPromise(r.layer.load());continue}const a=this._createSourceInfo(r);n(a)&&t.set(o,a)}for(const[,r]of e)r.destroy();return t}initialize(){this.updatingHandles.add((()=>this.snappingSources),(()=>this.notifyChange("updating")),u),n(this.view)&&this.handles.add([this.view.on("layerview-create",(e=>this._updateLayerView(e.layer,e.layerView))),this.view.on("layerview-destroy",(e=>this._updateLayerView(e.layer,null)))])}_updateLayerView(e,t){for(const[,r]of this.snappingSources)r.snappingSource.layerSource.layer===e&&(r.layerView=t)}destroy(){this._set("options",null);for(const[,e]of this.snappingSources)e.destroy()}async fetchCandidates(e,t,r,o){if(!(t&this._domain)||s(this.options)||!this.options.effectiveFeatureEnabled)return[];const a=[],u=this._computeScreeenSizeDistanceParameters(e,r),l={distance:u,point:e,coordinateHelper:r.coordinateHelper,types:this._types};for(const[,{snappingSource:s,layerView:i}]of this.snappingSources)!s.layerSource.enabled||n(i)&&i.suspended||a.push(s.fetchCandidates(l,o).then((e=>e.filter((e=>!this._candidateIsExcluded(s,e,r.excludeFeature))))));const p=(await i(a)).flat();return this._addRightAngleCandidates(p,e,u,r),c(o),j(e,p,r.coordinateHelper),p}_addRightAngleCandidates(e,t,r,o){const s=n(o.vertexHandle)?o.vertexHandle.rightEdge?.rightVertex?.pos:n(o.editGeometryOperations)&&"polygon"===o.editGeometryOperations.data.type?a(o.editGeometryOperations.data.components[0]?.getFirstVertex())?.pos:null,i=n(o.vertexHandle)?o.vertexHandle.leftEdge?.leftVertex?.pos:n(o.editGeometryOperations)?a(o.editGeometryOperations.data.components[0]?.getLastVertex())?.pos:null,{view:c}=this,u=C(s,c,o),l=C(i,c,o),p=e.length;for(let n=0;n<p;n++)this._addRightAngleCandidate(e[n],l,t,r,o,e),this._addRightAngleCandidate(e[n],u,t,r,o,e)}_addRightAngleCandidate(e,t,r,o,n,a){const i=e instanceof x,c=i&&g(e.constraint.start,e.constraint.end);if(s(t)||!i||c)return;const u=e.constraint.closestTo(t),l=(u[0]-r[0])/o.x,p=(u[1]-r[1])/o.y;if(l*l+p*p<=1){const r=n.coordinateHelper,o=new b({coordinateHelper:r,targetPoint:u,otherVertex:t,otherVertexType:R.NEXT,previousVertex:e.constraint.start,constraint:new w(r,t,u),objectId:e.objectId,elevationInfo:e.elevationInfo});a.push(o)}}_computeScreeenSizeDistanceParameters(e,t){let r=n(this.options)?this.options.distance*("touch"===t.pointer?this.options.touchSensitivityMultiplier:1):0;return s(this.view)?{x:r,y:r,z:r,distance:r}:"2d"===this.view.type?(r*=this.view.resolution,{x:r,y:r,z:r,distance:r}):this._computeScreenSizeDistanceParameters3D(e,r,this.view,t)}_computeScreenSizeDistanceParameters3D(e,t,r,o){const{coordinateHelper:n,elevationInfo:s}=o,{spatialReference:a}=n,i=n.hasZ()?f:s,c=n.toXYZ(e,E);c[2]=v(r,c,a,i,f),r.renderCoordsHelper.toRenderCoords(c,a,G);const u=r.state.camera.computeScreenPixelSizeAt(G),l=u*r.renderCoordsHelper.unitInMeters/r.mapCoordsHelper.unitInMeters,p=t*l,d=L(c,a,f,r),h=V(d,c,l,0,0,r,o),g=V(d,c,0,l,0,r,o),y=V(d,c,0,0,l,r,o);return{x:0===h?0:p/h,y:0===g?0:p/g,z:0===y?0:p/y,distance:u*t}}get _types(){return m.EDGE|m.VERTEX}_candidateIsExcluded(e,t,r){if(s(r))return!1;const o=this._getCandidateObjectId(t);if(s(o))return!1;const n=e.layerSource.layer;return"graphics"===n.type?r.uid===o:r.sourceLayer===n&&(!(!r.attributes||!("objectIdField"in n))&&r.attributes[n.objectIdField]===o)}_getCandidateObjectId(e){return e instanceof H?e.objectId:null}_createSourceInfo(e){const t=this._createFeatureSnappingSourceType(e);if(s(t))return null;if("loading"in t)return this.updatingHandles.addPromise(t.loading.then((()=>{this.destroyed||this.notifyChange("snappingSources")}))),null;const r=n(this.view)?this.view.allLayerViews.find((t=>t.layer===e.layer)):null;return new I(t.source,r)}_createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"oriented-imagery":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e);case"map-notes":return this._createFeatureSnappingSourceMapNotesLayer(e);case"scene":case"building-scene":return this._createFeatureSnappingSourceSceneLayer(e)}return null}_createFeatureSnappingSourceSceneLayer(e){const{view:t}=this;if(s(t)||"3d"!==t.type)return null;const r=this._getSourceModule("scene");return n(r.module)?{source:new r.module.SceneLayerSnappingSource({layerSource:e,view:t})}:{loading:r.loader}}_createFeatureSnappingSourceFeatureLayer(e){switch(e.layer.source.type){case"feature-layer":case"oriented-imagery":{const t=this._getSourceModule("featureService");return n(t.module)?{source:new t.module.FeatureServiceSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}case"memory":case"csv":case"geojson":case"wfs":{if("mesh"===e.layer.geometryType)return null;const t=this._getSourceModule("featureCollection");return n(t.module)?{source:new t.module.FeatureCollectionSnappingSource({layerSource:e,view:this.view})}:{loading:t.loader}}}return null}_createFeatureSnappingSourceGraphicsLayer(e){const t=this._getSourceModule("graphics");return n(t.module)?{source:new t.module.GraphicsSnappingSource({getGraphicsLayers:()=>[e.layer],spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}_createFeatureSnappingSourceMapNotesLayer(e){const t=this._getSourceModule("notes");return n(t.module)?{source:new t.module.GraphicsSnappingSource({getGraphicsLayers:()=>n(e.layer.sublayers)?e.layer.sublayers.toArray():[],spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}_getSourceModule(e){const t=this._sourceModules[e];if(s(t.loader)){const r=this._loadSourceModule(e).then((e=>{t.module=e}));return t.loader=r,{module:t.module,loader:r}}return{module:t.module,loader:t.loader}}_loadSourceModule(e){const t=this.updatingHandles;switch(e){case"featureService":return t.addPromise(import("./featureSources/FeatureServiceSnappingSource.js"));case"featureCollection":return t.addPromise(import("./featureSources/FeatureCollectionSnappingSource.js"));case"graphics":case"notes":return t.addPromise(import("./featureSources/GraphicsSnappingSource.js"));case"scene":return t.addPromise(import("./featureSources/SceneLayerSnappingSource.js"))}return null}};e([d({constructOnly:!0})],M.prototype,"spatialReference",void 0),e([d({constructOnly:!0})],M.prototype,"view",void 0),e([d()],M.prototype,"options",void 0),e([d({readOnly:!0})],M.prototype,"updating",null),e([d({readOnly:!0})],M.prototype,"snappingSources",null),M=e([h("esri.views.interactive.snapping.FeatureSnappingEngine")],M);class I{constructor(e,t){this.snappingSource=e,this.layerView=t,this.handles=new r;const o=this.snappingSource.layerSource.layer;if("refresh"in o){const t=o;this.handles.add(t.on("refresh",(()=>e.refresh())))}this.handles.add([l((()=>e.updating),(t=>e.layerSource.updating=t),p),l((()=>e.availability),(t=>e.layerSource.availability=t),p)])}destroy(){this.snappingSource.destroy(),this.handles.destroy()}}function V(e,t,r,o,n,s,{coordinateHelper:a}){const i=y(O,t);i[0]+=r,i[1]+=o,i[2]+=n;const c=L(i,a.spatialReference,f,s);return F(c,e)}const E=S(),G=S(),O=S();export{M as FeatureSnappingEngine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import s from"../../core/Evented.js";import{HandleOwnerMixin as n}from"../../core/HandleOwner.js";import i from"../../core/Logger.js";import{destroyMaybe as o,isSome as a,isNone as r,unwrap as l}from"../../core/maybe.js";import{EsriPromiseMixin as u}from"../../core/Promise.js";import{watch as p}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import f from"../../form/FormTemplate.js";import h from"../../layers/support/ContingentValue.js";import{isEditableLayer as g}from"../../layers/support/editableLayers.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{createFormExpressionArcadeExecutor as y}from"./FormExpressionArcadeExecutor.js";import{FormExpressionsManager as _}from"./FormExpressionsManager.js";import F from"./InputField.js";import v from"./InputFieldGroup.js";import{onLocaleChange as C}from"../../intl/locale.js";import{fetchMessageBundle as E}from"../../intl/messages.js";const x=new t({attributes:{}}),I=["editableExpression","requiredExpression","valueExpression","visibilityExpression"],V=["visibilityExpression"],b="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",j="#JSAPI_CONTINGENT_VALUE_ANY_HASH",w="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let A=class extends(n(u(s.EventedAccessor))){constructor(e){super(e),this._expressionExecutorLookup=new Map,this._expressionLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=x.clone(),this._initialFeature=x.clone(),this.arcadeEditType="NA",this.contingencyConstraintViolations=new Map,this.inputFields=[],this.messages=null,this.strict=!1}initialize(){const e=async()=>{const e=await E("esri/widgets/FeatureForm/t9n/FeatureForm");this.messages=e;for(const t of this.allInputFields)t.messages=e};e();const t=p((()=>[this.layer,this.layer?.loaded,this.formTemplate]),(()=>{a(this.layer)&&this.layer.loaded&&this._updateInputFields()}),{equals:([e,t,s],[n,i,o])=>e===n&&t===i&&s===o,initial:!0}),s=p((()=>this.layer),(e=>{"feature"===e?.type&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(e).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0});this.handles.add([C(e),t,s])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache)}get _arcadeContextInfo(){const{_initialFeature:e,arcadeEditType:t,layer:s,spatialReference:n,view:i}=this;return{layer:g(s)?s:null,originalFeature:e,editType:t,spatialReference:n,map:i?.map}}get updating(){return this.updatingHandles.updating}get allInputFields(){return S(this.inputFields)}get _layerFieldsByName(){return new Map(this.layer.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():x.clone(),this._initialFeature=this._featureClone.clone(),this._resetInputFieldValues(this._featureClone),this.contingencyConstraintViolations.clear(),a(this._expressionsManager)&&(this._expressionsManager.resetExecutors(),this._expressionsManager.feature=this._featureClone,this.updatingHandles.addPromise(this._expressionsManager.evaluateAll().then((()=>this._afterExpressionsEvaluated())))),this._set("feature",e)}get fieldsWithContingentValues(){if(r(this._contingentValuesCache))return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){this._override("formTemplate",e)}get joinedContingentValues(){return this._joinContingentValues()}get layer(){return this.feature?.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){this._override("layer",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.messages&&this.get("layer.loaded")?"ready":"disabled"}get submittable(){return!!this.valid||this.allInputFields.filter((e=>!e.valid)).every((({submittable:e})=>e))}get valid(){const e=this.allInputFields;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allInputFields.find((t=>t.name===e))}getValue(e){const{_featureClone:t,layer:s}=this,n=!!s?.getField(e);return t.getAttribute(e)??(n?null:void 0)}setValue(e,t){const{_featureClone:s,strict:n}=this,i=this.findField(e);t=""===t?null:t,i&&s.getAttribute(e)!==t&&(i.value=t,n&&!i.valid||(this._afterValueChange(i),a(this._expressionsManager)&&this.updatingHandles.addPromise(this._expressionsManager.evaluateInvalidated([i.name]).then((()=>this._afterExpressionsEvaluated())))))}getValues(){return{...this._featureClone.attributes}}submit(){const e=this.allInputFields,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),s=e.filter((e=>!e.valid)).map((({name:e})=>e)),n=this.getValues();if(this.validateContingencyConstraints(n,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),s.push(i));this.emit("submit",{valid:[...t],invalid:s,values:n})}validateContingencyConstraints(e,t){const{_contingentValuesCache:s}=this,n=new Map;if(this.contingencyConstraintViolations=n,r(s))return[];const{invalid:i,incomplete:o}=s.validateContingencyConstraints(e),a=[...i,...t?.includeIncompleteViolations?o:[]];for(const r of a)for(const e of r.fieldGroup.fields)n.set(e,r);return a}notifyFeatureGeometryChanged(){const{_expressionsManager:e,feature:t,_featureClone:s}=this;s.geometry=t.geometry,a(e)&&this.updatingHandles.addPromise(e.evaluateInvalidatedByGeometry().finally((()=>this._afterExpressionsEvaluated())))}_emitChangeEvent({name:e,valid:t,value:s}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:s,valid:t})}_updateInputFields(){const{_featureClone:e,_initialFeature:t,formTemplate:s,inputFields:n,messages:i,layer:o}=this,r={feature:e,initialFeature:t,layer:o,messages:i},l=n.slice(),u=a(s)&&s.elements.length>0?this._updateInputFieldsFromElements(l,s.elements,r):this._updateInputFieldsFromLayerFields(l,o?.fields,r);this.inputFields=u}_updateInputFieldsFromElements(e,t,s){const n=new Map;for(const a of e)if(M(a)){L(n,a.groupElement,a);for(const e of a.inputFields)L(n,e.fieldElement,e)}else L(n,a.fieldElement,a);const i=new Map,o=this._updateInputFieldsRecursive({existingInputFieldsByElement:n,updatedElements:t.filter(this._isSupportedElement),sharedInitializationProperties:s,group:null,newExpressionExecutorPromises:i});this.updatingHandles.addPromise(Promise.all(Array.from(i.values())).then((()=>{const e=Array.from(this._expressionExecutorLookup.values()),t=S(o);return this._createExpressionsManager(e,t),l(this._expressionsManager).evaluateAll().then((()=>this._afterExpressionsEvaluated()))})));for(const[a,r]of n.entries())n.delete(a),r.destroy();return o}_updateInputFieldsRecursive(e){const{existingInputFieldsByElement:t,updatedElements:s,sharedInitializationProperties:n,group:i,newExpressionExecutorPromises:o}=e,a=[];for(const r of s){const e=t.has(r),s=e?t.get(r):T(r)?this._makeInputFieldGroupFromGroupElement(r,n):this._makeInputFieldFromFieldElement(r,n,i);if(a.push(s),e)if(t.delete(r),M(s)){const{feature:e}=n;s.set({feature:e})}else s.set(n);else this._assignExpressionExecutors(s,r,o);if(T(r)){const e=r.elements.filter((e=>this._isSupportedElement(e)));s.inputFields=this._updateInputFieldsRecursive({existingInputFieldsByElement:t,updatedElements:e,sharedInitializationProperties:n,group:s,newExpressionExecutorPromises:o})}}return a}_updateInputFieldsFromLayerFields(e,t,s){if(!Array.isArray(t))return i.getLogger(this.declaredClass).warn(this.declaredClass,"No attribute fields found."),[];const n=new Map;for(const i of e)if(M(i)){for(const e of i.inputFields)e.destroy();i.inputFields.length=0,i.destroy()}else a(i.fieldElement)?i.destroy():n.set(i.field,i);const o=[],{feature:r,initialFeature:l,layer:u,messages:p}=s;for(const i of t){const e=n.get(i)??new F({field:i,feature:r,initialFeature:l,layer:u,messages:p,value:r.getAttribute(i.name)??null});o.push(e),n.delete(i)}for(const[i,a]of n.entries())n.delete(i),a.destroy();return o}_resetInputFieldValues(e){for(const t of this.allInputFields)t.value=e.getAttribute(t.name)}_makeInputFieldFromFieldElement(e,t,s=null){const{feature:n,initialFeature:i,layer:o,messages:a}=t;return new F({fieldElement:e,field:this._layerFieldsByName.get(e.fieldName),value:n.getAttribute(e.fieldName)??null,feature:n,initialFeature:i,layer:o,group:s,messages:a})}_makeInputFieldGroupFromGroupElement(e,t){const{feature:s,initialFeature:n}=t;return new v({groupElement:e,inputFields:[],feature:s,initialFeature:n})}_assignExpressionExecutors(e,t,s){const n=T(t)?V:I,i=[];for(const o of n){const n=t[o],{_expressionExecutorLookup:i}=this;if(a(n)&&""!==n){const t=`${o}Executor`,a=this._expressionLookup.get(n)??this._addToExpressionLookup(n);if(i.has(a))e[t]=i.get(a);else if(s.has(a)){const n=s.get(a).then((s=>(e[t]=s,s)));s.set(a,n)}else{const n=y(a,this.layer).then((s=>(e[t]=s,i.set(a,s),s)));s.set(a,n)}}}return i}_createExpressionsManager(e,t){const{_arcadeContextInfo:s,_featureClone:n}=this;this._expressionsManager=new _({executors:e,feature:n,arcadeContextInfo:s,inputFields:t})}_afterValueChange(e){const{name:t,value:s}=e;if(this.get("layer.typeIdField")===t&&"types"in this.layer){const e=new Set;this.layer.types.forEach((t=>Object.keys(t.domains).forEach((t=>e.add(t))))),e.forEach((e=>{const t=this.findField(e);t&&t.notifyChange("domain")}))}this._featureClone.setAttribute(t,s),this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allInputFields)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_addToExpressionLookup(e){const{_expressionLookup:t,formTemplate:s}=this,n=(a(s)&&a(s.expressionInfos)?Object.values(s.expressionInfos).find((t=>t.name===e)):null)?.expression??e;return t.set(e,n),e!==n&&t.set(n,n),n}_isSupportedElement(e){return"field"===e.type||"group"===e.type||(i.getLogger(this.declaredClass).warn("form-info::unsupported-element-type","Only element types 'field' and 'group' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}_joinContingentValues(){const e=this._contingentValuesCache;if(r(e))return[];const t="typeIdField"in this.layer?this.layer.typeIdField:null,s=t?this.getValue(t):null,n=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:i}=r,o=[];for(const n of e)n.isRetired||a(n.subtype)&&n.subtype.code!==s||o.push({values:n.values});o.length>0&&n.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(n);return[...i.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,s=[],n=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,a=[i.name,o.name].sort().join("|");if(n.has(a))continue;s.push([i,o]),n.add(a),t.set(e,o)}else t.set(e,l);const i=new Set(s.flat()),o=new Set(e);for(const l of i)o.delete(l);const a=new Map,r=new Map;for(const l of new Set(s.flat())){const e=Symbol(l.name);a.set(e,new Set([l])),r.set(l,e)}for(const[l,u]of s){const e=r.get(l),t=r.get(u);if(e===t)continue;const s=a.get(e),n=a.get(t);for(const i of n)s.add(i),r.set(i,e);a.delete(t)}return[[...a.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),s=t.shift();let n=t.shift(),i=this._generateJoinKey(s.fields,n.fields),o=new Set([...s.fields,...n.fields]),l=new Map;for(const a of s.contingencies){const[e]=this._hashContingency(a,i.codedValueFields,!0);l.has(e)?l.get(e).push(a):l.set(e,[a])}for(;t.length>0;){const e=new Map,s=t.shift(),a=this._generateJoinKey(o,s.fields);for(const t of n.contingencies){const[s,n]=this._hashContingency(t,i.codedValueFields),o=n?this._findMatchingContingenciesWithAnyHashMask(l,s):l.get(s);if(l.has(j)&&o.push(...this._findMatchingContingenciesContainingAny(t,l.get(j),i.codedValueFields)),!r(o))for(const l of o){const s=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(l,t,i.rangeFields):this._joinContingencies(l,t);if(r(s))break;const[n]=this._hashContingency(s,a.codedValueFields,!0);e.has(n)?e.get(n).push(s):e.set(n,[s])}}l=e,n=s,i=a,o=new Set([...o,...n.fields])}const u=[];for(const p of n.contingencies){const[e,t]=this._hashContingency(p,i.codedValueFields),s=t?this._findMatchingContingenciesWithAnyHashMask(l,e):l.get(e);if(l.has(j)&&s.push(...this._findMatchingContingenciesContainingAny(p,l.get(j),i.codedValueFields)),!r(s))for(const n of s){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(n,p,i.rangeFields):this._joinContingencies(n,p);a(e)&&u.push(e)}}return u}_joinContingencies(e,t){const s={values:{...e.values,...t.values}};for(const[n,i]of Object.entries(s.values))"any"===i.objectType&&a(e.values[n])&&(s.values[n]=e.values[n]);return s}_joinContingenciesWithRangeDomains(e,t,s){const n=this._joinContingencies(e,t);for(const i of s){const s=e.values[i],o=t.values[i],{leftIsNull:a,rightIsNull:r,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:d,leftIsRange:c,rightIsRange:f}=this._compareObjectTypes(s.objectType,o.objectType);if(l||d)continue;if(a&&p||r&&u){n.values[i]=new h({objectType:"null"});continue}if(a&&f||r&&c)return null;u?(s.minValue=-1/0,s.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const g=Math.max(s.minValue,o.minValue),m=Math.min(s.maxValue,o.maxValue);if(g>m)return null;n.values[i]=new h({objectType:"range",minValue:g,maxValue:m})}return n}_findMatchingContingenciesContainingAny(e,t,s){return t.filter((t=>s.every((s=>{const n=t.values[s],i=e.values[s];return"any"===n.objectType||"any"===i.objectType||n.codedValue?.code===i.codedValue?.code}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const s=RegExp(`${t}$`),n=[];for(const[i,o]of e){if(i===j)break;s.test(i)&&n.push(...o)}return n}_generateJoinKey(e,t){const s=Array.isArray(e)?new Set(e):e,n=Array.isArray(t)?new Set(t):t,i=s.size<n.size?s:n,o=i===s?n:s,a=new Set,l=new Set;for(const u of i)if(o.has(u)){const e=this.layer.getFieldDomain(u,{feature:this.feature});if(r(e))continue;switch(e.type){case"coded-value":a.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...a],rangeFields:[...l]}}_hashContingency(e,t,s=!1){if(t.length<1)return[b,!1];const n=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(s)return[j,!0];i=!0,n.push(`${o}:.*`)}else"null"===t.objectType?n.push(`${o}:${w}`):n.push(`${o}:${t.codedValue?.code}`)}return[n.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};e([d()],A.prototype,"_arcadeContextInfo",null),e([d()],A.prototype,"updating",null),e([d({readOnly:!0})],A.prototype,"allInputFields",null),e([d()],A.prototype,"_layerFieldsByName",null),e([d()],A.prototype,"arcadeEditType",void 0),e([d()],A.prototype,"contingencyConstraintViolations",void 0),e([d()],A.prototype,"feature",null),e([d()],A.prototype,"fieldsWithContingentValues",null),e([d({type:f})],A.prototype,"formTemplate",null),e([d()],A.prototype,"inputFields",void 0),e([d()],A.prototype,"joinedContingentValues",null),e([d()],A.prototype,"layer",null),e([d()],A.prototype,"messages",void 0),e([d()],A.prototype,"spatialReference",null),e([d()],A.prototype,"state",null),e([d()],A.prototype,"strict",void 0),e([d()],A.prototype,"submittable",null),e([d()],A.prototype,"valid",null),e([d()],A.prototype,"view",void 0),e([d()],A.prototype,"getValues",null),e([d()],A.prototype,"submit",null),A=e([c("esri.widgets.FeatureForm.FeatureFormViewModel")],A);const M=e=>!!e.inputFields,T=e=>"group"===e.type,S=e=>e.reduce(((e,t)=>M(t)?[...e,...t.inputFields]:[...e,t]),[]),L=(e,t,s)=>{a(t)&&e.set(t,s)},N=A;export{N as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import s from"../../core/Evented.js";import{HandleOwnerMixin as n}from"../../core/HandleOwner.js";import i from"../../core/Logger.js";import{destroyMaybe as o,isSome as a,isNone as r,unwrap as l}from"../../core/maybe.js";import{EsriPromiseMixin as u}from"../../core/Promise.js";import{watch as p}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import f from"../../form/FormTemplate.js";import h from"../../layers/support/ContingentValue.js";import{isEditableLayer as g}from"../../layers/support/editableLayers.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{createFormExpressionArcadeExecutor as y}from"./FormExpressionArcadeExecutor.js";import{FormExpressionsManager as _}from"./FormExpressionsManager.js";import F from"./InputField.js";import v from"./InputFieldGroup.js";import{onLocaleChange as C}from"../../intl/locale.js";import{fetchMessageBundle as E}from"../../intl/messages.js";const x=new t({attributes:{}}),I=["editableExpression","requiredExpression","valueExpression","visibilityExpression"],V=["visibilityExpression"],b="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",j="#JSAPI_CONTINGENT_VALUE_ANY_HASH",w="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let A=class extends(n(u(s.EventedAccessor))){constructor(e){super(e),this._expressionExecutorLookup=new Map,this._expressionLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=x.clone(),this._initialFeature=x.clone(),this.arcadeEditType="NA",this.contingencyConstraintViolations=new Map,this.inputFields=[],this.messages=null,this.strict=!1}initialize(){const e=async()=>{const e=await E("esri/widgets/FeatureForm/t9n/FeatureForm");this.messages=e;for(const t of this.allInputFields)t.messages=e};e();const t=p((()=>[this.layer,this.layer?.loaded,this.formTemplate]),(()=>{a(this.layer)&&this.layer.loaded&&this._updateInputFields()}),{equals:([e,t,s],[n,i,o])=>e===n&&t===i&&s===o,initial:!0}),s=p((()=>this.layer),(e=>{"feature"===e?.type&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(e).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0});this.handles.add([C(e),t,s])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache)}get _arcadeContextInfo(){const{_initialFeature:e,arcadeEditType:t,layer:s,spatialReference:n,view:i}=this;return{layer:g(s)?s:null,originalFeature:e,editType:t,spatialReference:n,map:i?.map}}get updating(){return this.updatingHandles.updating}get allInputFields(){return S(this.inputFields)}get _layerFieldsByName(){return new Map(this.layer.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():x.clone(),this._initialFeature=this._featureClone.clone(),this._resetInputFieldValues(this._featureClone),this.contingencyConstraintViolations.clear(),a(this._expressionsManager)&&(this._expressionsManager.resetExecutors(),this._expressionsManager.feature=this._featureClone,this.updatingHandles.addPromise(this._expressionsManager.evaluateAll().finally((()=>this._afterExpressionsEvaluated())))),this._set("feature",e)}get fieldsWithContingentValues(){if(r(this._contingentValuesCache))return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){this._override("formTemplate",e)}get joinedContingentValues(){return this._joinContingentValues()}get layer(){return this.feature?.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){this._override("layer",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.messages&&this.get("layer.loaded")?"ready":"disabled"}get submittable(){return!!this.valid||this.allInputFields.filter((e=>!e.valid)).every((({submittable:e})=>e))}get valid(){const e=this.allInputFields;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allInputFields.find((t=>t.name===e))}getValue(e){const{_featureClone:t,layer:s}=this,n=!!s?.getField(e);return t.getAttribute(e)??(n?null:void 0)}setValue(e,t){const{_featureClone:s,strict:n}=this,i=this.findField(e);t=""===t?null:t,i&&s.getAttribute(e)!==t&&(i.value=t,n&&!i.valid||(this._afterValueChange(i),a(this._expressionsManager)&&this.updatingHandles.addPromise(this._expressionsManager.evaluateInvalidated([i.name]).finally((()=>this._afterExpressionsEvaluated())))))}getValues(){return{...this._featureClone.attributes}}submit(){const e=this.allInputFields,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),s=e.filter((e=>!e.valid)).map((({name:e})=>e)),n=this.getValues();if(this.validateContingencyConstraints(n,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),s.push(i));this.emit("submit",{valid:[...t],invalid:s,values:n})}validateContingencyConstraints(e,t){const{_contingentValuesCache:s}=this,n=new Map;if(this.contingencyConstraintViolations=n,r(s))return[];const{invalid:i,incomplete:o}=s.validateContingencyConstraints(e),a=[...i,...t?.includeIncompleteViolations?o:[]];for(const r of a)for(const e of r.fieldGroup.fields)n.set(e,r);return a}notifyFeatureGeometryChanged(){const{_expressionsManager:e,feature:t,_featureClone:s}=this;s.geometry=t.geometry,a(e)&&this.updatingHandles.addPromise(e.evaluateInvalidatedByGeometry().finally((()=>this._afterExpressionsEvaluated())))}_emitChangeEvent({name:e,valid:t,value:s}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:s,valid:t})}_updateInputFields(){const{_featureClone:e,_initialFeature:t,formTemplate:s,inputFields:n,messages:i,layer:o}=this,r={feature:e,initialFeature:t,layer:o,messages:i},l=n.slice(),u=a(s)&&s.elements.length>0?this._updateInputFieldsFromElements(l,s.elements,r):this._updateInputFieldsFromLayerFields(l,o?.fields,r);this.inputFields=u}_updateInputFieldsFromElements(e,t,s){const n=new Map;for(const a of e)if(M(a)){L(n,a.groupElement,a);for(const e of a.inputFields)L(n,e.fieldElement,e)}else L(n,a.fieldElement,a);const i=new Map,o=this._updateInputFieldsRecursive({existingInputFieldsByElement:n,updatedElements:t.filter(this._isSupportedElement),sharedInitializationProperties:s,group:null,newExpressionExecutorPromises:i});this.updatingHandles.addPromise(Promise.all(Array.from(i.values())).then((()=>{const e=Array.from(this._expressionExecutorLookup.values()),t=S(o);return this._createExpressionsManager(e,t),l(this._expressionsManager).evaluateAll().finally((()=>this._afterExpressionsEvaluated()))})));for(const[a,r]of n.entries())n.delete(a),r.destroy();return o}_updateInputFieldsRecursive(e){const{existingInputFieldsByElement:t,updatedElements:s,sharedInitializationProperties:n,group:i,newExpressionExecutorPromises:o}=e,a=[];for(const r of s){const e=t.has(r),s=e?t.get(r):T(r)?this._makeInputFieldGroupFromGroupElement(r,n):this._makeInputFieldFromFieldElement(r,n,i);if(a.push(s),e)if(t.delete(r),M(s)){const{feature:e}=n;s.set({feature:e})}else s.set(n);else this._assignExpressionExecutors(s,r,o);if(T(r)){const e=r.elements.filter((e=>this._isSupportedElement(e)));s.inputFields=this._updateInputFieldsRecursive({existingInputFieldsByElement:t,updatedElements:e,sharedInitializationProperties:n,group:s,newExpressionExecutorPromises:o})}}return a}_updateInputFieldsFromLayerFields(e,t,s){if(!Array.isArray(t))return i.getLogger(this.declaredClass).warn(this.declaredClass,"No attribute fields found."),[];const n=new Map;for(const i of e)if(M(i)){for(const e of i.inputFields)e.destroy();i.inputFields.length=0,i.destroy()}else a(i.fieldElement)?i.destroy():n.set(i.field,i);const o=[],{feature:r,initialFeature:l,layer:u,messages:p}=s;for(const i of t){const e=n.get(i)??new F({field:i,feature:r,initialFeature:l,layer:u,messages:p,value:r.getAttribute(i.name)??null});o.push(e),n.delete(i)}for(const[i,a]of n.entries())n.delete(i),a.destroy();return o}_resetInputFieldValues(e){for(const t of this.allInputFields)t.value=e.getAttribute(t.name)}_makeInputFieldFromFieldElement(e,t,s=null){const{feature:n,initialFeature:i,layer:o,messages:a}=t;return new F({fieldElement:e,field:this._layerFieldsByName.get(e.fieldName),value:n.getAttribute(e.fieldName)??null,feature:n,initialFeature:i,layer:o,group:s,messages:a})}_makeInputFieldGroupFromGroupElement(e,t){const{feature:s,initialFeature:n}=t;return new v({groupElement:e,inputFields:[],feature:s,initialFeature:n})}_assignExpressionExecutors(e,t,s){const n=T(t)?V:I,i=[];for(const o of n){const n=t[o],{_expressionExecutorLookup:i}=this;if(a(n)&&""!==n){const t=`${o}Executor`,a=this._expressionLookup.get(n)??this._addToExpressionLookup(n);if(i.has(a))e[t]=i.get(a);else if(s.has(a)){const n=s.get(a).then((s=>(e[t]=s,s)));s.set(a,n)}else{const n=y(a,this.layer).then((s=>(e[t]=s,i.set(a,s),s)));s.set(a,n)}}}return i}_createExpressionsManager(e,t){const{_arcadeContextInfo:s,_featureClone:n}=this;this._expressionsManager=new _({executors:e,feature:n,arcadeContextInfo:s,inputFields:t})}_afterValueChange(e){const{name:t,value:s}=e;if(this.get("layer.typeIdField")===t&&"types"in this.layer){const e=new Set;this.layer.types.forEach((t=>Object.keys(t.domains).forEach((t=>e.add(t))))),e.forEach((e=>{const t=this.findField(e);t&&t.notifyChange("domain")}))}this._featureClone.setAttribute(t,s),this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allInputFields)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_addToExpressionLookup(e){const{_expressionLookup:t,formTemplate:s}=this,n=(a(s)&&a(s.expressionInfos)?Object.values(s.expressionInfos).find((t=>t.name===e)):null)?.expression??e;return t.set(e,n),e!==n&&t.set(n,n),n}_isSupportedElement(e){return"field"===e.type||"group"===e.type||(i.getLogger(this.declaredClass).warn("form-info::unsupported-element-type","Only element types 'field' and 'group' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}_joinContingentValues(){const e=this._contingentValuesCache;if(r(e))return[];const t="typeIdField"in this.layer?this.layer.typeIdField:null,s=t?this.getValue(t):null,n=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:i}=r,o=[];for(const n of e)n.isRetired||a(n.subtype)&&n.subtype.code!==s||o.push({values:n.values});o.length>0&&n.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(n);return[...i.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,s=[],n=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,a=[i.name,o.name].sort().join("|");if(n.has(a))continue;s.push([i,o]),n.add(a),t.set(e,o)}else t.set(e,l);const i=new Set(s.flat()),o=new Set(e);for(const l of i)o.delete(l);const a=new Map,r=new Map;for(const l of new Set(s.flat())){const e=Symbol(l.name);a.set(e,new Set([l])),r.set(l,e)}for(const[l,u]of s){const e=r.get(l),t=r.get(u);if(e===t)continue;const s=a.get(e),n=a.get(t);for(const i of n)s.add(i),r.set(i,e);a.delete(t)}return[[...a.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),s=t.shift();let n=t.shift(),i=this._generateJoinKey(s.fields,n.fields),o=new Set([...s.fields,...n.fields]),l=new Map;for(const a of s.contingencies){const[e]=this._hashContingency(a,i.codedValueFields,!0);l.has(e)?l.get(e).push(a):l.set(e,[a])}for(;t.length>0;){const e=new Map,s=t.shift(),a=this._generateJoinKey(o,s.fields);for(const t of n.contingencies){const[s,n]=this._hashContingency(t,i.codedValueFields),o=n?this._findMatchingContingenciesWithAnyHashMask(l,s):l.get(s);if(l.has(j)&&o.push(...this._findMatchingContingenciesContainingAny(t,l.get(j),i.codedValueFields)),!r(o))for(const l of o){const s=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(l,t,i.rangeFields):this._joinContingencies(l,t);if(r(s))break;const[n]=this._hashContingency(s,a.codedValueFields,!0);e.has(n)?e.get(n).push(s):e.set(n,[s])}}l=e,n=s,i=a,o=new Set([...o,...n.fields])}const u=[];for(const p of n.contingencies){const[e,t]=this._hashContingency(p,i.codedValueFields),s=t?this._findMatchingContingenciesWithAnyHashMask(l,e):l.get(e);if(l.has(j)&&s.push(...this._findMatchingContingenciesContainingAny(p,l.get(j),i.codedValueFields)),!r(s))for(const n of s){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(n,p,i.rangeFields):this._joinContingencies(n,p);a(e)&&u.push(e)}}return u}_joinContingencies(e,t){const s={values:{...e.values,...t.values}};for(const[n,i]of Object.entries(s.values))"any"===i.objectType&&a(e.values[n])&&(s.values[n]=e.values[n]);return s}_joinContingenciesWithRangeDomains(e,t,s){const n=this._joinContingencies(e,t);for(const i of s){const s=e.values[i],o=t.values[i],{leftIsNull:a,rightIsNull:r,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:d,leftIsRange:c,rightIsRange:f}=this._compareObjectTypes(s.objectType,o.objectType);if(l||d)continue;if(a&&p||r&&u){n.values[i]=new h({objectType:"null"});continue}if(a&&f||r&&c)return null;u?(s.minValue=-1/0,s.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const g=Math.max(s.minValue,o.minValue),m=Math.min(s.maxValue,o.maxValue);if(g>m)return null;n.values[i]=new h({objectType:"range",minValue:g,maxValue:m})}return n}_findMatchingContingenciesContainingAny(e,t,s){return t.filter((t=>s.every((s=>{const n=t.values[s],i=e.values[s];return"any"===n.objectType||"any"===i.objectType||n.codedValue?.code===i.codedValue?.code}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const s=RegExp(`${t}$`),n=[];for(const[i,o]of e){if(i===j)break;s.test(i)&&n.push(...o)}return n}_generateJoinKey(e,t){const s=Array.isArray(e)?new Set(e):e,n=Array.isArray(t)?new Set(t):t,i=s.size<n.size?s:n,o=i===s?n:s,a=new Set,l=new Set;for(const u of i)if(o.has(u)){const e=this.layer.getFieldDomain(u,{feature:this.feature});if(r(e))continue;switch(e.type){case"coded-value":a.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...a],rangeFields:[...l]}}_hashContingency(e,t,s=!1){if(t.length<1)return[b,!1];const n=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(s)return[j,!0];i=!0,n.push(`${o}:.*`)}else"null"===t.objectType?n.push(`${o}:${w}`):n.push(`${o}:${t.codedValue?.code}`)}return[n.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};e([d()],A.prototype,"_arcadeContextInfo",null),e([d()],A.prototype,"updating",null),e([d({readOnly:!0})],A.prototype,"allInputFields",null),e([d()],A.prototype,"_layerFieldsByName",null),e([d()],A.prototype,"arcadeEditType",void 0),e([d()],A.prototype,"contingencyConstraintViolations",void 0),e([d()],A.prototype,"feature",null),e([d()],A.prototype,"fieldsWithContingentValues",null),e([d({type:f})],A.prototype,"formTemplate",null),e([d()],A.prototype,"inputFields",void 0),e([d()],A.prototype,"joinedContingentValues",null),e([d()],A.prototype,"layer",null),e([d()],A.prototype,"messages",void 0),e([d()],A.prototype,"spatialReference",null),e([d()],A.prototype,"state",null),e([d()],A.prototype,"strict",void 0),e([d()],A.prototype,"submittable",null),e([d()],A.prototype,"valid",null),e([d()],A.prototype,"view",void 0),e([d()],A.prototype,"getValues",null),e([d()],A.prototype,"submit",null),A=e([c("esri.widgets.FeatureForm.FeatureFormViewModel")],A);const M=e=>!!e.inputFields,T=e=>"group"===e.type,S=e=>e.reduce(((e,t)=>M(t)?[...e,...t.inputFields]:[...e,t]),[]),L=(e,t,s)=>{a(t)&&e.set(t,s)},N=A;export{N as default};
package/widgets/Popup.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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{eventKey as i}from"../core/events.js";import o from"../core/Handles.js";import n from"../core/Logger.js";import{isNone as s}from"../core/maybe.js";import{watch as r,when as a,on as l,whenOnce as c,initial as u}from"../core/reactiveUtils.js";import{throttle as d}from"../core/throttle.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as h}from"../core/accessorSupport/decorators/cast.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import _ from"./Feature.js";import m from"./Spinner.js";import f from"./Widget.js";import{CSS as v}from"./Feature/resources.js";import{FeatureContentMixin as b}from"./Feature/support/FeatureContentMixin.js";import w from"./Popup/PopupViewModel.js";import{Heading as M}from"./support/Heading.js";import{accessibleHandler as y}from"./support/decorators/accessibleHandler.js";import{messageBundle as k}from"./support/decorators/messageBundle.js";import{vmEvent as C}from"./support/decorators/vmEvent.js";import{tsx as A}from"./support/jsxFactory.js";import{isRTL as F,storeNode as I,cssTransition as x}from"./support/widgetUtils.js";import{isDarkTheme as O}from"../support/themeUtils.js";import{substitute as T}from"../intl/substitute.js";const E="selected-index",N=0,D="popup-spinner",B={calciteThemeLight:"calcite-theme-light",calciteThemeDark:"calcite-theme-dark",iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow",iconDockToTop:"esri-icon-maximize",iconDockToBottom:"esri-icon-dock-bottom",iconDockToLeft:"esri-icon-dock-left",iconDockToRight:"esri-icon-dock-right",iconClose:"esri-icon-close",iconUndock:"esri-icon-minimize",iconCheckMark:"esri-icon-check-mark",iconLoading:"esri-icon-loading-indicator",iconDefaultAction:"esri-icon-default-action",iconActionsMenu:"esri-icon-handle-horizontal",rotating:"esri-rotating",base:"esri-popup",widget:"esri-widget",main:"esri-popup__main-container",loadingContainer:"esri-popup__loading-container",isCollapsible:"esri-popup--is-collapsible",isCollapsed:"esri-popup--is-collapsed",shadow:"esri-popup--shadow",isDocked:"esri-popup--is-docked",isDockedTopLeft:"esri-popup--is-docked-top-left",isDockedTopCenter:"esri-popup--is-docked-top-center",isDockedTopRight:"esri-popup--is-docked-top-right",isDockedBottomLeft:"esri-popup--is-docked-bottom-left",isDockedBottomCenter:"esri-popup--is-docked-bottom-center",isDockedBottomRight:"esri-popup--is-docked-bottom-right",alignTopCenter:"esri-popup--aligned-top-center",alignBottomCenter:"esri-popup--aligned-bottom-center",alignTopLeft:"esri-popup--aligned-top-left",alignBottomLeft:"esri-popup--aligned-bottom-left",alignTopRight:"esri-popup--aligned-top-right",alignBottomRight:"esri-popup--aligned-bottom-right",isFeatureMenuOpen:"esri-popup--feature-menu-open",isActionsMenuOpen:"esri-popup--actions-menu-open",hasFeatureUpdated:"esri-popup--feature-updated",header:"esri-popup__header",headerButtons:"esri-popup__header-buttons",headerContainer:"esri-popup__header-container",headerContainerButton:"esri-popup__header-container--button",headerTitle:"esri-popup__header-title",content:"esri-popup__content",contentHasFlows:"esri-content--has-flows",contentFlowItem:"esri-content__flow-item",footer:"esri-popup__footer",footerHasPagination:"esri-popup__footer--has-pagination",footerHasActions:"esri-popup__footer--has-actions",footerHasActionsMenu:"esri-popup__footer--has-actions-menu",button:"esri-popup__button",buttonDisabled:"esri-popup__button--disabled",buttonDock:"esri-popup__button--dock",icon:"esri-popup__icon",iconDock:"esri-popup__icon--dock-icon",inlineActionsContainer:"esri-popup__inline-actions-container",actionsMenuButton:"esri-popup__actions-menu-button",actions:"esri-popup__actions",action:"esri-popup__action",actionImage:"esri-popup__action-image",actionText:"esri-popup__action-text",actionToggle:"esri-popup__action-toggle",actionToggleOn:"esri-popup__action-toggle--on",actionExit:"esri-popup__action--exit",pointer:"esri-popup__pointer",pointerDirection:"esri-popup__pointer-direction",navigation:"esri-popup__navigation",paginationPrevious:"esri-popup__pagination-previous",paginationNext:"esri-popup__pagination-next",paginationPreviousIconLTR:"esri-popup__pagination-previous-icon",paginationPreviousIconRTL:"esri-popup__pagination-previous-icon--rtl",paginationNextIconLTR:"esri-popup__pagination-next-icon",paginationNextIconRTL:"esri-popup__pagination-next-icon--rtl",featureMenu:"esri-popup__feature-menu",featureMenuList:"esri-popup__feature-menu-list",featureMenuItem:"esri-popup__feature-menu-item",featureMenuViewport:"esri-popup__feature-menu-viewport",featureMenuHeader:"esri-popup__feature-menu-header",featureMenuNote:"esri-popup__feature-menu-note",featureMenuSelected:"esri-popup__feature-menu-item--selected",featureMenuButton:"esri-popup__feature-menu-button",featureMenuTitle:"esri-popup__feature-menu-title",featureMenuObserver:"esri-popup__feature-menu-observer",featureMenuLoader:"esri-popup__feature-menu-loader",collapseButton:"esri-popup__collapse-button",collapseIcon:"esri-popup__collapse-icon"},P={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},L="esri-popup";function R(e,t){return void 0===t?`${L}__${e}`:`${L}__${e}-${t}`}const S={closeButton:!0,featureNavigation:!0};let V=class extends(b(f)){constructor(e,i){super(e,i),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new o,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=d((()=>this._displaySpinner()),N),this._exitRelatedRecordsActions=new WeakMap,this._flowItems=new t,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.featureMenuOpen=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.spinnerEnabled=!0,this.viewModel=new w,this.visibleElements={...S},this._addSelectedFeatureIndexHandle(),this.addHandles([r((()=>this.viewModel?.screenLocation),(()=>this._positionContainer())),r((()=>[this.viewModel?.active,this.dockEnabled]),(()=>this._toggleScreenLocationEnabled())),r((()=>this.viewModel?.screenLocation),((e,t)=>{!!e!=!!t&&this.reposition()})),r((()=>[this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment]),(()=>this.reposition())),r((()=>this.spinnerEnabled),(e=>this._spinnerEnabledChange(e))),r((()=>this.viewModel?.view?.size),((e,t)=>this._updateDockEnabledForViewSize(e,t))),r((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),r((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e,t))),r((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),r((()=>this.selectedFeatureWidget),(()=>this._destroyFlowItemWidgets())),r((()=>[this.selectedFeatureWidget?.viewModel?.title,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setTitleFromFeatureWidget())),r((()=>[this.selectedFeatureWidget?.viewModel?.content,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setContentFromFeatureWidget())),a((()=>!this.collapsed),(()=>{"xsmall"===this.viewModel?.view?.widthBreakpoint&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()})),l((()=>this.viewModel?.allActions),"change",(()=>this._watchActions())),r((()=>this.viewModel?.allActions),(()=>this._watchActions()),u),r((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),l((()=>this._flowItems),"change",(()=>{this.notifyChange("_activeFlowItemWidget"),this.scheduleRender()})),r((()=>[this._activeFlowItemWidget?.viewModel?.state,this._activeFlowItemWidget?.viewModel?.title]),(()=>this.scheduleRender()))])}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-flow.js"),import("@esri/calcite-components/dist/components/calcite-flow-item.js"),import("@esri/calcite-components/dist/components/calcite-action.js"),import("@esri/calcite-components/dist/components/calcite-tooltip.js"),import("@esri/calcite-components/dist/components/calcite-icon.js")])}destroy(){this._destroyFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._handles?.destroy(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._handles=null}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){const{selectedFeatureWidget:e,viewModel:t}=this;if(!e)return!!t?.content;const i=e.viewModel;if(i?.waitingForContent||"error"===i?.state)return!0;const o=i?.content;return Array.isArray(o)?!!o.length:!!o}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}get _activeFlowItemWidget(){const{_flowItems:e}=this;return e.getItemAt(e.length-1)||null}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){this.viewModel.autoOpenEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||P}set dockOptions(e){const t={...P},i=this.get("viewModel.view.breakpoints"),o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:r}=n;!0===r?n.breakpoint=s:"object"==typeof r&&(n.breakpoint={...s,...r}),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,visibleElements:t,headingLevel:i,_flowItems:o}=this,{selectedFeatureViewModel:n}=this.viewModel,s={...t,title:!1};return n?(e?(e.viewModel=n,e.visibleElements=s):this._feature=new _({flowItems:o,headingLevel:i+1,viewModel:n,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}castVisibleElements(e){return{...S,...e}}blur(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(e){this._handles.remove(E);const t=!!e&&!!e.featureMenuOpen,i=!!e&&!!e.actionsMenuOpen,o={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:i,featureMenuOpen:t};"xsmall"===this.viewModel?.view?.widthBreakpoint&&(o.collapsed=!0),this.set(o),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{actionsMenuOpen:e,dockEnabled:t,featureMenuVisible:i,dividedActions:o,currentAlignment:n,currentDockPosition:s}=this,{active:r}=this.viewModel,{menuActions:a}=o,l=r&&a.length>1&&e,c=r&&t,u=r&&!t,d=this.selectedFeature?.layer?.title,p=this.selectedFeature?.layer?.id,h={[B.alignTopCenter]:"top-center"===n,[B.alignBottomCenter]:"bottom-center"===n,[B.alignTopLeft]:"top-left"===n,[B.alignBottomLeft]:"bottom-left"===n,[B.alignTopRight]:"top-right"===n,[B.alignBottomRight]:"bottom-right"===n,[B.isDocked]:c,[B.shadow]:u,[B.isDockedTopLeft]:"top-left"===s,[B.isDockedTopCenter]:"top-center"===s,[B.isDockedTopRight]:"top-right"===s,[B.isDockedBottomLeft]:"bottom-left"===s,[B.isDockedBottomCenter]:"bottom-center"===s,[B.isDockedBottomRight]:"bottom-right"===s,[B.isFeatureMenuOpen]:i,[B.isActionsMenuOpen]:l};return A("div",{class:this.classes(B.base,h),role:"presentation","data-layer-title":d,"data-layer-id":p,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},r?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return A("span",{"aria-hidden":"true",class:this.classes(B.icon,B.iconLoading,B.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?A("div",{key:R("loading-container"),role:"presentation",class:B.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousIcon(){const e=F(this.container),t={[B.iconRightTriangleArrow]:e,[B.paginationPreviousIconRTL]:e,[B.iconLeftTriangleArrow]:!e,[B.paginationPreviousIconLTR]:!e};return A("span",{"aria-hidden":"true",class:this.classes(B.icon,t)})}renderPreviousButton(){const{messages:e}=this;return A("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(B.button,B.paginationPrevious),"aria-label":e.previous,title:e.previous},this.renderPreviousIcon())}renderNextIcon(){const e=F(this.container),t={[B.iconLeftTriangleArrow]:e,[B.paginationNextIconRTL]:e,[B.iconRightTriangleArrow]:!e,[B.paginationNextIconLTR]:!e};return A("span",{"aria-hidden":"true",class:this.classes(B.icon,t)})}renderNextButton(){const{messages:e}=this;return A("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(B.button,B.paginationNext),"aria-label":e.next,title:e.next},this.renderNextIcon())}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:t,messagesCommon:i}=this,{featureCount:o,selectedFeatureIndex:n}=this.viewModel;return A("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:this.classes(B.button,B.featureMenuButton),"aria-haspopup":"true","aria-controls":t,"aria-expanded":e.toString(),"aria-label":i.menu,title:i.menu},this._getPageText(o,n))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton(),this.renderNextButton()]:null}renderDockIcon(){const{dockEnabled:e}=this,t=this._wouldDockTo(),i={[B.iconUndock]:e,[B.iconDock]:!e,[B.iconDockToRight]:!e&&("top-right"===t||"bottom-right"===t),[B.iconDockToLeft]:!e&&("top-left"===t||"bottom-left"===t),[B.iconDockToTop]:!e&&"top-center"===t,[B.iconDockToBottom]:!e&&"bottom-center"===t};return A("span",{"aria-hidden":"true",class:this.classes(i,B.icon)})}renderDockButton(){const{dockEnabled:e,messages:t}=this,i=this.viewModel?.view?.widthBreakpoint,o=e?t.undock:t.dock;return"xsmall"!==i&&this.dockOptions?.buttonEnabled?A("div",{role:"button","aria-label":o,title:o,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(B.button,B.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:t,collapsible:i,contentCollapsed:o,messagesCommon:n}=this,s={[B.headerContainerButton]:i},r=A(M,{level:this.headingLevel,class:B.headerTitle,innerHTML:e}),a=i?A("button",{key:`${e}--collapsible`,id:t,title:o?n.expand:n.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(B.headerContainer,s),"aria-expanded":o?"false":"true",onclick:this._toggleCollapsed,type:"button"},r,A("calcite-icon",{class:B.collapseIcon,key:"collapse-icon",icon:o?"chevron-down":"chevron-up",scale:"m"})):A("div",{key:e,id:t,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(B.headerContainer,s)},r);return e?a:null}renderCloseIcon(){return A("span",{"aria-hidden":"true",class:this.classes(B.icon,B.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:t}=this;return e.closeButton?A("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:B.button,"aria-label":t.close,title:t.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return A("header",{class:B.header},this.renderTitle(),A("div",{class:B.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:t,contentCollapsed:i,_flowItems:o,messagesCommon:n}=this,{content:s}=this.viewModel,r=o.toArray(),a={[B.contentHasFlows]:!!r.length};return t&&!i?A("div",{key:s,enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:this.classes(B.content,a)},A("calcite-flow",{bind:this,onCalciteFlowItemBack:this._handleBackClick},A("calcite-flow-item",{bind:this,"data-node-ref":"_rootFlowItemNode","intl-back":n.back,afterCreate:I,key:"root-flow-item"},this.renderContent()),r.map((e=>this.renderFlowItem(e)))),r.map((e=>this.renderFlowItemTooltip(e)))):null}renderFlowItem(e){const{messages:t,messagesCommon:i}=this,o=O();return A("calcite-flow-item",{class:this.classes({[B.calciteThemeDark]:!o,[B.calciteThemeLight]:o}),heading:e.title,"intl-back":i.back,description:this._getFlowItemDescription(e),key:`flow-item-${e.viewModel.uid}`},A("calcite-action",{class:B.actionExit,icon:"move-up",label:t?.exitRelatedRecords,text:t?.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:t=>this._storeExitRelatedRecordsAction(e,t),onclick:this._destroyFlowItemWidgets}),A("div",{class:this.classes(B.contentFlowItem,{[B.calciteThemeDark]:o,[B.calciteThemeLight]:!o})},e.render()))}renderFlowItemTooltip(e){const{messages:t,_exitRelatedRecordsActions:i}=this,o=O();return A("calcite-tooltip",{class:this.classes({[B.calciteThemeDark]:!o,[B.calciteThemeLight]:o}),key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t?.exitRelatedRecords,referenceElement:i.get(e),placement:"auto"},t?.exitRelatedRecords)}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o,messagesCommon:n}=this,s=i?n.close:n.open,{menuActions:r}=o;return r.length?A("div",{key:R("actions-menu-button"),class:this.classes(B.button,B.actionsMenuButton),role:"button",id:t,"aria-haspopup":"true","aria-controls":i?e:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":s,title:s},A("span",{"aria-hidden":"true",class:B.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o}=this,{menuActions:n}=o;return n.length&&i?A("ul",{id:e,role:"menu","aria-labelledby":t,key:R("actions"),class:B.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},n.toArray().map((e=>this.renderAction({action:e,type:"menu-item"})))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return!!e.length&&e.toArray().map((e=>this.renderAction({action:e,type:"inline"})))}renderInlineActionsContainer(){const{inlineActions:e,menuActions:t}=this.dividedActions,i=!!e.length,o=!!t.length;return i||o?A("div",{key:"inline-actions-container","data-inline-actions":i.toString(),"data-menu-actions":o.toString(),class:B.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?A("section",{key:R("navigation"),class:this.classes(B.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:t}=this,{inlineActions:i,menuActions:o}=t,n=!!i.length,s=!!o.length,r={[B.footerHasPagination]:e,[B.footerHasActions]:n,[B.footerHasActionsMenu]:s};return e||n?A("div",{key:R("feature-buttons"),class:this.classes(B.footer,r)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:t,isLoadingFeature:i}=this.viewModel,o=T(e.selectedFeatures,{total:t.length});return A("section",{key:R("menu"),class:B.featureMenu},A("strong",{class:B.featureMenuHeader},o),A("nav",{bind:this,class:B.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:I},this.renderFeatureMenu(),A("div",{class:B.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),i?A("div",{class:B.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:A("div",{key:R("pointer"),class:B.pointer,role:"presentation"},A("div",{class:this.classes(B.pointerDirection,B.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i,titleId:o,contentId:n,collapsible:s,hasContent:r,contentCollapsed:a,visibleElements:l}=this,{title:c}=this.viewModel,u="bottom-left"===t||"bottom-center"===t||"bottom-right"===t||"top-left"===i||"top-center"===i||"top-right"===i,d="top-left"===t||"top-center"===t||"top-right"===t||"bottom-left"===i||"bottom-center"===i||"bottom-right"===i,p={[B.shadow]:e,[B.isCollapsible]:s,[B.isCollapsed]:a};return A("div",{class:this.classes(B.main,B.widget,p),tabIndex:l.closeButton?null:-1,role:"dialog","aria-labelledby":c?o:"","aria-describedby":r&&!a?n:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},u?this.renderFooter():null,u?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),d?this.renderFooter():null,d?this.renderFeatureMenuContainer():null)}renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?A("div",{class:v.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return A("span",{key:"text",class:B.actionText},e)}renderActionIcon(e){const t=this._getActionClass(e),i=this._getActionImage(e),o={[B.iconLoading]:e.active,[B.rotating]:e.active,[B.icon]:!!t,[B.actionImage]:!e.active&&!!i};return t&&(o[t]=!e.active),A("span",{key:"icon","aria-hidden":"true",class:this.classes(B.icon,o),styles:this._getIconStyles(i)})}renderAction(e){const{action:t,type:i}=e,o=this._getActionTitle(t),n={[B.action]:"toggle"!==t.type,[B.actionToggle]:"toggle"===t.type,[B.actionToggleOn]:"toggle"===t.type&&t.value,[B.buttonDisabled]:t.disabled},s=[this.renderActionIcon(t),this.renderActionText(o)],r="menu-item"===i?A("li",{key:t.uid,role:"menuitem",tabIndex:0,title:o,"aria-label":o,class:this.classes(B.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s):A("div",{key:t.uid,role:"button",tabIndex:0,title:o,"aria-label":o,class:this.classes(B.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s);return t.visible?r:null}renderFeatureMenuItem(e,t){const{messages:i,messagesCommon:o}=this,{selectedFeatureIndex:n,selectedFeatureViewModel:s}=this.viewModel,r=e===s,a={[B.featureMenuSelected]:r},l=r?A("span",{key:R(`feature-menu-selected-feature-${n}`),title:i.selectedFeature,"aria-label":i.selectedFeature,class:B.iconCheckMark}):null,c=A("span",{innerHTML:e.title||o.untitled});return A("li",{role:"menuitem",tabIndex:-1,key:R(`feature-menu-feature-${n}`),class:this.classes(a,B.featureMenuItem),bind:this,"data-feature-index":t,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},A("span",{class:B.featureMenuTitle},c,l))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:t}=this.viewModel;return t.length>1?A("ol",{class:B.featureMenuList,id:e,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},t.filter((e=>!!e.graphic)).map(((e,t)=>this.renderFeatureMenuItem(e,t)))):null}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description}_destroyFlowItemWidgets(){this._flowItems.removeAll().forEach((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_handleBackClick(){const e=this._flowItems.pop();this._exitRelatedRecordsActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy())}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,r="zoom-to-feature"===n?T(e.title,{messages:t}):"remove-selected-feature"===n?T(e.title,{messages:o}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?T(e.title,{messages:t}):e.title;return r&&s?T(r,s):r}_getActionClass(e){const{selectedFeature:t}=this,i=t?.attributes,{className:o,image:n}=e,s=n||o?o:B.iconDefaultAction;return s&&i?T(s,i):s}_getActionImage(e){const{selectedFeature:t}=this,i=t?.attributes,{image:o}=e;return o&&i?T(o,i):o}_createFeatureUpdatedAnimation(){return x("enter",B.hasFeatureUpdated)}_getInlineActionCount(){const{maxInlineActions:e,featureNavigationVisible:t}=this;if("number"!=typeof e)return null;const i=Math.round(e);return Math.max(t?i-1:i,0)}_watchActions(){const{allActions:e}=this.viewModel;this.notifyChange("dividedActions");const t="actions";this._handles.remove(t),e&&e.forEach((e=>{this._handles.add(r((()=>[e.uid,e.active,e.className,e.disabled,e.id,e.title,e.image,e.visible]),(()=>this.scheduleRender())),t)}))}_divideActions(){const{allActions:e}=this.viewModel,i=e.filter((e=>e.visible)),o=this._getInlineActionCount(),n=null===o,s=0===o;return{inlineActions:n?i.slice(0):s?new t:i.slice(0,o),menuActions:n?new t:s?i.slice(0):i.slice(o)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this;e&&(this.viewModel.title="error"===e.viewModel?.state?t.errorMessage:e.viewModel?.title||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_handleFeatureMenuKeyup(e){"Escape"===i(e)&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){"Escape"===i(e)&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const t=i(e),{_featureMenuNode:o}=this,n=e.currentTarget["data-feature-index"];if(!o)return;const s=o.querySelectorAll("li"),r=s.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();s[s.length-1].focus()}else{e.stopPropagation();s[0].focus()}else{e.stopPropagation();s[(n+1+r)%r].focus()}else{e.stopPropagation();s[(n-1+r)%r].focus()}}_handleActionMenuItemKeyup(e){const t=i(e),{_actionsMenuNode:o}=this,n=e.currentTarget.dataset.actionUid,{menuActions:s}=this.dividedActions,r=s.findIndex((e=>e.uid===n));if(!o)return;const a=o.querySelectorAll("li"),l=a.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();a[a.length-1].focus()}else{e.stopPropagation();a[0].focus()}else{e.stopPropagation();a[(r+1+l)%l].focus()}else{e.stopPropagation();a[(r-1+l)%l].focus()}}_handleMainKeyup(e){const t=i(e);"ArrowLeft"===t&&(e.stopPropagation(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.next())}_spinnerEnabledChange(e){if(this._destroySpinner(),!e)return;const t=this.get("viewModel.view");this._createSpinner(t)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i?e.show({location:t}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e.shouldFocus&&(await c((()=>!0===this.viewModel?.active)),this.focus())}_addSelectedFeatureIndexHandle(){const e=r((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this._handles.add(e,E)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this;i&&e!==t&&-1!==e&&(this._destroyFlowItemWidgets(),this.actionsMenuOpen=!1,this.featureMenuOpen=!1,this._mainContainerNode&&(this._mainContainerNode.scrollTop=0),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,e&&!e.destroyed&&e.destroy()),this._feature=null}_isScreenLocationWithinView(e,t){return e.x>-1&&e.y>-1&&e.x<=t.width&&e.y<=t.height}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const r=s.padding;return"right"===n&&o.x+i/2>s.width-r.right||("left"===n&&o.x-i/2<r.left||("top"===n&&o.y-t<r.top||"bottom"===n&&o.y+t>s.height-r.bottom))}_calculateAutoAlignment(e){if("auto"!==e)return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:r,view:a}=n;if(s(r)||!a||!i)return"top-center";if(!this._isScreenLocationWithinView(r,a))return this._get("currentAlignment")||"top-center";function l(e){return parseInt(e.replace(/[^-\d\.]/g,""),10)}const c=o?window.getComputedStyle(o,null):null,u=c?l(c.getPropertyValue("max-height")):0,d=c?l(c.getPropertyValue("height")):0,{height:p,width:h}=i.getBoundingClientRect(),g=h+t,_=Math.max(p,u,d)+t,m=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"right",view:a}),f=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"left",view:a}),v=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"top",view:a}),b=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"bottom",view:a});return f?v?"bottom-right":"top-right":m?v?"bottom-left":"top-left":v?b?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return"function"==typeof e?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return F(this.container)&&t.reverse(),e.replace(/leading/gi,t[0]).replace(/trailing/gi,t[1])}_callDockPosition(e){return"function"==typeof e?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){if("auto"!==e)return e;const t=this.viewModel?.view,i=F(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!e)return;const{screenLocation:t}=this.viewModel,{width:i}=e.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&(e.style.top=o.top,e.style.left=o.left,e.style.bottom=o.bottom,e.style.right=o.right)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return"top-left"===t||"bottom-left"===t||"top-right"===t||"bottom-right"===t?e+i:e}_calculateAlignmentPosition(e,t,i,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this,r=o/2,a=i.height-t,l=i.width-e,{padding:c}=this.view;return"bottom-center"===n?{top:t+s-c.top,left:e-r-c.left}:"top-left"===n?{bottom:a+s-c.bottom,right:l+s-c.right}:"bottom-left"===n?{top:t+s-c.top,right:l+s-c.right}:"top-right"===n?{bottom:a+s-c.bottom,left:e+s-c.left}:"bottom-right"===n?{top:t+s-c.top,left:e+s-c.left}:"top-center"===n?{bottom:a+s-c.bottom,left:e-r-c.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(s(e)||!t)return;const n=this._calculateFullWidth(t),r=this._calculateAlignmentPosition(e.x,e.y,o,n);return r?{top:void 0!==r.top?`${r.top}px`:"auto",left:void 0!==r.left?`${r.left}px`:"auto",bottom:void 0!==r.bottom?`${r.bottom}px`:"auto",right:void 0!==r.right?`${r.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){if(e){const e=this.get("viewModel.view");this._wireUpView(e)}else t&&(this.close(),this.clear())}_wireUpView(e){if(this._destroySpinner(),!e)return;const{spinnerEnabled:t}=this;t&&this._createSpinner(e),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,r]=t,{width:a,height:l}=i;return o<=a&&s>a||o>a&&s<=a||n<=l&&r>l||n>l&&r<=l}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],r=[];s[0]=e[0]-o,s[1]=e[1]-n,r[0]=t[0]-o,r[1]=t[1]-n;const{dockOptions:a}=this,l=a.breakpoint;this._dockingThresholdCrossed(s,r,l)&&this._setDockEnabledForViewSize(a),this._setCurrentDockPosition()}_focusDockButtonNode(e){this._focusDockButton&&(this._focusDockButton=!1,e.focus())}_closeButtonNodeUpdated(e){return this._focusClose?(this._focusClose=!1,void e.focus()):this._blurClose?(this._blurClose=!1,void e.blur()):void 0}_mainContainerNodeUpdated(e){return this._mainContainerNode=e,this._focusContainer?(this._focusContainer=!1,void e.focus()):this._blurContainer?(this._blurContainer=!1,void e.blur()):void 0}_featureMenuNodeUpdated(e){if(this._featureMenuNode=e,!e||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_focusFeatureMenuButtonNode(e){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,e.focus())}_focusActionsMenuButtonNode(e){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,e.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n))return!1;const s=t.hasOwnProperty("width")&&o<=t.width,r=t.hasOwnProperty("height")&&n<=t.height;return s||r}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,t){return this.featureNavigationVisible?T(this.messages.pageText,{index:t+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t&&t.ui&&t.ui.remove(this._spinner,D),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new m({view:e}),e.ui.add(this._spinner,{key:D,position:"manual"}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const e=!this.featureMenuOpen;this._featureMenuOpenChanged(e),this.actionsMenuOpen=!1,this.featureMenuOpen=e}_toggleActionsMenu(){const e=!this.actionsMenuOpen;this._actionsMenuOpenChanged(e),this.featureMenuOpen=!1,this.actionsMenuOpen=e}_triggerAction(e){const t=e.currentTarget.dataset.actionUid,{allActions:i}=this.viewModel,o=i.findIndex((e=>e.uid===t)),n=i.getItemAt(o);n&&"toggle"===n.type&&(n.value=!n.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(o)}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};e([p({readOnly:!0})],V.prototype,"actionsMenuId",null),e([p({readOnly:!0})],V.prototype,"actionsMenuButtonId",null),e([p({readOnly:!0})],V.prototype,"featureMenuId",null),e([p({readOnly:!0})],V.prototype,"titleId",null),e([p({readOnly:!0})],V.prototype,"contentId",null),e([p({readOnly:!0})],V.prototype,"hasContent",null),e([p({readOnly:!0})],V.prototype,"featureNavigationVisible",null),e([p({readOnly:!0})],V.prototype,"collapsible",null),e([p({readOnly:!0})],V.prototype,"featureMenuVisible",null),e([p({readOnly:!0})],V.prototype,"contentCollapsed",null),e([p({readOnly:!0})],V.prototype,"dividedActions",null),e([p({readOnly:!0,dependsOn:["_flowItems.length"]})],V.prototype,"_activeFlowItemWidget",null),e([p()],V.prototype,"actions",null),e([p()],V.prototype,"actionsMenuOpen",null),e([p()],V.prototype,"alignment",void 0),e([p()],V.prototype,"autoCloseEnabled",null),e([p()],V.prototype,"autoOpenEnabled",null),e([p()],V.prototype,"defaultPopupTemplateEnabled",null),e([p()],V.prototype,"content",null),e([p()],V.prototype,"collapsed",void 0),e([p()],V.prototype,"collapseEnabled",void 0),e([p({readOnly:!0})],V.prototype,"currentAlignment",null),e([p({readOnly:!0})],V.prototype,"currentDockPosition",null),e([p()],V.prototype,"dockOptions",null),e([p()],V.prototype,"dockEnabled",void 0),e([p({readOnly:!0})],V.prototype,"featureCount",null),e([p()],V.prototype,"featureMenuOpen",void 0),e([p()],V.prototype,"features",null),e([p()],V.prototype,"goToOverride",null),e([p()],V.prototype,"headingLevel",void 0),e([p()],V.prototype,"highlightEnabled",null),e([p()],V.prototype,"location",null),e([p()],V.prototype,"label",null),e([p()],V.prototype,"maxInlineActions",void 0),e([p(),k("esri/widgets/Popup/t9n/Popup")],V.prototype,"messages",void 0),e([p(),k("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([p()],V.prototype,"promises",null),e([p({readOnly:!0})],V.prototype,"selectedFeature",null),e([p()],V.prototype,"selectedFeatureIndex",null),e([p({readOnly:!0})],V.prototype,"selectedFeatureWidget",null),e([p()],V.prototype,"spinnerEnabled",void 0),e([p()],V.prototype,"title",null),e([p()],V.prototype,"updateLocationEnabled",null),e([p()],V.prototype,"view",null),e([p({type:w}),C(["triggerAction","trigger-action"])],V.prototype,"viewModel",void 0),e([p()],V.prototype,"visible",null),e([p()],V.prototype,"visibleElements",void 0),e([h("visibleElements")],V.prototype,"castVisibleElements",null),e([y()],V.prototype,"_close",null),e([y()],V.prototype,"_toggleDockEnabled",null),e([y()],V.prototype,"_toggleFeatureMenu",null),e([y()],V.prototype,"_toggleActionsMenu",null),e([y()],V.prototype,"_triggerAction",null),e([y()],V.prototype,"_selectFeature",null),e([y()],V.prototype,"_next",null),e([y()],V.prototype,"_previous",null),V=e([g("esri.widgets.Popup")],V);const U=V;export{U as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{eventKey as i}from"../core/events.js";import o from"../core/Handles.js";import n from"../core/Logger.js";import{isNone as s}from"../core/maybe.js";import{watch as r,when as a,on as l,whenOnce as c,initial as u}from"../core/reactiveUtils.js";import{throttle as d}from"../core/throttle.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as h}from"../core/accessorSupport/decorators/cast.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import _ from"./Feature.js";import m from"./Spinner.js";import f from"./Widget.js";import{CSS as v}from"./Feature/resources.js";import{FeatureContentMixin as b}from"./Feature/support/FeatureContentMixin.js";import w from"./Popup/PopupViewModel.js";import{Heading as M}from"./support/Heading.js";import{accessibleHandler as y}from"./support/decorators/accessibleHandler.js";import{messageBundle as k}from"./support/decorators/messageBundle.js";import{vmEvent as C}from"./support/decorators/vmEvent.js";import{tsx as A}from"./support/jsxFactory.js";import{isRTL as F,storeNode as I,cssTransition as x}from"./support/widgetUtils.js";import{isDarkTheme as O}from"../support/themeUtils.js";import{substitute as T}from"../intl/substitute.js";const E="selected-index",N=0,D="popup-spinner",B={calciteThemeLight:"calcite-theme-light",calciteThemeDark:"calcite-theme-dark",iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow",iconDockToTop:"esri-icon-maximize",iconDockToBottom:"esri-icon-dock-bottom",iconDockToLeft:"esri-icon-dock-left",iconDockToRight:"esri-icon-dock-right",iconClose:"esri-icon-close",iconUndock:"esri-icon-minimize",iconCheckMark:"esri-icon-check-mark",iconLoading:"esri-icon-loading-indicator",iconDefaultAction:"esri-icon-default-action",iconActionsMenu:"esri-icon-handle-horizontal",rotating:"esri-rotating",base:"esri-popup",widget:"esri-widget",main:"esri-popup__main-container",loadingContainer:"esri-popup__loading-container",isCollapsible:"esri-popup--is-collapsible",isCollapsed:"esri-popup--is-collapsed",shadow:"esri-popup--shadow",isDocked:"esri-popup--is-docked",isDockedTopLeft:"esri-popup--is-docked-top-left",isDockedTopCenter:"esri-popup--is-docked-top-center",isDockedTopRight:"esri-popup--is-docked-top-right",isDockedBottomLeft:"esri-popup--is-docked-bottom-left",isDockedBottomCenter:"esri-popup--is-docked-bottom-center",isDockedBottomRight:"esri-popup--is-docked-bottom-right",alignTopCenter:"esri-popup--aligned-top-center",alignBottomCenter:"esri-popup--aligned-bottom-center",alignTopLeft:"esri-popup--aligned-top-left",alignBottomLeft:"esri-popup--aligned-bottom-left",alignTopRight:"esri-popup--aligned-top-right",alignBottomRight:"esri-popup--aligned-bottom-right",isFeatureMenuOpen:"esri-popup--feature-menu-open",isActionsMenuOpen:"esri-popup--actions-menu-open",hasFeatureUpdated:"esri-popup--feature-updated",header:"esri-popup__header",headerButtons:"esri-popup__header-buttons",headerContainer:"esri-popup__header-container",headerContainerButton:"esri-popup__header-container--button",headerTitle:"esri-popup__header-title",content:"esri-popup__content",contentHasFlows:"esri-content--has-flows",contentFlowItem:"esri-content__flow-item",footer:"esri-popup__footer",footerHasPagination:"esri-popup__footer--has-pagination",footerHasActions:"esri-popup__footer--has-actions",footerHasActionsMenu:"esri-popup__footer--has-actions-menu",button:"esri-popup__button",buttonDisabled:"esri-popup__button--disabled",buttonDock:"esri-popup__button--dock",icon:"esri-popup__icon",iconDock:"esri-popup__icon--dock-icon",inlineActionsContainer:"esri-popup__inline-actions-container",actionsMenuButton:"esri-popup__actions-menu-button",actions:"esri-popup__actions",action:"esri-popup__action",actionImage:"esri-popup__action-image",actionText:"esri-popup__action-text",actionToggle:"esri-popup__action-toggle",actionToggleOn:"esri-popup__action-toggle--on",actionExit:"esri-popup__action--exit",pointer:"esri-popup__pointer",pointerDirection:"esri-popup__pointer-direction",navigation:"esri-popup__navigation",paginationPrevious:"esri-popup__pagination-previous",paginationNext:"esri-popup__pagination-next",paginationPreviousIconLTR:"esri-popup__pagination-previous-icon",paginationPreviousIconRTL:"esri-popup__pagination-previous-icon--rtl",paginationNextIconLTR:"esri-popup__pagination-next-icon",paginationNextIconRTL:"esri-popup__pagination-next-icon--rtl",featureMenu:"esri-popup__feature-menu",featureMenuList:"esri-popup__feature-menu-list",featureMenuItem:"esri-popup__feature-menu-item",featureMenuViewport:"esri-popup__feature-menu-viewport",featureMenuHeader:"esri-popup__feature-menu-header",featureMenuNote:"esri-popup__feature-menu-note",featureMenuSelected:"esri-popup__feature-menu-item--selected",featureMenuButton:"esri-popup__feature-menu-button",featureMenuTitle:"esri-popup__feature-menu-title",featureMenuObserver:"esri-popup__feature-menu-observer",featureMenuLoader:"esri-popup__feature-menu-loader",collapseButton:"esri-popup__collapse-button",collapseIcon:"esri-popup__collapse-icon"},P={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},L="esri-popup";function R(e,t){return void 0===t?`${L}__${e}`:`${L}__${e}-${t}`}const S={closeButton:!0,featureNavigation:!0};let V=class extends(b(f)){constructor(e,i){super(e,i),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new o,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=d((()=>this._displaySpinner()),N),this._exitRelatedRecordsActions=new WeakMap,this._flowItems=new t,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.featureMenuOpen=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.spinnerEnabled=!0,this.viewModel=new w,this.visibleElements={...S},this._addSelectedFeatureIndexHandle(),this.addHandles([r((()=>this.viewModel?.screenLocation),(()=>this._positionContainer())),r((()=>[this.viewModel?.active,this.dockEnabled]),(()=>this._toggleScreenLocationEnabled())),r((()=>this.viewModel?.screenLocation),((e,t)=>{!!e!=!!t&&this.reposition()})),r((()=>[this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment]),(()=>this.reposition())),r((()=>this.spinnerEnabled),(e=>this._spinnerEnabledChange(e))),r((()=>this.viewModel?.view?.size),((e,t)=>this._updateDockEnabledForViewSize(e,t))),r((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),r((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e,t))),r((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),r((()=>this.selectedFeatureWidget),(()=>this._destroyFlowItemWidgets())),r((()=>[this.selectedFeatureWidget?.viewModel?.title,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setTitleFromFeatureWidget())),r((()=>[this.selectedFeatureWidget?.viewModel?.content,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setContentFromFeatureWidget())),a((()=>!this.collapsed),(()=>{"xsmall"===this.viewModel?.view?.widthBreakpoint&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()})),l((()=>this.viewModel?.allActions),"change",(()=>this._watchActions())),r((()=>this.viewModel?.allActions),(()=>this._watchActions()),u),r((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),l((()=>this._flowItems),"change",(()=>{this.notifyChange("_activeFlowItemWidget"),this.scheduleRender()})),r((()=>[this._activeFlowItemWidget?.viewModel?.state,this._activeFlowItemWidget?.viewModel?.title]),(()=>this.scheduleRender()))])}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-flow.js"),import("@esri/calcite-components/dist/components/calcite-flow-item.js"),import("@esri/calcite-components/dist/components/calcite-action.js"),import("@esri/calcite-components/dist/components/calcite-tooltip.js"),import("@esri/calcite-components/dist/components/calcite-icon.js")])}destroy(){this._destroyFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._handles?.destroy(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._handles=null}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){const{selectedFeatureWidget:e,viewModel:t}=this;if(!e)return!!t?.content;const i=e.viewModel;if(i?.waitingForContent||"error"===i?.state)return!0;const o=i?.content;return Array.isArray(o)?!!o.length:!!o}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}get _activeFlowItemWidget(){const{_flowItems:e}=this;return e.getItemAt(e.length-1)||null}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){this.viewModel.autoOpenEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||P}set dockOptions(e){const t={...P},i=this.get("viewModel.view.breakpoints"),o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:r}=n;!0===r?n.breakpoint=s:"object"==typeof r&&(n.breakpoint={...s,...r}),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,visibleElements:t,headingLevel:i,_flowItems:o}=this,{selectedFeatureViewModel:n}=this.viewModel,s={...t,title:!1};return n?(e?(e.viewModel=n,e.visibleElements=s):this._feature=new _({flowItems:o,headingLevel:i+1,viewModel:n,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}castVisibleElements(e){return{...S,...e}}blur(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(e){this._handles.remove(E);const t=!!e&&!!e.featureMenuOpen,i=!!e&&!!e.actionsMenuOpen,o={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:i,featureMenuOpen:t};"xsmall"===this.viewModel?.view?.widthBreakpoint&&(o.collapsed=!0),this.set(o),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{actionsMenuOpen:e,dockEnabled:t,featureMenuVisible:i,dividedActions:o,currentAlignment:n,currentDockPosition:s}=this,{active:r}=this.viewModel,{menuActions:a}=o,l=r&&a.length>1&&e,c=r&&t,u=r&&!t,d=this.selectedFeature?.layer?.title,p=this.selectedFeature?.layer?.id,h={[B.alignTopCenter]:"top-center"===n,[B.alignBottomCenter]:"bottom-center"===n,[B.alignTopLeft]:"top-left"===n,[B.alignBottomLeft]:"bottom-left"===n,[B.alignTopRight]:"top-right"===n,[B.alignBottomRight]:"bottom-right"===n,[B.isDocked]:c,[B.shadow]:u,[B.isDockedTopLeft]:"top-left"===s,[B.isDockedTopCenter]:"top-center"===s,[B.isDockedTopRight]:"top-right"===s,[B.isDockedBottomLeft]:"bottom-left"===s,[B.isDockedBottomCenter]:"bottom-center"===s,[B.isDockedBottomRight]:"bottom-right"===s,[B.isFeatureMenuOpen]:i,[B.isActionsMenuOpen]:l};return A("div",{class:this.classes(B.base,h),role:"presentation","data-layer-title":d,"data-layer-id":p,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},r?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return A("span",{"aria-hidden":"true",class:this.classes(B.icon,B.iconLoading,B.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?A("div",{key:R("loading-container"),role:"presentation",class:B.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousIcon(){const e=F(this.container),t={[B.iconRightTriangleArrow]:e,[B.paginationPreviousIconRTL]:e,[B.iconLeftTriangleArrow]:!e,[B.paginationPreviousIconLTR]:!e};return A("span",{"aria-hidden":"true",class:this.classes(B.icon,t)})}renderPreviousButton(){const{messages:e}=this;return A("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(B.button,B.paginationPrevious),"aria-label":e.previous,title:e.previous},this.renderPreviousIcon())}renderNextIcon(){const e=F(this.container),t={[B.iconLeftTriangleArrow]:e,[B.paginationNextIconRTL]:e,[B.iconRightTriangleArrow]:!e,[B.paginationNextIconLTR]:!e};return A("span",{"aria-hidden":"true",class:this.classes(B.icon,t)})}renderNextButton(){const{messages:e}=this;return A("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(B.button,B.paginationNext),"aria-label":e.next,title:e.next},this.renderNextIcon())}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:t,messagesCommon:i}=this,{featureCount:o,selectedFeatureIndex:n}=this.viewModel;return A("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:this.classes(B.button,B.featureMenuButton),"aria-haspopup":"true","aria-controls":t,"aria-expanded":e.toString(),"aria-label":i.menu,title:i.menu},this._getPageText(o,n))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton(),this.renderNextButton()]:null}renderDockIcon(){const{dockEnabled:e}=this,t=this._wouldDockTo(),i={[B.iconUndock]:e,[B.iconDock]:!e,[B.iconDockToRight]:!e&&("top-right"===t||"bottom-right"===t),[B.iconDockToLeft]:!e&&("top-left"===t||"bottom-left"===t),[B.iconDockToTop]:!e&&"top-center"===t,[B.iconDockToBottom]:!e&&"bottom-center"===t};return A("span",{"aria-hidden":"true",class:this.classes(i,B.icon)})}renderDockButton(){const{dockEnabled:e,messages:t}=this,i=this.viewModel?.view?.widthBreakpoint,o=e?t.undock:t.dock;return"xsmall"!==i&&this.dockOptions?.buttonEnabled?A("div",{role:"button","aria-label":o,title:o,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(B.button,B.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:t,collapsible:i,contentCollapsed:o,messagesCommon:n}=this,s={[B.headerContainerButton]:i},r=A(M,{level:this.headingLevel,class:B.headerTitle,innerHTML:e}),a=i?A("button",{key:`${e}--collapsible`,id:t,title:o?n.expand:n.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(B.headerContainer,s),"aria-expanded":o?"false":"true",onclick:this._toggleCollapsed,type:"button"},r,A("calcite-icon",{class:B.collapseIcon,key:"collapse-icon",icon:o?"chevron-down":"chevron-up",scale:"m"})):A("div",{key:e,id:t,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(B.headerContainer,s)},r);return e?a:null}renderCloseIcon(){return A("span",{"aria-hidden":"true",class:this.classes(B.icon,B.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:t}=this;return e.closeButton?A("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:B.button,"aria-label":t.close,title:t.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return A("header",{class:B.header},this.renderTitle(),A("div",{class:B.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:t,contentCollapsed:i,_flowItems:o,messagesCommon:n}=this,{content:s}=this.viewModel,r=o.toArray(),a={[B.contentHasFlows]:!!r.length};return t&&!i?A("div",{key:s,enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:this.classes(B.content,a)},A("calcite-flow",{bind:this,onCalciteFlowItemBack:this._handleBackClick},A("calcite-flow-item",{bind:this,"data-node-ref":"_rootFlowItemNode","intl-back":n.back,afterCreate:I,key:"root-flow-item"},this.renderContent()),r.map((e=>this.renderFlowItem(e)))),r.map((e=>this.renderFlowItemTooltip(e)))):null}renderFlowItem(e){const{messages:t,messagesCommon:i}=this,o=O();return A("calcite-flow-item",{class:this.classes({[B.calciteThemeDark]:!o,[B.calciteThemeLight]:o}),heading:e.title,"intl-back":i.back,description:this._getFlowItemDescription(e),key:`flow-item-${e.viewModel.uid}`},A("calcite-action",{class:B.actionExit,icon:"move-up",label:t?.exitRelatedRecords,text:t?.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:t=>this._storeExitRelatedRecordsAction(e,t),onclick:this._destroyFlowItemWidgets}),A("div",{class:this.classes(B.contentFlowItem,{[B.calciteThemeDark]:o,[B.calciteThemeLight]:!o})},e.render()))}renderFlowItemTooltip(e){const{messages:t,_exitRelatedRecordsActions:i}=this,o=O();return A("calcite-tooltip",{class:this.classes({[B.calciteThemeDark]:!o,[B.calciteThemeLight]:o}),key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t?.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:i.get(e),placement:"top"},t?.exitRelatedRecords)}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o,messagesCommon:n}=this,s=i?n.close:n.open,{menuActions:r}=o;return r.length?A("div",{key:R("actions-menu-button"),class:this.classes(B.button,B.actionsMenuButton),role:"button",id:t,"aria-haspopup":"true","aria-controls":i?e:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":s,title:s},A("span",{"aria-hidden":"true",class:B.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o}=this,{menuActions:n}=o;return n.length&&i?A("ul",{id:e,role:"menu","aria-labelledby":t,key:R("actions"),class:B.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},n.toArray().map((e=>this.renderAction({action:e,type:"menu-item"})))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return!!e.length&&e.toArray().map((e=>this.renderAction({action:e,type:"inline"})))}renderInlineActionsContainer(){const{inlineActions:e,menuActions:t}=this.dividedActions,i=!!e.length,o=!!t.length;return i||o?A("div",{key:"inline-actions-container","data-inline-actions":i.toString(),"data-menu-actions":o.toString(),class:B.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?A("section",{key:R("navigation"),class:this.classes(B.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:t}=this,{inlineActions:i,menuActions:o}=t,n=!!i.length,s=!!o.length,r={[B.footerHasPagination]:e,[B.footerHasActions]:n,[B.footerHasActionsMenu]:s};return e||n?A("div",{key:R("feature-buttons"),class:this.classes(B.footer,r)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:t,isLoadingFeature:i}=this.viewModel,o=T(e.selectedFeatures,{total:t.length});return A("section",{key:R("menu"),class:B.featureMenu},A("strong",{class:B.featureMenuHeader},o),A("nav",{bind:this,class:B.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:I},this.renderFeatureMenu(),A("div",{class:B.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),i?A("div",{class:B.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:A("div",{key:R("pointer"),class:B.pointer,role:"presentation"},A("div",{class:this.classes(B.pointerDirection,B.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i,titleId:o,contentId:n,collapsible:s,hasContent:r,contentCollapsed:a,visibleElements:l}=this,{title:c}=this.viewModel,u="bottom-left"===t||"bottom-center"===t||"bottom-right"===t||"top-left"===i||"top-center"===i||"top-right"===i,d="top-left"===t||"top-center"===t||"top-right"===t||"bottom-left"===i||"bottom-center"===i||"bottom-right"===i,p={[B.shadow]:e,[B.isCollapsible]:s,[B.isCollapsed]:a};return A("div",{class:this.classes(B.main,B.widget,p),tabIndex:l.closeButton?null:-1,role:"dialog","aria-labelledby":c?o:"","aria-describedby":r&&!a?n:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},u?this.renderFooter():null,u?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),d?this.renderFooter():null,d?this.renderFeatureMenuContainer():null)}renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?A("div",{class:v.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return A("span",{key:"text",class:B.actionText},e)}renderActionIcon(e){const t=this._getActionClass(e),i=this._getActionImage(e),o={[B.iconLoading]:e.active,[B.rotating]:e.active,[B.icon]:!!t,[B.actionImage]:!e.active&&!!i};return t&&(o[t]=!e.active),A("span",{key:"icon","aria-hidden":"true",class:this.classes(B.icon,o),styles:this._getIconStyles(i)})}renderAction(e){const{action:t,type:i}=e,o=this._getActionTitle(t),n={[B.action]:"toggle"!==t.type,[B.actionToggle]:"toggle"===t.type,[B.actionToggleOn]:"toggle"===t.type&&t.value,[B.buttonDisabled]:t.disabled},s=[this.renderActionIcon(t),this.renderActionText(o)],r="menu-item"===i?A("li",{key:t.uid,role:"menuitem",tabIndex:0,title:o,"aria-label":o,class:this.classes(B.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s):A("div",{key:t.uid,role:"button",tabIndex:0,title:o,"aria-label":o,class:this.classes(B.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s);return t.visible?r:null}renderFeatureMenuItem(e,t){const{messages:i,messagesCommon:o}=this,{selectedFeatureIndex:n,selectedFeatureViewModel:s}=this.viewModel,r=e===s,a={[B.featureMenuSelected]:r},l=r?A("span",{key:R(`feature-menu-selected-feature-${n}`),title:i.selectedFeature,"aria-label":i.selectedFeature,class:B.iconCheckMark}):null,c=A("span",{innerHTML:e.title||o.untitled});return A("li",{role:"menuitem",tabIndex:-1,key:R(`feature-menu-feature-${n}`),class:this.classes(a,B.featureMenuItem),bind:this,"data-feature-index":t,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},A("span",{class:B.featureMenuTitle},c,l))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:t}=this.viewModel;return t.length>1?A("ol",{class:B.featureMenuList,id:e,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},t.filter((e=>!!e.graphic)).map(((e,t)=>this.renderFeatureMenuItem(e,t)))):null}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description}_destroyFlowItemWidgets(){this._flowItems.removeAll().forEach((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_handleBackClick(){const e=this._flowItems.pop();this._exitRelatedRecordsActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy())}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,r="zoom-to-feature"===n?T(e.title,{messages:t}):"remove-selected-feature"===n?T(e.title,{messages:o}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?T(e.title,{messages:t}):e.title;return r&&s?T(r,s):r}_getActionClass(e){const{selectedFeature:t}=this,i=t?.attributes,{className:o,image:n}=e,s=n||o?o:B.iconDefaultAction;return s&&i?T(s,i):s}_getActionImage(e){const{selectedFeature:t}=this,i=t?.attributes,{image:o}=e;return o&&i?T(o,i):o}_createFeatureUpdatedAnimation(){return x("enter",B.hasFeatureUpdated)}_getInlineActionCount(){const{maxInlineActions:e,featureNavigationVisible:t}=this;if("number"!=typeof e)return null;const i=Math.round(e);return Math.max(t?i-1:i,0)}_watchActions(){const{allActions:e}=this.viewModel;this.notifyChange("dividedActions");const t="actions";this._handles.remove(t),e&&e.forEach((e=>{this._handles.add(r((()=>[e.uid,e.active,e.className,e.disabled,e.id,e.title,e.image,e.visible]),(()=>this.scheduleRender())),t)}))}_divideActions(){const{allActions:e}=this.viewModel,i=e.filter((e=>e.visible)),o=this._getInlineActionCount(),n=null===o,s=0===o;return{inlineActions:n?i.slice(0):s?new t:i.slice(0,o),menuActions:n?new t:s?i.slice(0):i.slice(o)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this;e&&(this.viewModel.title="error"===e.viewModel?.state?t.errorMessage:e.viewModel?.title||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_handleFeatureMenuKeyup(e){"Escape"===i(e)&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){"Escape"===i(e)&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const t=i(e),{_featureMenuNode:o}=this,n=e.currentTarget["data-feature-index"];if(!o)return;const s=o.querySelectorAll("li"),r=s.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();s[s.length-1].focus()}else{e.stopPropagation();s[0].focus()}else{e.stopPropagation();s[(n+1+r)%r].focus()}else{e.stopPropagation();s[(n-1+r)%r].focus()}}_handleActionMenuItemKeyup(e){const t=i(e),{_actionsMenuNode:o}=this,n=e.currentTarget.dataset.actionUid,{menuActions:s}=this.dividedActions,r=s.findIndex((e=>e.uid===n));if(!o)return;const a=o.querySelectorAll("li"),l=a.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();a[a.length-1].focus()}else{e.stopPropagation();a[0].focus()}else{e.stopPropagation();a[(r+1+l)%l].focus()}else{e.stopPropagation();a[(r-1+l)%l].focus()}}_handleMainKeyup(e){const t=i(e);"ArrowLeft"===t&&(e.stopPropagation(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.next())}_spinnerEnabledChange(e){if(this._destroySpinner(),!e)return;const t=this.get("viewModel.view");this._createSpinner(t)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i?e.show({location:t}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e.shouldFocus&&(await c((()=>!0===this.viewModel?.active)),this.focus())}_addSelectedFeatureIndexHandle(){const e=r((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this._handles.add(e,E)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this;i&&e!==t&&-1!==e&&(this._destroyFlowItemWidgets(),this.actionsMenuOpen=!1,this.featureMenuOpen=!1,this._mainContainerNode&&(this._mainContainerNode.scrollTop=0),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,e&&!e.destroyed&&e.destroy()),this._feature=null}_isScreenLocationWithinView(e,t){return e.x>-1&&e.y>-1&&e.x<=t.width&&e.y<=t.height}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const r=s.padding;return"right"===n&&o.x+i/2>s.width-r.right||("left"===n&&o.x-i/2<r.left||("top"===n&&o.y-t<r.top||"bottom"===n&&o.y+t>s.height-r.bottom))}_calculateAutoAlignment(e){if("auto"!==e)return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:r,view:a}=n;if(s(r)||!a||!i)return"top-center";if(!this._isScreenLocationWithinView(r,a))return this._get("currentAlignment")||"top-center";function l(e){return parseInt(e.replace(/[^-\d\.]/g,""),10)}const c=o?window.getComputedStyle(o,null):null,u=c?l(c.getPropertyValue("max-height")):0,d=c?l(c.getPropertyValue("height")):0,{height:p,width:h}=i.getBoundingClientRect(),g=h+t,_=Math.max(p,u,d)+t,m=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"right",view:a}),f=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"left",view:a}),v=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"top",view:a}),b=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"bottom",view:a});return f?v?"bottom-right":"top-right":m?v?"bottom-left":"top-left":v?b?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return"function"==typeof e?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return F(this.container)&&t.reverse(),e.replace(/leading/gi,t[0]).replace(/trailing/gi,t[1])}_callDockPosition(e){return"function"==typeof e?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){if("auto"!==e)return e;const t=this.viewModel?.view,i=F(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!e)return;const{screenLocation:t}=this.viewModel,{width:i}=e.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&(e.style.top=o.top,e.style.left=o.left,e.style.bottom=o.bottom,e.style.right=o.right)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return"top-left"===t||"bottom-left"===t||"top-right"===t||"bottom-right"===t?e+i:e}_calculateAlignmentPosition(e,t,i,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this,r=o/2,a=i.height-t,l=i.width-e,{padding:c}=this.view;return"bottom-center"===n?{top:t+s-c.top,left:e-r-c.left}:"top-left"===n?{bottom:a+s-c.bottom,right:l+s-c.right}:"bottom-left"===n?{top:t+s-c.top,right:l+s-c.right}:"top-right"===n?{bottom:a+s-c.bottom,left:e+s-c.left}:"bottom-right"===n?{top:t+s-c.top,left:e+s-c.left}:"top-center"===n?{bottom:a+s-c.bottom,left:e-r-c.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(s(e)||!t)return;const n=this._calculateFullWidth(t),r=this._calculateAlignmentPosition(e.x,e.y,o,n);return r?{top:void 0!==r.top?`${r.top}px`:"auto",left:void 0!==r.left?`${r.left}px`:"auto",bottom:void 0!==r.bottom?`${r.bottom}px`:"auto",right:void 0!==r.right?`${r.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){if(e){const e=this.get("viewModel.view");this._wireUpView(e)}else t&&(this.close(),this.clear())}_wireUpView(e){if(this._destroySpinner(),!e)return;const{spinnerEnabled:t}=this;t&&this._createSpinner(e),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,r]=t,{width:a,height:l}=i;return o<=a&&s>a||o>a&&s<=a||n<=l&&r>l||n>l&&r<=l}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],r=[];s[0]=e[0]-o,s[1]=e[1]-n,r[0]=t[0]-o,r[1]=t[1]-n;const{dockOptions:a}=this,l=a.breakpoint;this._dockingThresholdCrossed(s,r,l)&&this._setDockEnabledForViewSize(a),this._setCurrentDockPosition()}_focusDockButtonNode(e){this._focusDockButton&&(this._focusDockButton=!1,e.focus())}_closeButtonNodeUpdated(e){return this._focusClose?(this._focusClose=!1,void e.focus()):this._blurClose?(this._blurClose=!1,void e.blur()):void 0}_mainContainerNodeUpdated(e){return this._mainContainerNode=e,this._focusContainer?(this._focusContainer=!1,void e.focus()):this._blurContainer?(this._blurContainer=!1,void e.blur()):void 0}_featureMenuNodeUpdated(e){if(this._featureMenuNode=e,!e||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_focusFeatureMenuButtonNode(e){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,e.focus())}_focusActionsMenuButtonNode(e){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,e.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n))return!1;const s=t.hasOwnProperty("width")&&o<=t.width,r=t.hasOwnProperty("height")&&n<=t.height;return s||r}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,t){return this.featureNavigationVisible?T(this.messages.pageText,{index:t+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t&&t.ui&&t.ui.remove(this._spinner,D),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new m({view:e}),e.ui.add(this._spinner,{key:D,position:"manual"}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const e=!this.featureMenuOpen;this._featureMenuOpenChanged(e),this.actionsMenuOpen=!1,this.featureMenuOpen=e}_toggleActionsMenu(){const e=!this.actionsMenuOpen;this._actionsMenuOpenChanged(e),this.featureMenuOpen=!1,this.actionsMenuOpen=e}_triggerAction(e){const t=e.currentTarget.dataset.actionUid,{allActions:i}=this.viewModel,o=i.findIndex((e=>e.uid===t)),n=i.getItemAt(o);n&&"toggle"===n.type&&(n.value=!n.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(o)}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};e([p({readOnly:!0})],V.prototype,"actionsMenuId",null),e([p({readOnly:!0})],V.prototype,"actionsMenuButtonId",null),e([p({readOnly:!0})],V.prototype,"featureMenuId",null),e([p({readOnly:!0})],V.prototype,"titleId",null),e([p({readOnly:!0})],V.prototype,"contentId",null),e([p({readOnly:!0})],V.prototype,"hasContent",null),e([p({readOnly:!0})],V.prototype,"featureNavigationVisible",null),e([p({readOnly:!0})],V.prototype,"collapsible",null),e([p({readOnly:!0})],V.prototype,"featureMenuVisible",null),e([p({readOnly:!0})],V.prototype,"contentCollapsed",null),e([p({readOnly:!0})],V.prototype,"dividedActions",null),e([p({readOnly:!0,dependsOn:["_flowItems.length"]})],V.prototype,"_activeFlowItemWidget",null),e([p()],V.prototype,"actions",null),e([p()],V.prototype,"actionsMenuOpen",null),e([p()],V.prototype,"alignment",void 0),e([p()],V.prototype,"autoCloseEnabled",null),e([p()],V.prototype,"autoOpenEnabled",null),e([p()],V.prototype,"defaultPopupTemplateEnabled",null),e([p()],V.prototype,"content",null),e([p()],V.prototype,"collapsed",void 0),e([p()],V.prototype,"collapseEnabled",void 0),e([p({readOnly:!0})],V.prototype,"currentAlignment",null),e([p({readOnly:!0})],V.prototype,"currentDockPosition",null),e([p()],V.prototype,"dockOptions",null),e([p()],V.prototype,"dockEnabled",void 0),e([p({readOnly:!0})],V.prototype,"featureCount",null),e([p()],V.prototype,"featureMenuOpen",void 0),e([p()],V.prototype,"features",null),e([p()],V.prototype,"goToOverride",null),e([p()],V.prototype,"headingLevel",void 0),e([p()],V.prototype,"highlightEnabled",null),e([p()],V.prototype,"location",null),e([p()],V.prototype,"label",null),e([p()],V.prototype,"maxInlineActions",void 0),e([p(),k("esri/widgets/Popup/t9n/Popup")],V.prototype,"messages",void 0),e([p(),k("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([p()],V.prototype,"promises",null),e([p({readOnly:!0})],V.prototype,"selectedFeature",null),e([p()],V.prototype,"selectedFeatureIndex",null),e([p({readOnly:!0})],V.prototype,"selectedFeatureWidget",null),e([p()],V.prototype,"spinnerEnabled",void 0),e([p()],V.prototype,"title",null),e([p()],V.prototype,"updateLocationEnabled",null),e([p()],V.prototype,"view",null),e([p({type:w}),C(["triggerAction","trigger-action"])],V.prototype,"viewModel",void 0),e([p()],V.prototype,"visible",null),e([p()],V.prototype,"visibleElements",void 0),e([h("visibleElements")],V.prototype,"castVisibleElements",null),e([y()],V.prototype,"_close",null),e([y()],V.prototype,"_toggleDockEnabled",null),e([y()],V.prototype,"_toggleFeatureMenu",null),e([y()],V.prototype,"_toggleActionsMenu",null),e([y()],V.prototype,"_triggerAction",null),e([y()],V.prototype,"_selectFeature",null),e([y()],V.prototype,"_next",null),e([y()],V.prototype,"_previous",null),V=e([g("esri.widgets.Popup")],V);const U=V;export{U as default};