@arcgis/core 4.23.0-next.20211226 → 4.23.0-next.20211230

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i}),r(80442);var n,o=r(78286),s=r(17202);const i={apiKey:void 0,applicationUrl:null==(n=globalThis.location)?void 0:n.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryService:null,geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,o.RH)(i,globalThis.esriConfig,!0),delete i.has),!i.assetsPath){const e="4.23.0";i.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${s.r}/assets`}i.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(i,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),i.request.corsEnabledServers=[],i.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof i))return new i(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=void 0,this instanceof o&&(this.message=t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(function(e,r){if(""===r)return"$";const o=(0,n.hS)(r,t),s=null==o?"":o;if(void 0===s)throw new Error(`could not find key "${r}" in template`);return s.toString()}))}(t,r)||"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=null==e?Math.random()*n._m:e}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{"use strict";r.d(t,{SO:()=>l,a9:()=>a,fS:()=>s,cq:()=>f,w6:()=>c,Od:()=>b,e$:()=>d,FY:()=>p});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}const i=!!Array.prototype.fill;function a(e,t){if(i)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function c(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class l{constructor(){this.last=0}}const u=new l;function f(e,t,r,n){n=n||u;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function d(e,t,r,n){const o=null==r?e.length:r,s=f(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const h=new Set;function p(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;h.clear();for(let e=0;e<n;++e)h.add(t[e]);o=o||u;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(h.has(e[t])&&(s&&s.push(e[t]),h.delete(e[t]),e[t]=e[r-1],--r,--t,0===h.size||0===r))return h.clear(),r;for(let t=0;t<i;++t)if(h.has(e[t])&&(s&&s.push(e[t]),h.delete(e[t]),e[t]=e[r-1],--r,--t,0===h.size||0===r))return h.clear(),r;return h.clear(),r}function b(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{vT:()=>n,on:()=>o,IH:()=>s})},80442:(e,t,r)=>{"use strict";var n,o;let s;var i,a;function c(e){return"function"==typeof s[e]?s[e]=s[e](globalThis):s[e]}r.d(t,{Z:()=>c}),s=null!=(n=globalThis.dojoConfig)&&n.has||null!=(o=globalThis.esriConfig)&&o.has?{...null==(i=globalThis.dojoConfig)?void 0:i.has,...null==(a=globalThis.esriConfig)?void 0:a.has}:{},c.add=(e,t,r,n)=>((n||void 0===s[e])&&(s[e]=t),r&&c(e)),c.cache=s,c.add("esri-deprecation-warnings",!0),(()=>{var e;c.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const t="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(c.add("host-browser",t),c.add("host-node","object"==typeof globalThis.process&&(null==(e=globalThis.process.versions)?void 0:e.node)&&globalThis.process.versions.v8),c.add("dom",t),c("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(c.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),c.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),c.add("khtml",r.includes("Konqueror")?n:void 0),c.add("edge",parseFloat(t.split("Edge/")[1])||void 0),c.add("opr",parseFloat(t.split("OPR/")[1])||void 0),c.add("webkit",!c("wp")&&!c("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),c.add("chrome",!c("edge")&&!c("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),c.add("android",!c("wp")&&parseFloat(t.split("Android ")[1])||void 0),c.add("safari",!r.includes("Safari")||c("wp")||c("chrome")||c("android")||c("edge")||c("opr")?void 0:parseFloat(r.split("Version/")[1])),c.add("mac",r.includes("Macintosh")),!c("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));c.add(e,n),c.add("ios",n)}c.add("trident",parseFloat(r.split("Trident/")[1])||void 0),c("webkit")||(!t.includes("Gecko")||c("wp")||c("khtml")||c("trident")||c("edge")||c.add("mozilla",n),c("mozilla")&&c.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&c.add("esri-mobile",t),r&&c.add("esri-iPhone",r),c.add("esri-geolocation",!!navigator.geolocation)}c.add("esri-canvas-svg-support",!c("trident")),c.add("esri-wasm","WebAssembly"in globalThis),c.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),c.add("esri-atomics","Atomics"in globalThis),c.add("esri-workers","Worker"in globalThis),c.add("web-feat:cache","caches"in globalThis),c.add("esri-workers-arraybuffer-transfer",!c("safari")||Number(c("safari"))>=12),c.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),c.add("featurelayer-simplify-payload-size-factors",[1,1,4]),c.add("featurelayer-snapshot-enabled",!0),c.add("featurelayer-snapshot-point-min-threshold",8e4),c.add("featurelayer-snapshot-point-max-threshold",4e5),c.add("featurelayer-snapshot-point-coverage",.1),c.add("featurelayer-advanced-symbols",!1),c.add("featurelayer-pbf",!0),c.add("featurelayer-pbf-statistics",!1),c.add("feature-layers-workers",!0),c.add("mapview-transitions-duration",200),c.add("mapserver-pbf-enabled",!1),c.add("vectortilelayer-max-buffers",c("ff")?160:Number.POSITIVE_INFINITY),c("host-webworker")||c("host-browser")&&(c.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),c.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{c.add("esri-image-decode",!0,!0,!0)})).catch((()=>{c.add("esri-image-decode",!1,!0,!0)}))}return!1})),c.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{d9:()=>i,fS:()=>d,yd:()=>s,Vo:()=>a}),r(67676),r(80442);var n=r(70586),o=r(1533);function s(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&s(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function i(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(c(e))return e.clone();if(l(e))return e.map(i);if(u(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=i(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(l(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(c(e))return e.clone();if(!u(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function f(e){if((0,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(e))return(0,o.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,i(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(i(e))})),t}return null}function d(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e){return void 0===e}function i(e,t){return n(e)?t(e):null}function a(e){return e}function c(e,t){if(o(e))throw new Error(t);return e}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e){return n(e)&&e.destroy(),null}function f(e){return n(e)&&e.dispose(),null}function d(e){return n(e)&&e.remove(),null}function h(e){return n(e)&&e.release(),null}function p(e){return null}function b(e,t){const r=new Array;for(const n of e)r.push(m(n,null,t));return r}function g(e,t){for(const r of e)m(r,null,t)}function m(e,t,r){return n(e)?r(e):t}function y(e,t){return n(e)?t(e):null}function v(e){return e.filter((e=>n(e)))}function w(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function _(e){return e}r.d(t,{Po:()=>y,yw:()=>i,j0:()=>_,SC:()=>u,O3:()=>f,lV:()=>v,JR:()=>g,U2:()=>w,Wi:()=>o,pC:()=>n,o8:()=>s,Fd:()=>b,R2:()=>m,Bd:()=>p,RY:()=>h,hw:()=>d,Wg:()=>a,Pt:()=>l,s3:()=>c})},78286:(e,t,r)=>{"use strict";r.d(t,{RH:()=>o,hS:()=>s,RB:()=>i});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce((function(e,o){let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{-1===s.indexOf(e)&&s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>C,$6:()=>c,Ue:()=>l,zE:()=>u,dD:()=>_,hh:()=>T,vr:()=>j,Ds:()=>x,as:()=>O,WW:()=>P,R8:()=>w,D_:()=>v,Hc:()=>h,y8:()=>E,fu:()=>g,$F:()=>m,d1:()=>k,DB:()=>S,r9:()=>p,k_:()=>f,H9:()=>b,Yn:()=>M,gx:()=>A,Hl:()=>y});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o,s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e){return Promise.all(e)}function l(e){return new Promise(((t,r)=>{try{e(t,r)}catch(e){Promise.resolve().then((()=>r(e)))}}))}function u(e="Aborted"){return new s.Z("AbortError",e)}function f(e,t="Aborted"){if(h(e))throw u(t)}function d(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function h(e){const t=d(e);return(0,a.pC)(t)&&t.aborted}function p(e){if(v(e))throw e}function b(e){if(!v(e))throw e}function g(e,t){const r=d(e);if(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function m(e,t){const r=d(e);if(!(0,a.Wi)(r))return f(r),(0,i.IH)(r,"abort",(()=>t(u())))}function y(e,t){const r=d(t);return(0,a.Wi)(r)?e:new Promise(((r,n)=>{let o=g(t,(()=>n(u())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function v(e){return e&&"AbortError"===e.name}function w(e){return e.catch((e=>{if(!v(e))throw e}))}function _(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}function O(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e);return O(t.map((t=>e[t]))).then((e=>{const r={};return t.forEach(((t,n)=>r[t]=e[n])),r}))}const t=e;return l((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}function P(e){return O(e).then((e=>e.filter((e=>!!e.value)).map((e=>e.value))))}function k(e){return Promise.reject(e)}function S(e){return Promise.resolve(e)}function C(e,t,r){const n=new AbortController;return g(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);g(n,(()=>{s&&(clearTimeout(s),o(u()))}))}))}function E(e){return e&&"function"==typeof e.then}function A(e){return E(e)?e:Promise.resolve(e)}function x(e,t=-1){let r,n,o,s,i=null;const c=(...l)=>{if(r){n=l,s&&s.reject(u()),s=_();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||_(),s=null,t>0){const n=new AbortController;r=A(e(...l,n.signal));const o=r;C(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=A(e(...l));const f=()=>{const e=n;n=o=r=i=null,null!=e&&c(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return c}function T(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}function j(e,t){let r,n=new AbortController;const o=e(n.signal);let s={promise:o,finished:!1,abort:()=>{n&&(n.abort(),n=null)}};const i=()=>{s&&(s.finished=!0,s=null),(0,a.pC)(r)&&(r.remove(),r=null),n=null};return o.then(i,i),r=g(t,(()=>{(0,a.pC)(s)&&s.abort()})),s}function M(e){return Promise.resolve().then((()=>{f(e)}))}},19153:(e,t,r)=>{"use strict";r.d(t,{Qs:()=>a,hP:()=>c,gx:()=>i,Cb:()=>l});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return null==e?"":e}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&-1!==t.indexOf(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,eP:()=>s,xZ:()=>h,fS:()=>p,z3:()=>l,Hx:()=>f,W0:()=>i,Uc:()=>u,ZY:()=>d,lq:()=>a,KZ:()=>c,tP:()=>o})},17452:(e,t,r)=>{"use strict";r.d(t,{R9:()=>y,qg:()=>E,tD:()=>j,ZN:()=>ue,fl:()=>fe,AX:()=>_,Gd:()=>v,Ie:()=>ae,sJ:()=>Q,AH:()=>K,io:()=>Y,vt:()=>se,oh:()=>N,P$:()=>Z,Ml:()=>de,ed:()=>M,b7:()=>C,D6:()=>R,tm:()=>$,YP:()=>B,jc:()=>D,HK:()=>H,$U:()=>ee,oC:()=>G,kl:()=>U,v_:()=>F,hF:()=>L,_l:()=>V,PF:()=>J,Fv:()=>q,B7:()=>S,u0:()=>P,Yd:()=>oe,Hu:()=>le,Qj:()=>ie,hO:()=>te,mN:()=>O});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const v=new y(n.Z.applicationUrl),w={},_=(()=>{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}`})();function O(e){const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=P(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function P(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function k(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function S(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>k(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):k(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function C(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ee(e);const n=M(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&re()&&(r=te(r)),O(r)}function E(e){const t=M(e);let r,n;if(t){const e=x(t.proxyUrl);r=e.path,n=e.query?P(e.query):null}if(r){const t=O(e);e=r+"?"+t.path;const o=S({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const A={path:"",query:""};function x(e){const t=e.indexOf("?");return-1!==t?(A.path=e.slice(0,t),A.query=e.slice(t+1)):(A.path=e,A.query=null),A}function T(e){return(e=ne(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=x(e).path),!0)).toLowerCase()}function j(e){const t={proxyUrl:e.proxyUrl,urlPrefix:T(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function M(e){const t=c.proxyRules,r=T(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function $(e,t){return e=I(e),t=I(t),ne(e)===ne(t)}function I(e){const t=(e=q(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function N(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function R(e,t,r=!1){const n=ce(e),o=ce(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function U(e){if("string"==typeof e){if(!B(e))return!0;e=ce(e)}if(R(e,v))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=W(t[r]);for(let t=0;t<n.length;t++)if(R(e,n[t]))return!0}return!1}function W(e){return w[e]||(X(e)||G(e)?w[e]=[new y(L(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function L(e,t=_,r){return G(e)?r&&r.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===Z(e).slice(2)?`http:${e}`:`https:${e}`:X(e)?e:(0,i.j0)(F("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function J(e,t=_,r){if(!B(e))return e;const n=q(e),o=n.toLowerCase(),s=q(t).toLowerCase().replace(/\/+$/,""),i=r?q(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function q(e){return function(e){const t=c.httpsDomains;if(!function(e){return f.test(e)||"http"===v.scheme&&G(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&n===v.authority&&!b.test(e)||(re()&&n===v.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||re()&&!M(e))&&(e=te(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=x(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=L(e=e.trim()))))}function F(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(B(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function Z(e,t=!1){if(D(e)||H(e))return null;let r=e.indexOf("://");if(-1===r&&G(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ne(e,!0)),e}function B(e){return G(e)||X(e)}function D(e){return null!=e&&"blob:"===e.slice(0,5)}function H(e){return"data:"===e.slice(0,5)}function K(e){const t=Q(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}const z=/^data:(.*?)(;base64)?,(.*)$/;function Q(e){const t=e.match(z);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function V(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function Y(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function G(e){return null!=e&&void 0!==e&&"/"===e[0]&&"/"===e[1]}function X(e){return u.test(e)}function ee(e){return d.test(e)||"https"===v.scheme&&G(e)}function te(e){return G(e)?`https:${e}`:e.replace(f,"https:")}function re(){return"https"===v.scheme}function ne(e,t=!1){return G(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function oe(e){let t=0;if(B(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function se(e,t){if(!e)return"";const r=O(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(null==t||!t.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function ie(e){return e.replace(/\/+$/,"")}function ae(e,t,r){if(!(t&&r&&e&&B(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function ce(e){return"string"==typeof e?new y(L(e)):(e.scheme||(e.scheme=v.scheme),e)}function le(e,t){const r=O(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function ue(e,t,r){const n=O(e),o=n.query||{};return o[t]=String(r),`${n.path}?${S(o)}`}function fe(e,t){const r=O(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=S(n);return o?`${r.path}?${o}`:r.path}function de(e){if((0,i.Wi)(e))return null;const t=e.match(he);return t?t[1]:null}const he=/.*?\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(411),r.e(1534),r.e(3578),r.e(8961),r.e(7054),r.e(2781),r.e(966)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(8936)]).then(r.bind(r,18936)),ElevationSamplerWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(411),r.e(2781),r.e(6481),r.e(6459),r.e(3553)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(4588),r.e(411),r.e(1534),r.e(3485),r.e(3578),r.e(8961),r.e(7054),r.e(2781),r.e(5404)]).then(r.bind(r,2255)),GeoJSONSourceWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(411),r.e(1534),r.e(3578),r.e(8961),r.e(7054),r.e(2781),r.e(6348),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(411),r.e(1534),r.e(3578),r.e(8961),r.e(7054),r.e(2781),r.e(6348),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(8961),r.e(147)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(5638),r.e(4588),r.e(411),r.e(1534),r.e(3485),r.e(3578),r.e(8961),r.e(7054),r.e(2730),r.e(7783)]).then(r.bind(r,97783)),PointCloudWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(411),r.e(9294),r.e(9474)]).then(r.bind(r,16583)),RasterWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(411),r.e(176),r.e(8034)]).then(r.bind(r,61576)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(411),r.e(1534),r.e(3578),r.e(8961),r.e(7054),r.e(2781),r.e(6348),r.e(4556),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(2303),r.e(1785),r.e(6810),r.e(9872)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t){this._port=e,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r});return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const i=(0,c.jt)();return new Promise(((r,o)=>{const c=(0,a.$F)(n,(()=>{var e;const t=this._outJobs.get(i);t&&(this._outJobs.delete(i),null==(e=t.abortHandle)||e.remove(),this._post({type:d,jobId:i}),o((0,a.zE)()))})),l={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(i,l),this._post({type:h,jobId:i,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_close(){this._channel&&(this._channel=null),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{var t;null==(t=e.abortHandle)||t.remove(),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&-1!==t.indexOf(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e).type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){var t;const{jobId:r,error:n,data:s}=e,i=this._outJobs;if(!i.has(r))return;const a=i.get(r);i.delete(r),null==(t=a.abortHandle)||t.remove(),n?a.reject(o.Z.fromJSON(JSON.parse(n))):a.resolve(s)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{Cs:()=>n,jt:()=>a,oi:()=>l,QM:()=>u,AB:()=>c});var n,o,s=r(80442);(o=n||(n={}))[o.HANDSHAKE=0]="HANDSHAKE",o[o.OPEN=1]="OPEN",o[o.OPENED=2]="OPENED",o[o.RESPONSE=3]="RESPONSE",o[o.INVOKE=4]="INVOKE",o[o.ABORT=5]="ABORT",o[o.CLOSE=6]="CLOSE",o[o.OPEN_PORT=7]="OPEN_PORT",o[o.ON=8]="ON";let i=0;function a(){return i++}function c(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function l(e,t,r,o){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(s=f(o),t.data=r):(s=f(r.transferList),t.data=r.result),s?e.postMessage(t,s):e.postMessage(t)}function u(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function f(e){if(!e||!e.length)return null;if((0,s.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,id:()=>a,qh:()=>c,i8:()=>s,Nv:()=>i});var n=r(80442),o=r(17452);const s="4.23",i={async request(e,t){var n;const{default:s}=await r.e(3172).then(r.bind(r,3172)),i=e.options,a=i.responseType;i.signal=null==t?void 0:t.signal,i.responseType="native"===a||"native-request-init"===a?"native-request-init":["blob","json","text"].includes(a)&&null!=(n=(0,o.oh)(e.url))&&n.after?a:"array-buffer";const c=await s(e.url,i),l={data:c.data,ssl:c.ssl};switch(c.requestOptions.responseType){case"native-request-init":return delete l.data.signal,l;case"blob":l.data=await l.data.arrayBuffer();break;case"json":l.data=(new TextEncoder).encode(JSON.stringify(l.data)).buffer;break;case"text":l.data=(new TextEncoder).encode(l.data).buffer}return{result:l,transferList:[l.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")||((0,n.Z)("edge")||(0,n.Z)("trident"))&&console.warn("Deprecated browser - see http://esriurl.com/oldbrowser")},17202:(e,t,r)=>{"use strict";r.d(t,{r:()=>n,$:()=>o});const n="20211226",o="c887125d13bb041b154e53c69c1a29b37c518693"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{24:"4beba242e7540ee3182b",36:"a6ff3db3493543df81bc",102:"8697ed25dd992fb08069",147:"8b6ab6202a40fe622833",176:"b87bc1481a49b38109f4",223:"3aa4194dc5497c57647f",247:"a0450fbf01de854f5c97",280:"ea05f870dda27bca4fe8",368:"cb68db7169b9dfd1c3ff",402:"2c9af2ebd72d9b55329b",411:"32f8c4af7e70ebdcb19e",511:"da1c2873bdbc0956dca0",565:"d53ad780789f4d9124ad",576:"812a5abfadd747a09b6f",635:"f467c8f1fce22f6f599c",639:"b935d0c8d5951298cc53",755:"208a7e24e19fc5633dd7",819:"6280c69d87b2a3a18780",966:"f678293de9a6d8f5b5db",1074:"2d9b32e3e24631cd4e34",1412:"6db7081d344bea26ef64",1421:"7fa2d758a24bbaaab0bf",1433:"1def8845714ea745fd24",1534:"8ceac95537638dc9a322",1648:"f52b6d5037e4205b035c",1765:"904332faa22bc0e876cb",1773:"4d539878bfbd7c549e60",1785:"8298231a0fd0129b0d5c",2133:"0881ce46b10362861f87",2134:"070a78b488f92d022495",2303:"fe635f6dcfb146d80e89",2399:"96f148a556a2418038de",2515:"fff6b0338f06dad0c45d",2730:"010a71c2aa1b7681e191",2781:"ad7e9553d03a43573a54",2785:"c6bd943fe8fd13bb4806",2953:"5d4863a92b03bebc1b54",3027:"0c711b129d501b1d4439",3081:"da69e3e5949fe1716e34",3136:"cc96608b2802fbfe7a08",3172:"9c417740bf3707a0d465",3230:"7351fbd8a9dbef027d06",3307:"b5bb7cfa26b1f0cec67a",3437:"a721342a32541717324d",3471:"c11474b702dfb94e8e87",3485:"cfbffa429d88e7709c3f",3505:"9cdaba126ac7fa5f33f0",3516:"8f83bebef9174c3f15da",3529:"5005b8c1fdd5cb9a4c19",3553:"7c1b9ae141112a63b446",3578:"18668dc45eb9e35530df",3667:"0f04246c1b591a3ac74d",3668:"52e4c367c72ea7cc3457",3749:"c67fea81f69a60c0eaef",3792:"653d1550dd1a4867a9fc",3852:"62c683f44c297d239ab8",3942:"722a10c65456844d72b9",4166:"0c0a02770eeeb3e28ea1",4273:"642c38ac00a962f35d44",4358:"f977977564b2b75332a9",4369:"8a250ec51097f16feb66",4464:"86783c9b51dde845c24f",4470:"feeaf61424336e9eac88",4499:"8500c6c011400af1b7bd",4556:"44b01d42d4ec72913229",4579:"64459604505647e9c714",4588:"0cd583c3233573cb8468",4599:"99f0d896c17dd09cd285",4695:"14bef72154b3a19561a7",4720:"c984b3040e120e502b11",4816:"3d5169ea9810d10caf0d",4859:"65f73fbbc3c7c60c6d3d",4889:"1fd48459afb58a6cf14f",5051:"0d2effbd84a9482eb639",5404:"8b322a2a47dfdbb59b45",5410:"dd63ba77b7e4c3c9c594",5638:"ce5ca5e95b2378ec55b9",5732:"469ba1b24cdeea0758ec",5823:"22b09e276c9b9f22f0f8",5837:"42c67e6579b54844ec06",5845:"241859d74c0daac62e11",5853:"b2f62234ebb8b6158baa",6104:"3a20f66b0b7d08064e34",6233:"3fcb1a5aec640f9707e2",6237:"c544df83e86a9d36b68c",6348:"634b5ccd7a3ac67f855d",6401:"12df4f05de1262f9940f",6459:"3a2b2dc3e938d53faa30",6481:"e84b935c285888a892c1",6550:"573dc3064e84ca86844d",6570:"836a5a96156b91fb9dca",6678:"b313ab14a643273e7d09",6690:"4bfbf5a34c9207fdcf44",6710:"d688dd04d3a94e932ae1",6726:"bea1da9e3f878e0e2c83",6740:"23745a5ab47c840dc452",6748:"48d3a3abc53abe6a4017",6774:"4a830f056c4d0ed93928",6810:"411db587521e12c593be",6841:"36a3f6fb4d1d18fcb642",6968:"ba6fdaed6c315dc13981",7013:"9846098704ee38bf6350",7049:"331be347c1b1ca0be2d2",7054:"9b7c51ff3d2b42aa62f5",7091:"ed0297fc61014e848c18",7277:"dfa57982d28c9aeb97b9",7284:"5d8170f6207dbeb4de1b",7319:"b58eba403bd517a7bb15",7572:"615aa2d3ecafe30c80c0",7616:"d336afd5890dcdbf5341",7622:"445099d037affd139ed0",7668:"2f66fcb8670b108af549",7779:"39af317388ecebb4387d",7783:"6e13dab8ec43f7494297",7845:"8afae85018491491f773",7873:"93eb468381bfcf0e47d7",8014:"c32a4fbdc87225f84019",8034:"6deac533bb455be4004b",8062:"ff02295329a8986d0568",8121:"fd3e5d823dc7917f4b8f",8163:"d39b7983b68d6e5b404d",8209:"b8666d1a4e4fff7a4703",8216:"803de5097a8a2c4b58a8",8227:"1f394b20410fddb30a96",8422:"7aa543a97f055cddea99",8511:"45848fecec88ed2da33d",8536:"e5c9d8482b913cf3580a",8589:"daa9c450b2e2a5371249",8625:"bde1d5b0a7717350986e",8659:"1f8110ea12d65ca94b55",8683:"2a39d520b192b8e552b5",8758:"826c983100569586b61f",8828:"36de1a1959f038a61cca",8833:"b51261a9a9ab62388839",8846:"1ac6be0dc25e16c75d06",8936:"2025d0fd61a64876c81b",8961:"9796d54ff12b6429164a",9070:"2f8cf135b1116559659f",9101:"cd02fe27eb07681cb366",9151:"a247ddd84245c81112c8",9169:"f7ae0344257e6e08469b",9201:"39be2893a7dbdecfd65a",9254:"a9ffa806df20130ecfb6",9291:"9387db408f496e7dd003",9294:"75466e0c8c8da499b150",9296:"e01812116b27874948f0",9474:"0c3e3a5baf54bd5e210c",9490:"950565d1e682fc4072e1",9664:"fc7e31d87555beb63291",9767:"fbb67cb6224aed2cce16",9872:"eeadd92f0bede9fc8745",9884:"356db8b8297282c77291",9928:"ffaf091c6023225cf5aa",9932:"c1b6c31fa3ec1542f996",9938:"af13e534e4160636bd3d"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1,102:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
1
+ var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i}),r(80442);var n,o=r(78286),s=r(17202);const i={apiKey:void 0,applicationUrl:null==(n=globalThis.location)?void 0:n.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryService:null,geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,o.RH)(i,globalThis.esriConfig,!0),delete i.has),!i.assetsPath){const e="4.23.0";i.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${s.r}/assets`}i.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(i,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),i.request.corsEnabledServers=[],i.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof i))return new i(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=void 0,this instanceof o&&(this.message=t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(function(e,r){if(""===r)return"$";const o=(0,n.hS)(r,t),s=null==o?"":o;if(void 0===s)throw new Error(`could not find key "${r}" in template`);return s.toString()}))}(t,r)||"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=null==e?Math.random()*n._m:e}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{"use strict";r.d(t,{SO:()=>l,a9:()=>a,fS:()=>s,cq:()=>f,w6:()=>c,Od:()=>b,e$:()=>d,FY:()=>p});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}const i=!!Array.prototype.fill;function a(e,t){if(i)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function c(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class l{constructor(){this.last=0}}const u=new l;function f(e,t,r,n){n=n||u;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function d(e,t,r,n){const o=null==r?e.length:r,s=f(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const h=new Set;function p(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;h.clear();for(let e=0;e<n;++e)h.add(t[e]);o=o||u;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(h.has(e[t])&&(s&&s.push(e[t]),h.delete(e[t]),e[t]=e[r-1],--r,--t,0===h.size||0===r))return h.clear(),r;for(let t=0;t<i;++t)if(h.has(e[t])&&(s&&s.push(e[t]),h.delete(e[t]),e[t]=e[r-1],--r,--t,0===h.size||0===r))return h.clear(),r;return h.clear(),r}function b(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{vT:()=>n,on:()=>o,IH:()=>s})},80442:(e,t,r)=>{"use strict";var n,o;let s;var i,a;function c(e){return"function"==typeof s[e]?s[e]=s[e](globalThis):s[e]}r.d(t,{Z:()=>c}),s=null!=(n=globalThis.dojoConfig)&&n.has||null!=(o=globalThis.esriConfig)&&o.has?{...null==(i=globalThis.dojoConfig)?void 0:i.has,...null==(a=globalThis.esriConfig)?void 0:a.has}:{},c.add=(e,t,r,n)=>((n||void 0===s[e])&&(s[e]=t),r&&c(e)),c.cache=s,c.add("esri-deprecation-warnings",!0),(()=>{var e;c.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const t="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(c.add("host-browser",t),c.add("host-node","object"==typeof globalThis.process&&(null==(e=globalThis.process.versions)?void 0:e.node)&&globalThis.process.versions.v8),c.add("dom",t),c("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(c.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),c.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),c.add("khtml",r.includes("Konqueror")?n:void 0),c.add("edge",parseFloat(t.split("Edge/")[1])||void 0),c.add("opr",parseFloat(t.split("OPR/")[1])||void 0),c.add("webkit",!c("wp")&&!c("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),c.add("chrome",!c("edge")&&!c("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),c.add("android",!c("wp")&&parseFloat(t.split("Android ")[1])||void 0),c.add("safari",!r.includes("Safari")||c("wp")||c("chrome")||c("android")||c("edge")||c("opr")?void 0:parseFloat(r.split("Version/")[1])),c.add("mac",r.includes("Macintosh")),!c("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));c.add(e,n),c.add("ios",n)}c.add("trident",parseFloat(r.split("Trident/")[1])||void 0),c("webkit")||(!t.includes("Gecko")||c("wp")||c("khtml")||c("trident")||c("edge")||c.add("mozilla",n),c("mozilla")&&c.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&c.add("esri-mobile",t),r&&c.add("esri-iPhone",r),c.add("esri-geolocation",!!navigator.geolocation)}c.add("esri-canvas-svg-support",!c("trident")),c.add("esri-wasm","WebAssembly"in globalThis),c.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),c.add("esri-atomics","Atomics"in globalThis),c.add("esri-workers","Worker"in globalThis),c.add("web-feat:cache","caches"in globalThis),c.add("esri-workers-arraybuffer-transfer",!c("safari")||Number(c("safari"))>=12),c.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),c.add("featurelayer-simplify-payload-size-factors",[1,1,4]),c.add("featurelayer-snapshot-enabled",!0),c.add("featurelayer-snapshot-point-min-threshold",8e4),c.add("featurelayer-snapshot-point-max-threshold",4e5),c.add("featurelayer-snapshot-point-coverage",.1),c.add("featurelayer-advanced-symbols",!1),c.add("featurelayer-pbf",!0),c.add("featurelayer-pbf-statistics",!1),c.add("feature-layers-workers",!0),c.add("mapview-transitions-duration",200),c.add("mapserver-pbf-enabled",!1),c.add("vectortilelayer-max-buffers",c("ff")?160:Number.POSITIVE_INFINITY),c("host-webworker")||c("host-browser")&&(c.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),c.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{c.add("esri-image-decode",!0,!0,!0)})).catch((()=>{c.add("esri-image-decode",!1,!0,!0)}))}return!1})),c.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{d9:()=>i,fS:()=>d,yd:()=>s,Vo:()=>a}),r(67676),r(80442);var n=r(70586),o=r(1533);function s(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&s(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function i(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(c(e))return e.clone();if(l(e))return e.map(i);if(u(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=i(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(l(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(c(e))return e.clone();if(!u(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function f(e){if((0,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(e))return(0,o.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,i(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(i(e))})),t}return null}function d(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e){return void 0===e}function i(e,t){return n(e)?t(e):null}function a(e){return e}function c(e,t){if(o(e))throw new Error(t);return e}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e){return n(e)&&e.destroy(),null}function f(e){return n(e)&&e.dispose(),null}function d(e){return n(e)&&e.remove(),null}function h(e){return n(e)&&e.release(),null}function p(e){return null}function b(e,t){const r=new Array;for(const n of e)r.push(m(n,null,t));return r}function g(e,t){for(const r of e)m(r,null,t)}function m(e,t,r){return n(e)?r(e):t}function y(e,t){return n(e)?t(e):null}function v(e){return e.filter((e=>n(e)))}function w(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function _(e){return e}r.d(t,{Po:()=>y,yw:()=>i,j0:()=>_,SC:()=>u,O3:()=>f,lV:()=>v,JR:()=>g,U2:()=>w,Wi:()=>o,pC:()=>n,o8:()=>s,Fd:()=>b,R2:()=>m,Bd:()=>p,RY:()=>h,hw:()=>d,Wg:()=>a,Pt:()=>l,s3:()=>c})},78286:(e,t,r)=>{"use strict";r.d(t,{RH:()=>o,hS:()=>s,RB:()=>i});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce((function(e,o){let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{-1===s.indexOf(e)&&s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>C,$6:()=>c,Ue:()=>l,zE:()=>u,dD:()=>_,hh:()=>T,vr:()=>j,Ds:()=>x,as:()=>O,WW:()=>P,R8:()=>w,D_:()=>v,Hc:()=>h,y8:()=>E,fu:()=>g,$F:()=>m,d1:()=>k,DB:()=>S,r9:()=>p,k_:()=>f,H9:()=>b,Yn:()=>M,gx:()=>A,Hl:()=>y});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o,s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e){return Promise.all(e)}function l(e){return new Promise(((t,r)=>{try{e(t,r)}catch(e){Promise.resolve().then((()=>r(e)))}}))}function u(e="Aborted"){return new s.Z("AbortError",e)}function f(e,t="Aborted"){if(h(e))throw u(t)}function d(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function h(e){const t=d(e);return(0,a.pC)(t)&&t.aborted}function p(e){if(v(e))throw e}function b(e){if(!v(e))throw e}function g(e,t){const r=d(e);if(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function m(e,t){const r=d(e);if(!(0,a.Wi)(r))return f(r),(0,i.IH)(r,"abort",(()=>t(u())))}function y(e,t){const r=d(t);return(0,a.Wi)(r)?e:new Promise(((r,n)=>{let o=g(t,(()=>n(u())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function v(e){return e&&"AbortError"===e.name}function w(e){return e.catch((e=>{if(!v(e))throw e}))}function _(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}function O(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e);return O(t.map((t=>e[t]))).then((e=>{const r={};return t.forEach(((t,n)=>r[t]=e[n])),r}))}const t=e;return l((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}function P(e){return O(e).then((e=>e.filter((e=>!!e.value)).map((e=>e.value))))}function k(e){return Promise.reject(e)}function S(e){return Promise.resolve(e)}function C(e,t,r){const n=new AbortController;return g(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);g(n,(()=>{s&&(clearTimeout(s),o(u()))}))}))}function E(e){return e&&"function"==typeof e.then}function A(e){return E(e)?e:Promise.resolve(e)}function x(e,t=-1){let r,n,o,s,i=null;const c=(...l)=>{if(r){n=l,s&&s.reject(u()),s=_();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||_(),s=null,t>0){const n=new AbortController;r=A(e(...l,n.signal));const o=r;C(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=A(e(...l));const f=()=>{const e=n;n=o=r=i=null,null!=e&&c(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return c}function T(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}function j(e,t){let r,n=new AbortController;const o=e(n.signal);let s={promise:o,finished:!1,abort:()=>{n&&(n.abort(),n=null)}};const i=()=>{s&&(s.finished=!0,s=null),(0,a.pC)(r)&&(r.remove(),r=null),n=null};return o.then(i,i),r=g(t,(()=>{(0,a.pC)(s)&&s.abort()})),s}function M(e){return Promise.resolve().then((()=>{f(e)}))}},19153:(e,t,r)=>{"use strict";r.d(t,{Qs:()=>a,hP:()=>c,gx:()=>i,Cb:()=>l});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return null==e?"":e}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&-1!==t.indexOf(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,eP:()=>s,xZ:()=>h,fS:()=>p,z3:()=>l,Hx:()=>f,W0:()=>i,Uc:()=>u,ZY:()=>d,lq:()=>a,KZ:()=>c,tP:()=>o})},17452:(e,t,r)=>{"use strict";r.d(t,{R9:()=>y,qg:()=>E,tD:()=>j,ZN:()=>ue,fl:()=>fe,AX:()=>_,Gd:()=>v,Ie:()=>ae,sJ:()=>Q,AH:()=>K,io:()=>Y,vt:()=>se,oh:()=>N,P$:()=>Z,Ml:()=>de,ed:()=>M,b7:()=>C,D6:()=>R,tm:()=>$,YP:()=>B,jc:()=>D,HK:()=>H,$U:()=>ee,oC:()=>G,kl:()=>U,v_:()=>F,hF:()=>L,_l:()=>V,PF:()=>J,Fv:()=>q,B7:()=>S,u0:()=>P,Yd:()=>oe,Hu:()=>le,Qj:()=>ie,hO:()=>te,mN:()=>O});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const v=new y(n.Z.applicationUrl),w={},_=(()=>{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}`})();function O(e){const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=P(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function P(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function k(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function S(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>k(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):k(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function C(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ee(e);const n=M(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&re()&&(r=te(r)),O(r)}function E(e){const t=M(e);let r,n;if(t){const e=x(t.proxyUrl);r=e.path,n=e.query?P(e.query):null}if(r){const t=O(e);e=r+"?"+t.path;const o=S({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const A={path:"",query:""};function x(e){const t=e.indexOf("?");return-1!==t?(A.path=e.slice(0,t),A.query=e.slice(t+1)):(A.path=e,A.query=null),A}function T(e){return(e=ne(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=x(e).path),!0)).toLowerCase()}function j(e){const t={proxyUrl:e.proxyUrl,urlPrefix:T(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function M(e){const t=c.proxyRules,r=T(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function $(e,t){return e=I(e),t=I(t),ne(e)===ne(t)}function I(e){const t=(e=q(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function N(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function R(e,t,r=!1){const n=ce(e),o=ce(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function U(e){if("string"==typeof e){if(!B(e))return!0;e=ce(e)}if(R(e,v))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=W(t[r]);for(let t=0;t<n.length;t++)if(R(e,n[t]))return!0}return!1}function W(e){return w[e]||(X(e)||G(e)?w[e]=[new y(L(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function L(e,t=_,r){return G(e)?r&&r.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===Z(e).slice(2)?`http:${e}`:`https:${e}`:X(e)?e:(0,i.j0)(F("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function J(e,t=_,r){if(!B(e))return e;const n=q(e),o=n.toLowerCase(),s=q(t).toLowerCase().replace(/\/+$/,""),i=r?q(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function q(e){return function(e){const t=c.httpsDomains;if(!function(e){return f.test(e)||"http"===v.scheme&&G(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&n===v.authority&&!b.test(e)||(re()&&n===v.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||re()&&!M(e))&&(e=te(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=x(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=L(e=e.trim()))))}function F(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(B(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function Z(e,t=!1){if(D(e)||H(e))return null;let r=e.indexOf("://");if(-1===r&&G(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ne(e,!0)),e}function B(e){return G(e)||X(e)}function D(e){return null!=e&&"blob:"===e.slice(0,5)}function H(e){return"data:"===e.slice(0,5)}function K(e){const t=Q(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}const z=/^data:(.*?)(;base64)?,(.*)$/;function Q(e){const t=e.match(z);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function V(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function Y(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function G(e){return null!=e&&void 0!==e&&"/"===e[0]&&"/"===e[1]}function X(e){return u.test(e)}function ee(e){return d.test(e)||"https"===v.scheme&&G(e)}function te(e){return G(e)?`https:${e}`:e.replace(f,"https:")}function re(){return"https"===v.scheme}function ne(e,t=!1){return G(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function oe(e){let t=0;if(B(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function se(e,t){if(!e)return"";const r=O(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(null==t||!t.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function ie(e){return e.replace(/\/+$/,"")}function ae(e,t,r){if(!(t&&r&&e&&B(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function ce(e){return"string"==typeof e?new y(L(e)):(e.scheme||(e.scheme=v.scheme),e)}function le(e,t){const r=O(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function ue(e,t,r){const n=O(e),o=n.query||{};return o[t]=String(r),`${n.path}?${S(o)}`}function fe(e,t){const r=O(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=S(n);return o?`${r.path}?${o}`:r.path}function de(e){if((0,i.Wi)(e))return null;const t=e.match(he);return t?t[1]:null}const he=/.*?\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(411),r.e(1534),r.e(3578),r.e(8961),r.e(7054),r.e(2781),r.e(966)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(8936)]).then(r.bind(r,18936)),ElevationSamplerWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(411),r.e(2781),r.e(6481),r.e(6459),r.e(3553)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(4588),r.e(411),r.e(1534),r.e(3485),r.e(3578),r.e(8961),r.e(7054),r.e(2781),r.e(5404)]).then(r.bind(r,2255)),GeoJSONSourceWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(411),r.e(1534),r.e(3578),r.e(8961),r.e(7054),r.e(2781),r.e(6348),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(411),r.e(1534),r.e(3578),r.e(8961),r.e(7054),r.e(2781),r.e(6348),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(8961),r.e(147)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(5638),r.e(4588),r.e(411),r.e(1534),r.e(3485),r.e(3578),r.e(8961),r.e(7054),r.e(2730),r.e(7783)]).then(r.bind(r,97783)),PointCloudWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(411),r.e(9294),r.e(9474)]).then(r.bind(r,16583)),RasterWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(411),r.e(176),r.e(8034)]).then(r.bind(r,61576)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(2785),r.e(6570),r.e(9928),r.e(2303),r.e(7668),r.e(411),r.e(1534),r.e(3578),r.e(8961),r.e(7054),r.e(2781),r.e(6348),r.e(4556),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(2303),r.e(1785),r.e(6810),r.e(9872)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t){this._port=e,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r});return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const i=(0,c.jt)();return new Promise(((r,o)=>{const c=(0,a.$F)(n,(()=>{var e;const t=this._outJobs.get(i);t&&(this._outJobs.delete(i),null==(e=t.abortHandle)||e.remove(),this._post({type:d,jobId:i}),o((0,a.zE)()))})),l={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(i,l),this._post({type:h,jobId:i,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_close(){this._channel&&(this._channel=null),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{var t;null==(t=e.abortHandle)||t.remove(),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&-1!==t.indexOf(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e).type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){var t;const{jobId:r,error:n,data:s}=e,i=this._outJobs;if(!i.has(r))return;const a=i.get(r);i.delete(r),null==(t=a.abortHandle)||t.remove(),n?a.reject(o.Z.fromJSON(JSON.parse(n))):a.resolve(s)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{Cs:()=>n,jt:()=>a,oi:()=>l,QM:()=>u,AB:()=>c});var n,o,s=r(80442);(o=n||(n={}))[o.HANDSHAKE=0]="HANDSHAKE",o[o.OPEN=1]="OPEN",o[o.OPENED=2]="OPENED",o[o.RESPONSE=3]="RESPONSE",o[o.INVOKE=4]="INVOKE",o[o.ABORT=5]="ABORT",o[o.CLOSE=6]="CLOSE",o[o.OPEN_PORT=7]="OPEN_PORT",o[o.ON=8]="ON";let i=0;function a(){return i++}function c(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function l(e,t,r,o){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(s=f(o),t.data=r):(s=f(r.transferList),t.data=r.result),s?e.postMessage(t,s):e.postMessage(t)}function u(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function f(e){if(!e||!e.length)return null;if((0,s.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,id:()=>a,qh:()=>c,i8:()=>s,Nv:()=>i});var n=r(80442),o=r(17452);const s="4.23",i={async request(e,t){var n;const{default:s}=await r.e(3172).then(r.bind(r,3172)),i=e.options,a=i.responseType;i.signal=null==t?void 0:t.signal,i.responseType="native"===a||"native-request-init"===a?"native-request-init":["blob","json","text"].includes(a)&&null!=(n=(0,o.oh)(e.url))&&n.after?a:"array-buffer";const c=await s(e.url,i),l={data:c.data,ssl:c.ssl};switch(c.requestOptions.responseType){case"native-request-init":return delete l.data.signal,l;case"blob":l.data=await l.data.arrayBuffer();break;case"json":l.data=(new TextEncoder).encode(JSON.stringify(l.data)).buffer;break;case"text":l.data=(new TextEncoder).encode(l.data).buffer}return{result:l,transferList:[l.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")||((0,n.Z)("edge")||(0,n.Z)("trident"))&&console.warn("Deprecated browser - see http://esriurl.com/oldbrowser")},17202:(e,t,r)=>{"use strict";r.d(t,{r:()=>n,$:()=>o});const n="20211230",o="031184be9af0675d8af42e28a660b33eadfe73b6"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{24:"4beba242e7540ee3182b",36:"a6ff3db3493543df81bc",102:"46b6262703dc7dd2f33f",147:"8b6ab6202a40fe622833",176:"b87bc1481a49b38109f4",223:"3aa4194dc5497c57647f",247:"a0450fbf01de854f5c97",280:"ea05f870dda27bca4fe8",368:"cb68db7169b9dfd1c3ff",402:"2c9af2ebd72d9b55329b",411:"32f8c4af7e70ebdcb19e",511:"da1c2873bdbc0956dca0",565:"d53ad780789f4d9124ad",576:"812a5abfadd747a09b6f",635:"f467c8f1fce22f6f599c",639:"b935d0c8d5951298cc53",755:"208a7e24e19fc5633dd7",819:"6280c69d87b2a3a18780",966:"f678293de9a6d8f5b5db",1074:"2d9b32e3e24631cd4e34",1412:"6db7081d344bea26ef64",1421:"7fa2d758a24bbaaab0bf",1433:"1def8845714ea745fd24",1534:"8ceac95537638dc9a322",1648:"f52b6d5037e4205b035c",1765:"904332faa22bc0e876cb",1773:"4d539878bfbd7c549e60",1785:"8298231a0fd0129b0d5c",2133:"0881ce46b10362861f87",2134:"070a78b488f92d022495",2303:"fe635f6dcfb146d80e89",2399:"96f148a556a2418038de",2515:"fff6b0338f06dad0c45d",2730:"010a71c2aa1b7681e191",2781:"ad7e9553d03a43573a54",2785:"c6bd943fe8fd13bb4806",2953:"5d4863a92b03bebc1b54",3027:"0c711b129d501b1d4439",3081:"da69e3e5949fe1716e34",3136:"cc96608b2802fbfe7a08",3172:"9c417740bf3707a0d465",3230:"7351fbd8a9dbef027d06",3307:"b5bb7cfa26b1f0cec67a",3437:"a721342a32541717324d",3471:"c11474b702dfb94e8e87",3485:"cfbffa429d88e7709c3f",3505:"9cdaba126ac7fa5f33f0",3516:"8f83bebef9174c3f15da",3529:"5005b8c1fdd5cb9a4c19",3553:"7c1b9ae141112a63b446",3578:"18668dc45eb9e35530df",3667:"0f04246c1b591a3ac74d",3668:"52e4c367c72ea7cc3457",3749:"c67fea81f69a60c0eaef",3792:"653d1550dd1a4867a9fc",3852:"62c683f44c297d239ab8",3942:"722a10c65456844d72b9",4166:"0c0a02770eeeb3e28ea1",4273:"642c38ac00a962f35d44",4358:"f977977564b2b75332a9",4369:"8a250ec51097f16feb66",4464:"86783c9b51dde845c24f",4470:"feeaf61424336e9eac88",4499:"8500c6c011400af1b7bd",4556:"44b01d42d4ec72913229",4579:"64459604505647e9c714",4588:"0cd583c3233573cb8468",4599:"99f0d896c17dd09cd285",4695:"14bef72154b3a19561a7",4720:"c984b3040e120e502b11",4816:"3d5169ea9810d10caf0d",4859:"65f73fbbc3c7c60c6d3d",4889:"1fd48459afb58a6cf14f",5051:"0d2effbd84a9482eb639",5404:"8b322a2a47dfdbb59b45",5410:"dd63ba77b7e4c3c9c594",5638:"ce5ca5e95b2378ec55b9",5732:"469ba1b24cdeea0758ec",5823:"22b09e276c9b9f22f0f8",5837:"42c67e6579b54844ec06",5845:"241859d74c0daac62e11",5853:"b2f62234ebb8b6158baa",6104:"3a20f66b0b7d08064e34",6233:"3fcb1a5aec640f9707e2",6237:"c544df83e86a9d36b68c",6348:"634b5ccd7a3ac67f855d",6401:"12df4f05de1262f9940f",6459:"3a2b2dc3e938d53faa30",6481:"e84b935c285888a892c1",6550:"573dc3064e84ca86844d",6570:"836a5a96156b91fb9dca",6678:"b313ab14a643273e7d09",6690:"4bfbf5a34c9207fdcf44",6710:"d688dd04d3a94e932ae1",6726:"bea1da9e3f878e0e2c83",6740:"23745a5ab47c840dc452",6748:"48d3a3abc53abe6a4017",6774:"4a830f056c4d0ed93928",6810:"411db587521e12c593be",6841:"36a3f6fb4d1d18fcb642",6968:"ba6fdaed6c315dc13981",7013:"9846098704ee38bf6350",7049:"331be347c1b1ca0be2d2",7054:"9b7c51ff3d2b42aa62f5",7091:"ed0297fc61014e848c18",7277:"dfa57982d28c9aeb97b9",7284:"5d8170f6207dbeb4de1b",7319:"b58eba403bd517a7bb15",7572:"615aa2d3ecafe30c80c0",7616:"d336afd5890dcdbf5341",7622:"445099d037affd139ed0",7668:"2f66fcb8670b108af549",7779:"39af317388ecebb4387d",7783:"6e13dab8ec43f7494297",7845:"8afae85018491491f773",7873:"93eb468381bfcf0e47d7",8014:"c32a4fbdc87225f84019",8034:"6deac533bb455be4004b",8062:"ff02295329a8986d0568",8121:"fd3e5d823dc7917f4b8f",8163:"d39b7983b68d6e5b404d",8209:"b8666d1a4e4fff7a4703",8216:"803de5097a8a2c4b58a8",8227:"1f394b20410fddb30a96",8422:"7aa543a97f055cddea99",8511:"45848fecec88ed2da33d",8536:"e5c9d8482b913cf3580a",8589:"daa9c450b2e2a5371249",8625:"bde1d5b0a7717350986e",8659:"1f8110ea12d65ca94b55",8683:"2a39d520b192b8e552b5",8758:"826c983100569586b61f",8828:"36de1a1959f038a61cca",8833:"b51261a9a9ab62388839",8846:"1ac6be0dc25e16c75d06",8936:"2025d0fd61a64876c81b",8961:"9796d54ff12b6429164a",9070:"2f8cf135b1116559659f",9101:"cd02fe27eb07681cb366",9151:"a247ddd84245c81112c8",9169:"f7ae0344257e6e08469b",9201:"39be2893a7dbdecfd65a",9254:"a9ffa806df20130ecfb6",9291:"9387db408f496e7dd003",9294:"75466e0c8c8da499b150",9296:"e01812116b27874948f0",9474:"0c3e3a5baf54bd5e210c",9490:"950565d1e682fc4072e1",9664:"fc7e31d87555beb63291",9767:"fbb67cb6224aed2cce16",9872:"eeadd92f0bede9fc8745",9884:"356db8b8297282c77291",9928:"ffaf091c6023225cf5aa",9932:"c1b6c31fa3ec1542f996",9938:"af13e534e4160636bd3d"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1,102:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[102],{68773:(e,t,r)=>{r.d(t,{Z:()=>s}),r(80442);var n,o=r(78286),i=r(17202);const s={apiKey:void 0,applicationUrl:null==(n=globalThis.location)?void 0:n.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryService:null,geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,o.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.23.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${i.r}/assets`}s.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(s,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),s.request.corsEnabledServers=[],s.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0}},20102:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(22974),o=r(92604),i=r(58896);class s extends i.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof s))return new s(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new s(e.name,e.message,e.details)}}s.prototype.type="error"},92604:(e,t,r)=>{r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),i=r(19153);const s={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return s[this._parentWithMember("level",t)]<=s[e]}_argsToKey(...e){return(0,i.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=void 0,this instanceof o&&(this.message=t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(function(e,r){if(""===r)return"$";const o=(0,n.hS)(r,t),i=null==o?"":o;if(void 0===i)throw new Error(`could not find key "${r}" in template`);return i.toString()}))}(t,r)||"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=null==e?Math.random()*n._m:e}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{r.d(t,{SO:()=>c,a9:()=>a,fS:()=>i,cq:()=>d,w6:()=>l,Od:()=>p,e$:()=>f,FY:()=>g});var n=r(70586),o=r(77734);function i(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}const s=!!Array.prototype.fill;function a(e,t){if(s)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function l(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class c{constructor(){this.last=0}}const u=new c;function d(e,t,r,n){n=n||u;const o=Math.max(0,n.last-10);for(let i=o;i<r;++i)if(e[i]===t)return n.last=i,i;const i=Math.min(o,r);for(let r=0;r<i;++r)if(e[r]===t)return n.last=r,r;return-1}function f(e,t,r,n){const o=null==r?e.length:r,i=d(e,t,o,n);if(-1!==i)return e[i]=e[o-1],null==r&&e.pop(),t}const h=new Set;function g(e,t,r=e.length,n=t.length,o,i){if(0===n||0===r)return r;h.clear();for(let e=0;e<n;++e)h.add(t[e]);o=o||u;const s=Math.max(0,o.last-10);for(let t=s;t<r;++t)if(h.has(e[t])&&(i&&i.push(e[t]),h.delete(e[t]),e[t]=e[r-1],--r,--t,0===h.size||0===r))return h.clear(),r;for(let t=0;t<s;++t)if(h.has(e[t])&&(i&&i.push(e[t]),h.delete(e[t]),e[t]=e[r-1],--r,--t,0===h.size||0===r))return h.clear(),r;return h.clear(),r}function p(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},80442:(e,t,r)=>{var n,o;let i;var s,a;function l(e){return"function"==typeof i[e]?i[e]=i[e](globalThis):i[e]}r.d(t,{Z:()=>l}),i=null!=(n=globalThis.dojoConfig)&&n.has||null!=(o=globalThis.esriConfig)&&o.has?{...null==(s=globalThis.dojoConfig)?void 0:s.has,...null==(a=globalThis.esriConfig)?void 0:a.has}:{},l.add=(e,t,r,n)=>((n||void 0===i[e])&&(i[e]=t),r&&l(e)),l.cache=i,l.add("esri-deprecation-warnings",!0),(()=>{var e;l.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const t="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(l.add("host-browser",t),l.add("host-node","object"==typeof globalThis.process&&(null==(e=globalThis.process.versions)?void 0:e.node)&&globalThis.process.versions.v8),l.add("dom",t),l("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(l.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),l.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),l.add("khtml",r.includes("Konqueror")?n:void 0),l.add("edge",parseFloat(t.split("Edge/")[1])||void 0),l.add("opr",parseFloat(t.split("OPR/")[1])||void 0),l.add("webkit",!l("wp")&&!l("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),l.add("chrome",!l("edge")&&!l("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),l.add("android",!l("wp")&&parseFloat(t.split("Android ")[1])||void 0),l.add("safari",!r.includes("Safari")||l("wp")||l("chrome")||l("android")||l("edge")||l("opr")?void 0:parseFloat(r.split("Version/")[1])),l.add("mac",r.includes("Macintosh")),!l("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));l.add(e,n),l.add("ios",n)}l.add("trident",parseFloat(r.split("Trident/")[1])||void 0),l("webkit")||(!t.includes("Gecko")||l("wp")||l("khtml")||l("trident")||l("edge")||l.add("mozilla",n),l("mozilla")&&l.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&l.add("esri-mobile",t),r&&l.add("esri-iPhone",r),l.add("esri-geolocation",!!navigator.geolocation)}l.add("esri-canvas-svg-support",!l("trident")),l.add("esri-wasm","WebAssembly"in globalThis),l.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),l.add("esri-atomics","Atomics"in globalThis),l.add("esri-workers","Worker"in globalThis),l.add("web-feat:cache","caches"in globalThis),l.add("esri-workers-arraybuffer-transfer",!l("safari")||Number(l("safari"))>=12),l.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),l.add("featurelayer-simplify-payload-size-factors",[1,1,4]),l.add("featurelayer-snapshot-enabled",!0),l.add("featurelayer-snapshot-point-min-threshold",8e4),l.add("featurelayer-snapshot-point-max-threshold",4e5),l.add("featurelayer-snapshot-point-coverage",.1),l.add("featurelayer-advanced-symbols",!1),l.add("featurelayer-pbf",!0),l.add("featurelayer-pbf-statistics",!1),l.add("feature-layers-workers",!0),l.add("mapview-transitions-duration",200),l.add("mapserver-pbf-enabled",!1),l.add("vectortilelayer-max-buffers",l("ff")?160:Number.POSITIVE_INFINITY),l("host-webworker")||l("host-browser")&&(l.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),l.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((()=>{l.add("esri-image-decode",!0,!0,!0)})).catch((()=>{l.add("esri-image-decode",!1,!0,!0)}))}return!1})),l.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{r.d(t,{d9:()=>s,fS:()=>f,yd:()=>i,Vo:()=>a}),r(67676),r(80442);var n=r(70586),o=r(1533);function i(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&i(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function s(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=d(e);if((0,n.pC)(t))return t;if(l(e))return e.clone();if(c(e))return e.map(s);if(u(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=s(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=d(e);if((0,n.pC)(t))return t;if(c(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(l(e))return e.clone();if(!u(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function l(e){return"function"==typeof e.clone}function c(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if((0,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(e))return(0,o.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,s(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(s(e))})),t}return null}function f(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}},70586:(e,t,r)=>{function n(e){return null!=e}function o(e){return null==e}function i(e){return void 0===e}function s(e,t){return n(e)?t(e):null}function a(e){return e}function l(e,t){if(o(e))throw new Error(t);return e}function c(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function f(e){return n(e)&&e.remove(),null}function h(e){return n(e)&&e.release(),null}function g(e){return null}function p(e,t){const r=new Array;for(const n of e)r.push(y(n,null,t));return r}function m(e,t){for(const r of e)y(r,null,t)}function y(e,t,r){return n(e)?r(e):t}function w(e,t){return n(e)?t(e):null}function b(e){return e.filter((e=>n(e)))}function v(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function _(e){return e}r.d(t,{Po:()=>w,yw:()=>s,j0:()=>_,SC:()=>u,O3:()=>d,lV:()=>b,JR:()=>m,U2:()=>v,Wi:()=>o,pC:()=>n,o8:()=>i,Fd:()=>p,R2:()=>y,Bd:()=>g,RY:()=>h,hw:()=>f,Wg:()=>a,Pt:()=>c,s3:()=>l})},78286:(e,t,r)=>{r.d(t,{RH:()=>o,hS:()=>i,RB:()=>s});var n=r(22974);function o(e,t,r=!1){return l(e,t,r)}function i(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function s(e,t,r){const n=e.split("."),o=n.pop(),i=a(n,!0,r);i&&o&&(i[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function l(e,t,r){return t?Object.keys(t).reduce((function(e,o){let i=e[o],s=t[o];return i===s?e:void 0===i?(e[o]=(0,n.d9)(s),e):(Array.isArray(s)||Array.isArray(e)?(i=i?Array.isArray(i)?e[o]=i.concat():e[o]=[i]:e[o]=[],s&&(Array.isArray(s)||(s=[s]),r?s.forEach((e=>{-1===i.indexOf(e)&&i.push(e)})):e[o]=s.concat())):s&&"object"==typeof s?e[o]=l(i,s,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=s),e)}),e||{}):e}},19153:(e,t,r)=>{r.d(t,{Qs:()=>a,hP:()=>l,gx:()=>s,Cb:()=>c});var n=r(78286);const o=/\{([^\}]+)\}/g;function i(e){return null==e?"":e}function s(e,t){return e.replace(o,"object"==typeof t?(e,r)=>i((0,n.hS)(r,t)):(e,r)=>i(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&-1!==t.indexOf(e)?e:`\\${e}`))}function l(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function c(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function i(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function s(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 l(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function c(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 d(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function f(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 g(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,eP:()=>i,xZ:()=>h,fS:()=>g,z3:()=>c,Hx:()=>d,W0:()=>s,Uc:()=>u,ZY:()=>f,lq:()=>a,KZ:()=>l,tP:()=>o})},17202:(e,t,r)=>{r.d(t,{r:()=>n,$:()=>o});const n="20211226",o="c887125d13bb041b154e53c69c1a29b37c518693"}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[102],{68773:(e,t,r)=>{r.d(t,{Z:()=>s}),r(80442);var n,o=r(78286),i=r(17202);const s={apiKey:void 0,applicationUrl:null==(n=globalThis.location)?void 0:n.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryService:null,geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,o.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.23.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${i.r}/assets`}s.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(s,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),s.request.corsEnabledServers=[],s.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0}},20102:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(22974),o=r(92604),i=r(58896);class s extends i.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof s))return new s(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new s(e.name,e.message,e.details)}}s.prototype.type="error"},92604:(e,t,r)=>{r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),i=r(19153);const s={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return s[this._parentWithMember("level",t)]<=s[e]}_argsToKey(...e){return(0,i.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=void 0,this instanceof o&&(this.message=t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(function(e,r){if(""===r)return"$";const o=(0,n.hS)(r,t),i=null==o?"":o;if(void 0===i)throw new Error(`could not find key "${r}" in template`);return i.toString()}))}(t,r)||"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=null==e?Math.random()*n._m:e}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{r.d(t,{SO:()=>c,a9:()=>a,fS:()=>i,cq:()=>d,w6:()=>l,Od:()=>p,e$:()=>f,FY:()=>g});var n=r(70586),o=r(77734);function i(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}const s=!!Array.prototype.fill;function a(e,t){if(s)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function l(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class c{constructor(){this.last=0}}const u=new c;function d(e,t,r,n){n=n||u;const o=Math.max(0,n.last-10);for(let i=o;i<r;++i)if(e[i]===t)return n.last=i,i;const i=Math.min(o,r);for(let r=0;r<i;++r)if(e[r]===t)return n.last=r,r;return-1}function f(e,t,r,n){const o=null==r?e.length:r,i=d(e,t,o,n);if(-1!==i)return e[i]=e[o-1],null==r&&e.pop(),t}const h=new Set;function g(e,t,r=e.length,n=t.length,o,i){if(0===n||0===r)return r;h.clear();for(let e=0;e<n;++e)h.add(t[e]);o=o||u;const s=Math.max(0,o.last-10);for(let t=s;t<r;++t)if(h.has(e[t])&&(i&&i.push(e[t]),h.delete(e[t]),e[t]=e[r-1],--r,--t,0===h.size||0===r))return h.clear(),r;for(let t=0;t<s;++t)if(h.has(e[t])&&(i&&i.push(e[t]),h.delete(e[t]),e[t]=e[r-1],--r,--t,0===h.size||0===r))return h.clear(),r;return h.clear(),r}function p(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},80442:(e,t,r)=>{var n,o;let i;var s,a;function l(e){return"function"==typeof i[e]?i[e]=i[e](globalThis):i[e]}r.d(t,{Z:()=>l}),i=null!=(n=globalThis.dojoConfig)&&n.has||null!=(o=globalThis.esriConfig)&&o.has?{...null==(s=globalThis.dojoConfig)?void 0:s.has,...null==(a=globalThis.esriConfig)?void 0:a.has}:{},l.add=(e,t,r,n)=>((n||void 0===i[e])&&(i[e]=t),r&&l(e)),l.cache=i,l.add("esri-deprecation-warnings",!0),(()=>{var e;l.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const t="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(l.add("host-browser",t),l.add("host-node","object"==typeof globalThis.process&&(null==(e=globalThis.process.versions)?void 0:e.node)&&globalThis.process.versions.v8),l.add("dom",t),l("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(l.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),l.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),l.add("khtml",r.includes("Konqueror")?n:void 0),l.add("edge",parseFloat(t.split("Edge/")[1])||void 0),l.add("opr",parseFloat(t.split("OPR/")[1])||void 0),l.add("webkit",!l("wp")&&!l("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),l.add("chrome",!l("edge")&&!l("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),l.add("android",!l("wp")&&parseFloat(t.split("Android ")[1])||void 0),l.add("safari",!r.includes("Safari")||l("wp")||l("chrome")||l("android")||l("edge")||l("opr")?void 0:parseFloat(r.split("Version/")[1])),l.add("mac",r.includes("Macintosh")),!l("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));l.add(e,n),l.add("ios",n)}l.add("trident",parseFloat(r.split("Trident/")[1])||void 0),l("webkit")||(!t.includes("Gecko")||l("wp")||l("khtml")||l("trident")||l("edge")||l.add("mozilla",n),l("mozilla")&&l.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&l.add("esri-mobile",t),r&&l.add("esri-iPhone",r),l.add("esri-geolocation",!!navigator.geolocation)}l.add("esri-canvas-svg-support",!l("trident")),l.add("esri-wasm","WebAssembly"in globalThis),l.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),l.add("esri-atomics","Atomics"in globalThis),l.add("esri-workers","Worker"in globalThis),l.add("web-feat:cache","caches"in globalThis),l.add("esri-workers-arraybuffer-transfer",!l("safari")||Number(l("safari"))>=12),l.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),l.add("featurelayer-simplify-payload-size-factors",[1,1,4]),l.add("featurelayer-snapshot-enabled",!0),l.add("featurelayer-snapshot-point-min-threshold",8e4),l.add("featurelayer-snapshot-point-max-threshold",4e5),l.add("featurelayer-snapshot-point-coverage",.1),l.add("featurelayer-advanced-symbols",!1),l.add("featurelayer-pbf",!0),l.add("featurelayer-pbf-statistics",!1),l.add("feature-layers-workers",!0),l.add("mapview-transitions-duration",200),l.add("mapserver-pbf-enabled",!1),l.add("vectortilelayer-max-buffers",l("ff")?160:Number.POSITIVE_INFINITY),l("host-webworker")||l("host-browser")&&(l.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),l.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((()=>{l.add("esri-image-decode",!0,!0,!0)})).catch((()=>{l.add("esri-image-decode",!1,!0,!0)}))}return!1})),l.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{r.d(t,{d9:()=>s,fS:()=>f,yd:()=>i,Vo:()=>a}),r(67676),r(80442);var n=r(70586),o=r(1533);function i(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&i(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function s(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=d(e);if((0,n.pC)(t))return t;if(l(e))return e.clone();if(c(e))return e.map(s);if(u(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=s(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=d(e);if((0,n.pC)(t))return t;if(c(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(l(e))return e.clone();if(!u(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function l(e){return"function"==typeof e.clone}function c(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if((0,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(e))return(0,o.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,s(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(s(e))})),t}return null}function f(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}},70586:(e,t,r)=>{function n(e){return null!=e}function o(e){return null==e}function i(e){return void 0===e}function s(e,t){return n(e)?t(e):null}function a(e){return e}function l(e,t){if(o(e))throw new Error(t);return e}function c(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function f(e){return n(e)&&e.remove(),null}function h(e){return n(e)&&e.release(),null}function g(e){return null}function p(e,t){const r=new Array;for(const n of e)r.push(y(n,null,t));return r}function m(e,t){for(const r of e)y(r,null,t)}function y(e,t,r){return n(e)?r(e):t}function w(e,t){return n(e)?t(e):null}function b(e){return e.filter((e=>n(e)))}function v(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function _(e){return e}r.d(t,{Po:()=>w,yw:()=>s,j0:()=>_,SC:()=>u,O3:()=>d,lV:()=>b,JR:()=>m,U2:()=>v,Wi:()=>o,pC:()=>n,o8:()=>i,Fd:()=>p,R2:()=>y,Bd:()=>g,RY:()=>h,hw:()=>f,Wg:()=>a,Pt:()=>c,s3:()=>l})},78286:(e,t,r)=>{r.d(t,{RH:()=>o,hS:()=>i,RB:()=>s});var n=r(22974);function o(e,t,r=!1){return l(e,t,r)}function i(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function s(e,t,r){const n=e.split("."),o=n.pop(),i=a(n,!0,r);i&&o&&(i[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function l(e,t,r){return t?Object.keys(t).reduce((function(e,o){let i=e[o],s=t[o];return i===s?e:void 0===i?(e[o]=(0,n.d9)(s),e):(Array.isArray(s)||Array.isArray(e)?(i=i?Array.isArray(i)?e[o]=i.concat():e[o]=[i]:e[o]=[],s&&(Array.isArray(s)||(s=[s]),r?s.forEach((e=>{-1===i.indexOf(e)&&i.push(e)})):e[o]=s.concat())):s&&"object"==typeof s?e[o]=l(i,s,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=s),e)}),e||{}):e}},19153:(e,t,r)=>{r.d(t,{Qs:()=>a,hP:()=>l,gx:()=>s,Cb:()=>c});var n=r(78286);const o=/\{([^\}]+)\}/g;function i(e){return null==e?"":e}function s(e,t){return e.replace(o,"object"==typeof t?(e,r)=>i((0,n.hS)(r,t)):(e,r)=>i(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&-1!==t.indexOf(e)?e:`\\${e}`))}function l(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function c(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function i(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function s(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 l(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function c(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 d(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function f(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 g(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,eP:()=>i,xZ:()=>h,fS:()=>g,z3:()=>c,Hx:()=>d,W0:()=>s,Uc:()=>u,ZY:()=>f,lq:()=>a,KZ:()=>l,tP:()=>o})},17202:(e,t,r)=>{r.d(t,{r:()=>n,$:()=>o});const n="20211230",o="031184be9af0675d8af42e28a660b33eadfe73b6"}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.23.0-next.20211226",
3
+ "version": "4.23.0-next.20211230",
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.23/esri/copyright.txt for details.
4
4
  */
5
- const c="20211226",b="c887125d13bb041b154e53c69c1a29b37c518693";export{c as buildDate,b as commitHash};
5
+ const e="20211230",a="031184be9af0675d8af42e28a660b33eadfe73b6";export{e as buildDate,a as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Collection.js";import t from"../../../core/Logger.js";import{init as r}from"../../../core/watchUtils.js";import{g as n}from"../../../chunks/vec3.js";import s from"./RenderContext.js";import{RenderPass as i}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as d}from"../webgl-engine/lib/RenderSlot.js";const o=t.getLogger("esri.views.3d.externalRenderers.ExternalRendererStore");class a{constructor(){this._renderers=new e}add(e,t){this._findOrCreateStageRenderer(e).add(t)}remove(e,t){const r=this._findStageRenderer(e);r&&r.remove(t),0===r.renderers.length&&(r.destroy(),this._renderers.remove(r))}_findStageRenderer(e){return this._renderers.find((t=>t.view===e))}_findOrCreateStageRenderer(e){let t=this._findStageRenderer(e);return t||(t=new h(e),this._renderers.add(t)),t}}class h{constructor(t){this.view=t,this.canRender=!0,this.renderers=new e,this._readyWatchHandle=r(t,"ready",(e=>{e?(this.context=new s(this.view),this.view._stage.addRenderPlugin([d.OPAQUE_PLUGIN,d.TRANSPARENT_PLUGIN],this)):(this.renderers.forEach((e=>c(e,"dispose",this.context))),this.context=null)}))}destroy(){this.renderers.drain((e=>{this.context&&c(e,"dispose",this.context)})),this.view._stage&&this.view._stage.removeRenderPlugin(this),this._readyWatchHandle&&(this._readyWatchHandle.remove(),this._readyWatchHandle=null),this.context=null}add(e){-1===this.renderers.indexOf(e)?(this.renderers.add(e),this.context&&(this._webglStateReset(),c(e,"setup",this.context),this.view._stage.renderView.requestRender())):o.warn("add(): Cannot add external renderer: renderer has already been added")}remove(e){const t=this.renderers.indexOf(e);-1!==t&&(this.renderers.removeAt(t),this.context&&(c(e,"dispose",this.context),this.view._stage.renderView.requestRender()))}initializeRenderContext(e){this.context.gl=e.renderContext.rctx.gl,this.context.rctx=e.renderContext.rctx,this.renderers.length>0&&this._webglStateReset(),this.renderers.forEach((e=>c(e,"setup",this.context)))}uninitializeRenderContext(){}render(e){0===this.renderers.length||e.pass!==i.MATERIAL||e.slot!==d.OPAQUE_PLUGIN&&e.slot!==d.TRANSPARENT_PLUGIN||(this._updateContext(e),this._webglStateReset(),this.renderers.forEach((t=>{switch(e.slot){case d.OPAQUE_PLUGIN:c(t,"render",this.context);break;case d.TRANSPARENT_PLUGIN:c(t,"renderTransparent",this.context)}})))}_updateContext(e){this.context.camera.copyFrom(e.camera),n(this.context.sunLight.direction,e.scenelightingData.old.direction),n(this.context.sunLight.diffuse.color,e.scenelightingData.old.diffuse.color),n(this.context.sunLight.ambient.color,e.scenelightingData.old.ambient.color),this.context._renderTargetHelper=e.offscreenRenderingHelper}_webglStateReset(){var e;this.context.rctx.resetState(),null==(e=this.context._renderTargetHelper)||e.bindFramebuffer()}}function c(e,t,r){"function"==typeof e[t]&&e[t](r)}export{a as default};
5
+ import e from"../../../core/Collection.js";import t from"../../../core/Logger.js";import{init as r}from"../../../core/watchUtils.js";import{g as n}from"../../../chunks/vec3.js";import s from"./RenderContext.js";import{RenderPass as i}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as d}from"../webgl-engine/lib/RenderSlot.js";const o=t.getLogger("esri.views.3d.externalRenderers.ExternalRendererStore");class a{constructor(){this._renderers=new e}add(e,t){this._findOrCreateStageRenderer(e).add(t)}remove(e,t){const r=this._findStageRenderer(e);r&&r.remove(t),0===r.renderers.length&&(r.destroy(),this._renderers.remove(r))}_findStageRenderer(e){return this._renderers.find((t=>t.view===e))}_findOrCreateStageRenderer(e){let t=this._findStageRenderer(e);return t||(t=new h(e),this._renderers.add(t)),t}}class h{constructor(t){this.view=t,this.canRender=!0,this.renderers=new e,this._readyWatchHandle=r(t,"ready",(e=>{e?(this.context=new s(this.view),this.view._stage.addRenderPlugin([d.OPAQUE_PLUGIN,d.TRANSPARENT_PLUGIN],this)):(this.renderers.forEach((e=>c(e,"dispose",this.context))),this.context=null)}))}destroy(){this.renderers.drain((e=>{this.context&&c(e,"dispose",this.context)})),this.view._stage&&this.view._stage.removeRenderPlugin(this),this._readyWatchHandle&&(this._readyWatchHandle.remove(),this._readyWatchHandle=null),this.context=null}add(e){-1===this.renderers.indexOf(e)?(this.renderers.add(e),this.context&&(this._webglStateReset(),c(e,"setup",this.context),this.view._stage.renderView.requestRender())):o.warn("add(): Cannot add external renderer: renderer has already been added")}remove(e){const t=this.renderers.indexOf(e);-1!==t&&(this.renderers.removeAt(t),this.context&&(c(e,"dispose",this.context),this.view._stage.renderView.requestRender()))}initializeRenderContext(e){this.context.gl=e.renderContext.rctx.gl,this.context.rctx=e.renderContext.rctx,this.renderers.length>0&&this._webglStateReset(),this.renderers.forEach((e=>c(e,"setup",this.context)))}uninitializeRenderContext(){}render(e){0===this.renderers.length||e.pass!==i.MATERIAL||e.slot!==d.OPAQUE_PLUGIN&&e.slot!==d.TRANSPARENT_PLUGIN||(this._updateContext(e),this._webglStateReset(),this.renderers.forEach((t=>{switch(e.slot){case d.OPAQUE_PLUGIN:c(t,"render",this.context);break;case d.TRANSPARENT_PLUGIN:c(t,"renderTransparent",this.context)}})))}_updateContext(e){this.context.camera.copyFrom(e.camera),n(this.context.sunLight.direction,e.scenelightingData.old.direction),n(this.context.sunLight.diffuse.color,e.scenelightingData.old.diffuse.color),n(this.context.sunLight.ambient.color,e.scenelightingData.old.ambient.color),this.context._renderTargetHelper=e.offscreenRenderingHelper}_webglStateReset(){var e;this.context.rctx.resetState(),null==(e=this.context._renderTargetHelper)||e.bindFramebuffer()}get needsTransparentPass(){return this.renderers.some((e=>"function"==typeof e.renderTransparent))}}function c(e,t,r){"function"==typeof e[t]&&e[t](r)}export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as s}from"../../../../../core/maybe.js";import{f as a,t as e,e as r}from"../../../../../chunks/mat3.js";import{c as t}from"../../../../../chunks/mat3f64.js";import{c as i}from"../../../../../chunks/mat4.js";import{s as h}from"../../../../../chunks/vec2.js";import{b as n,s as m,g as o,f as l}from"../../../../../chunks/vec3.js";import{c as P}from"../../../../../chunks/vec3f64.js";import{c as p}from"../../../../../chunks/vec4.js";import{d as _}from"../../../../../chunks/boundedPlane.js";import{MaterialPassesParameters as c,ShadowMapPassParameters as d,HighlightPassParameters as u,MaterialSubPass as T,RenderPassIdentifier as A}from"./AllRenderPasses.js";import{RenderPass as g,RenderPassSorting as w}from"./RenderPass.js";import{TwoVectorPosition as R}from"../util/TwoVectorPosition.js";import{union as f}from"../../lib/depthRange.js";import{RenderPass as M}from"../../lib/RenderPass.js";import{RenderSlot as E}from"../../lib/RenderSlot.js";class H{constructor(s,a){this.rctx=s,this.shaderTechniqueRepository=a,this.canRender=!0,this._materialPassParams=new c,this._shadowPassParams=new d,this._highlightPassParams=new u,this._systems=new Set,this._passes={materialOpaque:new g(s,this.shaderTechniqueRepository),materialTransparent:new g(s,this.shaderTechniqueRepository,w.BackToFront),materialIntegratedMesh:new g(s,this.shaderTechniqueRepository),shadowMap:new g(s,this.shaderTechniqueRepository),highlight:new g(s,this.shaderTechniqueRepository),highlightIntegratedMesh:new g(s,this.shaderTechniqueRepository),highlightShadowMap:new g(s,this.shaderTechniqueRepository),defaultShadowMap:new g(s,this.shaderTechniqueRepository)}}register(s){this._systems.add(s)}prepareRender(s){if(0!==this._systems.size){for(const s of Object.values(this._passes))s.prepareSubmit();this._systems.forEach((a=>a.submit(this._passes,{camera:s})));for(const s of Object.values(this._passes))s.finishSubmit();this.shaderTechniqueRepository.frameUpdate()}}render(s){if(0!==this._systems.size)switch(this._configure(s),s.slot){case E.OPAQUE_PLUGIN:switch(s.pass){case M.MATERIAL:return this._materialPassParams.subPass=T.Color,this._configureMaterialColorPass(s),this._passes.materialOpaque.dispatch(this._materialPassParams);case M.MATERIAL_DEPTH:return this._materialPassParams.subPass=T.Depth,this._passes.materialOpaque.dispatch(this._materialPassParams);case M.MATERIAL_NORMAL:return this._materialPassParams.subPass=T.Normal,this._passes.materialOpaque.dispatch(this._materialPassParams);case M.MATERIAL_HIGHLIGHT:return this._passes.highlight.dispatch(this._highlightPassParams);case M.MATERIAL_DEPTH_SHADOWMAP_ALL:return this._passes.shadowMap.dispatch(this._shadowPassParams);case M.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT:return this._passes.highlightShadowMap.dispatch(this._shadowPassParams);case M.MATERIAL_DEPTH_SHADOWMAP_DEFAULT:return this._passes.defaultShadowMap.dispatch(this._shadowPassParams)}return;case E.TRANSPARENT_PLUGIN:switch(s.pass){case M.MATERIAL:return this._materialPassParams.subPass=T.Color,this._configureMaterialColorPass(s),this._passes.materialTransparent.dispatch(this._materialPassParams);case M.MATERIAL_ALPHA:return this._materialPassParams.subPass=T.Alpha,this._configureMaterialColorPass(s),this._passes.materialTransparent.dispatch(this._materialPassParams);case M.MATERIAL_DEPTH:return this._materialPassParams.subPass=T.Depth,this._passes.materialTransparent.dispatch(this._materialPassParams);case M.MATERIAL_NORMAL:return this._materialPassParams.subPass=T.Normal,this._passes.materialTransparent.dispatch(this._materialPassParams)}return;case E.INTEGRATED_MESH:switch(s.pass){case M.MATERIAL:return this._materialPassParams.subPass=T.Color,this._configureMaterialColorPass(s),this._materialPassParams.ssrParams=s.ssrParams,this._passes.materialIntegratedMesh.dispatch(this._materialPassParams);case M.MATERIAL_DEPTH:return this._materialPassParams.subPass=T.Depth,this._passes.materialIntegratedMesh.dispatch(this._materialPassParams);case M.MATERIAL_NORMAL:return this._materialPassParams.subPass=T.Normal,this._passes.materialIntegratedMesh.dispatch(this._materialPassParams);case M.MATERIAL_HIGHLIGHT:return this._passes.highlightIntegratedMesh.dispatch(this._highlightPassParams)}return}}notifyDirty(){this._context.requestRender()}slots(){return[E.OPAQUE_PLUGIN,E.TRANSPARENT_PLUGIN,E.INTEGRATED_MESH]}initializeRenderContext(s){this._context=s}uninitializeRenderContext(){}queryDepthRange(a){const e={near:1/0,far:-1/0};return this._systems.forEach((r=>{const t=r.queryShadowCasterDepthRange(a);s(t)&&f(e,t,e)})),e}get shadowCastingEnabled(){return this._materialPassParams.shadowsEnabled}set shadowCastingEnabled(s){this._materialPassParams.shadowsEnabled=s}get screenSpaceReflectionsEnabled(){return s(this._materialPassParams.ssrParams.ssrEnabled)}set screenSpaceReflectionsEnabled(s){this._materialPassParams.ssrParams.ssrEnabled=!!s}_configureMaterialColorPass(s){this._materialPassParams.bindShadowMap=a=>{s.shadowMap.bind(a);const e=this._materialPassParams.viewTransform;n(I,e.worldFromView_TL,e.worldFromView_TH),s.shadowMap.bindView(a,I)},this._materialPassParams.bindAmbientOcclusion=a=>s.ssaoHelper.bind(a,s.camera),this._materialPassParams.ambientOcclusionEnabled=!!s.ssaoHelper&&s.ssaoHelper.ready,this._materialPassParams.sceneHasOcludees=s.hasOccludees}_configure(s){const a=s.pass===M.MATERIAL_DEPTH_SHADOWMAP_ALL||s.pass===M.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT||s.pass===M.MATERIAL_DEPTH_SHADOWMAP_DEFAULT?this._shadowPassParams:s.pass===M.MATERIAL_HIGHLIGHT?this._highlightPassParams:this._materialPassParams;this._updateParameters(s,a)}_updateParameters(s,t){const n=s.camera,P=n.viewInverseTransposeMatrix;m(I,P[3],P[7],P[11]),b.set(I),o(t.viewTransform.worldFromView_TH,b.high),o(t.viewTransform.worldFromView_TL,b.low),a(t.viewTransform.viewFromCameraRelative_RS,n.viewMatrix),i(t.viewTransform.projFromView,n.projectionMatrix),t.identifier===A.Material?(this._materialPassParams.transparent=s.slot===E.TRANSPARENT_PLUGIN,this._materialPassParams.integratedMesh=s.slot===E.INTEGRATED_MESH,this._materialPassParams.lighting=s.scenelightingData,e(L,t.viewTransform.viewFromCameraRelative_RS),r(t.transformNormal_ViewFromGlobal,L),h(t.cameraNearFar,n.near,n.far)):t.identifier===A.ShadowMap?h(t.cameraNearFar,n.near,n.far):t.identifier===A.Highlight&&(t.highlightDepthTexture=s.highlightDepthTexture,p(t.viewport,n.fullViewport)),t.identifier!==A.Material&&t.identifier!==A.Highlight||(t.inverseViewport[0]=1/n.fullViewport[2],t.inverseViewport[1]=1/n.fullViewport[3]),_(s.sliceHelper.plane,t.slicePlane),l(t.slicePlane.origin,t.slicePlane.origin,I),t.slicePlaneEnabled=s.sliceHelper.isEnabled,this._materialPassParams.slot=s.slot,this._materialPassParams.transparencyPassType=s.transparencyPassType,this._materialPassParams.multipassTerrainParams=s.multipassTerrainParams}get needsHighlight(){return this._passes.highlight.count>0||this._passes.highlightIntegratedMesh.count>0}}const I=P(),L=t(),b=new R;export{H as RenderPassManager};
5
+ import{isSome as s}from"../../../../../core/maybe.js";import{f as a,t as e,e as r}from"../../../../../chunks/mat3.js";import{c as t}from"../../../../../chunks/mat3f64.js";import{c as i}from"../../../../../chunks/mat4.js";import{s as h}from"../../../../../chunks/vec2.js";import{b as n,s as m,g as o,f as l}from"../../../../../chunks/vec3.js";import{c as P}from"../../../../../chunks/vec3f64.js";import{c as p}from"../../../../../chunks/vec4.js";import{d as _}from"../../../../../chunks/boundedPlane.js";import{MaterialPassesParameters as c,ShadowMapPassParameters as d,HighlightPassParameters as u,MaterialSubPass as T,RenderPassIdentifier as A}from"./AllRenderPasses.js";import{RenderPass as g,RenderPassSorting as w}from"./RenderPass.js";import{TwoVectorPosition as R}from"../util/TwoVectorPosition.js";import{union as f}from"../../lib/depthRange.js";import{RenderPass as M}from"../../lib/RenderPass.js";import{RenderSlot as E}from"../../lib/RenderSlot.js";class H{constructor(s,a){this.rctx=s,this.shaderTechniqueRepository=a,this.canRender=!0,this._materialPassParams=new c,this._shadowPassParams=new d,this._highlightPassParams=new u,this._systems=new Set,this._passes={materialOpaque:new g(s,this.shaderTechniqueRepository),materialTransparent:new g(s,this.shaderTechniqueRepository,w.BackToFront),materialIntegratedMesh:new g(s,this.shaderTechniqueRepository),shadowMap:new g(s,this.shaderTechniqueRepository),highlight:new g(s,this.shaderTechniqueRepository),highlightIntegratedMesh:new g(s,this.shaderTechniqueRepository),highlightShadowMap:new g(s,this.shaderTechniqueRepository),defaultShadowMap:new g(s,this.shaderTechniqueRepository)}}register(s){this._systems.add(s)}prepareRender(s){if(0!==this._systems.size){for(const s of Object.values(this._passes))s.prepareSubmit();this._systems.forEach((a=>a.submit(this._passes,{camera:s})));for(const s of Object.values(this._passes))s.finishSubmit();this.shaderTechniqueRepository.frameUpdate()}}render(s){if(0!==this._systems.size)switch(this._configure(s),s.slot){case E.OPAQUE_PLUGIN:switch(s.pass){case M.MATERIAL:return this._materialPassParams.subPass=T.Color,this._configureMaterialColorPass(s),this._passes.materialOpaque.dispatch(this._materialPassParams);case M.MATERIAL_DEPTH:return this._materialPassParams.subPass=T.Depth,this._passes.materialOpaque.dispatch(this._materialPassParams);case M.MATERIAL_NORMAL:return this._materialPassParams.subPass=T.Normal,this._passes.materialOpaque.dispatch(this._materialPassParams);case M.MATERIAL_HIGHLIGHT:return this._passes.highlight.dispatch(this._highlightPassParams);case M.MATERIAL_DEPTH_SHADOWMAP_ALL:return this._passes.shadowMap.dispatch(this._shadowPassParams);case M.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT:return this._passes.highlightShadowMap.dispatch(this._shadowPassParams);case M.MATERIAL_DEPTH_SHADOWMAP_DEFAULT:return this._passes.defaultShadowMap.dispatch(this._shadowPassParams)}return;case E.TRANSPARENT_PLUGIN:switch(s.pass){case M.MATERIAL:return this._materialPassParams.subPass=T.Color,this._configureMaterialColorPass(s),this._passes.materialTransparent.dispatch(this._materialPassParams);case M.MATERIAL_ALPHA:return this._materialPassParams.subPass=T.Alpha,this._configureMaterialColorPass(s),this._passes.materialTransparent.dispatch(this._materialPassParams);case M.MATERIAL_DEPTH:return this._materialPassParams.subPass=T.Depth,this._passes.materialTransparent.dispatch(this._materialPassParams);case M.MATERIAL_NORMAL:return this._materialPassParams.subPass=T.Normal,this._passes.materialTransparent.dispatch(this._materialPassParams)}return;case E.INTEGRATED_MESH:switch(s.pass){case M.MATERIAL:return this._materialPassParams.subPass=T.Color,this._configureMaterialColorPass(s),this._materialPassParams.ssrParams=s.ssrParams,this._passes.materialIntegratedMesh.dispatch(this._materialPassParams);case M.MATERIAL_DEPTH:return this._materialPassParams.subPass=T.Depth,this._passes.materialIntegratedMesh.dispatch(this._materialPassParams);case M.MATERIAL_NORMAL:return this._materialPassParams.subPass=T.Normal,this._passes.materialIntegratedMesh.dispatch(this._materialPassParams);case M.MATERIAL_HIGHLIGHT:return this._passes.highlightIntegratedMesh.dispatch(this._highlightPassParams)}return}}notifyDirty(){this._context.requestRender()}slots(){return[E.OPAQUE_PLUGIN,E.TRANSPARENT_PLUGIN,E.INTEGRATED_MESH]}initializeRenderContext(s){this._context=s}uninitializeRenderContext(){}queryDepthRange(a){const e={near:1/0,far:-1/0};return this._systems.forEach((r=>{const t=r.queryShadowCasterDepthRange(a);s(t)&&f(e,t,e)})),e}get shadowCastingEnabled(){return this._materialPassParams.shadowsEnabled}set shadowCastingEnabled(s){this._materialPassParams.shadowsEnabled=s}get screenSpaceReflectionsEnabled(){return s(this._materialPassParams.ssrParams.ssrEnabled)}set screenSpaceReflectionsEnabled(s){this._materialPassParams.ssrParams.ssrEnabled=!!s}_configureMaterialColorPass(s){this._materialPassParams.bindShadowMap=a=>{s.shadowMap.bind(a);const e=this._materialPassParams.viewTransform;n(I,e.worldFromView_TL,e.worldFromView_TH),s.shadowMap.bindView(a,I)},this._materialPassParams.bindAmbientOcclusion=a=>s.ssaoHelper.bind(a,s.camera),this._materialPassParams.ambientOcclusionEnabled=!!s.ssaoHelper&&s.ssaoHelper.ready,this._materialPassParams.sceneHasOcludees=s.hasOccludees}_configure(s){const a=s.pass===M.MATERIAL_DEPTH_SHADOWMAP_ALL||s.pass===M.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT||s.pass===M.MATERIAL_DEPTH_SHADOWMAP_DEFAULT?this._shadowPassParams:s.pass===M.MATERIAL_HIGHLIGHT?this._highlightPassParams:this._materialPassParams;this._updateParameters(s,a)}_updateParameters(s,t){const n=s.camera,P=n.viewInverseTransposeMatrix;m(I,P[3],P[7],P[11]),b.set(I),o(t.viewTransform.worldFromView_TH,b.high),o(t.viewTransform.worldFromView_TL,b.low),a(t.viewTransform.viewFromCameraRelative_RS,n.viewMatrix),i(t.viewTransform.projFromView,n.projectionMatrix),t.identifier===A.Material?(this._materialPassParams.transparent=s.slot===E.TRANSPARENT_PLUGIN,this._materialPassParams.integratedMesh=s.slot===E.INTEGRATED_MESH,this._materialPassParams.lighting=s.scenelightingData,e(L,t.viewTransform.viewFromCameraRelative_RS),r(t.transformNormal_ViewFromGlobal,L),h(t.cameraNearFar,n.near,n.far)):t.identifier===A.ShadowMap?h(t.cameraNearFar,n.near,n.far):t.identifier===A.Highlight&&(t.highlightDepthTexture=s.highlightDepthTexture,p(t.viewport,n.fullViewport)),t.identifier!==A.Material&&t.identifier!==A.Highlight||(t.inverseViewport[0]=1/n.fullViewport[2],t.inverseViewport[1]=1/n.fullViewport[3]),_(s.sliceHelper.plane,t.slicePlane),l(t.slicePlane.origin,t.slicePlane.origin,I),t.slicePlaneEnabled=s.sliceHelper.isEnabled,this._materialPassParams.slot=s.slot,this._materialPassParams.transparencyPassType=s.transparencyPassType,this._materialPassParams.multipassTerrainParams=s.multipassTerrainParams}get needsHighlight(){return this._passes.highlight.count>0||this._passes.highlightIntegratedMesh.count>0}get needsTransparentPass(){return this._passes.materialTransparent.count>0}}const I=P(),L=t(),b=new R;export{H as RenderPassManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isPromiseLike as e}from"../../../../core/promiseUtils.js";import{union as t}from"./depthRange.js";import{RenderSlot as r}from"./RenderSlot.js";import{assert as n}from"./Util.js";class s{constructor(e){this.context=e,this.renderPlugins=new Array,this.slots=[];for(let t=0;t<r.MAX_SLOTS;++t)this.slots[t]=[]}add(t,r,n){const s=()=>{this.renderPlugins.push(r);for(const e of t)this.slots[e].push(r);this.context.requestRender()},i=r.initializeRenderContext(this.context,n);if(e(i))return i.then(s);s()}remove(e){const t=this.renderPlugins.length;this.renderPlugins=this.renderPlugins.filter((t=>t!==e)),n(this.renderPlugins.length<t,"Removing non-added render plugin");for(let r=0;r<this.slots.length;++r)this.slots[r]=this.slots[r].filter((t=>t!==e));e.uninitializeRenderContext(),this.context.requestRender()}prepareRender(e,t){for(const r of this.renderPlugins)r.prepareRender&&r.prepareRender(e,t)}render(){const e=this.slots[this.context.renderContext.slot],t=new Array;e.filter((e=>{if(!e.canRender)return!1;if(i(e)){const r=e.prepareTechnique(this.context.renderContext);return!!r&&(t.push(r),!0)}return t.push(null),!0})).forEach(((e,r)=>e.render(this.context.renderContext,t[r])))}queryDepthRange(e){const r=o;r.near=1/0,r.far=-1/0;for(const n of this.renderPlugins)if(n.queryDepthRange){const s=n.queryDepthRange(e);s&&t(r,s,r)}return r}get needsHighlight(){return this.renderPlugins.some((e=>e.needsHighlight))}get needsLinearDepth(){return this.renderPlugins.some((e=>e.needsLinearDepth))}get needsLaserlineWithContrastControl(){const e=this.slots[r.LASERLINES_CONTRAST_CONTROL];return!!e&&e.length>0}get renderOccludedFlags(){let e=0;return this.renderPlugins.forEach((t=>{t.renderOccludedFlags&&(e|=t.renderOccludedFlags)})),e}}function i(e){return"prepareTechnique"in e}const o={near:0,far:0};export{s as RenderPluginManager};
5
+ import{isPromiseLike as e}from"../../../../core/promiseUtils.js";import{union as r}from"./depthRange.js";import{RenderSlot as t}from"./RenderSlot.js";import{assert as n}from"./Util.js";class s{constructor(e){this.context=e,this.renderPlugins=new Array,this.slots=[];for(let r=0;r<t.MAX_SLOTS;++r)this.slots[r]=[]}add(r,t,n){const s=()=>{this.renderPlugins.push(t);for(const e of r)this.slots[e].push(t);this.context.requestRender()},i=t.initializeRenderContext(this.context,n);if(e(i))return i.then(s);s()}remove(e){const r=this.renderPlugins.length;this.renderPlugins=this.renderPlugins.filter((r=>r!==e)),n(this.renderPlugins.length<r,"Removing non-added render plugin");for(let t=0;t<this.slots.length;++t)this.slots[t]=this.slots[t].filter((r=>r!==e));e.uninitializeRenderContext(),this.context.requestRender()}prepareRender(e,r){for(const t of this.renderPlugins)t.prepareRender&&t.prepareRender(e,r)}render(){const e=this.slots[this.context.renderContext.slot],r=new Array;e.filter((e=>{if(!e.canRender)return!1;if(i(e)){const t=e.prepareTechnique(this.context.renderContext);return!!t&&(r.push(t),!0)}return r.push(null),!0})).forEach(((e,t)=>e.render(this.context.renderContext,r[t])))}queryDepthRange(e){const t=o;t.near=1/0,t.far=-1/0;for(const n of this.renderPlugins)if(n.queryDepthRange){const s=n.queryDepthRange(e);s&&r(t,s,t)}return t}get needsTransparentPass(){return this.renderPlugins.some((e=>e.needsTransparentPass))}get needsHighlight(){return this.renderPlugins.some((e=>e.needsHighlight))}get needsLinearDepth(){return this.renderPlugins.some((e=>e.needsLinearDepth))}get needsLaserlineWithContrastControl(){const e=this.slots[t.LASERLINES_CONTRAST_CONTROL];return!!e&&e.length>0}get renderOccludedFlags(){let e=0;return this.renderPlugins.forEach((r=>{r.renderOccludedFlags&&(e|=r.renderOccludedFlags)})),e}}function i(e){return"prepareTechnique"in e}const o={near:0,far:0};export{s as RenderPluginManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import t from"../../../../core/Handles.js";import{someMap as s}from"../../../../core/MapUtils.js";import{destroyMaybe as n,disposeMaybe as i,isSome as a,isNone as h,unwrap as o}from"../../../../core/maybe.js";import{Milliseconds as d}from"../../../../core/time.js";import{init as l}from"../../../../core/watchUtils.js";import{property as _}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{v as c,j as m,a as u,m as g}from"../../../../chunks/mat4.js";import{I as f,c as T}from"../../../../chunks/mat4f64.js";import{a as R}from"../../../../chunks/vec2f64.js";import{MAXIMUM_ANIMATION_LOAD as x,MINIMUM_IDLE_ANIMATION_MS as C}from"../../support/animationUtils.js";import E from"../../support/debugFlags.js";import{RenderPassManager as A}from"../core/renderPasses/RenderPassManager.js";import{HUDTransparentRenderStyle as P}from"../core/shaderLibrary/hud/HUDUniforms.js";import{AntiAliasingMode as b,TransparencyPassType as w,Decorations as S,RenderRequestType as H,StencilBits as D}from"./basicInterfaces.js";import{BoundingInfo as M}from"./BoundingInfo.js";import{ZERO as O,union as y}from"./depthRange.js";import{depthRangeFromScene as L}from"./depthRangeUtils.js";import{createEmptyDepthTexture as I}from"./glUtil3D.js";import v from"./HighlightHelper.js";import{RenderOccludedFlag as N}from"./Material.js";import{OffscreenRendering as U}from"./OffscreenRendering.js";import{RenderContext as j}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as q}from"./rendererUtils.js";import{RenderPass as G}from"./RenderPass.js";import{RenderPluginManager as F}from"./RenderPluginManager.js";import{RenderSlot as V}from"./RenderSlot.js";import{ShadowAccumulator as k}from"./ShadowAccumulator.js";import{ShadowHighlightHelper as W}from"./ShadowHighlightHelper.js";import B from"./ShadowMap.js";import Q from"./SliceHelper.js";import{SmaaRenderPass as z}from"./SmaaRenderPass.js";import{SSAOHelper as X}from"./SSAOHelper.js";import{EdgeView as K}from"./edgeRendering/EdgeView.js";import{Transparency as Y}from"./edgeRendering/interfaces.js";import{SceneLighting as J}from"../lighting/SceneLighting.js";import{MergedRenderer as Z}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as $}from"../shaders/CompositingTechnique.js";import{HighlightShadowMapSlot as ee,DefaultSnapshotSlot as re}from"../shaders/ShadowHighlightTechnique.js";import{RendererPerformanceInfo as te,Statistics as se}from"../statistics/RendererPerformanceInfo.js";import{ClearBufferBit as ne,PixelFormat as ie,PixelType as ae}from"../../../webgl/enums.js";import{startMeasurement as he}from"../../../webgl/Measurement.js";const oe=.9;let de=class extends r{constructor(e,r,s,n,i,a,h,o,_){super({}),this._materialRepository=e,this._shaderTechniqueRepository=s,this._rctx=n,this._compositingHelper=i,this._magnifierHelper=a,this._requestRender=h,this._stage=_,this._materialRenderers=new Map,this._hasHighlights=!1,this._hasOccludees=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._content=new Map,this._isRendering=!1,this._fallbackDepthStencilTexture=null,this.performanceInfo=new te,this._antialiasing=b.SMAA,this._oitEnabled=!1,this._multipassTerrain=!0,this._opaqueTerrain=!0,this._lighting=new J,this._hasAnimations=!1,this._animationTimestep=d(0),this._handles=new t,this._renderHiddenTransparentEdges=()=>{},this._smaaPass=new z(this._rctx,s),this._oitEnabled=this._hasOITSupport,this._requestRender(),this._offscreenRendering=new U(this._rctx,this._compositingHelper),this._sliceHelper=new Q,this._shadowMap=new B(this._rctx,_.viewingMode,2),this._ssaoHelper=new X(s,this._rctx,(()=>this._requestRender())),this._highlightHelper=new v(s,this._rctx),this._shadowHighlightHelper=new W(this._rctx,_.viewingMode),this._shadowAccumulator=new k(this._rctx,s,_,((e,r)=>{this.renderPassManager.shadowCastingEnabled=!0,this._renderPlugins.prepareRender(e,r),this.renderPassManager.shadowCastingEnabled=this._shadowMap.enabled}),((e,r,t,s)=>{e.start(t,r,s),this._renderShadowCascades(G.MATERIAL_DEPTH_SHADOWMAP_ALL,e),t.setGLViewport(this._rctx),this._ensureCameraBindParameters(t)}),(()=>this._requestRender())),this._bindParameters={slot:null,camera:null,inverseViewport:R(),shadowMap:this._shadowMap,shadowMappingEnabled:this._shadowMap.enabled,ssaoHelper:this._ssaoHelper,ssaoEnabled:this._ssaoHelper.enabled,origin:null,screenToWorldRatio:null,screenToPCSRatio:null,slicePlane:this._sliceHelper.plane,highlightDepthTexture:null,hasOccludees:!1,linearDepthTexture:null,terrainLinearDepthTexture:null,geometryLinearDepthTexture:null,multipassTerrainEnabled:!1,multipassGeometryEnabled:!1,cullAboveGround:!1,lastFrameColorTexture:null,reprojectionMatrix:f,ssrEnabled:!1,lighting:this._lighting,highlightColorTexture:null},this._renderContext=new j(this._rctx,this._offscreenRendering,this._lighting,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderContext.multipassTerrainParams={camera:null,multipassTerrainEnabled:!1,cullAboveGround:!1,terrainLinearDepthTexture:null},this._renderContext.multipassGeometryParams={multipassGeometryEnabled:!1,geometryLinearDepthTexture:null},this._renderContext.ssrParams={camera:null,linearDepthTexture:null,lastFrameColorTexture:null,reprojectionMatrix:f,ssrEnabled:!1},this._renderPlugins=new F({renderContext:this._renderContext,shaderTechniqueRep:s,textureRep:r,materialRep:this._materialRepository,requestRender:this._requestRender,schedule:o}),this.renderPassManager=new A(this._rctx,this._shaderTechniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([l(E,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(Y.TRANSPARENT):()=>{},this._requestRender()})),l(this._stage,"camera",(()=>this._requestRender()),!0)])}get hasWater(){return this._hasWater||this._hasOverlayWater}get hasWaterReflection(){return this.hasWater&&this._waterReflectionEnabled}normalizeCtorArgs(){return{}}dispose(){this._handles.destroy(),this._smaaPass.dispose(),this._materialRenderers.forEach((e=>e.dispose())),this._materialRenderers.clear(),this._edgeView=n(this._edgeView),this._offscreenRendering.dispose(),this._fallbackDepthStencilTexture=i(this._fallbackDepthStencilTexture),this._shadowMap.enabled=!1,this._shadowMap.dispose(),this._ssaoHelper.enabled=!1,this._ssaoHelper.dispose(),this._highlightHelper.dispose(),this._shadowHighlightHelper.dispose(),this._shadowAccumulator.dispose(),M.prune(),this._content.clear()}get updating(){return this._antialiasing===b.SMAA&&this._smaaPass.updating||a(this._edgeView)&&this._edgeView.updating||this._shadowAccumulator.running||!this.isCameraFinal}ensureEdgeView(){return h(this._edgeView)&&(this._edgeView=new K({rctx:this._rctx,renderSR:this._stage.renderSR,techniqueRepository:this._shaderTechniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:e=>this._stage.resourceController.schedule(e)}),this._handles.add(this._edgeView.watch("updating",(()=>this._requestRender()),!0)),this._requestRender()),this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return null===this._bindParameters.reprojectionMatrix||c(this._bindParameters.reprojectionMatrix,f)}set _reprojectionMatrix(e){c(this._bindParameters.reprojectionMatrix,e)||(this._bindParameters.reprojectionMatrix=e,this.notifyChange("isCameraFinal"))}get hasShadowsEnabled(){var e;return!(null==(e=this._shadowMap)||!e.enabled)}setRenderParameters(e){const{renderPassManager:r,_shadowMap:t,_ssaoHelper:s}=this;void 0!==e.screenSpaceReflectionsEnabled&&r.screenSpaceReflectionsEnabled!==e.screenSpaceReflectionsEnabled&&(r.screenSpaceReflectionsEnabled=e.screenSpaceReflectionsEnabled,this._requestRender()),void 0===e.shadowMap||t.enabled===e.shadowMap&&r.shadowCastingEnabled===e.shadowMap||(t.enabled=e.shadowMap,r.shadowCastingEnabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),void 0!==e.ssao&&s.enabled!==e.ssao&&(s.enabled=e.ssao,this._requestRender()),e.background&&this._offscreenRendering.background!==e.background&&(this._offscreenRendering.background=e.background,this._requestRender());const n=e.antialiasingEnabled?b.SMAA:b.NONE;void 0!==e.antialiasingEnabled&&this._antialiasing!==n&&(this._antialiasing=n,this._requestRender()),void 0!==e.highQualityTransparency&&this._multipassTerrain!==e.highQualityTransparency&&(this._multipassTerrain=e.highQualityTransparency,this._oitEnabled=e.highQualityTransparency&&this._hasOITSupport,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlightHelper.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlightHelper.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=o(e.slicePlane),this._requestRender()),void 0!==e.waterReflectionEnabled&&this._waterReflectionEnabled!==e.waterReflectionEnabled&&(this._waterReflectionEnabled=e.waterReflectionEnabled,this._requestRender()),void 0!==e.opaqueTerrain&&this._opaqueTerrain!==e.opaqueTerrain&&(this._opaqueTerrain=e.opaqueTerrain,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlendWorking}modify(e){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:t,updates:n}=e;if(0===r.length&&0===t.length&&0===n.length)return;t.forAll((({id:e})=>this._content.delete(e))),r.forAll((e=>this._content.set(e.id,e)));const i=q(e);let a=!1;i.forEach(((e,r)=>{let t=this._materialRenderers.get(r);if(!t){if(!(e.adds.length>0))return;t=new Z(this._rctx,this._materialRepository,r),this._materialRenderers.set(r,t)}t.modify(e),t.isEmpty&&(a=!0)})),a&&this._materialRenderers.forEach(((e,r)=>{e.isEmpty&&(this._materialRenderers.delete(r),e.dispose())})),this._hasHighlights=s(this._materialRenderers,(e=>e.hasHighlights)),this._hasOccludees=s(this._materialRenderers,(e=>e.hasOccludees)),this._hasWater=s(this._materialRenderers,(e=>e.hasWater)),this._requestRender()}updateAnimation(e){return this._hasAnimations=!1,this._materialRenderers.forEach((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations}get animationTimestep(){return this._animationTimestep}updateLightSources(e,r,t){this._lighting.groundLightingFactor=r,this._lighting.globalFactor=t,this._lighting.set(e)}render(e,r,t,s){this._isRendering=!0,this.performanceInfo.prerender(this._rctx),this._bindParameters.lighting=this._lighting,this._renderContext.hasOccludees=this._hasOccludees,this._renderContext.transparencyPassType=w.NONE,this._bindParameters.transparencyPassType=w.NONE;const n=this._offscreenRendering;n.needLastFrameColorTexture=this.hasWaterReflection,n.advanceCurrentRenderTarget();const i=this._sliceHelper.plane;s===S.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),r.setGLViewport(this._rctx),this.needsShadowCast&&(this.renderPassManager.shadowCastingEnabled=!0),this._renderPlugins.prepareRender(r,t),this.performanceInfo.advance(se.Prepare);const o=this._computeDepthRange(r);this._renderShadowMap(e,r,this._lighting.lightingMainDirection,o),this.performanceInfo.advance(se.Shadowmap),n.initializeFrame(r),this._ensureBindParameters(r),this._renderLinearDepth(),this.performanceInfo.advance(se.Lineardepth),this._accumulateShadows(o,r,t),this._renderNormal(),this.performanceInfo.advance(se.Normals),this._ensureBindParametersSSR(),this._ssaoHelper.computeSSAO(r,n.linearDepthTexture,n.normalTexture),this.performanceInfo.advance(se.SSAO),this._renderContext.pass=G.MATERIAL,n.bindFramebuffer(),this._renderOpaqueGeometry(),this.performanceInfo.advance(se.Opaque);const d=this._multipassTerrain&&!this._opaqueTerrain;this._renderTerrainLinearDepth(d),this._setMultipassFlags(d),this._setTerrainCulling(d),this._renderEdges(Y.OPAQUE),this.performanceInfo.advance(se.OpaqueEdges),this._renderHiddenTransparentEdges(),this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry(),this.performanceInfo.advance(se.Transparent),this._renderGeometryLinearDepth(d);const l=this._renderHUDVisibility();d||this._renderInternalSlot(V.LINE_CALLOUTS),this.performanceInfo.advance(se.Hudvisibility),this._renderEdges(Y.TRANSPARENT,d),this.performanceInfo.advance(se.TransparentEdges),this._renderSlot(V.VOXEL),this._renderTransparentTerrain(),!this._opaqueTerrain&&l&&(d?this._renderLineCallouts(P.OCCLUDED):n.compositeTransparentTerrainOntoHUDVisibility(),this._renderHUD(P.OCCLUDED,n.framebuffer),this.performanceInfo.advance(se.HudOccluded)),this.performanceInfo.advance(se.TransparentTerrain),this._setTerrainCulling(!1),this._opaqueTerrain||(n.compositeTransparentTerrainOntoMain(),d&&(this._renderEdges(Y.OPAQUE),this.performanceInfo.advance(se.OpaqueEdges),this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry(),this.performanceInfo.advance(se.Transparent),this._renderEdges(Y.TRANSPARENT),this.performanceInfo.advance(se.TransparentEdges))),d&&this._renderLineCallouts(P.NOTOCCLUDED),this._setMultipassFlags(!1),this._shadowAccumulator.render(),n.renderToTargets((()=>{this._renderInternalSlot(V.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(V.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(V.LASERLINES)}),n.currentColorTarget,n.mainDepth),this.performanceInfo.advance(se.Atmosphere),this._renderPlugins.needsLaserlineWithContrastControl&&n.renderTmpAndCompositeToMain((()=>this._renderSlot(V.LASERLINES_CONTRAST_CONTROL)),$.PremultipliedAlpha),this.performanceInfo.advance(se.Laserline),this._renderOccluded(),this.performanceInfo.advance(se.Occluded);const _=s===S.ON&&this._magnifierHelper.enabled,p=_&&h(e)?this._offscreenRendering.getFramebuffer(this._offscreenRendering.tmpColor,this._offscreenRendering.tmpDepth):e;this._rctx.bindFramebuffer(p);const c=this._offscreenRendering.colorTexture;!this._renderAntiAliasing(this._antialiasing,c)&&a(c)&&this._compositingHelper.composite(c,$.None),this.performanceInfo.advance(se.Antialiasing),this._renderHUD(P.NOTOCCLUDED,p),this.performanceInfo.advance(se.HudNotoccluded),this._renderHighlights(p,this._bindParameters),this.performanceInfo.advance(se.Highlights),_&&this._magnifierHelper.render(this._rctx,this._bindParameters),p!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._offscreenRendering.tmpColorTexture,$.None)),this._renderContext.lastFrameCamera.copyFrom(this._renderContext.camera),this._sliceHelper.plane=i,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.postrender()}finish(e){if(this._hasAnimations||(this._animationTimestep=d(0)),e===H.BACKGROUND){this._rctx.gl.getError();const e=this.performanceInfo.elapsedTime/x;this._animationTimestep=d(Math.max(this._animationTimestep*oe+e*(1-oe),C))}}readDepthPixels(e,r,t,s,n,i){const a=this._offscreenRendering.bindTarget(this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e),this._renderContext.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=ne.COLOR_BUFFER_BIT|ne.DEPTH_BUFFER_BIT|ne.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(G.MATERIAL_DEPTH)}a.readPixels(r,t,s,n,ie.RGBA,ae.UNSIGNED_BYTE,i)}readAccumulatedShadow(e,r){return this._shadowAccumulator.readAccumulatedShadow(e,r)}_setMultipassFlags(e){this._renderContext.multipassTerrainParams.multipassTerrainEnabled=this._bindParameters.multipassTerrainEnabled=e,this._renderContext.multipassGeometryParams.multipassGeometryEnabled=this._bindParameters.multipassGeometryEnabled=e}_setTerrainCulling(e){this._renderContext.multipassTerrainParams.cullAboveGround=this._bindParameters.cullAboveGround=e}_renderSlot(e){this._renderContext.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;a(t)&&t.shouldRender()&&this._offscreenRendering.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),$.Alpha,r)}_renderShadowMap(e,r,t,s){const n=this._shadowMap;n.enabled&&(n.start(r,t,s),this.needsShadowHighlight?(this._renderShadowCascades(G.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT,this._shadowMap,(e=>n.takeCascadeSnapshotTo(e,ee))),n.clear(),this._renderShadowCascades(G.MATERIAL_DEPTH_SHADOWMAP_DEFAULT,this._shadowMap,(e=>{n.takeCascadeSnapshotTo(e,re),this._renderGeometryAndTransparentTerrainPass(G.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT)}))):this._renderShadowCascades(G.MATERIAL_DEPTH_SHADOWMAP_ALL),n.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.getCascades())s.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.enabled||this._renderPlugins.needsLinearDepth||this._hasWater&&this._waterReflectionEnabled||this.needsShadowHighlight||this.needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreenRendering.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(G.MATERIAL_DEPTH)),this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.linearDepth),this._renderContext.ssrParams.linearDepthTexture=this._bindParameters.linearDepthTexture=this._offscreenRendering.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.pass;this._renderContext.pass=G.MATERIAL_DEPTH,this._offscreenRendering.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreenRendering.terrainLinearDepth,this._offscreenRendering.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.terrainLinearDepth);this._renderContext.multipassTerrainParams.terrainLinearDepthTexture=this._bindParameters.terrainLinearDepthTexture=this._offscreenRendering.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.pass;this._offscreenRendering.renderToTargets((()=>this._renderGeometryPass(G.MATERIAL_DEPTH)),this._offscreenRendering.geometryLinearDepth,this._offscreenRendering.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.geometryLinearDepth);this._renderContext.multipassGeometryParams.geometryLinearDepthTexture=this._bindParameters.geometryLinearDepthTexture=this._offscreenRendering.geometryLinearDepthTexture}get needsNormal(){return this._ssaoHelper.enabled}_renderNormal(){this.needsNormal?this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(G.MATERIAL_NORMAL)}),this._offscreenRendering.normal,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.normal)}get needsDepthRange(){return this._shadowMap.enabled||this.needsShadowCast}_computeDepthRange(e){if(!this.needsDepthRange)return O;const r=L(e,this._content,this._stage.layers);return y(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.pass=e,this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.pass=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderOpaqueGeometry(){this._renderSlot(V.INTEGRATED_MESH),this._renderSlot(V.OPAQUE_TERRAIN),this._renderInternalSlot(V.OPAQUE_MATERIAL),this._renderSlot(V.OPAQUE_PLUGIN),this._renderSlot(V.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(V.TRANSPARENT_MATERIAL),this._renderSlot(V.TRANSPARENT_PLUGIN)}_renderTransparentTerrain(){this._renderSlot(V.TRANSPARENT_TERRAIN)}_renderHUDVisibility(){let e=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper?this._renderContext.offscreenRenderingHelper.hudVisibilityTexture:null,e=this._renderInternalSlot(V.OCCLUSION_PIXELS)}),this._multipassTerrain&&!this._opaqueTerrain),e}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===P.OCCLUDED?this._offscreenRendering.renderToTargets((()=>this._renderInternalSlot(V.LINE_CALLOUTS)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderInternalSlot(V.LINE_CALLOUTS)}_renderHUD(e,r){this._oitEnabled?(this._renderOrderIndependentTransparency((()=>this._renderHUDElements(e)),!0),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._offscreenRendering.hudColorTexture,$.PremultipliedAlpha)):e===P.OCCLUDED?this._offscreenRendering.renderToTargets((()=>this._renderHUDElements(P.OCCLUDED)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderHUDElements(e)}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._renderInternalSlot(V.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(V.HUD_MATERIAL),this._renderInternalSlot(V.LABEL_MATERIAL)}get needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlightHelper.isVisible&&this.needsHighlight}_renderHighlights(e,r){if(!this.needsHighlight)return void this._offscreenRendering.disposeTarget(this._offscreenRendering.highlight);const t=this._highlightHelper,s=t.profilingCallback&&he(this._renderContext.rctx);this._renderContext.highlightDepthTexture=r.highlightDepthTexture;const n=this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(G.MATERIAL_HIGHLIGHT),this._rctx.clearSafe(ne.DEPTH_BUFFER_BIT),this._renderHUDElements(P.BOTH)}),this._offscreenRendering.highlight,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=n.colorTexture,this.needsShadowHighlight&&this._shadowHighlightHelper.render(r,e),t.render(this._renderContext.camera,n,e),a(s)&&t.profilingCallback&&s.stop((e=>{t.profilingCallback&&t.profilingCallback(e)}))}get needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this.needsShadowCast&&(this._shadowAccumulator.setAccumulationDependencies(this._offscreenRendering.linearDepthTexture,e,r,t),this._shadowAccumulator.accumulateFixedSamples(),this.renderPassManager.shadowCastingEnabled=this._shadowMap.enabled)}_renderOrderIndependentTransparency(e,r){const t=t=>{this._renderContext.transparencyPassType=t,this._bindParameters.transparencyPassType=this._renderContext.transparencyPassType,this._offscreenRendering.renderOITPass((()=>e()),t,r)},s=this._renderContext.pass;this._renderContext.pass=G.MATERIAL_ALPHA,t(w.Alpha),this._renderContext.pass=G.MATERIAL,t(w.Color),t(w.FrontFace),this._offscreenRendering.compositeTransparentOntoOpaque(r),this._renderContext.transparencyPassType=w.NONE,this._bindParameters.transparencyPassType=this._renderContext.transparencyPassType,this._renderContext.pass=s}_renderOccluded(){let e=0;this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&t.renderOccluded===N.OccludeAndTransparentStencil&&(e|=t.renderOccluded,pe.push(t))}));const r=this._offscreenRendering,t=(t,s,n,i,a)=>{0!=(e&s)&&(r.renderToTargets(n,r.tmpColor,r.mainDepth,[0,0,0,0],i,a),r.compositeOccludedOntoMain(t))};0!==pe.length&&(this._renderInternalSlot(V.OCCLUDER_MATERIAL,pe),t(.5,N.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(V.TRANSPARENT_OCCLUDER_MATERIAL,pe)),!1,!1),pe.length=0),this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&(t.renderOccluded===N.OccludeAndTransparent||t.renderOccluded===N.Transparent||t.renderOccluded===N.Opaque)&&(e|=t.renderOccluded,_e.push(t))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const n=e=>{this._renderContext.renderOccludedMask=e,s>N.Occlude&&this._renderSlot(V.OCCLUDED_TERRAIN),this._renderInternalSlot(V.OPAQUE_MATERIAL,_e),this._renderInternalSlot(V.TRANSPARENT_MATERIAL,_e),this._renderInternalSlot(V.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,_e),this._renderContext.resetRenderOccludedMask()};this._renderContext.pass=G.MATERIAL,t(.5,N.OccludeAndTransparent,(()=>n(N.OccludeAndTransparent)),!0,D.OutlineVisualElementMask),t(.5,N.Transparent,(()=>n(N.Transparent)),!0,D.OutlineVisualElementMask),t(1,N.Opaque,(()=>n(N.Opaque)),!0,D.OutlineVisualElementMask),_e.length=0}_renderAntiAliasing(e,r){if(e===b.SMAA){if(this._smaaPass.enable((()=>this._requestRender()))&&a(r))return this._smaaPass.render(r),!0}else this._smaaPass.disable();return!1}_ensureCameraBindParameters(e){this._renderContext.camera=e,this._bindParameters.camera=this._renderContext.camera,this._bindParameters.inverseViewport[0]=1/this._renderContext.camera.fullViewport[2],this._bindParameters.inverseViewport[1]=1/this._renderContext.camera.fullViewport[3]}_ensureBindParameters(e){var r;this._ensureCameraBindParameters(e);const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.shadowMap=this._renderContext.shadowMap,this._bindParameters.shadowMappingEnabled=this._renderContext.shadowMap.enabled,this._bindParameters.ssaoHelper=this._renderContext.ssaoHelper,this._bindParameters.ssaoEnabled=this._renderContext.ssaoHelper.enabled,this._bindParameters.slicePlane=this._renderContext.sliceHelper.plane,this._bindParameters.hasOccludees=this._renderContext.hasOccludees,this._renderContext.multipassTerrainParams.camera=this._renderContext.camera,this._bindParameters.hudVisibilityTexture=t.hudVisibilityTexture,this._bindParameters.highlightDepthTexture=null!=(r=t.depthTexture)?r:this._getFallbackDepthTexture()}_ensureBindParametersSSR(){this.hasWaterReflection?(this._renderContext.lastFrameCamera.equals(this._renderContext.camera)?this._renderContext.ssrParams.reprojectionMatrix=this._reprojectionMatrix=f:(m(ce,this._renderContext.lastFrameCamera.viewMatrix,this._bindParameters.origin?this._bindParameters.origin:[0,0,0]),m(ue,this._renderContext.camera.viewMatrix,this._bindParameters.origin?this._bindParameters.origin:[0,0,0]),u(ue,ue),u(me,this._renderContext.camera.projectionMatrix),g(ge,ue,me),g(ge,ce,ge),g(ge,this._renderContext.lastFrameCamera.projectionMatrix,ge),this._renderContext.ssrParams.reprojectionMatrix=this._reprojectionMatrix=ge),this._renderContext.ssrParams.camera=this._renderContext.camera,this._renderContext.ssrParams.lastFrameColorTexture=this._bindParameters.lastFrameColorTexture=this._offscreenRendering.lastFrameColorTexture):this._renderContext.ssrParams.lastFrameColorTexture=this._bindParameters.lastFrameColorTexture=null,this._renderContext.ssrParams.ssrEnabled=this._bindParameters.ssrEnabled=this.hasWaterReflection}_renderInternalSlot(e,r){let t=!1;return this._bindParameters.slot=e,a(r)?r.forEach((r=>{if(!r.shouldRender(this._renderContext))return;const s=this._materialRenderers.get(r);a(s)&&(t=s.render(e,this._renderContext.pass,this._bindParameters)||t)})):this._materialRenderers.forEach(((r,s)=>{s.shouldRender(this._renderContext)&&(t=r.render(e,this._renderContext.pass,this._bindParameters)||t)})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=I(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){var e,r,t,s,n,i,a,h,o,d;return{offscreen:null!=(e=null==(r=this._offscreenRendering)?void 0:r.gpuMemoryUsage)?e:0,highlights:(null!=(t=null==(s=this._highlightHelper)?void 0:s.gpuMemoryUsage)?t:0)+(null!=(n=null==(i=this._shadowHighlightHelper)?void 0:i.gpuMemoryUsage)?n:0),shadows:null!=(a=null==(h=this._shadowMap)?void 0:h.gpuMemoryUsage)?a:0,ssao:null!=(o=null==(d=this._ssaoHelper)?void 0:d.gpuMemoryUsage)?o:0}}get test(){const e=this;return{offscreen:this._offscreenRendering,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlightHelper,lighting:this._lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,getFramebufferTexture:r=>{var t;switch(r){case le.Color:return e._offscreenRendering.colorTexture;case le.LinearDepth:return e._offscreenRendering.linearDepthTexture;case le.Normals:return e._offscreenRendering.normalTexture;case le.ShadowMap:return null==(t=e._shadowMap)?void 0:t.test.depthTexture;case le.HudVisibility:return e._offscreenRendering.hudVisibilityTexture;case le.Highlight:return e._offscreenRendering.highlightTexture}}}}};var le;e([_()],de.prototype,"_shadowAccumulator",void 0),e([_()],de.prototype,"_smaaPass",void 0),e([_()],de.prototype,"_antialiasing",void 0),e([_()],de.prototype,"_edgeView",void 0),e([_()],de.prototype,"updating",null),e([_()],de.prototype,"isCameraFinal",null),de=e([p("esri.views.3d.webgl-engine.lib.Renderer")],de),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(le||(le={}));const _e=[],pe=[],ce=T(),me=T(),ue=T(),ge=T();export{le as FramebufferId,de as Renderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import t from"../../../../core/Handles.js";import{someMap as s}from"../../../../core/MapUtils.js";import{destroyMaybe as n,disposeMaybe as i,isSome as a,isNone as h,unwrap as o}from"../../../../core/maybe.js";import{Milliseconds as d}from"../../../../core/time.js";import{init as l}from"../../../../core/watchUtils.js";import{property as _}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{v as c,j as m,a as u,m as g}from"../../../../chunks/mat4.js";import{I as f,c as T}from"../../../../chunks/mat4f64.js";import{a as R}from"../../../../chunks/vec2f64.js";import{MAXIMUM_ANIMATION_LOAD as E,MINIMUM_IDLE_ANIMATION_MS as A}from"../../support/animationUtils.js";import x from"../../support/debugFlags.js";import{RenderPassManager as C}from"../core/renderPasses/RenderPassManager.js";import{HUDTransparentRenderStyle as P}from"../core/shaderLibrary/hud/HUDUniforms.js";import{AntiAliasingMode as b,TransparencyPassType as w,Decorations as S,RenderRequestType as H,StencilBits as D}from"./basicInterfaces.js";import{BoundingInfo as M}from"./BoundingInfo.js";import{ZERO as O,union as L}from"./depthRange.js";import{depthRangeFromScene as I}from"./depthRangeUtils.js";import{createEmptyDepthTexture as y}from"./glUtil3D.js";import N from"./HighlightHelper.js";import{RenderOccludedFlag as v}from"./Material.js";import{OffscreenRendering as U}from"./OffscreenRendering.js";import{RenderContext as j}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as q}from"./rendererUtils.js";import{RenderPass as G}from"./RenderPass.js";import{RenderPluginManager as F}from"./RenderPluginManager.js";import{RenderSlot as V}from"./RenderSlot.js";import{ShadowAccumulator as B}from"./ShadowAccumulator.js";import{ShadowHighlightHelper as k}from"./ShadowHighlightHelper.js";import W from"./ShadowMap.js";import Q from"./SliceHelper.js";import{SmaaRenderPass as z}from"./SmaaRenderPass.js";import{SSAOHelper as X}from"./SSAOHelper.js";import{EdgeView as K}from"./edgeRendering/EdgeView.js";import{Transparency as Y}from"./edgeRendering/interfaces.js";import{SceneLighting as J}from"../lighting/SceneLighting.js";import{MergedRenderer as Z}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as $}from"../shaders/CompositingTechnique.js";import{HighlightShadowMapSlot as ee,DefaultSnapshotSlot as re}from"../shaders/ShadowHighlightTechnique.js";import{RendererPerformanceInfo as te,Statistics as se}from"../statistics/RendererPerformanceInfo.js";import{ClearBufferBit as ne,PixelFormat as ie,PixelType as ae}from"../../../webgl/enums.js";import{startMeasurement as he}from"../../../webgl/Measurement.js";const oe=.9;let de=class extends r{constructor(e,r,s,n,i,a,h,o,_){super({}),this._materialRepository=e,this._shaderTechniqueRepository=s,this._rctx=n,this._compositingHelper=i,this._magnifierHelper=a,this._requestRender=h,this._stage=_,this._materialRenderers=new Map,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasOccludees=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._content=new Map,this._isRendering=!1,this._fallbackDepthStencilTexture=null,this.performanceInfo=new te,this._antialiasing=b.SMAA,this._oitEnabled=!1,this._multipassTerrain=!0,this._opaqueTerrain=!0,this._lighting=new J,this._hasAnimations=!1,this._animationTimestep=d(0),this._handles=new t,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this._smaaPass=new z(this._rctx,s),this._oitEnabled=this._hasOITSupport,this._requestRender(),this._offscreenRendering=new U(this._rctx,this._compositingHelper),this._sliceHelper=new Q,this._shadowMap=new W(this._rctx,_.viewingMode,2),this._ssaoHelper=new X(s,this._rctx,(()=>this._requestRender())),this._highlightHelper=new N(s,this._rctx),this._shadowHighlightHelper=new k(this._rctx,_.viewingMode),this._shadowAccumulator=new B(this._rctx,s,_,((e,r)=>{this.renderPassManager.shadowCastingEnabled=!0,this._renderPlugins.prepareRender(e,r),this.renderPassManager.shadowCastingEnabled=this._shadowMap.enabled}),((e,r,t,s)=>{e.start(t,r,s),this._renderShadowCascades(G.MATERIAL_DEPTH_SHADOWMAP_ALL,e),t.setGLViewport(this._rctx),this._ensureCameraBindParameters(t)}),(()=>this._requestRender())),this._bindParameters={slot:null,camera:null,inverseViewport:R(),shadowMap:this._shadowMap,shadowMappingEnabled:this._shadowMap.enabled,ssaoHelper:this._ssaoHelper,ssaoEnabled:this._ssaoHelper.enabled,origin:null,screenToWorldRatio:null,screenToPCSRatio:null,slicePlane:this._sliceHelper.plane,highlightDepthTexture:null,hasOccludees:!1,linearDepthTexture:null,terrainLinearDepthTexture:null,geometryLinearDepthTexture:null,multipassTerrainEnabled:!1,multipassGeometryEnabled:!1,cullAboveGround:!1,lastFrameColorTexture:null,reprojectionMatrix:f,ssrEnabled:!1,lighting:this._lighting,highlightColorTexture:null},this._renderContext=new j(this._rctx,this._offscreenRendering,this._lighting,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderContext.multipassTerrainParams={camera:null,multipassTerrainEnabled:!1,cullAboveGround:!1,terrainLinearDepthTexture:null},this._renderContext.multipassGeometryParams={multipassGeometryEnabled:!1,geometryLinearDepthTexture:null},this._renderContext.ssrParams={camera:null,linearDepthTexture:null,lastFrameColorTexture:null,reprojectionMatrix:f,ssrEnabled:!1},this._renderPlugins=new F({renderContext:this._renderContext,shaderTechniqueRep:s,textureRep:r,materialRep:this._materialRepository,requestRender:this._requestRender,schedule:o}),this.renderPassManager=new C(this._rctx,this._shaderTechniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([l(x,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(Y.TRANSPARENT):()=>{},this._requestRender()})),l(this._stage,"camera",(()=>this._requestRender()),!0)])}get hasWater(){return this._hasWater||this._hasOverlayWater}get hasWaterReflection(){return this.hasWater&&this._waterReflectionEnabled}normalizeCtorArgs(){return{}}dispose(){this._handles.destroy(),this._smaaPass.dispose(),this._materialRenderers.forEach((e=>e.dispose())),this._materialRenderers.clear(),this._edgeView=n(this._edgeView),this._offscreenRendering.dispose(),this._fallbackDepthStencilTexture=i(this._fallbackDepthStencilTexture),this._shadowMap.enabled=!1,this._shadowMap.dispose(),this._ssaoHelper.enabled=!1,this._ssaoHelper.dispose(),this._highlightHelper.dispose(),this._shadowHighlightHelper.dispose(),this._shadowAccumulator.dispose(),M.prune(),this._content.clear()}get updating(){return this._antialiasing===b.SMAA&&this._smaaPass.updating||a(this._edgeView)&&this._edgeView.updating||this._shadowAccumulator.running||!this.isCameraFinal}ensureEdgeView(){return h(this._edgeView)&&(this._edgeView=new K({rctx:this._rctx,renderSR:this._stage.renderSR,techniqueRepository:this._shaderTechniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:e=>this._stage.resourceController.schedule(e)}),this._handles.add(this._edgeView.watch("updating",(()=>this._requestRender()),!0)),this._requestRender()),this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return null===this._bindParameters.reprojectionMatrix||c(this._bindParameters.reprojectionMatrix,f)}set _reprojectionMatrix(e){c(this._bindParameters.reprojectionMatrix,e)||(this._bindParameters.reprojectionMatrix=e,this.notifyChange("isCameraFinal"))}get hasShadowsEnabled(){var e;return!(null==(e=this._shadowMap)||!e.enabled)}setRenderParameters(e){const{renderPassManager:r,_shadowMap:t,_ssaoHelper:s}=this;void 0!==e.screenSpaceReflectionsEnabled&&r.screenSpaceReflectionsEnabled!==e.screenSpaceReflectionsEnabled&&(r.screenSpaceReflectionsEnabled=e.screenSpaceReflectionsEnabled,this._requestRender()),void 0===e.shadowMap||t.enabled===e.shadowMap&&r.shadowCastingEnabled===e.shadowMap||(t.enabled=e.shadowMap,r.shadowCastingEnabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),void 0!==e.ssao&&s.enabled!==e.ssao&&(s.enabled=e.ssao,this._requestRender()),e.background&&this._offscreenRendering.background!==e.background&&(this._offscreenRendering.background=e.background,this._requestRender());const n=e.antialiasingEnabled?b.SMAA:b.NONE;void 0!==e.antialiasingEnabled&&this._antialiasing!==n&&(this._antialiasing=n,this._requestRender()),void 0!==e.highQualityTransparency&&this._multipassTerrain!==e.highQualityTransparency&&(this._multipassTerrain=e.highQualityTransparency,this._oitEnabled=e.highQualityTransparency&&this._hasOITSupport,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlightHelper.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlightHelper.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=o(e.slicePlane),this._requestRender()),void 0!==e.waterReflectionEnabled&&this._waterReflectionEnabled!==e.waterReflectionEnabled&&(this._waterReflectionEnabled=e.waterReflectionEnabled,this._requestRender()),void 0!==e.opaqueTerrain&&this._opaqueTerrain!==e.opaqueTerrain&&(this._opaqueTerrain=e.opaqueTerrain,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlendWorking}modify(e){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:t,updates:n}=e;if(0===r.length&&0===t.length&&0===n.length)return;t.forAll((({id:e})=>this._content.delete(e))),r.forAll((e=>this._content.set(e.id,e)));const i=q(e);let a=!1;i.forEach(((e,r)=>{let t=this._materialRenderers.get(r);if(!t){if(!(e.adds.length>0))return;t=new Z(this._rctx,this._materialRepository,r),this._materialRenderers.set(r,t)}t.modify(e),t.isEmpty&&(a=!0)})),a&&this._materialRenderers.forEach(((e,r)=>{e.isEmpty&&(this._materialRenderers.delete(r),e.dispose())})),this._hasHighlights=s(this._materialRenderers,(e=>e.hasHighlights)),this._hasOccludees=s(this._materialRenderers,(e=>e.hasOccludees)),this._hasWater=s(this._materialRenderers,(e=>e.hasWater)),this._needsTransparentPass=s(this._materialRenderers,(e=>e.requiresSlot(V.TRANSPARENT_MATERIAL,G.MATERIAL))),this._hasHUDElements=s(this._materialRenderers,(e=>e.requiresSlot(V.LINE_CALLOUTS_HUD_DEPTH,G.MATERIAL)||e.requiresSlot(V.HUD_MATERIAL,G.MATERIAL)||e.requiresSlot(V.LABEL_MATERIAL,G.MATERIAL))),this._requestRender()}updateAnimation(e){return this._hasAnimations=!1,this._materialRenderers.forEach((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations}get animationTimestep(){return this._animationTimestep}updateLightSources(e,r,t){this._lighting.groundLightingFactor=r,this._lighting.globalFactor=t,this._lighting.set(e)}render(e,r,t,s){this._isRendering=!0,this.performanceInfo.prerender(this._rctx),this._bindParameters.lighting=this._lighting,this._renderContext.hasOccludees=this._hasOccludees,this._renderContext.transparencyPassType=w.NONE,this._bindParameters.transparencyPassType=w.NONE;const n=this._offscreenRendering;n.needLastFrameColorTexture=this.hasWaterReflection,n.advanceCurrentRenderTarget();const i=this._sliceHelper.plane;s===S.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),r.setGLViewport(this._rctx),this.needsShadowCast&&(this.renderPassManager.shadowCastingEnabled=!0),this._renderPlugins.prepareRender(r,t),this.performanceInfo.advance(se.Prepare);const o=this._computeDepthRange(r);this._renderShadowMap(e,r,this._lighting.lightingMainDirection,o),this.performanceInfo.advance(se.Shadowmap),n.initializeFrame(r),this._ensureBindParameters(r),this._renderLinearDepth(),this.performanceInfo.advance(se.Lineardepth),this._accumulateShadows(o,r,t),this._renderNormal(),this.performanceInfo.advance(se.Normals),this._ensureBindParametersSSR(),this._ssaoHelper.computeSSAO(r,n.linearDepthTexture,n.normalTexture),this.performanceInfo.advance(se.SSAO),this._renderContext.pass=G.MATERIAL,n.bindFramebuffer(),this._renderOpaqueGeometry(),this.performanceInfo.advance(se.Opaque);const d=this._multipassTerrain&&!this._opaqueTerrain;this._renderTerrainLinearDepth(d),this._setMultipassFlags(d),this._setTerrainCulling(d),this._renderEdges(Y.OPAQUE),this.performanceInfo.advance(se.OpaqueEdges),this._renderHiddenTransparentEdges();const l=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;l&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(se.Transparent),this._renderGeometryLinearDepth(d);const _=this._renderHUDVisibility();d||this._renderInternalSlot(V.LINE_CALLOUTS),this.performanceInfo.advance(se.Hudvisibility),this._renderEdges(Y.TRANSPARENT,d),this.performanceInfo.advance(se.TransparentEdges),this._renderSlot(V.VOXEL),this._renderTransparentTerrain(),!this._opaqueTerrain&&_&&(d?this._renderLineCallouts(P.OCCLUDED):n.compositeTransparentTerrainOntoHUDVisibility(),this._renderHUD(P.OCCLUDED,n.framebuffer),this.performanceInfo.advance(se.HudOccluded)),this.performanceInfo.advance(se.TransparentTerrain),this._setTerrainCulling(!1),this._opaqueTerrain||(n.compositeTransparentTerrainOntoMain(),d&&(this._renderEdges(Y.OPAQUE),this.performanceInfo.advance(se.OpaqueEdges),l&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(se.Transparent),this._renderEdges(Y.TRANSPARENT),this.performanceInfo.advance(se.TransparentEdges))),d&&this._renderLineCallouts(P.NOTOCCLUDED),this._setMultipassFlags(!1),this._shadowAccumulator.render(),n.renderToTargets((()=>{this._renderInternalSlot(V.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(V.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(V.LASERLINES)}),n.currentColorTarget,n.mainDepth),this.performanceInfo.advance(se.Atmosphere),this._renderPlugins.needsLaserlineWithContrastControl&&n.renderTmpAndCompositeToMain((()=>this._renderSlot(V.LASERLINES_CONTRAST_CONTROL)),$.PremultipliedAlpha),this.performanceInfo.advance(se.Laserline),this._renderOccluded(),this.performanceInfo.advance(se.Occluded);const p=s===S.ON&&this._magnifierHelper.enabled,c=p&&h(e)?this._offscreenRendering.getFramebuffer(this._offscreenRendering.tmpColor,this._offscreenRendering.tmpDepth):e;this._rctx.bindFramebuffer(c);const m=this._offscreenRendering.colorTexture;!this._renderAntiAliasing(this._antialiasing,m)&&a(m)&&this._compositingHelper.composite(m,$.None),this.performanceInfo.advance(se.Antialiasing),this._renderHUD(P.NOTOCCLUDED,c),this.performanceInfo.advance(se.HudNotoccluded),this._renderHighlights(c,this._bindParameters),this.performanceInfo.advance(se.Highlights),p&&this._magnifierHelper.render(this._rctx,this._bindParameters),c!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._offscreenRendering.tmpColorTexture,$.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._renderContext.camera),this._sliceHelper.plane=i,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.postrender()}finish(e){if(this._hasAnimations||(this._animationTimestep=d(0)),e===H.BACKGROUND){this._rctx.gl.getError();const e=this.performanceInfo.elapsedTime/E;this._animationTimestep=d(Math.max(this._animationTimestep*oe+e*(1-oe),A))}}readDepthPixels(e,r,t,s,n,i){const a=this._offscreenRendering.bindTarget(this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e),this._renderContext.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=ne.COLOR_BUFFER_BIT|ne.DEPTH_BUFFER_BIT|ne.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(G.MATERIAL_DEPTH)}a.readPixels(r,t,s,n,ie.RGBA,ae.UNSIGNED_BYTE,i)}readAccumulatedShadow(e,r){return this._shadowAccumulator.readAccumulatedShadow(e,r)}_setMultipassFlags(e){this._renderContext.multipassTerrainParams.multipassTerrainEnabled=this._bindParameters.multipassTerrainEnabled=e,this._renderContext.multipassGeometryParams.multipassGeometryEnabled=this._bindParameters.multipassGeometryEnabled=e}_setTerrainCulling(e){this._renderContext.multipassTerrainParams.cullAboveGround=this._bindParameters.cullAboveGround=e}_renderSlot(e){this._renderContext.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;a(t)&&t.shouldRender()&&this._offscreenRendering.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),$.Alpha,r)}_renderShadowMap(e,r,t,s){const n=this._shadowMap;n.enabled&&(n.start(r,t,s),this.needsShadowHighlight?(this._renderShadowCascades(G.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT,this._shadowMap,(e=>n.takeCascadeSnapshotTo(e,ee))),n.clear(),this._renderShadowCascades(G.MATERIAL_DEPTH_SHADOWMAP_DEFAULT,this._shadowMap,(e=>{n.takeCascadeSnapshotTo(e,re),this._renderGeometryAndTransparentTerrainPass(G.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT)}))):this._renderShadowCascades(G.MATERIAL_DEPTH_SHADOWMAP_ALL),n.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.getCascades())s.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.enabled||this._renderPlugins.needsLinearDepth||this._hasWater&&this._waterReflectionEnabled||this.needsShadowHighlight||this.needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreenRendering.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(G.MATERIAL_DEPTH)),this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.linearDepth),this._renderContext.ssrParams.linearDepthTexture=this._bindParameters.linearDepthTexture=this._offscreenRendering.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.pass;this._renderContext.pass=G.MATERIAL_DEPTH,this._offscreenRendering.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreenRendering.terrainLinearDepth,this._offscreenRendering.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.terrainLinearDepth);this._renderContext.multipassTerrainParams.terrainLinearDepthTexture=this._bindParameters.terrainLinearDepthTexture=this._offscreenRendering.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.pass;this._offscreenRendering.renderToTargets((()=>this._renderGeometryPass(G.MATERIAL_DEPTH)),this._offscreenRendering.geometryLinearDepth,this._offscreenRendering.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.geometryLinearDepth);this._renderContext.multipassGeometryParams.geometryLinearDepthTexture=this._bindParameters.geometryLinearDepthTexture=this._offscreenRendering.geometryLinearDepthTexture}get needsNormal(){return this._ssaoHelper.enabled}_renderNormal(){this.needsNormal?this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(G.MATERIAL_NORMAL)}),this._offscreenRendering.normal,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.normal)}get needsDepthRange(){return this._shadowMap.enabled||this.needsShadowCast}_computeDepthRange(e){if(!this.needsDepthRange)return O;const r=I(e,this._content,this._stage.layers);return L(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.pass=e,this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.pass=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderOpaqueGeometry(){this._renderSlot(V.INTEGRATED_MESH),this._renderSlot(V.OPAQUE_TERRAIN),this._renderInternalSlot(V.OPAQUE_MATERIAL),this._renderSlot(V.OPAQUE_PLUGIN),this._renderSlot(V.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(V.TRANSPARENT_MATERIAL),this._renderSlot(V.TRANSPARENT_PLUGIN)}_renderTransparentTerrain(){this._renderSlot(V.TRANSPARENT_TERRAIN)}_renderHUDVisibility(){let e=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,e=this._renderInternalSlot(V.OCCLUSION_PIXELS)}),this._multipassTerrain&&!this._opaqueTerrain),e}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===P.OCCLUDED?this._offscreenRendering.renderToTargets((()=>this._renderInternalSlot(V.LINE_CALLOUTS)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderInternalSlot(V.LINE_CALLOUTS)}_renderHUD(e,r){this._hasHUDElements&&(this._oitEnabled?(this._renderOrderIndependentTransparency((()=>this._renderHUDElements(e)),!0),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._offscreenRendering.hudColorTexture,$.PremultipliedAlpha)):e===P.OCCLUDED?this._offscreenRendering.renderToTargets((()=>this._renderHUDElements(P.OCCLUDED)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderHUDElements(e))}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._renderInternalSlot(V.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(V.HUD_MATERIAL),this._renderInternalSlot(V.LABEL_MATERIAL)}get needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlightHelper.isVisible&&this.needsHighlight}_renderHighlights(e,r){if(!this.needsHighlight)return void this._offscreenRendering.disposeTarget(this._offscreenRendering.highlight);const t=this._highlightHelper,s=t.profilingCallback&&he(this._renderContext.rctx);this._renderContext.highlightDepthTexture=r.highlightDepthTexture;const n=this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(G.MATERIAL_HIGHLIGHT),this._rctx.clearSafe(ne.DEPTH_BUFFER_BIT),this._renderHUDElements(P.BOTH)}),this._offscreenRendering.highlight,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=n.colorTexture,this.needsShadowHighlight&&this._shadowHighlightHelper.render(r,e),t.render(this._renderContext.camera,n,e),a(s)&&t.profilingCallback&&s.stop((e=>{t.profilingCallback&&t.profilingCallback(e)}))}get needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this.needsShadowCast&&(this._shadowAccumulator.setAccumulationDependencies(this._offscreenRendering.linearDepthTexture,e,r,t),this._shadowAccumulator.accumulateFixedSamples(),this.renderPassManager.shadowCastingEnabled=this._shadowMap.enabled)}_renderOrderIndependentTransparency(e,r){const t=t=>{this._renderContext.transparencyPassType=t,this._bindParameters.transparencyPassType=this._renderContext.transparencyPassType,this._offscreenRendering.renderOITPass((()=>e()),t,r)},s=this._renderContext.pass;this._renderContext.pass=G.MATERIAL_ALPHA,t(w.Alpha),this._renderContext.pass=G.MATERIAL,t(w.Color),t(w.FrontFace),this._offscreenRendering.compositeTransparentOntoOpaque(r),this._renderContext.transparencyPassType=w.NONE,this._bindParameters.transparencyPassType=this._renderContext.transparencyPassType,this._renderContext.pass=s,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreenRendering.disposeTarget(this._offscreenRendering.alphaFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.colorFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.frontFaceTarget)),this._oitUsed=!1}_renderOccluded(){let e=0;this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&t.renderOccluded===v.OccludeAndTransparentStencil&&(e|=t.renderOccluded,pe.push(t))}));const r=this._offscreenRendering,t=(t,s,n,i,a)=>{0!=(e&s)&&(r.renderToTargets(n,r.tmpColor,r.mainDepth,[0,0,0,0],i,a),r.compositeOccludedOntoMain(t))};0!==pe.length&&(this._renderInternalSlot(V.OCCLUDER_MATERIAL,pe),t(.5,v.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(V.TRANSPARENT_OCCLUDER_MATERIAL,pe)),!1,!1),pe.length=0),this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&(t.renderOccluded===v.OccludeAndTransparent||t.renderOccluded===v.Transparent||t.renderOccluded===v.Opaque)&&(e|=t.renderOccluded,_e.push(t))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const n=e=>{this._renderContext.renderOccludedMask=e,s>v.Occlude&&this._renderSlot(V.OCCLUDED_TERRAIN),this._renderInternalSlot(V.OPAQUE_MATERIAL,_e),this._renderInternalSlot(V.TRANSPARENT_MATERIAL,_e),this._renderInternalSlot(V.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,_e),this._renderContext.resetRenderOccludedMask()};this._renderContext.pass=G.MATERIAL,t(.5,v.OccludeAndTransparent,(()=>n(v.OccludeAndTransparent)),!0,D.OutlineVisualElementMask),t(.5,v.Transparent,(()=>n(v.Transparent)),!0,D.OutlineVisualElementMask),t(1,v.Opaque,(()=>n(v.Opaque)),!0,D.OutlineVisualElementMask),_e.length=0}_renderAntiAliasing(e,r){if(e===b.SMAA){if(this._smaaPass.enable((()=>this._requestRender()))&&a(r))return this._smaaPass.render(r),!0}else this._smaaPass.disable();return!1}_ensureCameraBindParameters(e){this._renderContext.camera=e,this._bindParameters.camera=this._renderContext.camera,this._bindParameters.inverseViewport[0]=1/this._renderContext.camera.fullViewport[2],this._bindParameters.inverseViewport[1]=1/this._renderContext.camera.fullViewport[3]}_ensureBindParameters(e){var r;this._ensureCameraBindParameters(e);const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.shadowMap=this._renderContext.shadowMap,this._bindParameters.shadowMappingEnabled=this._renderContext.shadowMap.enabled,this._bindParameters.ssaoHelper=this._renderContext.ssaoHelper,this._bindParameters.ssaoEnabled=this._renderContext.ssaoHelper.enabled,this._bindParameters.slicePlane=this._renderContext.sliceHelper.plane,this._bindParameters.hasOccludees=this._renderContext.hasOccludees,this._renderContext.multipassTerrainParams.camera=this._renderContext.camera,this._bindParameters.hudVisibilityTexture=t.hudVisibilityTexture,this._bindParameters.highlightDepthTexture=null!=(r=t.depthTexture)?r:this._getFallbackDepthTexture()}_ensureBindParametersSSR(){this.hasWaterReflection?(this._renderContext.lastFrameCamera.equals(this._renderContext.camera)?this._renderContext.ssrParams.reprojectionMatrix=this._reprojectionMatrix=f:(m(ce,this._renderContext.lastFrameCamera.viewMatrix,this._bindParameters.origin?this._bindParameters.origin:[0,0,0]),m(ue,this._renderContext.camera.viewMatrix,this._bindParameters.origin?this._bindParameters.origin:[0,0,0]),u(ue,ue),u(me,this._renderContext.camera.projectionMatrix),g(ge,ue,me),g(ge,ce,ge),g(ge,this._renderContext.lastFrameCamera.projectionMatrix,ge),this._renderContext.ssrParams.reprojectionMatrix=this._reprojectionMatrix=ge),this._renderContext.ssrParams.camera=this._renderContext.camera,this._renderContext.ssrParams.lastFrameColorTexture=this._bindParameters.lastFrameColorTexture=this._offscreenRendering.lastFrameColorTexture):this._renderContext.ssrParams.lastFrameColorTexture=this._bindParameters.lastFrameColorTexture=null,this._renderContext.ssrParams.ssrEnabled=this._bindParameters.ssrEnabled=this.hasWaterReflection}_renderInternalSlot(e,r){let t=!1;return this._bindParameters.slot=e,a(r)?r.forEach((r=>{if(!r.shouldRender(this._renderContext))return;const s=this._materialRenderers.get(r);a(s)&&(t=s.render(e,this._renderContext.pass,this._bindParameters)||t)})):this._materialRenderers.forEach(((r,s)=>{s.shouldRender(this._renderContext)&&(t=r.render(e,this._renderContext.pass,this._bindParameters)||t)})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=y(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){var e,r,t,s,n,i,a,h,o,d;return{offscreen:null!=(e=null==(r=this._offscreenRendering)?void 0:r.gpuMemoryUsage)?e:0,highlights:(null!=(t=null==(s=this._highlightHelper)?void 0:s.gpuMemoryUsage)?t:0)+(null!=(n=null==(i=this._shadowHighlightHelper)?void 0:i.gpuMemoryUsage)?n:0),shadows:null!=(a=null==(h=this._shadowMap)?void 0:h.gpuMemoryUsage)?a:0,ssao:null!=(o=null==(d=this._ssaoHelper)?void 0:d.gpuMemoryUsage)?o:0}}get test(){const e=this;return{offscreen:this._offscreenRendering,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlightHelper,lighting:this._lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,getFramebufferTexture:r=>{var t;switch(r){case le.Color:return e._offscreenRendering.colorTexture;case le.LinearDepth:return e._offscreenRendering.linearDepthTexture;case le.Normals:return e._offscreenRendering.normalTexture;case le.ShadowMap:return null==(t=e._shadowMap)?void 0:t.test.depthTexture;case le.HudVisibility:return e._offscreenRendering.hudVisibilityTexture;case le.Highlight:return e._offscreenRendering.highlightTexture}}}}};var le;e([_()],de.prototype,"_shadowAccumulator",void 0),e([_()],de.prototype,"_smaaPass",void 0),e([_()],de.prototype,"_antialiasing",void 0),e([_()],de.prototype,"_edgeView",void 0),e([_()],de.prototype,"updating",null),e([_()],de.prototype,"isCameraFinal",null),de=e([p("esri.views.3d.webgl-engine.lib.Renderer")],de),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(le||(le={}));const _e=[],pe=[],ce=T(),me=T(),ue=T(),ge=T();export{le as FramebufferId,de as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as e}from"../../../../../core/maybe.js";import{isAborted as t,throwIfAborted as s}from"../../../../../core/promiseUtils.js";import{I as a,c as n}from"../../../../../chunks/mat4f64.js";import{a as i}from"../../../../../chunks/vec2f64.js";import{f as r,d as l,m as o}from"../../../../../chunks/vec3.js";import{c}from"../../../../../chunks/vec3f64.js";import{c as h}from"../../../../../chunks/vec4f64.js";import d from"../../../support/debugFlags.js";import{glLayout as u}from"../../../support/buffer/glUtil.js";import{bindOutputHighlight as _}from"../../core/shaderLibrary/output/OutputHighlight.glsl.js";import p from"../Camera.js";import{Default3D as m}from"../DefaultVertexAttributeLocations.js";import{IntersectorType as f}from"../IntersectorInterfaces.js";import{DepthOrder as g}from"../Octree.js";import{RenderPass as I}from"../RenderPass.js";import{RenderSlot as D}from"../RenderSlot.js";import{assert as y}from"../Util.js";import{InstanceData as v,StateFlags as E}from"./InstanceData.js";import{InstanceOctree as R}from"./InstanceOctree.js";import{LevelSelector as T}from"./LevelSelector.js";import{LodLevel as b}from"./LodLevel.js";import{RenderInstanceData as C}from"./RenderInstanceData.js";import{getInstanceBufferLayout as A}from"../../materials/DefaultMaterial.js";import{colorMixModes as L}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as S}from"../../materials/renderers/utils.js";import{bindVertexBufferLayout as U,unbindVertexBufferLayout as x}from"../../../../webgl/Util.js";let O=function(e){const t=e.baseBoundingSphere.radius,s=e.levels.map((e=>e.minScreenSpaceRadius));return new T(t,s)};function P(e){O=e}class H{constructor(e,t,s,a){this.type=f.LOD,this.isGround=!1,this._inverseViewport=i(),this._levels=[],this._defaultRenderInstanceData=[],this._highlightRenderInstanceData=[],this._instanceIndex=0,this._slicePlane=!1,this._enableLevelSelection=!0,this._lastCamera=new p,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.canRender=!0,this._symbol=e,this._optionalFields=t,this._metadata=s,this._instanceBufferLayout=A({instancedDoublePrecision:!0,instanced:t}),this._glInstanceBufferLayout=u(this._instanceBufferLayout,1),this._instanceData=new v(this._optionalFields,a),this._instanceData.on("instance-added",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-removed",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-transform-changed",(e=>{this._requestUpdateCycle(),this._metadata.notifyGraphicGeometryChanged(e.index)})),this._instanceData.on("instance-visibility-changed",(e=>{this._requestUpdateCycle(!0),this._metadata.notifyGraphicVisibilityChanged(e.index)})),this._instanceData.on("instance-highlight-changed",(()=>this._requestUpdateCycle(!0))),this._enableLevelSelection=this._symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this._metadata.layerUid}get instanceData(){return this._instanceData}get memoryUsage(){const e={cpu:0,gpu:0};return this._defaultRenderInstanceData.forEach((t=>{const s=t.memoryUsage;e.cpu+=s.cpu,e.gpu+=s.gpu})),this._highlightRenderInstanceData.forEach((t=>{const s=t.memoryUsage;e.cpu+=s.cpu,e.gpu+=s.gpu})),e}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach(((e,s)=>{const a=this._defaultRenderInstanceData[s],n=this._highlightRenderInstanceData[s],i=a.size+n.size,r=e.triangleCount;t.push({renderedInstances:i,renderedTriangles:i*r,trianglesPerInstance:r})})),{totalInstances:e,renderedInstances:t.reduce(((e,t)=>e+t.renderedInstances),0),renderedTriangles:t.reduce(((e,t)=>e+t.renderedTriangles),0),levels:t}}async initializeRenderContext(e,a){this._context=e;const n=e.renderContext.rctx,i=await Promise.allSettled(this._symbol.levels.map((t=>(this._defaultRenderInstanceData.push(new C(n,this._instanceBufferLayout)),this._highlightRenderInstanceData.push(new C(n,this._instanceBufferLayout)),b.create(e,t,a))))),r=i.map((e=>"fulfilled"===e.status?e.value:null)).filter((e=>e));if(t(a)||r.length!==i.length){r.forEach((e=>e.destroy())),s(a);for(const e of i)if("rejected"===e.status)throw e.reason}this._levels=r,this._levelSelector=O(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach((e=>e.destroy())),this._defaultRenderInstanceData.forEach((e=>e.destroy())),this._highlightRenderInstanceData.forEach((e=>e.destroy()))}get slots(){return[D.OPAQUE_PLUGIN,D.TRANSPARENT_PLUGIN]}get needsHighlight(){return this._highlightRenderInstanceData.reduce(((e,t)=>e+t.size),0)>0}prepareRender(e,t){if(d.LOD_INSTANCE_RENDERER_DISABLE_UPDATES)return;if(this._enableLevelSelection){const e=t.equals(this._lastCamera);this._lastCamera.copyFrom(t),e||this._requestUpdateCycle()}const s=this._needFullCycle?this._instanceData.size:2e3;this._needFullCycle=!1,this._updateInstances(t,s),this.needsUpdates&&this._context.requestRender()}render(e){var t,s;const n=e.slot===D.OPAQUE_PLUGIN?D.OPAQUE_MATERIAL:e.slot===D.TRANSPARENT_PLUGIN?D.TRANSPARENT_MATERIAL:null;if(!n||!this.baseMaterial.isVisible()||!this.baseMaterial.isVisibleInPass(e.pass))return;const i=e.camera;this._inverseViewport[0]=1/i.fullViewport[2],this._inverseViewport[1]=1/i.fullViewport[3];const r={slot:n,origin:[0,0,0],camera:i,inverseViewport:this._inverseViewport,shadowMap:e.shadowMap,shadowMappingEnabled:e.shadowMap.enabled,ssaoHelper:e.ssaoHelper,ssaoEnabled:e.ssaoHelper.enabled,screenToWorldRatio:null,screenToPCSRatio:null,slicePlane:e.sliceHelper&&e.sliceHelper.plane,hudVisibilityTexture:e.offscreenRenderingHelper?e.offscreenRenderingHelper.hudVisibilityTexture:null,highlightDepthTexture:null!=(t=null==(s=e.offscreenRenderingHelper)?void 0:s.depthTexture)?t:null,hasOccludees:!1,linearDepthTexture:null,lastFrameColorTexture:null,reprojectionMatrix:a,ssrEnabled:!1,lighting:e.scenelightingData,transparencyPassType:e.transparencyPassType,terrainLinearDepthTexture:e.multipassTerrainParams.terrainLinearDepthTexture,geometryLinearDepthTexture:e.multipassGeometryParams.geometryLinearDepthTexture,multipassTerrainEnabled:e.multipassTerrainParams.multipassTerrainEnabled,cullAboveGround:e.multipassTerrainParams.cullAboveGround,multipassGeometryEnabled:e.multipassGeometryParams.multipassGeometryEnabled,highlightColorTexture:null};e.rctx.bindVAO();const l=e.pass!==I.MATERIAL_HIGHLIGHT&&e.pass!==I.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT,o=e.pass!==I.MATERIAL_DEPTH_SHADOWMAP_DEFAULT;l&&this._renderComponents(e,n,r,this._defaultRenderInstanceData),o&&this._renderComponents(e,n,r,this._highlightRenderInstanceData)}intersect(e,t,s,a){if(!this.baseMaterial.isVisible())return;const n=c();r(n,a,s);const i=n=>{this._instanceData.getCombinedModelTransform(n,G),e.transform.set(G),o(N,s,e.transform.inverse),o(F,a,e.transform.inverse);const i=this._instanceData.getState(n),r=this._instanceData.getLodLevel(n);y(i&E.ACTIVE,"invalid instance state"),y(r>=0&&r<this._levels.length,"invaid lod level"),this._levels[r].intersect(e,t,N,F,n,this._metadata)};this.baseMaterial.parameters.verticalOffset?this.octree.forEach(i):this.octree.forEachAlongRay(s,n,i)}queryDepthRange(e){return this._queryDepthRangeOctree(e)}notifyShaderTransformationChanged(){this._invalidateOctree()}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,e&&(this._needFullCycle=!0),this.needsUpdates&&this._context.requestRender()}get needsUpdates(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}get octree(){return this._octree||(this._octree=this._buildOctree()),this._octree}_invalidateOctree(){this._octree&&(this._octree.destroy(),this._octree=null)}_buildOctree(){const e=new R(this._instanceData,this.baseBoundingSphere),t=this._instanceData,s=t.view?t.view.state:null;for(let a=0;a<this._instanceData.capacity;++a){s.get(a)&E.ACTIVE&&e.addInstance(a)}return e}_queryDepthRangeOctree(e){const t=e.eye,s=e.viewForward,a=this.octree.findClosest(s,g.FRONT_TO_BACK,e.frustum),n=this.octree.findClosest(s,g.BACK_TO_FRONT,e.frustum);if(null!=a&&null!=n){this._instanceData.view.boundingSphere.getVec(a,j),r(j,j,t);const i=l(j,s)-j[3];this._instanceData.view.boundingSphere.getVec(n,j),r(j,j,t);const o=l(j,s)+j[3];return{near:Math.max(e.near,i),far:Math.min(e.far,o)}}return{near:1/0,far:-1/0}}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._defaultRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this._highlightRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this.needsUpdates&&this._context.requestRender()}_updateInstances(e,t){const s=this._enableLevelSelection,a=this._levelSelector;a.updateCamera(e),this._defaultRenderInstanceData.forEach((e=>{e.beginUpdate()})),this._highlightRenderInstanceData.forEach((e=>{e.beginUpdate()}));const n=this._instanceData,i=this._instanceData.view,r=n.size,l=n.capacity;let o=this._instanceIndex;t=Math.min(r,t);for(let c=0;c<t;++c){0===o&&this._startUpdateCycle();const e=i.state.get(o);let r=0;if(!(e&E.ALLOCATED)){o=(o+1)%l,t++;continue}const c=i.lodLevel.get(o);if(e&E.DEFAULT_ACTIVE&&this._defaultRenderInstanceData[c].freeTail(),e&E.HIGHLIGHT_ACTIVE&&this._highlightRenderInstanceData[c].freeTail(),e&E.REMOVE)n.freeInstance(o);else if(e&E.VISIBLE){let t=0;s&&(i.modelOrigin.getVec(o,w),t=a.selectLevel(w,n.getCombinedMedianScaleFactor(o))),r=e&~(E.ACTIVE|E.TRANSFORM_CHANGED),t>=0&&(e&E.HIGHLIGHT?(M(this._highlightRenderInstanceData[t],i,o),r|=E.HIGHLIGHT_ACTIVE):(M(this._defaultRenderInstanceData[t],i,o),r|=E.DEFAULT_ACTIVE)),i.state.set(o,r),i.lodLevel.set(o,t)}else r=e&~(E.ACTIVE|E.TRANSFORM_CHANGED),i.state.set(o,r);if(this._octree){const t=!!(e&E.ACTIVE),s=!!(r&E.ACTIVE);!t&&s?this._octree.addInstance(o):t&&!s?this._octree.removeInstance(o):t&&s&&e&E.TRANSFORM_CHANGED&&(this._octree.removeInstance(o),this._octree.addInstance(o))}o=(o+1)%l}this._instanceIndex=o,this._defaultRenderInstanceData.forEach((e=>{e.endUpdate()})),this._highlightRenderInstanceData.forEach((e=>{e.endUpdate()}))}_renderComponents(e,t,s,a){this.levels.forEach(((n,i)=>{n.components.forEach((n=>{this._renderComponent(e,t,s,a[i],n,i)}))}))}_renderComponent(t,s,a,n,i,r){if(0===n.size||!i.material.requiresSlot(s))return;const{rctx:l,pass:o}=t,c=i.glMaterials.load(l,o);if(e(c))return;const h=l.capabilities.instancing,u=c.beginSlot(a),p=u.program;u.bindPipelineState(l,s),l.useProgram(p),c.bind(a,u),l.bindVAO(i.vao),u.ensureAttributeLocations(i.vao),t.isHighlightPass&&_(p,a),u.bindDraw(a),d.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&t.pass===I.MATERIAL&&(p.setUniform4fv("externalColor",B[Math.min(r,B.length-1)]),p.setUniform1i("colorMixMode",L.replace));const f=n.capacity,g=n.headIndex,D=n.tailIndex,v=n.firstIndex,E=this._glInstanceBufferLayout,R=(e,t)=>{U(l,m,n.buffer,E,e),h.drawArraysInstanced(u.primitiveType,0,i.vertexCount,t-e),x(l,m,n.buffer,E)};i.material.parameters.transparent&&null!=v?g>D?(y(v>=D&&v<=g,"invalid firstIndex"),R(v,g),R(D,v)):g<D&&(v<=g?(y(v>=0&&v<=g,"invalid firstIndex"),R(v,g),R(D,f),R(0,v)):(y(v>=D&&v<=f,"invalid firstIndex"),R(v,f),R(0,g),R(D,v))):g>D?R(D,g):g<D&&(R(0,g),R(D,f)),l.bindVAO(null)}}function M(e,t,s){const a=e.allocateHead();V(t,s,e.view,a)}function V(e,t,s,a){S(e.modelOrigin,t,s.modelOriginHi,s.modelOriginLo,a),s.model.copyFrom(a,e.model,t),s.modelNormal.copyFrom(a,e.modelNormal,t),e.color&&s.color&&s.color.copyFrom(a,e.color,t),e.featureAttribute&&s.featureAttribute&&s.featureAttribute.copyFrom(a,e.featureAttribute,t)}const w=c(),j=h(),G=n(),N=c(),F=c(),B=[[1,0,1,1],[0,0,1,1],[0,1,0,1],[1,1,0,1],[1,0,0,1]];export{H as LodRenderer,P as setLevelSelectorFactory};
5
+ import{isNone as e}from"../../../../../core/maybe.js";import{isAborted as t,throwIfAborted as s}from"../../../../../core/promiseUtils.js";import{I as a,c as n}from"../../../../../chunks/mat4f64.js";import{a as i}from"../../../../../chunks/vec2f64.js";import{f as r,d as l,m as o}from"../../../../../chunks/vec3.js";import{c}from"../../../../../chunks/vec3f64.js";import{c as h}from"../../../../../chunks/vec4f64.js";import d from"../../../support/debugFlags.js";import{glLayout as u}from"../../../support/buffer/glUtil.js";import{bindOutputHighlight as _}from"../../core/shaderLibrary/output/OutputHighlight.glsl.js";import p from"../Camera.js";import{Default3D as m}from"../DefaultVertexAttributeLocations.js";import{IntersectorType as f}from"../IntersectorInterfaces.js";import{DepthOrder as g}from"../Octree.js";import{RenderPass as I}from"../RenderPass.js";import{RenderSlot as D}from"../RenderSlot.js";import{assert as y}from"../Util.js";import{InstanceData as E,StateFlags as T}from"./InstanceData.js";import{InstanceOctree as v}from"./InstanceOctree.js";import{LevelSelector as R}from"./LevelSelector.js";import{LodLevel as A}from"./LodLevel.js";import{RenderInstanceData as b}from"./RenderInstanceData.js";import{getInstanceBufferLayout as C}from"../../materials/DefaultMaterial.js";import{colorMixModes as L}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as S}from"../../materials/renderers/utils.js";import{bindVertexBufferLayout as U,unbindVertexBufferLayout as x}from"../../../../webgl/Util.js";let P=function(e){const t=e.baseBoundingSphere.radius,s=e.levels.map((e=>e.minScreenSpaceRadius));return new R(t,s)};function O(e){P=e}class H{constructor(e,t,s,a){this.type=f.LOD,this.isGround=!1,this._inverseViewport=i(),this._levels=[],this._defaultRenderInstanceData=[],this._highlightRenderInstanceData=[],this._instanceIndex=0,this._slicePlane=!1,this._enableLevelSelection=!0,this._lastCamera=new p,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.slots=[D.OPAQUE_PLUGIN,D.TRANSPARENT_PLUGIN],this.canRender=!0,this._symbol=e,this._optionalFields=t,this._metadata=s,this._instanceBufferLayout=C({instancedDoublePrecision:!0,instanced:t}),this._glInstanceBufferLayout=u(this._instanceBufferLayout,1),this._instanceData=new E(this._optionalFields,a),this._instanceData.on("instance-added",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-removed",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-transform-changed",(e=>{this._requestUpdateCycle(),this._metadata.notifyGraphicGeometryChanged(e.index)})),this._instanceData.on("instance-visibility-changed",(e=>{this._requestUpdateCycle(!0),this._metadata.notifyGraphicVisibilityChanged(e.index)})),this._instanceData.on("instance-highlight-changed",(()=>this._requestUpdateCycle(!0))),this._enableLevelSelection=this._symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this._metadata.layerUid}get instanceData(){return this._instanceData}get memoryUsage(){const e={cpu:0,gpu:0};return this._defaultRenderInstanceData.forEach((t=>{const s=t.memoryUsage;e.cpu+=s.cpu,e.gpu+=s.gpu})),this._highlightRenderInstanceData.forEach((t=>{const s=t.memoryUsage;e.cpu+=s.cpu,e.gpu+=s.gpu})),e}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach(((e,s)=>{const a=this._defaultRenderInstanceData[s],n=this._highlightRenderInstanceData[s],i=a.size+n.size,r=e.triangleCount;t.push({renderedInstances:i,renderedTriangles:i*r,trianglesPerInstance:r})})),{totalInstances:e,renderedInstances:t.reduce(((e,t)=>e+t.renderedInstances),0),renderedTriangles:t.reduce(((e,t)=>e+t.renderedTriangles),0),levels:t}}async initializeRenderContext(e,a){this._context=e;const n=e.renderContext.rctx,i=await Promise.allSettled(this._symbol.levels.map((t=>(this._defaultRenderInstanceData.push(new b(n,this._instanceBufferLayout)),this._highlightRenderInstanceData.push(new b(n,this._instanceBufferLayout)),A.create(e,t,a))))),r=i.map((e=>"fulfilled"===e.status?e.value:null)).filter((e=>e));if(t(a)||r.length!==i.length){r.forEach((e=>e.destroy())),s(a);for(const e of i)if("rejected"===e.status)throw e.reason}this._levels=r,this._levelSelector=P(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach((e=>e.destroy())),this._defaultRenderInstanceData.forEach((e=>e.destroy())),this._highlightRenderInstanceData.forEach((e=>e.destroy()))}get needsTransparentPass(){return this._levels.some((e=>e.components.some((e=>e.material.requiresSlot(D.TRANSPARENT_MATERIAL)))))}get needsHighlight(){return this._highlightRenderInstanceData.some((e=>e.size>0))}prepareRender(e,t){if(d.LOD_INSTANCE_RENDERER_DISABLE_UPDATES)return;if(this._enableLevelSelection){const e=t.equals(this._lastCamera);this._lastCamera.copyFrom(t),e||this._requestUpdateCycle()}const s=this._needFullCycle?this._instanceData.size:2e3;this._needFullCycle=!1,this._updateInstances(t,s),this.needsUpdates&&this._context.requestRender()}render(e){var t,s;const n=e.slot===D.OPAQUE_PLUGIN?D.OPAQUE_MATERIAL:e.slot===D.TRANSPARENT_PLUGIN?D.TRANSPARENT_MATERIAL:null;if(!n||!this.baseMaterial.isVisible()||!this.baseMaterial.isVisibleInPass(e.pass))return;const i=e.camera;this._inverseViewport[0]=1/i.fullViewport[2],this._inverseViewport[1]=1/i.fullViewport[3];const r={slot:n,origin:[0,0,0],camera:i,inverseViewport:this._inverseViewport,shadowMap:e.shadowMap,shadowMappingEnabled:e.shadowMap.enabled,ssaoHelper:e.ssaoHelper,ssaoEnabled:e.ssaoHelper.enabled,screenToWorldRatio:null,screenToPCSRatio:null,slicePlane:e.sliceHelper&&e.sliceHelper.plane,hudVisibilityTexture:e.offscreenRenderingHelper?e.offscreenRenderingHelper.hudVisibilityTexture:null,highlightDepthTexture:null!=(t=null==(s=e.offscreenRenderingHelper)?void 0:s.depthTexture)?t:null,hasOccludees:!1,linearDepthTexture:null,lastFrameColorTexture:null,reprojectionMatrix:a,ssrEnabled:!1,lighting:e.scenelightingData,transparencyPassType:e.transparencyPassType,terrainLinearDepthTexture:e.multipassTerrainParams.terrainLinearDepthTexture,geometryLinearDepthTexture:e.multipassGeometryParams.geometryLinearDepthTexture,multipassTerrainEnabled:e.multipassTerrainParams.multipassTerrainEnabled,cullAboveGround:e.multipassTerrainParams.cullAboveGround,multipassGeometryEnabled:e.multipassGeometryParams.multipassGeometryEnabled,highlightColorTexture:null};e.rctx.bindVAO();const l=e.pass!==I.MATERIAL_HIGHLIGHT&&e.pass!==I.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT,o=e.pass!==I.MATERIAL_DEPTH_SHADOWMAP_DEFAULT;l&&this._renderComponents(e,n,r,this._defaultRenderInstanceData),o&&this._renderComponents(e,n,r,this._highlightRenderInstanceData)}intersect(e,t,s,a){if(!this.baseMaterial.isVisible())return;const n=c();r(n,a,s);const i=n=>{this._instanceData.getCombinedModelTransform(n,N),e.transform.set(N),o(G,s,e.transform.inverse),o(F,a,e.transform.inverse);const i=this._instanceData.getState(n),r=this._instanceData.getLodLevel(n);y(i&T.ACTIVE,"invalid instance state"),y(r>=0&&r<this._levels.length,"invaid lod level"),this._levels[r].intersect(e,t,G,F,n,this._metadata)};this.baseMaterial.parameters.verticalOffset?this.octree.forEach(i):this.octree.forEachAlongRay(s,n,i)}queryDepthRange(e){return this._queryDepthRangeOctree(e)}notifyShaderTransformationChanged(){this._invalidateOctree()}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,e&&(this._needFullCycle=!0),this.needsUpdates&&this._context.requestRender()}get needsUpdates(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}get octree(){return this._octree||(this._octree=this._buildOctree()),this._octree}_invalidateOctree(){this._octree&&(this._octree.destroy(),this._octree=null)}_buildOctree(){const e=new v(this._instanceData,this.baseBoundingSphere),t=this._instanceData,s=t.view?t.view.state:null;for(let a=0;a<this._instanceData.capacity;++a){s.get(a)&T.ACTIVE&&e.addInstance(a)}return e}_queryDepthRangeOctree(e){const t=e.eye,s=e.viewForward,a=this.octree.findClosest(s,g.FRONT_TO_BACK,e.frustum),n=this.octree.findClosest(s,g.BACK_TO_FRONT,e.frustum);if(null!=a&&null!=n){this._instanceData.view.boundingSphere.getVec(a,j),r(j,j,t);const i=l(j,s)-j[3];this._instanceData.view.boundingSphere.getVec(n,j),r(j,j,t);const o=l(j,s)+j[3];return{near:Math.max(e.near,i),far:Math.min(e.far,o)}}return{near:1/0,far:-1/0}}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._defaultRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this._highlightRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this.needsUpdates&&this._context.requestRender()}_updateInstances(e,t){const s=this._enableLevelSelection,a=this._levelSelector;a.updateCamera(e),this._defaultRenderInstanceData.forEach((e=>{e.beginUpdate()})),this._highlightRenderInstanceData.forEach((e=>{e.beginUpdate()}));const n=this._instanceData,i=this._instanceData.view,r=n.size,l=n.capacity;let o=this._instanceIndex;t=Math.min(r,t);for(let c=0;c<t;++c){0===o&&this._startUpdateCycle();const e=i.state.get(o);let r=0;if(!(e&T.ALLOCATED)){o=(o+1)%l,t++;continue}const c=i.lodLevel.get(o);if(e&T.DEFAULT_ACTIVE&&this._defaultRenderInstanceData[c].freeTail(),e&T.HIGHLIGHT_ACTIVE&&this._highlightRenderInstanceData[c].freeTail(),e&T.REMOVE)n.freeInstance(o);else if(e&T.VISIBLE){let t=0;s&&(i.modelOrigin.getVec(o,w),t=a.selectLevel(w,n.getCombinedMedianScaleFactor(o))),r=e&~(T.ACTIVE|T.TRANSFORM_CHANGED),t>=0&&(e&T.HIGHLIGHT?(M(this._highlightRenderInstanceData[t],i,o),r|=T.HIGHLIGHT_ACTIVE):(M(this._defaultRenderInstanceData[t],i,o),r|=T.DEFAULT_ACTIVE)),i.state.set(o,r),i.lodLevel.set(o,t)}else r=e&~(T.ACTIVE|T.TRANSFORM_CHANGED),i.state.set(o,r);if(this._octree){const t=!!(e&T.ACTIVE),s=!!(r&T.ACTIVE);!t&&s?this._octree.addInstance(o):t&&!s?this._octree.removeInstance(o):t&&s&&e&T.TRANSFORM_CHANGED&&(this._octree.removeInstance(o),this._octree.addInstance(o))}o=(o+1)%l}this._instanceIndex=o,this._defaultRenderInstanceData.forEach((e=>{e.endUpdate()})),this._highlightRenderInstanceData.forEach((e=>{e.endUpdate()}))}_renderComponents(e,t,s,a){this.levels.forEach(((n,i)=>{n.components.forEach((n=>{this._renderComponent(e,t,s,a[i],n,i)}))}))}_renderComponent(t,s,a,n,i,r){if(0===n.size||!i.material.requiresSlot(s))return;const{rctx:l,pass:o}=t,c=i.glMaterials.load(l,o);if(e(c))return;const h=l.capabilities.instancing,u=c.beginSlot(a),p=u.program;u.bindPipelineState(l,s),l.useProgram(p),c.bind(a,u),l.bindVAO(i.vao),u.ensureAttributeLocations(i.vao),t.isHighlightPass&&_(p,a),u.bindDraw(a),d.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&t.pass===I.MATERIAL&&(p.setUniform4fv("externalColor",B[Math.min(r,B.length-1)]),p.setUniform1i("colorMixMode",L.replace));const f=n.capacity,g=n.headIndex,D=n.tailIndex,E=n.firstIndex,T=this._glInstanceBufferLayout,v=(e,t)=>{U(l,m,n.buffer,T,e),h.drawArraysInstanced(u.primitiveType,0,i.vertexCount,t-e),x(l,m,n.buffer,T)};i.material.parameters.transparent&&null!=E?g>D?(y(E>=D&&E<=g,"invalid firstIndex"),v(E,g),v(D,E)):g<D&&(E<=g?(y(E>=0&&E<=g,"invalid firstIndex"),v(E,g),v(D,f),v(0,E)):(y(E>=D&&E<=f,"invalid firstIndex"),v(E,f),v(0,g),v(D,E))):g>D?v(D,g):g<D&&(v(0,g),v(D,f)),l.bindVAO(null)}}function M(e,t,s){const a=e.allocateHead();V(t,s,e.view,a)}function V(e,t,s,a){S(e.modelOrigin,t,s.modelOriginHi,s.modelOriginLo,a),s.model.copyFrom(a,e.model,t),s.modelNormal.copyFrom(a,e.modelNormal,t),e.color&&s.color&&s.color.copyFrom(a,e.color,t),e.featureAttribute&&s.featureAttribute&&s.featureAttribute.copyFrom(a,e.featureAttribute,t)}const w=c(),j=h(),N=n(),G=c(),F=c(),B=[[1,0,1,1],[0,0,1,1],[0,1,0,1],[1,1,0,1],[1,0,0,1]];export{H as LodRenderer,O as setLevelSelectorFactory};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{someMap as e}from"../../../../../core/MapUtils.js";import{isSome as t,isNone as r}from"../../../../../core/maybe.js";import s from"../../../../../core/PooledArray.js";import{m as i,a,t as o}from"../../../../../chunks/mat4.js";import{c as n}from"../../../../../chunks/mat4f64.js";import{glLayout as d}from"../../../support/buffer/glUtil.js";import{GLMaterials as h}from"../../lib/GLMaterials.js";import{RenderOccludedFlag as f}from"../../lib/Material.js";import{ModelDirty as m}from"../../lib/ModelDirtyTypes.js";import{RenderPass as l}from"../../lib/RenderPass.js";import{assert as c,setMatrixTranslation3 as u}from"../../lib/Util.js";import{WaterMaterial as g}from"../WaterMaterial.js";import{sortInstancesByRange as _,BufferRange as p,Instance as b,addOrMerge as w}from"./Instance.js";import{MergedGeometryBuffer as y}from"./MergedGeometryBuffer.js";import{MergedGeometryBufferPool as C}from"./MergedGeometryBufferPool.js";import{calculateTransformRelativeToOrigin as H}from"./utils.js";class v{constructor(e,t,r){this._rctx=e,this._materialRepository=t,this._material=r,this.type="MergedRenderer",this._dataByOrigin=new Map,this._renderCommandData=new s,this._hasHighlights=!1,this._hasOccludees=!1,this._glMaterials=new h(this._material,this._materialRepository),this._bufferWriter=r.createBufferWriter(),this._bufferPool=new C(e,r.vertexAttributeLocations,d(this._bufferWriter.vertexBufferLayout))}dispose(){this._glMaterials.destroy(),this._dataByOrigin.forEach((e=>e.buffer.dispose())),this._dataByOrigin.clear(),this._bufferPool.dispose()}get isEmpty(){return 0===this._dataByOrigin.size}get hasHighlights(){return this._hasHighlights}get hasOccludees(){return this._hasOccludees}get hasWater(){return!this.isEmpty&&this._material instanceof g}get rendersOccluded(){return!this.isEmpty&&this._material.renderOccluded!==f.Occlude}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateRenderCommands()}_addAndRemoveGeometries(e,t){const r=this._bufferWriter,s=r.vertexBufferLayout.stride/4,i=this._dataByOrigin,a=A(e,t);a.forEach(((e,t)=>{a.delete(t);const o=e.toAdd.reduce(((e,t)=>e+r.elementCount(t.data)),0);let n=i.get(t);if(null==n)c(0===e.toRemove.length),n=new B(e.origin,new y(this._bufferPool,o*s)),i.set(t,n);else if(0===e.toAdd.length&&n.instances.size===e.toRemove.length)return n.buffer.dispose(),void i.delete(t);let d=0;n.instances.forEach((e=>d+=e.to-e.from));const h=e.toRemove.reduce(((e,t)=>e+r.elementCount(t.data)),0),f=n.buffer.size,m=(d+o-h)*s,l=T;if(m<f/2?this._removeAndRebuild(n,e.toRemove,s,m,l):e.toRemove.length>0&&this._remove(n,e.toRemove,s,l),e.toAdd.length>0){const t=E;u(t,-e.origin[0],-e.origin[1],-e.origin[2]),this._add(n,e.toAdd,s,t,l)}const g=n.buffer.vao.vertexBuffers.geometry;I(l),l.forAll((({from:e,to:t})=>{if(e<t){const r=n.buffer.array,s=4,i=e*s,a=t*s;g.setSubData(r,i,i,a)}})),l.clear(),n.drawCommandsDirty=!0}))}_updateGeometries(e){const t=this._bufferWriter,r=t.vertexBufferLayout.stride/4;for(const s of e){const e=s.renderGeometry,i=this._dataByOrigin.get(e.origin.id),a=i&&i.instances.get(e.id);if(!a)return;const o=s.updateType;if(o&m.State.VISIBILITIES&&(a.isVisible=e.instanceParameters.visible),o&(m.State.HIGHLIGHTS|m.State.VISIBILITIES)){const t=e.instanceParameters.visible;a.hasHighlights=!!e.instanceParameters.highlights&&t}if(o&m.State.OCCLUDEES&&(a.hasOccludees=!!e.instanceParameters.occludees),o&(m.State.VERTEXATTRS|m.State.TRANSFORMATION)){const{array:s,vao:o}=i.buffer;H(e,P,L),t.write({transformation:P,invTranspTransformation:L},e.data,t.vertexBufferLayout.createView(s.buffer),a.from),c(a.from+t.elementCount(e.data)===a.to,"material VBO layout has changed"),o.vertexBuffers.geometry.setSubData(s,a.from*r*4,a.from*r*4,a.to*r*4)}i.drawCommandsDirty=!0}}_updateRenderCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach((t=>{t.hasHiddenInstances=!1,t.hasHighlights=!1,t.hasOccludees=!1,e(t.instances,(e=>(e.isVisible?(e.hasHighlights&&(this._hasHighlights=!0,t.hasHighlights=!0),e.hasOccludees&&(this._hasOccludees=!0,t.hasOccludees=!0)):t.hasHiddenInstances=!0,t.hasHiddenInstances&&t.hasHighlights&&t.hasOccludees)))}));const t=e=>{if(e.drawCommandsDefault=null,e.drawCommandsHighlight=null,e.drawCommandsOccludees=null,e.drawCommandsShadowHighlightRest=null,0===e.instances.size)return;if(!S(e)){const t=this._bufferWriter.vertexBufferLayout.stride,r=4*e.buffer.size/t;return void(e.drawCommandsDefault=[{first:0,count:r}])}const t=_(e.instances);e.drawCommandsDefault=[],e.drawCommandsHighlight=[],e.drawCommandsOccludees=[],e.drawCommandsShadowHighlightRest=[];for(const r of t)r.isVisible&&(r.hasOccludees?w(e.drawCommandsOccludees,r):w(e.drawCommandsDefault,r),r.hasHighlights?w(e.drawCommandsHighlight,r):w(e.drawCommandsShadowHighlightRest,r))};this._dataByOrigin.forEach((e=>{e.drawCommandsDirty&&(t(e),e.drawCommandsDirty=!1)}))}updateAnimation(e){return this._material.update(e)}render(e,s,i){if(null!=e&&!this._material.requiresSlot(e,s))return!1;const a=s===l.MATERIAL_HIGHLIGHT||s===l.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT;if(a&&!this._hasHighlights)return!1;const o=s===l.MATERIAL_DEPTH_SHADOWMAP_DEFAULT,n=!(a||o);if(this._dataByOrigin.forEach((e=>{if(a&&!e.hasHighlights)return;const r=(a?e.drawCommandsHighlight:o&&S(e)?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault)||null,s=n&&e.drawCommandsOccludees||null;(t(r)||t(s))&&this._renderCommandData.push(new M(e.origin,e.buffer,r,s))})),0===this._renderCommandData.length)return!1;const d=this._rctx,h=this._glMaterials.load(d,s);if(r(h))return this._renderCommandData.clear(),!1;const f=h.beginSlot(i);return f.bindPipelineState(d,e,!1),d.useProgram(f.program),h.bind(i,f),this._renderCommandData.forAll((({origin:r,buffer:s,renderCommands:a,occludeeCommands:o})=>{i.origin=r,f.bindDraw(i),f.ensureAttributeLocations(s.vao),d.bindVAO(s.vao);const n=f.primitiveType;t(a)&&this._renderCommands(d,n,a),t(o)&&(f.bindPipelineState(d,e,!0),this._renderCommands(d,n,o),f.bindPipelineState(d,e,!1))})),this._renderCommandData.clear(),!0}_renderCommands(e,t,r){for(let s=0;s<r.length;s++)e.drawArrays(t,r[s].first,r[s].count)}_removeAndRebuild(e,t,r,s,i){for(const h of t)e.instances.delete(h.id);const a=_(e.instances);e.instances.clear();const o=e.buffer.size,n=e.buffer.alloc(s);let d=0;for(const h of a){const t=h.from*r,s=h.to*r;n.copy(d,t,s),h.from=d/r,d+=s-t,h.to=d/r,e.instances.set(h.id,h)}i.push(new p(0,n.hasNewBuffer?e.buffer.array.length:o)),n.dispose(),e.buffer.erase(d,i.back().to),e.holes.clear()}_remove(e,t,r,s){for(const i of t){const t=i.id,a=e.instances.get(t),o=a.from*r,n=a.to*r;e.buffer.erase(o,n),e.holes.push(new p(a.from,a.to)),e.instances.delete(t),s.push(new p(o,n))}I(e.holes)}_add(e,s,n,d,h){const f=this._bufferWriter;let m=f.vertexBufferLayout.createView(e.buffer.array.buffer);for(const l of s){const s=t(l.transformation)?i(P,d,l.transformation):d;a(L,s);const u=o(L,L),g=f.elementCount(l.data),_=g*n;let w=D(e.holes,g);r(w)&&(w=e.buffer.size/n,e.buffer.grow(_),m=f.vertexBufferLayout.createView(e.buffer.array.buffer)),f.write({transformation:s,invTranspTransformation:u},l.data,m,w);const y=l.instanceParameters.visible,C=!!l.instanceParameters.highlights&&y,H=!!l.instanceParameters.occludees,v=new b(l.id,w,w+g,y,C,H);c(null==e.instances.get(l.id)),e.instances.set(l.id,v),h.push(new p(v.from*n,v.to*n))}}get test(){return{material:this._material,glMaterials:this._glMaterials}}}class O{constructor(e){this.origin=e,this.toAdd=new Array,this.toRemove=new Array}}function A(e,t){const r=new Map;for(const s of e)R(r,s,!0);for(const s of t)R(r,s,!1);return r}function R(e,t,s){const i=t.origin;if(r(i))return;let a=e.get(i.id);null==a&&(a=new O(i.vec3),e.set(i.id,a)),s?a.toAdd.push(t):a.toRemove.push(t)}function S(e){return e.hasOccludees||e.hasHighlights||e.hasHiddenInstances}function D(e,t){let r;if(!e.some((e=>!(e.to-e.from<t)&&(r=e,!0))))return null;const s=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),s}function I(e){const t=new Map;e.forAll((e=>t.set(e.from,e)));let r=!0;for(;r;)r=!1,e.forEach((s=>{const i=t.get(s.to);i&&(s.to=i.to,t.delete(i.from),e.removeUnordered(i),r=!0)}))}class B{constructor(e,t){this.origin=e,this.buffer=t,this.instances=new Map,this.holes=new s({deallocator:null}),this.hasHiddenInstances=!1,this.hasHighlights=!1,this.hasOccludees=!1,this.drawCommandsDirty=!1}}class M{constructor(e,t,r,s){this.origin=e,this.buffer=t,this.renderCommands=r,this.occludeeCommands=s}}const T=new s({deallocator:null}),E=n(),P=n(),L=n();export{v as MergedRenderer};
5
+ import{someMap as e}from"../../../../../core/MapUtils.js";import{isSome as t,isNone as r}from"../../../../../core/maybe.js";import s from"../../../../../core/PooledArray.js";import{m as i,a,t as o}from"../../../../../chunks/mat4.js";import{c as n}from"../../../../../chunks/mat4f64.js";import{glLayout as d}from"../../../support/buffer/glUtil.js";import{GLMaterials as h}from"../../lib/GLMaterials.js";import{RenderOccludedFlag as l}from"../../lib/Material.js";import{ModelDirty as f}from"../../lib/ModelDirtyTypes.js";import{RenderPass as m}from"../../lib/RenderPass.js";import{assert as c,setMatrixTranslation3 as u}from"../../lib/Util.js";import{WaterMaterial as g}from"../WaterMaterial.js";import{sortInstancesByRange as _,BufferRange as p,Instance as b,addOrMerge as w}from"./Instance.js";import{MergedGeometryBuffer as y}from"./MergedGeometryBuffer.js";import{MergedGeometryBufferPool as C}from"./MergedGeometryBufferPool.js";import{calculateTransformRelativeToOrigin as H}from"./utils.js";class v{constructor(e,t,r){this._rctx=e,this._materialRepository=t,this._material=r,this.type="MergedRenderer",this._dataByOrigin=new Map,this._renderCommandData=new s,this._hasHighlights=!1,this._hasOccludees=!1,this._glMaterials=new h(this._material,this._materialRepository),this._bufferWriter=r.createBufferWriter(),this._bufferPool=new C(e,r.vertexAttributeLocations,d(this._bufferWriter.vertexBufferLayout))}dispose(){this._glMaterials.destroy(),this._dataByOrigin.forEach((e=>e.buffer.dispose())),this._dataByOrigin.clear(),this._bufferPool.dispose()}get isEmpty(){return 0===this._dataByOrigin.size}get hasHighlights(){return this._hasHighlights}get hasOccludees(){return this._hasOccludees}get hasWater(){return!this.isEmpty&&this._material instanceof g}get rendersOccluded(){return!this.isEmpty&&this._material.renderOccluded!==l.Occlude}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateRenderCommands()}_addAndRemoveGeometries(e,t){const r=this._bufferWriter,s=r.vertexBufferLayout.stride/4,i=this._dataByOrigin,a=A(e,t);a.forEach(((e,t)=>{a.delete(t);const o=e.toAdd.reduce(((e,t)=>e+r.elementCount(t.data)),0);let n=i.get(t);if(null==n)c(0===e.toRemove.length),n=new B(e.origin,new y(this._bufferPool,o*s)),i.set(t,n);else if(0===e.toAdd.length&&n.instances.size===e.toRemove.length)return n.buffer.dispose(),void i.delete(t);let d=0;n.instances.forEach((e=>d+=e.to-e.from));const h=e.toRemove.reduce(((e,t)=>e+r.elementCount(t.data)),0),l=n.buffer.size,f=(d+o-h)*s,m=T;if(f<l/2?this._removeAndRebuild(n,e.toRemove,s,f,m):e.toRemove.length>0&&this._remove(n,e.toRemove,s,m),e.toAdd.length>0){const t=E;u(t,-e.origin[0],-e.origin[1],-e.origin[2]),this._add(n,e.toAdd,s,t,m)}const g=n.buffer.vao.vertexBuffers.geometry;I(m),m.forAll((({from:e,to:t})=>{if(e<t){const r=n.buffer.array,s=4,i=e*s,a=t*s;g.setSubData(r,i,i,a)}})),m.clear(),n.drawCommandsDirty=!0}))}_updateGeometries(e){const t=this._bufferWriter,r=t.vertexBufferLayout.stride/4;for(const s of e){const e=s.renderGeometry,i=this._dataByOrigin.get(e.origin.id),a=i&&i.instances.get(e.id);if(!a)return;const o=s.updateType;if(o&f.State.VISIBILITIES&&(a.isVisible=e.instanceParameters.visible),o&(f.State.HIGHLIGHTS|f.State.VISIBILITIES)){const t=e.instanceParameters.visible;a.hasHighlights=!!e.instanceParameters.highlights&&t}if(o&f.State.OCCLUDEES&&(a.hasOccludees=!!e.instanceParameters.occludees),o&(f.State.VERTEXATTRS|f.State.TRANSFORMATION)){const{array:s,vao:o}=i.buffer;H(e,P,L),t.write({transformation:P,invTranspTransformation:L},e.data,t.vertexBufferLayout.createView(s.buffer),a.from),c(a.from+t.elementCount(e.data)===a.to,"material VBO layout has changed"),o.vertexBuffers.geometry.setSubData(s,a.from*r*4,a.from*r*4,a.to*r*4)}i.drawCommandsDirty=!0}}_updateRenderCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach((t=>{t.hasHiddenInstances=!1,t.hasHighlights=!1,t.hasOccludees=!1,e(t.instances,(e=>(e.isVisible?(e.hasHighlights&&(this._hasHighlights=!0,t.hasHighlights=!0),e.hasOccludees&&(this._hasOccludees=!0,t.hasOccludees=!0)):t.hasHiddenInstances=!0,t.hasHiddenInstances&&t.hasHighlights&&t.hasOccludees)))}));const t=e=>{if(e.drawCommandsDefault=null,e.drawCommandsHighlight=null,e.drawCommandsOccludees=null,e.drawCommandsShadowHighlightRest=null,0===e.instances.size)return;if(!S(e)){const t=this._bufferWriter.vertexBufferLayout.stride,r=4*e.buffer.size/t;return void(e.drawCommandsDefault=[{first:0,count:r}])}const t=_(e.instances);e.drawCommandsDefault=[],e.drawCommandsHighlight=[],e.drawCommandsOccludees=[],e.drawCommandsShadowHighlightRest=[];for(const r of t)r.isVisible&&(r.hasOccludees?w(e.drawCommandsOccludees,r):w(e.drawCommandsDefault,r),r.hasHighlights?w(e.drawCommandsHighlight,r):w(e.drawCommandsShadowHighlightRest,r))};this._dataByOrigin.forEach((e=>{e.drawCommandsDirty&&(t(e),e.drawCommandsDirty=!1)}))}updateAnimation(e){return this._material.update(e)}requiresSlot(e,t){return null==e||this._material.requiresSlot(e,t)}render(e,s,i){if(!this.requiresSlot(e,s))return!1;const a=s===m.MATERIAL_HIGHLIGHT||s===m.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT;if(a&&!this._hasHighlights)return!1;const o=s===m.MATERIAL_DEPTH_SHADOWMAP_DEFAULT,n=!(a||o);if(this._dataByOrigin.forEach((e=>{if(a&&!e.hasHighlights)return;const r=(a?e.drawCommandsHighlight:o&&S(e)?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault)||null,s=n&&e.drawCommandsOccludees||null;(t(r)||t(s))&&this._renderCommandData.push(new M(e.origin,e.buffer,r,s))})),0===this._renderCommandData.length)return!1;const d=this._rctx,h=this._glMaterials.load(d,s);if(r(h))return this._renderCommandData.clear(),!1;const l=h.beginSlot(i);return l.bindPipelineState(d,e,!1),d.useProgram(l.program),h.bind(i,l),this._renderCommandData.forAll((({origin:r,buffer:s,renderCommands:a,occludeeCommands:o})=>{i.origin=r,l.bindDraw(i),l.ensureAttributeLocations(s.vao),d.bindVAO(s.vao);const n=l.primitiveType;t(a)&&this._renderCommands(d,n,a),t(o)&&(l.bindPipelineState(d,e,!0),this._renderCommands(d,n,o),l.bindPipelineState(d,e,!1))})),this._renderCommandData.clear(),!0}_renderCommands(e,t,r){for(let s=0;s<r.length;s++)e.drawArrays(t,r[s].first,r[s].count)}_removeAndRebuild(e,t,r,s,i){for(const h of t)e.instances.delete(h.id);const a=_(e.instances);e.instances.clear();const o=e.buffer.size,n=e.buffer.alloc(s);let d=0;for(const h of a){const t=h.from*r,s=h.to*r;n.copy(d,t,s),h.from=d/r,d+=s-t,h.to=d/r,e.instances.set(h.id,h)}i.push(new p(0,n.hasNewBuffer?e.buffer.array.length:o)),n.dispose(),e.buffer.erase(d,i.back().to),e.holes.clear()}_remove(e,t,r,s){for(const i of t){const t=i.id,a=e.instances.get(t),o=a.from*r,n=a.to*r;e.buffer.erase(o,n),e.holes.push(new p(a.from,a.to)),e.instances.delete(t),s.push(new p(o,n))}I(e.holes)}_add(e,s,n,d,h){const l=this._bufferWriter;let f=l.vertexBufferLayout.createView(e.buffer.array.buffer);for(const m of s){const s=t(m.transformation)?i(P,d,m.transformation):d;a(L,s);const u=o(L,L),g=l.elementCount(m.data),_=g*n;let w=D(e.holes,g);r(w)&&(w=e.buffer.size/n,e.buffer.grow(_),f=l.vertexBufferLayout.createView(e.buffer.array.buffer)),l.write({transformation:s,invTranspTransformation:u},m.data,f,w);const y=m.instanceParameters.visible,C=!!m.instanceParameters.highlights&&y,H=!!m.instanceParameters.occludees,v=new b(m.id,w,w+g,y,C,H);c(null==e.instances.get(m.id)),e.instances.set(m.id,v),h.push(new p(v.from*n,v.to*n))}}get test(){return{material:this._material,glMaterials:this._glMaterials}}}class O{constructor(e){this.origin=e,this.toAdd=new Array,this.toRemove=new Array}}function A(e,t){const r=new Map;for(const s of e)R(r,s,!0);for(const s of t)R(r,s,!1);return r}function R(e,t,s){const i=t.origin;if(r(i))return;let a=e.get(i.id);null==a&&(a=new O(i.vec3),e.set(i.id,a)),s?a.toAdd.push(t):a.toRemove.push(t)}function S(e){return e.hasOccludees||e.hasHighlights||e.hasHiddenInstances}function D(e,t){let r;if(!e.some((e=>!(e.to-e.from<t)&&(r=e,!0))))return null;const s=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),s}function I(e){const t=new Map;e.forAll((e=>t.set(e.from,e)));let r=!0;for(;r;)r=!1,e.forEach((s=>{const i=t.get(s.to);i&&(s.to=i.to,t.delete(i.from),e.removeUnordered(i),r=!0)}))}class B{constructor(e,t){this.origin=e,this.buffer=t,this.instances=new Map,this.holes=new s({deallocator:null}),this.hasHiddenInstances=!1,this.hasHighlights=!1,this.hasOccludees=!1,this.drawCommandsDirty=!1}}class M{constructor(e,t,r,s){this.origin=e,this.buffer=t,this.renderCommands=r,this.occludeeCommands=s}}const T=new s({deallocator:null}),E=n(),P=n(),L=n();export{v as MergedRenderer};