@arcgis/core 5.1.0-next.52 → 5.1.0-next.53
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.
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/009db7b459b18f6a668b.js +1 -0
- package/assets/esri/core/workers/chunks/{386435341e949f5573b4.js → 0fc60b4c44c4e865b699.js} +2 -2
- package/assets/esri/core/workers/chunks/199f70c0373f6008a545.js +1 -0
- package/assets/esri/core/workers/chunks/{d2af5342fbe80e2d8c60.js → 20f9f3470cad47d01803.js} +1 -1
- package/assets/esri/core/workers/chunks/2757cf54656b5d318b11.js +1 -0
- package/assets/esri/core/workers/chunks/2aaeaf022af8493281dc.js +1 -0
- package/assets/esri/core/workers/chunks/34fe4570eef9e73839b8.js +1 -0
- package/assets/esri/core/workers/chunks/{7480bd6f892abf444cac.js → 3c9e1ec94bbcbf494916.js} +3 -3
- package/assets/esri/core/workers/chunks/40bcfc4f8efe7de7ec9d.js +1 -0
- package/assets/esri/core/workers/chunks/{cc1f3a2f281a2f6e0f94.js → 4d54beab8ae5ff31e7b0.js} +1 -1
- package/assets/esri/core/workers/chunks/55bb5b7817c2963c8bfa.js +1 -0
- package/assets/esri/core/workers/chunks/{39f3bea123f20c816ab2.js → 662932d2effd2b384b9e.js} +1 -1
- package/assets/esri/core/workers/chunks/7d56b2ac5030dd8b748e.js +1 -0
- package/assets/esri/core/workers/chunks/{720a33a7f118d2769133.js → 851dd71d28681d4eccfd.js} +1 -1
- package/assets/esri/core/workers/chunks/{88c6cc90606409b5c884.js → 87d2021e91d025a2a142.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe7dec83e40014c55a6b.js → 96e799ca97989a6ed448.js} +1 -1
- package/assets/esri/core/workers/chunks/9db2ff1d4cbb5d1b623e.js +1 -0
- package/assets/esri/core/workers/chunks/a462aa1c7b68efad6906.js +1 -0
- package/assets/esri/core/workers/chunks/{f5fd59291cb161fdc05b.js → a787fe09d3df9d4254ba.js} +1 -1
- package/assets/esri/core/workers/chunks/a971e61336f455b953d5.js +1 -0
- package/assets/esri/core/workers/chunks/b2b77598048818c957b7.js +1 -0
- package/assets/esri/core/workers/chunks/{3fa5f102b6f77c523a76.js → b3e5dcb530cef678c8f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{daf65bccc45dc5c400ae.js → c460ca93ed8e20d8b53a.js} +1 -1
- package/assets/esri/core/workers/chunks/{3fcc8c455af56ae89030.js → ccf845ac0ac354507a25.js} +1 -1
- package/assets/esri/core/workers/chunks/{c48d1ee37c207bfb0aac.js → dd319d5fe89b275e93cf.js} +1 -1
- package/assets/esri/core/workers/chunks/ec91d5081f423755cb07.js +1 -0
- package/assets/esri/core/workers/chunks/{eb36417edc11fa80e312.js → ee8cd91c27e9cdfc3b2e.js} +1 -1
- package/assets/esri/core/workers/chunks/f8eb14170f927aecfbc8.js +1 -0
- package/assets/esri/core/workers/chunks/{792219a079c28bcdc003.js → fcfaaced184f8da3e28d.js} +1 -1
- package/config.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/maybe.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/raster/datasets/FunctionRaster.js +1 -1
- package/layers/raster/functions/AspectFunction.js +1 -1
- package/layers/raster/functions/BaseRasterFunction.js +1 -1
- package/layers/raster/functions/ConvolutionFunction.js +1 -1
- package/layers/raster/functions/CurvatureFunction.js +1 -1
- package/layers/raster/functions/HillshadeFunction.js +1 -1
- package/layers/raster/functions/ShadedReliefFunction.js +1 -1
- package/layers/raster/functions/SlopeFunction.js +1 -1
- package/layers/raster/functions/StatisticsFunction.js +1 -1
- package/layers/raster/functions/pixelUtils.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/package.json +3 -3
- package/support/revision.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl/ManagedFBO.d.ts +1 -0
- package/views/3d/webgl/ManagedFBOResource.d.ts +1 -0
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheUsage.js +1 -1
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/assets/esri/core/workers/chunks/0b661b90f7ee3ae23425.js +0 -1
- package/assets/esri/core/workers/chunks/167e4ff7cbc88b42db71.js +0 -1
- package/assets/esri/core/workers/chunks/1a481f3ae3146682eb00.js +0 -1
- package/assets/esri/core/workers/chunks/30654845ca1334f1c206.js +0 -1
- package/assets/esri/core/workers/chunks/34207774bc371e95ba3c.js +0 -1
- package/assets/esri/core/workers/chunks/35dbe1eeb6932b03aea2.js +0 -1
- package/assets/esri/core/workers/chunks/380bb57bccc266d6442a.js +0 -1
- package/assets/esri/core/workers/chunks/5351e71ce7839636d06d.js +0 -1
- package/assets/esri/core/workers/chunks/55edd712c6d2d044e550.js +0 -1
- package/assets/esri/core/workers/chunks/64da1ad9df9094ef5c12.js +0 -1
- package/assets/esri/core/workers/chunks/666f201d222c50ab8428.js +0 -1
- package/assets/esri/core/workers/chunks/7380177f16d914fdbc63.js +0 -1
- package/assets/esri/core/workers/chunks/7dba4121cdd20dbc4b20.js +0 -1
- package/assets/esri/core/workers/chunks/bb659dcd297b895830df.js +0 -1
- /package/assets/esri/core/workers/chunks/{386435341e949f5573b4.js.LICENSE.txt → 0fc60b4c44c4e865b699.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[148],{61893(e,t,r){r.d(t,{Z:()=>d,g:()=>h});var s=r(5482),i=r(69622),n=r(36563),o=r(17676),a=r(64108);class l{constructor(){this._resolver=Promise.withResolvers(),this._status=0,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=1,this._cleanUp()},()=>{this._status=2,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return 1===this._status}isRejected(){return 2===this._status}isFulfilled(){return 0!==this._status}abort(){this._resolver.reject((0,o.NK)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=Promise.withResolvers(),t=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(t);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()},e=>{this.isFulfilled()||this._allPromise!==r||(0,o.zf)(e)||this._resolver.reject(e)}),e.resolve()}}const h=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),this._promiseProps=new l,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return this._promiseProps.promise.then(()=>this).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}addResolvingTask(e){e&&!this._promiseProps.isFulfilled()&&(this.addHandles((0,n.rE)(e)),this._promiseProps.addResolvingPromise(e.promise))}};return r=(0,s.Cg)([(0,a.$)("esri.core.Promise")],r),r},d=h(i.A)},36708(e,t,r){r.d(t,{C_:()=>u,OH:()=>g,Vh:()=>m,on:()=>c,pc:()=>v,wB:()=>l,z7:()=>h});var s=r(37955),i=r(36563),n=r(97768),o=r(17676),a=r(14012);function l(e,t,r={}){return d(e,t,r,p)}function h(e,t,r={}){return d(e,t,r,f)}function d(e,t,r={},s){let i=null;const o=r.once?(e,r)=>{s(e)&&((0,n.xt)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,a.Cn)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return i}function c(e,t,r,o={}){let a=null,h=null,d=null;function c(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function u(e){o.once&&o.once&&(0,n.xt)(d),r(e)}const p=l(e,(e,r)=>{c(),(0,s.wb)(e)&&(a=e,h=(0,s.on)(e,t,u),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return d=(0,i.hA)(()=>{p.remove(),c()}),d}function u(e,t){return function(e,t,r){if((0,o.G4)(r))return Promise.reject((0,o.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,n.xt)(a)}return new Promise((s,n)=>{a=(0,i.vE)([(0,o.u7)(r,()=>{l(),n((0,o.NK)())}),d(e,e=>{l(),s(e)},{sync:!1,once:!0},t??p)])})}(e,f,t)}function p(e){return!0}function f(e){return!!e}r(80559);const g={sync:!0},m={initial:!0},v={sync:!0,initial:!0}},16494(e,t,r){r.d(t,{Nd:()=>a,W5:()=>o});var s=r(17632);const i=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce((e,t)=>(e[t]=[],e),{}),n=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],o=new s.I({whiteList:i,onTagAttr:(e,t,r)=>{const s=`${t}="${r}"`;if(n.includes(t))return s},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),a=new s.I({whiteList:{br:[]},stripIgnoreTag:!0,escapeHtml:e=>e},!1)},13069(e,t,r){r.d(t,{AG:()=>a,lk:()=>i,vD:()=>o,yS:()=>n});const s="randomUUID"in crypto;function i(){if(s)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${i().toUpperCase()}}`}function o(){return`{${i()}}`}function a(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},50148(e,t,r){r.r(t),r.d(t,{default:()=>at});var s=r(70333),i=r(92602),n=r(11254),o=r(49186),a=r(65529),l=r(37955),h=r(4718),d=r(93637),c=r(17676),u=r(84952),p=r(5482),f=r(91429),g=r(64108);let m=class extends a.nJ{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e?._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){return s.id.refreshToken(this)}refreshServerTokens(){return s.id.refreshServerTokens(this)}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=s.id,r=this.server?t.findServerInfo(this.server):null,i=r?.owningSystemUrl,n=i?t.findServerInfo(i):null;!1===e||i&&"portal"!==this.scope&&(!n?.webTierAuth||t.normalizeWebTierAuth)||null==this.expires&&null==this.validity||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=s.id,t=e.credentials.indexOf(this);t>-1&&e.credentials.splice(t,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=(0,h.oy)({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};(0,p.Cg)([(0,f.MZ)()],m.prototype,"creationTime",void 0),(0,p.Cg)([(0,f.MZ)()],m.prototype,"expires",void 0),(0,p.Cg)([(0,f.MZ)()],m.prototype,"isAdmin",void 0),(0,p.Cg)([(0,f.MZ)()],m.prototype,"oAuthState",void 0),(0,p.Cg)([(0,f.MZ)()],m.prototype,"resources",void 0),(0,p.Cg)([(0,f.MZ)()],m.prototype,"scope",void 0),(0,p.Cg)([(0,f.MZ)()],m.prototype,"server",void 0),(0,p.Cg)([(0,f.MZ)()],m.prototype,"ssl",void 0),(0,p.Cg)([(0,f.MZ)()],m.prototype,"token",void 0),(0,p.Cg)([(0,f.MZ)()],m.prototype,"tokenRefreshBuffer",void 0),(0,p.Cg)([(0,f.MZ)()],m.prototype,"userId",void 0),(0,p.Cg)([(0,f.MZ)()],m.prototype,"validity",void 0),m=(0,p.Cg)([(0,g.$)("esri.identity.Credential")],m);const v=m;var _=r(79783),y=r(88491);function w(e){return function(){const e=getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replaceAll(/\W/g,"").toLowerCase();return"dark"===e||"light"===e?e:void 0}()??(0,y.eg)(e??document.body)}function S(e){return function(e){return`calcite-mode-${e}`}(w(e))}r(44208);var I=r(53966),A=r(97768),k=r(61893),U=r(36708),C=r(13069),P=r(62788),b=r(71429),x=r(16494);const T="http://www.w3.org/",R=`${T}2000/svg`,O=`${T}1999/xlink`;let N=[],M=(e,t)=>{let r={};return Object.keys(e).forEach(t=>{r[t]=e[t]}),t&&Object.keys(t).forEach(e=>{r[e]=t[e]}),r},D=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),j=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},E=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if(D(e[s],t))return s;return-1},L=(e,t,r,s)=>{let i=e[t];if(""===i.vnodeSelector)return;let n=i.properties;if(!(n?void 0===n.key?n.bind:n.key:void 0))for(let n=0;n<e.length;n++)if(n!==t){let t=e[n];if(D(t,i))throw new Error(`${r.vnodeSelector} had a ${i.vnodeSelector} child ${"added"===s?s:"removed"}, but there is now more than one. You must add unique key properties to make them distinguishable.`)}},q=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},$=[],Z=!1,F=e=>{(e.children||[]).forEach(F),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},V=()=>{Z=!1,$.forEach(F),$.length=0},B=e=>{$.push(e),Z||(Z=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(V,{timeout:16}):setTimeout(V,16))},H=e=>{let t=e.domNode;if(e.properties){let r=e.properties.exitAnimation;if(r){t.style.pointerEvents="none";let s=()=>{t.parentNode&&(t.parentNode.removeChild(t),B(e))};return void r(t,s,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),B(e))},z=(e,t,r)=>{if(!t)return;let s=r.eventHandlerInterceptor,i=Object.keys(t),n=i.length;for(let o=0;o<n;o++){let n=i[o],a=t[n];if("className"===n)throw new Error('Property "className" is not supported, use "class".');if("class"===n)X(e,a,!0);else if("classes"===n){let t=Object.keys(a),r=t.length;for(let s=0;s<r;s++){let r=t[s];a[r]&&e.classList.add(r)}}else if("styles"===n){let t=Object.keys(a),s=t.length;for(let i=0;i<s;i++){let s=t[i],n=a[s];n&&(j(n),r.styleApplyer(e,s,n))}}else if("key"!==n&&null!=a){let i=typeof a;"function"===i?(0===n.lastIndexOf("on",0)&&(s&&(a=s(n,a,e,t)),"oninput"===n&&function(){let e=a;a=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),e[n]=a):r.namespace===R?"href"===n?e.setAttributeNS(O,n,a):e.setAttribute(n,a):"string"===i&&"value"!==n?"innerHTML"===n?e[n]=x.W5.sanitize(a):W(e)&&n in e?e[n]=a:e.setAttribute(n,a):e[n]=a}}};function W(e){if(!(e instanceof Element&&e.tagName.includes("-")))return!1;const t=window.customElements.get(e.tagName.toLowerCase());return!!t&&e instanceof t}let J,G=(e,t,r)=>{((e,t,r)=>{if(t)for(let s of t)K(s,e,void 0,r)})(e,t.children,r),t.text&&(e.textContent=t.text),z(e,t.properties,r),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,r,t.vnodeSelector,t.properties,t.children])},K=(e,t,r,s)=>{let i,n=0,o=e.vnodeSelector,a=t.ownerDocument;if(""===o)i=e.domNode=a.createTextNode(e.text),void 0!==r?t.insertBefore(i,r):t.appendChild(i);else{for(let l=0;l<=o.length;++l){let h=o.charAt(l);if(l===o.length||"."===h||"#"===h){let h=o.charAt(n-1),d=o.slice(n,l);"."===h?i.classList.add(d):"#"===h?i.id=d:("svg"===d&&(s=M(s,{namespace:R})),void 0!==s.namespace?i=e.domNode=a.createElementNS(s.namespace,d):(i=e.domNode=e.domNode||a.createElement(d),"input"===d&&e.properties&&void 0!==e.properties.type&&i.setAttribute("type",e.properties.type)),void 0!==r?t.insertBefore(i,r):i.parentNode!==t&&t.appendChild(i)),n=l+1}}G(i,e,s)}},X=(e,t,r)=>{t&&t.split(" ").forEach(t=>{t&&e.classList.toggle(t,r)})},Y=(e,t,r,s,i)=>{if(r===s)return!1;s=s||N;let n,o=(r=r||N).length,a=s.length,l=0,h=0,d=!1;for(;h<a;){let a=l<o?r[l]:void 0,c=s[h];if(void 0!==a&&D(a,c))d=J(a,c,i)||d,l++;else{let a=E(r,c,l+1);if(a>=0){for(n=l;n<a;n++)H(r[n]),L(r,n,e,"removed");d=J(r[a],c,i)||d,l=a+1}else K(c,t,l<o?r[l].domNode:void 0,i),q(c),L(s,h,e,"added")}h++}if(o>l)for(n=l;n<o;n++)H(r[n]),L(r,n,e,"removed");return d};J=(e,t,r)=>{let s=e.domNode,i=!1;if(e===t)return!1;let n=!1;if(""===t.vnodeSelector){if(t.text!==e.text){let e=s.ownerDocument.createTextNode(t.text);return s.parentNode.replaceChild(e,s),t.domNode=e,i=!0,i}t.domNode=s}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(r=M(r,{namespace:R})),e.text!==t.text&&(n=!0,void 0===t.text?s.removeChild(s.firstChild):s.textContent=t.text),t.domNode=s,n=Y(t,s,e.children,t.children,r)||n,n=((e,t,r,s)=>{if(!r)return;let i=!1,n=Object.keys(r),o=n.length;for(let a=0;a<o;a++){let o=n[a],l=r[o],h=t[o];if("class"===o)h!==l&&(X(e,h,!1),X(e,l,!0));else if("classes"===o){let t=e.classList,r=Object.keys(l),s=r.length;for(let e=0;e<s;e++){let s=r[e],n=!!l[s];n!==!!h[s]&&(i=!0,n?t.add(s):t.remove(s))}}else if("styles"===o){let t=Object.keys(l),r=t.length;for(let n=0;n<r;n++){let r=t[n],o=l[r];o!==h[r]&&(i=!0,o?(j(o),s.styleApplyer(e,r,o)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"!==o||W(e)){if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===R?"href"===o?e.setAttributeNS(O,o,l):e.setAttribute(o,l):"string"===t?"innerHTML"===o?e[o]=x.W5.sanitize(l):"role"===o&&""===l?e.removeAttribute(o):W(e)&&o in e?e[o]=l:e.setAttribute(o,l):e[o]!==l&&(e[o]=l),i=!0)}}else{let t=e[o];t!==l&&(e["oninput-value"]?t===e["oninput-value"]:l!==h)&&(e[o]=l,e["oninput-value"]=void 0),l!==h&&(i=!0)}}return i})(s,e.properties,t.properties,r)||n,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[s,r,t.vnodeSelector,t.properties,t.children]);return n&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(s,t.properties,e.properties),i};let Q=(e,t)=>({getLastRender:()=>e,update:r=>{if(e.vnodeSelector!==r.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let s=e;e=r,J(s,r,t)},domNode:e.domNode});const ee={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}};let te,re=e=>M(ee,e),se=(e,t,r)=>(r=re(r),K(t,e,void 0,r),Q(t,r)),ie=(e,t,r)=>(r=re(r),K(t,e.parentNode,e,r),Q(t,r)),ne=(e,t,r)=>(r=re(r),t.domNode=e,G(e,t,r),Q(t,r)),oe=(e,t,r)=>(r=re(r),K(t,e.parentNode,e,r),e.parentNode.removeChild(e),Q(t,r));te=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];const ae={handleInterceptedEvent:(e,t,r,s)=>(e.scheduleRender(),t.properties[`on${s.type}`].apply(t.properties.bind||r,[s]))},le={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{t.startsWith("-")?e.style.setProperty(t,r):e.style[t]=r}},he=(e,t,r=!1)=>{let s=e;return t.forEach((e,i)=>{const n=s?.children?((e,t)=>e.find(t))(s.children,t=>t.domNode===e):void 0;r&&!n&&i!==t.length-1||(s=n)}),s};var de=r(91866),ce=r(2741);let ue;ue="components/assets";var pe=r(36563);const fe=Symbol("widget"),ge=Symbol("widget-test-data"),me=[],ve={},_e=new Map;function ye(e,t){let r=t.children;if(r?.length)for(let t=0;t<r.length;++t)r[t]=ye(e,r[t]);else r=me;const s=t.vnodeSelector;if(Ae(s)){const i=t.properties||ve,n=i.key||s,o={key:n,afterCreate:we,afterUpdate:Se,afterRemoved:Ie,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:n,children:r}};return{vnodeSelector:s.vnodeSelector,properties:o,children:void 0,text:void 0,domNode:null}}return t}function we(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:n}){const o=new i(n);o.container=e,_e.set(e,o),o.afterCreate?.(o,e),s.addHandles((0,pe.hA)(()=>Ie(e))),queueMicrotask(()=>{o[ge].projector?.renderNow()})}function Se(e,t,r,{widgetProperties:s}){const i=_e.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function Ie(e){const t=_e.get(e);t&&(t.afterRemoved?.(t,e),t.destroy(),_e.delete(e))}function Ae(e){return"function"==typeof e&&e[fe]}const ke=new Set;new Map;const Ue=new Map;function Ce(){Ue.clear()}function Pe(e){Ue.delete(e)}var be=r(98291),xe=r(76030);(()=>{const e=new Map;new ResizeObserver(t=>{Ce();for(const r of t)e.get(r.target)?.(r)})})();var Te=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},Re=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?Re(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=Te(i)),t.push(i))}};const Oe=function(...e){const t=be.A.acquire();for(let r=0;r<e.length;r++){const s=e[r],i=typeof s;if("string"===i)t.push(s);else if(Array.isArray(s))t.push.apply(t,s);else if("object"===i)for(const e in s)s[e]&&t.push(e)}const r=t.join(" ");return be.A.release(t),r},Ne=function(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}};function Me(e,t,...r){return"function"!=typeof e||Ae(e)?function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(1===r.length&&"string"==typeof r[0])return{vnodeSelector:e,properties:t||void 0,children:void 0,text:r[0],domNode:null};var i=[];return Re(r,i),{vnodeSelector:e,properties:t||void 0,children:i,text:void 0,domNode:null}}(e,t??null,...r):e(t,...r)}var De;let je=0;function Ee(e,t){const r=Object.prototype.hasOwnProperty;for(const s in t)r.call(t,s)&&r.call(e,s)&&(null!=e[s]&&null!=t[s]&&"object"==typeof e[s]&&"object"==typeof t[s]?Ee(e[s],t[s]):e[s]=t[s]);return e}const Le=(e=>{let t;const r={...ae,...e},s=(n=r,{...le,...n}),i=s.performanceLogger;var n;let o,a=!0,l=!1;const h=[],d=[],c=(e,n,o)=>{let a;s.eventHandlerInterceptor=(e,s,n,o)=>function(e){let s;i("domEvent",e);const n=((e,t)=>{const r=[];for(;e&&e!==t;)r.push(e),e=e.parentNode;return r})(e.currentTarget,a.domNode),o=n.some(e=>customElements.get(e?.tagName?.toLowerCase()));if(e.eventPhase!==Event.CAPTURING_PHASE&&o){const t=e.composedPath(),r=t.slice(t.indexOf(e.currentTarget),t.indexOf(a.domNode)).reverse();s=he(a.getLastRender(),r,!0)}else n.reverse(),s=he(a.getLastRender(),n);let l;return s&&(l=r.handleInterceptedEvent(t,s,this,e)),i("domEventProcessed",e),l},r.postProcessProjectionOptions?.(s);const l=o();a=e(n,l,s),s.eventHandlerInterceptor=void 0,h.push(a),d.push(o),r.afterFirstVNodeRendered&&r.afterFirstVNodeRendered(a,l)};let u=()=>{if(o=void 0,a){a=!1,i("renderStart",void 0);for(let e=0;e<h.length;e++){const t=d[e]();i("rendered",void 0);try{h[e].update(t)}catch(e){console.error(e)}i("patched",void 0)}i("renderDone",void 0),a=!0}};return r.modifyDoRenderImplementation&&(u=r.modifyDoRenderImplementation(u,h,d)),t={renderNow:u,scheduleRender:()=>{o||l||(o=requestAnimationFrame(u))},stop:()=>{o&&(cancelAnimationFrame(o),o=void 0),l=!0},resume:()=>{l=!1,a=!0,t.scheduleRender()},append:(e,t)=>{c(se,e,t)},insertBefore:(e,t)=>{c(ie,e,t)},merge:(e,t)=>{c(ne,e,t)},replace:(e,t)=>{c(oe,e,t)},detach:e=>{for(let t=0;t<d.length;t++)if(d[t]===e)return d.splice(t,1),h.splice(t,1)[0];throw new Error("renderFunction was not found")}},t})({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,s,i,n)=>{const o=t?.(e,s,i,n),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in i)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>o?.call(i,e);i.addEventListener(t,r,a);const s=()=>i.removeEventListener(t,r,a),l=n.afterRemoved;n.afterRemoved=e=>{l?.(e),s()}}return o}},handleInterceptedEvent(e,t,r,s){const{eventPhase:i,type:n}=s,o=i===Event.CAPTURING_PHASE;let a=`on${n}${o?"capture":""}`;const l=t.properties;(l&&a in l||(a=`on${n[0].toUpperCase()}${n.slice(1)}${o?"Capture":""}`,l&&a in l))&&(Ce(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let qe=!1,$e=class extends((0,k.g)(a.nJ)){static{this[De]=!0}constructor(e,t){super(e,t),this._attached=!1,this._projector=Le,this._readyForTrueRender=!1,this.key=this,this.autoRenderingEnabled=!0,this.topLayerDisabled=!1,this._loadLocale=(0,c.sg)(async()=>{if(this._messageBundleProps?.length){const e=await Promise.allSettled(this._messageBundleProps.map(async({bundlePath:e,propertyName:t})=>{if(this.destroyed)return;let r=await(0,_.ud)(e);this.destroyed||(this.uiStrings&&Object.keys(this.uiStrings)&&(r=Ee((0,h.o8)(r),this.uiStrings)),this[t]=r)}));if(this.destroyed)return;for(const t of e)"rejected"===t.status&&I.A.getLogger(this).error("widget-intl:locale-error",this.declaredClass,t.reason)}await this.loadLocale()}),this.addHandles((0,pe.hA)()),de.qu||(0,de.Qu)((0,u.s2)((0,ce.s)("components/assets")));const r="esri-widget-uid-"+(0,C.lk)(),s=this.render.bind(this);this._trackingTarget=new b.r(()=>{this.autoRenderingEnabled&&this.scheduleRender()});const i=()=>({vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}),n=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const e=s()??i(),t=e.properties??={};if(t.key??=r,Ae(e.vnodeSelector)){if(!this.visible)return i()}else this.visible?t.styles||(t.styles={}):(t.class="",t.styles={display:"none"}),t.styles.display??="";let n=0;return e.children?.forEach(e=>{Ae(e.vnodeSelector)||(e.properties??={},e.properties.key??=`${this.id}--${n++}`)}),ye(this,e)};this.render=()=>{if(qe)return n();let e=(t=this,Ue.get(t)??null);var t;if(e)return e;this._trackingTarget.clear(),qe=!0;try{e=(0,P.a)(this._trackingTarget,n)}catch(t){throw I.A.getLogger(this).error(t),t}finally{qe=!1}return e&&function(e,t){Ue.set(e,t)}(this,e),e};const o=this.beforeFirstRender();o?this._resourcesFetch=o.then(()=>{this.destroyed||(this._readyForTrueRender=!0,this._postInitialize())}):(this._resourcesFetch=Promise.resolve().then(()=>{this.destroyed||this._postInitialize()}),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),function(e){ke.add(e),e.finally(()=>ke.delete(e))}(this._resourcesFetch)}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then(()=>{}).catch(c.jH):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||((0,A.pR)(this._trackingTarget),(0,A.pR)(this.viewModel),this._detach(this.container),this._set("container",null),this.render=()=>null,this._projector=null,Pe(this))}get container(){return this._get("container")}set container(e){this._get("container")||this._set("container",function(e){return"string"==typeof e?document.getElementById(e):e??null}(e))}get destroyed(){return super.destroyed}get domNode(){return this.container}set domNode(e){this.container=e}get icon(){return null}set icon(e){this._overrideIfSome("icon",e)}get id(){return this._get("id")||this.container?.id||Date.now().toString(16)+"-widget-"+je++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(De=fe,ge)](){return{projector:this._projector}}static{this.vnodeSelector="div"}render(){throw new Error("not implemented")}removeContainer(){this._set("container",null)}scheduleRender(){this.destroyed||(Pe(this),this._projector.scheduleRender())}classes(...e){return Oe.apply(this,e)}renderNow(){Pe(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles((0,U.wB)(()=>this.viewModel,(e,t)=>{t&&this.removeHandles("delegated-events"),e&&(0,l.wb)(e)&&this.addHandles(this._delegatedEventNames.map(t=>(0,l.on)(e,t,e=>{this.emit(t,e)})),"delegated-events")},U.pc)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(c.jH),this.scheduleRender()};this.addHandles([(0,_.oQ)(e),(0,U.wB)(()=>this.uiStrings,e)]),this.addHandles((0,U.z7)(()=>this.container,e=>{this.destroyed||(e.closest("[arcgis-widget-wrapped]")||(this.topLayerDisabled=!0,this.announceDeprecation?.()),this._attach(e))},{initial:!0,once:!0}))}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){this._attached&&(this._projector.detach(this.render),this._attached=!1),e?.parentNode?.removeChild(e)}};(0,p.Cg)([(0,f.MZ)()],$e.prototype,"_readyForTrueRender",void 0),(0,p.Cg)([(0,f.MZ)({value:null})],$e.prototype,"container",null),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"icon",null),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"id",null),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"label",null),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"renderable",null),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"uiStrings",void 0),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"viewModel",void 0),(0,p.Cg)([(0,f.MZ)({value:!0})],$e.prototype,"visible",null),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"key",void 0),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"children",void 0),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"afterCreate",void 0),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"afterUpdate",void 0),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"afterRemoved",void 0),(0,p.Cg)([(0,f.MZ)()],$e.prototype,"topLayerDisabled",void 0),$e=(0,p.Cg)([(0,f.$K)("esri.widgets.Widget")],$e);const Ze=$e,Fe="esri-identity-modal",Ve={base:Fe,info:`${Fe}__info`,notice:`${Fe}__notice`};let Be=class extends Ze{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return function(e){const t=[];for(const r of Object.keys(e))customElements.get(`calcite-${r}`)||t.push(e[r]?.());return t.length>0?Promise.all(t):null}({button:()=>Promise.all([r.e(7617),r.e(9597),r.e(5673)]).then(r.bind(r,15673)),dialog:()=>Promise.all([r.e(7617),r.e(9597),r.e(3620),r.e(8345)]).then(r.bind(r,18345)),input:()=>Promise.all([r.e(7617),r.e(9597),r.e(6364)]).then(r.bind(r,16364)),label:()=>Promise.all([r.e(7617),r.e(4387)]).then(r.bind(r,14387)),notice:()=>Promise.all([r.e(7617),r.e(9597),r.e(3620),r.e(883)]).then(r.bind(r,90883))})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:e,title:t,messages:r,signingIn:s,oAuthPrompt:i,server:n,resource:o,error:a}=this,{info:l,oAuthInfo:h,lblItem:d,invalidUser:c,noAuthService:u,lblUser:p,lblPwd:f,lblCancel:g,lblSigning:m,lblOk:v}=r;return Me("div",{class:this.classes(Ve.base,S(this.container))},Me("form",{bind:this,onsubmit:this._submit},Me("calcite-dialog",{bind:this,heading:t,modal:!0,open:e,outsideCloseDisabled:!0,scale:"s",width:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},Me("div",{class:Ve.info},(0,_.V2)(i?h:l,{server:n&&/\.arcgis\.com/i.test(n)?"ArcGIS Online":n,resource:`(${o||d})`})),a?Me("calcite-notice",{class:Ve.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},Me("div",{slot:"message"},a.details?.httpStatus?c:u)):null,i?null:[Me("calcite-label",null,p,Me("calcite-input",{afterCreate:e=>this._usernameInputNode=e,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),Me("calcite-label",null,f,Me("calcite-input",{afterCreate:e=>this._passwordInputNode=e,bind:this,name:"password",required:!0,type:"password",value:""}))],Me("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},g),Me("calcite-button",{loading:!!s,slot:"footer-end",type:"submit"},s?m:v))))}_focusUsernameInput(){return async function(e){await(0,xe.$m)((0,c.Mq)(void 0));const t=e();t&&("setFocus"in t&&"function"==typeof t.setFocus?await t.setFocus():t instanceof HTMLElement&&t.focus())}(()=>this._usernameInputNode)}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",t)}};(0,p.Cg)([(0,f.MZ)({readOnly:!0})],Be.prototype,"container",void 0),(0,p.Cg)([(0,f.MZ)(),Ne("esri/t9n/common")],Be.prototype,"commonMessages",void 0),(0,p.Cg)([(0,f.MZ)()],Be.prototype,"error",void 0),(0,p.Cg)([(0,f.MZ)(),Ne("esri/identity/t9n/identity")],Be.prototype,"messages",void 0),(0,p.Cg)([(0,f.MZ)()],Be.prototype,"oAuthPrompt",void 0),(0,p.Cg)([(0,f.MZ)()],Be.prototype,"open",void 0),(0,p.Cg)([(0,f.MZ)()],Be.prototype,"signingIn",void 0),(0,p.Cg)([(0,f.MZ)()],Be.prototype,"server",void 0),(0,p.Cg)([(0,f.MZ)({readOnly:!0})],Be.prototype,"title",null),(0,p.Cg)([(0,f.MZ)()],Be.prototype,"resource",void 0),Be=(0,p.Cg)([(0,f.$K)("esri.identity.IdentityModal")],Be);const He=Be,ze="esriJSAPIOAuth";class We{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token))if(null==this.expires&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t?.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(ze,JSON.stringify(e))}catch(e){return console.warn(e),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t?.appId&&t?.portalUrl&&(null==this.expires||this.expires>Date.now())&&(this.refreshToken||this.token)){const e=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken";(0,n.A)(e,{authMode:"anonymous",keepAlive:!0,method:"post",query:{f:"json",auth_token:this.refreshToken||this.token,client_id:t.appId,token_type_hint:this.refreshToken?"refresh_token":"access_token"}})}if(t?.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(ze,JSON.stringify(e))}catch(e){console.log(e)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t?.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(ze);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}We.prototype.declaredClass="esri.identity.OAuthCredential";var Je,Ge=r(25482);let Ke=class extends Ge.o{static{Je=this}constructor(e){super(e),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Je.fromJSON(this.toJSON())}};(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"appId",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"authNamespace",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"expiration",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"flowType",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"forceLogin",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"forceUserId",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"locale",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"minTimeUntilExpiration",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"popup",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"popupCallbackUrl",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"popupWindowFeatures",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"portalUrl",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"preserveUrlHash",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ke.prototype,"userId",void 0),Ke=Je=(0,p.Cg)([(0,f.$K)("esri.identity.OAuthInfo")],Ke);const Xe=Ke;let Ye=class extends Ge.o{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"adminTokenServiceUrl",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"currentVersion",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"hasPortal",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"hasServer",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"owningSystemUrl",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"owningTenant",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"server",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"shortLivedTokenValidity",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"tokenServiceUrl",void 0),(0,p.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"webTierAuth",void 0),Ye=(0,p.Cg)([(0,f.$K)("esri.identity.ServerInfo")],Ye);const Qe=Ye;var et=r(39131);const tt={},rt=e=>{const t=new u.s0(e.owningSystemUrl).host,r=new u.s0(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},st=(e,t)=>!!(rt(e)&&t&&t.some(t=>t.test(e.server)));let it=null,nt=null;try{it=window.localStorage,nt=window.sessionStorage}catch{}class ot extends a.a${constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=(0,u.An)(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer|3DTilesServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const t=this.serverInfos;t?(e=e.filter(e=>!this.findServerInfo(e.server)),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach(e=>{e.owningSystemUrl&&this._portals.push(e.owningSystemUrl),e.hasPortal&&this._portals.push(e.server)})}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const e=this.findOAuthInfo(r.portalUrl);e&&t.splice(t.indexOf(e),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let s,i=this.findServerInfo(t),n=!0;i||(i=new Qe,i.server=this._getServerInstanceRoot(t),r?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(t),i.hasPortal=!0),this.registerServers([i])),s=this._findCredential(t),s?(delete e.server,Object.assign(s,e),n=!1):(s=new v({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),s.resources=[t],this.credentials.push(s)),s.emitTokenChange(!1),n||s.refreshServerTokens()}toJSON(){return(0,h.oy)({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;"string"==typeof e&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,s=e.credentials;if(t){const e=[];t.forEach(t=>{t.server&&t.tokenServiceUrl&&e.push(t.declaredClass?t:new Qe(t))}),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach(t=>{t.appId&&e.push(t.declaredClass?t:new Xe(t))}),e.length&&this.registerOAuthInfos(e)}s&&s.forEach(e=>{e.server&&e.token&&e.expires&&e.expires>Date.now()&&((e=e.declaredClass?e:new v(e)).emitTokenChange(),this.credentials.push(e))})}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const s=this._isServerRsrc(e)?"server":"portal";if(t){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&t===i.userId&&i.scope===s){r=i;break}}else for(const t of this.credentials)if(this._hasSameServerInstance(t.server,e)&&-1!==this._getIdenticalSvcIdx(e,t)&&t.scope===s){r=t;break}return r}getCredential(e,t){let r,s=!1,i=!0;t&&(s=!(!t.token&&!t.credential),r=t.error,i=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,a=Promise.withResolvers();if(t.signal&&(0,c.u7)(t.signal,()=>{n.abort()}),(0,c.u7)(n,()=>{a.reject(new o.A("identity-manager:user-aborted","ABORTED"))}),(0,c.G4)(n))return a.promise;t.signal=n.signal;const l=this._isAdminResource(e),h=s?this.findCredential(e):null;let d;if(h&&498===r?.details?.httpStatus)h.destroy();else if(h)return d=new o.A("identity-manager:not-authorized","You are currently signed in as: '"+h.userId+"'. You do not have access to this resource: "+e,{error:r}),a.reject(d),a.promise;const p=this._findCredential(e,t);if(p)return a.resolve(p),a.promise;let f=this.findServerInfo(e);if(f)!f.hasPortal&&f.server&&f.owningSystemUrl&&this._hasSameServerInstance(f.server,f.owningSystemUrl)&&(f.hasPortal=!0),!f.hasServer&&this._isServerRsrc(e)&&(f._restInfoPms=this._getTokenSvcUrl(e),f.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return d=new o.A("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),a.reject(d),a.promise;f=new Qe,f.server=this._getServerInstanceRoot(e),"string"==typeof t?(f.tokenServiceUrl=t,f.hasPortal=!0):(f._restInfoPms=t,f.hasServer=!0),this.registerServers([f])}return f.hasPortal&&void 0===f._selfReq&&(i||(0,u.FX)(f.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(e=>e.tokenServiceUrl===f.tokenServiceUrl))&&(f._selfReq={owningTenant:t?.owningTenant,selfDfd:this._getPortalSelf(f.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,f,t,a,l)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const s=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new u.s0(this._appOrigin),a=e.shortLivedTokenValidity;let l,h,d,c,p,f,g,m;t&&(m=this.tokenValidity||a||this._defaultTokenValidity,m>a&&a>0&&(m=a)),r&&(l=r.isAdmin,h=r.serverUrl,d=r.token,f=r.signal,g=r.ssl,e.customParameters=r.customParameters),l?c=e.adminTokenServiceUrl:(c=e.tokenServiceUrl,p=new u.s0(c.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!g&&"http"===i.scheme&&((0,u.FX)(i.uri,c,!0)||"https"===p.scheme&&i.host===p.host&&"7080"===i.port&&"7443"===p.port)&&(c=c.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:d,expiration:m,referer:l||s?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:f};return s||(v.withCredentials=!1),(0,n.A)(c,v).then(r=>{const s=r.data;if(!s?.token)return new o.A("identity-manager:authentication-failed","Unable to generate token");const i=e.server;return tt[i]||(tt[i]={}),t&&(tt[i][t.username]=t.password),s.validity=m,s})}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,t,r){let s=!1;return this.getCredential(e,{prompt:!1}).then(i=>{let a;const l={f:"json"};if("portal"===i.scope)if(t&&(this._doPortalSignIn(e)||r?.force))a=i.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!i.token)return{credential:i};a=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};a=i.server+"/rest/services"}return i.token&&(l.token=i.token),(0,n.A)(a,{query:l,authMode:"anonymous"}).then(e=>{if(!1===e.data.valid)throw new o.A("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,e.data);return s=!!e.data.viewOnlyUserTypeApp,{credential:i}}).catch(e=>{if("identity-manager:not-authorized"===e.name)throw e;const t=e.details?.httpStatus;if(498===t)throw i.destroy(),new o.A("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new o.A("identity-manager:invalid-request","Bad request");return{credential:i}})}).then(e=>({credential:e.credential,viewOnly:s}))}setOAuthResponseHash(e){e&&(e.startsWith("#")&&(e=e.slice(1)),this._processOAuthPopupParams((0,u.zf)(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=Promise.withResolvers(),i=()=>{l?.remove(),h?.remove(),this.dialog?.destroy(),this.dialog=l=h=null},n=()=>{i(),this._oAuthDfd=null,s.reject(new o.A("identity-manager:user-aborted","ABORTED"))};r.signal&&(0,c.u7)(r.signal,()=>{n()});const a=new He({open:!0,resource:this.getResourceName(e),server:t.server});this.dialog=a,this.emit("dialog-create");let l=a.on("cancel",n),h=a.on("submit",e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then(n=>{i();const o=new v({userId:e.username,server:t.server??void 0,token:n.token,expires:null!=n.expires?Number(n.expires):null,ssl:!!n.ssl,isAdmin:r.isAdmin,validity:n.validity});s.resolve(o)}).catch(e=>{a.error=e,a.signingIn=!1})});return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=Promise.withResolvers();const i=this._oAuthDfd;let n;s?.signal&&(0,c.u7)(s.signal,()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&d()}),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const a=r._oAuthCred;if(a.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));n=(0,u.$1)(e),a.codeVerifier=n,e=crypto.getRandomValues(new Uint8Array(32)),a.stateUID=(0,u.$1)(e),a.save()||(a.codeVerifier=n=null)}else a.codeVerifier=null;let l,h;this._getCodeChallenge(n).then(i=>{const n=!s||!1!==s.oAuthPopupConfirmation;if(!r.popup||!n)return void this._doOAuthSignIn(e,t,r,i);const o=new He({oAuthPrompt:!0,server:t.server,open:!0});this.dialog=o,this.emit("dialog-create"),l=o.on("cancel",d),h=o.on("submit",()=>{p(),this._doOAuthSignIn(e,t,r,i)})});const d=()=>{p(),this._oAuthDfd=null,i.reject(new o.A("identity-manager:user-aborted","ABORTED"))},p=()=>{l?.remove(),h?.remove(),this.dialog?.destroy(),this.dialog=null};return i.promise}async refreshToken(e){const t=this.findServerInfo(e.server),r=t?.owningSystemUrl,s=!!r&&"server"===e.scope,i=s&&st(t,this._legacyFed),n=t.webTierAuth,o=n&&this.normalizeWebTierAuth,a=tt[e.server],l=a?.[e.userId];let h,d=e.resources&&e.resources[0],c=s?this.findServerInfo(r):null,u={username:e.userId,password:l};if(n&&!o)return;s&&!c&&this.serverInfos.some(e=>(this._isIdProvider(r,e.server)&&(c=e),!!c));const p=c?this.findCredential(c.server,e.userId):null;if(!s||p){if(!i){if(s)h={serverUrl:d,token:p?.token,ssl:p?.ssl};else if(o)u=null,h={ssl:e.ssl};else{if(!l){let r;return d&&(d=this._sanitizeUrl(d),e._enqueued=1,r=this._enqueue(d,t,null,null,e.isAdmin,e),r.then(()=>{e._enqueued=0,e.refreshServerTokens()}).catch(()=>{e._enqueued=0})),r}e.isAdmin&&(h={isAdmin:!0})}return this.generateToken(s?c:t,s?null:u,h).then(t=>{e.token=t.token,e.expires=null!=t.expires?Number(t.expires):null,e.creationTime=Date.now(),e.validity=t.validity,e.emitTokenChange(),e.refreshServerTokens()}).catch(()=>{})}p?.refreshToken()}}refreshServerTokens(e){"portal"===e.scope&&this.credentials.forEach(t=>{const r=this.findServerInfo(t.server),s=r?.owningSystemUrl;t!==e&&t.userId===e.userId&&s&&"server"===t.scope&&(this._hasSameServerInstance(e.server,s)||this._isIdProvider(s,e.server))&&(st(r,this._legacyFed)?(t.token=e.token,t.expires=e.expires,t.creationTime=e.creationTime,t.validity=e.validity,t.emitTokenChange()):t.refreshToken())})}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=(0,l.on)(window,"message",t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&"arcgis:auth:requestCredential"===t.data?.type){const r=t.source;this.getCredential(e).then(e=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:e.expires,server:e.server,ssl:e.ssl,token:e.token,userId:e.userId}},t.origin)}).catch(e=>{r.postMessage({type:"arcgis:auth:error",error:{name:e.name,message:e.message}},t.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.startsWith("#")&&(e=e.slice(1));const t=(0,u.zf)(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),"access_denied"===t.error&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let t=window.location.search;if(t){t.startsWith("?")&&(t=t.slice(1));const e=(0,u.zf)(t);let r=!1;if(e.code&&e.state)try{e.state=JSON.parse(e.state),e.state.portalUrl&&e.state.uid&&(this._oAuthLocationParams=e,r=!0)}catch{}else if(e.error&&e.error_description&&(console.log("IdentityManager OAuth Error: ",e.error," - ",e.error_description),"access_denied"===e.error&&(r=!0,e.state)))try{e.state=JSON.parse(e.state)}catch{}if(r){const t={...e};["code","error","error_description","message_code","persist","state"].forEach(e=>{delete t[e]});const r=(0,u.x0)(t),s=window.location.pathname+(r?`?${r}`:"")+(e.state?.hash||"");window.history.replaceState(window.history.state,"",s)}}}_getOAuthToken(e,t,r,s,i){return e=e.replace(/^http:/i,"https:"),(0,n.A)(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:s&&i?{grant_type:"authorization_code",code:t,redirect_uri:s,client_id:r,code_verifier:i}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then(e=>e.data)}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t);return(0,u.$1)(new Uint8Array(r))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new o.A("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let r,s,i,n,o=-1;const a=t?.token,l=t?.resource,h=this._isServerRsrc(e)?"server":"portal",d=this.credentials.filter(t=>this._hasSameServerInstance(t.server,e)&&t.scope===h);if(e=l||e,d.length)if(1===d.length){if(r=d[0],i=this.findServerInfo(r.server),s=i?.owningSystemUrl,n=s?this.findCredential(s,r.userId):void 0,o=this._getIdenticalSvcIdx(e,r),!a)return-1===o&&r.resources.push(e),this._addResource(e,n),r;-1!==o&&(r.resources.splice(o,1),this._removeResource(e,n))}else{let t,r;if(d.some(a=>(r=this._getIdenticalSvcIdx(e,a),-1!==r&&(t=a,i=this.findServerInfo(t.server),s=i?.owningSystemUrl,n=s?this.findCredential(s,t.userId):void 0,o=r,!0))),a)t&&(t.resources.splice(o,1),this._removeResource(e,n));else if(t)return this._addResource(e,n),t}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t)for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}return t}_addResource(e,t){t&&-1===this._getIdenticalSvcIdx(e,t)&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t?.isAdmin&&!(0,u.FX)(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!(0,u.FX)(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new u.s0(e);return t.scheme+"://"+t.host+(null!=t.port?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return-1===r&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),-1!==r||(0,et.$E)(t)||(r=t.indexOf("/sharing")),-1===r&&t.endsWith("/")&&(r=t.length-1),r>-1?e.slice(0,r):e}_hasSameServerInstance(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=(0,et.qG)(e),t=(0,et.qG)(t),(e=e.slice(Math.max(0,e.indexOf(":"))))===t.slice(Math.max(0,t.indexOf(":")))}_sanitizeUrl(e){const t=(i.A.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return-1!==r&&(e=e.slice(r+t.length+1)),e=(0,u.S8)(e),(0,u.An)(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const s=this._getSuffix(e).toLowerCase(),i=this._getSuffix(t).toLowerCase();if(r=s===i,!r){const e=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=s.replaceAll(e,"$1")===i.replaceAll(e,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new u.s0(e.toLowerCase()),r=this._portalConfig;let s=this._gwDomains.some(e=>e.regex.test(t.uri));return!s&&r&&(s=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),s||i.A.portalUrl&&(s=(0,u.FX)(t,i.A.portalUrl,!0)),s||(s=this._portals.some(e=>this._hasSameServerInstance(e,t.uri))),s=s||this._agsPortal.test(t.path),s}_isIdProvider(e,t){let r=-1,s=-1;this._gwDomains.forEach((i,n)=>{-1===r&&i.regex.test(e)&&(r=n),-1===s&&i.regex.test(t)&&(s=n)});let i=!1;if(r>-1&&s>-1&&(0===r||4===r?0!==s&&4!==s||(i=!0):1===r?1!==s&&2!==s||(i=!0):2===r?2===s&&(i=!0):3===r&&3===s&&(i=!0)),!i){const r=this.findServerInfo(t),s=r?.owningSystemUrl;s&&rt(r)&&this._isPortalDomain(s)&&this._isIdProvider(e,s)&&(i=!0)}return i}_getIdenticalSvcIdx(e,t){let r=-1;for(let s=0;s<t.resources.length;s++){const i=t.resources[s];if(this._isIdenticalService(e,i)){r=s;break}}return r}_getSuffix(e){return e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"$1")}_getTokenSvcUrl(e){let t,r,s;if(this._isRESTService(e)||this._isAdminResource(e)){const s=this._getServerInstanceRoot(e);return t=s+"/admin/generateToken",r=(0,n.A)(e=s+"/rest/info",{query:{f:"json"}}).then(e=>e.data),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let t="";if(this._gwDomains.some(r=>(r.regex.test(e)&&(t=r.tokenServiceUrl),!!t)),t||this._portals.some(r=>(this._hasSameServerInstance(r,e)&&(t=r+this._gwTokenUrl),!!t)),t||(s=e.toLowerCase().indexOf("/sharing"),-1!==s&&(t=e.slice(0,s)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const r=new u.s0(e).port;/^http:\/\//i.test(e)&&"7080"===r&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}}_processOAuthResponseParams(e,t,r){const s=t._oAuthCred;if(e.code){const i=s.codeVerifier;return s.codeVerifier=null,s.stateUID=null,s.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),i).then(i=>{const n=new v({userId:i.username,server:r.server??void 0,token:i.access_token,expires:Date.now()+1e3*i.expires_in,ssl:i.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=n.userId,s.storage=i.persist?it:nt,s.refreshToken=i.refresh_token,s.token=null,s.expires=i.refresh_token_expires_in?Date.now()+1e3*i.refresh_token_expires_in:null,s.userId=n.userId,s.ssl=n.ssl,s.save(),n})}const i=new v({userId:e.username,server:r.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:"true"===e.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=i.userId,s.storage=e.persist?it:nt,s.refreshToken=null,s.token=i.token,s.expires=i.expires,s.userId=i.userId,s.ssl=i.ssl,s.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r="access_denied"===e.error,s=new o.A(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then(e=>{t.resolve(e)}).catch(e=>{t.reject(e)})}_setOAuthResponseQueryString(e){e&&(e.startsWith("?")&&(e=e.slice(1)),this._processOAuthPopupParams((0,u.zf)(e)))}async _exchangeToken(e,t,r){return(await(0,n.A)(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}})).data.token}async _getPlatformSelf(e,t){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const r=await(0,n.A)(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,r.data}catch(e){throw"OAUTH_0066"===e.details?.messageCode&&(this._getPlatformSelfError=[e,Date.now()]),e}}_getPortalSelf(e,t){let r;return this._gwDomains.some(t=>(t.regex.test(e)&&(r=t.customBaseUrl),!!r)),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),(0,n.A)(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(e=>e.data))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,s=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(s?s.hasPortal||s.owningSystemUrl&&this._isPortalDomain(s.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||(0,u.FX)(r,e,!0)))}_checkProtocol(e,t,r,s){let i=!0;const n=s?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&(0,u.zs)(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!i)&&r(new o.A("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,t,r,s,i,n){return s||(s=Promise.withResolvers()),s.resUrl_=e,s.sinfo_=t,s.options_=r,s.admin_=i,s.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(s)):this._xoReqs.push(s):this._doSignIn(s),s.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=t=>{const r=e.options_?.resource,s=e.resUrl_,i=e.refresh_;let n=!1;this.credentials.includes(t)||(i&&this.credentials.includes(i)?(i.userId=t.userId,i.token=t.token,i.expires=t.expires,i.validity=t.validity,i.ssl=t.ssl,i.creationTime=t.creationTime,n=!0,t=i):this.credentials.push(t)),t.resources||(t.resources=[]),t.resources.includes(r||s)||t.resources.push(r||s),t.scope=this._isServerRsrc(s)?"server":"portal",t.emitTokenChange();const o=this._soReqs,a={};this._soReqs=[],o.forEach(e=>{if(!this._isIdenticalService(s,e.resUrl_)){const r=this._getSuffix(e.resUrl_);a[r]||(a[r]=!0,t.resources.push(e.resUrl_))}}),e.resolve(t),o.forEach(e=>{this._hasSameServerInstance(this._getServerInstanceRoot(s),e.resUrl_)?e.resolve(t):this._soReqs.push(e)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,n||this.emit("credential-create",{credential:t}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=t=>{e.reject(t),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=(i,n,a,h)=>{const d=e.sinfo_,p=!e.options_||!1!==e.options_.prompt,f=d.hasPortal&&this._findOAuthInfo(e.resUrl_);let g,m;if(i)t(new v({userId:i,server:d.server??void 0,token:a??void 0,expires:null!=h?Number(h):null,ssl:!!n}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const s=(0,l.on)(window,"message",e=>{e.source===window.parent&&e.data&&("arcgis:auth:credential"===e.data.type?(s.remove(),e.data.credential.expires<Date.now()?r(new o.A("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new v(e.data.credential))):"arcgis:auth:error"===e.data.type&&(s.remove(),"tokenExpiredError"===e.data.error.name?r(new o.A("identity-manager:credential-request-failed","Parent application's token has expired.")):r(o.A.fromJSON(e.data.error))))});(0,c.u7)(e.options_?.signal,()=>{s.remove()})}else if(f){let i=f._oAuthCred;if(!i){const e=new We(f,it),t=new We(f,nt);e.isValid()&&t.isValid()?e.expires>t.expires?(i=e,t.destroy()):(i=t,e.destroy()):i=e.isValid()?e:t,f._oAuthCred=i}if(i.isValid()){g=new v({userId:i.userId??void 0,server:d.server??void 0,token:i.token??void 0,expires:i.expires,ssl:i.ssl??void 0,_oAuthCred:i});const n=f.appId!==i.appId&&this._doPortalSignIn(e.resUrl_);n||i.refreshToken?(e._pendingDfd=i.refreshToken?this._getOAuthToken(d.server,i.refreshToken,i.appId).then(e=>(g.expires=Date.now()+1e3*e.expires_in,g.token=e.access_token,g)):Promise.resolve(g),e._pendingDfd.then(e=>n?this._exchangeToken(e.server,f.appId,e.token).then(t=>(e.token=t,e)).catch(()=>e):e).then(e=>{t(e)}).catch(e=>{const t=e.details?.httpStatus;t>0&&404!==t?(i.destroy(),s()):r(e)})):t(g)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(f.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===i.stateUID&&i.codeVerifier)){const s=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(s,f,d).then(e=>{t(e)}).catch(r)}else{const s=()=>{p?e._pendingDfd=this.oAuthSignIn(e.resUrl_,d,f,e.options_).then(t,r):(m=new o.A("identity-manager:not-authenticated","User is not signed in."),r(m))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(d.server,f.appId).then(e=>{(0,u.FX)(e.portalUrl,this._appOrigin,!0)?(g=new v({userId:e.username,server:d.server??void 0,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(g)):s()}).catch(s):s()}}else if(p){if(this._checkProtocol(e.resUrl_,d,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,d,s).then(t,r)}}else m=new o.A("identity-manager:not-authenticated","User is not signed in."),r(m)},i=()=>{const s=e.sinfo_,i=s.owningSystemUrl,n=e.options_;let o,a,l,h;if(n&&(o=n.token,a=n.error,l=n.prompt),h=this._findCredential(i,{token:o,resource:e.resUrl_}),!h)for(const e of this.credentials)if(this._isIdProvider(i,e.server)){h=e;break}if(h){const i=this.findCredential(e.resUrl_,h.userId);if(i)t(i);else if(st(s,this._legacyFed)){const e=h.toJSON();e.server=s.server,e.resources=null,t(new v(e))}else(e._pendingDfd=this.generateToken(this.findServerInfo(h.server),null,{serverUrl:e.resUrl_,token:h.token,signal:e.options_.signal,ssl:h.ssl})).then(r=>{t(new v({userId:h?.userId,server:s.server??void 0,token:r.token,expires:null!=r.expires?Number(r.expires):null,ssl:!!r.ssl,isAdmin:e.admin_,validity:r.validity}))},r)}else this._busy=null,o&&(e.options_.token=null),(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:s.owningTenant,signal:e.options_.signal,token:o,error:a,prompt:l})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},t=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(t)})};this._errbackFunc=r;const n=e.sinfo_.owningSystemUrl,a=this._isServerRsrc(e.resUrl_),h=e.sinfo_._restInfoPms;h?h.promise.then(t=>{const r=e.sinfo_;if(r._restInfoPms){r.adminTokenServiceUrl=r._restInfoPms.adminUrl,r._restInfoPms=null,r.tokenServiceUrl=((0,d.wc)("authInfo.tokenServicesUrl",t)||(0,d.wc)("authInfo.tokenServiceUrl",t)||(0,d.wc)("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=(0,d.wc)("authInfo.shortLivedTokenValidity",t)??null,r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}a&&r.owningSystemUrl?i():s()},()=>{e.sinfo_._restInfoPms=null;const t=new o.A("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(t)}):a&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(t=>{const r={};let s,i,n,o;return t&&(s=t.user?.username,r.username=s,r.allSSL=t.allSSL,i=t.supportsOAuth,o=parseFloat(t.currentVersion),"multitenant"===t.portalMode&&(n=t.customBaseUrl),e.sinfo_.currentVersion=o),e.sinfo_.webTierAuth=!!s,s&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:r.allSSL}).catch(()=>null).then(e=>(r.portalToken=e?.token,r.tokenExpiration=e?.expires,r)):!s&&i&&o>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:n,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>r):r}).catch(()=>null).then(t=>{e.sinfo_._selfReq=null,t?s(t.username,t.allSSL,t.portalToken,t.tokenExpiration):s()}):s()}_generateOAuthInfo(e){let t,r=null,s=e.portalUrl;const i=e.customBaseUrl,o=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=this._appUrlObj.path;const e=r.search(/\/(apps|home)\//);r=e>-1?r.slice(0,e):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=(0,n.A)(r+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new Xe({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})})):t=Promise.resolve(),t.then(()=>{if(this._defaultOAuthInfo)return s=s.replace(/^http:/i,"https:"),(0,n.A)(s+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:o,client_id:this._defaultOAuthInfo.appId,redirect_uri:(0,u.s2)(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(e=>{if(e.data.valid){const t=this._defaultOAuthInfo.clone();e.data.urlKey&&i?t.portalUrl="https://"+e.data.urlKey.toLowerCase()+"."+i:t.portalUrl=s,t.popup=window!==window.top||!((0,u.FX)(s,this._appOrigin)||this._gwDomains.some(e=>e.regex.test(s)&&e.regex.test(this._appOrigin))),this.oAuthInfos.push(t)}})})}_doOAuthSignIn(e,t,r,s){const i=r._oAuthCred,n={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const a={client_id:r.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!i.codeVerifier)};r.forceLogin&&(a.force_login=!0),r.forceUserId&&r.userId&&(a.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(a.redirectToUserOrgUrl=!0),i.codeVerifier&&(a.code_challenge=s||i.codeVerifier,a.code_challenge_method=s?"S256":"plain");const h=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",d=h+"?"+(0,u.x0)(a);if(r.popup){const e=window.open(d,"esriJSAPIOAuth",r.popupWindowFeatures);if(e)e.focus(),this._oAuthDfd.oAuthWin_=e,this._oAuthIntervalId=setInterval(()=>{if(e.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const e=this._oAuthDfd;if(e){const t=new o.A("identity-manager:user-aborted","ABORTED");e.reject(t)}}},500),this._oAuthOnPopupHandle=(0,l.on)(window,["arcgis:auth:hash","arcgis:auth:location:search"],e=>{"arcgis:auth:hash"===e.type?this.setOAuthResponseHash(e.detail):this._setOAuthResponseQueryString(e.detail)});else{const e=new o.A("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:a,authorizeUrl:h,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=d}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return(0,u.s2)(e.popupCallbackUrl);if(t){const e=(0,u.An)(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach(t=>{delete e.query[t]}),(0,u.a6)(e.path,e.query)}return r}}ot.prototype.declaredClass="esri.identity.IdentityManagerBase";const at=new ot;(0,s.Aq)(at)},79783(e,t,r){r.d(t,{ud:()=>w,JK:()=>S,oQ:()=>I,V2:()=>k});var s=r(2741),i=r(97770),n=r(73444),o=r(10838),a=r(18047),l=r(53966),h=r(93637),d=r(799);const c=()=>l.A.getLogger("esri.intl.substitute");function u(e,t){switch(t.type){case"date":return(0,i.Yq)(e,t.intlOptions);case"number":return(0,a.ZV)(e,t.intlOptions);default:return c().warn("missing format descriptor for key {key}"),f(e)}}function p(e,t){switch(t.toLowerCase()){case"dateformat":return(0,i.Yq)(e);case"numberformat":return(0,a.ZV)(e);default:return c().warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,i.Yq)(e):/^numberformat/i.test(t)?(0,a.ZV)(e):f(e)}}function f(e){switch(typeof e){case"string":return e;case"number":return(0,a.ZV)(e);case"boolean":return""+e;default:return e instanceof Date?(0,i.Yq)(e):""}}var g=r(11254),m=r(49186);async function v(e){if(null!=y.fetchBundleAsset)return y.fetchBundleAsset(e);const t=await(0,g.A)(e,{responseType:"text"});return JSON.parse(t.data)}class _{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let s;s="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=s,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)\\/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,s){const i=t.exec(r);if(!i)throw new m.A("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const n=i[1]?`${i[1]}/`:"",a=i[2],l=(0,o.xO)(s),h=`${n}${a}.json`,d=l?`${n}${a}_${l}.json`:h;let c;try{c=await v(e(d))}catch(t){if(d===h)throw new m.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{c=await v(e(h))}catch(e){throw new m.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return c}(this.getAssetUrl,this.matcher,e,t)}}const y={},w=o.ud,S=n.JK,I=n.oQ,A=o.ao,k=function(e,t,r={}){const{format:s={}}=r;return(0,d.HC)(e,e=>function(e,t,r){let s,i;const n=e.indexOf(":");if(-1===n?s=e.trim():(s=e.slice(0,n).trim(),i=e.slice(n+1).trim()),!s)return"";const o=(0,h.wc)(s,t);if(null==o)return"";const a=(i?r?.[i]:null)??r?.[s];return a?u(o,a):i?p(o,i):f(o)}(e,t,s))};var U;A((U={pattern:"esri/",location:s.s},new _(U)))},18047(e,t,r){r.d(t,{Up:()=>l,ZV:()=>h,yx:()=>a});var s=r(73444);const i={ar:"ar-u-nu-latn",bs:"sr-Latn-CS",nn:"no-NN"};let n=new WeakMap,o={};function a(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function l(e){const{minimumFractionDigits:t,maximumFractionDigits:r,useGrouping:s}=e;return{minimumFractionDigits:t,maximumFractionDigits:r,useGrouping:"auto"===s?"auto":"always"===s}}function h(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||o;if(!n.has(t)){const r=(0,s.lR)(),o=r&&i[r]||(0,s.QC)();n.set(t,new Intl.NumberFormat(o,e))}return n.get(t)}(t).format(e)}(0,s.Ml)(()=>{n=new WeakMap,o={}}),new Map}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[926,1695],{99719(e,t,r){r.d(t,{x:()=>n});class n{}},92400(e,t,r){r.d(t,{CU:()=>l,UQ:()=>o,fF:()=>i,o6:()=>s});var n=r(17676);class i{constructor(){}}function s(e,t,r){if(e instanceof i&&!(e instanceof l)){const n=new l;return n.fn=e,n.parameterEvaluator=r,n.context=t,n}return e}class o extends i{constructor(e){super(),this.fn=e}createFunction(e){return(...t)=>this.fn(e,{preparsed:!0,arguments:t})}call(e,t){return this.fn(e,t)}marshalledCall(e,t,r,o){return o(e,t,(t,a,u)=>{u=u.map(t=>t instanceof i&&!(t instanceof l)?s(t,e,o):t);const c=this.call(r,{args:u});return(0,n.$X)(c)?c.then(e=>s(e,r,o)):c})}}class l extends i{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,t){return this.fn.marshalledCall(e,t,this.context,this.parameterEvaluator)}marshalledCall(e,t,r){return this.fn.marshalledCall(e,t,this.context,this.parameterEvaluator)}}},93818(e,t,r){r.d(t,{A:()=>n});class n{constructor(e=[]){this._elements=e}length(){return this._elements.length}get(e){return this._elements[e]}toArray(){return this.slice()}slice(e=0,t=this.length()){const r=[];for(let n=e;n<t;n++)r.push(this.get(n));return r}}},7335(e,t,r){r.d(t,{A:()=>s});var n=r(93818),i=r(7320);class s extends n.A{constructor(e,t,r,n,i){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=r,this._hasM=n,this._spRef=t,this._cacheId=i}get(e){if(void 0===this._lazyPath[e]){const t=this._elements[e];if(void 0===t)return;this._lazyPath[e]=new i.A(t,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||null!==e&&e instanceof s!=0&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}},7320(e,t,r){r.d(t,{A:()=>s});var n=r(93818),i=r(86738);class s extends n.A{constructor(e,t,r,n,i,s){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=t,this._hasZ=r,this._hasM=n,this._cacheId=i,this._partId=s}get(e){if(void 0===this._lazyPt[e]){const t=this._elements[e];if(void 0===t)return;const r=new i.A(t[0],t[1],this._spRef);this._hasZ&&(r.z=t[2]),this._hasM&&(r.m=this._hasZ?t[3]:t[2]),r.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=r}return this._lazyPt[e]}equalityTest(e){return e===this||null!==e&&e instanceof s!=0&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}},6800(e,t,r){r.d(t,{G:()=>a,y:()=>o});var n=r(99719),i=r(78878),s=r(54218);function o(e){l=e}let l;function a(e){return null===e?null:(0,i.e)(e)?e.clone():(0,i.d)(e)?e:(0,i.h)(e)?e.clone():(0,i.j)(e)?e.toArray().map(e=>a(e)):(0,s.cy)(e)?e.map(e=>a(e)):(0,i.k)(e)?l.createFromArcadeFeature(e):(0,i.l)(e)||(0,i.m)(e)?e:(0,i.n)(e)||"esri.arcade.Attachment"===e?.declaredClass?e.deepClone():("esri.arcade.Portal"===e?.declaredClass||(0,i.o)(e)||e instanceof n.x||(0,i.i)(e),e)}},33325(e,t,r){r.d(t,{$P:()=>c,At:()=>v,JB:()=>S,Lk:()=>p,Qi:()=>C,eB:()=>b,eg:()=>y,f0:()=>h,gO:()=>f,ik:()=>m,ke:()=>a,nE:()=>u,rX:()=>d,yT:()=>g});var n=r(66131),i=r(44729),s=r(15032),o=r(20437),l=r(92647);function a(e){return o.A.fromJSON(e.toJSON())}function u(e){return e.toJSON?e.toJSON():e}function c(e){return e instanceof Date}function p(e){return e instanceof l.c9}function d(e){return e instanceof n.lY}function h(e){return e instanceof i.n}function y(e){return e instanceof s.k}const f=1e3,m={point:"point",polygon:"polygon",polyline:"polyline",multipoint:"multipoint",extent:"extent",esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint",esriGeometryEnvelope:"extent",envelope:"extent"},g={point:"esriGeometryPoint",polygon:"esriGeometryPolygon",polyline:"esriGeometryPolyline",multipoint:"esriGeometryMultipoint",extent:"esriGeometryEnvelope",esriGeometryPoint:"esriGeometryPoint",esriGeometryPolygon:"esriGeometryPolygon",esriGeometryPolyline:"esriGeometryPolyline",esriGeometryMultipoint:"esriGeometryMultipoint",esriGeometryEnvelope:"esriGeometryEnvelope",envelope:"esriGeometryEnvelope"},v={"small-integer":"esriFieldTypeSmallInteger",integer:"esriFieldTypeInteger",long:"esriFieldTypeLong",single:"esriFieldTypeSingle",double:"esriFieldTypeDouble",string:"esriFieldTypeString",date:"esriFieldTypeDate","date-only":"esriFieldTypeDateOnly","time-only":"esriFieldTypeTimeOnly","timestamp-offset":"esriFieldTypeTimestampOffset",oid:"esriFieldTypeOID",geometry:"esriFieldTypeGeometry",blob:"esriFieldTypeBlob",raster:"esriFieldTypeRaster",guid:"esriFieldTypeGUID","global-id":"esriFieldTypeGlobalID",xml:"esriFieldTypeXML","big-integer":"esriFieldTypeBigInteger",esriFieldTypeSmallInteger:"esriFieldTypeSmallInteger",esriFieldTypeInteger:"esriFieldTypeInteger",esriFieldTypeLong:"esriFieldTypeLong",esriFieldTypeSingle:"esriFieldTypeSingle",esriFieldTypeDouble:"esriFieldTypeDouble",esriFieldTypeString:"esriFieldTypeString",esriFieldTypeDate:"esriFieldTypeDate",esriFieldTypeDateOnly:"esriFieldTypeDateOnly",esriFieldTypeTimeOnly:"esriFieldTypeTimeOnly",esriFieldTypeTimestampOffset:"esriFieldTypeTimestampOffset",esriFieldTypeOID:"esriFieldTypeOID",esriFieldTypeGeometry:"esriFieldTypeGeometry",esriFieldTypeBlob:"esriFieldTypeBlob",esriFieldTypeRaster:"esriFieldTypeRaster",esriFieldTypeGUID:"esriFieldTypeGUID",esriFieldTypeGlobalID:"esriFieldTypeGlobalID",esriFieldTypeXML:"esriFieldTypeXML",esriFieldTypeBigInteger:"esriFieldTypeBigInteger"};function C(e){return void 0===e?"":e=(e=(e=e.replace(/\/featureserver\/[0-9]*/i,"/FeatureServer")).replace(/\/mapserver\/[0-9]*/i,"/MapServer")).split("?")[0]}function S(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const r="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&(i=t.cmp,function(e){return function(t,r){const n={key:t,value:e[t]},s={key:r,value:e[r]};return i(n,s)}});var i;const s=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let i,o;if(Array.isArray(t)){for(o="[",i=0;i<t.length;i++)i&&(o+=","),o+=e(t[i])||"null";return o+"]"}if(null===t)return"null";if(s.includes(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const l=s.push(t)-1,a=Object.keys(t).sort(n?.(t));for(o="",i=0;i<a.length;i++){const r=a[i],n=e(t[r]);n&&(o&&(o+=","),o+=JSON.stringify(r)+":"+n)}return s.splice(l,1),"{"+o+"}"}(e)}function b(e){switch(e.type){case"catalog-footprint":case"catalog":case"csv":case"feature":case"geojson":case"knowledge-graph-sublayer":case"oriented-imagery":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}},78878(e,t,r){r.d(t,{$:()=>G,A:()=>x,B:()=>te,C:()=>Te,D:()=>ve,E:()=>we,F:()=>Ne,G:()=>Pe,H:()=>ge,I:()=>_,J:()=>R,K:()=>je,L:()=>re,M:()=>J,N:()=>_e,O:()=>E,P:()=>me,Q:()=>oe,R:()=>P,S:()=>ne,T:()=>Ee,U:()=>Be,V:()=>ke,W:()=>Qe,X:()=>Ue,Y:()=>Ce,Z:()=>j,_:()=>Q,a:()=>Ge,a0:()=>Le,a1:()=>de,a2:()=>Re,a3:()=>De,a4:()=>Me,a5:()=>Se,a6:()=>be,b:()=>Je,c:()=>ce,d:()=>q,e:()=>Y,f:()=>W,g:()=>X,h:()=>k,i:()=>I,j:()=>H,k:()=>B,l:()=>V,m:()=>L,n:()=>$,o:()=>z,p:()=>Ke,q:()=>U,r:()=>fe,s:()=>pe,t:()=>he,u:()=>ae,v:()=>F,w:()=>ue,x:()=>xe,y:()=>K,z:()=>D});var n=r(92602),i=r(70333),s=r(66131),o=r(99719),l=r(85935),a=r(92400),u=r(93818),c=r(7335),p=r(7320),d=r(33325),h=r(14607),y=r(44729),f=r(15032),m=r(5443),g=r(91075),v=r(48526),C=r(86738),S=r(39829),b=r(82799),M=r(16930),Z=r(95108),A=r(65864),T=r(73444),O=r(54218),w=r(92647),N=r(94128);class P{constructor(e){this.value=e}}class _{constructor(e){this.value=e}}const F={type:"VOID"},D=Symbol("BREAK"),x=Symbol("CONTINUE");function G(e,t,r){return""===t||null==t||t===r||t===r?e:e=e.split(t).join(r)}function I(e){return e instanceof a.fF}function J(e){return e instanceof o.x}function q(e){return!!((0,O.Kg)(e)||(0,O.Et)(e)||Y(e)||W(e)||X(e)||(0,O.Lm)(e)||null===e||e===F)}function R(e,t){return void 0===e?t:e}function E(e){return null==e?"":(0,O.cy)(e)||H(e)?"Array":Y(e)?"Date":X(e)?"Time":W(e)?"DateOnly":(0,O.Kg)(e)?"String":(0,O.Lm)(e)?"Boolean":(0,O.Et)(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":z(e)?"KnowledgeGraph":e instanceof o.x?"Module":B(e)?"Feature":e instanceof C.A?"Point":e instanceof S.A?"Polygon":e instanceof b.A?"Polyline":e instanceof v.A?"Multipoint":e instanceof m.A?"Extent":I(e)?"Function":L(e)?"FeatureSet":V(e)?"FeatureSetCollection":j(e)?"Voxel":Q(e)?"Pixel":e===F?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognized Type"}function U(e){return e===F}function k(e){return e instanceof g.A}function B(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function j(e){return"esri.arcade.Voxel"===e?.arcadeDeclaredClass}function Q(e){return"esri.arcade.Pixel"===e?.arcadeDeclaredClass}function L(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function $(e){return"esri.arcade.Dictionary"===e?.declaredClass}function K(e){return $(e)||B(e)||j(e)||Q(e)}function V(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function z(e){return"esri.rest.knowledgeGraph.KnowledgeGraph"===e?.declaredClass}function H(e){return e instanceof u.A}function Y(e){return e instanceof s.lY}function W(e){return e instanceof y.n}function X(e){return e instanceof f.k}function ee(e){return null!=e&&"object"==typeof e}function te(e,t,r,n,i){if(e.length<t||e.length>r)throw new l.D$(n,"WrongNumberOfParameters",i)}function re(e){return null==e||U(e)||""===e}function ne(e){return e<0?-Math.round(-e):Math.round(e)}function ie(e,t){return isNaN(e)||null==t||""===t?e.toString():(t=G(t,"‰",""),t=G(t,"¤",""),(0,h.GP)(e,{pattern:t}))}function se(e,t){return null==t||""===t?e.toISOString(!0):e.toFormat(oe(t),{locale:(0,T.JK)(),numberingSystem:"latn"})}function oe(e,t=!1){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let r="";const n=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const i of e.match(n)||[])switch(i){case"D":r+="d";break;case"DD":r+="dd";break;case"DDD":r+="o";break;case"d":r+="c";break;case"ddd":r+="ccc";break;case"dddd":r+="cccc";break;case"M":r+="L";break;case"MM":r+="LL";break;case"MMM":r+="LLL";break;case"MMMM":r+="LLLL";break;case"YY":r+="yy";break;case"Y":case"YYYY":r+="yyyy";break;case"Q":r+="q";break;case"Z":r+="Z";break;case"ZZ":r+="ZZ";break;case"ZZZ":r+="ZZZ";break;case"ZZZZ":r+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":r+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":r+="'S'";break;case"SS":r+="'SS'";break;case"SSS":r+="u";break;case"A":case"a":r+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":r+=i;break;default:i.length>=2&&i.startsWith("[")&&i.endsWith("]")?r+=`'${i.slice(1,-1)}'`:r+=`'${i}'`}return r}function le(e,t,r){switch(r){case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}return!1}function ae(e,t,r){if(null===e){if(null===t||t===F)return le(null,null,r);if((0,O.Et)(t))return le(0,t,r);if((0,O.Kg)(t))return le(0,fe(t),r);if((0,O.Lm)(t))return le(0,fe(t),r);if(Y(t))return le(0,t.toNumber(),r);if(X(t))return le(e,t.toNumber(),r);if(W(t))return le(e,t.toNumber(),r)}if(e===F){if(null===t||t===F)return le(null,null,r);if((0,O.Et)(t))return le(0,t,r);if((0,O.Kg)(t))return le(0,fe(t),r);if((0,O.Lm)(t))return le(0,fe(t),r);if(Y(t))return le(0,t.toNumber(),r);if(X(t))return le(e,t.toNumber(),r);if(W(t))return le(e,t.toNumber(),r)}else if((0,O.Et)(e)){if((0,O.Et)(t))return le(e,t,r);if((0,O.Lm)(t))return le(e,fe(t),r);if(null===t||t===F)return le(e,0,r);if((0,O.Kg)(t))return le(e,fe(t),r);if(Y(t))return le(e,t.toNumber(),r);if(X(t))return le(e,t.toNumber(),r);if(W(t))return le(e,t.toNumber(),r)}else if((0,O.Kg)(e)){if((0,O.Kg)(t))return le(pe(e),pe(t),r);if(Y(t))return le(fe(e),t.toNumber(),r);if(X(t))return le(fe(e),t.toNumber(),r);if(W(t))return le(fe(e),t.toNumber(),r);if((0,O.Et)(t))return le(fe(e),t,r);if(null===t||t===F)return le(fe(e),0,r);if((0,O.Lm)(t))return le(fe(e),fe(t),r)}else if(Y(e)){if(Y(t))return e.timeZone!==t.timeZone&&(e.isUnknownTimeZone?e=s.lY.arcadeDateAndZoneToArcadeDate(e,t.timeZone):t.isUnknownTimeZone&&(t=s.lY.arcadeDateAndZoneToArcadeDate(t,e.timeZone))),le(e.toNumber(),t.toNumber(),r);if(null===t||t===F)return le(e.toNumber(),0,r);if((0,O.Et)(t))return le(e.toNumber(),t,r);if((0,O.Lm)(t))return le(e.toNumber(),fe(t),r);if((0,O.Kg)(t))return le(e.toNumber(),fe(t),r);if(X(t))throw new l.D$(null,"CannotCompareDateAndTime",null);if(W(t))return le(e.toNumber(),t.toNumber(),r)}else if((0,O.Lm)(e)){if((0,O.Lm)(t))return le(e,t,r);if((0,O.Et)(t))return le(fe(e),fe(t),r);if(Y(t))return le(fe(e),t.toNumber(),r);if(X(t))return le(fe(e),t.toNumber(),r);if(W(t))return le(fe(e),t.toNumber(),r);if(null===t||t===F)return le(fe(e),0,r);if((0,O.Kg)(t))return le(fe(e),fe(t),r)}else if(W(e)){if(Y(t))return le(e.toNumber(),t.toNumber(),r);if(null===t||t===F)return le(e.toNumber(),0,r);if((0,O.Et)(t))return le(e.toNumber(),t,r);if((0,O.Lm)(t))return le(e.toNumber(),fe(t),r);if((0,O.Kg)(t))return le(e.toNumber(),fe(t),r);if(X(t))throw new l.D$(null,"CannotCompareDateAndTime",null);if(W(t))return le(e.toNumber(),t.toNumber(),r)}else if(X(e)){if(Y(t))throw new l.D$(null,"CannotCompareDateAndTime",null);if(null===t||t===F)return le(e.toNumber(),0,r);if((0,O.Et)(t))return le(e.toNumber(),t,r);if((0,O.Lm)(t))return le(e.toNumber(),fe(t),r);if((0,O.Kg)(t))return le(e.toNumber(),fe(t),r);if(X(t))return le(e.toNumber(),t.toNumber(),r);if(W(t))throw new l.D$(null,"CannotCompareDateAndTime",null)}return!!ue(e,t)&&("<="===r||">="===r)}function ue(e,t){if(e===t)return!0;if(null===e&&t===F||null===t&&e===F)return!0;if(Y(e)&&Y(t))return e.equals(t);if(X(e)&&X(t))return e.equals(t);if(W(e)&&W(t))return e.equals(t);if(e instanceof c.A)return e.equalityTest(t);if(e instanceof p.A)return e.equalityTest(t);if(e instanceof C.A&&t instanceof C.A){const r=e.cache._arcadeCacheId,n=t.cache._arcadeCacheId;if(null!=r)return r===n}if(ee(e)&&ee(t)){if(e._arcadeCacheId===t._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===t._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function ce(e,{useNumbersForDates:t}){let r="";for(const n in e){""!==r&&(r+=",");const i=e[n];null==i?r+=JSON.stringify(n)+":null":(0,O.Lm)(i)||(0,O.Et)(i)||(0,O.Kg)(i)?r+=JSON.stringify(n)+":"+JSON.stringify(i):k(i)?r+=JSON.stringify(n)+":"+he(i):X(i)||W(i)?r+=`${JSON.stringify(n)}:${JSON.stringify(i.toString())}`:H(i)||Array.isArray(i)?r+=JSON.stringify(n)+":"+he(i,null,t):Y(i)?r+=t?JSON.stringify(n)+":"+JSON.stringify(i.getTime()):JSON.stringify(n)+":"+i.stringify():null!==i&&"object"==typeof i&&"castToText"in i&&(r+=JSON.stringify(n)+":"+i.castToText(t))}return"{"+r+"}"}function pe(e,t){if((0,O.Kg)(e))return e;if(null===e)return"";if((0,O.Et)(e))return ie(e,t);if((0,O.Lm)(e))return e.toString();if(Y(e))return se(e,t);if(X(e))return e.toFormat(t);if(W(e))return e.toFormat(t);if(e instanceof g.A)return JSON.stringify(e.toJSON());if((0,O.cy)(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=ye(e[r]);return"["+t.join(",")+"]"}if(e instanceof u.A){const t=[];for(let r=0;r<e.length();r++)t[r]=ye(e.get(r));return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText():I(e)?"object, Function":e===F?"":J(e)?"object, Module":""}function de(e){const t=[];if(e instanceof u.A){for(let r=0;r<e.length();r++)t[r]=fe(e.get(r));return t}if(!(0,O.cy)(e))return null;for(let r=0;r<e.length;r++)t[r]=fe(e[r]);return t}function he(e,t,r=!1){if((0,O.Kg)(e))return e;if(null===e)return"";if((0,O.Et)(e))return ie(e,t);if((0,O.Lm)(e))return e.toString();if(Y(e))return se(e,t);if(X(e))return e.toFormat(t);if(W(e))return e.toFormat(t);if(e instanceof g.A)return e instanceof m.A?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+Ae(e.spatialReference)+"}":Ae(e.toJSON(),(e,t)=>e.key===t.key?0:"spatialReference"===e.key?1:"spatialReference"===t.key||e.key<t.key?-1:e.key>t.key?1:0);if((0,O.cy)(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=ye(e[n],r);return"["+t.join(",")+"]"}if(e instanceof u.A){const t=[];for(let n=0;n<e.length();n++)t[n]=ye(e.get(n),r);return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText(r):I(e)?"object, Function":e===F?"":J(e)?"object, Module":""}function ye(e,t=!1){if(null===e)return"null";if((0,O.Lm)(e)||(0,O.Kg)(e))return JSON.stringify(e);if((0,O.Et)(e))return e.toString();if(e instanceof g.A)return he(e,null,t);if(e instanceof u.A)return he(e,null,t);if(Array.isArray(e))return he(e,null,t);if(Y(e))return t?JSON.stringify(e.getTime()):JSON.stringify(se(e,""));if(X(e))return JSON.stringify(e.toString());if(W(e))return JSON.stringify(e.toString());if(null!==e&&"object"==typeof e){if("castToText"in e)return e.castToText(t)}else if(e===F)return"null";return"null"}function fe(e,t){return(0,O.Et)(e)?e:null===e||""===e?0:Y(e)||W(e)||X(e)?NaN:(0,O.Lm)(e)?e?1:0:(0,O.cy)(e)||""===e||void 0===e?NaN:void 0!==t&&(0,O.Kg)(e)?(t=G(t,"‰",""),t=G(t,"¤",""),(0,h.qg)(e,{pattern:t})):e===F?0:Number(e)}function me(e,t){if(Y(e))return e;if((0,O.Kg)(e)){const r=function(e,t){const r=/ (\d\d)/,n=(0,s.mT)(t);let i=w.c9.fromISO(e,{zone:n});return i.isValid||r.test(e)&&(e=e.replace(r,"T$1"),i=w.c9.fromISO(e,{zone:t}),i.isValid)?i:null}(e,t);if(r)return s.lY.dateTimeToArcadeDate(r)}return null}function ge(e){return(0,O.Lm)(e)?e:(0,O.Kg)(e)?"true"===(e=e.toLowerCase()):!!(0,O.Et)(e)&&0!==e&&!isNaN(e)}function ve(e,t){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=t),e)}function Ce(e){if(null===e)return null;if(e instanceof C.A)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof S.A){if(0===(e.curveRings??e.rings).length)return null;for(const t of e.curveRings??e.rings)if(t.length>0)return e;return null}if(e instanceof b.A){if(0===(e.curvePaths??e.paths).length)return null;for(const t of e.curvePaths??e.paths)if(t.length>0)return e;return null}return e instanceof v.A?0===e.points.length?null:e:e instanceof m.A?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function Se(e,t){if(!e)return t;if(!e.domain)return t;let r=null,n=null;if(Y(t))r=t.toNumber();else if(W(t))r=t.toString();else if(X(t))r=t.toStorageString();else if("string"===e.field.type||"esriFieldTypeString"===e.field.type)r=pe(t);else{if(null==t)return null;if(""===t)return t;r=fe(t)}for(let t=0;t<e.domain.codedValues.length;t++){const i=e.domain.codedValues[t];i.code===r&&(n=i)}return null===n?pe(t):n.name}function be(e,t){if(!e)return t;if(!e.domain)return t;let r=null;const n=pe(t);for(let t=0;t<e.domain.codedValues.length;t++){const i=e.domain.codedValues[t];i.name===n&&(r=i)}return null===r?t:r.code}function Me(e,t,r=null,n=null){if(!t)return null;if(!t.fields)return null;let i,s,o=null;for(let r=0;r<t.fields.length;r++){const n=t.fields[r];n.name.toLowerCase()===e.toString().toLowerCase()&&(o=n)}if(null===o)throw new l.D$(null,"FieldNotFound",null,{key:e});let a=t.typeIdField,u="id",c=t.types;if(t.subtypeField&&(a=t.subtypeField,u="code",c=t.subtypes??[]),null===n&&r&&a)n=r.hasField(a)?r.field(a):null;else if(a&&null!==n){let e=!1;for(const t of c||[])if(n===t[u]){e=!0;break}if(!e)for(const t of c||[])if(n===t.name){n=t[u],e=!0;break}e||(n=null,r&&a&&(n=r.hasField(a)?r.field(a):null))}return null!=n&&c.some(e=>e[u]===n&&(i=e.domains?.[o.name],i&&"inherited"===i.type&&(i=Ze(o.name,t),s=!0),!0)),s||i||(i=Ze(e,t)),{field:o,domain:i}}function Ze(e,t){let r;return t.fields.some(t=>(t.name.toLowerCase()===e.toLowerCase()&&(r=t.domain),!!r)),r}function Ae(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const r="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&(i=t.cmp,function(e){return function(t,r){const n={key:t,value:e[t]},s={key:r,value:e[r]};return i(n,s)}});var i;const s=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let i,o;if(Array.isArray(t)){for(o="[",i=0;i<t.length;i++)i&&(o+=","),o+=e(t[i])||"null";return o+"]"}if(null===t)return"null";if(s.includes(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const l=s.push(t)-1,a=Object.keys(t).sort(n?.(t));for(o="",i=0;i<a.length;i++){const r=a[i],n=e(t[r]);n&&(o&&(o+=","),o+=JSON.stringify(r)+":"+n)}return s.splice(l,1),"{"+o+"}"}(e)}function Te(e){if(null===e)return null;const t=[];for(const r of e)B(r)?t.push(r.geometry()):t.push(r);return t}function Oe(e,t){if(!(t instanceof C.A))throw new l.D$(null,"InvalidParameter",null);e.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}function we(e,t){if((0,O.cy)(e)||H(e)){let r=!1,n=!1,i=[],s=t;if((0,O.cy)(e)){for(const t of e)Oe(i,t);i.length>0&&(s=e[0].spatialReference,r=e[0].hasZ,n=e[0].hasM)}else if(e instanceof p.A)i=e._elements,i.length>0&&(r=e._hasZ,n=e._hasM,s=e.get(0).spatialReference);else{if(!H(e))throw new l.D$(null,"InvalidParameter",null);for(const t of e.toArray())Oe(i,t);i.length>0&&(s=e.get(0).spatialReference,r=!0===e.get(0).hasZ,n=!0===e.get(0).hasM)}return 0===i.length?null:((0,Z.$3)(i)||(i=i.slice().reverse()),new S.A({rings:[i],spatialReference:s,hasZ:r,hasM:n}))}return e}function Ne(e,t){if((0,O.cy)(e)||H(e)){let r=!1,n=!1,i=[],s=t;if((0,O.cy)(e)){for(const t of e)Oe(i,t);i.length>0&&(s=e[0].spatialReference,r=!0===e[0].hasZ,n=!0===e[0].hasM)}else if(e instanceof p.A)i=e._elements,i.length>0&&(r=e._hasZ,n=e._hasM,s=e.get(0).spatialReference);else if(H(e)){for(const t of e.toArray())Oe(i,t);i.length>0&&(s=e.get(0).spatialReference,r=!0===e.get(0).hasZ,n=!0===e.get(0).hasM)}return 0===i.length?null:new b.A({paths:[i],spatialReference:s,hasZ:r,hasM:n})}return e}function Pe(e,t){if((0,O.cy)(e)||H(e)){let r=!1,n=!1,i=[],s=t;if((0,O.cy)(e)){for(const t of e)Oe(i,t);i.length>0&&(s=e[0].spatialReference,r=!0===e[0].hasZ,n=!0===e[0].hasM)}else if(e instanceof p.A)i=e._elements,i.length>0&&(r=e._hasZ,n=e._hasM,s=e.get(0).spatialReference);else if(H(e)){for(const t of e.toArray())Oe(i,t);i.length>0&&(s=e.get(0).spatialReference,r=!0===e.get(0).hasZ,n=!0===e.get(0).hasM)}return 0===i.length?null:new v.A({points:i,spatialReference:s,hasZ:r,hasM:n})}return e}function _e(e,t=!0){if(null==e)return[];if((0,O.cy)(e)){const r=[];for(const n of e){const e=pe(n);(t||""!==e)&&r.push(e)}return r}if(H(e)){const r=[];for(let n=0;n<e.length();n++){const i=pe(e.get(n));(t||""!==i)&&r.push(i)}return r}if(q(e)){const r=pe(e);if(t||""!==r)return[r]}return[]}let Fe=0;function De(){return Fe++,Fe%100==0?(Fe=0,new Promise(e=>{setTimeout(()=>{e()},0)})):Promise.resolve()}function xe(e,t,r){switch(r){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<<t;case">>":return e>>t;case">>>":return e>>>t}}function Ge(e,t=null){return null==e?null:(0,O.Lm)(e)||(0,O.Et)(e)||(0,O.Kg)(e)?e:e instanceof g.A?!0===t?.keepGeometryType?e:e.toJSON():e instanceof u.A?e.toArray().map(e=>Ge(e,t)):Array.isArray(e)?e.map(e=>Ge(e,t)):(0,O.$P)(e)?e:Y(e)?e.toJSDate():X(e)?e.toString():W(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Ie(e,t,r,n,i){const s=await Je(e,t,r);i[n]=s}async function Je(e,t=null,r=null){if(e instanceof u.A&&(e=e.toArray()),null==e)return null;if(q(e)||e instanceof g.A||(0,O.$P)(e)||Y(e))return Ge(e,r);if(Array.isArray(e)){const n=[],i=[];for(const s of e)null===s||q(s)||s instanceof g.A||(0,O.$P)(s)||Y(s)?i.push(Ge(s,r)):(i.push(null),n.push(Ie(s,t,r,i.length-1,i)));return n.length>0&&await Promise.all(n),i}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,r):null}function qe(e){return Re(e)?e.parent:e}function Re(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function Ee(e,t,r){const n=qe(e.fullSchema());return null===n?null:n.fields?Me(t,n,e,r):null}function Ue(e){const t=qe(e.fullSchema());return null===t?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map(e=>({name:e.name,code:e.code})):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map(e=>({name:e.name,code:e.id})):[]}:null:null}function ke(e,t,r,n){const i=qe(e.fullSchema());if(null===i)return null;if(!i.fields)return null;const s=Me(t,i,e,n);if(void 0===r)try{r=e.field(t)}catch(e){return null}return Se(s,r)}function Be(e,t,r,n){const i=qe(e.fullSchema());if(null===i)return null;if(!i.fields)return null;if(void 0===r){try{r=e.field(t)}catch(e){return null}return r}return be(Me(t,i,e,n),r)}function je(e){return e?.timeZone??"system"}function Qe(e){const t=qe(e.fullSchema());if(null===t)return null;if(!t.fields)return null;const r=[];for(const e of t.fields)r.push((0,d.nE)(e));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:void 0===d.yT[t.geometryType]?"":d.yT[t.geometryType],fields:r}}function Le(e,t){const r=s.lY.systemTimeZoneCanonicalName;return"system"===e&&(e=r),{version:$e,engineVersion:i.rE,timeZone:e,userTimeZone:r,spatialReference:t instanceof M.A?t.toJSON():t,application:n.A.applicationName??"",engine:"web",locale:(0,T.JK)()}}const $e="1.35",Ke=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:_,ReturnResult:P,absRound:ne,arcadeVersion:$e,autoCastArrayOfPointsToMultiPoint:Pe,autoCastArrayOfPointsToPolygon:we,autoCastArrayOfPointsToPolyline:Ne,autoCastFeatureToGeometry:Te,binaryOperator:xe,breakResult:D,castAsJson:Ge,castAsJsonAsync:Je,castRecordToText:ce,continueResult:x,defaultExecutingContext:Le,defaultTimeZone:je,defaultUndefined:R,equalityTest:ue,featureDomainCodeLookup:Be,featureDomainValueLookup:ke,featureFullDomain:Ee,featureSchema:Qe,featureSubtypes:Ue,fixNullGeometry:Ce,fixSpatialReference:ve,formatDate:se,formatNumber:ie,getDomain:Me,getDomainCode:be,getDomainValue:Se,getType:E,greaterThanLessThan:ae,isArray:O.cy,isBoolean:O.Lm,isDate:Y,isDateOnly:W,isDictionary:$,isDictionaryLike:K,isEmpty:re,isFeature:B,isFeatureSet:L,isFeatureSetCollection:V,isFunctionParameter:I,isGeometry:k,isGraphic:N.D,isImmutableArray:H,isInteger:O.Fq,isJsDate:O.$P,isKnowledgeGraph:z,isModule:J,isNumber:O.Et,isObject:ee,isPixel:Q,isSimpleType:q,isString:O.Kg,isSubtypeGrouplayer:function(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass},isSubtypeSublayer:Re,isTime:X,isVoid:U,isVoxel:j,multiReplace:G,parseGeometryFromJson:function(e,t){const r=JSON.parse(e);return r&&!r.spatialReference&&(r.spatialReference=t),(0,A.rS)(r)},pcCheck:te,stableStringify:Ae,standardiseDateFormat:oe,tick:De,toBoolean:ge,toDate:me,toNumber:fe,toNumberArray:de,toString:pe,toStringArray:_e,toStringExplicit:he,voidOperation:F},Symbol.toStringTag,{value:"Module"}))},92474(e,t,r){r.d(t,{WV:()=>d,Zm:()=>y,x_:()=>h});var n=r(5482),i=r(49186),s=r(97768),o=r(61893),l=r(17676),a=r(67076),u=r(10107),c=r(64108);const p="loaded",d=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(e=>{const t=this.load.bind(this);this.load=r=>{const n=new Promise((e,t)=>{const n=(0,l.NY)(r,t);this.destroyed&&t(new i.A("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this.when(e,t).finally(()=>{n&&n.remove()})});if("not-loaded"===this.loadStatus){this._set("loadStatus","loading");const e=this._loadController=new AbortController;t({signal:e.signal})}return e(),n}})),this.when(()=>{this._set("loadStatus",p),this._loadController=null},e=>{this.destroyed||(this._set("loadStatus","failed"),this._set("loadError",e),this._loadController=null)})}destroy(){this._loadController&&(this._loadController=(0,s.DC)(this._loadController),this._promiseProps.abort()),this._set("loadError",null),this._set("loadWarnings",[])}get loaded(){return this.loadStatus===p}get loadWarnings(){return this._get("loadWarnings")}load(e){return null}cancelLoad(){return this.isFulfilled()||(this._set("loadError",new i.A("load:cancelled","Cancelled")),this._loadController?.abort(),this._promiseProps.abort()),this}};return(0,n.Cg)([(0,u.MZ)({readOnly:!0})],r.prototype,"loaded",null),(0,n.Cg)([(0,u.MZ)({readOnly:!0})],r.prototype,"loadError",void 0),(0,n.Cg)([(0,u.MZ)({clonable:!1})],r.prototype,"loadStatus",void 0),(0,n.Cg)([(0,u.MZ)({type:[a.A],readOnly:!0})],r.prototype,"loadWarnings",null),r=(0,n.Cg)([(0,c.$)("esri.core.Loadable")],r),r},h=d(o.Z);function y(e){return!(!e||!e.load)}},61893(e,t,r){r.d(t,{Z:()=>c,g:()=>u});var n=r(5482),i=r(69622),s=r(36563),o=r(17676),l=r(64108);class a{constructor(){this._resolver=Promise.withResolvers(),this._status=0,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=1,this._cleanUp()},()=>{this._status=2,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return 1===this._status}isRejected(){return 2===this._status}isFulfilled(){return 0!==this._status}abort(){this._resolver.reject((0,o.NK)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=Promise.withResolvers(),t=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(t);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()},e=>{this.isFulfilled()||this._allPromise!==r||(0,o.zf)(e)||this._resolver.reject(e)}),e.resolve()}}const u=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),this._promiseProps=new a,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return this._promiseProps.promise.then(()=>this).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}addResolvingTask(e){e&&!this._promiseProps.isFulfilled()&&(this.addHandles((0,s.rE)(e)),this._promiseProps.addResolvingPromise(e.promise))}};return r=(0,n.Cg)([(0,l.$)("esri.core.Promise")],r),r},c=u(i.A)},14607(e,t,r){r.d(t,{B:()=>u,GP:()=>l,qg:()=>c});var n=r(799),i=r(73444);const s={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],no:[","," "],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function o(e=(0,i.JK)()){let t=(e=e.toLowerCase())in s;if(!t){const r=e.split("-");r.length>1&&r[0]in s&&(e=r[0],t=!0),t||(e="en")}const[r,n,o="#,##0.###"]=s[e];return{decimal:r,group:n,pattern:o}}function l(e,t){const r=o((t={...t}).locale);t.customs=r;const n=t.pattern||r.pattern;return isNaN(e)||Math.abs(e)===1/0?null:function(e,t,r){const n=(r=r||{}).customs.group,i=r.customs.decimal,s=t.split(";"),o=s[0];if((t=s[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const l=a,u=o.match(l);if(!u)throw new Error("unable to find a number expression in pattern: "+t);return!1===r.fractional&&(r.places=0),t.replace(l,function(e,t,r){!0===(r=r||{}).places&&(r.places=0),r.places===1/0&&(r.places=6);const n=t.split("."),i="string"==typeof r.places&&r.places.indexOf(",");let s=r.places;i?s=r.places.slice(i+1):+s>=0||(s=(n[1]||[]).length),r.round<0||(e=Number(e.toFixed(Number(s))));const o=String(Math.abs(e)).split("."),l=o[1]||"";if(n[1]||r.places){i&&(r.places=r.places.slice(0,Math.max(0,i)));const e=void 0!==r.places?r.places:n[1]&&n[1].lastIndexOf("0")+1;+e>l.length&&(o[1]=l.padEnd(Number(e),"0")),+s<l.length&&(o[1]=l.slice(0,Math.max(0,Number(s))))}else o[1]&&o.pop();const a=n[0].replace(",","");let u=a.indexOf("0");-1!==u&&(u=a.length-u,u>o[0].length&&(o[0]=o[0].padStart(u,"0")),a.includes("#")||(o[0]=o[0].slice(-u)));let c,p,d=n[0].lastIndexOf(",");if(-1!==d){c=n[0].length-d-1;const e=n[0].slice(0,d);d=e.lastIndexOf(","),-1!==d&&(p=e.length-d-1)}const h=[];for(let e=o[0];e;){const t=e.length-c;h.push(t>0?e.slice(Math.max(0,t)):e),e=t>0?e.slice(0,t):"",p&&(c=p,p=void 0)}return o[0]=h.reverse().join(r.group||","),o.join(r.decimal||".")}(e,u[0],{decimal:i,group:n,places:r.places,round:r.round}))}(e,n,t)}const a=/[#0,]*[#0](?:\.0*#*)?/;function u(e){const t=o((e=e||{}).locale),r=e.pattern||t.pattern,i=t.group,s=t.decimal;let l=1;if(r.includes("%"))l/=100;else if(r.includes("‰"))l/=1e3;else if(r.includes("¤"))throw new Error("currency notation not supported");const u=r.split(";");1===u.length&&u.push("-"+u[0]);const c=d(u,t=>(t="(?:"+(0,n.Cj)(t,".")+")").replace(a,t=>{const r={signed:!1,separator:e.strict?i:[i,""],fractional:e.fractional,decimal:s,exponent:!1},n=t.split(".");let o=e.places;1===n.length&&1!==l&&(n[1]="###"),1===n.length||0===o?r.fractional=!1:(void 0===o&&(o=e.pattern?n[1].lastIndexOf("0")+1:1/0),o&&null==e.fractional&&(r.fractional=!0),!e.places&&+o<n[1].length&&(o+=","+n[1].length),r.places=o);const a=n[0].split(",");return a.length>1&&(r.groupSize=a.pop().length,a.length>1&&(r.groupSize2=a.pop().length)),"("+function(e){"places"in(e=e||{})||(e.places=1/0),"string"!=typeof e.decimal&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=p(e),r=d(e.fractional,t=>{let r="";return t&&0!==e.places&&(r="\\"+e.decimal,e.places===1/0?r="(?:"+r+"\\d+)?":r+="\\d{"+e.places+"}"),r},!0);let n=t+r;return r&&(n="(?:(?:"+n+")|(?:"+r+"))"),n+d(e.exponent,t=>t?"([eE]"+p({signed:e.eSigned})+")":"")}(r)+")"}),!0);return{regexp:c.replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:i,decimal:s,factor:l}}function c(e,t){const r=u(t),n=new RegExp("^"+r.regexp+"$").exec(e);if(!n)return NaN;let i=n[1];if(!n[1]){if(!n[2])return NaN;i=n[2],r.factor*=-1}return i=i.replaceAll(new RegExp("["+r.group+"\\s\\xa0]","g"),"").replace(r.decimal,"."),Number(i)*r.factor}function p(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",d(e.signed,e=>e?"[-+]":"",!0)+d(e.separator,t=>{if(!t)return"(?:\\d+)";" "===(t=(0,n.Cj)(t))?t="\\s":" "===t&&(t="\\s\\xa0");const r=e.groupSize,i=e.groupSize2;if(i){const e="(?:0|[1-9]\\d{0,"+(i-1)+"}(?:["+t+"]\\d{"+i+"})*["+t+"]\\d{"+r+"})";return r-i>0?"(?:"+e+"|(?:0|[1-9]\\d{0,"+(r-1)+"}))":e}return"(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+t+"]\\d{"+r+"})*)"},!0)}const d=(e,t,r)=>{if(!Array.isArray(e))return t(e);const n=[];for(let r=0;r<e.length;r++)n.push(t(e[r]));return h(n.join("|"),Boolean(r))},h=(e,t)=>"("+(t?"?:":"")+e+")"},60408(e,t,r){function n(e){return void 0!==e.xmin&&void 0!==e.ymin&&void 0!==e.xmax&&void 0!==e.ymax}function i(e){return void 0!==e.points}function s(e){return void 0!==e.x&&void 0!==e.y}function o(e){return void 0!==e.paths||void 0!==e.curvePaths}function l(e){return void 0!==e.rings||void 0!==e.curveRings}function a(e){return"object"==typeof e&&"vertexAttributes"in e}function u(e){return e?s(e)?"esriGeometryPoint":o(e)?"esriGeometryPolyline":l(e)?"esriGeometryPolygon":n(e)?"esriGeometryEnvelope":i(e)?"esriGeometryMultipoint":null:null}function c(e){return null!=e&&("hasZ"in e&&e.hasZ||"z"in e&&null!=e.z)}function p(e){return null!=e&&("hasM"in e&&e.hasM||"m"in e&&null!=e.m)}r.d(t,{$B:()=>u,Bi:()=>l,Pv:()=>c,Rg:()=>o,U9:()=>i,W0:()=>p,ZC:()=>n,fT:()=>s,uW:()=>a})},65864(e,t,r){r.d(t,{rS:()=>c,xD:()=>d});var n=r(5443),i=r(91075),s=r(48526),o=r(86738),l=r(39829),a=r(82799),u=r(60408);function c(e){return null==e?null:e instanceof i.A?e:(0,u.fT)(e)?o.A.fromJSON(e):(0,u.Rg)(e)?a.A.fromJSON(e):(0,u.Bi)(e)?l.A.fromJSON(e):(0,u.U9)(e)?s.A.fromJSON(e):(0,u.ZC)(e)?n.A.fromJSON(e):null}const p={esriGeometryPoint:o.A,esriGeometryPolyline:a.A,esriGeometryPolygon:l.A,esriGeometryEnvelope:n.A,esriGeometryMultipoint:s.A,esriGeometryMultiPatch:l.A};function d(e){return e&&p[e]||null}},39357(e,t,r){r.d(t,{A:()=>l});var n,i=r(5482),s=r(25482),o=r(91429);let l=n=class extends s.o{constructor(e){super(e),this.name=null,this.code=null}clone(){return new n({name:this.name,code:this.code})}};(0,i.Cg)([(0,o.MZ)({type:String,json:{write:{isRequired:!0}}})],l.prototype,"name",void 0),(0,i.Cg)([(0,o.MZ)({type:[String,Number],json:{write:{isRequired:!0}}})],l.prototype,"code",void 0),l=n=(0,i.Cg)([(0,o.$K)("esri.layers.support.CodedValue")],l)},53177(e,t,r){r.d(t,{A:()=>c});var n,i=r(5482),s=r(4718),o=r(91429),l=r(39357),a=r(76357),u=r(93223);let c=class extends a.A{static{n=this}constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const r=String(e);this.codedValues.some(e=>(String(e.code)===r&&(t=e.name),!!t))}return t}clone(){return new n({codedValues:(0,s.o8)(this.codedValues),name:this.name})}};(0,i.Cg)([(0,o.MZ)({type:[l.A],json:{write:{isRequired:!0}}})],c.prototype,"codedValues",void 0),(0,i.Cg)([(0,u.e)({codedValue:"coded-value"})],c.prototype,"type",void 0),c=n=(0,i.Cg)([(0,o.$K)("esri.layers.support.CodedValueDomain")],c)},76357(e,t,r){r.d(t,{A:()=>u});var n=r(5482),i=r(66552),s=r(25482),o=r(91429),l=r(93223);const a=new i.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let u=class extends s.o{constructor(e){super(e),this.name=null,this.type=null}};(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],u.prototype,"name",void 0),(0,n.Cg)([(0,l.e)(a),(0,o.MZ)({json:{write:{isRequired:!0}}})],u.prototype,"type",void 0),u=(0,n.Cg)([(0,o.$K)("esri.layers.support.Domain")],u)},20437(e,t,r){r.d(t,{A:()=>y});var n,i=r(5482),s=r(66552),o=r(25482),l=r(91429),a=r(56507),u=r(8631),c=r(98453),p=r(36005),d=r(93223);const h=new s.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let y=class extends o.o{static{n=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?.value??null}readValueType(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?h.fromJSON(r.fieldValueType):null}clone(){return new n({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"alias",void 0),(0,i.Cg)([(0,l.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],y.prototype,"defaultValue",void 0),(0,i.Cg)([(0,l.MZ)()],y.prototype,"description",void 0),(0,i.Cg)([(0,p.w)("description")],y.prototype,"readDescription",null),(0,i.Cg)([(0,l.MZ)({types:u.g,json:{read:{reader:u.r},write:!0}})],y.prototype,"domain",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"editable",void 0),(0,i.Cg)([(0,l.MZ)({type:a.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],y.prototype,"length",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"name",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"nullable",void 0),(0,i.Cg)([(0,d.e)(c.m)],y.prototype,"type",void 0),(0,i.Cg)([(0,l.MZ)()],y.prototype,"valueType",void 0),(0,i.Cg)([(0,p.w)("valueType",["description"])],y.prototype,"readValueType",null),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{read:!1}})],y.prototype,"visible",void 0),y=n=(0,i.Cg)([(0,l.$K)("esri.layers.support.Field")],y)},41628(e,t,r){r.d(t,{A:()=>a});var n,i=r(5482),s=r(91429),o=r(76357),l=r(93223);let a=class extends o.A{static{n=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new n({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,i.Cg)([(0,s.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]},isRequired:!0}}})],a.prototype,"maxValue",void 0),(0,i.Cg)([(0,s.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]},isRequired:!0}}})],a.prototype,"minValue",void 0),(0,i.Cg)([(0,l.e)({range:"range"})],a.prototype,"type",void 0),a=n=(0,i.Cg)([(0,s.$K)("esri.layers.support.RangeDomain")],a)},8631(e,t,r){r.d(t,{r:()=>d,g:()=>p});var n,i=r(53177),s=r(76357),o=r(5482),l=r(91429),a=r(93223);let u=class extends s.A{static{n=this}constructor(e){super(e),this.type="inherited"}clone(){return new n}};(0,o.Cg)([(0,a.e)({inherited:"inherited"})],u.prototype,"type",void 0),u=n=(0,o.Cg)([(0,l.$K)("esri.layers.support.InheritedDomain")],u);var c=r(41628);const p={key:"type",base:s.A,typeMap:{range:c.A,"coded-value":i.A,inherited:u}};function d(e){if(!e?.type)return null;switch(e.type){case"range":return c.A.fromJSON(e);case"codedValue":return i.A.fromJSON(e);case"inherited":return u.fromJSON(e)}return null}},98453(e,t,r){r.d(t,{m:()=>n});const n=new(r(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},20655(e,t,r){r.d(t,{A:()=>N});var n=r(5482),i=r(92602),s=r(70333),o=r(11254),l=r(49186),a=r(44208),u=r(25482),c=r(92474),p=r(97768),d=r(17676),h=r(91429),y=r(56507),f=r(5443),m=r(73444);let g;var v=r(96360),C=r(16405),S=r(69622);let b=class extends S.A{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};(0,n.Cg)([(0,h.MZ)()],b.prototype,"nextQueryParams",void 0),(0,n.Cg)([(0,h.MZ)()],b.prototype,"queryParams",void 0),(0,n.Cg)([(0,h.MZ)()],b.prototype,"results",void 0),(0,n.Cg)([(0,h.MZ)()],b.prototype,"total",void 0),b=(0,n.Cg)([(0,h.$K)("esri.portal.PortalQueryResult")],b);var M,Z=r(41318),A=r(926),T=r(36005);let O;const w={PortalGroup:()=>Promise.resolve({default:v.A}),PortalItem:()=>r.e(812).then(r.bind(r,80812)),PortalUser:()=>Promise.resolve({default:Z.A})};let N=class extends((0,u.T)(c.x_)){static{M=this}static{this.AUTH_MODE_ANONYMOUS="anonymous"}static{this.AUTH_MODE_AUTO="auto"}static{this.AUTH_MODE_IMMEDIATE="immediate"}static{this.AUTH_MODE_NO_PROMPT="no-prompt"}constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.g3DTilesGalleryGroupQuery=null,this.g3dTilesEnabled=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.default3DBasemapQuery=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.hasClassificationSchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.recycleBinEnabled=!1,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=i.A.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useDefault3dBasemap=!1,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e}destroy(){P.unregister(this),this.defaultBasemap=(0,p.pR)(this.defaultBasemap),this.defaultDevBasemap=(0,p.pR)(this.defaultDevBasemap),this.defaultVectorBasemap=(0,p.pR)(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=(0,p.xt)(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const t of e)i.A.request.trustedServers.includes(t)||i.A.request.trustedServers.push(t);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){const e=this.user?.orgId,t=!e||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get hasAPIKey(){return(0,A.Jn)(this.restUrl)}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get loaded(){return super.loaded}get restUrl(){let e=this.url;if(e){const t=e.indexOf("/sharing");e=t>0?e.slice(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e?e.toLowerCase():e}readUser(e){let t=null;return e&&(t=Z.A.fromJSON(e),t.portal=this),t}load(e){const t=Promise.all([r.e(812),r.e(3116)]).then(r.bind(r,83116)).then(({default:t})=>{(0,d.Te)(e),O=t}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,e)).then(e=>{if(!this.hasAPIKey&&s.id){const e=s.id;this.credential=e.findCredential(this.restUrl),this.credential||this.authMode!==M.AUTH_MODE_AUTO&&this.authMode!==M.AUTH_MODE_NO_PROMPT||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=e.on("credential-create",function(e){const t=s.id;return()=>{const r=e.deref();r&&t.findCredential(r.restUrl)&&r.signIn().catch(()=>{})}}(new WeakRef(this))),P.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=e,this.read(e)});return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService("defaultElevationLayers"),t=(await Promise.all([r.e(3508),r.e(9953),r.e(812),r.e(9186),r.e(2369),r.e(7716)]).then(r.bind(r,62369))).default;return e?e.map(e=>new t({id:e.id,url:e.url})):[]}async fetchBasemaps(e,t){const r=await this._fetchBasemaps(e,t);if(!0===t?.include3d&&!1!==this.use3dBasemaps){if(this.g3dTilesEnabled&&this.g3DTilesGalleryGroupQuery&&(0,a.A)("enable-feature:basemap-groundlayers")){const e=await this._fetchBasemaps3D(this.g3DTilesGalleryGroupQuery,t);r.unshift(...e)}const n=await this._fetchBasemaps3D(e,t);r.unshift(...n)}return r}async fetchDefault3DBasemap(e){if(!this.useDefault3dBasemap||!this.default3DBasemapQuery||"none"===this.default3DBasemapQuery)return null;const t=new C.A;t.query=this.default3DBasemapQuery,t.disableExtraQuery=!0;const r=(await this.queryItems(t,e)).results.find(e=>"Web Scene"===e.type);return r?new O({portalItem:r}):null}fetchCategorySchema(e){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",e).then(e=>e.categorySchema):(0,d.G4)(e)?Promise.reject((0,d.NK)()):Promise.resolve([])}async fetchClassificationSchema(e){return this.hasClassificationSchema?this.request(this.restUrl+"/portals/self/classification/classificationSchema",e).then(e=>e.classificationSchema):null}fetchFeaturedGroups(e){const t=this.featuredGroups,r=new C.A({num:100,sortField:"title"});if(t?.length){const n=[];for(const e of t)n.push(`(title:"${e.title}" AND owner:${e.owner})`);return r.query=n.join(" OR "),this.queryGroups(r,e).then(e=>e.results)}return(0,d.G4)(e)?Promise.reject((0,d.NK)()):Promise.resolve([])}fetchRegions(e){const t=this.user?.culture||this.culture||(0,m.JK)();return this.request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){const t=this.user?.culture||this.culture||(0,m.JK)();return this.request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return g&&!g.destroyed||(g=new M),g}queryGroups(e,t){return this.queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this.queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||(e.sortField="username"),this.queryPortal("/community/users",e,"PortalUser",t)}fetchSelf(e=this.authMode,t=!1,r){const n=this.restUrl+"/portals/self",i={authMode:e,query:{culture:(0,m.JK)().toLowerCase()},withCredentials:!0,...r};return"auto"===i.authMode&&(i.authMode="no-prompt"),t&&(i.query.default=!0),this.request(n,i)}queryPortal(e,t,r,n){const i=(0,y.dp)(C.A,t),s=t=>this.request(this.restUrl+e,{...i.toRequestOptions(this),...n}).then(e=>{const r=i.clone();return r.start=e.nextStart,new b({nextQueryParams:r,queryParams:i,total:e.total,results:M._resultsToTypedArray(t,{portal:this},e,n)})}).then(e=>Promise.all(e.results.map(t=>"function"==typeof t.when?t.when():e)).then(()=>e,t=>((0,d.QP)(t),e)));return r&&w[r]?w[r]().then(({default:e})=>((0,d.Te)(n),s(e))):s()}signIn(){if(this.hasAPIKey)return this.load().then(()=>{if(!this.user)throw new l.A("portal:not-authenticated","Unable to authenticate user. Portal.user is missing")});if(this.authMode===M.AUTH_MODE_ANONYMOUS||this.authMode===M.AUTH_MODE_NO_PROMPT&&!s.id)return Promise.reject(new l.A("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if("failed"===this.loadStatus)return Promise.reject(this.loadError);const e=e=>Promise.resolve().then(()=>"not-loaded"===this.loadStatus?(e||(this.authMode="immediate"),this.load().then(()=>null)):"loading"===this.loadStatus?this.load().then(()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate"))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate"))).then(e=>{e&&(this.sourceJSON=e,this.read(e))});return s.id?s.id.getCredential(this.restUrl,{prompt:this.authMode!==M.AUTH_MODE_NO_PROMPT}).then(t=>e(t)):e(this.credential)}normalizeUrl(e){const t=this.credential?.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}requestToTypedArray(e,t,r){return this.request(e,t).then(e=>{const t=M._resultsToTypedArray(r,{portal:this},e);return Promise.all(t.map(t=>"function"==typeof t.when?t.when():e)).then(()=>t,()=>t)})}request(e,t={}){const r={f:"json",...t.query},{authMode:n=(this.authMode===M.AUTH_MODE_ANONYMOUS||this.authMode===M.AUTH_MODE_NO_PROMPT?this.authMode:"auto"),body:i=null,cacheBust:s=!1,method:l="auto",responseType:a="json",signal:u}=t,c={authMode:n,body:i,cacheBust:s,method:l,query:r,responseType:a,timeout:0,signal:u};return t.withCredentials&&(c.withCredentials=!0),(0,o.A)(this._normalizeSSL(e),c).then(e=>e.data)}toJSON(){throw new l.A("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new M({sourceJSON:e})}_getHelperService(e){const t=this.helperServices?.[e];if(!t)throw new l.A("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}async _fetchBasemaps(e,t){const r=new C.A;r.query=e||((0,A.Dd)()?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),r.disableExtraQuery=!0;const n=await this.queryGroups(r,t);if(!n.total)return[];const i=n.results[0];r.num=100,r.query='type:"Web Map" -type:"Web Application"',r.sortField=i.sortField||"name",r.sortOrder=i.sortOrder||"desc";const s=await i.queryItems(r,t);return s.total?s.results.filter(e=>"Web Map"===e.type).map(e=>new O({portalItem:e})):[]}async _fetchBasemaps3D(e,t){const r=e||this.basemapGalleryGroupQuery3D;if(!r)return[];if((0,A.Dd)())return[];const n=new C.A({query:r,disableExtraQuery:!0}),i=await this.queryGroups(n,t);if(!i.total)return[];const s=i.results[0];n.num=100,n.query='type:"Web Scene"',n.sortField=s.sortField||"name",n.sortOrder=s.sortOrder||"desc";const o=await s.queryItems(n,t);return o.total?o.results.filter(e=>"Web Scene"===e.type).map(e=>new O({portalItem:e})):[]}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(e){if(e){const t=O.fromJSON(e);return t.portalItem={portal:this},t}return null}static _resultsToTypedArray(e,t,r,n){let i;if(r){const s=null!=n?n.signal:null;i=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(e||t)&&(i=i.map(r=>{const n=Object.assign(e?e.fromJSON(r):r,t);return"function"==typeof n.load&&n.load(s),n}))}else i=[];return i}};(0,n.Cg)([(0,h.MZ)()],N.prototype,"access",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"allSSL",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"authMode",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"authorizedCrossOriginDomains",void 0),(0,n.Cg)([(0,T.w)("authorizedCrossOriginDomains")],N.prototype,"readAuthorizedCrossOriginDomains",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"basemapGalleryGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)({json:{name:"3DBasemapGalleryGroupQuery"}})],N.prototype,"basemapGalleryGroupQuery3D",void 0),(0,n.Cg)([(0,h.MZ)({json:{name:"g3DTilesGalleryGroupQuery"}})],N.prototype,"g3DTilesGalleryGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)({json:{name:"g3dTilesEnabled"}})],N.prototype,"g3dTilesEnabled",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"bingKey",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canListApps",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canListData",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canListPreProvisionedItems",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canProvisionDirectPurchase",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canSearchPublic",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canShareBingPublic",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canSharePublic",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canSignInArcGIS",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canSignInIDP",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"colorSetsGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"commentsEnabled",void 0),(0,n.Cg)([(0,h.MZ)({type:Date})],N.prototype,"created",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"credential",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"culture",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"currentVersion",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"customBaseUrl",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"default3DBasemapQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"defaultBasemap",void 0),(0,n.Cg)([(0,T.w)("defaultBasemap")],N.prototype,"readDefaultBasemap",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"defaultDevBasemap",void 0),(0,n.Cg)([(0,T.w)("defaultDevBasemap")],N.prototype,"readDefaultDevBasemap",null),(0,n.Cg)([(0,h.MZ)({type:f.A})],N.prototype,"defaultExtent",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"defaultVectorBasemap",void 0),(0,n.Cg)([(0,T.w)("defaultVectorBasemap")],N.prototype,"readDefaultVectorBasemap",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"description",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"devBasemapGalleryGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"eueiEnabled",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"extraQuery",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"featuredGroups",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"featuredItemsGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"galleryTemplatesGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"layoutGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"livingAtlasGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"hasAPIKey",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"hasCategorySchema",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"hasClassificationSchema",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"helpBase",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"helperServices",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"helpMap",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"homePageFeaturedContent",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"homePageFeaturedContentCount",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"httpPort",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"httpsPort",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"id",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"ipCntryCode",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"isOrganization",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"isPortal",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"isReadOnly",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"itemPageUrl",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"layerTemplatesGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"maxTokenExpirationMinutes",void 0),(0,n.Cg)([(0,h.MZ)({type:Date})],N.prototype,"modified",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"name",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"portalHostname",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"portalMode",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"portalProperties",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"region",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"recycleBinEnabled",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"restUrl",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"rotatorPanels",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"showHomePageDescription",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"sourceJSON",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"staticImagesUrl",void 0),(0,n.Cg)([(0,h.MZ)({json:{name:"2DStylesGroupQuery"}})],N.prototype,"stylesGroupQuery2d",void 0),(0,n.Cg)([(0,h.MZ)({json:{name:"stylesGroupQuery"}})],N.prototype,"stylesGroupQuery3d",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"supportsHostedServices",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"symbolSetsGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"templatesGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"thumbnail",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"thumbnailUrl",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"units",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"url",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"urlKey",void 0),(0,n.Cg)([(0,T.w)("urlKey")],N.prototype,"readUrlKey",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"user",void 0),(0,n.Cg)([(0,T.w)("user")],N.prototype,"readUser",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"use3dBasemaps",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"useDefault3dBasemap",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"useStandardizedQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"useVectorBasemaps",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"vectorBasemapGalleryGroupQuery",void 0),N=M=(0,n.Cg)([(0,h.$K)("esri.portal.Portal")],N);const P=new FinalizationRegistry(e=>{e.remove()})},96360(e,t,r){r.d(t,{A:()=>c});var n,i=r(5482),s=r(49186),o=r(25482),l=r(91429),a=r(56507),u=r(16405);let c=n=class extends o.o{constructor(e){super(e),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.sourceJSON=null,this.tags=null,this.title=null}get thumbnailUrl(){const e=this.url,t=this.thumbnail;return e&&t&&this.portal?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`):null}get url(){const e=this.portal?.restUrl;return e?e+"/community/groups/"+this.id:null}fetchCategorySchema(e){return this.portal.request(this.url+"/categorySchema",e).then(t=>{const r=t.categorySchema||[];return r.some(e=>"contentCategorySetsGroupQuery.LivingAtlas"===e.source)?this._fetchCategorySchemaSet("LivingAtlas",e):r})}fetchMembers(e){return this.portal.request(this.url+"/users",e)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}toJSON(){throw new s.A("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const t=new n({sourceJSON:e});return t.read(e),t}queryItems(e,t){let r=(0,a.dp)(u.A,e);const n=this.portal;return parseFloat(n.currentVersion)>5?(r=r||new u.A,n.queryPortal(`/content/groups/${this.id}/search`,r,"PortalItem",t)):(r=r?r.clone():new u.A,r.query="group:"+this.id+(r.query?" "+r.query:""),n.queryItems(r,t))}_fetchCategorySchemaSet(e,t){const r=this.portal;return r.fetchSelf(r.authMode,!0,t).then(e=>{const n=e.contentCategorySetsGroupQuery;if(n){const e=new u.A({disableExtraQuery:!0,num:1,query:n});return r.queryGroups(e,t)}throw new s.A("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(r=>{if(r.total){const n=r.results[0],i=new u.A({num:1,query:`typekeywords:"${e}"`});return n.queryItems(i,t)}throw new s.A("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(e=>e.total?e.results[0].fetchData("json",t).then(e=>{const t=e?.categorySchema;return t?.length?t:[]}):[])}};(0,i.Cg)([(0,l.MZ)()],c.prototype,"access",void 0),(0,i.Cg)([(0,l.MZ)({type:Date})],c.prototype,"created",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"description",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"id",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"isInvitationOnly",void 0),(0,i.Cg)([(0,l.MZ)({type:Date})],c.prototype,"modified",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"owner",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"portal",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"snippet",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"sortField",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"sortOrder",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"sourceJSON",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"tags",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"thumbnail",void 0),(0,i.Cg)([(0,l.MZ)({readOnly:!0})],c.prototype,"thumbnailUrl",null),(0,i.Cg)([(0,l.MZ)()],c.prototype,"title",void 0),(0,i.Cg)([(0,l.MZ)({readOnly:!0})],c.prototype,"url",null),c=n=(0,i.Cg)([(0,l.$K)("esri.portal.PortalGroup")],c)},16405(e,t,r){r.d(t,{A:()=>h});var n,i=r(5482),s=r(69622),o=r(66552),l=r(4718),a=r(91429),u=r(5443),c=r(16930),p=r(28735);const d=new o.J({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let h=n=class extends s.A{constructor(e){super(e),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(e){"asc"!==e&&"desc"!==e||this._set("sortOrder",e)}clone(){return new n({categories:this.categories?(0,l.o8)(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(e,t){let r=[];this.categories&&(r=this.categories.map(e=>Array.isArray(e)?JSON.stringify(e):e));let n="";if(this.extent){const e=(0,p.Cv)(this.extent,c.A.WGS84);null!=e&&(n=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`)}let i=this.query;!this.disableExtraQuery&&e.extraQuery&&(i="("+i+")"+e.extraQuery);const s={categories:r,bbox:n,q:i,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(s.sortField=this.sortField.split(",").map(e=>d.toJSON(e.trim())).join(","),s.sortOrder=this.sortOrder),{query:{...t,...s}}}};(0,i.Cg)([(0,a.MZ)()],h.prototype,"categories",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"disableExtraQuery",void 0),(0,i.Cg)([(0,a.MZ)({type:u.A})],h.prototype,"extent",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"filter",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"num",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"query",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"sortField",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"sortOrder",null),(0,i.Cg)([(0,a.MZ)()],h.prototype,"start",void 0),h=n=(0,i.Cg)([(0,a.$K)("esri.portal.PortalQueryParams")],h)},41318(e,t,r){r.d(t,{A:()=>c});var n=r(5482),i=r(49186),s=r(25482),o=r(91429);let l=class extends s.o{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const e=this.portal?.restUrl;return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new i.A("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};(0,n.Cg)([(0,o.MZ)({type:Date})],l.prototype,"created",void 0),(0,n.Cg)([(0,o.MZ)()],l.prototype,"id",void 0),(0,n.Cg)([(0,o.MZ)()],l.prototype,"portal",void 0),(0,n.Cg)([(0,o.MZ)()],l.prototype,"title",void 0),(0,n.Cg)([(0,o.MZ)({readOnly:!0})],l.prototype,"url",null),(0,n.Cg)([(0,o.MZ)()],l.prototype,"username",void 0),l=(0,n.Cg)([(0,o.$K)("esri.portal.PortalFolder")],l);var a,u=r(96360);let c=a=class extends s.o{constructor(e){super(e),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.id=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userLicenseTypeId=null,this.userType=null}get thumbnailUrl(){const e=this.url,t=this.thumbnail;return e&&t?this.portal.normalizeUrl(`${e}/info/${t}?f=json`):null}get userContentUrl(){const e=this.portal?.restUrl;return e?`${e}/content/users/${this.id}`:null}get url(){const e=this.portal?.restUrl;return e?`${e}/community/users/${this.id}`:null}addItem(e){const t=e&&e.item,r=e?.data,n=e?.folder,i={method:"post"};t&&(i.query=t.createPostQuery(),null!=r&&("string"==typeof r?i.query.text=r:"object"==typeof r&&(i.query.text=JSON.stringify(r))));let s=this.userContentUrl;return n&&(s+="/"+("string"==typeof n?n:n.id)),this.portal.request(s+"/addItem",i).then(e=>(t.id=e.id,t.portal=this.portal,t.loaded?t.reload():t.load()))}async deleteItem(e,t=!1){let r=this.userContentUrl;e.ownerFolder&&(r+="/"+e.ownerFolder);const n=t?{permanentDelete:!0}:{};await this.portal.request(r+`/items/${e.id}/delete`,{method:"post",query:n}),e.id=null,e.portal=null}async deleteItems(e,t=!1){e=e.slice();const r=this.userContentUrl+"/deleteItems",n=[],s=e.map(e=>e.id);if(s.length){const o={method:"post",query:{items:s.join(","),permanentDelete:t}},l=await this.portal.request(r,o);for(const t of l.results){const r=e.find(e=>t.itemId===e.id),s=t.success;let o=null;s?(r.id=null,r.portal=null):t.error&&(o=new i.A("portal:delete-item-failed",t.error.message,t.error)),n.push({item:r,success:s,error:o})}}return n}fetchFolders(){return this.portal.request(this.userContentUrl??"",{query:{num:1}}).then(e=>{let t;return t=e&&e.folders?e.folders.map(e=>{const t=l.fromJSON(e);return t.portal=this.portal,t}):[],t})}fetchGroups(){return this.portal.request(this.url??"").then(e=>{let t;return t=e&&e.groups?e.groups.map(e=>{const t=u.A.fromJSON(e);return t.portal=this.portal,t}):[],t})}async fetchItems(e){e??={};let t=this.userContentUrl??"";e.folder&&(t+="/"+e.folder.id);const{default:n}=await r.e(812).then(r.bind(r,80812)),i={folders:!1,inRecycleBin:!!e.inRecycleBin||null,foldersContent:!(e.folder||!e.includeSubfolderItems)||null,num:e.num||10,start:e.start||1,sortField:e.sortField||"created",sortOrder:e.sortOrder||"asc"},s=await this.portal.request(t,{query:i});let o;return s?.items?(o=s.items.map(e=>{const t=n.fromJSON(e);return t.portal=this.portal,t}),await Promise.all(o.map(e=>e.load())),{items:o,nextStart:s.nextStart,total:s.total}):{items:[],nextStart:-1,total:0}}fetchTags(){return this.portal.request(this.url+"/tags").then(e=>e.tags)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}queryFavorites(e){return this.favGroupId?(this._favGroup||(this._favGroup=new u.A({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(e)):Promise.reject(new i.A("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}async restoreItem(e,t){const r=this.userContentUrl,n=t?{folderID:"string"==typeof t?t:t.id}:null;await this.portal.request(r+`/items/${e.id}/restore`,{method:"post",query:n})}toJSON(){throw new i.A("internal:not-yet-implemented","PortalUser.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const t=new a({sourceJSON:e});return t.read(e),t}};(0,n.Cg)([(0,o.MZ)()],c.prototype,"access",void 0),(0,n.Cg)([(0,o.MZ)({type:Date})],c.prototype,"created",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"culture",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"description",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"email",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"favGroupId",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"fullName",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"id",void 0),(0,n.Cg)([(0,o.MZ)({type:Date})],c.prototype,"modified",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"orgId",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"portal",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"preferredView",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"privileges",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"region",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"role",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"roleId",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"sourceJSON",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"thumbnail",void 0),(0,n.Cg)([(0,o.MZ)({readOnly:!0})],c.prototype,"thumbnailUrl",null),(0,n.Cg)([(0,o.MZ)()],c.prototype,"units",void 0),(0,n.Cg)([(0,o.MZ)({readOnly:!0})],c.prototype,"userContentUrl",null),(0,n.Cg)([(0,o.MZ)({readOnly:!0})],c.prototype,"url",null),(0,n.Cg)([(0,o.MZ)()],c.prototype,"username",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"userLicenseTypeId",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"userType",void 0),c=a=(0,n.Cg)([(0,o.$K)("esri.portal.PortalUser")],c)},2272(e,t,r){r.d(t,{Dl:()=>u,gf:()=>p,jV:()=>a,lF:()=>c});var n=r(92602),i=r(70333),s=r(4718),o=r(84952),l=r(926);function a(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function u(e){return"string"==typeof e?(0,o.An)(e):(0,s.o8)(e)}function c(e,t,r){const n={};for(const i in e){if("declaredClass"===i)continue;const s=e[i];if(null!=s&&"function"!=typeof s)if(Array.isArray(s))n[i]=s.map(e=>c(e));else if("object"==typeof s)if(s.toJSON){const e=s.toJSON(r?.[i]);n[i]=t?e:JSON.stringify(e)}else n[i]=t?s:JSON.stringify(s);else n[i]=s}return n}async function p(e,t,s){const o=function(e,t){return e?t&&(0,l.Qc)(e)?t:(0,l.getApiKey)(e)??i.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!i.id&&n.A.request.useIdentity&&await Promise.all([r.e(7632),r.e(1378),r.e(148)]).then(r.bind(r,50148));const a=await i.id.getCredential(e,s);return a?.token}},926(e,t,r){r.d(t,{Dd:()=>d,Jn:()=>h,Qc:()=>y,getApiKey:()=>c,getSessionToken:()=>p});var n=r(92602),i=r(11254),s=r(84952);const o=/^https?:\/\/(i?basemaps|basemapstyles)-api\.arcgis\.com\//i,l=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]),a=new Map;let u=null;function c(e){if(!y(e))return null;const t=t=>t instanceof RegExp?t.test(e):"string"==typeof t&&e.startsWith(t),r=n.A.apiKeys;if(Array.isArray(r.scopes))for(const e of r.scopes)if(Array.isArray(e.urls)){if(e.urls.some(t))return e.token}else if(t(e.urls))return e.token;return r.basemapStyles&&o.test(e)?r.basemapStyles:n.A.apiKey&&/^https?:\/\/.+\.arcgis\.com(\/|$)/i.test(e)?n.A.apiKey:null}async function p(e){if(!n.A.sessions?.basemap?.enabled||!o.test(e))return null;const t=c(e);if(!t)return null;u&&await u;const{styleFamily:r="arcgis",autoRefresh:s,duration:l=43200}=n.A.sessions.basemap,p=`${t}:${r}`,d=a.get(p);if(d&&(!s||d.endTime>Date.now()))return d.sessionToken;let h;u=(0,i.A)("https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/sessions/start",{cacheBust:!0,query:{durationSeconds:l,styleFamily:r,token:t}});try{h=(await u).data,h.endTime-=5e3,a.set(p,h)}finally{u=null}return h.sessionToken}function d(){return null!=n.A.apiKey||null!=n.A.apiKeys.basemapStyles}function h(e,t){return t?y(e):null!=c(e)}function y(e){const t=(0,s.$z)(e,!0);return!!t&&!l.has(t)&&!e.endsWith("/sharing/rest/generateToken")}},94128(e,t,r){r.d(t,{D:()=>i,Z:()=>n});const n=Symbol("GraphicInstance");function i(e){return null!=e&&"object"==typeof e&&n in e}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[926,1695],{99719(e,t,r){r.d(t,{x:()=>n});class n{}},92400(e,t,r){r.d(t,{CU:()=>l,UQ:()=>o,fF:()=>i,o6:()=>s});var n=r(17676);class i{constructor(){}}function s(e,t,r){if(e instanceof i&&!(e instanceof l)){const n=new l;return n.fn=e,n.parameterEvaluator=r,n.context=t,n}return e}class o extends i{constructor(e){super(),this.fn=e}createFunction(e){return(...t)=>this.fn(e,{preparsed:!0,arguments:t})}call(e,t){return this.fn(e,t)}marshalledCall(e,t,r,o){return o(e,t,(t,a,u)=>{u=u.map(t=>t instanceof i&&!(t instanceof l)?s(t,e,o):t);const c=this.call(r,{args:u});return(0,n.$X)(c)?c.then(e=>s(e,r,o)):c})}}class l extends i{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,t){return this.fn.marshalledCall(e,t,this.context,this.parameterEvaluator)}marshalledCall(e,t,r){return this.fn.marshalledCall(e,t,this.context,this.parameterEvaluator)}}},93818(e,t,r){r.d(t,{A:()=>n});class n{constructor(e=[]){this._elements=e}length(){return this._elements.length}get(e){return this._elements[e]}toArray(){return this.slice()}slice(e=0,t=this.length()){const r=[];for(let n=e;n<t;n++)r.push(this.get(n));return r}}},7335(e,t,r){r.d(t,{A:()=>s});var n=r(93818),i=r(7320);class s extends n.A{constructor(e,t,r,n,i){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=r,this._hasM=n,this._spRef=t,this._cacheId=i}get(e){if(void 0===this._lazyPath[e]){const t=this._elements[e];if(void 0===t)return;this._lazyPath[e]=new i.A(t,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||null!==e&&e instanceof s!=0&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}},7320(e,t,r){r.d(t,{A:()=>s});var n=r(93818),i=r(86738);class s extends n.A{constructor(e,t,r,n,i,s){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=t,this._hasZ=r,this._hasM=n,this._cacheId=i,this._partId=s}get(e){if(void 0===this._lazyPt[e]){const t=this._elements[e];if(void 0===t)return;const r=new i.A(t[0],t[1],this._spRef);this._hasZ&&(r.z=t[2]),this._hasM&&(r.m=this._hasZ?t[3]:t[2]),r.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=r}return this._lazyPt[e]}equalityTest(e){return e===this||null!==e&&e instanceof s!=0&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}},6800(e,t,r){r.d(t,{G:()=>a,y:()=>o});var n=r(99719),i=r(78878),s=r(54218);function o(e){l=e}let l;function a(e){return null===e?null:(0,i.e)(e)?e.clone():(0,i.d)(e)?e:(0,i.h)(e)?e.clone():(0,i.j)(e)?e.toArray().map(e=>a(e)):(0,s.cy)(e)?e.map(e=>a(e)):(0,i.k)(e)?l.createFromArcadeFeature(e):(0,i.l)(e)||(0,i.m)(e)?e:(0,i.n)(e)||"esri.arcade.Attachment"===e?.declaredClass?e.deepClone():("esri.arcade.Portal"===e?.declaredClass||(0,i.o)(e)||e instanceof n.x||(0,i.i)(e),e)}},33325(e,t,r){r.d(t,{$P:()=>c,At:()=>v,JB:()=>S,Lk:()=>p,Qi:()=>C,eB:()=>b,eg:()=>y,f0:()=>h,gO:()=>f,ik:()=>m,ke:()=>a,nE:()=>u,rX:()=>d,yT:()=>g});var n=r(66131),i=r(44729),s=r(15032),o=r(20437),l=r(92647);function a(e){return o.A.fromJSON(e.toJSON())}function u(e){return e.toJSON?e.toJSON():e}function c(e){return e instanceof Date}function p(e){return e instanceof l.c9}function d(e){return e instanceof n.lY}function h(e){return e instanceof i.n}function y(e){return e instanceof s.k}const f=1e3,m={point:"point",polygon:"polygon",polyline:"polyline",multipoint:"multipoint",extent:"extent",esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint",esriGeometryEnvelope:"extent",envelope:"extent"},g={point:"esriGeometryPoint",polygon:"esriGeometryPolygon",polyline:"esriGeometryPolyline",multipoint:"esriGeometryMultipoint",extent:"esriGeometryEnvelope",esriGeometryPoint:"esriGeometryPoint",esriGeometryPolygon:"esriGeometryPolygon",esriGeometryPolyline:"esriGeometryPolyline",esriGeometryMultipoint:"esriGeometryMultipoint",esriGeometryEnvelope:"esriGeometryEnvelope",envelope:"esriGeometryEnvelope"},v={"small-integer":"esriFieldTypeSmallInteger",integer:"esriFieldTypeInteger",long:"esriFieldTypeLong",single:"esriFieldTypeSingle",double:"esriFieldTypeDouble",string:"esriFieldTypeString",date:"esriFieldTypeDate","date-only":"esriFieldTypeDateOnly","time-only":"esriFieldTypeTimeOnly","timestamp-offset":"esriFieldTypeTimestampOffset",oid:"esriFieldTypeOID",geometry:"esriFieldTypeGeometry",blob:"esriFieldTypeBlob",raster:"esriFieldTypeRaster",guid:"esriFieldTypeGUID","global-id":"esriFieldTypeGlobalID",xml:"esriFieldTypeXML","big-integer":"esriFieldTypeBigInteger",esriFieldTypeSmallInteger:"esriFieldTypeSmallInteger",esriFieldTypeInteger:"esriFieldTypeInteger",esriFieldTypeLong:"esriFieldTypeLong",esriFieldTypeSingle:"esriFieldTypeSingle",esriFieldTypeDouble:"esriFieldTypeDouble",esriFieldTypeString:"esriFieldTypeString",esriFieldTypeDate:"esriFieldTypeDate",esriFieldTypeDateOnly:"esriFieldTypeDateOnly",esriFieldTypeTimeOnly:"esriFieldTypeTimeOnly",esriFieldTypeTimestampOffset:"esriFieldTypeTimestampOffset",esriFieldTypeOID:"esriFieldTypeOID",esriFieldTypeGeometry:"esriFieldTypeGeometry",esriFieldTypeBlob:"esriFieldTypeBlob",esriFieldTypeRaster:"esriFieldTypeRaster",esriFieldTypeGUID:"esriFieldTypeGUID",esriFieldTypeGlobalID:"esriFieldTypeGlobalID",esriFieldTypeXML:"esriFieldTypeXML",esriFieldTypeBigInteger:"esriFieldTypeBigInteger"};function C(e){return void 0===e?"":e=(e=(e=e.replace(/\/featureserver\/[0-9]*/i,"/FeatureServer")).replace(/\/mapserver\/[0-9]*/i,"/MapServer")).split("?")[0]}function S(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const r="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&(i=t.cmp,function(e){return function(t,r){const n={key:t,value:e[t]},s={key:r,value:e[r]};return i(n,s)}});var i;const s=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let i,o;if(Array.isArray(t)){for(o="[",i=0;i<t.length;i++)i&&(o+=","),o+=e(t[i])||"null";return o+"]"}if(null===t)return"null";if(s.includes(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const l=s.push(t)-1,a=Object.keys(t).sort(n?.(t));for(o="",i=0;i<a.length;i++){const r=a[i],n=e(t[r]);n&&(o&&(o+=","),o+=JSON.stringify(r)+":"+n)}return s.splice(l,1),"{"+o+"}"}(e)}function b(e){switch(e.type){case"catalog-footprint":case"catalog":case"csv":case"feature":case"geojson":case"knowledge-graph-sublayer":case"oriented-imagery":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}},78878(e,t,r){r.d(t,{$:()=>G,A:()=>x,B:()=>te,C:()=>Te,D:()=>ve,E:()=>we,F:()=>Ne,G:()=>Pe,H:()=>ge,I:()=>_,J:()=>R,K:()=>je,L:()=>re,M:()=>J,N:()=>_e,O:()=>E,P:()=>me,Q:()=>oe,R:()=>P,S:()=>ne,T:()=>Ee,U:()=>Be,V:()=>ke,W:()=>Qe,X:()=>Ue,Y:()=>Ce,Z:()=>j,_:()=>Q,a:()=>Ge,a0:()=>Le,a1:()=>de,a2:()=>Re,a3:()=>De,a4:()=>Me,a5:()=>Se,a6:()=>be,b:()=>Je,c:()=>ce,d:()=>q,e:()=>Y,f:()=>W,g:()=>X,h:()=>k,i:()=>I,j:()=>H,k:()=>B,l:()=>V,m:()=>L,n:()=>$,o:()=>z,p:()=>Ke,q:()=>U,r:()=>fe,s:()=>pe,t:()=>he,u:()=>ae,v:()=>F,w:()=>ue,x:()=>xe,y:()=>K,z:()=>D});var n=r(92602),i=r(70333),s=r(66131),o=r(99719),l=r(85935),a=r(92400),u=r(93818),c=r(7335),p=r(7320),d=r(33325),h=r(14607),y=r(44729),f=r(15032),m=r(5443),g=r(91075),v=r(48526),C=r(86738),S=r(39829),b=r(82799),M=r(16930),Z=r(95108),A=r(65864),T=r(73444),O=r(54218),w=r(92647),N=r(94128);class P{constructor(e){this.value=e}}class _{constructor(e){this.value=e}}const F={type:"VOID"},D=Symbol("BREAK"),x=Symbol("CONTINUE");function G(e,t,r){return""===t||null==t||t===r||t===r?e:e=e.split(t).join(r)}function I(e){return e instanceof a.fF}function J(e){return e instanceof o.x}function q(e){return!!((0,O.Kg)(e)||(0,O.Et)(e)||Y(e)||W(e)||X(e)||(0,O.Lm)(e)||null===e||e===F)}function R(e,t){return void 0===e?t:e}function E(e){return null==e?"":(0,O.cy)(e)||H(e)?"Array":Y(e)?"Date":X(e)?"Time":W(e)?"DateOnly":(0,O.Kg)(e)?"String":(0,O.Lm)(e)?"Boolean":(0,O.Et)(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":z(e)?"KnowledgeGraph":e instanceof o.x?"Module":B(e)?"Feature":e instanceof C.A?"Point":e instanceof S.A?"Polygon":e instanceof b.A?"Polyline":e instanceof v.A?"Multipoint":e instanceof m.A?"Extent":I(e)?"Function":L(e)?"FeatureSet":V(e)?"FeatureSetCollection":j(e)?"Voxel":Q(e)?"Pixel":e===F?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognized Type"}function U(e){return e===F}function k(e){return e instanceof g.A}function B(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function j(e){return"esri.arcade.Voxel"===e?.arcadeDeclaredClass}function Q(e){return"esri.arcade.Pixel"===e?.arcadeDeclaredClass}function L(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function $(e){return"esri.arcade.Dictionary"===e?.declaredClass}function K(e){return $(e)||B(e)||j(e)||Q(e)}function V(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function z(e){return"esri.rest.knowledgeGraph.KnowledgeGraph"===e?.declaredClass}function H(e){return e instanceof u.A}function Y(e){return e instanceof s.lY}function W(e){return e instanceof y.n}function X(e){return e instanceof f.k}function ee(e){return null!=e&&"object"==typeof e}function te(e,t,r,n,i){if(e.length<t||e.length>r)throw new l.D$(n,"WrongNumberOfParameters",i)}function re(e){return null==e||U(e)||""===e}function ne(e){return e<0?-Math.round(-e):Math.round(e)}function ie(e,t){return isNaN(e)||null==t||""===t?e.toString():(t=G(t,"‰",""),t=G(t,"¤",""),(0,h.GP)(e,{pattern:t}))}function se(e,t){return null==t||""===t?e.toISOString(!0):e.toFormat(oe(t),{locale:(0,T.JK)(),numberingSystem:"latn"})}function oe(e,t=!1){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let r="";const n=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const i of e.match(n)||[])switch(i){case"D":r+="d";break;case"DD":r+="dd";break;case"DDD":r+="o";break;case"d":r+="c";break;case"ddd":r+="ccc";break;case"dddd":r+="cccc";break;case"M":r+="L";break;case"MM":r+="LL";break;case"MMM":r+="LLL";break;case"MMMM":r+="LLLL";break;case"YY":r+="yy";break;case"Y":case"YYYY":r+="yyyy";break;case"Q":r+="q";break;case"Z":r+="Z";break;case"ZZ":r+="ZZ";break;case"ZZZ":r+="ZZZ";break;case"ZZZZ":r+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":r+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":r+="'S'";break;case"SS":r+="'SS'";break;case"SSS":r+="u";break;case"A":case"a":r+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":r+=i;break;default:i.length>=2&&i.startsWith("[")&&i.endsWith("]")?r+=`'${i.slice(1,-1)}'`:r+=`'${i}'`}return r}function le(e,t,r){switch(r){case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}return!1}function ae(e,t,r){if(null===e){if(null===t||t===F)return le(null,null,r);if((0,O.Et)(t))return le(0,t,r);if((0,O.Kg)(t))return le(0,fe(t),r);if((0,O.Lm)(t))return le(0,fe(t),r);if(Y(t))return le(0,t.toNumber(),r);if(X(t))return le(e,t.toNumber(),r);if(W(t))return le(e,t.toNumber(),r)}if(e===F){if(null===t||t===F)return le(null,null,r);if((0,O.Et)(t))return le(0,t,r);if((0,O.Kg)(t))return le(0,fe(t),r);if((0,O.Lm)(t))return le(0,fe(t),r);if(Y(t))return le(0,t.toNumber(),r);if(X(t))return le(e,t.toNumber(),r);if(W(t))return le(e,t.toNumber(),r)}else if((0,O.Et)(e)){if((0,O.Et)(t))return le(e,t,r);if((0,O.Lm)(t))return le(e,fe(t),r);if(null===t||t===F)return le(e,0,r);if((0,O.Kg)(t))return le(e,fe(t),r);if(Y(t))return le(e,t.toNumber(),r);if(X(t))return le(e,t.toNumber(),r);if(W(t))return le(e,t.toNumber(),r)}else if((0,O.Kg)(e)){if((0,O.Kg)(t))return le(pe(e),pe(t),r);if(Y(t))return le(fe(e),t.toNumber(),r);if(X(t))return le(fe(e),t.toNumber(),r);if(W(t))return le(fe(e),t.toNumber(),r);if((0,O.Et)(t))return le(fe(e),t,r);if(null===t||t===F)return le(fe(e),0,r);if((0,O.Lm)(t))return le(fe(e),fe(t),r)}else if(Y(e)){if(Y(t))return e.timeZone!==t.timeZone&&(e.isUnknownTimeZone?e=s.lY.arcadeDateAndZoneToArcadeDate(e,t.timeZone):t.isUnknownTimeZone&&(t=s.lY.arcadeDateAndZoneToArcadeDate(t,e.timeZone))),le(e.toNumber(),t.toNumber(),r);if(null===t||t===F)return le(e.toNumber(),0,r);if((0,O.Et)(t))return le(e.toNumber(),t,r);if((0,O.Lm)(t))return le(e.toNumber(),fe(t),r);if((0,O.Kg)(t))return le(e.toNumber(),fe(t),r);if(X(t))throw new l.D$(null,"CannotCompareDateAndTime",null);if(W(t))return le(e.toNumber(),t.toNumber(),r)}else if((0,O.Lm)(e)){if((0,O.Lm)(t))return le(e,t,r);if((0,O.Et)(t))return le(fe(e),fe(t),r);if(Y(t))return le(fe(e),t.toNumber(),r);if(X(t))return le(fe(e),t.toNumber(),r);if(W(t))return le(fe(e),t.toNumber(),r);if(null===t||t===F)return le(fe(e),0,r);if((0,O.Kg)(t))return le(fe(e),fe(t),r)}else if(W(e)){if(Y(t))return le(e.toNumber(),t.toNumber(),r);if(null===t||t===F)return le(e.toNumber(),0,r);if((0,O.Et)(t))return le(e.toNumber(),t,r);if((0,O.Lm)(t))return le(e.toNumber(),fe(t),r);if((0,O.Kg)(t))return le(e.toNumber(),fe(t),r);if(X(t))throw new l.D$(null,"CannotCompareDateAndTime",null);if(W(t))return le(e.toNumber(),t.toNumber(),r)}else if(X(e)){if(Y(t))throw new l.D$(null,"CannotCompareDateAndTime",null);if(null===t||t===F)return le(e.toNumber(),0,r);if((0,O.Et)(t))return le(e.toNumber(),t,r);if((0,O.Lm)(t))return le(e.toNumber(),fe(t),r);if((0,O.Kg)(t))return le(e.toNumber(),fe(t),r);if(X(t))return le(e.toNumber(),t.toNumber(),r);if(W(t))throw new l.D$(null,"CannotCompareDateAndTime",null)}return!!ue(e,t)&&("<="===r||">="===r)}function ue(e,t){if(e===t)return!0;if(null===e&&t===F||null===t&&e===F)return!0;if(Y(e)&&Y(t))return e.equals(t);if(X(e)&&X(t))return e.equals(t);if(W(e)&&W(t))return e.equals(t);if(e instanceof c.A)return e.equalityTest(t);if(e instanceof p.A)return e.equalityTest(t);if(e instanceof C.A&&t instanceof C.A){const r=e.cache._arcadeCacheId,n=t.cache._arcadeCacheId;if(null!=r)return r===n}if(ee(e)&&ee(t)){if(e._arcadeCacheId===t._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===t._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function ce(e,{useNumbersForDates:t}){let r="";for(const n in e){""!==r&&(r+=",");const i=e[n];null==i?r+=JSON.stringify(n)+":null":(0,O.Lm)(i)||(0,O.Et)(i)||(0,O.Kg)(i)?r+=JSON.stringify(n)+":"+JSON.stringify(i):k(i)?r+=JSON.stringify(n)+":"+he(i):X(i)||W(i)?r+=`${JSON.stringify(n)}:${JSON.stringify(i.toString())}`:H(i)||Array.isArray(i)?r+=JSON.stringify(n)+":"+he(i,null,t):Y(i)?r+=t?JSON.stringify(n)+":"+JSON.stringify(i.getTime()):JSON.stringify(n)+":"+i.stringify():null!==i&&"object"==typeof i&&"castToText"in i&&(r+=JSON.stringify(n)+":"+i.castToText(t))}return"{"+r+"}"}function pe(e,t){if((0,O.Kg)(e))return e;if(null===e)return"";if((0,O.Et)(e))return ie(e,t);if((0,O.Lm)(e))return e.toString();if(Y(e))return se(e,t);if(X(e))return e.toFormat(t);if(W(e))return e.toFormat(t);if(e instanceof g.A)return JSON.stringify(e.toJSON());if((0,O.cy)(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=ye(e[r]);return"["+t.join(",")+"]"}if(e instanceof u.A){const t=[];for(let r=0;r<e.length();r++)t[r]=ye(e.get(r));return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText():I(e)?"object, Function":e===F?"":J(e)?"object, Module":""}function de(e){const t=[];if(e instanceof u.A){for(let r=0;r<e.length();r++)t[r]=fe(e.get(r));return t}if(!(0,O.cy)(e))return null;for(let r=0;r<e.length;r++)t[r]=fe(e[r]);return t}function he(e,t,r=!1){if((0,O.Kg)(e))return e;if(null===e)return"";if((0,O.Et)(e))return ie(e,t);if((0,O.Lm)(e))return e.toString();if(Y(e))return se(e,t);if(X(e))return e.toFormat(t);if(W(e))return e.toFormat(t);if(e instanceof g.A)return e instanceof m.A?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+Ae(e.spatialReference)+"}":Ae(e.toJSON(),(e,t)=>e.key===t.key?0:"spatialReference"===e.key?1:"spatialReference"===t.key||e.key<t.key?-1:e.key>t.key?1:0);if((0,O.cy)(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=ye(e[n],r);return"["+t.join(",")+"]"}if(e instanceof u.A){const t=[];for(let n=0;n<e.length();n++)t[n]=ye(e.get(n),r);return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText(r):I(e)?"object, Function":e===F?"":J(e)?"object, Module":""}function ye(e,t=!1){if(null===e)return"null";if((0,O.Lm)(e)||(0,O.Kg)(e))return JSON.stringify(e);if((0,O.Et)(e))return e.toString();if(e instanceof g.A)return he(e,null,t);if(e instanceof u.A)return he(e,null,t);if(Array.isArray(e))return he(e,null,t);if(Y(e))return t?JSON.stringify(e.getTime()):JSON.stringify(se(e,""));if(X(e))return JSON.stringify(e.toString());if(W(e))return JSON.stringify(e.toString());if(null!==e&&"object"==typeof e){if("castToText"in e)return e.castToText(t)}else if(e===F)return"null";return"null"}function fe(e,t){return(0,O.Et)(e)?e:null===e||""===e?0:Y(e)||W(e)||X(e)?NaN:(0,O.Lm)(e)?e?1:0:(0,O.cy)(e)||""===e||void 0===e?NaN:void 0!==t&&(0,O.Kg)(e)?(t=G(t,"‰",""),t=G(t,"¤",""),(0,h.qg)(e,{pattern:t})):e===F?0:Number(e)}function me(e,t){if(Y(e))return e;if((0,O.Kg)(e)){const r=function(e,t){const r=/ (\d\d)/,n=(0,s.mT)(t);let i=w.c9.fromISO(e,{zone:n});return i.isValid||r.test(e)&&(e=e.replace(r,"T$1"),i=w.c9.fromISO(e,{zone:t}),i.isValid)?i:null}(e,t);if(r)return s.lY.dateTimeToArcadeDate(r)}return null}function ge(e){return(0,O.Lm)(e)?e:(0,O.Kg)(e)?"true"===(e=e.toLowerCase()):!!(0,O.Et)(e)&&0!==e&&!isNaN(e)}function ve(e,t){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=t),e)}function Ce(e){if(null===e)return null;if(e instanceof C.A)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof S.A){if(0===(e.curveRings??e.rings).length)return null;for(const t of e.curveRings??e.rings)if(t.length>0)return e;return null}if(e instanceof b.A){if(0===(e.curvePaths??e.paths).length)return null;for(const t of e.curvePaths??e.paths)if(t.length>0)return e;return null}return e instanceof v.A?0===e.points.length?null:e:e instanceof m.A?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function Se(e,t){if(!e)return t;if(!e.domain)return t;let r=null,n=null;if(Y(t))r=t.toNumber();else if(W(t))r=t.toString();else if(X(t))r=t.toStorageString();else if("string"===e.field.type||"esriFieldTypeString"===e.field.type)r=pe(t);else{if(null==t)return null;if(""===t)return t;r=fe(t)}for(let t=0;t<e.domain.codedValues.length;t++){const i=e.domain.codedValues[t];i.code===r&&(n=i)}return null===n?pe(t):n.name}function be(e,t){if(!e)return t;if(!e.domain)return t;let r=null;const n=pe(t);for(let t=0;t<e.domain.codedValues.length;t++){const i=e.domain.codedValues[t];i.name===n&&(r=i)}return null===r?t:r.code}function Me(e,t,r=null,n=null){if(!t)return null;if(!t.fields)return null;let i,s,o=null;for(let r=0;r<t.fields.length;r++){const n=t.fields[r];n.name.toLowerCase()===e.toString().toLowerCase()&&(o=n)}if(null===o)throw new l.D$(null,"FieldNotFound",null,{key:e});let a=t.typeIdField,u="id",c=t.types;if(t.subtypeField&&(a=t.subtypeField,u="code",c=t.subtypes??[]),null===n&&r&&a)n=r.hasField(a)?r.field(a):null;else if(a&&null!==n){let e=!1;for(const t of c||[])if(n===t[u]){e=!0;break}if(!e)for(const t of c||[])if(n===t.name){n=t[u],e=!0;break}e||(n=null,r&&a&&(n=r.hasField(a)?r.field(a):null))}return null!=n&&c.some(e=>e[u]===n&&(i=e.domains?.[o.name],i&&"inherited"===i.type&&(i=Ze(o.name,t),s=!0),!0)),s||i||(i=Ze(e,t)),{field:o,domain:i}}function Ze(e,t){let r;return t.fields.some(t=>(t.name.toLowerCase()===e.toLowerCase()&&(r=t.domain),!!r)),r}function Ae(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const r="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&(i=t.cmp,function(e){return function(t,r){const n={key:t,value:e[t]},s={key:r,value:e[r]};return i(n,s)}});var i;const s=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let i,o;if(Array.isArray(t)){for(o="[",i=0;i<t.length;i++)i&&(o+=","),o+=e(t[i])||"null";return o+"]"}if(null===t)return"null";if(s.includes(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const l=s.push(t)-1,a=Object.keys(t).sort(n?.(t));for(o="",i=0;i<a.length;i++){const r=a[i],n=e(t[r]);n&&(o&&(o+=","),o+=JSON.stringify(r)+":"+n)}return s.splice(l,1),"{"+o+"}"}(e)}function Te(e){if(null===e)return null;const t=[];for(const r of e)B(r)?t.push(r.geometry()):t.push(r);return t}function Oe(e,t){if(!(t instanceof C.A))throw new l.D$(null,"InvalidParameter",null);e.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}function we(e,t){if((0,O.cy)(e)||H(e)){let r=!1,n=!1,i=[],s=t;if((0,O.cy)(e)){for(const t of e)Oe(i,t);i.length>0&&(s=e[0].spatialReference,r=e[0].hasZ,n=e[0].hasM)}else if(e instanceof p.A)i=e._elements,i.length>0&&(r=e._hasZ,n=e._hasM,s=e.get(0).spatialReference);else{if(!H(e))throw new l.D$(null,"InvalidParameter",null);for(const t of e.toArray())Oe(i,t);i.length>0&&(s=e.get(0).spatialReference,r=!0===e.get(0).hasZ,n=!0===e.get(0).hasM)}return 0===i.length?null:((0,Z.$3)(i)||(i=i.slice().reverse()),new S.A({rings:[i],spatialReference:s,hasZ:r,hasM:n}))}return e}function Ne(e,t){if((0,O.cy)(e)||H(e)){let r=!1,n=!1,i=[],s=t;if((0,O.cy)(e)){for(const t of e)Oe(i,t);i.length>0&&(s=e[0].spatialReference,r=!0===e[0].hasZ,n=!0===e[0].hasM)}else if(e instanceof p.A)i=e._elements,i.length>0&&(r=e._hasZ,n=e._hasM,s=e.get(0).spatialReference);else if(H(e)){for(const t of e.toArray())Oe(i,t);i.length>0&&(s=e.get(0).spatialReference,r=!0===e.get(0).hasZ,n=!0===e.get(0).hasM)}return 0===i.length?null:new b.A({paths:[i],spatialReference:s,hasZ:r,hasM:n})}return e}function Pe(e,t){if((0,O.cy)(e)||H(e)){let r=!1,n=!1,i=[],s=t;if((0,O.cy)(e)){for(const t of e)Oe(i,t);i.length>0&&(s=e[0].spatialReference,r=!0===e[0].hasZ,n=!0===e[0].hasM)}else if(e instanceof p.A)i=e._elements,i.length>0&&(r=e._hasZ,n=e._hasM,s=e.get(0).spatialReference);else if(H(e)){for(const t of e.toArray())Oe(i,t);i.length>0&&(s=e.get(0).spatialReference,r=!0===e.get(0).hasZ,n=!0===e.get(0).hasM)}return 0===i.length?null:new v.A({points:i,spatialReference:s,hasZ:r,hasM:n})}return e}function _e(e,t=!0){if(null==e)return[];if((0,O.cy)(e)){const r=[];for(const n of e){const e=pe(n);(t||""!==e)&&r.push(e)}return r}if(H(e)){const r=[];for(let n=0;n<e.length();n++){const i=pe(e.get(n));(t||""!==i)&&r.push(i)}return r}if(q(e)){const r=pe(e);if(t||""!==r)return[r]}return[]}let Fe=0;function De(){return Fe++,Fe%100==0?(Fe=0,new Promise(e=>{setTimeout(()=>{e()},0)})):Promise.resolve()}function xe(e,t,r){switch(r){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<<t;case">>":return e>>t;case">>>":return e>>>t}}function Ge(e,t=null){return null==e?null:(0,O.Lm)(e)||(0,O.Et)(e)||(0,O.Kg)(e)?e:e instanceof g.A?!0===t?.keepGeometryType?e:e.toJSON():e instanceof u.A?e.toArray().map(e=>Ge(e,t)):Array.isArray(e)?e.map(e=>Ge(e,t)):(0,O.$P)(e)?e:Y(e)?e.toJSDate():X(e)?e.toString():W(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Ie(e,t,r,n,i){const s=await Je(e,t,r);i[n]=s}async function Je(e,t=null,r=null){if(e instanceof u.A&&(e=e.toArray()),null==e)return null;if(q(e)||e instanceof g.A||(0,O.$P)(e)||Y(e))return Ge(e,r);if(Array.isArray(e)){const n=[],i=[];for(const s of e)null===s||q(s)||s instanceof g.A||(0,O.$P)(s)||Y(s)?i.push(Ge(s,r)):(i.push(null),n.push(Ie(s,t,r,i.length-1,i)));return n.length>0&&await Promise.all(n),i}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,r):null}function qe(e){return Re(e)?e.parent:e}function Re(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function Ee(e,t,r){const n=qe(e.fullSchema());return null===n?null:n.fields?Me(t,n,e,r):null}function Ue(e){const t=qe(e.fullSchema());return null===t?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map(e=>({name:e.name,code:e.code})):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map(e=>({name:e.name,code:e.id})):[]}:null:null}function ke(e,t,r,n){const i=qe(e.fullSchema());if(null===i)return null;if(!i.fields)return null;const s=Me(t,i,e,n);if(void 0===r)try{r=e.field(t)}catch(e){return null}return Se(s,r)}function Be(e,t,r,n){const i=qe(e.fullSchema());if(null===i)return null;if(!i.fields)return null;if(void 0===r){try{r=e.field(t)}catch(e){return null}return r}return be(Me(t,i,e,n),r)}function je(e){return e?.timeZone??"system"}function Qe(e){const t=qe(e.fullSchema());if(null===t)return null;if(!t.fields)return null;const r=[];for(const e of t.fields)r.push((0,d.nE)(e));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:void 0===d.yT[t.geometryType]?"":d.yT[t.geometryType],fields:r}}function Le(e,t){const r=s.lY.systemTimeZoneCanonicalName;return"system"===e&&(e=r),{version:$e,engineVersion:i.rE,timeZone:e,userTimeZone:r,spatialReference:t instanceof M.A?t.toJSON():t,application:n.A.applicationName??"",engine:"web",locale:(0,T.JK)()}}const $e="1.35",Ke=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:_,ReturnResult:P,absRound:ne,arcadeVersion:$e,autoCastArrayOfPointsToMultiPoint:Pe,autoCastArrayOfPointsToPolygon:we,autoCastArrayOfPointsToPolyline:Ne,autoCastFeatureToGeometry:Te,binaryOperator:xe,breakResult:D,castAsJson:Ge,castAsJsonAsync:Je,castRecordToText:ce,continueResult:x,defaultExecutingContext:Le,defaultTimeZone:je,defaultUndefined:R,equalityTest:ue,featureDomainCodeLookup:Be,featureDomainValueLookup:ke,featureFullDomain:Ee,featureSchema:Qe,featureSubtypes:Ue,fixNullGeometry:Ce,fixSpatialReference:ve,formatDate:se,formatNumber:ie,getDomain:Me,getDomainCode:be,getDomainValue:Se,getType:E,greaterThanLessThan:ae,isArray:O.cy,isBoolean:O.Lm,isDate:Y,isDateOnly:W,isDictionary:$,isDictionaryLike:K,isEmpty:re,isFeature:B,isFeatureSet:L,isFeatureSetCollection:V,isFunctionParameter:I,isGeometry:k,isGraphic:N.D,isImmutableArray:H,isInteger:O.Fq,isJsDate:O.$P,isKnowledgeGraph:z,isModule:J,isNumber:O.Et,isObject:ee,isPixel:Q,isSimpleType:q,isString:O.Kg,isSubtypeGrouplayer:function(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass},isSubtypeSublayer:Re,isTime:X,isVoid:U,isVoxel:j,multiReplace:G,parseGeometryFromJson:function(e,t){const r=JSON.parse(e);return r&&!r.spatialReference&&(r.spatialReference=t),(0,A.rS)(r)},pcCheck:te,stableStringify:Ae,standardiseDateFormat:oe,tick:De,toBoolean:ge,toDate:me,toNumber:fe,toNumberArray:de,toString:pe,toStringArray:_e,toStringExplicit:he,voidOperation:F},Symbol.toStringTag,{value:"Module"}))},92474(e,t,r){r.d(t,{WV:()=>d,Zm:()=>y,x_:()=>h});var n=r(5482),i=r(49186),s=r(97768),o=r(61893),l=r(17676),a=r(67076),u=r(10107),c=r(64108);const p="loaded",d=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(e=>{const t=this.load.bind(this);this.load=r=>{const n=new Promise((e,t)=>{const n=(0,l.NY)(r,t);this.destroyed&&t(new i.A("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this.when(e,t).finally(()=>{n&&n.remove()})});if("not-loaded"===this.loadStatus){this._set("loadStatus","loading");const e=this._loadController=new AbortController;t({signal:e.signal})}return e(),n}})),this.when(()=>{this._set("loadStatus",p),this._loadController=null},e=>{this.destroyed||(this._set("loadStatus","failed"),this._set("loadError",e),this._loadController=null)})}destroy(){this._loadController&&(this._loadController=(0,s.DC)(this._loadController),this._promiseProps.abort()),this._set("loadError",null),this._set("loadWarnings",[])}get loaded(){return this.loadStatus===p}get loadWarnings(){return this._get("loadWarnings")}load(e){return null}cancelLoad(){return this.isFulfilled()||(this._set("loadError",new i.A("load:cancelled","Cancelled")),this._loadController?.abort(),this._promiseProps.abort()),this}};return(0,n.Cg)([(0,u.MZ)({readOnly:!0})],r.prototype,"loaded",null),(0,n.Cg)([(0,u.MZ)({readOnly:!0})],r.prototype,"loadError",void 0),(0,n.Cg)([(0,u.MZ)({clonable:!1})],r.prototype,"loadStatus",void 0),(0,n.Cg)([(0,u.MZ)({type:[a.A],readOnly:!0})],r.prototype,"loadWarnings",null),r=(0,n.Cg)([(0,c.$)("esri.core.Loadable")],r),r},h=d(o.Z);function y(e){return!(!e||!e.load)}},61893(e,t,r){r.d(t,{Z:()=>c,g:()=>u});var n=r(5482),i=r(69622),s=r(36563),o=r(17676),l=r(64108);class a{constructor(){this._resolver=Promise.withResolvers(),this._status=0,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=1,this._cleanUp()},()=>{this._status=2,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return 1===this._status}isRejected(){return 2===this._status}isFulfilled(){return 0!==this._status}abort(){this._resolver.reject((0,o.NK)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=Promise.withResolvers(),t=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(t);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()},e=>{this.isFulfilled()||this._allPromise!==r||(0,o.zf)(e)||this._resolver.reject(e)}),e.resolve()}}const u=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),this._promiseProps=new a,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return this._promiseProps.promise.then(()=>this).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}addResolvingTask(e){e&&!this._promiseProps.isFulfilled()&&(this.addHandles((0,s.rE)(e)),this._promiseProps.addResolvingPromise(e.promise))}};return r=(0,n.Cg)([(0,l.$)("esri.core.Promise")],r),r},c=u(i.A)},14607(e,t,r){r.d(t,{B:()=>u,GP:()=>l,qg:()=>c});var n=r(799),i=r(73444);const s={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],no:[","," "],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function o(e=(0,i.JK)()){let t=(e=e.toLowerCase())in s;if(!t){const r=e.split("-");r.length>1&&r[0]in s&&(e=r[0],t=!0),t||(e="en")}const[r,n,o="#,##0.###"]=s[e];return{decimal:r,group:n,pattern:o}}function l(e,t){const r=o((t={...t}).locale);t.customs=r;const n=t.pattern||r.pattern;return isNaN(e)||Math.abs(e)===1/0?null:function(e,t,r){const n=(r=r||{}).customs.group,i=r.customs.decimal,s=t.split(";"),o=s[0];if((t=s[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const l=a,u=o.match(l);if(!u)throw new Error("unable to find a number expression in pattern: "+t);return!1===r.fractional&&(r.places=0),t.replace(l,function(e,t,r){!0===(r=r||{}).places&&(r.places=0),r.places===1/0&&(r.places=6);const n=t.split("."),i="string"==typeof r.places&&r.places.indexOf(",");let s=r.places;i?s=r.places.slice(i+1):+s>=0||(s=(n[1]||[]).length),r.round<0||(e=Number(e.toFixed(Number(s))));const o=String(Math.abs(e)).split("."),l=o[1]||"";if(n[1]||r.places){i&&(r.places=r.places.slice(0,Math.max(0,i)));const e=void 0!==r.places?r.places:n[1]&&n[1].lastIndexOf("0")+1;+e>l.length&&(o[1]=l.padEnd(Number(e),"0")),+s<l.length&&(o[1]=l.slice(0,Math.max(0,Number(s))))}else o[1]&&o.pop();const a=n[0].replace(",","");let u=a.indexOf("0");-1!==u&&(u=a.length-u,u>o[0].length&&(o[0]=o[0].padStart(u,"0")),a.includes("#")||(o[0]=o[0].slice(-u)));let c,p,d=n[0].lastIndexOf(",");if(-1!==d){c=n[0].length-d-1;const e=n[0].slice(0,d);d=e.lastIndexOf(","),-1!==d&&(p=e.length-d-1)}const h=[];for(let e=o[0];e;){const t=e.length-c;h.push(t>0?e.slice(Math.max(0,t)):e),e=t>0?e.slice(0,t):"",p&&(c=p,p=void 0)}return o[0]=h.reverse().join(r.group||","),o.join(r.decimal||".")}(e,u[0],{decimal:i,group:n,places:r.places,round:r.round}))}(e,n,t)}const a=/[#0,]*[#0](?:\.0*#*)?/;function u(e){const t=o((e=e||{}).locale),r=e.pattern||t.pattern,i=t.group,s=t.decimal;let l=1;if(r.includes("%"))l/=100;else if(r.includes("‰"))l/=1e3;else if(r.includes("¤"))throw new Error("currency notation not supported");const u=r.split(";");1===u.length&&u.push("-"+u[0]);const c=d(u,t=>(t="(?:"+(0,n.Cj)(t,".")+")").replace(a,t=>{const r={signed:!1,separator:e.strict?i:[i,""],fractional:e.fractional,decimal:s,exponent:!1},n=t.split(".");let o=e.places;1===n.length&&1!==l&&(n[1]="###"),1===n.length||0===o?r.fractional=!1:(void 0===o&&(o=e.pattern?n[1].lastIndexOf("0")+1:1/0),o&&null==e.fractional&&(r.fractional=!0),!e.places&&+o<n[1].length&&(o+=","+n[1].length),r.places=o);const a=n[0].split(",");return a.length>1&&(r.groupSize=a.pop().length,a.length>1&&(r.groupSize2=a.pop().length)),"("+function(e){"places"in(e=e||{})||(e.places=1/0),"string"!=typeof e.decimal&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=p(e),r=d(e.fractional,t=>{let r="";return t&&0!==e.places&&(r="\\"+e.decimal,e.places===1/0?r="(?:"+r+"\\d+)?":r+="\\d{"+e.places+"}"),r},!0);let n=t+r;return r&&(n="(?:(?:"+n+")|(?:"+r+"))"),n+d(e.exponent,t=>t?"([eE]"+p({signed:e.eSigned})+")":"")}(r)+")"}),!0);return{regexp:c.replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:i,decimal:s,factor:l}}function c(e,t){const r=u(t),n=new RegExp("^"+r.regexp+"$").exec(e);if(!n)return NaN;let i=n[1];if(!n[1]){if(!n[2])return NaN;i=n[2],r.factor*=-1}return i=i.replaceAll(new RegExp("["+r.group+"\\s\\xa0]","g"),"").replace(r.decimal,"."),Number(i)*r.factor}function p(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",d(e.signed,e=>e?"[-+]":"",!0)+d(e.separator,t=>{if(!t)return"(?:\\d+)";" "===(t=(0,n.Cj)(t))?t="\\s":" "===t&&(t="\\s\\xa0");const r=e.groupSize,i=e.groupSize2;if(i){const e="(?:0|[1-9]\\d{0,"+(i-1)+"}(?:["+t+"]\\d{"+i+"})*["+t+"]\\d{"+r+"})";return r-i>0?"(?:"+e+"|(?:0|[1-9]\\d{0,"+(r-1)+"}))":e}return"(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+t+"]\\d{"+r+"})*)"},!0)}const d=(e,t,r)=>{if(!Array.isArray(e))return t(e);const n=[];for(let r=0;r<e.length;r++)n.push(t(e[r]));return h(n.join("|"),Boolean(r))},h=(e,t)=>"("+(t?"?:":"")+e+")"},60408(e,t,r){function n(e){return void 0!==e.xmin&&void 0!==e.ymin&&void 0!==e.xmax&&void 0!==e.ymax}function i(e){return void 0!==e.points}function s(e){return void 0!==e.x&&void 0!==e.y}function o(e){return void 0!==e.paths||void 0!==e.curvePaths}function l(e){return void 0!==e.rings||void 0!==e.curveRings}function a(e){return"object"==typeof e&&"vertexAttributes"in e}function u(e){return e?s(e)?"esriGeometryPoint":o(e)?"esriGeometryPolyline":l(e)?"esriGeometryPolygon":n(e)?"esriGeometryEnvelope":i(e)?"esriGeometryMultipoint":null:null}function c(e){return null!=e&&("hasZ"in e&&e.hasZ||"z"in e&&null!=e.z)}function p(e){return null!=e&&("hasM"in e&&e.hasM||"m"in e&&null!=e.m)}r.d(t,{$B:()=>u,Bi:()=>l,Pv:()=>c,Rg:()=>o,U9:()=>i,W0:()=>p,ZC:()=>n,fT:()=>s,uW:()=>a})},65864(e,t,r){r.d(t,{rS:()=>c,xD:()=>d});var n=r(5443),i=r(91075),s=r(48526),o=r(86738),l=r(39829),a=r(82799),u=r(60408);function c(e){return null==e?null:e instanceof i.A?e:(0,u.fT)(e)?o.A.fromJSON(e):(0,u.Rg)(e)?a.A.fromJSON(e):(0,u.Bi)(e)?l.A.fromJSON(e):(0,u.U9)(e)?s.A.fromJSON(e):(0,u.ZC)(e)?n.A.fromJSON(e):null}const p={esriGeometryPoint:o.A,esriGeometryPolyline:a.A,esriGeometryPolygon:l.A,esriGeometryEnvelope:n.A,esriGeometryMultipoint:s.A,esriGeometryMultiPatch:l.A};function d(e){return e&&p[e]||null}},39357(e,t,r){r.d(t,{A:()=>l});var n,i=r(5482),s=r(25482),o=r(91429);let l=n=class extends s.o{constructor(e){super(e),this.name=null,this.code=null}clone(){return new n({name:this.name,code:this.code})}};(0,i.Cg)([(0,o.MZ)({type:String,json:{write:{isRequired:!0}}})],l.prototype,"name",void 0),(0,i.Cg)([(0,o.MZ)({type:[String,Number],json:{write:{isRequired:!0}}})],l.prototype,"code",void 0),l=n=(0,i.Cg)([(0,o.$K)("esri.layers.support.CodedValue")],l)},53177(e,t,r){r.d(t,{A:()=>c});var n,i=r(5482),s=r(4718),o=r(91429),l=r(39357),a=r(76357),u=r(93223);let c=class extends a.A{static{n=this}constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const r=String(e);this.codedValues.some(e=>(String(e.code)===r&&(t=e.name),!!t))}return t}clone(){return new n({codedValues:(0,s.o8)(this.codedValues),name:this.name})}};(0,i.Cg)([(0,o.MZ)({type:[l.A],json:{write:{isRequired:!0}}})],c.prototype,"codedValues",void 0),(0,i.Cg)([(0,u.e)({codedValue:"coded-value"})],c.prototype,"type",void 0),c=n=(0,i.Cg)([(0,o.$K)("esri.layers.support.CodedValueDomain")],c)},76357(e,t,r){r.d(t,{A:()=>u});var n=r(5482),i=r(66552),s=r(25482),o=r(91429),l=r(93223);const a=new i.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let u=class extends s.o{constructor(e){super(e),this.name=null,this.type=null}};(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],u.prototype,"name",void 0),(0,n.Cg)([(0,l.e)(a),(0,o.MZ)({json:{write:{isRequired:!0}}})],u.prototype,"type",void 0),u=(0,n.Cg)([(0,o.$K)("esri.layers.support.Domain")],u)},20437(e,t,r){r.d(t,{A:()=>y});var n,i=r(5482),s=r(66552),o=r(25482),l=r(91429),a=r(56507),u=r(8631),c=r(98453),p=r(36005),d=r(93223);const h=new s.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let y=class extends o.o{static{n=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?.value??null}readValueType(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?h.fromJSON(r.fieldValueType):null}clone(){return new n({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"alias",void 0),(0,i.Cg)([(0,l.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],y.prototype,"defaultValue",void 0),(0,i.Cg)([(0,l.MZ)()],y.prototype,"description",void 0),(0,i.Cg)([(0,p.w)("description")],y.prototype,"readDescription",null),(0,i.Cg)([(0,l.MZ)({types:u.g,json:{read:{reader:u.r},write:!0}})],y.prototype,"domain",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"editable",void 0),(0,i.Cg)([(0,l.MZ)({type:a.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],y.prototype,"length",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"name",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"nullable",void 0),(0,i.Cg)([(0,d.e)(c.m)],y.prototype,"type",void 0),(0,i.Cg)([(0,l.MZ)()],y.prototype,"valueType",void 0),(0,i.Cg)([(0,p.w)("valueType",["description"])],y.prototype,"readValueType",null),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{read:!1}})],y.prototype,"visible",void 0),y=n=(0,i.Cg)([(0,l.$K)("esri.layers.support.Field")],y)},41628(e,t,r){r.d(t,{A:()=>a});var n,i=r(5482),s=r(91429),o=r(76357),l=r(93223);let a=class extends o.A{static{n=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new n({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,i.Cg)([(0,s.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]},isRequired:!0}}})],a.prototype,"maxValue",void 0),(0,i.Cg)([(0,s.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]},isRequired:!0}}})],a.prototype,"minValue",void 0),(0,i.Cg)([(0,l.e)({range:"range"})],a.prototype,"type",void 0),a=n=(0,i.Cg)([(0,s.$K)("esri.layers.support.RangeDomain")],a)},8631(e,t,r){r.d(t,{r:()=>d,g:()=>p});var n,i=r(53177),s=r(76357),o=r(5482),l=r(91429),a=r(93223);let u=class extends s.A{static{n=this}constructor(e){super(e),this.type="inherited"}clone(){return new n}};(0,o.Cg)([(0,a.e)({inherited:"inherited"})],u.prototype,"type",void 0),u=n=(0,o.Cg)([(0,l.$K)("esri.layers.support.InheritedDomain")],u);var c=r(41628);const p={key:"type",base:s.A,typeMap:{range:c.A,"coded-value":i.A,inherited:u}};function d(e){if(!e?.type)return null;switch(e.type){case"range":return c.A.fromJSON(e);case"codedValue":return i.A.fromJSON(e);case"inherited":return u.fromJSON(e)}return null}},98453(e,t,r){r.d(t,{m:()=>n});const n=new(r(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},20655(e,t,r){r.d(t,{A:()=>N});var n=r(5482),i=r(92602),s=r(70333),o=r(11254),l=r(49186),a=r(44208),u=r(25482),c=r(92474),p=r(97768),d=r(17676),h=r(91429),y=r(56507),f=r(5443),m=r(73444);let g;var v=r(96360),C=r(16405),S=r(69622);let b=class extends S.A{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};(0,n.Cg)([(0,h.MZ)()],b.prototype,"nextQueryParams",void 0),(0,n.Cg)([(0,h.MZ)()],b.prototype,"queryParams",void 0),(0,n.Cg)([(0,h.MZ)()],b.prototype,"results",void 0),(0,n.Cg)([(0,h.MZ)()],b.prototype,"total",void 0),b=(0,n.Cg)([(0,h.$K)("esri.portal.PortalQueryResult")],b);var M,Z=r(41318),A=r(926),T=r(36005);let O;const w={PortalGroup:()=>Promise.resolve({default:v.A}),PortalItem:()=>r.e(812).then(r.bind(r,80812)),PortalUser:()=>Promise.resolve({default:Z.A})};let N=class extends((0,u.T)(c.x_)){static{M=this}static{this.AUTH_MODE_ANONYMOUS="anonymous"}static{this.AUTH_MODE_AUTO="auto"}static{this.AUTH_MODE_IMMEDIATE="immediate"}static{this.AUTH_MODE_NO_PROMPT="no-prompt"}constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.g3DTilesGalleryGroupQuery=null,this.g3dTilesEnabled=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.default3DBasemapQuery=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.hasClassificationSchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.recycleBinEnabled=!1,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=i.A.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useDefault3dBasemap=!1,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e}destroy(){P.unregister(this),this.defaultBasemap=(0,p.pR)(this.defaultBasemap),this.defaultDevBasemap=(0,p.pR)(this.defaultDevBasemap),this.defaultVectorBasemap=(0,p.pR)(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=(0,p.xt)(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const t of e)i.A.request.trustedServers.includes(t)||i.A.request.trustedServers.push(t);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){const e=this.user?.orgId,t=!e||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get hasAPIKey(){return(0,A.Jn)(this.restUrl)}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get loaded(){return super.loaded}get restUrl(){let e=this.url;if(e){const t=e.indexOf("/sharing");e=t>0?e.slice(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e?e.toLowerCase():e}readUser(e){let t=null;return e&&(t=Z.A.fromJSON(e),t.portal=this),t}load(e){const t=Promise.all([r.e(812),r.e(3116)]).then(r.bind(r,83116)).then(({default:t})=>{(0,d.Te)(e),O=t}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,e)).then(e=>{if(!this.hasAPIKey&&s.id){const e=s.id;this.credential=e.findCredential(this.restUrl),this.credential||this.authMode!==M.AUTH_MODE_AUTO&&this.authMode!==M.AUTH_MODE_NO_PROMPT||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=e.on("credential-create",function(e){const t=s.id;return()=>{const r=e.deref();r&&t.findCredential(r.restUrl)&&r.signIn().catch(()=>{})}}(new WeakRef(this))),P.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=e,this.read(e)});return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService("defaultElevationLayers"),t=(await Promise.all([r.e(3508),r.e(9953),r.e(812),r.e(9186),r.e(2369),r.e(7716)]).then(r.bind(r,62369))).default;return e?e.map(e=>new t({id:e.id,url:e.url})):[]}async fetchBasemaps(e,t){const r=await this._fetchBasemaps(e,t);if(!0===t?.include3d&&!1!==this.use3dBasemaps){if(this.g3dTilesEnabled&&this.g3DTilesGalleryGroupQuery&&(0,a.A)("enable-feature:basemap-groundlayers")){const e=await this._fetchBasemaps3D(this.g3DTilesGalleryGroupQuery,t);r.unshift(...e)}const n=await this._fetchBasemaps3D(e,t);r.unshift(...n)}return r}async fetchDefault3DBasemap(e){if(!this.useDefault3dBasemap||!this.default3DBasemapQuery||"none"===this.default3DBasemapQuery)return null;const t=new C.A;t.query=this.default3DBasemapQuery,t.disableExtraQuery=!0;const r=(await this.queryItems(t,e)).results.find(e=>"Web Scene"===e.type);return r?new O({portalItem:r}):null}fetchCategorySchema(e){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",e).then(e=>e.categorySchema):(0,d.G4)(e)?Promise.reject((0,d.NK)()):Promise.resolve([])}async fetchClassificationSchema(e){return this.hasClassificationSchema?this.request(this.restUrl+"/portals/self/classification/classificationSchema",e).then(e=>e.classificationSchema):null}fetchFeaturedGroups(e){const t=this.featuredGroups,r=new C.A({num:100,sortField:"title"});if(t?.length){const n=[];for(const e of t)n.push(`(title:"${e.title}" AND owner:${e.owner})`);return r.query=n.join(" OR "),this.queryGroups(r,e).then(e=>e.results)}return(0,d.G4)(e)?Promise.reject((0,d.NK)()):Promise.resolve([])}fetchRegions(e){const t=this.user?.culture||this.culture||(0,m.JK)();return this.request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){const t=this.user?.culture||this.culture||(0,m.JK)();return this.request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return g&&!g.destroyed||(g=new M),g}queryGroups(e,t){return this.queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this.queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||(e.sortField="username"),this.queryPortal("/community/users",e,"PortalUser",t)}fetchSelf(e=this.authMode,t=!1,r){const n=this.restUrl+"/portals/self",i={authMode:e,query:{culture:(0,m.JK)().toLowerCase()},withCredentials:!0,...r};return"auto"===i.authMode&&(i.authMode="no-prompt"),t&&(i.query.default=!0),this.request(n,i)}queryPortal(e,t,r,n){const i=(0,y.dp)(C.A,t),s=t=>this.request(this.restUrl+e,{...i.toRequestOptions(this),...n}).then(e=>{const r=i.clone();return r.start=e.nextStart,new b({nextQueryParams:r,queryParams:i,total:e.total,results:M._resultsToTypedArray(t,{portal:this},e,n)})}).then(e=>Promise.all(e.results.map(t=>"function"==typeof t.when?t.when():e)).then(()=>e,t=>((0,d.QP)(t),e)));return r&&w[r]?w[r]().then(({default:e})=>((0,d.Te)(n),s(e))):s()}signIn(){if(this.hasAPIKey)return this.load().then(()=>{if(!this.user)throw new l.A("portal:not-authenticated","Unable to authenticate user. Portal.user is missing")});if(this.authMode===M.AUTH_MODE_ANONYMOUS||this.authMode===M.AUTH_MODE_NO_PROMPT&&!s.id)return Promise.reject(new l.A("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if("failed"===this.loadStatus)return Promise.reject(this.loadError);const e=e=>Promise.resolve().then(()=>"not-loaded"===this.loadStatus?(e||(this.authMode="immediate"),this.load().then(()=>null)):"loading"===this.loadStatus?this.load().then(()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate"))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate"))).then(e=>{e&&(this.sourceJSON=e,this.read(e))});return s.id?s.id.getCredential(this.restUrl,{prompt:this.authMode!==M.AUTH_MODE_NO_PROMPT}).then(t=>e(t)):e(this.credential)}normalizeUrl(e){const t=this.credential?.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}requestToTypedArray(e,t,r){return this.request(e,t).then(e=>{const t=M._resultsToTypedArray(r,{portal:this},e);return Promise.all(t.map(t=>"function"==typeof t.when?t.when():e)).then(()=>t,()=>t)})}request(e,t={}){const r={f:"json",...t.query},{authMode:n=(this.authMode===M.AUTH_MODE_ANONYMOUS||this.authMode===M.AUTH_MODE_NO_PROMPT?this.authMode:"auto"),body:i=null,cacheBust:s=!1,method:l="auto",responseType:a="json",signal:u}=t,c={authMode:n,body:i,cacheBust:s,method:l,query:r,responseType:a,timeout:0,signal:u};return t.withCredentials&&(c.withCredentials=!0),(0,o.A)(this._normalizeSSL(e),c).then(e=>e.data)}toJSON(){throw new l.A("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new M({sourceJSON:e})}_getHelperService(e){const t=this.helperServices?.[e];if(!t)throw new l.A("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}async _fetchBasemaps(e,t){const r=new C.A;r.query=e||((0,A.Dd)()?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),r.disableExtraQuery=!0;const n=await this.queryGroups(r,t);if(!n.total)return[];const i=n.results[0];r.num=100,r.query='type:"Web Map" -type:"Web Application"',r.sortField=i.sortField||"name",r.sortOrder=i.sortOrder||"desc";const s=await i.queryItems(r,t);return s.total?s.results.filter(e=>"Web Map"===e.type).map(e=>new O({portalItem:e})):[]}async _fetchBasemaps3D(e,t){const r=e||this.basemapGalleryGroupQuery3D;if(!r)return[];if((0,A.Dd)())return[];const n=new C.A({query:r,disableExtraQuery:!0}),i=await this.queryGroups(n,t);if(!i.total)return[];const s=i.results[0];n.num=100,n.query='type:"Web Scene"',n.sortField=s.sortField||"name",n.sortOrder=s.sortOrder||"desc";const o=await s.queryItems(n,t);return o.total?o.results.filter(e=>"Web Scene"===e.type).map(e=>new O({portalItem:e})):[]}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(e){if(e){const t=O.fromJSON(e);return t.portalItem={portal:this},t}return null}static _resultsToTypedArray(e,t,r,n){let i;if(r){const s=null!=n?n.signal:null;i=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(e||t)&&(i=i.map(r=>{const n=Object.assign(e?e.fromJSON(r):r,t);return"function"==typeof n.load&&n.load(s),n}))}else i=[];return i}};(0,n.Cg)([(0,h.MZ)()],N.prototype,"access",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"allSSL",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"authMode",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"authorizedCrossOriginDomains",void 0),(0,n.Cg)([(0,T.w)("authorizedCrossOriginDomains")],N.prototype,"readAuthorizedCrossOriginDomains",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"basemapGalleryGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)({json:{name:"3DBasemapGalleryGroupQuery"}})],N.prototype,"basemapGalleryGroupQuery3D",void 0),(0,n.Cg)([(0,h.MZ)({json:{name:"g3DTilesGalleryGroupQuery"}})],N.prototype,"g3DTilesGalleryGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)({json:{name:"g3dTilesEnabled"}})],N.prototype,"g3dTilesEnabled",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"bingKey",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canListApps",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canListData",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canListPreProvisionedItems",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canProvisionDirectPurchase",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canSearchPublic",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canShareBingPublic",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canSharePublic",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canSignInArcGIS",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"canSignInIDP",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"colorSetsGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"commentsEnabled",void 0),(0,n.Cg)([(0,h.MZ)({type:Date})],N.prototype,"created",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"credential",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"culture",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"currentVersion",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"customBaseUrl",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"default3DBasemapQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"defaultBasemap",void 0),(0,n.Cg)([(0,T.w)("defaultBasemap")],N.prototype,"readDefaultBasemap",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"defaultDevBasemap",void 0),(0,n.Cg)([(0,T.w)("defaultDevBasemap")],N.prototype,"readDefaultDevBasemap",null),(0,n.Cg)([(0,h.MZ)({type:f.A})],N.prototype,"defaultExtent",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"defaultVectorBasemap",void 0),(0,n.Cg)([(0,T.w)("defaultVectorBasemap")],N.prototype,"readDefaultVectorBasemap",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"description",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"devBasemapGalleryGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"eueiEnabled",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"extraQuery",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"featuredGroups",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"featuredItemsGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"galleryTemplatesGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"layoutGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"livingAtlasGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"hasAPIKey",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"hasCategorySchema",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"hasClassificationSchema",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"helpBase",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"helperServices",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"helpMap",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"homePageFeaturedContent",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"homePageFeaturedContentCount",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"httpPort",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"httpsPort",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"id",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"ipCntryCode",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"isOrganization",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"isPortal",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"isReadOnly",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"itemPageUrl",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"layerTemplatesGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"maxTokenExpirationMinutes",void 0),(0,n.Cg)([(0,h.MZ)({type:Date})],N.prototype,"modified",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"name",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"portalHostname",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"portalMode",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"portalProperties",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"region",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"recycleBinEnabled",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"restUrl",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"rotatorPanels",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"showHomePageDescription",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"sourceJSON",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"staticImagesUrl",void 0),(0,n.Cg)([(0,h.MZ)({json:{name:"2DStylesGroupQuery"}})],N.prototype,"stylesGroupQuery2d",void 0),(0,n.Cg)([(0,h.MZ)({json:{name:"stylesGroupQuery"}})],N.prototype,"stylesGroupQuery3d",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"supportsHostedServices",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"symbolSetsGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"templatesGroupQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"thumbnail",void 0),(0,n.Cg)([(0,h.MZ)({readOnly:!0})],N.prototype,"thumbnailUrl",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"units",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"url",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"urlKey",void 0),(0,n.Cg)([(0,T.w)("urlKey")],N.prototype,"readUrlKey",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"user",void 0),(0,n.Cg)([(0,T.w)("user")],N.prototype,"readUser",null),(0,n.Cg)([(0,h.MZ)()],N.prototype,"use3dBasemaps",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"useDefault3dBasemap",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"useStandardizedQuery",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"useVectorBasemaps",void 0),(0,n.Cg)([(0,h.MZ)()],N.prototype,"vectorBasemapGalleryGroupQuery",void 0),N=M=(0,n.Cg)([(0,h.$K)("esri.portal.Portal")],N);const P=new FinalizationRegistry(e=>{e.remove()})},96360(e,t,r){r.d(t,{A:()=>c});var n,i=r(5482),s=r(49186),o=r(25482),l=r(91429),a=r(56507),u=r(16405);let c=n=class extends o.o{constructor(e){super(e),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.sourceJSON=null,this.tags=null,this.title=null}get thumbnailUrl(){const e=this.url,t=this.thumbnail;return e&&t&&this.portal?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`):null}get url(){const e=this.portal?.restUrl;return e?e+"/community/groups/"+this.id:null}fetchCategorySchema(e){return this.portal.request(this.url+"/categorySchema",e).then(t=>{const r=t.categorySchema||[];return r.some(e=>"contentCategorySetsGroupQuery.LivingAtlas"===e.source)?this._fetchCategorySchemaSet("LivingAtlas",e):r})}fetchMembers(e){return this.portal.request(this.url+"/users",e)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}toJSON(){throw new s.A("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const t=new n({sourceJSON:e});return t.read(e),t}queryItems(e,t){let r=(0,a.dp)(u.A,e);const n=this.portal;return parseFloat(n.currentVersion)>5?(r=r||new u.A,n.queryPortal(`/content/groups/${this.id}/search`,r,"PortalItem",t)):(r=r?r.clone():new u.A,r.query="group:"+this.id+(r.query?" "+r.query:""),n.queryItems(r,t))}_fetchCategorySchemaSet(e,t){const r=this.portal;return r.fetchSelf(r.authMode,!0,t).then(e=>{const n=e.contentCategorySetsGroupQuery;if(n){const e=new u.A({disableExtraQuery:!0,num:1,query:n});return r.queryGroups(e,t)}throw new s.A("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(r=>{if(r.total){const n=r.results[0],i=new u.A({num:1,query:`typekeywords:"${e}"`});return n.queryItems(i,t)}throw new s.A("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(e=>e.total?e.results[0].fetchData("json",t).then(e=>{const t=e?.categorySchema;return t?.length?t:[]}):[])}};(0,i.Cg)([(0,l.MZ)()],c.prototype,"access",void 0),(0,i.Cg)([(0,l.MZ)({type:Date})],c.prototype,"created",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"description",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"id",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"isInvitationOnly",void 0),(0,i.Cg)([(0,l.MZ)({type:Date})],c.prototype,"modified",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"owner",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"portal",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"snippet",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"sortField",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"sortOrder",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"sourceJSON",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"tags",void 0),(0,i.Cg)([(0,l.MZ)()],c.prototype,"thumbnail",void 0),(0,i.Cg)([(0,l.MZ)({readOnly:!0})],c.prototype,"thumbnailUrl",null),(0,i.Cg)([(0,l.MZ)()],c.prototype,"title",void 0),(0,i.Cg)([(0,l.MZ)({readOnly:!0})],c.prototype,"url",null),c=n=(0,i.Cg)([(0,l.$K)("esri.portal.PortalGroup")],c)},16405(e,t,r){r.d(t,{A:()=>h});var n,i=r(5482),s=r(69622),o=r(66552),l=r(4718),a=r(91429),u=r(5443),c=r(16930),p=r(28735);const d=new o.J({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let h=n=class extends s.A{constructor(e){super(e),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(e){"asc"!==e&&"desc"!==e||this._set("sortOrder",e)}clone(){return new n({categories:this.categories?(0,l.o8)(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(e,t){let r=[];this.categories&&(r=this.categories.map(e=>Array.isArray(e)?JSON.stringify(e):e));let n="";if(this.extent){const e=(0,p.Cv)(this.extent,c.A.WGS84);null!=e&&(n=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`)}let i=this.query;!this.disableExtraQuery&&e.extraQuery&&(i="("+i+")"+e.extraQuery);const s={categories:r,bbox:n,q:i,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(s.sortField=this.sortField.split(",").map(e=>d.toJSON(e.trim())).join(","),s.sortOrder=this.sortOrder),{query:{...t,...s}}}};(0,i.Cg)([(0,a.MZ)()],h.prototype,"categories",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"disableExtraQuery",void 0),(0,i.Cg)([(0,a.MZ)({type:u.A})],h.prototype,"extent",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"filter",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"num",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"query",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"sortField",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"sortOrder",null),(0,i.Cg)([(0,a.MZ)()],h.prototype,"start",void 0),h=n=(0,i.Cg)([(0,a.$K)("esri.portal.PortalQueryParams")],h)},41318(e,t,r){r.d(t,{A:()=>c});var n=r(5482),i=r(49186),s=r(25482),o=r(91429);let l=class extends s.o{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const e=this.portal?.restUrl;return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new i.A("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};(0,n.Cg)([(0,o.MZ)({type:Date})],l.prototype,"created",void 0),(0,n.Cg)([(0,o.MZ)()],l.prototype,"id",void 0),(0,n.Cg)([(0,o.MZ)()],l.prototype,"portal",void 0),(0,n.Cg)([(0,o.MZ)()],l.prototype,"title",void 0),(0,n.Cg)([(0,o.MZ)({readOnly:!0})],l.prototype,"url",null),(0,n.Cg)([(0,o.MZ)()],l.prototype,"username",void 0),l=(0,n.Cg)([(0,o.$K)("esri.portal.PortalFolder")],l);var a,u=r(96360);let c=a=class extends s.o{constructor(e){super(e),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.id=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userLicenseTypeId=null,this.userType=null}get thumbnailUrl(){const e=this.url,t=this.thumbnail;return e&&t?this.portal.normalizeUrl(`${e}/info/${t}?f=json`):null}get userContentUrl(){const e=this.portal?.restUrl;return e?`${e}/content/users/${this.id}`:null}get url(){const e=this.portal?.restUrl;return e?`${e}/community/users/${this.id}`:null}addItem(e){const t=e&&e.item,r=e?.data,n=e?.folder,i={method:"post"};t&&(i.query=t.createPostQuery(),null!=r&&("string"==typeof r?i.query.text=r:"object"==typeof r&&(i.query.text=JSON.stringify(r))));let s=this.userContentUrl;return n&&(s+="/"+("string"==typeof n?n:n.id)),this.portal.request(s+"/addItem",i).then(e=>(t.id=e.id,t.portal=this.portal,t.loaded?t.reload():t.load()))}async deleteItem(e,t=!1){let r=this.userContentUrl;e.ownerFolder&&(r+="/"+e.ownerFolder);const n=t?{permanentDelete:!0}:{};await this.portal.request(r+`/items/${e.id}/delete`,{method:"post",query:n}),e.id=null,e.portal=null}async deleteItems(e,t=!1){e=e.slice();const r=this.userContentUrl+"/deleteItems",n=[],s=e.map(e=>e.id);if(s.length){const o={method:"post",query:{items:s.join(","),permanentDelete:t}},l=await this.portal.request(r,o);for(const t of l.results){const r=e.find(e=>t.itemId===e.id),s=t.success;let o=null;s?(r.id=null,r.portal=null):t.error&&(o=new i.A("portal:delete-item-failed",t.error.message,t.error)),n.push({item:r,success:s,error:o})}}return n}fetchFolders(){return this.portal.request(this.userContentUrl??"",{query:{num:1}}).then(e=>{let t;return t=e&&e.folders?e.folders.map(e=>{const t=l.fromJSON(e);return t.portal=this.portal,t}):[],t})}fetchGroups(){return this.portal.request(this.url??"").then(e=>{let t;return t=e&&e.groups?e.groups.map(e=>{const t=u.A.fromJSON(e);return t.portal=this.portal,t}):[],t})}async fetchItems(e){e??={};let t=this.userContentUrl??"";e.folder&&(t+="/"+e.folder.id);const{default:n}=await r.e(812).then(r.bind(r,80812)),i={folders:!1,inRecycleBin:!!e.inRecycleBin||null,foldersContent:!(e.folder||!e.includeSubfolderItems)||null,num:e.num||10,start:e.start||1,sortField:e.sortField||"created",sortOrder:e.sortOrder||"asc"},s=await this.portal.request(t,{query:i});let o;return s?.items?(o=s.items.map(e=>{const t=n.fromJSON(e);return t.portal=this.portal,t}),await Promise.all(o.map(e=>e.load())),{items:o,nextStart:s.nextStart,total:s.total}):{items:[],nextStart:-1,total:0}}fetchTags(){return this.portal.request(this.url+"/tags").then(e=>e.tags)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}queryFavorites(e){return this.favGroupId?(this._favGroup||(this._favGroup=new u.A({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(e)):Promise.reject(new i.A("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}async restoreItem(e,t){const r=this.userContentUrl,n=t?{folderID:"string"==typeof t?t:t.id}:null;await this.portal.request(r+`/items/${e.id}/restore`,{method:"post",query:n})}toJSON(){throw new i.A("internal:not-yet-implemented","PortalUser.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const t=new a({sourceJSON:e});return t.read(e),t}};(0,n.Cg)([(0,o.MZ)()],c.prototype,"access",void 0),(0,n.Cg)([(0,o.MZ)({type:Date})],c.prototype,"created",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"culture",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"description",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"email",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"favGroupId",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"fullName",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"id",void 0),(0,n.Cg)([(0,o.MZ)({type:Date})],c.prototype,"modified",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"orgId",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"portal",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"preferredView",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"privileges",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"region",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"role",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"roleId",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"sourceJSON",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"thumbnail",void 0),(0,n.Cg)([(0,o.MZ)({readOnly:!0})],c.prototype,"thumbnailUrl",null),(0,n.Cg)([(0,o.MZ)()],c.prototype,"units",void 0),(0,n.Cg)([(0,o.MZ)({readOnly:!0})],c.prototype,"userContentUrl",null),(0,n.Cg)([(0,o.MZ)({readOnly:!0})],c.prototype,"url",null),(0,n.Cg)([(0,o.MZ)()],c.prototype,"username",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"userLicenseTypeId",void 0),(0,n.Cg)([(0,o.MZ)()],c.prototype,"userType",void 0),c=a=(0,n.Cg)([(0,o.$K)("esri.portal.PortalUser")],c)},2272(e,t,r){r.d(t,{Dl:()=>u,gf:()=>p,jV:()=>a,lF:()=>c});var n=r(92602),i=r(70333),s=r(4718),o=r(84952),l=r(926);function a(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function u(e){return"string"==typeof e?(0,o.An)(e):(0,s.o8)(e)}function c(e,t,r){const n={};for(const i in e){if("declaredClass"===i)continue;const s=e[i];if(null!=s&&"function"!=typeof s)if(Array.isArray(s))n[i]=s.map(e=>c(e));else if("object"==typeof s)if(s.toJSON){const e=s.toJSON(r?.[i]);n[i]=t?e:JSON.stringify(e)}else n[i]=t?s:JSON.stringify(s);else n[i]=s}return n}async function p(e,t,s){const o=function(e,t){return e?t&&(0,l.Qc)(e)?t:(0,l.getApiKey)(e)??i.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!i.id&&n.A.request.useIdentity&&await Promise.all([r.e(7632),r.e(692),r.e(148)]).then(r.bind(r,50148));const a=await i.id.getCredential(e,s);return a?.token}},926(e,t,r){r.d(t,{Dd:()=>d,Jn:()=>h,Qc:()=>y,getApiKey:()=>c,getSessionToken:()=>p});var n=r(92602),i=r(11254),s=r(84952);const o=/^https?:\/\/(i?basemaps|basemapstyles)-api\.arcgis\.com\//i,l=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]),a=new Map;let u=null;function c(e){if(!y(e))return null;const t=t=>t instanceof RegExp?t.test(e):"string"==typeof t&&e.startsWith(t),r=n.A.apiKeys;if(Array.isArray(r.scopes))for(const e of r.scopes)if(Array.isArray(e.urls)){if(e.urls.some(t))return e.token}else if(t(e.urls))return e.token;return r.basemapStyles&&o.test(e)?r.basemapStyles:n.A.apiKey&&/^https?:\/\/.+\.arcgis\.com(\/|$)/i.test(e)?n.A.apiKey:null}async function p(e){if(!n.A.sessions?.basemap?.enabled||!o.test(e))return null;const t=c(e);if(!t)return null;u&&await u;const{styleFamily:r="arcgis",autoRefresh:s,duration:l=43200}=n.A.sessions.basemap,p=`${t}:${r}`,d=a.get(p);if(d&&(!s||d.endTime>Date.now()))return d.sessionToken;let h;u=(0,i.A)("https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/sessions/start",{cacheBust:!0,query:{durationSeconds:l,styleFamily:r,token:t}});try{h=(await u).data,h.endTime-=5e3,a.set(p,h)}finally{u=null}return h.sessionToken}function d(){return null!=n.A.apiKey||null!=n.A.apiKeys.basemapStyles}function h(e,t){return t?y(e):null!=c(e)}function y(e){const t=(0,s.$z)(e,!0);return!!t&&!l.has(t)&&!e.endsWith("/sharing/rest/generateToken")}},94128(e,t,r){r.d(t,{D:()=>i,Z:()=>n});const n=Symbol("GraphicInstance");function i(e){return null!=e&&"object"==typeof e&&n in e}}}]);
|