@arcgis/core 4.23.0-next.20220319 → 4.23.0-next.20220322

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",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:()=>u,a9:()=>c,fS:()=>s,cq:()=>d,zG:()=>i,w6:()=>l,Od:()=>g,e$:()=>h,FY:()=>b});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function i(e){return e&&"number"==typeof e.length}const a=!!Array.prototype.fill;function c(e,t){if(a)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function l(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class u{constructor(){this.last=0}}const f=new u;function d(e,t,r,n){n=n||f;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function h(e,t,r,n){const o=null==r?e.length:r,s=d(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const p=new Set;function b(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;p.clear();for(let e=0;e<n;++e)p.add(t[e]);o=o||f;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(p.has(e[t])&&(s&&s.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;for(let t=0;t<i;++t)if(p.has(e[t])&&(s&&s.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;return p.clear(),r}function g(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{vT:()=>n,on:()=>o,IH:()=>s})},80442:(e,t,r)=>{"use strict";var n,o;let s;var i,a;function c(e){return"function"==typeof s[e]?s[e]=s[e](globalThis):s[e]}r.d(t,{Z:()=>c}),s=null!=(n=globalThis.dojoConfig)&&n.has||null!=(o=globalThis.esriConfig)&&o.has?{...null==(i=globalThis.dojoConfig)?void 0:i.has,...null==(a=globalThis.esriConfig)?void 0:a.has}:{},c.add=(e,t,r,n)=>((n||void 0===s[e])&&(s[e]=t),r&&c(e)),c.cache=s,c.add("esri-deprecation-warnings",!0),(()=>{var e;c.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const t="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(c.add("host-browser",t),c.add("host-node","object"==typeof globalThis.process&&(null==(e=globalThis.process.versions)?void 0:e.node)&&globalThis.process.versions.v8),c.add("dom",t),c("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(c.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),c.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),c.add("khtml",r.includes("Konqueror")?n:void 0),c.add("edge",parseFloat(t.split("Edge/")[1])||void 0),c.add("opr",parseFloat(t.split("OPR/")[1])||void 0),c.add("webkit",!c("wp")&&!c("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),c.add("chrome",!c("edge")&&!c("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),c.add("android",!c("wp")&&parseFloat(t.split("Android ")[1])||void 0),c.add("safari",!r.includes("Safari")||c("wp")||c("chrome")||c("android")||c("edge")||c("opr")?void 0:parseFloat(r.split("Version/")[1])),c.add("mac",r.includes("Macintosh")),!c("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));c.add(e,n),c.add("ios",n)}c.add("trident",parseFloat(r.split("Trident/")[1])||void 0),c("webkit")||(!t.includes("Gecko")||c("wp")||c("khtml")||c("trident")||c("edge")||c.add("mozilla",n),c("mozilla")&&c.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&c.add("esri-mobile",t),r&&c.add("esri-iPhone",r),c.add("esri-geolocation",!!navigator.geolocation)}c.add("esri-canvas-svg-support",!c("trident")),c.add("esri-wasm","WebAssembly"in globalThis),c.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),c.add("esri-atomics","Atomics"in globalThis),c.add("esri-workers","Worker"in globalThis),c.add("web-feat:cache","caches"in globalThis),c.add("esri-workers-arraybuffer-transfer",!c("safari")||Number(c("safari"))>=12),c.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),c.add("featurelayer-simplify-payload-size-factors",[1,1,4]),c.add("featurelayer-snapshot-enabled",!0),c.add("featurelayer-snapshot-point-min-threshold",8e4),c.add("featurelayer-snapshot-point-max-threshold",4e5),c.add("featurelayer-snapshot-point-coverage",.1),c.add("featurelayer-advanced-symbols",!1),c.add("featurelayer-pbf",!0),c.add("featurelayer-pbf-statistics",!1),c.add("feature-layers-workers",!0),c.add("feature-polyline-generalization-factor",1),c.add("mapview-transitions-duration",200),c.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),c.add("mapserver-pbf-enabled",!1),c("host-webworker")||c("host-browser")&&(c.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),c.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{c.add("esri-image-decode",!0,!0,!0)})).catch((()=>{c.add("esri-image-decode",!1,!0,!0)}))}return!1})),c.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{d9:()=>i,fS:()=>d,yd:()=>s,Vo:()=>a}),r(67676),r(80442);var n=r(70586),o=r(1533);function s(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&s(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function i(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(c(e))return e.clone();if(l(e))return e.map(i);if(u(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=i(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(l(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(c(e))return e.clone();if(!u(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function f(e){if((0,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(e))return(0,o.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,i(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(i(e))})),t}return null}function d(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e){return void 0===e}function i(e,t){return n(e)?t(e):null}function a(e){return e}function c(e,t){if(o(e))throw new Error(t);return e}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e,t){return n(e)?e:t}function f(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function h(e){return n(e)&&e.remove(),null}function p(e){return n(e)&&e.release(),null}function b(e){return null}function g(e,t){const r=new Array;for(const n of e)r.push(y(n,null,t));return r}function m(e,t){for(const r of e)i(r,t)}function y(e,t,r){return n(e)?r(e):t}function v(e){return e.filter((e=>n(e)))}function w(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function _(e){return e}r.d(t,{yw:()=>i,j0:()=>_,SC:()=>f,O3:()=>d,lV:()=>v,JR:()=>m,U2:()=>w,Wi:()=>o,pC:()=>n,o8:()=>s,Fd:()=>g,R2:()=>y,Bd:()=>b,RY:()=>p,hw:()=>h,Wg:()=>a,Pt:()=>l,s3:()=>c,yl:()=>u})},78286:(e,t,r)=>{"use strict";r.d(t,{RH:()=>o,hS:()=>s,RB:()=>i});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce((function(e,o){let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{-1===s.indexOf(e)&&s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>C,$6:()=>c,Ue:()=>l,zE:()=>u,dD:()=>_,hh:()=>x,vr:()=>T,Ds:()=>j,as:()=>O,WW:()=>P,R8:()=>w,D_:()=>v,Hc:()=>h,y8:()=>E,fu:()=>g,$F:()=>m,d1:()=>k,DB:()=>S,r9:()=>p,k_:()=>f,H9:()=>b,Yn:()=>M,gx:()=>A,Hl:()=>y});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o,s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e){return Promise.all(e)}function l(e){return new Promise(((t,r)=>{try{e(t,r)}catch(e){Promise.resolve().then((()=>r(e)))}}))}function u(e="Aborted"){return new s.Z("AbortError",e)}function f(e,t="Aborted"){if(h(e))throw u(t)}function d(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function h(e){const t=d(e);return(0,a.pC)(t)&&t.aborted}function p(e){if(v(e))throw e}function b(e){if(!v(e))throw e}function g(e,t){const r=d(e);if(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function m(e,t){const r=d(e);if(!(0,a.Wi)(r))return f(r),(0,i.IH)(r,"abort",(()=>t(u())))}function y(e,t){const r=d(t);return(0,a.Wi)(r)?e:new Promise(((r,n)=>{let o=g(t,(()=>n(u())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function v(e){return e&&"AbortError"===e.name}function w(e){return e.catch((e=>{if(!v(e))throw e}))}function _(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}function O(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e);return O(t.map((t=>e[t]))).then((e=>{const r={};return t.forEach(((t,n)=>r[t]=e[n])),r}))}const t=e;return l((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}function P(e){return O(e).then((e=>e.filter((e=>!!e.value)).map((e=>e.value))))}function k(e){return Promise.reject(e)}function S(e){return Promise.resolve(e)}function C(e,t,r){const n=new AbortController;return g(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);g(n,(()=>{s&&(clearTimeout(s),o(u()))}))}))}function E(e){return e&&"function"==typeof e.then}function A(e){return E(e)?e:Promise.resolve(e)}function j(e,t=-1){let r,n,o,s,i=null;const c=(...l)=>{if(r){n=l,s&&s.reject(u()),s=_();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||_(),s=null,t>0){const n=new AbortController;r=A(e(...l,n.signal));const o=r;C(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=A(e(...l));const f=()=>{const e=n;n=o=r=i=null,null!=e&&c(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return c}function x(){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 T(e,t){let r,n=new AbortController;const o=e(n.signal);let s={promise:o,finished:!1,abort:()=>{n&&(n.abort(),n=null)}};const i=()=>{s&&(s.finished=!0,s=null),(0,a.pC)(r)&&(r.remove(),r=null),n=null};return o.then(i,i),r=g(t,(()=>{(0,a.pC)(s)&&s.abort()})),s}function M(e){return Promise.resolve().then((()=>{f(e)}))}},19153:(e,t,r)=>{"use strict";r.d(t,{Qs:()=>a,hP:()=>c,gx:()=>i,Cb:()=>l});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return null==e?"":e}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&-1!==t.indexOf(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,eP:()=>s,xZ:()=>h,fS:()=>p,z3:()=>l,Hx:()=>f,W0:()=>i,Uc:()=>u,ZY:()=>d,lq:()=>a,KZ:()=>c,tP:()=>o})},17452:(e,t,r)=>{"use strict";r.d(t,{R9:()=>y,qg:()=>j,tD:()=>$,ZN:()=>he,fl:()=>pe,rS:()=>V,Ie:()=>ue,sJ:()=>Y,AH:()=>Q,io:()=>ee,L:()=>P,TI:()=>O,vt:()=>ce,oh:()=>U,P$:()=>D,Ml:()=>be,ed:()=>I,b7:()=>A,D6:()=>W,tm:()=>R,YP:()=>H,jc:()=>z,HK:()=>K,$U:()=>ne,oC:()=>te,kl:()=>L,v_:()=>B,hF:()=>q,_l:()=>X,PF:()=>F,Fv:()=>Z,B7:()=>E,u0:()=>S,Yd:()=>ae,Hu:()=>de,Qj:()=>le,hO:()=>oe,mN:()=>k});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const v={};let w=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(w.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${w.scheme}://${w.host}${null!=w.port?`:${w.port}`:""}${t}`}();const O=()=>w,P=()=>_;function k(e){const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=S(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function S(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function E(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function A(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=I(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),k(r)}function j(e){const t=I(e);let r,n;if(t){const e=T(t.proxyUrl);r=e.path,n=e.query?S(e.query):null}if(r){const t=k(e);e=r+"?"+t.path;const o=E({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function T(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=T(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function I(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function R(e,t){return e=N(e),t=N(t),ie(e)===ie(t)}function N(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function U(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function W(e,t,r=!1){const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function L(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(W(e,w))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(W(e,n[t]))return!0}return!1}function J(e){return v[e]||(re(e)||te(e)?v[e]=[new y(q(e))]:v[e]=[new y(`http://${e}`),new y(`https://${e}`)]),v[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===w.scheme&&w.authority===D(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(B("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function F(e,t=_,r){if(!H(e))return e;const n=Z(e),o=n.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=r?Z(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function Z(e){return function(e){const t=c.httpsDomains;if(!function(e){return f.test(e)||"http"===w.scheme&&te(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===w.scheme&&n===w.authority&&!b.test(e)||(se()&&n===w.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!I(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=T(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function B(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function D(e,t=!1){if(z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return"data:"===e.slice(0,5)}function Q(e){const t=Y(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function V(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&void 0!==e&&"/"===e[0]&&"/"===e[1]}function re(e){return u.test(e)}function ne(e){return d.test(e)||"https"===w.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===w.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=k(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(null==t||!t.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=w.scheme),e)}function de(e,t){const r=k(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function he(e,t,r){const n=k(e),o=n.query||{};return o[t]=String(r),`${n.path}?${E(o)}`}function pe(e,t){const r=k(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=E(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(ge);return t?t[1]:null}const ge=/.*?\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5406),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(7793)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(8936)]).then(r.bind(r,18936)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(6481),r.e(6459),r.e(7996)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(9662),r.e(6353)]).then(r.bind(r,98363)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5886),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(9662),r.e(4325),r.e(1684)]).then(r.bind(r,70299)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(6347)]).then(r.bind(r,16583)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(176),r.e(2398),r.e(7282)]).then(r.bind(r,61576)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6810),r.e(3388)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t){this._port=e,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r});return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const i=(0,c.jt)();return new Promise(((r,o)=>{const c=(0,a.$F)(n,(()=>{var e;const t=this._outJobs.get(i);t&&(this._outJobs.delete(i),null==(e=t.abortHandle)||e.remove(),this._post({type:d,jobId:i}),o((0,a.zE)()))})),l={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(i,l),this._post({type:h,jobId:i,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_close(){this._channel&&(this._channel=null),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{var t;null==(t=e.abortHandle)||t.remove(),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&-1!==t.indexOf(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e).type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){var t;const{jobId:r,error:n,data:s}=e,i=this._outJobs;if(!i.has(r))return;const a=i.get(r);i.delete(r),null==(t=a.abortHandle)||t.remove(),n?a.reject(o.Z.fromJSON(JSON.parse(n))):a.resolve(s)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{Cs:()=>n,jt:()=>a,oi:()=>l,QM:()=>u,AB:()=>c});var n,o,s=r(80442);(o=n||(n={}))[o.HANDSHAKE=0]="HANDSHAKE",o[o.OPEN=1]="OPEN",o[o.OPENED=2]="OPENED",o[o.RESPONSE=3]="RESPONSE",o[o.INVOKE=4]="INVOKE",o[o.ABORT=5]="ABORT",o[o.CLOSE=6]="CLOSE",o[o.OPEN_PORT=7]="OPEN_PORT",o[o.ON=8]="ON";let i=0;function a(){return i++}function c(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function l(e,t,r,o){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(s=f(o),t.data=r):(s=f(r.transferList),t.data=r.result),s?e.postMessage(t,s):e.postMessage(t)}function u(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function f(e){if(!e||!e.length)return null;if((0,s.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,id:()=>a,qh:()=>c,i8:()=>s,Nv:()=>i});var n=r(80442),o=r(17452);const s="4.23",i={async request(e,t){var n;const{default:s}=await r.e(3172).then(r.bind(r,3172)),i=e.options,a=i.responseType;i.signal=null==t?void 0:t.signal,i.responseType="native"===a||"native-request-init"===a?"native-request-init":["blob","json","text"].includes(a)&&null!=(n=(0,o.oh)(e.url))&&n.after?a:"array-buffer";const c=await s(e.url,i),l={data:c.data,ssl:c.ssl};switch(c.requestOptions.responseType){case"native-request-init":return delete l.data.signal,l;case"blob":l.data=await l.data.arrayBuffer();break;case"json":l.data=(new TextEncoder).encode(JSON.stringify(l.data)).buffer;break;case"text":l.data=(new TextEncoder).encode(l.data).buffer}return{result:l,transferList:[l.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")||((0,n.Z)("edge")||(0,n.Z)("trident"))&&console.warn("Deprecated browser - see http://esriurl.com/oldbrowser")},17202:(e,t,r)=>{"use strict";r.d(t,{r:()=>n,$:()=>o});const n="20220319",o="af11bcfb4f044e6f4f6e60a84a7647b822ce6e7d"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{24:"5d5fa2b1fc48a17eb9ab",86:"666f3fc44eaee390d2b1",176:"93ace2e16c102db1bc29",214:"53a150a1eec3894e2a9e",223:"5bdd4df2b0ea60dba368",247:"a0450fbf01de854f5c97",280:"73a3ad2146bfea9f5dce",565:"0018053ac16a09feba70",576:"812a5abfadd747a09b6f",609:"792fc86380a84b6ac98e",635:"e8e775758b79c5a084c8",639:"db2604563294bf49bbf9",678:"ea313474f460ce31b6d5",712:"93bd67b4258e84c1e6f0",819:"5d3e774ce7b006c8cba8",999:"da7cce130c459c84a794",1188:"b04af5e4a9ae0c90a1de",1197:"e9d59300727f5e52e148",1400:"de337486515d9aff478b",1412:"8d95f3a3f776fef3f9cb",1421:"7fa2d758a24bbaaab0bf",1433:"52489e2f7748dc610263",1534:"6ef8de3aa9a8d9c22161",1562:"6141d433dda78b29e6e1",1684:"410e9b40a2b7f88ea669",1773:"4d2ef57ff3a5cfc1313f",1785:"d88cb7568e2f8ac9905b",1916:"3011f1c1ee5631df98b2",2133:"3403cb53e4e60923c5fc",2134:"070a78b488f92d022495",2279:"cab3f15de3686ca966ec",2304:"d209d82484aa725c5aa9",2397:"3d70f945621de60c7b14",2398:"2a1adc5de77f832b31de",2399:"467b5faa1c90d9821609",2515:"68fc1d7c3fd10a7205c4",3003:"2dcdad8e77bb4bd82680",3027:"0c711b129d501b1d4439",3127:"45155ec947e3f4511c08",3172:"10322d990cda5aedf2f0",3230:"29eb733e18be5a778f4a",3388:"dd47b92663f21fc442b8",3529:"2f6bff1aa485cf22527d",3668:"85fde4b92b0c212f5ff6",3852:"62c683f44c297d239ab8",4166:"8cfefa829131ec234de3",4325:"c7da2f1bdda4de915210",4358:"f977977564b2b75332a9",4369:"2758b8c1fc9a29b71470",4475:"e07cd9d316923546745c",4499:"f971884d4e7400d88a21",4547:"592e91f00549c5b20a2f",4579:"11a45709b703be84caaf",4695:"778d55486ce1e96338d4",4720:"113362697da1b69deaed",4889:"28a5878cbe5880476855",4959:"ae7dbdab79bca1e11741",5163:"3d52f71bf73811246d52",5235:"8b4c76cebb100e6c06f8",5257:"49d645e0bce92c156a4b",5307:"19e74eebecf4aac8cb72",5313:"15a969377bab11e7fd77",5318:"4837b6dc4b4878b01018",5329:"0a4401a148c3cb73d6ff",5358:"7691aa2227321066149d",5406:"4fc0a5f51be0ee462f0e",5410:"3e030fef8292b5e42295",5517:"591dd9e631437f92fa6b",5808:"096eb783027492e82937",5823:"fe1f3c93c92bc80810a4",5837:"42c67e6579b54844ec06",5853:"341dfd1b8201725518b9",5886:"2dd00e2bc45445cac33c",6088:"c087477e016da3827f3e",6233:"a66fd506069e3c776e1b",6237:"c544df83e86a9d36b68c",6347:"cc2bbd979dde20369b47",6353:"c52feec2175d8378ec90",6459:"7dcf52d3db3903c8eb9f",6481:"e84b935c285888a892c1",6550:"3894fe150674f64d6f19",6619:"b6d3d3b4807a2c6be002",6690:"6b6ad7d34669e2a8e52f",6710:"d11d1d294ccc4ccdf60f",6748:"7110152ed817433ceec0",6774:"4a830f056c4d0ed93928",6785:"43586fec92d0e9545972",6810:"411db587521e12c593be",6841:"b426f7b4c3dc60a366f6",6903:"e57b71ba70f088a3a052",6968:"f9579dd231563114fb30",7039:"60553206e233bf18a0a2",7054:"7adf62addc056a6309a5",7055:"8fb2fb11646d3973e8da",7277:"c23d965a55215168a1a2",7282:"b160857d5d25e8b56335",7284:"160052071932e0deda52",7319:"36df90c086bdb14d903b",7572:"6f827a32646bab0a8777",7604:"6d01a79473d6556b5c90",7682:"2a40d566961cce44426e",7793:"bfe8ca8b69975bfb2167",7845:"5b696059d1c392353fc1",7873:"93eb468381bfcf0e47d7",7913:"70b0b6d9559960307059",7996:"a6a2131bb9e10463c6fb",8014:"013eefcf29d02f955676",8062:"3bbff5ea1ea0e955c592",8121:"4f90019bf2a1fbf3c754",8163:"c75745292f7eb5f8d3f1",8227:"1f394b20410fddb30a96",8234:"c415af3787d6af66fc9e",8297:"b59a296f0371b6e26508",8326:"d34daffae237de764aab",8422:"7f91f70ef69a7e24f8e2",8625:"e4019b63a1fe74e2c842",8734:"f6e7506ee0a7b132a65f",8739:"98a63d4a405b11ac70b5",8758:"6d7fa026f58fd0c68a39",8828:"13b04d5bf348ab5054c2",8833:"fa42e7b062e44940617e",8927:"1e0498dc9836658d9aba",8936:"fffea9587ec14c6d34e8",9032:"f720ce44e0af6a68b608",9070:"1d4bc5b86d436fd09603",9127:"5cd20be7d545e84937a2",9151:"9bcec5ff5afc2bcd753a",9153:"9c6be39f1f21ab8b1c2d",9169:"f7ae0344257e6e08469b",9254:"f19feacc02a2091b6583",9291:"214910032945dd2d86b0",9296:"78ccff2011adbd73f10b",9490:"8fcabb9332d1d425e64f",9662:"d50d2bf051ed9f2d2008",9754:"c512898c1fc9072c2c5e",9870:"678c94b331fde96e6998",9884:"356db8b8297282c77291",9932:"3d6d9906a534ddd8fa37",9941:"365176c3b81e191ede66",9989:"807ffca9c71313cf2ea8"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
1
+ var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{Z:()=>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",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:()=>u,a9:()=>c,fS:()=>s,cq:()=>d,zG:()=>i,w6:()=>l,Od:()=>g,e$:()=>h,FY:()=>b});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function i(e){return e&&"number"==typeof e.length}const a=!!Array.prototype.fill;function c(e,t){if(a)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function l(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class u{constructor(){this.last=0}}const f=new u;function d(e,t,r,n){n=n||f;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function h(e,t,r,n){const o=null==r?e.length:r,s=d(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const p=new Set;function b(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;p.clear();for(let e=0;e<n;++e)p.add(t[e]);o=o||f;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(p.has(e[t])&&(s&&s.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;for(let t=0;t<i;++t)if(p.has(e[t])&&(s&&s.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;return p.clear(),r}function g(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{vT:()=>n,on:()=>o,IH:()=>s})},80442:(e,t,r)=>{"use strict";var n,o;let s;var i,a;function c(e){return"function"==typeof s[e]?s[e]=s[e](globalThis):s[e]}r.d(t,{Z:()=>c}),s=null!=(n=globalThis.dojoConfig)&&n.has||null!=(o=globalThis.esriConfig)&&o.has?{...null==(i=globalThis.dojoConfig)?void 0:i.has,...null==(a=globalThis.esriConfig)?void 0:a.has}:{},c.add=(e,t,r,n)=>((n||void 0===s[e])&&(s[e]=t),r&&c(e)),c.cache=s,c.add("esri-deprecation-warnings",!0),(()=>{var e;c.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const t="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(c.add("host-browser",t),c.add("host-node","object"==typeof globalThis.process&&(null==(e=globalThis.process.versions)?void 0:e.node)&&globalThis.process.versions.v8),c.add("dom",t),c("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(c.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),c.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),c.add("khtml",r.includes("Konqueror")?n:void 0),c.add("edge",parseFloat(t.split("Edge/")[1])||void 0),c.add("opr",parseFloat(t.split("OPR/")[1])||void 0),c.add("webkit",!c("wp")&&!c("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),c.add("chrome",!c("edge")&&!c("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),c.add("android",!c("wp")&&parseFloat(t.split("Android ")[1])||void 0),c.add("safari",!r.includes("Safari")||c("wp")||c("chrome")||c("android")||c("edge")||c("opr")?void 0:parseFloat(r.split("Version/")[1])),c.add("mac",r.includes("Macintosh")),!c("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));c.add(e,n),c.add("ios",n)}c.add("trident",parseFloat(r.split("Trident/")[1])||void 0),c("webkit")||(!t.includes("Gecko")||c("wp")||c("khtml")||c("trident")||c("edge")||c.add("mozilla",n),c("mozilla")&&c.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&c.add("esri-mobile",t),r&&c.add("esri-iPhone",r),c.add("esri-geolocation",!!navigator.geolocation)}c.add("esri-canvas-svg-support",!c("trident")),c.add("esri-wasm","WebAssembly"in globalThis),c.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),c.add("esri-atomics","Atomics"in globalThis),c.add("esri-workers","Worker"in globalThis),c.add("web-feat:cache","caches"in globalThis),c.add("esri-workers-arraybuffer-transfer",!c("safari")||Number(c("safari"))>=12),c.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),c.add("featurelayer-simplify-payload-size-factors",[1,1,4]),c.add("featurelayer-snapshot-enabled",!0),c.add("featurelayer-snapshot-point-min-threshold",8e4),c.add("featurelayer-snapshot-point-max-threshold",4e5),c.add("featurelayer-snapshot-point-coverage",.1),c.add("featurelayer-advanced-symbols",!1),c.add("featurelayer-pbf",!0),c.add("featurelayer-pbf-statistics",!1),c.add("feature-layers-workers",!0),c.add("feature-polyline-generalization-factor",1),c.add("mapview-transitions-duration",200),c.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),c.add("mapserver-pbf-enabled",!1),c("host-webworker")||c("host-browser")&&(c.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),c.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{c.add("esri-image-decode",!0,!0,!0)})).catch((()=>{c.add("esri-image-decode",!1,!0,!0)}))}return!1})),c.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{d9:()=>i,fS:()=>d,yd:()=>s,Vo:()=>a}),r(67676),r(80442);var n=r(70586),o=r(1533);function s(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&s(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function i(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(c(e))return e.clone();if(l(e))return e.map(i);if(u(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=i(e[t]);return r}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=f(e);if((0,n.pC)(t))return t;if(l(e)){let t=!0;const r=e.map((e=>{const r=a(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(c(e))return e.clone();if(!u(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=a(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function u(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function f(e){if((0,o.W0)(e)||(0,o.lq)(e)||(0,o.KZ)(e)||(0,o.z3)(e)||(0,o.Uc)(e)||(0,o.Hx)(e)||(0,o.ZY)(e)||(0,o.xZ)(e)||(0,o.fS)(e))return(0,o.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,i(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(i(e))})),t}return null}function d(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e){return void 0===e}function i(e,t){return n(e)?t(e):null}function a(e){return e}function c(e,t){if(o(e))throw new Error(t);return e}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e,t){return n(e)?e:t}function f(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function h(e){return n(e)&&e.remove(),null}function p(e){return n(e)&&e.release(),null}function b(e){return null}function g(e,t){const r=new Array;for(const n of e)r.push(y(n,null,t));return r}function m(e,t){for(const r of e)i(r,t)}function y(e,t,r){return n(e)?r(e):t}function v(e){return e.filter((e=>n(e)))}function w(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function _(e){return e}r.d(t,{yw:()=>i,j0:()=>_,SC:()=>f,O3:()=>d,lV:()=>v,JR:()=>m,U2:()=>w,Wi:()=>o,pC:()=>n,o8:()=>s,Fd:()=>g,R2:()=>y,Bd:()=>b,RY:()=>p,hw:()=>h,Wg:()=>a,Pt:()=>l,s3:()=>c,yl:()=>u})},78286:(e,t,r)=>{"use strict";r.d(t,{RH:()=>o,hS:()=>s,RB:()=>i});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce((function(e,o){let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{-1===s.indexOf(e)&&s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>C,$6:()=>c,Ue:()=>l,zE:()=>u,dD:()=>_,hh:()=>x,vr:()=>T,Ds:()=>j,as:()=>O,WW:()=>P,R8:()=>w,D_:()=>v,Hc:()=>h,y8:()=>E,fu:()=>g,$F:()=>m,d1:()=>k,DB:()=>S,r9:()=>p,k_:()=>f,H9:()=>b,Yn:()=>M,gx:()=>A,Hl:()=>y});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o,s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e){return Promise.all(e)}function l(e){return new Promise(((t,r)=>{try{e(t,r)}catch(e){Promise.resolve().then((()=>r(e)))}}))}function u(e="Aborted"){return new s.Z("AbortError",e)}function f(e,t="Aborted"){if(h(e))throw u(t)}function d(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function h(e){const t=d(e);return(0,a.pC)(t)&&t.aborted}function p(e){if(v(e))throw e}function b(e){if(!v(e))throw e}function g(e,t){const r=d(e);if(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function m(e,t){const r=d(e);if(!(0,a.Wi)(r))return f(r),(0,i.IH)(r,"abort",(()=>t(u())))}function y(e,t){const r=d(t);return(0,a.Wi)(r)?e:new Promise(((r,n)=>{let o=g(t,(()=>n(u())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function v(e){return e&&"AbortError"===e.name}function w(e){return e.catch((e=>{if(!v(e))throw e}))}function _(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}function O(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e);return O(t.map((t=>e[t]))).then((e=>{const r={};return t.forEach(((t,n)=>r[t]=e[n])),r}))}const t=e;return l((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}function P(e){return O(e).then((e=>e.filter((e=>!!e.value)).map((e=>e.value))))}function k(e){return Promise.reject(e)}function S(e){return Promise.resolve(e)}function C(e,t,r){const n=new AbortController;return g(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);g(n,(()=>{s&&(clearTimeout(s),o(u()))}))}))}function E(e){return e&&"function"==typeof e.then}function A(e){return E(e)?e:Promise.resolve(e)}function j(e,t=-1){let r,n,o,s,i=null;const c=(...l)=>{if(r){n=l,s&&s.reject(u()),s=_();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||_(),s=null,t>0){const n=new AbortController;r=A(e(...l,n.signal));const o=r;C(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=A(e(...l));const f=()=>{const e=n;n=o=r=i=null,null!=e&&c(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return c}function x(){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 T(e,t){let r,n=new AbortController;const o=e(n.signal);let s={promise:o,finished:!1,abort:()=>{n&&(n.abort(),n=null)}};const i=()=>{s&&(s.finished=!0,s=null),(0,a.pC)(r)&&(r.remove(),r=null),n=null};return o.then(i,i),r=g(t,(()=>{(0,a.pC)(s)&&s.abort()})),s}function M(e){return Promise.resolve().then((()=>{f(e)}))}},19153:(e,t,r)=>{"use strict";r.d(t,{Qs:()=>a,hP:()=>c,gx:()=>i,Cb:()=>l});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return null==e?"":e}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&-1!==t.indexOf(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,eP:()=>s,xZ:()=>h,fS:()=>p,z3:()=>l,Hx:()=>f,W0:()=>i,Uc:()=>u,ZY:()=>d,lq:()=>a,KZ:()=>c,tP:()=>o})},17452:(e,t,r)=>{"use strict";r.d(t,{R9:()=>y,qg:()=>j,tD:()=>$,ZN:()=>he,fl:()=>pe,rS:()=>V,Ie:()=>ue,sJ:()=>Y,AH:()=>Q,io:()=>ee,L:()=>P,TI:()=>O,vt:()=>ce,oh:()=>U,P$:()=>D,Ml:()=>be,ed:()=>I,b7:()=>A,D6:()=>W,tm:()=>R,YP:()=>H,jc:()=>z,HK:()=>K,$U:()=>ne,oC:()=>te,kl:()=>L,v_:()=>B,hF:()=>q,_l:()=>X,PF:()=>F,Fv:()=>Z,B7:()=>E,u0:()=>S,Yd:()=>ae,Hu:()=>de,Qj:()=>le,hO:()=>oe,mN:()=>k});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const v={};let w=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(w.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${w.scheme}://${w.host}${null!=w.port?`:${w.port}`:""}${t}`}();const O=()=>w,P=()=>_;function k(e){const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=S(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function S(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function E(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function A(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=I(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),k(r)}function j(e){const t=I(e);let r,n;if(t){const e=T(t.proxyUrl);r=e.path,n=e.query?S(e.query):null}if(r){const t=k(e);e=r+"?"+t.path;const o=E({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function T(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=T(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function I(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function R(e,t){return e=N(e),t=N(t),ie(e)===ie(t)}function N(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function U(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function W(e,t,r=!1){const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function L(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(W(e,w))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(W(e,n[t]))return!0}return!1}function J(e){return v[e]||(re(e)||te(e)?v[e]=[new y(q(e))]:v[e]=[new y(`http://${e}`),new y(`https://${e}`)]),v[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===w.scheme&&w.authority===D(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(B("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function F(e,t=_,r){if(!H(e))return e;const n=Z(e),o=n.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=r?Z(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function Z(e){return function(e){const t=c.httpsDomains;if(!function(e){return f.test(e)||"http"===w.scheme&&te(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===w.scheme&&n===w.authority&&!b.test(e)||(se()&&n===w.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!I(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=T(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function B(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function D(e,t=!1){if(z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return"data:"===e.slice(0,5)}function Q(e){const t=Y(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function V(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&void 0!==e&&"/"===e[0]&&"/"===e[1]}function re(e){return u.test(e)}function ne(e){return d.test(e)||"https"===w.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===w.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=k(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(null==t||!t.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=w.scheme),e)}function de(e,t){const r=k(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function he(e,t,r){const n=k(e),o=n.query||{};return o[t]=String(r),`${n.path}?${E(o)}`}function pe(e,t){const r=k(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=E(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(ge);return t?t[1]:null}const ge=/.*?\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5406),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(7793)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(8936)]).then(r.bind(r,18936)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(6481),r.e(6459),r.e(7996)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(9662),r.e(6353)]).then(r.bind(r,98363)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5886),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(9662),r.e(4325),r.e(1684)]).then(r.bind(r,70299)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(6347)]).then(r.bind(r,16583)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(5257),r.e(176),r.e(2398),r.e(7282)]).then(r.bind(r,61576)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(1534),r.e(5257),r.e(9870),r.e(5886),r.e(5406),r.e(7054),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6810),r.e(3388)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t){this._port=e,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r});return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const i=(0,c.jt)();return new Promise(((r,o)=>{const c=(0,a.$F)(n,(()=>{var e;const t=this._outJobs.get(i);t&&(this._outJobs.delete(i),null==(e=t.abortHandle)||e.remove(),this._post({type:d,jobId:i}),o((0,a.zE)()))})),l={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(i,l),this._post({type:h,jobId:i,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_close(){this._channel&&(this._channel=null),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{var t;null==(t=e.abortHandle)||t.remove(),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&-1!==t.indexOf(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e).type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){var t;const{jobId:r,error:n,data:s}=e,i=this._outJobs;if(!i.has(r))return;const a=i.get(r);i.delete(r),null==(t=a.abortHandle)||t.remove(),n?a.reject(o.Z.fromJSON(JSON.parse(n))):a.resolve(s)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{Cs:()=>n,jt:()=>a,oi:()=>l,QM:()=>u,AB:()=>c});var n,o,s=r(80442);(o=n||(n={}))[o.HANDSHAKE=0]="HANDSHAKE",o[o.OPEN=1]="OPEN",o[o.OPENED=2]="OPENED",o[o.RESPONSE=3]="RESPONSE",o[o.INVOKE=4]="INVOKE",o[o.ABORT=5]="ABORT",o[o.CLOSE=6]="CLOSE",o[o.OPEN_PORT=7]="OPEN_PORT",o[o.ON=8]="ON";let i=0;function a(){return i++}function c(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function l(e,t,r,o){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(s=f(o),t.data=r):(s=f(r.transferList),t.data=r.result),s?e.postMessage(t,s):e.postMessage(t)}function u(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function f(e){if(!e||!e.length)return null;if((0,s.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,id:()=>a,qh:()=>c,i8:()=>s,Nv:()=>i});var n=r(80442),o=r(17452);const s="4.23",i={async request(e,t){var n;const{default:s}=await r.e(3172).then(r.bind(r,3172)),i=e.options,a=i.responseType;i.signal=null==t?void 0:t.signal,i.responseType="native"===a||"native-request-init"===a?"native-request-init":["blob","json","text"].includes(a)&&null!=(n=(0,o.oh)(e.url))&&n.after?a:"array-buffer";const c=await s(e.url,i),l={data:c.data,ssl:c.ssl};switch(c.requestOptions.responseType){case"native-request-init":return delete l.data.signal,l;case"blob":l.data=await l.data.arrayBuffer();break;case"json":l.data=(new TextEncoder).encode(JSON.stringify(l.data)).buffer;break;case"text":l.data=(new TextEncoder).encode(l.data).buffer}return{result:l,transferList:[l.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")||((0,n.Z)("edge")||(0,n.Z)("trident"))&&console.warn("Deprecated browser - see http://esriurl.com/oldbrowser")},17202:(e,t,r)=>{"use strict";r.d(t,{r:()=>n,$:()=>o});const n="20220322",o="dec012ea4e0c744c265cb910604dec5c0e010a93"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{24:"5d5fa2b1fc48a17eb9ab",86:"666f3fc44eaee390d2b1",176:"93ace2e16c102db1bc29",214:"53a150a1eec3894e2a9e",223:"5bdd4df2b0ea60dba368",247:"a0450fbf01de854f5c97",280:"73a3ad2146bfea9f5dce",565:"0018053ac16a09feba70",576:"812a5abfadd747a09b6f",609:"792fc86380a84b6ac98e",635:"e8e775758b79c5a084c8",639:"db2604563294bf49bbf9",678:"ea313474f460ce31b6d5",712:"93bd67b4258e84c1e6f0",819:"5d3e774ce7b006c8cba8",999:"da7cce130c459c84a794",1188:"b04af5e4a9ae0c90a1de",1197:"e9d59300727f5e52e148",1400:"de337486515d9aff478b",1412:"8d95f3a3f776fef3f9cb",1421:"7fa2d758a24bbaaab0bf",1433:"52489e2f7748dc610263",1534:"6ef8de3aa9a8d9c22161",1562:"6141d433dda78b29e6e1",1684:"410e9b40a2b7f88ea669",1773:"4d2ef57ff3a5cfc1313f",1785:"d88cb7568e2f8ac9905b",1916:"3011f1c1ee5631df98b2",2133:"3403cb53e4e60923c5fc",2134:"070a78b488f92d022495",2279:"cab3f15de3686ca966ec",2304:"d209d82484aa725c5aa9",2397:"3d70f945621de60c7b14",2398:"2a1adc5de77f832b31de",2399:"467b5faa1c90d9821609",2515:"68fc1d7c3fd10a7205c4",3003:"2dcdad8e77bb4bd82680",3027:"0c711b129d501b1d4439",3127:"45155ec947e3f4511c08",3172:"10322d990cda5aedf2f0",3230:"29eb733e18be5a778f4a",3388:"dd47b92663f21fc442b8",3529:"2f6bff1aa485cf22527d",3668:"85fde4b92b0c212f5ff6",3852:"62c683f44c297d239ab8",4166:"8cfefa829131ec234de3",4325:"c7da2f1bdda4de915210",4358:"f977977564b2b75332a9",4369:"2758b8c1fc9a29b71470",4475:"e07cd9d316923546745c",4499:"f971884d4e7400d88a21",4547:"592e91f00549c5b20a2f",4579:"11a45709b703be84caaf",4695:"778d55486ce1e96338d4",4720:"113362697da1b69deaed",4889:"28a5878cbe5880476855",4959:"ae7dbdab79bca1e11741",5163:"3d52f71bf73811246d52",5235:"8b4c76cebb100e6c06f8",5257:"49d645e0bce92c156a4b",5307:"19e74eebecf4aac8cb72",5313:"15a969377bab11e7fd77",5318:"4837b6dc4b4878b01018",5329:"0a4401a148c3cb73d6ff",5358:"7691aa2227321066149d",5406:"4fc0a5f51be0ee462f0e",5410:"3e030fef8292b5e42295",5517:"591dd9e631437f92fa6b",5808:"096eb783027492e82937",5823:"fe1f3c93c92bc80810a4",5837:"42c67e6579b54844ec06",5853:"341dfd1b8201725518b9",5886:"2dd00e2bc45445cac33c",6088:"c087477e016da3827f3e",6233:"a66fd506069e3c776e1b",6237:"c544df83e86a9d36b68c",6347:"cc2bbd979dde20369b47",6353:"c52feec2175d8378ec90",6459:"7dcf52d3db3903c8eb9f",6481:"e84b935c285888a892c1",6550:"3894fe150674f64d6f19",6619:"b6d3d3b4807a2c6be002",6690:"6b6ad7d34669e2a8e52f",6710:"d11d1d294ccc4ccdf60f",6748:"7110152ed817433ceec0",6774:"4a830f056c4d0ed93928",6785:"43586fec92d0e9545972",6810:"411db587521e12c593be",6841:"b426f7b4c3dc60a366f6",6903:"e57b71ba70f088a3a052",6968:"f9579dd231563114fb30",7039:"60553206e233bf18a0a2",7054:"7adf62addc056a6309a5",7055:"8fb2fb11646d3973e8da",7277:"c23d965a55215168a1a2",7282:"b160857d5d25e8b56335",7284:"160052071932e0deda52",7319:"36df90c086bdb14d903b",7572:"6f827a32646bab0a8777",7604:"6d01a79473d6556b5c90",7682:"2a40d566961cce44426e",7793:"bfe8ca8b69975bfb2167",7845:"5b696059d1c392353fc1",7873:"93eb468381bfcf0e47d7",7913:"70b0b6d9559960307059",7996:"a6a2131bb9e10463c6fb",8014:"013eefcf29d02f955676",8062:"3bbff5ea1ea0e955c592",8121:"4f90019bf2a1fbf3c754",8163:"c75745292f7eb5f8d3f1",8227:"1f394b20410fddb30a96",8234:"c415af3787d6af66fc9e",8297:"b59a296f0371b6e26508",8326:"d34daffae237de764aab",8422:"7f91f70ef69a7e24f8e2",8625:"e4019b63a1fe74e2c842",8734:"f6e7506ee0a7b132a65f",8739:"98a63d4a405b11ac70b5",8758:"6d7fa026f58fd0c68a39",8828:"13b04d5bf348ab5054c2",8833:"fa42e7b062e44940617e",8927:"1e0498dc9836658d9aba",8936:"fffea9587ec14c6d34e8",9032:"f720ce44e0af6a68b608",9070:"1d4bc5b86d436fd09603",9127:"5cd20be7d545e84937a2",9151:"9bcec5ff5afc2bcd753a",9153:"9c6be39f1f21ab8b1c2d",9169:"f7ae0344257e6e08469b",9254:"f19feacc02a2091b6583",9291:"214910032945dd2d86b0",9296:"78ccff2011adbd73f10b",9490:"8fcabb9332d1d425e64f",9662:"d50d2bf051ed9f2d2008",9754:"c512898c1fc9072c2c5e",9870:"678c94b331fde96e6998",9884:"356db8b8297282c77291",9932:"3d6d9906a534ddd8fa37",9941:"365176c3b81e191ede66",9989:"807ffca9c71313cf2ea8"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
package/interfaces.d.ts CHANGED
@@ -80921,10 +80921,16 @@ declare namespace __esri {
80921
80921
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#startCreateFeaturesWorkflowAtFeatureCreation)
80922
80922
  */
80923
80923
  startCreateFeaturesWorkflowAtFeatureCreation(creationInfo: CreationInfo): Promise<void>;
80924
+ /**
80925
+ * Initiates the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateFeaturesWorkflow.html) by displaying the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) panel.
80926
+ *
80927
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#startCreateFeaturesWorkflowAtFeatureTypeSelection)
80928
+ */
80929
+ startCreateFeaturesWorkflowAtFeatureTypeSelection(): Promise<void>;
80924
80930
  /**
80925
80931
  * Initiates the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateFeaturesWorkflow.html) by displaying the panel where feature creation begins.
80926
80932
  *
80927
- * @deprecated since 4.23, instead use [startCreateFeaturesWorkflowAtFeatureCreation](#startCreateFeaturesWorkflowAtFeatureCreation)
80933
+ * @deprecated since version 4.23. Instead use [startCreateFeaturesWorkflowAtFeatureCreation](#startCreateFeaturesWorkflowAtFeatureCreation)
80928
80934
  *
80929
80935
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#startCreateWorkflowAtFeatureCreation)
80930
80936
  */
@@ -80932,13 +80938,15 @@ declare namespace __esri {
80932
80938
  /**
80933
80939
  * This method starts the [CreateWorkflow](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateWorkflow.html) where it waits for the feature to be selected.
80934
80940
  *
80941
+ * @deprecated since 4.23
80942
+ *
80935
80943
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#startCreateWorkflowAtFeatureEdit)
80936
80944
  */
80937
80945
  startCreateWorkflowAtFeatureEdit(feature: Graphic): Promise<void>;
80938
80946
  /**
80939
80947
  * Initiates the [CreateWorkflow](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateWorkflow.html) by displaying the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) panel.
80940
80948
  *
80941
- * @deprecated since 4.23, use [startCreateFeaturesWorkflowAtFeatureCreation](#startCreateFeaturesWorkflowAtFeatureCreation) instead.
80949
+ * @deprecated since version 4.23. Instead use [startCreateFeaturesWorkflowAtFeatureTypeSelection](#startCreateFeaturesWorkflowAtFeatureTypeSelection) instead.
80942
80950
  *
80943
80951
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#startCreateWorkflowAtFeatureTypeSelection)
80944
80952
  */
@@ -81329,10 +81337,22 @@ declare namespace __esri {
81329
81337
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#deleteFeatureFromWorkflow)
81330
81338
  */
81331
81339
  deleteFeatureFromWorkflow(): Promise<void>;
81340
+ /**
81341
+ * Initiates the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateFeaturesWorkflow.html) by displaying the panel where feature creation begins.
81342
+ *
81343
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startCreateFeaturesWorkflowAtFeatureCreation)
81344
+ */
81345
+ startCreateFeaturesWorkflowAtFeatureCreation(creationInfo: CreationInfo): Promise<void>;
81346
+ /**
81347
+ * Initiates the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateFeaturesWorkflow.html) by displaying the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) panel.
81348
+ *
81349
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startCreateFeaturesWorkflowAtFeatureTypeSelection)
81350
+ */
81351
+ startCreateFeaturesWorkflowAtFeatureTypeSelection(): Promise<void>;
81332
81352
  /**
81333
81353
  * Initiates the [CreateWorkflow](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateWorkflow.html) by displaying the panel where feature creation begins.
81334
81354
  *
81335
- * @deprecated since 4.23, instead use {@link module:esri/widgets/Editor#startCreateFeaturesWorkflowAtFeatureCreation startCreateFeaturesWorkflowAtFeatureCreation}.
81355
+ * @deprecated since version 4.23. Instead use {@link module:esri/widgets/Editor#startCreateFeaturesWorkflowAtFeatureCreation startCreateFeaturesWorkflowAtFeatureCreation}.
81336
81356
  *
81337
81357
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startCreateWorkflowAtFeatureCreation)
81338
81358
  */
@@ -81340,13 +81360,15 @@ declare namespace __esri {
81340
81360
  /**
81341
81361
  * This method starts the [CreateWorkflow](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateWorkflow.html) where it waits for the feature to be selected.
81342
81362
  *
81363
+ * @deprecated since 4.23
81364
+ *
81343
81365
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startCreateWorkflowAtFeatureEdit)
81344
81366
  */
81345
81367
  startCreateWorkflowAtFeatureEdit(feature: Graphic): Promise<void>;
81346
81368
  /**
81347
81369
  * Initiates the [CreateWorkflow](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateWorkflow.html) by displaying the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) panel.
81348
81370
  *
81349
- * @deprecated since 4.23, instead use {@link module:esri/widgets/Editor#startCreateFeaturesWorkflowAtFeatureCreation startCreateFeaturesWorkflowAtFeatureCreation}.
81371
+ * @deprecated since version 4.23. Instead use {@link module:esri/widgets/Editor#startCreateFeaturesWorkflowAtFeatureTypeSelection startCreateFeaturesWorkflowAtFeatureTypeSelection}.
81350
81372
  *
81351
81373
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startCreateWorkflowAtFeatureTypeSelection)
81352
81374
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.23.0-next.20220319",
3
+ "version": "4.23.0-next.20220322",
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 e="20220319",f="af11bcfb4f044e6f4f6e60a84a7647b822ce6e7d";export{e as buildDate,f as commitHash};
5
+ const c="20220322",e="dec012ea4e0c744c265cb910604dec5c0e010a93";export{c as buildDate,e as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{get as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{e as n}from"../../../../chunks/earcut.js";import{a}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a as o}from"../../../../chunks/mat4.js";import{I as l,c}from"../../../../chunks/mat4f64.js";import{g as h,n as m,s as p,f as d,c as u,m as f}from"../../../../chunks/vec3.js";import{d as g,c as y}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as _}from"../../../../geometry/projection.js";import{create as b,empty as E,expandWithBuffer as x,intersectsClippingArea as P}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f64 as v}from"../../../../geometry/support/buffer/BufferView.js";import{t as S,a as w}from"../../../../chunks/vec32.js";import{getDriverAxisSizeValue as j}from"../../../../renderers/support/renderingInfoUtils.js";import{ViewingMode as A}from"../../../ViewingMode.js";import{needsElevationUpdates3D as L,evaluateElevationInfoAtPoint as M,SampleElevationInfo as O}from"./elevationAlignmentUtils.js";import{ElevationContext as B}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as I}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as C}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as R,computeCentroid as T}from"./graphicUtils.js";import{ApplyRendererDiffResult as z}from"./interfaces.js";import{geometryAsPolygon as G,geometryToRenderInfo as D}from"./polygonUtils.js";import{createMaterial as U}from"../support/edgeUtils.js";import k from"../../support/debugFlags.js";import{SamplePosition as N}from"../../support/ElevationProvider.js";import{CullFaceOptions as F,PrimitiveType as V}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as H}from"../../webgl-engine/lib/Geometry.js";import{Object3D as Y}from"../../webgl-engine/lib/Object3D.js";import{VertexAttribute as Z}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as W}from"../../webgl-engine/materials/DefaultMaterial.js";const q=["polygon","extent"];class J extends C{constructor(e,t,r,s){super(e,t,r,s),this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=R(this._getSymbolSize());if(t)throw new e("graphics3dextrudesymbollayer:invalid-size",t)}const r=t(this.symbolLayer,"material","color"),s=this._getCombinedOpacityAndColor(r),n=g(s),a=s[3],i=a<1||this.needsDrivenTransparentPass,o={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,diffuse:n,ambient:n,opacity:a,transparent:i,cullFace:i?F.None:F.Back,vertexColors:!0,slicePlaneEnabled:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};this._material=new W(o),this._bottomMaterial=new W({...o,cullFace:F.Back}),this._context.stage.add(this._material),this._context.stage.add(this._bottomMaterial)}destroy(){super.destroy(),this._material&&(this._context.stage.remove(this._material),this._context.stage.remove(this._bottomMaterial))}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,q,this.symbolLayer.type))return null;const r=this._getVertexOpacityAndColor(e.renderingInfo,255),s=this.setGraphicElevationContext(t,new B);return this._createAs3DShape(t,e.renderingInfo,r,s,t.uid)}layerOpacityChanged(e,s){const n=t(this.symbolLayer,"material","color"),a=this._getCombinedOpacity(n),i=a<1||this.needsDrivenTransparentPass;this._material.setParameters({opacity:a,transparent:i}),this._bottomMaterial.setParameters({opacity:a,transparent:i});const o=this._getLayerOpacity();return e.forEach((e=>{const t=s(e);r(t)&&t.layerOpacityChanged(o,this._context.isAsync)})),!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,L)}slicePlaneEnabledChanged(e,t){return this._material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),this._bottomMaterial.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),e.forEach((e=>{const s=t(e);r(s)&&s.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){return this._material.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._bottomMaterial.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}pixelRatioChanged(){return!0}_getExtrusionSize(e){let t;var r;e.size&&this._drivenProperties.size?t=null!=(r=j(e.size,2))?r:0:t=this._getSymbolSize();return t/=this._context.renderCoordsHelper.unitInMeters,t}applyRendererDiff(){return z.Recreate_Graphics}_getSymbolSize(){var e;return null!=(e=this.symbolLayer.size)?e:1}_createAs3DShape(e,t,h,m,p){const d=G(e.geometry);if(s(d))return null;const u=D(d,this._context.elevationProvider,this._context.renderCoordsHelper,m);if(this._logGeometryCreationWarnings(u,d.rings,"rings","ExtrudeSymbol3DLayer"),0===d.rings.length||!d.rings.some((e=>e.length>0)))return null;const f=T(d);if(s(f))return null;const g=new Array,j=new Array,M=new Array,O=b(),B=c(),C=y(),R=this._context.renderCoordsHelper.viewingMode===A.Global;R||this._context.renderCoordsHelper.worldUpAtPosition(null,C),_(d.spatialReference,[f.x,f.y,0],B,this._context.renderCoordsHelper.spatialReference);const z=c();o(z,B);const k=i();a(k,z);const{polygons:N,mapPosition:F,position:V}=u,H=V.length/3,Z=new Float64Array(3*H*6),W=new Float64Array(3*H*6),q=new Float64Array(3*H*6),J=new Float64Array(1*H*6);let Q=0;for(let r=0;r<N.length;++r){const e=N[r],s=e.count;if(this._context.clippingExtent&&(E(O),x(O,e.mapPosition),!P(O,this._context.clippingExtent)))continue;const a=n(e.mapPosition,e.holeIndices,3);if(0===a.length)continue;const i=3*s*2+a.length,o=new Uint32Array(i),c=new Uint32Array(a.length),m=6*s,p=3*Z.BYTES_PER_ELEMENT,d=new v(Z.buffer,Q*p,p,(Q+m)*p),u=3*W.BYTES_PER_ELEMENT,f=new v(W.buffer,Q*u,u,(Q+m)*u),y=new Float64Array(q.buffer,3*Q*q.BYTES_PER_ELEMENT,3*m),_=new Float64Array(J.buffer,1*Q*J.BYTES_PER_ELEMENT,1*m),b=this._getExtrusionSize(t);K(V,F,a,e,d.typedBuffer,y,f.typedBuffer,_,0,o,c,b,C,R),S(d,d,z),w(f,f,k),Q+=6*s;const A=this._createExtrudeGeometry(o,o.length-c.length,{positions:d.typedBuffer,elevation:y,normals:f.typedBuffer,heights:_},h);g.push(A),j.push(this._material),M.push(l);const L=this._createExtrudeGeometry(c,0,{positions:d.typedBuffer,elevation:y,normals:f.typedBuffer,heights:_},h);g.push(L),j.push(this._bottomMaterial),M.push(l)}if(0===g.length)return null;const X=new Y({geometries:g,materials:j,transformations:M,metadata:{layerUid:this._context.layer.uid,graphicUid:p,isElevationSource:!0}});X.transformation=B;const $=U(this.symbolLayer,{opacity:this._getLayerOpacity()}),ee=r($)?{baseMaterial:this._material,edgeMaterials:[$],properties:{mergeGeometries:!0,slicePlaneEnabled:this._context.slicePlaneEnabled}}:null,te=new I(this,X,g,null,null,le,m,ee);return te.alignedSampledElevation=u.sampledElevation,te.needsElevationUpdates=L(m.mode),te}_createExtrudeGeometry(e,t,r,s){const n=new Uint32Array(e.length),a=[[Z.POSITION,{size:3,data:r.positions,exclusive:!0}],[Z.NORMAL,{size:3,data:r.normals,exclusive:!0}],[Z.COLOR,{size:4,data:s,exclusive:!0}],[Z.SIZE,{size:1,data:r.heights,exclusive:!0}]],i=[[Z.POSITION,e],[Z.NORMAL,e],[Z.COLOR,n]];return r.elevation&&(a.push([Z.MAPPOS,{size:3,data:r.elevation}]),i.push([Z.MAPPOS,e])),new H(a,i,V.Triangle,t)}}function K(e,t,r,s,n,a,i,o,l,c,h,m,p,d){const u=r.length/3;let f=0,g=2*s.count;Q(e,t,s.index,s.count,r,0,u,n,a,i,o,l,c,h,g,m,p,d),l+=2*s.count,g=0,ee(n,a,o,i,f,s.pathLengths[0],s.count,l,c,g,m),l+=4*s.pathLengths[0],g+=2*s.pathLengths[0],f+=s.pathLengths[0];for(let y=1;y<s.pathLengths.length;++y)ee(n,a,o,i,f,s.pathLengths[y],s.count,l,c,g,m),l+=4*s.pathLengths[y],g+=2*s.pathLengths[y],f+=s.pathLengths[y]}function Q(e,t,r,s,n,a,i,o,l,c,p,d,u,f,g,y,_,b){h(he,_);const E=y>0?1:-1;let x=3*r,P=d,v=3*P,S=d+s,w=3*S;for(let h=0;h<s;++h)b&&(he[0]=e[x+0],he[1]=e[x+1],he[2]=e[x+2],m(he,he)),o[v+0]=e[x+0],o[v+1]=e[x+1],o[v+2]=e[x+2],l[v+0]=t[x+0],l[v+1]=t[x+1],l[v+2]=t[x+2],c[v+0]=-E*he[0],c[v+1]=-E*he[1],c[v+2]=-E*he[2],p[P]=0,o[w+0]=e[x+0]+y*he[0],o[w+1]=e[x+1]+y*he[1],o[w+2]=e[x+2]+y*he[2],l[w+0]=t[x+0],l[w+1]=t[x+1],l[w+2]=t[x+2],c[w+0]=E*he[0],c[w+1]=E*he[1],c[w+2]=E*he[2],p[S]=y,v+=3,w+=3,x+=3,P+=1,S+=1;x=3*a,v=0,w=3*g;const j=y<0?de:pe,A=y<0?pe:de;for(let h=0;h<i;++h)f[v+0]=n[x+j[0]],f[v+1]=n[x+j[1]],f[v+2]=n[x+j[2]],u[w+0]=n[x+A[0]]+s,u[w+1]=n[x+A[1]]+s,u[w+2]=n[x+A[2]]+s,v+=3,w+=3,x+=3}function X(e,t,r,s,n,a,i){s[a]=s[i],i*=3,e[(a*=3)+0]=e[i+0],e[a+1]=e[i+1],e[a+2]=e[i+2],t[a+0]=t[i+0],t[a+1]=t[i+1],t[a+2]=t[i+2],r[a+0]=n[0],r[a+1]=n[1],r[a+2]=n[2]}const $=y();function ee(e,t,r,s,n,a,i,o,l,c,h){let m=n,p=n+1,d=n+i,u=n+i+1,f=o,g=o+1,y=o+2*a,_=o+2*a+1;h<0&&(m=n+i+1,u=n),c*=3;for(let b=0;b<a;++b)b===a-1&&(h>0?(p=n,u=n+i):(p=n,m=n+i)),ie(e,m,p,d,$),X(e,t,s,r,$,f,m),X(e,t,s,r,$,g,p),X(e,t,s,r,$,y,d),X(e,t,s,r,$,_,u),l[c++]=f,l[c++]=y,l[c++]=_,l[c++]=f,l[c++]=_,l[c++]=g,m++,p++,d++,u++,f+=2,g+=2,y+=2,_+=2}const te=y(),re=y(),se=y(),ne=y(),ae=y();function ie(e,t,r,s,n){t*=3,r*=3,s*=3,p(te,e[t++],e[t++],e[t++]),p(re,e[r++],e[r++],e[r++]),p(se,e[s++],e[s++],e[s++]),d(ne,re,te),d(ae,se,te),u(n,ae,ne),m(n,n)}const oe=y();function le(e,t,r,s){const n=e.stageObject,a=n.geometryRecords,i=a.length,l="absolute-height"!==t.mode;let h=0;const m=n.transformation,d=o(c(),m);for(let o=0;o<i;o+=2){const e=a[o].geometry,i=e.getMutableAttribute(Z.POSITION).data,c=e.vertexAttributes.get(Z.SIZE).data,u=e.vertexAttributes.get(Z.MAPPOS).data,g=new N(u),y=i.length/3;let _=0,b=!1,E=0;const x=r.spatialReference;for(let n=0;n<y;n++){oe[0]=i[_],oe[1]=i[_+1],oe[2]=i[_+2],M(g,r,t,s,me),l&&(E+=me.sampledElevation),k.TESTS_DISABLE_OPTIMIZATIONS?(p(ce,g.array[g.offset+0],g.array[g.offset+1],me.z+c[_/3]),s.toRenderCoords(ce,x,ce),f(ce,ce,d)):(p(ce,i[_+0],i[_+1],i[_+2]),f(ce,ce,m),s.setAltitude(ce,me.z+c[_/3]),f(ce,ce,d)),i[_]=ce[0],i[_+1]=ce[1],i[_+2]=ce[2];const e=ue/s.unitInMeters;(Math.abs(oe[0]-i[_])>=e||Math.abs(oe[1]-i[_+1])>=e||Math.abs(oe[2]-i[_+2])>=e)&&(b=!0),g.offset+=3,_+=3}b&&(e.invalidateBoundingInfo(),n.geometryVertexAttrsUpdated(a[o]),a[o+1].geometry.invalidateBoundingInfo(),n.geometryVertexAttrsUpdated(a[o+1])),h+=E/y}return h/i}const ce=y(),he=y(),me=new O,pe=[0,2,1],de=[0,1,2],ue=.01;export{J as Graphics3DExtrudeSymbolLayer};
5
+ import e from"../../../../core/Error.js";import{get as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{e as n}from"../../../../chunks/earcut.js";import{a}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a as o}from"../../../../chunks/mat4.js";import{I as l,c}from"../../../../chunks/mat4f64.js";import{g as h,n as m,s as p,f as d,c as u,m as f}from"../../../../chunks/vec3.js";import{d as g,c as y}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as b}from"../../../../geometry/projection.js";import{create as _,empty as E,expandWithBuffer as x,intersectsClippingArea as P}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f64 as v}from"../../../../geometry/support/buffer/BufferView.js";import{t as S,a as w}from"../../../../chunks/vec32.js";import{getDriverAxisSizeValue as j}from"../../../../renderers/support/renderingInfoUtils.js";import{ViewingMode as A}from"../../../ViewingMode.js";import{needsElevationUpdates3D as L,evaluateElevationInfoAtPoint as M,SampleElevationInfo as O}from"./elevationAlignmentUtils.js";import{ElevationContext as B}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as C}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as I}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as R,computeCentroid as T}from"./graphicUtils.js";import{ApplyRendererDiffResult as z}from"./interfaces.js";import{geometryAsPolygon as D,geometryToRenderInfo as G}from"./polygonUtils.js";import{createMaterial as U}from"../support/edgeUtils.js";import k from"../../support/debugFlags.js";import{SamplePosition as N}from"../../support/ElevationProvider.js";import{CullFaceOptions as F,PrimitiveType as V}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as H}from"../../webgl-engine/lib/Geometry.js";import{Object3D as Y}from"../../webgl-engine/lib/Object3D.js";import{VertexAttribute as Z}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as W}from"../../webgl-engine/materials/DefaultMaterial.js";const q=["polygon","extent"];class J extends I{constructor(e,t,r,s){super(e,t,r,s),this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=R(this._getSymbolSize());if(t)throw new e("graphics3dextrudesymbollayer:invalid-size",t)}const r=t(this.symbolLayer,"material","color"),s=this._getCombinedOpacityAndColor(r),n=g(s),a=s[3],i=a<1||this.needsDrivenTransparentPass,o={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,diffuse:n,ambient:n,opacity:a,transparent:i,cullFace:i?F.None:F.Back,vertexColors:!0,slicePlaneEnabled:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};this._material=new W(o),this._bottomMaterial=new W({...o,cullFace:F.Back}),this._context.stage.add(this._material),this._context.stage.add(this._bottomMaterial)}destroy(){super.destroy(),this._material&&(this._context.stage.remove(this._material),this._context.stage.remove(this._bottomMaterial))}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,q,this.symbolLayer.type))return null;const r=this._getVertexOpacityAndColor(e.renderingInfo,255),s=this.setGraphicElevationContext(t,new B);return this._createAs3DShape(t,e.renderingInfo,r,s,t.uid)}layerOpacityChanged(e,s){const n=t(this.symbolLayer,"material","color"),a=this._getCombinedOpacity(n),i=a<1||this.needsDrivenTransparentPass;this._material.setParameters({opacity:a,transparent:i}),this._bottomMaterial.setParameters({opacity:a,transparent:i});const o=this._getLayerOpacity();return e.forEach((e=>{const t=s(e);r(t)&&t.layerOpacityChanged(o,this._context.isAsync)})),!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,L)}slicePlaneEnabledChanged(e,t){return this._material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),this._bottomMaterial.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),e.forEach((e=>{const s=t(e);r(s)&&s.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){return this._material.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._bottomMaterial.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}pixelRatioChanged(){return!0}_getExtrusionSize(e){let t;var r;e.size&&this._drivenProperties.size?t=null!=(r=j(e.size,2))?r:0:t=this._getSymbolSize();return t/=this._context.renderCoordsHelper.unitInMeters,t}applyRendererDiff(e,t){return this._drivenPropertiesChanged(t)?z.Recreate_Symbol:z.Recreate_Graphics}_getSymbolSize(){var e;return null!=(e=this.symbolLayer.size)?e:1}_createAs3DShape(e,t,h,m,p){const d=D(e.geometry);if(s(d))return null;const u=G(d,this._context.elevationProvider,this._context.renderCoordsHelper,m);if(this._logGeometryCreationWarnings(u,d.rings,"rings","ExtrudeSymbol3DLayer"),0===d.rings.length||!d.rings.some((e=>e.length>0)))return null;const f=T(d);if(s(f))return null;const g=new Array,j=new Array,M=new Array,O=_(),B=c(),I=y(),R=this._context.renderCoordsHelper.viewingMode===A.Global;R||this._context.renderCoordsHelper.worldUpAtPosition(null,I),b(d.spatialReference,[f.x,f.y,0],B,this._context.renderCoordsHelper.spatialReference);const z=c();o(z,B);const k=i();a(k,z);const{polygons:N,mapPosition:F,position:V}=u,H=V.length/3,Z=new Float64Array(3*H*6),W=new Float64Array(3*H*6),q=new Float64Array(3*H*6),J=new Float64Array(1*H*6);let X=0;for(let r=0;r<N.length;++r){const e=N[r],s=e.count;if(this._context.clippingExtent&&(E(O),x(O,e.mapPosition),!P(O,this._context.clippingExtent)))continue;const a=n(e.mapPosition,e.holeIndices,3);if(0===a.length)continue;const i=3*s*2+a.length,o=new Uint32Array(i),c=new Uint32Array(a.length),m=6*s,p=3*Z.BYTES_PER_ELEMENT,d=new v(Z.buffer,X*p,p,(X+m)*p),u=3*W.BYTES_PER_ELEMENT,f=new v(W.buffer,X*u,u,(X+m)*u),y=new Float64Array(q.buffer,3*X*q.BYTES_PER_ELEMENT,3*m),b=new Float64Array(J.buffer,1*X*J.BYTES_PER_ELEMENT,1*m),_=this._getExtrusionSize(t);Q(V,F,a,e,d.typedBuffer,y,f.typedBuffer,b,0,o,c,_,I,R),S(d,d,z),w(f,f,k),X+=6*s;const A=K(o,o.length-c.length,{positions:d.typedBuffer,elevation:y,normals:f.typedBuffer,heights:b},h);g.push(A),j.push(this._material),M.push(l);const L=K(c,0,{positions:d.typedBuffer,elevation:y,normals:f.typedBuffer,heights:b},h);g.push(L),j.push(this._bottomMaterial),M.push(l)}if(0===g.length)return null;const $=new Y({geometries:g,materials:j,transformations:M,metadata:{layerUid:this._context.layer.uid,graphicUid:p,isElevationSource:!0}});$.transformation=B;const ee=U(this.symbolLayer,{opacity:this._getLayerOpacity()}),te=r(ee)?{baseMaterial:this._material,edgeMaterials:[ee],properties:{mergeGeometries:!0,slicePlaneEnabled:this._context.slicePlaneEnabled}}:null,re=new C(this,$,g,null,null,ce,m,te);return re.alignedSampledElevation=u.sampledElevation,re.needsElevationUpdates=L(m.mode),re}}function K(e,t,r,s){const n=new Uint32Array(e.length),a=[[Z.POSITION,{size:3,data:r.positions,exclusive:!0}],[Z.NORMAL,{size:3,data:r.normals,exclusive:!0}],[Z.COLOR,{size:4,data:s,exclusive:!0}],[Z.SIZE,{size:1,data:r.heights,exclusive:!0}]],i=[[Z.POSITION,e],[Z.NORMAL,e],[Z.COLOR,n]];return r.elevation&&(a.push([Z.MAPPOS,{size:3,data:r.elevation}]),i.push([Z.MAPPOS,e])),new H(a,i,V.Triangle,t)}function Q(e,t,r,s,n,a,i,o,l,c,h,m,p,d){const u=r.length/3;let f=0,g=2*s.count;X(e,t,s.index,s.count,r,0,u,n,a,i,o,l,c,h,g,m,p,d),l+=2*s.count,g=0,te(n,a,o,i,f,s.pathLengths[0],s.count,l,c,g,m),l+=4*s.pathLengths[0],g+=2*s.pathLengths[0],f+=s.pathLengths[0];for(let y=1;y<s.pathLengths.length;++y)te(n,a,o,i,f,s.pathLengths[y],s.count,l,c,g,m),l+=4*s.pathLengths[y],g+=2*s.pathLengths[y],f+=s.pathLengths[y]}function X(e,t,r,s,n,a,i,o,l,c,p,d,u,f,g,y,b,_){h(me,b);const E=y>0?1:-1;let x=3*r,P=d,v=3*P,S=d+s,w=3*S;for(let h=0;h<s;++h)_&&(me[0]=e[x+0],me[1]=e[x+1],me[2]=e[x+2],m(me,me)),o[v+0]=e[x+0],o[v+1]=e[x+1],o[v+2]=e[x+2],l[v+0]=t[x+0],l[v+1]=t[x+1],l[v+2]=t[x+2],c[v+0]=-E*me[0],c[v+1]=-E*me[1],c[v+2]=-E*me[2],p[P]=0,o[w+0]=e[x+0]+y*me[0],o[w+1]=e[x+1]+y*me[1],o[w+2]=e[x+2]+y*me[2],l[w+0]=t[x+0],l[w+1]=t[x+1],l[w+2]=t[x+2],c[w+0]=E*me[0],c[w+1]=E*me[1],c[w+2]=E*me[2],p[S]=y,v+=3,w+=3,x+=3,P+=1,S+=1;x=3*a,v=0,w=3*g;const j=y<0?ue:de,A=y<0?de:ue;for(let h=0;h<i;++h)f[v+0]=n[x+j[0]],f[v+1]=n[x+j[1]],f[v+2]=n[x+j[2]],u[w+0]=n[x+A[0]]+s,u[w+1]=n[x+A[1]]+s,u[w+2]=n[x+A[2]]+s,v+=3,w+=3,x+=3}function $(e,t,r,s,n,a,i){s[a]=s[i],i*=3,e[(a*=3)+0]=e[i+0],e[a+1]=e[i+1],e[a+2]=e[i+2],t[a+0]=t[i+0],t[a+1]=t[i+1],t[a+2]=t[i+2],r[a+0]=n[0],r[a+1]=n[1],r[a+2]=n[2]}const ee=y();function te(e,t,r,s,n,a,i,o,l,c,h){let m=n,p=n+1,d=n+i,u=n+i+1,f=o,g=o+1,y=o+2*a,b=o+2*a+1;h<0&&(m=n+i+1,u=n),c*=3;for(let _=0;_<a;++_)_===a-1&&(h>0?(p=n,u=n+i):(p=n,m=n+i)),oe(e,m,p,d,ee),$(e,t,s,r,ee,f,m),$(e,t,s,r,ee,g,p),$(e,t,s,r,ee,y,d),$(e,t,s,r,ee,b,u),l[c++]=f,l[c++]=y,l[c++]=b,l[c++]=f,l[c++]=b,l[c++]=g,m++,p++,d++,u++,f+=2,g+=2,y+=2,b+=2}const re=y(),se=y(),ne=y(),ae=y(),ie=y();function oe(e,t,r,s,n){t*=3,r*=3,s*=3,p(re,e[t++],e[t++],e[t++]),p(se,e[r++],e[r++],e[r++]),p(ne,e[s++],e[s++],e[s++]),d(ae,se,re),d(ie,ne,re),u(n,ie,ae),m(n,n)}const le=y();function ce(e,t,r,s){const n=e.stageObject,a=n.geometryRecords,i=a.length,l="absolute-height"!==t.mode;let h=0;const m=n.transformation,d=o(c(),m);for(let o=0;o<i;o+=2){const e=a[o].geometry,i=e.getMutableAttribute(Z.POSITION).data,c=e.vertexAttributes.get(Z.SIZE).data,u=e.vertexAttributes.get(Z.MAPPOS).data,g=new N(u),y=i.length/3;let b=0,_=!1,E=0;const x=r.spatialReference;for(let n=0;n<y;n++){le[0]=i[b],le[1]=i[b+1],le[2]=i[b+2],M(g,r,t,s,pe),l&&(E+=pe.sampledElevation),k.TESTS_DISABLE_OPTIMIZATIONS?(p(he,g.array[g.offset+0],g.array[g.offset+1],pe.z+c[b/3]),s.toRenderCoords(he,x,he),f(he,he,d)):(p(he,i[b+0],i[b+1],i[b+2]),f(he,he,m),s.setAltitude(he,pe.z+c[b/3]),f(he,he,d)),i[b]=he[0],i[b+1]=he[1],i[b+2]=he[2];const e=fe/s.unitInMeters;(Math.abs(le[0]-i[b])>=e||Math.abs(le[1]-i[b+1])>=e||Math.abs(le[2]-i[b+2])>=e)&&(_=!0),g.offset+=3,b+=3}_&&(e.invalidateBoundingInfo(),n.geometryVertexAttrsUpdated(a[o]),a[o+1].geometry.invalidateBoundingInfo(),n.geometryVertexAttrsUpdated(a[o+1])),h+=E/y}return h/i}const he=y(),me=y(),pe=new O,de=[0,2,1],ue=[0,1,2],fe=.01;export{J as Graphics3DExtrudeSymbolLayer};
@@ -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"../../../../Color.js";import"../../../../core/has.js";import t from"../../../../core/Logger.js";import{isSome as o,unwrap as i,unwrapOr as r}from"../../../../core/maybe.js";import{O as n}from"../../../../chunks/vec3f64.js";import{f as s}from"../../../../chunks/vec4f64.js";import{SymbolUpdateType as a}from"./elevationAlignmentUtils.js";import{ElevationContext as l}from"./ElevationContext.js";import{zeroContext as p}from"./featureExpressionInfoUtils.js";import{mixinColorAndOpacity as d}from"./graphicUtils.js";import{ApplyRendererDiffResult as c}from"./interfaces.js";import{Loadable as u}from"./Loadable.js";import{defaultSymbolLayerComplexity as h}from"./symbolComplexity.js";const f=t.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer");class y extends u{constructor(e,t,o,i){super(o.schedule),this._context=o,this._elevationInfoOverride=null,this.complexity=null,this.logger=f,this._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0},this.symbol=e,this.symbolLayer=t,this._renderPriority=i.renderPriority,this._renderPriorityStep=i.renderPriorityStep,this._elevationContext=new l,this.complexity=this.computeComplexity(),this._updateDrivenProperties(i.ignoreDrivers),this._updateElevationContext()}getCachedSize(){return null}get extentPadding(){return 0}get needsDrivenTransparentPass(){return this._drivenProperties.opacity&&!this._drivenProperties.opacityAlwaysOpaque}_logGeometryCreationWarnings(e,t,o,i){const r=e.projectionSuccess,n="polygons"in e?e.polygons:null,s=`${i} geometry failed to be created`;let a=null;r?!t.length||1===t.length&&!t[0].length?a=`${s} (no ${o} were defined)`:Array.isArray(t)&&Array.isArray(t[0])?n&&0===n.length&&"rings"===o&&t.length>0&&t[0].length>2&&(a=`${s} (filled rings should use clockwise winding - try reversing the order of vertices)`):a=`${s} (${o} should be defined as a 2D array)`:a=`${s} (failed to project geometry to view spatial reference)`,a&&f.warnOncePerTick(a)}_validateGeometry(e,t=null,i=null){if(o(t)&&!t.includes(e.type))return this.logger.warn("unsupported geometry type for "+i+` symbol: ${e.type}`),!1;if("point"===e.type){const t=e;if(!isFinite(t.x)||!isFinite(t.y))return f.warn("point coordinate is not a valid number, graphic skipped"),!1}return!0}_defaultElevationInfoNoZ(){return m}_defaultElevationInfoZ(){return g}_updateElevationContext(){o(this._elevationInfoOverride)?(this._elevationContext.setFromElevationInfo(this._elevationInfoOverride),this._elevationContext.updateFeatureExpressionInfoContext(null)):this._context.layer.elevationInfo?(this._elevationContext.setFromElevationInfo(this._context.layer.elevationInfo),this._elevationContext.updateFeatureExpressionInfoContext(this._context.featureExpressionInfoContext)):this._elevationContext.reset()}getDefaultElevationInfo(e){return e.hasZ?this._defaultElevationInfoZ():this._defaultElevationInfoNoZ()}getGeometryElevationMode(e,t=this.getDefaultElevationInfo(e)){return this._elevationContext.mode||t.mode}setElevationInfoOverride(e){this._elevationInfoOverride=e,this._updateElevationContext()}setGraphicElevationContext(e,t){const o=i(e.geometry),n=this.getDefaultElevationInfo(o);t.unit=null!=this._elevationContext.unit?this._elevationContext.unit:n.unit,t.mode=this.getGeometryElevationMode(o,n),t.offsetMeters=r(this._elevationContext.meterUnitOffset,r(n.offset,0));const s=!this._elevationOptions.supportsOnTheGround&&"on-the-ground"===t.mode;s&&(t.mode="relative-to-ground",t.offsetMeters=0);const a=s?p:this._elevationContext.featureExpressionInfoContext;return t.updateFeatureExpressionInfoContext(a,e,this._context.layer),t}prepareSymbolLayerPatch(e){}updateGeometry(e,t){return!1}onRemoveGraphic(e){}_updateDrivenProperties(e){const t={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1};if(e)return void(this._drivenProperties=t);const o=this._context.renderer;o&&"visualVariables"in o&&o.visualVariables&&o.visualVariables.forEach((e=>{switch(e.type){case"color":if(t.color=!0,e.stops)for(let o=0;o<e.stops.length;o++){const i=e.stops[o].color;i&&(t.opacity=!0,i.a<1&&(t.opacityAlwaysOpaque=!1))}break;case"opacity":t.opacity=!0,t.opacityAlwaysOpaque=!1;break;case"size":t.size=!0}})),this._drivenProperties=t}_getLayerOpacity(){if(this._context.graphicsCoreOwner&&"fullOpacity"in this._context.graphicsCoreOwner)return this._context.graphicsCoreOwner.fullOpacity;const e=this._context.layer.opacity;return null==e?1:e}_getCombinedOpacity(e,t=_){let i=1;return this.draped||(i*=this._getLayerOpacity()),this._drivenProperties.opacity||(o(e)?i*=e.a:t.hasIntrinsicColor||(i=0)),i}_getCombinedOpacityAndColor(t,i=_){const r=this._getCombinedOpacity(t,i);if(this._drivenProperties.color)return d(null,r);const s=o(t)?e.toUnitRGB(t):n;return d(s,r)}_getVertexOpacityAndColor(e,t=null){const i=this._drivenProperties.color?e.color:null,r=this._drivenProperties.opacity?e.opacity:null,n=d(i,r);return o(t)&&(n[0]*=t,n[1]*=t,n[2]*=t,n[3]*=t),n}isFastUpdatesEnabled(){return this._fastUpdates&&this._fastUpdates.enabled}computeComplexity(){return h(this.symbol,this.symbolLayer)}globalPropertyChanged(e,t,o){switch(e){case"opacity":return this.layerOpacityChanged(t,o);case"elevationInfo":{const e=this._elevationContext.mode;this._updateElevationContext();return this.layerElevationInfoChanged(t,o,e)!==a.RECREATE}case"slicePlaneEnabled":return this.slicePlaneEnabledChanged(t,o);case"physicalBasedRenderingEnabled":return this.physicalBasedRenderingChanged();case"pixelRatio":return this.pixelRatioChanged();default:return!1}}updateGraphics3DGraphicElevationInfo(e,t,i){let r=a.UPDATE;return e.forEach((e=>{const n=t(e);if(o(n)){const t=e.graphic;this.setGraphicElevationContext(t,n.elevationContext),n.needsElevationUpdates=i(n.elevationContext.mode)}else r=a.RECREATE})),r}applyRendererDiff(e,t){return c.Recreate_Symbol}getFastUpdateAttrValues(e){if(!this._fastUpdates.enabled)return null;const t=this._fastUpdates.visualVariables,o=t.size?v(t.size.field,e):0,i=t.color?v(t.color.field,e):0,r=t.opacity?v(t.opacity.field,e):0;return s(o,i,r,0)}get draped(){return this._draped}ensureDrapedStatus(e){return null==this._draped?(this._draped=e,!0):(e!==this.draped&&f.warnOnce("A symbol can only produce either draped or non-draped visualizations. Use two separate symbol instances for draped and non-draped graphics if necessary."),!1)}}function v(e,t){const o=null!=e?t.attributes[e]:0;return null!=o&&isFinite(o)?o:0}const m={mode:"on-the-ground",offset:0,unit:"meters"},g={mode:"absolute-height",offset:0,unit:"meters"},_={hasIntrinsicColor:!1};export{y as Graphics3DSymbolLayer,y as default,v as getAttributeValue};
5
+ import e from"../../../../Color.js";import"../../../../core/has.js";import t from"../../../../core/Logger.js";import{isSome as o,unwrap as i,unwrapOr as r}from"../../../../core/maybe.js";import{O as n}from"../../../../chunks/vec3f64.js";import{f as s}from"../../../../chunks/vec4f64.js";import{SymbolUpdateType as a}from"./elevationAlignmentUtils.js";import{ElevationContext as l}from"./ElevationContext.js";import{zeroContext as p}from"./featureExpressionInfoUtils.js";import{mixinColorAndOpacity as c}from"./graphicUtils.js";import{ApplyRendererDiffResult as d}from"./interfaces.js";import{Loadable as h}from"./Loadable.js";import{defaultSymbolLayerComplexity as u}from"./symbolComplexity.js";const f=t.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer");class y extends h{constructor(e,t,o,i){super(o.schedule),this._context=o,this._elevationInfoOverride=null,this._ignoreDrivers=!1,this._drivenProperties={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1},this.complexity=null,this.logger=f,this._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0},this.symbol=e,this.symbolLayer=t,this._renderPriority=i.renderPriority,this._renderPriorityStep=i.renderPriorityStep,this._elevationContext=new l,this.complexity=this.computeComplexity(),this._ignoreDrivers=i.ignoreDrivers,this._ignoreDrivers||(this._drivenProperties=m(this._context.renderer)),this._updateElevationContext()}getCachedSize(){return null}get extentPadding(){return 0}_drivenPropertiesChanged(e){if(this._ignoreDrivers)return!1;const t=this._drivenProperties,o=m(e);return o.color!==t.color||o.opacity!==t.opacity||o.opacityAlwaysOpaque!==t.opacityAlwaysOpaque||o.size!==t.size}get needsDrivenTransparentPass(){return this._drivenProperties.opacity&&!this._drivenProperties.opacityAlwaysOpaque}_logGeometryCreationWarnings(e,t,o,i){const r=e.projectionSuccess,n="polygons"in e?e.polygons:null,s=`${i} geometry failed to be created`;let a=null;r?!t.length||1===t.length&&!t[0].length?a=`${s} (no ${o} were defined)`:Array.isArray(t)&&Array.isArray(t[0])?n&&0===n.length&&"rings"===o&&t.length>0&&t[0].length>2&&(a=`${s} (filled rings should use clockwise winding - try reversing the order of vertices)`):a=`${s} (${o} should be defined as a 2D array)`:a=`${s} (failed to project geometry to view spatial reference)`,a&&f.warnOncePerTick(a)}_validateGeometry(e,t=null,i=null){if(o(t)&&!t.includes(e.type))return this.logger.warn("unsupported geometry type for "+i+` symbol: ${e.type}`),!1;if("point"===e.type){const t=e;if(!isFinite(t.x)||!isFinite(t.y))return f.warn("point coordinate is not a valid number, graphic skipped"),!1}return!0}_defaultElevationInfoNoZ(){return g}_defaultElevationInfoZ(){return _}_updateElevationContext(){o(this._elevationInfoOverride)?(this._elevationContext.setFromElevationInfo(this._elevationInfoOverride),this._elevationContext.updateFeatureExpressionInfoContext(null)):this._context.layer.elevationInfo?(this._elevationContext.setFromElevationInfo(this._context.layer.elevationInfo),this._elevationContext.updateFeatureExpressionInfoContext(this._context.featureExpressionInfoContext)):this._elevationContext.reset()}getDefaultElevationInfo(e){return e.hasZ?this._defaultElevationInfoZ():this._defaultElevationInfoNoZ()}getGeometryElevationMode(e,t=this.getDefaultElevationInfo(e)){return this._elevationContext.mode||t.mode}setElevationInfoOverride(e){this._elevationInfoOverride=e,this._updateElevationContext()}setGraphicElevationContext(e,t){const o=i(e.geometry),n=this.getDefaultElevationInfo(o);t.unit=null!=this._elevationContext.unit?this._elevationContext.unit:n.unit,t.mode=this.getGeometryElevationMode(o,n),t.offsetMeters=r(this._elevationContext.meterUnitOffset,r(n.offset,0));const s=!this._elevationOptions.supportsOnTheGround&&"on-the-ground"===t.mode;s&&(t.mode="relative-to-ground",t.offsetMeters=0);const a=s?p:this._elevationContext.featureExpressionInfoContext;return t.updateFeatureExpressionInfoContext(a,e,this._context.layer),t}prepareSymbolLayerPatch(e){}updateGeometry(e,t){return!1}onRemoveGraphic(e){}_getLayerOpacity(){if(this._context.graphicsCoreOwner&&"fullOpacity"in this._context.graphicsCoreOwner)return this._context.graphicsCoreOwner.fullOpacity;const e=this._context.layer.opacity;return null==e?1:e}_getCombinedOpacity(e,t=x){let i=1;return this.draped||(i*=this._getLayerOpacity()),this._drivenProperties.opacity||(o(e)?i*=e.a:t.hasIntrinsicColor||(i=0)),i}_getCombinedOpacityAndColor(t,i=x){const r=this._getCombinedOpacity(t,i);if(this._drivenProperties.color)return c(null,r);const s=o(t)?e.toUnitRGB(t):n;return c(s,r)}_getVertexOpacityAndColor(e,t=null){const i=this._drivenProperties.color?e.color:null,r=this._drivenProperties.opacity?e.opacity:null,n=c(i,r);return o(t)&&(n[0]*=t,n[1]*=t,n[2]*=t,n[3]*=t),n}isFastUpdatesEnabled(){return this._fastUpdates&&this._fastUpdates.enabled}computeComplexity(){return u(this.symbol,this.symbolLayer)}globalPropertyChanged(e,t,o){switch(e){case"opacity":return this.layerOpacityChanged(t,o);case"elevationInfo":{const e=this._elevationContext.mode;this._updateElevationContext();return this.layerElevationInfoChanged(t,o,e)!==a.RECREATE}case"slicePlaneEnabled":return this.slicePlaneEnabledChanged(t,o);case"physicalBasedRenderingEnabled":return this.physicalBasedRenderingChanged();case"pixelRatio":return this.pixelRatioChanged();default:return!1}}updateGraphics3DGraphicElevationInfo(e,t,i){let r=a.UPDATE;return e.forEach((e=>{const n=t(e);if(o(n)){const t=e.graphic;this.setGraphicElevationContext(t,n.elevationContext),n.needsElevationUpdates=i(n.elevationContext.mode)}else r=a.RECREATE})),r}applyRendererDiff(e,t){return d.Recreate_Symbol}getFastUpdateAttrValues(e){if(!this._fastUpdates.enabled)return null;const t=this._fastUpdates.visualVariables,o=t.size?v(t.size.field,e):0,i=t.color?v(t.color.field,e):0,r=t.opacity?v(t.opacity.field,e):0;return s(o,i,r,0)}get draped(){return this._draped}ensureDrapedStatus(e){return null==this._draped?(this._draped=e,!0):(e!==this.draped&&f.warnOnce("A symbol can only produce either draped or non-draped visualizations. Use two separate symbol instances for draped and non-draped graphics if necessary."),!1)}}function v(e,t){const o=null!=e?t.attributes[e]:0;return null!=o&&isFinite(o)?o:0}function m(e){const t={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1};return e&&"visualVariables"in e&&e.visualVariables&&e.visualVariables.forEach((e=>{switch(e.type){case"color":if(t.color=!0,e.stops)for(let o=0;o<e.stops.length;o++){const i=e.stops[o].color;i&&(t.opacity=!0,i.a<1&&(t.opacityAlwaysOpaque=!1))}break;case"opacity":t.opacity=!0,t.opacityAlwaysOpaque=!1;break;case"size":t.size=!0}})),t}const g={mode:"on-the-ground",offset:0,unit:"meters"},_={mode:"absolute-height",offset:0,unit:"meters"},x={hasIntrinsicColor:!1};export{y as Graphics3DSymbolLayer,y as default,v as getAttributeValue};
@@ -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{remove as t}from"../../core/arrayUtils.js";import{makeHandle as a}from"../../core/handleUtils.js";import{removeMaybe as r,isSome as i,isNone as s,destroyMaybe as o}from"../../core/maybe.js";import{watch as n,syncAndInitial as l}from"../../core/reactiveUtils.js";import"../../core/Logger.js";import"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/accessorSupport/set.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{CreateFeaturesWorkflowData as d}from"./CreateFeaturesWorkflowData.js";import h from"./Workflow.js";import{startCreatingNewFeature as p,findLayerInfo as f,updateGraphicSymbolWhenRequired as m,getVisualVariableAttributes as g,startUpdatingFeature as v,createWorkflowSteps as w,avoidFeatureTemplateSelectionWithOnlyOneItem as y,visualVariableInteractiveUpdate as M}from"./workflowUtils.js";var b;let V=b=class extends h{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.featureFormHandle=null,this.visualVariableAttributes={rotation:null,size:null},this.highlightHandles=new Map,this.preventDefaultActionOnCancel=!1}get numPendingFeatures(){return this.data.viewModel.sketchViewModel.layer.graphics.length}get pendingFeatures(){return this.data.viewModel.sketchViewModel.layer.graphics}async updatePendingFeature(e){return this.preventDefaultActionOnCancel=!0,this.data.viewModel.sketchViewModel.cancel(),t(this.lastActiveGraphics,e),this._startUpdating(e)}static create(e,t,a,r){const i=new b({data:new d({creationInfo:t,viewModel:e}),onCommit:async e=>{await r(e.creationInfo.layer,{addFeatures:e.viewModel.sketchViewModel.layer.graphics.toArray()})}});return i._set("steps",this._createWorkflowSteps(i,a)),i}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",a((()=>e.effect=t))}const t=e.opacity;return e.opacity=.7,a((()=>e.opacity=t))}_highlight(e){const t=this.data.viewModel.view;"3d"===t.type&&this.highlightHandles.set(e,t.highlight(e))}_removeHighlight(e){r(this.highlightHandles.get(e)),this.highlightHandles.delete(e)}async _startCreating(){return this.createFeatureState="create-new",p(this.data.viewModel.sketchViewModel,this.data.creationInfo)}async _startUpdating(e){const t=this.data.viewModel,a=t.sketchViewModel,i=this.data.creationInfo.layer,s=f(t.layerInfos,i),o=null==s?void 0:s.formTemplate;return t.featureFormViewModel.set({feature:e,formTemplate:o}),r(this.featureFormHandle),this.featureFormHandle=t.featureFormViewModel.on("value-change",(async()=>{e.attributes=t.featureFormViewModel.getValues(),await m(e)})),this._removeHighlight(e),this.createFeatureState="update-pending",this.visualVariableAttributes=g(e),v(a,e,i,this.visualVariableAttributes)}static _createWorkflowSteps(e,a="awaiting-feature-creation-info"){const{data:c,handles:d}=e;let h=null,p=!0;const f=w(["awaiting-feature-creation-info","creating-features"],a,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){c.creationInfo=null,d.add(c.viewModel.featureTemplatesViewModel.on("select",(({item:e})=>{c.creationInfo={layer:e.layer,template:e.template},c.viewModel.activeWorkflow.next()})),this.id)},async tearDown(){d.remove(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){const a=c.viewModel.view,f=c.viewModel.sketchViewModel;p=f.updateOnGraphicClick,f.updateOnGraphicClick=!1,e.lastActiveGraphics=[],e.featureFormHandle=r(e.featureFormHandle),e.visualVariableAttributes={rotation:null,size:null};const m="2d"===a.type?e._fadeExistingFeatures(c.creationInfo.layer):null,g=f.on("create",(async t=>{if("cancel"===t.state){if(e.preventDefaultActionOnCancel)return void(e.preventDefaultActionOnCancel=!1);if(e.lastActiveGraphics.length<1)return e._startCreating();const t=e.lastActiveGraphics.pop();return e._startUpdating(t)}if("complete"===t.state)return e._startUpdating(t.graphic)})),v=f.on("update",(async t=>{const r=t.graphics[0];if("complete"===t.state)return r!==h&&(e.lastActiveGraphics.push(r),e._highlight(r)),h=null,t.aborted&&e.preventDefaultActionOnCancel?void(e.preventDefaultActionOnCancel=!1):e._startCreating();"start"===t.state&&e._removeHighlight(r),await M(a,r,t,e.visualVariableAttributes);const s=r.attributes;if(i(e.visualVariableAttributes.rotation)){const{field:t}=e.visualVariableAttributes.rotation;c.viewModel.featureFormViewModel.setValue(t,s[t])}if(i(e.visualVariableAttributes.size)){const{field:t}=e.visualVariableAttributes.size;c.viewModel.featureFormViewModel.setValue(t,s[t])}})),w=f.on("delete",(async a=>{const r=a.graphics[0];t(e.lastActiveGraphics,r),h=r}));let y=null;const b=n((()=>{var e;const t=f.snappingOptions.featureSources.find((e=>e.layer===c.creationInfo.layer));return{hasFeatureLayerSource:!!t,enabled:null!=(e=null==t?void 0:t.enabled)&&e}}),(({hasFeatureLayerSource:e,enabled:t})=>{const a=f.snappingOptions.featureSources;e?(s(y)&&(y=new u({layer:f.layer,enabled:t}),a.add(y)),y.enabled=t):(i(y)&&a.remove(y),y=o(y))}),l),V=a.on("immediate-click",(async t=>{const r=await a.hitTest(t,{include:f.layer});if(r.results.length>0){const t=r.results[0].graphic;if("transform"===f.activeTool||"reshape"===f.activeTool){if(f.updateGraphics.getItemAt(0)===t)return;await e.updatePendingFeature(t)}}}));await e._startCreating();const F={remove:()=>{r(e.featureFormHandle),g.remove(),v.remove(),w.remove(),b.remove(),i(y)&&f.snappingOptions.featureSources.remove(y),y=o(y),f.cancel(),V.remove(),r(m)}};d.add(F,this.id)},async tearDown(e){e.cancelled&&c.viewModel.sketchViewModel.layer.removeAll(),d.remove(this.id),c.viewModel.sketchViewModel.updateOnGraphicClick=p}})});return y(c,f)}};V=b=e([c("esri.widgets.Editor.CreateFeaturesWorkflow")],V);const F=V;export{F as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{remove as t}from"../../core/arrayUtils.js";import{makeHandle as a}from"../../core/handleUtils.js";import{unwrap as r,removeMaybe as i,isSome as s,isNone as o,destroyMaybe as n}from"../../core/maybe.js";import{watch as l,syncAndInitial as c}from"../../core/reactiveUtils.js";import"../../core/Logger.js";import"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/accessorSupport/set.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{CreateFeaturesWorkflowData as h}from"./CreateFeaturesWorkflowData.js";import p from"./Workflow.js";import{startCreatingNewFeature as f,findLayerInfo as m,updateGraphicSymbolWhenRequired as g,getVisualVariableAttributes as v,startUpdatingFeature as w,createWorkflowSteps as y,avoidFeatureTemplateSelectionWithOnlyOneItem as M,visualVariableInteractiveUpdate as b}from"./workflowUtils.js";var V;let F=V=class extends p{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.featureFormHandle=null,this.visualVariableAttributes={rotation:null,size:null},this.highlightHandles=new Map,this.preventDefaultActionOnCancel=!1}get numPendingFeatures(){return this.data.viewModel.sketchViewModel.layer.graphics.length}get pendingFeatures(){return this.data.viewModel.sketchViewModel.layer.graphics}async updatePendingFeature(e){return this.preventDefaultActionOnCancel=!0,this.data.viewModel.sketchViewModel.cancel(),t(this.lastActiveGraphics,e),this._startUpdating(e)}static create(e,t,a,i){const s=new V({data:new h({creationInfo:r(t),viewModel:e}),onCommit:async e=>{await i(e.creationInfo.layer,{addFeatures:e.viewModel.sketchViewModel.layer.graphics.toArray()})}});return s._set("steps",this._createWorkflowSteps(s,a)),s}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",a((()=>e.effect=t))}const t=e.opacity;return e.opacity=.7,a((()=>e.opacity=t))}_highlight(e){const t=this.data.viewModel.view;"3d"===t.type&&this.highlightHandles.set(e,t.highlight(e))}_removeHighlight(e){i(this.highlightHandles.get(e)),this.highlightHandles.delete(e)}async _startCreating(){return this.createFeatureState="create-new",f(this.data.viewModel.sketchViewModel,this.data.creationInfo)}async _startUpdating(e){const t=this.data.viewModel,a=t.sketchViewModel,r=this.data.creationInfo.layer,s=m(t.layerInfos,r),o=null==s?void 0:s.formTemplate;return t.featureFormViewModel.set({feature:e,formTemplate:o}),i(this.featureFormHandle),this.featureFormHandle=t.featureFormViewModel.on("value-change",(async()=>{e.attributes=t.featureFormViewModel.getValues(),await g(e)})),this._removeHighlight(e),this.createFeatureState="update-pending",this.visualVariableAttributes=v(e),w(a,e,r,this.visualVariableAttributes)}static _createWorkflowSteps(e,a="awaiting-feature-creation-info"){const{data:r,handles:u}=e;let h=null,p=!0;const f=y(["awaiting-feature-creation-info","creating-features"],a,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){r.creationInfo=null,u.add(r.viewModel.featureTemplatesViewModel.on("select",(({item:e})=>{r.creationInfo={layer:e.layer,template:e.template},r.viewModel.activeWorkflow.next()})),this.id)},async tearDown(){u.remove(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){const a=r.viewModel.view,f=r.viewModel.sketchViewModel;p=f.updateOnGraphicClick,f.updateOnGraphicClick=!1,e.lastActiveGraphics=[],e.featureFormHandle=i(e.featureFormHandle),e.visualVariableAttributes={rotation:null,size:null};const m="2d"===a.type?e._fadeExistingFeatures(r.creationInfo.layer):null,g=f.on("create",(async t=>{if("cancel"===t.state){if(e.preventDefaultActionOnCancel)return void(e.preventDefaultActionOnCancel=!1);if(e.lastActiveGraphics.length<1)return e._startCreating();const t=e.lastActiveGraphics.pop();return e._startUpdating(t)}if("complete"===t.state)return e._startUpdating(t.graphic)})),v=f.on("update",(async t=>{const i=t.graphics[0];if("complete"===t.state)return i!==h&&(e.lastActiveGraphics.push(i),e._highlight(i)),h=null,t.aborted&&e.preventDefaultActionOnCancel?void(e.preventDefaultActionOnCancel=!1):e._startCreating();"start"===t.state&&e._removeHighlight(i),await b(a,i,t,e.visualVariableAttributes);const o=i.attributes;if(s(e.visualVariableAttributes.rotation)){const{field:t}=e.visualVariableAttributes.rotation;r.viewModel.featureFormViewModel.setValue(t,o[t])}if(s(e.visualVariableAttributes.size)){const{field:t}=e.visualVariableAttributes.size;r.viewModel.featureFormViewModel.setValue(t,o[t])}})),w=f.on("delete",(async a=>{const r=a.graphics[0];t(e.lastActiveGraphics,r),h=r}));let y=null;const M=l((()=>{var e;const t=f.snappingOptions.featureSources.find((e=>e.layer===r.creationInfo.layer));return{hasFeatureLayerSource:!!t,enabled:null!=(e=null==t?void 0:t.enabled)&&e}}),(({hasFeatureLayerSource:e,enabled:t})=>{const a=f.snappingOptions.featureSources;e?(o(y)&&(y=new d({layer:f.layer,enabled:t}),a.add(y)),y.enabled=t):(s(y)&&a.remove(y),y=n(y))}),c),V=a.on("immediate-click",(async t=>{const r=await a.hitTest(t,{include:f.layer});if(r.results.length>0){const t=r.results[0].graphic;if("transform"===f.activeTool||"reshape"===f.activeTool){if(f.updateGraphics.getItemAt(0)===t)return;await e.updatePendingFeature(t)}}}));await e._startCreating();const F={remove:()=>{i(e.featureFormHandle),g.remove(),v.remove(),w.remove(),M.remove(),s(y)&&f.snappingOptions.featureSources.remove(y),y=n(y),f.cancel(),V.remove(),i(m)}};u.add(F,this.id)},async tearDown(e){e.cancelled&&r.viewModel.sketchViewModel.layer.removeAll(),u.remove(this.id),r.viewModel.sketchViewModel.updateOnGraphicClick=p}})});return M(r,f)}};F=V=e([u("esri.widgets.Editor.CreateFeaturesWorkflow")],F);const A=F;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{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import r from"../../core/Error.js";import a from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import i from"../../core/Logger.js";import{on as s,init as n,watch as l,whenFalseOnce as d}from"../../core/watchUtils.js";import{aliasOf as c}from"../../core/accessorSupport/decorators/aliasOf.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import{subclass as w}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../layers/GraphicsLayer.js";import f from"../../views/interactive/snapping/SnappingOptions.js";import h from"../Attachments/AttachmentsViewModel.js";import m from"./CreateFeaturesWorkflow.js";import k from"./CreateWorkflow.js";import y from"./UpdateWorkflow.js";import v from"../FeatureForm/FeatureFormViewModel.js";import W from"../FeatureTemplates/FeatureTemplatesViewModel.js";import g from"../Sketch/SketchViewModel.js";import _ from"../Spinner/SpinnerViewModel.js";const C="esri.widgets.Editor.EditorViewModel",b=i.getLogger(C),F=["create","create-features","update"];function j(e,t,a){b.error(new r(e,t,a))}function M(e,t){return e&&e.find((e=>e.layer===t))}let V=class extends(o(a.EventedAccessor)){constructor(e){super(e),this._sketchGraphicsLayer=new u({listMode:"hide",internal:!0}),this.activeWorkflow=null,this.activityQueue=[],this.failures=[],this.attachmentsViewModel=new h({abilities:{editing:!0}}),this.featureFormViewModel=new v,this.featureTemplatesViewModel=new W,this.layerInfos=null,this.sketchViewModel=new g({layer:this._sketchGraphicsLayer}),this.snappingOptions=new f,this.spinnerViewModel=new _}initialize(){this.handles.add([s(this,"activeWorkflow","cancel",(()=>this.emit("workflow-cancel"))),s(this,"activeWorkflow","commit",(()=>this.emit("workflow-commit"))),n(this,"view.map",(e=>{e&&e.add(this._sketchGraphicsLayer)})),l(this,"editableItems",(()=>{const{activeWorkflow:e}=this;if(this.refreshCreationTemplates(),!e)return;const{stepId:t}=e;"create"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdate||"awaiting-update-feature-candidate"===t&&!e.data.candidates.some((e=>{const t=this.editableItems.find((t=>t.layer===e.layer));return t&&t.supports.indexOf("update")>-1})))&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}))])}destroy(){this._cancelWorkflow().then((()=>{var e;null!=(e=this.view)&&e.map&&this.view.map.remove(this._sketchGraphicsLayer),this.view=null}))}get allowedWorkflows(){return this._get("allowedWorkflows")}set allowedWorkflows(e){e&&0!==e.length||(e=[...F]),this._set("allowedWorkflows",e)}get canCreate(){return this.editableItems.some((e=>e.supports.includes("create")))}get canUpdate(){return this.editableItems.some((e=>e.supports.includes("update")))}get editableItems(){var e,r,a;const o=null==(e=this.view)?void 0:e.allLayerViews;if(!o)return new t;const i=new Set(null==(r=this.view)||null==(a=r.map)?void 0:a.editableLayers);return o.filter((e=>i.has(e.layer))).map((e=>{const{layer:t,suspended:r}=e,{data:a,operations:o}=t.capabilities,i=M(this.layerInfos,t),s="supportsAttachment"in a&&a.supportsAttachment&&(!i||!1!==i.allowAttachments);if(r)return{hasAttachments:s,layer:t,supports:[]};const n=[];return o.supportsAdd&&(this.allowedWorkflows.includes("create")||this.allowedWorkflows.includes("create-features"))&&(!i||!1!==i.enabled&&!1!==i.addEnabled)&&n.push("create"),o.supportsUpdate&&this.allowedWorkflows.includes("update")&&(!i||!1!==i.enabled&&!1!==i.updateEnabled)&&n.push("update"),!1!==(i&&i.deleteEnabled)&&o.supportsDelete&&n.push("delete"),{hasAttachments:s,layer:t,supports:n}})).reverse()}get state(){if(!this.get("view.ready")||0===this.editableItems.length)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this;return t?t.stepId:"ready"}get syncing(){return this.activityQueue.length>0}set view(e){this.sketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}async startCreateWorkflowAtFeatureTypeSelection(){if(!this.canCreate)return void j("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createCreateWorkflow();await e.start(),this._set("activeWorkflow",e)}async startCreateWorkflowAtFeatureCreation(e){if(!this.canCreate)return void j("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createCreateWorkflow("awaiting-feature-to-create");t.data.creationInfo=e,await t.start(),this._set("activeWorkflow",t)}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(!this.canCreate)throw new r("editing:unsupported-workflow","Creating features is unsupported or disabled.");await this._cancelWorkflow();const a=this._createCreateFeaturesWorkflow(e,t);await a.start(),this._set("activeWorkflow",a)}async startCreateWorkflowAtFeatureEdit(e){if(!this.canCreate)return void j("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createCreateWorkflow("editing-new-feature");t.data.edits.feature=e,await t.start(),this._set("activeWorkflow",t)}async startUpdateWorkflowAtFeatureSelection(){if(!this.canUpdate)return void j("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createUpdateWorkflow();await e.start(),this._set("activeWorkflow",e)}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(!this.canUpdate)return void j("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,await t.start(),this._set("activeWorkflow",t)}async startUpdateWorkflowAtFeatureEdit(e){if(!this.canUpdate)return void j("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature");t.data.edits.feature=e,await t.start(),this._set("activeWorkflow",t)}async deleteFeatureFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?(await this._delete(e.data.edits.feature),await e.reset()):j("editing:unsupported-workflow","Deleting requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warn:!0,...e})}refreshCreationTemplates(){const e=[];for(const{layer:t,supports:r}of this.editableItems)t.loaded&&r.includes("create")&&e.push(t);this.featureTemplatesViewModel.layers=e}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e&&e.warn&&j("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force)return this.emit("workflow-cancel"),this._set("activeWorkflow",null),void await t.cancel(e);await t.cancel(e),this._set("activeWorkflow",null)}_createCreateFeaturesWorkflow(e,t){return m.create(this,e,t,((e,t)=>this._applyEdits(e,t)))}_createCreateWorkflow(e){return k.create(this,e,((e,t)=>this._applyEdits(e,t)))}_createUpdateWorkflow(e){return y.create(this,e,((e,t)=>this._applyEdits(e,t)))}async _delete(e){const t=e.sourceLayer;"applyEdits"in t&&await this._applyEdits(t,{deleteFeatures:[e]})}async _applyEdits(e,t){await this._queueOperation((async()=>{const r=await this.view.whenLayerView(e),a=await e.applyEdits(t);return await d(r,"updating"),a}))}_queueOperation(e){this.activityQueue.push(e),this.notifyChange("syncing");const t=(e,t)=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)};return e().then((({addFeatureResults:e,deleteFeatureResults:t,updateFeatureResults:r})=>{const a=e.find((e=>!!e.error))||r.find((e=>!!e.error))||t.find((e=>!!e.error));if(a)throw a.error})).catch((r=>{j("editing:operation-error","An error occurred.",{error:r});const a={error:r,retry:()=>(t(a,this.failures),this._queueOperation(e)),cancel:()=>{t(a,this.failures)}};this._set("failures",[...this.failures,a])})).then((()=>{t(e,this.activityQueue),this.notifyChange("syncing")}))}};e([p({readOnly:!0})],V.prototype,"activeWorkflow",void 0),e([p({readOnly:!0})],V.prototype,"activityQueue",void 0),e([p({value:[...F]})],V.prototype,"allowedWorkflows",null),e([p({readOnly:!0})],V.prototype,"canCreate",null),e([p({readOnly:!0})],V.prototype,"canUpdate",null),e([p({readOnly:!0})],V.prototype,"editableItems",null),e([p({readOnly:!0})],V.prototype,"failures",void 0),e([p()],V.prototype,"attachmentsViewModel",void 0),e([p()],V.prototype,"featureFormViewModel",void 0),e([p()],V.prototype,"featureTemplatesViewModel",void 0),e([p()],V.prototype,"layerInfos",void 0),e([p()],V.prototype,"sketchViewModel",void 0),e([c("sketchViewModel.snappingOptions")],V.prototype,"snappingOptions",void 0),e([p()],V.prototype,"spinnerViewModel",void 0),e([p()],V.prototype,"state",null),e([p({readOnly:!0})],V.prototype,"syncing",null),e([p()],V.prototype,"view",null),V=e([w(C)],V);const U=V;export{U as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import r from"../../core/Error.js";import a from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import i from"../../core/Logger.js";import{on as s,init as n,watch as l,whenFalseOnce as c}from"../../core/watchUtils.js";import{aliasOf as d}from"../../core/accessorSupport/decorators/aliasOf.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../layers/GraphicsLayer.js";import f from"../../views/interactive/snapping/SnappingOptions.js";import h from"../Attachments/AttachmentsViewModel.js";import k from"./CreateFeaturesWorkflow.js";import m from"./CreateWorkflow.js";import{workflowDeprecation as y}from"./deprecationUtils.js";import W from"./UpdateWorkflow.js";import v from"../FeatureForm/FeatureFormViewModel.js";import g from"../FeatureTemplates/FeatureTemplatesViewModel.js";import _ from"../Sketch/SketchViewModel.js";import C from"../Spinner/SpinnerViewModel.js";const F="esri.widgets.Editor.EditorViewModel",b=i.getLogger(F),j=["create","create-features","update"];function A(e,t,a){b.error(new r(e,t,a))}function M(e,t){return e&&e.find((e=>e.layer===t))}let V=class extends(o(a.EventedAccessor)){constructor(e){super(e),this._sketchGraphicsLayer=new w({listMode:"hide",internal:!0}),this.activeWorkflow=null,this.activityQueue=[],this.failures=[],this.attachmentsViewModel=new h({abilities:{editing:!0}}),this.featureFormViewModel=new v,this.featureTemplatesViewModel=new g,this.layerInfos=null,this.sketchViewModel=new _({layer:this._sketchGraphicsLayer}),this.snappingOptions=new f,this.spinnerViewModel=new C}initialize(){this.handles.add([s(this,"activeWorkflow","cancel",(()=>this.emit("workflow-cancel"))),s(this,"activeWorkflow","commit",(()=>this.emit("workflow-commit"))),n(this,"view.map",(e=>{e&&e.add(this._sketchGraphicsLayer)})),l(this,"editableItems",(()=>{const{activeWorkflow:e}=this;if(this.refreshCreationTemplates(),!e)return;const{stepId:t}=e;"create"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdate||"awaiting-update-feature-candidate"===t&&!e.data.candidates.some((e=>{const t=this.editableItems.find((t=>t.layer===e.layer));return t&&t.supports.indexOf("update")>-1})))&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}))])}destroy(){this._cancelWorkflow().then((()=>{var e;null!=(e=this.view)&&e.map&&this.view.map.remove(this._sketchGraphicsLayer),this.view=null}))}get allowedWorkflows(){return this._get("allowedWorkflows")}set allowedWorkflows(e){e&&0!==e.length||(e=[...j]),this._set("allowedWorkflows",e)}get canCreate(){return this.editableItems.some((e=>e.supports.includes("create")))}get canUpdate(){return this.editableItems.some((e=>e.supports.includes("update")))}get editableItems(){var e,r,a;const o=null==(e=this.view)?void 0:e.allLayerViews;if(!o)return new t;const i=new Set(null==(r=this.view)||null==(a=r.map)?void 0:a.editableLayers);return o.filter((e=>i.has(e.layer))).map((e=>{const{layer:t,suspended:r}=e,{data:a,operations:o}=t.capabilities,i=M(this.layerInfos,t),s="supportsAttachment"in a&&a.supportsAttachment&&(!i||!1!==i.allowAttachments);if(r)return{hasAttachments:s,layer:t,supports:[]};const n=[];return o.supportsAdd&&(this.allowedWorkflows.includes("create")||this.allowedWorkflows.includes("create-features"))&&(!i||!1!==i.enabled&&!1!==i.addEnabled)&&n.push("create"),o.supportsUpdate&&this.allowedWorkflows.includes("update")&&(!i||!1!==i.enabled&&!1!==i.updateEnabled)&&n.push("update"),!1!==(i&&i.deleteEnabled)&&o.supportsDelete&&n.push("delete"),{hasAttachments:s,layer:t,supports:n}})).reverse()}get state(){if(!this.get("view.ready")||0===this.editableItems.length)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this;return t?t.stepId:"ready"}get syncing(){return this.activityQueue.length>0}set view(e){this.sketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}async startCreateWorkflowAtFeatureTypeSelection(){if(y(b,"startCreateWorkflowAtFeatureTypeSelection","startCreateFeaturesWorkflowAtFeatureTypeSelection"),!this.canCreate)return void A("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createCreateWorkflow();await e.start(),this._set("activeWorkflow",e)}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateWorkflowAtFeatureCreation(e){if(y(b,"startCreateWorkflowAtFeatureCreation","startCreateFeaturesWorkflowAtFeatureCreation"),!this.canCreate)return void A("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createCreateWorkflow("awaiting-feature-to-create");t.data.creationInfo=e,await t.start(),this._set("activeWorkflow",t)}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(!this.canCreate)throw new r("editing:unsupported-workflow","Creating features is unsupported or disabled.");await this._cancelWorkflow();const a=this._createCreateFeaturesWorkflow(e,t);await a.start(),this._set("activeWorkflow",a)}async startCreateWorkflowAtFeatureEdit(e){if(y(b,"startCreateWorkflowAtFeatureEdit"),!this.canCreate)return void A("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createCreateWorkflow("editing-new-feature");t.data.edits.feature=e,await t.start(),this._set("activeWorkflow",t)}async startUpdateWorkflowAtFeatureSelection(){if(!this.canUpdate)return void A("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createUpdateWorkflow();await e.start(),this._set("activeWorkflow",e)}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(!this.canUpdate)return void A("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,await t.start(),this._set("activeWorkflow",t)}async startUpdateWorkflowAtFeatureEdit(e){if(!this.canUpdate)return void A("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature");t.data.edits.feature=e,await t.start(),this._set("activeWorkflow",t)}async deleteFeatureFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?(await this._delete(e.data.edits.feature),await e.reset()):A("editing:unsupported-workflow","Deleting requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warn:!0,...e})}refreshCreationTemplates(){const e=[];for(const{layer:t,supports:r}of this.editableItems)t.loaded&&r.includes("create")&&e.push(t);this.featureTemplatesViewModel.layers=e}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e&&e.warn&&A("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force)return this.emit("workflow-cancel"),this._set("activeWorkflow",null),void await t.cancel(e);await t.cancel(e),this._set("activeWorkflow",null)}_createCreateFeaturesWorkflow(e,t){return k.create(this,e,t,((e,t)=>this._applyEdits(e,t)))}_createCreateWorkflow(e){return m.create(this,e,((e,t)=>this._applyEdits(e,t)))}_createUpdateWorkflow(e){return W.create(this,e,((e,t)=>this._applyEdits(e,t)))}async _delete(e){const t=e.sourceLayer;"applyEdits"in t&&await this._applyEdits(t,{deleteFeatures:[e]})}async _applyEdits(e,t){await this._queueOperation((async()=>{const r=await this.view.whenLayerView(e),a=await e.applyEdits(t);return await c(r,"updating"),a}))}_queueOperation(e){this.activityQueue.push(e),this.notifyChange("syncing");const t=(e,t)=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)};return e().then((({addFeatureResults:e,deleteFeatureResults:t,updateFeatureResults:r})=>{const a=e.find((e=>!!e.error))||r.find((e=>!!e.error))||t.find((e=>!!e.error));if(a)throw a.error})).catch((r=>{A("editing:operation-error","An error occurred.",{error:r});const a={error:r,retry:()=>(t(a,this.failures),this._queueOperation(e)),cancel:()=>{t(a,this.failures)}};this._set("failures",[...this.failures,a])})).then((()=>{t(e,this.activityQueue),this.notifyChange("syncing")}))}};e([p({readOnly:!0})],V.prototype,"activeWorkflow",void 0),e([p({readOnly:!0})],V.prototype,"activityQueue",void 0),e([p({value:[...j]})],V.prototype,"allowedWorkflows",null),e([p({readOnly:!0})],V.prototype,"canCreate",null),e([p({readOnly:!0})],V.prototype,"canUpdate",null),e([p({readOnly:!0})],V.prototype,"editableItems",null),e([p({readOnly:!0})],V.prototype,"failures",void 0),e([p()],V.prototype,"attachmentsViewModel",void 0),e([p()],V.prototype,"featureFormViewModel",void 0),e([p()],V.prototype,"featureTemplatesViewModel",void 0),e([p()],V.prototype,"layerInfos",void 0),e([p()],V.prototype,"sketchViewModel",void 0),e([d("sketchViewModel.snappingOptions")],V.prototype,"snappingOptions",void 0),e([p()],V.prototype,"spinnerViewModel",void 0),e([p()],V.prototype,"state",null),e([p({readOnly:!0})],V.prototype,"syncing",null),e([p()],V.prototype,"view",null),V=e([u(F)],V);const U=V;export{U as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import{deprecated as e}from"../../core/deprecate.js";function t(t,r,s){e(t,"`"+r+"` is deprecated, because it instantiates the deprecated class 'esri.widgets.Editor.CreateWorkflow'",{replacement:s,version:"4.23",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-CreateFeaturesWorkflow.html"})}export{t as workflowDeprecation};
package/widgets/Editor.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{HandleOwnerMixin as t}from"../core/HandleOwner.js";import{isSome as s}from"../core/maybe.js";import{watch as i}from"../core/reactiveUtils.js";import{init as a,on as n,watch as r,whenNot as o}from"../core/watchUtils.js";import{aliasOf as l}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{getDisplayFieldName as h}from"../layers/support/fieldUtils.js";import m from"../views/interactive/snapping/SnappingOptions.js";import u from"./Attachments.js";import g from"./FeatureForm.js";import v from"./FeatureTemplates.js";import _ from"./Spinner.js";import w from"./Widget.js";import f from"./Editor/EditorViewModel.js";import{ItemList as k}from"./FeatureTemplates/ItemList.js";import{Heading as y,incrementHeadingLevel as b}from"./support/Heading.js";import C from"./support/SnappingControls.js";import{accessibleHandler as M}from"./support/decorators/accessibleHandler.js";import{messageBundle as A}from"./support/decorators/messageBundle.js";import"../core/Logger.js";import{vmEvent as F}from"./support/decorators/vmEvent.js";import{tsx as W}from"./support/jsxFactory.js";import{classes as T}from"./support/widgetUtils.js";import{substitute as S}from"../intl/substitute.js";const B={base:"esri-editor esri-widget esri-widget--panel",scroller:"esri-editor__scroller",content:"esri-editor__content",contentGroup:"esri-editor__content-group",message:"esri-editor__message",controls:"esri-editor__controls",progressBar:"esri-editor__progress-bar",promptContainer:"esri-editor__prompt",promptHeader:"esri-editor__prompt__header",promptHeading:"esri-editor__prompt__header__heading",promptMessage:"esri-editor__prompt__message",promptDivider:"esri-editor__prompt__divider",promptActions:"esri-editor__prompt__actions",promptOption:"esri-editor__prompt__option",promptOptionPrimary:"esri-editor__prompt__option--primary",promptOptionNegative:"esri-editor__prompt__option--negative",promptOptionPositive:"esri-editor__prompt__option--positive",controlButton:"esri-editor__control-button",overlay:"esri-editor__overlay",warningIcon:"esri-icon-notice-triangle",widgetIcon:"esri-icon-edit",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonSecondary:"esri-button--secondary",buttonTertiary:"esri-button--tertiary",input:"esri-input",interactive:"esri-interactive",select:"esri-select",panelToolbar:"esri-editor__panel-toolbar",panelToolbarSnappingButton:"esri-editor__panel-toolbar__snapping-button",panelContent:"esri-editor__panel-content",panelContentSection:"esri-editor__panel-content--section",updateFeaturesActionButtons:"esri-editor__update-features-action-buttons",updateFeaturesActionButtonsButton:"esri-editor__update-features-action-buttons--button",featureTemplatesContainer:"esri-editor__feature-templates-container",snappingControlsPopover:"esri-editor__snapping-controls-popover",scrimOverlay:"esri-editor__scrim-overlay"},E={undoRedoButtons:!1};function P(e){e.focus()}let j=class extends(t(w)){constructor(e,t){super(e,t),this._candidateCommitted=!1,this._featureForm=new g,this._stateStack=[],this._attachments=new u({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._featureTemplates=new v({enableListScroll:!1}),this._filterText="",this._prompt=null,this._spinner=new _,this._snappingPopover=null,this.activeWorkflow=null,this.allowedWorkflows=null,this.useDeprecatedCreateWorkflow=!1,this.headingLevel=4,this.iconClass=B.widgetIcon,this.label=void 0,this.layerInfos=null,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.snappingOptions=new m,this.supportingWidgetDefaults=null,this.view=null,this.viewModel=new f,this.visibleElements={...E},this._setCandidateFeature=(e,t=!1)=>{if(this._candidateCommitted)return;const s=this._assertActiveUpdateWorkflow();s.data.edits.feature=e,t&&(s.next(),this._candidateCommitted=!0)},this._handleSave=this._handleSave.bind(this),this._handleBack=this._handleBack.bind(this),this._handleDone=this._handleDone.bind(this),this._handleDelete=this._handleDelete.bind(this),this._handleAdd=this._handleAdd.bind(this),this._handleEdit=this._handleEdit.bind(this),this._handleAttachmentAdd=this._handleAttachmentAdd.bind(this),this._handleAttachmentUpdate=this._handleAttachmentUpdate.bind(this),this._handleAttachmentDelete=this._handleAttachmentDelete.bind(this),this.EditorPanel=this.EditorPanel.bind(this)}initialize(){const{view:e,snappingOptions:t}=this;this._snappingControls=new C({snappingOptions:t,view:e,visibleElements:{header:!1}}),this.own([a(this,"headingLevel",(e=>{this._featureForm.headingLevel=b(e),this._featureTemplates.headingLevel=b(e)})),this.viewModel.featureTemplatesViewModel.on("select",(({item:e})=>this.useDeprecatedCreateWorkflow?this.startCreateWorkflowAtFeatureCreation(e):this.startCreateFeaturesWorkflowAtFeatureCreation(e))),i((()=>this.viewModel.state),((e,t)=>{const s=this._stateStack.indexOf(e);-1===s?this._stateStack.push(t):this._stateStack.splice(s)})),a(this,"viewModel",(e=>{this._featureForm.viewModel=e?e.featureFormViewModel:null,this._attachments.viewModel=e?e.attachmentsViewModel:null,this._featureTemplates.viewModel=e?e.featureTemplatesViewModel:null,this._spinner.viewModel=e?e.spinnerViewModel:null})),a(this,"view",((e,t)=>{const s=`editor-${this.id}-spinner`;t&&t.ui.remove(this._spinner,s),e&&e.ui.add(this._spinner,{key:s,position:"manual"})})),n(this,"viewModel.sketchViewModel","create",(()=>{this.scheduleRender()})),n(this,"viewModel.activeWorkflow","cancel-request",(({controller:e})=>{const{messages:t,messagesCommon:s}=this;this._prompt={title:t.cancelRequestTitle,message:t.cancelRequestWarningMessage,context:"danger",actions:{primary:{label:s.form.yes,action:()=>{e.allow(),this._prompt=null}},secondary:{label:s.form.no,action:()=>(e.deny(),this._prompt=null)}}},this.scheduleRender()})),a(this,"supportingWidgetDefaults",(e=>{e&&(this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel.set(e.sketch))})),r(this,"_attachments.error",(e=>{if(!e)return;const{messages:t,messagesCommon:s}=this;this._prompt={title:t.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:s.form.ok,action:()=>{this._prompt=null}}}}})),r(this,"viewModel.failures",(e=>{if(!e)return;const{messages:t}=this,[{error:s,retry:i,cancel:a}]=e;this._prompt={title:t.errorWarningTitle,message:S(t.errorWarningMessageTemplate,{errorMessage:s.message}),context:"warning",actions:{primary:{label:t.retry,action:()=>{i(),this._prompt=null}},secondary:{label:t.ignore,action:()=>(a(),this._prompt=null)}}}})),r(this,"viewModel.state",(e=>{"awaiting-feature-to-update"===e&&(this._filterText=""),"awaiting-update-feature-candidate"===e&&(this._candidateCommitted=!1)})),r(this,["_attachments.selectedFile","_attachments.submitting"],(()=>this.scheduleRender())),o(this,"viewModel.activeWorkflow",(()=>this._featureTemplates.filterText=""))])}destroy(){this._attachments.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._snappingControls.destroy()}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-action.js"),import("@esri/calcite-components/dist/components/calcite-action-menu.js"),import("@esri/calcite-components/dist/components/calcite-button.js"),import("@esri/calcite-components/dist/components/calcite-flow.js"),import("@esri/calcite-components/dist/components/calcite-icon.js"),import("@esri/calcite-components/dist/components/calcite-loader.js"),import("@esri/calcite-components/dist/components/calcite-panel.js"),import("@esri/calcite-components/dist/components/calcite-popover.js"),import("@esri/calcite-components/dist/components/calcite-popover-manager.js"),import("@esri/calcite-components/dist/components/calcite-scrim.js"),import("@esri/calcite-components/dist/components/calcite-tooltip-manager.js")])}castVisibleElements(e){return{...E,...e}}startCreateWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateWorkflowAtFeatureTypeSelection()}startCreateWorkflowAtFeatureCreation(e){return this.viewModel.startCreateWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflow(e,"creating-features")}startCreateWorkflowAtFeatureEdit(e){return this.viewModel.startCreateWorkflowAtFeatureEdit(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}deleteFeatureFromWorkflow(){return this.viewModel.deleteFeatureFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{_attachments:e,_prompt:t,viewModel:i}=this;if(!i)return W("div",{class:B.base});const{state:a}=i,n=s(t)?W("calcite-scrim",null,this.renderPrompt(t)):null;return W("div",{class:B.base},i.syncing||e.submitting?this.renderProgressBar():null,W("calcite-flow",null,this._stateStack.map((e=>this.renderState(e))),this.renderState(a)),n)}renderState(e){switch(e){case"disabled":break;case"ready":return this.renderLanding(e);case"awaiting-feature-creation-info":return this.renderTemplates(e);case"creating-features":case"editing-new-feature":case"editing-existing-feature":return this.renderAttributeEditing(e);case"awaiting-feature-to-update":return this.renderFeatureUpdating(e);case"awaiting-update-feature-candidate":return this.renderFeatureList(e);case"awaiting-feature-to-create":return this.renderFeatureCreation(e);case"adding-attachment":return this.renderAttachmentAdding(e);case"editing-attachment":return this.renderAttachmentEditing(e)}return W("div",null)}isPanelActive(e){return this.viewModel.state===e}renderTemplates(e){const{EditorPanel:t,headingLevel:s,messages:i,messagesCommon:a,_handleBack:n,_snappingControls:r,viewModel:{sketchViewModel:o}}=this;return W(t,{active:this.isPanelActive(e),key:"templates-panel",handleBack:n,heading:i.selectTemplate,headingLevel:s,messages:i,messagesCommon:a,sketchViewModel:o,snappingControls:r},this._featureTemplates.render())}renderAttributeEditing(e){const{activeWorkflow:t,EditorPanel:s,messages:i,messagesCommon:a,headingLevel:n,_handleBack:r,_snappingControls:o,viewModel:l}=this,{sketchViewModel:d}=l,c=l.featureFormViewModel;if("create-features"===t.type&&t.pendingFeatures.length<1)return this.renderFeatureCreation(e);const p="update"===t.type&&!t.data.edits.modified||l.syncing||c.inputFields.length>0&&!c.submittable,h="update"===t.type?i.editFeature:i.createFeatures,m="update"===t.type?a.update:a.create,u="create-features"===t.type&&"create-new"===t.createFeatureState,g=[{label:"create-features"===t.type&&t.numPendingFeatures>1?S(i.createFeaturesTemplate,{numFeatures:t.numPendingFeatures}):m,type:"primary",disabled:p,clickHandler:this._handleSave}];let v=!1;return"update"===t.type&&(t.data.editableItem.hasAttachments&&(v=!0),t.data.editableItem.supports.includes("delete")&&g.push({label:a.delete,type:"tertiary",clickHandler:this._handleDelete})),W(s,{active:this.isPanelActive(e),key:"attribute-editing-panel",heading:h,headingLevel:n,showContentScrim:u,handleBack:r,messages:i,messagesCommon:a,sketchViewModel:d,snappingControls:o},W("div",{class:B.panelContentSection},W("div",{class:B.contentGroup},c.inputFields.length>0?this._featureForm.render():this.renderMessage(S(i.clickToFinishTemplate,{button:m})),v?W("div",{key:"attachments"},W("div",null,i.attachments),this._attachments.render()):null)),W("div",{class:this._prompt?"":B.scrimOverlay},this.renderControls(g)))}renderAttachmentAdding(e){const{_attachments:t,EditorPanel:s,_handleBack:i,headingLevel:a,messages:n,messagesCommon:r,_snappingControls:o,viewModel:{sketchViewModel:l}}=this,d=[{label:t.submitting?r.cancel:r.add,disabled:t.submitting||!t.selectedFile,type:"primary",clickHandler:this._handleAttachmentAdd}];return W(s,{active:this.isPanelActive(e),key:"attachment-adding-panel",heading:n.addAttachment,headingLevel:a,handleBack:i,messages:n,messagesCommon:r,sketchViewModel:l,snappingControls:o},W("div",{class:this.classes(B.content,B.scroller)},t.render()),this.renderControls(d))}renderAttachmentEditing(e){const{_attachments:t,EditorPanel:s,_handleBack:i,headingLevel:a,messages:n,messagesCommon:r,_snappingControls:o,viewModel:{sketchViewModel:l}}=this,d=[{label:r.update,disabled:t.submitting||!t.selectedFile,type:"primary",clickHandler:this._handleAttachmentUpdate},{label:r.delete,disabled:t.submitting,type:"tertiary",clickHandler:this._handleAttachmentDelete}];return W(s,{active:this.isPanelActive(e),key:"attachment-editing-panel",heading:n.editAttachment,headingLevel:a,handleBack:i,messages:n,messagesCommon:r,sketchViewModel:l,snappingControls:o},W("div",{class:this.classes(B.content,B.scroller)},t.render()),this.renderControls(d))}renderFeatureUpdating(e){const{EditorPanel:t,_handleBack:s,headingLevel:i,messages:a,messagesCommon:n,_snappingControls:r,viewModel:{sketchViewModel:o}}=this;return W(t,{active:this.isPanelActive(e),key:"feature-updating-panel",heading:a.selectFeature,headingLevel:i,handleBack:s,messages:a,messagesCommon:n,sketchViewModel:o,snappingControls:r},W("div",{class:this.classes(B.content,B.scroller)},this.renderMessage(a.selectFeatureToEdit)))}renderMessage(e){return W("div",{class:B.message},e)}renderFeatureCreation(e){const{EditorPanel:t,_handleBack:s,headingLevel:i,messages:a,messagesCommon:n,_snappingControls:r,viewModel:o}=this,{sketchViewModel:l}=o,d=o.sketchViewModel,c=this._assertActiveCreateWorkflow().data.creationInfo.layer,p=d.canUndo()&&d.createGraphic?d.createGraphic:null,h=this._getSketchingTip(c.geometryType,p);return W(t,{active:this.isPanelActive(e),key:"feature-creation-panel",heading:a.placeFeature,headingLevel:i,handleBack:s,messages:a,messagesCommon:n,sketchViewModel:l,snappingControls:r},W("div",{class:this.classes(B.content,B.scroller)},this.renderMessage(h)))}renderControls(e){return W("div",{class:B.controls,key:"controls"},e.map((({disabled:e=!1,label:t,type:s,clickHandler:i},a)=>this.renderButton({label:t,class:this.classes(B.controlButton,B.button,"secondary"===s?B.buttonSecondary:"tertiary"===s?B.buttonTertiary:null,e?B.buttonDisabled:null),disabled:e,clickHandler:i,key:a}))))}renderPrompt({title:e,message:t,context:s,actions:i}){const a=!!i.secondary,n=W("calcite-button",{appearance:"solid",color:"danger"===s?"red":"blue",width:a?"half":"full",onclick:i.primary.action,key:"prompt-primary-button",afterCreate:P},i.primary.label),r=a?W("calcite-button",{appearance:"clear",color:"danger"===s?"red":"blue",width:"half",onclick:i.secondary.action,key:"prompt-secondary-button"},i.secondary.label):null;return W("div",{class:`${B.promptContainer}--${s}`},W("div",{class:B.promptHeader},W("calcite-icon",{icon:"exclamation-mark-triangle"}),W(y,{class:B.promptHeading,level:this.headingLevel},e)),W("div",{class:B.promptMessage},t),W("div",{class:B.promptDivider}),W("div",{class:B.promptActions},r,n))}renderProgressBar(){return W("div",{class:this.classes(B.progressBar),key:"progress-bar"})}renderButton(e){return W("button",{class:e.class,disabled:e.disabled,key:e.key,onclick:e.clickHandler,type:"button"},e.label)}renderLanding(e){const{EditorPanel:t,headingLevel:s,messages:i,messagesCommon:a,_snappingControls:n,viewModel:{sketchViewModel:r}}=this;return W(t,{active:this.isPanelActive(e),key:"landing-panel",heading:i.widgetLabel,headingLevel:s,showBackButton:!1,messages:i,messagesCommon:a,sketchViewModel:r,snappingControls:n},W("div",{key:"edit-actions",class:B.panelContentSection},this.renderUpdateActions()),W("div",{key:"create-actions",class:B.panelContentSection},this.renderCreateActions()))}renderUpdateActions(){const{messages:e,messagesCommon:t}=this;return W("div",null,W(y,{level:b(this.headingLevel)},e.editFeatures),W("div",{class:B.updateFeaturesActionButtons},W("calcite-action",{text:t.select,textEnabled:!0,icon:"cursor",alignment:"start",class:B.updateFeaturesActionButtonsButton,onclick:this._handleEdit})))}renderCreateActions(){const{messages:e}=this;return W("div",null,W(y,{level:b(this.headingLevel)},e.createFeatures),W("div",{key:"templates",class:B.featureTemplatesContainer},this._featureTemplates.render()))}renderFeatureList(e){const{EditorPanel:t,_handleBack:s,headingLevel:i,messages:a,messagesCommon:n,messagesTemplates:r,_snappingControls:o,viewModel:{editableItems:l,sketchViewModel:d}}=this,c=this._assertActiveUpdateWorkflow().data.candidates,p=S(a.multipleFeaturesTemplate,{total:c.length}),h=new Map;let m=0;c.map((e=>({label:this._getLabel(e),id:e.attributes[e.layer.objectIdField],data:e}))).filter((e=>{const{label:t,data:s}=e,i=this._filterText.toLowerCase(),{title:a}=s.layer,n=this.viewModel.editableItems.find((e=>e.layer===s.layer));return n.supports.indexOf("update")>-1&&(!i||t.toLowerCase().indexOf(i)>-1||a.toLowerCase().indexOf(i)>-1)})).forEach((e=>{m++;const t=e.data.layer;h.has(t)?h.get(t).items.push(e):h.set(t,{id:`${t.id}`,label:t.title,items:[e]})}));const u=l.filter((({layer:e})=>h.has(e))).map((({layer:e})=>h.get(e))).toArray(),g=m>10||this._filterText.length>0;return W(t,{active:this.isPanelActive(e),key:"feature-list",heading:p,headingLevel:i,handleBack:s,messages:a,messagesCommon:n,sketchViewModel:d,snappingControls:o},k({id:this.id,enableListScroll:!1,filterEnabled:g,filterText:this._filterText,items:u,messages:{filterPlaceholder:r.filterPlaceholder,noItems:r.noItems,noMatches:r.noMatches},onItemMouseEnter:({data:e})=>this._setCandidateFeature(e),onItemMouseLeave:()=>this._setCandidateFeature(null),onItemSelect:({data:e})=>this._setCandidateFeature(e,!0),onFilterChange:e=>this._filterText=e}))}EditorPanel(e,...t){const{active:s,handleBack:i,heading:a,headingLevel:n,key:r,messages:o,messagesCommon:l,showBackButton:d,showContentScrim:c,sketchViewModel:p,snappingControls:h}=e;return W("calcite-panel",{bind:this,key:r,heading:a,headingLevel:n,showBackButton:null==d||d,beforeBack:null!=i?i:null,onCalcitePanelScroll:this._onSnappingPopoverPanelScroll},W("calcite-popover-manager",{autoClose:s,class:B.panelToolbar},W("calcite-popover",{afterCreate:this._afterSnappingPopoverCreated,afterUpdate:this._afterSnappingPopoverUpdated,bind:this,label:o.snappingSettings,heading:o.snappingSettings,"reference-element":`${r}__snappingButton`,"overlay-positioning":"fixed"},W("div",{class:B.snappingControlsPopover},h.render())),W("calcite-button",{id:`${r}__snappingButton`,text:o.snapping,appearance:"transparent",color:"neutral",alignment:"icon-end-space-between","icon-start":"vertex-gps","icon-end":"caret-down",width:"full",class:B.panelToolbarSnappingButton},o.snapping),this.visibleElements.undoRedoButtons?[W("calcite-button",{key:"undo-button",text:l.undo,appearance:"transparent",color:"neutral",alignment:"center","icon-start":"undo",scale:"l",disabled:!p.canUndo(),onclick:p.undo.bind(p)}),W("calcite-button",{key:"redo-button",text:l.redo,appearance:"transparent",color:"neutral",alignment:"center","icon-start":"redo",scale:"l",disabled:!p.canRedo(),onclick:p.redo.bind(p)})]:null),W("div",{class:T(B.panelContent,B.scroller)},t,c?W("calcite-scrim",null):null))}_onSnappingPopoverPanelScroll(){var e;null!=(e=this._snappingPopover)&&e.open&&this._snappingPopover.toggle()}_afterSnappingPopoverCreated(e){this._snappingPopover=e}_afterSnappingPopoverUpdated(e){this._snappingPopover=e}_getSketchingTip(e,t){const{messages:s}=this;if("point"===e)return s.tips.clickToAddPoint;if("polygon"===e||"polyline"===e){if(!t)return s.tips.clickToStart;const i=t.geometry,a="polygon"===e?"rings":"paths",[n]=i[a];return"polygon"===e&&n<4?s.tips.clickToContinue:s.tips.clickToContinueThenDoubleClickToEnd}return s.tips.clickToAddFeature}_getLabel(e){const t=e.layer;if(!t)return null;const{objectIdField:s}=t,{attributes:i}=e,a=h(t);return a&&i[a]&&`${i[a]}`||S(this.messages.untitledFeatureTemplate,{id:i[s]})}_handleDelete(){const{messages:e,messagesCommon:t}=this;this._prompt={title:e.deleteWarningTitle,message:e.deleteWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.viewModel.deleteFeatureFromWorkflow(),this._prompt=null}},secondary:{label:e.keepFeature,action:()=>this._prompt=null}}}}_handleSave(){this.viewModel.featureFormViewModel.validateContingencyConstraints(this.viewModel.featureFormViewModel.getValues(),{includeIncompleteViolations:!0}).length>0||this.viewModel.activeWorkflow.commit()}_handleAttachmentAdd(){const{_attachments:e}=this,{activeWorkflow:t}=this.viewModel;e.addAttachment().then((()=>t.previous()))}_handleAttachmentUpdate(){const{_attachments:e}=this,{activeWorkflow:t}=this.viewModel;e.updateAttachment().then((()=>t.previous()))}_handleAttachmentDelete(){const{messages:e,messagesCommon:t}=this;this._prompt={title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{const{_attachments:e}=this,{activeWorkflow:t}=this.viewModel;e.deleteAttachment(e.viewModel.activeAttachmentInfo).then((()=>{t.previous(),this._prompt=null}))}},secondary:{label:e.keepAttachment,action:()=>this._prompt=null}}}}_handleAdd(){this.viewModel.canCreate}_handleEdit(){this.viewModel.canUpdate&&this.viewModel.startUpdateWorkflowAtFeatureSelection()}_handleDone(){this.viewModel.cancelWorkflow({force:!0})}async _handleBack(){const{messages:e}=this,t=this.activeWorkflow,s=()=>{t.hasPreviousStep?t.previous({cancelCurrentStep:!0}):this.viewModel.cancelWorkflow({force:!0})};if("create"===t.type||"create-features"===t.type&&t.numPendingFeatures>0||"update"===t.type&&t.data.edits.modified){const{type:i}=t,a="create"===i?e.cancelAddWarningMessage:e.cancelEditWarningMessage,n="create"===i?e.cancelAddTitle:e.cancelEditTitle,r="create"===i?e.continueAdding:e.continueEditing,o="create"===i?e.discardFeature:e.discardEdits;return this._prompt={title:n,message:a,context:"danger",actions:{primary:{label:o,action:()=>{s(),this._prompt=null}},secondary:{label:r,action:()=>this._prompt=null}}},this.scheduleRender(),Promise.reject()}s()}_assertActiveCreateWorkflow(){const{type:e}=this.viewModel.activeWorkflow;if("create"===e||"create-features"===e)return this.viewModel.activeWorkflow;throw Error("Expected activeWorkflow to be instance of CreateWorkflow or CreateFeaturesWorkflow")}_assertActiveUpdateWorkflow(){if("update"===this.viewModel.activeWorkflow.type)return this.viewModel.activeWorkflow;throw Error("Expected activeWorkflow to be an UpdateWorkflow")}};e([c()],j.prototype,"_attachments",void 0),e([l("viewModel.activeWorkflow")],j.prototype,"activeWorkflow",void 0),e([l("viewModel.allowedWorkflows")],j.prototype,"allowedWorkflows",void 0),e([c()],j.prototype,"useDeprecatedCreateWorkflow",void 0),e([c()],j.prototype,"headingLevel",void 0),e([c()],j.prototype,"iconClass",void 0),e([c({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],j.prototype,"label",void 0),e([l("viewModel.layerInfos")],j.prototype,"layerInfos",void 0),e([c(),A("esri/widgets/Editor/t9n/Editor")],j.prototype,"messages",void 0),e([c(),A("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([c(),A("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],j.prototype,"messagesTemplates",void 0),e([l("viewModel.snappingOptions")],j.prototype,"snappingOptions",void 0),e([c()],j.prototype,"supportingWidgetDefaults",void 0),e([l("viewModel.view")],j.prototype,"view",void 0),e([c(),F(["workflow-cancel","workflow-commit"])],j.prototype,"viewModel",void 0),e([c()],j.prototype,"visibleElements",void 0),e([d("visibleElements")],j.prototype,"castVisibleElements",null),e([M()],j.prototype,"_handleDelete",null),e([M()],j.prototype,"_handleAttachmentAdd",null),e([M()],j.prototype,"_handleAttachmentUpdate",null),e([M()],j.prototype,"_handleAttachmentDelete",null),e([M()],j.prototype,"_handleAdd",null),e([M()],j.prototype,"_handleEdit",null),e([M()],j.prototype,"_handleDone",null),j=e([p("esri.widgets.Editor")],j);const L=j;export{L as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{HandleOwnerMixin as t}from"../core/HandleOwner.js";import s from"../core/Logger.js";import{isSome as i}from"../core/maybe.js";import{watch as a}from"../core/reactiveUtils.js";import{init as r,on as o,watch as n,whenNot as l}from"../core/watchUtils.js";import{aliasOf as d}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as c}from"../core/accessorSupport/decorators/cast.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{getDisplayFieldName as m}from"../layers/support/fieldUtils.js";import u from"../views/interactive/snapping/SnappingOptions.js";import g from"./Attachments.js";import v from"./FeatureForm.js";import _ from"./FeatureTemplates.js";import w from"./Spinner.js";import f from"./Widget.js";import{workflowDeprecation as k}from"./Editor/deprecationUtils.js";import y from"./Editor/EditorViewModel.js";import{ItemList as b}from"./FeatureTemplates/ItemList.js";import{Heading as C,incrementHeadingLevel as M}from"./support/Heading.js";import F from"./support/SnappingControls.js";import{accessibleHandler as A}from"./support/decorators/accessibleHandler.js";import{messageBundle as W}from"./support/decorators/messageBundle.js";import{vmEvent as T}from"./support/decorators/vmEvent.js";import{tsx as S}from"./support/jsxFactory.js";import{classes as E}from"./support/widgetUtils.js";import{substitute as B}from"../intl/substitute.js";const P={base:"esri-editor esri-widget esri-widget--panel",scroller:"esri-editor__scroller",content:"esri-editor__content",contentGroup:"esri-editor__content-group",message:"esri-editor__message",controls:"esri-editor__controls",progressBar:"esri-editor__progress-bar",promptContainer:"esri-editor__prompt",promptHeader:"esri-editor__prompt__header",promptHeading:"esri-editor__prompt__header__heading",promptMessage:"esri-editor__prompt__message",promptDivider:"esri-editor__prompt__divider",promptActions:"esri-editor__prompt__actions",promptOption:"esri-editor__prompt__option",promptOptionPrimary:"esri-editor__prompt__option--primary",promptOptionNegative:"esri-editor__prompt__option--negative",promptOptionPositive:"esri-editor__prompt__option--positive",controlButton:"esri-editor__control-button",overlay:"esri-editor__overlay",warningIcon:"esri-icon-notice-triangle",widgetIcon:"esri-icon-edit",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonSecondary:"esri-button--secondary",buttonTertiary:"esri-button--tertiary",input:"esri-input",interactive:"esri-interactive",select:"esri-select",panelToolbar:"esri-editor__panel-toolbar",panelToolbarSnappingButton:"esri-editor__panel-toolbar__snapping-button",panelContent:"esri-editor__panel-content",panelContentSection:"esri-editor__panel-content--section",updateFeaturesActionButtons:"esri-editor__update-features-action-buttons",updateFeaturesActionButtonsButton:"esri-editor__update-features-action-buttons--button",featureTemplatesContainer:"esri-editor__feature-templates-container",snappingControlsPopover:"esri-editor__snapping-controls-popover",scrimOverlay:"esri-editor__scrim-overlay"},j={undoRedoButtons:!1};function L(e){e.focus()}const x="esri.widgets.Editor",U=s.getLogger(x);let V=class extends(t(f)){constructor(e,t){super(e,t),this._candidateCommitted=!1,this._featureForm=new v,this._stateStack=[],this._attachments=new g({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._featureTemplates=new _({enableListScroll:!1}),this._filterText="",this._prompt=null,this._spinner=new w,this._snappingPopover=null,this.activeWorkflow=null,this.allowedWorkflows=null,this.useDeprecatedCreateWorkflow=!1,this.headingLevel=4,this.iconClass=P.widgetIcon,this.label=void 0,this.layerInfos=null,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.snappingOptions=new u,this.supportingWidgetDefaults=null,this.view=null,this.viewModel=new y,this.visibleElements={...j},this._setCandidateFeature=(e,t=!1)=>{if(this._candidateCommitted)return;const s=this._assertActiveUpdateWorkflow();s.data.edits.feature=e,t&&(s.next(),this._candidateCommitted=!0)},this._handleSave=this._handleSave.bind(this),this._handleBack=this._handleBack.bind(this),this._handleDone=this._handleDone.bind(this),this._handleDelete=this._handleDelete.bind(this),this._handleAdd=this._handleAdd.bind(this),this._handleEdit=this._handleEdit.bind(this),this._handleAttachmentAdd=this._handleAttachmentAdd.bind(this),this._handleAttachmentUpdate=this._handleAttachmentUpdate.bind(this),this._handleAttachmentDelete=this._handleAttachmentDelete.bind(this),this.EditorPanel=this.EditorPanel.bind(this)}initialize(){const{view:e,snappingOptions:t}=this;this._snappingControls=new F({snappingOptions:t,view:e,visibleElements:{header:!1}}),this.own([r(this,"headingLevel",(e=>{this._featureForm.headingLevel=M(e),this._featureTemplates.headingLevel=M(e)})),this.viewModel.featureTemplatesViewModel.on("select",(({item:e})=>this.useDeprecatedCreateWorkflow?this.startCreateWorkflowAtFeatureCreation(e):this.startCreateFeaturesWorkflowAtFeatureCreation(e))),a((()=>this.viewModel.state),((e,t)=>{const s=this._stateStack.indexOf(e);-1===s?this._stateStack.push(t):this._stateStack.splice(s)})),r(this,"viewModel",(e=>{this._featureForm.viewModel=e?e.featureFormViewModel:null,this._attachments.viewModel=e?e.attachmentsViewModel:null,this._featureTemplates.viewModel=e?e.featureTemplatesViewModel:null,this._spinner.viewModel=e?e.spinnerViewModel:null})),r(this,"view",((e,t)=>{const s=`editor-${this.id}-spinner`;t&&t.ui.remove(this._spinner,s),e&&e.ui.add(this._spinner,{key:s,position:"manual"})})),o(this,"viewModel.sketchViewModel","create",(()=>{this.scheduleRender()})),o(this,"viewModel.activeWorkflow","cancel-request",(({controller:e})=>{const{messages:t,messagesCommon:s}=this;this._prompt={title:t.cancelRequestTitle,message:t.cancelRequestWarningMessage,context:"danger",actions:{primary:{label:s.form.yes,action:()=>{e.allow(),this._prompt=null}},secondary:{label:s.form.no,action:()=>(e.deny(),this._prompt=null)}}},this.scheduleRender()})),r(this,"supportingWidgetDefaults",(e=>{e&&(this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel.set(e.sketch))})),n(this,"_attachments.error",(e=>{if(!e)return;const{messages:t,messagesCommon:s}=this;this._prompt={title:t.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:s.form.ok,action:()=>{this._prompt=null}}}}})),n(this,"viewModel.failures",(e=>{if(!e)return;const{messages:t}=this,[{error:s,retry:i,cancel:a}]=e;this._prompt={title:t.errorWarningTitle,message:B(t.errorWarningMessageTemplate,{errorMessage:s.message}),context:"warning",actions:{primary:{label:t.retry,action:()=>{i(),this._prompt=null}},secondary:{label:t.ignore,action:()=>(a(),this._prompt=null)}}}})),n(this,"viewModel.state",(e=>{"awaiting-feature-to-update"===e&&(this._filterText=""),"awaiting-update-feature-candidate"===e&&(this._candidateCommitted=!1)})),n(this,["_attachments.selectedFile","_attachments.submitting"],(()=>this.scheduleRender())),l(this,"viewModel.activeWorkflow",(()=>this._featureTemplates.filterText=""))])}destroy(){this._attachments.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._snappingControls.destroy()}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-action.js"),import("@esri/calcite-components/dist/components/calcite-action-menu.js"),import("@esri/calcite-components/dist/components/calcite-button.js"),import("@esri/calcite-components/dist/components/calcite-flow.js"),import("@esri/calcite-components/dist/components/calcite-icon.js"),import("@esri/calcite-components/dist/components/calcite-loader.js"),import("@esri/calcite-components/dist/components/calcite-panel.js"),import("@esri/calcite-components/dist/components/calcite-popover.js"),import("@esri/calcite-components/dist/components/calcite-popover-manager.js"),import("@esri/calcite-components/dist/components/calcite-scrim.js"),import("@esri/calcite-components/dist/components/calcite-tooltip-manager.js")])}castVisibleElements(e){return{...j,...e}}startCreateWorkflowAtFeatureTypeSelection(){return k(U,"startCreateWorkflowAtFeatureTypeSelection","startCreateFeaturesWorkflowAtFeatureTypeSelection"),this.viewModel.startCreateWorkflowAtFeatureTypeSelection()}startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection()}startCreateWorkflowAtFeatureCreation(e){return k(U,"startCreateWorkflowAtFeatureCreation","startCreateFeaturesWorkflowAtFeatureCreation"),this.viewModel.startCreateWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateWorkflowAtFeatureEdit(e){return k(U,"startCreateWorkflowAtFeatureEdit"),this.viewModel.startCreateWorkflowAtFeatureEdit(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}deleteFeatureFromWorkflow(){return this.viewModel.deleteFeatureFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{_attachments:e,_prompt:t,viewModel:s}=this;if(!s)return S("div",{class:P.base});const{state:a}=s,r=i(t)?S("calcite-scrim",null,this.renderPrompt(t)):null;return S("div",{class:P.base},s.syncing||e.submitting?this.renderProgressBar():null,S("calcite-flow",null,this._stateStack.map((e=>this.renderState(e))),this.renderState(a)),r)}renderState(e){switch(e){case"disabled":break;case"ready":return this.renderLanding(e);case"awaiting-feature-creation-info":return this.renderTemplates(e);case"creating-features":case"editing-new-feature":case"editing-existing-feature":return this.renderAttributeEditing(e);case"awaiting-feature-to-update":return this.renderFeatureUpdating(e);case"awaiting-update-feature-candidate":return this.renderFeatureList(e);case"awaiting-feature-to-create":return this.renderFeatureCreation(e);case"adding-attachment":return this.renderAttachmentAdding(e);case"editing-attachment":return this.renderAttachmentEditing(e)}return S("div",null)}isPanelActive(e){return this.viewModel.state===e}renderTemplates(e){const{EditorPanel:t,headingLevel:s,messages:i,messagesCommon:a,_handleBack:r,_snappingControls:o,viewModel:{sketchViewModel:n}}=this;return S(t,{active:this.isPanelActive(e),key:"templates-panel",handleBack:r,heading:i.selectTemplate,headingLevel:s,messages:i,messagesCommon:a,sketchViewModel:n,snappingControls:o},this._featureTemplates.render())}renderAttributeEditing(e){const{activeWorkflow:t,EditorPanel:s,messages:i,messagesCommon:a,headingLevel:r,_handleBack:o,_snappingControls:n,viewModel:l}=this,{sketchViewModel:d}=l,c=l.featureFormViewModel;if("create-features"===t.type&&t.pendingFeatures.length<1)return this.renderFeatureCreation(e);const p="update"===t.type&&!t.data.edits.modified||l.syncing||c.inputFields.length>0&&!c.submittable,h="update"===t.type?i.editFeature:i.createFeatures,m="update"===t.type?a.update:a.create,u="create-features"===t.type&&"create-new"===t.createFeatureState,g=[{label:"create-features"===t.type&&t.numPendingFeatures>1?B(i.createFeaturesTemplate,{numFeatures:t.numPendingFeatures}):m,type:"primary",disabled:p,clickHandler:this._handleSave}];let v=!1;return"update"===t.type&&(t.data.editableItem.hasAttachments&&(v=!0),t.data.editableItem.supports.includes("delete")&&g.push({label:a.delete,type:"tertiary",clickHandler:this._handleDelete})),S(s,{active:this.isPanelActive(e),key:"attribute-editing-panel",heading:h,headingLevel:r,showContentScrim:u,handleBack:o,messages:i,messagesCommon:a,sketchViewModel:d,snappingControls:n},S("div",{class:P.panelContentSection},S("div",{class:P.contentGroup},c.inputFields.length>0?this._featureForm.render():this.renderMessage(B(i.clickToFinishTemplate,{button:m})),v?S("div",{key:"attachments"},S("div",null,i.attachments),this._attachments.render()):null)),S("div",{class:this._prompt?"":P.scrimOverlay},this.renderControls(g)))}renderAttachmentAdding(e){const{_attachments:t,EditorPanel:s,_handleBack:i,headingLevel:a,messages:r,messagesCommon:o,_snappingControls:n,viewModel:{sketchViewModel:l}}=this,d=[{label:t.submitting?o.cancel:o.add,disabled:t.submitting||!t.selectedFile,type:"primary",clickHandler:this._handleAttachmentAdd}];return S(s,{active:this.isPanelActive(e),key:"attachment-adding-panel",heading:r.addAttachment,headingLevel:a,handleBack:i,messages:r,messagesCommon:o,sketchViewModel:l,snappingControls:n},S("div",{class:this.classes(P.content,P.scroller)},t.render()),this.renderControls(d))}renderAttachmentEditing(e){const{_attachments:t,EditorPanel:s,_handleBack:i,headingLevel:a,messages:r,messagesCommon:o,_snappingControls:n,viewModel:{sketchViewModel:l}}=this,d=[{label:o.update,disabled:t.submitting||!t.selectedFile,type:"primary",clickHandler:this._handleAttachmentUpdate},{label:o.delete,disabled:t.submitting,type:"tertiary",clickHandler:this._handleAttachmentDelete}];return S(s,{active:this.isPanelActive(e),key:"attachment-editing-panel",heading:r.editAttachment,headingLevel:a,handleBack:i,messages:r,messagesCommon:o,sketchViewModel:l,snappingControls:n},S("div",{class:this.classes(P.content,P.scroller)},t.render()),this.renderControls(d))}renderFeatureUpdating(e){const{EditorPanel:t,_handleBack:s,headingLevel:i,messages:a,messagesCommon:r,_snappingControls:o,viewModel:{sketchViewModel:n}}=this;return S(t,{active:this.isPanelActive(e),key:"feature-updating-panel",heading:a.selectFeature,headingLevel:i,handleBack:s,messages:a,messagesCommon:r,sketchViewModel:n,snappingControls:o},S("div",{class:this.classes(P.content,P.scroller)},this.renderMessage(a.selectFeatureToEdit)))}renderMessage(e){return S("div",{class:P.message},e)}renderFeatureCreation(e){const{EditorPanel:t,_handleBack:s,headingLevel:i,messages:a,messagesCommon:r,_snappingControls:o,viewModel:n}=this,{sketchViewModel:l}=n,d=n.sketchViewModel,c=this._assertActiveCreateWorkflow().data.creationInfo.layer,p=d.canUndo()&&d.createGraphic?d.createGraphic:null,h=this._getSketchingTip(c.geometryType,p);return S(t,{active:this.isPanelActive(e),key:"feature-creation-panel",heading:a.placeFeature,headingLevel:i,handleBack:s,messages:a,messagesCommon:r,sketchViewModel:l,snappingControls:o},S("div",{class:this.classes(P.content,P.scroller)},this.renderMessage(h)))}renderControls(e){return S("div",{class:P.controls,key:"controls"},e.map((({disabled:e=!1,label:t,type:s,clickHandler:i},a)=>this.renderButton({label:t,class:this.classes(P.controlButton,P.button,"secondary"===s?P.buttonSecondary:"tertiary"===s?P.buttonTertiary:null,e?P.buttonDisabled:null),disabled:e,clickHandler:i,key:a}))))}renderPrompt({title:e,message:t,context:s,actions:i}){const a=!!i.secondary,r=S("calcite-button",{appearance:"solid",color:"danger"===s?"red":"blue",width:a?"half":"full",onclick:i.primary.action,key:"prompt-primary-button",afterCreate:L},i.primary.label),o=a?S("calcite-button",{appearance:"clear",color:"danger"===s?"red":"blue",width:"half",onclick:i.secondary.action,key:"prompt-secondary-button"},i.secondary.label):null;return S("div",{class:`${P.promptContainer}--${s}`},S("div",{class:P.promptHeader},S("calcite-icon",{icon:"exclamation-mark-triangle"}),S(C,{class:P.promptHeading,level:this.headingLevel},e)),S("div",{class:P.promptMessage},t),S("div",{class:P.promptDivider}),S("div",{class:P.promptActions},o,r))}renderProgressBar(){return S("div",{class:this.classes(P.progressBar),key:"progress-bar"})}renderButton(e){return S("button",{class:e.class,disabled:e.disabled,key:e.key,onclick:e.clickHandler,type:"button"},e.label)}renderLanding(e){const{EditorPanel:t,headingLevel:s,messages:i,messagesCommon:a,_snappingControls:r,viewModel:{sketchViewModel:o}}=this;return S(t,{active:this.isPanelActive(e),key:"landing-panel",heading:i.widgetLabel,headingLevel:s,showBackButton:!1,messages:i,messagesCommon:a,sketchViewModel:o,snappingControls:r},S("div",{key:"edit-actions",class:P.panelContentSection},this.renderUpdateActions()),S("div",{key:"create-actions",class:P.panelContentSection},this.renderCreateActions()))}renderUpdateActions(){const{messages:e,messagesCommon:t}=this;return S("div",null,S(C,{level:M(this.headingLevel)},e.editFeatures),S("div",{class:P.updateFeaturesActionButtons},S("calcite-action",{text:t.select,textEnabled:!0,icon:"cursor",alignment:"start",class:P.updateFeaturesActionButtonsButton,onclick:this._handleEdit})))}renderCreateActions(){const{messages:e}=this;return S("div",null,S(C,{level:M(this.headingLevel)},e.createFeatures),S("div",{key:"templates",class:P.featureTemplatesContainer},this._featureTemplates.render()))}renderFeatureList(e){const{EditorPanel:t,_handleBack:s,headingLevel:i,messages:a,messagesCommon:r,messagesTemplates:o,_snappingControls:n,viewModel:{editableItems:l,sketchViewModel:d}}=this,c=this._assertActiveUpdateWorkflow().data.candidates,p=B(a.multipleFeaturesTemplate,{total:c.length}),h=new Map;let m=0;c.map((e=>({label:this._getLabel(e),id:e.attributes[e.layer.objectIdField],data:e}))).filter((e=>{const{label:t,data:s}=e,i=this._filterText.toLowerCase(),{title:a}=s.layer,r=this.viewModel.editableItems.find((e=>e.layer===s.layer));return r.supports.indexOf("update")>-1&&(!i||t.toLowerCase().indexOf(i)>-1||a.toLowerCase().indexOf(i)>-1)})).forEach((e=>{m++;const t=e.data.layer;h.has(t)?h.get(t).items.push(e):h.set(t,{id:`${t.id}`,label:t.title,items:[e]})}));const u=l.filter((({layer:e})=>h.has(e))).map((({layer:e})=>h.get(e))).toArray(),g=m>10||this._filterText.length>0;return S(t,{active:this.isPanelActive(e),key:"feature-list",heading:p,headingLevel:i,handleBack:s,messages:a,messagesCommon:r,sketchViewModel:d,snappingControls:n},b({id:this.id,enableListScroll:!1,filterEnabled:g,filterText:this._filterText,items:u,messages:{filterPlaceholder:o.filterPlaceholder,noItems:o.noItems,noMatches:o.noMatches},onItemMouseEnter:({data:e})=>this._setCandidateFeature(e),onItemMouseLeave:()=>this._setCandidateFeature(null),onItemSelect:({data:e})=>this._setCandidateFeature(e,!0),onFilterChange:e=>this._filterText=e}))}EditorPanel(e,...t){const{active:s,handleBack:i,heading:a,headingLevel:r,key:o,messages:n,messagesCommon:l,showBackButton:d,showContentScrim:c,sketchViewModel:p,snappingControls:h}=e;return S("calcite-panel",{bind:this,key:o,heading:a,headingLevel:r,showBackButton:null==d||d,beforeBack:null!=i?i:null,onCalcitePanelScroll:this._onSnappingPopoverPanelScroll},S("calcite-popover-manager",{autoClose:s,class:P.panelToolbar},S("calcite-popover",{afterCreate:this._afterSnappingPopoverCreated,afterUpdate:this._afterSnappingPopoverUpdated,bind:this,label:n.snappingSettings,heading:n.snappingSettings,"reference-element":`${o}__snappingButton`,"overlay-positioning":"fixed"},S("div",{class:P.snappingControlsPopover},h.render())),S("calcite-button",{id:`${o}__snappingButton`,text:n.snapping,appearance:"transparent",color:"neutral",alignment:"icon-end-space-between","icon-start":"vertex-gps","icon-end":"caret-down",width:"full",class:P.panelToolbarSnappingButton},n.snapping),this.visibleElements.undoRedoButtons?[S("calcite-button",{key:"undo-button",text:l.undo,appearance:"transparent",color:"neutral",alignment:"center","icon-start":"undo",scale:"l",disabled:!p.canUndo(),onclick:p.undo.bind(p)}),S("calcite-button",{key:"redo-button",text:l.redo,appearance:"transparent",color:"neutral",alignment:"center","icon-start":"redo",scale:"l",disabled:!p.canRedo(),onclick:p.redo.bind(p)})]:null),S("div",{class:E(P.panelContent,P.scroller)},t,c?S("calcite-scrim",null):null))}_onSnappingPopoverPanelScroll(){var e;null!=(e=this._snappingPopover)&&e.open&&this._snappingPopover.toggle()}_afterSnappingPopoverCreated(e){this._snappingPopover=e}_afterSnappingPopoverUpdated(e){this._snappingPopover=e}_getSketchingTip(e,t){const{messages:s}=this;if("point"===e)return s.tips.clickToAddPoint;if("polygon"===e||"polyline"===e){if(!t)return s.tips.clickToStart;const i=t.geometry,a="polygon"===e?"rings":"paths",[r]=i[a];return"polygon"===e&&r<4?s.tips.clickToContinue:s.tips.clickToContinueThenDoubleClickToEnd}return s.tips.clickToAddFeature}_getLabel(e){const t=e.layer;if(!t)return null;const{objectIdField:s}=t,{attributes:i}=e,a=m(t);return a&&i[a]&&`${i[a]}`||B(this.messages.untitledFeatureTemplate,{id:i[s]})}_handleDelete(){const{messages:e,messagesCommon:t}=this;this._prompt={title:e.deleteWarningTitle,message:e.deleteWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.viewModel.deleteFeatureFromWorkflow(),this._prompt=null}},secondary:{label:e.keepFeature,action:()=>this._prompt=null}}}}_handleSave(){this.viewModel.featureFormViewModel.validateContingencyConstraints(this.viewModel.featureFormViewModel.getValues(),{includeIncompleteViolations:!0}).length>0||this.viewModel.activeWorkflow.commit()}_handleAttachmentAdd(){const{_attachments:e}=this,{activeWorkflow:t}=this.viewModel;e.addAttachment().then((()=>t.previous()))}_handleAttachmentUpdate(){const{_attachments:e}=this,{activeWorkflow:t}=this.viewModel;e.updateAttachment().then((()=>t.previous()))}_handleAttachmentDelete(){const{messages:e,messagesCommon:t}=this;this._prompt={title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{const{_attachments:e}=this,{activeWorkflow:t}=this.viewModel;e.deleteAttachment(e.viewModel.activeAttachmentInfo).then((()=>{t.previous(),this._prompt=null}))}},secondary:{label:e.keepAttachment,action:()=>this._prompt=null}}}}_handleAdd(){this.viewModel.canCreate}_handleEdit(){this.viewModel.canUpdate&&this.viewModel.startUpdateWorkflowAtFeatureSelection()}_handleDone(){this.viewModel.cancelWorkflow({force:!0})}async _handleBack(){const{messages:e}=this,t=this.activeWorkflow,s=()=>{t.hasPreviousStep?t.previous({cancelCurrentStep:!0}):this.viewModel.cancelWorkflow({force:!0})};if("create"===t.type||"create-features"===t.type&&t.numPendingFeatures>0||"update"===t.type&&t.data.edits.modified){const{type:i}=t,a="create"===i?e.cancelAddWarningMessage:e.cancelEditWarningMessage,r="create"===i?e.cancelAddTitle:e.cancelEditTitle,o="create"===i?e.continueAdding:e.continueEditing,n="create"===i?e.discardFeature:e.discardEdits;return this._prompt={title:r,message:a,context:"danger",actions:{primary:{label:n,action:()=>{s(),this._prompt=null}},secondary:{label:o,action:()=>this._prompt=null}}},this.scheduleRender(),Promise.reject()}s()}_assertActiveCreateWorkflow(){const{type:e}=this.viewModel.activeWorkflow;if("create"===e||"create-features"===e)return this.viewModel.activeWorkflow;throw Error("Expected activeWorkflow to be instance of CreateWorkflow or CreateFeaturesWorkflow")}_assertActiveUpdateWorkflow(){if("update"===this.viewModel.activeWorkflow.type)return this.viewModel.activeWorkflow;throw Error("Expected activeWorkflow to be an UpdateWorkflow")}};e([p()],V.prototype,"_attachments",void 0),e([d("viewModel.activeWorkflow")],V.prototype,"activeWorkflow",void 0),e([d("viewModel.allowedWorkflows")],V.prototype,"allowedWorkflows",void 0),e([p()],V.prototype,"useDeprecatedCreateWorkflow",void 0),e([p()],V.prototype,"headingLevel",void 0),e([p()],V.prototype,"iconClass",void 0),e([p({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],V.prototype,"label",void 0),e([d("viewModel.layerInfos")],V.prototype,"layerInfos",void 0),e([p(),W("esri/widgets/Editor/t9n/Editor")],V.prototype,"messages",void 0),e([p(),W("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([p(),W("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],V.prototype,"messagesTemplates",void 0),e([d("viewModel.snappingOptions")],V.prototype,"snappingOptions",void 0),e([p()],V.prototype,"supportingWidgetDefaults",void 0),e([d("viewModel.view")],V.prototype,"view",void 0),e([p(),T(["workflow-cancel","workflow-commit"])],V.prototype,"viewModel",void 0),e([p()],V.prototype,"visibleElements",void 0),e([c("visibleElements")],V.prototype,"castVisibleElements",null),e([A()],V.prototype,"_handleDelete",null),e([A()],V.prototype,"_handleAttachmentAdd",null),e([A()],V.prototype,"_handleAttachmentUpdate",null),e([A()],V.prototype,"_handleAttachmentDelete",null),e([A()],V.prototype,"_handleAdd",null),e([A()],V.prototype,"_handleEdit",null),e([A()],V.prototype,"_handleDone",null),V=e([h(x)],V);const D=V;export{D 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{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as n}from"../../core/HandleOwner.js";import s from"../../core/Logger.js";import{destroyMaybe as o,isSome as l,isNone as r}from"../../core/maybe.js";import{EsriPromiseMixin as a}from"../../core/Promise.js";import{watch as u}from"../../core/reactiveUtils.js";import{ReentrantObjectPool as c}from"../../core/ReentrantObjectPool.js";import{property as d}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 h from"../../form/FormTemplate.js";import f from"../../layers/support/ContingentValue.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{loadArcade as g}from"../../support/arcadeOnDemand.js";import y from"./InputField.js";import _ from"./InputFieldGroup.js";import{onLocaleChange as F}from"../../intl/locale.js";import{fetchMessageBundle as v}from"../../intl/messages.js";function C(e){return!!e.inputFields}const I=new t({attributes:{}}),E="esri.widgets.FeatureForm.FeatureFormViewModel",b=s.getLogger(E),V="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",j="#JSAPI_CONTINGENT_VALUE_ANY_HASH",A="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let w=class extends(n(a(i.EventedAccessor))){constructor(e){super(e),this._arcade=null,this._compiledExpressions=new Map,this._contingentValuesCache=null,this._fieldPool=new c(y),this._fieldGroupPool=new c(_),this._featureClone=I.clone(),this._initialFeature=I.clone(),this._needsArcade=!1,this._inputFieldCache=new Map,this._inputFieldGroupCache=new Map,this.contingencyConstraintViolations=new Map,this.messages=null,this.strict=!1}initialize(){const e=async()=>this.messages=await v("esri/widgets/FeatureForm/t9n/FeatureForm");e();const t=u((()=>this.layer),(e=>{"feature"===(null==e?void 0:e.type)&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(e).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0}),i=u((()=>{var e,t;const{formTemplate:i}=this;if(r(i))return null;const n=null!=(e=i.expressionInfos)?e:[],s=null!=(t=i.elements)?t:[];return[...n.map((e=>e.expression)),...null==s?void 0:s.map((e=>this._getExpressionsFromElementRecursive(e))).flat()]}),(async e=>{if(e.length<1)return;const t=new Set(e),n=new Map;if(l(this.formTemplate)&&l(this.formTemplate.expressionInfos))for(const i of this.formTemplate.expressionInfos)t.delete(i.name),n.set(i.expression,i.name);for(const i of this._compiledExpressions.keys())t.delete(i);if(t.size<1)return;this._needsArcade=!0;const s=await g();this._arcade=s;const{arcadeUtils:o}=s;for(const l of t.values()){var r;o.hasGeometryOperations(l)&&(await o.enableGeometryOperations(),i.remove()),this._setFunctionForExpression(null!=(r=n.get(l))?r:l,l)}this.notifyChange("inputFields")})),n=u((()=>this.formTemplate),(()=>this._compiledExpressions.clear()));this.handles.add([F(e),i,n,t])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache),this._fieldPool.destroy(),this._fieldGroupPool.destroy()}get allInputFields(){return this.inputFields.reduce(((e,t)=>C(t)?[...e,...t.inputFields]:[...e,t]),[])}get _layerFieldsByName(){return new Map(this.layer.fields.map((e=>[e.name,e])))}get description(){const{formTemplate:e}=this;return l(e)?e.description:""}set description(e){void 0===e?this._clearOverride("description"):this._override("description",e)}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():I.clone(),this._initialFeature=this._featureClone.clone(),this._inputFieldCache.clear(),this._inputFieldGroupCache.clear(),this._set("feature",e)}get fieldsWithContingentValues(){if(r(this._contingentValuesCache))return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){void 0===e?this._clearOverride("formTemplate"):this._override("formTemplate",e)}get inputFields(){const{_arcade:e,_featureClone:t,_initialFeature:i,_inputFieldCache:n,_needsArcade:s,formTemplate:o,messages:r,layer:a,state:u}=this;if("ready"!==u||s&&!e)return[];const c=t.clone(),d=Array.from(n.keys()),p={arcade:e,feature:c,initialFeature:i,layer:a,messages:r},h=l(o)&&o.elements.length>0?this._generateInputFieldsFromElements(o.elements,p):this._generateInputFieldsFromLayerFields(null==a?void 0:a.fields,p);return this._cullInputFieldCache(this._flattenGroups(h).map((e=>e.name)),d),this._releasePreviousInputFields(),h.filter((e=>e.visible))}get joinedContingentValues(){return this._joinContingentValues()}get layer(){var e;return null!=(e=this.feature)&&e.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){e?this._override("layer",e):this._clearOverride("layer")}get state(){return this.messages&&this.get("layer.loaded")?"ready":"disabled"}get submittable(){return!!this.valid||this.allInputFields.filter((e=>!e.valid)).every((({submittable:e})=>e))}get title(){const{formTemplate:e}=this;return l(e)?e.title:""}set title(e){void 0===e?this._clearOverride("title"):this._override("title",e)}get valid(){const e=this.allInputFields;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allInputFields.find((t=>t.name===e))}getValue(e){var t;const{_featureClone:i,layer:n}=this,s=!(null==n||!n.getField(e));return null!=(t=i.getAttribute(e))?t:s?null:void 0}setValue(e,t){const{_featureClone:i,strict:n}=this,s=this.findField(e);if(t=""===t?null:t,!s||i.getAttribute(e)===t)return;s.value=t;if(this.get("layer.typeIdField")===s.name&&"types"in this.layer){const e=new Set;this.layer.types.forEach((t=>Object.keys(t.domains).forEach((t=>e.add(t))))),e.forEach((e=>{const t=this.findField(e);t&&t.notifyChange("domain")}))}n&&!s.valid||(i.setAttribute(e,t),this.notifyChange("inputFields"),this._emitChangeEvent(s))}getValues(){return{...this._featureClone.attributes}}submit(){const e=this.allInputFields,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),i=e.filter((e=>!e.valid)).map((({name:e})=>e)),n=this.getValues();if(this.validateContingencyConstraints(n,{includeIncompleteViolations:!0}).length>0)for(const[s,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(s),i.push(s));this.emit("submit",{valid:[...t],invalid:i,values:n})}validateContingencyConstraints(e,t){const{_contingentValuesCache:i}=this,n=new Map;if(this.contingencyConstraintViolations=n,r(i))return[];const{invalid:s,incomplete:o}=i.validateContingencyConstraints(e),l=[...s,...null!=t&&t.includeIncompleteViolations?o:[]];for(const r of l)for(const e of r.fieldGroup.fields)n.set(e,r);return l}_cullInputFieldCache(e,t){const i=t.filter((t=>!e.includes(t)));for(const n in i)this._inputFieldCache.delete(n)}_flattenGroups(e){return e.flatMap((e=>"groupElement"in e?e.inputFields:e))}_releasePreviousInputFields(){const e=this._get("inputFields");if(e&&!(e.length<1))for(const t of e)"groupElement"in t?this._releaseInputFieldGroup(t):this._releaseInputField(t)}_releaseInputFieldGroup(e){e.inputFields.forEach((e=>this._releaseInputField(e))),this._fieldGroupPool.release(e)}_releaseInputField(e){this._fieldPool.release(e)}_emitChangeEvent({name:e,valid:t,value:i}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:i,valid:t})}_generateInputFieldsFromElements(e,t){const i=[];for(const n of e)this._isSupportedElement(n)&&i.push("group"===n.type?this._acquireAndInitializeInputFieldGroup(n,t):this._acquireAndInitializeInputField({field:this._layerFieldsByName.get(n.fieldName),fieldElement:n,...t}));return i}_generateInputFieldsFromLayerFields(e,t){return Array.isArray(e)?e.map((e=>this._acquireAndInitializeInputField({field:e,fieldElement:null,...t}))):(b.warn(E,"No attribute fields found."),[])}_acquireAndInitializeInputField(e){var t,i,n,s,o,l;const{arcade:r,feature:a,field:u,fieldElement:c,group:d,initialFeature:p,layer:h,messages:f}=e,m=null!=(t=this._compiledExpressions.get(null==c?void 0:c.requiredExpression))?t:void 0,g=null!=(i=this._compiledExpressions.get(null==c?void 0:c.visibilityExpression))?i:void 0,y=null!=(n=this._compiledExpressions.get(null==c?void 0:c.valueExpression))?n:void 0,_=null!=(s=this._compiledExpressions.get(null==c?void 0:c.editableExpression))?s:void 0,F=u.name,v=null!=(o=null==(l=this._inputFieldCache.get(F))?void 0:l.value)?o:this.getValue(F),C=this._fieldPool.acquire();return this._inputFieldCache.set(F,C),C.set({field:u,fieldElement:c,arcade:r,feature:a,group:d,initialFeature:p,layer:h,messages:f,requiredFunction:m,visibilityFunction:g,editableFunction:_,valueFunction:y,value:v})}_acquireAndInitializeInputFieldGroup(e,t){const i=this._fieldGroupPool.acquire(),n=[];for(const r of e.elements)this._isSupportedElement(r)&&n.push(this._acquireAndInitializeInputField({field:this._layerFieldsByName.get(r.fieldName),fieldElement:r,group:i,...t}));const{arcade:s,feature:o}=t,l=this._compiledExpressions.get(e.visibilityExpression);return i.set({arcade:s,feature:o,groupElement:e,inputFields:n,visibilityFunction:l})}_getExpressionsFromElementRecursive(e){const t=[];if(e.visibilityExpression&&t.push(e.visibilityExpression),"field"===e.type){const i=["requiredExpression","valueExpression","editableExpression"];for(const n of i)e[n]&&t.push(e[n])}if("group"===e.type&&e.elements)for(const i of e.elements)t.push(...this._getExpressionsFromElementRecursive(i));return t}_setFunctionForExpression(e,t){const{_arcade:{arcadeUtils:i},_compiledExpressions:n}=this;n.set(e,i.createFunction(t))}_isSupportedElement(e){return"field"===e.type||"group"===e.type||(b.warn("form-info::unsupported-element-type","Only element types 'field' and 'group' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}_joinContingentValues(){const e=this._contingentValuesCache;if(r(e))return[];const t="typeIdField"in this.layer?this.layer.typeIdField:null,i=t?this.getValue(t):null,n=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:s}=r,o=[];for(const n of e)n.isRetired||l(n.subtype)&&n.subtype.code!==i||o.push({values:n.values});o.length>0&&n.push({name:s,fields:t,contingencies:o})}const[s,o]=this._generateJoinPlan(n);return[...s.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,i=[],n=new Set;for(const a of e)for(const e of a.fields)if(t.has(e)){const s=t.get(e),o=a,l=[s.name,o.name].sort().join("|");if(n.has(l))continue;i.push([s,o]),n.add(l),t.set(e,o)}else t.set(e,a);const s=new Set(i.flat()),o=new Set(e);for(const a of s)o.delete(a);const l=new Map,r=new Map;for(const a of new Set(i.flat())){const e=Symbol(a.name);l.set(e,new Set([a])),r.set(a,e)}for(const[a,u]of i){const e=r.get(a),t=r.get(u);if(e===t)continue;const i=l.get(e),n=l.get(t);for(const s of n)i.add(s),r.set(s,e);l.delete(t)}return[[...l.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),i=t.shift();let n=t.shift(),s=this._generateJoinKey(i.fields,n.fields),o=new Set([...i.fields,...n.fields]),a=new Map;for(const l of i.contingencies){const[e]=this._hashContingency(l,s.codedValueFields,!0);a.has(e)?a.get(e).push(l):a.set(e,[l])}for(;t.length>0;){const e=new Map,i=t.shift(),l=this._generateJoinKey(o,i.fields);for(const t of n.contingencies){const[i,n]=this._hashContingency(t,s.codedValueFields),o=n?this._findMatchingContingenciesWithAnyHashMask(a,i):a.get(i);if(a.has(j)&&o.push(...this._findMatchingContingenciesContainingAny(t,a.get(j),s.codedValueFields)),!r(o))for(const a of o){const i=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(a,t,s.rangeFields):this._joinContingencies(a,t);if(r(i))break;const[n]=this._hashContingency(i,l.codedValueFields,!0);e.has(n)?e.get(n).push(i):e.set(n,[i])}}a=e,n=i,s=l,o=new Set([...o,...n.fields])}const u=[];for(const c of n.contingencies){const[e,t]=this._hashContingency(c,s.codedValueFields),i=t?this._findMatchingContingenciesWithAnyHashMask(a,e):a.get(e);if(a.has(j)&&i.push(...this._findMatchingContingenciesContainingAny(c,a.get(j),s.codedValueFields)),!r(i))for(const n of i){const e=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(n,c,s.rangeFields):this._joinContingencies(n,c);l(e)&&u.push(e)}}return u}_joinContingencies(e,t){const i={values:{...e.values,...t.values}};for(const[n,s]of Object.entries(i.values))"any"===s.objectType&&l(e.values[n])&&(i.values[n]=e.values[n]);return i}_joinContingenciesWithRangeDomains(e,t,i){const n=this._joinContingencies(e,t);for(const s of i){const i=e.values[s],o=t.values[s],{leftIsNull:l,rightIsNull:r,bothAreNull:a,leftIsAny:u,rightIsAny:c,bothAreAny:d,leftIsRange:p,rightIsRange:h}=this._compareObjectTypes(i.objectType,o.objectType);if(a||d)continue;if(l&&c||r&&u){n.values[s]=new f({objectType:"null"});continue}if(l&&h||r&&p)return null;u?(i.minValue=-1/0,i.maxValue=1/0):c&&(o.minValue=-1/0,o.maxValue=1/0);const m=Math.max(i.minValue,o.minValue),g=Math.min(i.maxValue,o.maxValue);if(m>g)return null;n.values[s]=new f({objectType:"range",minValue:m,maxValue:g})}return n}_findMatchingContingenciesContainingAny(e,t,i){return t.filter((t=>i.every((i=>{var n,s;const o=t.values[i],l=e.values[i];return"any"===o.objectType||"any"===l.objectType||(null==(n=o.codedValue)?void 0:n.code)===(null==(s=l.codedValue)?void 0:s.code)}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const i=RegExp(`${t}$`),n=[];for(const[s,o]of e){if(s===j)break;i.test(s)&&n.push(...o)}return n}_generateJoinKey(e,t){const i=Array.isArray(e)?new Set(e):e,n=Array.isArray(t)?new Set(t):t,s=i.size<n.size?i:n,o=s===i?n:i,l=new Set,a=new Set;for(const u of s)if(o.has(u)){const e=this.layer.getFieldDomain(u,{feature:this.feature});if(r(e))continue;switch(e.type){case"coded-value":l.add(u);break;case"range":a.add(u)}}return{codedValueFields:[...l],rangeFields:[...a]}}_hashContingency(e,t,i=!1){if(t.length<1)return[V,!1];const n=[];let s=!1;for(const l of t){const t=e.values[l];if("any"===t.objectType){if(i)return[j,!0];s=!0,n.push(`${l}:.*`)}else if("null"===t.objectType)n.push(`${l}:${A}`);else{var o;n.push(`${l}:${null==(o=t.codedValue)?void 0:o.code}`)}}return[n.sort().join("&"),s]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};e([d({readOnly:!0})],w.prototype,"allInputFields",null),e([d()],w.prototype,"_layerFieldsByName",null),e([d({readOnly:!0})],w.prototype,"_inputFieldCache",void 0),e([d({readOnly:!0})],w.prototype,"_inputFieldGroupCache",void 0),e([d()],w.prototype,"contingencyConstraintViolations",void 0),e([d()],w.prototype,"description",null),e([d()],w.prototype,"feature",null),e([d()],w.prototype,"fieldsWithContingentValues",null),e([d({type:h})],w.prototype,"formTemplate",null),e([d({readOnly:!0,dependsOn:["formTemplate","messages","feature","layer.fields","layer.loaded","state"]})],w.prototype,"inputFields",null),e([d()],w.prototype,"joinedContingentValues",null),e([d()],w.prototype,"layer",null),e([d()],w.prototype,"messages",void 0),e([d()],w.prototype,"state",null),e([d()],w.prototype,"strict",void 0),e([d()],w.prototype,"submittable",null),e([d()],w.prototype,"title",null),e([d()],w.prototype,"valid",null),e([d()],w.prototype,"getValues",null),e([d()],w.prototype,"submit",null),w=e([p(E)],w);const x=w;export{x as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as n}from"../../core/HandleOwner.js";import s from"../../core/Logger.js";import{destroyMaybe as o,isSome as l,isNone as r}from"../../core/maybe.js";import{EsriPromiseMixin as a}from"../../core/Promise.js";import{watch as u}from"../../core/reactiveUtils.js";import{ReentrantObjectPool as c}from"../../core/ReentrantObjectPool.js";import{property as d}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 h from"../../form/FormTemplate.js";import f from"../../layers/support/ContingentValue.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{loadArcade as g}from"../../support/arcadeOnDemand.js";import y from"./InputField.js";import _ from"./InputFieldGroup.js";import{onLocaleChange as v}from"../../intl/locale.js";import{fetchMessageBundle as F}from"../../intl/messages.js";function C(e){return!!e.inputFields}const E=new t({attributes:{}}),I="esri.widgets.FeatureForm.FeatureFormViewModel",V=s.getLogger(I),b="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",j="#JSAPI_CONTINGENT_VALUE_ANY_HASH",A="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let w=class extends(n(a(i.EventedAccessor))){constructor(e){super(e),this._arcade=null,this._compiledExpressions=new Map,this._contingentValuesCache=null,this._fieldPool=new c(y,(e=>this.handles.add(u((()=>e.value),(()=>{e.isUsingValueExpression&&this._afterValueChange(e)})),e.id)),(({id:e})=>this.handles.remove(e))),this._fieldGroupPool=new c(_),this._featureClone=E.clone(),this._initialFeature=E.clone(),this._needsArcade=!1,this._inputFieldCache=new Map,this._inputFieldGroupCache=new Map,this.contingencyConstraintViolations=new Map,this.messages=null,this.strict=!1}initialize(){const e=async()=>this.messages=await F("esri/widgets/FeatureForm/t9n/FeatureForm");e();const t=u((()=>this.layer),(e=>{"feature"===(null==e?void 0:e.type)&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(e).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0}),i=u((()=>{var e,t;const{formTemplate:i}=this;if(r(i))return null;const n=null!=(e=i.expressionInfos)?e:[],s=null!=(t=i.elements)?t:[];return[...n.map((e=>e.expression)),...null==s?void 0:s.map((e=>this._getExpressionsFromElementRecursive(e))).flat()]}),(async e=>{if(e.length<1)return;const t=new Set(e),n=new Map;if(l(this.formTemplate)&&l(this.formTemplate.expressionInfos))for(const i of this.formTemplate.expressionInfos)t.delete(i.name),n.set(i.expression,i.name);for(const i of this._compiledExpressions.keys())t.delete(i);if(t.size<1)return;this._needsArcade=!0;const s=await g();this._arcade=s;const{arcadeUtils:o}=s;for(const l of t.values()){var r;o.hasGeometryOperations(l)&&(await o.enableGeometryOperations(),i.remove()),this._setFunctionForExpression(null!=(r=n.get(l))?r:l,l)}this.notifyChange("inputFields")})),n=u((()=>this.formTemplate),(()=>this._compiledExpressions.clear()));this.handles.add([v(e),i,n,t])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache),this._fieldPool.destroy(),this._fieldGroupPool.destroy()}get allInputFields(){return this.inputFields.reduce(((e,t)=>C(t)?[...e,...t.inputFields]:[...e,t]),[])}get _layerFieldsByName(){return new Map(this.layer.fields.map((e=>[e.name,e])))}get description(){const{formTemplate:e}=this;return l(e)?e.description:""}set description(e){void 0===e?this._clearOverride("description"):this._override("description",e)}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():E.clone(),this._initialFeature=this._featureClone.clone(),this._inputFieldCache.clear(),this._inputFieldGroupCache.clear(),this._set("feature",e)}get fieldsWithContingentValues(){if(r(this._contingentValuesCache))return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){void 0===e?this._clearOverride("formTemplate"):this._override("formTemplate",e)}get inputFields(){const{_arcade:e,_featureClone:t,_initialFeature:i,_inputFieldCache:n,_needsArcade:s,formTemplate:o,messages:r,layer:a,state:u}=this;if("ready"!==u||s&&!e)return[];const c=t.clone(),d=Array.from(n.keys()),p={arcade:e,feature:c,initialFeature:i,layer:a,messages:r},h=l(o)&&o.elements.length>0?this._generateInputFieldsFromElements(o.elements,p):this._generateInputFieldsFromLayerFields(null==a?void 0:a.fields,p);return this._cullInputFieldCache(this._flattenGroups(h).map((e=>e.name)),d),this._releasePreviousInputFields(),h.filter((e=>e.visible))}get joinedContingentValues(){return this._joinContingentValues()}get layer(){var e;return null!=(e=this.feature)&&e.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){e?this._override("layer",e):this._clearOverride("layer")}get state(){return this.messages&&this.get("layer.loaded")?"ready":"disabled"}get submittable(){return!!this.valid||this.allInputFields.filter((e=>!e.valid)).every((({submittable:e})=>e))}get title(){const{formTemplate:e}=this;return l(e)?e.title:""}set title(e){void 0===e?this._clearOverride("title"):this._override("title",e)}get valid(){const e=this.allInputFields;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allInputFields.find((t=>t.name===e))}getValue(e){var t;const{_featureClone:i,layer:n}=this,s=!(null==n||!n.getField(e));return null!=(t=i.getAttribute(e))?t:s?null:void 0}setValue(e,t){const{_featureClone:i,strict:n}=this,s=this.findField(e);t=""===t?null:t,s&&i.getAttribute(e)!==t&&(s.value=t,n&&!s.valid||this._afterValueChange(s))}getValues(){return{...this._featureClone.attributes}}submit(){const e=this.allInputFields,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),i=e.filter((e=>!e.valid)).map((({name:e})=>e)),n=this.getValues();if(this.validateContingencyConstraints(n,{includeIncompleteViolations:!0}).length>0)for(const[s,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(s),i.push(s));this.emit("submit",{valid:[...t],invalid:i,values:n})}validateContingencyConstraints(e,t){const{_contingentValuesCache:i}=this,n=new Map;if(this.contingencyConstraintViolations=n,r(i))return[];const{invalid:s,incomplete:o}=i.validateContingencyConstraints(e),l=[...s,...null!=t&&t.includeIncompleteViolations?o:[]];for(const r of l)for(const e of r.fieldGroup.fields)n.set(e,r);return l}_cullInputFieldCache(e,t){const i=t.filter((t=>!e.includes(t)));for(const n in i)this._inputFieldCache.delete(n)}_flattenGroups(e){return e.flatMap((e=>"groupElement"in e?e.inputFields:e))}_releasePreviousInputFields(){const e=this._get("inputFields");if(e&&!(e.length<1))for(const t of e)"groupElement"in t?this._releaseInputFieldGroup(t):this._releaseInputField(t)}_releaseInputFieldGroup(e){e.inputFields.forEach((e=>this._releaseInputField(e))),this._fieldGroupPool.release(e)}_releaseInputField(e){this._fieldPool.release(e)}_emitChangeEvent({name:e,valid:t,value:i}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:i,valid:t})}_generateInputFieldsFromElements(e,t){const i=[];for(const n of e)this._isSupportedElement(n)&&i.push("group"===n.type?this._acquireAndInitializeInputFieldGroup(n,t):this._acquireAndInitializeInputField({field:this._layerFieldsByName.get(n.fieldName),fieldElement:n,...t}));return i}_generateInputFieldsFromLayerFields(e,t){return Array.isArray(e)?e.map((e=>this._acquireAndInitializeInputField({field:e,fieldElement:null,...t}))):(V.warn(I,"No attribute fields found."),[])}_acquireAndInitializeInputField(e){var t,i,n,s,o,l;const{arcade:r,feature:a,field:u,fieldElement:c,group:d,initialFeature:p,layer:h,messages:f}=e,m=null!=(t=this._compiledExpressions.get(null==c?void 0:c.requiredExpression))?t:void 0,g=null!=(i=this._compiledExpressions.get(null==c?void 0:c.visibilityExpression))?i:void 0,y=null!=(n=this._compiledExpressions.get(null==c?void 0:c.valueExpression))?n:void 0,_=null!=(s=this._compiledExpressions.get(null==c?void 0:c.editableExpression))?s:void 0,v=u.name,F=null!=(o=null==(l=this._inputFieldCache.get(v))?void 0:l.value)?o:this.getValue(v),C=this._fieldPool.acquire();return this._inputFieldCache.set(v,C),C.set({field:u,fieldElement:c,arcade:r,feature:a,group:d,initialFeature:p,layer:h,messages:f,requiredFunction:m,visibilityFunction:g,editableFunction:_,valueFunction:y,value:F})}_acquireAndInitializeInputFieldGroup(e,t){const i=this._fieldGroupPool.acquire(),n=[];for(const r of e.elements)this._isSupportedElement(r)&&n.push(this._acquireAndInitializeInputField({field:this._layerFieldsByName.get(r.fieldName),fieldElement:r,group:i,...t}));const{arcade:s,feature:o}=t,l=this._compiledExpressions.get(e.visibilityExpression);return i.set({arcade:s,feature:o,groupElement:e,inputFields:n,visibilityFunction:l})}_afterValueChange(e){const{name:t,value:i}=e;if(this.get("layer.typeIdField")===e.name&&"types"in this.layer){const e=new Set;this.layer.types.forEach((t=>Object.keys(t.domains).forEach((t=>e.add(t))))),e.forEach((e=>{const t=this.findField(e);t&&t.notifyChange("domain")}))}this._featureClone.setAttribute(t,i),this.notifyChange("inputFields"),this._emitChangeEvent(e)}_getExpressionsFromElementRecursive(e){const t=[];if(e.visibilityExpression&&t.push(e.visibilityExpression),"field"===e.type){const i=["requiredExpression","valueExpression","editableExpression"];for(const n of i)e[n]&&t.push(e[n])}if("group"===e.type&&e.elements)for(const i of e.elements)t.push(...this._getExpressionsFromElementRecursive(i));return t}_setFunctionForExpression(e,t){const{_arcade:{arcadeUtils:i},_compiledExpressions:n}=this;n.set(e,i.createFunction(t))}_isSupportedElement(e){return"field"===e.type||"group"===e.type||(V.warn("form-info::unsupported-element-type","Only element types 'field' and 'group' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}_joinContingentValues(){const e=this._contingentValuesCache;if(r(e))return[];const t="typeIdField"in this.layer?this.layer.typeIdField:null,i=t?this.getValue(t):null,n=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:s}=r,o=[];for(const n of e)n.isRetired||l(n.subtype)&&n.subtype.code!==i||o.push({values:n.values});o.length>0&&n.push({name:s,fields:t,contingencies:o})}const[s,o]=this._generateJoinPlan(n);return[...s.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,i=[],n=new Set;for(const a of e)for(const e of a.fields)if(t.has(e)){const s=t.get(e),o=a,l=[s.name,o.name].sort().join("|");if(n.has(l))continue;i.push([s,o]),n.add(l),t.set(e,o)}else t.set(e,a);const s=new Set(i.flat()),o=new Set(e);for(const a of s)o.delete(a);const l=new Map,r=new Map;for(const a of new Set(i.flat())){const e=Symbol(a.name);l.set(e,new Set([a])),r.set(a,e)}for(const[a,u]of i){const e=r.get(a),t=r.get(u);if(e===t)continue;const i=l.get(e),n=l.get(t);for(const s of n)i.add(s),r.set(s,e);l.delete(t)}return[[...l.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),i=t.shift();let n=t.shift(),s=this._generateJoinKey(i.fields,n.fields),o=new Set([...i.fields,...n.fields]),a=new Map;for(const l of i.contingencies){const[e]=this._hashContingency(l,s.codedValueFields,!0);a.has(e)?a.get(e).push(l):a.set(e,[l])}for(;t.length>0;){const e=new Map,i=t.shift(),l=this._generateJoinKey(o,i.fields);for(const t of n.contingencies){const[i,n]=this._hashContingency(t,s.codedValueFields),o=n?this._findMatchingContingenciesWithAnyHashMask(a,i):a.get(i);if(a.has(j)&&o.push(...this._findMatchingContingenciesContainingAny(t,a.get(j),s.codedValueFields)),!r(o))for(const a of o){const i=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(a,t,s.rangeFields):this._joinContingencies(a,t);if(r(i))break;const[n]=this._hashContingency(i,l.codedValueFields,!0);e.has(n)?e.get(n).push(i):e.set(n,[i])}}a=e,n=i,s=l,o=new Set([...o,...n.fields])}const u=[];for(const c of n.contingencies){const[e,t]=this._hashContingency(c,s.codedValueFields),i=t?this._findMatchingContingenciesWithAnyHashMask(a,e):a.get(e);if(a.has(j)&&i.push(...this._findMatchingContingenciesContainingAny(c,a.get(j),s.codedValueFields)),!r(i))for(const n of i){const e=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(n,c,s.rangeFields):this._joinContingencies(n,c);l(e)&&u.push(e)}}return u}_joinContingencies(e,t){const i={values:{...e.values,...t.values}};for(const[n,s]of Object.entries(i.values))"any"===s.objectType&&l(e.values[n])&&(i.values[n]=e.values[n]);return i}_joinContingenciesWithRangeDomains(e,t,i){const n=this._joinContingencies(e,t);for(const s of i){const i=e.values[s],o=t.values[s],{leftIsNull:l,rightIsNull:r,bothAreNull:a,leftIsAny:u,rightIsAny:c,bothAreAny:d,leftIsRange:p,rightIsRange:h}=this._compareObjectTypes(i.objectType,o.objectType);if(a||d)continue;if(l&&c||r&&u){n.values[s]=new f({objectType:"null"});continue}if(l&&h||r&&p)return null;u?(i.minValue=-1/0,i.maxValue=1/0):c&&(o.minValue=-1/0,o.maxValue=1/0);const m=Math.max(i.minValue,o.minValue),g=Math.min(i.maxValue,o.maxValue);if(m>g)return null;n.values[s]=new f({objectType:"range",minValue:m,maxValue:g})}return n}_findMatchingContingenciesContainingAny(e,t,i){return t.filter((t=>i.every((i=>{var n,s;const o=t.values[i],l=e.values[i];return"any"===o.objectType||"any"===l.objectType||(null==(n=o.codedValue)?void 0:n.code)===(null==(s=l.codedValue)?void 0:s.code)}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const i=RegExp(`${t}$`),n=[];for(const[s,o]of e){if(s===j)break;i.test(s)&&n.push(...o)}return n}_generateJoinKey(e,t){const i=Array.isArray(e)?new Set(e):e,n=Array.isArray(t)?new Set(t):t,s=i.size<n.size?i:n,o=s===i?n:i,l=new Set,a=new Set;for(const u of s)if(o.has(u)){const e=this.layer.getFieldDomain(u,{feature:this.feature});if(r(e))continue;switch(e.type){case"coded-value":l.add(u);break;case"range":a.add(u)}}return{codedValueFields:[...l],rangeFields:[...a]}}_hashContingency(e,t,i=!1){if(t.length<1)return[b,!1];const n=[];let s=!1;for(const l of t){const t=e.values[l];if("any"===t.objectType){if(i)return[j,!0];s=!0,n.push(`${l}:.*`)}else if("null"===t.objectType)n.push(`${l}:${A}`);else{var o;n.push(`${l}:${null==(o=t.codedValue)?void 0:o.code}`)}}return[n.sort().join("&"),s]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};e([d({readOnly:!0})],w.prototype,"allInputFields",null),e([d()],w.prototype,"_layerFieldsByName",null),e([d({readOnly:!0})],w.prototype,"_inputFieldCache",void 0),e([d({readOnly:!0})],w.prototype,"_inputFieldGroupCache",void 0),e([d()],w.prototype,"contingencyConstraintViolations",void 0),e([d()],w.prototype,"description",null),e([d()],w.prototype,"feature",null),e([d()],w.prototype,"fieldsWithContingentValues",null),e([d({type:h})],w.prototype,"formTemplate",null),e([d({readOnly:!0,dependsOn:["formTemplate","messages","feature","layer.fields","layer.loaded","state"]})],w.prototype,"inputFields",null),e([d()],w.prototype,"joinedContingentValues",null),e([d()],w.prototype,"layer",null),e([d()],w.prototype,"messages",void 0),e([d()],w.prototype,"state",null),e([d()],w.prototype,"strict",void 0),e([d()],w.prototype,"submittable",null),e([d()],w.prototype,"title",null),e([d()],w.prototype,"valid",null),e([d()],w.prototype,"getValues",null),e([d()],w.prototype,"submit",null),w=e([p(I)],w);const x=w;export{x 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{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Accessor.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import{isSome as l,isNone as r,get as n}from"../../core/maybe.js";import{watch as o}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../layers/support/CodedValueDomain.js";import"../../layers/support/Domain.js";import"../../layers/support/InheritedDomain.js";import"../../layers/support/RangeDomain.js";import{validateDomainValue as d,DomainValidationError as p,getDomainRange as c}from"../../layers/support/domainUtils.js";import{isNumericField as h,isStringField as m,isDateField as y,TypeValidationError as v,validateFieldValue as f,getFeatureEditFields as g,getFeatureGeometryFields as E,NumericRangeValidationError as b,getFieldRange as _}from"../../layers/support/fieldUtils.js";import{substitute as x}from"../../intl/substitute.js";var F,V;!function(e){e.Text="text",e.Number="number",e.Date="date",e.Unsupported="unsupported"}(F||(F={})),function(e){e.TOO_SHORT="length-validation-error::too-short"}(V||(V={}));const O={type:"number"},U={type:"number",intlOptions:{notation:"scientific"}},T={type:"date",intlOptions:{day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}};let A=class extends(i(t)){constructor(e){super(e),this._storedValue=null,this.arcade=null,this.editableFunction=null,this.requiredFunction=null,this.valueFunction=null,this.visibilityFunction=null,this.feature=null,this.field=null,this.fieldElement=null,this.layer=null,this.description=null,this.inputType=null,this.error=null,this.group=null,this.hint=null,this.messages=null,this.name=null}initialize(){this.handles.add(o((()=>this.value),((e,t)=>{if(e!==t){const{feature:e,name:t,value:i}=this;e.setAttribute(t,i)}})))}get _configAllowsEdits(){var e,t,i;const{fieldElement:r,layer:n,name:o}=this;if(l(r))return!1!==r.editable;const s="subtype-group"!==(null==n?void 0:n.type)?null==n||null==(e=n.popupTemplate)||null==(t=e.fieldInfos)?void 0:t.find((({fieldName:e})=>e===o)):null;return null==(i=null==s?void 0:s.isEditable)||i}get _layerFieldAllowsEdits(){const{field:e,layer:t}=this;return(null==t?void 0:t.capabilities.operations.supportsEditing)&&(null==e?void 0:e.editable)}get isUsingValueExpression(){return this._shouldUseValueExpression()}get evaluatedEditableExpression(){const{editableFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedRequiredExpression(){const{requiredFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedVisibilityExpression(){const{visibilityFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedValueExpression(){const{valueFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get domain(){var e;const{typeIdField:t}=this.layer,i=t===this.name,r=null==(e=this.field)?void 0:e.domain;if(i&&!r){const{layer:e}=this,t="subtype-group"===e.type?e.sublayers.map((({subtypeCode:e,title:t})=>({id:e,name:t}))):e.types.map((({id:e,name:t})=>({code:e,name:t})));return new u({name:"__internal-type-based-coded-value-domain__",codedValues:t})}const{feature:o}=this,s=t&&this.layer.getFieldDomain(this.name,{feature:o})||r,a=n(this.fieldElement,"domain");return l(a)&&this._isDomainCompatible(a)?a:s}get editable(){var e;return!!this._layerFieldAllowsEdits&&(null!=(e=this.evaluatedEditableExpression)?e:this._configAllowsEdits)}get errorMessage(){return this._toErrorMessage()}get includeTime(){var e;const{fieldElement:t}=this,i=l(t)&&"datetime-picker"===(null==(e=t.input)?void 0:e.type)?t.input.includeTime:void 0;return void 0===i||i}get label(){return l(this.fieldElement)&&this.fieldElement.label||this.field.alias||this.field.name}get maxLength(){const e=-1;if(this.type===F.Date)return e;const{field:t,fieldElement:i}=this,r=null==t?void 0:t.length,n=l(i)&&j(i.input)?i.input.maxLength:NaN;return!isNaN(n)&&n>=e&&(r===e||n<=r)?n:r}get minLength(){const e=-1;if(this.type===F.Date)return e;const{field:t,fieldElement:i}=this,r=null==t?void 0:t.length,n=l(i)&&j(i.input)?i.input.minLength:NaN;return!isNaN(n)&&n>=e&&(r===e||n<=r)?n:e}get required(){var e,t;return!!this.editable&&(!1===(null==(e=this.field)?void 0:e.nullable)||null!=(t=this.evaluatedRequiredExpression)&&t)}get submittable(){return!!this.valid||this.initialFeature.getAttribute(this.field.name)===this.value}get type(){const{field:e}=this;return h(e)?F.Number:m(e)?F.Text:y(e)?F.Date:F.Unsupported}get valid(){const e=this._validate();return this._set("error",e),null===e}get value(){return this._shouldUseValueExpression()?this.evaluatedValueExpression:this.get("_storedValue")}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e)}get visible(){return!this._isEditorField()&&(l(this.fieldElement)?null==(e=this.evaluatedVisibilityExpression)||e:this._isVisibleByDefault());var e}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===(null==e?void 0:e.type)){const i=typeof e.codedValues[0].code;if("string"===i&&m(t)||"number"===i&&h(t))return!0}return!!("range"===(null==e?void 0:e.type)&&h(t)||y(t))}_validate(){const{domain:e,field:t,initialFeature:i,minLength:l,required:r,type:n,valid:o,value:s}=this,a=r&&null===s,u=void 0!==o;return!a&&i.getAttribute(t.name)===s&&u?null:"text"===n&&l>-1&&"string"==typeof s&&s.length<l?V.TOO_SHORT:e?null!==s||r?d(e,s):null:a?v.INVALID_TYPE:f(t,s)}_isVisibleByDefault(){var e;const t=null==(e=this.field)?void 0:e.type;return"oid"!==t&&"global-id"!==t&&!this._isGeometryField()}_isEditorField(){return g(this.layer).indexOf(this.name)>-1}_isGeometryField(){return E(this.layer).indexOf(this.name)>-1}_shouldUseValueExpression(){return this._layerFieldAllowsEdits&&!this._configAllowsEdits&&l(this.valueFunction)}_toErrorMessage(){const{domain:e,field:t,messages:i,minLength:l,value:r,required:n,type:o}=this,s=this.error;if(n&&null===r)return i.validationErrors.cannotBeNull;if(s===p.VALUE_OUT_OF_RANGE||s===b.OUT_OF_RANGE){const l=c(e)||_(t);return x(i.validationErrors.outsideRange,l,{format:{max:"date"===o?T:l.isInteger?O:U,min:"date"===o?T:l.isInteger?O:U}})}return s===p.INVALID_CODED_VALUE?i.validationErrors.invalidCodedValue:s===v.INVALID_TYPE?i.validationErrors.invalidType:s===V.TOO_SHORT?x(i.validationErrors.tooShort,{min:l}):null}};function j(e){return!!e&&"maxLength"in e}e([s()],A.prototype,"_storedValue",void 0),e([s()],A.prototype,"_configAllowsEdits",null),e([s()],A.prototype,"_layerFieldAllowsEdits",null),e([s()],A.prototype,"arcade",void 0),e([s()],A.prototype,"editableFunction",void 0),e([s()],A.prototype,"requiredFunction",void 0),e([s()],A.prototype,"valueFunction",void 0),e([s()],A.prototype,"isUsingValueExpression",null),e([s()],A.prototype,"visibilityFunction",void 0),e([s()],A.prototype,"evaluatedEditableExpression",null),e([s()],A.prototype,"evaluatedRequiredExpression",null),e([s()],A.prototype,"evaluatedVisibilityExpression",null),e([s()],A.prototype,"evaluatedValueExpression",null),e([s()],A.prototype,"feature",void 0),e([s()],A.prototype,"field",void 0),e([s()],A.prototype,"fieldElement",void 0),e([s()],A.prototype,"initialFeature",null),e([s()],A.prototype,"layer",void 0),e([s({aliasOf:"fieldElement.description"})],A.prototype,"description",void 0),e([s()],A.prototype,"domain",null),e([s()],A.prototype,"editable",null),e([s({aliasOf:"fieldElement.input.type"})],A.prototype,"inputType",void 0),e([s({readOnly:!0})],A.prototype,"error",void 0),e([s({dependsOn:["error","messages","value"]})],A.prototype,"errorMessage",null),e([s()],A.prototype,"group",void 0),e([s({aliasOf:"fieldElement.hint"})],A.prototype,"hint",void 0),e([s()],A.prototype,"includeTime",null),e([s()],A.prototype,"label",null),e([s()],A.prototype,"maxLength",null),e([s()],A.prototype,"minLength",null),e([s()],A.prototype,"messages",void 0),e([s({aliasOf:"field.name"})],A.prototype,"name",void 0),e([s()],A.prototype,"required",null),e([s()],A.prototype,"submittable",null),e([s()],A.prototype,"type",null),e([s()],A.prototype,"valid",null),e([s({value:null})],A.prototype,"value",null),e([s()],A.prototype,"visible",null),A=e([a("esri.widgets.FeatureForm.InputField")],A);const D=A;export{D as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Accessor.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import{isSome as l,isNone as r,get as n}from"../../core/maybe.js";import{watch as o}from"../../core/reactiveUtils.js";import{generateUID as s}from"../../core/uid.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../layers/support/CodedValueDomain.js";import"../../layers/support/Domain.js";import"../../layers/support/InheritedDomain.js";import"../../layers/support/RangeDomain.js";import{validateDomainValue as p,DomainValidationError as c,getDomainRange as h}from"../../layers/support/domainUtils.js";import{isNumericField as m,isStringField as y,isDateField as v,TypeValidationError as f,validateFieldValue as g,getFeatureEditFields as E,getFeatureGeometryFields as b,NumericRangeValidationError as _,getFieldRange as x}from"../../layers/support/fieldUtils.js";import{substitute as F}from"../../intl/substitute.js";var V,O;!function(e){e.Text="text",e.Number="number",e.Date="date",e.Unsupported="unsupported"}(V||(V={})),function(e){e.TOO_SHORT="length-validation-error::too-short"}(O||(O={}));const U={type:"number"},T={type:"number",intlOptions:{notation:"scientific"}},j={type:"date",intlOptions:{day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}};let A=class extends(i(t)){constructor(e){super(e),this._storedValue=null,this.arcade=null,this.editableFunction=null,this.id=s().toString(),this.requiredFunction=null,this.valueFunction=null,this.visibilityFunction=null,this.feature=null,this.field=null,this.fieldElement=null,this.layer=null,this.description=null,this.inputType=null,this.error=null,this.group=null,this.hint=null,this.messages=null,this.name=null}initialize(){this.handles.add(o((()=>this.value),((e,t)=>{if(e!==t){const{feature:e,name:t,value:i}=this;e.setAttribute(t,i)}})))}get _configAllowsEdits(){var e,t,i;const{fieldElement:r,layer:n,name:o}=this;if(l(r))return!1!==r.editable;const s="subtype-group"!==(null==n?void 0:n.type)?null==n||null==(e=n.popupTemplate)||null==(t=e.fieldInfos)?void 0:t.find((({fieldName:e})=>e===o)):null;return null==(i=null==s?void 0:s.isEditable)||i}get _layerFieldAllowsEdits(){const{field:e,layer:t}=this;return(null==t?void 0:t.capabilities.operations.supportsEditing)&&(null==e?void 0:e.editable)}get isUsingValueExpression(){return this._shouldUseValueExpression()}get evaluatedEditableExpression(){const{editableFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedRequiredExpression(){const{requiredFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedVisibilityExpression(){const{visibilityFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedValueExpression(){const{valueFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get domain(){var e;const{typeIdField:t}=this.layer,i=t===this.name,r=null==(e=this.field)?void 0:e.domain;if(i&&!r){const{layer:e}=this,t="subtype-group"===e.type?e.sublayers.map((({subtypeCode:e,title:t})=>({id:e,name:t}))):e.types.map((({id:e,name:t})=>({code:e,name:t})));return new d({name:"__internal-type-based-coded-value-domain__",codedValues:t})}const{feature:o}=this,s=t&&this.layer.getFieldDomain(this.name,{feature:o})||r,a=n(this.fieldElement,"domain");return l(a)&&this._isDomainCompatible(a)?a:s}get editable(){var e;return!!this._layerFieldAllowsEdits&&(null!=(e=this.evaluatedEditableExpression)?e:this._configAllowsEdits)}get errorMessage(){return this._toErrorMessage()}get includeTime(){var e;const{fieldElement:t}=this,i=l(t)&&"datetime-picker"===(null==(e=t.input)?void 0:e.type)?t.input.includeTime:void 0;return void 0===i||i}get label(){return l(this.fieldElement)&&this.fieldElement.label||this.field.alias||this.field.name}get maxLength(){const e=-1;if(this.type===V.Date)return e;const{field:t,fieldElement:i}=this,r=null==t?void 0:t.length,n=l(i)&&D(i.input)?i.input.maxLength:NaN;return!isNaN(n)&&n>=e&&(r===e||n<=r)?n:r}get minLength(){const e=-1;if(this.type===V.Date)return e;const{field:t,fieldElement:i}=this,r=null==t?void 0:t.length,n=l(i)&&D(i.input)?i.input.minLength:NaN;return!isNaN(n)&&n>=e&&(r===e||n<=r)?n:e}get required(){var e,t;return!!this.editable&&(!1===(null==(e=this.field)?void 0:e.nullable)||null!=(t=this.evaluatedRequiredExpression)&&t)}get submittable(){return!!this.valid||this.initialFeature.getAttribute(this.field.name)===this.value}get type(){const{field:e}=this;return m(e)?V.Number:y(e)?V.Text:v(e)?V.Date:V.Unsupported}get valid(){const e=this._validate();return this._set("error",e),null===e}get value(){return this._shouldUseValueExpression()?this.evaluatedValueExpression:this.get("_storedValue")}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e)}get visible(){return!this._isEditorField()&&(l(this.fieldElement)?null==(e=this.evaluatedVisibilityExpression)||e:this._isVisibleByDefault());var e}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===(null==e?void 0:e.type)){const i=typeof e.codedValues[0].code;if("string"===i&&y(t)||"number"===i&&m(t))return!0}return!!("range"===(null==e?void 0:e.type)&&m(t)||v(t))}_validate(){const{domain:e,field:t,initialFeature:i,minLength:l,required:r,type:n,valid:o,value:s}=this,a=r&&null===s,u=void 0!==o;return!a&&i.getAttribute(t.name)===s&&u?null:"text"===n&&l>-1&&"string"==typeof s&&s.length<l?O.TOO_SHORT:e?null!==s||r?p(e,s):null:a?f.INVALID_TYPE:g(t,s)}_isVisibleByDefault(){var e;const t=null==(e=this.field)?void 0:e.type;return"oid"!==t&&"global-id"!==t&&!this._isGeometryField()}_isEditorField(){return E(this.layer).indexOf(this.name)>-1}_isGeometryField(){return b(this.layer).indexOf(this.name)>-1}_shouldUseValueExpression(){return this._layerFieldAllowsEdits&&!this._configAllowsEdits&&l(this.valueFunction)}_toErrorMessage(){const{domain:e,field:t,messages:i,minLength:l,value:r,required:n,type:o}=this,s=this.error;if(n&&null===r)return i.validationErrors.cannotBeNull;if(s===c.VALUE_OUT_OF_RANGE||s===_.OUT_OF_RANGE){const l=h(e)||x(t);return F(i.validationErrors.outsideRange,l,{format:{max:"date"===o?j:l.isInteger?U:T,min:"date"===o?j:l.isInteger?U:T}})}return s===c.INVALID_CODED_VALUE?i.validationErrors.invalidCodedValue:s===f.INVALID_TYPE?i.validationErrors.invalidType:s===O.TOO_SHORT?F(i.validationErrors.tooShort,{min:l}):null}};function D(e){return!!e&&"maxLength"in e}e([a()],A.prototype,"_storedValue",void 0),e([a()],A.prototype,"_configAllowsEdits",null),e([a()],A.prototype,"_layerFieldAllowsEdits",null),e([a()],A.prototype,"arcade",void 0),e([a()],A.prototype,"editableFunction",void 0),e([a()],A.prototype,"requiredFunction",void 0),e([a()],A.prototype,"valueFunction",void 0),e([a()],A.prototype,"isUsingValueExpression",null),e([a()],A.prototype,"visibilityFunction",void 0),e([a()],A.prototype,"evaluatedEditableExpression",null),e([a()],A.prototype,"evaluatedRequiredExpression",null),e([a()],A.prototype,"evaluatedVisibilityExpression",null),e([a()],A.prototype,"evaluatedValueExpression",null),e([a()],A.prototype,"feature",void 0),e([a()],A.prototype,"field",void 0),e([a()],A.prototype,"fieldElement",void 0),e([a()],A.prototype,"initialFeature",null),e([a()],A.prototype,"layer",void 0),e([a({aliasOf:"fieldElement.description"})],A.prototype,"description",void 0),e([a()],A.prototype,"domain",null),e([a()],A.prototype,"editable",null),e([a({aliasOf:"fieldElement.input.type"})],A.prototype,"inputType",void 0),e([a({readOnly:!0})],A.prototype,"error",void 0),e([a({dependsOn:["error","messages","value"]})],A.prototype,"errorMessage",null),e([a()],A.prototype,"group",void 0),e([a({aliasOf:"fieldElement.hint"})],A.prototype,"hint",void 0),e([a()],A.prototype,"includeTime",null),e([a()],A.prototype,"label",null),e([a()],A.prototype,"maxLength",null),e([a()],A.prototype,"minLength",null),e([a()],A.prototype,"messages",void 0),e([a({aliasOf:"field.name"})],A.prototype,"name",void 0),e([a()],A.prototype,"required",null),e([a()],A.prototype,"submittable",null),e([a()],A.prototype,"type",null),e([a()],A.prototype,"valid",null),e([a({value:null})],A.prototype,"value",null),e([a()],A.prototype,"visible",null),A=e([u("esri.widgets.FeatureForm.InputField")],A);const N=A;export{N as default};