@arcgis/core 4.24.0-next.20220429 → 4.24.0-next.20220430

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.
Files changed (52) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{3a43a2918b44781aaf85.js → 055a0ebf22a82f859474.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{3273b6be43eeb49ee842.js → 0b12ff7b2ed2838afbb8.js} +1 -1
  4. package/assets/esri/core/workers/chunks/0e25548573baf855e394.js +1 -0
  5. package/assets/esri/core/workers/chunks/{c388ac33496f004d56f3.js → 135a90ae61f3b3cae91b.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{54f9b1ab9d472bf4baca.js → 1facbda248863cf72cbd.js} +1 -1
  7. package/assets/esri/core/workers/chunks/2133499e642193f6738f.js +1 -0
  8. package/assets/esri/core/workers/chunks/{3c572629f46e5093223c.js → 30333a95dc0a44e23fb5.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{7afe89eafab00afb31f2.js → 30837d93116f0337972f.js} +1 -1
  10. package/assets/esri/core/workers/chunks/31df729c17470245288c.js +2 -0
  11. package/assets/esri/core/workers/chunks/{c0bf663240df7be68131.js.LICENSE.txt → 31df729c17470245288c.js.LICENSE.txt} +1 -1
  12. package/assets/esri/core/workers/chunks/{e5d6f3815ecab8560404.js → 4130ea1f5a9f197168d7.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{f5855075104c12bf71d8.js → 59e341b2db44351bf557.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{73630d52768e3d932f30.js → 5a10b58533b4116115ac.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{dc193247a1980360ec4f.js → 8e98ff9404a802352037.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{863cfe35ee640bac103f.js → 94e51fe1c539df6257c2.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{cbe7e6283a427a618d4b.js → 9519a02b9b8db88a3150.js} +1 -1
  18. package/assets/esri/core/workers/chunks/a59ee7d2b98c85f27dd2.js +1 -0
  19. package/assets/esri/core/workers/chunks/{92ef9b0c61640e0ecbb4.js → a5dbab94697757c87c49.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{147d3ee9aa81d7b2b7fa.js → a6406a248b7b2ed65f35.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{ebdf61eb364ac0856f40.js → acbd0f4d72d1f5d8e4e8.js} +1 -1
  22. package/assets/esri/core/workers/chunks/ad68fe924456d6d7d4f0.js +1 -0
  23. package/assets/esri/core/workers/chunks/b06c949fc7d08e376a5f.js +1 -0
  24. package/assets/esri/core/workers/chunks/c9b09099488d0e719dfb.js +1 -0
  25. package/assets/esri/core/workers/chunks/{4a05d0dfa73ff570e1fa.js → d15e6662d90718411d62.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{b74b9dceabbf7b1aec39.js → d16aac3461af9cee0c29.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{b9d9be39cd64f28dd478.js → d60dd3e1028f714f2258.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{cab6decfcb3f596a3837.js → d8c59b1d73650c060dfb.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{d24339b37cc9316e6d99.js → dcb6e1b33402d7fa455b.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{a8da24116180d708cf81.js → df653bca2b14dffc82d1.js} +1 -1
  31. package/chunks/index.js +1 -1
  32. package/config.js +1 -1
  33. package/interfaces.d.ts +8 -0
  34. package/layers/mixins/PortalLayer.js +1 -1
  35. package/package.json +2 -2
  36. package/request.js +1 -1
  37. package/support/revision.js +1 -1
  38. package/views/2d/engine/vectorTiles/TileParser.js +1 -1
  39. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  40. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  41. package/views/3d/terrain/PatchRenderData.js +1 -1
  42. package/views/3d/terrain/TerrainSurface.js +1 -1
  43. package/views/3d/terrain/Tile.js +1 -1
  44. package/widgets/FeatureTable/Grid/Grid.js +2 -2
  45. package/widgets/Sketch/SketchViewModel.js +1 -1
  46. package/assets/esri/core/workers/chunks/3f6b17c9d2629ed396da.js +0 -1
  47. package/assets/esri/core/workers/chunks/68d57660c7c71b82ff3c.js +0 -1
  48. package/assets/esri/core/workers/chunks/6ef8de3aa9a8d9c22161.js +0 -1
  49. package/assets/esri/core/workers/chunks/b548bf032c8af34fe155.js +0 -1
  50. package/assets/esri/core/workers/chunks/bbcae04235830debd814.js +0 -1
  51. package/assets/esri/core/workers/chunks/c0bf663240df7be68131.js +0 -2
  52. package/assets/esri/core/workers/chunks/cd9668acbe3babd2b188.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3974,4889],{78346:(e,t,r)=>{r.d(t,{bA:()=>U});var n=r(20102),o=r(80442),s=r(95330),i=r(80903),a=r(25045),l=r(40330),u=r(92604),p=r(94362),c=r(99880),d=r(68773),f=(r(2587),r(17452));const y={};function m(e){var t;const r={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(r.async=!0),e.hasOwnProperty("isDebug")||(r.isDebug=!1),e.baseUrl||(r.baseUrl=y.baseUrl),null==(t=y.packages)||t.forEach((e=>{!function(e,t){for(const r of e)if(r.name===t.name)return;e.push(t)}(r.packages,e)})),r}var h=r(41213);class g{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r)}))}}class w{constructor(){this._dispatcher=new g,this._workerPostMessage({type:p.Cs.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,h.Y)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,h.Y)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,p.QM)(e);if(t&&t.type===p.Cs.OPEN){const{modulePath:e,jobId:r}=t;let n=await a.default.loadWorker(e);n||(n=await import(e));const o=a.default.connect(n);this._workerPostMessage({type:p.Cs.OPENED,jobId:r,data:o})}}}var b=r(70171),v=r(17202);const S=u.Z.getLogger("esri.core.workers"),{HANDSHAKE:C}=p.Cs;let x,_;const P="Failed to create Worker. Fallback to execute module in main thread";async function E(e){return new Promise((t=>{function r(o){const s=(0,p.QM)(o);s&&s.type===C&&(e.removeEventListener("message",r),e.removeEventListener("error",n),t(e))}function n(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",n),S.warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new w).addEventListener("message",r),e.addEventListener("error",n)}e.addEventListener("message",r),e.addEventListener("error",n)}))}let F=0;const I=u.Z.getLogger("esri.core.workers"),{ABORT:k,INVOKE:O,OPEN:R,OPENED:N,RESPONSE:L}=p.Cs;class j{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),I.error(e)}))}static async create(e){const t=await async function(){if(!(0,o.Z)("esri-workers")||((0,o.Z)("mozilla"),0))return E(new w);if(!x&&!_)try{const e='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,buildDate:r,version:t}=configuration.kernelInfo,{revision:n,buildDate:i,version:s}=e.kernelInfo;o!==n&&console.warn(`[esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:\\nAPI version: ${t} [Date: ${r}, Revision: ${o.slice(0,8)}]\nAssets version: ${s} [Date: ${i}, Revision: ${n.slice(0,8)}]`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let e;function t(o){const t=e.connect(o);self.postMessage({type:2,jobId:r,data:t},[t])}"function"==typeof define&&define.amd?require([workerPath],(r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((r=>(e=r.default,checkWorkerRevision(e),e.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),e=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(e),e.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const e=outgoing.get(r);outgoing.delete(r),o.error?e.reject(JSON.parse(o.error)):e.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.replace('"{CONFIGURATION}"',`'${function(){let e;if(null!=d.Z.default){const t={...d.Z};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(d.Z));e.assetsPath=(0,f.hF)(e.assetsPath),e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,b.Kd)(),e.has={"esri-csp-restrictions":(0,o.Z)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,o.Z)("esri-2d-update-debug"),"esri-2d-query-centroid-enabled":(0,o.Z)("esri-2d-query-centroid-enabled"),"featurelayer-pbf":(0,o.Z)("featurelayer-pbf"),"featurelayer-simplify-thresholds":(0,o.Z)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,o.Z)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,o.Z)("featurelayer-simplify-mobile-factor"),"esri-atomics":(0,o.Z)("esri-atomics"),"esri-shared-array-buffer":(0,o.Z)("esri-shared-array-buffer"),"esri-tiles-debug":(0,o.Z)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,o.Z)("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":(0,o.Z)("feature-polyline-generalization-factor"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,f.hF)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,f.hF)(e.workers.workerPath):e.workers.workerPath=(0,f.hF)((0,c.V)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=d.Z.workers.loaderConfig,r=m({baseUrl:null==t?void 0:t.baseUrl,locale:(0,b.Kd)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...null==t?void 0:t.has},map:{...null==t?void 0:t.map},paths:{...null==t?void 0:t.paths},packages:(null==t?void 0:t.packages)||[]}),n={version:l.i8,buildDate:v.r,revision:v.$};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:n})}()}'`);x=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){_=e||{}}let e;if(x)try{e=new Worker(x,{name:"esri-worker-"+F++})}catch(t){S.warn(P,_),e=new w}else S.warn(P,_),e=new w;return E(e)}();return new j(t,e)}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,n=(0,p.jt)();return new Promise(((t,o)=>{const i={resolve:t,reject:o,abortHandle:(0,s.$F)(r,(()=>{this._outJobs.delete(n),this._post({type:k,jobId:n})}))};this._outJobs.set(n,i),this._post({type:R,jobId:n,modulePath:e})}))}_onMessage(e){const t=(0,p.QM)(e);if(t)switch(t.type){case N:this._onOpenedMessage(t);break;case L:this._onResponseMessage(t);break;case k:this._onAbortMessage(t);break;case O:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);n&&(n.controller&&n.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,i=o?new AbortController:null,a=this._inJobs,u=l.Nv[t];let c;try{if("function"!=typeof u)throw new TypeError(`${t} is not a function`);c=u.call(null,n,{signal:i?i.signal:null})}catch(e){return void this._post({type:L,jobId:r,error:(0,p.AB)(e)})}(0,s.y8)(c)?(a.set(r,{controller:i,promise:c}),c.then((e=>{a.has(r)&&(a.delete(r),this._post({type:L,jobId:r},e))}),(e=>{a.has(r)&&(a.delete(r),e||(e={message:"Error encountered at method"+t}),(0,s.D_)(e)||this._post({type:L,jobId:r,error:(0,p.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:L,jobId:r},c)}_onOpenedMessage(e){var t;const{jobId:r,data:n}=e,o=this._outJobs.get(r);o&&(this._outJobs.delete(r),null==(t=o.abortHandle)||t.remove(),o.resolve(n))}_onResponseMessage(e){var t;const{jobId:r,error:o,data:s}=e,i=this._outJobs.get(r);i&&(this._outJobs.delete(r),null==(t=i.abortHandle)||t.remove(),o?i.reject(n.Z.fromJSON(JSON.parse(o))):i.resolve(s))}_post(e,t,r){return(0,p.oi)(this.worker,e,t,r)}}let T=(0,o.Z)("esri-workers-debug")?1:(0,o.Z)("host-browser")?navigator.hardwareConcurrency-1:0;T||(T=(0,o.Z)("safari")&&(0,o.Z)("mac")||(0,o.Z)("trident")?7:2);let Z=0;const A=[];async function D(e,t){const r=new i.Z;return await r.open(e,t),r}async function U(e,t={}){if("string"!=typeof e)throw new n.Z("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,o.Z)("host-webworker")&&!(0,o.Z)("esri-workers")&&(r="local"),"local"===r){let r=await a.default.loadWorker(e);r||(r=await import(e)),(0,s.k_)(t.signal);const n=t.client||r;return D([a.default.connect(r)],{...t,client:n})}if(await async function(){if($)return $;M=new AbortController;const e=[];for(let t=0;t<T;t++){const r=j.create(t).then((e=>(A[t]=e,e)));e.push(r)}return $=Promise.all(e),$}(),(0,s.k_)(t.signal),"dedicated"===r){const r=Z++%T;return D([await A[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,T);if(r<T){const n=new Array(r);for(let o=0;o<r;++o){const r=Z++%T;n[o]=A[r].open(e,t)}return D(n,t)}}return D(A.map((r=>r.open(e,t))),t)}let M,$=null},2587:(e,t,r)=>{r(90344),r(18848),r(940),r(70171);var n=r(94443),o=r(3172),s=r(20102),i=r(70586);async function a(e){if((0,i.pC)(u.fetchBundleAsset))return u.fetchBundleAsset(e);const t=await(0,o.default)(e,{responseType:"text"});return JSON.parse(t.data)}class l{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let n;n="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,o){const i=t.exec(r);if(!i)throw new s.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=i[1]?`${i[1]}/`:"",u=i[2],p=(0,n.Su)(o),c=`${l}${u}.json`,d=p?`${l}${u}_${p}.json`:c;let f;try{f=await a(e(d))}catch(t){if(d===c)throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{f=await a(e(c))}catch(e){throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return f}(this.getAssetUrl,this.matcher,e,t)}}const u={};var p,c=r(99880);(0,n.tz)((p={pattern:"esri/",location:c.V},new l(p)))},940:(e,t,r)=>{r.d(t,{n:()=>u});var n=r(92604),o=r(78286),s=r(19153),i=r(90344),a=r(18848);const l=n.Z.getLogger("esri.intl");function u(e,t,r={}){const{format:n={}}=r;return(0,s.gx)(e,(e=>function(e,t,r){let n,s;const i=e.indexOf(":");if(-1===i?n=e.trim():(n=e.slice(0,i).trim(),s=e.slice(i+1).trim()),!n)return"";const a=(0,o.hS)(n,t);if(null==a)return"";const l=r[s]||r[n];return l?p(a,l):s?c(a,s):d(a)}(e,t,n)))}function p(e,t){switch(t.type){case"date":return(0,i.p6)(e,t.intlOptions);case"number":return(0,a.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),d(e)}}function c(e,t){switch(t.toLowerCase()){case"dateformat":return(0,i.p6)(e);case"numberformat":return(0,a.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,i.p6)(e):/^numberformat/i.test(t)?(0,a.uf)(e):d(e)}}function d(e){switch(typeof e){case"string":return e;case"number":return(0,a.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,i.p6)(e):""}}},12653:(e,t,r)=>{r.r(t),r.d(t,{default:()=>V});var n=r(43697),o=(r(66577),r(51773)),s=(r(16050),r(12501),r(95088),r(79056),r(5499),r(84382),r(30687),r(91423),r(32400)),i=r(70586),a=r(16453),l=r(78286),u=r(17452),p=r(5600),c=(r(67676),r(80442)),d=r(75215),f=r(52011),y=r(30556),m=r(86973),h=r(29600),g=r(20102),w=r(3920),b=r(83379),v=r(95330),S=r(78346),C=r(25278),x=r(51432),_=r(74889),P=r(6570);let E=class extends((0,w.p)(b.Z)){constructor(){super(...arguments),this.capabilities=(0,C.MS)(!1,!1),this.type="wfs",this.refresh=(0,v.Ds)((async e=>{await this.load();const{extent:t}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}}))}load(e){var t;const r=null!=(t=(0,i.pC)(e)&&e.signal)?t:null;return this.addResolvingPromise(this._startWorker({signal:r})),Promise.resolve(this)}destroy(){var e;null==(e=this._connection)||e.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return _.default.fromJSON(r)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const r=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:r.count,extent:P.Z.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _createLoadOptions(e){const{url:t,customParameters:r,name:n,namespaceUri:o,spatialReference:s,fields:a,geometryType:l,swapXY:u}=this.layer;if(!t)throw new g.Z("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await(0,x.FU)(t,{customParameters:r,...e}));const p=["fields","geometryType","name","namespaceUri","spatialReference","swapXY"].some((e=>null==this.layer[e])),c=p?await(0,x.be)(this.wfsCapabilities,n,o,{spatialReference:s,customParameters:r,signal:null==e?void 0:e.signal}):{...(0,x.eB)(a),geometryType:l,name:n,namespaceUri:o,spatialReference:s,swapXY:u},d=(0,i.Wg)((0,x.ft)(this.wfsCapabilities.readFeatureTypes(),c.name,c.namespaceUri)),f=m.Mk.toJSON(c.geometryType);return{customParameters:r,featureType:d,fields:c.fields.map((e=>e.toJSON())),geometryField:c.geometryField,geometryType:f,getFeatureUrl:this.wfsCapabilities.operations.GetFeature.url,getFeatureOutputFormat:this.wfsCapabilities.operations.GetFeature.outputFormat,objectIdField:c.objectIdField,spatialReference:c.spatialReference.toJSON(),swapXY:c.swapXY}}async _startWorker(e){const[t,r]=await(0,v.as)([this._createLoadOptions(e),(0,S.bA)("WFSSourceWorker",{...e,strategy:(0,c.Z)("feature-layers-workers")?"dedicated":"local"})]),n=t.error||r.error||null,o=r.value||null;if(n)throw o&&o.close(),n;const s=t.value;this._connection=r.value;const{extent:i}=await this._connection.invoke("load",s,e);this.sourceJSON={extent:i,fields:s.fields,geometryType:s.geometryType,objectIdField:s.objectIdField,geometryField:s.geometryField,drawingInfo:(0,C.bU)(s.geometryType),name:s.featureType.title,wfsInfo:{name:s.featureType.name,featureUrl:s.getFeatureUrl,maxFeatures:3e3,swapXY:s.swapXY,supportedSpatialReferences:s.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:s.featureType.namespaceUri}}}};(0,n._)([(0,p.Cb)()],E.prototype,"capabilities",void 0),(0,n._)([(0,p.Cb)({constructOnly:!0})],E.prototype,"layer",void 0),(0,n._)([(0,p.Cb)()],E.prototype,"sourceJSON",void 0),(0,n._)([(0,p.Cb)()],E.prototype,"type",void 0),(0,n._)([(0,p.Cb)()],E.prototype,"wfsCapabilities",void 0),E=(0,n._)([(0,f.j)("esri.layers.graphics.sources.WFSSource")],E);var F,I=r(71612),k=r(17017),O=r(69637),R=r(38009),N=r(68825),L=r(16859),j=r(34760),T=r(72965),Z=r(28294),A=r(21506),D=r(55785),U=r(1231),M=r(53518),$=r(35671),q=r(2319),G=r(30707),J=r(57444),W=r(32163),H=r(82971);const B=(0,M.v)();let z=F=class extends((0,N.c)((0,k.N)((0,O.b)((0,I.h)((0,Z.n)((0,j.Q)((0,T.M)((0,R.q)((0,L.I)((0,a.R)(h.Z))))))))))){constructor(e){super(e),this.capabilities=null,this.copyright=null,this.customParameters=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureReduction=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxFeatures=3e3,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new E({layer:this}),this.spatialReference=H.Z.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}static fromWFSLayerInfo(e){const{customParameters:t,fields:r,geometryField:n,geometryType:o,name:s,namespaceUri:i,objectIdField:a,spatialReference:l,swapXY:u,url:p,wfsCapabilities:c}=e;return new F({customParameters:t,fields:r,geometryField:n,geometryType:o,name:s,namespaceUri:i,objectIdField:a,spatialReference:l,swapXY:u,url:p,wfsCapabilities:c})}destroy(){var e;null==(e=this.source)||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),(0,$.YN)(this.renderer,this.fieldsIndex),(0,$.UF)(this.timeInfo,this.fieldsIndex)}))),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,r){const n=e.filter((e=>e.name!==x.M8));this.geometryField&&n.unshift(new U.Z({name:this.geometryField,alias:this.geometryField,type:"geometry"})),(0,l.RB)(r,n.map((e=>e.toJSON())),t)}get parsedUrl(){return this.url?(0,u.mN)(this.url):null}set renderer(e){(0,$.YN)(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return(0,W.eZ)(this,e)}createQuery(){const e=new J.Z;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:t,timeExtent:r}=this;return e.timeExtent=null!=t&&null!=r?r.offset(-t.value,t.unit):r||null,e}getFieldDomain(e,t){var r;return null==(r=this.getField(e))?void 0:r.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(J.Z.from(e)||this.createQuery(),t))).then((e=>{if(null!=e&&e.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>this.source.queryObjectIds(J.Z.from(e)||this.createQuery(),t)))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(J.Z.from(e)||this.createQuery(),t)))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(J.Z.from(e)||this.createQuery(),t)))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return(0,i.pC)(t)&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};(0,n._)([(0,p.Cb)({readOnly:!0,aliasOf:"source.capabilities"})],z.prototype,"capabilities",void 0),(0,n._)([(0,p.Cb)({type:String})],z.prototype,"copyright",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],z.prototype,"createQueryVersion",null),(0,n._)([(0,p.Cb)({json:{name:"wfsInfo.customParameters",write:{ignoreOrigin:!0}}})],z.prototype,"customParameters",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),(0,n._)([(0,p.Cb)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],z.prototype,"definitionExpression",void 0),(0,n._)([(0,p.Cb)({type:String})],z.prototype,"displayField",void 0),(0,n._)([(0,p.Cb)(A.PV)],z.prototype,"elevationInfo",void 0),(0,n._)([(0,p.Cb)(D.d)],z.prototype,"featureReduction",void 0),(0,n._)([(0,p.Cb)({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"featureUrl",void 0),(0,n._)([(0,p.Cb)({type:[U.Z],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],z.prototype,"fields",void 0),(0,n._)([(0,y.c)("fields")],z.prototype,"writeFields",null),(0,n._)([(0,p.Cb)(B.fieldsIndex)],z.prototype,"fieldsIndex",void 0),(0,n._)([(0,p.Cb)({type:P.Z,json:{name:"extent"}})],z.prototype,"fullExtent",void 0),(0,n._)([(0,p.Cb)()],z.prototype,"geometryField",void 0),(0,n._)([(0,p.Cb)({type:String,json:{read:{source:"layerDefinition.geometryType",reader:m.Mk.read},write:{target:"layerDefinition.geometryType",writer:m.Mk.write,ignoreOrigin:!0},origins:{service:{read:m.Mk.read}}}})],z.prototype,"geometryType",void 0),(0,n._)([(0,p.Cb)({type:String})],z.prototype,"id",void 0),(0,n._)([(0,p.Cb)(A.iR)],z.prototype,"labelsVisible",void 0),(0,n._)([(0,p.Cb)({type:[q.Z],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:G.r},write:!0}})],z.prototype,"labelingInfo",void 0),(0,n._)([(0,p.Cb)(A.rn)],z.prototype,"legendEnabled",void 0),(0,n._)([(0,p.Cb)({type:["show","hide"]})],z.prototype,"listMode",void 0),(0,n._)([(0,p.Cb)({type:String})],z.prototype,"objectIdField",void 0),(0,n._)([(0,p.Cb)({type:["WFS"]})],z.prototype,"operationalLayerType",void 0),(0,n._)([(0,p.Cb)({type:d.z8,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"maxFeatures",void 0),(0,n._)([(0,p.Cb)({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],z.prototype,"mode",void 0),(0,n._)([(0,p.Cb)({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"name",void 0),(0,n._)([(0,p.Cb)({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"namespaceUri",void 0),(0,n._)([(0,p.Cb)(A.bT)],z.prototype,"opacity",void 0),(0,n._)([(0,p.Cb)(B.outFields)],z.prototype,"outFields",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],z.prototype,"parsedUrl",null),(0,n._)([(0,p.Cb)(A.C_)],z.prototype,"popupEnabled",void 0),(0,n._)([(0,p.Cb)({type:o.Z,json:{name:"popupInfo",write:!0}})],z.prototype,"popupTemplate",void 0),(0,n._)([(0,p.Cb)({types:s.A,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:s.o,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],z.prototype,"renderer",null),(0,n._)([(0,p.Cb)(A.YI)],z.prototype,"screenSizePerspectiveEnabled",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],z.prototype,"source",void 0),(0,n._)([(0,p.Cb)({type:H.Z,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],z.prototype,"spatialReference",void 0),(0,n._)([(0,p.Cb)({readOnly:!0,type:[d.z8],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"spatialReferences",void 0),(0,n._)([(0,p.Cb)({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"swapXY",void 0),(0,n._)([(0,p.Cb)({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],z.prototype,"title",void 0),(0,n._)([(0,p.Cb)({json:{read:!1},readOnly:!0})],z.prototype,"type",void 0),(0,n._)([(0,p.Cb)(A.HQ)],z.prototype,"url",void 0),(0,n._)([(0,p.Cb)({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"version",void 0),(0,n._)([(0,p.Cb)({aliasOf:"source.wfsCapabilities"})],z.prototype,"wfsCapabilities",void 0),z=F=(0,n._)([(0,f.j)("esri.layers.WFSLayer")],z);const V=z},61159:(e,t,r)=>{r.d(t,{g:()=>n});const n={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},92722:(e,t,r)=>{r.d(t,{O3:()=>S,lG:()=>x,my:()=>C,q9:()=>l});var n=r(20102),o=r(70272),s=r(5428),i=r(35671);const a={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function l(e){return a[e]}function*u(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*p(e){if(!e)return null;switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function c(e){for(const t of e)if(t.length>2)return!0;return!1}function d(e){let t=0;for(let r=0;r<e.length;r++){const n=e[r],o=e[(r+1)%e.length];t+=n[0]*o[1]-o[0]*n[1]}return t<=0}function f(e){const t=e[0],r=e[e.length-1];return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]||e.push(t),e}function y(e,t,r){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,r){return g(e,t.coordinates,r),e}(e,t,r);case"MultiLineString":return function(e,t,r){for(const n of t.coordinates)g(e,n,r);return e}(e,t,r);case"MultiPolygon":return function(e,t,r){for(const n of t.coordinates){m(e,n[0],r);for(let t=1;t<n.length;t++)h(e,n[t],r)}return e}(e,t,r);case"Point":return function(e,t,r){return b(e,t.coordinates,r),e}(e,t,r);case"Polygon":return function(e,t,r){const n=t.coordinates;m(e,n[0],r);for(let t=1;t<n.length;t++)h(e,n[t],r);return e}(e,t,r)}}function m(e,t,r){const n=f(t);!function(e){return!d(e)}(n)?g(e,n,r):w(e,n,r)}function h(e,t,r){const n=f(t);!function(e){return d(e)}(n)?g(e,n,r):w(e,n,r)}function g(e,t,r){for(const n of t)b(e,n,r);e.lengths.push(t.length)}function w(e,t,r){for(let n=t.length-1;n>=0;n--)b(e,t[n],r);e.lengths.push(t.length)}function b(e,t,r){const[n,o,s]=t;e.coords.push(n,o),r.hasZ&&e.coords.push(s||0)}function v(e){switch(typeof e){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function S(e){if(!e)throw new n.Z("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new n.Z("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:t}=e;if(!t)return;const r="string"==typeof t?t:"name"===t.type?t.properties.name:"EPSG"===t.type?t.properties.code:null,o=new RegExp(".*(CRS84H?|4326)$","i");if(!r||!o.test(r))throw new n.Z("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:t})}function C(e,t={}){const r=[],n=new Set,o=new Set;let s,a=!1,d=null,f=!1,{geometryType:y=null}=t,m=!1;for(const t of u(e)){const{geometry:e,properties:i,id:u}=t;if((!e||(y||(y=l(e.type)),l(e.type)===y))&&(a||(a=c(p(e))),f||(f=null!=u,f&&(s=typeof u,d=Object.keys(i).filter((e=>i[e]===u)))),f&&null!=u&&(d.length>1?d=d.filter((e=>i[e]===u)):1===d.length&&(d=i[d[0]]===u?d:[])),!m&&i)){let e=!0;for(const t in i){if(n.has(t))continue;const s=i[t];if(null==s){e=!1,o.add(t);continue}const a=v(s);"unknown"!==a?(o.delete(t),n.add(t),r.push({name:t,alias:t,type:a})):o.add(t)}m=e}}const h=d&&1===d.length&&d[0]||null;if(h)for(const e of r)if(e.name===h&&(0,i.H7)(e)){e.type="esriFieldTypeOID";break}return{fields:r,geometryType:y,hasZ:a,objectIdFieldName:h,objectIdFieldType:s,unknownFields:Array.from(o)}}function x(e,t){return Array.from(function*(e,t={}){const{geometryType:r,objectIdField:n}=t;for(const a of e){var i;const{geometry:e,properties:u,id:p}=a;if(e&&l(e.type)!==r)continue;const c=u||{};let d=null!=(i=c[n])?i:null;n&&null!=p&&!c[n]&&(c[n]=d=p);const f=new o.u_(e?y(new s.Z,e,t):null,c,null,d);yield f}}(u(e),t))}},25278:(e,t,r)=>{r.d(t,{Dm:()=>p,Hq:()=>c,MS:()=>d,bU:()=>a});var n=r(80442),o=r(22974),s=r(61159),i=r(58333);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?i.I4:"esriGeometryPolyline"===e?i.ET:i.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function p(e,t){if((0,n.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this.${t} = null;`;for(const t in e)r+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const n=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new n}catch(r){return()=>({[t]:null,...e})}}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,o.d9)(e)}}]}function d(e,t){return{attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0},query:s.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1}}}},17017:(e,t,r)=>{r.d(t,{N:()=>i});var n=r(43697),o=r(5600),s=(r(67676),r(80442),r(75215),r(52011));const i=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,n._)([(0,o.Cb)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,n._)([(0,s.j)("esri.layers.mixins.CustomParametersMixin")],t),t}},68825:(e,t,r)=>{r.d(t,{c:()=>m});var n,o=r(43697),s=r(78286),i=r(5600),a=(r(67676),r(80442),r(75215),r(52011)),l=r(35454),u=r(96674);const p=new l.X({asc:"ascending",desc:"descending"});let c=n=class extends u.wq{constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new n({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,o._)([(0,i.Cb)({type:String,json:{write:!0}})],c.prototype,"field",void 0),(0,o._)([(0,i.Cb)({type:String,json:{write:!0}})],c.prototype,"valueExpression",void 0),(0,o._)([(0,i.Cb)({type:p.apiValues,json:{read:p.read,write:p.write}})],c.prototype,"order",void 0),c=n=(0,o._)([(0,a.j)("esri.layers.support.OrderByInfo")],c);const d=c;function f(e,t,r){if(!e)return null;const n=e.find((e=>!!e.field));if(!n)return null;const o=new d;return o.read(n,r),[o]}function y(e,t,r,n){const o=e.find((e=>!!e.field));o&&(0,s.RB)(r,[o.toJSON()],t)}const m=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,o._)([(0,i.Cb)({type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:f},write:{target:"layerDefinition.orderBy",writer:y}}})],t.prototype,"orderBy",void 0),t=(0,o._)([(0,a.j)("esri.layers.mixins.OrderedLayer")],t),t}},16859:(e,t,r)=>{r.d(t,{I:()=>v});var n=r(43697),o=r(40330),s=r(3172),i=r(66643),a=r(20102),l=r(92604),u=r(70586),p=r(95330),c=r(17452),d=r(5600),f=(r(67676),r(80442),r(75215),r(71715)),y=r(52011),m=r(30556),h=r(65587),g=r(15235),w=r(86082);const b=l.Z.getLogger("esri.layers.mixins.PortalLayer"),v=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new g.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const n=await r.e(8062).then(r.bind(r,18062));return(0,p.k_)(t),await n.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||b.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==o.id?void 0:o.id.findCredential(this.url):null;if(!t)return!0;const r=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.user=r,(0,u.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,r;const n=null==(t=this.portalItem)||null==(r=t.portal)?void 0:r.user;if(n)return n;const a=o.id.findServerInfo(this.url);if(null==a||!a.owningSystemUrl)return null;const l=`${a.owningSystemUrl}/sharing/rest`,p=h.Z.getDefault();if(p&&p.loaded&&(0,c.Fv)(p.restUrl)===(0,c.Fv)(l))return p.user;const d=`${l}/community/self`,f=(0,u.pC)(e)?e.signal:null,y=await(0,i.q6)((0,s.default)(d,{authMode:"no-prompt",query:{f:"json"},signal:f}));return y.ok?w.default.fromJSON(y.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,n=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||h.Z.getDefault());return r&&n&&!(0,c.tm)(n.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save the scene, set the layer.portalItem to null or save the scene to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,n._)([(0,d.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,n._)([(0,f.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,n._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,n._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,n._)([(0,d.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,n._)([(0,y.j)("esri.layers.mixins.PortalLayer")],t),t},S={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>g});var n=r(43697),o=r(92604),s=r(95330),i=r(5600),a=(r(67676),r(80442),r(75215),r(52011)),l=r(80539),u=(r(26258),r(87538));const p=new l.Z,c=new WeakMap;function d(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function f(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:f(t,e%t):0}let y=0,m=0;function h(){const e=Date.now();for(const r of p)if(r.refreshInterval){var t;e-(null!=(t=c.get(r))?t:0)+5>=6e4*r.refreshInterval&&(c.set(r,e),r.refresh(e))}}(0,u.EH)((()=>{const e=Date.now();let t=0;for(const r of p)t=f(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?c.get(r)||c.set(r,e):c.delete(r);if(t!==m){if(m=t,clearInterval(y),0===m)return void(y=0);y=setInterval(h,m)}}));const g=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,s.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){d(e)&&p.push(e)}(this)}),(()=>{}))}destroy(){var e;d(e=this)&&p.includes(e)&&p.remove(e)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,s.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{o.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,n._)([(0,i.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,n._)([(0,i.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,n._)([(0,i.Cb)()],t.prototype,"refreshParameters",null),t=(0,n._)([(0,a.j)("esri.layers.mixins.RefreshableLayer")],t),t}},51432:(e,t,r)=>{r.d(t,{M8:()=>C,ft:()=>I,FU:()=>P,Bm:()=>j,be:()=>k,eB:()=>O}),r(66577);var n=r(3172),o=r(20102),s=r(66374),i=r(70586),a=r(95330),l=r(17452),u=r(44547),p=r(8744),c=r(86973),d=r(92722);function f(e){var t;return null!=(t=y(e))?t:function(e){const t=new Date(e).getTime();return Number.isNaN(t)?null:t}(e)}function y(e){var t,r,n,o;const s=m.exec(e);if(!s)return null;const i=s.groups,a=+i.year,l=+i.month-1,u=+i.day,p=+(null!=(t=i.hours)?t:"0"),c=+(null!=(r=i.minutes)?r:"0"),d=+(null!=(n=i.seconds)?n:"0");if(p>23)return null;if(c>59)return null;if(d>59)return null;const f=null!=(o=i.ms)?o:"0",y=f?+f.padEnd(3,"0").substring(0,3):0;let h;if(i.isUTC)h=Date.UTC(a,l,u,p,c,d,y);else if(i.offsetSign){const e=+i.offsetHours,t=+i.offsetMinutes;h=6e4*("+"===i.offsetSign?-1:1)*(60*e+t)+Date.UTC(a,l,u,p,c,d,y)}else h=new Date(a,l,u,p,c,d,y).getTime();return Number.isNaN(h)?null:h}const m=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/;var h=r(88724),g=r(1231),w=r(82971),b=r(6570);const v="xlink:href",S="2.0.0",C="__esri_wfs_id__",x="wfs-layer:feature-type-not-found",_="wfs-layer:unknown-geometry-type";async function P(e,t){const r=function(e){const t=Z(e);(function(e){const t=e.firstElementChild.getAttribute("version");if(t&&t!==S)throw new o.Z("wfs-layer:unsupported-wfs-version",`Unsupported WFS version ${t}. Supported version: ${S}`)})(t),D(t);const r=t.firstElementChild,n=(0,s.Fs)(function(e){return(0,h.H)(e,{FeatureTypeList:{FeatureType:e=>{const t={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",supportedSpatialReferences:[]},r=new Set([4326]),n=e=>{var t,n;const o=parseInt(null==(t=e.textContent.match(/(?<wkid>\d+$)/i))||null==(n=t.groups)?void 0:n.wkid,10);Number.isNaN(o)||r.add(o)};return(0,h.h)(e,{Name:e=>{const{name:r,prefix:n}=A(e.textContent);t.typeName=`${n}:${r}`,t.name=r,t.namespacePrefix=n,t.namespaceUri=e.lookupNamespaceURI(n)},Abstract:e=>{t.description=e.textContent},Title:e=>{t.title=e.textContent},WGS84BoundingBox:e=>{t.extent=function(e){let t,r,n,o;for(const s of e.children)switch(s.localName){case"LowerCorner":[t,r]=s.textContent.split(" ").map((e=>Number.parseFloat(e)));break;case"UpperCorner":[n,o]=s.textContent.split(" ").map((e=>Number.parseFloat(e)))}return{xmin:t,ymin:r,xmax:n,ymax:o,spatialReference:p.Zn}}(e)},DefaultSRS:n,DefaultCRS:n,OtherSRS:n,OtherCRS:n}),t.title||(t.title=t.name),t.supportedSpatialReferences.push(...r),t}}})}(r));return{operations:F(r),get featureTypes(){return Array.from(n())},readFeatureTypes:n}}((await(0,n.default)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:S,...null==t?void 0:t.customParameters},signal:null==t?void 0:t.signal})).data);return function(e,t){(0,l.$U)(e)&&((0,l.D6)(e,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=(0,l.hO)(t.operations.DescribeFeatureType.url)),(0,l.D6)(e,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=(0,l.hO)(t.operations.GetFeature.url)))}(e,r),r}const E=new Set(["json","application/json","geojson","application/json; subtype=geojson"]);function F(e){let t=!1;const r={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}};if((0,h.h)(e,{OperationsMetadata:{Operation:e=>{switch(e.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:e=>{r.GetCapabilities.url=e.getAttribute(v)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:e=>{r.DescribeFeatureType.url=e.getAttribute(v)}}}};case"GetFeature":return{DCP:{HTTP:{Get:e=>{r.GetFeature.url=e.getAttribute(v)}}},Parameter:e=>{if("outputFormat"===e.getAttribute("name"))return{AllowedValues:{Value:e=>{const t=e.textContent;E.has(t.toLowerCase())&&(r.GetFeature.outputFormat=t)}}}}}}},Constraint:e=>{switch(e.getAttribute("name")){case"KVPEncoding":return{DefaultValue:e=>{t="true"===e.textContent.toLowerCase()}};case"ImplementsResultPaging":return{DefaultValue:e=>{r.GetFeature.supportsPagination="true"===e.textContent.toLowerCase()}}}}}}),!t)throw new o.Z("wfs-layer:kvp-encoding-not-supported","WFS service doesn't support key/value pair (KVP) encoding");if((0,i.Wi)(r.GetFeature.outputFormat))throw new o.Z("wfs-layer:geojson-not-supported","WFS service doesn't support GeoJSON output format");return r}function I(e,t,r){return(0,s.sE)(e,(e=>r?e.name===t&&e.namespaceUri===r:e.typeName===t||e.name===t))}async function k(e,t,r,n={}){var s;const{featureType:l,extent:c}=await async function(e,t,r,n={}){const{spatialReference:s=w.Z.WGS84}=n,a=e.readFeatureTypes(),l=t?I(a,t,r):a.next().value;if((0,i.Wi)(l))throw t?new o.Z(x,`The type '${t}' could not be found in the service`):new o.Z("wfs-layer:empty-service","The service is empty");let c=new b.Z({...l.extent,spatialReference:s});if(!(0,p.fS)(s,p.Zn))try{await(0,u.iQ)(p.Zn,s,void 0,n),c=(0,u.iV)(c,p.Zn)}catch{throw new o.Z("wfs-layer:unsupported-spatial-reference","Projection not supported")}return{extent:c,spatialReference:s,featureType:l}}(e,t,r,n),{fields:d,geometryType:f,swapXY:y,objectIdField:m,geometryField:h}=await async function(e,t,r={}){const[n,s]=await(0,a.as)([N(e.operations.DescribeFeatureType.url,t,r),R(e,t,r)]);if(n.error||s.error)throw new o.Z("wfs-layer:getWFSLayerTypeInfo-error",`An error occurred while getting info about the feature type '${t}'`,{error:n.error||s.error});const{fields:l,errors:u}=n.value,p=n.value.geometryType||s.value.geometryType,c=s.value.swapXY;if((0,i.Wi)(p))throw new o.Z(_,`The geometry type could not be determined for type '${t}`,{typeName:t,geometryType:p,fields:l,errors:u});return{...O(l),geometryType:p,swapXY:c}}(e,l.typeName,n);return{url:e.operations.GetCapabilities.url,name:l.name,namespaceUri:l.namespaceUri,fields:d,geometryField:h,geometryType:f,objectIdField:m,spatialReference:null!=(s=n.spatialReference)?s:w.Z.WGS84,extent:c,swapXY:y,wfsCapabilities:e,customParameters:n.customParameters}}function O(e){var t;const r=e.find((e=>"geometry"===e.type));let n=e.find((e=>"oid"===e.type));return e=e.filter((e=>"geometry"!==e.type)),n||(n=new g.Z({name:C,type:"oid",alias:C}),e.unshift(n)),{geometryField:null!=(t=null==r?void 0:r.name)?t:null,objectIdField:n.name,fields:e}}async function R(e,t,r={}){var o;let s,i=!1;const[a,l]=await Promise.all([j(e.operations.GetFeature.url,t,e.operations.GetFeature.outputFormat,{...r,count:1}),(0,n.default)(e.operations.GetFeature.url,{responseType:"text",query:T(t,void 0,{...r,count:1}),signal:null==r?void 0:r.signal})]),u="FeatureCollection"===a.type&&(null==(o=a.features[0])?void 0:o.geometry);if(u){let e;switch(s=c.Mk.fromJSON((0,d.q9)(u.type)),u.type){case"Point":e=u.coordinates;break;case"LineString":case"MultiPoint":e=u.coordinates[0];break;case"MultiLineString":case"Polygon":e=u.coordinates[0][0];break;case"MultiPolygon":e=u.coordinates[0][0][0]}const t=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(l.data);if(t){const r=e[0].toFixed(3),n=e[1].toFixed(3),o=parseFloat(t[1]).toFixed(3);r===parseFloat(t[2]).toFixed(3)&&n===o&&(i=!0)}}return{geometryType:s,swapXY:i}}async function N(e,t,r){return function(e,t){const{name:r}=A(e),n=Z(t);D(n);const a=(0,s.sE)((0,h.H)(n.firstElementChild,{element:e=>({name:e.getAttribute("name"),typeName:A(e.getAttribute("type")).name})}),(({name:e})=>e===r));if((0,i.pC)(a)){const e=(0,s.sE)((0,h.H)(n.firstElementChild,{complexType:e=>e}),(e=>e.getAttribute("name")===a.typeName));if((0,i.pC)(e))return function(e){var t,r;const n=[],s=[];let i;const a=(0,h.H)(e,{complexContent:{extension:{sequence:{element:e=>e}}}});for(const l of a){const a=l.getAttribute("name");if(!a)continue;let u,p;if(l.hasAttribute("type")?u=A(l.getAttribute("type")).name:(0,h.h)(l,{simpleType:{restriction:e=>(u=A(e.getAttribute("base")).name,{maxLength:e=>{p=+e.getAttribute("value")}})}}),!u)continue;const c="true"===l.getAttribute("nillable");let d=!1;switch(u.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":s.push(new g.Z({name:a,alias:a,type:"integer",nullable:c}));break;case"float":case"double":case"decimal":s.push(new g.Z({name:a,alias:a,type:"double",nullable:c}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":s.push(new g.Z({name:a,alias:a,type:"string",nullable:c,length:null!=(t=p)?t:255}));break;case"datetime":case"date":s.push(new g.Z({name:a,alias:a,type:"date",nullable:c,length:null!=(r=p)?r:36}));break;case"pointpropertytype":i="point",d=!0;break;case"multipointpropertytype":i="multipoint",d=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":i="polyline",d=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":i="polygon",d=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":d=!0,n.push(new o.Z(_,`geometry type '${u}' is not supported`,{type:(new XMLSerializer).serializeToString(e)}));break;default:n.push(new o.Z("wfs-layer:unknown-field-type",`Unknown field type '${u}'`,{type:(new XMLSerializer).serializeToString(e)}))}d&&s.push(new g.Z({name:a,alias:a,type:"geometry",nullable:c}))}for(const e of s)if("integer"===e.type&&!e.nullable&&L.has(e.name.toLowerCase())){e.type="oid";break}return{geometryType:i,fields:s,errors:n}}(e)}throw new o.Z(x,`Type '${e}' not found in document`,{document:(new XMLSerializer).serializeToString(n)})}(t,(await(0,n.default)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:S,TYPENAME:t,...null==r?void 0:r.customParameters},signal:null==r?void 0:r.signal})).data)}const L=new Set(["objectid","fid"]);async function j(e,t,r,s){let{data:i}=await(0,n.default)(e,{responseType:"text",query:T(t,r,s),signal:null==s?void 0:s.signal});i=i.replace(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{var a;if(null!=s&&null!=(a=s.dateFields)&&a.length){const e=new Set(s.dateFields);return JSON.parse(i,((t,r)=>e.has(t)?f(r):r))}return JSON.parse(i)}catch(e){throw new o.Z("wfs-layer:malformed-json","Error while parsing the response",{response:i,error:e})}}function T(e,t,r){return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:S,TYPENAMES:e,OUTPUTFORMAT:t,SRSNAME:"EPSG:4326",STARTINDEX:null==r?void 0:r.startIndex,COUNT:null==r?void 0:r.count,...null==r?void 0:r.customParameters}}function Z(e){return(new DOMParser).parseFromString(e.trim(),"text/xml")}function A(e){const[t,r]=e.split(":");return{prefix:r?t:"",name:null!=r?r:t}}function D(e){let t,r;if((0,h.h)(e.firstElementChild,{Exception:e=>(t=e.getAttribute("exceptionCode"),{ExceptionText:e=>{r=e.textContent}})}),t)throw new o.Z(`wfs-layer:${t}`,r)}},88724:(e,t,r)=>{function n(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];if("function"==typeof e){const t=e(r);t&&n(r,t)}else n(r,e)}}function*o(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];"function"==typeof e?yield e(r):yield*o(r,e)}}r.d(t,{H:()=>o,h:()=>n})},2319:(e,t,r)=>{r.d(t,{Z:()=>k});var n,o=r(43697),s=r(78223),i=r(35454),a=r(96674),l=r(22974),u=r(62357),p=r(5600),c=(r(75215),r(71715)),d=r(52011),f=r(30556),y=(r(67676),r(80442),r(8813));let m=n=class extends a.wq{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,t){return t.value?(0,y.dI)(t.value):e}writeExpression(e,t,r){null!=this.value&&(e=(0,y.dI)(this.value)),null!=e&&(t[r]=e)}clone(){return new n({expression:this.expression,title:this.title,value:this.value})}};(0,o._)([(0,p.Cb)({type:String,json:{write:{writerEnsuresNonNull:!0}}})],m.prototype,"expression",void 0),(0,o._)([(0,c.r)("expression",["expression","value"])],m.prototype,"readExpression",null),(0,o._)([(0,f.c)("expression")],m.prototype,"writeExpression",null),(0,o._)([(0,p.Cb)({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],m.prototype,"title",void 0),(0,o._)([(0,p.Cb)({json:{read:!1,write:!1}})],m.prototype,"value",void 0),m=n=(0,o._)([(0,d.j)("esri.layers.support.LabelExpressionInfo")],m);const h=m;var g=r(20256),w=r(4095),b=r(77987),v=r(78724),S=r(58333);b.Z.fromJSON(S.I4),w.Z.fromJSON(S.ET),g.Z.fromJSON(S.lF);const C=v.Z.fromJSON(S.qP);b.Z.fromJSON(S.eG),w.Z.fromJSON(S.wW),g.Z.fromJSON(S.lj);var x,_=r(21878);const P=new i.X({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function E(e){var t;return!e||"service"!==e.origin&&!("map-image"===(null==(t=e.layer)?void 0:t.type))}function F(e){var t,r;return!!function(e){return"map-image"===(null==e?void 0:e.type)}(e)&&!(null==(t=e.capabilities)||null==(r=t.exportMap)||!r.supportsArcadeExpressionForLabeling)}let I=x=class extends a.wq{constructor(e){super(e),this.type="label",this.name=null,this.allowOverrun=!1,this.deconflictionStrategy="static",this.labelExpression=null,this.labelExpressionInfo=null,this.labelPlacement=null,this.labelPosition="curved",this.maxScale=0,this.minScale=0,this.repeatLabel=!0,this.repeatLabelDistance=null,this.symbol=C,this.useCodedValues=void 0,this.where=null}static evaluateWhere(e,t){const r=(e,t,r)=>{switch(t){case"=":return e==r;case"<>":return e!=r;case">":return e>r;case">=":return e>=r;case"<":return e<r;case"<=":return e<=r}return!1};try{if(null==e)return!0;const n=e.split(" ");if(3===n.length)return r(t[n[0]],n[1],n[2]);if(7===n.length){const e=r(t[n[0]],n[1],n[2]),o=n[3],s=r(t[n[4]],n[5],n[6]);switch(o){case"AND":return e&&s;case"OR":return e||s}}return!1}catch(t){console.log("Error.: can't parse = "+e)}}readLabelExpression(e,t){const r=t.labelExpressionInfo;if(!r||!r.value&&!r.expression)return e}writeLabelExpression(e,t,r){if(this.labelExpressionInfo)if(null!=this.labelExpressionInfo.value)e=(0,y.z7)(this.labelExpressionInfo.value);else if(null!=this.labelExpressionInfo.expression){const t=(0,y.el)(this.labelExpressionInfo.expression);t&&(e="["+t+"]")}null!=e&&(t[r]=e)}writeLabelExpressionInfo(e,t,r,n){if(null==e&&null!=this.labelExpression&&E(n))e=new h({expression:this.getLabelExpressionArcade()});else if(!e)return;const o=e.toJSON(n);o.expression&&(t[r]=o)}writeMaxScale(e,t){(e||this.minScale)&&(t.maxScale=e)}writeMinScale(e,t){(e||this.maxScale)&&(t.minScale=e)}getLabelExpression(){return(0,y.hV)(this)}getLabelExpressionArcade(){return(0,y.YI)(this)}getLabelExpressionSingleField(){return(0,y.UO)(this)}hash(){return JSON.stringify(this)}clone(){return new x({allowOverrun:this.allowOverrun,deconflictionStrategy:this.deconflictionStrategy,labelExpression:this.labelExpression,labelExpressionInfo:(0,l.d9)(this.labelExpressionInfo),labelPosition:this.labelPosition,labelPlacement:this.labelPlacement,maxScale:this.maxScale,minScale:this.minScale,name:this.name,repeatLabel:this.repeatLabel,repeatLabelDistance:this.repeatLabelDistance,symbol:(0,l.d9)(this.symbol),where:this.where,useCodedValues:this.useCodedValues})}};(0,o._)([(0,p.Cb)({type:String,json:{write:!0}})],I.prototype,"name",void 0),(0,o._)([(0,p.Cb)({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],I.prototype,"allowOverrun",void 0),(0,o._)([(0,p.Cb)({type:String,json:{write:!0,default:"static",origins:{"web-scene":{write:!1}}}})],I.prototype,"deconflictionStrategy",void 0),(0,o._)([(0,p.Cb)({type:String,json:{write:{overridePolicy(e,t,r){return this.labelExpressionInfo&&"service"===(null==r?void 0:r.origin)&&F(r.layer)?{enabled:!1}:{allowNull:!0}}}}})],I.prototype,"labelExpression",void 0),(0,o._)([(0,c.r)("labelExpression")],I.prototype,"readLabelExpression",null),(0,o._)([(0,f.c)("labelExpression")],I.prototype,"writeLabelExpression",null),(0,o._)([(0,p.Cb)({type:h,json:{write:{overridePolicy:(e,t,r)=>function(e){return E(e)||F(e.layer)}(r)?{allowNull:!0}:{enabled:!1}}}})],I.prototype,"labelExpressionInfo",void 0),(0,o._)([(0,f.c)("labelExpressionInfo")],I.prototype,"writeLabelExpressionInfo",null),(0,o._)([(0,p.Cb)({type:P.apiValues,json:{type:P.jsonValues,read:P.read,write:P.write}})],I.prototype,"labelPlacement",void 0),(0,o._)([(0,p.Cb)({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],I.prototype,"labelPosition",void 0),(0,o._)([(0,p.Cb)({type:Number})],I.prototype,"maxScale",void 0),(0,o._)([(0,f.c)("maxScale")],I.prototype,"writeMaxScale",null),(0,o._)([(0,p.Cb)({type:Number})],I.prototype,"minScale",void 0),(0,o._)([(0,f.c)("minScale")],I.prototype,"writeMinScale",null),(0,o._)([(0,p.Cb)({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:!1}}}})],I.prototype,"repeatLabel",void 0),(0,o._)([(0,p.Cb)({type:Number,cast:u.t_,json:{write:!0,origins:{"web-scene":{write:!1}}}})],I.prototype,"repeatLabelDistance",void 0),(0,o._)([(0,p.Cb)({types:s.yK,json:{origins:{"web-scene":{types:s.S6,write:_.vX,default:null}},write:_.vX,default:null}})],I.prototype,"symbol",void 0),(0,o._)([(0,p.Cb)({type:Boolean,json:{write:!0}})],I.prototype,"useCodedValues",void 0),(0,o._)([(0,p.Cb)({type:String,json:{write:!0}})],I.prototype,"where",void 0),I=x=(0,o._)([(0,d.j)("esri.layers.support.LabelClass")],I);const k=I},8813:(e,t,r)=>{r.d(t,{UO:()=>f,YI:()=>d,dI:()=>y,el:()=>b,hV:()=>c,z7:()=>p});var n=r(19153);const o="__begin__",s="__end__",i=new RegExp(o,"ig"),a=new RegExp(s,"ig"),l=new RegExp("^"+o,"i"),u=new RegExp(s+"$","i");function p(e){return e.replace(new RegExp("\\{","g"),"[").replace(new RegExp("\\}","g"),"]")}function c(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=function(e){return e.replace(new RegExp("\\[","g"),"{").replace(new RegExp("\\]","g"),"}")}(e.labelExpression),t.type="conventional"),t}function d(e){const t=c(e);if(!t)return null;switch(t.type){case"conventional":return y(t.expression);case"arcade":return t.expression}return null}function f(e){const t=c(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e.match(m);return t&&t[1].trim()||null}(t.expression);case"arcade":return b(t.expression)}return null}function y(e){let t;return e?(t=(0,n.gx)(e,(e=>o+'$feature["'+e+'"]'+s)),t=l.test(t)?t.replace(l,""):'"'+t,t=u.test(t)?t.replace(u,""):t+'"',t=t.replace(i,'" + ').replace(a,' + "')):t='""',t}const m=/^\s*\{([^}]+)\}\s*$/i,h=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,g=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,w=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function b(e){if(!e)return null;let t=h.exec(e)||g.exec(e);return t?t[1]||t[3]:(t=w.exec(e),t?t[2]:null)}},51706:(e,t,r)=>{var n,o;function s(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function i(e){return null!=e&&!isNaN(e)&&isFinite(e)}function a(e){return e.valueExpression?n.Expression:e.field&&"string"==typeof e.field?n.Field:n.Unknown}function l(e,t){const r=t||a(e),s=e.valueUnit||"unknown";return r===n.Unknown?o.Constant:e.stops?o.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?o.ClampedLinear:"unknown"===s?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?o.Proportional:o.Additive:o.Identity:o.RealWorldSize}r.d(t,{PS:()=>a,QW:()=>l,RY:()=>n,hL:()=>o,iY:()=>s,qh:()=>i}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(n||(n={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(o||(o={}))},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>v});var n,o=r(43697),s=r(66577),i=r(38171),a=r(35454),l=r(96674),u=r(22974),p=r(70586),c=r(5600),d=(r(75215),r(71715)),f=r(52011),y=r(30556),m=r(82971),h=r(33955),g=r(1231);const w=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let b=n=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=m.Z.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const o=e[t],s=i.Z.fromJSON(o),a=o.geometry&&o.geometry.spatialReference;(0,p.pC)(s.geometry)&&!a&&(s.geometry.spatialReference=r);const l=o.aggregateGeometries,u=s.aggregateGeometries;if(l&&(0,p.pC)(u))for(const e in u){const t=u[e],n=l[e],o=null==n?void 0:n.spatialReference;(0,p.pC)(t)&&!o&&(t.spatialReference=r)}n.push(s)}return n}writeGeometryType(e,t,r,n){if(e)return void w.write(e,t,r,n);const{features:o}=this;if(o)for(const e of o)if(e&&(0,p.pC)(e.geometry))return void w.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,n=(0,h.im)(e);return!r&&t.spatialReference&&(n.spatialReference=m.Z.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,p.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const n=t.features[r];if(n.geometry){const t=e&&e[r];n.geometry=t&&t.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,r],translate:[n,o]}=e,s=this.features,i=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-n)/t)),(e=>Math.round((o-e)/r)));for(let e=0,t=s.length;e<t;e++)i((0,p.Wg)(s[e].geometry))||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[n,o],scale:[s,i]}=r,a=this._getHydrationFunction(e,(e=>e*s+n),(e=>o-e*i));for(const{geometry:e}of t)(0,p.pC)(e)&&a(e);return this.transform=null,this}_quantizePoints(e,t,r){let n,o;const s=[];for(let i=0,a=e.length;i<a;i++){const a=e[i];if(i>0){const e=t(a[0]),i=r(a[1]);e===n&&i===o||(s.push([e-n,i-o]),n=e,o=i)}else n=t(a[0]),o=r(a[1]),s.push([n,o])}return s.length>0?s:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const n=(0,h.oU)(e)?e.rings:e.paths,o=[];for(let e=0,s=n.length;e<s;e++){const s=n[e],i=this._quantizePoints(s,t,r);i&&o.push(i)}return o.length>0?((0,h.oU)(e)?e.rings=o:e.paths=o,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,r);return n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const n=(0,h.oU)(e)?e.rings:e.paths;let o,s;for(let e=0,i=n.length;e<i;e++){const i=n[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];e>0?(o+=n[0],s+=n[1]):(o=n[0],s=n[1]),n[0]=t(o),n[1]=r(s)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const n=e.points;let o,s;for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(o+=i[0],s+=i[1]):(o=i[0],s=i[1]),i[0]=t(o),i[1]=r(s)}}:void 0}};(0,o._)([(0,c.Cb)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,o._)([(0,c.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,o._)([(0,c.Cb)({type:[i.Z],json:{write:!0}})],b.prototype,"features",void 0),(0,o._)([(0,d.r)("features")],b.prototype,"readFeatures",null),(0,o._)([(0,c.Cb)({type:[g.Z],json:{write:!0}})],b.prototype,"fields",void 0),(0,o._)([(0,c.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],b.prototype,"geometryType",void 0),(0,o._)([(0,y.c)("geometryType")],b.prototype,"writeGeometryType",null),(0,o._)([(0,c.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,o._)([(0,c.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,o._)([(0,c.Cb)({types:s.qM,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,o._)([(0,d.r)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,o._)([(0,c.Cb)({type:m.Z,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,o._)([(0,y.c)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,o._)([(0,c.Cb)({json:{write:!0}})],b.prototype,"transform",void 0),b=n=(0,o._)([(0,f.j)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0;const v=b},32163:(e,t,r)=>{r.d(t,{eZ:()=>c});var n=r(51773),o=r(35671),s=r(84649),i=(r(63801),r(48074),r(38745),r(9190)),a=(r(10214),r(44951),r(422)),l=r(63061);const u=["oid","global-id"],p=["oid","global-id","guid"];function c({displayField:e,editFieldsInfo:t,fields:r,objectIdField:l,title:u},p){if(!r)return null;const c=function({editFieldsInfo:e,fields:t,objectIdField:r},n){return function(e,t){const r=e;return t&&(e=e.filter((e=>!t.includes(e.type)))),e===r&&(e=e.slice()),e.sort(y),e}(t,(null==n?void 0:n.ignoreFieldTypes)||b).map((t=>new a.Z({fieldName:t.name,isEditable:h(t,e),label:t.alias,format:g(t),visible:f(t,{editFieldsInfo:e,objectIdField:r,visibleFieldNames:null==n?void 0:n.visibleFieldNames})})))}({editFieldsInfo:t,fields:r,objectIdField:l},p);if(!c.length)return null;const d=function(e){const t=(0,o.O5)(e),{titleBase:r}=e;return t?`${r}: {${t.trim()}}`:r}({titleBase:u,fields:r,displayField:e}),m=[new i.Z,new s.Z];return new n.Z({title:d,content:m,fieldInfos:c})}const d=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/shape/i,/perimeter/i,/objectid/i,/_i$/i],f=(e,{editFieldsInfo:t,objectIdField:r,visibleFieldNames:n})=>n?n.has(e.name):!(m(e.name,t)||r&&e.name===r||u.includes(e.type)||d.some((t=>t.test(e.name))));function y(e,t){return"oid"===e.type?-1:"oid"===t.type?1:w(e)?-1:w(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function m(e,t){if(!e||!t)return!1;const{creationDateField:r,creatorField:n,editDateField:o,editorField:s}=t;return[r&&r.toLowerCase(),n&&n.toLowerCase(),o&&o.toLowerCase(),s&&s.toLowerCase()].includes(e.toLowerCase())}function h(e,t){return e.editable&&!p.includes(e.type)&&!m(e.name,t)}function g(e){switch(e.type){case"small-integer":case"integer":case"single":return new l.Z({digitSeparator:!0,places:0});case"double":return new l.Z({digitSeparator:!0,places:2});case"date":return new l.Z({dateFormat:"long-month-day-year"});default:return"string"===e.type&&(0,o.Ec)(e.name)?new l.Z({digitSeparator:!0,places:0}):null}}function w(e){return"name"===(e.name&&e.name.toLowerCase())||"name"===(e.alias&&e.alias.toLowerCase())||void 0}const b=["geometry","blob","raster","guid","xml"]}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3974,4889],{78346:(e,t,r)=>{r.d(t,{bA:()=>U});var n=r(20102),o=r(80442),s=r(95330),i=r(80903),a=r(25045),l=r(40330),u=r(92604),p=r(94362),c=r(99880),d=r(68773),f=(r(2587),r(17452));const y={};function m(e){var t;const r={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(r.async=!0),e.hasOwnProperty("isDebug")||(r.isDebug=!1),e.baseUrl||(r.baseUrl=y.baseUrl),null==(t=y.packages)||t.forEach((e=>{!function(e,t){for(const r of e)if(r.name===t.name)return;e.push(t)}(r.packages,e)})),r}var h=r(41213);class g{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r)}))}}class w{constructor(){this._dispatcher=new g,this._workerPostMessage({type:p.Cs.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,h.Y)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,h.Y)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,p.QM)(e);if(t&&t.type===p.Cs.OPEN){const{modulePath:e,jobId:r}=t;let n=await a.default.loadWorker(e);n||(n=await import(e));const o=a.default.connect(n);this._workerPostMessage({type:p.Cs.OPENED,jobId:r,data:o})}}}var b=r(70171),v=r(17202);const S=u.Z.getLogger("esri.core.workers"),{HANDSHAKE:C}=p.Cs;let x,_;const P="Failed to create Worker. Fallback to execute module in main thread";async function E(e){return new Promise((t=>{function r(o){const s=(0,p.QM)(o);s&&s.type===C&&(e.removeEventListener("message",r),e.removeEventListener("error",n),t(e))}function n(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",n),S.warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new w).addEventListener("message",r),e.addEventListener("error",n)}e.addEventListener("message",r),e.addEventListener("error",n)}))}let F=0;const I=u.Z.getLogger("esri.core.workers"),{ABORT:k,INVOKE:O,OPEN:R,OPENED:N,RESPONSE:L}=p.Cs;class j{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),I.error(e)}))}static async create(e){const t=await async function(){if(!(0,o.Z)("esri-workers")||((0,o.Z)("mozilla"),0))return E(new w);if(!x&&!_)try{const e='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,buildDate:r,version:t}=configuration.kernelInfo,{revision:n,buildDate:i,version:s}=e.kernelInfo;o!==n&&console.warn(`[esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:\\nAPI version: ${t} [Date: ${r}, Revision: ${o.slice(0,8)}]\nAssets version: ${s} [Date: ${i}, Revision: ${n.slice(0,8)}]`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let e;function t(o){const t=e.connect(o);self.postMessage({type:2,jobId:r,data:t},[t])}"function"==typeof define&&define.amd?require([workerPath],(r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((r=>(e=r.default,checkWorkerRevision(e),e.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),e=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(e),e.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const e=outgoing.get(r);outgoing.delete(r),o.error?e.reject(JSON.parse(o.error)):e.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.replace('"{CONFIGURATION}"',`'${function(){let e;if(null!=d.Z.default){const t={...d.Z};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(d.Z));e.assetsPath=(0,f.hF)(e.assetsPath),e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,b.Kd)(),e.has={"esri-csp-restrictions":(0,o.Z)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,o.Z)("esri-2d-update-debug"),"esri-2d-query-centroid-enabled":(0,o.Z)("esri-2d-query-centroid-enabled"),"featurelayer-pbf":(0,o.Z)("featurelayer-pbf"),"featurelayer-simplify-thresholds":(0,o.Z)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,o.Z)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,o.Z)("featurelayer-simplify-mobile-factor"),"esri-atomics":(0,o.Z)("esri-atomics"),"esri-shared-array-buffer":(0,o.Z)("esri-shared-array-buffer"),"esri-tiles-debug":(0,o.Z)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,o.Z)("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":(0,o.Z)("feature-polyline-generalization-factor"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,f.hF)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,f.hF)(e.workers.workerPath):e.workers.workerPath=(0,f.hF)((0,c.V)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=d.Z.workers.loaderConfig,r=m({baseUrl:null==t?void 0:t.baseUrl,locale:(0,b.Kd)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...null==t?void 0:t.has},map:{...null==t?void 0:t.map},paths:{...null==t?void 0:t.paths},packages:(null==t?void 0:t.packages)||[]}),n={version:l.i8,buildDate:v.r,revision:v.$};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:n})}()}'`);x=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){_=e||{}}let e;if(x)try{e=new Worker(x,{name:"esri-worker-"+F++})}catch(t){S.warn(P,_),e=new w}else S.warn(P,_),e=new w;return E(e)}();return new j(t,e)}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,n=(0,p.jt)();return new Promise(((t,o)=>{const i={resolve:t,reject:o,abortHandle:(0,s.$F)(r,(()=>{this._outJobs.delete(n),this._post({type:k,jobId:n})}))};this._outJobs.set(n,i),this._post({type:R,jobId:n,modulePath:e})}))}_onMessage(e){const t=(0,p.QM)(e);if(t)switch(t.type){case N:this._onOpenedMessage(t);break;case L:this._onResponseMessage(t);break;case k:this._onAbortMessage(t);break;case O:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);n&&(n.controller&&n.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,i=o?new AbortController:null,a=this._inJobs,u=l.Nv[t];let c;try{if("function"!=typeof u)throw new TypeError(`${t} is not a function`);c=u.call(null,n,{signal:i?i.signal:null})}catch(e){return void this._post({type:L,jobId:r,error:(0,p.AB)(e)})}(0,s.y8)(c)?(a.set(r,{controller:i,promise:c}),c.then((e=>{a.has(r)&&(a.delete(r),this._post({type:L,jobId:r},e))}),(e=>{a.has(r)&&(a.delete(r),e||(e={message:"Error encountered at method"+t}),(0,s.D_)(e)||this._post({type:L,jobId:r,error:(0,p.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:L,jobId:r},c)}_onOpenedMessage(e){var t;const{jobId:r,data:n}=e,o=this._outJobs.get(r);o&&(this._outJobs.delete(r),null==(t=o.abortHandle)||t.remove(),o.resolve(n))}_onResponseMessage(e){var t;const{jobId:r,error:o,data:s}=e,i=this._outJobs.get(r);i&&(this._outJobs.delete(r),null==(t=i.abortHandle)||t.remove(),o?i.reject(n.Z.fromJSON(JSON.parse(o))):i.resolve(s))}_post(e,t,r){return(0,p.oi)(this.worker,e,t,r)}}let T=(0,o.Z)("esri-workers-debug")?1:(0,o.Z)("host-browser")?navigator.hardwareConcurrency-1:0;T||(T=(0,o.Z)("safari")&&(0,o.Z)("mac")||(0,o.Z)("trident")?7:2);let Z=0;const A=[];async function D(e,t){const r=new i.Z;return await r.open(e,t),r}async function U(e,t={}){if("string"!=typeof e)throw new n.Z("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,o.Z)("host-webworker")&&!(0,o.Z)("esri-workers")&&(r="local"),"local"===r){let r=await a.default.loadWorker(e);r||(r=await import(e)),(0,s.k_)(t.signal);const n=t.client||r;return D([a.default.connect(r)],{...t,client:n})}if(await async function(){if($)return $;M=new AbortController;const e=[];for(let t=0;t<T;t++){const r=j.create(t).then((e=>(A[t]=e,e)));e.push(r)}return $=Promise.all(e),$}(),(0,s.k_)(t.signal),"dedicated"===r){const r=Z++%T;return D([await A[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,T);if(r<T){const n=new Array(r);for(let o=0;o<r;++o){const r=Z++%T;n[o]=A[r].open(e,t)}return D(n,t)}}return D(A.map((r=>r.open(e,t))),t)}let M,$=null},2587:(e,t,r)=>{r(90344),r(18848),r(940),r(70171);var n=r(94443),o=r(3172),s=r(20102),i=r(70586);async function a(e){if((0,i.pC)(u.fetchBundleAsset))return u.fetchBundleAsset(e);const t=await(0,o.default)(e,{responseType:"text"});return JSON.parse(t.data)}class l{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let n;n="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,o){const i=t.exec(r);if(!i)throw new s.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=i[1]?`${i[1]}/`:"",u=i[2],p=(0,n.Su)(o),c=`${l}${u}.json`,d=p?`${l}${u}_${p}.json`:c;let f;try{f=await a(e(d))}catch(t){if(d===c)throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{f=await a(e(c))}catch(e){throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return f}(this.getAssetUrl,this.matcher,e,t)}}const u={};var p,c=r(99880);(0,n.tz)((p={pattern:"esri/",location:c.V},new l(p)))},940:(e,t,r)=>{r.d(t,{n:()=>u});var n=r(92604),o=r(78286),s=r(19153),i=r(90344),a=r(18848);const l=n.Z.getLogger("esri.intl");function u(e,t,r={}){const{format:n={}}=r;return(0,s.gx)(e,(e=>function(e,t,r){let n,s;const i=e.indexOf(":");if(-1===i?n=e.trim():(n=e.slice(0,i).trim(),s=e.slice(i+1).trim()),!n)return"";const a=(0,o.hS)(n,t);if(null==a)return"";const l=r[s]||r[n];return l?p(a,l):s?c(a,s):d(a)}(e,t,n)))}function p(e,t){switch(t.type){case"date":return(0,i.p6)(e,t.intlOptions);case"number":return(0,a.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),d(e)}}function c(e,t){switch(t.toLowerCase()){case"dateformat":return(0,i.p6)(e);case"numberformat":return(0,a.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,i.p6)(e):/^numberformat/i.test(t)?(0,a.uf)(e):d(e)}}function d(e){switch(typeof e){case"string":return e;case"number":return(0,a.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,i.p6)(e):""}}},12653:(e,t,r)=>{r.r(t),r.d(t,{default:()=>V});var n=r(43697),o=(r(66577),r(51773)),s=(r(16050),r(12501),r(95088),r(79056),r(5499),r(84382),r(30687),r(91423),r(32400)),i=r(70586),a=r(16453),l=r(78286),u=r(17452),p=r(5600),c=(r(67676),r(80442)),d=r(75215),f=r(52011),y=r(30556),m=r(86973),h=r(29600),g=r(20102),w=r(3920),b=r(83379),v=r(95330),S=r(78346),C=r(25278),x=r(51432),_=r(74889),P=r(6570);let E=class extends((0,w.p)(b.Z)){constructor(){super(...arguments),this.capabilities=(0,C.MS)(!1,!1),this.type="wfs",this.refresh=(0,v.Ds)((async e=>{await this.load();const{extent:t}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}}))}load(e){var t;const r=null!=(t=(0,i.pC)(e)&&e.signal)?t:null;return this.addResolvingPromise(this._startWorker({signal:r})),Promise.resolve(this)}destroy(){var e;null==(e=this._connection)||e.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return _.default.fromJSON(r)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const r=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:r.count,extent:P.Z.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _createLoadOptions(e){const{url:t,customParameters:r,name:n,namespaceUri:o,spatialReference:s,fields:a,geometryType:l,swapXY:u}=this.layer;if(!t)throw new g.Z("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await(0,x.FU)(t,{customParameters:r,...e}));const p=["fields","geometryType","name","namespaceUri","spatialReference","swapXY"].some((e=>null==this.layer[e])),c=p?await(0,x.be)(this.wfsCapabilities,n,o,{spatialReference:s,customParameters:r,signal:null==e?void 0:e.signal}):{...(0,x.eB)(a),geometryType:l,name:n,namespaceUri:o,spatialReference:s,swapXY:u},d=(0,i.Wg)((0,x.ft)(this.wfsCapabilities.readFeatureTypes(),c.name,c.namespaceUri)),f=m.Mk.toJSON(c.geometryType);return{customParameters:r,featureType:d,fields:c.fields.map((e=>e.toJSON())),geometryField:c.geometryField,geometryType:f,getFeatureUrl:this.wfsCapabilities.operations.GetFeature.url,getFeatureOutputFormat:this.wfsCapabilities.operations.GetFeature.outputFormat,objectIdField:c.objectIdField,spatialReference:c.spatialReference.toJSON(),swapXY:c.swapXY}}async _startWorker(e){const[t,r]=await(0,v.as)([this._createLoadOptions(e),(0,S.bA)("WFSSourceWorker",{...e,strategy:(0,c.Z)("feature-layers-workers")?"dedicated":"local"})]),n=t.error||r.error||null,o=r.value||null;if(n)throw o&&o.close(),n;const s=t.value;this._connection=r.value;const{extent:i}=await this._connection.invoke("load",s,e);this.sourceJSON={extent:i,fields:s.fields,geometryType:s.geometryType,objectIdField:s.objectIdField,geometryField:s.geometryField,drawingInfo:(0,C.bU)(s.geometryType),name:s.featureType.title,wfsInfo:{name:s.featureType.name,featureUrl:s.getFeatureUrl,maxFeatures:3e3,swapXY:s.swapXY,supportedSpatialReferences:s.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:s.featureType.namespaceUri}}}};(0,n._)([(0,p.Cb)()],E.prototype,"capabilities",void 0),(0,n._)([(0,p.Cb)({constructOnly:!0})],E.prototype,"layer",void 0),(0,n._)([(0,p.Cb)()],E.prototype,"sourceJSON",void 0),(0,n._)([(0,p.Cb)()],E.prototype,"type",void 0),(0,n._)([(0,p.Cb)()],E.prototype,"wfsCapabilities",void 0),E=(0,n._)([(0,f.j)("esri.layers.graphics.sources.WFSSource")],E);var F,I=r(71612),k=r(17017),O=r(69637),R=r(38009),N=r(68825),L=r(16859),j=r(34760),T=r(72965),Z=r(28294),A=r(21506),D=r(55785),U=r(1231),M=r(53518),$=r(35671),q=r(2319),G=r(30707),J=r(57444),W=r(32163),H=r(82971);const B=(0,M.v)();let z=F=class extends((0,N.c)((0,k.N)((0,O.b)((0,I.h)((0,Z.n)((0,j.Q)((0,T.M)((0,R.q)((0,L.I)((0,a.R)(h.Z))))))))))){constructor(e){super(e),this.capabilities=null,this.copyright=null,this.customParameters=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureReduction=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxFeatures=3e3,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new E({layer:this}),this.spatialReference=H.Z.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}static fromWFSLayerInfo(e){const{customParameters:t,fields:r,geometryField:n,geometryType:o,name:s,namespaceUri:i,objectIdField:a,spatialReference:l,swapXY:u,url:p,wfsCapabilities:c}=e;return new F({customParameters:t,fields:r,geometryField:n,geometryType:o,name:s,namespaceUri:i,objectIdField:a,spatialReference:l,swapXY:u,url:p,wfsCapabilities:c})}destroy(){var e;null==(e=this.source)||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),(0,$.YN)(this.renderer,this.fieldsIndex),(0,$.UF)(this.timeInfo,this.fieldsIndex)}))),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,r){const n=e.filter((e=>e.name!==x.M8));this.geometryField&&n.unshift(new U.Z({name:this.geometryField,alias:this.geometryField,type:"geometry"})),(0,l.RB)(r,n.map((e=>e.toJSON())),t)}get parsedUrl(){return this.url?(0,u.mN)(this.url):null}set renderer(e){(0,$.YN)(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return(0,W.eZ)(this,e)}createQuery(){const e=new J.Z;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:t,timeExtent:r}=this;return e.timeExtent=null!=t&&null!=r?r.offset(-t.value,t.unit):r||null,e}getFieldDomain(e,t){var r;return null==(r=this.getField(e))?void 0:r.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(J.Z.from(e)||this.createQuery(),t))).then((e=>{if(null!=e&&e.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>this.source.queryObjectIds(J.Z.from(e)||this.createQuery(),t)))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(J.Z.from(e)||this.createQuery(),t)))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(J.Z.from(e)||this.createQuery(),t)))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return(0,i.pC)(t)&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};(0,n._)([(0,p.Cb)({readOnly:!0,aliasOf:"source.capabilities"})],z.prototype,"capabilities",void 0),(0,n._)([(0,p.Cb)({type:String})],z.prototype,"copyright",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],z.prototype,"createQueryVersion",null),(0,n._)([(0,p.Cb)({json:{name:"wfsInfo.customParameters",write:{ignoreOrigin:!0}}})],z.prototype,"customParameters",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),(0,n._)([(0,p.Cb)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],z.prototype,"definitionExpression",void 0),(0,n._)([(0,p.Cb)({type:String})],z.prototype,"displayField",void 0),(0,n._)([(0,p.Cb)(A.PV)],z.prototype,"elevationInfo",void 0),(0,n._)([(0,p.Cb)(D.d)],z.prototype,"featureReduction",void 0),(0,n._)([(0,p.Cb)({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"featureUrl",void 0),(0,n._)([(0,p.Cb)({type:[U.Z],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],z.prototype,"fields",void 0),(0,n._)([(0,y.c)("fields")],z.prototype,"writeFields",null),(0,n._)([(0,p.Cb)(B.fieldsIndex)],z.prototype,"fieldsIndex",void 0),(0,n._)([(0,p.Cb)({type:P.Z,json:{name:"extent"}})],z.prototype,"fullExtent",void 0),(0,n._)([(0,p.Cb)()],z.prototype,"geometryField",void 0),(0,n._)([(0,p.Cb)({type:String,json:{read:{source:"layerDefinition.geometryType",reader:m.Mk.read},write:{target:"layerDefinition.geometryType",writer:m.Mk.write,ignoreOrigin:!0},origins:{service:{read:m.Mk.read}}}})],z.prototype,"geometryType",void 0),(0,n._)([(0,p.Cb)({type:String})],z.prototype,"id",void 0),(0,n._)([(0,p.Cb)(A.iR)],z.prototype,"labelsVisible",void 0),(0,n._)([(0,p.Cb)({type:[q.Z],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:G.r},write:!0}})],z.prototype,"labelingInfo",void 0),(0,n._)([(0,p.Cb)(A.rn)],z.prototype,"legendEnabled",void 0),(0,n._)([(0,p.Cb)({type:["show","hide"]})],z.prototype,"listMode",void 0),(0,n._)([(0,p.Cb)({type:String})],z.prototype,"objectIdField",void 0),(0,n._)([(0,p.Cb)({type:["WFS"]})],z.prototype,"operationalLayerType",void 0),(0,n._)([(0,p.Cb)({type:d.z8,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"maxFeatures",void 0),(0,n._)([(0,p.Cb)({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],z.prototype,"mode",void 0),(0,n._)([(0,p.Cb)({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"name",void 0),(0,n._)([(0,p.Cb)({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"namespaceUri",void 0),(0,n._)([(0,p.Cb)(A.bT)],z.prototype,"opacity",void 0),(0,n._)([(0,p.Cb)(B.outFields)],z.prototype,"outFields",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],z.prototype,"parsedUrl",null),(0,n._)([(0,p.Cb)(A.C_)],z.prototype,"popupEnabled",void 0),(0,n._)([(0,p.Cb)({type:o.Z,json:{name:"popupInfo",write:!0}})],z.prototype,"popupTemplate",void 0),(0,n._)([(0,p.Cb)({types:s.A,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:s.o,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],z.prototype,"renderer",null),(0,n._)([(0,p.Cb)(A.YI)],z.prototype,"screenSizePerspectiveEnabled",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],z.prototype,"source",void 0),(0,n._)([(0,p.Cb)({type:H.Z,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],z.prototype,"spatialReference",void 0),(0,n._)([(0,p.Cb)({readOnly:!0,type:[d.z8],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"spatialReferences",void 0),(0,n._)([(0,p.Cb)({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"swapXY",void 0),(0,n._)([(0,p.Cb)({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],z.prototype,"title",void 0),(0,n._)([(0,p.Cb)({json:{read:!1},readOnly:!0})],z.prototype,"type",void 0),(0,n._)([(0,p.Cb)(A.HQ)],z.prototype,"url",void 0),(0,n._)([(0,p.Cb)({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],z.prototype,"version",void 0),(0,n._)([(0,p.Cb)({aliasOf:"source.wfsCapabilities"})],z.prototype,"wfsCapabilities",void 0),z=F=(0,n._)([(0,f.j)("esri.layers.WFSLayer")],z);const V=z},61159:(e,t,r)=>{r.d(t,{g:()=>n});const n={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},92722:(e,t,r)=>{r.d(t,{O3:()=>S,lG:()=>x,my:()=>C,q9:()=>l});var n=r(20102),o=r(70272),s=r(5428),i=r(35671);const a={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function l(e){return a[e]}function*u(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*p(e){if(!e)return null;switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function c(e){for(const t of e)if(t.length>2)return!0;return!1}function d(e){let t=0;for(let r=0;r<e.length;r++){const n=e[r],o=e[(r+1)%e.length];t+=n[0]*o[1]-o[0]*n[1]}return t<=0}function f(e){const t=e[0],r=e[e.length-1];return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]||e.push(t),e}function y(e,t,r){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,r){return g(e,t.coordinates,r),e}(e,t,r);case"MultiLineString":return function(e,t,r){for(const n of t.coordinates)g(e,n,r);return e}(e,t,r);case"MultiPolygon":return function(e,t,r){for(const n of t.coordinates){m(e,n[0],r);for(let t=1;t<n.length;t++)h(e,n[t],r)}return e}(e,t,r);case"Point":return function(e,t,r){return b(e,t.coordinates,r),e}(e,t,r);case"Polygon":return function(e,t,r){const n=t.coordinates;m(e,n[0],r);for(let t=1;t<n.length;t++)h(e,n[t],r);return e}(e,t,r)}}function m(e,t,r){const n=f(t);!function(e){return!d(e)}(n)?g(e,n,r):w(e,n,r)}function h(e,t,r){const n=f(t);!function(e){return d(e)}(n)?g(e,n,r):w(e,n,r)}function g(e,t,r){for(const n of t)b(e,n,r);e.lengths.push(t.length)}function w(e,t,r){for(let n=t.length-1;n>=0;n--)b(e,t[n],r);e.lengths.push(t.length)}function b(e,t,r){const[n,o,s]=t;e.coords.push(n,o),r.hasZ&&e.coords.push(s||0)}function v(e){switch(typeof e){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function S(e){if(!e)throw new n.Z("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new n.Z("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:t}=e;if(!t)return;const r="string"==typeof t?t:"name"===t.type?t.properties.name:"EPSG"===t.type?t.properties.code:null,o=new RegExp(".*(CRS84H?|4326)$","i");if(!r||!o.test(r))throw new n.Z("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:t})}function C(e,t={}){const r=[],n=new Set,o=new Set;let s,a=!1,d=null,f=!1,{geometryType:y=null}=t,m=!1;for(const t of u(e)){const{geometry:e,properties:i,id:u}=t;if((!e||(y||(y=l(e.type)),l(e.type)===y))&&(a||(a=c(p(e))),f||(f=null!=u,f&&(s=typeof u,d=Object.keys(i).filter((e=>i[e]===u)))),f&&null!=u&&(d.length>1?d=d.filter((e=>i[e]===u)):1===d.length&&(d=i[d[0]]===u?d:[])),!m&&i)){let e=!0;for(const t in i){if(n.has(t))continue;const s=i[t];if(null==s){e=!1,o.add(t);continue}const a=v(s);"unknown"!==a?(o.delete(t),n.add(t),r.push({name:t,alias:t,type:a})):o.add(t)}m=e}}const h=d&&1===d.length&&d[0]||null;if(h)for(const e of r)if(e.name===h&&(0,i.H7)(e)){e.type="esriFieldTypeOID";break}return{fields:r,geometryType:y,hasZ:a,objectIdFieldName:h,objectIdFieldType:s,unknownFields:Array.from(o)}}function x(e,t){return Array.from(function*(e,t={}){const{geometryType:r,objectIdField:n}=t;for(const a of e){var i;const{geometry:e,properties:u,id:p}=a;if(e&&l(e.type)!==r)continue;const c=u||{};let d=null!=(i=c[n])?i:null;n&&null!=p&&!c[n]&&(c[n]=d=p);const f=new o.u_(e?y(new s.Z,e,t):null,c,null,d);yield f}}(u(e),t))}},25278:(e,t,r)=>{r.d(t,{Dm:()=>p,Hq:()=>c,MS:()=>d,bU:()=>a});var n=r(80442),o=r(22974),s=r(61159),i=r(58333);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?i.I4:"esriGeometryPolyline"===e?i.ET:i.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function p(e,t){if((0,n.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this.${t} = null;`;for(const t in e)r+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const n=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new n}catch(r){return()=>({[t]:null,...e})}}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,o.d9)(e)}}]}function d(e,t){return{attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0},query:s.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1}}}},17017:(e,t,r)=>{r.d(t,{N:()=>i});var n=r(43697),o=r(5600),s=(r(67676),r(80442),r(75215),r(52011));const i=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,n._)([(0,o.Cb)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,n._)([(0,s.j)("esri.layers.mixins.CustomParametersMixin")],t),t}},68825:(e,t,r)=>{r.d(t,{c:()=>m});var n,o=r(43697),s=r(78286),i=r(5600),a=(r(67676),r(80442),r(75215),r(52011)),l=r(35454),u=r(96674);const p=new l.X({asc:"ascending",desc:"descending"});let c=n=class extends u.wq{constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new n({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,o._)([(0,i.Cb)({type:String,json:{write:!0}})],c.prototype,"field",void 0),(0,o._)([(0,i.Cb)({type:String,json:{write:!0}})],c.prototype,"valueExpression",void 0),(0,o._)([(0,i.Cb)({type:p.apiValues,json:{read:p.read,write:p.write}})],c.prototype,"order",void 0),c=n=(0,o._)([(0,a.j)("esri.layers.support.OrderByInfo")],c);const d=c;function f(e,t,r){if(!e)return null;const n=e.find((e=>!!e.field));if(!n)return null;const o=new d;return o.read(n,r),[o]}function y(e,t,r,n){const o=e.find((e=>!!e.field));o&&(0,s.RB)(r,[o.toJSON()],t)}const m=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,o._)([(0,i.Cb)({type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:f},write:{target:"layerDefinition.orderBy",writer:y}}})],t.prototype,"orderBy",void 0),t=(0,o._)([(0,a.j)("esri.layers.mixins.OrderedLayer")],t),t}},16859:(e,t,r)=>{r.d(t,{I:()=>v});var n=r(43697),o=r(40330),s=r(3172),i=r(66643),a=r(20102),l=r(92604),u=r(70586),p=r(95330),c=r(17452),d=r(5600),f=(r(67676),r(80442),r(75215),r(71715)),y=r(52011),m=r(30556),h=r(65587),g=r(15235),w=r(86082);const b=l.Z.getLogger("esri.layers.mixins.PortalLayer"),v=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new g.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const n=await r.e(8062).then(r.bind(r,18062));return(0,p.k_)(t),await n.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||b.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==o.id?void 0:o.id.findCredential(this.url):null;if(!t)return!0;const r=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.user=r,(0,u.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,r;const n=null==(t=this.portalItem)||null==(r=t.portal)?void 0:r.user;if(n)return n;const a=o.id.findServerInfo(this.url);if(null==a||!a.owningSystemUrl)return null;const l=`${a.owningSystemUrl}/sharing/rest`,p=h.Z.getDefault();if(p&&p.loaded&&(0,c.Fv)(p.restUrl)===(0,c.Fv)(l))return p.user;const d=`${l}/community/self`,f=(0,u.pC)(e)?e.signal:null,y=await(0,i.q6)((0,s.default)(d,{authMode:"no-prompt",query:{f:"json"},signal:f}));return y.ok?w.default.fromJSON(y.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,n=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||h.Z.getDefault());return r&&n&&!(0,c.tm)(n.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,n._)([(0,d.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,n._)([(0,f.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,n._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,n._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,n._)([(0,d.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,n._)([(0,y.j)("esri.layers.mixins.PortalLayer")],t),t},S={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>g});var n=r(43697),o=r(92604),s=r(95330),i=r(5600),a=(r(67676),r(80442),r(75215),r(52011)),l=r(80539),u=(r(26258),r(87538));const p=new l.Z,c=new WeakMap;function d(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function f(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:f(t,e%t):0}let y=0,m=0;function h(){const e=Date.now();for(const r of p)if(r.refreshInterval){var t;e-(null!=(t=c.get(r))?t:0)+5>=6e4*r.refreshInterval&&(c.set(r,e),r.refresh(e))}}(0,u.EH)((()=>{const e=Date.now();let t=0;for(const r of p)t=f(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?c.get(r)||c.set(r,e):c.delete(r);if(t!==m){if(m=t,clearInterval(y),0===m)return void(y=0);y=setInterval(h,m)}}));const g=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,s.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){d(e)&&p.push(e)}(this)}),(()=>{}))}destroy(){var e;d(e=this)&&p.includes(e)&&p.remove(e)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,s.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{o.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,n._)([(0,i.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,n._)([(0,i.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,n._)([(0,i.Cb)()],t.prototype,"refreshParameters",null),t=(0,n._)([(0,a.j)("esri.layers.mixins.RefreshableLayer")],t),t}},51432:(e,t,r)=>{r.d(t,{M8:()=>C,ft:()=>I,FU:()=>P,Bm:()=>j,be:()=>k,eB:()=>O}),r(66577);var n=r(3172),o=r(20102),s=r(66374),i=r(70586),a=r(95330),l=r(17452),u=r(44547),p=r(8744),c=r(86973),d=r(92722);function f(e){var t;return null!=(t=y(e))?t:function(e){const t=new Date(e).getTime();return Number.isNaN(t)?null:t}(e)}function y(e){var t,r,n,o;const s=m.exec(e);if(!s)return null;const i=s.groups,a=+i.year,l=+i.month-1,u=+i.day,p=+(null!=(t=i.hours)?t:"0"),c=+(null!=(r=i.minutes)?r:"0"),d=+(null!=(n=i.seconds)?n:"0");if(p>23)return null;if(c>59)return null;if(d>59)return null;const f=null!=(o=i.ms)?o:"0",y=f?+f.padEnd(3,"0").substring(0,3):0;let h;if(i.isUTC)h=Date.UTC(a,l,u,p,c,d,y);else if(i.offsetSign){const e=+i.offsetHours,t=+i.offsetMinutes;h=6e4*("+"===i.offsetSign?-1:1)*(60*e+t)+Date.UTC(a,l,u,p,c,d,y)}else h=new Date(a,l,u,p,c,d,y).getTime();return Number.isNaN(h)?null:h}const m=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/;var h=r(88724),g=r(1231),w=r(82971),b=r(6570);const v="xlink:href",S="2.0.0",C="__esri_wfs_id__",x="wfs-layer:feature-type-not-found",_="wfs-layer:unknown-geometry-type";async function P(e,t){const r=function(e){const t=Z(e);(function(e){const t=e.firstElementChild.getAttribute("version");if(t&&t!==S)throw new o.Z("wfs-layer:unsupported-wfs-version",`Unsupported WFS version ${t}. Supported version: ${S}`)})(t),D(t);const r=t.firstElementChild,n=(0,s.Fs)(function(e){return(0,h.H)(e,{FeatureTypeList:{FeatureType:e=>{const t={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",supportedSpatialReferences:[]},r=new Set([4326]),n=e=>{var t,n;const o=parseInt(null==(t=e.textContent.match(/(?<wkid>\d+$)/i))||null==(n=t.groups)?void 0:n.wkid,10);Number.isNaN(o)||r.add(o)};return(0,h.h)(e,{Name:e=>{const{name:r,prefix:n}=A(e.textContent);t.typeName=`${n}:${r}`,t.name=r,t.namespacePrefix=n,t.namespaceUri=e.lookupNamespaceURI(n)},Abstract:e=>{t.description=e.textContent},Title:e=>{t.title=e.textContent},WGS84BoundingBox:e=>{t.extent=function(e){let t,r,n,o;for(const s of e.children)switch(s.localName){case"LowerCorner":[t,r]=s.textContent.split(" ").map((e=>Number.parseFloat(e)));break;case"UpperCorner":[n,o]=s.textContent.split(" ").map((e=>Number.parseFloat(e)))}return{xmin:t,ymin:r,xmax:n,ymax:o,spatialReference:p.Zn}}(e)},DefaultSRS:n,DefaultCRS:n,OtherSRS:n,OtherCRS:n}),t.title||(t.title=t.name),t.supportedSpatialReferences.push(...r),t}}})}(r));return{operations:F(r),get featureTypes(){return Array.from(n())},readFeatureTypes:n}}((await(0,n.default)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:S,...null==t?void 0:t.customParameters},signal:null==t?void 0:t.signal})).data);return function(e,t){(0,l.$U)(e)&&((0,l.D6)(e,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=(0,l.hO)(t.operations.DescribeFeatureType.url)),(0,l.D6)(e,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=(0,l.hO)(t.operations.GetFeature.url)))}(e,r),r}const E=new Set(["json","application/json","geojson","application/json; subtype=geojson"]);function F(e){let t=!1;const r={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}};if((0,h.h)(e,{OperationsMetadata:{Operation:e=>{switch(e.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:e=>{r.GetCapabilities.url=e.getAttribute(v)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:e=>{r.DescribeFeatureType.url=e.getAttribute(v)}}}};case"GetFeature":return{DCP:{HTTP:{Get:e=>{r.GetFeature.url=e.getAttribute(v)}}},Parameter:e=>{if("outputFormat"===e.getAttribute("name"))return{AllowedValues:{Value:e=>{const t=e.textContent;E.has(t.toLowerCase())&&(r.GetFeature.outputFormat=t)}}}}}}},Constraint:e=>{switch(e.getAttribute("name")){case"KVPEncoding":return{DefaultValue:e=>{t="true"===e.textContent.toLowerCase()}};case"ImplementsResultPaging":return{DefaultValue:e=>{r.GetFeature.supportsPagination="true"===e.textContent.toLowerCase()}}}}}}),!t)throw new o.Z("wfs-layer:kvp-encoding-not-supported","WFS service doesn't support key/value pair (KVP) encoding");if((0,i.Wi)(r.GetFeature.outputFormat))throw new o.Z("wfs-layer:geojson-not-supported","WFS service doesn't support GeoJSON output format");return r}function I(e,t,r){return(0,s.sE)(e,(e=>r?e.name===t&&e.namespaceUri===r:e.typeName===t||e.name===t))}async function k(e,t,r,n={}){var s;const{featureType:l,extent:c}=await async function(e,t,r,n={}){const{spatialReference:s=w.Z.WGS84}=n,a=e.readFeatureTypes(),l=t?I(a,t,r):a.next().value;if((0,i.Wi)(l))throw t?new o.Z(x,`The type '${t}' could not be found in the service`):new o.Z("wfs-layer:empty-service","The service is empty");let c=new b.Z({...l.extent,spatialReference:s});if(!(0,p.fS)(s,p.Zn))try{await(0,u.iQ)(p.Zn,s,void 0,n),c=(0,u.iV)(c,p.Zn)}catch{throw new o.Z("wfs-layer:unsupported-spatial-reference","Projection not supported")}return{extent:c,spatialReference:s,featureType:l}}(e,t,r,n),{fields:d,geometryType:f,swapXY:y,objectIdField:m,geometryField:h}=await async function(e,t,r={}){const[n,s]=await(0,a.as)([N(e.operations.DescribeFeatureType.url,t,r),R(e,t,r)]);if(n.error||s.error)throw new o.Z("wfs-layer:getWFSLayerTypeInfo-error",`An error occurred while getting info about the feature type '${t}'`,{error:n.error||s.error});const{fields:l,errors:u}=n.value,p=n.value.geometryType||s.value.geometryType,c=s.value.swapXY;if((0,i.Wi)(p))throw new o.Z(_,`The geometry type could not be determined for type '${t}`,{typeName:t,geometryType:p,fields:l,errors:u});return{...O(l),geometryType:p,swapXY:c}}(e,l.typeName,n);return{url:e.operations.GetCapabilities.url,name:l.name,namespaceUri:l.namespaceUri,fields:d,geometryField:h,geometryType:f,objectIdField:m,spatialReference:null!=(s=n.spatialReference)?s:w.Z.WGS84,extent:c,swapXY:y,wfsCapabilities:e,customParameters:n.customParameters}}function O(e){var t;const r=e.find((e=>"geometry"===e.type));let n=e.find((e=>"oid"===e.type));return e=e.filter((e=>"geometry"!==e.type)),n||(n=new g.Z({name:C,type:"oid",alias:C}),e.unshift(n)),{geometryField:null!=(t=null==r?void 0:r.name)?t:null,objectIdField:n.name,fields:e}}async function R(e,t,r={}){var o;let s,i=!1;const[a,l]=await Promise.all([j(e.operations.GetFeature.url,t,e.operations.GetFeature.outputFormat,{...r,count:1}),(0,n.default)(e.operations.GetFeature.url,{responseType:"text",query:T(t,void 0,{...r,count:1}),signal:null==r?void 0:r.signal})]),u="FeatureCollection"===a.type&&(null==(o=a.features[0])?void 0:o.geometry);if(u){let e;switch(s=c.Mk.fromJSON((0,d.q9)(u.type)),u.type){case"Point":e=u.coordinates;break;case"LineString":case"MultiPoint":e=u.coordinates[0];break;case"MultiLineString":case"Polygon":e=u.coordinates[0][0];break;case"MultiPolygon":e=u.coordinates[0][0][0]}const t=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(l.data);if(t){const r=e[0].toFixed(3),n=e[1].toFixed(3),o=parseFloat(t[1]).toFixed(3);r===parseFloat(t[2]).toFixed(3)&&n===o&&(i=!0)}}return{geometryType:s,swapXY:i}}async function N(e,t,r){return function(e,t){const{name:r}=A(e),n=Z(t);D(n);const a=(0,s.sE)((0,h.H)(n.firstElementChild,{element:e=>({name:e.getAttribute("name"),typeName:A(e.getAttribute("type")).name})}),(({name:e})=>e===r));if((0,i.pC)(a)){const e=(0,s.sE)((0,h.H)(n.firstElementChild,{complexType:e=>e}),(e=>e.getAttribute("name")===a.typeName));if((0,i.pC)(e))return function(e){var t,r;const n=[],s=[];let i;const a=(0,h.H)(e,{complexContent:{extension:{sequence:{element:e=>e}}}});for(const l of a){const a=l.getAttribute("name");if(!a)continue;let u,p;if(l.hasAttribute("type")?u=A(l.getAttribute("type")).name:(0,h.h)(l,{simpleType:{restriction:e=>(u=A(e.getAttribute("base")).name,{maxLength:e=>{p=+e.getAttribute("value")}})}}),!u)continue;const c="true"===l.getAttribute("nillable");let d=!1;switch(u.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":s.push(new g.Z({name:a,alias:a,type:"integer",nullable:c}));break;case"float":case"double":case"decimal":s.push(new g.Z({name:a,alias:a,type:"double",nullable:c}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":s.push(new g.Z({name:a,alias:a,type:"string",nullable:c,length:null!=(t=p)?t:255}));break;case"datetime":case"date":s.push(new g.Z({name:a,alias:a,type:"date",nullable:c,length:null!=(r=p)?r:36}));break;case"pointpropertytype":i="point",d=!0;break;case"multipointpropertytype":i="multipoint",d=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":i="polyline",d=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":i="polygon",d=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":d=!0,n.push(new o.Z(_,`geometry type '${u}' is not supported`,{type:(new XMLSerializer).serializeToString(e)}));break;default:n.push(new o.Z("wfs-layer:unknown-field-type",`Unknown field type '${u}'`,{type:(new XMLSerializer).serializeToString(e)}))}d&&s.push(new g.Z({name:a,alias:a,type:"geometry",nullable:c}))}for(const e of s)if("integer"===e.type&&!e.nullable&&L.has(e.name.toLowerCase())){e.type="oid";break}return{geometryType:i,fields:s,errors:n}}(e)}throw new o.Z(x,`Type '${e}' not found in document`,{document:(new XMLSerializer).serializeToString(n)})}(t,(await(0,n.default)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:S,TYPENAME:t,...null==r?void 0:r.customParameters},signal:null==r?void 0:r.signal})).data)}const L=new Set(["objectid","fid"]);async function j(e,t,r,s){let{data:i}=await(0,n.default)(e,{responseType:"text",query:T(t,r,s),signal:null==s?void 0:s.signal});i=i.replace(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{var a;if(null!=s&&null!=(a=s.dateFields)&&a.length){const e=new Set(s.dateFields);return JSON.parse(i,((t,r)=>e.has(t)?f(r):r))}return JSON.parse(i)}catch(e){throw new o.Z("wfs-layer:malformed-json","Error while parsing the response",{response:i,error:e})}}function T(e,t,r){return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:S,TYPENAMES:e,OUTPUTFORMAT:t,SRSNAME:"EPSG:4326",STARTINDEX:null==r?void 0:r.startIndex,COUNT:null==r?void 0:r.count,...null==r?void 0:r.customParameters}}function Z(e){return(new DOMParser).parseFromString(e.trim(),"text/xml")}function A(e){const[t,r]=e.split(":");return{prefix:r?t:"",name:null!=r?r:t}}function D(e){let t,r;if((0,h.h)(e.firstElementChild,{Exception:e=>(t=e.getAttribute("exceptionCode"),{ExceptionText:e=>{r=e.textContent}})}),t)throw new o.Z(`wfs-layer:${t}`,r)}},88724:(e,t,r)=>{function n(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];if("function"==typeof e){const t=e(r);t&&n(r,t)}else n(r,e)}}function*o(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];"function"==typeof e?yield e(r):yield*o(r,e)}}r.d(t,{H:()=>o,h:()=>n})},2319:(e,t,r)=>{r.d(t,{Z:()=>k});var n,o=r(43697),s=r(78223),i=r(35454),a=r(96674),l=r(22974),u=r(62357),p=r(5600),c=(r(75215),r(71715)),d=r(52011),f=r(30556),y=(r(67676),r(80442),r(8813));let m=n=class extends a.wq{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,t){return t.value?(0,y.dI)(t.value):e}writeExpression(e,t,r){null!=this.value&&(e=(0,y.dI)(this.value)),null!=e&&(t[r]=e)}clone(){return new n({expression:this.expression,title:this.title,value:this.value})}};(0,o._)([(0,p.Cb)({type:String,json:{write:{writerEnsuresNonNull:!0}}})],m.prototype,"expression",void 0),(0,o._)([(0,c.r)("expression",["expression","value"])],m.prototype,"readExpression",null),(0,o._)([(0,f.c)("expression")],m.prototype,"writeExpression",null),(0,o._)([(0,p.Cb)({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],m.prototype,"title",void 0),(0,o._)([(0,p.Cb)({json:{read:!1,write:!1}})],m.prototype,"value",void 0),m=n=(0,o._)([(0,d.j)("esri.layers.support.LabelExpressionInfo")],m);const h=m;var g=r(20256),w=r(4095),b=r(77987),v=r(78724),S=r(58333);b.Z.fromJSON(S.I4),w.Z.fromJSON(S.ET),g.Z.fromJSON(S.lF);const C=v.Z.fromJSON(S.qP);b.Z.fromJSON(S.eG),w.Z.fromJSON(S.wW),g.Z.fromJSON(S.lj);var x,_=r(21878);const P=new i.X({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function E(e){var t;return!e||"service"!==e.origin&&!("map-image"===(null==(t=e.layer)?void 0:t.type))}function F(e){var t,r;return!!function(e){return"map-image"===(null==e?void 0:e.type)}(e)&&!(null==(t=e.capabilities)||null==(r=t.exportMap)||!r.supportsArcadeExpressionForLabeling)}let I=x=class extends a.wq{constructor(e){super(e),this.type="label",this.name=null,this.allowOverrun=!1,this.deconflictionStrategy="static",this.labelExpression=null,this.labelExpressionInfo=null,this.labelPlacement=null,this.labelPosition="curved",this.maxScale=0,this.minScale=0,this.repeatLabel=!0,this.repeatLabelDistance=null,this.symbol=C,this.useCodedValues=void 0,this.where=null}static evaluateWhere(e,t){const r=(e,t,r)=>{switch(t){case"=":return e==r;case"<>":return e!=r;case">":return e>r;case">=":return e>=r;case"<":return e<r;case"<=":return e<=r}return!1};try{if(null==e)return!0;const n=e.split(" ");if(3===n.length)return r(t[n[0]],n[1],n[2]);if(7===n.length){const e=r(t[n[0]],n[1],n[2]),o=n[3],s=r(t[n[4]],n[5],n[6]);switch(o){case"AND":return e&&s;case"OR":return e||s}}return!1}catch(t){console.log("Error.: can't parse = "+e)}}readLabelExpression(e,t){const r=t.labelExpressionInfo;if(!r||!r.value&&!r.expression)return e}writeLabelExpression(e,t,r){if(this.labelExpressionInfo)if(null!=this.labelExpressionInfo.value)e=(0,y.z7)(this.labelExpressionInfo.value);else if(null!=this.labelExpressionInfo.expression){const t=(0,y.el)(this.labelExpressionInfo.expression);t&&(e="["+t+"]")}null!=e&&(t[r]=e)}writeLabelExpressionInfo(e,t,r,n){if(null==e&&null!=this.labelExpression&&E(n))e=new h({expression:this.getLabelExpressionArcade()});else if(!e)return;const o=e.toJSON(n);o.expression&&(t[r]=o)}writeMaxScale(e,t){(e||this.minScale)&&(t.maxScale=e)}writeMinScale(e,t){(e||this.maxScale)&&(t.minScale=e)}getLabelExpression(){return(0,y.hV)(this)}getLabelExpressionArcade(){return(0,y.YI)(this)}getLabelExpressionSingleField(){return(0,y.UO)(this)}hash(){return JSON.stringify(this)}clone(){return new x({allowOverrun:this.allowOverrun,deconflictionStrategy:this.deconflictionStrategy,labelExpression:this.labelExpression,labelExpressionInfo:(0,l.d9)(this.labelExpressionInfo),labelPosition:this.labelPosition,labelPlacement:this.labelPlacement,maxScale:this.maxScale,minScale:this.minScale,name:this.name,repeatLabel:this.repeatLabel,repeatLabelDistance:this.repeatLabelDistance,symbol:(0,l.d9)(this.symbol),where:this.where,useCodedValues:this.useCodedValues})}};(0,o._)([(0,p.Cb)({type:String,json:{write:!0}})],I.prototype,"name",void 0),(0,o._)([(0,p.Cb)({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],I.prototype,"allowOverrun",void 0),(0,o._)([(0,p.Cb)({type:String,json:{write:!0,default:"static",origins:{"web-scene":{write:!1}}}})],I.prototype,"deconflictionStrategy",void 0),(0,o._)([(0,p.Cb)({type:String,json:{write:{overridePolicy(e,t,r){return this.labelExpressionInfo&&"service"===(null==r?void 0:r.origin)&&F(r.layer)?{enabled:!1}:{allowNull:!0}}}}})],I.prototype,"labelExpression",void 0),(0,o._)([(0,c.r)("labelExpression")],I.prototype,"readLabelExpression",null),(0,o._)([(0,f.c)("labelExpression")],I.prototype,"writeLabelExpression",null),(0,o._)([(0,p.Cb)({type:h,json:{write:{overridePolicy:(e,t,r)=>function(e){return E(e)||F(e.layer)}(r)?{allowNull:!0}:{enabled:!1}}}})],I.prototype,"labelExpressionInfo",void 0),(0,o._)([(0,f.c)("labelExpressionInfo")],I.prototype,"writeLabelExpressionInfo",null),(0,o._)([(0,p.Cb)({type:P.apiValues,json:{type:P.jsonValues,read:P.read,write:P.write}})],I.prototype,"labelPlacement",void 0),(0,o._)([(0,p.Cb)({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],I.prototype,"labelPosition",void 0),(0,o._)([(0,p.Cb)({type:Number})],I.prototype,"maxScale",void 0),(0,o._)([(0,f.c)("maxScale")],I.prototype,"writeMaxScale",null),(0,o._)([(0,p.Cb)({type:Number})],I.prototype,"minScale",void 0),(0,o._)([(0,f.c)("minScale")],I.prototype,"writeMinScale",null),(0,o._)([(0,p.Cb)({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:!1}}}})],I.prototype,"repeatLabel",void 0),(0,o._)([(0,p.Cb)({type:Number,cast:u.t_,json:{write:!0,origins:{"web-scene":{write:!1}}}})],I.prototype,"repeatLabelDistance",void 0),(0,o._)([(0,p.Cb)({types:s.yK,json:{origins:{"web-scene":{types:s.S6,write:_.vX,default:null}},write:_.vX,default:null}})],I.prototype,"symbol",void 0),(0,o._)([(0,p.Cb)({type:Boolean,json:{write:!0}})],I.prototype,"useCodedValues",void 0),(0,o._)([(0,p.Cb)({type:String,json:{write:!0}})],I.prototype,"where",void 0),I=x=(0,o._)([(0,d.j)("esri.layers.support.LabelClass")],I);const k=I},8813:(e,t,r)=>{r.d(t,{UO:()=>f,YI:()=>d,dI:()=>y,el:()=>b,hV:()=>c,z7:()=>p});var n=r(19153);const o="__begin__",s="__end__",i=new RegExp(o,"ig"),a=new RegExp(s,"ig"),l=new RegExp("^"+o,"i"),u=new RegExp(s+"$","i");function p(e){return e.replace(new RegExp("\\{","g"),"[").replace(new RegExp("\\}","g"),"]")}function c(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=function(e){return e.replace(new RegExp("\\[","g"),"{").replace(new RegExp("\\]","g"),"}")}(e.labelExpression),t.type="conventional"),t}function d(e){const t=c(e);if(!t)return null;switch(t.type){case"conventional":return y(t.expression);case"arcade":return t.expression}return null}function f(e){const t=c(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e.match(m);return t&&t[1].trim()||null}(t.expression);case"arcade":return b(t.expression)}return null}function y(e){let t;return e?(t=(0,n.gx)(e,(e=>o+'$feature["'+e+'"]'+s)),t=l.test(t)?t.replace(l,""):'"'+t,t=u.test(t)?t.replace(u,""):t+'"',t=t.replace(i,'" + ').replace(a,' + "')):t='""',t}const m=/^\s*\{([^}]+)\}\s*$/i,h=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,g=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,w=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function b(e){if(!e)return null;let t=h.exec(e)||g.exec(e);return t?t[1]||t[3]:(t=w.exec(e),t?t[2]:null)}},51706:(e,t,r)=>{var n,o;function s(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function i(e){return null!=e&&!isNaN(e)&&isFinite(e)}function a(e){return e.valueExpression?n.Expression:e.field&&"string"==typeof e.field?n.Field:n.Unknown}function l(e,t){const r=t||a(e),s=e.valueUnit||"unknown";return r===n.Unknown?o.Constant:e.stops?o.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?o.ClampedLinear:"unknown"===s?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?o.Proportional:o.Additive:o.Identity:o.RealWorldSize}r.d(t,{PS:()=>a,QW:()=>l,RY:()=>n,hL:()=>o,iY:()=>s,qh:()=>i}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(n||(n={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(o||(o={}))},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>v});var n,o=r(43697),s=r(66577),i=r(38171),a=r(35454),l=r(96674),u=r(22974),p=r(70586),c=r(5600),d=(r(75215),r(71715)),f=r(52011),y=r(30556),m=r(82971),h=r(33955),g=r(1231);const w=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let b=n=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=m.Z.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const o=e[t],s=i.Z.fromJSON(o),a=o.geometry&&o.geometry.spatialReference;(0,p.pC)(s.geometry)&&!a&&(s.geometry.spatialReference=r);const l=o.aggregateGeometries,u=s.aggregateGeometries;if(l&&(0,p.pC)(u))for(const e in u){const t=u[e],n=l[e],o=null==n?void 0:n.spatialReference;(0,p.pC)(t)&&!o&&(t.spatialReference=r)}n.push(s)}return n}writeGeometryType(e,t,r,n){if(e)return void w.write(e,t,r,n);const{features:o}=this;if(o)for(const e of o)if(e&&(0,p.pC)(e.geometry))return void w.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,n=(0,h.im)(e);return!r&&t.spatialReference&&(n.spatialReference=m.Z.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,p.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const n=t.features[r];if(n.geometry){const t=e&&e[r];n.geometry=t&&t.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,r],translate:[n,o]}=e,s=this.features,i=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-n)/t)),(e=>Math.round((o-e)/r)));for(let e=0,t=s.length;e<t;e++)i((0,p.Wg)(s[e].geometry))||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[n,o],scale:[s,i]}=r,a=this._getHydrationFunction(e,(e=>e*s+n),(e=>o-e*i));for(const{geometry:e}of t)(0,p.pC)(e)&&a(e);return this.transform=null,this}_quantizePoints(e,t,r){let n,o;const s=[];for(let i=0,a=e.length;i<a;i++){const a=e[i];if(i>0){const e=t(a[0]),i=r(a[1]);e===n&&i===o||(s.push([e-n,i-o]),n=e,o=i)}else n=t(a[0]),o=r(a[1]),s.push([n,o])}return s.length>0?s:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const n=(0,h.oU)(e)?e.rings:e.paths,o=[];for(let e=0,s=n.length;e<s;e++){const s=n[e],i=this._quantizePoints(s,t,r);i&&o.push(i)}return o.length>0?((0,h.oU)(e)?e.rings=o:e.paths=o,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,r);return n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const n=(0,h.oU)(e)?e.rings:e.paths;let o,s;for(let e=0,i=n.length;e<i;e++){const i=n[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];e>0?(o+=n[0],s+=n[1]):(o=n[0],s=n[1]),n[0]=t(o),n[1]=r(s)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const n=e.points;let o,s;for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(o+=i[0],s+=i[1]):(o=i[0],s=i[1]),i[0]=t(o),i[1]=r(s)}}:void 0}};(0,o._)([(0,c.Cb)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,o._)([(0,c.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,o._)([(0,c.Cb)({type:[i.Z],json:{write:!0}})],b.prototype,"features",void 0),(0,o._)([(0,d.r)("features")],b.prototype,"readFeatures",null),(0,o._)([(0,c.Cb)({type:[g.Z],json:{write:!0}})],b.prototype,"fields",void 0),(0,o._)([(0,c.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],b.prototype,"geometryType",void 0),(0,o._)([(0,y.c)("geometryType")],b.prototype,"writeGeometryType",null),(0,o._)([(0,c.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,o._)([(0,c.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,o._)([(0,c.Cb)({types:s.qM,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,o._)([(0,d.r)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,o._)([(0,c.Cb)({type:m.Z,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,o._)([(0,y.c)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,o._)([(0,c.Cb)({json:{write:!0}})],b.prototype,"transform",void 0),b=n=(0,o._)([(0,f.j)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0;const v=b},32163:(e,t,r)=>{r.d(t,{eZ:()=>c});var n=r(51773),o=r(35671),s=r(84649),i=(r(63801),r(48074),r(38745),r(9190)),a=(r(10214),r(44951),r(422)),l=r(63061);const u=["oid","global-id"],p=["oid","global-id","guid"];function c({displayField:e,editFieldsInfo:t,fields:r,objectIdField:l,title:u},p){if(!r)return null;const c=function({editFieldsInfo:e,fields:t,objectIdField:r},n){return function(e,t){const r=e;return t&&(e=e.filter((e=>!t.includes(e.type)))),e===r&&(e=e.slice()),e.sort(y),e}(t,(null==n?void 0:n.ignoreFieldTypes)||b).map((t=>new a.Z({fieldName:t.name,isEditable:h(t,e),label:t.alias,format:g(t),visible:f(t,{editFieldsInfo:e,objectIdField:r,visibleFieldNames:null==n?void 0:n.visibleFieldNames})})))}({editFieldsInfo:t,fields:r,objectIdField:l},p);if(!c.length)return null;const d=function(e){const t=(0,o.O5)(e),{titleBase:r}=e;return t?`${r}: {${t.trim()}}`:r}({titleBase:u,fields:r,displayField:e}),m=[new i.Z,new s.Z];return new n.Z({title:d,content:m,fieldInfos:c})}const d=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/shape/i,/perimeter/i,/objectid/i,/_i$/i],f=(e,{editFieldsInfo:t,objectIdField:r,visibleFieldNames:n})=>n?n.has(e.name):!(m(e.name,t)||r&&e.name===r||u.includes(e.type)||d.some((t=>t.test(e.name))));function y(e,t){return"oid"===e.type?-1:"oid"===t.type?1:w(e)?-1:w(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function m(e,t){if(!e||!t)return!1;const{creationDateField:r,creatorField:n,editDateField:o,editorField:s}=t;return[r&&r.toLowerCase(),n&&n.toLowerCase(),o&&o.toLowerCase(),s&&s.toLowerCase()].includes(e.toLowerCase())}function h(e,t){return e.editable&&!p.includes(e.type)&&!m(e.name,t)}function g(e){switch(e.type){case"small-integer":case"integer":case"single":return new l.Z({digitSeparator:!0,places:0});case"double":return new l.Z({digitSeparator:!0,places:2});case"date":return new l.Z({dateFormat:"long-month-day-year"});default:return"string"===e.type&&(0,o.Ec)(e.name)?new l.Z({digitSeparator:!0,places:0}):null}}function w(e){return"name"===(e.name&&e.name.toLowerCase())||"name"===(e.alias&&e.alias.toLowerCase())||void 0}const b=["geometry","blob","raster","guid","xml"]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[739,4889],{57435:(e,t,r)=>{r.d(t,{Z:()=>y});var s=r(43697),i=r(80539),o=r(3920),n=r(70586),l=(r(95330),r(26258),r(87538)),a=r(5600),u=(r(67676),r(80442),r(75215),r(52011));let p=class extends((0,o.p)(i.Z)){constructor(e){super(e),this.getCollections=null}initialize(){this.handles.add((0,l.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=(0,n.pC)(this.getCollections)?this.getCollections():null;if((0,n.Wi)(e))return void this.removeAll();let t=0;for(const r of e)(0,n.pC)(r)&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new i.Z(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction?this.itemFilterFunction:e=>!!e;for(const s of t)if(s){if(r(s)){const t=this.indexOf(s,e);t>=0?t!==e&&this.reorder(s,e):this.add(s,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(s);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,s._)([(0,a.Cb)()],p.prototype,"getCollections",void 0),(0,s._)([(0,a.Cb)()],p.prototype,"getChildrenFunction",void 0),(0,s._)([(0,a.Cb)()],p.prototype,"itemFilterFunction",void 0),p=(0,s._)([(0,u.j)("esri.core.CollectionFlattener")],p);const y=p},42756:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Q});var s=r(43697),i=(r(66577),r(80539)),o=r(57435),n=r(70586),l=r(16453),a=r(95330),u=r(17445),p=r(17452),y=r(5600),h=(r(67676),r(80442),r(75215)),d=r(71715),c=r(52011),f=r(30556),m=r(82971),g=r(29600),b=r(71612),v=r(38009),_=r(16859),C=r(34760),w=r(72965),S=r(21506),I=r(32448),x=r(96674),P=r(83379),F=r(19153),E=r(90578),k=r(68773),R=r(40330),G=(r(51773),r(3172)),T=r(22974),Z=r(60437),L=r(20322);r(91423),r(74889);const O={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function j(e){const t=e.folders||[],r=t.slice(),s=new Map,i=new Map,o=new Map,n=new Map,l=new Map,a={esriGeometryPoint:i,esriGeometryPolyline:o,esriGeometryPolygon:n};(e.featureCollection&&e.featureCollection.layers||[]).forEach((e=>{const t=(0,T.d9)(e);t.featureSet.features=[];const r=e.featureSet.geometryType;s.set(r,t);const l=e.layerDefinition.objectIdField;"esriGeometryPoint"===r?z(i,l,e.featureSet.features):"esriGeometryPolyline"===r?z(o,l,e.featureSet.features):"esriGeometryPolygon"===r&&z(n,l,e.featureSet.features)})),e.groundOverlays&&e.groundOverlays.forEach((e=>{l.set(e.id,e)})),t.forEach((t=>{t.networkLinkIds.forEach((s=>{const i=function(e,t,r){const s=function(e,t){let r;return t.some((t=>t.id===e&&(r=t,!0))),r}(e,r);return s&&(s.parentFolderId=t,s.networkLink=s),s}(s,t.id,e.networkLinks);i&&r.push(i)}))})),r.forEach((e=>{if(e.featureInfos){e.points=(0,T.d9)(s.get("esriGeometryPoint")),e.polylines=(0,T.d9)(s.get("esriGeometryPolyline")),e.polygons=(0,T.d9)(s.get("esriGeometryPolygon")),e.mapImages=[];for(const t of e.featureInfos)switch(t.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const r=a[t.type].get(t.id);r&&e[O[t.type]].featureSet.features.push(r);break}case"GroundOverlay":{const r=l.get(t.id);r&&e.mapImages.push(r);break}}e.fullExtent=U([e])}}));const u=U(r);return{folders:t,sublayers:r,extent:u}}function N(e,t,r,s){const i=R.id&&R.id.findCredential(e);e=(0,p.fl)(e,{token:i&&i.token});const o=k.Z.kmlServiceUrl;return(0,G.default)(o,{query:{url:e,model:"simple",folders:"",refresh:0!==r||void 0,outSR:JSON.stringify(t)},responseType:"json",signal:s})}function M(e,t,r=null,s=[]){const i=[],o={},n=t.sublayers,l=t.folders.map((e=>e.id));return n.forEach((t=>{const n=new e;if(r?n.read(t,r):n.read(t),s.length&&l.includes(n.id)&&(n.visible=s.includes(n.id)),o[t.id]=n,null!=t.parentFolderId&&-1!==t.parentFolderId){const e=o[t.parentFolderId];e.sublayers||(e.sublayers=[]),e.sublayers.unshift(n)}else i.unshift(n)})),i}function z(e,t,r){r.forEach((r=>{e.set(r.attributes[t],r)}))}function U(e){const t=(0,Z.Ue)(Z.Gv),r=(0,Z.Ue)(Z.Gv);for(const s of e){if(s.polygons&&s.polygons.featureSet&&s.polygons.featureSet.features)for(const e of s.polygons.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.polylines&&s.polylines.featureSet&&s.polylines.featureSet.features)for(const e of s.polylines.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.points&&s.points.featureSet&&s.points.featureSet.features)for(const e of s.points.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.mapImages)for(const e of s.mapImages)(0,L.Yg)(t,e.extent),(0,Z.TC)(r,t)}return(0,Z.fS)(r,Z.Gv)?null:{xmin:r[0],ymin:r[1],zmin:r[2],xmax:r[3],ymax:r[4],zmax:r[5],spatialReference:m.Z.WGS84}}var D,q=r(6570);let H=D=class extends(I.Z.EventedMixin((0,x.eC)(P.Z))){constructor(){super(...arguments),this._sublayersHandles=null,this.description=null,this.id=null,this.networkLink=null,this.title=null,this.sourceJSON=null,this.fullExtent=null}initialize(){(0,u.N1)((()=>this.networkLink)).then((()=>(0,u.N1)((()=>!0===this.visible)))).then((()=>this.load()))}load(e){if(!this.networkLink)return;if(this.networkLink.viewFormat)return;const t=(0,n.pC)(e)?e.signal:null,r=this._fetchService(this._get("networkLink").href,t).then((e=>{const t=U(e.sublayers);this.fullExtent=q.Z.fromJSON(t),this.sourceJSON=e;const r=(0,h.se)(i.Z.ofType(D),M(D,e));this.sublayers?this.sublayers.addMany(r):this.sublayers=r,this.layer.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")}));return this.addResolvingPromise(r),Promise.resolve(this)}set sublayers(e){const t=this._get("sublayers");t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this._sublayersHandles.forEach((e=>e.remove())),this._sublayersHandles=null),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this._sublayersHandles=[e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))]),this._set("sublayers",e)}castSublayers(e){return(0,h.se)(i.Z.ofType(D),e)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach((t=>t.layer=e))}_fetchService(e,t){return N(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then((e=>j(e.data)))}};(0,s._)([(0,y.Cb)()],H.prototype,"description",void 0),(0,s._)([(0,y.Cb)()],H.prototype,"id",void 0),(0,s._)([(0,y.Cb)({readOnly:!0,value:null})],H.prototype,"networkLink",void 0),(0,s._)([(0,y.Cb)({json:{write:{allowNull:!0}}})],H.prototype,"parent",void 0),(0,s._)([(0,y.Cb)({value:null,json:{write:{allowNull:!0}}})],H.prototype,"sublayers",null),(0,s._)([(0,E.p)("sublayers")],H.prototype,"castSublayers",null),(0,s._)([(0,y.Cb)({value:null,json:{read:{source:"name",reader:e=>(0,F.Cb)(e)}}})],H.prototype,"title",void 0),(0,s._)([(0,y.Cb)({value:!0})],H.prototype,"visible",null),(0,s._)([(0,d.r)("visible",["visibility"])],H.prototype,"readVisible",null),(0,s._)([(0,y.Cb)()],H.prototype,"sourceJSON",void 0),(0,s._)([(0,y.Cb)({value:null})],H.prototype,"layer",null),(0,s._)([(0,y.Cb)({type:q.Z})],H.prototype,"fullExtent",void 0),H=D=(0,s._)([(0,c.j)("esri.layers.support.KMLSublayer")],H);const J=H,W=["kml","xml"];let A=class extends((0,b.h)((0,C.Q)((0,w.M)((0,v.q)((0,_.I)((0,l.R)(g.Z))))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new o.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=m.Z.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.own([(0,u.YP)((()=>this.sublayers),((e,t)=>{t&&t.forEach((e=>{e.parent=null,e.layer=null})),e&&e.forEach((e=>{e.parent=this,e.layer=this}))}),u.Z_),this.on("sublayer-update",(()=>this.notifyChange("fullExtent")))])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,r){return M(J,t,r,this._visibleFolders)}writeSublayers(e,t){const r=[],s=e.toArray();for(;s.length;){const e=s[0];e.networkLink||(e.visible&&r.push(e.id),e.sublayers&&s.push(...e.sublayers.toArray())),s.shift()}t.visibleFolders=r}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,p.vt)(this.url,W)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],r=e=>{e.visible&&(t.push(e),e.sublayers&&e.sublayers.forEach(r))};return e&&e.forEach(r),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=(0,n.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"]},e).catch(a.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=j((await Promise.resolve().then((()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:N(this.url,this.outSpatialReference,this.refreshInterval,e)))).data);t&&this.read(t,{origin:"service"})}_recomputeFullExtent(){let e=null;(0,n.pC)(this.extent)&&(e=this.extent.clone());const t=r=>{if(r.sublayers)for(const s of r.sublayers.items)t(s),s.visible&&s.fullExtent&&((0,n.pC)(e)?e.union(s.fullExtent):e=s.fullExtent.clone())};return t(this),e}};(0,s._)([(0,y.Cb)({readOnly:!0})],A.prototype,"allSublayers",void 0),(0,s._)([(0,y.Cb)({type:m.Z})],A.prototype,"outSpatialReference",void 0),(0,s._)([(0,y.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],A.prototype,"path",void 0),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1,write:!1}})],A.prototype,"legendEnabled",void 0),(0,s._)([(0,y.Cb)({type:["show","hide","hide-children"]})],A.prototype,"listMode",void 0),(0,s._)([(0,y.Cb)({type:["KML"]})],A.prototype,"operationalLayerType",void 0),(0,s._)([(0,y.Cb)({})],A.prototype,"resourceInfo",void 0),(0,s._)([(0,y.Cb)({type:i.Z.ofType(J),json:{write:{ignoreOrigin:!0}}})],A.prototype,"sublayers",void 0),(0,s._)([(0,d.r)(["web-map","portal-item"],"sublayers",["visibleFolders"])],A.prototype,"readSublayersFromItemOrWebMap",null),(0,s._)([(0,d.r)("service","sublayers",["sublayers"])],A.prototype,"readSublayers",null),(0,s._)([(0,f.c)("sublayers")],A.prototype,"writeSublayers",null),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],A.prototype,"type",void 0),(0,s._)([(0,y.Cb)({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],A.prototype,"title",null),(0,s._)([(0,y.Cb)(S.HQ)],A.prototype,"url",void 0),(0,s._)([(0,y.Cb)({readOnly:!0})],A.prototype,"visibleSublayers",null),(0,s._)([(0,y.Cb)({type:q.Z})],A.prototype,"extent",void 0),(0,s._)([(0,y.Cb)()],A.prototype,"fullExtent",null),A=(0,s._)([(0,c.j)("esri.layers.KMLLayer")],A);const Q=A},16859:(e,t,r)=>{r.d(t,{I:()=>_});var s=r(43697),i=r(40330),o=r(3172),n=r(66643),l=r(20102),a=r(92604),u=r(70586),p=r(95330),y=r(17452),h=r(5600),d=(r(67676),r(80442),r(75215),r(71715)),c=r(52011),f=r(30556),m=r(65587),g=r(15235),b=r(86082);const v=a.Z.getLogger("esri.layers.mixins.PortalLayer"),_=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new g.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const s=await r.e(8062).then(r.bind(r,18062));return(0,p.k_)(t),await s.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||v.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==i.id?void 0:i.id.findCredential(this.url):null;if(!t)return!0;const r=C.credential===t?C.user:await this._fetchEditingUser(e);return C.credential=t,C.user=r,(0,u.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,r;const s=null==(t=this.portalItem)||null==(r=t.portal)?void 0:r.user;if(s)return s;const l=i.id.findServerInfo(this.url);if(null==l||!l.owningSystemUrl)return null;const a=`${l.owningSystemUrl}/sharing/rest`,p=m.Z.getDefault();if(p&&p.loaded&&(0,y.Fv)(p.restUrl)===(0,y.Fv)(a))return p.user;const h=`${a}/community/self`,d=(0,u.pC)(e)?e.signal:null,c=await(0,n.q6)((0,o.default)(h,{authMode:"no-prompt",query:{f:"json"},signal:d}));return c.ok?b.default.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||m.Z.getDefault());return r&&s&&!(0,y.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save the scene, set the layer.portalItem to null or save the scene to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,h.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,s._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,f.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,h.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,s._)([(0,c.j)("esri.layers.mixins.PortalLayer")],t),t},C={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>g});var s=r(43697),i=r(92604),o=r(95330),n=r(5600),l=(r(67676),r(80442),r(75215),r(52011)),a=r(80539),u=(r(26258),r(87538));const p=new a.Z,y=new WeakMap;function h(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function d(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:d(t,e%t):0}let c=0,f=0;function m(){const e=Date.now();for(const r of p)if(r.refreshInterval){var t;e-(null!=(t=y.get(r))?t:0)+5>=6e4*r.refreshInterval&&(y.set(r,e),r.refresh(e))}}(0,u.EH)((()=>{const e=Date.now();let t=0;for(const r of p)t=d(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?y.get(r)||y.set(r,e):y.delete(r);if(t!==f){if(f=t,clearInterval(c),0===f)return void(c=0);c=setInterval(m,f)}}));const g=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,o.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){h(e)&&p.push(e)}(this)}),(()=>{}))}destroy(){h(this)&&p.includes(this)&&p.remove(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,o.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{i.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,s._)([(0,n.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,s._)([(0,n.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,s._)([(0,n.Cb)()],t.prototype,"refreshParameters",null),t=(0,s._)([(0,l.j)("esri.layers.mixins.RefreshableLayer")],t),t}},51706:(e,t,r)=>{var s,i;function o(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function n(e){return null!=e&&!isNaN(e)&&isFinite(e)}function l(e){return e.valueExpression?s.Expression:e.field&&"string"==typeof e.field?s.Field:s.Unknown}function a(e,t){const r=t||l(e),o=e.valueUnit||"unknown";return r===s.Unknown?i.Constant:e.stops?i.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?i.ClampedLinear:"unknown"===o?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?i.Proportional:i.Additive:i.Identity:i.RealWorldSize}r.d(t,{PS:()=>l,QW:()=>a,RY:()=>s,hL:()=>i,iY:()=>o,qh:()=>n}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(s||(s={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(i||(i={}))},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>_});var s,i=r(43697),o=r(66577),n=r(38171),l=r(35454),a=r(96674),u=r(22974),p=r(70586),y=r(5600),h=(r(75215),r(71715)),d=r(52011),c=r(30556),f=r(82971),m=r(33955),g=r(1231);const b=new l.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=s=class extends a.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=f.Z.fromJSON(t.spatialReference),s=[];for(let t=0;t<e.length;t++){const i=e[t],o=n.Z.fromJSON(i),l=i.geometry&&i.geometry.spatialReference;(0,p.pC)(o.geometry)&&!l&&(o.geometry.spatialReference=r);const a=i.aggregateGeometries,u=o.aggregateGeometries;if(a&&(0,p.pC)(u))for(const e in u){const t=u[e],s=a[e],i=null==s?void 0:s.spatialReference;(0,p.pC)(t)&&!i&&(t.spatialReference=r)}s.push(o)}return s}writeGeometryType(e,t,r,s){if(e)return void b.write(e,t,r,s);const{features:i}=this;if(i)for(const e of i)if(e&&(0,p.pC)(e.geometry))return void b.write(e.geometry.type,t,r,s)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,s=(0,m.im)(e);return!r&&t.spatialReference&&(s.spatialReference=f.Z.fromJSON(t.spatialReference)),s}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,p.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new s(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const s=t.features[r];if(s.geometry){const t=e&&e[r];s.geometry=t&&t.toJSON()||s.geometry}}return t}quantize(e){const{scale:[t,r],translate:[s,i]}=e,o=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-s)/t)),(e=>Math.round((i-e)/r)));for(let e=0,t=o.length;e<t;e++)n((0,p.Wg)(o[e].geometry))||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[s,i],scale:[o,n]}=r,l=this._getHydrationFunction(e,(e=>e*o+s),(e=>i-e*n));for(const{geometry:e}of t)(0,p.pC)(e)&&l(e);return this.transform=null,this}_quantizePoints(e,t,r){let s,i;const o=[];for(let n=0,l=e.length;n<l;n++){const l=e[n];if(n>0){const e=t(l[0]),n=r(l[1]);e===s&&n===i||(o.push([e-s,n-i]),s=e,i=n)}else s=t(l[0]),i=r(l[1]),o.push([s,i])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const s=(0,m.oU)(e)?e.rings:e.paths,i=[];for(let e=0,o=s.length;e<o;e++){const o=s[e],n=this._quantizePoints(o,t,r);n&&i.push(n)}return i.length>0?((0,m.oU)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const s=this._quantizePoints(e.points,t,r);return s.length>0?(e.points=s,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const s=(0,m.oU)(e)?e.rings:e.paths;let i,o;for(let e=0,n=s.length;e<n;e++){const n=s[e];for(let e=0,s=n.length;e<s;e++){const s=n[e];e>0?(i+=s[0],o+=s[1]):(i=s[0],o=s[1]),s[0]=t(i),s[1]=r(o)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const s=e.points;let i,o;for(let e=0,n=s.length;e<n;e++){const n=s[e];e>0?(i+=n[0],o+=n[1]):(i=n[0],o=n[1]),n[0]=t(i),n[1]=r(o)}}:void 0}};(0,i._)([(0,y.Cb)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,y.Cb)({type:[n.Z],json:{write:!0}})],v.prototype,"features",void 0),(0,i._)([(0,h.r)("features")],v.prototype,"readFeatures",null),(0,i._)([(0,y.Cb)({type:[g.Z],json:{write:!0}})],v.prototype,"fields",void 0),(0,i._)([(0,y.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:b.read}}})],v.prototype,"geometryType",void 0),(0,i._)([(0,c.c)("geometryType")],v.prototype,"writeGeometryType",null),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,i._)([(0,y.Cb)({types:o.qM,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,i._)([(0,h.r)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,i._)([(0,y.Cb)({type:f.Z,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,i._)([(0,c.c)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,i._)([(0,y.Cb)({json:{write:!0}})],v.prototype,"transform",void 0),v=s=(0,i._)([(0,d.j)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0;const _=v}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[739,4889],{57435:(e,t,r)=>{r.d(t,{Z:()=>y});var s=r(43697),i=r(80539),o=r(3920),n=r(70586),l=(r(95330),r(26258),r(87538)),a=r(5600),u=(r(67676),r(80442),r(75215),r(52011));let p=class extends((0,o.p)(i.Z)){constructor(e){super(e),this.getCollections=null}initialize(){this.handles.add((0,l.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=(0,n.pC)(this.getCollections)?this.getCollections():null;if((0,n.Wi)(e))return void this.removeAll();let t=0;for(const r of e)(0,n.pC)(r)&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new i.Z(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction?this.itemFilterFunction:e=>!!e;for(const s of t)if(s){if(r(s)){const t=this.indexOf(s,e);t>=0?t!==e&&this.reorder(s,e):this.add(s,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(s);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,s._)([(0,a.Cb)()],p.prototype,"getCollections",void 0),(0,s._)([(0,a.Cb)()],p.prototype,"getChildrenFunction",void 0),(0,s._)([(0,a.Cb)()],p.prototype,"itemFilterFunction",void 0),p=(0,s._)([(0,u.j)("esri.core.CollectionFlattener")],p);const y=p},42756:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Q});var s=r(43697),i=(r(66577),r(80539)),o=r(57435),n=r(70586),l=r(16453),a=r(95330),u=r(17445),p=r(17452),y=r(5600),h=(r(67676),r(80442),r(75215)),d=r(71715),c=r(52011),f=r(30556),m=r(82971),g=r(29600),b=r(71612),v=r(38009),_=r(16859),C=r(34760),w=r(72965),S=r(21506),I=r(32448),x=r(96674),P=r(83379),F=r(19153),E=r(90578),k=r(68773),R=r(40330),G=(r(51773),r(3172)),T=r(22974),Z=r(60437),L=r(20322);r(91423),r(74889);const O={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function j(e){const t=e.folders||[],r=t.slice(),s=new Map,i=new Map,o=new Map,n=new Map,l=new Map,a={esriGeometryPoint:i,esriGeometryPolyline:o,esriGeometryPolygon:n};(e.featureCollection&&e.featureCollection.layers||[]).forEach((e=>{const t=(0,T.d9)(e);t.featureSet.features=[];const r=e.featureSet.geometryType;s.set(r,t);const l=e.layerDefinition.objectIdField;"esriGeometryPoint"===r?z(i,l,e.featureSet.features):"esriGeometryPolyline"===r?z(o,l,e.featureSet.features):"esriGeometryPolygon"===r&&z(n,l,e.featureSet.features)})),e.groundOverlays&&e.groundOverlays.forEach((e=>{l.set(e.id,e)})),t.forEach((t=>{t.networkLinkIds.forEach((s=>{const i=function(e,t,r){const s=function(e,t){let r;return t.some((t=>t.id===e&&(r=t,!0))),r}(e,r);return s&&(s.parentFolderId=t,s.networkLink=s),s}(s,t.id,e.networkLinks);i&&r.push(i)}))})),r.forEach((e=>{if(e.featureInfos){e.points=(0,T.d9)(s.get("esriGeometryPoint")),e.polylines=(0,T.d9)(s.get("esriGeometryPolyline")),e.polygons=(0,T.d9)(s.get("esriGeometryPolygon")),e.mapImages=[];for(const t of e.featureInfos)switch(t.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const r=a[t.type].get(t.id);r&&e[O[t.type]].featureSet.features.push(r);break}case"GroundOverlay":{const r=l.get(t.id);r&&e.mapImages.push(r);break}}e.fullExtent=U([e])}}));const u=U(r);return{folders:t,sublayers:r,extent:u}}function N(e,t,r,s){const i=R.id&&R.id.findCredential(e);e=(0,p.fl)(e,{token:i&&i.token});const o=k.Z.kmlServiceUrl;return(0,G.default)(o,{query:{url:e,model:"simple",folders:"",refresh:0!==r||void 0,outSR:JSON.stringify(t)},responseType:"json",signal:s})}function M(e,t,r=null,s=[]){const i=[],o={},n=t.sublayers,l=t.folders.map((e=>e.id));return n.forEach((t=>{const n=new e;if(r?n.read(t,r):n.read(t),s.length&&l.includes(n.id)&&(n.visible=s.includes(n.id)),o[t.id]=n,null!=t.parentFolderId&&-1!==t.parentFolderId){const e=o[t.parentFolderId];e.sublayers||(e.sublayers=[]),e.sublayers.unshift(n)}else i.unshift(n)})),i}function z(e,t,r){r.forEach((r=>{e.set(r.attributes[t],r)}))}function U(e){const t=(0,Z.Ue)(Z.Gv),r=(0,Z.Ue)(Z.Gv);for(const s of e){if(s.polygons&&s.polygons.featureSet&&s.polygons.featureSet.features)for(const e of s.polygons.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.polylines&&s.polylines.featureSet&&s.polylines.featureSet.features)for(const e of s.polylines.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.points&&s.points.featureSet&&s.points.featureSet.features)for(const e of s.points.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.mapImages)for(const e of s.mapImages)(0,L.Yg)(t,e.extent),(0,Z.TC)(r,t)}return(0,Z.fS)(r,Z.Gv)?null:{xmin:r[0],ymin:r[1],zmin:r[2],xmax:r[3],ymax:r[4],zmax:r[5],spatialReference:m.Z.WGS84}}var D,q=r(6570);let H=D=class extends(I.Z.EventedMixin((0,x.eC)(P.Z))){constructor(){super(...arguments),this._sublayersHandles=null,this.description=null,this.id=null,this.networkLink=null,this.title=null,this.sourceJSON=null,this.fullExtent=null}initialize(){(0,u.N1)((()=>this.networkLink)).then((()=>(0,u.N1)((()=>!0===this.visible)))).then((()=>this.load()))}load(e){if(!this.networkLink)return;if(this.networkLink.viewFormat)return;const t=(0,n.pC)(e)?e.signal:null,r=this._fetchService(this._get("networkLink").href,t).then((e=>{const t=U(e.sublayers);this.fullExtent=q.Z.fromJSON(t),this.sourceJSON=e;const r=(0,h.se)(i.Z.ofType(D),M(D,e));this.sublayers?this.sublayers.addMany(r):this.sublayers=r,this.layer.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")}));return this.addResolvingPromise(r),Promise.resolve(this)}set sublayers(e){const t=this._get("sublayers");t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this._sublayersHandles.forEach((e=>e.remove())),this._sublayersHandles=null),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this._sublayersHandles=[e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))]),this._set("sublayers",e)}castSublayers(e){return(0,h.se)(i.Z.ofType(D),e)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach((t=>t.layer=e))}_fetchService(e,t){return N(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then((e=>j(e.data)))}};(0,s._)([(0,y.Cb)()],H.prototype,"description",void 0),(0,s._)([(0,y.Cb)()],H.prototype,"id",void 0),(0,s._)([(0,y.Cb)({readOnly:!0,value:null})],H.prototype,"networkLink",void 0),(0,s._)([(0,y.Cb)({json:{write:{allowNull:!0}}})],H.prototype,"parent",void 0),(0,s._)([(0,y.Cb)({value:null,json:{write:{allowNull:!0}}})],H.prototype,"sublayers",null),(0,s._)([(0,E.p)("sublayers")],H.prototype,"castSublayers",null),(0,s._)([(0,y.Cb)({value:null,json:{read:{source:"name",reader:e=>(0,F.Cb)(e)}}})],H.prototype,"title",void 0),(0,s._)([(0,y.Cb)({value:!0})],H.prototype,"visible",null),(0,s._)([(0,d.r)("visible",["visibility"])],H.prototype,"readVisible",null),(0,s._)([(0,y.Cb)()],H.prototype,"sourceJSON",void 0),(0,s._)([(0,y.Cb)({value:null})],H.prototype,"layer",null),(0,s._)([(0,y.Cb)({type:q.Z})],H.prototype,"fullExtent",void 0),H=D=(0,s._)([(0,c.j)("esri.layers.support.KMLSublayer")],H);const J=H,W=["kml","xml"];let A=class extends((0,b.h)((0,C.Q)((0,w.M)((0,v.q)((0,_.I)((0,l.R)(g.Z))))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new o.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=m.Z.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.own([(0,u.YP)((()=>this.sublayers),((e,t)=>{t&&t.forEach((e=>{e.parent=null,e.layer=null})),e&&e.forEach((e=>{e.parent=this,e.layer=this}))}),u.Z_),this.on("sublayer-update",(()=>this.notifyChange("fullExtent")))])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,r){return M(J,t,r,this._visibleFolders)}writeSublayers(e,t){const r=[],s=e.toArray();for(;s.length;){const e=s[0];e.networkLink||(e.visible&&r.push(e.id),e.sublayers&&s.push(...e.sublayers.toArray())),s.shift()}t.visibleFolders=r}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,p.vt)(this.url,W)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],r=e=>{e.visible&&(t.push(e),e.sublayers&&e.sublayers.forEach(r))};return e&&e.forEach(r),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=(0,n.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"]},e).catch(a.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=j((await Promise.resolve().then((()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:N(this.url,this.outSpatialReference,this.refreshInterval,e)))).data);t&&this.read(t,{origin:"service"})}_recomputeFullExtent(){let e=null;(0,n.pC)(this.extent)&&(e=this.extent.clone());const t=r=>{if(r.sublayers)for(const s of r.sublayers.items)t(s),s.visible&&s.fullExtent&&((0,n.pC)(e)?e.union(s.fullExtent):e=s.fullExtent.clone())};return t(this),e}};(0,s._)([(0,y.Cb)({readOnly:!0})],A.prototype,"allSublayers",void 0),(0,s._)([(0,y.Cb)({type:m.Z})],A.prototype,"outSpatialReference",void 0),(0,s._)([(0,y.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],A.prototype,"path",void 0),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1,write:!1}})],A.prototype,"legendEnabled",void 0),(0,s._)([(0,y.Cb)({type:["show","hide","hide-children"]})],A.prototype,"listMode",void 0),(0,s._)([(0,y.Cb)({type:["KML"]})],A.prototype,"operationalLayerType",void 0),(0,s._)([(0,y.Cb)({})],A.prototype,"resourceInfo",void 0),(0,s._)([(0,y.Cb)({type:i.Z.ofType(J),json:{write:{ignoreOrigin:!0}}})],A.prototype,"sublayers",void 0),(0,s._)([(0,d.r)(["web-map","portal-item"],"sublayers",["visibleFolders"])],A.prototype,"readSublayersFromItemOrWebMap",null),(0,s._)([(0,d.r)("service","sublayers",["sublayers"])],A.prototype,"readSublayers",null),(0,s._)([(0,f.c)("sublayers")],A.prototype,"writeSublayers",null),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],A.prototype,"type",void 0),(0,s._)([(0,y.Cb)({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],A.prototype,"title",null),(0,s._)([(0,y.Cb)(S.HQ)],A.prototype,"url",void 0),(0,s._)([(0,y.Cb)({readOnly:!0})],A.prototype,"visibleSublayers",null),(0,s._)([(0,y.Cb)({type:q.Z})],A.prototype,"extent",void 0),(0,s._)([(0,y.Cb)()],A.prototype,"fullExtent",null),A=(0,s._)([(0,c.j)("esri.layers.KMLLayer")],A);const Q=A},16859:(e,t,r)=>{r.d(t,{I:()=>_});var s=r(43697),i=r(40330),o=r(3172),n=r(66643),l=r(20102),a=r(92604),u=r(70586),p=r(95330),y=r(17452),h=r(5600),d=(r(67676),r(80442),r(75215),r(71715)),c=r(52011),f=r(30556),m=r(65587),g=r(15235),b=r(86082);const v=a.Z.getLogger("esri.layers.mixins.PortalLayer"),_=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new g.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const s=await r.e(8062).then(r.bind(r,18062));return(0,p.k_)(t),await s.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||v.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==i.id?void 0:i.id.findCredential(this.url):null;if(!t)return!0;const r=C.credential===t?C.user:await this._fetchEditingUser(e);return C.credential=t,C.user=r,(0,u.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,r;const s=null==(t=this.portalItem)||null==(r=t.portal)?void 0:r.user;if(s)return s;const l=i.id.findServerInfo(this.url);if(null==l||!l.owningSystemUrl)return null;const a=`${l.owningSystemUrl}/sharing/rest`,p=m.Z.getDefault();if(p&&p.loaded&&(0,y.Fv)(p.restUrl)===(0,y.Fv)(a))return p.user;const h=`${a}/community/self`,d=(0,u.pC)(e)?e.signal:null,c=await(0,n.q6)((0,o.default)(h,{authMode:"no-prompt",query:{f:"json"},signal:d}));return c.ok?b.default.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||m.Z.getDefault());return r&&s&&!(0,y.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,h.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,s._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,f.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,h.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,s._)([(0,c.j)("esri.layers.mixins.PortalLayer")],t),t},C={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>g});var s=r(43697),i=r(92604),o=r(95330),n=r(5600),l=(r(67676),r(80442),r(75215),r(52011)),a=r(80539),u=(r(26258),r(87538));const p=new a.Z,y=new WeakMap;function h(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function d(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:d(t,e%t):0}let c=0,f=0;function m(){const e=Date.now();for(const r of p)if(r.refreshInterval){var t;e-(null!=(t=y.get(r))?t:0)+5>=6e4*r.refreshInterval&&(y.set(r,e),r.refresh(e))}}(0,u.EH)((()=>{const e=Date.now();let t=0;for(const r of p)t=d(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?y.get(r)||y.set(r,e):y.delete(r);if(t!==f){if(f=t,clearInterval(c),0===f)return void(c=0);c=setInterval(m,f)}}));const g=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,o.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){h(e)&&p.push(e)}(this)}),(()=>{}))}destroy(){h(this)&&p.includes(this)&&p.remove(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,o.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{i.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,s._)([(0,n.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,s._)([(0,n.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,s._)([(0,n.Cb)()],t.prototype,"refreshParameters",null),t=(0,s._)([(0,l.j)("esri.layers.mixins.RefreshableLayer")],t),t}},51706:(e,t,r)=>{var s,i;function o(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function n(e){return null!=e&&!isNaN(e)&&isFinite(e)}function l(e){return e.valueExpression?s.Expression:e.field&&"string"==typeof e.field?s.Field:s.Unknown}function a(e,t){const r=t||l(e),o=e.valueUnit||"unknown";return r===s.Unknown?i.Constant:e.stops?i.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?i.ClampedLinear:"unknown"===o?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?i.Proportional:i.Additive:i.Identity:i.RealWorldSize}r.d(t,{PS:()=>l,QW:()=>a,RY:()=>s,hL:()=>i,iY:()=>o,qh:()=>n}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(s||(s={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(i||(i={}))},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>_});var s,i=r(43697),o=r(66577),n=r(38171),l=r(35454),a=r(96674),u=r(22974),p=r(70586),y=r(5600),h=(r(75215),r(71715)),d=r(52011),c=r(30556),f=r(82971),m=r(33955),g=r(1231);const b=new l.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=s=class extends a.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=f.Z.fromJSON(t.spatialReference),s=[];for(let t=0;t<e.length;t++){const i=e[t],o=n.Z.fromJSON(i),l=i.geometry&&i.geometry.spatialReference;(0,p.pC)(o.geometry)&&!l&&(o.geometry.spatialReference=r);const a=i.aggregateGeometries,u=o.aggregateGeometries;if(a&&(0,p.pC)(u))for(const e in u){const t=u[e],s=a[e],i=null==s?void 0:s.spatialReference;(0,p.pC)(t)&&!i&&(t.spatialReference=r)}s.push(o)}return s}writeGeometryType(e,t,r,s){if(e)return void b.write(e,t,r,s);const{features:i}=this;if(i)for(const e of i)if(e&&(0,p.pC)(e.geometry))return void b.write(e.geometry.type,t,r,s)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,s=(0,m.im)(e);return!r&&t.spatialReference&&(s.spatialReference=f.Z.fromJSON(t.spatialReference)),s}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,p.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new s(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const s=t.features[r];if(s.geometry){const t=e&&e[r];s.geometry=t&&t.toJSON()||s.geometry}}return t}quantize(e){const{scale:[t,r],translate:[s,i]}=e,o=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-s)/t)),(e=>Math.round((i-e)/r)));for(let e=0,t=o.length;e<t;e++)n((0,p.Wg)(o[e].geometry))||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[s,i],scale:[o,n]}=r,l=this._getHydrationFunction(e,(e=>e*o+s),(e=>i-e*n));for(const{geometry:e}of t)(0,p.pC)(e)&&l(e);return this.transform=null,this}_quantizePoints(e,t,r){let s,i;const o=[];for(let n=0,l=e.length;n<l;n++){const l=e[n];if(n>0){const e=t(l[0]),n=r(l[1]);e===s&&n===i||(o.push([e-s,n-i]),s=e,i=n)}else s=t(l[0]),i=r(l[1]),o.push([s,i])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const s=(0,m.oU)(e)?e.rings:e.paths,i=[];for(let e=0,o=s.length;e<o;e++){const o=s[e],n=this._quantizePoints(o,t,r);n&&i.push(n)}return i.length>0?((0,m.oU)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const s=this._quantizePoints(e.points,t,r);return s.length>0?(e.points=s,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const s=(0,m.oU)(e)?e.rings:e.paths;let i,o;for(let e=0,n=s.length;e<n;e++){const n=s[e];for(let e=0,s=n.length;e<s;e++){const s=n[e];e>0?(i+=s[0],o+=s[1]):(i=s[0],o=s[1]),s[0]=t(i),s[1]=r(o)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const s=e.points;let i,o;for(let e=0,n=s.length;e<n;e++){const n=s[e];e>0?(i+=n[0],o+=n[1]):(i=n[0],o=n[1]),n[0]=t(i),n[1]=r(o)}}:void 0}};(0,i._)([(0,y.Cb)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,y.Cb)({type:[n.Z],json:{write:!0}})],v.prototype,"features",void 0),(0,i._)([(0,h.r)("features")],v.prototype,"readFeatures",null),(0,i._)([(0,y.Cb)({type:[g.Z],json:{write:!0}})],v.prototype,"fields",void 0),(0,i._)([(0,y.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:b.read}}})],v.prototype,"geometryType",void 0),(0,i._)([(0,c.c)("geometryType")],v.prototype,"writeGeometryType",null),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,i._)([(0,y.Cb)({types:o.qM,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,i._)([(0,h.r)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,i._)([(0,y.Cb)({type:f.Z,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,i._)([(0,c.c)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,i._)([(0,y.Cb)({json:{write:!0}})],v.prototype,"transform",void 0),v=s=(0,i._)([(0,d.j)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0;const _=v}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3723],{3723:(e,t,r)=>{r.r(t),r.d(t,{default:()=>F});var s=r(43697),i=r(68773),o=r(3172),l=(r(78223),r(70586)),a=r(16453),n=r(95330),u=r(17452),h=r(5600),p=(r(67676),r(80442),r(75215),r(71715)),d=r(52011),y=r(6570),c=r(8744),m=r(29600),f=r(71612),v=r(38009),g=r(16859),b=r(34760),C=r(72965),_=r(21506),I=r(89164),S=r(4095),w=r(37898),P=r(77987),D=r(20256);const R=["atom","xml"],Z={base:I.Z,key:"type",typeMap:{"simple-line":S.Z},errorContext:"symbol"},E={base:I.Z,key:"type",typeMap:{"picture-marker":w.Z,"simple-marker":P.Z},errorContext:"symbol"},k={base:I.Z,key:"type",typeMap:{"simple-fill":D.Z},errorContext:"symbol"};let x=class extends((0,f.h)((0,b.Q)((0,v.q)((0,g.I)((0,C.M)((0,a.R)(m.Z))))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readFeatureCollections(e,t){return t.featureCollection.layers.forEach((e=>{var t;const r=e.layerDefinition.drawingInfo.renderer.symbol;r&&"esriSFS"===r.type&&null!=(t=r.outline)&&t.style.includes("esriSFS")&&(r.outline.style="esriSLSSolid")})),t.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,u.vt)(this.url,R)||"GeoRSS":e||""}set title(e){this._set("title",e)}load(e){const t=(0,l.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(n.r9).then((()=>this._fetchService(t))).then((e=>{this.read(e,{origin:"service"})}))),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){var t;const r=this.spatialReference,{data:s}=await(0,o.default)(i.Z.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:(0,c.oR)(r)?void 0:null!=(t=r.wkid)?t:JSON.stringify(r)},signal:e});return s}_hasGeometry(e){var t,r;return null!=(t=null==(r=this.featureCollections)?void 0:r.some((t=>{var r,s;return(null==(r=t.featureSet)?void 0:r.geometryType)===e&&(null==(s=t.featureSet.features)?void 0:s.length)>0})))&&t}};(0,s._)([(0,h.Cb)()],x.prototype,"description",void 0),(0,s._)([(0,h.Cb)()],x.prototype,"featureCollections",void 0),(0,s._)([(0,p.r)("service","featureCollections",["featureCollection.layers"])],x.prototype,"readFeatureCollections",null),(0,s._)([(0,h.Cb)({type:y.Z,json:{name:"lookAtExtent"}})],x.prototype,"fullExtent",void 0),(0,s._)([(0,h.Cb)(_.id)],x.prototype,"id",void 0),(0,s._)([(0,h.Cb)(_.rn)],x.prototype,"legendEnabled",void 0),(0,s._)([(0,h.Cb)({types:Z,json:{write:!0}})],x.prototype,"lineSymbol",void 0),(0,s._)([(0,h.Cb)({type:["show","hide"]})],x.prototype,"listMode",void 0),(0,s._)([(0,h.Cb)({types:E,json:{write:!0}})],x.prototype,"pointSymbol",void 0),(0,s._)([(0,h.Cb)({types:k,json:{write:!0}})],x.prototype,"polygonSymbol",void 0),(0,s._)([(0,h.Cb)({type:["GeoRSS"]})],x.prototype,"operationalLayerType",void 0),(0,s._)([(0,h.Cb)(_.HQ)],x.prototype,"url",void 0),(0,s._)([(0,h.Cb)({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],x.prototype,"title",null),(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1},value:"geo-rss"})],x.prototype,"type",void 0),x=(0,s._)([(0,d.j)("esri.layers.GeoRSSLayer")],x);const F=x},16859:(e,t,r)=>{r.d(t,{I:()=>C});var s=r(43697),i=r(40330),o=r(3172),l=r(66643),a=r(20102),n=r(92604),u=r(70586),h=r(95330),p=r(17452),d=r(5600),y=(r(67676),r(80442),r(75215),r(71715)),c=r(52011),m=r(30556),f=r(65587),v=r(15235),g=r(86082);const b=n.Z.getLogger("esri.layers.mixins.PortalLayer"),C=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new v.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const s=await r.e(8062).then(r.bind(r,18062));return(0,h.k_)(t),await s.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,h.D_)(e)||b.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,h.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==i.id?void 0:i.id.findCredential(this.url):null;if(!t)return!0;const r=_.credential===t?_.user:await this._fetchEditingUser(e);return _.credential=t,_.user=r,(0,u.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,r;const s=null==(t=this.portalItem)||null==(r=t.portal)?void 0:r.user;if(s)return s;const a=i.id.findServerInfo(this.url);if(null==a||!a.owningSystemUrl)return null;const n=`${a.owningSystemUrl}/sharing/rest`,h=f.Z.getDefault();if(h&&h.loaded&&(0,p.Fv)(h.restUrl)===(0,p.Fv)(n))return h.user;const d=`${n}/community/self`,y=(0,u.pC)(e)?e.signal:null,c=await(0,l.q6)((0,o.default)(d,{authMode:"no-prompt",query:{f:"json"},signal:y}));return c.ok?g.default.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||f.Z.getDefault());return r&&s&&!(0,p.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save the scene, set the layer.portalItem to null or save the scene to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,d.Cb)({type:v.default})],t.prototype,"portalItem",null),(0,s._)([(0,y.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,d.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,s._)([(0,c.j)("esri.layers.mixins.PortalLayer")],t),t},_={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>v});var s=r(43697),i=r(92604),o=r(95330),l=r(5600),a=(r(67676),r(80442),r(75215),r(52011)),n=r(80539),u=(r(26258),r(87538));const h=new n.Z,p=new WeakMap;function d(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function y(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:y(t,e%t):0}let c=0,m=0;function f(){const e=Date.now();for(const r of h)if(r.refreshInterval){var t;e-(null!=(t=p.get(r))?t:0)+5>=6e4*r.refreshInterval&&(p.set(r,e),r.refresh(e))}}(0,u.EH)((()=>{const e=Date.now();let t=0;for(const r of h)t=y(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?p.get(r)||p.set(r,e):p.delete(r);if(t!==m){if(m=t,clearInterval(c),0===m)return void(c=0);c=setInterval(f,m)}}));const v=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,o.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){d(e)&&h.push(e)}(this)}),(()=>{}))}destroy(){d(this)&&h.includes(this)&&h.remove(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,o.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{i.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,s._)([(0,l.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,s._)([(0,l.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,s._)([(0,l.Cb)()],t.prototype,"refreshParameters",null),t=(0,s._)([(0,a.j)("esri.layers.mixins.RefreshableLayer")],t),t}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3723],{3723:(e,t,r)=>{r.r(t),r.d(t,{default:()=>F});var s=r(43697),i=r(68773),o=r(3172),l=(r(78223),r(70586)),a=r(16453),n=r(95330),u=r(17452),h=r(5600),p=(r(67676),r(80442),r(75215),r(71715)),d=r(52011),y=r(6570),c=r(8744),m=r(29600),f=r(71612),v=r(38009),g=r(16859),b=r(34760),C=r(72965),_=r(21506),I=r(89164),S=r(4095),w=r(37898),P=r(77987),D=r(20256);const R=["atom","xml"],Z={base:I.Z,key:"type",typeMap:{"simple-line":S.Z},errorContext:"symbol"},E={base:I.Z,key:"type",typeMap:{"picture-marker":w.Z,"simple-marker":P.Z},errorContext:"symbol"},k={base:I.Z,key:"type",typeMap:{"simple-fill":D.Z},errorContext:"symbol"};let x=class extends((0,f.h)((0,b.Q)((0,v.q)((0,g.I)((0,C.M)((0,a.R)(m.Z))))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readFeatureCollections(e,t){return t.featureCollection.layers.forEach((e=>{var t;const r=e.layerDefinition.drawingInfo.renderer.symbol;r&&"esriSFS"===r.type&&null!=(t=r.outline)&&t.style.includes("esriSFS")&&(r.outline.style="esriSLSSolid")})),t.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,u.vt)(this.url,R)||"GeoRSS":e||""}set title(e){this._set("title",e)}load(e){const t=(0,l.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(n.r9).then((()=>this._fetchService(t))).then((e=>{this.read(e,{origin:"service"})}))),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){var t;const r=this.spatialReference,{data:s}=await(0,o.default)(i.Z.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:(0,c.oR)(r)?void 0:null!=(t=r.wkid)?t:JSON.stringify(r)},signal:e});return s}_hasGeometry(e){var t,r;return null!=(t=null==(r=this.featureCollections)?void 0:r.some((t=>{var r,s;return(null==(r=t.featureSet)?void 0:r.geometryType)===e&&(null==(s=t.featureSet.features)?void 0:s.length)>0})))&&t}};(0,s._)([(0,h.Cb)()],x.prototype,"description",void 0),(0,s._)([(0,h.Cb)()],x.prototype,"featureCollections",void 0),(0,s._)([(0,p.r)("service","featureCollections",["featureCollection.layers"])],x.prototype,"readFeatureCollections",null),(0,s._)([(0,h.Cb)({type:y.Z,json:{name:"lookAtExtent"}})],x.prototype,"fullExtent",void 0),(0,s._)([(0,h.Cb)(_.id)],x.prototype,"id",void 0),(0,s._)([(0,h.Cb)(_.rn)],x.prototype,"legendEnabled",void 0),(0,s._)([(0,h.Cb)({types:Z,json:{write:!0}})],x.prototype,"lineSymbol",void 0),(0,s._)([(0,h.Cb)({type:["show","hide"]})],x.prototype,"listMode",void 0),(0,s._)([(0,h.Cb)({types:E,json:{write:!0}})],x.prototype,"pointSymbol",void 0),(0,s._)([(0,h.Cb)({types:k,json:{write:!0}})],x.prototype,"polygonSymbol",void 0),(0,s._)([(0,h.Cb)({type:["GeoRSS"]})],x.prototype,"operationalLayerType",void 0),(0,s._)([(0,h.Cb)(_.HQ)],x.prototype,"url",void 0),(0,s._)([(0,h.Cb)({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],x.prototype,"title",null),(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1},value:"geo-rss"})],x.prototype,"type",void 0),x=(0,s._)([(0,d.j)("esri.layers.GeoRSSLayer")],x);const F=x},16859:(e,t,r)=>{r.d(t,{I:()=>C});var s=r(43697),i=r(40330),o=r(3172),l=r(66643),a=r(20102),n=r(92604),u=r(70586),h=r(95330),p=r(17452),d=r(5600),y=(r(67676),r(80442),r(75215),r(71715)),c=r(52011),m=r(30556),f=r(65587),v=r(15235),g=r(86082);const b=n.Z.getLogger("esri.layers.mixins.PortalLayer"),C=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new v.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const s=await r.e(8062).then(r.bind(r,18062));return(0,h.k_)(t),await s.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,h.D_)(e)||b.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,h.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==i.id?void 0:i.id.findCredential(this.url):null;if(!t)return!0;const r=_.credential===t?_.user:await this._fetchEditingUser(e);return _.credential=t,_.user=r,(0,u.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,r;const s=null==(t=this.portalItem)||null==(r=t.portal)?void 0:r.user;if(s)return s;const a=i.id.findServerInfo(this.url);if(null==a||!a.owningSystemUrl)return null;const n=`${a.owningSystemUrl}/sharing/rest`,h=f.Z.getDefault();if(h&&h.loaded&&(0,p.Fv)(h.restUrl)===(0,p.Fv)(n))return h.user;const d=`${n}/community/self`,y=(0,u.pC)(e)?e.signal:null,c=await(0,l.q6)((0,o.default)(d,{authMode:"no-prompt",query:{f:"json"},signal:y}));return c.ok?g.default.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||f.Z.getDefault());return r&&s&&!(0,p.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,d.Cb)({type:v.default})],t.prototype,"portalItem",null),(0,s._)([(0,y.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,d.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,s._)([(0,c.j)("esri.layers.mixins.PortalLayer")],t),t},_={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>v});var s=r(43697),i=r(92604),o=r(95330),l=r(5600),a=(r(67676),r(80442),r(75215),r(52011)),n=r(80539),u=(r(26258),r(87538));const h=new n.Z,p=new WeakMap;function d(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function y(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:y(t,e%t):0}let c=0,m=0;function f(){const e=Date.now();for(const r of h)if(r.refreshInterval){var t;e-(null!=(t=p.get(r))?t:0)+5>=6e4*r.refreshInterval&&(p.set(r,e),r.refresh(e))}}(0,u.EH)((()=>{const e=Date.now();let t=0;for(const r of h)t=y(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?p.get(r)||p.set(r,e):p.delete(r);if(t!==m){if(m=t,clearInterval(c),0===m)return void(c=0);c=setInterval(f,m)}}));const v=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,o.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){d(e)&&h.push(e)}(this)}),(()=>{}))}destroy(){d(this)&&h.includes(this)&&h.remove(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,o.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{i.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,s._)([(0,l.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,s._)([(0,l.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,s._)([(0,l.Cb)()],t.prototype,"refreshParameters",null),t=(0,s._)([(0,a.j)("esri.layers.mixins.RefreshableLayer")],t),t}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1938],{43090:(e,t,i)=>{function l(e){return 32+e.length}function r(e){if(!e)return 0;let t=32;for(const i in e)if(e.hasOwnProperty(i)){const r=e[i];switch(typeof r){case"string":t+=l(r);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function s(e,t){return 32+e.length*t}var o;i.d(t,{Y8:()=>o,do:()=>s,f2:()=>r}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(o||(o={}))},16859:(e,t,i)=>{i.d(t,{I:()=>b});var l=i(43697),r=i(40330),s=i(3172),o=i(66643),a=i(20102),n=i(92604),h=i(70586),c=i(95330),p=i(17452),u=i(5600),d=(i(67676),i(80442),i(75215),i(71715)),f=i(52011),m=i(30556),v=i(65587),y=i(15235),g=i(86082);const w=n.Z.getLogger("esri.layers.mixins.PortalLayer"),b=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new y.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const l=await i.e(8062).then(i.bind(i,18062));return(0,c.k_)(t),await l.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,c.D_)(e)||w.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,c.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==r.id?void 0:r.id.findCredential(this.url):null;if(!t)return!0;const i=_.credential===t?_.user:await this._fetchEditingUser(e);return _.credential=t,_.user=i,(0,h.Wi)(i)||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,i;const l=null==(t=this.portalItem)||null==(i=t.portal)?void 0:i.user;if(l)return l;const a=r.id.findServerInfo(this.url);if(null==a||!a.owningSystemUrl)return null;const n=`${a.owningSystemUrl}/sharing/rest`,c=v.Z.getDefault();if(c&&c.loaded&&(0,p.Fv)(c.restUrl)===(0,p.Fv)(n))return c.user;const u=`${n}/community/self`,d=(0,h.pC)(e)?e.signal:null,f=await(0,o.q6)((0,s.default)(u,{authMode:"no-prompt",query:{f:"json"},signal:d}));return f.ok?g.default.fromJSON(f.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,l=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||v.Z.getDefault());return i&&l&&!(0,p.tm)(l.restUrl,i.restUrl)?(t.messages&&t.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,l._)([(0,u.Cb)({type:y.default})],t.prototype,"portalItem",null),(0,l._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,l._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,l._)([(0,u.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,l._)([(0,u.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,l._)([(0,f.j)("esri.layers.mixins.PortalLayer")],t),t},_={credential:null,user:null}},39450:(e,t,i)=>{i.d(t,{Z:()=>c});var l,r=i(43697),s=i(96674),o=i(5600),a=(i(67676),i(80442),i(75215)),n=i(52011);let h=l=class extends s.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new l({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,r._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"cols",void 0),(0,r._)([(0,o.Cb)({type:a.z8,json:{write:!0}})],h.prototype,"level",void 0),(0,r._)([(0,o.Cb)({type:String,json:{write:!0}})],h.prototype,"levelValue",void 0),(0,r._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"origin",void 0),(0,r._)([(0,o.Cb)({type:Number,json:{write:!0}})],h.prototype,"resolution",void 0),(0,r._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"rows",void 0),(0,r._)([(0,o.Cb)({type:Number,json:{write:!0}})],h.prototype,"scale",void 0),h=l=(0,r._)([(0,n.j)("esri.layers.support.LOD")],h);const c=h},11145:(e,t,i)=>{i.d(t,{Z:()=>T});var l,r=i(43697),s=i(35454),o=i(96674),a=i(70586),n=i(67900),h=i(5600),c=(i(67676),i(80442),i(75215)),p=i(71715),u=i(52011),d=i(30556),f=i(13473),m=i(82971),v=i(24470),y=i(8744),g=i(40488),w=i(39450);const b=new s.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let _=l=class extends o.wq{constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.minScale=0,this.maxScale=0,this.size=null,this.spatialReference=null}static create(e={}){const{resolutionFactor:t=1,scales:i,size:r=256,spatialReference:s=m.Z.WebMercator,numLODs:o=24}=e;if(!(0,y.JY)(s)){const e=[];if(i)for(let t=0;t<i.length;t++){const l=i[t];e.push({level:t,scale:l,resolution:l})}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift({level:i,scale:t,resolution:t}),t*=2}return new l({dpi:96,lods:e,origin:new f.Z(0,0,s),size:[r,r],spatialReference:s})}const a=(0,y.C5)(s),h=e.origin?new f.Z({x:e.origin.x,y:e.origin.y,spatialReference:s}):new f.Z(a?{x:a.origin[0],y:a.origin[1],spatialReference:s}:{x:0,y:0,spatialReference:s}),c=1/(39.37*(0,n.c9)(s)*96),p=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],l=t*c;p.push({level:e,scale:t,resolution:l})}else{let e=(0,y.sT)(s)?512/r*591657527.5917094:256/r*591657527.591555;const i=Math.ceil(o/t);p.push({level:0,scale:e,resolution:e*c});for(let l=1;l<i;l++){const i=e/2**t,r=i*c;p.push({level:l,scale:i,resolution:r}),e=i}}return new l({dpi:96,lods:p,origin:h,size:[r,r],spatialReference:s})}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,y.C5)(e);return e.isWrappable&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return f.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const l=[];this._levelToLOD={},e&&(t=-1/0,i=1/0,e.forEach((e=>{l.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,this._levelToLOD[e.level]=e}))),this._set("scales",l),this._set("minScale",t),this._set("maxScale",i),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];{const i=Math.floor(e),l=i+1;return t[i]/(t[i]/t[l])**(e-i)}}scaleToZoom(e){const t=this.scales,i=t.length-1;let l=0;for(;l<i;l++){const i=t[l],r=t[l+1];if(i<=e)return l;if(r===e)return l+1;if(i>e&&r<e)return l+Math.log(i/e)/Math.log(i/r)}return l}snapScale(e,t=.95){const i=this.scaleToZoom(e);return i%Math.floor(i)>=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,l){const r=this.lodAt(e);if(!r)return null;let s,o;if("number"==typeof t)s=t,o=i;else if((0,y.fS)(t.spatialReference,this.spatialReference))s=t.x,o=t.y,l=i;else{const e=(0,g.iV)(t,this.spatialReference);if((0,a.Wi)(e))return null;s=e.x,o=e.y,l=i}const n=r.resolution*this.size[0],h=r.resolution*this.size[1];return l||(l={id:null,level:0,row:0,col:0,extent:(0,v.Ue)()}),l.level=e,l.row=Math.floor((this.origin.y-o)/h+.001),l.col=Math.floor((s-this.origin.x)/n+.001),this.updateTileInfo(l),l}updateTileInfo(e,t=l.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===l.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const r=e.level-i.level,s=i.resolution*this.size[0]/2**r,o=i.resolution*this.size[1]/2**r;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,v.Ue)()),e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const{resolution:i}=this.lodAt(t.level),l=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*l,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+l,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD&&this._levelToLOD[e]||null}clone(){return l.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const i=[],r=this.lods.length;for(let e=0;e<r;e++){const l=this.lods[e],r=l.resolution*t;i.push(new w.Z({level:l.level,scale:l.scale,resolution:r}))}return new l({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const l=e[i];this._upsampleLevels[l.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/l.resolution:0},t=l}}};var S,O;(0,r._)([(0,h.Cb)({type:Number,json:{write:!0}})],_.prototype,"compressionQuality",void 0),(0,r._)([(0,h.Cb)({type:Number,json:{write:!0}})],_.prototype,"dpi",void 0),(0,r._)([(0,h.Cb)({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],_.prototype,"format",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],_.prototype,"isWrappable",null),(0,r._)([(0,h.Cb)({type:f.Z,json:{write:!0}})],_.prototype,"origin",void 0),(0,r._)([(0,p.r)("origin")],_.prototype,"readOrigin",null),(0,r._)([(0,h.Cb)({type:[w.Z],value:null,json:{write:!0}})],_.prototype,"lods",null),(0,r._)([(0,h.Cb)({readOnly:!0})],_.prototype,"minScale",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],_.prototype,"maxScale",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],_.prototype,"scales",void 0),(0,r._)([(0,h.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],_.prototype,"size",void 0),(0,r._)([(0,p.r)("size",["rows","cols"])],_.prototype,"readSize",null),(0,r._)([(0,d.c)("size",{cols:{type:c.z8},rows:{type:c.z8}})],_.prototype,"writeSize",null),(0,r._)([(0,h.Cb)({type:m.Z,json:{write:!0}})],_.prototype,"spatialReference",void 0),_=l=(0,r._)([(0,u.j)("esri.layers.support.TileInfo")],_),(O=(S=_||(_={})).ExtrapolateOptions||(S.ExtrapolateOptions={}))[O.NONE=0]="NONE",O[O.POWER_OF_TWO=1]="POWER_OF_TWO";const T=_},56608:(e,t,i)=>{i.d(t,{y:()=>z});var l,r=i(43697),s=i(3172),o=i(15923),a=i(43090),n=i(20102),h=i(3920),c=i(92604),p=i(13867),u=i(44553),d=i(95330),f=i(17445),m=i(1654),v=i(17452),y=i(5600),g=i(67676),w=(i(80442),i(90578)),b=i(52011),_=i(22974);class S{constructor(){this.location={left:0,top:0,width:0,height:0},this._allAvailability="unknown",this.byteSize=40}getAvailability(e,t){if("unknown"!==this._allAvailability)return this._allAvailability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),l=i%8,r=i>>3,s=this._tileAvailabilityBitSet;return r<0||r>s.length?"unknown":s[r]&1<<l?"available":"unavailable"}_updateFromData(e){const t=this.location.width,i=this.location.height;let l=!0,r=!0;const s=Math.ceil(t*i/8),o=new Uint8Array(s);let a=0;for(let t=0;t<e.length;t++){const i=t%8;e[t]?(r=!1,o[a]|=1<<i):l=!1,7===i&&++a}r?this._allAvailability="unavailable":l?this._allAvailability="available":(this._allAvailability="unknown",this._tileAvailabilityBitSet=o,this.byteSize+=o.length)}static fromDefinition(e,t){const i=e.service.request||s.default,{row:l,col:r,width:o,height:a}=e,h={query:{f:"json"}};return t=t?{...h,...t}:h,i(function(e){let t;if("vector-tile"===e.service.type)t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;else{const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then((e=>e.data)).catch((e=>{if(e&&e.details&&422===e.details.httpStatus)return{location:{top:l,left:r,width:o,height:a},valid:!0,data:(0,g.a9)(o*a,0)};throw e})).then((e=>{if(e.location&&(e.location.top!==l||e.location.left!==r||e.location.width!==o||e.location.height!==a))throw new n.Z("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:l,left:r,width:o,height:a}});return S.fromJSON(e)}))}static fromJSON(e){S._validateJSON(e);const t=new S;return t.location=Object.freeze((0,_.d9)(e.location)),t._updateFromData(e.data),Object.freeze(t)}static _validateJSON(e){if(!e||!e.location)throw new n.Z("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new n.Z("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new n.Z("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new n.Z("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new n.Z("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function O(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}const T=c.Z.getLogger("esri.layers.support.TilemapCache");let z=l=class extends((0,h.p)(o.Z)){constructor(e){super(e),this._pendingTilemapRequests={},this._availableLevels={},this.levels=5,this.cacheByteSize=2*a.Y8.MEGABYTES,this.request=s.default,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new p.Z(this.cacheByteSize),this.handles.add([this.watch(["layer.parsedUrl","layer.tileServers?","layer.apiKey?","layer.customParameters?"],(()=>this._initializeTilemapDefinition())),(0,f.YP)((()=>{var e,t;return null==(e=this.layer)||null==(t=e.tileInfo)?void 0:t.lods}),(e=>this._initializeAvailableLevels(e)),f.tX)]),this._initializeTilemapDefinition()}castLevels(e){return e<=2?(T.error("Minimum levels for Tilemap is 3, but got ",e),3):e}get size(){return 1<<this.levels}fetchTilemap(e,t,i,l){if(!this._availableLevels[e])return Promise.reject(new n.Z("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const r=this._tmpTilemapDefinition,s=this._tilemapFromCache(e,t,i,r);if(s)return Promise.resolve(s);const o=l&&l.signal;return l={...l,signal:null},new Promise(((e,t)=>{(0,d.fu)(o,(()=>t((0,d.zE)())));const i=O(r);let s=this._pendingTilemapRequests[i];if(!s){s=S.fromDefinition(r,l).then((e=>(this._tilemapCache.put(i,e,e.byteSize),e)));const e=()=>delete this._pendingTilemapRequests[i];this._pendingTilemapRequests[i]=s,s.then(e,e)}s.then(e,t)}))}getAvailability(e,t,i){if(!this._availableLevels[e])return"unavailable";const l=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return l?l.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,l){return this._availableLevels[e]?this.fetchTilemap(e,t,i,l).catch((e=>e)).then((l=>{if(l instanceof S){const r=l.getAvailability(t,i);if("unavailable"===r)throw new n.Z("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return r}if((0,d.D_)(l))throw l;return"unknown"})):Promise.reject(new n.Z("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`))}fetchAvailabilityUpsample(e,t,i,l,r){l.level=e,l.row=t,l.col=i;const s=this.layer.tileInfo;s.updateTileInfo(l);const o=this.fetchAvailability(e,t,i,r).catch((e=>{if((0,d.D_)(e))throw e;if(s.upsampleTile(l))return this.fetchAvailabilityUpsample(l.level,l.row,l.col,l);throw e}));return this._fetchAvailabilityUpsamplePrefetch(l.id,e,t,i,r,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,i,r,s,o){if(!this._prefetchingEnabled)return;const a=`prefetch-${e}`;if(this.handles.has(a))return;const n=new AbortController;o.then((()=>n.abort()),(()=>n.abort()));let h=!1;const c={remove(){h||(h=!0,n.abort())}};if(this.handles.add(c,a),await(0,m.MU)(10,n.signal).catch((()=>{})),h||(h=!0,this.handles.remove(a)),(0,d.Hc)(n))return;const p={id:e,level:t,row:i,col:r},u={...s,signal:n.signal},f=this.layer.tileInfo;for(let e=0;l._prefetches.length<l._maxPrefetch&&f.upsampleTile(p);++e){const e=this.fetchAvailability(p.level,p.row,p.col,u);l._prefetches.push(e);const t=()=>{l._prefetches.removeUnordered(e)};e.then(t,t)}}_initializeTilemapDefinition(){var e;if(!this.layer.parsedUrl)return;const{parsedUrl:t,apiKey:i,customParameters:l}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:t.path,query:(0,v.B7)({...t.query,...l,token:null!=i?i:null==(e=t.query)?void 0:e.token}),tileServers:this.layer.tileServers,request:this.request,type:this.layer.type},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,l){l.level=e,l.row=t-t%this.size,l.col=i-i%this.size;const r=O(l);return this._tilemapCache.get(r)}_initializeAvailableLevels(e){this._availableLevels={},e&&e.forEach((e=>this._availableLevels[e.level]=!0))}get test(){const e=this;return{get prefetchingEnabled(){return e._prefetchingEnabled},set prefetchingEnabled(t){e._prefetchingEnabled=t},hasTilemap:(t,i,l)=>!!e._tilemapFromCache(t,i,l,e._tmpTilemapDefinition)}}};z._maxPrefetch=4,z._prefetches=new u.Z({initialSize:l._maxPrefetch}),(0,r._)([(0,y.Cb)({constructOnly:!0,type:Number})],z.prototype,"levels",void 0),(0,r._)([(0,w.p)("levels")],z.prototype,"castLevels",null),(0,r._)([(0,y.Cb)({readOnly:!0,type:Number})],z.prototype,"size",null),(0,r._)([(0,y.Cb)({constructOnly:!0,type:Number})],z.prototype,"cacheByteSize",void 0),(0,r._)([(0,y.Cb)({constructOnly:!0})],z.prototype,"layer",void 0),(0,r._)([(0,y.Cb)({constructOnly:!0})],z.prototype,"request",void 0),z=l=(0,r._)([(0,b.j)("esri.layers.support.TilemapCache")],z)},45322:(e,t,i)=>{i.d(t,{d:()=>s,h:()=>r});var l=i(11145);const r={type:l.Z,json:{origins:{service:{read:{source:["tileInfo","minScale","maxScale","minLOD","maxLOD"],reader:s}}}}};function s(e,t,i,r){if(!e)return null;const{minScale:s,maxScale:o,minLOD:a,maxLOD:n}=t;if(null!=a&&null!=n)return r&&r.ignoreMinMaxLOD?l.Z.fromJSON(e):l.Z.fromJSON({...e,lods:e.lods.filter((({level:e})=>null!=e&&e>=a&&e<=n))});if(0!==s&&0!==o){const t=e=>Math.round(1e4*e)/1e4,i=s?t(s):1/0,r=o?t(o):-1/0;return l.Z.fromJSON({...e,lods:e.lods.filter((e=>{const l=t(e.scale);return l<=i&&l>=r}))})}return l.Z.fromJSON(e)}}}]);